{"version":3,"file":"static/js/main.52955b6d.js","sources":["components/Alerts/AlertsContext.js","components/Alerts/AlertsReducer.js","components/AppContext/AppHooks.js","components/AppContext/AppReducer.js","components/AppContext/index.js","../node_modules/@mui/lab/LoadingButton/loadingButtonClasses.js","../node_modules/@mui/lab/LoadingButton/LoadingButton.js","components/Button/LoadingButton.tsx","components/Button/IconButton.tsx","components/Button/Button.tsx","components/CardItem.js","../node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js","../node_modules/state-local/lib/es/state-local.js","../node_modules/@monaco-editor/loader/lib/es/config/index.js","../node_modules/@monaco-editor/loader/lib/es/utils/isObject.js","../node_modules/@monaco-editor/loader/lib/es/validators/index.js","../node_modules/@monaco-editor/loader/lib/es/utils/curry.js","../node_modules/@monaco-editor/loader/lib/es/utils/compose.js","../node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js","../node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js","../node_modules/@monaco-editor/loader/lib/es/loader/index.js","../node_modules/@monaco-editor/react/src/MonacoContainer/styles.ts","../node_modules/@monaco-editor/react/src/Loading/styles.ts","../node_modules/@monaco-editor/react/src/Loading/Loading.tsx","../node_modules/@monaco-editor/react/src/Loading/index.ts","../node_modules/@monaco-editor/react/src/MonacoContainer/MonacoContainer.tsx","../node_modules/@monaco-editor/react/src/MonacoContainer/index.ts","../node_modules/@monaco-editor/react/src/hooks/useMount/index.ts","../node_modules/@monaco-editor/react/src/hooks/useUpdate/index.ts","../node_modules/@monaco-editor/react/src/utils/index.ts","../node_modules/@monaco-editor/react/src/DiffEditor/DiffEditor.tsx","../node_modules/@monaco-editor/react/src/DiffEditor/index.ts","../node_modules/@monaco-editor/react/src/hooks/usePrevious/index.ts","../node_modules/@monaco-editor/react/src/Editor/Editor.tsx","../node_modules/@monaco-editor/react/src/Editor/index.ts","components/CodeEditor.tsx","../node_modules/@mui/icons-material/esm/FirstPage.js","../node_modules/@mui/icons-material/esm/LastPage.js","../node_modules/@mui/icons-material/esm/ChevronLeft.js","../node_modules/@mui/icons-material/esm/ChevronRight.js","components/export/ExportTable.js","components/DataTable/SubHeader.tsx","components/DataTable/DataTable.tsx","components/DataTable/index.ts","components/ErrorList.tsx","../node_modules/@mui/material/ListItemAvatar/listItemAvatarClasses.js","../node_modules/@mui/material/ListItemAvatar/ListItemAvatar.js","hooks/useImageValidator.js","components/ImagePlaceholderPreview.js","components/FileList.js","components/Heading.tsx","components/Loading.tsx","components/LoadingDots.tsx","../node_modules/axios/index.js","components/LoanQueue/LoanQueueSearchFilters.tsx","components/LoanQueue/LoanQueueExpandedRow.tsx","components/LoanQueue/LoanQueueTypeLabel.tsx","components/Badge.tsx","components/LoanQueue/LoanQueueStatusBadge.tsx","forms/LoanQueueItemForm.tsx","components/LoanQueue/LoanQueueList.tsx","components/MailMergeSelect.js","components/MixPanel/MixPanelProvider.js","components/Page.tsx","components/PaginatedDataTable.js","components/RowExpandedProperty.tsx","components/SiteLogo.js","components/TabPanel.js","components/formControls/CodeEditorField.tsx","components/formControls/Form.tsx","components/formControls/RadioControl.js","components/formControls/RadioControlYesNo.js","components/formControls/Select.tsx","components/formControls/Switch.tsx","components/formControls/TextField.tsx","components/formControls/documentBucketAutocomplete/DocumentBucketAutocomplete.js","components/formControls/documentBucketAutocomplete/DocumentBucketAutocompleteField.js","components/formControls/FormControl.tsx","components/formControls/MoneyField.tsx","components/formControls/PercentField.tsx","components/formControls/Checkbox.tsx","components/formControls/CheckboxGroup.js","components/formControls/PhoneNumberField.js","components/formControls/WorkflowSelect.js","components/formControls/WorkflowCheckboxGroup.js","../node_modules/@mui/utils/refType/refType.js","../node_modules/@mui/x-date-pickers/internals/utils/views.js","../node_modules/@mui/x-date-pickers/internals/utils/date-utils.js","../node_modules/@mui/x-date-pickers/internals/utils/time-utils.js","../node_modules/@mui/x-date-pickers/internals/utils/getDefaultReferenceDate.js","../node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils.js","../node_modules/@mui/x-date-pickers/internals/utils/valueManagers.js","../node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider.js","../node_modules/@mui/x-date-pickers/locales/enUS.js","../node_modules/@mui/x-date-pickers/locales/utils/getPickersLocalization.js","../node_modules/@mui/x-date-pickers/internals/hooks/useUtils.js","../node_modules/@mui/x-date-pickers/node_modules/clsx/dist/clsx.mjs","../node_modules/@mui/x-date-pickers/internals/components/pickersToolbarClasses.js","../node_modules/@mui/x-date-pickers/internals/components/PickersToolbar.js","../node_modules/@mui/x-date-pickers/DatePicker/datePickerToolbarClasses.js","../node_modules/@mui/x-date-pickers/DatePicker/DatePickerToolbar.js","../node_modules/@mui/x-date-pickers/DatePicker/shared.js","../node_modules/@mui/x-date-pickers/internals/utils/validation/validateDate.js","../node_modules/@mui/x-date-pickers/internals/components/pickersPopperClasses.js","../node_modules/@mui/x-date-pickers/internals/utils/utils.js","../node_modules/@mui/x-date-pickers/internals/hooks/useDefaultReduceAnimations.js","../node_modules/@mui/x-date-pickers/internals/components/PickersPopper.js","../node_modules/@mui/x-date-pickers/internals/hooks/useValidation.js","../node_modules/@mui/x-date-pickers/internals/hooks/useValueWithTimezone.js","../node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerValue.js","../node_modules/@mui/x-date-pickers/internals/hooks/useOpenState.js","../node_modules/@mui/x-date-pickers/internals/hooks/useViews.js","../node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerViews.js","../node_modules/@mui/x-date-pickers/internals/hooks/useIsLandscape.js","../node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePicker.js","../node_modules/@mui/x-date-pickers/internals/utils/warning.js","../node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerLayoutProps.js","../node_modules/@mui/x-date-pickers/PickersLayout/pickersLayoutClasses.js","../node_modules/@mui/x-date-pickers/PickersActionBar/PickersActionBar.js","../node_modules/@mui/x-date-pickers/internals/constants/dimensions.js","../node_modules/@mui/x-date-pickers/PickersShortcuts/PickersShortcuts.js","../node_modules/@mui/x-date-pickers/PickersLayout/usePickerLayout.js","../node_modules/@mui/x-date-pickers/PickersLayout/PickersLayout.js","../node_modules/@mui/x-date-pickers/internals/hooks/useDesktopPicker/useDesktopPicker.js","../node_modules/@mui/x-date-pickers/icons/index.js","../node_modules/@mui/x-date-pickers/internals/hooks/useField/buildSectionsFromFormat.js","../node_modules/@mui/x-date-pickers/internals/hooks/useField/useFieldState.js","../node_modules/@mui/x-date-pickers/internals/hooks/useField/useFieldCharacterEditing.js","../node_modules/@mui/x-date-pickers/internals/hooks/useField/useFieldV7TextField.js","../node_modules/@mui/x-date-pickers/internals/hooks/useField/useFieldV6TextField.js","../node_modules/@mui/x-date-pickers/internals/utils/validation/extractValidationProps.js","../node_modules/@mui/x-date-pickers/internals/utils/fields.js","../node_modules/@mui/x-date-pickers/DateField/useDateField.js","../node_modules/@mui/x-date-pickers/internals/hooks/defaultizedFieldProps.js","../node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.js","../node_modules/@mui/x-date-pickers/hooks/useClearableField.js","../node_modules/@mui/x-date-pickers/PickersTextField/pickersTextFieldClasses.js","../node_modules/@mui/x-date-pickers/PickersTextField/PickersInputBase/pickersInputBaseClasses.js","../node_modules/@mui/x-date-pickers/PickersTextField/PickersOutlinedInput/pickersOutlinedInputClasses.js","../node_modules/@mui/x-date-pickers/PickersTextField/PickersOutlinedInput/Outline.js","../node_modules/@mui/x-date-pickers/PickersSectionList/pickersSectionListClasses.js","../node_modules/@mui/x-date-pickers/PickersSectionList/PickersSectionList.js","../node_modules/@mui/x-date-pickers/PickersTextField/PickersInputBase/PickersInputBase.js","../node_modules/@mui/x-date-pickers/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js","../node_modules/@mui/x-date-pickers/PickersTextField/PickersFilledInput/pickersFilledInputClasses.js","../node_modules/@mui/x-date-pickers/PickersTextField/PickersFilledInput/PickersFilledInput.js","../node_modules/@mui/x-date-pickers/PickersTextField/PickersInput/pickersInputClasses.js","../node_modules/@mui/x-date-pickers/PickersTextField/PickersInput/PickersInput.js","../node_modules/@mui/x-date-pickers/PickersTextField/PickersTextField.js","../node_modules/@mui/x-date-pickers/internals/utils/convertFieldResponseIntoMuiTextFieldProps.js","../node_modules/@mui/x-date-pickers/DateField/DateField.js","../node_modules/@mui/x-date-pickers/DateCalendar/useIsDateDisabled.js","../node_modules/@mui/x-date-pickers/DateCalendar/useCalendarState.js","../node_modules/@mui/x-date-pickers/DateCalendar/pickersFadeTransitionGroupClasses.js","../node_modules/@mui/x-date-pickers/DateCalendar/PickersFadeTransitionGroup.js","../node_modules/@mui/x-date-pickers/PickersDay/pickersDayClasses.js","../node_modules/@mui/x-date-pickers/PickersDay/PickersDay.js","../node_modules/dom-helpers/esm/removeClass.js","../node_modules/react-transition-group/esm/CSSTransition.js","../node_modules/dom-helpers/esm/addClass.js","../node_modules/dom-helpers/esm/hasClass.js","../node_modules/@mui/x-date-pickers/DateCalendar/pickersSlideTransitionClasses.js","../node_modules/@mui/x-date-pickers/DateCalendar/PickersSlideTransition.js","../node_modules/@mui/x-date-pickers/DateCalendar/dayCalendarClasses.js","../node_modules/@mui/x-date-pickers/DateCalendar/DayCalendar.js","../node_modules/@mui/x-date-pickers/MonthCalendar/pickersMonthClasses.js","../node_modules/@mui/x-date-pickers/MonthCalendar/PickersMonth.js","../node_modules/@mui/x-date-pickers/MonthCalendar/monthCalendarClasses.js","../node_modules/@mui/x-date-pickers/MonthCalendar/MonthCalendar.js","../node_modules/@mui/x-date-pickers/YearCalendar/pickersYearClasses.js","../node_modules/@mui/x-date-pickers/YearCalendar/PickersYear.js","../node_modules/@mui/x-date-pickers/YearCalendar/yearCalendarClasses.js","../node_modules/@mui/x-date-pickers/YearCalendar/YearCalendar.js","../node_modules/@mui/x-date-pickers/internals/components/PickersArrowSwitcher/pickersArrowSwitcherClasses.js","../node_modules/@mui/x-date-pickers/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js","../node_modules/@mui/x-date-pickers/PickersCalendarHeader/pickersCalendarHeaderClasses.js","../node_modules/@mui/x-date-pickers/PickersCalendarHeader/PickersCalendarHeader.js","../node_modules/@mui/x-date-pickers/internals/hooks/date-helpers-hooks.js","../node_modules/@mui/x-date-pickers/internals/components/PickerViewRoot/PickerViewRoot.js","../node_modules/@mui/x-date-pickers/DateCalendar/dateCalendarClasses.js","../node_modules/@mui/x-date-pickers/DateCalendar/DateCalendar.js","../node_modules/@mui/x-date-pickers/dateViewRenderers/dateViewRenderers.js","../node_modules/@mui/x-date-pickers/DesktopDatePicker/DesktopDatePicker.js","../node_modules/@mui/x-date-pickers/internals/components/PickersModalDialog.js","../node_modules/@mui/x-date-pickers/internals/hooks/useMobilePicker/useMobilePicker.js","../node_modules/@mui/x-date-pickers/MobileDatePicker/MobileDatePicker.js","../node_modules/@mui/x-date-pickers/DatePicker/DatePicker.js","../node_modules/@mui/x-date-pickers/AdapterMoment/AdapterMoment.js","components/formControls/DatePicker.js","components/formControls/FormRow.tsx","../node_modules/file-selector/node_modules/tslib/tslib.es6.mjs","../node_modules/file-selector/src/file.ts","../node_modules/file-selector/src/file-selector.ts","../node_modules/react-dropzone/dist/es/utils/index.js","../node_modules/react-dropzone/dist/es/index.js","components/formControls/FieldLabel.tsx","components/ImagePicker.js","components/formControls/ImagePickerField.js","components/Dropzone.js","components/formControls/DropzoneField.js","components/formControls/PasswordField.js","components/icons/TrueFalseIcon.tsx","components/layout/LayoutRow.tsx","components/layout/InnerPage.tsx","components/layout/LayoutCard.tsx","components/layout/LayoutRowGrid.tsx","components/modals/Dialog.tsx","components/modals/ModalByPhone.js","components/modals/ModalExportData.js","components/modals/ModalRemoveRestoreRecordConfirm.js","components/modals/ModalYesNo.tsx","components/versions/ActiveVersionAlert.js","components/withAuth.js","config.js","forms/NewVersionForm.js","hooks/useAlert.js","hooks/useWindowSize.js","hooks/useSiteConfig.js","../node_modules/@hookform/resolvers/src/validateFieldsNatively.ts","../node_modules/@hookform/resolvers/src/toNestErrors.ts","../node_modules/@hookform/resolvers/yup/src/yup.ts","hooks/useForm.tsx","hooks/useFormField.js","hooks/useLoanStatus.js","hooks/useMixpanel.js","hooks/usePagination.ts","hooks/useSearch.ts","hooks/useSearchText.js","hooks/useUser.ts","../node_modules/@matech/thebigpos-sdk/src/index.ts","lib/TheBigPOSClient.ts","pages/open/AppLinkCards.js","services/client.ts","services/constants.js","services/formattingUtils.js","services/helper.js","services/navigation.js","services/queryKeys.js","services/utils.js","services/yupValidation.js","../node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js","../node_modules/stylis/src/Utility.js","../node_modules/stylis/src/Tokenizer.js","../node_modules/stylis/src/Enum.js","../node_modules/stylis/src/Serializer.js","../node_modules/stylis/src/Parser.js","../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","../node_modules/stylis/src/Middleware.js","../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../node_modules/@emotion/react/dist/emotion-element-43c6fea0.browser.esm.js","../node_modules/@emotion/react/dist/emotion-react.browser.esm.js","../node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js","../node_modules/@emotion/hash/dist/emotion-hash.esm.js","../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js","../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","../node_modules/@formatjs/fast-memoize/lib/index.js","../node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","../node_modules/@formatjs/icu-skeleton-parser/lib/number.js","../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","../node_modules/@formatjs/icu-messageformat-parser/lib/index.js","../node_modules/@formatjs/intl/lib/src/error.js","../node_modules/@formatjs/intl/lib/src/utils.js","../node_modules/@icons/material/CheckIcon.js","../node_modules/@icons/material/UnfoldMoreHorizontalIcon.js","../node_modules/@microsoft/signalr/src/Errors.ts","../node_modules/@microsoft/signalr/src/HttpClient.ts","../node_modules/@microsoft/signalr/src/ILogger.ts","../node_modules/@microsoft/signalr/src/Loggers.ts","../node_modules/@microsoft/signalr/src/Utils.ts","../node_modules/@microsoft/signalr/src/FetchHttpClient.ts","../node_modules/@microsoft/signalr/src/DynamicImports.ts","../node_modules/@microsoft/signalr/src/XhrHttpClient.ts","../node_modules/@microsoft/signalr/src/DefaultHttpClient.ts","../node_modules/@microsoft/signalr/src/TextMessageFormat.ts","../node_modules/@microsoft/signalr/src/HandshakeProtocol.ts","../node_modules/@microsoft/signalr/src/IHubProtocol.ts","../node_modules/@microsoft/signalr/src/Subject.ts","../node_modules/@microsoft/signalr/src/MessageBuffer.ts","../node_modules/@microsoft/signalr/src/HubConnection.ts","../node_modules/@microsoft/signalr/src/DefaultReconnectPolicy.ts","../node_modules/@microsoft/signalr/src/HeaderNames.ts","../node_modules/@microsoft/signalr/src/AccessTokenHttpClient.ts","../node_modules/@microsoft/signalr/src/ITransport.ts","../node_modules/@microsoft/signalr/src/AbortController.ts","../node_modules/@microsoft/signalr/src/LongPollingTransport.ts","../node_modules/@microsoft/signalr/src/ServerSentEventsTransport.ts","../node_modules/@microsoft/signalr/src/WebSocketTransport.ts","../node_modules/@microsoft/signalr/src/HttpConnection.ts","../node_modules/@microsoft/signalr/src/JsonHubProtocol.ts","../node_modules/@microsoft/signalr/src/HubConnectionBuilder.ts","../node_modules/@mui/base/FocusTrap/FocusTrap.js","../node_modules/@mui/base/Portal/Portal.js","../node_modules/@mui/base/utils/appendOwnerState.js","../node_modules/@mui/base/utils/extractEventHandlers.js","../node_modules/@mui/base/utils/isHostComponent.js","../node_modules/@mui/base/node_modules/clsx/dist/clsx.mjs","../node_modules/@mui/base/utils/omitEventHandlers.js","../node_modules/@mui/base/utils/mergeSlotProps.js","../node_modules/@mui/base/utils/resolveComponentProps.js","../node_modules/@mui/base/utils/useSlotProps.js","../node_modules/@mui/icons-material/Add.js","../node_modules/@mui/icons-material/AddComment.js","../node_modules/@mui/icons-material/ArrowDropDown.js","../node_modules/@mui/icons-material/ArrowDropUp.js","../node_modules/@mui/icons-material/ArrowRight.js","../node_modules/@mui/icons-material/Brightness4.js","../node_modules/@mui/icons-material/Brightness7.js","../node_modules/@mui/icons-material/Cancel.js","../node_modules/@mui/icons-material/Chat.js","../node_modules/@mui/icons-material/Check.js","../node_modules/@mui/icons-material/CheckCircle.js","../node_modules/@mui/icons-material/Close.js","../node_modules/@mui/icons-material/CloudUploadOutlined.js","../node_modules/@mui/icons-material/Dangerous.js","../node_modules/@mui/icons-material/Delete.js","../node_modules/@mui/icons-material/Done.js","../node_modules/@mui/icons-material/Download.js","../node_modules/@mui/icons-material/DriveFolderUpload.js","../node_modules/@mui/icons-material/Error.js","../node_modules/@mui/icons-material/ExpandLess.js","../node_modules/@mui/icons-material/ExpandMore.js","../node_modules/@mui/icons-material/FileUploadOutlined.js","../node_modules/@mui/icons-material/Help.js","../node_modules/@mui/icons-material/HistoryEdu.js","../node_modules/@mui/icons-material/Home.js","../node_modules/@mui/icons-material/Image.js","../node_modules/@mui/icons-material/Info.js","../node_modules/@mui/icons-material/InsertDriveFile.js","../node_modules/@mui/icons-material/Lock.js","../node_modules/@mui/icons-material/LockOpen.js","../node_modules/@mui/icons-material/LockOutlined.js","../node_modules/@mui/icons-material/Menu.js","../node_modules/@mui/icons-material/MoreVert.js","../node_modules/@mui/icons-material/Search.js","../node_modules/@mui/icons-material/Visibility.js","../node_modules/@mui/icons-material/VisibilityOff.js","../node_modules/@mui/icons-material/Warning.js","../node_modules/@mui/icons-material/WarningRounded.js","../node_modules/@mui/icons-material/esm/Warning.js","../node_modules/@mui/icons-material/utils/createSvgIcon.js","../node_modules/@mui/utils/usePreviousProps/usePreviousProps.js","../node_modules/@mui/base/useAutocomplete/useAutocomplete.js","../node_modules/@mui/material/Autocomplete/autocompleteClasses.js","../node_modules/@mui/material/Autocomplete/Autocomplete.js","../node_modules/@mui/material/Backdrop/backdropClasses.js","../node_modules/@mui/material/Backdrop/Backdrop.js","../node_modules/@mui/system/esm/createBox.js","../node_modules/@mui/material/Box/boxClasses.js","../node_modules/@mui/material/Box/Box.js","../node_modules/@mui/material/Button/buttonClasses.js","../node_modules/@mui/material/Button/Button.js","../node_modules/@mui/material/ButtonBase/Ripple.js","../node_modules/@mui/material/ButtonBase/touchRippleClasses.js","../node_modules/@mui/material/ButtonBase/TouchRipple.js","../node_modules/@mui/material/ButtonBase/buttonBaseClasses.js","../node_modules/@mui/material/ButtonBase/ButtonBase.js","../node_modules/@mui/material/ButtonGroup/ButtonGroupButtonContext.js","../node_modules/@mui/material/ButtonGroup/ButtonGroupContext.js","../node_modules/@mui/material/Card/cardClasses.js","../node_modules/@mui/material/Card/Card.js","../node_modules/@mui/material/CardContent/cardContentClasses.js","../node_modules/@mui/material/CardContent/CardContent.js","../node_modules/@mui/material/internal/svg-icons/CheckBoxOutlineBlank.js","../node_modules/@mui/material/internal/svg-icons/CheckBox.js","../node_modules/@mui/material/internal/svg-icons/IndeterminateCheckBox.js","../node_modules/@mui/material/Checkbox/checkboxClasses.js","../node_modules/@mui/material/Checkbox/Checkbox.js","../node_modules/@mui/material/internal/svg-icons/Cancel.js","../node_modules/@mui/material/Chip/chipClasses.js","../node_modules/@mui/material/Chip/Chip.js","../node_modules/@mui/material/CircularProgress/circularProgressClasses.js","../node_modules/@mui/material/CircularProgress/CircularProgress.js","../node_modules/@mui/material/Dialog/Dialog.js","../node_modules/@mui/material/Dialog/DialogContext.js","../node_modules/@mui/material/Dialog/dialogClasses.js","../node_modules/@mui/material/DialogActions/dialogActionsClasses.js","../node_modules/@mui/material/DialogActions/DialogActions.js","../node_modules/@mui/material/DialogContent/dialogContentClasses.js","../node_modules/@mui/material/DialogContent/DialogContent.js","../node_modules/@mui/material/DialogTitle/DialogTitle.js","../node_modules/@mui/material/DialogTitle/dialogTitleClasses.js","../node_modules/@mui/material/Divider/Divider.js","../node_modules/@mui/material/Divider/dividerClasses.js","../node_modules/@mui/material/Fade/Fade.js","../node_modules/@mui/material/FilledInput/FilledInput.js","../node_modules/@mui/material/FilledInput/filledInputClasses.js","../node_modules/@mui/material/FormControl/formControlClasses.js","../node_modules/@mui/material/FormControl/FormControl.js","../node_modules/@mui/material/FormControl/FormControlContext.js","../node_modules/@mui/material/FormControl/formControlState.js","../node_modules/@mui/material/FormControl/useFormControl.js","../node_modules/@mui/system/esm/styled.js","../node_modules/@mui/system/esm/Stack/createStack.js","../node_modules/@mui/material/Stack/Stack.js","../node_modules/@mui/material/FormControlLabel/formControlLabelClasses.js","../node_modules/@mui/material/FormControlLabel/FormControlLabel.js","../node_modules/@mui/material/FormGroup/formGroupClasses.js","../node_modules/@mui/material/FormGroup/FormGroup.js","../node_modules/@mui/material/FormHelperText/formHelperTextClasses.js","../node_modules/@mui/material/FormHelperText/FormHelperText.js","../node_modules/@mui/material/FormLabel/FormLabel.js","../node_modules/@mui/material/FormLabel/formLabelClasses.js","../node_modules/@mui/system/esm/GlobalStyles/GlobalStyles.js","../node_modules/@mui/material/GlobalStyles/GlobalStyles.js","../node_modules/@mui/material/Grow/Grow.js","../node_modules/@mui/material/IconButton/iconButtonClasses.js","../node_modules/@mui/material/IconButton/IconButton.js","../node_modules/@mui/material/Input/Input.js","../node_modules/@mui/material/Input/inputClasses.js","../node_modules/@mui/material/InputAdornment/inputAdornmentClasses.js","../node_modules/@mui/material/InputAdornment/InputAdornment.js","../node_modules/@mui/base/TextareaAutosize/TextareaAutosize.js","../node_modules/@mui/material/InputBase/InputBase.js","../node_modules/@mui/material/InputBase/inputBaseClasses.js","../node_modules/@mui/material/InputBase/utils.js","../node_modules/@mui/material/InputLabel/inputLabelClasses.js","../node_modules/@mui/material/InputLabel/InputLabel.js","../node_modules/@mui/material/Link/linkClasses.js","../node_modules/@mui/material/Link/getTextDecoration.js","../node_modules/@mui/material/Link/Link.js","../node_modules/@mui/material/List/listClasses.js","../node_modules/@mui/material/List/List.js","../node_modules/@mui/material/List/ListContext.js","../node_modules/@mui/material/ListItem/listItemClasses.js","../node_modules/@mui/material/ListItem/ListItem.js","../node_modules/@mui/material/ListItemButton/ListItemButton.js","../node_modules/@mui/material/ListItemButton/listItemButtonClasses.js","../node_modules/@mui/material/ListItemIcon/listItemIconClasses.js","../node_modules/@mui/material/ListItemSecondaryAction/listItemSecondaryActionClasses.js","../node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction.js","../node_modules/@mui/material/ListItemText/ListItemText.js","../node_modules/@mui/material/ListItemText/listItemTextClasses.js","../node_modules/@mui/material/ListSubheader/listSubheaderClasses.js","../node_modules/@mui/material/ListSubheader/ListSubheader.js","../node_modules/@mui/material/Popover/popoverClasses.js","../node_modules/@mui/material/Popover/Popover.js","../node_modules/@mui/material/Menu/menuClasses.js","../node_modules/@mui/material/Menu/Menu.js","../node_modules/@mui/material/MenuItem/menuItemClasses.js","../node_modules/@mui/material/MenuItem/MenuItem.js","../node_modules/@mui/material/utils/getScrollbarSize.js","../node_modules/@mui/material/MenuList/MenuList.js","../node_modules/@mui/base/unstable_useModal/ModalManager.js","../node_modules/@mui/base/unstable_useModal/useModal.js","../node_modules/@mui/material/Modal/modalClasses.js","../node_modules/@mui/material/Modal/Modal.js","../node_modules/@mui/material/OutlinedInput/NotchedOutline.js","../node_modules/@mui/material/OutlinedInput/OutlinedInput.js","../node_modules/@mui/material/OutlinedInput/outlinedInputClasses.js","../node_modules/@mui/material/styles/getOverlayAlpha.js","../node_modules/@mui/material/Paper/paperClasses.js","../node_modules/@mui/material/Paper/Paper.js","../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../node_modules/@popperjs/core/lib/utils/math.js","../node_modules/@popperjs/core/lib/utils/userAgent.js","../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../node_modules/@popperjs/core/lib/enums.js","../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../node_modules/@popperjs/core/lib/utils/debounce.js","../node_modules/@popperjs/core/lib/createPopper.js","../node_modules/@popperjs/core/lib/utils/mergeByName.js","../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../node_modules/@popperjs/core/lib/utils/getVariation.js","../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../node_modules/@popperjs/core/lib/modifiers/offset.js","../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../node_modules/@popperjs/core/lib/dom-utils/contains.js","../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../node_modules/@popperjs/core/lib/utils/within.js","../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../node_modules/@popperjs/core/lib/modifiers/arrow.js","../node_modules/@popperjs/core/lib/modifiers/hide.js","../node_modules/@popperjs/core/lib/popper.js","../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../node_modules/@popperjs/core/lib/modifiers/flip.js","../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../node_modules/@mui/base/generateUtilityClass/index.js","../node_modules/@mui/base/Popper/popperClasses.js","../node_modules/@mui/base/generateUtilityClasses/index.js","../node_modules/@mui/base/utils/ClassNameConfigurator.js","../node_modules/@mui/base/Popper/Popper.js","../node_modules/@mui/material/Popper/Popper.js","../node_modules/@mui/material/internal/svg-icons/RadioButtonUnchecked.js","../node_modules/@mui/material/internal/svg-icons/RadioButtonChecked.js","../node_modules/@mui/material/Radio/RadioButtonIcon.js","../node_modules/@mui/material/Radio/radioClasses.js","../node_modules/@mui/material/Radio/Radio.js","../node_modules/@mui/material/RadioGroup/useRadioGroup.js","../node_modules/@mui/material/RadioGroup/radioGroupClasses.js","../node_modules/@mui/material/RadioGroup/RadioGroup.js","../node_modules/@mui/material/RadioGroup/RadioGroupContext.js","../node_modules/@mui/material/NativeSelect/nativeSelectClasses.js","../node_modules/@mui/material/NativeSelect/NativeSelectInput.js","../node_modules/@mui/material/Select/selectClasses.js","../node_modules/@mui/material/Select/SelectInput.js","../node_modules/@mui/material/Select/Select.js","../node_modules/@mui/material/SvgIcon/svgIconClasses.js","../node_modules/@mui/material/SvgIcon/SvgIcon.js","../node_modules/@mui/material/Switch/switchClasses.js","../node_modules/@mui/material/Switch/Switch.js","../node_modules/@mui/material/Tab/tabClasses.js","../node_modules/@mui/material/Tab/Tab.js","../node_modules/@mui/utils/scrollLeft/scrollLeft.js","../node_modules/@mui/material/internal/animate.js","../node_modules/@mui/material/Tabs/ScrollbarSize.js","../node_modules/@mui/material/internal/svg-icons/KeyboardArrowLeft.js","../node_modules/@mui/material/internal/svg-icons/KeyboardArrowRight.js","../node_modules/@mui/material/TabScrollButton/tabScrollButtonClasses.js","../node_modules/@mui/material/TabScrollButton/TabScrollButton.js","../node_modules/@mui/material/Tabs/tabsClasses.js","../node_modules/@mui/material/Tabs/Tabs.js","../node_modules/@mui/material/TextField/textFieldClasses.js","../node_modules/@mui/material/TextField/TextField.js","../node_modules/@mui/material/Tooltip/tooltipClasses.js","../node_modules/@mui/material/Tooltip/Tooltip.js","../node_modules/@mui/material/Typography/typographyClasses.js","../node_modules/@mui/material/Typography/Typography.js","../node_modules/@mui/material/internal/switchBaseClasses.js","../node_modules/@mui/material/internal/SwitchBase.js","../node_modules/@mui/material/internal/svg-icons/ArrowDropDown.js","../node_modules/@mui/material/internal/svg-icons/Close.js","../node_modules/@mui/material/colors/common.js","../node_modules/@mui/material/colors/grey.js","../node_modules/@mui/material/colors/purple.js","../node_modules/@mui/material/colors/red.js","../node_modules/@mui/material/colors/orange.js","../node_modules/@mui/material/colors/blue.js","../node_modules/@mui/material/colors/lightBlue.js","../node_modules/@mui/material/colors/green.js","../node_modules/@mui/material/styles/createPalette.js","../node_modules/@mui/material/styles/createTypography.js","../node_modules/@mui/material/styles/shadows.js","../node_modules/@mui/material/styles/zIndex.js","../node_modules/@mui/material/styles/createTheme.js","../node_modules/@mui/material/styles/createMixins.js","../node_modules/@mui/material/styles/createTransitions.js","../node_modules/@mui/material/styles/defaultTheme.js","../node_modules/@mui/material/styles/identifier.js","../node_modules/@mui/material/styles/rootShouldForwardProp.js","../node_modules/@mui/material/styles/slotShouldForwardProp.js","../node_modules/@mui/material/styles/styled.js","../node_modules/@mui/material/styles/useTheme.js","../node_modules/@mui/material/styles/useThemeProps.js","../node_modules/@mui/material/transitions/utils.js","../node_modules/@mui/material/utils/capitalize.js","../node_modules/@mui/material/utils/createChainedFunction.js","../node_modules/@mui/material/utils/createSvgIcon.js","../node_modules/@mui/material/utils/debounce.js","../node_modules/@mui/material/utils/deprecatedPropType.js","../node_modules/@mui/utils/deprecatedPropType/deprecatedPropType.js","../node_modules/@mui/material/utils/requirePropFactory.js","../node_modules/@mui/utils/requirePropFactory/requirePropFactory.js","../node_modules/@mui/material/utils/setRef.js","../node_modules/@mui/material/utils/unsupportedProp.js","../node_modules/@mui/utils/unsupportedProp/unsupportedProp.js","../node_modules/@mui/material/utils/index.js","../node_modules/@mui/material/utils/isMuiElement.js","../node_modules/@mui/utils/isMuiElement/isMuiElement.js","../node_modules/@mui/material/utils/ownerDocument.js","../node_modules/@mui/material/utils/ownerWindow.js","../node_modules/@mui/material/utils/useControlled.js","../node_modules/@mui/material/utils/useEnhancedEffect.js","../node_modules/@mui/material/utils/useEventCallback.js","../node_modules/@mui/material/utils/useForkRef.js","../node_modules/@mui/material/utils/useId.js","../node_modules/@mui/material/utils/useIsFocusVisible.js","../node_modules/@mui/material/zero-styled/index.js","../node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles.js","../node_modules/@emotion/styled/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js","../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js","../node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js","../node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider.js","../node_modules/@mui/styled-engine/index.js","../node_modules/@mui/system/colorManipulator.js","../node_modules/@mui/system/createStyled.js","../node_modules/@mui/system/esm/RtlProvider/index.js","../node_modules/@mui/system/esm/breakpoints.js","../node_modules/@mui/system/esm/colorManipulator.js","../node_modules/@mui/system/esm/createStyled.js","../node_modules/@mui/system/esm/createTheme/applyStyles.js","../node_modules/@mui/system/esm/createTheme/createBreakpoints.js","../node_modules/@mui/system/esm/createTheme/shape.js","../node_modules/@mui/system/esm/createTheme/createTheme.js","../node_modules/@mui/system/esm/createTheme/createSpacing.js","../node_modules/@mui/system/esm/merge.js","../node_modules/@mui/system/esm/spacing.js","../node_modules/@mui/system/esm/memoize.js","../node_modules/@mui/system/esm/style.js","../node_modules/@mui/system/esm/compose.js","../node_modules/@mui/system/esm/borders.js","../node_modules/@mui/system/esm/cssGrid.js","../node_modules/@mui/system/esm/palette.js","../node_modules/@mui/system/esm/sizing.js","../node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js","../node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js","../node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js","../node_modules/@mui/system/esm/useMediaQuery/useMediaQuery.js","../node_modules/@mui/system/esm/useTheme.js","../node_modules/@mui/system/esm/useThemeProps/getThemeProps.js","../node_modules/@mui/system/esm/useThemeProps/useThemeProps.js","../node_modules/@mui/system/esm/useThemeWithoutDefault.js","../node_modules/@mui/system/useThemeWithoutDefault.js","../node_modules/@mui/utils/ClassNameGenerator/ClassNameGenerator.js","../node_modules/@mui/utils/capitalize/capitalize.js","../node_modules/@mui/utils/clamp/clamp.js","../node_modules/@mui/utils/composeClasses/composeClasses.js","../node_modules/@mui/utils/createChainedFunction/createChainedFunction.js","../node_modules/@mui/utils/debounce/debounce.js","../node_modules/@mui/utils/deepmerge/deepmerge.js","../node_modules/@mui/utils/formatMuiErrorMessage/formatMuiErrorMessage.js","../node_modules/@mui/utils/generateUtilityClass/generateUtilityClass.js","../node_modules/@mui/utils/generateUtilityClasses/generateUtilityClasses.js","../node_modules/@mui/utils/getDisplayName/getDisplayName.js","../node_modules/@mui/utils/getScrollbarSize/getScrollbarSize.js","../node_modules/@mui/utils/ownerDocument/ownerDocument.js","../node_modules/@mui/utils/ownerWindow/ownerWindow.js","../node_modules/@mui/utils/resolveProps/resolveProps.js","../node_modules/@mui/utils/setRef/setRef.js","../node_modules/@mui/utils/useControlled/useControlled.js","../node_modules/@mui/utils/useEnhancedEffect/useEnhancedEffect.js","../node_modules/@mui/utils/useEventCallback/useEventCallback.js","../node_modules/@mui/utils/useForkRef/useForkRef.js","../node_modules/@mui/utils/useId/useId.js","../node_modules/@mui/utils/useIsFocusVisible/useIsFocusVisible.js","../node_modules/@mui/utils/useLazyRef/useLazyRef.js","../node_modules/@mui/utils/useOnMount/useOnMount.js","../node_modules/@mui/utils/useTimeout/useTimeout.js","../node_modules/@mui/utils/visuallyHidden/visuallyHidden.js","../node_modules/@remix-run/router/history.ts","../node_modules/@remix-run/router/utils.ts","../node_modules/@remix-run/router/router.ts","../node_modules/@sentry/src/env.ts","../node_modules/@sentry/src/node.ts","../node_modules/attr-accept/dist/es/index.js","../node_modules/clsx/dist/clsx.m.js","../node_modules/domelementtype/lib/index.js","../node_modules/domhandler/lib/index.js","../node_modules/domhandler/lib/node.js","../node_modules/file-saver/src/FileSaver.js","../node_modules/hermes-channel/src/hermes.ts","../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","../node_modules/html-dom-parser/src/client/constants.ts","../node_modules/html-dom-parser/src/client/domparser.ts","../node_modules/html-dom-parser/src/client/html-to-dom.ts","../node_modules/html-dom-parser/src/client/utilities.ts","../node_modules/html-react-parser/index.js","../node_modules/html-react-parser/lib/attributes-to-props.js","../node_modules/html-react-parser/lib/dom-to-react.js","../node_modules/html-react-parser/lib/utilities.js","../node_modules/inline-style-parser/index.js","../node_modules/intl-messageformat/lib/src/core.js","../node_modules/intl-messageformat/lib/src/error.js","../node_modules/intl-messageformat/lib/src/formatters.js","../node_modules/js-cookie/src/js.cookie.js","../node_modules/lodash.clonedeep/index.js","../node_modules/lodash.get/index.js","../node_modules/lodash.set/index.js","../node_modules/lodash.unset/index.js","../node_modules/lodash/_DataView.js","../node_modules/lodash/_Hash.js","../node_modules/lodash/_ListCache.js","../node_modules/lodash/_Map.js","../node_modules/lodash/_MapCache.js","../node_modules/lodash/_Promise.js","../node_modules/lodash/_Set.js","../node_modules/lodash/_SetCache.js","../node_modules/lodash/_Stack.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_Uint8Array.js","../node_modules/lodash/_WeakMap.js","../node_modules/lodash/_arrayEach.js","../node_modules/lodash/_arrayFilter.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_arrayMap.js","../node_modules/lodash/_arrayPush.js","../node_modules/lodash/_arraySome.js","../node_modules/lodash/_assignValue.js","../node_modules/lodash/_assocIndexOf.js","../node_modules/lodash/_baseAssign.js","../node_modules/lodash/_baseAssignIn.js","../node_modules/lodash/_baseAssignValue.js","../node_modules/lodash/_baseClone.js","../node_modules/lodash/_baseCreate.js","../node_modules/lodash/_baseEach.js","../node_modules/lodash/_baseFor.js","../node_modules/lodash/_baseForOwn.js","../node_modules/lodash/_baseGet.js","../node_modules/lodash/_baseGetAllKeys.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/_baseHasIn.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/_baseIsEqual.js","../node_modules/lodash/_baseIsEqualDeep.js","../node_modules/lodash/_baseIsMap.js","../node_modules/lodash/_baseIsMatch.js","../node_modules/lodash/_baseIsNative.js","../node_modules/lodash/_baseIsSet.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_baseIteratee.js","../node_modules/lodash/_baseKeys.js","../node_modules/lodash/_baseKeysIn.js","../node_modules/lodash/_baseMap.js","../node_modules/lodash/_baseMatches.js","../node_modules/lodash/_baseMatchesProperty.js","../node_modules/lodash/_baseProperty.js","../node_modules/lodash/_basePropertyDeep.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/_baseToString.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_cacheHas.js","../node_modules/lodash/_castFunction.js","../node_modules/lodash/_castPath.js","../node_modules/lodash/_cloneArrayBuffer.js","../node_modules/lodash/_cloneBuffer.js","../node_modules/lodash/_cloneDataView.js","../node_modules/lodash/_cloneRegExp.js","../node_modules/lodash/_cloneSymbol.js","../node_modules/lodash/_cloneTypedArray.js","../node_modules/lodash/_copyArray.js","../node_modules/lodash/_copyObject.js","../node_modules/lodash/_copySymbols.js","../node_modules/lodash/_copySymbolsIn.js","../node_modules/lodash/_coreJsData.js","../node_modules/lodash/_createBaseEach.js","../node_modules/lodash/_createBaseFor.js","../node_modules/lodash/_defineProperty.js","../node_modules/lodash/_equalArrays.js","../node_modules/lodash/_equalByTag.js","../node_modules/lodash/_equalObjects.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_getAllKeys.js","../node_modules/lodash/_getAllKeysIn.js","../node_modules/lodash/_getMapData.js","../node_modules/lodash/_getMatchData.js","../node_modules/lodash/_getNative.js","../node_modules/lodash/_getPrototype.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_getSymbols.js","../node_modules/lodash/_getSymbolsIn.js","../node_modules/lodash/_getTag.js","../node_modules/lodash/_getValue.js","../node_modules/lodash/_hasPath.js","../node_modules/lodash/_hashClear.js","../node_modules/lodash/_hashDelete.js","../node_modules/lodash/_hashGet.js","../node_modules/lodash/_hashHas.js","../node_modules/lodash/_hashSet.js","../node_modules/lodash/_initCloneArray.js","../node_modules/lodash/_initCloneByTag.js","../node_modules/lodash/_initCloneObject.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/_isKey.js","../node_modules/lodash/_isKeyable.js","../node_modules/lodash/_isMasked.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_isStrictComparable.js","../node_modules/lodash/_listCacheClear.js","../node_modules/lodash/_listCacheDelete.js","../node_modules/lodash/_listCacheGet.js","../node_modules/lodash/_listCacheHas.js","../node_modules/lodash/_listCacheSet.js","../node_modules/lodash/_mapCacheClear.js","../node_modules/lodash/_mapCacheDelete.js","../node_modules/lodash/_mapCacheGet.js","../node_modules/lodash/_mapCacheHas.js","../node_modules/lodash/_mapCacheSet.js","../node_modules/lodash/_mapToArray.js","../node_modules/lodash/_matchesStrictComparable.js","../node_modules/lodash/_memoizeCapped.js","../node_modules/lodash/_nativeCreate.js","../node_modules/lodash/_nativeKeys.js","../node_modules/lodash/_nativeKeysIn.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_root.js","../node_modules/lodash/_setCacheAdd.js","../node_modules/lodash/_setCacheHas.js","../node_modules/lodash/_setToArray.js","../node_modules/lodash/_stackClear.js","../node_modules/lodash/_stackDelete.js","../node_modules/lodash/_stackGet.js","../node_modules/lodash/_stackHas.js","../node_modules/lodash/_stackSet.js","../node_modules/lodash/_stringToPath.js","../node_modules/lodash/_toKey.js","../node_modules/lodash/_toSource.js","../node_modules/lodash/cloneDeep.js","../node_modules/lodash/eq.js","../node_modules/lodash/forOwn.js","../node_modules/lodash/get.js","../node_modules/lodash/hasIn.js","../node_modules/lodash/identity.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/isArray.js","../node_modules/lodash/isArrayLike.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/isFunction.js","../node_modules/lodash/isLength.js","../node_modules/lodash/isMap.js","../node_modules/lodash/isObject.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/isPlainObject.js","../node_modules/lodash/isSet.js","../node_modules/lodash/isString.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/keys.js","../node_modules/lodash/keysIn.js","../node_modules/lodash/lodash.js","../node_modules/lodash/map.js","../node_modules/lodash/memoize.js","../node_modules/lodash/property.js","../node_modules/lodash/stubArray.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/toString.js","../node_modules/mixpanel-browser/dist/mixpanel.cjs.js","../node_modules/moment/moment.js","../node_modules/prop-types/factoryWithThrowingShims.js","../node_modules/prop-types/index.js","../node_modules/prop-types/lib/ReactPropTypesSecret.js","../node_modules/property-expr/index.js","../node_modules/publish-subscribe-js/src/PublishSubscribe.js","../node_modules/react-data-table-component/src/DataTable/types.ts","../node_modules/react-data-table-component/src/DataTable/util.ts","../node_modules/react-data-table-component/src/DataTable/tableReducer.ts","../node_modules/react-data-table-component/src/DataTable/Table.tsx","../node_modules/react-data-table-component/src/DataTable/TableHead.tsx","../node_modules/react-data-table-component/src/DataTable/TableHeadRow.tsx","../node_modules/react-data-table-component/src/DataTable/media.ts","../node_modules/react-data-table-component/src/DataTable/Cell.ts","../node_modules/react-data-table-component/src/DataTable/TableCell.tsx","../node_modules/react-data-table-component/src/DataTable/Checkbox.tsx","../node_modules/react-data-table-component/src/DataTable/TableCellCheckbox.tsx","../node_modules/react-data-table-component/src/DataTable/ExpanderButton.tsx","../node_modules/react-data-table-component/src/DataTable/TableCellExpander.tsx","../node_modules/react-data-table-component/src/DataTable/ExpanderRow.tsx","../node_modules/react-data-table-component/src/DataTable/constants.ts","../node_modules/react-data-table-component/src/DataTable/TableRow.tsx","../node_modules/react-data-table-component/src/icons/NativeSortIcon.tsx","../node_modules/react-data-table-component/src/DataTable/TableCol.tsx","../node_modules/react-data-table-component/src/DataTable/TableColCheckbox.tsx","../node_modules/react-data-table-component/src/hooks/useRTL.ts","../node_modules/react-data-table-component/src/DataTable/ContextMenu.tsx","../node_modules/react-data-table-component/src/DataTable/TableHeader.tsx","../node_modules/react-data-table-component/src/DataTable/TableSubheader.tsx","../node_modules/react-data-table-component/src/DataTable/TableBody.tsx","../node_modules/react-data-table-component/src/DataTable/ResponsiveWrapper.tsx","../node_modules/react-data-table-component/src/DataTable/ProgressWrapper.tsx","../node_modules/react-data-table-component/src/DataTable/TableWrapper.tsx","../node_modules/react-data-table-component/src/DataTable/TableColExpander.tsx","../node_modules/react-data-table-component/src/DataTable/NoDataWrapper.tsx","../node_modules/react-data-table-component/src/icons/Dropdown.tsx","../node_modules/react-data-table-component/src/DataTable/Select.tsx","../node_modules/react-data-table-component/src/DataTable/defaultProps.tsx","../node_modules/react-data-table-component/src/icons/ExpanderCollapsedIcon.tsx","../node_modules/react-data-table-component/src/icons/ExpanderExpandedIcon.tsx","../node_modules/react-data-table-component/src/icons/FirstPage.tsx","../node_modules/react-data-table-component/src/icons/LastPage.tsx","../node_modules/react-data-table-component/src/icons/Right.tsx","../node_modules/react-data-table-component/src/icons/Left.tsx","../node_modules/react-data-table-component/src/DataTable/Pagination.tsx","../node_modules/react-data-table-component/src/hooks/useWindowSize.ts","../node_modules/react-data-table-component/src/hooks/useDidUpdateEffect.ts","../node_modules/react-data-table-component/node_modules/deepmerge/dist/cjs.js","../node_modules/react-data-table-component/src/DataTable/themes.ts","../node_modules/react-data-table-component/src/hooks/useColumns.ts","../node_modules/react-data-table-component/src/DataTable/DataTable.tsx","../node_modules/react-data-table-component/src/DataTable/styles.ts","../node_modules/react-dom/cjs/react-dom.production.min.js","../node_modules/react-dom/client.js","../node_modules/react-dom/index.js","../node_modules/react-geocode/dist/index.js","../node_modules/react-image-file-resizer/build/index.js","../node_modules/react-intl/lib/src/components/injectIntl.js","../node_modules/react-intl/lib/src/components/useIntl.js","../node_modules/react-intl/lib/src/utils.js","../node_modules/react-is/cjs/react-is.production.min.js","../node_modules/react-is/index.js","../node_modules/react-property/lib/index.js","../node_modules/react-property/lib/possibleStandardNamesOptimized.js","../node_modules/react-router/lib/context.ts","../node_modules/react-router/lib/hooks.tsx","../node_modules/react-router/lib/components.tsx","../node_modules/react-rte/dist/react-rte.js","../node_modules/react-signalr/src/signalr/context.ts","../node_modules/react-signalr/src/signalr/hooks.ts","../node_modules/react-signalr/src/signalr/index.tsx","../node_modules/react-signalr/src/signalr/provider/index.ts","../node_modules/react-signalr/src/signalr/provider/providerNativeFactory.ts","../node_modules/react-signalr/src/signalr/utils.ts","../node_modules/react-signalr/src/utils.ts","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/rng.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/regex.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/validate.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/v1.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/parse.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/v35.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/md5.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/v3.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/v4.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/sha1.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/v5.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/nil.js","../node_modules/react-signalr/node_modules/uuid/dist/esm-browser/version.js","../node_modules/react-signalr/signalr.js","../node_modules/react-swipeable-views-core/lib/checkIndexBounds.js","../node_modules/react-swipeable-views-core/lib/computeIndex.js","../node_modules/react-swipeable-views-core/lib/constant.js","../node_modules/react-swipeable-views-core/lib/getDisplaySameSlide.js","../node_modules/react-swipeable-views-core/lib/index.js","../node_modules/react-swipeable-views-core/lib/mod.js","../node_modules/react-swipeable-views/lib/SwipeableViews.js","../node_modules/react-swipeable-views/lib/index.js","../node_modules/react-transition-group/esm/config.js","../node_modules/react-transition-group/esm/Transition.js","../node_modules/react-transition-group/esm/utils/ChildMapping.js","../node_modules/react-transition-group/esm/TransitionGroup.js","../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../node_modules/react-transition-group/esm/TransitionGroupContext.js","../node_modules/react-transition-group/esm/utils/reflow.js","../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react.production.min.js","../node_modules/react/index.js","../node_modules/react/jsx-runtime.js","../node_modules/reactcss/lib/autoprefix.js","../node_modules/reactcss/lib/components/active.js","../node_modules/reactcss/lib/components/hover.js","../node_modules/reactcss/lib/flattenNames.js","../node_modules/reactcss/lib/index.js","../node_modules/reactcss/lib/loop.js","../node_modules/reactcss/lib/mergeClasses.js","../node_modules/scheduler/cjs/scheduler.production.min.js","../node_modules/scheduler/index.js","../node_modules/shallowequal/index.js","../node_modules/sheetjs-style/dist/cpexcel.js","../node_modules/sheetjs-style/jszip.js","../node_modules/sheetjs-style/xlsx.js","../node_modules/state-eventer/index.js","../node_modules/state-eventer/node_modules/fast-deep-equal/index.js","../node_modules/style-to-js/src/index.ts","../node_modules/style-to-js/src/utilities.ts","../node_modules/style-to-object/src/index.ts","../node_modules/styled-components/node_modules/tslib/tslib.es6.js","../node_modules/styled-components/node_modules/stylis/src/Enum.js","../node_modules/styled-components/node_modules/stylis/src/Utility.js","../node_modules/styled-components/node_modules/stylis/src/Tokenizer.js","../node_modules/styled-components/node_modules/stylis/src/Serializer.js","../node_modules/styled-components/node_modules/stylis/src/Prefixer.js","../node_modules/styled-components/node_modules/stylis/src/Middleware.js","../node_modules/styled-components/node_modules/stylis/src/Parser.js","../node_modules/styled-components/src/constants.ts","../node_modules/styled-components/src/utils/empties.ts","../node_modules/styled-components/src/utils/checkDynamicCreation.ts","../node_modules/styled-components/src/utils/determineTheme.ts","../node_modules/styled-components/src/utils/domElements.ts","../node_modules/styled-components/src/utils/escape.ts","../node_modules/styled-components/src/utils/generateAlphabeticName.ts","../node_modules/styled-components/src/utils/hash.ts","../node_modules/styled-components/src/utils/generateComponentId.ts","../node_modules/styled-components/src/utils/getComponentName.ts","../node_modules/styled-components/src/utils/isTag.ts","../node_modules/styled-components/src/utils/hoist.ts","../node_modules/styled-components/src/utils/isFunction.ts","../node_modules/styled-components/src/utils/isStyledComponent.ts","../node_modules/styled-components/src/utils/joinStrings.ts","../node_modules/styled-components/src/utils/isPlainObject.ts","../node_modules/styled-components/src/utils/mixinDeep.ts","../node_modules/styled-components/src/utils/setToString.ts","../node_modules/styled-components/src/utils/error.ts","../node_modules/styled-components/src/sheet/GroupedTag.ts","../node_modules/styled-components/src/sheet/GroupIDAllocator.ts","../node_modules/styled-components/src/sheet/Rehydration.ts","../node_modules/styled-components/src/utils/nonce.ts","../node_modules/styled-components/src/sheet/dom.ts","../node_modules/styled-components/src/sheet/Tag.ts","../node_modules/styled-components/src/sheet/Sheet.ts","../node_modules/styled-components/src/utils/stylis.ts","../node_modules/styled-components/src/models/StyleSheetManager.tsx","../node_modules/styled-components/src/models/Keyframes.ts","../node_modules/styled-components/src/utils/hyphenateStyleName.ts","../node_modules/styled-components/src/utils/flatten.ts","../node_modules/styled-components/src/utils/addUnitIfNeeded.ts","../node_modules/styled-components/src/utils/isStatelessFunction.ts","../node_modules/styled-components/src/utils/isStaticRules.ts","../node_modules/styled-components/src/models/ComponentStyle.ts","../node_modules/styled-components/src/models/ThemeProvider.tsx","../node_modules/styled-components/src/models/StyledComponent.ts","../node_modules/styled-components/src/utils/generateDisplayName.ts","../node_modules/styled-components/src/utils/interleave.ts","../node_modules/styled-components/src/constructors/css.ts","../node_modules/styled-components/src/constructors/constructWithOptions.ts","../node_modules/styled-components/src/constructors/styled.tsx","../node_modules/styled-components/src/models/GlobalStyle.ts","../node_modules/styled-components/src/constructors/createGlobalStyle.ts","../node_modules/styled-components/src/constructors/keyframes.ts","../node_modules/styled-components/src/hoc/withTheme.tsx","../node_modules/styled-components/src/models/ServerStyleSheet.tsx","../node_modules/styled-components/src/secretInternals.ts","../node_modules/styled-components/src/base.ts","../node_modules/tiny-case/index.js","../node_modules/toposort/index.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/v4.js","../node_modules/venti/venti.js","../node_modules/warning/warning.js","../node_modules/yup/index.esm.js","../node_modules/react-swipeable-views-core/node_modules/@babel/runtime/helpers/interopRequireDefault.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/assertThisInitialized.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/classCallCheck.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/createClass.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/extends.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/getPrototypeOf.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/inherits.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/interopRequireDefault.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/interopRequireWildcard.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/objectWithoutProperties.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/setPrototypeOf.js","../node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/typeof.js","workflows|lazy|/^/.//.*/.json$/|groupOptions: {}|namespace object","../node_modules/@babel/runtime/helpers/extends.js","../node_modules/@babel/runtime/helpers/interopRequireDefault.js","../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js","../node_modules/classnames/index.js","../node_modules/@babel/runtime/helpers/esm/assertClassBrand.js","../node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js","../node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js","../node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js","../node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js","../node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js","../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","../node_modules/@fortawesome/free-brands-svg-icons/index.mjs","../node_modules/@mui/material/node_modules/clsx/dist/clsx.mjs","../node_modules/@mui/system/node_modules/clsx/dist/clsx.mjs","../node_modules/@tanstack/query-core/src/focusManager.ts","../node_modules/@tanstack/query-core/src/mutation.ts","../node_modules/@tanstack/query-core/src/notifyManager.ts","../node_modules/@tanstack/query-core/src/onlineManager.ts","../node_modules/@tanstack/query-core/src/query.ts","../node_modules/@tanstack/query-core/src/removable.ts","../node_modules/@tanstack/query-core/src/retryer.ts","../node_modules/@tanstack/query-core/src/subscribable.ts","../node_modules/@tanstack/query-core/src/utils.ts","../node_modules/@tanstack/react-query/src/QueryClientProvider.tsx","../node_modules/@tanstack/query-core/src/mutationObserver.ts","../node_modules/@tanstack/react-query/src/useMutation.ts","../node_modules/@tanstack/query-core/src/queryObserver.ts","../node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx","../node_modules/@tanstack/react-query/src/isRestoring.ts","../node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts","../node_modules/@tanstack/react-query/src/suspense.ts","../node_modules/@tanstack/react-query/src/useQuery.ts","../node_modules/@tanstack/react-query/src/useBaseQuery.ts","../node_modules/@tanstack/react-query/src/utils.ts","../node_modules/axios/lib/helpers/bind.js","../node_modules/axios/lib/utils.js","../node_modules/axios/lib/core/AxiosError.js","../node_modules/axios/lib/helpers/toFormData.js","../node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../node_modules/axios/lib/helpers/buildURL.js","../node_modules/axios/lib/core/InterceptorManager.js","../node_modules/axios/lib/defaults/transitional.js","../node_modules/axios/lib/platform/browser/index.js","../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../node_modules/axios/lib/platform/browser/classes/FormData.js","../node_modules/axios/lib/platform/browser/classes/Blob.js","../node_modules/axios/lib/platform/common/utils.js","../node_modules/axios/lib/platform/index.js","../node_modules/axios/lib/helpers/formDataToJSON.js","../node_modules/axios/lib/defaults/index.js","../node_modules/axios/lib/helpers/toURLEncodedForm.js","../node_modules/axios/lib/helpers/parseHeaders.js","../node_modules/axios/lib/core/AxiosHeaders.js","../node_modules/axios/lib/core/transformData.js","../node_modules/axios/lib/cancel/isCancel.js","../node_modules/axios/lib/cancel/CanceledError.js","../node_modules/axios/lib/core/settle.js","../node_modules/axios/lib/helpers/speedometer.js","../node_modules/axios/lib/helpers/throttle.js","../node_modules/axios/lib/helpers/progressEventReducer.js","../node_modules/axios/lib/helpers/isURLSameOrigin.js","../node_modules/axios/lib/helpers/cookies.js","../node_modules/axios/lib/core/buildFullPath.js","../node_modules/axios/lib/helpers/isAbsoluteURL.js","../node_modules/axios/lib/helpers/combineURLs.js","../node_modules/axios/lib/core/mergeConfig.js","../node_modules/axios/lib/helpers/resolveConfig.js","../node_modules/axios/lib/adapters/xhr.js","../node_modules/axios/lib/helpers/parseProtocol.js","../node_modules/axios/lib/helpers/composeSignals.js","../node_modules/axios/lib/helpers/trackStream.js","../node_modules/axios/lib/adapters/fetch.js","../node_modules/axios/lib/adapters/adapters.js","../node_modules/axios/lib/helpers/null.js","../node_modules/axios/lib/core/dispatchRequest.js","../node_modules/axios/lib/env/data.js","../node_modules/axios/lib/helpers/validator.js","../node_modules/axios/lib/core/Axios.js","../node_modules/axios/lib/cancel/CancelToken.js","../node_modules/axios/lib/helpers/HttpStatusCode.js","../node_modules/axios/lib/axios.js","../node_modules/axios/lib/helpers/spread.js","../node_modules/axios/lib/helpers/isAxiosError.js","../node_modules/react-hook-form/src/utils/isCheckBoxInput.ts","../node_modules/react-hook-form/src/utils/isDateObject.ts","../node_modules/react-hook-form/src/utils/isNullOrUndefined.ts","../node_modules/react-hook-form/src/utils/isObject.ts","../node_modules/react-hook-form/src/logic/getEventValue.ts","../node_modules/react-hook-form/src/logic/isNameInFieldArray.ts","../node_modules/react-hook-form/src/logic/getNodeParentName.ts","../node_modules/react-hook-form/src/utils/isPlainObject.ts","../node_modules/react-hook-form/src/utils/isWeb.ts","../node_modules/react-hook-form/src/utils/cloneObject.ts","../node_modules/react-hook-form/src/utils/compact.ts","../node_modules/react-hook-form/src/utils/isUndefined.ts","../node_modules/react-hook-form/src/utils/get.ts","../node_modules/react-hook-form/src/utils/isBoolean.ts","../node_modules/react-hook-form/src/constants.ts","../node_modules/react-hook-form/src/useFormContext.tsx","../node_modules/react-hook-form/src/logic/getProxyFormState.ts","../node_modules/react-hook-form/src/utils/isEmptyObject.ts","../node_modules/react-hook-form/src/logic/shouldRenderFormState.ts","../node_modules/react-hook-form/src/utils/convertToArrayPayload.ts","../node_modules/react-hook-form/src/logic/shouldSubscribeByName.ts","../node_modules/react-hook-form/src/useSubscribe.ts","../node_modules/react-hook-form/src/utils/isString.ts","../node_modules/react-hook-form/src/logic/generateWatchOutput.ts","../node_modules/react-hook-form/src/useWatch.ts","../node_modules/react-hook-form/src/utils/isKey.ts","../node_modules/react-hook-form/src/utils/stringToPath.ts","../node_modules/react-hook-form/src/utils/set.ts","../node_modules/react-hook-form/src/useController.ts","../node_modules/react-hook-form/src/useFormState.ts","../node_modules/react-hook-form/src/controller.tsx","../node_modules/react-hook-form/src/logic/appendErrors.ts","../node_modules/react-hook-form/src/logic/generateId.ts","../node_modules/react-hook-form/src/logic/getFocusFieldName.ts","../node_modules/react-hook-form/src/logic/getValidationModes.ts","../node_modules/react-hook-form/src/logic/isWatched.ts","../node_modules/react-hook-form/src/logic/iterateFieldsByAction.ts","../node_modules/react-hook-form/src/logic/updateFieldArrayRootError.ts","../node_modules/react-hook-form/src/utils/isFileInput.ts","../node_modules/react-hook-form/src/utils/isFunction.ts","../node_modules/react-hook-form/src/utils/isHTMLElement.ts","../node_modules/react-hook-form/src/utils/isMessage.ts","../node_modules/react-hook-form/src/utils/isRadioInput.ts","../node_modules/react-hook-form/src/utils/isRegex.ts","../node_modules/react-hook-form/src/logic/getCheckboxValue.ts","../node_modules/react-hook-form/src/logic/getRadioValue.ts","../node_modules/react-hook-form/src/logic/getValidateError.ts","../node_modules/react-hook-form/src/logic/getValueAndMessage.ts","../node_modules/react-hook-form/src/logic/validateField.ts","../node_modules/react-hook-form/src/utils/append.ts","../node_modules/react-hook-form/src/utils/fillEmptyArray.ts","../node_modules/react-hook-form/src/utils/insert.ts","../node_modules/react-hook-form/src/utils/move.ts","../node_modules/react-hook-form/src/utils/prepend.ts","../node_modules/react-hook-form/src/utils/remove.ts","../node_modules/react-hook-form/src/utils/swap.ts","../node_modules/react-hook-form/src/utils/unset.ts","../node_modules/react-hook-form/src/utils/update.ts","../node_modules/react-hook-form/src/useFieldArray.ts","../node_modules/react-hook-form/src/utils/createSubject.ts","../node_modules/react-hook-form/src/utils/isPrimitive.ts","../node_modules/react-hook-form/src/utils/deepEqual.ts","../node_modules/react-hook-form/src/utils/isMultipleSelect.ts","../node_modules/react-hook-form/src/utils/isRadioOrCheckbox.ts","../node_modules/react-hook-form/src/utils/live.ts","../node_modules/react-hook-form/src/utils/objectHasFunction.ts","../node_modules/react-hook-form/src/logic/getDirtyFields.ts","../node_modules/react-hook-form/src/logic/getFieldValueAs.ts","../node_modules/react-hook-form/src/logic/getFieldValue.ts","../node_modules/react-hook-form/src/logic/getResolverOptions.ts","../node_modules/react-hook-form/src/logic/getRuleValue.ts","../node_modules/react-hook-form/src/logic/hasValidation.ts","../node_modules/react-hook-form/src/logic/schemaErrorLookup.ts","../node_modules/react-hook-form/src/logic/skipValidation.ts","../node_modules/react-hook-form/src/logic/unsetEmptyArray.ts","../node_modules/react-hook-form/src/logic/createFormControl.ts","../node_modules/react-hook-form/src/useForm.ts","../node_modules/tslib/tslib.es6.mjs","../webpack/bootstrap","../webpack/runtime/compat get default export","../webpack/runtime/create fake namespace object","../webpack/runtime/define property getters","../webpack/runtime/ensure chunk","../webpack/runtime/get javascript chunk filename","../webpack/runtime/get mini-css chunk filename","../webpack/runtime/global","../webpack/runtime/harmony module decorator","../webpack/runtime/hasOwnProperty shorthand","../webpack/runtime/load script","../webpack/runtime/make namespace object","../webpack/runtime/node module decorator","../webpack/runtime/publicPath","../webpack/runtime/css loading","../webpack/runtime/jsonp chunk loading","../webpack/runtime/nonce","../node_modules/@tanstack/query-core/src/queryCache.ts","../node_modules/@tanstack/query-core/src/mutationCache.ts","../node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts","../node_modules/@tanstack/query-core/src/queryClient.ts","../node_modules/react-router-dom/dom.ts","../node_modules/react-router-dom/index.tsx","../node_modules/@sentry/src/debug-build.ts","../node_modules/@sentry/src/worldwide.ts","../node_modules/@sentry/src/logger.ts","../node_modules/@sentry/src/is.ts","../node_modules/@sentry/src/browser.ts","../node_modules/@sentry/src/string.ts","../node_modules/@sentry/src/object.ts","../node_modules/@sentry/src/misc.ts","../node_modules/@sentry/src/syncpromise.ts","../node_modules/@sentry/src/eventProcessors.ts","../node_modules/@sentry/src/time.ts","../node_modules/@sentry/src/constants.ts","../node_modules/@sentry/src/session.ts","../node_modules/@sentry/src/stacktrace.ts","../node_modules/@sentry/src/normalize.ts","../node_modules/@sentry/src/memo.ts","../node_modules/@sentry/src/baggage.ts","../node_modules/@sentry/src/tracing.ts","../node_modules/@sentry/src/utils/spanUtils.ts","../node_modules/@sentry/src/utils/prepareEvent.ts","../node_modules/@sentry/src/scope.ts","../node_modules/@sentry/src/exports.ts","../node_modules/@sentry/src/utils/getRootSpan.ts","../node_modules/@sentry/src/tracing/dynamicSamplingContext.ts","../node_modules/@sentry/src/utils/applyScopeDataToEvent.ts","../node_modules/@sentry/src/version.ts","../node_modules/@sentry/src/hub.ts","../node_modules/@sentry/src/integration.ts","../node_modules/@sentry/src/integrations/inboundfilters.ts","../node_modules/@sentry/src/integrations/functiontostring.ts","../node_modules/@sentry/src/sdk.ts","../node_modules/@sentry/src/dsn.ts","../node_modules/@sentry/src/api.ts","../node_modules/@sentry/src/supports.ts","../node_modules/@sentry/src/vendor/supportsHistory.ts","../node_modules/@sentry/src/instrument/_handlers.ts","../node_modules/@sentry/src/instrument/history.ts","../node_modules/@sentry/src/envelope.ts","../node_modules/@sentry/src/error.ts","../node_modules/@sentry/src/metrics/envelope.ts","../node_modules/@sentry/src/metrics/utils.ts","../node_modules/@sentry/src/baseclient.ts","../node_modules/@sentry/src/utils/sdkMetadata.ts","../node_modules/src/debug-build.ts","../node_modules/src/eventbuilder.ts","../node_modules/src/helpers.ts","../node_modules/src/client.ts","../node_modules/src/userfeedback.ts","../node_modules/@sentry/src/clientreport.ts","../node_modules/@sentry/src/instrument/console.ts","../node_modules/@sentry/src/instrument/dom.ts","../node_modules/@sentry/src/instrument/xhr.ts","../node_modules/@sentry/src/instrument/fetch.ts","../node_modules/@sentry/src/severity.ts","../node_modules/@sentry/src/url.ts","../node_modules/src/integrations/breadcrumbs.ts","../node_modules/src/integrations/dedupe.ts","../node_modules/@sentry/src/instrument/globalError.ts","../node_modules/@sentry/src/instrument/globalUnhandledRejection.ts","../node_modules/src/integrations/globalhandlers.ts","../node_modules/src/integrations/httpcontext.ts","../node_modules/@sentry/src/aggregate-errors.ts","../node_modules/src/integrations/linkederrors.ts","../node_modules/src/integrations/trycatch.ts","../node_modules/src/stack-parsers.ts","../node_modules/@sentry/src/promisebuffer.ts","../node_modules/@sentry/src/ratelimit.ts","../node_modules/@sentry/src/transports/base.ts","../node_modules/src/transports/utils.ts","../node_modules/src/transports/fetch.ts","../node_modules/src/transports/xhr.ts","../node_modules/src/sdk.ts","../node_modules/@sentry/src/metrics/metric-summary.ts","../node_modules/@sentry/src/semanticAttributes.ts","../node_modules/@sentry/src/tracing/spanstatus.ts","../node_modules/@sentry/src/tracing/span.ts","../node_modules/@sentry/src/utils/hasTracingEnabled.ts","../node_modules/@sentry/src/tracing/trace.ts","../node_modules/@sentry/src/tracing/transaction.ts","../node_modules/@sentry/src/tracing/idletransaction.ts","../node_modules/@sentry/src/tracing/utils.ts","../node_modules/@sentry/src/tracing/errors.ts","../node_modules/@sentry/src/tracing/sampling.ts","../node_modules/@sentry/src/tracing/hubextensions.ts","../node_modules/@sentry-internal/src/common/debug-build.ts","../node_modules/@sentry-internal/src/browser/types.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/bindReporter.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/getNavigationEntry.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/getActivationStart.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/initMetric.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/generateUniqueID.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/observe.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/onHidden.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getCLS.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/getVisibilityWatcher.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getFID.ts","../node_modules/@sentry-internal/src/browser/web-vitals/lib/polyfills/interactionCountPolyfill.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getINP.ts","../node_modules/@sentry-internal/src/browser/web-vitals/getLCP.ts","../node_modules/@sentry-internal/src/browser/web-vitals/onTTFB.ts","../node_modules/@sentry-internal/src/browser/instrument.ts","../node_modules/@sentry/src/span.ts","../node_modules/@sentry-internal/src/browser/metrics/utils.ts","../node_modules/@sentry-internal/src/browser/metrics/index.ts","../node_modules/@sentry/src/tracing/measurement.ts","../node_modules/@sentry-internal/src/common/fetch.ts","../node_modules/@sentry-internal/src/browser/request.ts","../node_modules/@sentry-internal/src/browser/browserTracingIntegration.ts","../node_modules/@sentry-internal/src/browser/backgroundtab.ts","../node_modules/@sentry/src/reactrouterv6.tsx","../node_modules/@sentry/src/buildPolyfills/_optionalChain.ts","../node_modules/@sentry/src/utils/isSentryRequestUrl.ts","../node_modules/@sentry/src/isBrowser.ts","../node_modules/src/constants.ts","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/utils.js","../node_modules/@sentry/src/buildPolyfills/_nullishCoalesce.ts","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/types/dist/rrweb-types.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/mutation.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/error-handler.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observer.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/cross-origin-iframe-mirror.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/iframe-manager.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/processed-node-manager.js","../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/index.js","../node_modules/src/types/rrweb.ts","../node_modules/src/util/timestamp.ts","../node_modules/src/coreHandlers/util/addBreadcrumbEvent.ts","../node_modules/src/coreHandlers/util/domUtils.ts","../node_modules/src/coreHandlers/util/onWindowOpen.ts","../node_modules/src/coreHandlers/handleClick.ts","../node_modules/src/util/createBreadcrumb.ts","../../node_modules/@sentry-internal/rrweb-snapshot/es/rrweb-snapshot.js","../node_modules/src/coreHandlers/util/getAttributesToRecord.ts","../node_modules/src/coreHandlers/handleDom.ts","../node_modules/src/coreHandlers/handleKeyboardEvent.ts","../node_modules/src/util/createPerformanceEntries.ts","../node_modules/src/coreHandlers/performanceObserver.ts","../replay-worker/build/npm/esm/worker.ts","../node_modules/src/util/log.ts","../node_modules/src/eventBuffer/error.ts","../node_modules/src/eventBuffer/EventBufferArray.ts","../node_modules/src/eventBuffer/WorkerHandler.ts","../node_modules/src/eventBuffer/EventBufferCompressionWorker.ts","../node_modules/src/eventBuffer/EventBufferProxy.ts","../node_modules/src/eventBuffer/index.ts","../replay-worker/build/npm/esm/index.js","../node_modules/src/util/hasSessionStorage.ts","../node_modules/src/session/clearSession.ts","../node_modules/src/util/isSampled.ts","../node_modules/src/session/Session.ts","../node_modules/src/session/saveSession.ts","../node_modules/src/session/createSession.ts","../node_modules/src/util/isExpired.ts","../node_modules/src/util/isSessionExpired.ts","../node_modules/src/session/shouldRefreshSession.ts","../node_modules/src/session/loadOrCreateSession.ts","../node_modules/src/session/fetchSession.ts","../node_modules/src/util/addEvent.ts","../node_modules/src/util/eventUtils.ts","../node_modules/src/coreHandlers/handleAfterSendEvent.ts","../node_modules/src/coreHandlers/handleBeforeSendEvent.ts","../node_modules/src/coreHandlers/handleGlobalEvent.ts","../node_modules/src/coreHandlers/util/addFeedbackBreadcrumb.ts","../node_modules/src/util/isRrwebError.ts","../node_modules/src/coreHandlers/util/shouldSampleForBufferEvent.ts","../node_modules/src/util/createPerformanceSpans.ts","../node_modules/src/coreHandlers/handleHistory.ts","../node_modules/src/coreHandlers/util/addNetworkBreadcrumb.ts","../node_modules/src/util/shouldFilterRequest.ts","../node_modules/src/coreHandlers/handleXhr.ts","../node_modules/src/coreHandlers/util/networkUtils.ts","../node_modules/src/coreHandlers/util/fetchUtils.ts","../node_modules/src/coreHandlers/util/xhrUtils.ts","../node_modules/src/coreHandlers/handleNetworkBreadcrumbs.ts","../node_modules/src/coreHandlers/handleFetch.ts","../node_modules/src/coreHandlers/handleScope.ts","../node_modules/src/util/addGlobalListeners.ts","../node_modules/src/util/addMemoryEntry.ts","../node_modules/src/util/handleRecordingEmit.ts","../node_modules/src/util/sendReplayRequest.ts","../node_modules/src/util/prepareRecordingData.ts","../node_modules/src/util/prepareReplayEvent.ts","../node_modules/src/util/createReplayEnvelope.ts","../node_modules/src/util/sendReplay.ts","../node_modules/src/util/throttle.ts","../node_modules/src/replay.ts","../node_modules/src/util/debounce.ts","../node_modules/src/util/getPrivacyOptions.ts","../node_modules/src/integration.ts","../node_modules/src/util/maskAttribute.ts","reportWebVitals.js","components/AppContext/AppProvider.js","../node_modules/@react-spring/shared/src/globals.ts","../node_modules/@react-spring/rafz/src/index.ts","../node_modules/@react-spring/shared/src/helpers.ts","../node_modules/@react-spring/shared/src/FrameLoop.ts","../node_modules/@react-spring/shared/src/clamp.ts","../node_modules/@react-spring/shared/src/colorMatchers.ts","../node_modules/@react-spring/shared/src/normalizeColor.ts","../node_modules/@react-spring/shared/src/colorToRgba.ts","../node_modules/@react-spring/shared/src/createInterpolator.ts","../node_modules/@react-spring/shared/src/easings.ts","../node_modules/@react-spring/shared/src/fluids.ts","../node_modules/@react-spring/shared/src/stringInterpolation.ts","../node_modules/@react-spring/shared/src/regexs.ts","../node_modules/@react-spring/shared/src/variableToRgba.ts","../node_modules/@react-spring/shared/src/deprecations.ts","../node_modules/@react-spring/shared/src/isAnimatedString.ts","../node_modules/@react-spring/shared/src/hooks/useIsomorphicLayoutEffect.ts","../node_modules/@react-spring/shared/src/hooks/useIsMounted.ts","../node_modules/@react-spring/shared/src/hooks/useForceUpdate.ts","../node_modules/@react-spring/shared/src/hooks/useOnce.ts","../node_modules/@react-spring/shared/src/hooks/useReducedMotion.ts","../node_modules/@react-spring/animated/src/Animated.ts","../node_modules/@react-spring/animated/src/AnimatedValue.ts","../node_modules/@react-spring/animated/src/AnimatedString.ts","../node_modules/@react-spring/animated/src/context.ts","../node_modules/@react-spring/animated/src/AnimatedObject.ts","../node_modules/@react-spring/animated/src/AnimatedArray.ts","../node_modules/@react-spring/animated/src/getAnimatedType.ts","../node_modules/@react-spring/animated/src/withAnimated.tsx","../node_modules/@react-spring/animated/src/createHost.ts","../node_modules/@react-spring/core/src/helpers.ts","../node_modules/@react-spring/core/src/constants.ts","../node_modules/@react-spring/core/src/AnimationConfig.ts","../node_modules/@react-spring/core/src/Animation.ts","../node_modules/@react-spring/core/src/scheduleProps.ts","../node_modules/@react-spring/core/src/AnimationResult.ts","../node_modules/@react-spring/core/src/runAsync.ts","../node_modules/@react-spring/core/src/FrameValue.ts","../node_modules/@react-spring/core/src/SpringPhase.ts","../node_modules/@react-spring/core/src/SpringValue.ts","../node_modules/@react-spring/core/src/Controller.ts","../node_modules/@react-spring/core/src/SpringContext.tsx","../node_modules/@react-spring/shared/src/hooks/useMemoOne.ts","../node_modules/@react-spring/core/src/SpringRef.ts","../node_modules/@react-spring/core/src/hooks/useTransition.tsx","../node_modules/@react-spring/shared/src/hooks/usePrev.ts","../node_modules/@react-spring/core/src/Interpolation.ts","../node_modules/@react-spring/core/src/globals.ts","../node_modules/@react-spring/web/src/applyAnimatedValues.ts","../node_modules/@react-spring/web/src/AnimatedStyle.ts","../node_modules/@react-spring/web/src/index.ts","../node_modules/@react-spring/shared/src/colors.ts","../node_modules/@react-spring/web/src/primitives.ts","../node_modules/@mui/material/utils/useSlot.js","../node_modules/@mui/material/Alert/alertClasses.js","../node_modules/@mui/material/internal/svg-icons/SuccessOutlined.js","../node_modules/@mui/material/internal/svg-icons/ReportProblemOutlined.js","../node_modules/@mui/material/internal/svg-icons/ErrorOutline.js","../node_modules/@mui/material/internal/svg-icons/InfoOutlined.js","../node_modules/@mui/material/Alert/Alert.js","components/Alerts/Alert.js","components/Alerts/Alerts.js","components/Alerts/AlertsProvider.js","components/LoadingPage.tsx","../node_modules/@mui/private-theming/useTheme/ThemeContext.js","../node_modules/@mui/private-theming/useTheme/useTheme.js","../node_modules/@mui/private-theming/ThemeProvider/nested.js","../node_modules/@mui/private-theming/ThemeProvider/ThemeProvider.js","../node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js","../node_modules/@mui/material/styles/ThemeProvider.js","../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../node_modules/react-tooltip/dist/react-tooltip.min.mjs","routes/PrivateRoute.js","../node_modules/@mui/material/Toolbar/toolbarClasses.js","../node_modules/@mui/material/Toolbar/Toolbar.js","../node_modules/@mui/material/Slide/Slide.js","../node_modules/@mui/material/Drawer/drawerClasses.js","../node_modules/@mui/material/Drawer/Drawer.js","../node_modules/@mui/material/AppBar/appBarClasses.js","../node_modules/@mui/material/AppBar/AppBar.js","../node_modules/react-google-places-autocomplete/node_modules/tslib/tslib.es6.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/createClass.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/createSuper.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../node_modules/react-google-places-autocomplete/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js","../node_modules/react-google-places-autocomplete/node_modules/stylis/dist/stylis.mjs","../node_modules/react-google-places-autocomplete/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@emotion/cache/dist/emotion-cache.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js","../node_modules/react-google-places-autocomplete/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/react-google-places-autocomplete/node_modules/react-is/cjs/react-is.development.js","../node_modules/react-google-places-autocomplete/node_modules/react-is/index.js","../node_modules/react-google-places-autocomplete/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../node_modules/react-google-places-autocomplete/node_modules/@emotion/utils/dist/emotion-utils.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@emotion/hash/dist/emotion-hash.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@emotion/react/dist/emotion-element-3838ba9e.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/extends.js","../node_modules/react-google-places-autocomplete/node_modules/@emotion/react/dist/emotion-react.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/react-google-places-autocomplete/node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js","../node_modules/react-google-places-autocomplete/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js","../node_modules/react-google-places-autocomplete/node_modules/react-select/dist/index-a86253bb.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","../node_modules/react-google-places-autocomplete/node_modules/memoize-one/dist/memoize-one.esm.js","../node_modules/react-google-places-autocomplete/node_modules/react-select/dist/Select-457c486b.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/inherits.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../node_modules/react-google-places-autocomplete/node_modules/react-select/dist/useStateManager-7e1e8489.esm.js","../node_modules/react-google-places-autocomplete/node_modules/react-select/dist/useAsync-fd9b28d9.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/typeof.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/toPrimitive.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/toPropertyKey.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/defineProperty.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/objectSpread2.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/classCallCheck.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/createClass.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/setPrototypeOf.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/inherits.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/getPrototypeOf.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/assertThisInitialized.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/createSuper.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/arrayLikeToArray.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/iterableToArray.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/nonIterableSpread.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/toConsumableArray.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/arrayWithHoles.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/nonIterableRest.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/slicedToArray.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/objectWithoutProperties.js","../node_modules/react-google-places-autocomplete/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js","../node_modules/react-google-places-autocomplete/node_modules/react-select/async/dist/react-select-async.esm.js","../node_modules/react-google-places-autocomplete/node_modules/@googlemaps/js-api-loader/dist/index.esm.js","../node_modules/react-google-places-autocomplete/src/helpers/autocompletion-request-builder.ts","../node_modules/react-google-places-autocomplete/src/hooks/use-fetch-suggestions.ts","../node_modules/react-google-places-autocomplete/node_modules/use-debounce/esm/useDebouncedCallback.js","../node_modules/react-google-places-autocomplete/src/google-places-autocomplete.tsx","../node_modules/react-google-places-autocomplete/src/hooks/use-places-service.ts","../node_modules/react-google-places-autocomplete/src/utils/geocode-by-place-id.ts","../node_modules/@mui/base/useSlider/useSlider.js","../node_modules/@mui/base/utils/areArraysEqual.js","../node_modules/@mui/material/utils/shouldSpreadAdditionalProps.js","../node_modules/@mui/material/Slider/sliderClasses.js","../node_modules/@mui/material/Slider/Slider.js","../node_modules/@mui/material/Slider/SliderValueLabel.js","services/appService.js","components/formControls/Place.js","../node_modules/@mui/material/LinearProgress/linearProgressClasses.js","../node_modules/@mui/material/LinearProgress/LinearProgress.js","components/ProgressBar.js","../node_modules/@mui/icons-material/esm/CheckCircleRounded.js","components/modals/ModalSuccess.js","../node_modules/@mui/icons-material/esm/Home.js","../node_modules/@mui/icons-material/esm/Edit.js","../node_modules/@mui/icons-material/esm/ArrowBack.js","../node_modules/@mui/icons-material/esm/ArrowUpwardOutlined.js","../node_modules/@mui/icons-material/esm/ArrowDownwardOutlined.js","pages/loanapp/LoanApp.js","../node_modules/@mui/icons-material/esm/NotificationImportant.js","components/HeaderNavigation.js","components/modals/ModalError.js","components/modals/ModalPleaseWait.tsx","../node_modules/@mui/icons-material/esm/Announcement.js","components/modals/ModalInfo.js","components/modals/ModalSessionExpired.js","components/Suspense.js","pages/auth/AuthWrapper.js","components/ChangePassword.js","../node_modules/react-intl/lib/src/components/message.js","pages/auth/CreateAccount.js","../node_modules/@mui/icons-material/esm/ReportProblemSharp.js","forms/SignInForm.js","pages/auth/SignIn.js","pages/auth/ForgotPassword.js","../node_modules/html-react-parser/index.mjs","components/landing/CondensedAppLinks.js","pages/open/HowToApplyView.js","../node_modules/@fortawesome/fontawesome-svg-core/index.mjs","../node_modules/@fortawesome/react-fontawesome/index.es.js","components/Footer.js","components/HeaderOpen.js","components/Carousel/Carousel.js","pages/open/LoanOfficerCenterView.js","pages/open/LoanOfficerCondensedView.js","../node_modules/assets/icons/Calendar.svg","../node_modules/assets/icons/Memories.svg","pages/open/Landing.js","components/pricing/RateForm.js","pages/open/pricing/Pricing.js","../node_modules/@mui/material/Table/TableContext.js","../node_modules/@mui/material/Table/tableClasses.js","../node_modules/@mui/material/Table/Table.js","../node_modules/@mui/material/Table/Tablelvl2Context.js","../node_modules/@mui/material/TableBody/tableBodyClasses.js","../node_modules/@mui/material/TableBody/TableBody.js","../node_modules/@mui/material/TableCell/tableCellClasses.js","../node_modules/@mui/material/TableCell/TableCell.js","../node_modules/@mui/material/TableContainer/tableContainerClasses.js","../node_modules/@mui/material/TableContainer/TableContainer.js","../node_modules/@mui/material/TableHead/tableHeadClasses.js","../node_modules/@mui/material/TableHead/TableHead.js","../node_modules/@mui/material/TableRow/tableRowClasses.js","../node_modules/@mui/material/TableRow/TableRow.js","components/pricing/PricingTable.js","pages/open/pricing/PricingResults.js","../node_modules/@mui/lab/TabContext/TabContext.js","../node_modules/@mui/lab/TabList/TabList.js","pages/open/pricing/RateAndPayment.js","pages/protected/Fees.js","pages/open/pricing/Amortization.js","pages/open/pricing/PricingDetails.js","pages/open/Disclosures.js","components/modals/ModalAppError.js","components/modals/ModalTutorial.js","components/modals/ModalAddCoBorrower.js","components/modals/ModalWizard.js","components/modals/ModalLoanAppSelector.js","components/modals/ModalNewUser.js","components/modals/ModalWorkflowSelector.js","pages/protected/Portal.js","components/modals/ModalUploadSizeLimit.js","../node_modules/react-color/es/helpers/checkboard.js","../node_modules/react-color/es/components/common/Checkboard.js","../node_modules/react-color/es/components/common/Alpha.js","../node_modules/react-color/es/helpers/alpha.js","../node_modules/react-color/es/components/common/EditableInput.js","../node_modules/react-color/es/helpers/hue.js","../node_modules/react-color/es/components/common/Hue.js","../node_modules/lodash-es/_listCacheClear.js","../node_modules/lodash-es/eq.js","../node_modules/lodash-es/_assocIndexOf.js","../node_modules/lodash-es/_listCacheDelete.js","../node_modules/lodash-es/_listCacheGet.js","../node_modules/lodash-es/_listCacheHas.js","../node_modules/lodash-es/_listCacheSet.js","../node_modules/lodash-es/_ListCache.js","../node_modules/lodash-es/_stackClear.js","../node_modules/lodash-es/_stackDelete.js","../node_modules/lodash-es/_stackGet.js","../node_modules/lodash-es/_stackHas.js","../node_modules/lodash-es/_freeGlobal.js","../node_modules/lodash-es/_root.js","../node_modules/lodash-es/_Symbol.js","../node_modules/lodash-es/_getRawTag.js","../node_modules/lodash-es/_objectToString.js","../node_modules/lodash-es/_baseGetTag.js","../node_modules/lodash-es/isObject.js","../node_modules/lodash-es/isFunction.js","../node_modules/lodash-es/_coreJsData.js","../node_modules/lodash-es/_isMasked.js","../node_modules/lodash-es/_toSource.js","../node_modules/lodash-es/_baseIsNative.js","../node_modules/lodash-es/_getValue.js","../node_modules/lodash-es/_getNative.js","../node_modules/lodash-es/_Map.js","../node_modules/lodash-es/_nativeCreate.js","../node_modules/lodash-es/_hashClear.js","../node_modules/lodash-es/_hashDelete.js","../node_modules/lodash-es/_hashGet.js","../node_modules/lodash-es/_hashHas.js","../node_modules/lodash-es/_hashSet.js","../node_modules/lodash-es/_Hash.js","../node_modules/lodash-es/_mapCacheClear.js","../node_modules/lodash-es/_isKeyable.js","../node_modules/lodash-es/_getMapData.js","../node_modules/lodash-es/_mapCacheDelete.js","../node_modules/lodash-es/_mapCacheGet.js","../node_modules/lodash-es/_mapCacheHas.js","../node_modules/lodash-es/_mapCacheSet.js","../node_modules/lodash-es/_MapCache.js","../node_modules/lodash-es/_stackSet.js","../node_modules/lodash-es/_Stack.js","../node_modules/lodash-es/_defineProperty.js","../node_modules/lodash-es/_baseAssignValue.js","../node_modules/lodash-es/_assignMergeValue.js","../node_modules/lodash-es/_createBaseFor.js","../node_modules/lodash-es/_baseFor.js","../node_modules/lodash-es/_cloneBuffer.js","../node_modules/lodash-es/_Uint8Array.js","../node_modules/lodash-es/_cloneArrayBuffer.js","../node_modules/lodash-es/_cloneTypedArray.js","../node_modules/lodash-es/_copyArray.js","../node_modules/lodash-es/_baseCreate.js","../node_modules/lodash-es/_overArg.js","../node_modules/lodash-es/_getPrototype.js","../node_modules/lodash-es/_isPrototype.js","../node_modules/lodash-es/_initCloneObject.js","../node_modules/lodash-es/isObjectLike.js","../node_modules/lodash-es/_baseIsArguments.js","../node_modules/lodash-es/isArguments.js","../node_modules/lodash-es/isArray.js","../node_modules/lodash-es/isLength.js","../node_modules/lodash-es/isArrayLike.js","../node_modules/lodash-es/isArrayLikeObject.js","../node_modules/lodash-es/stubFalse.js","../node_modules/lodash-es/isBuffer.js","../node_modules/lodash-es/isPlainObject.js","../node_modules/lodash-es/_baseIsTypedArray.js","../node_modules/lodash-es/_baseUnary.js","../node_modules/lodash-es/_nodeUtil.js","../node_modules/lodash-es/isTypedArray.js","../node_modules/lodash-es/_safeGet.js","../node_modules/lodash-es/_assignValue.js","../node_modules/lodash-es/_copyObject.js","../node_modules/lodash-es/_baseTimes.js","../node_modules/lodash-es/_isIndex.js","../node_modules/lodash-es/_arrayLikeKeys.js","../node_modules/lodash-es/_nativeKeysIn.js","../node_modules/lodash-es/_baseKeysIn.js","../node_modules/lodash-es/keysIn.js","../node_modules/lodash-es/toPlainObject.js","../node_modules/lodash-es/_baseMergeDeep.js","../node_modules/lodash-es/_baseMerge.js","../node_modules/lodash-es/identity.js","../node_modules/lodash-es/_apply.js","../node_modules/lodash-es/_overRest.js","../node_modules/lodash-es/constant.js","../node_modules/lodash-es/_baseSetToString.js","../node_modules/lodash-es/_shortOut.js","../node_modules/lodash-es/_setToString.js","../node_modules/lodash-es/_baseRest.js","../node_modules/lodash-es/_isIterateeCall.js","../node_modules/lodash-es/_createAssigner.js","../node_modules/lodash-es/merge.js","../node_modules/react-color/es/components/common/Raised.js","../node_modules/lodash-es/now.js","../node_modules/lodash-es/_trimmedEndIndex.js","../node_modules/lodash-es/_baseTrim.js","../node_modules/lodash-es/isSymbol.js","../node_modules/lodash-es/toNumber.js","../node_modules/lodash-es/debounce.js","../node_modules/lodash-es/throttle.js","../node_modules/react-color/es/helpers/saturation.js","../node_modules/react-color/es/components/common/Saturation.js","../node_modules/lodash-es/_arrayEach.js","../node_modules/lodash-es/_nativeKeys.js","../node_modules/lodash-es/_baseKeys.js","../node_modules/lodash-es/keys.js","../node_modules/lodash-es/_createBaseEach.js","../node_modules/lodash-es/_baseEach.js","../node_modules/lodash-es/_baseForOwn.js","../node_modules/lodash-es/_castFunction.js","../node_modules/lodash-es/forEach.js","../node_modules/tinycolor2/esm/tinycolor.js","../node_modules/react-color/es/helpers/color.js","../node_modules/react-color/es/components/common/ColorWrap.js","../node_modules/react-color/es/helpers/interaction.js","../node_modules/react-color/es/components/common/Swatch.js","../node_modules/react-color/es/components/alpha/AlphaPointer.js","../node_modules/react-color/es/components/alpha/Alpha.js","../node_modules/lodash-es/_arrayMap.js","../node_modules/lodash-es/_setCacheAdd.js","../node_modules/lodash-es/_setCacheHas.js","../node_modules/lodash-es/_SetCache.js","../node_modules/lodash-es/_arraySome.js","../node_modules/lodash-es/_cacheHas.js","../node_modules/lodash-es/_equalArrays.js","../node_modules/lodash-es/_mapToArray.js","../node_modules/lodash-es/_setToArray.js","../node_modules/lodash-es/_equalByTag.js","../node_modules/lodash-es/_arrayPush.js","../node_modules/lodash-es/_baseGetAllKeys.js","../node_modules/lodash-es/_arrayFilter.js","../node_modules/lodash-es/stubArray.js","../node_modules/lodash-es/_getSymbols.js","../node_modules/lodash-es/_getAllKeys.js","../node_modules/lodash-es/_equalObjects.js","../node_modules/lodash-es/_DataView.js","../node_modules/lodash-es/_Promise.js","../node_modules/lodash-es/_Set.js","../node_modules/lodash-es/_WeakMap.js","../node_modules/lodash-es/_getTag.js","../node_modules/lodash-es/_baseIsEqualDeep.js","../node_modules/lodash-es/_baseIsEqual.js","../node_modules/lodash-es/_baseIsMatch.js","../node_modules/lodash-es/_isStrictComparable.js","../node_modules/lodash-es/_getMatchData.js","../node_modules/lodash-es/_matchesStrictComparable.js","../node_modules/lodash-es/_baseMatches.js","../node_modules/lodash-es/_isKey.js","../node_modules/lodash-es/memoize.js","../node_modules/lodash-es/_stringToPath.js","../node_modules/lodash-es/_memoizeCapped.js","../node_modules/lodash-es/_baseToString.js","../node_modules/lodash-es/toString.js","../node_modules/lodash-es/_castPath.js","../node_modules/lodash-es/_toKey.js","../node_modules/lodash-es/_baseGet.js","../node_modules/lodash-es/get.js","../node_modules/lodash-es/_baseHasIn.js","../node_modules/lodash-es/_hasPath.js","../node_modules/lodash-es/hasIn.js","../node_modules/lodash-es/_baseMatchesProperty.js","../node_modules/lodash-es/_baseProperty.js","../node_modules/lodash-es/_basePropertyDeep.js","../node_modules/lodash-es/property.js","../node_modules/lodash-es/_baseIteratee.js","../node_modules/lodash-es/_baseMap.js","../node_modules/lodash-es/map.js","../node_modules/react-color/es/components/block/BlockSwatches.js","../node_modules/react-color/es/components/block/Block.js","../node_modules/material-colors/dist/colors.es2015.js","../node_modules/react-color/es/components/circle/CircleSwatch.js","../node_modules/react-color/es/components/circle/Circle.js","../node_modules/lodash-es/isUndefined.js","../node_modules/react-color/es/components/chrome/ChromeFields.js","../node_modules/react-color/es/components/chrome/ChromePointer.js","../node_modules/react-color/es/components/chrome/ChromePointerCircle.js","../node_modules/react-color/es/components/chrome/Chrome.js","../node_modules/react-color/es/components/compact/CompactColor.js","../node_modules/react-color/es/components/compact/CompactFields.js","../node_modules/react-color/es/components/compact/Compact.js","../node_modules/react-color/es/components/github/GithubSwatch.js","../node_modules/react-color/es/components/github/Github.js","../node_modules/react-color/es/components/hue/HuePointer.js","../node_modules/react-color/es/components/hue/Hue.js","../node_modules/react-color/es/components/material/Material.js","../node_modules/react-color/es/components/photoshop/PhotoshopFields.js","../node_modules/react-color/es/components/photoshop/PhotoshopPointerCircle.js","../node_modules/react-color/es/components/photoshop/PhotoshopPointer.js","../node_modules/react-color/es/components/photoshop/PhotoshopButton.js","../node_modules/react-color/es/components/photoshop/PhotoshopPreviews.js","../node_modules/react-color/es/components/photoshop/Photoshop.js","../node_modules/react-color/es/components/sketch/SketchFields.js","../node_modules/react-color/es/components/sketch/SketchPresetColors.js","../node_modules/react-color/es/components/sketch/Sketch.js","../node_modules/react-color/es/components/slider/SliderSwatch.js","../node_modules/react-color/es/components/slider/SliderSwatches.js","../node_modules/react-color/es/components/slider/SliderPointer.js","../node_modules/react-color/es/components/slider/Slider.js","../node_modules/react-color/es/components/swatches/SwatchesColor.js","../node_modules/react-color/es/components/swatches/SwatchesGroup.js","../node_modules/react-color/es/components/swatches/Swatches.js","../node_modules/react-color/es/components/twitter/Twitter.js","../node_modules/react-color/es/components/google/GooglePointerCircle.js","../node_modules/react-color/es/components/google/GooglePointer.js","../node_modules/react-color/es/components/google/GoogleFields.js","../node_modules/react-color/es/components/google/Google.js","components/modals/ModalColorPicker.js","components/InheritanceButton.tsx","components/formControls/InheritedTextField.tsx","components/admin/NoImagePlaceholder.tsx","components/admin/WebsiteSettings.js","components/formControls/TextEditor.js","pages/protected/userProfile/forms/DeleteMeForm.js","components/modals/ModalDeleteMe.tsx","../node_modules/@mui/material/Stepper/stepperClasses.js","../node_modules/@mui/material/Stepper/StepperContext.js","../node_modules/@mui/material/Step/StepContext.js","../node_modules/@mui/material/StepConnector/stepConnectorClasses.js","../node_modules/@mui/material/StepConnector/StepConnector.js","../node_modules/@mui/material/Stepper/Stepper.js","../node_modules/@mui/material/Step/stepClasses.js","../node_modules/@mui/material/Step/Step.js","../node_modules/@mui/material/internal/svg-icons/CheckCircle.js","../node_modules/@mui/material/internal/svg-icons/Warning.js","../node_modules/@mui/material/StepIcon/stepIconClasses.js","../node_modules/@mui/material/StepIcon/StepIcon.js","../node_modules/@mui/material/StepLabel/stepLabelClasses.js","../node_modules/@mui/material/StepLabel/StepLabel.js","forms/MobilePhoneForm.js","forms/AuthCodeForm.js","components/ResendVerificationCodeLink.js","components/MobilePhoneVerificationStepper.js","components/MobilePhoneVerification.js","components/modals/ModalMobilePhoneVerificationModal.js","pages/protected/userProfile/UserProfileSettings.js","components/StateLicensesList.js","pages/protected/userProfile/forms/UserProfileForm.tsx","pages/protected/userProfile/forms/SmsOptInForm.tsx","pages/protected/userProfile/UserProfile.js","pages/protected/QuickPricer.js","pages/protected/pipeline/components/PipelineExpandedRow.js","pages/protected/pipeline/forms/ImportLoanForm.js","pages/protected/pipeline/components/LoansTab.tsx","components/formControls/Autocomplete.tsx","pages/protected/pipeline/forms/AssignLoanOfficerForm.tsx","pages/protected/pipeline/components/AssignLoanOfficerModal.tsx","pages/protected/pipeline/components/AutocompleteSearchFilter.tsx","pages/protected/pipeline/components/SearchFiltersLoanDraftsTab.tsx","components/modals/ConfirmModal.tsx","pages/protected/pipeline/components/LoanDrafts.tsx","pages/protected/pipeline/Pipeline.tsx","components/loanAppDetails/LoanDetailsCard.js","../node_modules/react-circular-progressbar/src/constants.ts","../node_modules/react-circular-progressbar/src/Path.tsx","../node_modules/react-circular-progressbar/src/CircularProgressbar.tsx","components/MobileStepper.js","components/loanAppDetails/LoanMilestoneStep.js","components/loanAppDetails/LoanMilestones.js","components/loanAppDetails/LoanInfo.js","components/loanAppDetails/PersonalInfo.js","components/loanAppDetails/RealEstateOwned.js","components/loanAppDetails/EmploymentIncome.js","components/loanAppDetails/Assets.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@kurkle/color/dist/color.esm.js","../node_modules/chart.js/src/helpers/helpers.core.ts","../node_modules/chart.js/src/helpers/helpers.math.ts","../node_modules/chart.js/src/helpers/helpers.collection.ts","../node_modules/chart.js/src/helpers/helpers.extras.ts","../node_modules/chart.js/src/helpers/helpers.easing.ts","../node_modules/chart.js/src/helpers/helpers.color.ts","../node_modules/chart.js/src/core/core.animations.defaults.js","../node_modules/chart.js/src/helpers/helpers.intl.ts","../node_modules/chart.js/src/core/core.ticks.js","../node_modules/chart.js/src/core/core.defaults.js","../node_modules/chart.js/src/core/core.layouts.defaults.js","../node_modules/chart.js/src/core/core.scale.defaults.js","../node_modules/chart.js/src/helpers/helpers.canvas.ts","../node_modules/chart.js/src/helpers/helpers.options.ts","../node_modules/chart.js/src/helpers/helpers.config.ts","../node_modules/chart.js/src/helpers/helpers.curve.ts","../node_modules/chart.js/src/helpers/helpers.dom.ts","../node_modules/chart.js/src/helpers/helpers.interpolation.ts","../node_modules/chart.js/src/helpers/helpers.rtl.ts","../node_modules/chart.js/src/helpers/helpers.segment.js","../node_modules/chart.js/src/core/core.animator.js","../node_modules/chart.js/src/core/core.animation.js","../node_modules/chart.js/src/core/core.animations.js","../node_modules/chart.js/src/core/core.datasetController.js","../node_modules/chart.js/src/controllers/controller.bar.js","../node_modules/chart.js/src/controllers/controller.bubble.js","../node_modules/chart.js/src/controllers/controller.doughnut.js","../node_modules/chart.js/src/controllers/controller.line.js","../node_modules/chart.js/src/controllers/controller.polarArea.js","../node_modules/chart.js/src/controllers/controller.pie.js","../node_modules/chart.js/src/controllers/controller.radar.js","../node_modules/chart.js/src/controllers/controller.scatter.js","../node_modules/chart.js/src/core/core.adapters.ts","../node_modules/chart.js/src/core/core.interaction.js","../node_modules/chart.js/src/core/core.layouts.js","../node_modules/chart.js/src/platform/platform.base.js","../node_modules/chart.js/src/platform/platform.basic.js","../node_modules/chart.js/src/platform/platform.dom.js","../node_modules/chart.js/src/core/core.element.ts","../node_modules/chart.js/src/core/core.scale.autoskip.js","../node_modules/chart.js/src/core/core.scale.js","../node_modules/chart.js/src/core/core.typedRegistry.js","../node_modules/chart.js/src/core/core.registry.js","../node_modules/chart.js/src/core/core.plugins.js","../node_modules/chart.js/src/core/core.config.js","../node_modules/chart.js/src/core/core.controller.js","../node_modules/chart.js/src/platform/index.js","../node_modules/chart.js/src/elements/element.arc.ts","../node_modules/chart.js/src/elements/element.line.js","../node_modules/chart.js/src/elements/element.point.ts","../node_modules/chart.js/src/elements/element.bar.js","../node_modules/chart.js/src/plugins/plugin.legend.js","../node_modules/chart.js/src/plugins/plugin.subtitle.js","../node_modules/chart.js/src/plugins/plugin.tooltip.js","../node_modules/chart.js/src/scales/scale.category.js","../node_modules/chart.js/src/scales/scale.linearbase.js","../node_modules/chart.js/src/scales/scale.linear.js","../node_modules/chart.js/src/scales/scale.logarithmic.js","../node_modules/chart.js/src/scales/scale.radialLinear.js","../node_modules/chart.js/src/scales/scale.time.js","../node_modules/chart.js/src/scales/scale.timeseries.js","../node_modules/react-chartjs-2/src/utils.ts","../node_modules/react-chartjs-2/src/chart.tsx","../node_modules/react-chartjs-2/src/typedCharts.tsx","components/loanAppDetails/MonthlyPaymentChart.js","components/loanAppDetails/LoanStatus.js","components/loanAppDetails/LoanUsersTable.js","contexts/LoanSignalRContext.tsx","hooks/useUserAgent.ts","contexts/LoanContext.tsx","pages/protected/loanDetails/LoanDetailsContent.tsx","components/loan/LoanLockedAlert.tsx","components/loan/LoanSummary.tsx","components/loan/LoanHeader.tsx","components/LoanPage.tsx","pages/protected/loanDetails/LoanDetails.tsx","pages/protected/tasks/components/TaskStatusBadge.tsx","../node_modules/@mui/material/Pagination/paginationClasses.js","../node_modules/@mui/material/usePagination/usePagination.js","../node_modules/@mui/material/PaginationItem/paginationItemClasses.js","../node_modules/@mui/material/internal/svg-icons/FirstPage.js","../node_modules/@mui/material/internal/svg-icons/LastPage.js","../node_modules/@mui/material/internal/svg-icons/NavigateBefore.js","../node_modules/@mui/material/internal/svg-icons/NavigateNext.js","../node_modules/@mui/material/PaginationItem/PaginationItem.js","../node_modules/@mui/material/Pagination/Pagination.js","pages/protected/tasks/components/TaskCommentForm.tsx","pages/protected/tasks/components/TaskCommentModal.tsx","pages/protected/tasks/components/ChatBubble.tsx","pages/protected/tasks/components/LeaveCommentButton.tsx","pages/protected/tasks/components/CommentPaginatedList.tsx","../node_modules/@mui/icons-material/esm/Check.js","pages/protected/tasks/components/TaskDetailsTab.tsx","pages/protected/tasks/components/TaskRowExpanded.tsx","pages/protected/tasks/components/TaskTypeLabel.js","components/RefreshButton.js","../node_modules/@mui/utils/getValidReactChildren/getValidReactChildren.js","../node_modules/@mui/material/ButtonGroup/buttonGroupClasses.js","../node_modules/@mui/material/ButtonGroup/ButtonGroup.js","../node_modules/@mui/base/ClickAwayListener/ClickAwayListener.js","components/ErrorText.js","pages/protected/tasks/forms/TaskCheckboxForm.js","pages/protected/tasks/components/TaskListItem.js","components/formControls/TaskLosTargetField.js","components/formControls/NumberField.tsx","forms/TaskForm.tsx","pages/protected/tasks/components/TaskImportStepper.js","pages/protected/tasks/components/ModalImportTasks.js","components/modals/ModalTaskForm.tsx","pages/protected/tasks/components/AddTaskButtonGroup.js","pages/protected/tasks/components/TaskActionButton.tsx","pages/protected/tasks/forms/LoanTaskFieldForm.tsx","pages/protected/tasks/forms/LoanTaskDocumentForm.tsx","pages/protected/tasks/helpers.ts","pages/protected/tasks/components/Verification.tsx","pages/protected/tasks/components/ModalLoanTask.tsx","pages/protected/tasks/components/LoanTaskActionButton.tsx","pages/protected/tasks/components/LoanTaskSummary.js","pages/protected/tasks/hooks/useTask.js","pages/protected/tasks/components/TaskSearchFilters.js","pages/protected/tasks/components/ModalImportDiffTasks.js","../node_modules/@mui/icons-material/esm/InfoOutlined.js","../node_modules/@mui/icons-material/esm/CheckCircleOutlined.js","../node_modules/@mui/icons-material/esm/WarningOutlined.js","../node_modules/@mui/icons-material/esm/ErrorOutlineOutlined.js","components/AlertBox.tsx","pages/protected/tasks/components/LoanTaskDiffAlert.js","pages/protected/tasks/components/LoanTaskReminderAlert.js","pages/protected/tasks/components/TaskRowName.js","pages/protected/tasks/TasksContent.js","pages/protected/tasks/Tasks.tsx","../node_modules/@mui/material/Collapse/collapseClasses.js","../node_modules/@mui/material/Collapse/Collapse.js","components/modals/ModalDocumentType.js","../node_modules/@mui/material/Icon/iconClasses.js","../node_modules/@mui/material/Icon/Icon.js","components/modals/ModalDocumentDragOrUpload.js","components/modals/ModalUploadMimeType.js","pages/protected/loanDocuments/LoanDocumentsContent.js","pages/protected/loanDocuments/LoanDocuments.tsx","components/lo/LOCalculatorForm.js","components/lo/LOLockedCalculatorForm.js","components/lo/LOCalculatorResults.js","components/lo/LOLoanComparisonScenario.js","components/lo/LOLoanComparisonForm.js","forms/GenerateLoanDocumentForm.tsx","components/modals/ModalGenerateLoanDocumentSelector.tsx","forms/ASOTriggersForm.js","components/modals/ModalAutomatedServices.js","pages/protected/loanCalculator/LoanCalculatorContent.js","pages/protected/loanCalculator/LoanCalculator.tsx","pages/protected/LoanPricingResults.js","pages/admin/Account/Profile.js","components/admin/Integrations.js","forms/AccountForm.js","components/admin/AccountSettings.js","../node_modules/@mui/material/ToggleButtonGroup/toggleButtonGroupClasses.js","../node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupContext.js","../node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupButtonContext.js","../node_modules/@mui/material/ToggleButton/toggleButtonClasses.js","../node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroup.js","../node_modules/@mui/material/ToggleButtonGroup/isValueSelected.js","../node_modules/@mui/material/ToggleButton/ToggleButton.js","components/modals/ModalMilestoneConfiguration.js","components/admin/MilestoneConfigurations.js","pages/admin/Account/AccountEdit.js","pages/admin/Rules/forms/BusinessRuleFilterValueSelect.js","pages/admin/Rules/forms/BusinessRuleForm.js","pages/admin/Rules/components/ModalBusinessRuleForm.js","components/formControls/ActiveDeletedSelect.js","pages/admin/Rules/components/RuleRowExpanded.js","components/InfoTooltip.tsx","pages/admin/Rules/RulesList.js","pages/admin/Rules/GlobalTasks.tsx","pages/admin/Rules/Rules.tsx","pages/admin/Rules/components/AddRuleTaskButtonGroup.js","components/formControls/taskAutocomplete/TaskAutocomplete.js","components/formControls/taskAutocomplete/TaskAutocompleteField.js","forms/ExistingTaskForm.js","pages/admin/Rules/components/ModalExistingTaskForm.js","pages/admin/Rules/components/TaskRowExpanded.js","pages/admin/Rules/RuleTasks.js","pages/admin/Corporations/CorporationExpandedRow.js","components/modals/ConfirmDeleteModal.tsx","pages/admin/SiteConfigurationPage.tsx","pages/admin/Corporations/Corporations.tsx","components/formControls/InheritedSwitch.tsx","components/admin/Features.js","components/admin/StateLicenses.js","pages/admin/Corporations/Profile.js","pages/admin/Corporations/CorporateEdit.js","pages/admin/LoanOfficers/LoanOfficerExpandedRow.js","pages/admin/Partners/UserSiteConfigurationSearchFilters.tsx","pages/admin/LoanOfficers/LoanOfficers.tsx","pages/admin/LoanOfficers/Profile.js","pages/admin/LoanOfficers/LoanOfficerEdit.js","pages/admin/Branches/BranchExpandedRow.js","pages/admin/Branches/BranchesSearchFilters.tsx","pages/admin/Branches/Branches.tsx","pages/admin/Branches/Profile.js","pages/admin/Branches/BranchEdit.js","workflows/user-questions.js","components/modals/ModalUser.js","components/modals/ModalChangePassword.js","pages/admin/Users/Users.js","pages/admin/NotificationTemplates/NotificationExpandedRow.js","pages/admin/NotificationTemplates/NotificationTemplates.js","pages/admin/Partners/PartnersExpandedRow.js","pages/admin/Partners/Partners.tsx","pages/admin/Partners/Profile.js","pages/admin/Partners/PartnerEdit.js","pages/admin/Workflows/WorkflowExpandedRow.js","pages/admin/Workflows/Workflows.js","components/modals/ModalWorkflowQuestion.js","components/versions/VersionListItem.js","components/versions/VersionList.js","components/modals/ModalVersionList.js","components/versions/VersionSelector.js","deprecated/forms/NewVersionForm.js","deprecated/modals/ModalNewVersion.js","pages/admin/Workflows/WorkflowEdit.js","pages/admin/Devices/DeviceRowExpanded.js","pages/admin/Devices/Devices.js","pages/admin/Devices/Profile.js","../node_modules/@mui/icons-material/esm/Add.js","../node_modules/@mui/icons-material/esm/Delete.js","../node_modules/@mui/icons-material/esm/Close.js","pages/admin/Devices/Apps.js","pages/admin/Devices/RemoteInfo.js","pages/admin/Devices/DeviceEdit.js","pages/admin/DocumentTemplates/TemplateExpandedRow.js","pages/admin/DocumentTemplates/DocumentTemplates.js","pages/protected/partners/Current.js","pages/protected/partners/Prospects.js","pages/protected/partners/Partners.js","../node_modules/@sentry/src/errorboundary.tsx","components/ErrorBoundary.js","pages/auth/AuthPage.js","pages/auth/SMSVerification.js","pages/auth/AuthChallenge.js","pages/open/DisclosuresSSO.js","pages/protected/incompleteLoans/IncompleteLoans.tsx","App.js","pages/open/Maintenance.js","../node_modules/@mui/material/CssBaseline/CssBaseline.js","pages/open/SiteNotFound.js","AppTheme.js","../node_modules/@formatjs/intl/lib/src/message.js","../node_modules/@formatjs/intl/lib/src/dateTime.js","../node_modules/@formatjs/intl/lib/src/displayName.js","../node_modules/@formatjs/intl/lib/src/list.js","../node_modules/@formatjs/intl/lib/src/number.js","../node_modules/@formatjs/intl/lib/src/plural.js","../node_modules/@formatjs/intl/lib/src/relativeTime.js","../node_modules/@formatjs/intl/lib/src/create-intl.js","../node_modules/react-intl/lib/src/components/createIntl.js","../node_modules/react-intl/lib/src/components/provider.js","i18n/index.ts","i18n/en.ts","i18n/es.ts","contexts/LanguageContext.tsx","index.tsx"],"sourceRoot":"","sourcesContent":["import { noop } from 'lodash'\nimport { createContext, useContext } from 'react'\n\nexport const AlertsDispatchContext = createContext({\n\tdispatch: noop,\n})\n\nexport function useAlertsDispatch() {\n\treturn useContext(AlertsDispatchContext)\n}\n\nexport const AlertsStateContext = createContext({\n\tstate: { alerts: [] },\n})\n\nexport function useAlertsState() {\n\treturn useContext(AlertsStateContext)\n}\n","import { v4 as uuidV4 } from 'uuid'\n\nexport const alertsActions = {\n\tadd: 'add',\n\tremove: 'remove',\n\tclear: 'clear',\n}\n\nexport const reducer = (state = {}, action) => {\n\tswitch (action.type) {\n\t\tcase alertsActions.add:\n\t\t\tconst id = uuidV4()\n\t\t\tconst { text, severity = 'success' } = action.payload\n\n\t\t\tconst alerts = [...state.alerts]\n\t\t\talerts.unshift({ text, severity, id })\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\talerts,\n\t\t\t}\n\t\tcase alertsActions.remove:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\talerts: state.alerts.filter(\n\t\t\t\t\t(alert) => alert.id !== action.payload\n\t\t\t\t),\n\t\t\t}\n\t\tcase alertsActions.clear:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\talerts: [],\n\t\t\t}\n\t\tdefault:\n\t\t\tconsole.info({ action })\n\t\t\tthrow new Error('Unknown Action')\n\t}\n}\n","import { useCallback } from 'react'\nimport { useAppContext } from './index'\nimport { appActions } from './AppReducer'\nimport { navigationLinking } from '../../services/navigation'\nimport { useMixpanel } from '../../hooks/useMixpanel'\nimport { useQueryClient } from '@tanstack/react-query'\n\nexport const useAppContextActions = () => {\n\tconst { dispatch } = useAppContext()\n\tconst mixpanel = useMixpanel()\n\tconst queryClient = useQueryClient()\n\n\tconst applySiteConfig = useCallback((siteConfig) => {\n\t\tdispatch({\n\t\t\ttype: appActions.setSiteConfig,\n\t\t\tpayload: { ...siteConfig },\n\t\t})\n\t}, [])\n\n\tconst applyAuthToken = useCallback(\n\t\t(authToken) => {\n\t\t\tdispatch({\n\t\t\t\ttype: appActions.setAuthToken,\n\t\t\t\tpayload: authToken,\n\t\t\t})\n\t\t},\n\t\t[dispatch]\n\t)\n\n\tconst applyUser = useCallback((user) => {\n\t\tconst payload = {\n\t\t\t...user,\n\t\t\temail: !user?.impersonatedBy ? user.email : user.impersonatedBy,\n\t\t}\n\t\tdispatch({\n\t\t\ttype: appActions.setUser,\n\t\t\tpayload,\n\t\t})\n\t}, [])\n\n\tconst applyInvite = useCallback((invite) => {\n\t\tdispatch({\n\t\t\ttype: appActions.setInvite,\n\t\t\tpayload: invite,\n\t\t})\n\t}, [])\n\n\tconst applyRedirectUrl = useCallback((url) => {\n\t\tdispatch({\n\t\t\ttype: appActions.setRedirectUrl,\n\t\t\tpayload: url,\n\t\t})\n\t}, [])\n\n\tconst applyImpersonationRequest = useCallback((request) => {\n\t\tdispatch({\n\t\t\ttype: appActions.setImpersonationRequest,\n\t\t\tpayload: request,\n\t\t})\n\t}, [])\n\n\tconst logOut = useCallback(\n\t\t(route = `/${navigationLinking.SignIn}`) => {\n\t\t\tmixpanel.reset()\n\t\t\tqueryClient.clear()\n\t\t\twindow.location.href = '/'\n\t\t},\n\t\t[]\n\t)\n\n\treturn {\n\t\tapplySiteConfig,\n\t\tapplyAuthToken,\n\t\tapplyUser,\n\t\tapplyInvite,\n\t\tapplyRedirectUrl,\n\t\tapplyImpersonationRequest,\n\t\tlogOut,\n\t}\n}\n","export const appActions = {\n\tsetSiteConfig: 'setSiteConfig',\n\tsetAuthToken: 'setAuthToken',\n\tsetUser: 'setUser',\n\tsetInvite: 'setInvite',\n\tlogOut: 'logOut',\n\tsetRedirectUrl: 'setRedirectUrl',\n\tsetImpersonationRequest: 'setImpersonationRequest',\n}\n\nexport const reducer = (state = {}, action) => {\n\tswitch (action.type) {\n\t\tcase appActions.setSiteConfig:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tsiteConfig: action.payload.siteConfig,\n\t\t\t\tsocialLinks: action.payload.socialLinks,\n\t\t\t\tlegalLinks: action.payload.legalLinks,\n\t\t\t\terrorStatus: action.payload.errorStatus,\n\t\t\t}\n\t\tcase appActions.setAuthToken:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tauthToken: action.payload,\n\t\t\t}\n\t\tcase appActions.setUser:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tuser: action.payload,\n\t\t\t}\n\t\tcase appActions.setInvite:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinvite: action.payload,\n\t\t\t}\n\t\tcase appActions.setRedirectUrl:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinvite: action.payload,\n\t\t\t}\n\t\tcase appActions.setImpersonationRequest:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\timpersonationRequest: action.payload,\n\t\t\t}\n\t\tcase appActions.logOut:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tuser: null,\n\t\t\t\tauthToken: null,\n\t\t\t\tinvite: null,\n\t\t\t\timpersonationRequest: null,\n\t\t\t}\n\t\tdefault:\n\t\t\tconsole.info({ action })\n\t\t\tthrow new Error('Unknown Action')\n\t}\n}\n","import { createContext, useContext } from 'react'\nimport { getTheme } from '../../config'\nimport { state } from 'venti'\nimport { navigationLinking } from '../../services/navigation'\n\nconst theme = getTheme()\n\nlet initialUserState = null\nlet initialAuthTokenState = null\n\nif (\n\ttheme.debug.enabled === true &&\n\tprocess.env.NODE_ENV !== 'production'\n) {\n\tinitialAuthTokenState = theme.debug.token\n\tinitialUserState = {\n\t\t...theme.debug.user,\n\t\tisLoggedIn: true,\n\t\tid: null,\n\t\taccess_token: initialAuthTokenState,\n\t\ttokenExp: 10000000,\n\t\tloanIDs: [theme.debug.loanId],\n\t}\n\tstate.set(theme.storageKeys.authToken, initialAuthTokenState)\n\tstate.set(theme.storageKeys.user, initialUserState)\n}\n\nexport const defaultState = {\n\tsiteConfig: null,\n\tsocialLinks: null,\n\tlegalLinks: null,\n\tuser: initialUserState,\n\tauthToken: initialAuthTokenState,\n\tinvite: null,\n\tredirectUrl: navigationLinking.Portal,\n\timpersonationRequest: null,\n}\n\nexport const AppContext = createContext({\n\tstate: defaultState,\n\tdispatch: () => {},\n})\n\nexport const useAppContext = () => useContext(AppContext)\n","import generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nexport function getLoadingButtonUtilityClass(slot) {\n return generateUtilityClass('MuiLoadingButton', slot);\n}\nconst loadingButtonClasses = generateUtilityClasses('MuiLoadingButton', ['root', 'loading', 'loadingIndicator', 'loadingIndicatorCenter', 'loadingIndicatorStart', 'loadingIndicatorEnd', 'endIconLoadingEnd', 'startIconLoadingStart']);\nexport default loadingButtonClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"children\", \"disabled\", \"id\", \"loading\", \"loadingIndicator\", \"loadingPosition\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { chainPropTypes } from '@mui/utils';\nimport { capitalize, unstable_useId as useId } from '@mui/material/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport Button from '@mui/material/Button';\nimport { ButtonGroupContext } from '@mui/material/ButtonGroup';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport resolveProps from '@mui/utils/resolveProps';\nimport loadingButtonClasses, { getLoadingButtonUtilityClass } from './loadingButtonClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n loading,\n loadingPosition,\n classes\n } = ownerState;\n const slots = {\n root: ['root', loading && 'loading'],\n startIcon: [loading && `startIconLoading${capitalize(loadingPosition)}`],\n endIcon: [loading && `endIconLoading${capitalize(loadingPosition)}`],\n loadingIndicator: ['loadingIndicator', loading && `loadingIndicator${capitalize(loadingPosition)}`]\n };\n const composedClasses = composeClasses(slots, getLoadingButtonUtilityClass, classes);\n return _extends({}, classes, composedClasses);\n};\n\n// TODO use `import { rootShouldForwardProp } from '../styles/styled';` once move to core\nconst rootShouldForwardProp = prop => prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as' && prop !== 'classes';\nconst LoadingButtonRoot = styled(Button, {\n shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',\n name: 'MuiLoadingButton',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n return [styles.root, styles.startIconLoadingStart && {\n [`& .${loadingButtonClasses.startIconLoadingStart}`]: styles.startIconLoadingStart\n }, styles.endIconLoadingEnd && {\n [`& .${loadingButtonClasses.endIconLoadingEnd}`]: styles.endIconLoadingEnd\n }];\n }\n})(({\n ownerState,\n theme\n}) => _extends({\n [`& .${loadingButtonClasses.startIconLoadingStart}, & .${loadingButtonClasses.endIconLoadingEnd}`]: {\n transition: theme.transitions.create(['opacity'], {\n duration: theme.transitions.duration.short\n }),\n opacity: 0\n }\n}, ownerState.loadingPosition === 'center' && {\n transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color'], {\n duration: theme.transitions.duration.short\n }),\n [`&.${loadingButtonClasses.loading}`]: {\n color: 'transparent'\n }\n}, ownerState.loadingPosition === 'start' && ownerState.fullWidth && {\n [`& .${loadingButtonClasses.startIconLoadingStart}, & .${loadingButtonClasses.endIconLoadingEnd}`]: {\n transition: theme.transitions.create(['opacity'], {\n duration: theme.transitions.duration.short\n }),\n opacity: 0,\n marginRight: -8\n }\n}, ownerState.loadingPosition === 'end' && ownerState.fullWidth && {\n [`& .${loadingButtonClasses.startIconLoadingStart}, & .${loadingButtonClasses.endIconLoadingEnd}`]: {\n transition: theme.transitions.create(['opacity'], {\n duration: theme.transitions.duration.short\n }),\n opacity: 0,\n marginLeft: -8\n }\n}));\nconst LoadingButtonLoadingIndicator = styled('span', {\n name: 'MuiLoadingButton',\n slot: 'LoadingIndicator',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.loadingIndicator, styles[`loadingIndicator${capitalize(ownerState.loadingPosition)}`]];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n position: 'absolute',\n visibility: 'visible',\n display: 'flex'\n}, ownerState.loadingPosition === 'start' && (ownerState.variant === 'outlined' || ownerState.variant === 'contained') && {\n left: ownerState.size === 'small' ? 10 : 14\n}, ownerState.loadingPosition === 'start' && ownerState.variant === 'text' && {\n left: 6\n}, ownerState.loadingPosition === 'center' && {\n left: '50%',\n transform: 'translate(-50%)',\n color: (theme.vars || theme).palette.action.disabled\n}, ownerState.loadingPosition === 'end' && (ownerState.variant === 'outlined' || ownerState.variant === 'contained') && {\n right: ownerState.size === 'small' ? 10 : 14\n}, ownerState.loadingPosition === 'end' && ownerState.variant === 'text' && {\n right: 6\n}, ownerState.loadingPosition === 'start' && ownerState.fullWidth && {\n position: 'relative',\n left: -10\n}, ownerState.loadingPosition === 'end' && ownerState.fullWidth && {\n position: 'relative',\n right: -10\n}));\nconst LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inProps, ref) {\n const contextProps = React.useContext(ButtonGroupContext);\n const resolvedProps = resolveProps(contextProps, inProps);\n const props = useThemeProps({\n props: resolvedProps,\n name: 'MuiLoadingButton'\n });\n const {\n children,\n disabled = false,\n id: idProp,\n loading = false,\n loadingIndicator: loadingIndicatorProp,\n loadingPosition = 'center',\n variant = 'text'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const id = useId(idProp);\n const loadingIndicator = loadingIndicatorProp != null ? loadingIndicatorProp : /*#__PURE__*/_jsx(CircularProgress, {\n \"aria-labelledby\": id,\n color: \"inherit\",\n size: 16\n });\n const ownerState = _extends({}, props, {\n disabled,\n loading,\n loadingIndicator,\n loadingPosition,\n variant\n });\n const classes = useUtilityClasses(ownerState);\n const loadingButtonLoadingIndicator = loading ? /*#__PURE__*/_jsx(LoadingButtonLoadingIndicator, {\n className: classes.loadingIndicator,\n ownerState: ownerState,\n children: loadingIndicator\n }) : null;\n return /*#__PURE__*/_jsxs(LoadingButtonRoot, _extends({\n disabled: disabled || loading,\n id: id,\n ref: ref\n }, other, {\n variant: variant,\n classes: classes,\n ownerState: ownerState,\n children: [ownerState.loadingPosition === 'end' ? children : loadingButtonLoadingIndicator, ownerState.loadingPosition === 'end' ? loadingButtonLoadingIndicator : children]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? LoadingButton.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * If `true`, the component is disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n /**\n * @ignore\n */\n id: PropTypes.string,\n /**\n * If `true`, the loading indicator is shown and the button becomes disabled.\n * @default false\n */\n loading: PropTypes.bool,\n /**\n * Element placed before the children if the button is in loading state.\n * The node should contain an element with `role=\"progressbar\"` with an accessible name.\n * By default we render a `CircularProgress` that is labelled by the button itself.\n * @default \n */\n loadingIndicator: PropTypes.node,\n /**\n * The loading indicator can be positioned on the start, end, or the center of the button.\n * @default 'center'\n */\n loadingPosition: chainPropTypes(PropTypes.oneOf(['start', 'end', 'center']), props => {\n if (props.loadingPosition === 'start' && !props.startIcon) {\n return new Error(`MUI: The loadingPosition=\"start\" should be used in combination with startIcon.`);\n }\n if (props.loadingPosition === 'end' && !props.endIcon) {\n return new Error(`MUI: The loadingPosition=\"end\" should be used in combination with endIcon.`);\n }\n return null;\n }),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The variant to use.\n * @default 'text'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['contained', 'outlined', 'text']), PropTypes.string])\n} : void 0;\nexport default LoadingButton;","import React from 'react'\nimport MuiLoadingButton from '@mui/lab/LoadingButton'\nimport type { LoadingButtonProps as MuiLoadingButtonProps } from '@mui/lab/LoadingButton'\nimport clsx from 'clsx'\n\nexport type LoadingBtnProps = {\n\tindicatorOnlyOnLoading?: boolean\n\ttext: string\n} & MuiLoadingButtonProps\n\nconst LoadingBtn = ({\n\ttext,\n\tvariant = 'contained',\n\tfullWidth = true,\n\tindicatorOnlyOnLoading = false,\n\tstyle,\n\tloading,\n\t...rest\n}: LoadingBtnProps) => (\n\t\n\t\t{text}\n\t\n)\n\nexport default LoadingBtn\nexport { LoadingBtn } // legacy export. should be default export only\n","import React from 'react'\nimport { IconButton as MuiIconButton } from '@mui/material'\nimport type { IconButtonProps as MuiIconButtonProps } from '@mui/material/IconButton'\n\nexport type IconButtonProps = {\n\tchildren: React.ReactNode\n} & MuiIconButtonProps\n\nconst IconButton = ({\n\tchildren,\n\t...iconButtonProps\n}: IconButtonProps) => {\n\treturn (\n\t\t{children}\n\t)\n}\n\nexport default IconButton\n","import {\n\tButton as ButtonMUI,\n\tButtonProps as MuiButtonProps,\n} from '@mui/material'\nimport React from 'react'\nimport clsx from 'clsx'\n\nexport type ButtonProps = {\n\ttext: string\n} & MuiButtonProps\n\nexport const Button = ({\n\ttext,\n\tvariant = 'contained',\n\tstyle,\n\t...rest\n}: ButtonProps) => (\n\t\n\t\t{text}\n\t\n)\n","import { useState } from 'react'\nimport NotificationBell from 'assets/images/notificationBell.png'\nimport { isMobileDevice } from '../services/helper'\n\nexport const CardItem = ({\n\titem,\n\tindex,\n\tonClick,\n\tsource,\n\tnotificationCount,\n}) => {\n\tconst [hoveredId, setHoveredId] = useState(null)\n\n\tconst isMobile = isMobileDevice()\n\tlet right = 23\n\tlet rightMobile = 18.5\n\n\tif (notificationCount === 1) {\n\t\tright = 27\n\t\trightMobile = 21.5\n\t} else if (notificationCount < 10) {\n\t\tright = 25\n\t\trightMobile = 20\n\t}\n\n\treturn (\n\t\t setHoveredId(e.currentTarget.id)}\n\t\t\tonMouseOut={() => setHoveredId(null)}\n\t\t\tid={index}\n\t\t>\n\t\t\t{notificationCount > 0 && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{notificationCount}\n\t\t\t\t\t\t

\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t\n\t\t\t

\n\t\t\t\t{item.name}\n\t\t\t

\n\t\t\t{item.description && (\n\t\t\t\t

\n\t\t\t\t\t{item.description}\n\t\t\t\t

\n\t\t\t)}\n\t\t\n\t)\n}\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nexport { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _defineProperty as defineProperty, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _slicedToArray as slicedToArray, _unsupportedIterableToArray as unsupportedIterableToArray };\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction compose() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (x) {\n return fns.reduceRight(function (y, f) {\n return f(y);\n }, x);\n };\n}\n\nfunction curry(fn) {\n return function curried() {\n var _this = this;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return args.length >= fn.length ? fn.apply(this, args) : function () {\n for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n nextArgs[_key3] = arguments[_key3];\n }\n\n return curried.apply(_this, [].concat(args, nextArgs));\n };\n };\n}\n\nfunction isObject(value) {\n return {}.toString.call(value).includes('Object');\n}\n\nfunction isEmpty(obj) {\n return !Object.keys(obj).length;\n}\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n\nfunction hasOwnProperty(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n\nfunction validateChanges(initial, changes) {\n if (!isObject(changes)) errorHandler('changeType');\n if (Object.keys(changes).some(function (field) {\n return !hasOwnProperty(initial, field);\n })) errorHandler('changeField');\n return changes;\n}\n\nfunction validateSelector(selector) {\n if (!isFunction(selector)) errorHandler('selectorType');\n}\n\nfunction validateHandler(handler) {\n if (!(isFunction(handler) || isObject(handler))) errorHandler('handlerType');\n if (isObject(handler) && Object.values(handler).some(function (_handler) {\n return !isFunction(_handler);\n })) errorHandler('handlersType');\n}\n\nfunction validateInitial(initial) {\n if (!initial) errorHandler('initialIsRequired');\n if (!isObject(initial)) errorHandler('initialType');\n if (isEmpty(initial)) errorHandler('initialContent');\n}\n\nfunction throwError(errorMessages, type) {\n throw new Error(errorMessages[type] || errorMessages[\"default\"]);\n}\n\nvar errorMessages = {\n initialIsRequired: 'initial state is required',\n initialType: 'initial state should be an object',\n initialContent: 'initial state shouldn\\'t be an empty object',\n handlerType: 'handler should be an object or a function',\n handlersType: 'all handlers should be a functions',\n selectorType: 'selector should be a function',\n changeType: 'provided value of changes should be an object',\n changeField: 'it seams you want to change a field in the state which is not specified in the \"initial\" state',\n \"default\": 'an unknown error accured in `state-local` package'\n};\nvar errorHandler = curry(throwError)(errorMessages);\nvar validators = {\n changes: validateChanges,\n selector: validateSelector,\n handler: validateHandler,\n initial: validateInitial\n};\n\nfunction create(initial) {\n var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n validators.initial(initial);\n validators.handler(handler);\n var state = {\n current: initial\n };\n var didUpdate = curry(didStateUpdate)(state, handler);\n var update = curry(updateState)(state);\n var validate = curry(validators.changes)(initial);\n var getChanges = curry(extractChanges)(state);\n\n function getState() {\n var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (state) {\n return state;\n };\n validators.selector(selector);\n return selector(state.current);\n }\n\n function setState(causedChanges) {\n compose(didUpdate, update, validate, getChanges)(causedChanges);\n }\n\n return [getState, setState];\n}\n\nfunction extractChanges(state, causedChanges) {\n return isFunction(causedChanges) ? causedChanges(state.current) : causedChanges;\n}\n\nfunction updateState(state, changes) {\n state.current = _objectSpread2(_objectSpread2({}, state.current), changes);\n return changes;\n}\n\nfunction didStateUpdate(state, handler, changes) {\n isFunction(handler) ? handler(state.current) : Object.keys(changes).forEach(function (field) {\n var _handler$field;\n\n return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]);\n });\n return changes;\n}\n\nvar index = {\n create: create\n};\n\nexport default index;\n","var config = {\n paths: {\n vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs'\n }\n};\n\nexport default config;\n","function isObject(value) {\n return {}.toString.call(value).includes('Object');\n}\n\nexport default isObject;\n","import curry from '../utils/curry.js';\nimport isObject from '../utils/isObject.js';\n\n/**\n * validates the configuration object and informs about deprecation\n * @param {Object} config - the configuration object \n * @return {Object} config - the validated configuration object\n */\n\nfunction validateConfig(config) {\n if (!config) errorHandler('configIsRequired');\n if (!isObject(config)) errorHandler('configType');\n\n if (config.urls) {\n informAboutDeprecation();\n return {\n paths: {\n vs: config.urls.monacoBase\n }\n };\n }\n\n return config;\n}\n/**\n * logs deprecation message\n */\n\n\nfunction informAboutDeprecation() {\n console.warn(errorMessages.deprecation);\n}\n\nfunction throwError(errorMessages, type) {\n throw new Error(errorMessages[type] || errorMessages[\"default\"]);\n}\n\nvar errorMessages = {\n configIsRequired: 'the configuration object is required',\n configType: 'the configuration object should be an object',\n \"default\": 'an unknown error accured in `@monaco-editor/loader` package',\n deprecation: \"Deprecation warning!\\n You are using deprecated way of configuration.\\n\\n Instead of using\\n monaco.config({ urls: { monacoBase: '...' } })\\n use\\n monaco.config({ paths: { vs: '...' } })\\n\\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\\n \"\n};\nvar errorHandler = curry(throwError)(errorMessages);\nvar validators = {\n config: validateConfig\n};\n\nexport default validators;\nexport { errorHandler, errorMessages };\n","function curry(fn) {\n return function curried() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return args.length >= fn.length ? fn.apply(this, args) : function () {\n for (var _len2 = arguments.length, nextArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n nextArgs[_key2] = arguments[_key2];\n }\n\n return curried.apply(_this, [].concat(args, nextArgs));\n };\n };\n}\n\nexport default curry;\n","var compose = function compose() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (x) {\n return fns.reduceRight(function (y, f) {\n return f(y);\n }, x);\n };\n};\n\nexport default compose;\n","import { objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';\n\nfunction merge(target, source) {\n Object.keys(source).forEach(function (key) {\n if (source[key] instanceof Object) {\n if (target[key]) {\n Object.assign(source[key], merge(target[key], source[key]));\n }\n }\n });\n return _objectSpread2(_objectSpread2({}, target), source);\n}\n\nexport default merge;\n","// The source (has been changed) is https://github.com/facebook/react/issues/5465#issuecomment-157888325\nvar CANCELATION_MESSAGE = {\n type: 'cancelation',\n msg: 'operation is manually canceled'\n};\n\nfunction makeCancelable(promise) {\n var hasCanceled_ = false;\n var wrappedPromise = new Promise(function (resolve, reject) {\n promise.then(function (val) {\n return hasCanceled_ ? reject(CANCELATION_MESSAGE) : resolve(val);\n });\n promise[\"catch\"](reject);\n });\n return wrappedPromise.cancel = function () {\n return hasCanceled_ = true;\n }, wrappedPromise;\n}\n\nexport default makeCancelable;\nexport { CANCELATION_MESSAGE };\n","import { slicedToArray as _slicedToArray, objectWithoutProperties as _objectWithoutProperties } from '../_virtual/_rollupPluginBabelHelpers.js';\nimport state from 'state-local';\nimport config$1 from '../config/index.js';\nimport validators from '../validators/index.js';\nimport compose from '../utils/compose.js';\nimport merge from '../utils/deepMerge.js';\nimport makeCancelable from '../utils/makeCancelable.js';\n\n/** the local state of the module */\n\nvar _state$create = state.create({\n config: config$1,\n isInitialized: false,\n resolve: null,\n reject: null,\n monaco: null\n}),\n _state$create2 = _slicedToArray(_state$create, 2),\n getState = _state$create2[0],\n setState = _state$create2[1];\n/**\n * set the loader configuration\n * @param {Object} config - the configuration object\n */\n\n\nfunction config(globalConfig) {\n var _validators$config = validators.config(globalConfig),\n monaco = _validators$config.monaco,\n config = _objectWithoutProperties(_validators$config, [\"monaco\"]);\n\n setState(function (state) {\n return {\n config: merge(state.config, config),\n monaco: monaco\n };\n });\n}\n/**\n * handles the initialization of the monaco-editor\n * @return {Promise} - returns an instance of monaco (with a cancelable promise)\n */\n\n\nfunction init() {\n var state = getState(function (_ref) {\n var monaco = _ref.monaco,\n isInitialized = _ref.isInitialized,\n resolve = _ref.resolve;\n return {\n monaco: monaco,\n isInitialized: isInitialized,\n resolve: resolve\n };\n });\n\n if (!state.isInitialized) {\n setState({\n isInitialized: true\n });\n\n if (state.monaco) {\n state.resolve(state.monaco);\n return makeCancelable(wrapperPromise);\n }\n\n if (window.monaco && window.monaco.editor) {\n storeMonacoInstance(window.monaco);\n state.resolve(window.monaco);\n return makeCancelable(wrapperPromise);\n }\n\n compose(injectScripts, getMonacoLoaderScript)(configureLoader);\n }\n\n return makeCancelable(wrapperPromise);\n}\n/**\n * injects provided scripts into the document.body\n * @param {Object} script - an HTML script element\n * @return {Object} - the injected HTML script element\n */\n\n\nfunction injectScripts(script) {\n return document.body.appendChild(script);\n}\n/**\n * creates an HTML script element with/without provided src\n * @param {string} [src] - the source path of the script\n * @return {Object} - the created HTML script element\n */\n\n\nfunction createScript(src) {\n var script = document.createElement('script');\n return src && (script.src = src), script;\n}\n/**\n * creates an HTML script element with the monaco loader src\n * @return {Object} - the created HTML script element\n */\n\n\nfunction getMonacoLoaderScript(configureLoader) {\n var state = getState(function (_ref2) {\n var config = _ref2.config,\n reject = _ref2.reject;\n return {\n config: config,\n reject: reject\n };\n });\n var loaderScript = createScript(\"\".concat(state.config.paths.vs, \"/loader.js\"));\n\n loaderScript.onload = function () {\n return configureLoader();\n };\n\n loaderScript.onerror = state.reject;\n return loaderScript;\n}\n/**\n * configures the monaco loader\n */\n\n\nfunction configureLoader() {\n var state = getState(function (_ref3) {\n var config = _ref3.config,\n resolve = _ref3.resolve,\n reject = _ref3.reject;\n return {\n config: config,\n resolve: resolve,\n reject: reject\n };\n });\n var require = window.require;\n\n require.config(state.config);\n\n require(['vs/editor/editor.main'], function (monaco) {\n storeMonacoInstance(monaco);\n state.resolve(monaco);\n }, function (error) {\n state.reject(error);\n });\n}\n/**\n * store monaco instance in local state\n */\n\n\nfunction storeMonacoInstance(monaco) {\n if (!getState().monaco) {\n setState({\n monaco: monaco\n });\n }\n}\n/**\n * internal helper function\n * extracts stored monaco instance\n * @return {Object|null} - the monaco instance\n */\n\n\nfunction __getMonacoInstance() {\n return getState(function (_ref4) {\n var monaco = _ref4.monaco;\n return monaco;\n });\n}\n\nvar wrapperPromise = new Promise(function (resolve, reject) {\n return setState({\n resolve: resolve,\n reject: reject\n });\n});\nvar loader = {\n config: config,\n init: init,\n __getMonacoInstance: __getMonacoInstance\n};\n\nexport default loader;\n","import { type CSSProperties } from 'react';\n\nconst styles: Record = {\n wrapper: {\n display: 'flex',\n position: 'relative',\n textAlign: 'initial',\n },\n fullWidth: {\n width: '100%',\n },\n hide: {\n display: 'none',\n },\n};\n\nexport default styles;\n","import { type CSSProperties } from 'react';\n\nconst styles: Record = {\n container: {\n display: 'flex',\n height: '100%',\n width: '100%',\n justifyContent: 'center',\n alignItems: 'center',\n },\n};\n\nexport default styles;\n","import React, { type PropsWithChildren } from 'react';\n\nimport styles from './styles';\n\nfunction Loading({ children }: PropsWithChildren) {\n return
{children}
;\n}\n\nexport default Loading;\n","import Loading from './Loading';\n\nexport default Loading;\n","import React from 'react';\n\nimport styles from './styles';\nimport Loading from '../Loading';\nimport { type ContainerProps } from './types';\n\n// ** forwardref render functions do not support proptypes or defaultprops **\n// one of the reasons why we use a separate prop for passing ref instead of using forwardref\n\nfunction MonacoContainer({\n width,\n height,\n isEditorReady,\n loading,\n _ref,\n className,\n wrapperProps,\n}: ContainerProps) {\n return (\n
\n {!isEditorReady && {loading}}\n \n
\n );\n}\n\nexport default MonacoContainer;\n","import { memo } from 'react';\n\nimport MonacoContainer from './MonacoContainer';\n\nexport default memo(MonacoContainer);\n","import { useEffect, type EffectCallback } from 'react';\n\nfunction useMount(effect: EffectCallback) {\n useEffect(effect, []);\n}\n\nexport default useMount;\n","import { useEffect, useRef, type DependencyList, type EffectCallback } from 'react';\n\nfunction useUpdate(effect: EffectCallback, deps: DependencyList, applyChanges = true) {\n const isInitialMount = useRef(true);\n\n useEffect(\n isInitialMount.current || !applyChanges\n ? () => {\n isInitialMount.current = false;\n }\n : effect,\n deps,\n );\n}\n\nexport default useUpdate;\n","import { type Monaco } from '..';\n\n/**\n * noop is a helper function that does nothing\n * @returns undefined\n */\nfunction noop() {\n /** no-op */\n}\n\n/**\n * getOrCreateModel is a helper function that will return a model if it exists\n * or create a new model if it does not exist.\n * This is useful for when you want to create a model for a file that may or may not exist yet.\n * @param monaco The monaco instance\n * @param value The value of the model\n * @param language The language of the model\n * @param path The path of the model\n * @returns The model that was found or created\n */\nfunction getOrCreateModel(monaco: Monaco, value: string, language: string, path: string) {\n return getModel(monaco, path) || createModel(monaco, value, language, path);\n}\n\n/**\n * getModel is a helper function that will return a model if it exists\n * or return undefined if it does not exist.\n * @param monaco The monaco instance\n * @param path The path of the model\n * @returns The model that was found or undefined\n */\nfunction getModel(monaco: Monaco, path: string) {\n return monaco.editor.getModel(createModelUri(monaco, path));\n}\n\n/**\n * createModel is a helper function that will create a new model\n * @param monaco The monaco instance\n * @param value The value of the model\n * @param language The language of the model\n * @param path The path of the model\n * @returns The model that was created\n */\nfunction createModel(monaco: Monaco, value: string, language?: string, path?: string) {\n return monaco.editor.createModel(\n value,\n language,\n path ? createModelUri(monaco, path) : undefined,\n );\n}\n\n/**\n * createModelUri is a helper function that will create a new model uri\n * @param monaco The monaco instance\n * @param path The path of the model\n * @returns The model uri that was created\n */\nfunction createModelUri(monaco: Monaco, path: string) {\n return monaco.Uri.parse(path);\n}\n\nexport { noop, getOrCreateModel };\n","'use client';\n\nimport React, { useState, useRef, useCallback, useEffect } from 'react';\nimport loader from '@monaco-editor/loader';\n\nimport MonacoContainer from '../MonacoContainer';\nimport useMount from '../hooks/useMount';\nimport useUpdate from '../hooks/useUpdate';\nimport { noop, getOrCreateModel } from '../utils';\nimport { type DiffEditorProps, type MonacoDiffEditor } from './types';\nimport { type Monaco } from '..';\n\nfunction DiffEditor({\n original,\n modified,\n language,\n originalLanguage,\n modifiedLanguage,\n originalModelPath,\n modifiedModelPath,\n keepCurrentOriginalModel = false,\n keepCurrentModifiedModel = false,\n theme = 'light',\n loading = 'Loading...',\n options = {},\n height = '100%',\n width = '100%',\n className,\n wrapperProps = {},\n beforeMount = noop,\n onMount = noop,\n}: DiffEditorProps) {\n const [isEditorReady, setIsEditorReady] = useState(false);\n const [isMonacoMounting, setIsMonacoMounting] = useState(true);\n const editorRef = useRef(null);\n const monacoRef = useRef(null);\n const containerRef = useRef(null);\n const onMountRef = useRef(onMount);\n const beforeMountRef = useRef(beforeMount);\n const preventCreation = useRef(false);\n\n useMount(() => {\n const cancelable = loader.init();\n\n cancelable\n .then((monaco) => (monacoRef.current = monaco) && setIsMonacoMounting(false))\n .catch(\n (error) =>\n error?.type !== 'cancelation' && console.error('Monaco initialization: error:', error),\n );\n\n return () => (editorRef.current ? disposeEditor() : cancelable.cancel());\n });\n\n useUpdate(\n () => {\n if (editorRef.current && monacoRef.current) {\n const originalEditor = editorRef.current.getOriginalEditor();\n const model = getOrCreateModel(\n monacoRef.current,\n original || '',\n originalLanguage || language || 'text',\n originalModelPath || '',\n );\n\n if (model !== originalEditor.getModel()) {\n originalEditor.setModel(model);\n }\n }\n },\n [originalModelPath],\n isEditorReady,\n );\n\n useUpdate(\n () => {\n if (editorRef.current && monacoRef.current) {\n const modifiedEditor = editorRef.current.getModifiedEditor();\n const model = getOrCreateModel(\n monacoRef.current,\n modified || '',\n modifiedLanguage || language || 'text',\n modifiedModelPath || '',\n );\n\n if (model !== modifiedEditor.getModel()) {\n modifiedEditor.setModel(model);\n }\n }\n },\n [modifiedModelPath],\n isEditorReady,\n );\n\n useUpdate(\n () => {\n const modifiedEditor = editorRef.current!.getModifiedEditor();\n if (modifiedEditor.getOption(monacoRef.current!.editor.EditorOption.readOnly)) {\n modifiedEditor.setValue(modified || '');\n } else {\n if (modified !== modifiedEditor.getValue()) {\n modifiedEditor.executeEdits('', [\n {\n range: modifiedEditor.getModel()!.getFullModelRange(),\n text: modified || '',\n forceMoveMarkers: true,\n },\n ]);\n\n modifiedEditor.pushUndoStop();\n }\n }\n },\n [modified],\n isEditorReady,\n );\n\n useUpdate(\n () => {\n editorRef.current?.getModel()?.original.setValue(original || '');\n },\n [original],\n isEditorReady,\n );\n\n useUpdate(\n () => {\n const { original, modified } = editorRef.current!.getModel()!;\n\n monacoRef.current!.editor.setModelLanguage(original, originalLanguage || language || 'text');\n monacoRef.current!.editor.setModelLanguage(modified, modifiedLanguage || language || 'text');\n },\n [language, originalLanguage, modifiedLanguage],\n isEditorReady,\n );\n\n useUpdate(\n () => {\n monacoRef.current?.editor.setTheme(theme);\n },\n [theme],\n isEditorReady,\n );\n\n useUpdate(\n () => {\n editorRef.current?.updateOptions(options);\n },\n [options],\n isEditorReady,\n );\n\n const setModels = useCallback(() => {\n if (!monacoRef.current) return;\n beforeMountRef.current(monacoRef.current);\n const originalModel = getOrCreateModel(\n monacoRef.current,\n original || '',\n originalLanguage || language || 'text',\n originalModelPath || '',\n );\n\n const modifiedModel = getOrCreateModel(\n monacoRef.current,\n modified || '',\n modifiedLanguage || language || 'text',\n modifiedModelPath || '',\n );\n\n editorRef.current?.setModel({\n original: originalModel,\n modified: modifiedModel,\n });\n }, [\n language,\n modified,\n modifiedLanguage,\n original,\n originalLanguage,\n originalModelPath,\n modifiedModelPath,\n ]);\n\n const createEditor = useCallback(() => {\n if (!preventCreation.current && containerRef.current) {\n editorRef.current = monacoRef.current!.editor.createDiffEditor(containerRef.current, {\n automaticLayout: true,\n ...options,\n });\n\n setModels();\n\n monacoRef.current?.editor.setTheme(theme);\n\n setIsEditorReady(true);\n preventCreation.current = true;\n }\n }, [options, theme, setModels]);\n\n useEffect(() => {\n if (isEditorReady) {\n onMountRef.current(editorRef.current!, monacoRef.current!);\n }\n }, [isEditorReady]);\n\n useEffect(() => {\n !isMonacoMounting && !isEditorReady && createEditor();\n }, [isMonacoMounting, isEditorReady, createEditor]);\n\n function disposeEditor() {\n const models = editorRef.current?.getModel();\n\n if (!keepCurrentOriginalModel) {\n models?.original?.dispose();\n }\n\n if (!keepCurrentModifiedModel) {\n models?.modified?.dispose();\n }\n\n editorRef.current?.dispose();\n }\n\n return (\n \n );\n}\n\nexport default DiffEditor;\n","import { memo } from 'react';\n\nimport DiffEditor from './DiffEditor';\n\nexport * from './types';\n\nexport default memo(DiffEditor);\n","import { useEffect, useRef } from 'react';\n\nfunction usePrevious(value: T) {\n const ref = useRef();\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref.current;\n}\n\nexport default usePrevious;\n","'use client';\n\nimport React, { useState, useEffect, useRef, useCallback } from 'react';\nimport loader from '@monaco-editor/loader';\nimport useMount from '../hooks/useMount';\nimport useUpdate from '../hooks/useUpdate';\nimport usePrevious from '../hooks/usePrevious';\nimport { type IDisposable, type editor } from 'monaco-editor';\nimport { noop, getOrCreateModel } from '../utils';\nimport { type EditorProps } from './types';\nimport { type Monaco } from '..';\nimport MonacoContainer from '../MonacoContainer';\n\nconst viewStates = new Map();\n\nfunction Editor({\n defaultValue,\n defaultLanguage,\n defaultPath,\n value,\n language,\n path,\n /* === */\n theme = 'light',\n line,\n loading = 'Loading...',\n options = {},\n overrideServices = {},\n saveViewState = true,\n keepCurrentModel = false,\n /* === */\n width = '100%',\n height = '100%',\n className,\n wrapperProps = {},\n /* === */\n beforeMount = noop,\n onMount = noop,\n onChange,\n onValidate = noop,\n}: EditorProps) {\n const [isEditorReady, setIsEditorReady] = useState(false);\n const [isMonacoMounting, setIsMonacoMounting] = useState(true);\n const monacoRef = useRef(null);\n const editorRef = useRef(null);\n const containerRef = useRef(null);\n const onMountRef = useRef(onMount);\n const beforeMountRef = useRef(beforeMount);\n const subscriptionRef = useRef();\n const valueRef = useRef(value);\n const previousPath = usePrevious(path);\n const preventCreation = useRef(false);\n const preventTriggerChangeEvent = useRef(false);\n\n useMount(() => {\n const cancelable = loader.init();\n\n cancelable\n .then((monaco) => (monacoRef.current = monaco) && setIsMonacoMounting(false))\n .catch(\n (error) =>\n error?.type !== 'cancelation' && console.error('Monaco initialization: error:', error),\n );\n\n return () => (editorRef.current ? disposeEditor() : cancelable.cancel());\n });\n\n useUpdate(\n () => {\n const model = getOrCreateModel(\n monacoRef.current!,\n defaultValue || value || '',\n defaultLanguage || language || '',\n path || defaultPath || '',\n );\n\n if (model !== editorRef.current?.getModel()) {\n if (saveViewState) viewStates.set(previousPath, editorRef.current?.saveViewState());\n editorRef.current?.setModel(model);\n if (saveViewState) editorRef.current?.restoreViewState(viewStates.get(path));\n }\n },\n [path],\n isEditorReady,\n );\n\n useUpdate(\n () => {\n editorRef.current?.updateOptions(options);\n },\n [options],\n isEditorReady,\n );\n\n useUpdate(\n () => {\n if (!editorRef.current || value === undefined) return;\n if (editorRef.current.getOption(monacoRef.current!.editor.EditorOption.readOnly)) {\n editorRef.current.setValue(value);\n } else if (value !== editorRef.current.getValue()) {\n preventTriggerChangeEvent.current = true;\n editorRef.current.executeEdits('', [\n {\n range: editorRef.current.getModel()!.getFullModelRange(),\n text: value,\n forceMoveMarkers: true,\n },\n ]);\n\n editorRef.current.pushUndoStop();\n preventTriggerChangeEvent.current = false;\n }\n },\n [value],\n isEditorReady,\n );\n\n useUpdate(\n () => {\n const model = editorRef.current?.getModel();\n if (model && language) monacoRef.current?.editor.setModelLanguage(model, language);\n },\n [language],\n isEditorReady,\n );\n\n useUpdate(\n () => {\n // reason for undefined check: https://github.com/suren-atoyan/monaco-react/pull/188\n if (line !== undefined) {\n editorRef.current?.revealLine(line);\n }\n },\n [line],\n isEditorReady,\n );\n\n useUpdate(\n () => {\n monacoRef.current?.editor.setTheme(theme);\n },\n [theme],\n isEditorReady,\n );\n\n const createEditor = useCallback(() => {\n if (!containerRef.current || !monacoRef.current) return;\n if (!preventCreation.current) {\n beforeMountRef.current(monacoRef.current);\n const autoCreatedModelPath = path || defaultPath;\n\n const defaultModel = getOrCreateModel(\n monacoRef.current,\n value || defaultValue || '',\n defaultLanguage || language || '',\n autoCreatedModelPath || '',\n );\n\n editorRef.current = monacoRef.current?.editor.create(\n containerRef.current,\n {\n model: defaultModel,\n automaticLayout: true,\n ...options,\n },\n overrideServices,\n );\n\n saveViewState && editorRef.current.restoreViewState(viewStates.get(autoCreatedModelPath));\n\n monacoRef.current.editor.setTheme(theme);\n\n if (line !== undefined) {\n editorRef.current.revealLine(line);\n }\n\n setIsEditorReady(true);\n preventCreation.current = true;\n }\n }, [\n defaultValue,\n defaultLanguage,\n defaultPath,\n value,\n language,\n path,\n options,\n overrideServices,\n saveViewState,\n theme,\n line,\n ]);\n\n useEffect(() => {\n if (isEditorReady) {\n onMountRef.current(editorRef.current!, monacoRef.current!);\n }\n }, [isEditorReady]);\n\n useEffect(() => {\n !isMonacoMounting && !isEditorReady && createEditor();\n }, [isMonacoMounting, isEditorReady, createEditor]);\n\n // subscription\n // to avoid unnecessary updates (attach - dispose listener) in subscription\n valueRef.current = value;\n\n // onChange\n useEffect(() => {\n if (isEditorReady && onChange) {\n subscriptionRef.current?.dispose();\n subscriptionRef.current = editorRef.current?.onDidChangeModelContent((event) => {\n if (!preventTriggerChangeEvent.current) {\n onChange(editorRef.current!.getValue(), event);\n }\n });\n }\n }, [isEditorReady, onChange]);\n\n // onValidate\n useEffect(() => {\n if (isEditorReady) {\n const changeMarkersListener = monacoRef.current!.editor.onDidChangeMarkers((uris) => {\n const editorUri = editorRef.current!.getModel()?.uri;\n\n if (editorUri) {\n const currentEditorHasMarkerChanges = uris.find((uri) => uri.path === editorUri.path);\n if (currentEditorHasMarkerChanges) {\n const markers = monacoRef.current!.editor.getModelMarkers({\n resource: editorUri,\n });\n onValidate?.(markers);\n }\n }\n });\n\n return () => {\n changeMarkersListener?.dispose();\n };\n }\n return () => {\n // eslint happy\n };\n }, [isEditorReady, onValidate]);\n\n function disposeEditor() {\n subscriptionRef.current?.dispose();\n\n if (keepCurrentModel) {\n saveViewState && viewStates.set(path, editorRef.current!.saveViewState());\n } else {\n editorRef.current!.getModel()?.dispose();\n }\n\n editorRef.current!.dispose();\n }\n\n return (\n \n );\n}\n\nexport default Editor;\n","import { memo } from 'react';\n\nimport Editor from './Editor';\n\nexport * from './types';\n\nexport default memo(Editor);\n","import React, { useState } from 'react'\nimport { Editor, EditorProps } from '@monaco-editor/react'\nimport clsx from 'clsx'\nimport { editor } from 'monaco-editor'\nimport { isDarkMode } from '../services/helper'\nimport LoadingDots from './LoadingDots'\n\nexport type ValidationErrorProps = {\n\tmessage: string\n\tstartLineNumber: number\n}\n\nexport type CodeEditorProps = EditorProps & {\n\tloading?: boolean\n\tclassName?: string\n\tonValidate?: (markers: editor.IMarker) => void\n\terrors?: string[]\n}\n\nconst CodeEditor = ({\n\tloading = false,\n\tclassName,\n\tonValidate,\n\terrors = [],\n\t...rest\n}: CodeEditorProps) => {\n\tconst [validationErrors, setValidationErrors] = useState<\n\t\teditor.IMarker[]\n\t>([])\n\tconst handleValidate = (markers: editor.IMarker[]) => {\n\t\tsetValidationErrors(markers)\n\t\tif (onValidate) {\n\t\t\tonValidate(markers)\n\t\t}\n\t}\n\treturn (\n\t\t
\n\t\t\t{loading && (\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t)}\n\t\t\t{!loading && (\n\t\t\t\t 0\n\t\t\t\t\t\t\t? 'border-red-500'\n\t\t\t\t\t\t\t: 'border-gray-200',\n\t\t\t\t\t\t'border-2'\n\t\t\t\t\t)}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{(validationErrors.length > 0 || errors.length > 0) && (\n\t\t\t\t
\n\t\t\t\t\t{validationErrors.map((error: ValidationErrorProps) => (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tLine {error.startLineNumber}: {error.message}\n\t\t\t\t\t\t
\n\t\t\t\t\t))}\n\t\t\t\t\t{errors.length > 0 && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{errors?.map((error) => (\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{/* @todo errors are sometimes strings and sometimes objects */}\n\t\t\t\t\t\t\t\t\t{typeof error === 'object' ? '' : error}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\t\t\t\t
\n\t\t\t)}\n\t\t
\n\t)\n}\n\nexport default CodeEditor\n","\"use client\";\n\nimport createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z\"\n}), 'FirstPage');","\"use client\";\n\nimport createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z\"\n}), 'LastPage');","\"use client\";\n\nimport createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z\"\n}), 'ChevronLeft');","\"use client\";\n\nimport createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"\n}), 'ChevronRight');","import React, { useEffect, useState } from 'react'\nimport { ModalExportData } from '../modals/ModalExportData'\nimport DownloadIcon from '@mui/icons-material/Download'\nimport { IconButton, Tooltip } from '@mui/material'\nimport { useTheme } from '@mui/material/styles'\nimport {\n\texportToCsv,\n\texportToExcel,\n\texportToJSON,\n} from '../../services/utils'\nimport { eventTypes } from '../../services/constants'\nimport { useMixpanel } from '../../hooks/useMixpanel'\nexport const ExportTable = ({ data, title }) => {\n\tconst themeMUI = useTheme()\n\tconst [exportData, setExportData] = useState()\n\tconst [fileTitle, setFileTitle] = useState()\n\tconst [exportModalOpen, setExportModalOpen] = useState(false)\n\tconst mixpanel = useMixpanel()\n\n\tuseEffect(() => {\n\t\tsetExportData(data)\n\t}, [data])\n\n\tuseEffect(() => {\n\t\tsetFileTitle(title.toLowerCase().replace(' ', '-'))\n\t}, [title])\n\n\tconst exportTable = (fileType) => {\n\t\tconst eventTypeMap = {\n\t\t\tbranches: eventTypes.BRANCH_EXPORTED,\n\t\t\tbrands: eventTypes.BRAND_EXPORTED,\n\t\t\tpartners: eventTypes.PARTNER_EXPORTED,\n\t\t\t'loan-officers': eventTypes.LOAN_OFFICER_EXPORTED,\n\t\t\tdefault: 'EXPORT',\n\t\t}\n\n\t\tconst eventType = eventTypeMap[fileTitle] || eventTypeMap.default\n\n\t\tconst exportFunctions = {\n\t\t\tcsv: exportToCsv,\n\t\t\txlsx: exportToExcel,\n\t\t\tjson: exportToJSON,\n\t\t}\n\n\t\tconst exportFunction = exportFunctions[fileType]\n\n\t\tif (exportFunction) {\n\t\t\texportFunction(exportData, fileTitle)\n\t\t}\n\n\t\tmixpanel.trackEvent(eventType, {\n\t\t\tfileType,\n\t\t\tfileTitle,\n\t\t})\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\n\t\t\t\t setExportModalOpen(true)}\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t)\n}\n","import * as React from 'react'\nimport clsx from 'clsx'\n\nconst alignMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n}\n\ntype AlignItems = 'center' | 'left' | 'right'\n\nexport type SubheaderProps = {\n\talign?: AlignItems\n\twrapContent?: boolean\n\tchildren?: React.ReactNode\n}\n\nconst SubHeader = ({\n\talign = 'right',\n\twrapContent = true,\n\t...rest\n}: SubheaderProps) => (\n\t\n)\n\nexport default SubHeader\n","import React, { useState } from 'react'\nimport RDataTable, { TableProps } from 'react-data-table-component'\nimport { useTheme } from '@mui/material/styles'\nimport Box from '@mui/material/Box'\nimport Paper from '@mui/material/Paper'\nimport MoreVertIcon from '@mui/icons-material/MoreVert'\nimport MenuItem from '@mui/material/MenuItem'\nimport Menu from '@mui/material/Menu'\nimport CancelIcon from '@mui/icons-material/Cancel'\nimport RefreshPNG from 'assets/lordicons/Refresh.png'\nimport RefreshGIF from 'assets/lordicons/RefreshAnimated.gif'\nimport RefreshDarkPNG from 'assets/lordicons/RefreshDark.png'\nimport RefreshDarkGIF from 'assets/lordicons/RefreshAnimatedDark.gif'\nimport clsx from 'clsx'\nimport { IconButton, Tooltip } from '@mui/material'\nimport ArrowDownIcon from '@mui/icons-material/ArrowDropDown'\nimport ArrowRightIcon from '@mui/icons-material/ArrowRight'\nimport {\n\tFirstPage,\n\tLastPage,\n\tChevronLeft,\n\tChevronRight,\n} from '@mui/icons-material'\nimport { Loading } from '../Loading'\nimport { Button } from '../Button'\nimport { useWindowSize } from '../../hooks'\nimport { getTheme } from '../../config'\nimport { isDarkMode } from '../../services/helper'\nimport { tableRowsPerPageOptions } from '../../services/utils'\nimport { ExportTable } from '../export/ExportTable'\nimport Heading from '../Heading'\nimport TextField from '../formControls/TextField'\nimport SubHeader from './SubHeader'\n\nconst theme = getTheme()\n\nconst bgColor = {\n\t'&:hover': {\n\t\tbackgroundColor: 'transparent',\n\t},\n}\n\nexport type ActionItem = {\n\tname: string\n\tonClick: (_e: React.MouseEvent, _row: T) => void\n\thideIf?: (_e: T) => boolean\n}\n\nexport type DataTableProps = {\n\ttitleActions?: React.ReactNode\n\tonRefreshClick?: () => void\n\taddNewBtn?: {\n\t\ttext?: string\n\t\tonClick?: () => void\n\t\tdisabled?: boolean\n\t}\n\texportEnabled?: boolean\n\texportData?: T[]\n\tonSearchChange?: (_e: React.ChangeEvent) => void\n\tsearchText?: string\n\tonClearSearchClick?: () => void\n\tsearchFilters?: React.ReactNode\n\tactionItems?: ActionItem[]\n\trefreshing?: boolean\n} & TableProps\n\nconst DataTable = ({\n\ttitle,\n\ttitleActions,\n\tonRefreshClick,\n\tprogressComponent = ,\n\tprogressPending,\n\taddNewBtn,\n\texportEnabled = false,\n\texportData,\n\tdata,\n\tonSearchChange,\n\tsearchText,\n\tonClearSearchClick,\n\tsearchFilters,\n\tcolumns,\n\tactionItems = [],\n\texpandableRows,\n\texpandableRowsComponent,\n\trefreshing = false,\n\tsubHeader,\n\tsubHeaderAlign,\n\tsubHeaderComponent,\n\tsubHeaderWrap,\n\t...rest\n}: DataTableProps) => {\n\tconst { dataTable: breakpoint } = theme.breakpoints\n\tconst themeMUI = useTheme()\n\tconst [width] = useWindowSize()\n\tconst [actionAnchorEl, setActionAnchorEl] =\n\t\tuseState(null)\n\tconst [selectedActionItem, setSelectedActionItem] =\n\t\tuseState(null)\n\n\tconst showActionMenu = (e: React.MouseEvent, row: T) => {\n\t\te.stopPropagation()\n\t\tsetActionAnchorEl(e.currentTarget as HTMLElement)\n\t\tsetSelectedActionItem(row)\n\t}\n\n\tconst customStyles = {\n\t\tresponsiveWrapper: {\n\t\t\tstyle: {\n\t\t\t\tmaxHeight: 'fit-content',\n\t\t\t},\n\t\t},\n\t\theadCells: {\n\t\t\tstyle: {\n\t\t\t\tbackgroundColor: isDarkMode()\n\t\t\t\t\t? theme.color.primary.black\n\t\t\t\t\t: theme.color.primary.white,\n\t\t\t},\n\t\t},\n\t\tprogress: {\n\t\t\tstyle: {\n\t\t\t\tbackgroundColor: isDarkMode()\n\t\t\t\t\t? theme.color.primary.black\n\t\t\t\t\t: undefined,\n\t\t\t},\n\t\t},\n\t\tnoData: {\n\t\t\tstyle: {\n\t\t\t\tbackgroundColor: isDarkMode()\n\t\t\t\t\t? theme.color.primary.black\n\t\t\t\t\t: undefined,\n\t\t\t\tcolor: isDarkMode() ? theme.color.primary.white : undefined,\n\t\t\t},\n\t\t},\n\t}\n\n\tconst getPaginationIcon = (IconComponent: React.ElementType) => (\n\t\t\n\t)\n\n\tconst hideActionMenu = () => {\n\t\tsetActionAnchorEl(null)\n\t\tsetTimeout(() => setSelectedActionItem(null), 500)\n\t}\n\n\tconst onActionItemClick = (\n\t\te: React.MouseEvent,\n\t\titem: ActionItem\n\t) => {\n\t\tif (selectedActionItem) item.onClick(e, selectedActionItem)\n\t\thideActionMenu()\n\t}\n\n\tconst expanderIconStyles = isDarkMode()\n\t\t? { color: 'white' }\n\t\t: undefined\n\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t{title && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\te.currentTarget.src =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthemeMUI.palette.mode === 'light'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? RefreshGIF\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: RefreshDarkGIF\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonFocus={(e) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\te.currentTarget.src =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthemeMUI.palette.mode === 'light'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? RefreshGIF\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: RefreshDarkGIF\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonMouseOut={(e) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\te.currentTarget.src =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthemeMUI.palette.mode === 'light'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? RefreshPNG\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: RefreshDarkPNG\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonBlur={(e) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\te.currentTarget.src =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthemeMUI.palette.mode === 'light'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? RefreshPNG\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: RefreshDarkPNG\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\talt=\"refresh\"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t) : null\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\t\t\t\t\t
\n\n\t\t\t\t\t{titleActions && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{titleActions}\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\t\t\t\t\t
\n\t\t\t\t\t\t{exportEnabled &&\n\t\t\t\t\t\t\t((exportData || []).length > 0 || data.length > 0) && (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t{addNewBtn && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{addNewBtn.onClick && (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{!addNewBtn.onClick && addNewBtn}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t{subHeader && (\n\t\t\t\t\n\t\t\t\t\t{subHeaderComponent}\n\t\t\t\t\n\t\t\t)}\n\n\t\t\t{(onSearchChange || searchFilters) && (\n\t\t\t\t
\n\t\t\t\t\t{onSearchChange && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{searchFilters}\n\t\t\t\t\n\t\t\t)}\n\t\t\t\n\t\t\t\t{refreshing && !progressPending && (\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tprogressPending={progressPending}\n\t\t\t\t\tdata={data}\n\t\t\t\t\texpandableRows={\n\t\t\t\t\t\texpandableRowsComponent && expandableRows === undefined\n\t\t\t\t\t\t\t? width < breakpoint\n\t\t\t\t\t\t\t: expandableRows\n\t\t\t\t\t}\n\t\t\t\t\texpandableRowsComponent={expandableRowsComponent}\n\t\t\t\t\tcolumns={\n\t\t\t\t\t\tactionItems && actionItems.length > 0\n\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t...columns,\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: '',\n\t\t\t\t\t\t\t\t\t\tcell: (row) => (\n\t\t\t\t\t\t\t\t\t\t\t showActionMenu(e, row)}\n\t\t\t\t\t\t\t\t\t\t\t\tsx={bgColor}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\twidth: '60px',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t: columns\n\t\t\t\t\t}\n\t\t\t\t\tpaginationPerPage={tableRowsPerPageOptions[0]}\n\t\t\t\t\tpaginationRowsPerPageOptions={tableRowsPerPageOptions}\n\t\t\t\t\texpandableIcon={{\n\t\t\t\t\t\texpanded: ,\n\t\t\t\t\t\tcollapsed: ,\n\t\t\t\t\t}}\n\t\t\t\t\tpaginationIconFirstPage={getPaginationIcon(FirstPage)}\n\t\t\t\t\tpaginationIconLastPage={getPaginationIcon(LastPage)}\n\t\t\t\t\tpaginationIconPrevious={getPaginationIcon(ChevronLeft)}\n\t\t\t\t\tpaginationIconNext={getPaginationIcon(ChevronRight)}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t
\n\t\t\t{actionItems && (\n\t\t\t\t\n\t\t\t\t\t{actionItems.map((item, index) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof item.hideIf === 'function' &&\n\t\t\t\t\t\t\tselectedActionItem &&\n\t\t\t\t\t\t\titem.hideIf(selectedActionItem)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t onActionItemClick(e, item)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{item.name}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t)\n}\n\nexport default DataTable\n","import DataTable from './DataTable'\nimport type { ActionItem, DataTableProps } from './DataTable'\nimport SubHeader from './SubHeader'\n\nexport { SubHeader, ActionItem, DataTableProps }\nexport default DataTable\n","import React from 'react'\nimport clsx from 'clsx'\nimport WarningIcon from '@mui/icons-material/Warning'\n\nexport type ErrorListItemProps = {\n\tproperty?: string\n\tpropertyName?: string\n\terror?: string\n\terrorMessage?: string\n\tmessage?: string\n}\n\nexport type ErrorListProps = {\n\ttitle?: string\n\terrors?: ErrorListItemProps[]\n\tclassName?: string\n}\n\nconst ErrorList = ({ title, errors, className }: ErrorListProps) => {\n\tif (!errors || errors.length === 0) return null\n\n\tconst errorsWithUuid = errors.map((error) => {\n\t\treturn {\n\t\t\t...error,\n\t\t\tuuid: crypto.randomUUID(),\n\t\t}\n\t})\n\treturn (\n\t\t
\n\t\t\t{title &&

{title}

}\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t\t{errorsWithUuid?.map((error) => (\n\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t{(error.property || error.propertyName) && (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{error.property || error.propertyName}:\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}{' '}\n\t\t\t\t\t\t\t{error.message || error.error || error.errorMessage}\n\t\t\t\t\t\t
  • \n\t\t\t\t\t))}\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t)\n}\n\nexport default ErrorList\n","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getListItemAvatarUtilityClass(slot) {\n return generateUtilityClass('MuiListItemAvatar', slot);\n}\nconst listItemAvatarClasses = generateUtilityClasses('MuiListItemAvatar', ['root', 'alignItemsFlexStart']);\nexport default listItemAvatarClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport ListContext from '../List/ListContext';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport { getListItemAvatarUtilityClass } from './listItemAvatarClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n alignItems,\n classes\n } = ownerState;\n const slots = {\n root: ['root', alignItems === 'flex-start' && 'alignItemsFlexStart']\n };\n return composeClasses(slots, getListItemAvatarUtilityClass, classes);\n};\nconst ListItemAvatarRoot = styled('div', {\n name: 'MuiListItemAvatar',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.alignItems === 'flex-start' && styles.alignItemsFlexStart];\n }\n})(({\n ownerState\n}) => _extends({\n minWidth: 56,\n flexShrink: 0\n}, ownerState.alignItems === 'flex-start' && {\n marginTop: 8\n}));\n\n/**\n * A simple wrapper to apply `List` styles to an `Avatar`.\n */\nconst ListItemAvatar = /*#__PURE__*/React.forwardRef(function ListItemAvatar(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiListItemAvatar'\n });\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const context = React.useContext(ListContext);\n const ownerState = _extends({}, props, {\n alignItems: context.alignItems\n });\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(ListItemAvatarRoot, _extends({\n className: clsx(classes.root, className),\n ownerState: ownerState,\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? ListItemAvatar.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component, normally an `Avatar`.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default ListItemAvatar;","import { useCallback } from 'react'\n\nconst useImageValidator = () => {\n\tconst isImage = useCallback((file) => {\n\t\tconst imageExtensions = [\n\t\t\t'jpg',\n\t\t\t'jpeg',\n\t\t\t'png',\n\t\t\t'gif',\n\t\t\t'webp',\n\t\t\t'heic',\n\t\t\t'svg',\n\t\t]\n\t\tconst filePath = file?.file\n\t\t\t? file?.file?.url\n\t\t\t: file?.path || file?.name\n\t\tconst extension = filePath.split('.').pop().toLowerCase()\n\t\treturn imageExtensions.includes(extension)\n\t}, [])\n\n\treturn isImage\n}\n\nexport default useImageValidator\n","import React, { useState } from 'react'\nimport ImageIcon from '@mui/icons-material/Image'\n\nconst ImagePlaceholderPreview = ({ file }) => {\n\tconst [isUrlError, setIsUrlError] = useState(false)\n\n\tconst handleError = () => {\n\t\tsetIsUrlError(true)\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{!isUrlError ? (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t) : (\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t)\n}\n\nexport default ImagePlaceholderPreview\n","import React, { useState } from 'react'\nimport {\n\tList,\n\tListItem,\n\tIconButton,\n\tListItemText,\n\tListItemSecondaryAction,\n\tListItemAvatar,\n} from '@mui/material'\nimport CloseIcon from '@mui/icons-material/Close'\nimport FileIcon from '@mui/icons-material/InsertDriveFile'\nimport { ModalRemoveRestoreRecordConfirm } from './modals/ModalRemoveRestoreRecordConfirm'\nimport useImageValidator from '../hooks/useImageValidator'\nimport ImagePlaceholderPreview from './ImagePlaceholderPreview'\n\nconst FileList = ({\n\tclassName,\n\tfiles,\n\tonRemoveClick: onRemoveConfirmProp,\n\tonFileClick,\n}) => {\n\tconst [deleteModalOpen, setDeleteModalOpen] = useState(false)\n\tconst [selectedFile, setSelectedFile] = useState(null)\n\tconst isImage = useImageValidator()\n\n\tif (!files || files.length === 0) {\n\t\treturn null\n\t}\n\n\tconst onRemoveClick = (file) => {\n\t\tsetSelectedFile(file)\n\t\tsetDeleteModalOpen(true)\n\t}\n\n\tconst onRemoveConfirm = () => {\n\t\tif (onRemoveConfirmProp) {\n\t\t\tonRemoveConfirmProp(selectedFile)\n\t\t}\n\t\tsetDeleteModalOpen(false)\n\t\tsetSelectedFile(null)\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\n\t\t\t\t{files.map((file) => (\n\t\t\t\t\t onFileClick(file.id)}\n\t\t\t\t\t\tstyle={{ cursor: onFileClick ? 'pointer' : '' }}\n\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{isImage(file) && file.file ? (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t{onRemoveClick && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t onRemoveClick(file)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\t\t\t\t\t\n\t\t\t\t))}\n\t\t\t\n\t\t\n\t)\n}\n\nexport default FileList\n","import React, { ReactNode } from 'react'\nimport clsx from 'clsx'\n\ntype HeadingProps = {\n\tchildren: ReactNode\n\tsize?: 'lg' | '2xl' | 'xl' | 'md' | 'sm'\n\tclassName?: string\n\tbutton?: ReactNode\n}\n\nconst Heading = ({\n\tchildren,\n\tsize = '2xl',\n\tclassName = undefined,\n\tbutton = null,\n}: HeadingProps) => {\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t{children}\n\t\t\t

\n\t\t\t{button}\n\t\t
\n\t)\n}\n\nexport default Heading\n","import React from 'react'\nimport loading from 'assets/loading.gif'\n\nexport type LoadingProps = {\n\tsize?: 'small'\n}\n\nexport const Loading = ({ size }: LoadingProps) => {\n\treturn (\n\t\t\n\t)\n}\n","import React from 'react'\n// @ts-ignore\nimport loadingDots from 'assets/loadingDots.gif'\n\ntype LoadingDotsProps = {\n\tstyle?: React.CSSProperties\n\tclassName?: string\n}\n\nconst LoadingDots = ({ style, className }: LoadingDotsProps) => (\n\t\n)\n\n/**\n * @deprecated use the default export instead\n */\nexport { LoadingDots }\n\nexport default LoadingDots\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n}\n","import React from 'react'\nimport {\n\tInputLabel,\n\tMenuItem,\n\tSelect,\n\tSelectChangeEvent,\n} from '@mui/material'\nimport { LoanQueueSearchCriteria } from '@matech/thebigpos-sdk'\nimport { FormControl } from '../formControls'\n\ntype LoanQueueSearchFiltersProps = {\n\thandleFilterChange: (\n\t\te: SelectChangeEvent,\n\t\tfilterName: string\n\t) => void\n\tsearchCriteria: LoanQueueSearchCriteria\n}\n\nconst LoanQueueSearchFilters = ({\n\thandleFilterChange,\n\tsearchCriteria,\n}: LoanQueueSearchFiltersProps) => {\n\tconst statuses: Record = {\n\t\tPending: 'Pending',\n\t\tRetrying: 'Retrying',\n\t\tSuccessful: 'Successful',\n\t\tFailed: 'Failed',\n\t\tFailedPermanently: 'Failed Permanently',\n\t\tUnknown: 'Unknown',\n\t}\n\n\tconst types = [\n\t\t'New',\n\t\t'Append',\n\t\t'Update',\n\t\t'Document',\n\t\t'Unknown',\n\t] as const\n\n\tconst reasons: Record = {\n\t\tLocked: 'Locked',\n\t\tLOSError: 'Encompass Error',\n\t\tException: 'Exception',\n\t\tUnknown: 'Unknown',\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\tType\n\t\t\t\t\n\t\t\t\t\tvalue={searchCriteria.type || 'all'}\n\t\t\t\t\tonChange={(e) => handleFilterChange(e, 'type')}\n\t\t\t\t\tname=\"Type\"\n\t\t\t\t>\n\t\t\t\t\tShow All\n\t\t\t\t\t{Object.values(types).map((key) => (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{key}\n\t\t\t\t\t\t\n\t\t\t\t\t))}\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\tStatus\n\t\t\t\t\n\t\t\t\t\tvalue={searchCriteria.status || 'all'}\n\t\t\t\t\tonChange={(e) => handleFilterChange(e, 'status')}\n\t\t\t\t\tname=\"Status\"\n\t\t\t\t>\n\t\t\t\t\tShow All\n\t\t\t\t\t{Object.entries(statuses).map(([key, value]) => (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{value}\n\t\t\t\t\t\t\n\t\t\t\t\t))}\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\tReason\n\t\t\t\t\n\t\t\t\t\tvalue={searchCriteria.reason || 'all'}\n\t\t\t\t\tonChange={(e) => handleFilterChange(e, 'reason')}\n\t\t\t\t\tname=\"Reason\"\n\t\t\t\t\tlabel=\"Reason\"\n\t\t\t\t>\n\t\t\t\t\tShow All\n\t\t\t\t\t{Object.entries(reasons).map(([key, value]) => (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{value}\n\t\t\t\t\t\t\n\t\t\t\t\t))}\n\t\t\t\t\n\t\t\t\n\t\t\n\t)\n}\n\nexport default LoanQueueSearchFilters\n","import { LoanQueue } from '@matech/thebigpos-sdk'\nimport React from 'react'\nimport { ExpanderComponentProps } from 'react-data-table-component'\nimport { useIntl } from 'react-intl'\nimport RowExpandedProperty from '../RowExpandedProperty'\nimport config from '../../config'\nimport { formatDate } from '../../services/helper'\nimport useUser from '../../hooks/useUser'\n\nconst LoanQueueExpandedRow = ({\n\tdata: loanQueueEntry,\n}: ExpanderComponentProps) => {\n\tconst { isSuperAdmin } = useUser()\n\tconst { formatMessage } = useIntl()\n\tconst { loan, user, details, createdAt, reason, status, jobID } =\n\t\tloanQueueEntry\n\tconst { firstName, lastName, email } = user\n\tconst fullName = `${firstName} ${lastName}`\n\n\treturn (\n\t\t
\n\t\t\t{loan && (\n\t\t\t\t\n\t\t\t)}\n\t\t\t\n\t\t\t\n\t\t\t{isSuperAdmin && (\n\t\t\t\t\n\t\t\t\t\t\t\t{jobID}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t
\n\t)\n}\n\nexport default LoanQueueExpandedRow\n","import React from 'react'\nimport { LoanQueue } from '@matech/thebigpos-sdk'\nimport { useIntl } from 'react-intl'\n\nexport type LoanQueueTypeLabelProps = {\n\ttype: LoanQueue['type']\n}\n\nconst LoanQueueTypeLabel = ({ type }: LoanQueueTypeLabelProps) => {\n\tconst { formatMessage } = useIntl()\n\n\tconst typeMap: Record = {\n\t\tNew: formatMessage({ id: 'loan_queue.type.new_loan' }),\n\t\tAppend: formatMessage({ id: 'loan_queue.type.new_cob_loan' }),\n\t\tUpdate: formatMessage({ id: 'loan_queue.type.loan_update' }),\n\t\tFieldUpdates: formatMessage({\n\t\t\tid: 'loan_queue.type.field_update',\n\t\t}),\n\t\tDocument: formatMessage({\n\t\t\tid: 'loan_queue.type.document_upload',\n\t\t}),\n\t\tBuckets: formatMessage({ id: 'loan_queue.type.new_buckets' }),\n\t}\n\treturn {typeMap[type] || 'Unknown'}\n}\n\nexport default LoanQueueTypeLabel\n","import React from 'react'\nimport clsx from 'clsx'\n\nexport type BadgeProps = {\n\tlabel: string\n\tcolor: 'info' | 'success' | 'warning' | 'danger'\n}\n\nconst Badge = ({ label, color }: BadgeProps) => {\n\tconst colorMap: Record = {\n\t\tinfo: 'bg-blue-500',\n\t\tsuccess: 'bg-emerald-400',\n\t\twarning: 'bg-orange-400',\n\t\tdanger: 'bg-red-400',\n\t}\n\treturn (\n\t\t\n\t\t\t{label}\n\t\t\n\t)\n}\n\nexport default Badge\n","import React from 'react'\nimport { LoanQueue } from '@matech/thebigpos-sdk'\nimport Badge, { BadgeProps } from '../Badge'\n\nexport type LoanQueueStatusBadgeProps = {\n\tstatus: LoanQueue['status']\n}\n\nconst LoanQueueStatusBadge = ({\n\tstatus,\n}: LoanQueueStatusBadgeProps) => {\n\tconst statusColorMap: Record<\n\t\tLoanQueue['status'],\n\t\tBadgeProps['color']\n\t> = {\n\t\tPending: 'info',\n\t\tProcessing: 'warning',\n\t\tCompleted: 'success',\n\t\tFailed: 'danger',\n\t\tError: 'danger',\n\t\tCanceled: 'warning',\n\t\tRetrying: 'warning',\n\t}\n\n\treturn \n}\n\nexport default LoanQueueStatusBadge\n","import React, { useEffect } from 'react'\nimport { FormProvider } from 'react-hook-form'\nimport type {\n\tLoanQueueWithData,\n\tUpdateLoanQueueRequest,\n} from '@matech/thebigpos-sdk'\nimport { useIntl } from 'react-intl'\nimport * as yup from 'yup'\nimport useForm from '../hooks/useForm'\nimport { Form, FormRow } from '../components/formControls'\nimport CodeEditorField from '../components/formControls/CodeEditorField'\nimport { LoadingBtn } from '../components/Button'\nimport { isJsonString } from '../services/utils'\n\nexport type LoanQueueItemFormProps = {\n\tloanQueueItemData: LoanQueueWithData['data']\n\tonSubmit: (data: UpdateLoanQueueRequest) => void\n\tloading?: boolean\n}\n\nconst LoanQueueItemForm = ({\n\tloanQueueItemData,\n\tonSubmit,\n\tloading = false,\n}: LoanQueueItemFormProps) => {\n\tconst { formatMessage } = useIntl()\n\tconst methods = useForm({\n\t\tdefaultValues: {\n\t\t\tdata: JSON.stringify(loanQueueItemData, null, 2),\n\t\t},\n\t\tschema: yup\n\t\t\t.object()\n\t\t\t.shape({\n\t\t\t\tdata: yup.string().required(),\n\t\t\t})\n\t\t\t.required(),\n\t})\n\n\tconst { handleSubmit, watch, reset } = methods\n\n\tconst isCurrentJsonValid = isJsonString(watch('data'))\n\n\tconst handleSaveClick = async (\n\t\tformData: UpdateLoanQueueRequest\n\t) => {\n\t\tconst isValid = isJsonString(formData.data)\n\t\tif (!isValid) {\n\t\t\treturn\n\t\t}\n\t\tonSubmit(JSON.parse(formData.data))\n\t}\n\n\tuseEffect(() => {\n\t\treset({\n\t\t\tdata: JSON.stringify(loanQueueItemData, null, 2),\n\t\t})\n\t}, [loanQueueItemData, reset])\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t)\n}\n\nexport default LoanQueueItemForm\n","import React, { useEffect, useState } from 'react'\nimport {\n\tuseMutation,\n\tuseQuery,\n\tuseQueryClient,\n} from '@tanstack/react-query'\nimport { TableColumn } from 'react-data-table-component'\nimport {\n\tLoanQueue,\n\tLoanQueueReason,\n\tLoanQueueSearchCriteria,\n\tLoanQueueType,\n\tLOSStatus,\n\tUpdateLoanQueueRequest,\n} from '@matech/thebigpos-sdk'\nimport { SelectChangeEvent } from '@mui/material'\nimport { AxiosError } from 'axios'\nimport { useIntl } from 'react-intl'\nimport { getTheme } from '../../config'\nimport { useAlert } from '../../hooks'\nimport useSearch from '../../hooks/useSearch'\nimport usePagination from '../../hooks/usePagination'\nimport { FixMeLater } from '../../types'\nimport queryKeys from '../../services/queryKeys'\nimport { TheBigPOSApi } from '../../lib/TheBigPOSClient'\nimport { formatDate } from '../../services/helper'\nimport DataTable, { ActionItem } from '../DataTable'\nimport LoanQueueSearchFilters from './LoanQueueSearchFilters'\nimport LoanQueueExpandedRow from './LoanQueueExpandedRow'\nimport useUser from '../../hooks/useUser'\nimport { ModalRemoveRestoreRecordConfirm } from '../modals/ModalRemoveRestoreRecordConfirm'\nimport LoanQueueTypeLabel from './LoanQueueTypeLabel'\nimport LoanQueueStatusBadge from './LoanQueueStatusBadge'\nimport Dialog from '../modals/Dialog'\nimport LoanQueueItemForm from '../../forms/LoanQueueItemForm'\n\nconst theme = getTheme()\n\ntype LoanQueueListProps = {\n\tloanId?: string\n\ttitle?: string\n}\n\nexport type LoanQueueSearchCriteriaFilters = {\n\tstatus?: LOSStatus & 'all'\n\ttype?: LoanQueueType & 'all'\n\treason?: LoanQueueReason & 'all'\n} & LoanQueueSearchCriteria\n\nconst LoanQueueList = ({ loanId, title }: LoanQueueListProps) => {\n\tconst { alert } = useAlert()\n\tconst queryClient = useQueryClient()\n\tconst { isAdmin } = useUser()\n\tconst { formatMessage } = useIntl()\n\tconst { dataTable: breakpoint } = theme.breakpoints\n\n\tconst { searchText, handleSearchChange, handleClearSearchClick } =\n\t\tuseSearch({})\n\tconst [searchCriteria, setSearchCriteria] =\n\t\tuseState({\n\t\t\tsearchText,\n\t\t\tloanID: loanId,\n\t\t} as LoanQueueSearchCriteria)\n\n\tconst [filters, setFilters] = useState({\n\t\ttype: undefined,\n\t\treason: undefined,\n\t\tstatus: undefined,\n\t} as LoanQueueSearchCriteriaFilters)\n\n\tconst [viewModalOpen, setViewModalOpen] = useState(false)\n\tconst [deleteModalOpen, setDeleteModalOpen] = useState(false)\n\tconst [selectedItem, setSelectedItem] = useState(\n\t\tnull\n\t)\n\n\tconst { defaultSortColumn, defaultSortDirection } = theme.pagination\n\tconst {\n\t\tpageNumber,\n\t\tpageSize,\n\t\tsortBy,\n\t\tsortDirection,\n\t\thandleSort,\n\t\thandleRowsPerPageChange,\n\t\thandlePageChange,\n\t} = usePagination({\n\t\tdefaultSortBy: defaultSortColumn,\n\t\tdefaultSortDirection: defaultSortDirection as FixMeLater,\n\t})\n\n\tconst {\n\t\tisFetching,\n\t\tisRefetching,\n\t\tisError,\n\t\tdata: result,\n\t\trefetch,\n\t} = useQuery({\n\t\tqueryKey: [\n\t\t\tqueryKeys.loanQueue,\n\t\t\t{\n\t\t\t\tloanId,\n\t\t\t\tsearchCriteria,\n\t\t\t\tpageNumber,\n\t\t\t\tpageSize,\n\t\t\t\tsortBy,\n\t\t\t\tsortDirection,\n\t\t\t},\n\t\t],\n\t\tqueryFn: () =>\n\t\t\tTheBigPOSApi.searchLoanQueue(searchCriteria, {\n\t\t\t\tpageNumber,\n\t\t\t\tpageSize,\n\t\t\t\tsortBy,\n\t\t\t\tsortDirection,\n\t\t\t}),\n\t})\n\n\tconst {\n\t\tdata: selectedItemResult,\n\t\tisError: selectedItemError,\n\t\tisFetching: selectedItemIsFetching,\n\t} = useQuery({\n\t\tqueryKey: [\n\t\t\tqueryKeys.loanQueue,\n\t\t\t{\n\t\t\t\tloanId,\n\t\t\t\tid: selectedItem?.id,\n\t\t\t},\n\t\t],\n\t\tqueryFn: () => TheBigPOSApi.getLoanQueue(selectedItem?.id || ''),\n\t\tenabled: !!selectedItem && viewModalOpen,\n\t})\n\n\tuseEffect(() => {\n\t\tif (!isError && !selectedItemError) return\n\n\t\talert(formatMessage({ id: 'errors.error_loading' }), {\n\t\t\tseverity: 'error',\n\t\t})\n\t}, [isError, alert, formatMessage, selectedItemError])\n\n\tuseEffect(() => {\n\t\tsetSearchCriteria((prev) => ({ ...prev, searchText }))\n\t}, [searchText])\n\n\tconst handleFilterChange = (\n\t\te: SelectChangeEvent,\n\t\tfield: string\n\t) => {\n\t\tsetFilters((prev) => ({\n\t\t\t...prev,\n\t\t\t[field]: e.target.value,\n\t\t}))\n\t}\n\n\tconst columns: TableColumn[] = [\n\t\t{\n\t\t\tname: formatMessage({ id: 'global.type' }),\n\t\t\tselector: (row: LoanQueue) => row.type,\n\t\t\tcell: (row: LoanQueue) => (\n\t\t\t\t\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: formatMessage({ id: 'global.reason' }),\n\t\t\tselector: (row: LoanQueue) => row.reason,\n\t\t\thide: breakpoint,\n\t\t},\n\t\t{\n\t\t\tname: formatMessage({ id: 'global.status' }),\n\t\t\tselector: (row: LoanQueue) => row.status,\n\t\t\tcell: (row: LoanQueue) => (\n\t\t\t\t\n\t\t\t),\n\t\t},\n\t\t...(isAdmin\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: formatMessage({ id: 'users.loan_officer' }),\n\t\t\t\t\t\tselector: (row: LoanQueue) =>\n\t\t\t\t\t\t\trow.loanOfficer\n\t\t\t\t\t\t\t\t? `${row.loanOfficer.firstName} ${row.loanOfficer.lastName}`\n\t\t\t\t\t\t\t\t: formatMessage({ id: 'loans.not_assigned' }),\n\t\t\t\t\t\thide: breakpoint,\n\t\t\t\t\t},\n\t\t\t\t]\n\t\t\t: []),\n\t\t{\n\t\t\tname: formatMessage({ id: 'global.created' }),\n\t\t\tsortField: 'createdAt',\n\t\t\tselector: (row: LoanQueue) => row.createdAt,\n\t\t\tcell: (row) => formatDate(row.createdAt, false),\n\t\t\tsortable: true,\n\t\t\thide: breakpoint,\n\t\t},\n\t]\n\n\tconst resendMutation = useMutation({\n\t\tmutationFn: (loanQueueId: string) => {\n\t\t\treturn TheBigPOSApi.retryLoanQueue(loanQueueId)\n\t\t},\n\t})\n\n\tconst deleteMutation = useMutation({\n\t\tmutationFn: (loanQueueId: string) => {\n\t\t\treturn TheBigPOSApi.deleteLoanQueue(loanQueueId)\n\t\t},\n\t})\n\n\tconst updateMutation = useMutation({\n\t\tmutationFn: ({\n\t\t\tloanQueueId,\n\t\t\tdata,\n\t\t}: {\n\t\t\tloanQueueId: string\n\t\t\tdata: UpdateLoanQueueRequest\n\t\t}) => {\n\t\t\treturn TheBigPOSApi.replaceLoanQueue(loanQueueId, { data })\n\t\t},\n\t})\n\n\tconst handleRowResendClick = async (row: LoanQueue) => {\n\t\ttry {\n\t\t\tawait resendMutation.mutateAsync(row.id)\n\t\t\talert(\n\t\t\t\tformatMessage(\n\t\t\t\t\t{ id: 'alerts.save_success' },\n\t\t\t\t\t{ name: formatMessage({ id: 'global.retry' }) }\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tseverity: 'success',\n\t\t\t\t}\n\t\t\t)\n\t\t\tawait queryClient.invalidateQueries({\n\t\t\t\tqueryKey: [queryKeys.loanQueue, { loanId }],\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tif (err instanceof AxiosError) {\n\t\t\t\talert(\n\t\t\t\t\terr?.response?.data?.message ||\n\t\t\t\t\t\ttheme.api_messages.server_error,\n\t\t\t\t\t{ severity: 'error' }\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\talert(theme.api_messages.server_error, {\n\t\t\t\t\tseverity: 'error',\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleRowDeleteClick = (row: LoanQueue) => {\n\t\tsetSelectedItem(row)\n\t\tsetDeleteModalOpen(true)\n\t}\n\n\tconst handleRowViewClick = (row: LoanQueue) => {\n\t\tsetSelectedItem(row)\n\t\tsetViewModalOpen(true)\n\t}\n\n\tconst handleLoanQueueItemFormSubmit = async (\n\t\tdata: UpdateLoanQueueRequest\n\t) => {\n\t\tif (!selectedItem?.id) {\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tawait updateMutation.mutateAsync({\n\t\t\t\tloanQueueId: selectedItem.id,\n\t\t\t\tdata,\n\t\t\t})\n\t\t\tawait resendMutation.mutateAsync(selectedItem.id)\n\t\t\tsetViewModalOpen(false)\n\t\t\talert(\n\t\t\t\tformatMessage(\n\t\t\t\t\t{ id: 'alerts.save_success' },\n\t\t\t\t\t{ name: formatMessage({ id: 'global.retry' }) }\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tseverity: 'success',\n\t\t\t\t}\n\t\t\t)\n\t\t\tawait queryClient.invalidateQueries({\n\t\t\t\tqueryKey: [queryKeys.loanQueue, { loanId }],\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tif (err instanceof AxiosError) {\n\t\t\t\talert(\n\t\t\t\t\terr?.response?.data?.message ||\n\t\t\t\t\t\tformatMessage({ id: 'errors.general' }),\n\t\t\t\t\t{ severity: 'error' }\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\talert(formatMessage({ id: 'errors.general' }), {\n\t\t\t\t\tseverity: 'error',\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\tconst viewableTypes = ['New', 'Append', 'Update', 'FieldUpdates']\n\n\tconst actionItems: ActionItem[] = [\n\t\t{\n\t\t\tname: formatMessage({ id: 'global.view' }),\n\t\t\tonClick: (\n\t\t\t\te: React.MouseEvent,\n\t\t\t\trow: LoanQueue\n\t\t\t) => handleRowViewClick(row),\n\t\t\thideIf: (row: LoanQueue) =>\n\t\t\t\t!isAdmin || !viewableTypes.includes(row.type),\n\t\t},\n\t\t{\n\t\t\tname: formatMessage({ id: 'global.resend' }),\n\t\t\tonClick: (\n\t\t\t\te: React.MouseEvent,\n\t\t\t\trow: LoanQueue\n\t\t\t) => handleRowResendClick(row),\n\t\t},\n\t\t{\n\t\t\tname: formatMessage({ id: 'global.delete' }),\n\t\t\tonClick: (\n\t\t\t\te: React.MouseEvent,\n\t\t\t\trow: LoanQueue\n\t\t\t) => handleRowDeleteClick(row),\n\t\t\thideIf: () => !isAdmin,\n\t\t},\n\t]\n\n\tuseEffect(() => {\n\t\tlet changedFilters = filters\n\n\t\tif (filters.type === 'all') {\n\t\t\tchangedFilters = { ...changedFilters, type: undefined }\n\t\t}\n\t\tif (filters.reason === 'all') {\n\t\t\tchangedFilters = { ...changedFilters, reason: undefined }\n\t\t}\n\t\tif (filters.status === 'all') {\n\t\t\tchangedFilters = { ...changedFilters, status: undefined }\n\t\t}\n\t\tsetSearchCriteria((prev) => ({ ...prev, ...changedFilters }))\n\t}, [filters])\n\n\tconst handleViewModalClose = () => {\n\t\tsetViewModalOpen(false)\n\t}\n\n\tconst deleteItem = async () => {\n\t\tif (!selectedItem) return\n\t\ttry {\n\t\t\tawait deleteMutation.mutateAsync(selectedItem?.id)\n\t\t\talert(\n\t\t\t\tformatMessage(\n\t\t\t\t\t{ id: 'alerts.delete_success' },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: formatMessage({\n\t\t\t\t\t\t\tid: 'loan_queue.loan_queue_record',\n\t\t\t\t\t\t}),\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tseverity: 'success',\n\t\t\t\t}\n\t\t\t)\n\t\t\tawait queryClient.invalidateQueries({\n\t\t\t\tqueryKey: [queryKeys.loanQueue, { loanId }],\n\t\t\t})\n\t\t} catch (err) {\n\t\t\tif (err instanceof AxiosError) {\n\t\t\t\talert(\n\t\t\t\t\terr?.response?.data?.message ||\n\t\t\t\t\t\tformatMessage({ id: 'errors.general' }),\n\t\t\t\t\t{ severity: 'error' }\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\talert(formatMessage({ id: 'errors.general' }), {\n\t\t\t\t\tseverity: 'error',\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tsetDeleteModalOpen(false)\n\t\tsetSelectedItem(null)\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\tdata={result?.data?.rows || []}\n\t\t\t\tcolumns={columns}\n\t\t\t\tprogressPending={isFetching}\n\t\t\t\tfixedHeader\n\t\t\t\tactionItems={actionItems}\n\t\t\t\tonSearchChange={handleSearchChange}\n\t\t\t\tonSort={handleSort}\n\t\t\t\tsearchText={searchText}\n\t\t\t\tonClearSearchClick={handleClearSearchClick}\n\t\t\t\tdefaultSortFieldId={sortBy}\n\t\t\t\tdefaultSortAsc={sortDirection === 'asc'}\n\t\t\t\tonChangePage={handlePageChange}\n\t\t\t\tonChangeRowsPerPage={handleRowsPerPageChange}\n\t\t\t\tpagination\n\t\t\t\texpandableRowsComponent={LoanQueueExpandedRow}\n\t\t\t\texpandableRows\n\t\t\t\tpaginationTotalRows={result?.data?.count}\n\t\t\t\tpaginationServer\n\t\t\t\ttitle={title}\n\t\t\t\tonRefreshClick={refetch}\n\t\t\t\trefreshing={\n\t\t\t\t\tisRefetching ||\n\t\t\t\t\tresendMutation.isPending ||\n\t\t\t\t\tdeleteMutation.isPending\n\t\t\t\t}\n\t\t\t\tsearchFilters={\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t/>\n\t\t\n\t)\n}\n\nexport default LoanQueueList\n","import {\n\tFormControl,\n\tInputLabel,\n\tListSubheader,\n\tMenuItem,\n\tSelect,\n} from '@mui/material'\nimport {\n\tdefaultOptions,\n\tloanFieldOptions,\n\tgroupedOptions,\n\tsiteConfigOptions,\n} from '../services/helper'\nimport { useAlert } from '../hooks'\n\nexport default function MailMergeSelect({\n\tloanOptions = false,\n\tsiteOptions = false,\n\tcombinedOptions = false,\n\tclassName = '',\n}) {\n\tconst { alert } = useAlert()\n\n\tconst formatMailMergeVar = (opt) => {\n\t\treturn opt.html ? `{{{${opt.value}}}}` : `{{${opt.value}}}`\n\t}\n\n\tconst handleMailMergeChange = async (\n\t\topt,\n\t\twrapInCurlies = false\n\t) => {\n\t\tif (opt.value) {\n\t\t\tconst value = wrapInCurlies\n\t\t\t\t? formatMailMergeVar(opt)\n\t\t\t\t: opt.value\n\t\t\tawait navigator.clipboard.writeText(value)\n\t\t\talert(`${value} Copied to Clipboard!`)\n\t\t}\n\t}\n\n\treturn (\n\t\t
\n\t\t\t{loanOptions && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t- Loan Fields -\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\thandleMailMergeChange(e.target.value, true)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={``}\n\t\t\t\t\t>\n\t\t\t\t\t\t{loanFieldOptions.map((item, index) => (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{item.label}{' '}\n\t\t\t\t\t\t\t\t{!!item.value && `- ${formatMailMergeVar(item)}`}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t))}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t{siteOptions && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t- Site Configuration Fields -\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\thandleMailMergeChange(e.target.value, true)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={``}\n\t\t\t\t\t>\n\t\t\t\t\t\t{siteConfigOptions.map((item, index) => (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{item.label}{' '}\n\t\t\t\t\t\t\t\t{!!item.value && `- ${formatMailMergeVar(item)}`}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t))}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t{combinedOptions && (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t- All Mail Merge Fields -\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\thandleMailMergeChange(e.target.value, true)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={``}\n\t\t\t\t\t>\n\t\t\t\t\t\t{groupedOptions.map((item, index) => [\n\t\t\t\t\t\t\t{item.label},\n\t\t\t\t\t\t\titem.options.map((option, optionIndex) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{option.label}{' '}\n\t\t\t\t\t\t\t\t\t{!!option.value &&\n\t\t\t\t\t\t\t\t\t\t`- ${formatMailMergeVar(option)}`}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t])}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t
\n\t)\n}\n","import React, { createContext, useEffect, useMemo } from 'react'\nimport mixpanel from 'mixpanel-browser'\n\nexport const MixpanelContext = createContext(null)\n\nexport const MixpanelProvider = ({ children }) => {\n\tconst mixPanelKey = process.env.REACT_APP_MIXPANEL_API_KEY\n\tconst MIXPANEL_DEBUG =\n\t\tprocess.env.REACT_APP_MIXPANEL_DEBUG === 'true'\n\n\tconst mixpanelInstance = useMemo(() => {\n\t\tmixpanel.init(mixPanelKey, {\n\t\t\tdebug: MIXPANEL_DEBUG,\n\t\t})\n\t\treturn mixpanel\n\t}, [mixPanelKey])\n\n\treturn (\n\t\t\n\t\t\t{children}\n\t\t\n\t)\n}\n","import React, { useEffect } from 'react'\nimport { useAppContext } from './AppContext'\nimport { FixMeLater } from '../types'\n// import ChatBot from \"./ChatBot\"\n\nexport type PageProps = {\n\tchildren: React.ReactNode\n\tpage?: string\n\ttitle?: string\n\tisFullWidth?: boolean\n\tnoDarkMode?: boolean\n}\n\nexport default function Page({\n\tchildren,\n\tpage = '',\n\ttitle,\n\tisFullWidth = false,\n\tnoDarkMode = false,\n}: PageProps) {\n\tconst { state } = useAppContext()\n\tconst { siteConfig } = state\n\n\tuseEffect(() => {\n\t\tconst titleName = (siteConfig as FixMeLater)?.name || ''\n\n\t\t// @todo - fix nested ternary\n\t\t// eslint-disable-next-line no-nested-ternary\n\t\tdocument.title = title\n\t\t\t? titleName\n\t\t\t\t? `${titleName} - ${title}`\n\t\t\t\t: title\n\t\t\t: titleName\n\t}, [title, siteConfig])\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t\t{children}\n\t\t\t\t{/* {process.env.REACT_APP_ENV_NAME !== 'shared' && user?.isLoggedIn && [\"LoanOfficer\", \"BranchManager\"].includes(user.role) && } */}\n\t\t\t
\n\t\t\n\t)\n}\n","import React, { useEffect, useState } from 'react'\nimport DataTable from './DataTable'\n\nconst PaginatedDataTable = ({\n\tdefaultSortAsc = true,\n\tdefaultSortFieldId,\n\tonPaginationChange,\n\t...rest\n}) => {\n\tconst [pageNumber, setPageNumber] = useState(1)\n\tconst [pageSize, setPageSize] = useState(10)\n\tconst [sortBy, setSortBy] = useState(defaultSortFieldId)\n\tconst [sortDirection, setSortDirection] = useState(\n\t\tdefaultSortAsc ? 'asc' : 'desc'\n\t)\n\n\tconst handlePerRowsChange = (newPerPage, page) => {\n\t\tsetPageNumber(page)\n\t\tsetPageSize(newPerPage)\n\t}\n\n\tconst handlePageChange = (page) => {\n\t\tsetPageNumber(page)\n\t}\n\n\tconst onSort = (column, sortDirection) => {\n\t\tsetSortBy(column?.sortField || defaultSortFieldId)\n\t\tsetSortDirection(sortDirection)\n\t}\n\n\tuseEffect(() => {\n\t\tonPaginationChange({\n\t\t\tpageNumber,\n\t\t\tpageSize,\n\t\t\tsortBy,\n\t\t\tsortDirection,\n\t\t})\n\t}, [pageNumber, pageSize, sortBy, sortDirection])\n\n\treturn (\n\t\t\n\t)\n}\n\nexport default PaginatedDataTable\n","import React from 'react'\n\ntype RowExpandedPropertyProps = {\n\tlabel: string\n\tvalue: string | null | React.ReactNode\n\tclassName?: string\n}\n\nconst RowExpandedProperty = ({\n\tlabel,\n\tvalue,\n\tclassName = undefined,\n}: RowExpandedPropertyProps) => {\n\treturn (\n\t\t
\n\t\t\t

\n\t\t\t\t{label}\n\t\t\t

\n\t\t\t

\n\t\t\t\t{value}\n\t\t\t

\n\t\t
\n\t)\n}\n\nexport default RowExpandedProperty\n","import React from 'react'\nimport { isDarkMode } from '../services/helper'\nimport { useAppContext } from './AppContext'\nimport { useNavigate } from 'react-router-dom'\n\nconst SiteLogo = ({ className = undefined }) => {\n\tconst navigate = useNavigate()\n\tconst { state } = useAppContext()\n\tconst { siteConfig } = state\n\n\tconst onClick = (e) => {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t\tnavigate('/')\n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t)\n}\n\nexport default SiteLogo\n","import React from 'react'\n\nfunction TabPanel(props) {\n\tconst { children, value, index, noMarginTop, ...other } = props\n\n\treturn (\n\t\t\n\t\t\t{value === index && (\n\t\t\t\t
{children}
\n\t\t\t)}\n\t\t\n\t)\n}\n\nexport default TabPanel\n","import React from 'react'\nimport {\n\tController,\n\tControl,\n\tFieldErrors,\n\tuseFormContext,\n} from 'react-hook-form'\nimport CodeEditor, { CodeEditorProps } from '../CodeEditor'\nimport useFormField from '../../hooks/useFormField'\n\nexport type CodeEditorFieldProps = {\n\tname: string\n\tcontrol?: Control\n\terrors?: FieldErrors | string[]\n\thelperText?: string\n} & Omit\n\nconst CodeEditorField = ({\n\tname,\n\tcontrol: propsControl,\n\terrors: propsErrors,\n\t...rest\n}: CodeEditorFieldProps) => {\n\tconst formContext = useFormContext()\n\tconst control = propsControl || formContext?.control\n\tconst errors = propsErrors || formContext?.formState.errors\n\n\tconst { getError } = useFormField()\n\tconst error = getError(name, errors)\n\n\treturn (\n\t\t (\n\t\t\t\t\n\t\t\t)}\n\t\t/>\n\t)\n}\n\nexport default CodeEditorField\n","import React from 'react'\n// import type { KeyboardEvent } from 'react'\nimport ErrorList, { ErrorListItemProps } from '../ErrorList'\n\nexport type FormProps = {\n\terrors?: ErrorListItemProps[]\n\tchildren: React.ReactNode\n\tonSubmit?: () => void\n} & React.HTMLProps\n\nconst Form = ({ errors, children, onSubmit, ...rest }: FormProps) => {\n\t// @todo check if this fires automatically. if so remove\n\t// const onKeyDown = (event: KeyboardEvent) => {\n\t// \tif (onSubmit && event.key === 'Enter') {\n\t// \t\tonSubmit()\n\t// \t}\n\t// }\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t{children}\n\t\t\n\t)\n}\n\nexport default Form\n","import React from 'react'\nimport FormLabel from '@mui/material/FormLabel'\nimport {\n\tFormControl,\n\tFormHelperText,\n\tRadioGroup,\n} from '@mui/material'\nimport { Controller } from 'react-hook-form'\nimport useFormField from '../../hooks/useFormField'\n\nconst RadioControl = ({\n\tvariant = 'standard',\n\tname,\n\tlabel,\n\tchildren,\n\terrors,\n\tcontrol,\n\tdefaultValue,\n\tradioGroupProps,\n\tclassName,\n\tsx,\n\tdisabled,\n\t...rest\n}) => {\n\tconst { getError } = useFormField()\n\tconst error = getError(name, errors)\n\n\treturn (\n\t\t\n\t\t\t{label}\n\t\t\t{control && (\n\t\t\t\t (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{!control && (\n\t\t\t\t\n\t\t\t\t\t{children}\n\t\t\t\t\n\t\t\t)}\n\t\t\t{error && {error.message}}\n\t\t\n\t)\n}\n\nexport default RadioControl\n","import React from 'react'\nimport RadioControl from './RadioControl'\nimport { FormControlLabel, Radio } from '@mui/material'\n\nconst RadioControlYesNo = (props) => {\n\treturn (\n\t\t\n\t\t\t}\n\t\t\t\tlabel=\"Yes\"\n\t\t\t/>\n\t\t\t}\n\t\t\t\tlabel=\"No\"\n\t\t\t/>\n\t\t\t{props.children}\n\t\t\n\t)\n}\n\nexport default RadioControlYesNo\n","import React, { useMemo } from 'react'\nimport {\n\tFormControl,\n\tInputLabel,\n\tSelect as MuiSelect,\n\tSelectProps as MuiSelectProps,\n\tFormHelperText,\n\tMenuItem,\n\tInputLabelProps,\n\tFormControlProps as MuiFormControlProps,\n} from '@mui/material'\nimport {\n\tController,\n\ttype FieldErrors,\n\tuseFormContext,\n} from 'react-hook-form'\nimport useFormField from '../../hooks/useFormField'\nimport { RFHControl } from '../../types'\n\ntype ItemProps = {\n\tdisabled?: boolean\n} & T\n\nexport type SelectProps = {\n\tname?: string\n\tmenuItems: ItemProps[]\n\tchildren?: React.ReactNode\n\tlabelField?: string\n\tvalueField?: string\n\tcontrol?: RFHControl\n\terrors?: FieldErrors\n\thelperText?: string\n\tselectProps?: Omit\n\tlabelProps?: InputLabelProps\n\trenderItem?: (item: ItemProps) => React.ReactNode\n\tdisplayEmpty?: boolean\n\tlabel: string\n\tplaceholder?: string\n\tdisabled?: boolean\n} & MuiFormControlProps\n\nconst Select = ({\n\tvariant = 'standard',\n\tname,\n\tselectProps,\n\tlabelProps,\n\tlabel,\n\tplaceholder,\n\tchildren,\n\terrors: propsErrors,\n\tcontrol: propsControl,\n\tdefaultValue,\n\tdisplayEmpty,\n\tmenuItems,\n\tlabelField = 'label',\n\tvalueField = 'value',\n\trenderItem,\n\thelperText,\n\tdisabled,\n\t...rest\n}: SelectProps) => {\n\tconst formContext = useFormContext()\n\tconst control = propsControl || formContext?.control\n\tconst errors = propsErrors || formContext?.formState.errors\n\n\tconst { getError } = useFormField()\n\tconst error = getError(name, errors)\n\tconst EmptyMenuItem = useMemo(\n\t\t() =>\n\t\t\tdisplayEmpty ? (\n\t\t\t\t\n\t\t\t\t\t{placeholder || 'Select value'}\n\t\t\t\t\n\t\t\t) : undefined,\n\t\t[displayEmpty, placeholder]\n\t)\n\tconst MenuItems: React.ReactNode[] | undefined = useMemo(\n\t\t() =>\n\t\t\tmenuItems\n\t\t\t\t? menuItems.map((item: ItemProps, i) => {\n\t\t\t\t\t\tif (renderItem) {\n\t\t\t\t\t\t\treturn renderItem(item)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t] as string\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={item.disabled}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{item[labelField as keyof ItemProps] as string}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)\n\t\t\t\t\t})\n\t\t\t\t: undefined,\n\t\t[labelField, menuItems, name, renderItem, valueField]\n\t)\n\n\treturn (\n\t\t\n\t\t\t{label}\n\t\t\t{control && name ? (\n\t\t\t\t (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{EmptyMenuItem}\n\t\t\t\t\t\t\t{MenuItems}\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t\n\t\t\t\t\t{EmptyMenuItem}\n\t\t\t\t\t{MenuItems}\n\t\t\t\t\t{children}\n\t\t\t\t\n\t\t\t)}\n\t\t\t{helperText && {helperText}}\n\t\t\t{error && {error.message}}\n\t\t\n\t)\n}\n\nexport default Select\n","import React from 'react'\nimport {\n\tFormControlLabel,\n\tSwitch as MuiSwitch,\n\tSwitchProps as MuiSwitchProps,\n} from '@mui/material'\nimport { Controller, useFormContext } from 'react-hook-form'\nimport { RFHControl } from '../../types'\n\nexport type SwitchProps = {\n\tname?: string\n\tlabel?: string\n\tcontrol?: RFHControl\n\tclassName?: string\n} & Omit\n\nconst Switch = ({\n\tname,\n\tlabel,\n\tcontrol: propsControl,\n\tclassName,\n\tsx,\n\tdefaultValue,\n\t...rest\n}: SwitchProps) => {\n\tconst formContext = useFormContext()\n\tconst control = propsControl || formContext?.control\n\n\treturn (\n\t\t
\n\t\t\t{name && control && (\n\t\t\t\t (\n\t\t\t\t\t\t field.onChange(e.target.checked)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{!control && (\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t
\n\t)\n}\n\nexport default Switch\n","import React, { useMemo } from 'react'\nimport {\n\tTextField as MuiTextField,\n\tTextFieldProps as MuiTextFieldProps,\n} from '@mui/material'\nimport { Controller, useFormContext } from 'react-hook-form'\nimport type { FieldErrors } from 'react-hook-form'\nimport IconButton from '@mui/material/IconButton'\nimport CancelIcon from '@mui/icons-material/Cancel'\nimport { merge } from 'lodash'\nimport useFormField from '../../hooks/useFormField'\nimport { RFHControl } from '../../types'\n\nexport type TextFieldProps = {\n\tname?: string\n\tcontrol?: RFHControl\n\terrors?: FieldErrors\n\tonClear?: () => void\n\tlabel: string\n\tisControlled?: boolean\n} & Omit\n\nconst TextField = ({\n\tvariant = 'standard',\n\tplaceholder,\n\tlabel,\n\tcontrol: propsControl,\n\trequired,\n\tname,\n\terrors: propsErrors,\n\tonChange,\n\tonClear,\n\tvalue,\n\tInputProps,\n\thelperText,\n\tisControlled = true,\n\t...rest\n}: TextFieldProps) => {\n\tconst formContext = useFormContext()\n\tconst control = propsControl || formContext?.control\n\tconst errors = propsErrors || formContext?.formState.errors\n\n\tconst { getError } = useFormField()\n\tconst error = getError(name, errors)\n\tconst placeholderTxt = placeholder || label\n\tconst labelTxt = required && label ? `${label} *` : label\n\n\tconst clearEndAdornment = useMemo(\n\t\t() => (\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t),\n\t\t[onClear]\n\t)\n\n\tconst inputProps = useMemo(() => {\n\t\treturn onClear && value\n\t\t\t? merge({ endAdornment: clearEndAdornment }, InputProps)\n\t\t\t: InputProps\n\t}, [InputProps, clearEndAdornment, onClear, value])\n\n\tif (name && control && isControlled) {\n\t\treturn (\n\t\t\t (\n\t\t\t\t\t {\n\t\t\t\t\t\t\tif (onChange) {\n\t\t\t\t\t\t\t\tonChange(e)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfield.onChange(e)\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tInputProps={inputProps}\n\t\t\t\t\t\t{...rest}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t/>\n\t\t)\n\t}\n\n\treturn (\n\t\t\n\t)\n}\n\nexport default TextField\n","import React, { useMemo, useState } from 'react'\nimport { useQuery } from '@tanstack/react-query'\nimport queryKeys from '../../../services/queryKeys'\n\nimport {\n\tAutocomplete,\n\tCircularProgress,\n\tTextField,\n} from '@mui/material'\nimport { TheBigPOSApi } from '../../../lib/TheBigPOSClient'\n\nconst DocumentBucketAutocomplete = ({\n\tonChange,\n\terror,\n\thelperText,\n\trequired,\n\tloanId,\n\tlabel = 'Document Bucket',\n\tvalue,\n\toptions,\n\tnullValueLabel = 'Unassigned',\n\t...rest\n}) => {\n\tconst [bucket, setBucket] = useState(value)\n\n\tconst {\n\t\tisFetching,\n\t\tisRefetching,\n\t\tisError,\n\t\tdata: buckets,\n\t} = useQuery({\n\t\tqueryKey: loanId\n\t\t\t? [queryKeys.documentBuckets]\n\t\t\t: [queryKeys.loanDocumentBuckets, loanId],\n\t\tqueryFn: () =>\n\t\t\tloanId\n\t\t\t\t? TheBigPOSApi.getLoanDocumentBuckets(loanId)\n\t\t\t\t: TheBigPOSApi.getDocumentBuckets(),\n\t})\n\n\tconst labelTxt = useMemo(\n\t\t() => (required ? `${label} *` : label),\n\t\t[required, label]\n\t)\n\n\tconst handleChange = (event, value) => {\n\t\tsetBucket(value)\n\t\tif (onChange && bucket !== value) {\n\t\t\tonChange(value)\n\t\t}\n\t}\n\tconst loading = useMemo(\n\t\t() => isFetching || isRefetching,\n\t\t[isFetching, isRefetching]\n\t)\n\n\tconst bucketOptions = useMemo(() => {\n\t\tif (!buckets) return []\n\n\t\tlet bucketOptionsMap = buckets?.data.map((bucket) => ({\n\t\t\tlabel: bucket === null ? nullValueLabel : bucket,\n\t\t\tvalue: bucket,\n\t\t}))\n\n\t\tif (\n\t\t\t!bucketOptionsMap.some(\n\t\t\t\t(bucketOption) => bucketOption.value === null\n\t\t\t)\n\t\t) {\n\t\t\tbucketOptionsMap = [\n\t\t\t\t{\n\t\t\t\t\tlabel: nullValueLabel,\n\t\t\t\t\tvalue: null,\n\t\t\t\t},\n\t\t\t\t...bucketOptionsMap,\n\t\t\t]\n\t\t}\n\n\t\tif (options && options.length) {\n\t\t\toptions.forEach((option) => {\n\t\t\t\tbucketOptionsMap.push(option)\n\t\t\t})\n\t\t}\n\n\t\tif (bucket === null) setBucket(nullValueLabel)\n\n\t\treturn bucketOptionsMap\n\t}, [buckets])\n\n\treturn (\n\t\t {\n\t\t\t\treturn (\n\t\t\t\t\t
  • \n\t\t\t\t\t\t{option.label}\n\t\t\t\t\t
  • \n\t\t\t\t)\n\t\t\t}}\n\t\t\trenderInput={(params) => (\n\t\t\t\t\n\t\t\t\t\t\t\t\t{loading ? (\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t{params.InputProps.endAdornment}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t),\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t/>\n\t)\n}\n\nexport default DocumentBucketAutocomplete\n","import React from 'react'\nimport DocumentBucketAutocomplete from './DocumentBucketAutocomplete'\nimport { Controller } from 'react-hook-form'\nimport useFormField from '../../../hooks/useFormField'\n\nconst DocumentBucketAutocompleteField = ({\n\tname,\n\tcontrol,\n\terrors,\n\tdefaultValue,\n\toptions,\n\tnullValueLabel,\n\t...rest\n}) => {\n\tconst { getError } = useFormField()\n\tconst error = getError(name, errors)\n\n\tif (!control) {\n\t\treturn \n\t}\n\n\treturn (\n\t\t (\n\t\t\t\t {\n\t\t\t\t\t\tconst value = e?.label ? e.value : e\n\t\t\t\t\t\tfield.onChange(e ? value : null)\n\t\t\t\t\t}}\n\t\t\t\t\toptions={options}\n\t\t\t\t\tnullValueLabel={nullValueLabel}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t)}\n\t\t/>\n\t)\n}\n\nexport default DocumentBucketAutocompleteField\n","import React from 'react'\nimport {\n\tFormControl as MuiFormControl,\n\tFormControlProps as MuiFormControlProps,\n} from '@mui/material'\n\nexport type FormControlProps = MuiFormControlProps\n\nconst FormControl = ({\n\tvariant = 'standard',\n\t...rest\n}: FormControlProps) => \n\nexport default FormControl\n","import React, { ChangeEvent } from 'react'\nimport { InputAdornment } from '@mui/material'\nimport { merge } from 'lodash'\nimport TextField, { TextFieldProps } from './TextField'\nimport { applyMask } from '../../services/utils'\n\nexport type MoneyFieldProps = TextFieldProps\n\nconst MoneyField = ({ InputProps, ...rest }: MoneyFieldProps) => {\n\tconst startAdornment = (\n\t\t$\n\t)\n\tconst mergedInputProps = InputProps\n\t\t? merge(InputProps, { startAdornment })\n\t\t: { startAdornment }\n\n\tconst onChange = (event: ChangeEvent<{ value: string }>) => {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tevent.target.value = applyMask(event.target.value, 'currency') // @todo this should be handled with state and not set on the event\n\t}\n\n\treturn (\n\t\t\n\t)\n}\n\nexport default MoneyField\n","import React from 'react'\nimport { InputAdornment } from '@mui/material'\nimport { merge } from 'lodash'\nimport TextField, { TextFieldProps } from './TextField'\n\nexport type PercentFieldProps = TextFieldProps\n\nconst PercentField = ({ InputProps, ...rest }: PercentFieldProps) => {\n\tconst endAdornment = (\n\t\t%\n\t)\n\tconst mergedInputProps = InputProps\n\t\t? merge(InputProps, { endAdornment })\n\t\t: { endAdornment }\n\treturn \n}\n\nexport default PercentField\n","import React from 'react'\nimport {\n\tFormControlLabel,\n\tFormHelperText,\n\tCheckbox as MuiCheckbox,\n\tCheckboxProps as MuiCheckboxProps,\n} from '@mui/material'\nimport { Controller, FieldErrors } from 'react-hook-form'\nimport { RFHControl } from '../../types'\n\nexport type CheckboxProps = {\n\tname?: string\n\tlabel?: string\n\tcontrol?: RFHControl\n\terrors?: FieldErrors\n\tclassName?: string\n\thelperText?: string\n} & Omit\n\nconst Checkbox = ({\n\tname,\n\tlabel,\n\tcontrol,\n\tdefaultValue,\n\tclassName,\n\thelperText,\n\t...rest\n}: CheckboxProps) => (\n\t<>\n\t\t
    \n\t\t\t{name && control && (\n\t\t\t\t (\n\t\t\t\t\t\t field.onChange(e.target.checked)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{!control && (\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t
    \n\t\t{helperText && (\n\t\t\t{helperText}\n\t\t)}\n\t\n)\n\nexport default Checkbox\n","import React from 'react'\nimport { FormHelperText, FormGroup } from '@mui/material'\nimport Checkbox from './Checkbox'\nimport FormLabel from '@mui/material/FormLabel'\nimport useFormField from '../../hooks/useFormField'\n\nconst CheckboxGroup = ({\n\tvariant = 'standard',\n\tname,\n\tlabel,\n\tchildren,\n\terrors,\n\tcontrol,\n\tdefaultValue,\n\tradioGroupProps,\n\tclassName,\n\tcheckboxesClassName,\n\tsx,\n\titems,\n\t...rest\n}) => {\n\tconst { getError } = useFormField()\n\tconst error = getError(name, errors)\n\n\treturn (\n\t\t\n\t\t\t{label}\n\t\t\t
    \n\t\t\t\t{items.map((item, i) => (\n\t\t\t\t\t\n\t\t\t\t))}\n\t\t\t
    \n\t\t\t{error && {error.message}}\n\t\t\n\t)\n}\n\nexport default CheckboxGroup\n","import React from 'react'\nimport TextField from './TextField'\nimport { applyMask } from '../../services/utils'\n\nconst PhoneNumberField = (props) => {\n\tconst onChange = (event) => {\n\t\tevent.target.value = applyMask(event.target.value, 'phone')\n\t}\n\n\treturn \n}\n\nexport default PhoneNumberField\n","import React, { useEffect, useState } from 'react'\nimport Select from './Select'\nimport { getWorkflowField } from '../../services/utils'\nimport { omit } from 'lodash'\n\nconst WorkflowSelect = ({ name, workflow, ...rest }) => {\n\tconst [menuItems, setMenuItems] = useState([])\n\tuseEffect(() => {\n\t\tasync function getFieldOptions() {\n\t\t\tconst result = await getWorkflowField(workflow, name)\n\t\t\tif (result) {\n\t\t\t\tsetMenuItems(result.options)\n\t\t\t} else {\n\t\t\t\tconsole.warn(`No fieldId ${name} found in ${workflow}`)\n\t\t\t}\n\t\t}\n\t\tgetFieldOptions()\n\t}, [name, workflow])\n\n\treturn (\n\t\t\n\t)\n}\n\nexport default WorkflowSelect\n","import React, { useEffect, useState } from 'react'\nimport { getWorkflowField } from '../../services/utils'\nimport { omit } from 'lodash'\nimport CheckboxGroup from './CheckboxGroup'\n\nconst WorkflowCheckboxGroup = ({ name, workflow, ...rest }) => {\n\tconst [items, setItems] = useState([])\n\tuseEffect(() => {\n\t\tasync function getFieldOptions() {\n\t\t\tconst result = await getWorkflowField(workflow, name)\n\t\t\tif (result) {\n\t\t\t\tconst options = []\n\t\t\t\tresult.options.forEach((r) => {\n\t\t\t\t\toptions.push({\n\t\t\t\t\t\tlabel: r.label,\n\t\t\t\t\t\tvalue: `${name}.${r.fieldId}`,\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t\tsetItems(options)\n\t\t\t} else {\n\t\t\t\tconsole.warn(`No fieldId ${name} found in ${workflow}`)\n\t\t\t}\n\t\t}\n\t\tgetFieldOptions()\n\t}, [name, workflow])\n\n\treturn (\n\t\t\n\t)\n}\n\nexport default WorkflowCheckboxGroup\n","import PropTypes from 'prop-types';\nconst refType = PropTypes.oneOfType([PropTypes.func, PropTypes.object]);\nexport default refType;","export const areViewsEqual = (views, expectedViews) => {\n if (views.length !== expectedViews.length) {\n return false;\n }\n return expectedViews.every(expectedView => views.includes(expectedView));\n};\nexport const applyDefaultViewProps = ({\n openTo,\n defaultOpenTo,\n views,\n defaultViews\n}) => {\n const viewsWithDefault = views ?? defaultViews;\n let openToWithDefault;\n if (openTo != null) {\n openToWithDefault = openTo;\n } else if (viewsWithDefault.includes(defaultOpenTo)) {\n openToWithDefault = defaultOpenTo;\n } else if (viewsWithDefault.length > 0) {\n openToWithDefault = viewsWithDefault[0];\n } else {\n throw new Error('MUI X: The `views` prop must contain at least one view.');\n }\n return {\n views: viewsWithDefault,\n openTo: openToWithDefault\n };\n};","import { areViewsEqual } from './views';\nexport const mergeDateAndTime = (utils, dateParam, timeParam) => {\n let mergedDate = dateParam;\n mergedDate = utils.setHours(mergedDate, utils.getHours(timeParam));\n mergedDate = utils.setMinutes(mergedDate, utils.getMinutes(timeParam));\n mergedDate = utils.setSeconds(mergedDate, utils.getSeconds(timeParam));\n return mergedDate;\n};\nexport const findClosestEnabledDate = ({\n date,\n disableFuture,\n disablePast,\n maxDate,\n minDate,\n isDateDisabled,\n utils,\n timezone\n}) => {\n const today = mergeDateAndTime(utils, utils.date(undefined, timezone), date);\n if (disablePast && utils.isBefore(minDate, today)) {\n minDate = today;\n }\n if (disableFuture && utils.isAfter(maxDate, today)) {\n maxDate = today;\n }\n let forward = date;\n let backward = date;\n if (utils.isBefore(date, minDate)) {\n forward = minDate;\n backward = null;\n }\n if (utils.isAfter(date, maxDate)) {\n if (backward) {\n backward = maxDate;\n }\n forward = null;\n }\n while (forward || backward) {\n if (forward && utils.isAfter(forward, maxDate)) {\n forward = null;\n }\n if (backward && utils.isBefore(backward, minDate)) {\n backward = null;\n }\n if (forward) {\n if (!isDateDisabled(forward)) {\n return forward;\n }\n forward = utils.addDays(forward, 1);\n }\n if (backward) {\n if (!isDateDisabled(backward)) {\n return backward;\n }\n backward = utils.addDays(backward, -1);\n }\n }\n return null;\n};\nexport const replaceInvalidDateByNull = (utils, value) => value == null || !utils.isValid(value) ? null : value;\nexport const applyDefaultDate = (utils, value, defaultValue) => {\n if (value == null || !utils.isValid(value)) {\n return defaultValue;\n }\n return value;\n};\nexport const areDatesEqual = (utils, a, b) => {\n if (!utils.isValid(a) && a != null && !utils.isValid(b) && b != null) {\n return true;\n }\n return utils.isEqual(a, b);\n};\nexport const getMonthsInYear = (utils, year) => {\n const firstMonth = utils.startOfYear(year);\n const months = [firstMonth];\n while (months.length < 12) {\n const prevMonth = months[months.length - 1];\n months.push(utils.addMonths(prevMonth, 1));\n }\n return months;\n};\nexport const getTodayDate = (utils, timezone, valueType) => valueType === 'date' ? utils.startOfDay(utils.date(undefined, timezone)) : utils.date(undefined, timezone);\nexport const formatMeridiem = (utils, meridiem) => {\n const date = utils.setHours(utils.date(), meridiem === 'am' ? 2 : 14);\n return utils.format(date, 'meridiem');\n};\nconst dateViews = ['year', 'month', 'day'];\nexport const isDatePickerView = view => dateViews.includes(view);\nexport const resolveDateFormat = (utils, {\n format,\n views\n}, isInToolbar) => {\n if (format != null) {\n return format;\n }\n const formats = utils.formats;\n if (areViewsEqual(views, ['year'])) {\n return formats.year;\n }\n if (areViewsEqual(views, ['month'])) {\n return formats.month;\n }\n if (areViewsEqual(views, ['day'])) {\n return formats.dayOfMonth;\n }\n if (areViewsEqual(views, ['month', 'year'])) {\n return `${formats.month} ${formats.year}`;\n }\n if (areViewsEqual(views, ['day', 'month'])) {\n return `${formats.month} ${formats.dayOfMonth}`;\n }\n if (isInToolbar) {\n // Little localization hack (Google is doing the same for android native pickers):\n // For english localization it is convenient to include weekday into the date \"Mon, Jun 1\".\n // For other locales using strings like \"June 1\", without weekday.\n return /en/.test(utils.getCurrentLocaleCode()) ? formats.normalDateWithWeekday : formats.normalDate;\n }\n return formats.keyboardDate;\n};\nexport const getWeekdays = (utils, date) => {\n const start = utils.startOfWeek(date);\n return [0, 1, 2, 3, 4, 5, 6].map(diff => utils.addDays(start, diff));\n};","import { areViewsEqual } from './views';\nconst timeViews = ['hours', 'minutes', 'seconds'];\nexport const isTimeView = view => timeViews.includes(view);\nexport const isInternalTimeView = view => timeViews.includes(view) || view === 'meridiem';\nexport const getMeridiem = (date, utils) => {\n if (!date) {\n return null;\n }\n return utils.getHours(date) >= 12 ? 'pm' : 'am';\n};\nexport const convertValueToMeridiem = (value, meridiem, ampm) => {\n if (ampm) {\n const currentMeridiem = value >= 12 ? 'pm' : 'am';\n if (currentMeridiem !== meridiem) {\n return meridiem === 'am' ? value - 12 : value + 12;\n }\n }\n return value;\n};\nexport const convertToMeridiem = (time, meridiem, ampm, utils) => {\n const newHoursAmount = convertValueToMeridiem(utils.getHours(time), meridiem, ampm);\n return utils.setHours(time, newHoursAmount);\n};\nexport const getSecondsInDay = (date, utils) => {\n return utils.getHours(date) * 3600 + utils.getMinutes(date) * 60 + utils.getSeconds(date);\n};\nexport const createIsAfterIgnoreDatePart = (disableIgnoringDatePartForTimeValidation, utils) => (dateLeft, dateRight) => {\n if (disableIgnoringDatePartForTimeValidation) {\n return utils.isAfter(dateLeft, dateRight);\n }\n return getSecondsInDay(dateLeft, utils) > getSecondsInDay(dateRight, utils);\n};\nexport const resolveTimeFormat = (utils, {\n format,\n views,\n ampm\n}) => {\n if (format != null) {\n return format;\n }\n const formats = utils.formats;\n if (areViewsEqual(views, ['hours'])) {\n return ampm ? `${formats.hours12h} ${formats.meridiem}` : formats.hours24h;\n }\n if (areViewsEqual(views, ['minutes'])) {\n return formats.minutes;\n }\n if (areViewsEqual(views, ['seconds'])) {\n return formats.seconds;\n }\n if (areViewsEqual(views, ['minutes', 'seconds'])) {\n return `${formats.minutes}:${formats.seconds}`;\n }\n if (areViewsEqual(views, ['hours', 'minutes', 'seconds'])) {\n return ampm ? `${formats.hours12h}:${formats.minutes}:${formats.seconds} ${formats.meridiem}` : `${formats.hours24h}:${formats.minutes}:${formats.seconds}`;\n }\n return ampm ? `${formats.hours12h}:${formats.minutes} ${formats.meridiem}` : `${formats.hours24h}:${formats.minutes}`;\n};","import { createIsAfterIgnoreDatePart } from './time-utils';\nimport { mergeDateAndTime, getTodayDate } from './date-utils';\nexport const SECTION_TYPE_GRANULARITY = {\n year: 1,\n month: 2,\n day: 3,\n hours: 4,\n minutes: 5,\n seconds: 6,\n milliseconds: 7\n};\nexport const getSectionTypeGranularity = sections => Math.max(...sections.map(section => SECTION_TYPE_GRANULARITY[section.type] ?? 1));\nconst roundDate = (utils, granularity, date) => {\n if (granularity === SECTION_TYPE_GRANULARITY.year) {\n return utils.startOfYear(date);\n }\n if (granularity === SECTION_TYPE_GRANULARITY.month) {\n return utils.startOfMonth(date);\n }\n if (granularity === SECTION_TYPE_GRANULARITY.day) {\n return utils.startOfDay(date);\n }\n\n // We don't have startOfHour / startOfMinute / startOfSecond\n let roundedDate = date;\n if (granularity < SECTION_TYPE_GRANULARITY.minutes) {\n roundedDate = utils.setMinutes(roundedDate, 0);\n }\n if (granularity < SECTION_TYPE_GRANULARITY.seconds) {\n roundedDate = utils.setSeconds(roundedDate, 0);\n }\n if (granularity < SECTION_TYPE_GRANULARITY.milliseconds) {\n roundedDate = utils.setMilliseconds(roundedDate, 0);\n }\n return roundedDate;\n};\nexport const getDefaultReferenceDate = ({\n props,\n utils,\n granularity,\n timezone,\n getTodayDate: inGetTodayDate\n}) => {\n let referenceDate = inGetTodayDate ? inGetTodayDate() : roundDate(utils, granularity, getTodayDate(utils, timezone));\n if (props.minDate != null && utils.isAfterDay(props.minDate, referenceDate)) {\n referenceDate = roundDate(utils, granularity, props.minDate);\n }\n if (props.maxDate != null && utils.isBeforeDay(props.maxDate, referenceDate)) {\n referenceDate = roundDate(utils, granularity, props.maxDate);\n }\n const isAfter = createIsAfterIgnoreDatePart(props.disableIgnoringDatePartForTimeValidation ?? false, utils);\n if (props.minTime != null && isAfter(props.minTime, referenceDate)) {\n referenceDate = roundDate(utils, granularity, props.disableIgnoringDatePartForTimeValidation ? props.minTime : mergeDateAndTime(utils, referenceDate, props.minTime));\n }\n if (props.maxTime != null && isAfter(referenceDate, props.maxTime)) {\n referenceDate = roundDate(utils, granularity, props.disableIgnoringDatePartForTimeValidation ? props.maxTime : mergeDateAndTime(utils, referenceDate, props.maxTime));\n }\n return referenceDate;\n};","import { getMonthsInYear } from '../../utils/date-utils';\nexport const getDateSectionConfigFromFormatToken = (utils, formatToken) => {\n const config = utils.formatTokenMap[formatToken];\n if (config == null) {\n throw new Error([`MUI X: The token \"${formatToken}\" is not supported by the Date and Time Pickers.`, 'Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported.'].join('\\n'));\n }\n if (typeof config === 'string') {\n return {\n type: config,\n contentType: config === 'meridiem' ? 'letter' : 'digit',\n maxLength: undefined\n };\n }\n return {\n type: config.sectionType,\n contentType: config.contentType,\n maxLength: config.maxLength\n };\n};\nconst getDeltaFromKeyCode = keyCode => {\n switch (keyCode) {\n case 'ArrowUp':\n return 1;\n case 'ArrowDown':\n return -1;\n case 'PageUp':\n return 5;\n case 'PageDown':\n return -5;\n default:\n return 0;\n }\n};\nexport const getDaysInWeekStr = (utils, timezone, format) => {\n const elements = [];\n const now = utils.date(undefined, timezone);\n const startDate = utils.startOfWeek(now);\n const endDate = utils.endOfWeek(now);\n let current = startDate;\n while (utils.isBefore(current, endDate)) {\n elements.push(current);\n current = utils.addDays(current, 1);\n }\n return elements.map(weekDay => utils.formatByString(weekDay, format));\n};\nexport const getLetterEditingOptions = (utils, timezone, sectionType, format) => {\n switch (sectionType) {\n case 'month':\n {\n return getMonthsInYear(utils, utils.date(undefined, timezone)).map(month => utils.formatByString(month, format));\n }\n case 'weekDay':\n {\n return getDaysInWeekStr(utils, timezone, format);\n }\n case 'meridiem':\n {\n const now = utils.date(undefined, timezone);\n return [utils.startOfDay(now), utils.endOfDay(now)].map(date => utils.formatByString(date, format));\n }\n default:\n {\n return [];\n }\n }\n};\n\n// This format should be the same on all the adapters\n// If some adapter does not respect this convention, then we will need to hardcode the format on each adapter.\nexport const FORMAT_SECONDS_NO_LEADING_ZEROS = 's';\nconst NON_LOCALIZED_DIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\nexport const getLocalizedDigits = utils => {\n const today = utils.date(undefined);\n const formattedZero = utils.formatByString(utils.setSeconds(today, 0), FORMAT_SECONDS_NO_LEADING_ZEROS);\n if (formattedZero === '0') {\n return NON_LOCALIZED_DIGITS;\n }\n return Array.from({\n length: 10\n }).map((_, index) => utils.formatByString(utils.setSeconds(today, index), FORMAT_SECONDS_NO_LEADING_ZEROS));\n};\nexport const removeLocalizedDigits = (valueStr, localizedDigits) => {\n if (localizedDigits[0] === '0') {\n return valueStr;\n }\n const digits = [];\n let currentFormattedDigit = '';\n for (let i = 0; i < valueStr.length; i += 1) {\n currentFormattedDigit += valueStr[i];\n const matchingDigitIndex = localizedDigits.indexOf(currentFormattedDigit);\n if (matchingDigitIndex > -1) {\n digits.push(matchingDigitIndex.toString());\n currentFormattedDigit = '';\n }\n }\n return digits.join('');\n};\nexport const applyLocalizedDigits = (valueStr, localizedDigits) => {\n if (localizedDigits[0] === '0') {\n return valueStr;\n }\n return valueStr.split('').map(char => localizedDigits[Number(char)]).join('');\n};\nexport const isStringNumber = (valueStr, localizedDigits) => {\n const nonLocalizedValueStr = removeLocalizedDigits(valueStr, localizedDigits);\n return !Number.isNaN(Number(nonLocalizedValueStr));\n};\n\n/**\n * Remove the leading zeroes to a digit section value.\n * E.g.: `03` => `3`\n * Warning: Should only be called with non-localized digits. Call `removeLocalizedDigits` with your value if needed.\n */\nexport const cleanLeadingZeros = (valueStr, size) => {\n let cleanValueStr = valueStr;\n\n // Remove the leading zeros\n cleanValueStr = Number(cleanValueStr).toString();\n\n // Add enough leading zeros to fill the section\n while (cleanValueStr.length < size) {\n cleanValueStr = `0${cleanValueStr}`;\n }\n return cleanValueStr;\n};\nexport const cleanDigitSectionValue = (utils, value, sectionBoundaries, localizedDigits, section) => {\n if (process.env.NODE_ENV !== 'production') {\n if (section.type !== 'day' && section.contentType === 'digit-with-letter') {\n throw new Error([`MUI X: The token \"${section.format}\" is a digit format with letter in it.'\n This type of format is only supported for 'day' sections`].join('\\n'));\n }\n }\n if (section.type === 'day' && section.contentType === 'digit-with-letter') {\n const date = utils.setDate(sectionBoundaries.longestMonth, value);\n return utils.formatByString(date, section.format);\n }\n\n // queryValue without leading `0` (`01` => `1`)\n let valueStr = value.toString();\n if (section.hasLeadingZerosInInput) {\n valueStr = cleanLeadingZeros(valueStr, section.maxLength);\n }\n return applyLocalizedDigits(valueStr, localizedDigits);\n};\nexport const adjustSectionValue = (utils, timezone, section, keyCode, sectionsValueBoundaries, localizedDigits, activeDate, stepsAttributes) => {\n const delta = getDeltaFromKeyCode(keyCode);\n const isStart = keyCode === 'Home';\n const isEnd = keyCode === 'End';\n const shouldSetAbsolute = section.value === '' || isStart || isEnd;\n const adjustDigitSection = () => {\n const sectionBoundaries = sectionsValueBoundaries[section.type]({\n currentDate: activeDate,\n format: section.format,\n contentType: section.contentType\n });\n const getCleanValue = value => cleanDigitSectionValue(utils, value, sectionBoundaries, localizedDigits, section);\n const step = section.type === 'minutes' && stepsAttributes?.minutesStep ? stepsAttributes.minutesStep : 1;\n const currentSectionValue = parseInt(removeLocalizedDigits(section.value, localizedDigits), 10);\n let newSectionValueNumber = currentSectionValue + delta * step;\n if (shouldSetAbsolute) {\n if (section.type === 'year' && !isEnd && !isStart) {\n return utils.formatByString(utils.date(undefined, timezone), section.format);\n }\n if (delta > 0 || isStart) {\n newSectionValueNumber = sectionBoundaries.minimum;\n } else {\n newSectionValueNumber = sectionBoundaries.maximum;\n }\n }\n if (newSectionValueNumber % step !== 0) {\n if (delta < 0 || isStart) {\n newSectionValueNumber += step - (step + newSectionValueNumber) % step; // for JS -3 % 5 = -3 (should be 2)\n }\n if (delta > 0 || isEnd) {\n newSectionValueNumber -= newSectionValueNumber % step;\n }\n }\n if (newSectionValueNumber > sectionBoundaries.maximum) {\n return getCleanValue(sectionBoundaries.minimum + (newSectionValueNumber - sectionBoundaries.maximum - 1) % (sectionBoundaries.maximum - sectionBoundaries.minimum + 1));\n }\n if (newSectionValueNumber < sectionBoundaries.minimum) {\n return getCleanValue(sectionBoundaries.maximum - (sectionBoundaries.minimum - newSectionValueNumber - 1) % (sectionBoundaries.maximum - sectionBoundaries.minimum + 1));\n }\n return getCleanValue(newSectionValueNumber);\n };\n const adjustLetterSection = () => {\n const options = getLetterEditingOptions(utils, timezone, section.type, section.format);\n if (options.length === 0) {\n return section.value;\n }\n if (shouldSetAbsolute) {\n if (delta > 0 || isStart) {\n return options[0];\n }\n return options[options.length - 1];\n }\n const currentOptionIndex = options.indexOf(section.value);\n const newOptionIndex = (currentOptionIndex + options.length + delta) % options.length;\n return options[newOptionIndex];\n };\n if (section.contentType === 'digit' || section.contentType === 'digit-with-letter') {\n return adjustDigitSection();\n }\n return adjustLetterSection();\n};\nexport const getSectionVisibleValue = (section, target, localizedDigits) => {\n let value = section.value || section.placeholder;\n const hasLeadingZeros = target === 'non-input' ? section.hasLeadingZerosInFormat : section.hasLeadingZerosInInput;\n if (target === 'non-input' && section.hasLeadingZerosInInput && !section.hasLeadingZerosInFormat) {\n value = Number(removeLocalizedDigits(value, localizedDigits)).toString();\n }\n\n // In the input, we add an empty character at the end of each section without leading zeros.\n // This makes sure that `onChange` will always be fired.\n // Otherwise, when your input value equals `1/dd/yyyy` (format `M/DD/YYYY` on DayJs),\n // If you press `1`, on the first section, the new value is also `1/dd/yyyy`,\n // So the browser will not fire the input `onChange`.\n const shouldAddInvisibleSpace = ['input-rtl', 'input-ltr'].includes(target) && section.contentType === 'digit' && !hasLeadingZeros && value.length === 1;\n if (shouldAddInvisibleSpace) {\n value = `${value}\\u200e`;\n }\n if (target === 'input-rtl') {\n value = `\\u2068${value}\\u2069`;\n }\n return value;\n};\nexport const changeSectionValueFormat = (utils, valueStr, currentFormat, newFormat) => {\n if (process.env.NODE_ENV !== 'production') {\n if (getDateSectionConfigFromFormatToken(utils, currentFormat).type === 'weekDay') {\n throw new Error(\"changeSectionValueFormat doesn't support week day formats\");\n }\n }\n return utils.formatByString(utils.parse(valueStr, currentFormat), newFormat);\n};\nconst isFourDigitYearFormat = (utils, timezone, format) => utils.formatByString(utils.date(undefined, timezone), format).length === 4;\nexport const doesSectionFormatHaveLeadingZeros = (utils, timezone, contentType, sectionType, format) => {\n if (contentType !== 'digit') {\n return false;\n }\n const now = utils.date(undefined, timezone);\n switch (sectionType) {\n // We can't use `changeSectionValueFormat`, because `utils.parse('1', 'YYYY')` returns `1971` instead of `1`.\n case 'year':\n {\n if (isFourDigitYearFormat(utils, timezone, format)) {\n const formatted0001 = utils.formatByString(utils.setYear(now, 1), format);\n return formatted0001 === '0001';\n }\n const formatted2001 = utils.formatByString(utils.setYear(now, 2001), format);\n return formatted2001 === '01';\n }\n case 'month':\n {\n return utils.formatByString(utils.startOfYear(now), format).length > 1;\n }\n case 'day':\n {\n return utils.formatByString(utils.startOfMonth(now), format).length > 1;\n }\n case 'weekDay':\n {\n return utils.formatByString(utils.startOfWeek(now), format).length > 1;\n }\n case 'hours':\n {\n return utils.formatByString(utils.setHours(now, 1), format).length > 1;\n }\n case 'minutes':\n {\n return utils.formatByString(utils.setMinutes(now, 1), format).length > 1;\n }\n case 'seconds':\n {\n return utils.formatByString(utils.setSeconds(now, 1), format).length > 1;\n }\n default:\n {\n throw new Error('Invalid section type');\n }\n }\n};\n\n/**\n * Some date libraries like `dayjs` don't support parsing from date with escaped characters.\n * To make sure that the parsing works, we are building a format and a date without any separator.\n */\nexport const getDateFromDateSections = (utils, sections, localizedDigits) => {\n // If we have both a day and a weekDay section,\n // Then we skip the weekDay in the parsing because libraries like dayjs can't parse complicated formats containing a weekDay.\n // dayjs(dayjs().format('dddd MMMM D YYYY'), 'dddd MMMM D YYYY')) // returns `Invalid Date` even if the format is valid.\n const shouldSkipWeekDays = sections.some(section => section.type === 'day');\n const sectionFormats = [];\n const sectionValues = [];\n for (let i = 0; i < sections.length; i += 1) {\n const section = sections[i];\n const shouldSkip = shouldSkipWeekDays && section.type === 'weekDay';\n if (!shouldSkip) {\n sectionFormats.push(section.format);\n sectionValues.push(getSectionVisibleValue(section, 'non-input', localizedDigits));\n }\n }\n const formatWithoutSeparator = sectionFormats.join(' ');\n const dateWithoutSeparatorStr = sectionValues.join(' ');\n return utils.parse(dateWithoutSeparatorStr, formatWithoutSeparator);\n};\nexport const createDateStrForV7HiddenInputFromSections = sections => sections.map(section => {\n return `${section.startSeparator}${section.value || section.placeholder}${section.endSeparator}`;\n}).join('');\nexport const createDateStrForV6InputFromSections = (sections, localizedDigits, isRTL) => {\n const formattedSections = sections.map(section => {\n const dateValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr', localizedDigits);\n return `${section.startSeparator}${dateValue}${section.endSeparator}`;\n });\n const dateStr = formattedSections.join('');\n if (!isRTL) {\n return dateStr;\n }\n\n // \\u2066: start left-to-right isolation\n // \\u2067: start right-to-left isolation\n // \\u2068: start first strong character isolation\n // \\u2069: pop isolation\n // wrap into an isolated group such that separators can split the string in smaller ones by adding \\u2069\\u2068\n return `\\u2066${dateStr}\\u2069`;\n};\nexport const getSectionsBoundaries = (utils, localizedDigits, timezone) => {\n const today = utils.date(undefined, timezone);\n const endOfYear = utils.endOfYear(today);\n const endOfDay = utils.endOfDay(today);\n const {\n maxDaysInMonth,\n longestMonth\n } = getMonthsInYear(utils, today).reduce((acc, month) => {\n const daysInMonth = utils.getDaysInMonth(month);\n if (daysInMonth > acc.maxDaysInMonth) {\n return {\n maxDaysInMonth: daysInMonth,\n longestMonth: month\n };\n }\n return acc;\n }, {\n maxDaysInMonth: 0,\n longestMonth: null\n });\n return {\n year: ({\n format\n }) => ({\n minimum: 0,\n maximum: isFourDigitYearFormat(utils, timezone, format) ? 9999 : 99\n }),\n month: () => ({\n minimum: 1,\n // Assumption: All years have the same amount of months\n maximum: utils.getMonth(endOfYear) + 1\n }),\n day: ({\n currentDate\n }) => ({\n minimum: 1,\n maximum: currentDate != null && utils.isValid(currentDate) ? utils.getDaysInMonth(currentDate) : maxDaysInMonth,\n longestMonth: longestMonth\n }),\n weekDay: ({\n format,\n contentType\n }) => {\n if (contentType === 'digit') {\n const daysInWeek = getDaysInWeekStr(utils, timezone, format).map(Number);\n return {\n minimum: Math.min(...daysInWeek),\n maximum: Math.max(...daysInWeek)\n };\n }\n return {\n minimum: 1,\n maximum: 7\n };\n },\n hours: ({\n format\n }) => {\n const lastHourInDay = utils.getHours(endOfDay);\n const hasMeridiem = removeLocalizedDigits(utils.formatByString(utils.endOfDay(today), format), localizedDigits) !== lastHourInDay.toString();\n if (hasMeridiem) {\n return {\n minimum: 1,\n maximum: Number(removeLocalizedDigits(utils.formatByString(utils.startOfDay(today), format), localizedDigits))\n };\n }\n return {\n minimum: 0,\n maximum: lastHourInDay\n };\n },\n minutes: () => ({\n minimum: 0,\n // Assumption: All years have the same amount of minutes\n maximum: utils.getMinutes(endOfDay)\n }),\n seconds: () => ({\n minimum: 0,\n // Assumption: All years have the same amount of seconds\n maximum: utils.getSeconds(endOfDay)\n }),\n meridiem: () => ({\n minimum: 0,\n maximum: 1\n }),\n empty: () => ({\n minimum: 0,\n maximum: 0\n })\n };\n};\nlet warnedOnceInvalidSection = false;\nexport const validateSections = (sections, valueType) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnceInvalidSection) {\n const supportedSections = ['empty'];\n if (['date', 'date-time'].includes(valueType)) {\n supportedSections.push('weekDay', 'day', 'month', 'year');\n }\n if (['time', 'date-time'].includes(valueType)) {\n supportedSections.push('hours', 'minutes', 'seconds', 'meridiem');\n }\n const invalidSection = sections.find(section => !supportedSections.includes(section.type));\n if (invalidSection) {\n console.warn(`MUI X: The field component you are using is not compatible with the \"${invalidSection.type}\" date section.`, `The supported date sections are [\"${supportedSections.join('\", \"')}\"]\\`.`);\n warnedOnceInvalidSection = true;\n }\n }\n }\n};\nconst transferDateSectionValue = (utils, timezone, section, dateToTransferFrom, dateToTransferTo) => {\n switch (section.type) {\n case 'year':\n {\n return utils.setYear(dateToTransferTo, utils.getYear(dateToTransferFrom));\n }\n case 'month':\n {\n return utils.setMonth(dateToTransferTo, utils.getMonth(dateToTransferFrom));\n }\n case 'weekDay':\n {\n const formattedDaysInWeek = getDaysInWeekStr(utils, timezone, section.format);\n const dayInWeekStrOfActiveDate = utils.formatByString(dateToTransferFrom, section.format);\n const dayInWeekOfActiveDate = formattedDaysInWeek.indexOf(dayInWeekStrOfActiveDate);\n const dayInWeekOfNewSectionValue = formattedDaysInWeek.indexOf(section.value);\n const diff = dayInWeekOfNewSectionValue - dayInWeekOfActiveDate;\n return utils.addDays(dateToTransferFrom, diff);\n }\n case 'day':\n {\n return utils.setDate(dateToTransferTo, utils.getDate(dateToTransferFrom));\n }\n case 'meridiem':\n {\n const isAM = utils.getHours(dateToTransferFrom) < 12;\n const mergedDateHours = utils.getHours(dateToTransferTo);\n if (isAM && mergedDateHours >= 12) {\n return utils.addHours(dateToTransferTo, -12);\n }\n if (!isAM && mergedDateHours < 12) {\n return utils.addHours(dateToTransferTo, 12);\n }\n return dateToTransferTo;\n }\n case 'hours':\n {\n return utils.setHours(dateToTransferTo, utils.getHours(dateToTransferFrom));\n }\n case 'minutes':\n {\n return utils.setMinutes(dateToTransferTo, utils.getMinutes(dateToTransferFrom));\n }\n case 'seconds':\n {\n return utils.setSeconds(dateToTransferTo, utils.getSeconds(dateToTransferFrom));\n }\n default:\n {\n return dateToTransferTo;\n }\n }\n};\nconst reliableSectionModificationOrder = {\n year: 1,\n month: 2,\n day: 3,\n weekDay: 4,\n hours: 5,\n minutes: 6,\n seconds: 7,\n meridiem: 8,\n empty: 9\n};\nexport const mergeDateIntoReferenceDate = (utils, timezone, dateToTransferFrom, sections, referenceDate, shouldLimitToEditedSections) =>\n// cloning sections before sort to avoid mutating it\n[...sections].sort((a, b) => reliableSectionModificationOrder[a.type] - reliableSectionModificationOrder[b.type]).reduce((mergedDate, section) => {\n if (!shouldLimitToEditedSections || section.modified) {\n return transferDateSectionValue(utils, timezone, section, dateToTransferFrom, mergedDate);\n }\n return mergedDate;\n}, referenceDate);\nexport const isAndroid = () => navigator.userAgent.toLowerCase().indexOf('android') > -1;\n\n// TODO v8: Remove if we drop the v6 TextField approach.\nexport const getSectionOrder = (sections, shouldApplyRTL) => {\n const neighbors = {};\n if (!shouldApplyRTL) {\n sections.forEach((_, index) => {\n const leftIndex = index === 0 ? null : index - 1;\n const rightIndex = index === sections.length - 1 ? null : index + 1;\n neighbors[index] = {\n leftIndex,\n rightIndex\n };\n });\n return {\n neighbors,\n startIndex: 0,\n endIndex: sections.length - 1\n };\n }\n const rtl2ltr = {};\n const ltr2rtl = {};\n let groupedSectionsStart = 0;\n let groupedSectionsEnd = 0;\n let RTLIndex = sections.length - 1;\n while (RTLIndex >= 0) {\n groupedSectionsEnd = sections.findIndex(\n // eslint-disable-next-line @typescript-eslint/no-loop-func\n (section, index) => index >= groupedSectionsStart && section.endSeparator?.includes(' ') &&\n // Special case where the spaces were not there in the initial input\n section.endSeparator !== ' / ');\n if (groupedSectionsEnd === -1) {\n groupedSectionsEnd = sections.length - 1;\n }\n for (let i = groupedSectionsEnd; i >= groupedSectionsStart; i -= 1) {\n ltr2rtl[i] = RTLIndex;\n rtl2ltr[RTLIndex] = i;\n RTLIndex -= 1;\n }\n groupedSectionsStart = groupedSectionsEnd + 1;\n }\n sections.forEach((_, index) => {\n const rtlIndex = ltr2rtl[index];\n const leftIndex = rtlIndex === 0 ? null : rtl2ltr[rtlIndex - 1];\n const rightIndex = rtlIndex === sections.length - 1 ? null : rtl2ltr[rtlIndex + 1];\n neighbors[index] = {\n leftIndex,\n rightIndex\n };\n });\n return {\n neighbors,\n startIndex: rtl2ltr[0],\n endIndex: rtl2ltr[sections.length - 1]\n };\n};\nexport const parseSelectedSections = (selectedSections, sections) => {\n if (selectedSections == null) {\n return null;\n }\n if (selectedSections === 'all') {\n return 'all';\n }\n if (typeof selectedSections === 'string') {\n return sections.findIndex(section => section.type === selectedSections);\n }\n return selectedSections;\n};\nexport const getSectionValueText = (section, utils) => {\n if (!section.value) {\n return undefined;\n }\n switch (section.type) {\n case 'month':\n {\n if (section.contentType === 'digit') {\n return utils.format(utils.setMonth(utils.date(), Number(section.value) - 1), 'month');\n }\n const parsedDate = utils.parse(section.value, section.format);\n return parsedDate ? utils.format(parsedDate, 'month') : undefined;\n }\n case 'day':\n return section.contentType === 'digit' ? utils.format(utils.setDate(utils.startOfYear(utils.date()), Number(section.value)), 'dayOfMonthFull') : section.value;\n case 'weekDay':\n // TODO: improve by providing the label of the week day\n return undefined;\n default:\n return undefined;\n }\n};\nexport const getSectionValueNow = (section, utils) => {\n if (!section.value) {\n return undefined;\n }\n switch (section.type) {\n case 'weekDay':\n {\n if (section.contentType === 'letter') {\n // TODO: improve by resolving the week day number from a letter week day\n return undefined;\n }\n return Number(section.value);\n }\n case 'meridiem':\n {\n const parsedDate = utils.parse(`01:00 ${section.value}`, `${utils.formats.hours12h}:${utils.formats.minutes} ${section.format}`);\n if (parsedDate) {\n return utils.getHours(parsedDate) >= 12 ? 1 : 0;\n }\n return undefined;\n }\n case 'day':\n return section.contentType === 'digit-with-letter' ? parseInt(section.value, 10) : Number(section.value);\n case 'month':\n {\n if (section.contentType === 'digit') {\n return Number(section.value);\n }\n const parsedDate = utils.parse(section.value, section.format);\n return parsedDate ? utils.getMonth(parsedDate) + 1 : undefined;\n }\n default:\n return section.contentType !== 'letter' ? Number(section.value) : undefined;\n }\n};","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"value\", \"referenceDate\"];\nimport { areDatesEqual, getTodayDate, replaceInvalidDateByNull } from './date-utils';\nimport { getDefaultReferenceDate } from './getDefaultReferenceDate';\nimport { createDateStrForV7HiddenInputFromSections, createDateStrForV6InputFromSections } from '../hooks/useField/useField.utils';\nexport const singleItemValueManager = {\n emptyValue: null,\n getTodayValue: getTodayDate,\n getInitialReferenceValue: _ref => {\n let {\n value,\n referenceDate\n } = _ref,\n params = _objectWithoutPropertiesLoose(_ref, _excluded);\n if (value != null && params.utils.isValid(value)) {\n return value;\n }\n if (referenceDate != null) {\n return referenceDate;\n }\n return getDefaultReferenceDate(params);\n },\n cleanValue: replaceInvalidDateByNull,\n areValuesEqual: areDatesEqual,\n isSameError: (a, b) => a === b,\n hasError: error => error != null,\n defaultErrorState: null,\n getTimezone: (utils, value) => value == null || !utils.isValid(value) ? null : utils.getTimezone(value),\n setTimezone: (utils, timezone, value) => value == null ? null : utils.setTimezone(value, timezone)\n};\nexport const singleItemFieldValueManager = {\n updateReferenceValue: (utils, value, prevReferenceValue) => value == null || !utils.isValid(value) ? prevReferenceValue : value,\n getSectionsFromValue: (utils, date, prevSections, getSectionsFromDate) => {\n const shouldReUsePrevDateSections = !utils.isValid(date) && !!prevSections;\n if (shouldReUsePrevDateSections) {\n return prevSections;\n }\n return getSectionsFromDate(date);\n },\n getV7HiddenInputValueFromSections: createDateStrForV7HiddenInputFromSections,\n getV6InputValueFromSections: createDateStrForV6InputFromSections,\n getActiveDateManager: (utils, state) => ({\n date: state.value,\n referenceDate: state.referenceValue,\n getSections: sections => sections,\n getNewValuesFromNewActiveDate: newActiveDate => ({\n value: newActiveDate,\n referenceValue: newActiveDate == null || !utils.isValid(newActiveDate) ? state.referenceValue : newActiveDate\n })\n }),\n parseValueStr: (valueStr, referenceValue, parseDate) => parseDate(valueStr.trim(), referenceValue)\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"localeText\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useThemeProps } from '@mui/material/styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const MuiPickersAdapterContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== 'production') {\n MuiPickersAdapterContext.displayName = 'MuiPickersAdapterContext';\n}\n/**\n * Demos:\n *\n * - [Date format and localization](https://mui.com/x/react-date-pickers/adapters-locale/)\n * - [Calendar systems](https://mui.com/x/react-date-pickers/calendar-systems/)\n * - [Translated components](https://mui.com/x/react-date-pickers/localization/)\n * - [UTC and timezones](https://mui.com/x/react-date-pickers/timezone/)\n *\n * API:\n *\n * - [LocalizationProvider API](https://mui.com/x/api/date-pickers/localization-provider/)\n */\nexport const LocalizationProvider = function LocalizationProvider(inProps) {\n const {\n localeText: inLocaleText\n } = inProps,\n otherInProps = _objectWithoutPropertiesLoose(inProps, _excluded);\n const {\n utils: parentUtils,\n localeText: parentLocaleText\n } = React.useContext(MuiPickersAdapterContext) ?? {\n utils: undefined,\n localeText: undefined\n };\n const props = useThemeProps({\n // We don't want to pass the `localeText` prop to the theme, that way it will always return the theme value,\n // We will then merge this theme value with our value manually\n props: otherInProps,\n name: 'MuiLocalizationProvider'\n });\n const {\n children,\n dateAdapter: DateAdapter,\n dateFormats,\n dateLibInstance,\n adapterLocale,\n localeText: themeLocaleText\n } = props;\n const localeText = React.useMemo(() => _extends({}, themeLocaleText, parentLocaleText, inLocaleText), [themeLocaleText, parentLocaleText, inLocaleText]);\n const utils = React.useMemo(() => {\n if (!DateAdapter) {\n if (parentUtils) {\n return parentUtils;\n }\n return null;\n }\n const adapter = new DateAdapter({\n locale: adapterLocale,\n formats: dateFormats,\n instance: dateLibInstance\n });\n if (!adapter.isMUIAdapter) {\n throw new Error(['MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`', \"For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`\", 'More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation'].join(`\\n`));\n }\n return adapter;\n }, [DateAdapter, adapterLocale, dateFormats, dateLibInstance, parentUtils]);\n const defaultDates = React.useMemo(() => {\n if (!utils) {\n return null;\n }\n return {\n minDate: utils.date('1900-01-01T00:00:00.000'),\n maxDate: utils.date('2099-12-31T00:00:00.000')\n };\n }, [utils]);\n const contextValue = React.useMemo(() => {\n return {\n utils,\n defaultDates,\n localeText\n };\n }, [defaultDates, utils, localeText]);\n return /*#__PURE__*/_jsx(MuiPickersAdapterContext.Provider, {\n value: contextValue,\n children: children\n });\n};\nprocess.env.NODE_ENV !== \"production\" ? LocalizationProvider.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Locale for the date library you are using\n */\n adapterLocale: PropTypes.any,\n children: PropTypes.node,\n /**\n * Date library adapter class function.\n * @see See the localization provider {@link https://mui.com/x/react-date-pickers/getting-started/#setup-your-date-library-adapter date adapter setup section} for more details.\n */\n dateAdapter: PropTypes.func,\n /**\n * Formats that are used for any child pickers\n */\n dateFormats: PropTypes.shape({\n dayOfMonth: PropTypes.string,\n dayOfMonthFull: PropTypes.string,\n fullDate: PropTypes.string,\n fullTime: PropTypes.string,\n fullTime12h: PropTypes.string,\n fullTime24h: PropTypes.string,\n hours12h: PropTypes.string,\n hours24h: PropTypes.string,\n keyboardDate: PropTypes.string,\n keyboardDateTime: PropTypes.string,\n keyboardDateTime12h: PropTypes.string,\n keyboardDateTime24h: PropTypes.string,\n meridiem: PropTypes.string,\n minutes: PropTypes.string,\n month: PropTypes.string,\n monthShort: PropTypes.string,\n normalDate: PropTypes.string,\n normalDateWithWeekday: PropTypes.string,\n seconds: PropTypes.string,\n shortDate: PropTypes.string,\n weekday: PropTypes.string,\n weekdayShort: PropTypes.string,\n year: PropTypes.string\n }),\n /**\n * Date library instance you are using, if it has some global overrides\n * ```jsx\n * dateLibInstance={momentTimeZone}\n * ```\n */\n dateLibInstance: PropTypes.any,\n /**\n * Locale for components texts\n */\n localeText: PropTypes.object\n} : void 0;","import { getPickersLocalization } from './utils/getPickersLocalization';\n\n// This object is not Partial because it is the default values\n\nconst enUSPickers = {\n // Calendar navigation\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n // View navigation\n openPreviousView: 'Open previous view',\n openNextView: 'Open next view',\n calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'year view is open, switch to calendar view' : 'calendar view is open, switch to year view',\n // DateRange labels\n start: 'Start',\n end: 'End',\n startDate: 'Start date',\n startTime: 'Start time',\n endDate: 'End date',\n endTime: 'End time',\n // Action bar\n cancelButtonLabel: 'Cancel',\n clearButtonLabel: 'Clear',\n okButtonLabel: 'OK',\n todayButtonLabel: 'Today',\n // Toolbar titles\n datePickerToolbarTitle: 'Select date',\n dateTimePickerToolbarTitle: 'Select date & time',\n timePickerToolbarTitle: 'Select time',\n dateRangePickerToolbarTitle: 'Select date range',\n // Clock labels\n clockLabelText: (view, time, adapter) => `Select ${view}. ${time === null ? 'No time selected' : `Selected time is ${adapter.format(time, 'fullTime')}`}`,\n hoursClockNumberText: hours => `${hours} hours`,\n minutesClockNumberText: minutes => `${minutes} minutes`,\n secondsClockNumberText: seconds => `${seconds} seconds`,\n // Digital clock labels\n selectViewText: view => `Select ${view}`,\n // Calendar labels\n calendarWeekNumberHeaderLabel: 'Week number',\n calendarWeekNumberHeaderText: '#',\n calendarWeekNumberAriaLabelText: weekNumber => `Week ${weekNumber}`,\n calendarWeekNumberText: weekNumber => `${weekNumber}`,\n // Open picker labels\n openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Choose date, selected date is ${utils.format(value, 'fullDate')}` : 'Choose date',\n openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Choose time, selected time is ${utils.format(value, 'fullTime')}` : 'Choose time',\n fieldClearLabel: 'Clear value',\n // Table labels\n timeTableLabel: 'pick time',\n dateTableLabel: 'pick date',\n // Field section placeholders\n fieldYearPlaceholder: params => 'Y'.repeat(params.digitAmount),\n fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',\n fieldDayPlaceholder: () => 'DD',\n fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',\n fieldHoursPlaceholder: () => 'hh',\n fieldMinutesPlaceholder: () => 'mm',\n fieldSecondsPlaceholder: () => 'ss',\n fieldMeridiemPlaceholder: () => 'aa',\n // View names\n year: 'Year',\n month: 'Month',\n day: 'Day',\n weekDay: 'Week day',\n hours: 'Hours',\n minutes: 'Minutes',\n seconds: 'Seconds',\n meridiem: 'Meridiem',\n // Common\n empty: 'Empty'\n};\nexport const DEFAULT_LOCALE = enUSPickers;\nexport const enUS = getPickersLocalization(enUSPickers);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport const getPickersLocalization = pickersTranslations => {\n return {\n components: {\n MuiLocalizationProvider: {\n defaultProps: {\n localeText: _extends({}, pickersTranslations)\n }\n }\n }\n };\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { MuiPickersAdapterContext } from '../../LocalizationProvider/LocalizationProvider';\nimport { DEFAULT_LOCALE } from '../../locales/enUS';\nexport const useLocalizationContext = () => {\n const localization = React.useContext(MuiPickersAdapterContext);\n if (localization === null) {\n throw new Error(['MUI X: Can not find the date and time pickers localization context.', 'It looks like you forgot to wrap your component in LocalizationProvider.', 'This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package'].join('\\n'));\n }\n if (localization.utils === null) {\n throw new Error(['MUI X: Can not find the date and time pickers adapter from its localization context.', 'It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider.'].join('\\n'));\n }\n const localeText = React.useMemo(() => _extends({}, DEFAULT_LOCALE, localization.localeText), [localization.localeText]);\n return React.useMemo(() => _extends({}, localization, {\n localeText\n }), [localization, localeText]);\n};\nexport const useUtils = () => useLocalizationContext().utils;\nexport const useDefaultDates = () => useLocalizationContext().defaultDates;\nexport const useLocaleText = () => useLocalizationContext().localeText;\nexport const useNow = timezone => {\n const utils = useUtils();\n const now = React.useRef();\n if (now.current === undefined) {\n now.current = utils.date(undefined, timezone);\n }\n return now.current;\n};","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t {\n const {\n classes,\n isLandscape\n } = ownerState;\n const slots = {\n root: ['root'],\n content: ['content'],\n penIconButton: ['penIconButton', isLandscape && 'penIconButtonLandscape']\n };\n return composeClasses(slots, getPickersToolbarUtilityClass, classes);\n};\nconst PickersToolbarRoot = styled('div', {\n name: 'MuiPickersToolbar',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})(({\n theme\n}) => ({\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-start',\n justifyContent: 'space-between',\n padding: theme.spacing(2, 3),\n variants: [{\n props: {\n isLandscape: true\n },\n style: {\n height: 'auto',\n maxWidth: 160,\n padding: 16,\n justifyContent: 'flex-start',\n flexWrap: 'wrap'\n }\n }]\n}));\nconst PickersToolbarContent = styled('div', {\n name: 'MuiPickersToolbar',\n slot: 'Content',\n overridesResolver: (props, styles) => styles.content\n})({\n display: 'flex',\n flexWrap: 'wrap',\n width: '100%',\n flex: 1,\n justifyContent: 'space-between',\n alignItems: 'center',\n flexDirection: 'row',\n variants: [{\n props: {\n isLandscape: true\n },\n style: {\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n flexDirection: 'column'\n }\n }, {\n props: {\n isLandscape: true,\n landscapeDirection: 'row'\n },\n style: {\n flexDirection: 'row'\n }\n }]\n});\nexport const PickersToolbar = /*#__PURE__*/React.forwardRef(function PickersToolbar(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersToolbar'\n });\n const {\n children,\n className,\n toolbarTitle,\n hidden,\n titleId\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = props;\n const classes = useUtilityClasses(ownerState);\n if (hidden) {\n return null;\n }\n return /*#__PURE__*/_jsxs(PickersToolbarRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: ownerState\n }, other, {\n children: [/*#__PURE__*/_jsx(Typography, {\n color: \"text.secondary\",\n variant: \"overline\",\n id: titleId,\n children: toolbarTitle\n }), /*#__PURE__*/_jsx(PickersToolbarContent, {\n className: classes.content,\n ownerState: ownerState,\n children: children\n })]\n }));\n});","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport function getDatePickerToolbarUtilityClass(slot) {\n return generateUtilityClass('MuiDatePickerToolbar', slot);\n}\nexport const datePickerToolbarClasses = generateUtilityClasses('MuiDatePickerToolbar', ['root', 'title']);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"value\", \"isLandscape\", \"onChange\", \"toolbarFormat\", \"toolbarPlaceholder\", \"views\", \"className\", \"onViewChange\", \"view\"];\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport PropTypes from 'prop-types';\nimport Typography from '@mui/material/Typography';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { unstable_composeClasses as composeClasses } from '@mui/utils';\nimport { PickersToolbar } from '../internals/components/PickersToolbar';\nimport { useLocaleText, useUtils } from '../internals/hooks/useUtils';\nimport { getDatePickerToolbarUtilityClass } from './datePickerToolbarClasses';\nimport { resolveDateFormat } from '../internals/utils/date-utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root'],\n title: ['title']\n };\n return composeClasses(slots, getDatePickerToolbarUtilityClass, classes);\n};\nconst DatePickerToolbarRoot = styled(PickersToolbar, {\n name: 'MuiDatePickerToolbar',\n slot: 'Root',\n overridesResolver: (_, styles) => styles.root\n})({});\nconst DatePickerToolbarTitle = styled(Typography, {\n name: 'MuiDatePickerToolbar',\n slot: 'Title',\n overridesResolver: (_, styles) => styles.title\n})({\n variants: [{\n props: {\n isLandscape: true\n },\n style: {\n margin: 'auto 16px auto auto'\n }\n }]\n});\n/**\n * Demos:\n *\n * - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)\n * - [Custom components](https://mui.com/x/react-date-pickers/custom-components/)\n *\n * API:\n *\n * - [DatePickerToolbar API](https://mui.com/x/api/date-pickers/date-picker-toolbar/)\n */\nexport const DatePickerToolbar = /*#__PURE__*/React.forwardRef(function DatePickerToolbar(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiDatePickerToolbar'\n });\n const {\n value,\n isLandscape,\n toolbarFormat,\n toolbarPlaceholder = '––',\n views,\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const utils = useUtils();\n const localeText = useLocaleText();\n const classes = useUtilityClasses(props);\n const dateText = React.useMemo(() => {\n if (!value) {\n return toolbarPlaceholder;\n }\n const formatFromViews = resolveDateFormat(utils, {\n format: toolbarFormat,\n views\n }, true);\n return utils.formatByString(value, formatFromViews);\n }, [value, toolbarFormat, toolbarPlaceholder, utils, views]);\n const ownerState = props;\n return /*#__PURE__*/_jsx(DatePickerToolbarRoot, _extends({\n ref: ref,\n toolbarTitle: localeText.datePickerToolbarTitle,\n isLandscape: isLandscape,\n className: clsx(classes.root, className)\n }, other, {\n children: /*#__PURE__*/_jsx(DatePickerToolbarTitle, {\n variant: \"h4\",\n align: isLandscape ? 'left' : 'center',\n ownerState: ownerState,\n className: classes.title,\n children: dateText\n })\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? DatePickerToolbar.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n className: PropTypes.string,\n disabled: PropTypes.bool,\n /**\n * If `true`, show the toolbar even in desktop mode.\n * @default `true` for Desktop, `false` for Mobile.\n */\n hidden: PropTypes.bool,\n isLandscape: PropTypes.bool.isRequired,\n onChange: PropTypes.func.isRequired,\n /**\n * Callback called when a toolbar is clicked\n * @template TView\n * @param {TView} view The view to open\n */\n onViewChange: PropTypes.func.isRequired,\n readOnly: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n titleId: PropTypes.string,\n /**\n * Toolbar date format.\n */\n toolbarFormat: PropTypes.string,\n /**\n * Toolbar value placeholder—it is displayed when the value is empty.\n * @default \"––\"\n */\n toolbarPlaceholder: PropTypes.node,\n value: PropTypes.object,\n /**\n * Currently visible picker view.\n */\n view: PropTypes.oneOf(['day', 'month', 'year']).isRequired,\n /**\n * Available views.\n */\n views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired).isRequired\n} : void 0;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useThemeProps } from '@mui/material/styles';\nimport { useDefaultDates, useUtils } from '../internals/hooks/useUtils';\nimport { applyDefaultViewProps } from '../internals/utils/views';\nimport { applyDefaultDate } from '../internals/utils/date-utils';\nimport { DatePickerToolbar } from './DatePickerToolbar';\nexport function useDatePickerDefaultizedProps(props, name) {\n const utils = useUtils();\n const defaultDates = useDefaultDates();\n const themeProps = useThemeProps({\n props,\n name\n });\n const localeText = React.useMemo(() => {\n if (themeProps.localeText?.toolbarTitle == null) {\n return themeProps.localeText;\n }\n return _extends({}, themeProps.localeText, {\n datePickerToolbarTitle: themeProps.localeText.toolbarTitle\n });\n }, [themeProps.localeText]);\n return _extends({}, themeProps, {\n localeText\n }, applyDefaultViewProps({\n views: themeProps.views,\n openTo: themeProps.openTo,\n defaultViews: ['year', 'day'],\n defaultOpenTo: 'day'\n }), {\n disableFuture: themeProps.disableFuture ?? false,\n disablePast: themeProps.disablePast ?? false,\n minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),\n maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate),\n slots: _extends({\n toolbar: DatePickerToolbar\n }, themeProps.slots)\n });\n}","import { applyDefaultDate } from '../date-utils';\nexport const validateDate = ({\n props,\n value,\n adapter\n}) => {\n if (value === null) {\n return null;\n }\n const {\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n disablePast,\n disableFuture,\n timezone\n } = props;\n const now = adapter.utils.date(undefined, timezone);\n const minDate = applyDefaultDate(adapter.utils, props.minDate, adapter.defaultDates.minDate);\n const maxDate = applyDefaultDate(adapter.utils, props.maxDate, adapter.defaultDates.maxDate);\n switch (true) {\n case !adapter.utils.isValid(value):\n return 'invalidDate';\n case Boolean(shouldDisableDate && shouldDisableDate(value)):\n return 'shouldDisableDate';\n case Boolean(shouldDisableMonth && shouldDisableMonth(value)):\n return 'shouldDisableMonth';\n case Boolean(shouldDisableYear && shouldDisableYear(value)):\n return 'shouldDisableYear';\n case Boolean(disableFuture && adapter.utils.isAfterDay(value, now)):\n return 'disableFuture';\n case Boolean(disablePast && adapter.utils.isBeforeDay(value, now)):\n return 'disablePast';\n case Boolean(minDate && adapter.utils.isBeforeDay(value, minDate)):\n return 'minDate';\n case Boolean(maxDate && adapter.utils.isAfterDay(value, maxDate)):\n return 'maxDate';\n default:\n return null;\n }\n};","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport function getPickersPopperUtilityClass(slot) {\n return generateUtilityClass('MuiPickersPopper', slot);\n}\nexport const pickersPopperClasses = generateUtilityClasses('MuiPickersPopper', ['root', 'paper']);","/* Use it instead of .includes method for IE support */\nexport function arrayIncludes(array, itemOrItems) {\n if (Array.isArray(itemOrItems)) {\n return itemOrItems.every(item => array.indexOf(item) !== -1);\n }\n return array.indexOf(itemOrItems) !== -1;\n}\nexport const onSpaceOrEnter = (innerFn, externalEvent) => event => {\n if (event.key === 'Enter' || event.key === ' ') {\n innerFn(event);\n\n // prevent any side effects\n event.preventDefault();\n event.stopPropagation();\n }\n if (externalEvent) {\n externalEvent(event);\n }\n};\nexport const executeInTheNextEventLoopTick = fn => {\n setTimeout(fn, 0);\n};\n\n// https://www.abeautifulsite.net/posts/finding-the-active-element-in-a-shadow-root/\nexport const getActiveElement = (root = document) => {\n const activeEl = root.activeElement;\n if (!activeEl) {\n return null;\n }\n if (activeEl.shadowRoot) {\n return getActiveElement(activeEl.shadowRoot);\n }\n return activeEl;\n};\nexport const DEFAULT_DESKTOP_MODE_MEDIA_QUERY = '@media (pointer: fine)';","import useMediaQuery from '@mui/material/useMediaQuery';\nconst PREFERS_REDUCED_MOTION = '@media (prefers-reduced-motion: reduce)';\n\n// detect if user agent has Android version < 10 or iOS version < 13\nconst mobileVersionMatches = typeof navigator !== 'undefined' && navigator.userAgent.match(/android\\s(\\d+)|OS\\s(\\d+)/i);\nconst androidVersion = mobileVersionMatches && mobileVersionMatches[1] ? parseInt(mobileVersionMatches[1], 10) : null;\nconst iOSVersion = mobileVersionMatches && mobileVersionMatches[2] ? parseInt(mobileVersionMatches[2], 10) : null;\nexport const slowAnimationDevices = androidVersion && androidVersion < 10 || iOSVersion && iOSVersion < 13 || false;\nexport const useDefaultReduceAnimations = () => {\n const prefersReduced = useMediaQuery(PREFERS_REDUCED_MOTION, {\n defaultMatches: false\n });\n return prefersReduced || slowAnimationDevices;\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"PaperComponent\", \"popperPlacement\", \"ownerState\", \"children\", \"paperSlotProps\", \"paperClasses\", \"onPaperClick\", \"onPaperTouchStart\"];\nimport * as React from 'react';\nimport { useSlotProps } from '@mui/base/utils';\nimport Grow from '@mui/material/Grow';\nimport Fade from '@mui/material/Fade';\nimport MuiPaper from '@mui/material/Paper';\nimport MuiPopper from '@mui/material/Popper';\nimport BaseFocusTrap from '@mui/material/Unstable_TrapFocus';\nimport { unstable_useForkRef as useForkRef, unstable_useEventCallback as useEventCallback, unstable_ownerDocument as ownerDocument, unstable_composeClasses as composeClasses } from '@mui/utils';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { getPickersPopperUtilityClass } from './pickersPopperClasses';\nimport { getActiveElement } from '../utils/utils';\nimport { useDefaultReduceAnimations } from '../hooks/useDefaultReduceAnimations';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root'],\n paper: ['paper']\n };\n return composeClasses(slots, getPickersPopperUtilityClass, classes);\n};\nconst PickersPopperRoot = styled(MuiPopper, {\n name: 'MuiPickersPopper',\n slot: 'Root',\n overridesResolver: (_, styles) => styles.root\n})(({\n theme\n}) => ({\n zIndex: theme.zIndex.modal\n}));\nconst PickersPopperPaper = styled(MuiPaper, {\n name: 'MuiPickersPopper',\n slot: 'Paper',\n overridesResolver: (_, styles) => styles.paper\n})({\n outline: 0,\n transformOrigin: 'top center',\n variants: [{\n props: ({\n placement\n }) => ['top', 'top-start', 'top-end'].includes(placement),\n style: {\n transformOrigin: 'bottom center'\n }\n }]\n});\nfunction clickedRootScrollbar(event, doc) {\n return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;\n}\n/**\n * Based on @mui/material/ClickAwayListener without the customization.\n * We can probably strip away even more since children won't be portaled.\n * @param {boolean} active Only listen to clicks when the popper is opened.\n * @param {(event: MouseEvent | TouchEvent) => void} onClickAway The callback to call when clicking outside the popper.\n * @returns {Array} The ref and event handler to listen to the outside clicks.\n */\nfunction useClickAwayListener(active, onClickAway) {\n const movedRef = React.useRef(false);\n const syntheticEventRef = React.useRef(false);\n const nodeRef = React.useRef(null);\n const activatedRef = React.useRef(false);\n React.useEffect(() => {\n if (!active) {\n return undefined;\n }\n\n // Ensure that this hook is not \"activated\" synchronously.\n // https://github.com/facebook/react/issues/20074\n function armClickAwayListener() {\n activatedRef.current = true;\n }\n document.addEventListener('mousedown', armClickAwayListener, true);\n document.addEventListener('touchstart', armClickAwayListener, true);\n return () => {\n document.removeEventListener('mousedown', armClickAwayListener, true);\n document.removeEventListener('touchstart', armClickAwayListener, true);\n activatedRef.current = false;\n };\n }, [active]);\n\n // The handler doesn't take event.defaultPrevented into account:\n //\n // event.preventDefault() is meant to stop default behaviors like\n // clicking a checkbox to check it, hitting a button to submit a form,\n // and hitting left arrow to move the cursor in a text input etc.\n // Only special HTML elements have these default behaviors.\n const handleClickAway = useEventCallback(event => {\n if (!activatedRef.current) {\n return;\n }\n\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n const insideReactTree = syntheticEventRef.current;\n syntheticEventRef.current = false;\n const doc = ownerDocument(nodeRef.current);\n\n // 1. IE11 support, which trigger the handleClickAway even after the unbind\n // 2. The child might render null.\n // 3. Behave like a blur listener.\n if (!nodeRef.current ||\n // is a TouchEvent?\n 'clientX' in event && clickedRootScrollbar(event, doc)) {\n return;\n }\n\n // Do not act if user performed touchmove\n if (movedRef.current) {\n movedRef.current = false;\n return;\n }\n let insideDOM;\n\n // If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js\n if (event.composedPath) {\n insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;\n } else {\n insideDOM = !doc.documentElement.contains(event.target) || nodeRef.current.contains(event.target);\n }\n if (!insideDOM && !insideReactTree) {\n onClickAway(event);\n }\n });\n\n // Keep track of mouse/touch events that bubbled up through the portal.\n const handleSynthetic = () => {\n syntheticEventRef.current = true;\n };\n React.useEffect(() => {\n if (active) {\n const doc = ownerDocument(nodeRef.current);\n const handleTouchMove = () => {\n movedRef.current = true;\n };\n doc.addEventListener('touchstart', handleClickAway);\n doc.addEventListener('touchmove', handleTouchMove);\n return () => {\n doc.removeEventListener('touchstart', handleClickAway);\n doc.removeEventListener('touchmove', handleTouchMove);\n };\n }\n return undefined;\n }, [active, handleClickAway]);\n React.useEffect(() => {\n // TODO This behavior is not tested automatically\n // It's unclear whether this is due to different update semantics in test (batched in act() vs discrete on click).\n // Or if this is a timing related issues due to different Transition components\n // Once we get rid of all the manual scheduling (for example setTimeout(update, 0)) we can revisit this code+test.\n if (active) {\n const doc = ownerDocument(nodeRef.current);\n doc.addEventListener('click', handleClickAway);\n return () => {\n doc.removeEventListener('click', handleClickAway);\n // cleanup `handleClickAway`\n syntheticEventRef.current = false;\n };\n }\n return undefined;\n }, [active, handleClickAway]);\n return [nodeRef, handleSynthetic, handleSynthetic];\n}\nconst PickersPopperPaperWrapper = /*#__PURE__*/React.forwardRef((props, ref) => {\n const {\n PaperComponent,\n popperPlacement,\n ownerState: inOwnerState,\n children,\n paperSlotProps,\n paperClasses,\n onPaperClick,\n onPaperTouchStart\n // picks up the style props provided by `Transition`\n // https://mui.com/material-ui/transitions/#child-requirement\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, inOwnerState, {\n placement: popperPlacement\n });\n const paperProps = useSlotProps({\n elementType: PaperComponent,\n externalSlotProps: paperSlotProps,\n additionalProps: {\n tabIndex: -1,\n elevation: 8,\n ref\n },\n className: paperClasses,\n ownerState\n });\n return /*#__PURE__*/_jsx(PaperComponent, _extends({}, other, paperProps, {\n onClick: event => {\n onPaperClick(event);\n paperProps.onClick?.(event);\n },\n onTouchStart: event => {\n onPaperTouchStart(event);\n paperProps.onTouchStart?.(event);\n },\n ownerState: ownerState,\n children: children\n }));\n});\nexport function PickersPopper(inProps) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersPopper'\n });\n const {\n anchorEl,\n children,\n containerRef = null,\n shouldRestoreFocus,\n onBlur,\n onDismiss,\n open,\n role,\n placement,\n slots,\n slotProps,\n reduceAnimations: inReduceAnimations\n } = props;\n React.useEffect(() => {\n function handleKeyDown(nativeEvent) {\n if (open && nativeEvent.key === 'Escape') {\n onDismiss();\n }\n }\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [onDismiss, open]);\n const lastFocusedElementRef = React.useRef(null);\n React.useEffect(() => {\n if (role === 'tooltip' || shouldRestoreFocus && !shouldRestoreFocus()) {\n return;\n }\n if (open) {\n lastFocusedElementRef.current = getActiveElement(document);\n } else if (lastFocusedElementRef.current && lastFocusedElementRef.current instanceof HTMLElement) {\n // make sure the button is flushed with updated label, before returning focus to it\n // avoids issue, where screen reader could fail to announce selected date after selection\n setTimeout(() => {\n if (lastFocusedElementRef.current instanceof HTMLElement) {\n lastFocusedElementRef.current.focus();\n }\n });\n }\n }, [open, role, shouldRestoreFocus]);\n const [clickAwayRef, onPaperClick, onPaperTouchStart] = useClickAwayListener(open, onBlur ?? onDismiss);\n const paperRef = React.useRef(null);\n const handleRef = useForkRef(paperRef, containerRef);\n const handlePaperRef = useForkRef(handleRef, clickAwayRef);\n const ownerState = props;\n const classes = useUtilityClasses(ownerState);\n const defaultReduceAnimations = useDefaultReduceAnimations();\n const reduceAnimations = inReduceAnimations ?? defaultReduceAnimations;\n const handleKeyDown = event => {\n if (event.key === 'Escape') {\n // stop the propagation to avoid closing parent modal\n event.stopPropagation();\n onDismiss();\n }\n };\n const Transition = slots?.desktopTransition ?? reduceAnimations ? Fade : Grow;\n const FocusTrap = slots?.desktopTrapFocus ?? BaseFocusTrap;\n const Paper = slots?.desktopPaper ?? PickersPopperPaper;\n const Popper = slots?.popper ?? PickersPopperRoot;\n const popperProps = useSlotProps({\n elementType: Popper,\n externalSlotProps: slotProps?.popper,\n additionalProps: {\n transition: true,\n role,\n open,\n anchorEl,\n placement,\n onKeyDown: handleKeyDown\n },\n className: classes.root,\n ownerState: props\n });\n return /*#__PURE__*/_jsx(Popper, _extends({}, popperProps, {\n children: ({\n TransitionProps,\n placement: popperPlacement\n }) => /*#__PURE__*/_jsx(FocusTrap, _extends({\n open: open,\n disableAutoFocus: true\n // pickers are managing focus position manually\n // without this prop the focus is returned to the button before `aria-label` is updated\n // which would force screen readers to read too old label\n ,\n disableRestoreFocus: true,\n disableEnforceFocus: role === 'tooltip',\n isEnabled: () => true\n }, slotProps?.desktopTrapFocus, {\n children: /*#__PURE__*/_jsx(Transition, _extends({}, TransitionProps, slotProps?.desktopTransition, {\n children: /*#__PURE__*/_jsx(PickersPopperPaperWrapper, {\n PaperComponent: Paper,\n ownerState: ownerState,\n popperPlacement: popperPlacement,\n ref: handlePaperRef,\n onPaperClick: onPaperClick,\n onPaperTouchStart: onPaperTouchStart,\n paperClasses: classes.paper,\n paperSlotProps: slotProps?.desktopPaper,\n children: children\n })\n }))\n }))\n }));\n}","import * as React from 'react';\nimport { useLocalizationContext } from './useUtils';\nexport function useValidation(props, validate, isSameError, defaultErrorState) {\n const {\n value,\n onError\n } = props;\n const adapter = useLocalizationContext();\n const previousValidationErrorRef = React.useRef(defaultErrorState);\n const validationError = validate({\n adapter,\n value,\n props\n });\n React.useEffect(() => {\n if (onError && !isSameError(validationError, previousValidationErrorRef.current)) {\n onError(validationError, value);\n }\n previousValidationErrorRef.current = validationError;\n }, [isSameError, onError, previousValidationErrorRef, validationError, value]);\n return validationError;\n}","import * as React from 'react';\nimport useEventCallback from '@mui/utils/useEventCallback';\nimport useControlled from '@mui/utils/useControlled';\nimport { useUtils } from './useUtils';\n/**\n * Hooks making sure that:\n * - The value returned by `onChange` always have the timezone of `props.value` or `props.defaultValue` if defined\n * - The value rendered is always the one from `props.timezone` if defined\n */\nexport const useValueWithTimezone = ({\n timezone: timezoneProp,\n value: valueProp,\n defaultValue,\n onChange,\n valueManager\n}) => {\n const utils = useUtils();\n const firstDefaultValue = React.useRef(defaultValue);\n const inputValue = valueProp ?? firstDefaultValue.current ?? valueManager.emptyValue;\n const inputTimezone = React.useMemo(() => valueManager.getTimezone(utils, inputValue), [utils, valueManager, inputValue]);\n const setInputTimezone = useEventCallback(newValue => {\n if (inputTimezone == null) {\n return newValue;\n }\n return valueManager.setTimezone(utils, inputTimezone, newValue);\n });\n const timezoneToRender = timezoneProp ?? inputTimezone ?? 'default';\n const valueWithTimezoneToRender = React.useMemo(() => valueManager.setTimezone(utils, timezoneToRender, inputValue), [valueManager, utils, timezoneToRender, inputValue]);\n const handleValueChange = useEventCallback((newValue, ...otherParams) => {\n const newValueWithInputTimezone = setInputTimezone(newValue);\n onChange?.(newValueWithInputTimezone, ...otherParams);\n });\n return {\n value: valueWithTimezoneToRender,\n handleValueChange,\n timezone: timezoneToRender\n };\n};\n\n/**\n * Wrapper around `useControlled` and `useValueWithTimezone`\n */\nexport const useControlledValueWithTimezone = ({\n name,\n timezone: timezoneProp,\n value: valueProp,\n defaultValue,\n onChange: onChangeProp,\n valueManager\n}) => {\n const [valueWithInputTimezone, setValue] = useControlled({\n name,\n state: 'value',\n controlled: valueProp,\n default: defaultValue ?? valueManager.emptyValue\n });\n const onChange = useEventCallback((newValue, ...otherParams) => {\n setValue(newValue);\n onChangeProp?.(newValue, ...otherParams);\n });\n return useValueWithTimezone({\n timezone: timezoneProp,\n value: valueWithInputTimezone,\n defaultValue: undefined,\n onChange,\n valueManager\n });\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport useEventCallback from '@mui/utils/useEventCallback';\nimport { useOpenState } from '../useOpenState';\nimport { useLocalizationContext, useUtils } from '../useUtils';\nimport { useValidation } from '../useValidation';\nimport { useValueWithTimezone } from '../useValueWithTimezone';\n\n/**\n * Decide if the new value should be published\n * The published value will be passed to `onChange` if defined.\n */\nconst shouldPublishValue = params => {\n const {\n action,\n hasChanged,\n dateState,\n isControlled\n } = params;\n const isCurrentValueTheDefaultValue = !isControlled && !dateState.hasBeenModifiedSinceMount;\n\n // The field is responsible for only calling `onChange` when needed.\n if (action.name === 'setValueFromField') {\n return true;\n }\n if (action.name === 'setValueFromAction') {\n // If the component is not controlled, and the value has not been modified since the mount,\n // Then we want to publish the default value whenever the user pressed the \"Accept\", \"Today\" or \"Clear\" button.\n if (isCurrentValueTheDefaultValue && ['accept', 'today', 'clear'].includes(action.pickerAction)) {\n return true;\n }\n return hasChanged(dateState.lastPublishedValue);\n }\n if (action.name === 'setValueFromView' && action.selectionState !== 'shallow') {\n // On the first view,\n // If the value is not controlled, then clicking on any value (including the one equal to `defaultValue`) should call `onChange`\n if (isCurrentValueTheDefaultValue) {\n return true;\n }\n return hasChanged(dateState.lastPublishedValue);\n }\n if (action.name === 'setValueFromShortcut') {\n // On the first view,\n // If the value is not controlled, then clicking on any value (including the one equal to `defaultValue`) should call `onChange`\n if (isCurrentValueTheDefaultValue) {\n return true;\n }\n return hasChanged(dateState.lastPublishedValue);\n }\n return false;\n};\n\n/**\n * Decide if the new value should be committed.\n * The committed value will be passed to `onAccept` if defined.\n * It will also be used as a reset target when calling the `cancel` picker action (when clicking on the \"Cancel\" button).\n */\nconst shouldCommitValue = params => {\n const {\n action,\n hasChanged,\n dateState,\n isControlled,\n closeOnSelect\n } = params;\n const isCurrentValueTheDefaultValue = !isControlled && !dateState.hasBeenModifiedSinceMount;\n if (action.name === 'setValueFromAction') {\n // If the component is not controlled, and the value has not been modified since the mount,\n // Then we want to commit the default value whenever the user pressed the \"Accept\", \"Today\" or \"Clear\" button.\n if (isCurrentValueTheDefaultValue && ['accept', 'today', 'clear'].includes(action.pickerAction)) {\n return true;\n }\n return hasChanged(dateState.lastCommittedValue);\n }\n if (action.name === 'setValueFromView' && action.selectionState === 'finish' && closeOnSelect) {\n // On picker where the 1st view is also the last view,\n // If the value is not controlled, then clicking on any value (including the one equal to `defaultValue`) should call `onAccept`\n if (isCurrentValueTheDefaultValue) {\n return true;\n }\n return hasChanged(dateState.lastCommittedValue);\n }\n if (action.name === 'setValueFromShortcut') {\n return action.changeImportance === 'accept' && hasChanged(dateState.lastCommittedValue);\n }\n return false;\n};\n\n/**\n * Decide if the picker should be closed after the value is updated.\n */\nconst shouldClosePicker = params => {\n const {\n action,\n closeOnSelect\n } = params;\n if (action.name === 'setValueFromAction') {\n return true;\n }\n if (action.name === 'setValueFromView') {\n return action.selectionState === 'finish' && closeOnSelect;\n }\n if (action.name === 'setValueFromShortcut') {\n return action.changeImportance === 'accept';\n }\n return false;\n};\n\n/**\n * Manage the value lifecycle of all the pickers.\n */\nexport const usePickerValue = ({\n props,\n valueManager,\n valueType,\n wrapperVariant,\n validator\n}) => {\n const {\n onAccept,\n onChange,\n value: inValue,\n defaultValue: inDefaultValue,\n closeOnSelect = wrapperVariant === 'desktop',\n timezone: timezoneProp\n } = props;\n const {\n current: defaultValue\n } = React.useRef(inDefaultValue);\n const {\n current: isControlled\n } = React.useRef(inValue !== undefined);\n\n /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (inValue !== undefined)) {\n console.error([`MUI X: A component is changing the ${isControlled ? '' : 'un'}controlled value of a picker to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled value` + 'for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [inValue]);\n React.useEffect(() => {\n if (!isControlled && defaultValue !== inDefaultValue) {\n console.error([`MUI X: A component is changing the defaultValue of an uncontrolled picker after being initialized. ` + `To suppress this warning opt to use a controlled value.`].join('\\n'));\n }\n }, [JSON.stringify(defaultValue)]);\n }\n /* eslint-enable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\n\n const utils = useUtils();\n const adapter = useLocalizationContext();\n const {\n isOpen,\n setIsOpen\n } = useOpenState(props);\n const [dateState, setDateState] = React.useState(() => {\n let initialValue;\n if (inValue !== undefined) {\n initialValue = inValue;\n } else if (defaultValue !== undefined) {\n initialValue = defaultValue;\n } else {\n initialValue = valueManager.emptyValue;\n }\n return {\n draft: initialValue,\n lastPublishedValue: initialValue,\n lastCommittedValue: initialValue,\n lastControlledValue: inValue,\n hasBeenModifiedSinceMount: false\n };\n });\n const {\n timezone,\n handleValueChange\n } = useValueWithTimezone({\n timezone: timezoneProp,\n value: inValue,\n defaultValue,\n onChange,\n valueManager\n });\n useValidation(_extends({}, props, {\n value: dateState.draft,\n timezone\n }), validator, valueManager.isSameError, valueManager.defaultErrorState);\n const updateDate = useEventCallback(action => {\n const updaterParams = {\n action,\n dateState,\n hasChanged: comparison => !valueManager.areValuesEqual(utils, action.value, comparison),\n isControlled,\n closeOnSelect\n };\n const shouldPublish = shouldPublishValue(updaterParams);\n const shouldCommit = shouldCommitValue(updaterParams);\n const shouldClose = shouldClosePicker(updaterParams);\n setDateState(prev => _extends({}, prev, {\n draft: action.value,\n lastPublishedValue: shouldPublish ? action.value : prev.lastPublishedValue,\n lastCommittedValue: shouldCommit ? action.value : prev.lastCommittedValue,\n hasBeenModifiedSinceMount: true\n }));\n if (shouldPublish) {\n const validationError = action.name === 'setValueFromField' ? action.context.validationError : validator({\n adapter,\n value: action.value,\n props: _extends({}, props, {\n value: action.value,\n timezone\n })\n });\n const context = {\n validationError\n };\n if (action.name === 'setValueFromShortcut') {\n context.shortcut = action.shortcut;\n }\n handleValueChange(action.value, context);\n }\n if (shouldCommit && onAccept) {\n onAccept(action.value);\n }\n if (shouldClose) {\n setIsOpen(false);\n }\n });\n if (inValue !== undefined && (dateState.lastControlledValue === undefined || !valueManager.areValuesEqual(utils, dateState.lastControlledValue, inValue))) {\n const isUpdateComingFromPicker = valueManager.areValuesEqual(utils, dateState.draft, inValue);\n setDateState(prev => _extends({}, prev, {\n lastControlledValue: inValue\n }, isUpdateComingFromPicker ? {} : {\n lastCommittedValue: inValue,\n lastPublishedValue: inValue,\n draft: inValue,\n hasBeenModifiedSinceMount: true\n }));\n }\n const handleClear = useEventCallback(() => {\n updateDate({\n value: valueManager.emptyValue,\n name: 'setValueFromAction',\n pickerAction: 'clear'\n });\n });\n const handleAccept = useEventCallback(() => {\n updateDate({\n value: dateState.lastPublishedValue,\n name: 'setValueFromAction',\n pickerAction: 'accept'\n });\n });\n const handleDismiss = useEventCallback(() => {\n updateDate({\n value: dateState.lastPublishedValue,\n name: 'setValueFromAction',\n pickerAction: 'dismiss'\n });\n });\n const handleCancel = useEventCallback(() => {\n updateDate({\n value: dateState.lastCommittedValue,\n name: 'setValueFromAction',\n pickerAction: 'cancel'\n });\n });\n const handleSetToday = useEventCallback(() => {\n updateDate({\n value: valueManager.getTodayValue(utils, timezone, valueType),\n name: 'setValueFromAction',\n pickerAction: 'today'\n });\n });\n const handleOpen = useEventCallback(event => {\n event.preventDefault();\n setIsOpen(true);\n });\n const handleClose = useEventCallback(event => {\n event?.preventDefault();\n setIsOpen(false);\n });\n const handleChange = useEventCallback((newValue, selectionState = 'partial') => updateDate({\n name: 'setValueFromView',\n value: newValue,\n selectionState\n }));\n const handleSelectShortcut = useEventCallback((newValue, changeImportance, shortcut) => updateDate({\n name: 'setValueFromShortcut',\n value: newValue,\n changeImportance,\n shortcut\n }));\n const handleChangeFromField = useEventCallback((newValue, context) => updateDate({\n name: 'setValueFromField',\n value: newValue,\n context\n }));\n const actions = {\n onClear: handleClear,\n onAccept: handleAccept,\n onDismiss: handleDismiss,\n onCancel: handleCancel,\n onSetToday: handleSetToday,\n onOpen: handleOpen,\n onClose: handleClose\n };\n const fieldResponse = {\n value: dateState.draft,\n onChange: handleChangeFromField\n };\n const viewValue = React.useMemo(() => valueManager.cleanValue(utils, dateState.draft), [utils, valueManager, dateState.draft]);\n const viewResponse = {\n value: viewValue,\n onChange: handleChange,\n onClose: handleClose,\n open: isOpen\n };\n const isValid = testedValue => {\n const error = validator({\n adapter,\n value: testedValue,\n props: _extends({}, props, {\n value: testedValue,\n timezone\n })\n });\n return !valueManager.hasError(error);\n };\n const layoutResponse = _extends({}, actions, {\n value: viewValue,\n onChange: handleChange,\n onSelectShortcut: handleSelectShortcut,\n isValid\n });\n return {\n open: isOpen,\n fieldProps: fieldResponse,\n viewProps: viewResponse,\n layoutProps: layoutResponse,\n actions\n };\n};","import * as React from 'react';\nexport const useOpenState = ({\n open,\n onOpen,\n onClose\n}) => {\n const isControllingOpenProp = React.useRef(typeof open === 'boolean').current;\n const [openState, setIsOpenState] = React.useState(false);\n\n // It is required to update inner state in useEffect in order to avoid situation when\n // Our component is not mounted yet, but `open` state is set to `true` (for example initially opened)\n React.useEffect(() => {\n if (isControllingOpenProp) {\n if (typeof open !== 'boolean') {\n throw new Error('You must not mix controlling and uncontrolled mode for `open` prop');\n }\n setIsOpenState(open);\n }\n }, [isControllingOpenProp, open]);\n const setIsOpen = React.useCallback(newIsOpen => {\n if (!isControllingOpenProp) {\n setIsOpenState(newIsOpen);\n }\n if (newIsOpen && onOpen) {\n onOpen();\n }\n if (!newIsOpen && onClose) {\n onClose();\n }\n }, [isControllingOpenProp, onOpen, onClose]);\n return {\n isOpen: openState,\n setIsOpen\n };\n};","import * as React from 'react';\nimport useEventCallback from '@mui/utils/useEventCallback';\nimport { unstable_useControlled as useControlled } from '@mui/utils';\nlet warnedOnceNotValidView = false;\nexport function useViews({\n onChange,\n onViewChange,\n openTo,\n view: inView,\n views,\n autoFocus,\n focusedView: inFocusedView,\n onFocusedViewChange\n}) {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnceNotValidView) {\n if (inView != null && !views.includes(inView)) {\n console.warn(`MUI X: \\`view=\"${inView}\"\\` is not a valid prop.`, `It must be an element of \\`views=[\"${views.join('\", \"')}\"]\\`.`);\n warnedOnceNotValidView = true;\n }\n if (inView == null && openTo != null && !views.includes(openTo)) {\n console.warn(`MUI X: \\`openTo=\"${openTo}\"\\` is not a valid prop.`, `It must be an element of \\`views=[\"${views.join('\", \"')}\"]\\`.`);\n warnedOnceNotValidView = true;\n }\n }\n }\n const previousOpenTo = React.useRef(openTo);\n const previousViews = React.useRef(views);\n const defaultView = React.useRef(views.includes(openTo) ? openTo : views[0]);\n const [view, setView] = useControlled({\n name: 'useViews',\n state: 'view',\n controlled: inView,\n default: defaultView.current\n });\n const defaultFocusedView = React.useRef(autoFocus ? view : null);\n const [focusedView, setFocusedView] = useControlled({\n name: 'useViews',\n state: 'focusedView',\n controlled: inFocusedView,\n default: defaultFocusedView.current\n });\n React.useEffect(() => {\n // Update the current view when `openTo` or `views` props change\n if (previousOpenTo.current && previousOpenTo.current !== openTo || previousViews.current && previousViews.current.some(previousView => !views.includes(previousView))) {\n setView(views.includes(openTo) ? openTo : views[0]);\n previousViews.current = views;\n previousOpenTo.current = openTo;\n }\n }, [openTo, setView, view, views]);\n const viewIndex = views.indexOf(view);\n const previousView = views[viewIndex - 1] ?? null;\n const nextView = views[viewIndex + 1] ?? null;\n const handleFocusedViewChange = useEventCallback((viewToFocus, hasFocus) => {\n if (hasFocus) {\n // Focus event\n setFocusedView(viewToFocus);\n } else {\n // Blur event\n setFocusedView(prevFocusedView => viewToFocus === prevFocusedView ? null : prevFocusedView // If false the blur is due to view switching\n );\n }\n onFocusedViewChange?.(viewToFocus, hasFocus);\n });\n const handleChangeView = useEventCallback(newView => {\n // always keep the focused view in sync\n handleFocusedViewChange(newView, true);\n if (newView === view) {\n return;\n }\n setView(newView);\n if (onViewChange) {\n onViewChange(newView);\n }\n });\n const goToNextView = useEventCallback(() => {\n if (nextView) {\n handleChangeView(nextView);\n }\n });\n const setValueAndGoToNextView = useEventCallback((value, currentViewSelectionState, selectedView) => {\n const isSelectionFinishedOnCurrentView = currentViewSelectionState === 'finish';\n const hasMoreViews = selectedView ?\n // handles case like `DateTimePicker`, where a view might return a `finish` selection state\n // but when it's not the final view given all `views` -> overall selection state should be `partial`.\n views.indexOf(selectedView) < views.length - 1 : Boolean(nextView);\n const globalSelectionState = isSelectionFinishedOnCurrentView && hasMoreViews ? 'partial' : currentViewSelectionState;\n onChange(value, globalSelectionState, selectedView);\n // Detects if the selected view is not the active one.\n // Can happen if multiple views are displayed, like in `DesktopDateTimePicker` or `MultiSectionDigitalClock`.\n if (selectedView && selectedView !== view) {\n const nextViewAfterSelected = views[views.indexOf(selectedView) + 1];\n if (nextViewAfterSelected) {\n // move to next view after the selected one\n handleChangeView(nextViewAfterSelected);\n }\n } else if (isSelectionFinishedOnCurrentView) {\n goToNextView();\n }\n });\n return {\n view,\n setView: handleChangeView,\n focusedView,\n setFocusedView: handleFocusedViewChange,\n nextView,\n previousView,\n // Always return up-to-date default view instead of the initial one (i.e. defaultView.current)\n defaultView: views.includes(openTo) ? openTo : views[0],\n goToNextView,\n setValueAndGoToNextView\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"sx\"];\nimport * as React from 'react';\nimport useEnhancedEffect from '@mui/utils/useEnhancedEffect';\nimport useEventCallback from '@mui/utils/useEventCallback';\nimport { useViews } from '../useViews';\nimport { isTimeView } from '../../utils/time-utils';\n\n/**\n * Props used to handle the views that are common to all pickers.\n */\n\n/**\n * Props used to handle the views of the pickers.\n */\n\n/**\n * Props used to handle the value of the pickers.\n */\n\n/**\n * Manage the views of all the pickers:\n * - Handles the view switch\n * - Handles the switch between UI views and field views\n * - Handles the focus management when switching views\n */\nexport const usePickerViews = ({\n props,\n propsFromPickerValue,\n additionalViewProps,\n autoFocusView,\n rendererInterceptor,\n fieldRef\n}) => {\n const {\n onChange,\n open,\n onClose\n } = propsFromPickerValue;\n const {\n views,\n openTo,\n onViewChange,\n disableOpenPicker,\n viewRenderers,\n timezone\n } = props;\n const propsToForwardToView = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n view,\n setView,\n defaultView,\n focusedView,\n setFocusedView,\n setValueAndGoToNextView\n } = useViews({\n view: undefined,\n views,\n openTo,\n onChange,\n onViewChange,\n autoFocus: autoFocusView\n });\n const {\n hasUIView,\n viewModeLookup\n } = React.useMemo(() => views.reduce((acc, viewForReduce) => {\n let viewMode;\n if (disableOpenPicker) {\n viewMode = 'field';\n } else if (viewRenderers[viewForReduce] != null) {\n viewMode = 'UI';\n } else {\n viewMode = 'field';\n }\n acc.viewModeLookup[viewForReduce] = viewMode;\n if (viewMode === 'UI') {\n acc.hasUIView = true;\n }\n return acc;\n }, {\n hasUIView: false,\n viewModeLookup: {}\n }), [disableOpenPicker, viewRenderers, views]);\n const timeViewsCount = React.useMemo(() => views.reduce((acc, viewForReduce) => {\n if (viewRenderers[viewForReduce] != null && isTimeView(viewForReduce)) {\n return acc + 1;\n }\n return acc;\n }, 0), [viewRenderers, views]);\n const currentViewMode = viewModeLookup[view];\n const shouldRestoreFocus = useEventCallback(() => currentViewMode === 'UI');\n const [popperView, setPopperView] = React.useState(currentViewMode === 'UI' ? view : null);\n if (popperView !== view && viewModeLookup[view] === 'UI') {\n setPopperView(view);\n }\n useEnhancedEffect(() => {\n // Handle case of `DateTimePicker` without time renderers\n if (currentViewMode === 'field' && open) {\n onClose();\n setTimeout(() => {\n // focusing the input before the range selection is done\n // calling it outside of timeout results in an inconsistent behavior between Safari And Chrome\n fieldRef?.current?.focusField(view);\n });\n }\n }, [view]); // eslint-disable-line react-hooks/exhaustive-deps\n\n useEnhancedEffect(() => {\n if (!open) {\n return;\n }\n let newView = view;\n\n // If the current view is a field view, go to the last popper view\n if (currentViewMode === 'field' && popperView != null) {\n newView = popperView;\n }\n\n // If the current view is not the default view and both are UI views\n if (newView !== defaultView && viewModeLookup[newView] === 'UI' && viewModeLookup[defaultView] === 'UI') {\n newView = defaultView;\n }\n if (newView !== view) {\n setView(newView);\n }\n setFocusedView(newView, true);\n }, [open]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const layoutProps = {\n views,\n view: popperView,\n onViewChange: setView\n };\n return {\n hasUIView,\n shouldRestoreFocus,\n layoutProps,\n renderCurrentView: () => {\n if (popperView == null) {\n return null;\n }\n const renderer = viewRenderers[popperView];\n if (renderer == null) {\n return null;\n }\n const rendererProps = _extends({}, propsToForwardToView, additionalViewProps, propsFromPickerValue, {\n views,\n timezone,\n onChange: setValueAndGoToNextView,\n view: popperView,\n onViewChange: setView,\n focusedView,\n onFocusedViewChange: setFocusedView,\n showViewSwitcher: timeViewsCount > 1,\n timeViewsCount\n });\n if (rendererInterceptor) {\n return rendererInterceptor(viewRenderers, popperView, rendererProps);\n }\n return renderer(rendererProps);\n }\n };\n};","import * as React from 'react';\nimport { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';\nimport { arrayIncludes } from '../utils/utils';\nfunction getOrientation() {\n if (typeof window === 'undefined') {\n return 'portrait';\n }\n if (window.screen && window.screen.orientation && window.screen.orientation.angle) {\n return Math.abs(window.screen.orientation.angle) === 90 ? 'landscape' : 'portrait';\n }\n\n // Support IOS safari\n if (window.orientation) {\n return Math.abs(Number(window.orientation)) === 90 ? 'landscape' : 'portrait';\n }\n return 'portrait';\n}\nexport const useIsLandscape = (views, customOrientation) => {\n const [orientation, setOrientation] = React.useState(getOrientation);\n useEnhancedEffect(() => {\n const eventHandler = () => {\n setOrientation(getOrientation());\n };\n window.addEventListener('orientationchange', eventHandler);\n return () => {\n window.removeEventListener('orientationchange', eventHandler);\n };\n }, []);\n if (arrayIncludes(views, ['hours', 'minutes', 'seconds'])) {\n // could not display 13:34:44 in landscape mode\n return false;\n }\n const orientationToUse = customOrientation || orientation;\n return orientationToUse === 'landscape';\n};","import { usePickerValue } from './usePickerValue';\nimport { usePickerViews } from './usePickerViews';\nimport { usePickerLayoutProps } from './usePickerLayoutProps';\nimport { buildWarning } from '../../utils/warning';\nconst warnRenderInputIsDefined = buildWarning(['The `renderInput` prop has been removed in version 6.0 of the Date and Time Pickers.', 'You can replace it with the `textField` component slot in most cases.', 'For more information, please have a look at the migration guide (https://mui.com/x/migration/migration-pickers-v5/#input-renderer-required-in-v5).']);\nexport const usePicker = ({\n props,\n valueManager,\n valueType,\n wrapperVariant,\n additionalViewProps,\n validator,\n autoFocusView,\n rendererInterceptor,\n fieldRef\n}) => {\n if (process.env.NODE_ENV !== 'production') {\n if (props.renderInput != null) {\n warnRenderInputIsDefined();\n }\n }\n const pickerValueResponse = usePickerValue({\n props,\n valueManager,\n valueType,\n wrapperVariant,\n validator\n });\n const pickerViewsResponse = usePickerViews({\n props,\n additionalViewProps,\n autoFocusView,\n fieldRef,\n propsFromPickerValue: pickerValueResponse.viewProps,\n rendererInterceptor\n });\n const pickerLayoutResponse = usePickerLayoutProps({\n props,\n wrapperVariant,\n propsFromPickerValue: pickerValueResponse.layoutProps,\n propsFromPickerViews: pickerViewsResponse.layoutProps\n });\n return {\n // Picker value\n open: pickerValueResponse.open,\n actions: pickerValueResponse.actions,\n fieldProps: pickerValueResponse.fieldProps,\n // Picker views\n renderCurrentView: pickerViewsResponse.renderCurrentView,\n hasUIView: pickerViewsResponse.hasUIView,\n shouldRestoreFocus: pickerViewsResponse.shouldRestoreFocus,\n // Picker layout\n layoutProps: pickerLayoutResponse.layoutProps\n };\n};","export const buildDeprecatedPropsWarning = message => {\n let alreadyWarned = false;\n if (process.env.NODE_ENV === 'production') {\n return () => {};\n }\n const cleanMessage = Array.isArray(message) ? message.join('\\n') : message;\n return deprecatedProps => {\n const deprecatedKeys = Object.entries(deprecatedProps).filter(([, value]) => value !== undefined).map(([key]) => `- ${key}`);\n if (!alreadyWarned && deprecatedKeys.length > 0) {\n alreadyWarned = true;\n console.warn([cleanMessage, 'deprecated props observed:', ...deprecatedKeys].join('\\n'));\n }\n };\n};\nexport const buildWarning = (message, gravity = 'warning') => {\n let alreadyWarned = false;\n const cleanMessage = Array.isArray(message) ? message.join('\\n') : message;\n return () => {\n if (!alreadyWarned) {\n alreadyWarned = true;\n if (gravity === 'error') {\n console.error(cleanMessage);\n } else {\n console.warn(cleanMessage);\n }\n }\n };\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { useIsLandscape } from '../useIsLandscape';\n\n/**\n * Props used to create the layout of the views.\n * Those props are exposed on all the pickers.\n */\n\n/**\n * Prepare the props for the view layout (managed by `PickersLayout`)\n */\nexport const usePickerLayoutProps = ({\n props,\n propsFromPickerValue,\n propsFromPickerViews,\n wrapperVariant\n}) => {\n const {\n orientation\n } = props;\n const isLandscape = useIsLandscape(propsFromPickerViews.views, orientation);\n const layoutProps = _extends({}, propsFromPickerViews, propsFromPickerValue, {\n isLandscape,\n wrapperVariant,\n disabled: props.disabled,\n readOnly: props.readOnly\n });\n return {\n layoutProps\n };\n};","import generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nexport function getPickersLayoutUtilityClass(slot) {\n return generateUtilityClass('MuiPickersLayout', slot);\n}\nexport const pickersLayoutClasses = generateUtilityClasses('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar', 'tabs', 'shortcuts']);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"onAccept\", \"onClear\", \"onCancel\", \"onSetToday\", \"actions\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '@mui/material/Button';\nimport DialogActions from '@mui/material/DialogActions';\nimport { useLocaleText } from '../internals/hooks/useUtils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Demos:\n *\n * - [Custom slots and subcomponents](https://mui.com/x/react-date-pickers/custom-components/)\n * - [Custom layout](https://mui.com/x/react-date-pickers/custom-layout/)\n *\n * API:\n *\n * - [PickersActionBar API](https://mui.com/x/api/date-pickers/pickers-action-bar/)\n */\nfunction PickersActionBar(props) {\n const {\n onAccept,\n onClear,\n onCancel,\n onSetToday,\n actions\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const localeText = useLocaleText();\n if (actions == null || actions.length === 0) {\n return null;\n }\n const buttons = actions?.map(actionType => {\n switch (actionType) {\n case 'clear':\n return /*#__PURE__*/_jsx(Button, {\n onClick: onClear,\n children: localeText.clearButtonLabel\n }, actionType);\n case 'cancel':\n return /*#__PURE__*/_jsx(Button, {\n onClick: onCancel,\n children: localeText.cancelButtonLabel\n }, actionType);\n case 'accept':\n return /*#__PURE__*/_jsx(Button, {\n onClick: onAccept,\n children: localeText.okButtonLabel\n }, actionType);\n case 'today':\n return /*#__PURE__*/_jsx(Button, {\n onClick: onSetToday,\n children: localeText.todayButtonLabel\n }, actionType);\n default:\n return null;\n }\n });\n return /*#__PURE__*/_jsx(DialogActions, _extends({}, other, {\n children: buttons\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? PickersActionBar.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Ordered array of actions to display.\n * If empty, does not display that action bar.\n * @default `['cancel', 'accept']` for mobile and `[]` for desktop\n */\n actions: PropTypes.arrayOf(PropTypes.oneOf(['accept', 'cancel', 'clear', 'today']).isRequired),\n /**\n * If `true`, the actions do not have additional margin.\n * @default false\n */\n disableSpacing: PropTypes.bool,\n onAccept: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n onClear: PropTypes.func.isRequired,\n onSetToday: PropTypes.func.isRequired,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { PickersActionBar };","export const DAY_SIZE = 36;\nexport const DAY_MARGIN = 2;\nexport const DIALOG_WIDTH = 320;\nexport const MAX_CALENDAR_HEIGHT = 280;\nexport const VIEW_HEIGHT = 336;\nexport const DIGITAL_CLOCK_VIEW_HEIGHT = 232;\nexport const MULTI_SECTION_CLOCK_SECTION_WIDTH = 48;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"items\", \"changeImportance\", \"isLandscape\", \"onChange\", \"isValid\"],\n _excluded2 = [\"getValue\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport List from '@mui/material/List';\nimport ListItem from '@mui/material/ListItem';\nimport Chip from '@mui/material/Chip';\nimport { VIEW_HEIGHT } from '../internals/constants/dimensions';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Demos:\n *\n * - [Shortcuts](https://mui.com/x/react-date-pickers/shortcuts/)\n *\n * API:\n *\n * - [PickersShortcuts API](https://mui.com/x/api/date-pickers/pickers-shortcuts/)\n */\nfunction PickersShortcuts(props) {\n const {\n items,\n changeImportance = 'accept',\n onChange,\n isValid\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n if (items == null || items.length === 0) {\n return null;\n }\n const resolvedItems = items.map(_ref => {\n let {\n getValue\n } = _ref,\n item = _objectWithoutPropertiesLoose(_ref, _excluded2);\n const newValue = getValue({\n isValid\n });\n return {\n label: item.label,\n onClick: () => {\n onChange(newValue, changeImportance, item);\n },\n disabled: !isValid(newValue)\n };\n });\n return /*#__PURE__*/_jsx(List, _extends({\n dense: true,\n sx: [{\n maxHeight: VIEW_HEIGHT,\n maxWidth: 200,\n overflow: 'auto'\n }, ...(Array.isArray(other.sx) ? other.sx : [other.sx])]\n }, other, {\n children: resolvedItems.map(item => {\n return /*#__PURE__*/_jsx(ListItem, {\n children: /*#__PURE__*/_jsx(Chip, _extends({}, item))\n }, item.label);\n })\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? PickersShortcuts.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Importance of the change when picking a shortcut:\n * - \"accept\": fires `onChange`, fires `onAccept` and closes the picker.\n * - \"set\": fires `onChange` but do not fire `onAccept` and does not close the picker.\n * @default \"accept\"\n */\n changeImportance: PropTypes.oneOf(['accept', 'set']),\n className: PropTypes.string,\n component: PropTypes.elementType,\n /**\n * If `true`, compact vertical padding designed for keyboard and mouse input is used for\n * the list and list items.\n * The prop is available to descendant components as the `dense` context.\n * @default false\n */\n dense: PropTypes.bool,\n /**\n * If `true`, vertical padding is removed from the list.\n * @default false\n */\n disablePadding: PropTypes.bool,\n isLandscape: PropTypes.bool.isRequired,\n isValid: PropTypes.func.isRequired,\n /**\n * Ordered array of shortcuts to display.\n * If empty, does not display the shortcuts.\n * @default []\n */\n items: PropTypes.arrayOf(PropTypes.shape({\n getValue: PropTypes.func.isRequired,\n label: PropTypes.string.isRequired\n })),\n onChange: PropTypes.func.isRequired,\n style: PropTypes.object,\n /**\n * The content of the subheader, normally `ListSubheader`.\n */\n subheader: PropTypes.node,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { PickersShortcuts };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useSlotProps } from '@mui/base/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/utils';\nimport { PickersActionBar } from '../PickersActionBar';\nimport { getPickersLayoutUtilityClass } from './pickersLayoutClasses';\nimport { PickersShortcuts } from '../PickersShortcuts';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction toolbarHasView(toolbarProps) {\n return toolbarProps.view !== null;\n}\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n isLandscape\n } = ownerState;\n const slots = {\n root: ['root', isLandscape && 'landscape'],\n contentWrapper: ['contentWrapper'],\n toolbar: ['toolbar'],\n actionBar: ['actionBar'],\n tabs: ['tabs'],\n landscape: ['landscape'],\n shortcuts: ['shortcuts']\n };\n return composeClasses(slots, getPickersLayoutUtilityClass, classes);\n};\nconst usePickerLayout = props => {\n const {\n wrapperVariant,\n onAccept,\n onClear,\n onCancel,\n onSetToday,\n view,\n views,\n onViewChange,\n value,\n onChange,\n onSelectShortcut,\n isValid,\n isLandscape,\n disabled,\n readOnly,\n children,\n slots,\n slotProps\n // TODO: Remove this \"as\" hack. It get introduced to mark `value` prop in PickersLayoutProps as not required.\n // The true type should be\n // - For pickers value: TDate | null\n // - For range pickers value: [TDate | null, TDate | null]\n } = props;\n const classes = useUtilityClasses(props);\n\n // Action bar\n\n const ActionBar = slots?.actionBar ?? PickersActionBar;\n const actionBarProps = useSlotProps({\n elementType: ActionBar,\n externalSlotProps: slotProps?.actionBar,\n additionalProps: {\n onAccept,\n onClear,\n onCancel,\n onSetToday,\n actions: wrapperVariant === 'desktop' ? [] : ['cancel', 'accept'],\n className: classes.actionBar\n },\n ownerState: _extends({}, props, {\n wrapperVariant\n })\n });\n const actionBar = /*#__PURE__*/_jsx(ActionBar, _extends({}, actionBarProps));\n\n // Toolbar\n\n const Toolbar = slots?.toolbar;\n const toolbarProps = useSlotProps({\n elementType: Toolbar,\n externalSlotProps: slotProps?.toolbar,\n additionalProps: {\n isLandscape,\n onChange,\n value,\n view,\n onViewChange,\n views,\n disabled,\n readOnly,\n className: classes.toolbar\n },\n ownerState: _extends({}, props, {\n wrapperVariant\n })\n });\n const toolbar = toolbarHasView(toolbarProps) && !!Toolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, toolbarProps)) : null;\n\n // Content\n\n const content = children;\n\n // Tabs\n\n const Tabs = slots?.tabs;\n const tabs = view && Tabs ? /*#__PURE__*/_jsx(Tabs, _extends({\n view: view,\n onViewChange: onViewChange,\n className: classes.tabs\n }, slotProps?.tabs)) : null;\n\n // Shortcuts\n\n const Shortcuts = slots?.shortcuts ?? PickersShortcuts;\n const shortcutsProps = useSlotProps({\n elementType: Shortcuts,\n externalSlotProps: slotProps?.shortcuts,\n additionalProps: {\n isValid,\n isLandscape,\n onChange: onSelectShortcut,\n className: classes.shortcuts\n },\n ownerState: {\n isValid,\n isLandscape,\n onChange: onSelectShortcut,\n className: classes.shortcuts,\n wrapperVariant\n }\n });\n const shortcuts = view && !!Shortcuts ? /*#__PURE__*/_jsx(Shortcuts, _extends({}, shortcutsProps)) : null;\n return {\n toolbar,\n content,\n tabs,\n actionBar,\n shortcuts\n };\n};\nexport default usePickerLayout;","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { unstable_composeClasses as composeClasses } from '@mui/utils';\nimport { pickersLayoutClasses, getPickersLayoutUtilityClass } from './pickersLayoutClasses';\nimport usePickerLayout from './usePickerLayout';\nimport { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n isLandscape,\n classes\n } = ownerState;\n const slots = {\n root: ['root', isLandscape && 'landscape'],\n contentWrapper: ['contentWrapper']\n };\n return composeClasses(slots, getPickersLayoutUtilityClass, classes);\n};\nconst PickersLayoutRoot = styled('div', {\n name: 'MuiPickersLayout',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})(({\n theme\n}) => ({\n display: 'grid',\n gridAutoColumns: 'max-content auto max-content',\n gridAutoRows: 'max-content auto max-content',\n [`& .${pickersLayoutClasses.actionBar}`]: {\n gridColumn: '1 / 4',\n gridRow: 3\n },\n variants: [{\n props: {\n isLandscape: true\n },\n style: {\n [`& .${pickersLayoutClasses.toolbar}`]: {\n gridColumn: theme.direction === 'rtl' ? 3 : 1,\n gridRow: '2 / 3'\n },\n [`.${pickersLayoutClasses.shortcuts}`]: {\n gridColumn: '2 / 4',\n gridRow: 1\n }\n }\n }, {\n props: {\n isLandscape: false\n },\n style: {\n [`& .${pickersLayoutClasses.toolbar}`]: {\n gridColumn: '2 / 4',\n gridRow: 1\n },\n [`& .${pickersLayoutClasses.shortcuts}`]: {\n gridColumn: theme.direction === 'rtl' ? 3 : 1,\n gridRow: '2 / 3'\n }\n }\n }]\n}));\nPickersLayoutRoot.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n as: PropTypes.elementType,\n ownerState: PropTypes.shape({\n isLandscape: PropTypes.bool.isRequired\n }).isRequired,\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n};\nexport { PickersLayoutRoot };\nexport const PickersLayoutContentWrapper = styled('div', {\n name: 'MuiPickersLayout',\n slot: 'ContentWrapper',\n overridesResolver: (props, styles) => styles.contentWrapper\n})({\n gridColumn: 2,\n gridRow: 2,\n display: 'flex',\n flexDirection: 'column'\n});\n\n/**\n * Demos:\n *\n * - [Custom layout](https://mui.com/x/react-date-pickers/custom-layout/)\n *\n * API:\n *\n * - [PickersLayout API](https://mui.com/x/api/date-pickers/pickers-layout/)\n */\nconst PickersLayout = function PickersLayout(inProps) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersLayout'\n });\n const {\n toolbar,\n content,\n tabs,\n actionBar,\n shortcuts\n } = usePickerLayout(props);\n const {\n sx,\n className,\n isLandscape,\n ref,\n wrapperVariant\n } = props;\n const ownerState = props;\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(PickersLayoutRoot, {\n ref: ref,\n sx: sx,\n className: clsx(className, classes.root),\n ownerState: ownerState,\n children: [isLandscape ? shortcuts : toolbar, isLandscape ? toolbar : shortcuts, /*#__PURE__*/_jsx(PickersLayoutContentWrapper, {\n className: classes.contentWrapper,\n children: wrapperVariant === 'desktop' ? /*#__PURE__*/_jsxs(React.Fragment, {\n children: [content, tabs]\n }) : /*#__PURE__*/_jsxs(React.Fragment, {\n children: [tabs, content]\n })\n }), actionBar]\n });\n};\nprocess.env.NODE_ENV !== \"production\" ? PickersLayout.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n className: PropTypes.string,\n disabled: PropTypes.bool,\n isLandscape: PropTypes.bool.isRequired,\n isValid: PropTypes.func.isRequired,\n onAccept: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n onChange: PropTypes.func.isRequired,\n onClear: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n onDismiss: PropTypes.func.isRequired,\n onOpen: PropTypes.func.isRequired,\n onSelectShortcut: PropTypes.func.isRequired,\n onSetToday: PropTypes.func.isRequired,\n onViewChange: PropTypes.func.isRequired,\n /**\n * Force rendering in particular orientation.\n */\n orientation: PropTypes.oneOf(['landscape', 'portrait']),\n readOnly: PropTypes.bool,\n /**\n * The props used for each component slot.\n * @default {}\n */\n slotProps: PropTypes.object,\n /**\n * Overridable component slots.\n * @default {}\n */\n slots: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n value: PropTypes.any,\n view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),\n views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired).isRequired,\n wrapperVariant: PropTypes.oneOf(['desktop', 'mobile'])\n} : void 0;\nexport { PickersLayout };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"props\", \"getOpenDialogAriaText\"],\n _excluded2 = [\"ownerState\"],\n _excluded3 = [\"ownerState\"];\nimport * as React from 'react';\nimport { useSlotProps } from '@mui/base/utils';\nimport MuiInputAdornment from '@mui/material/InputAdornment';\nimport IconButton from '@mui/material/IconButton';\nimport useForkRef from '@mui/utils/useForkRef';\nimport useId from '@mui/utils/useId';\nimport { PickersPopper } from '../../components/PickersPopper';\nimport { useUtils } from '../useUtils';\nimport { usePicker } from '../usePicker';\nimport { LocalizationProvider } from '../../../LocalizationProvider';\nimport { PickersLayout } from '../../../PickersLayout';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * Hook managing all the single-date desktop pickers:\n * - DesktopDatePicker\n * - DesktopDateTimePicker\n * - DesktopTimePicker\n */\nexport const useDesktopPicker = _ref => {\n let {\n props,\n getOpenDialogAriaText\n } = _ref,\n pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);\n const {\n slots,\n slotProps: innerSlotProps,\n className,\n sx,\n format,\n formatDensity,\n enableAccessibleFieldDOMStructure,\n selectedSections,\n onSelectedSectionsChange,\n timezone,\n name,\n label,\n inputRef,\n readOnly,\n disabled,\n autoFocus,\n localeText,\n reduceAnimations\n } = props;\n const utils = useUtils();\n const containerRef = React.useRef(null);\n const fieldRef = React.useRef(null);\n const labelId = useId();\n const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;\n const {\n open,\n actions,\n hasUIView,\n layoutProps,\n renderCurrentView,\n shouldRestoreFocus,\n fieldProps: pickerFieldProps\n } = usePicker(_extends({}, pickerParams, {\n props,\n fieldRef,\n autoFocusView: true,\n additionalViewProps: {},\n wrapperVariant: 'desktop'\n }));\n const InputAdornment = slots.inputAdornment ?? MuiInputAdornment;\n const _useSlotProps = useSlotProps({\n elementType: InputAdornment,\n externalSlotProps: innerSlotProps?.inputAdornment,\n additionalProps: {\n position: 'end'\n },\n ownerState: props\n }),\n inputAdornmentProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);\n const OpenPickerButton = slots.openPickerButton ?? IconButton;\n const _useSlotProps2 = useSlotProps({\n elementType: OpenPickerButton,\n externalSlotProps: innerSlotProps?.openPickerButton,\n additionalProps: {\n disabled: disabled || readOnly,\n onClick: open ? actions.onClose : actions.onOpen,\n 'aria-label': getOpenDialogAriaText(pickerFieldProps.value, utils),\n edge: inputAdornmentProps.position\n },\n ownerState: props\n }),\n openPickerButtonProps = _objectWithoutPropertiesLoose(_useSlotProps2, _excluded3);\n const OpenPickerIcon = slots.openPickerIcon;\n const Field = slots.field;\n const fieldProps = useSlotProps({\n elementType: Field,\n externalSlotProps: innerSlotProps?.field,\n additionalProps: _extends({}, pickerFieldProps, isToolbarHidden && {\n id: labelId\n }, {\n readOnly,\n disabled,\n className,\n sx,\n format,\n formatDensity,\n enableAccessibleFieldDOMStructure,\n selectedSections,\n onSelectedSectionsChange,\n timezone,\n label,\n name,\n autoFocus: autoFocus && !props.open,\n focused: open ? true : undefined\n }, inputRef ? {\n inputRef\n } : {}),\n ownerState: props\n });\n\n // TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged\n if (hasUIView) {\n fieldProps.InputProps = _extends({}, fieldProps.InputProps, {\n ref: containerRef,\n [`${inputAdornmentProps.position}Adornment`]: /*#__PURE__*/_jsx(InputAdornment, _extends({}, inputAdornmentProps, {\n children: /*#__PURE__*/_jsx(OpenPickerButton, _extends({}, openPickerButtonProps, {\n children: /*#__PURE__*/_jsx(OpenPickerIcon, _extends({}, innerSlotProps?.openPickerIcon))\n }))\n }))\n });\n }\n const slotsForField = _extends({\n textField: slots.textField,\n clearIcon: slots.clearIcon,\n clearButton: slots.clearButton\n }, fieldProps.slots);\n const Layout = slots.layout ?? PickersLayout;\n let labelledById = labelId;\n if (isToolbarHidden) {\n if (label) {\n labelledById = `${labelId}-label`;\n } else {\n labelledById = undefined;\n }\n }\n const slotProps = _extends({}, innerSlotProps, {\n toolbar: _extends({}, innerSlotProps?.toolbar, {\n titleId: labelId\n }),\n popper: _extends({\n 'aria-labelledby': labelledById\n }, innerSlotProps?.popper)\n });\n const handleFieldRef = useForkRef(fieldRef, fieldProps.unstableFieldRef);\n const renderPicker = () => /*#__PURE__*/_jsxs(LocalizationProvider, {\n localeText: localeText,\n children: [/*#__PURE__*/_jsx(Field, _extends({}, fieldProps, {\n slots: slotsForField,\n slotProps: slotProps,\n unstableFieldRef: handleFieldRef\n })), /*#__PURE__*/_jsx(PickersPopper, _extends({\n role: \"dialog\",\n placement: \"bottom-start\",\n anchorEl: containerRef.current\n }, actions, {\n open: open,\n slots: slots,\n slotProps: slotProps,\n shouldRestoreFocus: shouldRestoreFocus,\n reduceAnimations: reduceAnimations,\n children: /*#__PURE__*/_jsx(Layout, _extends({}, layoutProps, slotProps?.layout, {\n slots: slots,\n slotProps: slotProps,\n children: renderCurrentView()\n }))\n }))]\n });\n return {\n renderPicker\n };\n};","import { createSvgIcon } from '@mui/material/utils';\nimport * as React from 'react';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ArrowDropDownIcon = createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M7 10l5 5 5-5z\"\n}), 'ArrowDropDown');\n\n/**\n * @ignore - internal component.\n */\nexport const ArrowLeftIcon = createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z\"\n}), 'ArrowLeft');\n\n/**\n * @ignore - internal component.\n */\nexport const ArrowRightIcon = createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z\"\n}), 'ArrowRight');\n\n/**\n * @ignore - internal component.\n */\nexport const CalendarIcon = createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z\"\n}), 'Calendar');\n\n/**\n * @ignore - internal component.\n */\nexport const ClockIcon = createSvgIcon( /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(\"path\", {\n d: \"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"\n }), /*#__PURE__*/_jsx(\"path\", {\n d: \"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z\"\n })]\n}), 'Clock');\n\n/**\n * @ignore - internal component.\n */\nexport const DateRangeIcon = createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z\"\n}), 'DateRange');\n\n/**\n * @ignore - internal component.\n */\nexport const TimeIcon = createSvgIcon( /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(\"path\", {\n d: \"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"\n }), /*#__PURE__*/_jsx(\"path\", {\n d: \"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z\"\n })]\n}), 'Time');\n\n/**\n * @ignore - internal component.\n */\nexport const ClearIcon = createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Clear');","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { applyLocalizedDigits, cleanLeadingZeros, doesSectionFormatHaveLeadingZeros, getDateSectionConfigFromFormatToken, removeLocalizedDigits } from './useField.utils';\nconst expandFormat = ({\n utils,\n format\n}) => {\n // Expand the provided format\n let formatExpansionOverflow = 10;\n let prevFormat = format;\n let nextFormat = utils.expandFormat(format);\n while (nextFormat !== prevFormat) {\n prevFormat = nextFormat;\n nextFormat = utils.expandFormat(prevFormat);\n formatExpansionOverflow -= 1;\n if (formatExpansionOverflow < 0) {\n throw new Error('MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.');\n }\n }\n return nextFormat;\n};\nconst getEscapedPartsFromFormat = ({\n utils,\n expandedFormat\n}) => {\n const escapedParts = [];\n const {\n start: startChar,\n end: endChar\n } = utils.escapedCharacters;\n const regExp = new RegExp(`(\\\\${startChar}[^\\\\${endChar}]*\\\\${endChar})+`, 'g');\n let match = null;\n // eslint-disable-next-line no-cond-assign\n while (match = regExp.exec(expandedFormat)) {\n escapedParts.push({\n start: match.index,\n end: regExp.lastIndex - 1\n });\n }\n return escapedParts;\n};\nconst getSectionPlaceholder = (utils, timezone, localeText, sectionConfig, sectionFormat) => {\n switch (sectionConfig.type) {\n case 'year':\n {\n return localeText.fieldYearPlaceholder({\n digitAmount: utils.formatByString(utils.date(undefined, timezone), sectionFormat).length,\n format: sectionFormat\n });\n }\n case 'month':\n {\n return localeText.fieldMonthPlaceholder({\n contentType: sectionConfig.contentType,\n format: sectionFormat\n });\n }\n case 'day':\n {\n return localeText.fieldDayPlaceholder({\n format: sectionFormat\n });\n }\n case 'weekDay':\n {\n return localeText.fieldWeekDayPlaceholder({\n contentType: sectionConfig.contentType,\n format: sectionFormat\n });\n }\n case 'hours':\n {\n return localeText.fieldHoursPlaceholder({\n format: sectionFormat\n });\n }\n case 'minutes':\n {\n return localeText.fieldMinutesPlaceholder({\n format: sectionFormat\n });\n }\n case 'seconds':\n {\n return localeText.fieldSecondsPlaceholder({\n format: sectionFormat\n });\n }\n case 'meridiem':\n {\n return localeText.fieldMeridiemPlaceholder({\n format: sectionFormat\n });\n }\n default:\n {\n return sectionFormat;\n }\n }\n};\nconst createSection = ({\n utils,\n timezone,\n date,\n shouldRespectLeadingZeros,\n localeText,\n localizedDigits,\n now,\n token,\n startSeparator\n}) => {\n if (token === '') {\n throw new Error('MUI X: Should not call `commitToken` with an empty token');\n }\n const sectionConfig = getDateSectionConfigFromFormatToken(utils, token);\n const hasLeadingZerosInFormat = doesSectionFormatHaveLeadingZeros(utils, timezone, sectionConfig.contentType, sectionConfig.type, token);\n const hasLeadingZerosInInput = shouldRespectLeadingZeros ? hasLeadingZerosInFormat : sectionConfig.contentType === 'digit';\n const isValidDate = date != null && utils.isValid(date);\n let sectionValue = isValidDate ? utils.formatByString(date, token) : '';\n let maxLength = null;\n if (hasLeadingZerosInInput) {\n if (hasLeadingZerosInFormat) {\n maxLength = sectionValue === '' ? utils.formatByString(now, token).length : sectionValue.length;\n } else {\n if (sectionConfig.maxLength == null) {\n throw new Error(`MUI X: The token ${token} should have a 'maxDigitNumber' property on it's adapter`);\n }\n maxLength = sectionConfig.maxLength;\n if (isValidDate) {\n sectionValue = applyLocalizedDigits(cleanLeadingZeros(removeLocalizedDigits(sectionValue, localizedDigits), maxLength), localizedDigits);\n }\n }\n }\n return _extends({}, sectionConfig, {\n format: token,\n maxLength,\n value: sectionValue,\n placeholder: getSectionPlaceholder(utils, timezone, localeText, sectionConfig, token),\n hasLeadingZerosInFormat,\n hasLeadingZerosInInput,\n startSeparator,\n endSeparator: '',\n modified: false\n });\n};\nconst buildSections = params => {\n const {\n utils,\n expandedFormat,\n escapedParts\n } = params;\n const now = utils.date(undefined);\n const sections = [];\n let startSeparator = '';\n\n // This RegExp tests if the beginning of a string corresponds to a supported token\n const validTokens = Object.keys(utils.formatTokenMap).sort((a, b) => b.length - a.length); // Sort to put longest word first\n\n const regExpFirstWordInFormat = /^([a-zA-Z]+)/;\n const regExpWordOnlyComposedOfTokens = new RegExp(`^(${validTokens.join('|')})*$`);\n const regExpFirstTokenInWord = new RegExp(`^(${validTokens.join('|')})`);\n const getEscapedPartOfCurrentChar = i => escapedParts.find(escapeIndex => escapeIndex.start <= i && escapeIndex.end >= i);\n let i = 0;\n while (i < expandedFormat.length) {\n const escapedPartOfCurrentChar = getEscapedPartOfCurrentChar(i);\n const isEscapedChar = escapedPartOfCurrentChar != null;\n const firstWordInFormat = regExpFirstWordInFormat.exec(expandedFormat.slice(i))?.[1];\n\n // The first word in the format is only composed of tokens.\n // We extract those tokens to create a new sections.\n if (!isEscapedChar && firstWordInFormat != null && regExpWordOnlyComposedOfTokens.test(firstWordInFormat)) {\n let word = firstWordInFormat;\n while (word.length > 0) {\n const firstWord = regExpFirstTokenInWord.exec(word)[1];\n word = word.slice(firstWord.length);\n sections.push(createSection(_extends({}, params, {\n now,\n token: firstWord,\n startSeparator\n })));\n startSeparator = '';\n }\n i += firstWordInFormat.length;\n }\n // The remaining format does not start with a token,\n // We take the first character and add it to the current section's end separator.\n else {\n const char = expandedFormat[i];\n\n // If we are on the opening or closing character of an escaped part of the format,\n // Then we ignore this character.\n const isEscapeBoundary = isEscapedChar && escapedPartOfCurrentChar?.start === i || escapedPartOfCurrentChar?.end === i;\n if (!isEscapeBoundary) {\n if (sections.length === 0) {\n startSeparator += char;\n } else {\n sections[sections.length - 1].endSeparator += char;\n }\n }\n i += 1;\n }\n }\n if (sections.length === 0 && startSeparator.length > 0) {\n sections.push({\n type: 'empty',\n contentType: 'letter',\n maxLength: null,\n format: '',\n value: '',\n placeholder: '',\n hasLeadingZerosInFormat: false,\n hasLeadingZerosInInput: false,\n startSeparator,\n endSeparator: '',\n modified: false\n });\n }\n return sections;\n};\nconst postProcessSections = ({\n isRTL,\n formatDensity,\n sections\n}) => {\n return sections.map(section => {\n const cleanSeparator = separator => {\n let cleanedSeparator = separator;\n if (isRTL && cleanedSeparator !== null && cleanedSeparator.includes(' ')) {\n cleanedSeparator = `\\u2069${cleanedSeparator}\\u2066`;\n }\n if (formatDensity === 'spacious' && ['/', '.', '-'].includes(cleanedSeparator)) {\n cleanedSeparator = ` ${cleanedSeparator} `;\n }\n return cleanedSeparator;\n };\n section.startSeparator = cleanSeparator(section.startSeparator);\n section.endSeparator = cleanSeparator(section.endSeparator);\n return section;\n });\n};\nexport const buildSectionsFromFormat = params => {\n let expandedFormat = expandFormat(params);\n if (params.isRTL && params.enableAccessibleFieldDOMStructure) {\n expandedFormat = expandedFormat.split(' ').reverse().join(' ');\n }\n const escapedParts = getEscapedPartsFromFormat(_extends({}, params, {\n expandedFormat\n }));\n const sections = buildSections(_extends({}, params, {\n expandedFormat,\n escapedParts\n }));\n return postProcessSections(_extends({}, params, {\n sections\n }));\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport useControlled from '@mui/utils/useControlled';\nimport { useTheme } from '@mui/material/styles';\nimport { useUtils, useLocaleText, useLocalizationContext } from '../useUtils';\nimport { mergeDateIntoReferenceDate, getSectionsBoundaries, validateSections, getDateFromDateSections, parseSelectedSections, getLocalizedDigits } from './useField.utils';\nimport { buildSectionsFromFormat } from './buildSectionsFromFormat';\nimport { useValueWithTimezone } from '../useValueWithTimezone';\nimport { getSectionTypeGranularity } from '../../utils/getDefaultReferenceDate';\nexport const useFieldState = params => {\n const utils = useUtils();\n const localeText = useLocaleText();\n const adapter = useLocalizationContext();\n const theme = useTheme();\n const isRTL = theme.direction === 'rtl';\n const {\n valueManager,\n fieldValueManager,\n valueType,\n validator,\n internalProps,\n internalProps: {\n value: valueProp,\n defaultValue,\n referenceDate: referenceDateProp,\n onChange,\n format,\n formatDensity = 'dense',\n selectedSections: selectedSectionsProp,\n onSelectedSectionsChange,\n shouldRespectLeadingZeros = false,\n timezone: timezoneProp,\n enableAccessibleFieldDOMStructure = false\n }\n } = params;\n const {\n timezone,\n value: valueFromTheOutside,\n handleValueChange\n } = useValueWithTimezone({\n timezone: timezoneProp,\n value: valueProp,\n defaultValue,\n onChange,\n valueManager\n });\n const localizedDigits = React.useMemo(() => getLocalizedDigits(utils), [utils]);\n const sectionsValueBoundaries = React.useMemo(() => getSectionsBoundaries(utils, localizedDigits, timezone), [utils, localizedDigits, timezone]);\n const getSectionsFromValue = React.useCallback((value, fallbackSections = null) => fieldValueManager.getSectionsFromValue(utils, value, fallbackSections, date => buildSectionsFromFormat({\n utils,\n timezone,\n localeText,\n localizedDigits,\n format,\n date,\n formatDensity,\n shouldRespectLeadingZeros,\n enableAccessibleFieldDOMStructure,\n isRTL\n })), [fieldValueManager, format, localeText, localizedDigits, isRTL, shouldRespectLeadingZeros, utils, formatDensity, timezone, enableAccessibleFieldDOMStructure]);\n const [state, setState] = React.useState(() => {\n const sections = getSectionsFromValue(valueFromTheOutside);\n validateSections(sections, valueType);\n const stateWithoutReferenceDate = {\n sections,\n value: valueFromTheOutside,\n referenceValue: valueManager.emptyValue,\n tempValueStrAndroid: null\n };\n const granularity = getSectionTypeGranularity(sections);\n const referenceValue = valueManager.getInitialReferenceValue({\n referenceDate: referenceDateProp,\n value: valueFromTheOutside,\n utils,\n props: internalProps,\n granularity,\n timezone\n });\n return _extends({}, stateWithoutReferenceDate, {\n referenceValue\n });\n });\n const [selectedSections, innerSetSelectedSections] = useControlled({\n controlled: selectedSectionsProp,\n default: null,\n name: 'useField',\n state: 'selectedSections'\n });\n const setSelectedSections = newSelectedSections => {\n innerSetSelectedSections(newSelectedSections);\n onSelectedSectionsChange?.(newSelectedSections);\n };\n const parsedSelectedSections = React.useMemo(() => parseSelectedSections(selectedSections, state.sections), [selectedSections, state.sections]);\n const activeSectionIndex = parsedSelectedSections === 'all' ? 0 : parsedSelectedSections;\n const publishValue = ({\n value,\n referenceValue,\n sections\n }) => {\n setState(prevState => _extends({}, prevState, {\n sections,\n value,\n referenceValue,\n tempValueStrAndroid: null\n }));\n if (valueManager.areValuesEqual(utils, state.value, value)) {\n return;\n }\n const context = {\n validationError: validator({\n adapter,\n value,\n props: _extends({}, internalProps, {\n value,\n timezone\n })\n })\n };\n handleValueChange(value, context);\n };\n const setSectionValue = (sectionIndex, newSectionValue) => {\n const newSections = [...state.sections];\n newSections[sectionIndex] = _extends({}, newSections[sectionIndex], {\n value: newSectionValue,\n modified: true\n });\n return newSections;\n };\n const clearValue = () => {\n publishValue({\n value: valueManager.emptyValue,\n referenceValue: state.referenceValue,\n sections: getSectionsFromValue(valueManager.emptyValue)\n });\n };\n const clearActiveSection = () => {\n if (activeSectionIndex == null) {\n return;\n }\n const activeSection = state.sections[activeSectionIndex];\n const activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);\n const nonEmptySectionCountBefore = activeDateManager.getSections(state.sections).filter(section => section.value !== '').length;\n const hasNoOtherNonEmptySections = nonEmptySectionCountBefore === (activeSection.value === '' ? 0 : 1);\n const newSections = setSectionValue(activeSectionIndex, '');\n const newActiveDate = hasNoOtherNonEmptySections ? null : utils.getInvalidDate();\n const newValues = activeDateManager.getNewValuesFromNewActiveDate(newActiveDate);\n publishValue(_extends({}, newValues, {\n sections: newSections\n }));\n };\n const updateValueFromValueStr = valueStr => {\n const parseDateStr = (dateStr, referenceDate) => {\n const date = utils.parse(dateStr, format);\n if (date == null || !utils.isValid(date)) {\n return null;\n }\n const sections = buildSectionsFromFormat({\n utils,\n timezone,\n localeText,\n localizedDigits,\n format,\n date,\n formatDensity,\n shouldRespectLeadingZeros,\n enableAccessibleFieldDOMStructure,\n isRTL\n });\n return mergeDateIntoReferenceDate(utils, timezone, date, sections, referenceDate, false);\n };\n const newValue = fieldValueManager.parseValueStr(valueStr, state.referenceValue, parseDateStr);\n const newReferenceValue = fieldValueManager.updateReferenceValue(utils, newValue, state.referenceValue);\n publishValue({\n value: newValue,\n referenceValue: newReferenceValue,\n sections: getSectionsFromValue(newValue, state.sections)\n });\n };\n const updateSectionValue = ({\n activeSection,\n newSectionValue,\n shouldGoToNextSection\n }) => {\n /**\n * 1. Decide which section should be focused\n */\n if (shouldGoToNextSection && activeSectionIndex < state.sections.length - 1) {\n setSelectedSections(activeSectionIndex + 1);\n }\n\n /**\n * 2. Try to build a valid date from the new section value\n */\n const activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);\n const newSections = setSectionValue(activeSectionIndex, newSectionValue);\n const newActiveDateSections = activeDateManager.getSections(newSections);\n const newActiveDate = getDateFromDateSections(utils, newActiveDateSections, localizedDigits);\n let values;\n let shouldPublish;\n\n /**\n * If the new date is valid,\n * Then we merge the value of the modified sections into the reference date.\n * This makes sure that we don't lose some information of the initial date (like the time on a date field).\n */\n if (newActiveDate != null && utils.isValid(newActiveDate)) {\n const mergedDate = mergeDateIntoReferenceDate(utils, timezone, newActiveDate, newActiveDateSections, activeDateManager.referenceDate, true);\n values = activeDateManager.getNewValuesFromNewActiveDate(mergedDate);\n shouldPublish = true;\n } else {\n values = activeDateManager.getNewValuesFromNewActiveDate(newActiveDate);\n shouldPublish = (newActiveDate != null && !utils.isValid(newActiveDate)) !== (activeDateManager.date != null && !utils.isValid(activeDateManager.date));\n }\n\n /**\n * Publish or update the internal state with the new value and sections.\n */\n if (shouldPublish) {\n return publishValue(_extends({}, values, {\n sections: newSections\n }));\n }\n return setState(prevState => _extends({}, prevState, values, {\n sections: newSections,\n tempValueStrAndroid: null\n }));\n };\n const setTempAndroidValueStr = tempValueStrAndroid => setState(prev => _extends({}, prev, {\n tempValueStrAndroid\n }));\n React.useEffect(() => {\n const sections = getSectionsFromValue(state.value);\n validateSections(sections, valueType);\n setState(prevState => _extends({}, prevState, {\n sections\n }));\n }, [format, utils.locale, isRTL]); // eslint-disable-line react-hooks/exhaustive-deps\n\n React.useEffect(() => {\n let shouldUpdate;\n if (!valueManager.areValuesEqual(utils, state.value, valueFromTheOutside)) {\n shouldUpdate = true;\n } else {\n shouldUpdate = valueManager.getTimezone(utils, state.value) !== valueManager.getTimezone(utils, valueFromTheOutside);\n }\n if (shouldUpdate) {\n setState(prevState => _extends({}, prevState, {\n value: valueFromTheOutside,\n referenceValue: fieldValueManager.updateReferenceValue(utils, valueFromTheOutside, prevState.referenceValue),\n sections: getSectionsFromValue(valueFromTheOutside)\n }));\n }\n }, [valueFromTheOutside]); // eslint-disable-line react-hooks/exhaustive-deps\n\n return {\n state,\n activeSectionIndex,\n parsedSelectedSections,\n setSelectedSections,\n clearValue,\n clearActiveSection,\n updateSectionValue,\n updateValueFromValueStr,\n setTempAndroidValueStr,\n getSectionsFromValue,\n sectionsValueBoundaries,\n localizedDigits,\n timezone\n };\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport useEventCallback from '@mui/utils/useEventCallback';\nimport { useUtils } from '../useUtils';\nimport { changeSectionValueFormat, cleanDigitSectionValue, doesSectionFormatHaveLeadingZeros, getDateSectionConfigFromFormatToken, getDaysInWeekStr, getLetterEditingOptions, applyLocalizedDigits, removeLocalizedDigits, isStringNumber } from './useField.utils';\n\n/**\n * The letter editing and the numeric editing each define a `CharacterEditingApplier`.\n * This function decides what the new section value should be and if the focus should switch to the next section.\n *\n * If it returns `null`, then the section value is not updated and the focus does not move.\n */\n\n/**\n * Function called by `applyQuery` which decides:\n * - what is the new section value ?\n * - should the query used to get this value be stored for the next key press ?\n *\n * If it returns `{ sectionValue: string; shouldGoToNextSection: boolean }`,\n * Then we store the query and update the section with the new value.\n *\n * If it returns `{ saveQuery: true` },\n * Then we store the query and don't update the section.\n *\n * If it returns `{ saveQuery: false },\n * Then we do nothing.\n */\n\nconst QUERY_LIFE_DURATION_MS = 5000;\nconst isQueryResponseWithoutValue = response => response.saveQuery != null;\n\n/**\n * Update the active section value when the user pressed a key that is not a navigation key (arrow key for example).\n * This hook has two main editing behaviors\n *\n * 1. The numeric editing when the user presses a digit\n * 2. The letter editing when the user presses another key\n */\nexport const useFieldCharacterEditing = ({\n sections,\n updateSectionValue,\n sectionsValueBoundaries,\n localizedDigits,\n setTempAndroidValueStr,\n timezone\n}) => {\n const utils = useUtils();\n const [query, setQuery] = React.useState(null);\n const resetQuery = useEventCallback(() => setQuery(null));\n React.useEffect(() => {\n if (query != null && sections[query.sectionIndex]?.type !== query.sectionType) {\n resetQuery();\n }\n }, [sections, query, resetQuery]);\n React.useEffect(() => {\n if (query != null) {\n const timeout = setTimeout(() => resetQuery(), QUERY_LIFE_DURATION_MS);\n return () => {\n clearTimeout(timeout);\n };\n }\n return () => {};\n }, [query, resetQuery]);\n const applyQuery = ({\n keyPressed,\n sectionIndex\n }, getFirstSectionValueMatchingWithQuery, isValidQueryValue) => {\n const cleanKeyPressed = keyPressed.toLowerCase();\n const activeSection = sections[sectionIndex];\n\n // The current query targets the section being editing\n // We can try to concatenate the value\n if (query != null && (!isValidQueryValue || isValidQueryValue(query.value)) && query.sectionIndex === sectionIndex) {\n const concatenatedQueryValue = `${query.value}${cleanKeyPressed}`;\n const queryResponse = getFirstSectionValueMatchingWithQuery(concatenatedQueryValue, activeSection);\n if (!isQueryResponseWithoutValue(queryResponse)) {\n setQuery({\n sectionIndex,\n value: concatenatedQueryValue,\n sectionType: activeSection.type\n });\n return queryResponse;\n }\n }\n const queryResponse = getFirstSectionValueMatchingWithQuery(cleanKeyPressed, activeSection);\n if (isQueryResponseWithoutValue(queryResponse) && !queryResponse.saveQuery) {\n resetQuery();\n return null;\n }\n setQuery({\n sectionIndex,\n value: cleanKeyPressed,\n sectionType: activeSection.type\n });\n if (isQueryResponseWithoutValue(queryResponse)) {\n return null;\n }\n return queryResponse;\n };\n const applyLetterEditing = params => {\n const findMatchingOptions = (format, options, queryValue) => {\n const matchingValues = options.filter(option => option.toLowerCase().startsWith(queryValue));\n if (matchingValues.length === 0) {\n return {\n saveQuery: false\n };\n }\n return {\n sectionValue: matchingValues[0],\n shouldGoToNextSection: matchingValues.length === 1\n };\n };\n const testQueryOnFormatAndFallbackFormat = (queryValue, activeSection, fallbackFormat, formatFallbackValue) => {\n const getOptions = format => getLetterEditingOptions(utils, timezone, activeSection.type, format);\n if (activeSection.contentType === 'letter') {\n return findMatchingOptions(activeSection.format, getOptions(activeSection.format), queryValue);\n }\n\n // When editing a digit-format month / weekDay and the user presses a letter,\n // We can support the letter editing by using the letter-format month / weekDay and re-formatting the result.\n // We just have to make sure that the default month / weekDay format is a letter format,\n if (fallbackFormat && formatFallbackValue != null && getDateSectionConfigFromFormatToken(utils, fallbackFormat).contentType === 'letter') {\n const fallbackOptions = getOptions(fallbackFormat);\n const response = findMatchingOptions(fallbackFormat, fallbackOptions, queryValue);\n if (isQueryResponseWithoutValue(response)) {\n return {\n saveQuery: false\n };\n }\n return _extends({}, response, {\n sectionValue: formatFallbackValue(response.sectionValue, fallbackOptions)\n });\n }\n return {\n saveQuery: false\n };\n };\n const getFirstSectionValueMatchingWithQuery = (queryValue, activeSection) => {\n switch (activeSection.type) {\n case 'month':\n {\n const formatFallbackValue = fallbackValue => changeSectionValueFormat(utils, fallbackValue, utils.formats.month, activeSection.format);\n return testQueryOnFormatAndFallbackFormat(queryValue, activeSection, utils.formats.month, formatFallbackValue);\n }\n case 'weekDay':\n {\n const formatFallbackValue = (fallbackValue, fallbackOptions) => fallbackOptions.indexOf(fallbackValue).toString();\n return testQueryOnFormatAndFallbackFormat(queryValue, activeSection, utils.formats.weekday, formatFallbackValue);\n }\n case 'meridiem':\n {\n return testQueryOnFormatAndFallbackFormat(queryValue, activeSection);\n }\n default:\n {\n return {\n saveQuery: false\n };\n }\n }\n };\n return applyQuery(params, getFirstSectionValueMatchingWithQuery);\n };\n const applyNumericEditing = params => {\n const getNewSectionValue = (queryValue, section) => {\n const cleanQueryValue = removeLocalizedDigits(queryValue, localizedDigits);\n const queryValueNumber = Number(cleanQueryValue);\n const sectionBoundaries = sectionsValueBoundaries[section.type]({\n currentDate: null,\n format: section.format,\n contentType: section.contentType\n });\n if (queryValueNumber > sectionBoundaries.maximum) {\n return {\n saveQuery: false\n };\n }\n\n // If the user types `0` on a month section,\n // It is below the minimum, but we want to store the `0` in the query,\n // So that when he pressed `1`, it will store `01` and move to the next section.\n if (queryValueNumber < sectionBoundaries.minimum) {\n return {\n saveQuery: true\n };\n }\n const shouldGoToNextSection = queryValueNumber * 10 > sectionBoundaries.maximum || cleanQueryValue.length === sectionBoundaries.maximum.toString().length;\n const newSectionValue = cleanDigitSectionValue(utils, queryValueNumber, sectionBoundaries, localizedDigits, section);\n return {\n sectionValue: newSectionValue,\n shouldGoToNextSection\n };\n };\n const getFirstSectionValueMatchingWithQuery = (queryValue, activeSection) => {\n if (activeSection.contentType === 'digit' || activeSection.contentType === 'digit-with-letter') {\n return getNewSectionValue(queryValue, activeSection);\n }\n\n // When editing a letter-format month and the user presses a digit,\n // We can support the numeric editing by using the digit-format month and re-formatting the result.\n if (activeSection.type === 'month') {\n const hasLeadingZerosInFormat = doesSectionFormatHaveLeadingZeros(utils, timezone, 'digit', 'month', 'MM');\n const response = getNewSectionValue(queryValue, {\n type: activeSection.type,\n format: 'MM',\n hasLeadingZerosInFormat,\n hasLeadingZerosInInput: true,\n contentType: 'digit',\n maxLength: 2\n });\n if (isQueryResponseWithoutValue(response)) {\n return response;\n }\n const formattedValue = changeSectionValueFormat(utils, response.sectionValue, 'MM', activeSection.format);\n return _extends({}, response, {\n sectionValue: formattedValue\n });\n }\n\n // When editing a letter-format weekDay and the user presses a digit,\n // We can support the numeric editing by returning the nth day in the week day array.\n if (activeSection.type === 'weekDay') {\n const response = getNewSectionValue(queryValue, activeSection);\n if (isQueryResponseWithoutValue(response)) {\n return response;\n }\n const formattedValue = getDaysInWeekStr(utils, timezone, activeSection.format)[Number(response.sectionValue) - 1];\n return _extends({}, response, {\n sectionValue: formattedValue\n });\n }\n return {\n saveQuery: false\n };\n };\n return applyQuery(params, getFirstSectionValueMatchingWithQuery, queryValue => isStringNumber(queryValue, localizedDigits));\n };\n const applyCharacterEditing = useEventCallback(params => {\n const activeSection = sections[params.sectionIndex];\n const isNumericEditing = isStringNumber(params.keyPressed, localizedDigits);\n const response = isNumericEditing ? applyNumericEditing(_extends({}, params, {\n keyPressed: applyLocalizedDigits(params.keyPressed, localizedDigits)\n })) : applyLetterEditing(params);\n if (response == null) {\n setTempAndroidValueStr(null);\n return;\n }\n updateSectionValue({\n activeSection,\n newSectionValue: response.sectionValue,\n shouldGoToNextSection: response.shouldGoToNextSection\n });\n });\n return {\n applyCharacterEditing,\n resetCharacterQuery: resetQuery\n };\n};","import * as React from 'react';\nimport useForkRef from '@mui/utils/useForkRef';\nimport useEventCallback from '@mui/utils/useEventCallback';\nimport useEnhancedEffect from '@mui/utils/useEnhancedEffect';\nimport useId from '@mui/utils/useId';\nimport { getSectionValueNow, getSectionValueText, parseSelectedSections } from './useField.utils';\nimport { getActiveElement } from '../../utils/utils';\nimport { useLocaleText, useUtils } from '../useUtils';\nexport const useFieldV7TextField = params => {\n const {\n internalProps: {\n disabled,\n readOnly = false\n },\n forwardedProps: {\n sectionListRef: inSectionListRef,\n onBlur,\n onClick,\n onFocus,\n onInput,\n onPaste,\n focused: focusedProp,\n autoFocus = false\n },\n fieldValueManager,\n applyCharacterEditing,\n resetCharacterQuery,\n setSelectedSections,\n parsedSelectedSections,\n state,\n clearActiveSection,\n clearValue,\n updateSectionValue,\n updateValueFromValueStr,\n sectionOrder,\n areAllSectionsEmpty,\n sectionsValueBoundaries\n } = params;\n const sectionListRef = React.useRef(null);\n const handleSectionListRef = useForkRef(inSectionListRef, sectionListRef);\n const localeText = useLocaleText();\n const utils = useUtils();\n const id = useId();\n const [focused, setFocused] = React.useState(false);\n const interactions = React.useMemo(() => ({\n syncSelectionToDOM: () => {\n if (!sectionListRef.current) {\n return;\n }\n const selection = document.getSelection();\n if (!selection) {\n return;\n }\n if (parsedSelectedSections == null) {\n // If the selection contains an element inside the field, we reset it.\n if (selection.rangeCount > 0 && sectionListRef.current.getRoot().contains(selection.getRangeAt(0).startContainer)) {\n selection.removeAllRanges();\n }\n if (focused) {\n sectionListRef.current.getRoot().blur();\n }\n return;\n }\n\n // On multi input range pickers we want to update selection range only for the active input\n if (!sectionListRef.current.getRoot().contains(getActiveElement(document))) {\n return;\n }\n const range = new window.Range();\n let target;\n if (parsedSelectedSections === 'all') {\n target = sectionListRef.current.getRoot();\n } else {\n const section = state.sections[parsedSelectedSections];\n if (section.type === 'empty') {\n target = sectionListRef.current.getSectionContainer(parsedSelectedSections);\n } else {\n target = sectionListRef.current.getSectionContent(parsedSelectedSections);\n }\n }\n range.selectNodeContents(target);\n target.focus();\n selection.removeAllRanges();\n selection.addRange(range);\n },\n getActiveSectionIndexFromDOM: () => {\n const activeElement = getActiveElement(document);\n if (!activeElement || !sectionListRef.current || !sectionListRef.current.getRoot().contains(activeElement)) {\n return null;\n }\n return sectionListRef.current.getSectionIndexFromDOMElement(activeElement);\n },\n focusField: (newSelectedSections = 0) => {\n if (!sectionListRef.current) {\n return;\n }\n const newParsedSelectedSections = parseSelectedSections(newSelectedSections, state.sections);\n setFocused(true);\n sectionListRef.current.getSectionContent(newParsedSelectedSections).focus();\n },\n setSelectedSections: newSelectedSections => {\n if (!sectionListRef.current) {\n return;\n }\n const newParsedSelectedSections = parseSelectedSections(newSelectedSections, state.sections);\n const newActiveSectionIndex = newParsedSelectedSections === 'all' ? 0 : newParsedSelectedSections;\n setFocused(newActiveSectionIndex !== null);\n setSelectedSections(newSelectedSections);\n },\n isFieldFocused: () => {\n const activeElement = getActiveElement(document);\n return !!sectionListRef.current && sectionListRef.current.getRoot().contains(activeElement);\n }\n }), [parsedSelectedSections, setSelectedSections, state.sections, focused]);\n\n /**\n * If a section content has been updated with a value we don't want to keep,\n * Then we need to imperatively revert it (we can't let React do it because the value did not change in his internal representation).\n */\n const revertDOMSectionChange = useEventCallback(sectionIndex => {\n if (!sectionListRef.current) {\n return;\n }\n const section = state.sections[sectionIndex];\n sectionListRef.current.getSectionContent(sectionIndex).innerHTML = section.value || section.placeholder;\n interactions.syncSelectionToDOM();\n });\n const handleContainerClick = useEventCallback((event, ...args) => {\n // The click event on the clear button would propagate to the input, trigger this handler and result in a wrong section selection.\n // We avoid this by checking if the call of `handleContainerClick` is actually intended, or a side effect.\n if (event.isDefaultPrevented() || !sectionListRef.current) {\n return;\n }\n setFocused(true);\n onClick?.(event, ...args);\n if (parsedSelectedSections === 'all') {\n setTimeout(() => {\n const cursorPosition = document.getSelection().getRangeAt(0).startOffset;\n if (cursorPosition === 0) {\n setSelectedSections(sectionOrder.startIndex);\n return;\n }\n let sectionIndex = 0;\n let cursorOnStartOfSection = 0;\n while (cursorOnStartOfSection < cursorPosition && sectionIndex < state.sections.length) {\n const section = state.sections[sectionIndex];\n sectionIndex += 1;\n cursorOnStartOfSection += `${section.startSeparator}${section.value || section.placeholder}${section.endSeparator}`.length;\n }\n setSelectedSections(sectionIndex - 1);\n });\n } else if (!focused) {\n setFocused(true);\n setSelectedSections(sectionOrder.startIndex);\n } else {\n const hasClickedOnASection = sectionListRef.current.getRoot().contains(event.target);\n if (!hasClickedOnASection) {\n setSelectedSections(sectionOrder.startIndex);\n }\n }\n });\n const handleContainerInput = useEventCallback(event => {\n onInput?.(event);\n if (!sectionListRef.current || parsedSelectedSections !== 'all') {\n return;\n }\n const target = event.target;\n const keyPressed = target.textContent ?? '';\n sectionListRef.current.getRoot().innerHTML = state.sections.map(section => `${section.startSeparator}${section.value || section.placeholder}${section.endSeparator}`).join('');\n interactions.syncSelectionToDOM();\n if (keyPressed.length === 0 || keyPressed.charCodeAt(0) === 10) {\n resetCharacterQuery();\n clearValue();\n setSelectedSections('all');\n } else if (keyPressed.length > 1) {\n updateValueFromValueStr(keyPressed);\n } else {\n applyCharacterEditing({\n keyPressed,\n sectionIndex: 0\n });\n }\n });\n const handleContainerPaste = useEventCallback(event => {\n onPaste?.(event);\n if (readOnly || parsedSelectedSections !== 'all') {\n event.preventDefault();\n return;\n }\n const pastedValue = event.clipboardData.getData('text');\n event.preventDefault();\n resetCharacterQuery();\n updateValueFromValueStr(pastedValue);\n });\n const handleContainerFocus = useEventCallback((...args) => {\n onFocus?.(...args);\n if (focused || !sectionListRef.current) {\n return;\n }\n setFocused(true);\n const isFocusInsideASection = sectionListRef.current.getSectionIndexFromDOMElement(getActiveElement(document)) != null;\n if (!isFocusInsideASection) {\n setSelectedSections(sectionOrder.startIndex);\n }\n });\n const handleContainerBlur = useEventCallback((...args) => {\n onBlur?.(...args);\n setTimeout(() => {\n if (!sectionListRef.current) {\n return;\n }\n const activeElement = getActiveElement(document);\n const shouldBlur = !sectionListRef.current.getRoot().contains(activeElement);\n if (shouldBlur) {\n setFocused(false);\n setSelectedSections(null);\n }\n });\n });\n const getInputContainerClickHandler = useEventCallback(sectionIndex => event => {\n // The click event on the clear button would propagate to the input, trigger this handler and result in a wrong section selection.\n // We avoid this by checking if the call to this function is actually intended, or a side effect.\n if (event.isDefaultPrevented() || readOnly) {\n return;\n }\n setSelectedSections(sectionIndex);\n });\n const handleInputContentMouseUp = useEventCallback(event => {\n // Without this, the browser will remove the selected when clicking inside an already-selected section.\n event.preventDefault();\n });\n const getInputContentFocusHandler = useEventCallback(sectionIndex => () => {\n if (readOnly) {\n return;\n }\n setSelectedSections(sectionIndex);\n });\n const handleInputContentPaste = useEventCallback(event => {\n // prevent default to avoid the input `onInput` handler being called\n event.preventDefault();\n if (readOnly || typeof parsedSelectedSections !== 'number') {\n return;\n }\n const activeSection = state.sections[parsedSelectedSections];\n const pastedValue = event.clipboardData.getData('text');\n const lettersOnly = /^[a-zA-Z]+$/.test(pastedValue);\n const digitsOnly = /^[0-9]+$/.test(pastedValue);\n const digitsAndLetterOnly = /^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(pastedValue);\n const isValidPastedValue = activeSection.contentType === 'letter' && lettersOnly || activeSection.contentType === 'digit' && digitsOnly || activeSection.contentType === 'digit-with-letter' && digitsAndLetterOnly;\n if (isValidPastedValue) {\n resetCharacterQuery();\n updateSectionValue({\n activeSection,\n newSectionValue: pastedValue,\n shouldGoToNextSection: true\n });\n }\n // If the pasted value corresponds to a single section, but not the expected type, we skip the modification\n else if (!lettersOnly && !digitsOnly) {\n resetCharacterQuery();\n updateValueFromValueStr(pastedValue);\n }\n });\n const handleInputContentDragOver = useEventCallback(event => {\n event.preventDefault();\n event.dataTransfer.dropEffect = 'none';\n });\n const handleInputContentInput = useEventCallback(event => {\n if (!sectionListRef.current) {\n return;\n }\n const target = event.target;\n const keyPressed = target.textContent ?? '';\n const sectionIndex = sectionListRef.current.getSectionIndexFromDOMElement(target);\n const section = state.sections[sectionIndex];\n if (readOnly || !sectionListRef.current) {\n revertDOMSectionChange(sectionIndex);\n return;\n }\n if (keyPressed.length === 0) {\n if (section.value === '') {\n revertDOMSectionChange(sectionIndex);\n return;\n }\n resetCharacterQuery();\n clearActiveSection();\n return;\n }\n applyCharacterEditing({\n keyPressed,\n sectionIndex\n });\n\n // The DOM value needs to remain the one React is expecting.\n revertDOMSectionChange(sectionIndex);\n });\n useEnhancedEffect(() => {\n if (!focused || !sectionListRef.current) {\n return;\n }\n if (parsedSelectedSections === 'all') {\n sectionListRef.current.getRoot().focus();\n } else if (typeof parsedSelectedSections === 'number') {\n const domElement = sectionListRef.current.getSectionContent(parsedSelectedSections);\n if (domElement) {\n domElement.focus();\n }\n }\n }, [parsedSelectedSections, focused]);\n const sectionBoundaries = React.useMemo(() => {\n return state.sections.reduce((acc, next) => {\n acc[next.type] = sectionsValueBoundaries[next.type]({\n currentDate: null,\n contentType: next.contentType,\n format: next.format\n });\n return acc;\n }, {});\n }, [sectionsValueBoundaries, state.sections]);\n const isContainerEditable = parsedSelectedSections === 'all';\n const elements = React.useMemo(() => {\n return state.sections.map((section, index) => {\n const isEditable = !isContainerEditable && !disabled && !readOnly;\n return {\n container: {\n 'data-sectionindex': index,\n onClick: getInputContainerClickHandler(index)\n },\n content: {\n tabIndex: isContainerEditable || index > 0 ? -1 : 0,\n contentEditable: !isContainerEditable && !disabled && !readOnly,\n role: 'spinbutton',\n id: `${id}-${section.type}`,\n 'aria-labelledby': `${id}-${section.type}`,\n 'aria-readonly': readOnly,\n 'aria-valuenow': getSectionValueNow(section, utils),\n 'aria-valuemin': sectionBoundaries[section.type].minimum,\n 'aria-valuemax': sectionBoundaries[section.type].maximum,\n 'aria-valuetext': section.value ? getSectionValueText(section, utils) : localeText.empty,\n 'aria-label': localeText[section.type],\n 'aria-disabled': disabled,\n spellCheck: isEditable ? false : undefined,\n autoCapitalize: isEditable ? 'off' : undefined,\n autoCorrect: isEditable ? 'off' : undefined,\n [parseInt(React.version, 10) >= 17 ? 'enterKeyHint' : 'enterkeyhint']: isEditable ? 'next' : undefined,\n children: section.value || section.placeholder,\n onInput: handleInputContentInput,\n onPaste: handleInputContentPaste,\n onFocus: getInputContentFocusHandler(index),\n onDragOver: handleInputContentDragOver,\n onMouseUp: handleInputContentMouseUp,\n inputMode: section.contentType === 'letter' ? 'text' : 'numeric'\n },\n before: {\n children: section.startSeparator\n },\n after: {\n children: section.endSeparator\n }\n };\n });\n }, [state.sections, getInputContentFocusHandler, handleInputContentPaste, handleInputContentDragOver, handleInputContentInput, getInputContainerClickHandler, handleInputContentMouseUp, disabled, readOnly, isContainerEditable, localeText, utils, sectionBoundaries, id]);\n const handleValueStrChange = useEventCallback(event => {\n updateValueFromValueStr(event.target.value);\n });\n const valueStr = React.useMemo(() => areAllSectionsEmpty ? '' : fieldValueManager.getV7HiddenInputValueFromSections(state.sections), [areAllSectionsEmpty, state.sections, fieldValueManager]);\n React.useEffect(() => {\n if (sectionListRef.current == null) {\n throw new Error(['MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`', 'You probably tried to pass a component to the `textField` slot that contains an `` element instead of a `PickersSectionList`.', '', 'If you want to keep using an `` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:', '', '', '', 'Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element'].join('\\n'));\n }\n if (autoFocus && sectionListRef.current) {\n sectionListRef.current.getSectionContent(sectionOrder.startIndex).focus();\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return {\n interactions,\n returnedValue: {\n // Forwarded\n autoFocus,\n readOnly,\n focused: focusedProp ?? focused,\n sectionListRef: handleSectionListRef,\n onBlur: handleContainerBlur,\n onClick: handleContainerClick,\n onFocus: handleContainerFocus,\n onInput: handleContainerInput,\n onPaste: handleContainerPaste,\n // Additional\n enableAccessibleFieldDOMStructure: true,\n elements,\n // TODO v7: Try to set to undefined when there is a section selected.\n tabIndex: parsedSelectedSections === 0 ? -1 : 0,\n contentEditable: isContainerEditable,\n value: valueStr,\n onChange: handleValueStrChange,\n areAllSectionsEmpty\n }\n };\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useTheme } from '@mui/material/styles';\nimport useEventCallback from '@mui/utils/useEventCallback';\nimport useForkRef from '@mui/utils/useForkRef';\nimport { getActiveElement } from '../../utils/utils';\nimport { getSectionVisibleValue, isAndroid } from './useField.utils';\nconst cleanString = dirtyString => dirtyString.replace(/[\\u2066\\u2067\\u2068\\u2069]/g, '');\nexport const addPositionPropertiesToSections = (sections, localizedDigits, isRTL) => {\n let position = 0;\n let positionInInput = isRTL ? 1 : 0;\n const newSections = [];\n for (let i = 0; i < sections.length; i += 1) {\n const section = sections[i];\n const renderedValue = getSectionVisibleValue(section, isRTL ? 'input-rtl' : 'input-ltr', localizedDigits);\n const sectionStr = `${section.startSeparator}${renderedValue}${section.endSeparator}`;\n const sectionLength = cleanString(sectionStr).length;\n const sectionLengthInInput = sectionStr.length;\n\n // The ...InInput values consider the unicode characters but do include them in their indexes\n const cleanedValue = cleanString(renderedValue);\n const startInInput = positionInInput + (cleanedValue === '' ? 0 : renderedValue.indexOf(cleanedValue[0])) + section.startSeparator.length;\n const endInInput = startInInput + cleanedValue.length;\n newSections.push(_extends({}, section, {\n start: position,\n end: position + sectionLength,\n startInInput,\n endInInput\n }));\n position += sectionLength;\n // Move position to the end of string associated to the current section\n positionInInput += sectionLengthInInput;\n }\n return newSections;\n};\nexport const useFieldV6TextField = params => {\n const theme = useTheme();\n const isRTL = theme.direction === 'rtl';\n const focusTimeoutRef = React.useRef();\n const {\n forwardedProps: {\n onFocus,\n onClick,\n onPaste,\n onBlur,\n inputRef: inputRefProp,\n placeholder: inPlaceholder\n },\n internalProps: {\n readOnly = false\n },\n parsedSelectedSections,\n activeSectionIndex,\n state,\n fieldValueManager,\n valueManager,\n applyCharacterEditing,\n resetCharacterQuery,\n updateSectionValue,\n updateValueFromValueStr,\n clearActiveSection,\n clearValue,\n setTempAndroidValueStr,\n setSelectedSections,\n getSectionsFromValue,\n areAllSectionsEmpty,\n localizedDigits\n } = params;\n const inputRef = React.useRef(null);\n const handleRef = useForkRef(inputRefProp, inputRef);\n const sections = React.useMemo(() => addPositionPropertiesToSections(state.sections, localizedDigits, isRTL), [state.sections, localizedDigits, isRTL]);\n const interactions = React.useMemo(() => ({\n syncSelectionToDOM: () => {\n if (!inputRef.current) {\n return;\n }\n if (parsedSelectedSections == null) {\n if (inputRef.current.scrollLeft) {\n // Ensure that input content is not marked as selected.\n // setting selection range to 0 causes issues in Safari.\n // https://bugs.webkit.org/show_bug.cgi?id=224425\n inputRef.current.scrollLeft = 0;\n }\n return;\n }\n\n // On multi input range pickers we want to update selection range only for the active input\n // This helps to avoid the focus jumping on Safari https://github.com/mui/mui-x/issues/9003\n // because WebKit implements the `setSelectionRange` based on the spec: https://bugs.webkit.org/show_bug.cgi?id=224425\n if (inputRef.current !== getActiveElement(document)) {\n return;\n }\n\n // Fix scroll jumping on iOS browser: https://github.com/mui/mui-x/issues/8321\n const currentScrollTop = inputRef.current.scrollTop;\n if (parsedSelectedSections === 'all') {\n inputRef.current.select();\n } else {\n const selectedSection = sections[parsedSelectedSections];\n const selectionStart = selectedSection.type === 'empty' ? selectedSection.startInInput - selectedSection.startSeparator.length : selectedSection.startInInput;\n const selectionEnd = selectedSection.type === 'empty' ? selectedSection.endInInput + selectedSection.endSeparator.length : selectedSection.endInInput;\n if (selectionStart !== inputRef.current.selectionStart || selectionEnd !== inputRef.current.selectionEnd) {\n if (inputRef.current === getActiveElement(document)) {\n inputRef.current.setSelectionRange(selectionStart, selectionEnd);\n }\n }\n }\n\n // Even reading this variable seems to do the trick, but also setting it just to make use of it\n inputRef.current.scrollTop = currentScrollTop;\n },\n getActiveSectionIndexFromDOM: () => {\n const browserStartIndex = inputRef.current.selectionStart ?? 0;\n const browserEndIndex = inputRef.current.selectionEnd ?? 0;\n const isInputReadOnly = !!inputRef.current?.readOnly;\n if (browserStartIndex === 0 && browserEndIndex === 0 || isInputReadOnly) {\n return null;\n }\n const nextSectionIndex = browserStartIndex <= sections[0].startInInput ? 1 // Special case if browser index is in invisible characters at the beginning.\n : sections.findIndex(section => section.startInInput - section.startSeparator.length > browserStartIndex);\n return nextSectionIndex === -1 ? sections.length - 1 : nextSectionIndex - 1;\n },\n focusField: (newSelectedSection = 0) => {\n inputRef.current?.focus();\n setSelectedSections(newSelectedSection);\n },\n setSelectedSections: newSelectedSections => setSelectedSections(newSelectedSections),\n isFieldFocused: () => inputRef.current === getActiveElement(document)\n }), [inputRef, parsedSelectedSections, sections, setSelectedSections]);\n const syncSelectionFromDOM = () => {\n if (readOnly) {\n setSelectedSections(null);\n return;\n }\n const browserStartIndex = inputRef.current.selectionStart ?? 0;\n let nextSectionIndex;\n if (browserStartIndex <= sections[0].startInInput) {\n // Special case if browser index is in invisible characters at the beginning\n nextSectionIndex = 1;\n } else if (browserStartIndex >= sections[sections.length - 1].endInInput) {\n // If the click is after the last character of the input, then we want to select the 1st section.\n nextSectionIndex = 1;\n } else {\n nextSectionIndex = sections.findIndex(section => section.startInInput - section.startSeparator.length > browserStartIndex);\n }\n const sectionIndex = nextSectionIndex === -1 ? sections.length - 1 : nextSectionIndex - 1;\n setSelectedSections(sectionIndex);\n };\n const handleInputFocus = useEventCallback((...args) => {\n onFocus?.(...args);\n // The ref is guaranteed to be resolved at this point.\n const input = inputRef.current;\n clearTimeout(focusTimeoutRef.current);\n focusTimeoutRef.current = setTimeout(() => {\n // The ref changed, the component got remounted, the focus event is no longer relevant.\n if (!input || input !== inputRef.current) {\n return;\n }\n if (activeSectionIndex != null || readOnly) {\n return;\n }\n if (\n // avoid selecting all sections when focusing empty field without value\n input.value.length && Number(input.selectionEnd) - Number(input.selectionStart) === input.value.length) {\n setSelectedSections('all');\n } else {\n syncSelectionFromDOM();\n }\n });\n });\n const handleInputClick = useEventCallback((event, ...args) => {\n // The click event on the clear button would propagate to the input, trigger this handler and result in a wrong section selection.\n // We avoid this by checking if the call of `handleInputClick` is actually intended, or a side effect.\n if (event.isDefaultPrevented()) {\n return;\n }\n onClick?.(event, ...args);\n syncSelectionFromDOM();\n });\n const handleInputPaste = useEventCallback(event => {\n onPaste?.(event);\n\n // prevent default to avoid the input `onChange` handler being called\n event.preventDefault();\n if (readOnly) {\n return;\n }\n const pastedValue = event.clipboardData.getData('text');\n if (typeof parsedSelectedSections === 'number') {\n const activeSection = state.sections[parsedSelectedSections];\n const lettersOnly = /^[a-zA-Z]+$/.test(pastedValue);\n const digitsOnly = /^[0-9]+$/.test(pastedValue);\n const digitsAndLetterOnly = /^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(pastedValue);\n const isValidPastedValue = activeSection.contentType === 'letter' && lettersOnly || activeSection.contentType === 'digit' && digitsOnly || activeSection.contentType === 'digit-with-letter' && digitsAndLetterOnly;\n if (isValidPastedValue) {\n resetCharacterQuery();\n updateSectionValue({\n activeSection,\n newSectionValue: pastedValue,\n shouldGoToNextSection: true\n });\n return;\n }\n if (lettersOnly || digitsOnly) {\n // The pasted value corresponds to a single section, but not the expected type,\n // skip the modification\n return;\n }\n }\n resetCharacterQuery();\n updateValueFromValueStr(pastedValue);\n });\n const handleContainerBlur = useEventCallback((...args) => {\n onBlur?.(...args);\n setSelectedSections(null);\n });\n const handleInputChange = useEventCallback(event => {\n if (readOnly) {\n return;\n }\n const targetValue = event.target.value;\n if (targetValue === '') {\n resetCharacterQuery();\n clearValue();\n return;\n }\n const eventData = event.nativeEvent.data;\n // Calling `.fill(04/11/2022)` in playwright will trigger a change event with the requested content to insert in `event.nativeEvent.data`\n // usual changes have only the currently typed character in the `event.nativeEvent.data`\n const shouldUseEventData = eventData && eventData.length > 1;\n const valueStr = shouldUseEventData ? eventData : targetValue;\n const cleanValueStr = cleanString(valueStr);\n\n // If no section is selected or eventData should be used, we just try to parse the new value\n // This line is mostly triggered by imperative code / application tests.\n if (activeSectionIndex == null || shouldUseEventData) {\n updateValueFromValueStr(shouldUseEventData ? eventData : cleanValueStr);\n return;\n }\n let keyPressed;\n if (parsedSelectedSections === 'all' && cleanValueStr.length === 1) {\n keyPressed = cleanValueStr;\n } else {\n const prevValueStr = cleanString(fieldValueManager.getV6InputValueFromSections(sections, localizedDigits, isRTL));\n let startOfDiffIndex = -1;\n let endOfDiffIndex = -1;\n for (let i = 0; i < prevValueStr.length; i += 1) {\n if (startOfDiffIndex === -1 && prevValueStr[i] !== cleanValueStr[i]) {\n startOfDiffIndex = i;\n }\n if (endOfDiffIndex === -1 && prevValueStr[prevValueStr.length - i - 1] !== cleanValueStr[cleanValueStr.length - i - 1]) {\n endOfDiffIndex = i;\n }\n }\n const activeSection = sections[activeSectionIndex];\n const hasDiffOutsideOfActiveSection = startOfDiffIndex < activeSection.start || prevValueStr.length - endOfDiffIndex - 1 > activeSection.end;\n if (hasDiffOutsideOfActiveSection) {\n // TODO: Support if the new date is valid\n return;\n }\n\n // The active section being selected, the browser has replaced its value with the key pressed by the user.\n const activeSectionEndRelativeToNewValue = cleanValueStr.length - prevValueStr.length + activeSection.end - cleanString(activeSection.endSeparator || '').length;\n keyPressed = cleanValueStr.slice(activeSection.start + cleanString(activeSection.startSeparator || '').length, activeSectionEndRelativeToNewValue);\n }\n if (keyPressed.length === 0) {\n if (isAndroid()) {\n setTempAndroidValueStr(valueStr);\n } else {\n resetCharacterQuery();\n clearActiveSection();\n }\n return;\n }\n applyCharacterEditing({\n keyPressed,\n sectionIndex: activeSectionIndex\n });\n });\n const placeholder = React.useMemo(() => {\n if (inPlaceholder) {\n return inPlaceholder;\n }\n return fieldValueManager.getV6InputValueFromSections(getSectionsFromValue(valueManager.emptyValue), localizedDigits, isRTL);\n }, [inPlaceholder, fieldValueManager, getSectionsFromValue, valueManager.emptyValue, localizedDigits, isRTL]);\n const valueStr = React.useMemo(() => state.tempValueStrAndroid ?? fieldValueManager.getV6InputValueFromSections(state.sections, localizedDigits, isRTL), [state.sections, fieldValueManager, state.tempValueStrAndroid, localizedDigits, isRTL]);\n React.useEffect(() => {\n // Select all the sections when focused on mount (`autoFocus = true` on the input)\n if (inputRef.current && inputRef.current === getActiveElement(document)) {\n setSelectedSections('all');\n }\n return () => {\n clearTimeout(focusTimeoutRef.current);\n };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const inputMode = React.useMemo(() => {\n if (activeSectionIndex == null) {\n return 'text';\n }\n if (state.sections[activeSectionIndex].contentType === 'letter') {\n return 'text';\n }\n return 'numeric';\n }, [activeSectionIndex, state.sections]);\n const inputHasFocus = inputRef.current && inputRef.current === getActiveElement(document);\n const shouldShowPlaceholder = !inputHasFocus && areAllSectionsEmpty;\n return {\n interactions,\n returnedValue: {\n // Forwarded\n readOnly,\n onBlur: handleContainerBlur,\n onClick: handleInputClick,\n onFocus: handleInputFocus,\n onPaste: handleInputPaste,\n inputRef: handleRef,\n // Additional\n enableAccessibleFieldDOMStructure: false,\n placeholder,\n inputMode,\n autoComplete: 'off',\n value: shouldShowPlaceholder ? '' : valueStr,\n onChange: handleInputChange\n }\n };\n};","export const DATE_VALIDATION_PROP_NAMES = ['disablePast', 'disableFuture', 'minDate', 'maxDate', 'shouldDisableDate', 'shouldDisableMonth', 'shouldDisableYear'];\nexport const TIME_VALIDATION_PROP_NAMES = ['disablePast', 'disableFuture', 'minTime', 'maxTime', 'shouldDisableTime', 'minutesStep', 'ampm', 'disableIgnoringDatePartForTimeValidation'];\nexport const DATE_TIME_VALIDATION_PROP_NAMES = ['minDateTime', 'maxDateTime'];\nconst VALIDATION_PROP_NAMES = [...DATE_VALIDATION_PROP_NAMES, ...TIME_VALIDATION_PROP_NAMES, ...DATE_TIME_VALIDATION_PROP_NAMES];\n/**\n * Extract the validation props for the props received by a component.\n * Limit the risk of forgetting some of them and reduce the bundle size.\n */\nexport const extractValidationProps = props => VALIDATION_PROP_NAMES.reduce((extractedProps, propName) => {\n if (props.hasOwnProperty(propName)) {\n extractedProps[propName] = props[propName];\n }\n return extractedProps;\n}, {});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { DATE_TIME_VALIDATION_PROP_NAMES, DATE_VALIDATION_PROP_NAMES, TIME_VALIDATION_PROP_NAMES } from './validation/extractValidationProps';\nconst SHARED_FIELD_INTERNAL_PROP_NAMES = ['value', 'defaultValue', 'referenceDate', 'format', 'formatDensity', 'onChange', 'timezone', 'onError', 'shouldRespectLeadingZeros', 'selectedSections', 'onSelectedSectionsChange', 'unstableFieldRef', 'enableAccessibleFieldDOMStructure', 'disabled', 'readOnly', 'dateSeparator'];\nexport const splitFieldInternalAndForwardedProps = (props, valueType) => {\n const forwardedProps = _extends({}, props);\n const internalProps = {};\n const extractProp = propName => {\n if (forwardedProps.hasOwnProperty(propName)) {\n // @ts-ignore\n internalProps[propName] = forwardedProps[propName];\n delete forwardedProps[propName];\n }\n };\n SHARED_FIELD_INTERNAL_PROP_NAMES.forEach(extractProp);\n if (valueType === 'date') {\n DATE_VALIDATION_PROP_NAMES.forEach(extractProp);\n } else if (valueType === 'time') {\n TIME_VALIDATION_PROP_NAMES.forEach(extractProp);\n } else if (valueType === 'date-time') {\n DATE_VALIDATION_PROP_NAMES.forEach(extractProp);\n TIME_VALIDATION_PROP_NAMES.forEach(extractProp);\n DATE_TIME_VALIDATION_PROP_NAMES.forEach(extractProp);\n }\n return {\n forwardedProps,\n internalProps\n };\n};","import { singleItemFieldValueManager, singleItemValueManager } from '../internals/utils/valueManagers';\nimport { useField } from '../internals/hooks/useField';\nimport { validateDate } from '../internals/utils/validation/validateDate';\nimport { splitFieldInternalAndForwardedProps } from '../internals/utils/fields';\nimport { useDefaultizedDateField } from '../internals/hooks/defaultizedFieldProps';\nexport const useDateField = inProps => {\n const props = useDefaultizedDateField(inProps);\n const {\n forwardedProps,\n internalProps\n } = splitFieldInternalAndForwardedProps(props, 'date');\n return useField({\n forwardedProps,\n internalProps,\n valueManager: singleItemValueManager,\n fieldValueManager: singleItemFieldValueManager,\n validator: validateDate,\n valueType: 'date'\n });\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { applyDefaultDate } from '../utils/date-utils';\nimport { useUtils, useDefaultDates } from './useUtils';\nexport const useDefaultizedDateField = props => {\n const utils = useUtils();\n const defaultDates = useDefaultDates();\n return _extends({}, props, {\n disablePast: props.disablePast ?? false,\n disableFuture: props.disableFuture ?? false,\n format: props.format ?? utils.formats.keyboardDate,\n minDate: applyDefaultDate(utils, props.minDate, defaultDates.minDate),\n maxDate: applyDefaultDate(utils, props.maxDate, defaultDates.maxDate)\n });\n};\nexport const useDefaultizedTimeField = props => {\n const utils = useUtils();\n const ampm = props.ampm ?? utils.is12HourCycleInCurrentLocale();\n const defaultFormat = ampm ? utils.formats.fullTime12h : utils.formats.fullTime24h;\n return _extends({}, props, {\n disablePast: props.disablePast ?? false,\n disableFuture: props.disableFuture ?? false,\n format: props.format ?? defaultFormat\n });\n};\nexport const useDefaultizedDateTimeField = props => {\n const utils = useUtils();\n const defaultDates = useDefaultDates();\n const ampm = props.ampm ?? utils.is12HourCycleInCurrentLocale();\n const defaultFormat = ampm ? utils.formats.keyboardDateTime12h : utils.formats.keyboardDateTime24h;\n return _extends({}, props, {\n disablePast: props.disablePast ?? false,\n disableFuture: props.disableFuture ?? false,\n format: props.format ?? defaultFormat,\n disableIgnoringDatePartForTimeValidation: Boolean(props.minDateTime || props.maxDateTime),\n minDate: applyDefaultDate(utils, props.minDateTime ?? props.minDate, defaultDates.minDate),\n maxDate: applyDefaultDate(utils, props.maxDateTime ?? props.maxDate, defaultDates.maxDate),\n minTime: props.minDateTime ?? props.minTime,\n maxTime: props.maxDateTime ?? props.maxTime\n });\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport useEnhancedEffect from '@mui/utils/useEnhancedEffect';\nimport useEventCallback from '@mui/utils/useEventCallback';\nimport { useTheme } from '@mui/material/styles';\nimport { useValidation } from '../useValidation';\nimport { useUtils } from '../useUtils';\nimport { adjustSectionValue, getSectionOrder } from './useField.utils';\nimport { useFieldState } from './useFieldState';\nimport { useFieldCharacterEditing } from './useFieldCharacterEditing';\nimport { useFieldV7TextField } from './useFieldV7TextField';\nimport { useFieldV6TextField } from './useFieldV6TextField';\nexport const useField = params => {\n const utils = useUtils();\n const {\n internalProps,\n internalProps: {\n unstableFieldRef,\n minutesStep,\n enableAccessibleFieldDOMStructure = false,\n disabled = false,\n readOnly = false\n },\n forwardedProps: {\n onKeyDown,\n error,\n clearable,\n onClear\n },\n fieldValueManager,\n valueManager,\n validator\n } = params;\n const theme = useTheme();\n const isRTL = theme.direction === 'rtl';\n const stateResponse = useFieldState(params);\n const {\n state,\n activeSectionIndex,\n parsedSelectedSections,\n setSelectedSections,\n clearValue,\n clearActiveSection,\n updateSectionValue,\n setTempAndroidValueStr,\n sectionsValueBoundaries,\n localizedDigits,\n timezone\n } = stateResponse;\n const characterEditingResponse = useFieldCharacterEditing({\n sections: state.sections,\n updateSectionValue,\n sectionsValueBoundaries,\n localizedDigits,\n setTempAndroidValueStr,\n timezone\n });\n const {\n resetCharacterQuery\n } = characterEditingResponse;\n const areAllSectionsEmpty = valueManager.areValuesEqual(utils, state.value, valueManager.emptyValue);\n const useFieldTextField = enableAccessibleFieldDOMStructure ? useFieldV7TextField : useFieldV6TextField;\n const sectionOrder = React.useMemo(() => getSectionOrder(state.sections, isRTL && !enableAccessibleFieldDOMStructure), [state.sections, isRTL, enableAccessibleFieldDOMStructure]);\n const {\n returnedValue,\n interactions\n } = useFieldTextField(_extends({}, params, stateResponse, characterEditingResponse, {\n areAllSectionsEmpty,\n sectionOrder\n }));\n const handleContainerKeyDown = useEventCallback(event => {\n onKeyDown?.(event);\n\n // eslint-disable-next-line default-case\n switch (true) {\n // Select all\n case (event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'a' && !event.shiftKey && !event.altKey:\n {\n // prevent default to make sure that the next line \"select all\" while updating\n // the internal state at the same time.\n event.preventDefault();\n setSelectedSections('all');\n break;\n }\n case event.key === 'Enter':\n {\n event.preventDefault();\n break;\n }\n\n // Move selection to next section\n case event.key === 'ArrowRight':\n {\n event.preventDefault();\n if (parsedSelectedSections == null) {\n setSelectedSections(sectionOrder.startIndex);\n } else if (parsedSelectedSections === 'all') {\n setSelectedSections(sectionOrder.endIndex);\n } else {\n const nextSectionIndex = sectionOrder.neighbors[parsedSelectedSections].rightIndex;\n if (nextSectionIndex !== null) {\n setSelectedSections(nextSectionIndex);\n }\n }\n break;\n }\n\n // Move selection to previous section\n case event.key === 'ArrowLeft':\n {\n event.preventDefault();\n if (parsedSelectedSections == null) {\n setSelectedSections(sectionOrder.endIndex);\n } else if (parsedSelectedSections === 'all') {\n setSelectedSections(sectionOrder.startIndex);\n } else {\n const nextSectionIndex = sectionOrder.neighbors[parsedSelectedSections].leftIndex;\n if (nextSectionIndex !== null) {\n setSelectedSections(nextSectionIndex);\n }\n }\n break;\n }\n\n // Reset the value of the selected section\n case event.key === 'Delete':\n {\n event.preventDefault();\n if (readOnly) {\n break;\n }\n if (parsedSelectedSections == null || parsedSelectedSections === 'all') {\n clearValue();\n } else {\n clearActiveSection();\n }\n resetCharacterQuery();\n break;\n }\n\n // Increment / decrement the selected section value\n case ['ArrowUp', 'ArrowDown', 'Home', 'End', 'PageUp', 'PageDown'].includes(event.key):\n {\n event.preventDefault();\n if (readOnly || activeSectionIndex == null) {\n break;\n }\n const activeSection = state.sections[activeSectionIndex];\n const activeDateManager = fieldValueManager.getActiveDateManager(utils, state, activeSection);\n const newSectionValue = adjustSectionValue(utils, timezone, activeSection, event.key, sectionsValueBoundaries, localizedDigits, activeDateManager.date, {\n minutesStep\n });\n updateSectionValue({\n activeSection,\n newSectionValue,\n shouldGoToNextSection: false\n });\n break;\n }\n }\n });\n useEnhancedEffect(() => {\n interactions.syncSelectionToDOM();\n });\n const validationError = useValidation(_extends({}, internalProps, {\n value: state.value,\n timezone\n }), validator, valueManager.isSameError, valueManager.defaultErrorState);\n const inputError = React.useMemo(() => {\n // only override when `error` is undefined.\n // in case of multi input fields, the `error` value is provided externally and will always be defined.\n if (error !== undefined) {\n return error;\n }\n return valueManager.hasError(validationError);\n }, [valueManager, validationError, error]);\n React.useEffect(() => {\n if (!inputError && activeSectionIndex == null) {\n resetCharacterQuery();\n }\n }, [state.referenceValue, activeSectionIndex, inputError]); // eslint-disable-line react-hooks/exhaustive-deps\n\n // If `tempValueStrAndroid` is still defined for some section when running `useEffect`,\n // Then `onChange` has only been called once, which means the user pressed `Backspace` to reset the section.\n // This causes a small flickering on Android,\n // But we can't use `useEnhancedEffect` which is always called before the second `onChange` call and then would cause false positives.\n React.useEffect(() => {\n if (state.tempValueStrAndroid != null && activeSectionIndex != null) {\n resetCharacterQuery();\n clearActiveSection();\n }\n }, [state.sections]); // eslint-disable-line react-hooks/exhaustive-deps\n\n React.useImperativeHandle(unstableFieldRef, () => ({\n getSections: () => state.sections,\n getActiveSectionIndex: interactions.getActiveSectionIndexFromDOM,\n setSelectedSections: interactions.setSelectedSections,\n focusField: interactions.focusField,\n isFieldFocused: interactions.isFieldFocused\n }));\n const handleClearValue = useEventCallback((event, ...args) => {\n event.preventDefault();\n onClear?.(event, ...args);\n clearValue();\n if (!interactions.isFieldFocused()) {\n // setSelectedSections is called internally\n interactions.focusField(0);\n } else {\n setSelectedSections(sectionOrder.startIndex);\n }\n });\n const commonForwardedProps = {\n onKeyDown: handleContainerKeyDown,\n onClear: handleClearValue,\n error: inputError,\n clearable: Boolean(clearable && !areAllSectionsEmpty && !readOnly && !disabled)\n };\n const commonAdditionalProps = {\n disabled,\n readOnly\n };\n return _extends({}, params.forwardedProps, commonForwardedProps, commonAdditionalProps, returnedValue);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"clearable\", \"onClear\", \"InputProps\", \"sx\", \"slots\", \"slotProps\"],\n _excluded2 = [\"ownerState\"];\nimport * as React from 'react';\nimport { useSlotProps } from '@mui/base/utils';\nimport MuiIconButton from '@mui/material/IconButton';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport { ClearIcon } from '../icons';\nimport { useLocaleText } from '../internals/hooks/useUtils';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const useClearableField = props => {\n const localeText = useLocaleText();\n const {\n clearable,\n onClear,\n InputProps,\n sx,\n slots,\n slotProps\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const IconButton = slots?.clearButton ?? MuiIconButton;\n // The spread is here to avoid this bug mui/material-ui#34056\n const _useSlotProps = useSlotProps({\n elementType: IconButton,\n externalSlotProps: slotProps?.clearButton,\n ownerState: {},\n className: 'clearButton',\n additionalProps: {\n title: localeText.fieldClearLabel\n }\n }),\n iconButtonProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);\n const EndClearIcon = slots?.clearIcon ?? ClearIcon;\n const endClearIconProps = useSlotProps({\n elementType: EndClearIcon,\n externalSlotProps: slotProps?.clearIcon,\n ownerState: {}\n });\n return _extends({}, other, {\n InputProps: _extends({}, InputProps, {\n endAdornment: /*#__PURE__*/_jsxs(React.Fragment, {\n children: [clearable && /*#__PURE__*/_jsx(InputAdornment, {\n position: \"end\",\n sx: {\n marginRight: InputProps?.endAdornment ? -1 : -1.5\n },\n children: /*#__PURE__*/_jsx(IconButton, _extends({}, iconButtonProps, {\n onClick: onClear,\n children: /*#__PURE__*/_jsx(EndClearIcon, _extends({\n fontSize: \"small\"\n }, endClearIconProps))\n }))\n }), InputProps?.endAdornment]\n })\n }),\n sx: [{\n '& .clearButton': {\n opacity: 1\n },\n '@media (pointer: fine)': {\n '& .clearButton': {\n opacity: 0\n },\n '&:hover, &:focus-within': {\n '.clearButton': {\n opacity: 1\n }\n }\n }\n }, ...(Array.isArray(sx) ? sx : [sx])]\n });\n};","import generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nexport function getPickersTextFieldUtilityClass(slot) {\n return generateUtilityClass('MuiPickersTextField', slot);\n}\nexport const pickersTextFieldClasses = generateUtilityClasses('MuiPickersTextField', ['root', 'focused', 'disabled', 'error', 'required']);","import generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nexport function getPickersInputBaseUtilityClass(slot) {\n return generateUtilityClass('MuiPickersInputBase', slot);\n}\nexport const pickersInputBaseClasses = generateUtilityClasses('MuiPickersInputBase', ['root', 'focused', 'disabled', 'error', 'notchedOutline', 'sectionContent', 'sectionBefore', 'sectionAfter', 'adornedStart', 'adornedEnd', 'input']);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport { pickersInputBaseClasses } from '../PickersInputBase';\nexport function getPickersOutlinedInputUtilityClass(slot) {\n return generateUtilityClass('MuiPickersOutlinedInput', slot);\n}\nexport const pickersOutlinedInputClasses = _extends({}, pickersInputBaseClasses, generateUtilityClasses('MuiPickersOutlinedInput', ['root', 'notchedOutline', 'input']));","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"className\", \"label\", \"notched\", \"shrink\"];\nimport * as React from 'react';\nimport { styled } from '@mui/material/styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst OutlineRoot = styled('fieldset', {\n name: 'MuiPickersOutlinedInput',\n slot: 'NotchedOutline',\n overridesResolver: (props, styles) => styles.notchedOutline\n})(({\n theme\n}) => {\n const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';\n return {\n textAlign: 'left',\n position: 'absolute',\n bottom: 0,\n right: 0,\n top: -5,\n left: 0,\n margin: 0,\n padding: '0 8px',\n pointerEvents: 'none',\n borderRadius: 'inherit',\n borderStyle: 'solid',\n borderWidth: 1,\n overflow: 'hidden',\n minWidth: '0%',\n borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor\n };\n});\nconst OutlineLabel = styled('span')(({\n theme\n}) => ({\n fontFamily: theme.typography.fontFamily,\n fontSize: 'inherit'\n}));\nconst OutlineLegend = styled('legend')(({\n theme\n}) => ({\n float: 'unset',\n // Fix conflict with bootstrap\n width: 'auto',\n // Fix conflict with bootstrap\n overflow: 'hidden',\n // Fix Horizontal scroll when label too long\n variants: [{\n props: {\n withLabel: false\n },\n style: {\n padding: 0,\n lineHeight: '11px',\n // sync with `height` in `legend` styles\n transition: theme.transitions.create('width', {\n duration: 150,\n easing: theme.transitions.easing.easeOut\n })\n }\n }, {\n props: {\n withLabel: true\n },\n style: {\n display: 'block',\n // Fix conflict with normalize.css and sanitize.css\n padding: 0,\n height: 11,\n // sync with `lineHeight` in `legend` styles\n fontSize: '0.75em',\n visibility: 'hidden',\n maxWidth: 0.01,\n transition: theme.transitions.create('max-width', {\n duration: 50,\n easing: theme.transitions.easing.easeOut\n }),\n whiteSpace: 'nowrap',\n '& > span': {\n paddingLeft: 5,\n paddingRight: 5,\n display: 'inline-block',\n opacity: 0,\n visibility: 'visible'\n }\n }\n }, {\n props: {\n withLabel: true,\n notched: true\n },\n style: {\n maxWidth: '100%',\n transition: theme.transitions.create('max-width', {\n duration: 100,\n easing: theme.transitions.easing.easeOut,\n delay: 50\n })\n }\n }]\n}));\n\n/**\n * @ignore - internal component.\n */\nexport default function Outline(props) {\n const {\n className,\n label\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const withLabel = label != null && label !== '';\n const ownerState = _extends({}, props, {\n withLabel\n });\n return /*#__PURE__*/_jsx(OutlineRoot, _extends({\n \"aria-hidden\": true,\n className: className\n }, other, {\n ownerState: ownerState,\n children: /*#__PURE__*/_jsx(OutlineLegend, {\n ownerState: ownerState,\n children: withLabel ? /*#__PURE__*/_jsx(OutlineLabel, {\n children: label\n }) :\n /*#__PURE__*/\n // notranslate needed while Google Translate will not fix zero-width space issue\n _jsx(OutlineLabel, {\n className: \"notranslate\",\n children: \"\\u200B\"\n })\n })\n }));\n}","import generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nexport function getPickersSectionListUtilityClass(slot) {\n return generateUtilityClass('MuiPickersSectionList', slot);\n}\nexport const pickersSectionListClasses = generateUtilityClasses('MuiPickersSectionList', ['root', 'section', 'sectionContent']);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"slots\", \"slotProps\", \"elements\", \"sectionListRef\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useSlotProps } from '@mui/base/utils';\nimport composeClasses from '@mui/utils/composeClasses';\nimport useForkRef from '@mui/utils/useForkRef';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { getPickersSectionListUtilityClass, pickersSectionListClasses } from './pickersSectionListClasses';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const PickersSectionListRoot = styled('div', {\n name: 'MuiPickersSectionList',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({\n direction: 'ltr /*! @noflip */',\n outline: 'none'\n});\nexport const PickersSectionListSection = styled('span', {\n name: 'MuiPickersSectionList',\n slot: 'Section',\n overridesResolver: (props, styles) => styles.section\n})({});\nexport const PickersSectionListSectionSeparator = styled('span', {\n name: 'MuiPickersSectionList',\n slot: 'SectionSeparator',\n overridesResolver: (props, styles) => styles.sectionSeparator\n})({\n whiteSpace: 'pre'\n});\nexport const PickersSectionListSectionContent = styled('span', {\n name: 'MuiPickersSectionList',\n slot: 'SectionContent',\n overridesResolver: (props, styles) => styles.sectionContent\n})({\n outline: 'none'\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root'],\n section: ['section'],\n sectionContent: ['sectionContent']\n };\n return composeClasses(slots, getPickersSectionListUtilityClass, classes);\n};\n/**\n * Demos:\n *\n * - [Custom field](https://mui.com/x/react-date-pickers/custom-field/)\n *\n * API:\n *\n * - [PickersSectionList API](https://mui.com/x/api/date-pickers/pickers-section-list/)\n */\nfunction PickersSection(props) {\n const {\n slots,\n slotProps,\n element,\n classes\n } = props;\n const Section = slots?.section ?? PickersSectionListSection;\n const sectionProps = useSlotProps({\n elementType: Section,\n externalSlotProps: slotProps?.section,\n externalForwardedProps: element.container,\n className: classes.section,\n ownerState: {}\n });\n const SectionContent = slots?.sectionContent ?? PickersSectionListSectionContent;\n const sectionContentProps = useSlotProps({\n elementType: SectionContent,\n externalSlotProps: slotProps?.sectionContent,\n externalForwardedProps: element.content,\n additionalProps: {\n suppressContentEditableWarning: true\n },\n className: classes.sectionContent,\n ownerState: {}\n });\n const SectionSeparator = slots?.sectionSeparator ?? PickersSectionListSectionSeparator;\n const sectionSeparatorBeforeProps = useSlotProps({\n elementType: SectionSeparator,\n externalSlotProps: slotProps?.sectionSeparator,\n externalForwardedProps: element.before,\n ownerState: {\n position: 'before'\n }\n });\n const sectionSeparatorAfterProps = useSlotProps({\n elementType: SectionSeparator,\n externalSlotProps: slotProps?.sectionSeparator,\n externalForwardedProps: element.after,\n ownerState: {\n position: 'after'\n }\n });\n return /*#__PURE__*/_jsxs(Section, _extends({}, sectionProps, {\n children: [/*#__PURE__*/_jsx(SectionSeparator, _extends({}, sectionSeparatorBeforeProps)), /*#__PURE__*/_jsx(SectionContent, _extends({}, sectionContentProps)), /*#__PURE__*/_jsx(SectionSeparator, _extends({}, sectionSeparatorAfterProps))]\n }));\n}\nconst PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSectionList(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersSectionList'\n });\n const {\n slots,\n slotProps,\n elements,\n sectionListRef\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const classes = useUtilityClasses(props);\n const rootRef = React.useRef(null);\n const handleRootRef = useForkRef(ref, rootRef);\n const getRoot = methodName => {\n if (!rootRef.current) {\n throw new Error(`MUI X: Cannot call sectionListRef.${methodName} before the mount of the component.`);\n }\n return rootRef.current;\n };\n React.useImperativeHandle(sectionListRef, () => ({\n getRoot() {\n return getRoot('getRoot');\n },\n getSectionContainer(index) {\n const root = getRoot('getSectionContainer');\n return root.querySelector(`.${pickersSectionListClasses.section}[data-sectionindex=\"${index}\"]`);\n },\n getSectionContent(index) {\n const root = getRoot('getSectionContent');\n return root.querySelector(`.${pickersSectionListClasses.section}[data-sectionindex=\"${index}\"] .${pickersSectionListClasses.sectionContent}`);\n },\n getSectionIndexFromDOMElement(element) {\n const root = getRoot('getSectionIndexFromDOMElement');\n if (element == null || !root.contains(element)) {\n return null;\n }\n let sectionContainer = null;\n if (element.classList.contains(pickersSectionListClasses.section)) {\n sectionContainer = element;\n } else if (element.classList.contains(pickersSectionListClasses.sectionContent)) {\n sectionContainer = element.parentElement;\n }\n if (sectionContainer == null) {\n return null;\n }\n return Number(sectionContainer.dataset.sectionindex);\n }\n }));\n const Root = slots?.root ?? PickersSectionListRoot;\n const rootProps = useSlotProps({\n elementType: Root,\n externalSlotProps: slotProps?.root,\n externalForwardedProps: other,\n additionalProps: {\n ref: handleRootRef,\n suppressContentEditableWarning: true\n },\n className: classes.root,\n ownerState: {}\n });\n return /*#__PURE__*/_jsx(Root, _extends({}, rootProps, {\n children: rootProps.contentEditable ? elements.map(({\n content,\n before,\n after\n }) => `${before.children}${content.children}${after.children}`).join('') : /*#__PURE__*/_jsx(React.Fragment, {\n children: elements.map((element, elementIndex) => /*#__PURE__*/_jsx(PickersSection, {\n slots: slots,\n slotProps: slotProps,\n element: element,\n classes: classes\n }, elementIndex))\n })\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? PickersSectionList.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * If true, the whole element is editable.\n * Useful when all the sections are selected.\n */\n contentEditable: PropTypes.bool.isRequired,\n /**\n * The elements to render.\n * Each element contains the prop to edit a section of the value.\n */\n elements: PropTypes.arrayOf(PropTypes.shape({\n after: PropTypes.object.isRequired,\n before: PropTypes.object.isRequired,\n container: PropTypes.object.isRequired,\n content: PropTypes.object.isRequired\n })).isRequired,\n sectionListRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n getRoot: PropTypes.func.isRequired,\n getSectionContainer: PropTypes.func.isRequired,\n getSectionContent: PropTypes.func.isRequired,\n getSectionIndexFromDOMElement: PropTypes.func.isRequired\n })\n })]),\n /**\n * The props used for each component slot.\n */\n slotProps: PropTypes.object,\n /**\n * Overridable component slots.\n */\n slots: PropTypes.object\n} : void 0;\nexport { PickersSectionList };","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"elements\", \"areAllSectionsEmpty\", \"defaultValue\", \"label\", \"value\", \"onChange\", \"id\", \"autoFocus\", \"endAdornment\", \"startAdornment\", \"renderSuffix\", \"slots\", \"slotProps\", \"contentEditable\", \"tabIndex\", \"onInput\", \"onPaste\", \"onKeyDown\", \"fullWidth\", \"name\", \"readOnly\", \"inputProps\", \"inputRef\", \"sectionListRef\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useFormControl } from '@mui/material/FormControl';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport useForkRef from '@mui/utils/useForkRef';\nimport { refType } from '@mui/utils';\nimport composeClasses from '@mui/utils/composeClasses';\nimport capitalize from '@mui/utils/capitalize';\nimport { useSlotProps } from '@mui/base/utils';\nimport visuallyHidden from '@mui/utils/visuallyHidden';\nimport { pickersInputBaseClasses, getPickersInputBaseUtilityClass } from './pickersInputBaseClasses';\nimport { Unstable_PickersSectionList as PickersSectionList, Unstable_PickersSectionListRoot as PickersSectionListRoot, Unstable_PickersSectionListSection as PickersSectionListSection, Unstable_PickersSectionListSectionSeparator as PickersSectionListSectionSeparator, Unstable_PickersSectionListSectionContent as PickersSectionListSectionContent } from '../../PickersSectionList';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst round = value => Math.round(value * 1e5) / 1e5;\nexport const PickersInputBaseRoot = styled('div', {\n name: 'MuiPickersInputBase',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})(({\n theme\n}) => _extends({}, theme.typography.body1, {\n color: (theme.vars || theme).palette.text.primary,\n cursor: 'text',\n padding: 0,\n display: 'flex',\n justifyContent: 'flex-start',\n alignItems: 'center',\n position: 'relative',\n boxSizing: 'border-box',\n // Prevent padding issue with fullWidth.\n letterSpacing: `${round(0.15 / 16)}em`,\n variants: [{\n props: {\n fullWidth: true\n },\n style: {\n width: '100%'\n }\n }]\n}));\nexport const PickersInputBaseSectionsContainer = styled(PickersSectionListRoot, {\n name: 'MuiPickersInputBase',\n slot: 'SectionsContainer',\n overridesResolver: (props, styles) => styles.sectionsContainer\n})(({\n theme\n}) => _extends({\n padding: '4px 0 5px',\n fontFamily: theme.typography.fontFamily,\n fontSize: 'inherit',\n lineHeight: '1.4375em',\n // 23px\n flexGrow: 1,\n outline: 'none',\n display: 'flex',\n flexWrap: 'nowrap',\n overflow: 'hidden',\n letterSpacing: 'inherit',\n // Baseline behavior\n width: '182px'\n}, theme.direction === 'rtl' && {\n textAlign: 'right /*! @noflip */'\n}, {\n variants: [{\n props: {\n size: 'small'\n },\n style: {\n paddingTop: 1\n }\n }, {\n props: {\n adornedStart: false,\n focused: false,\n filled: false\n },\n style: {\n color: 'currentColor',\n opacity: 0\n }\n }, {\n // Can't use the object notation because label can be null or undefined\n props: ({\n adornedStart,\n focused,\n filled,\n label\n }) => !adornedStart && !focused && !filled && label == null,\n style: theme.vars ? {\n opacity: theme.vars.opacity.inputPlaceholder\n } : {\n opacity: theme.palette.mode === 'light' ? 0.42 : 0.5\n }\n }]\n}));\nconst PickersInputBaseSection = styled(PickersSectionListSection, {\n name: 'MuiPickersInputBase',\n slot: 'Section',\n overridesResolver: (props, styles) => styles.section\n})(({\n theme\n}) => ({\n fontFamily: theme.typography.fontFamily,\n fontSize: 'inherit',\n letterSpacing: 'inherit',\n lineHeight: '1.4375em',\n // 23px\n display: 'flex'\n}));\nconst PickersInputBaseSectionContent = styled(PickersSectionListSectionContent, {\n name: 'MuiPickersInputBase',\n slot: 'SectionContent',\n overridesResolver: (props, styles) => styles.content\n})(({\n theme\n}) => ({\n fontFamily: theme.typography.fontFamily,\n lineHeight: '1.4375em',\n // 23px\n letterSpacing: 'inherit',\n width: 'fit-content',\n outline: 'none'\n}));\nconst PickersInputBaseSectionSeparator = styled(PickersSectionListSectionSeparator, {\n name: 'MuiPickersInputBase',\n slot: 'Separator',\n overridesResolver: (props, styles) => styles.separator\n})(() => ({\n whiteSpace: 'pre',\n letterSpacing: 'inherit'\n}));\nconst PickersInputBaseInput = styled('input', {\n name: 'MuiPickersInputBase',\n slot: 'Input',\n overridesResolver: (props, styles) => styles.hiddenInput\n})(_extends({}, visuallyHidden));\nconst useUtilityClasses = ownerState => {\n const {\n focused,\n disabled,\n error,\n classes,\n fullWidth,\n readOnly,\n color,\n size,\n endAdornment,\n startAdornment\n } = ownerState;\n const slots = {\n root: ['root', focused && !disabled && 'focused', disabled && 'disabled', readOnly && 'readOnly', error && 'error', fullWidth && 'fullWidth', `color${capitalize(color)}`, size === 'small' && 'inputSizeSmall', Boolean(startAdornment) && 'adornedStart', Boolean(endAdornment) && 'adornedEnd'],\n notchedOutline: ['notchedOutline'],\n input: ['input'],\n sectionsContainer: ['sectionsContainer'],\n sectionContent: ['sectionContent'],\n sectionBefore: ['sectionBefore'],\n sectionAfter: ['sectionAfter']\n };\n return composeClasses(slots, getPickersInputBaseUtilityClass, classes);\n};\n/**\n * @ignore - internal component.\n */\nconst PickersInputBase = /*#__PURE__*/React.forwardRef(function PickersInputBase(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersInputBase'\n });\n const {\n elements,\n areAllSectionsEmpty,\n value,\n onChange,\n id,\n endAdornment,\n startAdornment,\n renderSuffix,\n slots,\n slotProps,\n contentEditable,\n tabIndex,\n onInput,\n onPaste,\n onKeyDown,\n name,\n readOnly,\n inputProps,\n inputRef,\n sectionListRef\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootRef = React.useRef(null);\n const handleRootRef = useForkRef(ref, rootRef);\n const handleInputRef = useForkRef(inputProps?.ref, inputRef);\n const muiFormControl = useFormControl();\n if (!muiFormControl) {\n throw new Error('MUI X: PickersInputBase should always be used inside a PickersTextField component');\n }\n const handleInputFocus = event => {\n // Fix a bug with IE11 where the focus/blur events are triggered\n // while the component is disabled.\n if (muiFormControl.disabled) {\n event.stopPropagation();\n return;\n }\n muiFormControl.onFocus?.(event);\n };\n React.useEffect(() => {\n if (muiFormControl) {\n muiFormControl.setAdornedStart(Boolean(startAdornment));\n }\n }, [muiFormControl, startAdornment]);\n React.useEffect(() => {\n if (!muiFormControl) {\n return;\n }\n if (areAllSectionsEmpty) {\n muiFormControl.onEmpty();\n } else {\n muiFormControl.onFilled();\n }\n }, [muiFormControl, areAllSectionsEmpty]);\n const ownerState = _extends({}, props, muiFormControl);\n const classes = useUtilityClasses(ownerState);\n const InputRoot = slots?.root || PickersInputBaseRoot;\n const inputRootProps = useSlotProps({\n elementType: InputRoot,\n externalSlotProps: slotProps?.root,\n externalForwardedProps: other,\n additionalProps: {\n 'aria-invalid': muiFormControl.error,\n ref: handleRootRef\n },\n className: classes.root,\n ownerState\n });\n const InputSectionsContainer = slots?.input || PickersInputBaseSectionsContainer;\n return /*#__PURE__*/_jsxs(InputRoot, _extends({}, inputRootProps, {\n children: [startAdornment, /*#__PURE__*/_jsx(PickersSectionList, {\n sectionListRef: sectionListRef,\n elements: elements,\n contentEditable: contentEditable,\n tabIndex: tabIndex,\n className: classes.sectionsContainer,\n onFocus: handleInputFocus,\n onBlur: muiFormControl.onBlur,\n onInput: onInput,\n onPaste: onPaste,\n onKeyDown: onKeyDown,\n slots: {\n root: InputSectionsContainer,\n section: PickersInputBaseSection,\n sectionContent: PickersInputBaseSectionContent,\n sectionSeparator: PickersInputBaseSectionSeparator\n },\n slotProps: {\n root: {\n ownerState\n },\n sectionContent: {\n className: pickersInputBaseClasses.sectionContent\n },\n sectionSeparator: ({\n position\n }) => ({\n className: position === 'before' ? pickersInputBaseClasses.sectionBefore : pickersInputBaseClasses.sectionAfter\n })\n }\n }), endAdornment, renderSuffix ? renderSuffix(_extends({}, muiFormControl)) : null, /*#__PURE__*/_jsx(PickersInputBaseInput, _extends({\n name: name,\n className: classes.input,\n value: value,\n onChange: onChange,\n id: id,\n \"aria-hidden\": \"true\",\n tabIndex: -1,\n readOnly: readOnly,\n required: muiFormControl.required,\n disabled: muiFormControl.disabled\n }, inputProps, {\n ref: handleInputRef\n }))]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? PickersInputBase.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Is `true` if the current values equals the empty value.\n * For a single item value, it means that `value === null`\n * For a range value, it means that `value === [null, null]`\n */\n areAllSectionsEmpty: PropTypes.bool.isRequired,\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * If true, the whole element is editable.\n * Useful when all the sections are selected.\n */\n contentEditable: PropTypes.bool.isRequired,\n /**\n * The elements to render.\n * Each element contains the prop to edit a section of the value.\n */\n elements: PropTypes.arrayOf(PropTypes.shape({\n after: PropTypes.object.isRequired,\n before: PropTypes.object.isRequired,\n container: PropTypes.object.isRequired,\n content: PropTypes.object.isRequired\n })).isRequired,\n endAdornment: PropTypes.node,\n fullWidth: PropTypes.bool,\n id: PropTypes.string,\n inputProps: PropTypes.object,\n inputRef: refType,\n label: PropTypes.node,\n margin: PropTypes.oneOf(['dense', 'none', 'normal']),\n name: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n onClick: PropTypes.func.isRequired,\n onInput: PropTypes.func.isRequired,\n onKeyDown: PropTypes.func.isRequired,\n onPaste: PropTypes.func.isRequired,\n ownerState: PropTypes.any,\n readOnly: PropTypes.bool,\n renderSuffix: PropTypes.func,\n sectionListRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n getRoot: PropTypes.func.isRequired,\n getSectionContainer: PropTypes.func.isRequired,\n getSectionContent: PropTypes.func.isRequired,\n getSectionIndexFromDOMElement: PropTypes.func.isRequired\n })\n })]),\n /**\n * The props used for each component slot.\n * @default {}\n */\n slotProps: PropTypes.object,\n /**\n * The components used for each slot inside.\n *\n * @default {}\n */\n slots: PropTypes.object,\n startAdornment: PropTypes.node,\n style: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n value: PropTypes.string.isRequired\n} : void 0;\nexport { PickersInputBase };","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"label\", \"autoFocus\", \"ownerState\", \"notched\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useFormControl } from '@mui/material/FormControl';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { refType } from '@mui/utils';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { pickersOutlinedInputClasses, getPickersOutlinedInputUtilityClass } from './pickersOutlinedInputClasses';\nimport Outline from './Outline';\nimport { PickersInputBase } from '../PickersInputBase';\nimport { PickersInputBaseRoot, PickersInputBaseSectionsContainer } from '../PickersInputBase/PickersInputBase';\nimport { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nconst PickersOutlinedInputRoot = styled(PickersInputBaseRoot, {\n name: 'MuiPickersOutlinedInput',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})(({\n theme\n}) => {\n const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';\n return {\n padding: '0 14px',\n borderRadius: (theme.vars || theme).shape.borderRadius,\n [`&:hover .${pickersOutlinedInputClasses.notchedOutline}`]: {\n borderColor: (theme.vars || theme).palette.text.primary\n },\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n [`&:hover .${pickersOutlinedInputClasses.notchedOutline}`]: {\n borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor\n }\n },\n [`&.${pickersOutlinedInputClasses.focused} .${pickersOutlinedInputClasses.notchedOutline}`]: {\n borderStyle: 'solid',\n borderWidth: 2\n },\n [`&.${pickersOutlinedInputClasses.disabled}`]: {\n [`& .${pickersOutlinedInputClasses.notchedOutline}`]: {\n borderColor: (theme.vars || theme).palette.action.disabled\n },\n '*': {\n color: (theme.vars || theme).palette.action.disabled\n }\n },\n [`&.${pickersOutlinedInputClasses.error} .${pickersOutlinedInputClasses.notchedOutline}`]: {\n borderColor: (theme.vars || theme).palette.error.main\n },\n variants: Object.keys((theme.vars ?? theme).palette)\n // @ts-ignore\n .filter(key => (theme.vars ?? theme).palette[key].main).map(color => ({\n props: {\n color\n },\n style: {\n [`&.${pickersOutlinedInputClasses.focused}:not(.${pickersOutlinedInputClasses.error}) .${pickersOutlinedInputClasses.notchedOutline}`]: {\n // @ts-ignore\n borderColor: (theme.vars || theme).palette[color].main\n }\n }\n }))\n };\n});\nconst PickersOutlinedInputSectionsContainer = styled(PickersInputBaseSectionsContainer, {\n name: 'MuiPickersOutlinedInput',\n slot: 'SectionsContainer',\n overridesResolver: (props, styles) => styles.sectionsContainer\n})({\n padding: '16.5px 0',\n variants: [{\n props: {\n size: 'small'\n },\n style: {\n padding: '8.5px 0'\n }\n }]\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root'],\n notchedOutline: ['notchedOutline'],\n input: ['input']\n };\n const composedClasses = composeClasses(slots, getPickersOutlinedInputUtilityClass, classes);\n return _extends({}, classes, composedClasses);\n};\n/**\n * @ignore - internal component.\n */\nconst PickersOutlinedInput = /*#__PURE__*/React.forwardRef(function PickersOutlinedInput(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersOutlinedInput'\n });\n const {\n label,\n ownerState: ownerStateProp,\n notched\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const muiFormControl = useFormControl();\n const ownerState = _extends({}, props, ownerStateProp, muiFormControl, {\n color: muiFormControl?.color || 'primary'\n });\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(PickersInputBase, _extends({\n slots: {\n root: PickersOutlinedInputRoot,\n input: PickersOutlinedInputSectionsContainer\n },\n renderSuffix: state => /*#__PURE__*/_jsx(Outline, {\n shrink: Boolean(notched || state.adornedStart || state.focused || state.filled),\n notched: Boolean(notched || state.adornedStart || state.focused || state.filled),\n className: classes.notchedOutline,\n label: label != null && label !== '' && muiFormControl?.required ? /*#__PURE__*/_jsxs(React.Fragment, {\n children: [label, \"\\u2009\", '*']\n }) : label,\n ownerState: ownerState\n })\n }, other, {\n label: label,\n classes: classes,\n ref: ref\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? PickersOutlinedInput.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Is `true` if the current values equals the empty value.\n * For a single item value, it means that `value === null`\n * For a range value, it means that `value === [null, null]`\n */\n areAllSectionsEmpty: PropTypes.bool.isRequired,\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * If true, the whole element is editable.\n * Useful when all the sections are selected.\n */\n contentEditable: PropTypes.bool.isRequired,\n /**\n * The elements to render.\n * Each element contains the prop to edit a section of the value.\n */\n elements: PropTypes.arrayOf(PropTypes.shape({\n after: PropTypes.object.isRequired,\n before: PropTypes.object.isRequired,\n container: PropTypes.object.isRequired,\n content: PropTypes.object.isRequired\n })).isRequired,\n endAdornment: PropTypes.node,\n fullWidth: PropTypes.bool,\n id: PropTypes.string,\n inputProps: PropTypes.object,\n inputRef: refType,\n label: PropTypes.node,\n margin: PropTypes.oneOf(['dense', 'none', 'normal']),\n name: PropTypes.string,\n notched: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n onClick: PropTypes.func.isRequired,\n onInput: PropTypes.func.isRequired,\n onKeyDown: PropTypes.func.isRequired,\n onPaste: PropTypes.func.isRequired,\n ownerState: PropTypes.any,\n readOnly: PropTypes.bool,\n renderSuffix: PropTypes.func,\n sectionListRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n getRoot: PropTypes.func.isRequired,\n getSectionContainer: PropTypes.func.isRequired,\n getSectionContent: PropTypes.func.isRequired,\n getSectionIndexFromDOMElement: PropTypes.func.isRequired\n })\n })]),\n /**\n * The props used for each component slot.\n * @default {}\n */\n slotProps: PropTypes.object,\n /**\n * The components used for each slot inside.\n *\n * @default {}\n */\n slots: PropTypes.object,\n startAdornment: PropTypes.node,\n style: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n value: PropTypes.string.isRequired\n} : void 0;\nexport { PickersOutlinedInput };\nPickersOutlinedInput.muiName = 'Input';","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport { pickersInputBaseClasses } from '../PickersInputBase';\nexport function getPickersFilledInputUtilityClass(slot) {\n return generateUtilityClass('MuiPickersFilledInput', slot);\n}\nexport const pickersFilledInputClasses = _extends({}, pickersInputBaseClasses, generateUtilityClasses('MuiPickersFilledInput', ['root', 'underline', 'input']));","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"label\", \"autoFocus\", \"disableUnderline\", \"ownerState\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useFormControl } from '@mui/material/FormControl';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { shouldForwardProp } from '@mui/system';\nimport { refType } from '@mui/utils';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { pickersFilledInputClasses, getPickersFilledInputUtilityClass } from './pickersFilledInputClasses';\nimport { PickersInputBase } from '../PickersInputBase';\nimport { PickersInputBaseRoot, PickersInputBaseSectionsContainer } from '../PickersInputBase/PickersInputBase';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PickersFilledInputRoot = styled(PickersInputBaseRoot, {\n name: 'MuiPickersFilledInput',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root,\n shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'disableUnderline'\n})(({\n theme\n}) => {\n const light = theme.palette.mode === 'light';\n const bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';\n const backgroundColor = light ? 'rgba(0, 0, 0, 0.06)' : 'rgba(255, 255, 255, 0.09)';\n const hoverBackground = light ? 'rgba(0, 0, 0, 0.09)' : 'rgba(255, 255, 255, 0.13)';\n const disabledBackground = light ? 'rgba(0, 0, 0, 0.12)' : 'rgba(255, 255, 255, 0.12)';\n return {\n backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor,\n borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,\n borderTopRightRadius: (theme.vars || theme).shape.borderRadius,\n transition: theme.transitions.create('background-color', {\n duration: theme.transitions.duration.shorter,\n easing: theme.transitions.easing.easeOut\n }),\n '&:hover': {\n backgroundColor: theme.vars ? theme.vars.palette.FilledInput.hoverBg : hoverBackground,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor\n }\n },\n [`&.${pickersFilledInputClasses.focused}`]: {\n backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor\n },\n [`&.${pickersFilledInputClasses.disabled}`]: {\n backgroundColor: theme.vars ? theme.vars.palette.FilledInput.disabledBg : disabledBackground\n },\n variants: [...Object.keys((theme.vars ?? theme).palette)\n // @ts-ignore\n .filter(key => (theme.vars ?? theme).palette[key].main).map(color => ({\n props: {\n color,\n disableUnderline: false\n },\n style: {\n '&::after': {\n // @ts-ignore\n borderBottom: `2px solid ${(theme.vars || theme).palette[color]?.main}`\n }\n }\n })), {\n props: {\n disableUnderline: false\n },\n style: {\n '&::after': {\n left: 0,\n bottom: 0,\n // Doing the other way around crash on IE11 \"''\" https://github.com/cssinjs/jss/issues/242\n content: '\"\"',\n position: 'absolute',\n right: 0,\n transform: 'scaleX(0)',\n transition: theme.transitions.create('transform', {\n duration: theme.transitions.duration.shorter,\n easing: theme.transitions.easing.easeOut\n }),\n pointerEvents: 'none' // Transparent to the hover style.\n },\n [`&.${pickersFilledInputClasses.focused}:after`]: {\n // translateX(0) is a workaround for Safari transform scale bug\n // See https://github.com/mui/material-ui/issues/31766\n transform: 'scaleX(1) translateX(0)'\n },\n [`&.${pickersFilledInputClasses.error}`]: {\n '&:before, &:after': {\n borderBottomColor: (theme.vars || theme).palette.error.main\n }\n },\n '&::before': {\n borderBottom: `1px solid ${theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / ${theme.vars.opacity.inputUnderline})` : bottomLineColor}`,\n left: 0,\n bottom: 0,\n // Doing the other way around crash on IE11 \"''\" https://github.com/cssinjs/jss/issues/242\n content: '\"\\\\00a0\"',\n position: 'absolute',\n right: 0,\n transition: theme.transitions.create('border-bottom-color', {\n duration: theme.transitions.duration.shorter\n }),\n pointerEvents: 'none' // Transparent to the hover style.\n },\n [`&:hover:not(.${pickersFilledInputClasses.disabled}, .${pickersFilledInputClasses.error}):before`]: {\n borderBottom: `1px solid ${(theme.vars || theme).palette.text.primary}`\n },\n [`&.${pickersFilledInputClasses.disabled}:before`]: {\n borderBottomStyle: 'dotted'\n }\n }\n }, {\n props: ({\n startAdornment\n }) => !!startAdornment,\n style: {\n paddingLeft: 12\n }\n }, {\n props: ({\n endAdornment\n }) => !!endAdornment,\n style: {\n paddingRight: 12\n }\n }]\n };\n});\nconst PickersFilledSectionsContainer = styled(PickersInputBaseSectionsContainer, {\n name: 'MuiPickersFilledInput',\n slot: 'sectionsContainer',\n overridesResolver: (props, styles) => styles.sectionsContainer\n})({\n paddingTop: 25,\n paddingRight: 12,\n paddingBottom: 8,\n paddingLeft: 12,\n variants: [{\n props: {\n size: 'small'\n },\n style: {\n paddingTop: 21,\n paddingBottom: 4\n }\n }, {\n props: ({\n startAdornment\n }) => !!startAdornment,\n style: {\n paddingLeft: 0\n }\n }, {\n props: ({\n endAdornment\n }) => !!endAdornment,\n style: {\n paddingRight: 0\n }\n }, {\n props: {\n hiddenLabel: true\n },\n style: {\n paddingTop: 16,\n paddingBottom: 17\n }\n }, {\n props: {\n hiddenLabel: true,\n size: 'small'\n },\n style: {\n paddingTop: 8,\n paddingBottom: 9\n }\n }]\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n disableUnderline\n } = ownerState;\n const slots = {\n root: ['root', !disableUnderline && 'underline'],\n input: ['input']\n };\n const composedClasses = composeClasses(slots, getPickersFilledInputUtilityClass, classes);\n return _extends({}, classes, composedClasses);\n};\n/**\n * @ignore - internal component.\n */\nconst PickersFilledInput = /*#__PURE__*/React.forwardRef(function PickersFilledInput(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersFilledInput'\n });\n const {\n label,\n disableUnderline = false,\n ownerState: ownerStateProp\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const muiFormControl = useFormControl();\n const ownerState = _extends({}, props, ownerStateProp, muiFormControl, {\n color: muiFormControl?.color || 'primary'\n });\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(PickersInputBase, _extends({\n slots: {\n root: PickersFilledInputRoot,\n input: PickersFilledSectionsContainer\n },\n slotProps: {\n root: {\n disableUnderline\n }\n }\n }, other, {\n label: label,\n classes: classes,\n ref: ref\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? PickersFilledInput.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Is `true` if the current values equals the empty value.\n * For a single item value, it means that `value === null`\n * For a range value, it means that `value === [null, null]`\n */\n areAllSectionsEmpty: PropTypes.bool.isRequired,\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * If true, the whole element is editable.\n * Useful when all the sections are selected.\n */\n contentEditable: PropTypes.bool.isRequired,\n disableUnderline: PropTypes.bool,\n /**\n * The elements to render.\n * Each element contains the prop to edit a section of the value.\n */\n elements: PropTypes.arrayOf(PropTypes.shape({\n after: PropTypes.object.isRequired,\n before: PropTypes.object.isRequired,\n container: PropTypes.object.isRequired,\n content: PropTypes.object.isRequired\n })).isRequired,\n endAdornment: PropTypes.node,\n fullWidth: PropTypes.bool,\n hiddenLabel: PropTypes.bool,\n id: PropTypes.string,\n inputProps: PropTypes.object,\n inputRef: refType,\n label: PropTypes.node,\n margin: PropTypes.oneOf(['dense', 'none', 'normal']),\n name: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n onClick: PropTypes.func.isRequired,\n onInput: PropTypes.func.isRequired,\n onKeyDown: PropTypes.func.isRequired,\n onPaste: PropTypes.func.isRequired,\n ownerState: PropTypes.any,\n readOnly: PropTypes.bool,\n renderSuffix: PropTypes.func,\n sectionListRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n getRoot: PropTypes.func.isRequired,\n getSectionContainer: PropTypes.func.isRequired,\n getSectionContent: PropTypes.func.isRequired,\n getSectionIndexFromDOMElement: PropTypes.func.isRequired\n })\n })]),\n /**\n * The props used for each component slot.\n * @default {}\n */\n slotProps: PropTypes.object,\n /**\n * The components used for each slot inside.\n *\n * @default {}\n */\n slots: PropTypes.object,\n startAdornment: PropTypes.node,\n style: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n value: PropTypes.string.isRequired\n} : void 0;\nexport { PickersFilledInput };\nPickersFilledInput.muiName = 'Input';","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport { pickersInputBaseClasses } from '../PickersInputBase';\nexport function getPickersInputUtilityClass(slot) {\n return generateUtilityClass('MuiPickersFilledInput', slot);\n}\nexport const pickersInputClasses = _extends({}, pickersInputBaseClasses, generateUtilityClasses('MuiPickersInput', ['root', 'input']));","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"label\", \"autoFocus\", \"disableUnderline\", \"ownerState\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useFormControl } from '@mui/material/FormControl';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { refType } from '@mui/utils';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { pickersInputClasses, getPickersInputUtilityClass } from './pickersInputClasses';\nimport { PickersInputBase } from '../PickersInputBase';\nimport { PickersInputBaseRoot } from '../PickersInputBase/PickersInputBase';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PickersInputRoot = styled(PickersInputBaseRoot, {\n name: 'MuiPickersInput',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})(({\n theme\n}) => {\n const light = theme.palette.mode === 'light';\n let bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';\n if (theme.vars) {\n bottomLineColor = `rgba(${theme.vars.palette.common.onBackgroundChannel} / ${theme.vars.opacity.inputUnderline})`;\n }\n return {\n 'label + &': {\n marginTop: 16\n },\n variants: [...Object.keys((theme.vars ?? theme).palette)\n // @ts-ignore\n .filter(key => (theme.vars ?? theme).palette[key].main).map(color => ({\n props: {\n color\n },\n style: {\n '&::after': {\n // @ts-ignore\n borderBottom: `2px solid ${(theme.vars || theme).palette[color].main}`\n }\n }\n })), {\n props: {\n disableUnderline: false\n },\n style: {\n '&::after': {\n background: 'red',\n left: 0,\n bottom: 0,\n // Doing the other way around crash on IE11 \"''\" https://github.com/cssinjs/jss/issues/242\n content: '\"\"',\n position: 'absolute',\n right: 0,\n transform: 'scaleX(0)',\n transition: theme.transitions.create('transform', {\n duration: theme.transitions.duration.shorter,\n easing: theme.transitions.easing.easeOut\n }),\n pointerEvents: 'none' // Transparent to the hover style.\n },\n [`&.${pickersInputClasses.focused}:after`]: {\n // translateX(0) is a workaround for Safari transform scale bug\n // See https://github.com/mui/material-ui/issues/31766\n transform: 'scaleX(1) translateX(0)'\n },\n [`&.${pickersInputClasses.error}`]: {\n '&:before, &:after': {\n borderBottomColor: (theme.vars || theme).palette.error.main\n }\n },\n '&::before': {\n borderBottom: `1px solid ${bottomLineColor}`,\n left: 0,\n bottom: 0,\n // Doing the other way around crash on IE11 \"''\" https://github.com/cssinjs/jss/issues/242\n content: '\"\\\\00a0\"',\n position: 'absolute',\n right: 0,\n transition: theme.transitions.create('border-bottom-color', {\n duration: theme.transitions.duration.shorter\n }),\n pointerEvents: 'none' // Transparent to the hover style.\n },\n [`&:hover:not(.${pickersInputClasses.disabled}, .${pickersInputClasses.error}):before`]: {\n borderBottom: `2px solid ${(theme.vars || theme).palette.text.primary}`,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n borderBottom: `1px solid ${bottomLineColor}`\n }\n },\n [`&.${pickersInputClasses.disabled}:before`]: {\n borderBottomStyle: 'dotted'\n }\n }\n }]\n };\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n disableUnderline\n } = ownerState;\n const slots = {\n root: ['root', !disableUnderline && 'underline'],\n input: ['input']\n };\n const composedClasses = composeClasses(slots, getPickersInputUtilityClass, classes);\n return _extends({}, classes, composedClasses);\n};\n/**\n * @ignore - internal component.\n */\nconst PickersInput = /*#__PURE__*/React.forwardRef(function PickersInput(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersInput'\n });\n const {\n label,\n disableUnderline = false,\n ownerState: ownerStateProp\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const muiFormControl = useFormControl();\n const ownerState = _extends({}, props, ownerStateProp, muiFormControl, {\n disableUnderline,\n color: muiFormControl?.color || 'primary'\n });\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(PickersInputBase, _extends({\n slots: {\n root: PickersInputRoot\n }\n }, other, {\n label: label,\n classes: classes,\n ref: ref\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? PickersInput.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Is `true` if the current values equals the empty value.\n * For a single item value, it means that `value === null`\n * For a range value, it means that `value === [null, null]`\n */\n areAllSectionsEmpty: PropTypes.bool.isRequired,\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * If true, the whole element is editable.\n * Useful when all the sections are selected.\n */\n contentEditable: PropTypes.bool.isRequired,\n disableUnderline: PropTypes.bool,\n /**\n * The elements to render.\n * Each element contains the prop to edit a section of the value.\n */\n elements: PropTypes.arrayOf(PropTypes.shape({\n after: PropTypes.object.isRequired,\n before: PropTypes.object.isRequired,\n container: PropTypes.object.isRequired,\n content: PropTypes.object.isRequired\n })).isRequired,\n endAdornment: PropTypes.node,\n fullWidth: PropTypes.bool,\n id: PropTypes.string,\n inputProps: PropTypes.object,\n inputRef: refType,\n label: PropTypes.node,\n margin: PropTypes.oneOf(['dense', 'none', 'normal']),\n name: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n onClick: PropTypes.func.isRequired,\n onInput: PropTypes.func.isRequired,\n onKeyDown: PropTypes.func.isRequired,\n onPaste: PropTypes.func.isRequired,\n ownerState: PropTypes.any,\n readOnly: PropTypes.bool,\n renderSuffix: PropTypes.func,\n sectionListRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n getRoot: PropTypes.func.isRequired,\n getSectionContainer: PropTypes.func.isRequired,\n getSectionContent: PropTypes.func.isRequired,\n getSectionIndexFromDOMElement: PropTypes.func.isRequired\n })\n })]),\n /**\n * The props used for each component slot.\n * @default {}\n */\n slotProps: PropTypes.object,\n /**\n * The components used for each slot inside.\n *\n * @default {}\n */\n slots: PropTypes.object,\n startAdornment: PropTypes.node,\n style: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n value: PropTypes.string.isRequired\n} : void 0;\nexport { PickersInput };\nPickersInput.muiName = 'Input';","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"onFocus\", \"onBlur\", \"className\", \"color\", \"disabled\", \"error\", \"variant\", \"required\", \"InputProps\", \"inputProps\", \"inputRef\", \"sectionListRef\", \"elements\", \"areAllSectionsEmpty\", \"onClick\", \"onKeyDown\", \"onKeyUp\", \"onPaste\", \"onInput\", \"endAdornment\", \"startAdornment\", \"tabIndex\", \"contentEditable\", \"focused\", \"value\", \"onChange\", \"fullWidth\", \"id\", \"name\", \"helperText\", \"FormHelperTextProps\", \"label\", \"InputLabelProps\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { refType } from '@mui/utils';\nimport useForkRef from '@mui/utils/useForkRef';\nimport composeClasses from '@mui/utils/composeClasses';\nimport useId from '@mui/utils/useId';\nimport InputLabel from '@mui/material/InputLabel';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\nimport { getPickersTextFieldUtilityClass } from './pickersTextFieldClasses';\nimport { PickersOutlinedInput } from './PickersOutlinedInput';\nimport { PickersFilledInput } from './PickersFilledInput';\nimport { PickersInput } from './PickersInput';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst VARIANT_COMPONENT = {\n standard: PickersInput,\n filled: PickersFilledInput,\n outlined: PickersOutlinedInput\n};\nconst PickersTextFieldRoot = styled(FormControl, {\n name: 'MuiPickersTextField',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({});\nconst useUtilityClasses = ownerState => {\n const {\n focused,\n disabled,\n classes,\n required\n } = ownerState;\n const slots = {\n root: ['root', focused && !disabled && 'focused', disabled && 'disabled', required && 'required']\n };\n return composeClasses(slots, getPickersTextFieldUtilityClass, classes);\n};\nconst PickersTextField = /*#__PURE__*/React.forwardRef(function PickersTextField(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersTextField'\n });\n const {\n // Props used by FormControl\n onFocus,\n onBlur,\n className,\n color = 'primary',\n disabled = false,\n error = false,\n variant = 'outlined',\n required = false,\n // Props used by PickersInput\n InputProps,\n inputProps,\n inputRef,\n sectionListRef,\n elements,\n areAllSectionsEmpty,\n onClick,\n onKeyDown,\n onPaste,\n onInput,\n endAdornment,\n startAdornment,\n tabIndex,\n contentEditable,\n focused,\n value,\n onChange,\n fullWidth,\n id: idProp,\n name,\n // Props used by FormHelperText\n helperText,\n FormHelperTextProps,\n // Props used by InputLabel\n label,\n InputLabelProps\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const rootRef = React.useRef(null);\n const handleRootRef = useForkRef(ref, rootRef);\n const id = useId(idProp);\n const helperTextId = helperText && id ? `${id}-helper-text` : undefined;\n const inputLabelId = label && id ? `${id}-label` : undefined;\n const ownerState = _extends({}, props, {\n color,\n disabled,\n error,\n focused,\n required,\n variant\n });\n const classes = useUtilityClasses(ownerState);\n const PickersInputComponent = VARIANT_COMPONENT[variant];\n return /*#__PURE__*/_jsxs(PickersTextFieldRoot, _extends({\n className: clsx(classes.root, className),\n ref: handleRootRef,\n focused: focused,\n onFocus: onFocus,\n onBlur: onBlur,\n disabled: disabled,\n variant: variant,\n error: error,\n color: color,\n fullWidth: fullWidth,\n required: required,\n ownerState: ownerState\n }, other, {\n children: [/*#__PURE__*/_jsx(InputLabel, _extends({\n htmlFor: id,\n id: inputLabelId\n }, InputLabelProps, {\n children: label\n })), /*#__PURE__*/_jsx(PickersInputComponent, _extends({\n elements: elements,\n areAllSectionsEmpty: areAllSectionsEmpty,\n onClick: onClick,\n onKeyDown: onKeyDown,\n onInput: onInput,\n onPaste: onPaste,\n endAdornment: endAdornment,\n startAdornment: startAdornment,\n tabIndex: tabIndex,\n contentEditable: contentEditable,\n value: value,\n onChange: onChange,\n id: id,\n fullWidth: fullWidth,\n inputProps: inputProps,\n inputRef: inputRef,\n sectionListRef: sectionListRef,\n label: label,\n name: name,\n role: \"group\",\n \"aria-labelledby\": inputLabelId\n }, InputProps)), helperText && /*#__PURE__*/_jsx(FormHelperText, _extends({\n id: helperTextId\n }, FormHelperTextProps, {\n children: helperText\n }))]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? PickersTextField.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Is `true` if the current values equals the empty value.\n * For a single item value, it means that `value === null`\n * For a range value, it means that `value === [null, null]`\n */\n areAllSectionsEmpty: PropTypes.bool.isRequired,\n className: PropTypes.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n * @default 'primary'\n */\n color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),\n component: PropTypes.elementType,\n /**\n * If true, the whole element is editable.\n * Useful when all the sections are selected.\n */\n contentEditable: PropTypes.bool.isRequired,\n disabled: PropTypes.bool.isRequired,\n /**\n * The elements to render.\n * Each element contains the prop to edit a section of the value.\n */\n elements: PropTypes.arrayOf(PropTypes.shape({\n after: PropTypes.object.isRequired,\n before: PropTypes.object.isRequired,\n container: PropTypes.object.isRequired,\n content: PropTypes.object.isRequired\n })).isRequired,\n endAdornment: PropTypes.node,\n error: PropTypes.bool.isRequired,\n /**\n * If `true`, the component is displayed in focused state.\n */\n focused: PropTypes.bool,\n FormHelperTextProps: PropTypes.object,\n fullWidth: PropTypes.bool,\n /**\n * The helper text content.\n */\n helperText: PropTypes.node,\n /**\n * If `true`, the label is hidden.\n * This is used to increase density for a `FilledInput`.\n * Be sure to add `aria-label` to the `input` element.\n * @default false\n */\n hiddenLabel: PropTypes.bool,\n id: PropTypes.string,\n InputLabelProps: PropTypes.object,\n inputProps: PropTypes.object,\n /**\n * Props applied to the Input element.\n * It will be a [`FilledInput`](/material-ui/api/filled-input/),\n * [`OutlinedInput`](/material-ui/api/outlined-input/) or [`Input`](/material-ui/api/input/)\n * component depending on the `variant` prop value.\n */\n InputProps: PropTypes.object,\n inputRef: refType,\n label: PropTypes.node,\n /**\n * If `dense` or `normal`, will adjust vertical spacing of this and contained components.\n * @default 'none'\n */\n margin: PropTypes.oneOf(['dense', 'none', 'normal']),\n name: PropTypes.string,\n onBlur: PropTypes.func.isRequired,\n onChange: PropTypes.func.isRequired,\n onClick: PropTypes.func.isRequired,\n onFocus: PropTypes.func.isRequired,\n onInput: PropTypes.func.isRequired,\n onKeyDown: PropTypes.func.isRequired,\n onPaste: PropTypes.func.isRequired,\n readOnly: PropTypes.bool,\n /**\n * If `true`, the label will indicate that the `input` is required.\n * @default false\n */\n required: PropTypes.bool,\n sectionListRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n getRoot: PropTypes.func.isRequired,\n getSectionContainer: PropTypes.func.isRequired,\n getSectionContent: PropTypes.func.isRequired,\n getSectionIndexFromDOMElement: PropTypes.func.isRequired\n })\n })]),\n /**\n * The size of the component.\n * @default 'medium'\n */\n size: PropTypes.oneOf(['medium', 'small']),\n startAdornment: PropTypes.node,\n style: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n value: PropTypes.string.isRequired,\n /**\n * The variant to use.\n * @default 'outlined'\n */\n variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])\n} : void 0;\nexport { PickersTextField };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"enableAccessibleFieldDOMStructure\"],\n _excluded2 = [\"InputProps\", \"readOnly\"],\n _excluded3 = [\"onPaste\", \"onKeyDown\", \"inputMode\", \"readOnly\", \"InputProps\", \"inputProps\", \"inputRef\"];\nexport const convertFieldResponseIntoMuiTextFieldProps = _ref => {\n let {\n enableAccessibleFieldDOMStructure\n } = _ref,\n fieldResponse = _objectWithoutPropertiesLoose(_ref, _excluded);\n if (enableAccessibleFieldDOMStructure) {\n const {\n InputProps,\n readOnly\n } = fieldResponse,\n other = _objectWithoutPropertiesLoose(fieldResponse, _excluded2);\n return _extends({}, other, {\n InputProps: _extends({}, InputProps ?? {}, {\n readOnly\n })\n });\n }\n const {\n onPaste,\n onKeyDown,\n inputMode,\n readOnly,\n InputProps,\n inputProps,\n inputRef\n } = fieldResponse,\n other = _objectWithoutPropertiesLoose(fieldResponse, _excluded3);\n return _extends({}, other, {\n InputProps: _extends({}, InputProps ?? {}, {\n readOnly\n }),\n inputProps: _extends({}, inputProps ?? {}, {\n inputMode,\n onPaste,\n onKeyDown,\n ref: inputRef\n })\n });\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"slots\", \"slotProps\", \"InputProps\", \"inputProps\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MuiTextField from '@mui/material/TextField';\nimport { useThemeProps } from '@mui/material/styles';\nimport { useSlotProps } from '@mui/base/utils';\nimport { refType } from '@mui/utils';\nimport { useDateField } from './useDateField';\nimport { useClearableField } from '../hooks';\nimport { PickersTextField } from '../PickersTextField';\nimport { convertFieldResponseIntoMuiTextFieldProps } from '../internals/utils/convertFieldResponseIntoMuiTextFieldProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Demos:\n *\n * - [DateField](http://mui.com/x/react-date-pickers/date-field/)\n * - [Fields](https://mui.com/x/react-date-pickers/fields/)\n *\n * API:\n *\n * - [DateField API](https://mui.com/x/api/date-pickers/date-field/)\n */\nconst DateField = /*#__PURE__*/React.forwardRef(function DateField(inProps, inRef) {\n const themeProps = useThemeProps({\n props: inProps,\n name: 'MuiDateField'\n });\n const {\n slots,\n slotProps,\n InputProps,\n inputProps\n } = themeProps,\n other = _objectWithoutPropertiesLoose(themeProps, _excluded);\n const ownerState = themeProps;\n const TextField = slots?.textField ?? (inProps.enableAccessibleFieldDOMStructure ? PickersTextField : MuiTextField);\n const textFieldProps = useSlotProps({\n elementType: TextField,\n externalSlotProps: slotProps?.textField,\n externalForwardedProps: other,\n additionalProps: {\n ref: inRef\n },\n ownerState\n });\n\n // TODO: Remove when mui/material-ui#35088 will be merged\n textFieldProps.inputProps = _extends({}, inputProps, textFieldProps.inputProps);\n textFieldProps.InputProps = _extends({}, InputProps, textFieldProps.InputProps);\n const fieldResponse = useDateField(textFieldProps);\n const convertedFieldResponse = convertFieldResponseIntoMuiTextFieldProps(fieldResponse);\n const processedFieldProps = useClearableField(_extends({}, convertedFieldResponse, {\n slots,\n slotProps\n }));\n return /*#__PURE__*/_jsx(TextField, _extends({}, processedFieldProps));\n});\nprocess.env.NODE_ENV !== \"production\" ? DateField.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * If `true`, the `input` element is focused during the first mount.\n * @default false\n */\n autoFocus: PropTypes.bool,\n className: PropTypes.string,\n /**\n * If `true`, a clear button will be shown in the field allowing value clearing.\n * @default false\n */\n clearable: PropTypes.bool,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n * @default 'primary'\n */\n color: PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']),\n component: PropTypes.elementType,\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue: PropTypes.object,\n /**\n * If `true`, the component is disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, disable values after the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disableFuture: PropTypes.bool,\n /**\n * If `true`, disable values before the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disablePast: PropTypes.bool,\n /**\n * @default false\n */\n enableAccessibleFieldDOMStructure: PropTypes.bool,\n /**\n * If `true`, the component is displayed in focused state.\n */\n focused: PropTypes.bool,\n /**\n * Format of the date when rendered in the input(s).\n */\n format: PropTypes.string,\n /**\n * Density of the format when rendered in the input.\n * Setting `formatDensity` to `\"spacious\"` will add a space before and after each `/`, `-` and `.` character.\n * @default \"dense\"\n */\n formatDensity: PropTypes.oneOf(['dense', 'spacious']),\n /**\n * Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.\n */\n FormHelperTextProps: PropTypes.object,\n /**\n * If `true`, the input will take up the full width of its container.\n * @default false\n */\n fullWidth: PropTypes.bool,\n /**\n * The helper text content.\n */\n helperText: PropTypes.node,\n /**\n * If `true`, the label is hidden.\n * This is used to increase density for a `FilledInput`.\n * Be sure to add `aria-label` to the `input` element.\n * @default false\n */\n hiddenLabel: PropTypes.bool,\n /**\n * The id of the `input` element.\n * Use this prop to make `label` and `helperText` accessible for screen readers.\n */\n id: PropTypes.string,\n /**\n * Props applied to the [`InputLabel`](/material-ui/api/input-label/) element.\n * Pointer events like `onClick` are enabled if and only if `shrink` is `true`.\n */\n InputLabelProps: PropTypes.object,\n /**\n * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n */\n inputProps: PropTypes.object,\n /**\n * Props applied to the Input element.\n * It will be a [`FilledInput`](/material-ui/api/filled-input/),\n * [`OutlinedInput`](/material-ui/api/outlined-input/) or [`Input`](/material-ui/api/input/)\n * component depending on the `variant` prop value.\n */\n InputProps: PropTypes.object,\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n /**\n * The label content.\n */\n label: PropTypes.node,\n /**\n * If `dense` or `normal`, will adjust vertical spacing of this and contained components.\n * @default 'none'\n */\n margin: PropTypes.oneOf(['dense', 'none', 'normal']),\n /**\n * Maximal selectable date.\n */\n maxDate: PropTypes.object,\n /**\n * Minimal selectable date.\n */\n minDate: PropTypes.object,\n /**\n * Name attribute of the `input` element.\n */\n name: PropTypes.string,\n onBlur: PropTypes.func,\n /**\n * Callback fired when the value changes.\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.\n * @param {TValue} value The new value.\n * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value.\n */\n onChange: PropTypes.func,\n /**\n * Callback fired when the clear button is clicked.\n */\n onClear: PropTypes.func,\n /**\n * Callback fired when the error associated to the current value changes.\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.\n * @param {TError} error The new error.\n * @param {TValue} value The value associated to the error.\n */\n onError: PropTypes.func,\n onFocus: PropTypes.func,\n /**\n * Callback fired when the selected sections change.\n * @param {FieldSelectedSections} newValue The new selected sections.\n */\n onSelectedSectionsChange: PropTypes.func,\n /**\n * It prevents the user from changing the value of the field\n * (not from interacting with the field).\n * @default false\n */\n readOnly: PropTypes.bool,\n /**\n * The date used to generate a part of the new value that is not present in the format when both `value` and `defaultValue` are empty.\n * For example, on time fields it will be used to determine the date to set.\n * @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`. Value is rounded to the most granular section used.\n */\n referenceDate: PropTypes.object,\n /**\n * If `true`, the label is displayed as required and the `input` element is required.\n * @default false\n */\n required: PropTypes.bool,\n /**\n * The currently selected sections.\n * This prop accepts four formats:\n * 1. If a number is provided, the section at this index will be selected.\n * 2. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.\n * 3. If `\"all\"` is provided, all the sections will be selected.\n * 4. If `null` is provided, no section will be selected.\n * If not provided, the selected sections will be handled internally.\n */\n selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),\n /**\n * Disable specific date.\n *\n * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.\n *\n * @template TDate\n * @param {TDate} day The date to test.\n * @returns {boolean} If `true` the date will be disabled.\n */\n shouldDisableDate: PropTypes.func,\n /**\n * Disable specific month.\n * @template TDate\n * @param {TDate} month The month to test.\n * @returns {boolean} If `true`, the month will be disabled.\n */\n shouldDisableMonth: PropTypes.func,\n /**\n * Disable specific year.\n * @template TDate\n * @param {TDate} year The year to test.\n * @returns {boolean} If `true`, the year will be disabled.\n */\n shouldDisableYear: PropTypes.func,\n /**\n * If `true`, the format will respect the leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `8/16/2018`)\n * If `false`, the format will always add leading zeroes (e.g: on dayjs, the format `M/D/YYYY` will render `08/16/2018`)\n *\n * Warning n°1: Luxon is not able to respect the leading zeroes when using macro tokens (e.g: \"DD\"), so `shouldRespectLeadingZeros={true}` might lead to inconsistencies when using `AdapterLuxon`.\n *\n * Warning n°2: When `shouldRespectLeadingZeros={true}`, the field will add an invisible character on the sections containing a single digit to make sure `onChange` is fired.\n * If you need to get the clean value from the input, you can remove this character using `input.value.replace(/\\u200e/g, '')`.\n *\n * Warning n°3: When used in strict mode, dayjs and moment require to respect the leading zeros.\n * This mean that when using `shouldRespectLeadingZeros={false}`, if you retrieve the value directly from the input (not listening to `onChange`) and your format contains tokens without leading zeros, the value will not be parsed by your library.\n *\n * @default false\n */\n shouldRespectLeadingZeros: PropTypes.bool,\n /**\n * The size of the component.\n */\n size: PropTypes.oneOf(['medium', 'small']),\n /**\n * The props used for each component slot.\n * @default {}\n */\n slotProps: PropTypes.object,\n /**\n * Overridable component slots.\n * @default {}\n */\n slots: PropTypes.object,\n style: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Choose which timezone to use for the value.\n * Example: \"default\", \"system\", \"UTC\", \"America/New_York\".\n * If you pass values from other timezones to some props, they will be converted to this timezone before being used.\n * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.\n * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.\n */\n timezone: PropTypes.string,\n /**\n * The ref object used to imperatively interact with the field.\n */\n unstableFieldRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n /**\n * The selected value.\n * Used when the component is controlled.\n */\n value: PropTypes.object,\n /**\n * The variant to use.\n * @default 'outlined'\n */\n variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])\n} : void 0;\nexport { DateField };","import * as React from 'react';\nimport { validateDate } from '../internals/utils/validation/validateDate';\nimport { useLocalizationContext } from '../internals/hooks/useUtils';\nexport const useIsDateDisabled = ({\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n minDate,\n maxDate,\n disableFuture,\n disablePast,\n timezone\n}) => {\n const adapter = useLocalizationContext();\n return React.useCallback(day => validateDate({\n adapter,\n value: day,\n props: {\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n minDate,\n maxDate,\n disableFuture,\n disablePast,\n timezone\n }\n }) !== null, [adapter, shouldDisableDate, shouldDisableMonth, shouldDisableYear, minDate, maxDate, disableFuture, disablePast, timezone]);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport useEventCallback from '@mui/utils/useEventCallback';\nimport { useIsDateDisabled } from './useIsDateDisabled';\nimport { useUtils } from '../internals/hooks/useUtils';\nimport { singleItemValueManager } from '../internals/utils/valueManagers';\nimport { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';\nexport const createCalendarStateReducer = (reduceAnimations, disableSwitchToMonthOnDayFocus, utils) => (state, action) => {\n switch (action.type) {\n case 'changeMonth':\n return _extends({}, state, {\n slideDirection: action.direction,\n currentMonth: action.newMonth,\n isMonthSwitchingAnimating: !reduceAnimations\n });\n case 'finishMonthSwitchingAnimation':\n return _extends({}, state, {\n isMonthSwitchingAnimating: false\n });\n case 'changeFocusedDay':\n {\n if (state.focusedDay != null && action.focusedDay != null && utils.isSameDay(action.focusedDay, state.focusedDay)) {\n return state;\n }\n const needMonthSwitch = action.focusedDay != null && !disableSwitchToMonthOnDayFocus && !utils.isSameMonth(state.currentMonth, action.focusedDay);\n return _extends({}, state, {\n focusedDay: action.focusedDay,\n isMonthSwitchingAnimating: needMonthSwitch && !reduceAnimations && !action.withoutMonthSwitchingAnimation,\n currentMonth: needMonthSwitch ? utils.startOfMonth(action.focusedDay) : state.currentMonth,\n slideDirection: action.focusedDay != null && utils.isAfterDay(action.focusedDay, state.currentMonth) ? 'left' : 'right'\n });\n }\n default:\n throw new Error('missing support');\n }\n};\nexport const useCalendarState = params => {\n const {\n value,\n referenceDate: referenceDateProp,\n disableFuture,\n disablePast,\n disableSwitchToMonthOnDayFocus = false,\n maxDate,\n minDate,\n onMonthChange,\n reduceAnimations,\n shouldDisableDate,\n timezone\n } = params;\n const utils = useUtils();\n const reducerFn = React.useRef(createCalendarStateReducer(Boolean(reduceAnimations), disableSwitchToMonthOnDayFocus, utils)).current;\n const referenceDate = React.useMemo(() => {\n return singleItemValueManager.getInitialReferenceValue({\n value,\n utils,\n timezone,\n props: params,\n referenceDate: referenceDateProp,\n granularity: SECTION_TYPE_GRANULARITY.day\n });\n }, [] // eslint-disable-line react-hooks/exhaustive-deps\n );\n const [calendarState, dispatch] = React.useReducer(reducerFn, {\n isMonthSwitchingAnimating: false,\n focusedDay: referenceDate,\n currentMonth: utils.startOfMonth(referenceDate),\n slideDirection: 'left'\n });\n const handleChangeMonth = React.useCallback(payload => {\n dispatch(_extends({\n type: 'changeMonth'\n }, payload));\n if (onMonthChange) {\n onMonthChange(payload.newMonth);\n }\n }, [onMonthChange]);\n const changeMonth = React.useCallback(newDate => {\n const newDateRequested = newDate;\n if (utils.isSameMonth(newDateRequested, calendarState.currentMonth)) {\n return;\n }\n handleChangeMonth({\n newMonth: utils.startOfMonth(newDateRequested),\n direction: utils.isAfterDay(newDateRequested, calendarState.currentMonth) ? 'left' : 'right'\n });\n }, [calendarState.currentMonth, handleChangeMonth, utils]);\n const isDateDisabled = useIsDateDisabled({\n shouldDisableDate,\n minDate,\n maxDate,\n disableFuture,\n disablePast,\n timezone\n });\n const onMonthSwitchingAnimationEnd = React.useCallback(() => {\n dispatch({\n type: 'finishMonthSwitchingAnimation'\n });\n }, []);\n const changeFocusedDay = useEventCallback((newFocusedDate, withoutMonthSwitchingAnimation) => {\n if (!isDateDisabled(newFocusedDate)) {\n dispatch({\n type: 'changeFocusedDay',\n focusedDay: newFocusedDate,\n withoutMonthSwitchingAnimation\n });\n }\n });\n return {\n referenceDate,\n calendarState,\n changeMonth,\n changeFocusedDay,\n isDateDisabled,\n onMonthSwitchingAnimationEnd,\n handleChangeMonth\n };\n};","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport const getPickersFadeTransitionGroupUtilityClass = slot => generateUtilityClass('MuiPickersFadeTransitionGroup', slot);\nexport const pickersFadeTransitionGroupClasses = generateUtilityClasses('MuiPickersFadeTransitionGroup', ['root']);","import * as React from 'react';\nimport clsx from 'clsx';\nimport { TransitionGroup } from 'react-transition-group';\nimport Fade from '@mui/material/Fade';\nimport { styled, useTheme, useThemeProps } from '@mui/material/styles';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { getPickersFadeTransitionGroupUtilityClass } from './pickersFadeTransitionGroupClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, getPickersFadeTransitionGroupUtilityClass, classes);\n};\nconst PickersFadeTransitionGroupRoot = styled(TransitionGroup, {\n name: 'MuiPickersFadeTransitionGroup',\n slot: 'Root',\n overridesResolver: (_, styles) => styles.root\n})({\n display: 'block',\n position: 'relative'\n});\n\n/**\n * @ignore - do not document.\n */\nexport function PickersFadeTransitionGroup(inProps) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersFadeTransitionGroup'\n });\n const {\n children,\n className,\n reduceAnimations,\n transKey\n } = props;\n const classes = useUtilityClasses(props);\n const theme = useTheme();\n if (reduceAnimations) {\n return children;\n }\n return /*#__PURE__*/_jsx(PickersFadeTransitionGroupRoot, {\n className: clsx(classes.root, className),\n children: /*#__PURE__*/_jsx(Fade, {\n appear: false,\n mountOnEnter: true,\n unmountOnExit: true,\n timeout: {\n appear: theme.transitions.duration.enteringScreen,\n enter: theme.transitions.duration.enteringScreen,\n exit: 0\n },\n children: children\n }, transKey)\n });\n}","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport function getPickersDayUtilityClass(slot) {\n return generateUtilityClass('MuiPickersDay', slot);\n}\nexport const pickersDayClasses = generateUtilityClasses('MuiPickersDay', ['root', 'dayWithMargin', 'dayOutsideMonth', 'hiddenDaySpacingFiller', 'today', 'selected', 'disabled']);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"autoFocus\", \"className\", \"day\", \"disabled\", \"disableHighlightToday\", \"disableMargin\", \"hidden\", \"isAnimating\", \"onClick\", \"onDaySelect\", \"onFocus\", \"onBlur\", \"onKeyDown\", \"onMouseDown\", \"onMouseEnter\", \"outsideCurrentMonth\", \"selected\", \"showDaysOutsideCurrentMonth\", \"children\", \"today\", \"isFirstVisibleCell\", \"isLastVisibleCell\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport ButtonBase from '@mui/material/ButtonBase';\nimport { unstable_useEnhancedEffect as useEnhancedEffect, unstable_composeClasses as composeClasses, unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { alpha, styled, useThemeProps } from '@mui/material/styles';\nimport { useUtils } from '../internals/hooks/useUtils';\nimport { DAY_SIZE, DAY_MARGIN } from '../internals/constants/dimensions';\nimport { getPickersDayUtilityClass, pickersDayClasses } from './pickersDayClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n selected,\n disableMargin,\n disableHighlightToday,\n today,\n disabled,\n outsideCurrentMonth,\n showDaysOutsideCurrentMonth,\n classes\n } = ownerState;\n const isHiddenDaySpacingFiller = outsideCurrentMonth && !showDaysOutsideCurrentMonth;\n const slots = {\n root: ['root', selected && !isHiddenDaySpacingFiller && 'selected', disabled && 'disabled', !disableMargin && 'dayWithMargin', !disableHighlightToday && today && 'today', outsideCurrentMonth && showDaysOutsideCurrentMonth && 'dayOutsideMonth', isHiddenDaySpacingFiller && 'hiddenDaySpacingFiller'],\n hiddenDaySpacingFiller: ['hiddenDaySpacingFiller']\n };\n return composeClasses(slots, getPickersDayUtilityClass, classes);\n};\nconst styleArg = ({\n theme\n}) => _extends({}, theme.typography.caption, {\n width: DAY_SIZE,\n height: DAY_SIZE,\n borderRadius: '50%',\n padding: 0,\n // explicitly setting to `transparent` to avoid potentially getting impacted by change from the overridden component\n backgroundColor: 'transparent',\n transition: theme.transitions.create('background-color', {\n duration: theme.transitions.duration.short\n }),\n color: (theme.vars || theme).palette.text.primary,\n '@media (pointer: fine)': {\n '&:hover': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity)\n }\n },\n '&:focus': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.focusOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.focusOpacity),\n [`&.${pickersDayClasses.selected}`]: {\n willChange: 'background-color',\n backgroundColor: (theme.vars || theme).palette.primary.dark\n }\n },\n [`&.${pickersDayClasses.selected}`]: {\n color: (theme.vars || theme).palette.primary.contrastText,\n backgroundColor: (theme.vars || theme).palette.primary.main,\n fontWeight: theme.typography.fontWeightMedium,\n '&:hover': {\n willChange: 'background-color',\n backgroundColor: (theme.vars || theme).palette.primary.dark\n }\n },\n [`&.${pickersDayClasses.disabled}:not(.${pickersDayClasses.selected})`]: {\n color: (theme.vars || theme).palette.text.disabled\n },\n [`&.${pickersDayClasses.disabled}&.${pickersDayClasses.selected}`]: {\n opacity: 0.6\n },\n variants: [{\n props: {\n disableMargin: false\n },\n style: {\n margin: `0 ${DAY_MARGIN}px`\n }\n }, {\n props: {\n outsideCurrentMonth: true,\n showDaysOutsideCurrentMonth: true\n },\n style: {\n color: (theme.vars || theme).palette.text.secondary\n }\n }, {\n props: {\n disableHighlightToday: false,\n today: true\n },\n style: {\n [`&:not(.${pickersDayClasses.selected})`]: {\n border: `1px solid ${(theme.vars || theme).palette.text.secondary}`\n }\n }\n }]\n});\nconst overridesResolver = (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, !ownerState.disableMargin && styles.dayWithMargin, !ownerState.disableHighlightToday && ownerState.today && styles.today, !ownerState.outsideCurrentMonth && ownerState.showDaysOutsideCurrentMonth && styles.dayOutsideMonth, ownerState.outsideCurrentMonth && !ownerState.showDaysOutsideCurrentMonth && styles.hiddenDaySpacingFiller];\n};\nconst PickersDayRoot = styled(ButtonBase, {\n name: 'MuiPickersDay',\n slot: 'Root',\n overridesResolver\n})(styleArg);\nconst PickersDayFiller = styled('div', {\n name: 'MuiPickersDay',\n slot: 'Root',\n overridesResolver\n})(({\n theme\n}) => _extends({}, styleArg({\n theme\n}), {\n // visibility: 'hidden' does not work here as it hides the element from screen readers as well\n opacity: 0,\n pointerEvents: 'none'\n}));\nconst noop = () => {};\nconst PickersDayRaw = /*#__PURE__*/React.forwardRef(function PickersDay(inProps, forwardedRef) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersDay'\n });\n const {\n autoFocus = false,\n className,\n day,\n disabled = false,\n disableHighlightToday = false,\n disableMargin = false,\n isAnimating,\n onClick,\n onDaySelect,\n onFocus = noop,\n onBlur = noop,\n onKeyDown = noop,\n onMouseDown = noop,\n onMouseEnter = noop,\n outsideCurrentMonth,\n selected = false,\n showDaysOutsideCurrentMonth = false,\n children,\n today: isToday = false\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n autoFocus,\n disabled,\n disableHighlightToday,\n disableMargin,\n selected,\n showDaysOutsideCurrentMonth,\n today: isToday\n });\n const classes = useUtilityClasses(ownerState);\n const utils = useUtils();\n const ref = React.useRef(null);\n const handleRef = useForkRef(ref, forwardedRef);\n\n // Since this is rendered when a Popper is opened we can't use passive effects.\n // Focusing in passive effects in Popper causes scroll jump.\n useEnhancedEffect(() => {\n if (autoFocus && !disabled && !isAnimating && !outsideCurrentMonth) {\n // ref.current being null would be a bug in MUI\n ref.current.focus();\n }\n }, [autoFocus, disabled, isAnimating, outsideCurrentMonth]);\n\n // For a day outside the current month, move the focus from mouseDown to mouseUp\n // Goal: have the onClick ends before sliding to the new month\n const handleMouseDown = event => {\n onMouseDown(event);\n if (outsideCurrentMonth) {\n event.preventDefault();\n }\n };\n const handleClick = event => {\n if (!disabled) {\n onDaySelect(day);\n }\n if (outsideCurrentMonth) {\n event.currentTarget.focus();\n }\n if (onClick) {\n onClick(event);\n }\n };\n if (outsideCurrentMonth && !showDaysOutsideCurrentMonth) {\n return /*#__PURE__*/_jsx(PickersDayFiller, {\n className: clsx(classes.root, classes.hiddenDaySpacingFiller, className),\n ownerState: ownerState,\n role: other.role\n });\n }\n return /*#__PURE__*/_jsx(PickersDayRoot, _extends({\n className: clsx(classes.root, className),\n ref: handleRef,\n centerRipple: true,\n disabled: disabled,\n tabIndex: selected ? 0 : -1,\n onKeyDown: event => onKeyDown(event, day),\n onFocus: event => onFocus(event, day),\n onBlur: event => onBlur(event, day),\n onMouseEnter: event => onMouseEnter(event, day),\n onClick: handleClick,\n onMouseDown: handleMouseDown\n }, other, {\n ownerState: ownerState,\n children: !children ? utils.format(day, 'dayOfMonth') : children\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? PickersDayRaw.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * A ref for imperative actions.\n * It currently only supports `focusVisible()` action.\n */\n action: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n focusVisible: PropTypes.func.isRequired\n })\n })]),\n /**\n * If `true`, the ripples are centered.\n * They won't start at the cursor interaction position.\n * @default false\n */\n centerRipple: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n className: PropTypes.string,\n component: PropTypes.elementType,\n /**\n * The date to show.\n */\n day: PropTypes.object.isRequired,\n /**\n * If `true`, renders as disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, today's date is rendering without highlighting with circle.\n * @default false\n */\n disableHighlightToday: PropTypes.bool,\n /**\n * If `true`, days are rendering without margin. Useful for displaying linked range of days.\n * @default false\n */\n disableMargin: PropTypes.bool,\n /**\n * If `true`, the ripple effect is disabled.\n *\n * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure\n * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.\n * @default false\n */\n disableRipple: PropTypes.bool,\n /**\n * If `true`, the touch ripple effect is disabled.\n * @default false\n */\n disableTouchRipple: PropTypes.bool,\n /**\n * If `true`, the base button will have a keyboard focus ripple.\n * @default false\n */\n focusRipple: PropTypes.bool,\n /**\n * This prop can help identify which element has keyboard focus.\n * The class name will be applied when the element gains the focus through keyboard interaction.\n * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).\n * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).\n * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components\n * if needed.\n */\n focusVisibleClassName: PropTypes.string,\n isAnimating: PropTypes.bool,\n /**\n * If `true`, day is the first visible cell of the month.\n * Either the first day of the month or the first day of the week depending on `showDaysOutsideCurrentMonth`.\n */\n isFirstVisibleCell: PropTypes.bool.isRequired,\n /**\n * If `true`, day is the last visible cell of the month.\n * Either the last day of the month or the last day of the week depending on `showDaysOutsideCurrentMonth`.\n */\n isLastVisibleCell: PropTypes.bool.isRequired,\n onBlur: PropTypes.func,\n onDaySelect: PropTypes.func.isRequired,\n onFocus: PropTypes.func,\n /**\n * Callback fired when the component is focused with a keyboard.\n * We trigger a `onFocus` callback too.\n */\n onFocusVisible: PropTypes.func,\n onKeyDown: PropTypes.func,\n onMouseEnter: PropTypes.func,\n /**\n * If `true`, day is outside of month and will be hidden.\n */\n outsideCurrentMonth: PropTypes.bool.isRequired,\n /**\n * If `true`, renders as selected.\n * @default false\n */\n selected: PropTypes.bool,\n /**\n * If `true`, days outside the current month are rendered:\n *\n * - if `fixedWeekNumber` is defined, renders days to have the weeks requested.\n *\n * - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.\n *\n * - ignored if `calendars` equals more than `1` on range pickers.\n * @default false\n */\n showDaysOutsideCurrentMonth: PropTypes.bool,\n style: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * @default 0\n */\n tabIndex: PropTypes.number,\n /**\n * If `true`, renders as today date.\n * @default false\n */\n today: PropTypes.bool,\n /**\n * Props applied to the `TouchRipple` element.\n */\n TouchRippleProps: PropTypes.object,\n /**\n * A ref that points to the `TouchRipple` element.\n */\n touchRippleRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.shape({\n pulsate: PropTypes.func.isRequired,\n start: PropTypes.func.isRequired,\n stop: PropTypes.func.isRequired\n })\n })])\n} : void 0;\n\n/**\n * Demos:\n *\n * - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)\n * API:\n *\n * - [PickersDay API](https://mui.com/x/api/date-pickers/pickers-day/)\n */\nexport const PickersDay = /*#__PURE__*/React.memo(PickersDayRaw);","function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport addOneClass from 'dom-helpers/addClass';\nimport removeOneClass from 'dom-helpers/removeClass';\nimport React from 'react';\nimport Transition from './Transition';\nimport { classNamesShape } from './utils/PropTypes';\nimport { forceReflow } from './utils/reflow';\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return addOneClass(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return removeOneClass(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should\n * use it if you're using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
    \n * \n *
    \n * {\"I'll receive my-node-* classes\"}\n *
    \n *
    \n * \n *
    \n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**, so it's\n * important to add `transition` declaration only to them, otherwise transitions\n * might not behave as intended! This might not be obvious when the transitions\n * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in\n * the example above (minus `transition`), but it becomes apparent in more\n * complex transitions.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument[0],\n appearing = _this$resolveArgument[1];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntering = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument2[0],\n appearing = _this$resolveArgument2[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntered = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument3[0],\n appearing = _this$resolveArgument3[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(maybeNode, maybeAppearing);\n }\n };\n\n _this.onExit = function (maybeNode) {\n var _this$resolveArgument4 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument4[0];\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(maybeNode);\n }\n };\n\n _this.onExiting = function (maybeNode) {\n var _this$resolveArgument5 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument5[0];\n\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(maybeNode);\n }\n };\n\n _this.onExited = function (maybeNode) {\n var _this$resolveArgument6 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument6[0];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(maybeNode);\n }\n };\n\n _this.resolveArguments = function (maybeNode, maybeAppearing) {\n return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`\n : [maybeNode, maybeAppearing];\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n var _this$getClassNames = this.getClassNames('enter'),\n doneClassName = _this$getClassNames.doneClassName;\n\n if (type === 'appear' && phase === 'done' && doneClassName) {\n className += \" \" + doneClassName;\n } // This is to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n if (node) forceReflow(node);\n }\n\n if (className) {\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n }\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = _objectWithoutPropertiesLoose(_this$props, [\"classNames\"]);\n\n return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(React.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = process.env.NODE_ENV !== \"production\" ? _extends({}, Transition.propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided, which\n * will be suffixed for each stage, e.g. `classNames=\"fade\"` applies:\n *\n * - `fade-appear`, `fade-appear-active`, `fade-appear-done`\n * - `fade-enter`, `fade-enter-active`, `fade-enter-done`\n * - `fade-exit`, `fade-exit-active`, `fade-exit-done`\n *\n * A few details to note about how these classes are applied:\n *\n * 1. They are _joined_ with the ones that are already defined on the child\n * component, so if you want to add some base styles, you can use\n * `className` without worrying that it will be overridden.\n *\n * 2. If the transition component mounts with `in={false}`, no classes are\n * applied yet. You might be expecting `*-exit-done`, but if you think\n * about it, a component cannot finish exiting if it hasn't entered yet.\n *\n * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This\n * allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply\n * an epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: classNamesShape,\n\n /**\n * A `` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExit: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit-active' is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExited: PropTypes.func\n}) : {};\nexport default CSSTransition;","import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}","/**\n * Checks if a given element has a CSS class.\n * \n * @param element the element\n * @param className the CSS class name\n */\nexport default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport const getPickersSlideTransitionUtilityClass = slot => generateUtilityClass('MuiPickersSlideTransition', slot);\nexport const pickersSlideTransitionClasses = generateUtilityClasses('MuiPickersSlideTransition', ['root', 'slideEnter-left', 'slideEnter-right', 'slideEnterActive', 'slideExit', 'slideExitActiveLeft-left', 'slideExitActiveLeft-right']);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"className\", \"reduceAnimations\", \"slideDirection\", \"transKey\", \"classes\"];\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport { styled, useTheme, useThemeProps } from '@mui/material/styles';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { CSSTransition, TransitionGroup } from 'react-transition-group';\nimport { getPickersSlideTransitionUtilityClass, pickersSlideTransitionClasses } from './pickersSlideTransitionClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n slideDirection\n } = ownerState;\n const slots = {\n root: ['root'],\n exit: ['slideExit'],\n enterActive: ['slideEnterActive'],\n enter: [`slideEnter-${slideDirection}`],\n exitActive: [`slideExitActiveLeft-${slideDirection}`]\n };\n return composeClasses(slots, getPickersSlideTransitionUtilityClass, classes);\n};\nconst PickersSlideTransitionRoot = styled(TransitionGroup, {\n name: 'MuiPickersSlideTransition',\n slot: 'Root',\n overridesResolver: (_, styles) => [styles.root, {\n [`.${pickersSlideTransitionClasses['slideEnter-left']}`]: styles['slideEnter-left']\n }, {\n [`.${pickersSlideTransitionClasses['slideEnter-right']}`]: styles['slideEnter-right']\n }, {\n [`.${pickersSlideTransitionClasses.slideEnterActive}`]: styles.slideEnterActive\n }, {\n [`.${pickersSlideTransitionClasses.slideExit}`]: styles.slideExit\n }, {\n [`.${pickersSlideTransitionClasses['slideExitActiveLeft-left']}`]: styles['slideExitActiveLeft-left']\n }, {\n [`.${pickersSlideTransitionClasses['slideExitActiveLeft-right']}`]: styles['slideExitActiveLeft-right']\n }]\n})(({\n theme\n}) => {\n const slideTransition = theme.transitions.create('transform', {\n duration: theme.transitions.duration.complex,\n easing: 'cubic-bezier(0.35, 0.8, 0.4, 1)'\n });\n return {\n display: 'block',\n position: 'relative',\n overflowX: 'hidden',\n '& > *': {\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0\n },\n [`& .${pickersSlideTransitionClasses['slideEnter-left']}`]: {\n willChange: 'transform',\n transform: 'translate(100%)',\n zIndex: 1\n },\n [`& .${pickersSlideTransitionClasses['slideEnter-right']}`]: {\n willChange: 'transform',\n transform: 'translate(-100%)',\n zIndex: 1\n },\n [`& .${pickersSlideTransitionClasses.slideEnterActive}`]: {\n transform: 'translate(0%)',\n transition: slideTransition\n },\n [`& .${pickersSlideTransitionClasses.slideExit}`]: {\n transform: 'translate(0%)'\n },\n [`& .${pickersSlideTransitionClasses['slideExitActiveLeft-left']}`]: {\n willChange: 'transform',\n transform: 'translate(-100%)',\n transition: slideTransition,\n zIndex: 0\n },\n [`& .${pickersSlideTransitionClasses['slideExitActiveLeft-right']}`]: {\n willChange: 'transform',\n transform: 'translate(100%)',\n transition: slideTransition,\n zIndex: 0\n }\n };\n});\n\n/**\n * @ignore - do not document.\n */\nexport function PickersSlideTransition(inProps) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersSlideTransition'\n });\n const {\n children,\n className,\n reduceAnimations,\n transKey\n // extracting `classes` from `other`\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const classes = useUtilityClasses(props);\n const theme = useTheme();\n if (reduceAnimations) {\n return /*#__PURE__*/_jsx(\"div\", {\n className: clsx(classes.root, className),\n children: children\n });\n }\n const transitionClasses = {\n exit: classes.exit,\n enterActive: classes.enterActive,\n enter: classes.enter,\n exitActive: classes.exitActive\n };\n return /*#__PURE__*/_jsx(PickersSlideTransitionRoot, {\n className: clsx(classes.root, className),\n childFactory: element => /*#__PURE__*/React.cloneElement(element, {\n classNames: transitionClasses\n }),\n role: \"presentation\",\n children: /*#__PURE__*/_jsx(CSSTransition, _extends({\n mountOnEnter: true,\n unmountOnExit: true,\n timeout: theme.transitions.duration.complex,\n classNames: transitionClasses\n }, other, {\n children: children\n }), transKey)\n });\n}","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport const getDayCalendarUtilityClass = slot => generateUtilityClass('MuiDayCalendar', slot);\nexport const dayCalendarClasses = generateUtilityClasses('MuiDayCalendar', ['root', 'header', 'weekDayLabel', 'loadingContainer', 'slideTransition', 'monthContainer', 'weekContainer', 'weekNumberLabel', 'weekNumber']);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"parentProps\", \"day\", \"focusableDay\", \"selectedDays\", \"isDateDisabled\", \"currentMonthNumber\", \"isViewFocused\"],\n _excluded2 = [\"ownerState\"];\nimport * as React from 'react';\nimport useEventCallback from '@mui/utils/useEventCallback';\nimport Typography from '@mui/material/Typography';\nimport { useSlotProps } from '@mui/base/utils';\nimport { styled, useTheme, useThemeProps } from '@mui/material/styles';\nimport { unstable_composeClasses as composeClasses, unstable_useControlled as useControlled } from '@mui/utils';\nimport clsx from 'clsx';\nimport { PickersDay } from '../PickersDay/PickersDay';\nimport { useUtils, useNow, useLocaleText } from '../internals/hooks/useUtils';\nimport { DAY_SIZE, DAY_MARGIN } from '../internals/constants/dimensions';\nimport { PickersSlideTransition } from './PickersSlideTransition';\nimport { useIsDateDisabled } from './useIsDateDisabled';\nimport { findClosestEnabledDate, getWeekdays } from '../internals/utils/date-utils';\nimport { getDayCalendarUtilityClass } from './dayCalendarClasses';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root'],\n header: ['header'],\n weekDayLabel: ['weekDayLabel'],\n loadingContainer: ['loadingContainer'],\n slideTransition: ['slideTransition'],\n monthContainer: ['monthContainer'],\n weekContainer: ['weekContainer'],\n weekNumberLabel: ['weekNumberLabel'],\n weekNumber: ['weekNumber']\n };\n return composeClasses(slots, getDayCalendarUtilityClass, classes);\n};\nconst weeksContainerHeight = (DAY_SIZE + DAY_MARGIN * 2) * 6;\nconst PickersCalendarDayRoot = styled('div', {\n name: 'MuiDayCalendar',\n slot: 'Root',\n overridesResolver: (_, styles) => styles.root\n})({});\nconst PickersCalendarDayHeader = styled('div', {\n name: 'MuiDayCalendar',\n slot: 'Header',\n overridesResolver: (_, styles) => styles.header\n})({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center'\n});\nconst PickersCalendarWeekDayLabel = styled(Typography, {\n name: 'MuiDayCalendar',\n slot: 'WeekDayLabel',\n overridesResolver: (_, styles) => styles.weekDayLabel\n})(({\n theme\n}) => ({\n width: 36,\n height: 40,\n margin: '0 2px',\n textAlign: 'center',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n color: (theme.vars || theme).palette.text.secondary\n}));\nconst PickersCalendarWeekNumberLabel = styled(Typography, {\n name: 'MuiDayCalendar',\n slot: 'WeekNumberLabel',\n overridesResolver: (_, styles) => styles.weekNumberLabel\n})(({\n theme\n}) => ({\n width: 36,\n height: 40,\n margin: '0 2px',\n textAlign: 'center',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n color: theme.palette.text.disabled\n}));\nconst PickersCalendarWeekNumber = styled(Typography, {\n name: 'MuiDayCalendar',\n slot: 'WeekNumber',\n overridesResolver: (_, styles) => styles.weekNumber\n})(({\n theme\n}) => _extends({}, theme.typography.caption, {\n width: DAY_SIZE,\n height: DAY_SIZE,\n padding: 0,\n margin: `0 ${DAY_MARGIN}px`,\n color: theme.palette.text.disabled,\n fontSize: '0.75rem',\n alignItems: 'center',\n justifyContent: 'center',\n display: 'inline-flex'\n}));\nconst PickersCalendarLoadingContainer = styled('div', {\n name: 'MuiDayCalendar',\n slot: 'LoadingContainer',\n overridesResolver: (_, styles) => styles.loadingContainer\n})({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n minHeight: weeksContainerHeight\n});\nconst PickersCalendarSlideTransition = styled(PickersSlideTransition, {\n name: 'MuiDayCalendar',\n slot: 'SlideTransition',\n overridesResolver: (_, styles) => styles.slideTransition\n})({\n minHeight: weeksContainerHeight\n});\nconst PickersCalendarWeekContainer = styled('div', {\n name: 'MuiDayCalendar',\n slot: 'MonthContainer',\n overridesResolver: (_, styles) => styles.monthContainer\n})({\n overflow: 'hidden'\n});\nconst PickersCalendarWeek = styled('div', {\n name: 'MuiDayCalendar',\n slot: 'WeekContainer',\n overridesResolver: (_, styles) => styles.weekContainer\n})({\n margin: `${DAY_MARGIN}px 0`,\n display: 'flex',\n justifyContent: 'center'\n});\nfunction WrappedDay(_ref) {\n let {\n parentProps,\n day,\n focusableDay,\n selectedDays,\n isDateDisabled,\n currentMonthNumber,\n isViewFocused\n } = _ref,\n other = _objectWithoutPropertiesLoose(_ref, _excluded);\n const {\n disabled,\n disableHighlightToday,\n isMonthSwitchingAnimating,\n showDaysOutsideCurrentMonth,\n slots,\n slotProps,\n timezone\n } = parentProps;\n const utils = useUtils();\n const now = useNow(timezone);\n const isFocusableDay = focusableDay !== null && utils.isSameDay(day, focusableDay);\n const isSelected = selectedDays.some(selectedDay => utils.isSameDay(selectedDay, day));\n const isToday = utils.isSameDay(day, now);\n const Day = slots?.day ?? PickersDay;\n // We don't want to pass to ownerState down, to avoid re-rendering all the day whenever a prop changes.\n const _useSlotProps = useSlotProps({\n elementType: Day,\n externalSlotProps: slotProps?.day,\n additionalProps: _extends({\n disableHighlightToday,\n showDaysOutsideCurrentMonth,\n role: 'gridcell',\n isAnimating: isMonthSwitchingAnimating,\n // it is used in date range dragging logic by accessing `dataset.timestamp`\n 'data-timestamp': utils.toJsDate(day).valueOf()\n }, other),\n ownerState: _extends({}, parentProps, {\n day,\n selected: isSelected\n })\n }),\n dayProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);\n const isDisabled = React.useMemo(() => disabled || isDateDisabled(day), [disabled, isDateDisabled, day]);\n const outsideCurrentMonth = React.useMemo(() => utils.getMonth(day) !== currentMonthNumber, [utils, day, currentMonthNumber]);\n const isFirstVisibleCell = React.useMemo(() => {\n const startOfMonth = utils.startOfMonth(utils.setMonth(day, currentMonthNumber));\n if (!showDaysOutsideCurrentMonth) {\n return utils.isSameDay(day, startOfMonth);\n }\n return utils.isSameDay(day, utils.startOfWeek(startOfMonth));\n }, [currentMonthNumber, day, showDaysOutsideCurrentMonth, utils]);\n const isLastVisibleCell = React.useMemo(() => {\n const endOfMonth = utils.endOfMonth(utils.setMonth(day, currentMonthNumber));\n if (!showDaysOutsideCurrentMonth) {\n return utils.isSameDay(day, endOfMonth);\n }\n return utils.isSameDay(day, utils.endOfWeek(endOfMonth));\n }, [currentMonthNumber, day, showDaysOutsideCurrentMonth, utils]);\n return /*#__PURE__*/_jsx(Day, _extends({}, dayProps, {\n day: day,\n disabled: isDisabled,\n autoFocus: isViewFocused && isFocusableDay,\n today: isToday,\n outsideCurrentMonth: outsideCurrentMonth,\n isFirstVisibleCell: isFirstVisibleCell,\n isLastVisibleCell: isLastVisibleCell,\n selected: isSelected,\n tabIndex: isFocusableDay ? 0 : -1,\n \"aria-selected\": isSelected,\n \"aria-current\": isToday ? 'date' : undefined\n }));\n}\n\n/**\n * @ignore - do not document.\n */\nexport function DayCalendar(inProps) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiDayCalendar'\n });\n const utils = useUtils();\n const {\n onFocusedDayChange,\n className,\n currentMonth,\n selectedDays,\n focusedDay,\n loading,\n onSelectedDaysChange,\n onMonthSwitchingAnimationEnd,\n readOnly,\n reduceAnimations,\n renderLoading = () => /*#__PURE__*/_jsx(\"span\", {\n children: \"...\"\n }),\n slideDirection,\n TransitionProps,\n disablePast,\n disableFuture,\n minDate,\n maxDate,\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n dayOfWeekFormatter = date => utils.format(date, 'weekdayShort').charAt(0).toUpperCase(),\n hasFocus,\n onFocusedViewChange,\n gridLabelId,\n displayWeekNumber,\n fixedWeekNumber,\n autoFocus,\n timezone\n } = props;\n const now = useNow(timezone);\n const classes = useUtilityClasses(props);\n const theme = useTheme();\n const isRTL = theme.direction === 'rtl';\n const isDateDisabled = useIsDateDisabled({\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n minDate,\n maxDate,\n disablePast,\n disableFuture,\n timezone\n });\n const localeText = useLocaleText();\n const [internalHasFocus, setInternalHasFocus] = useControlled({\n name: 'DayCalendar',\n state: 'hasFocus',\n controlled: hasFocus,\n default: autoFocus ?? false\n });\n const [internalFocusedDay, setInternalFocusedDay] = React.useState(() => focusedDay || now);\n const handleDaySelect = useEventCallback(day => {\n if (readOnly) {\n return;\n }\n onSelectedDaysChange(day);\n });\n const focusDay = day => {\n if (!isDateDisabled(day)) {\n onFocusedDayChange(day);\n setInternalFocusedDay(day);\n onFocusedViewChange?.(true);\n setInternalHasFocus(true);\n }\n };\n const handleKeyDown = useEventCallback((event, day) => {\n switch (event.key) {\n case 'ArrowUp':\n focusDay(utils.addDays(day, -7));\n event.preventDefault();\n break;\n case 'ArrowDown':\n focusDay(utils.addDays(day, 7));\n event.preventDefault();\n break;\n case 'ArrowLeft':\n {\n const newFocusedDayDefault = utils.addDays(day, isRTL ? 1 : -1);\n const nextAvailableMonth = utils.addMonths(day, isRTL ? 1 : -1);\n const closestDayToFocus = findClosestEnabledDate({\n utils,\n date: newFocusedDayDefault,\n minDate: isRTL ? newFocusedDayDefault : utils.startOfMonth(nextAvailableMonth),\n maxDate: isRTL ? utils.endOfMonth(nextAvailableMonth) : newFocusedDayDefault,\n isDateDisabled,\n timezone\n });\n focusDay(closestDayToFocus || newFocusedDayDefault);\n event.preventDefault();\n break;\n }\n case 'ArrowRight':\n {\n const newFocusedDayDefault = utils.addDays(day, isRTL ? -1 : 1);\n const nextAvailableMonth = utils.addMonths(day, isRTL ? -1 : 1);\n const closestDayToFocus = findClosestEnabledDate({\n utils,\n date: newFocusedDayDefault,\n minDate: isRTL ? utils.startOfMonth(nextAvailableMonth) : newFocusedDayDefault,\n maxDate: isRTL ? newFocusedDayDefault : utils.endOfMonth(nextAvailableMonth),\n isDateDisabled,\n timezone\n });\n focusDay(closestDayToFocus || newFocusedDayDefault);\n event.preventDefault();\n break;\n }\n case 'Home':\n focusDay(utils.startOfWeek(day));\n event.preventDefault();\n break;\n case 'End':\n focusDay(utils.endOfWeek(day));\n event.preventDefault();\n break;\n case 'PageUp':\n focusDay(utils.addMonths(day, 1));\n event.preventDefault();\n break;\n case 'PageDown':\n focusDay(utils.addMonths(day, -1));\n event.preventDefault();\n break;\n default:\n break;\n }\n });\n const handleFocus = useEventCallback((event, day) => focusDay(day));\n const handleBlur = useEventCallback((event, day) => {\n if (internalHasFocus && utils.isSameDay(internalFocusedDay, day)) {\n onFocusedViewChange?.(false);\n }\n });\n const currentMonthNumber = utils.getMonth(currentMonth);\n const currentYearNumber = utils.getYear(currentMonth);\n const validSelectedDays = React.useMemo(() => selectedDays.filter(day => !!day).map(day => utils.startOfDay(day)), [utils, selectedDays]);\n\n // need a new ref whenever the `key` of the transition changes: https://reactcommunity.org/react-transition-group/transition/#Transition-prop-nodeRef.\n const transitionKey = `${currentYearNumber}-${currentMonthNumber}`;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const slideNodeRef = React.useMemo(() => /*#__PURE__*/React.createRef(), [transitionKey]);\n const startOfCurrentWeek = utils.startOfWeek(now);\n const focusableDay = React.useMemo(() => {\n const startOfMonth = utils.startOfMonth(currentMonth);\n const endOfMonth = utils.endOfMonth(currentMonth);\n if (isDateDisabled(internalFocusedDay) || utils.isAfterDay(internalFocusedDay, endOfMonth) || utils.isBeforeDay(internalFocusedDay, startOfMonth)) {\n return findClosestEnabledDate({\n utils,\n date: internalFocusedDay,\n minDate: startOfMonth,\n maxDate: endOfMonth,\n disablePast,\n disableFuture,\n isDateDisabled,\n timezone\n });\n }\n return internalFocusedDay;\n }, [currentMonth, disableFuture, disablePast, internalFocusedDay, isDateDisabled, utils, timezone]);\n const weeksToDisplay = React.useMemo(() => {\n const currentMonthWithTimezone = utils.setTimezone(currentMonth, timezone);\n const toDisplay = utils.getWeekArray(currentMonthWithTimezone);\n let nextMonth = utils.addMonths(currentMonthWithTimezone, 1);\n while (fixedWeekNumber && toDisplay.length < fixedWeekNumber) {\n const additionalWeeks = utils.getWeekArray(nextMonth);\n const hasCommonWeek = utils.isSameDay(toDisplay[toDisplay.length - 1][0], additionalWeeks[0][0]);\n additionalWeeks.slice(hasCommonWeek ? 1 : 0).forEach(week => {\n if (toDisplay.length < fixedWeekNumber) {\n toDisplay.push(week);\n }\n });\n nextMonth = utils.addMonths(nextMonth, 1);\n }\n return toDisplay;\n }, [currentMonth, fixedWeekNumber, utils, timezone]);\n return /*#__PURE__*/_jsxs(PickersCalendarDayRoot, {\n role: \"grid\",\n \"aria-labelledby\": gridLabelId,\n className: classes.root,\n children: [/*#__PURE__*/_jsxs(PickersCalendarDayHeader, {\n role: \"row\",\n className: classes.header,\n children: [displayWeekNumber && /*#__PURE__*/_jsx(PickersCalendarWeekNumberLabel, {\n variant: \"caption\",\n role: \"columnheader\",\n \"aria-label\": localeText.calendarWeekNumberHeaderLabel,\n className: classes.weekNumberLabel,\n children: localeText.calendarWeekNumberHeaderText\n }), getWeekdays(utils, now).map((weekday, i) => /*#__PURE__*/_jsx(PickersCalendarWeekDayLabel, {\n variant: \"caption\",\n role: \"columnheader\",\n \"aria-label\": utils.format(utils.addDays(startOfCurrentWeek, i), 'weekday'),\n className: classes.weekDayLabel,\n children: dayOfWeekFormatter(weekday)\n }, i.toString()))]\n }), loading ? /*#__PURE__*/_jsx(PickersCalendarLoadingContainer, {\n className: classes.loadingContainer,\n children: renderLoading()\n }) : /*#__PURE__*/_jsx(PickersCalendarSlideTransition, _extends({\n transKey: transitionKey,\n onExited: onMonthSwitchingAnimationEnd,\n reduceAnimations: reduceAnimations,\n slideDirection: slideDirection,\n className: clsx(className, classes.slideTransition)\n }, TransitionProps, {\n nodeRef: slideNodeRef,\n children: /*#__PURE__*/_jsx(PickersCalendarWeekContainer, {\n ref: slideNodeRef,\n role: \"rowgroup\",\n className: classes.monthContainer,\n children: weeksToDisplay.map((week, index) => /*#__PURE__*/_jsxs(PickersCalendarWeek, {\n role: \"row\",\n className: classes.weekContainer\n // fix issue of announcing row 1 as row 2\n // caused by week day labels row\n ,\n \"aria-rowindex\": index + 1,\n children: [displayWeekNumber && /*#__PURE__*/_jsx(PickersCalendarWeekNumber, {\n className: classes.weekNumber,\n role: \"rowheader\",\n \"aria-label\": localeText.calendarWeekNumberAriaLabelText(utils.getWeekNumber(week[0])),\n children: localeText.calendarWeekNumberText(utils.getWeekNumber(week[0]))\n }), week.map((day, dayIndex) => /*#__PURE__*/_jsx(WrappedDay, {\n parentProps: props,\n day: day,\n selectedDays: validSelectedDays,\n focusableDay: focusableDay,\n onKeyDown: handleKeyDown,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onDaySelect: handleDaySelect,\n isDateDisabled: isDateDisabled,\n currentMonthNumber: currentMonthNumber,\n isViewFocused: internalHasFocus\n // fix issue of announcing column 1 as column 2 when `displayWeekNumber` is enabled\n ,\n \"aria-colindex\": dayIndex + 1\n }, day.toString()))]\n }, `week-${week[0]}`))\n })\n }))]\n });\n}","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport function getPickersMonthUtilityClass(slot) {\n return generateUtilityClass('MuiPickersMonth', slot);\n}\nexport const pickersMonthClasses = generateUtilityClasses('MuiPickersMonth', ['root', 'monthButton', 'disabled', 'selected']);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"autoFocus\", \"children\", \"disabled\", \"selected\", \"value\", \"tabIndex\", \"onClick\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"aria-current\", \"aria-label\", \"monthsPerRow\"];\nimport * as React from 'react';\nimport { styled, alpha, useThemeProps } from '@mui/material/styles';\nimport { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';\nimport { getPickersMonthUtilityClass, pickersMonthClasses } from './pickersMonthClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n disabled,\n selected,\n classes\n } = ownerState;\n const slots = {\n root: ['root'],\n monthButton: ['monthButton', disabled && 'disabled', selected && 'selected']\n };\n return composeClasses(slots, getPickersMonthUtilityClass, classes);\n};\nconst PickersMonthRoot = styled('div', {\n name: 'MuiPickersMonth',\n slot: 'Root',\n overridesResolver: (_, styles) => [styles.root]\n})({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexBasis: '33.3%',\n variants: [{\n props: {\n monthsPerRow: 4\n },\n style: {\n flexBasis: '25%'\n }\n }]\n});\nconst PickersMonthButton = styled('button', {\n name: 'MuiPickersMonth',\n slot: 'MonthButton',\n overridesResolver: (_, styles) => [styles.monthButton, {\n [`&.${pickersMonthClasses.disabled}`]: styles.disabled\n }, {\n [`&.${pickersMonthClasses.selected}`]: styles.selected\n }]\n})(({\n theme\n}) => _extends({\n color: 'unset',\n backgroundColor: 'transparent',\n border: 0,\n outline: 0\n}, theme.typography.subtitle1, {\n margin: '8px 0',\n height: 36,\n width: 72,\n borderRadius: 18,\n cursor: 'pointer',\n '&:focus': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity)\n },\n '&:hover': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity)\n },\n '&:disabled': {\n cursor: 'auto',\n pointerEvents: 'none'\n },\n [`&.${pickersMonthClasses.disabled}`]: {\n color: (theme.vars || theme).palette.text.secondary\n },\n [`&.${pickersMonthClasses.selected}`]: {\n color: (theme.vars || theme).palette.primary.contrastText,\n backgroundColor: (theme.vars || theme).palette.primary.main,\n '&:focus, &:hover': {\n backgroundColor: (theme.vars || theme).palette.primary.dark\n }\n }\n}));\n\n/**\n * @ignore - do not document.\n */\nexport const PickersMonth = /*#__PURE__*/React.memo(function PickersMonth(inProps) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersMonth'\n });\n const {\n autoFocus,\n children,\n disabled,\n selected,\n value,\n tabIndex,\n onClick,\n onKeyDown,\n onFocus,\n onBlur,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel\n // We don't want to forward this prop to the root element\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ref = React.useRef(null);\n const classes = useUtilityClasses(props);\n useEnhancedEffect(() => {\n if (autoFocus) {\n ref.current?.focus();\n }\n }, [autoFocus]);\n return /*#__PURE__*/_jsx(PickersMonthRoot, _extends({\n className: classes.root,\n ownerState: props\n }, other, {\n children: /*#__PURE__*/_jsx(PickersMonthButton, {\n ref: ref,\n disabled: disabled,\n type: \"button\",\n role: \"radio\",\n tabIndex: disabled ? -1 : tabIndex,\n \"aria-current\": ariaCurrent,\n \"aria-checked\": selected,\n \"aria-label\": ariaLabel,\n onClick: event => onClick(event, value),\n onKeyDown: event => onKeyDown(event, value),\n onFocus: event => onFocus(event, value),\n onBlur: event => onBlur(event, value),\n className: classes.monthButton,\n ownerState: props,\n children: children\n })\n }));\n});","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport function getMonthCalendarUtilityClass(slot) {\n return generateUtilityClass('MuiMonthCalendar', slot);\n}\nexport const monthCalendarClasses = generateUtilityClasses('MuiMonthCalendar', ['root']);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"value\", \"defaultValue\", \"referenceDate\", \"disabled\", \"disableFuture\", \"disablePast\", \"maxDate\", \"minDate\", \"onChange\", \"shouldDisableMonth\", \"readOnly\", \"disableHighlightToday\", \"autoFocus\", \"onMonthFocus\", \"hasFocus\", \"onFocusedViewChange\", \"monthsPerRow\", \"timezone\", \"gridLabelId\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { useTheme } from '@mui/system';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { unstable_useControlled as useControlled, unstable_composeClasses as composeClasses, unstable_useEventCallback as useEventCallback } from '@mui/utils';\nimport { PickersMonth } from './PickersMonth';\nimport { useUtils, useNow, useDefaultDates } from '../internals/hooks/useUtils';\nimport { getMonthCalendarUtilityClass } from './monthCalendarClasses';\nimport { applyDefaultDate, getMonthsInYear } from '../internals/utils/date-utils';\nimport { singleItemValueManager } from '../internals/utils/valueManagers';\nimport { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';\nimport { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';\nimport { DIALOG_WIDTH } from '../internals/constants/dimensions';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, getMonthCalendarUtilityClass, classes);\n};\nexport function useMonthCalendarDefaultizedProps(props, name) {\n const utils = useUtils();\n const defaultDates = useDefaultDates();\n const themeProps = useThemeProps({\n props,\n name\n });\n return _extends({\n disableFuture: false,\n disablePast: false\n }, themeProps, {\n minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),\n maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate)\n });\n}\nconst MonthCalendarRoot = styled('div', {\n name: 'MuiMonthCalendar',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({\n display: 'flex',\n flexWrap: 'wrap',\n alignContent: 'stretch',\n padding: '0 4px',\n width: DIALOG_WIDTH,\n // avoid padding increasing width over defined\n boxSizing: 'border-box'\n});\n/**\n * Demos:\n *\n * - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)\n *\n * API:\n *\n * - [MonthCalendar API](https://mui.com/x/api/date-pickers/month-calendar/)\n */\nexport const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(inProps, ref) {\n const props = useMonthCalendarDefaultizedProps(inProps, 'MuiMonthCalendar');\n const {\n className,\n value: valueProp,\n defaultValue,\n referenceDate: referenceDateProp,\n disabled,\n disableFuture,\n disablePast,\n maxDate,\n minDate,\n onChange,\n shouldDisableMonth,\n readOnly,\n autoFocus = false,\n onMonthFocus,\n hasFocus,\n onFocusedViewChange,\n monthsPerRow = 3,\n timezone: timezoneProp,\n gridLabelId\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n value,\n handleValueChange,\n timezone\n } = useControlledValueWithTimezone({\n name: 'MonthCalendar',\n timezone: timezoneProp,\n value: valueProp,\n defaultValue,\n onChange: onChange,\n valueManager: singleItemValueManager\n });\n const now = useNow(timezone);\n const theme = useTheme();\n const utils = useUtils();\n const referenceDate = React.useMemo(() => singleItemValueManager.getInitialReferenceValue({\n value,\n utils,\n props,\n timezone,\n referenceDate: referenceDateProp,\n granularity: SECTION_TYPE_GRANULARITY.month\n }), [] // eslint-disable-line react-hooks/exhaustive-deps\n );\n const ownerState = props;\n const classes = useUtilityClasses(ownerState);\n const todayMonth = React.useMemo(() => utils.getMonth(now), [utils, now]);\n const selectedMonth = React.useMemo(() => {\n if (value != null) {\n return utils.getMonth(value);\n }\n return null;\n }, [value, utils]);\n const [focusedMonth, setFocusedMonth] = React.useState(() => selectedMonth || utils.getMonth(referenceDate));\n const [internalHasFocus, setInternalHasFocus] = useControlled({\n name: 'MonthCalendar',\n state: 'hasFocus',\n controlled: hasFocus,\n default: autoFocus ?? false\n });\n const changeHasFocus = useEventCallback(newHasFocus => {\n setInternalHasFocus(newHasFocus);\n if (onFocusedViewChange) {\n onFocusedViewChange(newHasFocus);\n }\n });\n const isMonthDisabled = React.useCallback(dateToValidate => {\n const firstEnabledMonth = utils.startOfMonth(disablePast && utils.isAfter(now, minDate) ? now : minDate);\n const lastEnabledMonth = utils.startOfMonth(disableFuture && utils.isBefore(now, maxDate) ? now : maxDate);\n const monthToValidate = utils.startOfMonth(dateToValidate);\n if (utils.isBefore(monthToValidate, firstEnabledMonth)) {\n return true;\n }\n if (utils.isAfter(monthToValidate, lastEnabledMonth)) {\n return true;\n }\n if (!shouldDisableMonth) {\n return false;\n }\n return shouldDisableMonth(monthToValidate);\n }, [disableFuture, disablePast, maxDate, minDate, now, shouldDisableMonth, utils]);\n const handleMonthSelection = useEventCallback((event, month) => {\n if (readOnly) {\n return;\n }\n const newDate = utils.setMonth(value ?? referenceDate, month);\n handleValueChange(newDate);\n });\n const focusMonth = useEventCallback(month => {\n if (!isMonthDisabled(utils.setMonth(value ?? referenceDate, month))) {\n setFocusedMonth(month);\n changeHasFocus(true);\n if (onMonthFocus) {\n onMonthFocus(month);\n }\n }\n });\n React.useEffect(() => {\n setFocusedMonth(prevFocusedMonth => selectedMonth !== null && prevFocusedMonth !== selectedMonth ? selectedMonth : prevFocusedMonth);\n }, [selectedMonth]);\n const handleKeyDown = useEventCallback((event, month) => {\n const monthsInYear = 12;\n const monthsInRow = 3;\n switch (event.key) {\n case 'ArrowUp':\n focusMonth((monthsInYear + month - monthsInRow) % monthsInYear);\n event.preventDefault();\n break;\n case 'ArrowDown':\n focusMonth((monthsInYear + month + monthsInRow) % monthsInYear);\n event.preventDefault();\n break;\n case 'ArrowLeft':\n focusMonth((monthsInYear + month + (theme.direction === 'ltr' ? -1 : 1)) % monthsInYear);\n event.preventDefault();\n break;\n case 'ArrowRight':\n focusMonth((monthsInYear + month + (theme.direction === 'ltr' ? 1 : -1)) % monthsInYear);\n event.preventDefault();\n break;\n default:\n break;\n }\n });\n const handleMonthFocus = useEventCallback((event, month) => {\n focusMonth(month);\n });\n const handleMonthBlur = useEventCallback((event, month) => {\n if (focusedMonth === month) {\n changeHasFocus(false);\n }\n });\n return /*#__PURE__*/_jsx(MonthCalendarRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: ownerState,\n role: \"radiogroup\",\n \"aria-labelledby\": gridLabelId\n }, other, {\n children: getMonthsInYear(utils, value ?? referenceDate).map(month => {\n const monthNumber = utils.getMonth(month);\n const monthText = utils.format(month, 'monthShort');\n const monthLabel = utils.format(month, 'month');\n const isSelected = monthNumber === selectedMonth;\n const isDisabled = disabled || isMonthDisabled(month);\n return /*#__PURE__*/_jsx(PickersMonth, {\n selected: isSelected,\n value: monthNumber,\n onClick: handleMonthSelection,\n onKeyDown: handleKeyDown,\n autoFocus: internalHasFocus && monthNumber === focusedMonth,\n disabled: isDisabled,\n tabIndex: monthNumber === focusedMonth ? 0 : -1,\n onFocus: handleMonthFocus,\n onBlur: handleMonthBlur,\n \"aria-current\": todayMonth === monthNumber ? 'date' : undefined,\n \"aria-label\": monthLabel,\n monthsPerRow: monthsPerRow,\n children: monthText\n }, monthText);\n })\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? MonthCalendar.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n autoFocus: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n className: PropTypes.string,\n /**\n * The default selected value.\n * Used when the component is not controlled.\n */\n defaultValue: PropTypes.object,\n /**\n * If `true` picker is disabled\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, disable values after the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disableFuture: PropTypes.bool,\n /**\n * If `true`, today's date is rendering without highlighting with circle.\n * @default false\n */\n disableHighlightToday: PropTypes.bool,\n /**\n * If `true`, disable values before the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disablePast: PropTypes.bool,\n gridLabelId: PropTypes.string,\n hasFocus: PropTypes.bool,\n /**\n * Maximal selectable date.\n */\n maxDate: PropTypes.object,\n /**\n * Minimal selectable date.\n */\n minDate: PropTypes.object,\n /**\n * Months rendered per row.\n * @default 3\n */\n monthsPerRow: PropTypes.oneOf([3, 4]),\n /**\n * Callback fired when the value changes.\n * @template TDate\n * @param {TDate} value The new value.\n */\n onChange: PropTypes.func,\n onFocusedViewChange: PropTypes.func,\n onMonthFocus: PropTypes.func,\n /**\n * If `true` picker is readonly\n */\n readOnly: PropTypes.bool,\n /**\n * The date used to generate the new value when both `value` and `defaultValue` are empty.\n * @default The closest valid month using the validation props, except callbacks such as `shouldDisableMonth`.\n */\n referenceDate: PropTypes.object,\n /**\n * Disable specific month.\n * @template TDate\n * @param {TDate} month The month to test.\n * @returns {boolean} If `true`, the month will be disabled.\n */\n shouldDisableMonth: PropTypes.func,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Choose which timezone to use for the value.\n * Example: \"default\", \"system\", \"UTC\", \"America/New_York\".\n * If you pass values from other timezones to some props, they will be converted to this timezone before being used.\n * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.\n * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.\n */\n timezone: PropTypes.string,\n /**\n * The selected value.\n * Used when the component is controlled.\n */\n value: PropTypes.object\n} : void 0;","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport function getPickersYearUtilityClass(slot) {\n return generateUtilityClass('MuiPickersYear', slot);\n}\nexport const pickersYearClasses = generateUtilityClasses('MuiPickersYear', ['root', 'yearButton', 'selected', 'disabled']);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"autoFocus\", \"className\", \"children\", \"disabled\", \"selected\", \"value\", \"tabIndex\", \"onClick\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"aria-current\", \"yearsPerRow\"];\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/utils';\nimport { alpha, styled, useThemeProps } from '@mui/material/styles';\nimport { getPickersYearUtilityClass, pickersYearClasses } from './pickersYearClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n disabled,\n selected,\n classes\n } = ownerState;\n const slots = {\n root: ['root'],\n yearButton: ['yearButton', disabled && 'disabled', selected && 'selected']\n };\n return composeClasses(slots, getPickersYearUtilityClass, classes);\n};\nconst PickersYearRoot = styled('div', {\n name: 'MuiPickersYear',\n slot: 'Root',\n overridesResolver: (_, styles) => [styles.root]\n})({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexBasis: '33.3%',\n variants: [{\n props: {\n yearsPerRow: 4\n },\n style: {\n flexBasis: '25%'\n }\n }]\n});\nconst PickersYearButton = styled('button', {\n name: 'MuiPickersYear',\n slot: 'YearButton',\n overridesResolver: (_, styles) => [styles.yearButton, {\n [`&.${pickersYearClasses.disabled}`]: styles.disabled\n }, {\n [`&.${pickersYearClasses.selected}`]: styles.selected\n }]\n})(({\n theme\n}) => _extends({\n color: 'unset',\n backgroundColor: 'transparent',\n border: 0,\n outline: 0\n}, theme.typography.subtitle1, {\n margin: '6px 0',\n height: 36,\n width: 72,\n borderRadius: 18,\n cursor: 'pointer',\n '&:focus': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.focusOpacity})` : alpha(theme.palette.action.active, theme.palette.action.focusOpacity)\n },\n '&:hover': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity)\n },\n '&:disabled': {\n cursor: 'auto',\n pointerEvents: 'none'\n },\n [`&.${pickersYearClasses.disabled}`]: {\n color: (theme.vars || theme).palette.text.secondary\n },\n [`&.${pickersYearClasses.selected}`]: {\n color: (theme.vars || theme).palette.primary.contrastText,\n backgroundColor: (theme.vars || theme).palette.primary.main,\n '&:focus, &:hover': {\n backgroundColor: (theme.vars || theme).palette.primary.dark\n }\n }\n}));\n\n/**\n * @ignore - internal component.\n */\nexport const PickersYear = /*#__PURE__*/React.memo(function PickersYear(inProps) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersYear'\n });\n const {\n autoFocus,\n className,\n children,\n disabled,\n selected,\n value,\n tabIndex,\n onClick,\n onKeyDown,\n onFocus,\n onBlur,\n 'aria-current': ariaCurrent\n // We don't want to forward this prop to the root element\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ref = React.useRef(null);\n const classes = useUtilityClasses(props);\n\n // We can't forward the `autoFocus` to the button because it is a native button, not a MUI Button\n React.useEffect(() => {\n if (autoFocus) {\n // `ref.current` being `null` would be a bug in MUI.\n ref.current.focus();\n }\n }, [autoFocus]);\n return /*#__PURE__*/_jsx(PickersYearRoot, _extends({\n className: clsx(classes.root, className),\n ownerState: props\n }, other, {\n children: /*#__PURE__*/_jsx(PickersYearButton, {\n ref: ref,\n disabled: disabled,\n type: \"button\",\n role: \"radio\",\n tabIndex: disabled ? -1 : tabIndex,\n \"aria-current\": ariaCurrent,\n \"aria-checked\": selected,\n onClick: event => onClick(event, value),\n onKeyDown: event => onKeyDown(event, value),\n onFocus: event => onFocus(event, value),\n onBlur: event => onBlur(event, value),\n className: classes.yearButton,\n ownerState: props,\n children: children\n })\n }));\n});","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport function getYearCalendarUtilityClass(slot) {\n return generateUtilityClass('MuiYearCalendar', slot);\n}\nexport const yearCalendarClasses = generateUtilityClasses('MuiYearCalendar', ['root']);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"autoFocus\", \"className\", \"value\", \"defaultValue\", \"referenceDate\", \"disabled\", \"disableFuture\", \"disablePast\", \"maxDate\", \"minDate\", \"onChange\", \"readOnly\", \"shouldDisableYear\", \"disableHighlightToday\", \"onYearFocus\", \"hasFocus\", \"onFocusedViewChange\", \"yearsPerRow\", \"timezone\", \"gridLabelId\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { useTheme } from '@mui/system';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_useControlled as useControlled, unstable_useEventCallback as useEventCallback } from '@mui/utils';\nimport { PickersYear } from './PickersYear';\nimport { useUtils, useNow, useDefaultDates } from '../internals/hooks/useUtils';\nimport { getYearCalendarUtilityClass } from './yearCalendarClasses';\nimport { applyDefaultDate } from '../internals/utils/date-utils';\nimport { singleItemValueManager } from '../internals/utils/valueManagers';\nimport { SECTION_TYPE_GRANULARITY } from '../internals/utils/getDefaultReferenceDate';\nimport { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';\nimport { DIALOG_WIDTH, MAX_CALENDAR_HEIGHT } from '../internals/constants/dimensions';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, getYearCalendarUtilityClass, classes);\n};\nfunction useYearCalendarDefaultizedProps(props, name) {\n const utils = useUtils();\n const defaultDates = useDefaultDates();\n const themeProps = useThemeProps({\n props,\n name\n });\n return _extends({\n disablePast: false,\n disableFuture: false\n }, themeProps, {\n yearsPerRow: themeProps.yearsPerRow ?? 3,\n minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),\n maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate)\n });\n}\nconst YearCalendarRoot = styled('div', {\n name: 'MuiYearCalendar',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n overflowY: 'auto',\n height: '100%',\n padding: '0 4px',\n width: DIALOG_WIDTH,\n maxHeight: MAX_CALENDAR_HEIGHT,\n // avoid padding increasing width over defined\n boxSizing: 'border-box',\n position: 'relative'\n});\n/**\n * Demos:\n *\n * - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)\n *\n * API:\n *\n * - [YearCalendar API](https://mui.com/x/api/date-pickers/year-calendar/)\n */\nexport const YearCalendar = /*#__PURE__*/React.forwardRef(function YearCalendar(inProps, ref) {\n const props = useYearCalendarDefaultizedProps(inProps, 'MuiYearCalendar');\n const {\n autoFocus,\n className,\n value: valueProp,\n defaultValue,\n referenceDate: referenceDateProp,\n disabled,\n disableFuture,\n disablePast,\n maxDate,\n minDate,\n onChange,\n readOnly,\n shouldDisableYear,\n onYearFocus,\n hasFocus,\n onFocusedViewChange,\n yearsPerRow,\n timezone: timezoneProp,\n gridLabelId\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n value,\n handleValueChange,\n timezone\n } = useControlledValueWithTimezone({\n name: 'YearCalendar',\n timezone: timezoneProp,\n value: valueProp,\n defaultValue,\n onChange: onChange,\n valueManager: singleItemValueManager\n });\n const now = useNow(timezone);\n const theme = useTheme();\n const utils = useUtils();\n const referenceDate = React.useMemo(() => singleItemValueManager.getInitialReferenceValue({\n value,\n utils,\n props,\n timezone,\n referenceDate: referenceDateProp,\n granularity: SECTION_TYPE_GRANULARITY.year\n }), [] // eslint-disable-line react-hooks/exhaustive-deps\n );\n const ownerState = props;\n const classes = useUtilityClasses(ownerState);\n const todayYear = React.useMemo(() => utils.getYear(now), [utils, now]);\n const selectedYear = React.useMemo(() => {\n if (value != null) {\n return utils.getYear(value);\n }\n return null;\n }, [value, utils]);\n const [focusedYear, setFocusedYear] = React.useState(() => selectedYear || utils.getYear(referenceDate));\n const [internalHasFocus, setInternalHasFocus] = useControlled({\n name: 'YearCalendar',\n state: 'hasFocus',\n controlled: hasFocus,\n default: autoFocus ?? false\n });\n const changeHasFocus = useEventCallback(newHasFocus => {\n setInternalHasFocus(newHasFocus);\n if (onFocusedViewChange) {\n onFocusedViewChange(newHasFocus);\n }\n });\n const isYearDisabled = React.useCallback(dateToValidate => {\n if (disablePast && utils.isBeforeYear(dateToValidate, now)) {\n return true;\n }\n if (disableFuture && utils.isAfterYear(dateToValidate, now)) {\n return true;\n }\n if (minDate && utils.isBeforeYear(dateToValidate, minDate)) {\n return true;\n }\n if (maxDate && utils.isAfterYear(dateToValidate, maxDate)) {\n return true;\n }\n if (!shouldDisableYear) {\n return false;\n }\n const yearToValidate = utils.startOfYear(dateToValidate);\n return shouldDisableYear(yearToValidate);\n }, [disableFuture, disablePast, maxDate, minDate, now, shouldDisableYear, utils]);\n const handleYearSelection = useEventCallback((event, year) => {\n if (readOnly) {\n return;\n }\n const newDate = utils.setYear(value ?? referenceDate, year);\n handleValueChange(newDate);\n });\n const focusYear = useEventCallback(year => {\n if (!isYearDisabled(utils.setYear(value ?? referenceDate, year))) {\n setFocusedYear(year);\n changeHasFocus(true);\n onYearFocus?.(year);\n }\n });\n React.useEffect(() => {\n setFocusedYear(prevFocusedYear => selectedYear !== null && prevFocusedYear !== selectedYear ? selectedYear : prevFocusedYear);\n }, [selectedYear]);\n const handleKeyDown = useEventCallback((event, year) => {\n switch (event.key) {\n case 'ArrowUp':\n focusYear(year - yearsPerRow);\n event.preventDefault();\n break;\n case 'ArrowDown':\n focusYear(year + yearsPerRow);\n event.preventDefault();\n break;\n case 'ArrowLeft':\n focusYear(year + (theme.direction === 'ltr' ? -1 : 1));\n event.preventDefault();\n break;\n case 'ArrowRight':\n focusYear(year + (theme.direction === 'ltr' ? 1 : -1));\n event.preventDefault();\n break;\n default:\n break;\n }\n });\n const handleYearFocus = useEventCallback((event, year) => {\n focusYear(year);\n });\n const handleYearBlur = useEventCallback((event, year) => {\n if (focusedYear === year) {\n changeHasFocus(false);\n }\n });\n const scrollerRef = React.useRef(null);\n const handleRef = useForkRef(ref, scrollerRef);\n React.useEffect(() => {\n if (autoFocus || scrollerRef.current === null) {\n return;\n }\n const tabbableButton = scrollerRef.current.querySelector('[tabindex=\"0\"]');\n if (!tabbableButton) {\n return;\n }\n\n // Taken from useScroll in x-data-grid, but vertically centered\n const offsetHeight = tabbableButton.offsetHeight;\n const offsetTop = tabbableButton.offsetTop;\n const clientHeight = scrollerRef.current.clientHeight;\n const scrollTop = scrollerRef.current.scrollTop;\n const elementBottom = offsetTop + offsetHeight;\n if (offsetHeight > clientHeight || offsetTop < scrollTop) {\n // Button already visible\n return;\n }\n scrollerRef.current.scrollTop = elementBottom - clientHeight / 2 - offsetHeight / 2;\n }, [autoFocus]);\n return /*#__PURE__*/_jsx(YearCalendarRoot, _extends({\n ref: handleRef,\n className: clsx(classes.root, className),\n ownerState: ownerState,\n role: \"radiogroup\",\n \"aria-labelledby\": gridLabelId\n }, other, {\n children: utils.getYearRange([minDate, maxDate]).map(year => {\n const yearNumber = utils.getYear(year);\n const isSelected = yearNumber === selectedYear;\n const isDisabled = disabled || isYearDisabled(year);\n return /*#__PURE__*/_jsx(PickersYear, {\n selected: isSelected,\n value: yearNumber,\n onClick: handleYearSelection,\n onKeyDown: handleKeyDown,\n autoFocus: internalHasFocus && yearNumber === focusedYear,\n disabled: isDisabled,\n tabIndex: yearNumber === focusedYear ? 0 : -1,\n onFocus: handleYearFocus,\n onBlur: handleYearBlur,\n \"aria-current\": todayYear === yearNumber ? 'date' : undefined,\n yearsPerRow: yearsPerRow,\n children: utils.format(year, 'year')\n }, utils.format(year, 'year'));\n })\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? YearCalendar.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n autoFocus: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n className: PropTypes.string,\n /**\n * The default selected value.\n * Used when the component is not controlled.\n */\n defaultValue: PropTypes.object,\n /**\n * If `true` picker is disabled\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, disable values after the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disableFuture: PropTypes.bool,\n /**\n * If `true`, today's date is rendering without highlighting with circle.\n * @default false\n */\n disableHighlightToday: PropTypes.bool,\n /**\n * If `true`, disable values before the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disablePast: PropTypes.bool,\n gridLabelId: PropTypes.string,\n hasFocus: PropTypes.bool,\n /**\n * Maximal selectable date.\n */\n maxDate: PropTypes.object,\n /**\n * Minimal selectable date.\n */\n minDate: PropTypes.object,\n /**\n * Callback fired when the value changes.\n * @template TDate\n * @param {TDate} value The new value.\n */\n onChange: PropTypes.func,\n onFocusedViewChange: PropTypes.func,\n onYearFocus: PropTypes.func,\n /**\n * If `true` picker is readonly\n */\n readOnly: PropTypes.bool,\n /**\n * The date used to generate the new value when both `value` and `defaultValue` are empty.\n * @default The closest valid year using the validation props, except callbacks such as `shouldDisableYear`.\n */\n referenceDate: PropTypes.object,\n /**\n * Disable specific year.\n * @template TDate\n * @param {TDate} year The year to test.\n * @returns {boolean} If `true`, the year will be disabled.\n */\n shouldDisableYear: PropTypes.func,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Choose which timezone to use for the value.\n * Example: \"default\", \"system\", \"UTC\", \"America/New_York\".\n * If you pass values from other timezones to some props, they will be converted to this timezone before being used.\n * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.\n * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.\n */\n timezone: PropTypes.string,\n /**\n * The selected value.\n * Used when the component is controlled.\n */\n value: PropTypes.object,\n /**\n * Years rendered per row.\n * @default 3\n */\n yearsPerRow: PropTypes.oneOf([3, 4])\n} : void 0;","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport function getPickersArrowSwitcherUtilityClass(slot) {\n return generateUtilityClass('MuiPickersArrowSwitcher', slot);\n}\nexport const pickersArrowSwitcherClasses = generateUtilityClasses('MuiPickersArrowSwitcher', ['root', 'spacer', 'button']);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"className\", \"slots\", \"slotProps\", \"isNextDisabled\", \"isNextHidden\", \"onGoToNext\", \"nextLabel\", \"isPreviousDisabled\", \"isPreviousHidden\", \"onGoToPrevious\", \"previousLabel\"],\n _excluded2 = [\"ownerState\"],\n _excluded3 = [\"ownerState\"];\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport Typography from '@mui/material/Typography';\nimport { useTheme, styled, useThemeProps } from '@mui/material/styles';\nimport { unstable_composeClasses as composeClasses } from '@mui/utils';\nimport { useSlotProps } from '@mui/base/utils';\nimport IconButton from '@mui/material/IconButton';\nimport { ArrowLeftIcon, ArrowRightIcon } from '../../../icons';\nimport { getPickersArrowSwitcherUtilityClass } from './pickersArrowSwitcherClasses';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst PickersArrowSwitcherRoot = styled('div', {\n name: 'MuiPickersArrowSwitcher',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({\n display: 'flex'\n});\nconst PickersArrowSwitcherSpacer = styled('div', {\n name: 'MuiPickersArrowSwitcher',\n slot: 'Spacer',\n overridesResolver: (props, styles) => styles.spacer\n})(({\n theme\n}) => ({\n width: theme.spacing(3)\n}));\nconst PickersArrowSwitcherButton = styled(IconButton, {\n name: 'MuiPickersArrowSwitcher',\n slot: 'Button',\n overridesResolver: (props, styles) => styles.button\n})({\n variants: [{\n props: {\n hidden: true\n },\n style: {\n visibility: 'hidden'\n }\n }]\n});\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root'],\n spacer: ['spacer'],\n button: ['button']\n };\n return composeClasses(slots, getPickersArrowSwitcherUtilityClass, classes);\n};\nexport const PickersArrowSwitcher = /*#__PURE__*/React.forwardRef(function PickersArrowSwitcher(inProps, ref) {\n const theme = useTheme();\n const isRTL = theme.direction === 'rtl';\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersArrowSwitcher'\n });\n const {\n children,\n className,\n slots,\n slotProps,\n isNextDisabled,\n isNextHidden,\n onGoToNext,\n nextLabel,\n isPreviousDisabled,\n isPreviousHidden,\n onGoToPrevious,\n previousLabel\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = props;\n const classes = useUtilityClasses(ownerState);\n const nextProps = {\n isDisabled: isNextDisabled,\n isHidden: isNextHidden,\n goTo: onGoToNext,\n label: nextLabel\n };\n const previousProps = {\n isDisabled: isPreviousDisabled,\n isHidden: isPreviousHidden,\n goTo: onGoToPrevious,\n label: previousLabel\n };\n const PreviousIconButton = slots?.previousIconButton ?? PickersArrowSwitcherButton;\n const previousIconButtonProps = useSlotProps({\n elementType: PreviousIconButton,\n externalSlotProps: slotProps?.previousIconButton,\n additionalProps: {\n size: 'medium',\n title: previousProps.label,\n 'aria-label': previousProps.label,\n disabled: previousProps.isDisabled,\n edge: 'end',\n onClick: previousProps.goTo\n },\n ownerState: _extends({}, ownerState, {\n hidden: previousProps.isHidden\n }),\n className: classes.button\n });\n const NextIconButton = slots?.nextIconButton ?? PickersArrowSwitcherButton;\n const nextIconButtonProps = useSlotProps({\n elementType: NextIconButton,\n externalSlotProps: slotProps?.nextIconButton,\n additionalProps: {\n size: 'medium',\n title: nextProps.label,\n 'aria-label': nextProps.label,\n disabled: nextProps.isDisabled,\n edge: 'start',\n onClick: nextProps.goTo\n },\n ownerState: _extends({}, ownerState, {\n hidden: nextProps.isHidden\n }),\n className: classes.button\n });\n const LeftArrowIcon = slots?.leftArrowIcon ?? ArrowLeftIcon;\n // The spread is here to avoid this bug mui/material-ui#34056\n const _useSlotProps = useSlotProps({\n elementType: LeftArrowIcon,\n externalSlotProps: slotProps?.leftArrowIcon,\n additionalProps: {\n fontSize: 'inherit'\n },\n ownerState: undefined\n }),\n leftArrowIconProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);\n const RightArrowIcon = slots?.rightArrowIcon ?? ArrowRightIcon;\n // The spread is here to avoid this bug mui/material-ui#34056\n const _useSlotProps2 = useSlotProps({\n elementType: RightArrowIcon,\n externalSlotProps: slotProps?.rightArrowIcon,\n additionalProps: {\n fontSize: 'inherit'\n },\n ownerState: undefined\n }),\n rightArrowIconProps = _objectWithoutPropertiesLoose(_useSlotProps2, _excluded3);\n return /*#__PURE__*/_jsxs(PickersArrowSwitcherRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: ownerState\n }, other, {\n children: [/*#__PURE__*/_jsx(PreviousIconButton, _extends({}, previousIconButtonProps, {\n children: isRTL ? /*#__PURE__*/_jsx(RightArrowIcon, _extends({}, rightArrowIconProps)) : /*#__PURE__*/_jsx(LeftArrowIcon, _extends({}, leftArrowIconProps))\n })), children ? /*#__PURE__*/_jsx(Typography, {\n variant: \"subtitle1\",\n component: \"span\",\n children: children\n }) : /*#__PURE__*/_jsx(PickersArrowSwitcherSpacer, {\n className: classes.spacer,\n ownerState: ownerState\n }), /*#__PURE__*/_jsx(NextIconButton, _extends({}, nextIconButtonProps, {\n children: isRTL ? /*#__PURE__*/_jsx(LeftArrowIcon, _extends({}, leftArrowIconProps)) : /*#__PURE__*/_jsx(RightArrowIcon, _extends({}, rightArrowIconProps))\n }))]\n }));\n});","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport const getPickersCalendarHeaderUtilityClass = slot => generateUtilityClass('MuiPickersCalendarHeader', slot);\nexport const pickersCalendarHeaderClasses = generateUtilityClasses('MuiPickersCalendarHeader', ['root', 'labelContainer', 'label', 'switchViewButton', 'switchViewIcon']);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"slots\", \"slotProps\", \"currentMonth\", \"disabled\", \"disableFuture\", \"disablePast\", \"maxDate\", \"minDate\", \"onMonthChange\", \"onViewChange\", \"view\", \"reduceAnimations\", \"views\", \"labelId\", \"className\", \"timezone\", \"format\"],\n _excluded2 = [\"ownerState\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport Fade from '@mui/material/Fade';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { useSlotProps } from '@mui/base/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/utils';\nimport IconButton from '@mui/material/IconButton';\nimport { useLocaleText, useUtils } from '../internals/hooks/useUtils';\nimport { PickersFadeTransitionGroup } from '../DateCalendar/PickersFadeTransitionGroup';\nimport { ArrowDropDownIcon } from '../icons';\nimport { PickersArrowSwitcher } from '../internals/components/PickersArrowSwitcher';\nimport { usePreviousMonthDisabled, useNextMonthDisabled } from '../internals/hooks/date-helpers-hooks';\nimport { getPickersCalendarHeaderUtilityClass, pickersCalendarHeaderClasses } from './pickersCalendarHeaderClasses';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root'],\n labelContainer: ['labelContainer'],\n label: ['label'],\n switchViewButton: ['switchViewButton'],\n switchViewIcon: ['switchViewIcon']\n };\n return composeClasses(slots, getPickersCalendarHeaderUtilityClass, classes);\n};\nconst PickersCalendarHeaderRoot = styled('div', {\n name: 'MuiPickersCalendarHeader',\n slot: 'Root',\n overridesResolver: (_, styles) => styles.root\n})({\n display: 'flex',\n alignItems: 'center',\n marginTop: 12,\n marginBottom: 4,\n paddingLeft: 24,\n paddingRight: 12,\n // prevent jumping in safari\n maxHeight: 40,\n minHeight: 40\n});\nconst PickersCalendarHeaderLabelContainer = styled('div', {\n name: 'MuiPickersCalendarHeader',\n slot: 'LabelContainer',\n overridesResolver: (_, styles) => styles.labelContainer\n})(({\n theme\n}) => _extends({\n display: 'flex',\n overflow: 'hidden',\n alignItems: 'center',\n cursor: 'pointer',\n marginRight: 'auto'\n}, theme.typography.body1, {\n fontWeight: theme.typography.fontWeightMedium\n}));\nconst PickersCalendarHeaderLabel = styled('div', {\n name: 'MuiPickersCalendarHeader',\n slot: 'Label',\n overridesResolver: (_, styles) => styles.label\n})({\n marginRight: 6\n});\nconst PickersCalendarHeaderSwitchViewButton = styled(IconButton, {\n name: 'MuiPickersCalendarHeader',\n slot: 'SwitchViewButton',\n overridesResolver: (_, styles) => styles.switchViewButton\n})({\n marginRight: 'auto',\n variants: [{\n props: {\n view: 'year'\n },\n style: {\n [`.${pickersCalendarHeaderClasses.switchViewIcon}`]: {\n transform: 'rotate(180deg)'\n }\n }\n }]\n});\nconst PickersCalendarHeaderSwitchViewIcon = styled(ArrowDropDownIcon, {\n name: 'MuiPickersCalendarHeader',\n slot: 'SwitchViewIcon',\n overridesResolver: (_, styles) => styles.switchViewIcon\n})(({\n theme\n}) => ({\n willChange: 'transform',\n transition: theme.transitions.create('transform'),\n transform: 'rotate(0deg)'\n}));\n/**\n * Demos:\n *\n * - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)\n * - [DateRangeCalendar](https://mui.com/x/react-date-pickers/date-range-calendar/)\n * - [Custom slots and subcomponents](https://mui.com/x/react-date-pickers/custom-components/)\n *\n * API:\n *\n * - [PickersCalendarHeader API](https://mui.com/x/api/date-pickers/pickers-calendar-header/)\n */\nconst PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalendarHeader(inProps, ref) {\n const localeText = useLocaleText();\n const utils = useUtils();\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPickersCalendarHeader'\n });\n const {\n slots,\n slotProps,\n currentMonth: month,\n disabled,\n disableFuture,\n disablePast,\n maxDate,\n minDate,\n onMonthChange,\n onViewChange,\n view,\n reduceAnimations,\n views,\n labelId,\n className,\n timezone,\n format = `${utils.formats.month} ${utils.formats.year}`\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = props;\n const classes = useUtilityClasses(props);\n const SwitchViewButton = slots?.switchViewButton ?? PickersCalendarHeaderSwitchViewButton;\n const switchViewButtonProps = useSlotProps({\n elementType: SwitchViewButton,\n externalSlotProps: slotProps?.switchViewButton,\n additionalProps: {\n size: 'small',\n 'aria-label': localeText.calendarViewSwitchingButtonAriaLabel(view)\n },\n ownerState,\n className: classes.switchViewButton\n });\n const SwitchViewIcon = slots?.switchViewIcon ?? PickersCalendarHeaderSwitchViewIcon;\n // The spread is here to avoid this bug mui/material-ui#34056\n const _useSlotProps = useSlotProps({\n elementType: SwitchViewIcon,\n externalSlotProps: slotProps?.switchViewIcon,\n ownerState: undefined,\n className: classes.switchViewIcon\n }),\n switchViewIconProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);\n const selectNextMonth = () => onMonthChange(utils.addMonths(month, 1), 'left');\n const selectPreviousMonth = () => onMonthChange(utils.addMonths(month, -1), 'right');\n const isNextMonthDisabled = useNextMonthDisabled(month, {\n disableFuture,\n maxDate,\n timezone\n });\n const isPreviousMonthDisabled = usePreviousMonthDisabled(month, {\n disablePast,\n minDate,\n timezone\n });\n const handleToggleView = () => {\n if (views.length === 1 || !onViewChange || disabled) {\n return;\n }\n if (views.length === 2) {\n onViewChange(views.find(el => el !== view) || views[0]);\n } else {\n // switching only between first 2\n const nextIndexToOpen = views.indexOf(view) !== 0 ? 0 : 1;\n onViewChange(views[nextIndexToOpen]);\n }\n };\n\n // No need to display more information\n if (views.length === 1 && views[0] === 'year') {\n return null;\n }\n const label = utils.formatByString(month, format);\n return /*#__PURE__*/_jsxs(PickersCalendarHeaderRoot, _extends({}, other, {\n ownerState: ownerState,\n className: clsx(className, classes.root),\n ref: ref,\n children: [/*#__PURE__*/_jsxs(PickersCalendarHeaderLabelContainer, {\n role: \"presentation\",\n onClick: handleToggleView,\n ownerState: ownerState\n // putting this on the label item element below breaks when using transition\n ,\n \"aria-live\": \"polite\",\n className: classes.labelContainer,\n children: [/*#__PURE__*/_jsx(PickersFadeTransitionGroup, {\n reduceAnimations: reduceAnimations,\n transKey: label,\n children: /*#__PURE__*/_jsx(PickersCalendarHeaderLabel, {\n id: labelId,\n ownerState: ownerState,\n className: classes.label,\n children: label\n })\n }), views.length > 1 && !disabled && /*#__PURE__*/_jsx(SwitchViewButton, _extends({}, switchViewButtonProps, {\n children: /*#__PURE__*/_jsx(SwitchViewIcon, _extends({}, switchViewIconProps))\n }))]\n }), /*#__PURE__*/_jsx(Fade, {\n in: view === 'day',\n children: /*#__PURE__*/_jsx(PickersArrowSwitcher, {\n slots: slots,\n slotProps: slotProps,\n onGoToPrevious: selectPreviousMonth,\n isPreviousDisabled: isPreviousMonthDisabled,\n previousLabel: localeText.previousMonth,\n onGoToNext: selectNextMonth,\n isNextDisabled: isNextMonthDisabled,\n nextLabel: localeText.nextMonth\n })\n })]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? PickersCalendarHeader.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n className: PropTypes.string,\n currentMonth: PropTypes.object.isRequired,\n disabled: PropTypes.bool,\n disableFuture: PropTypes.bool,\n disablePast: PropTypes.bool,\n /**\n * Format used to display the date.\n * @default `${adapter.formats.month} ${adapter.formats.year}`\n */\n format: PropTypes.string,\n labelId: PropTypes.string,\n maxDate: PropTypes.object.isRequired,\n minDate: PropTypes.object.isRequired,\n onMonthChange: PropTypes.func.isRequired,\n onViewChange: PropTypes.func,\n reduceAnimations: PropTypes.bool.isRequired,\n /**\n * The props used for each component slot.\n * @default {}\n */\n slotProps: PropTypes.object,\n /**\n * Overridable component slots.\n * @default {}\n */\n slots: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n timezone: PropTypes.string.isRequired,\n view: PropTypes.oneOf(['day', 'month', 'year']).isRequired,\n views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired).isRequired\n} : void 0;\nexport { PickersCalendarHeader };","import * as React from 'react';\nimport { useUtils } from './useUtils';\nimport { getMeridiem, convertToMeridiem } from '../utils/time-utils';\nexport function useNextMonthDisabled(month, {\n disableFuture,\n maxDate,\n timezone\n}) {\n const utils = useUtils();\n return React.useMemo(() => {\n const now = utils.date(undefined, timezone);\n const lastEnabledMonth = utils.startOfMonth(disableFuture && utils.isBefore(now, maxDate) ? now : maxDate);\n return !utils.isAfter(lastEnabledMonth, month);\n }, [disableFuture, maxDate, month, utils, timezone]);\n}\nexport function usePreviousMonthDisabled(month, {\n disablePast,\n minDate,\n timezone\n}) {\n const utils = useUtils();\n return React.useMemo(() => {\n const now = utils.date(undefined, timezone);\n const firstEnabledMonth = utils.startOfMonth(disablePast && utils.isAfter(now, minDate) ? now : minDate);\n return !utils.isBefore(firstEnabledMonth, month);\n }, [disablePast, minDate, month, utils, timezone]);\n}\nexport function useMeridiemMode(date, ampm, onChange, selectionState) {\n const utils = useUtils();\n const meridiemMode = getMeridiem(date, utils);\n const handleMeridiemChange = React.useCallback(mode => {\n const timeWithMeridiem = date == null ? null : convertToMeridiem(date, mode, Boolean(ampm), utils);\n onChange(timeWithMeridiem, selectionState ?? 'partial');\n }, [ampm, date, onChange, selectionState, utils]);\n return {\n meridiemMode,\n handleMeridiemChange\n };\n}","import { styled } from '@mui/material/styles';\nimport { DIALOG_WIDTH, VIEW_HEIGHT } from '../../constants/dimensions';\nexport const PickerViewRoot = styled('div')({\n overflow: 'hidden',\n width: DIALOG_WIDTH,\n maxHeight: VIEW_HEIGHT,\n display: 'flex',\n flexDirection: 'column',\n margin: '0 auto'\n});","import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nexport const getDateCalendarUtilityClass = slot => generateUtilityClass('MuiDateCalendar', slot);\nexport const dateCalendarClasses = generateUtilityClasses('MuiDateCalendar', ['root', 'viewTransitionContainer']);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"autoFocus\", \"onViewChange\", \"value\", \"defaultValue\", \"referenceDate\", \"disableFuture\", \"disablePast\", \"onChange\", \"onYearChange\", \"onMonthChange\", \"reduceAnimations\", \"shouldDisableDate\", \"shouldDisableMonth\", \"shouldDisableYear\", \"view\", \"views\", \"openTo\", \"className\", \"disabled\", \"readOnly\", \"minDate\", \"maxDate\", \"disableHighlightToday\", \"focusedView\", \"onFocusedViewChange\", \"showDaysOutsideCurrentMonth\", \"fixedWeekNumber\", \"dayOfWeekFormatter\", \"slots\", \"slotProps\", \"loading\", \"renderLoading\", \"displayWeekNumber\", \"yearsPerRow\", \"monthsPerRow\", \"timezone\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { useSlotProps } from '@mui/base/utils';\nimport { styled, useThemeProps } from '@mui/material/styles';\nimport { unstable_composeClasses as composeClasses, unstable_useId as useId, unstable_useEventCallback as useEventCallback } from '@mui/utils';\nimport { useCalendarState } from './useCalendarState';\nimport { useDefaultDates, useUtils } from '../internals/hooks/useUtils';\nimport { PickersFadeTransitionGroup } from './PickersFadeTransitionGroup';\nimport { DayCalendar } from './DayCalendar';\nimport { MonthCalendar } from '../MonthCalendar';\nimport { YearCalendar } from '../YearCalendar';\nimport { useViews } from '../internals/hooks/useViews';\nimport { PickersCalendarHeader } from '../PickersCalendarHeader';\nimport { findClosestEnabledDate, applyDefaultDate, mergeDateAndTime } from '../internals/utils/date-utils';\nimport { PickerViewRoot } from '../internals/components/PickerViewRoot';\nimport { useDefaultReduceAnimations } from '../internals/hooks/useDefaultReduceAnimations';\nimport { getDateCalendarUtilityClass } from './dateCalendarClasses';\nimport { useControlledValueWithTimezone } from '../internals/hooks/useValueWithTimezone';\nimport { singleItemValueManager } from '../internals/utils/valueManagers';\nimport { VIEW_HEIGHT } from '../internals/constants/dimensions';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root'],\n viewTransitionContainer: ['viewTransitionContainer']\n };\n return composeClasses(slots, getDateCalendarUtilityClass, classes);\n};\nfunction useDateCalendarDefaultizedProps(props, name) {\n const utils = useUtils();\n const defaultDates = useDefaultDates();\n const defaultReduceAnimations = useDefaultReduceAnimations();\n const themeProps = useThemeProps({\n props,\n name\n });\n return _extends({}, themeProps, {\n loading: themeProps.loading ?? false,\n disablePast: themeProps.disablePast ?? false,\n disableFuture: themeProps.disableFuture ?? false,\n openTo: themeProps.openTo ?? 'day',\n views: themeProps.views ?? ['year', 'day'],\n reduceAnimations: themeProps.reduceAnimations ?? defaultReduceAnimations,\n renderLoading: themeProps.renderLoading ?? (() => /*#__PURE__*/_jsx(\"span\", {\n children: \"...\"\n })),\n minDate: applyDefaultDate(utils, themeProps.minDate, defaultDates.minDate),\n maxDate: applyDefaultDate(utils, themeProps.maxDate, defaultDates.maxDate)\n });\n}\nconst DateCalendarRoot = styled(PickerViewRoot, {\n name: 'MuiDateCalendar',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({\n display: 'flex',\n flexDirection: 'column',\n height: VIEW_HEIGHT\n});\nconst DateCalendarViewTransitionContainer = styled(PickersFadeTransitionGroup, {\n name: 'MuiDateCalendar',\n slot: 'ViewTransitionContainer',\n overridesResolver: (props, styles) => styles.viewTransitionContainer\n})({});\n/**\n * Demos:\n *\n * - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)\n * - [DateCalendar](https://mui.com/x/react-date-pickers/date-calendar/)\n * - [Validation](https://mui.com/x/react-date-pickers/validation/)\n *\n * API:\n *\n * - [DateCalendar API](https://mui.com/x/api/date-pickers/date-calendar/)\n */\nexport const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(inProps, ref) {\n const utils = useUtils();\n const id = useId();\n const props = useDateCalendarDefaultizedProps(inProps, 'MuiDateCalendar');\n const {\n autoFocus,\n onViewChange,\n value: valueProp,\n defaultValue,\n referenceDate: referenceDateProp,\n disableFuture,\n disablePast,\n onChange,\n onYearChange,\n onMonthChange,\n reduceAnimations,\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n view: inView,\n views,\n openTo,\n className,\n disabled,\n readOnly,\n minDate,\n maxDate,\n disableHighlightToday,\n focusedView: inFocusedView,\n onFocusedViewChange,\n showDaysOutsideCurrentMonth,\n fixedWeekNumber,\n dayOfWeekFormatter,\n slots,\n slotProps,\n loading,\n renderLoading,\n displayWeekNumber,\n yearsPerRow,\n monthsPerRow,\n timezone: timezoneProp\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n value,\n handleValueChange,\n timezone\n } = useControlledValueWithTimezone({\n name: 'DateCalendar',\n timezone: timezoneProp,\n value: valueProp,\n defaultValue,\n onChange,\n valueManager: singleItemValueManager\n });\n const {\n view,\n setView,\n focusedView,\n setFocusedView,\n goToNextView,\n setValueAndGoToNextView\n } = useViews({\n view: inView,\n views,\n openTo,\n onChange: handleValueChange,\n onViewChange,\n autoFocus,\n focusedView: inFocusedView,\n onFocusedViewChange\n });\n const {\n referenceDate,\n calendarState,\n changeFocusedDay,\n changeMonth,\n handleChangeMonth,\n isDateDisabled,\n onMonthSwitchingAnimationEnd\n } = useCalendarState({\n value,\n referenceDate: referenceDateProp,\n reduceAnimations,\n onMonthChange,\n minDate,\n maxDate,\n shouldDisableDate,\n disablePast,\n disableFuture,\n timezone\n });\n\n // When disabled, limit the view to the selected date\n const minDateWithDisabled = disabled && value || minDate;\n const maxDateWithDisabled = disabled && value || maxDate;\n const gridLabelId = `${id}-grid-label`;\n const hasFocus = focusedView !== null;\n const CalendarHeader = slots?.calendarHeader ?? PickersCalendarHeader;\n const calendarHeaderProps = useSlotProps({\n elementType: CalendarHeader,\n externalSlotProps: slotProps?.calendarHeader,\n additionalProps: {\n views,\n view,\n currentMonth: calendarState.currentMonth,\n onViewChange: setView,\n onMonthChange: (newMonth, direction) => handleChangeMonth({\n newMonth,\n direction\n }),\n minDate: minDateWithDisabled,\n maxDate: maxDateWithDisabled,\n disabled,\n disablePast,\n disableFuture,\n reduceAnimations,\n timezone,\n labelId: gridLabelId,\n slots,\n slotProps\n },\n ownerState: props\n });\n const handleDateMonthChange = useEventCallback(newDate => {\n const startOfMonth = utils.startOfMonth(newDate);\n const endOfMonth = utils.endOfMonth(newDate);\n const closestEnabledDate = isDateDisabled(newDate) ? findClosestEnabledDate({\n utils,\n date: newDate,\n minDate: utils.isBefore(minDate, startOfMonth) ? startOfMonth : minDate,\n maxDate: utils.isAfter(maxDate, endOfMonth) ? endOfMonth : maxDate,\n disablePast,\n disableFuture,\n isDateDisabled,\n timezone\n }) : newDate;\n if (closestEnabledDate) {\n setValueAndGoToNextView(closestEnabledDate, 'finish');\n onMonthChange?.(startOfMonth);\n } else {\n goToNextView();\n changeMonth(startOfMonth);\n }\n changeFocusedDay(closestEnabledDate, true);\n });\n const handleDateYearChange = useEventCallback(newDate => {\n const startOfYear = utils.startOfYear(newDate);\n const endOfYear = utils.endOfYear(newDate);\n const closestEnabledDate = isDateDisabled(newDate) ? findClosestEnabledDate({\n utils,\n date: newDate,\n minDate: utils.isBefore(minDate, startOfYear) ? startOfYear : minDate,\n maxDate: utils.isAfter(maxDate, endOfYear) ? endOfYear : maxDate,\n disablePast,\n disableFuture,\n isDateDisabled,\n timezone\n }) : newDate;\n if (closestEnabledDate) {\n setValueAndGoToNextView(closestEnabledDate, 'finish');\n onYearChange?.(closestEnabledDate);\n } else {\n goToNextView();\n changeMonth(startOfYear);\n }\n changeFocusedDay(closestEnabledDate, true);\n });\n const handleSelectedDayChange = useEventCallback(day => {\n if (day) {\n // If there is a date already selected, then we want to keep its time\n return handleValueChange(mergeDateAndTime(utils, day, value ?? referenceDate), 'finish', view);\n }\n return handleValueChange(day, 'finish', view);\n });\n React.useEffect(() => {\n if (value != null && utils.isValid(value)) {\n changeMonth(value);\n }\n }, [value]); // eslint-disable-line\n\n const ownerState = props;\n const classes = useUtilityClasses(ownerState);\n const baseDateValidationProps = {\n disablePast,\n disableFuture,\n maxDate,\n minDate\n };\n const commonViewProps = {\n disableHighlightToday,\n readOnly,\n disabled,\n timezone,\n gridLabelId\n };\n const prevOpenViewRef = React.useRef(view);\n React.useEffect(() => {\n // If the view change and the focus was on the previous view\n // Then we update the focus.\n if (prevOpenViewRef.current === view) {\n return;\n }\n if (focusedView === prevOpenViewRef.current) {\n setFocusedView(view, true);\n }\n prevOpenViewRef.current = view;\n }, [focusedView, setFocusedView, view]);\n const selectedDays = React.useMemo(() => [value], [value]);\n return /*#__PURE__*/_jsxs(DateCalendarRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className),\n ownerState: ownerState\n }, other, {\n children: [/*#__PURE__*/_jsx(CalendarHeader, _extends({}, calendarHeaderProps)), /*#__PURE__*/_jsx(DateCalendarViewTransitionContainer, {\n reduceAnimations: reduceAnimations,\n className: classes.viewTransitionContainer,\n transKey: view,\n ownerState: ownerState,\n children: /*#__PURE__*/_jsxs(\"div\", {\n children: [view === 'year' && /*#__PURE__*/_jsx(YearCalendar, _extends({}, baseDateValidationProps, commonViewProps, {\n value: value,\n onChange: handleDateYearChange,\n shouldDisableYear: shouldDisableYear,\n hasFocus: hasFocus,\n onFocusedViewChange: isViewFocused => setFocusedView('year', isViewFocused),\n yearsPerRow: yearsPerRow,\n referenceDate: referenceDate\n })), view === 'month' && /*#__PURE__*/_jsx(MonthCalendar, _extends({}, baseDateValidationProps, commonViewProps, {\n hasFocus: hasFocus,\n className: className,\n value: value,\n onChange: handleDateMonthChange,\n shouldDisableMonth: shouldDisableMonth,\n onFocusedViewChange: isViewFocused => setFocusedView('month', isViewFocused),\n monthsPerRow: monthsPerRow,\n referenceDate: referenceDate\n })), view === 'day' && /*#__PURE__*/_jsx(DayCalendar, _extends({}, calendarState, baseDateValidationProps, commonViewProps, {\n onMonthSwitchingAnimationEnd: onMonthSwitchingAnimationEnd,\n onFocusedDayChange: changeFocusedDay,\n reduceAnimations: reduceAnimations,\n selectedDays: selectedDays,\n onSelectedDaysChange: handleSelectedDayChange,\n shouldDisableDate: shouldDisableDate,\n shouldDisableMonth: shouldDisableMonth,\n shouldDisableYear: shouldDisableYear,\n hasFocus: hasFocus,\n onFocusedViewChange: isViewFocused => setFocusedView('day', isViewFocused),\n showDaysOutsideCurrentMonth: showDaysOutsideCurrentMonth,\n fixedWeekNumber: fixedWeekNumber,\n dayOfWeekFormatter: dayOfWeekFormatter,\n displayWeekNumber: displayWeekNumber,\n slots: slots,\n slotProps: slotProps,\n loading: loading,\n renderLoading: renderLoading\n }))]\n })\n })]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? DateCalendar.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * If `true`, the main element is focused during the first mount.\n * This main element is:\n * - the element chosen by the visible view if any (i.e: the selected day on the `day` view).\n * - the `input` element if there is a field rendered.\n */\n autoFocus: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n className: PropTypes.string,\n /**\n * Formats the day of week displayed in the calendar header.\n * @param {TDate} date The date of the day of week provided by the adapter.\n * @returns {string} The name to display.\n * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()\n */\n dayOfWeekFormatter: PropTypes.func,\n /**\n * The default selected value.\n * Used when the component is not controlled.\n */\n defaultValue: PropTypes.object,\n /**\n * If `true`, the picker and text field are disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, disable values after the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disableFuture: PropTypes.bool,\n /**\n * If `true`, today's date is rendering without highlighting with circle.\n * @default false\n */\n disableHighlightToday: PropTypes.bool,\n /**\n * If `true`, disable values before the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disablePast: PropTypes.bool,\n /**\n * If `true`, the week number will be display in the calendar.\n */\n displayWeekNumber: PropTypes.bool,\n /**\n * The day view will show as many weeks as needed after the end of the current month to match this value.\n * Put it to 6 to have a fixed number of weeks in Gregorian calendars\n */\n fixedWeekNumber: PropTypes.number,\n /**\n * Controlled focused view.\n */\n focusedView: PropTypes.oneOf(['day', 'month', 'year']),\n /**\n * If `true`, calls `renderLoading` instead of rendering the day calendar.\n * Can be used to preload information and show it in calendar.\n * @default false\n */\n loading: PropTypes.bool,\n /**\n * Maximal selectable date.\n */\n maxDate: PropTypes.object,\n /**\n * Minimal selectable date.\n */\n minDate: PropTypes.object,\n /**\n * Months rendered per row.\n * @default 3\n */\n monthsPerRow: PropTypes.oneOf([3, 4]),\n /**\n * Callback fired when the value changes.\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @template TView The view type. Will be one of date or time views.\n * @param {TValue} value The new value.\n * @param {PickerSelectionState | undefined} selectionState Indicates if the date selection is complete.\n * @param {TView | undefined} selectedView Indicates the view in which the selection has been made.\n */\n onChange: PropTypes.func,\n /**\n * Callback fired on focused view change.\n * @template TView\n * @param {TView} view The new view to focus or not.\n * @param {boolean} hasFocus `true` if the view should be focused.\n */\n onFocusedViewChange: PropTypes.func,\n /**\n * Callback fired on month change.\n * @template TDate\n * @param {TDate} month The new month.\n */\n onMonthChange: PropTypes.func,\n /**\n * Callback fired on view change.\n * @template TView\n * @param {TView} view The new view.\n */\n onViewChange: PropTypes.func,\n /**\n * Callback fired on year change.\n * @template TDate\n * @param {TDate} year The new year.\n */\n onYearChange: PropTypes.func,\n /**\n * The default visible view.\n * Used when the component view is not controlled.\n * Must be a valid option from `views` list.\n */\n openTo: PropTypes.oneOf(['day', 'month', 'year']),\n /**\n * Make picker read only.\n * @default false\n */\n readOnly: PropTypes.bool,\n /**\n * If `true`, disable heavy animations.\n * @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13\n */\n reduceAnimations: PropTypes.bool,\n /**\n * The date used to generate the new value when both `value` and `defaultValue` are empty.\n * @default The closest valid date using the validation props, except callbacks such as `shouldDisableDate`.\n */\n referenceDate: PropTypes.object,\n /**\n * Component displaying when passed `loading` true.\n * @returns {React.ReactNode} The node to render when loading.\n * @default () => ...\n */\n renderLoading: PropTypes.func,\n /**\n * Disable specific date.\n *\n * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.\n *\n * @template TDate\n * @param {TDate} day The date to test.\n * @returns {boolean} If `true` the date will be disabled.\n */\n shouldDisableDate: PropTypes.func,\n /**\n * Disable specific month.\n * @template TDate\n * @param {TDate} month The month to test.\n * @returns {boolean} If `true`, the month will be disabled.\n */\n shouldDisableMonth: PropTypes.func,\n /**\n * Disable specific year.\n * @template TDate\n * @param {TDate} year The year to test.\n * @returns {boolean} If `true`, the year will be disabled.\n */\n shouldDisableYear: PropTypes.func,\n /**\n * If `true`, days outside the current month are rendered:\n *\n * - if `fixedWeekNumber` is defined, renders days to have the weeks requested.\n *\n * - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.\n *\n * - ignored if `calendars` equals more than `1` on range pickers.\n * @default false\n */\n showDaysOutsideCurrentMonth: PropTypes.bool,\n /**\n * The props used for each component slot.\n * @default {}\n */\n slotProps: PropTypes.object,\n /**\n * Overridable component slots.\n * @default {}\n */\n slots: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Choose which timezone to use for the value.\n * Example: \"default\", \"system\", \"UTC\", \"America/New_York\".\n * If you pass values from other timezones to some props, they will be converted to this timezone before being used.\n * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.\n * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.\n */\n timezone: PropTypes.string,\n /**\n * The selected value.\n * Used when the component is controlled.\n */\n value: PropTypes.object,\n /**\n * The visible view.\n * Used when the component view is controlled.\n * Must be a valid option from `views` list.\n */\n view: PropTypes.oneOf(['day', 'month', 'year']),\n /**\n * Available views.\n */\n views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired),\n /**\n * Years rendered per row.\n * @default 3\n */\n yearsPerRow: PropTypes.oneOf([3, 4])\n} : void 0;","import * as React from 'react';\nimport { DateCalendar } from '../DateCalendar';\nimport { isDatePickerView } from '../internals/utils/date-utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const renderDateViewCalendar = ({\n view,\n onViewChange,\n views,\n focusedView,\n onFocusedViewChange,\n value,\n defaultValue,\n referenceDate,\n onChange,\n className,\n classes,\n disableFuture,\n disablePast,\n minDate,\n maxDate,\n shouldDisableDate,\n shouldDisableMonth,\n shouldDisableYear,\n reduceAnimations,\n onMonthChange,\n monthsPerRow,\n onYearChange,\n yearsPerRow,\n slots,\n slotProps,\n loading,\n renderLoading,\n disableHighlightToday,\n readOnly,\n disabled,\n showDaysOutsideCurrentMonth,\n dayOfWeekFormatter,\n sx,\n autoFocus,\n fixedWeekNumber,\n displayWeekNumber,\n timezone\n}) => /*#__PURE__*/_jsx(DateCalendar, {\n view: view,\n onViewChange: onViewChange,\n views: views.filter(isDatePickerView),\n focusedView: focusedView && isDatePickerView(focusedView) ? focusedView : null,\n onFocusedViewChange: onFocusedViewChange,\n value: value,\n defaultValue: defaultValue,\n referenceDate: referenceDate,\n onChange: onChange,\n className: className,\n classes: classes,\n disableFuture: disableFuture,\n disablePast: disablePast,\n minDate: minDate,\n maxDate: maxDate,\n shouldDisableDate: shouldDisableDate,\n shouldDisableMonth: shouldDisableMonth,\n shouldDisableYear: shouldDisableYear,\n reduceAnimations: reduceAnimations,\n onMonthChange: onMonthChange,\n monthsPerRow: monthsPerRow,\n onYearChange: onYearChange,\n yearsPerRow: yearsPerRow,\n slots: slots,\n slotProps: slotProps,\n loading: loading,\n renderLoading: renderLoading,\n disableHighlightToday: disableHighlightToday,\n readOnly: readOnly,\n disabled: disabled,\n showDaysOutsideCurrentMonth: showDaysOutsideCurrentMonth,\n dayOfWeekFormatter: dayOfWeekFormatter,\n sx: sx,\n autoFocus: autoFocus,\n fixedWeekNumber: fixedWeekNumber,\n displayWeekNumber: displayWeekNumber,\n timezone: timezone\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { resolveComponentProps } from '@mui/base/utils';\nimport { refType } from '@mui/utils';\nimport { singleItemValueManager } from '../internals/utils/valueManagers';\nimport { useDatePickerDefaultizedProps } from '../DatePicker/shared';\nimport { useLocaleText, useUtils } from '../internals/hooks/useUtils';\nimport { validateDate } from '../internals/utils/validation/validateDate';\nimport { useDesktopPicker } from '../internals/hooks/useDesktopPicker';\nimport { CalendarIcon } from '../icons';\nimport { DateField } from '../DateField';\nimport { extractValidationProps } from '../internals/utils/validation/extractValidationProps';\nimport { renderDateViewCalendar } from '../dateViewRenderers';\nimport { resolveDateFormat } from '../internals/utils/date-utils';\n/**\n * Demos:\n *\n * - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)\n * - [Validation](https://mui.com/x/react-date-pickers/validation/)\n *\n * API:\n *\n * - [DesktopDatePicker API](https://mui.com/x/api/date-pickers/desktop-date-picker/)\n */\nconst DesktopDatePicker = /*#__PURE__*/React.forwardRef(function DesktopDatePicker(inProps, ref) {\n const localeText = useLocaleText();\n const utils = useUtils();\n\n // Props with the default values common to all date pickers\n const defaultizedProps = useDatePickerDefaultizedProps(inProps, 'MuiDesktopDatePicker');\n const viewRenderers = _extends({\n day: renderDateViewCalendar,\n month: renderDateViewCalendar,\n year: renderDateViewCalendar\n }, defaultizedProps.viewRenderers);\n\n // Props with the default values specific to the desktop variant\n const props = _extends({}, defaultizedProps, {\n viewRenderers,\n format: resolveDateFormat(utils, defaultizedProps, false),\n yearsPerRow: defaultizedProps.yearsPerRow ?? 4,\n slots: _extends({\n openPickerIcon: CalendarIcon,\n field: DateField\n }, defaultizedProps.slots),\n slotProps: _extends({}, defaultizedProps.slotProps, {\n field: ownerState => _extends({}, resolveComponentProps(defaultizedProps.slotProps?.field, ownerState), extractValidationProps(defaultizedProps), {\n ref\n }),\n toolbar: _extends({\n hidden: true\n }, defaultizedProps.slotProps?.toolbar)\n })\n });\n const {\n renderPicker\n } = useDesktopPicker({\n props,\n valueManager: singleItemValueManager,\n valueType: 'date',\n getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? localeText.openDatePickerDialogue,\n validator: validateDate\n });\n return renderPicker();\n});\nDesktopDatePicker.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * If `true`, the main element is focused during the first mount.\n * This main element is:\n * - the element chosen by the visible view if any (i.e: the selected day on the `day` view).\n * - the `input` element if there is a field rendered.\n */\n autoFocus: PropTypes.bool,\n className: PropTypes.string,\n /**\n * If `true`, the popover or modal will close after submitting the full date.\n * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).\n */\n closeOnSelect: PropTypes.bool,\n /**\n * Formats the day of week displayed in the calendar header.\n * @param {TDate} date The date of the day of week provided by the adapter.\n * @returns {string} The name to display.\n * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()\n */\n dayOfWeekFormatter: PropTypes.func,\n /**\n * The default value.\n * Used when the component is not controlled.\n */\n defaultValue: PropTypes.object,\n /**\n * If `true`, the picker and text field are disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, disable values after the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disableFuture: PropTypes.bool,\n /**\n * If `true`, today's date is rendering without highlighting with circle.\n * @default false\n */\n disableHighlightToday: PropTypes.bool,\n /**\n * If `true`, the open picker button will not be rendered (renders only the field).\n * @default false\n */\n disableOpenPicker: PropTypes.bool,\n /**\n * If `true`, disable values before the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disablePast: PropTypes.bool,\n /**\n * If `true`, the week number will be display in the calendar.\n */\n displayWeekNumber: PropTypes.bool,\n /**\n * @default false\n */\n enableAccessibleFieldDOMStructure: PropTypes.any,\n /**\n * The day view will show as many weeks as needed after the end of the current month to match this value.\n * Put it to 6 to have a fixed number of weeks in Gregorian calendars\n */\n fixedWeekNumber: PropTypes.number,\n /**\n * Format of the date when rendered in the input(s).\n * Defaults to localized format based on the used `views`.\n */\n format: PropTypes.string,\n /**\n * Density of the format when rendered in the input.\n * Setting `formatDensity` to `\"spacious\"` will add a space before and after each `/`, `-` and `.` character.\n * @default \"dense\"\n */\n formatDensity: PropTypes.oneOf(['dense', 'spacious']),\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n /**\n * The label content.\n */\n label: PropTypes.node,\n /**\n * If `true`, calls `renderLoading` instead of rendering the day calendar.\n * Can be used to preload information and show it in calendar.\n * @default false\n */\n loading: PropTypes.bool,\n /**\n * Locale for components texts.\n * Allows overriding texts coming from `LocalizationProvider` and `theme`.\n */\n localeText: PropTypes.object,\n /**\n * Maximal selectable date.\n */\n maxDate: PropTypes.object,\n /**\n * Minimal selectable date.\n */\n minDate: PropTypes.object,\n /**\n * Months rendered per row.\n * @default 3\n */\n monthsPerRow: PropTypes.oneOf([3, 4]),\n /**\n * Name attribute used by the `input` element in the Field.\n */\n name: PropTypes.string,\n /**\n * Callback fired when the value is accepted.\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @param {TValue} value The value that was just accepted.\n */\n onAccept: PropTypes.func,\n /**\n * Callback fired when the value changes.\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.\n * @param {TValue} value The new value.\n * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value.\n */\n onChange: PropTypes.func,\n /**\n * Callback fired when the popup requests to be closed.\n * Use in controlled mode (see `open`).\n */\n onClose: PropTypes.func,\n /**\n * Callback fired when the error associated to the current value changes.\n * If the error has a non-null value, then the `TextField` will be rendered in `error` state.\n *\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.\n * @param {TError} error The new error describing why the current value is not valid.\n * @param {TValue} value The value associated to the error.\n */\n onError: PropTypes.func,\n /**\n * Callback fired on month change.\n * @template TDate\n * @param {TDate} month The new month.\n */\n onMonthChange: PropTypes.func,\n /**\n * Callback fired when the popup requests to be opened.\n * Use in controlled mode (see `open`).\n */\n onOpen: PropTypes.func,\n /**\n * Callback fired when the selected sections change.\n * @param {FieldSelectedSections} newValue The new selected sections.\n */\n onSelectedSectionsChange: PropTypes.func,\n /**\n * Callback fired on view change.\n * @template TView\n * @param {TView} view The new view.\n */\n onViewChange: PropTypes.func,\n /**\n * Callback fired on year change.\n * @template TDate\n * @param {TDate} year The new year.\n */\n onYearChange: PropTypes.func,\n /**\n * Control the popup or dialog open state.\n * @default false\n */\n open: PropTypes.bool,\n /**\n * The default visible view.\n * Used when the component view is not controlled.\n * Must be a valid option from `views` list.\n */\n openTo: PropTypes.oneOf(['day', 'month', 'year']),\n /**\n * Force rendering in particular orientation.\n */\n orientation: PropTypes.oneOf(['landscape', 'portrait']),\n readOnly: PropTypes.bool,\n /**\n * If `true`, disable heavy animations.\n * @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13\n */\n reduceAnimations: PropTypes.bool,\n /**\n * The date used to generate the new value when both `value` and `defaultValue` are empty.\n * @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.\n */\n referenceDate: PropTypes.object,\n /**\n * Component displaying when passed `loading` true.\n * @returns {React.ReactNode} The node to render when loading.\n * @default () => ...\n */\n renderLoading: PropTypes.func,\n /**\n * The currently selected sections.\n * This prop accepts four formats:\n * 1. If a number is provided, the section at this index will be selected.\n * 2. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.\n * 3. If `\"all\"` is provided, all the sections will be selected.\n * 4. If `null` is provided, no section will be selected.\n * If not provided, the selected sections will be handled internally.\n */\n selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),\n /**\n * Disable specific date.\n *\n * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.\n *\n * @template TDate\n * @param {TDate} day The date to test.\n * @returns {boolean} If `true` the date will be disabled.\n */\n shouldDisableDate: PropTypes.func,\n /**\n * Disable specific month.\n * @template TDate\n * @param {TDate} month The month to test.\n * @returns {boolean} If `true`, the month will be disabled.\n */\n shouldDisableMonth: PropTypes.func,\n /**\n * Disable specific year.\n * @template TDate\n * @param {TDate} year The year to test.\n * @returns {boolean} If `true`, the year will be disabled.\n */\n shouldDisableYear: PropTypes.func,\n /**\n * If `true`, days outside the current month are rendered:\n *\n * - if `fixedWeekNumber` is defined, renders days to have the weeks requested.\n *\n * - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.\n *\n * - ignored if `calendars` equals more than `1` on range pickers.\n * @default false\n */\n showDaysOutsideCurrentMonth: PropTypes.bool,\n /**\n * The props used for each component slot.\n * @default {}\n */\n slotProps: PropTypes.object,\n /**\n * Overridable component slots.\n * @default {}\n */\n slots: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Choose which timezone to use for the value.\n * Example: \"default\", \"system\", \"UTC\", \"America/New_York\".\n * If you pass values from other timezones to some props, they will be converted to this timezone before being used.\n * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.\n * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.\n */\n timezone: PropTypes.string,\n /**\n * The selected value.\n * Used when the component is controlled.\n */\n value: PropTypes.object,\n /**\n * The visible view.\n * Used when the component view is controlled.\n * Must be a valid option from `views` list.\n */\n view: PropTypes.oneOf(['day', 'month', 'year']),\n /**\n * Define custom view renderers for each section.\n * If `null`, the section will only have field editing.\n * If `undefined`, internally defined view will be used.\n */\n viewRenderers: PropTypes.shape({\n day: PropTypes.func,\n month: PropTypes.func,\n year: PropTypes.func\n }),\n /**\n * Available views.\n */\n views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired),\n /**\n * Years rendered per row.\n * @default 4\n */\n yearsPerRow: PropTypes.oneOf([3, 4])\n};\nexport { DesktopDatePicker };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport DialogContent from '@mui/material/DialogContent';\nimport Fade from '@mui/material/Fade';\nimport MuiDialog, { dialogClasses } from '@mui/material/Dialog';\nimport { styled } from '@mui/material/styles';\nimport { DIALOG_WIDTH } from '../constants/dimensions';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PickersModalDialogRoot = styled(MuiDialog)({\n [`& .${dialogClasses.container}`]: {\n outline: 0\n },\n [`& .${dialogClasses.paper}`]: {\n outline: 0,\n minWidth: DIALOG_WIDTH\n }\n});\nconst PickersModalDialogContent = styled(DialogContent)({\n '&:first-of-type': {\n padding: 0\n }\n});\nexport function PickersModalDialog(props) {\n const {\n children,\n onDismiss,\n open,\n slots,\n slotProps\n } = props;\n const Dialog = slots?.dialog ?? PickersModalDialogRoot;\n const Transition = slots?.mobileTransition ?? Fade;\n return /*#__PURE__*/_jsx(Dialog, _extends({\n open: open,\n onClose: onDismiss\n }, slotProps?.dialog, {\n TransitionComponent: Transition,\n TransitionProps: slotProps?.mobileTransition,\n PaperComponent: slots?.mobilePaper,\n PaperProps: slotProps?.mobilePaper,\n children: /*#__PURE__*/_jsx(PickersModalDialogContent, {\n children: children\n })\n }));\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"props\", \"getOpenDialogAriaText\"];\nimport * as React from 'react';\nimport { useSlotProps } from '@mui/base/utils';\nimport useForkRef from '@mui/utils/useForkRef';\nimport useId from '@mui/utils/useId';\nimport { PickersModalDialog } from '../../components/PickersModalDialog';\nimport { usePicker } from '../usePicker';\nimport { onSpaceOrEnter } from '../../utils/utils';\nimport { useUtils } from '../useUtils';\nimport { LocalizationProvider } from '../../../LocalizationProvider';\nimport { PickersLayout } from '../../../PickersLayout';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * Hook managing all the single-date mobile pickers:\n * - MobileDatePicker\n * - MobileDateTimePicker\n * - MobileTimePicker\n */\nexport const useMobilePicker = _ref => {\n let {\n props,\n getOpenDialogAriaText\n } = _ref,\n pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);\n const {\n slots,\n slotProps: innerSlotProps,\n className,\n sx,\n format,\n formatDensity,\n enableAccessibleFieldDOMStructure,\n selectedSections,\n onSelectedSectionsChange,\n timezone,\n name,\n label,\n inputRef,\n readOnly,\n disabled,\n localeText\n } = props;\n const utils = useUtils();\n const fieldRef = React.useRef(null);\n const labelId = useId();\n const isToolbarHidden = innerSlotProps?.toolbar?.hidden ?? false;\n const {\n open,\n actions,\n layoutProps,\n renderCurrentView,\n fieldProps: pickerFieldProps\n } = usePicker(_extends({}, pickerParams, {\n props,\n fieldRef,\n autoFocusView: true,\n additionalViewProps: {},\n wrapperVariant: 'mobile'\n }));\n const Field = slots.field;\n const fieldProps = useSlotProps({\n elementType: Field,\n externalSlotProps: innerSlotProps?.field,\n additionalProps: _extends({}, pickerFieldProps, isToolbarHidden && {\n id: labelId\n }, !(disabled || readOnly) && {\n onClick: actions.onOpen,\n onKeyDown: onSpaceOrEnter(actions.onOpen)\n }, {\n readOnly: readOnly ?? true,\n disabled,\n className,\n sx,\n format,\n formatDensity,\n enableAccessibleFieldDOMStructure,\n selectedSections,\n onSelectedSectionsChange,\n timezone,\n label,\n name\n }, inputRef ? {\n inputRef\n } : {}),\n ownerState: props\n });\n\n // TODO: Move to `useSlotProps` when https://github.com/mui/material-ui/pull/35088 will be merged\n fieldProps.inputProps = _extends({}, fieldProps.inputProps, {\n 'aria-label': getOpenDialogAriaText(pickerFieldProps.value, utils)\n });\n const slotsForField = _extends({\n textField: slots.textField\n }, fieldProps.slots);\n const Layout = slots.layout ?? PickersLayout;\n let labelledById = labelId;\n if (isToolbarHidden) {\n if (label) {\n labelledById = `${labelId}-label`;\n } else {\n labelledById = undefined;\n }\n }\n const slotProps = _extends({}, innerSlotProps, {\n toolbar: _extends({}, innerSlotProps?.toolbar, {\n titleId: labelId\n }),\n mobilePaper: _extends({\n 'aria-labelledby': labelledById\n }, innerSlotProps?.mobilePaper)\n });\n const handleFieldRef = useForkRef(fieldRef, fieldProps.unstableFieldRef);\n const renderPicker = () => /*#__PURE__*/_jsxs(LocalizationProvider, {\n localeText: localeText,\n children: [/*#__PURE__*/_jsx(Field, _extends({}, fieldProps, {\n slots: slotsForField,\n slotProps: slotProps,\n unstableFieldRef: handleFieldRef\n })), /*#__PURE__*/_jsx(PickersModalDialog, _extends({}, actions, {\n open: open,\n slots: slots,\n slotProps: slotProps,\n children: /*#__PURE__*/_jsx(Layout, _extends({}, layoutProps, slotProps?.layout, {\n slots: slots,\n slotProps: slotProps,\n children: renderCurrentView()\n }))\n }))]\n });\n return {\n renderPicker\n };\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { resolveComponentProps } from '@mui/base/utils';\nimport { refType } from '@mui/utils';\nimport { useMobilePicker } from '../internals/hooks/useMobilePicker';\nimport { useDatePickerDefaultizedProps } from '../DatePicker/shared';\nimport { useUtils, useLocaleText } from '../internals/hooks/useUtils';\nimport { validateDate } from '../internals/utils/validation/validateDate';\nimport { DateField } from '../DateField';\nimport { extractValidationProps } from '../internals/utils/validation/extractValidationProps';\nimport { singleItemValueManager } from '../internals/utils/valueManagers';\nimport { renderDateViewCalendar } from '../dateViewRenderers';\nimport { resolveDateFormat } from '../internals/utils/date-utils';\n/**\n * Demos:\n *\n * - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)\n * - [Validation](https://mui.com/x/react-date-pickers/validation/)\n *\n * API:\n *\n * - [MobileDatePicker API](https://mui.com/x/api/date-pickers/mobile-date-picker/)\n */\nconst MobileDatePicker = /*#__PURE__*/React.forwardRef(function MobileDatePicker(inProps, ref) {\n const localeText = useLocaleText();\n const utils = useUtils();\n\n // Props with the default values common to all date pickers\n const defaultizedProps = useDatePickerDefaultizedProps(inProps, 'MuiMobileDatePicker');\n const viewRenderers = _extends({\n day: renderDateViewCalendar,\n month: renderDateViewCalendar,\n year: renderDateViewCalendar\n }, defaultizedProps.viewRenderers);\n\n // Props with the default values specific to the mobile variant\n const props = _extends({}, defaultizedProps, {\n viewRenderers,\n format: resolveDateFormat(utils, defaultizedProps, false),\n slots: _extends({\n field: DateField\n }, defaultizedProps.slots),\n slotProps: _extends({}, defaultizedProps.slotProps, {\n field: ownerState => _extends({}, resolveComponentProps(defaultizedProps.slotProps?.field, ownerState), extractValidationProps(defaultizedProps), {\n ref\n }),\n toolbar: _extends({\n hidden: false\n }, defaultizedProps.slotProps?.toolbar)\n })\n });\n const {\n renderPicker\n } = useMobilePicker({\n props,\n valueManager: singleItemValueManager,\n valueType: 'date',\n getOpenDialogAriaText: props.localeText?.openDatePickerDialogue ?? localeText.openDatePickerDialogue,\n validator: validateDate\n });\n return renderPicker();\n});\nMobileDatePicker.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * If `true`, the main element is focused during the first mount.\n * This main element is:\n * - the element chosen by the visible view if any (i.e: the selected day on the `day` view).\n * - the `input` element if there is a field rendered.\n */\n autoFocus: PropTypes.bool,\n className: PropTypes.string,\n /**\n * If `true`, the popover or modal will close after submitting the full date.\n * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).\n */\n closeOnSelect: PropTypes.bool,\n /**\n * Formats the day of week displayed in the calendar header.\n * @param {TDate} date The date of the day of week provided by the adapter.\n * @returns {string} The name to display.\n * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()\n */\n dayOfWeekFormatter: PropTypes.func,\n /**\n * The default value.\n * Used when the component is not controlled.\n */\n defaultValue: PropTypes.object,\n /**\n * If `true`, the picker and text field are disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, disable values after the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disableFuture: PropTypes.bool,\n /**\n * If `true`, today's date is rendering without highlighting with circle.\n * @default false\n */\n disableHighlightToday: PropTypes.bool,\n /**\n * If `true`, the open picker button will not be rendered (renders only the field).\n * @default false\n */\n disableOpenPicker: PropTypes.bool,\n /**\n * If `true`, disable values before the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disablePast: PropTypes.bool,\n /**\n * If `true`, the week number will be display in the calendar.\n */\n displayWeekNumber: PropTypes.bool,\n /**\n * @default false\n */\n enableAccessibleFieldDOMStructure: PropTypes.any,\n /**\n * The day view will show as many weeks as needed after the end of the current month to match this value.\n * Put it to 6 to have a fixed number of weeks in Gregorian calendars\n */\n fixedWeekNumber: PropTypes.number,\n /**\n * Format of the date when rendered in the input(s).\n * Defaults to localized format based on the used `views`.\n */\n format: PropTypes.string,\n /**\n * Density of the format when rendered in the input.\n * Setting `formatDensity` to `\"spacious\"` will add a space before and after each `/`, `-` and `.` character.\n * @default \"dense\"\n */\n formatDensity: PropTypes.oneOf(['dense', 'spacious']),\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n /**\n * The label content.\n */\n label: PropTypes.node,\n /**\n * If `true`, calls `renderLoading` instead of rendering the day calendar.\n * Can be used to preload information and show it in calendar.\n * @default false\n */\n loading: PropTypes.bool,\n /**\n * Locale for components texts.\n * Allows overriding texts coming from `LocalizationProvider` and `theme`.\n */\n localeText: PropTypes.object,\n /**\n * Maximal selectable date.\n */\n maxDate: PropTypes.object,\n /**\n * Minimal selectable date.\n */\n minDate: PropTypes.object,\n /**\n * Months rendered per row.\n * @default 3\n */\n monthsPerRow: PropTypes.oneOf([3, 4]),\n /**\n * Name attribute used by the `input` element in the Field.\n */\n name: PropTypes.string,\n /**\n * Callback fired when the value is accepted.\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @param {TValue} value The value that was just accepted.\n */\n onAccept: PropTypes.func,\n /**\n * Callback fired when the value changes.\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.\n * @param {TValue} value The new value.\n * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value.\n */\n onChange: PropTypes.func,\n /**\n * Callback fired when the popup requests to be closed.\n * Use in controlled mode (see `open`).\n */\n onClose: PropTypes.func,\n /**\n * Callback fired when the error associated to the current value changes.\n * If the error has a non-null value, then the `TextField` will be rendered in `error` state.\n *\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.\n * @param {TError} error The new error describing why the current value is not valid.\n * @param {TValue} value The value associated to the error.\n */\n onError: PropTypes.func,\n /**\n * Callback fired on month change.\n * @template TDate\n * @param {TDate} month The new month.\n */\n onMonthChange: PropTypes.func,\n /**\n * Callback fired when the popup requests to be opened.\n * Use in controlled mode (see `open`).\n */\n onOpen: PropTypes.func,\n /**\n * Callback fired when the selected sections change.\n * @param {FieldSelectedSections} newValue The new selected sections.\n */\n onSelectedSectionsChange: PropTypes.func,\n /**\n * Callback fired on view change.\n * @template TView\n * @param {TView} view The new view.\n */\n onViewChange: PropTypes.func,\n /**\n * Callback fired on year change.\n * @template TDate\n * @param {TDate} year The new year.\n */\n onYearChange: PropTypes.func,\n /**\n * Control the popup or dialog open state.\n * @default false\n */\n open: PropTypes.bool,\n /**\n * The default visible view.\n * Used when the component view is not controlled.\n * Must be a valid option from `views` list.\n */\n openTo: PropTypes.oneOf(['day', 'month', 'year']),\n /**\n * Force rendering in particular orientation.\n */\n orientation: PropTypes.oneOf(['landscape', 'portrait']),\n readOnly: PropTypes.bool,\n /**\n * If `true`, disable heavy animations.\n * @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13\n */\n reduceAnimations: PropTypes.bool,\n /**\n * The date used to generate the new value when both `value` and `defaultValue` are empty.\n * @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.\n */\n referenceDate: PropTypes.object,\n /**\n * Component displaying when passed `loading` true.\n * @returns {React.ReactNode} The node to render when loading.\n * @default () => ...\n */\n renderLoading: PropTypes.func,\n /**\n * The currently selected sections.\n * This prop accepts four formats:\n * 1. If a number is provided, the section at this index will be selected.\n * 2. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.\n * 3. If `\"all\"` is provided, all the sections will be selected.\n * 4. If `null` is provided, no section will be selected.\n * If not provided, the selected sections will be handled internally.\n */\n selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),\n /**\n * Disable specific date.\n *\n * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.\n *\n * @template TDate\n * @param {TDate} day The date to test.\n * @returns {boolean} If `true` the date will be disabled.\n */\n shouldDisableDate: PropTypes.func,\n /**\n * Disable specific month.\n * @template TDate\n * @param {TDate} month The month to test.\n * @returns {boolean} If `true`, the month will be disabled.\n */\n shouldDisableMonth: PropTypes.func,\n /**\n * Disable specific year.\n * @template TDate\n * @param {TDate} year The year to test.\n * @returns {boolean} If `true`, the year will be disabled.\n */\n shouldDisableYear: PropTypes.func,\n /**\n * If `true`, days outside the current month are rendered:\n *\n * - if `fixedWeekNumber` is defined, renders days to have the weeks requested.\n *\n * - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.\n *\n * - ignored if `calendars` equals more than `1` on range pickers.\n * @default false\n */\n showDaysOutsideCurrentMonth: PropTypes.bool,\n /**\n * The props used for each component slot.\n * @default {}\n */\n slotProps: PropTypes.object,\n /**\n * Overridable component slots.\n * @default {}\n */\n slots: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Choose which timezone to use for the value.\n * Example: \"default\", \"system\", \"UTC\", \"America/New_York\".\n * If you pass values from other timezones to some props, they will be converted to this timezone before being used.\n * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.\n * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.\n */\n timezone: PropTypes.string,\n /**\n * The selected value.\n * Used when the component is controlled.\n */\n value: PropTypes.object,\n /**\n * The visible view.\n * Used when the component view is controlled.\n * Must be a valid option from `views` list.\n */\n view: PropTypes.oneOf(['day', 'month', 'year']),\n /**\n * Define custom view renderers for each section.\n * If `null`, the section will only have field editing.\n * If `undefined`, internally defined view will be used.\n */\n viewRenderers: PropTypes.shape({\n day: PropTypes.func,\n month: PropTypes.func,\n year: PropTypes.func\n }),\n /**\n * Available views.\n */\n views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired),\n /**\n * Years rendered per row.\n * @default 3\n */\n yearsPerRow: PropTypes.oneOf([3, 4])\n};\nexport { MobileDatePicker };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"desktopModeMediaQuery\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport useMediaQuery from '@mui/material/useMediaQuery';\nimport { useThemeProps } from '@mui/material/styles';\nimport { refType } from '@mui/utils';\nimport { DesktopDatePicker } from '../DesktopDatePicker';\nimport { MobileDatePicker } from '../MobileDatePicker';\nimport { DEFAULT_DESKTOP_MODE_MEDIA_QUERY } from '../internals/utils/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Demos:\n *\n * - [DatePicker](https://mui.com/x/react-date-pickers/date-picker/)\n * - [Validation](https://mui.com/x/react-date-pickers/validation/)\n *\n * API:\n *\n * - [DatePicker API](https://mui.com/x/api/date-pickers/date-picker/)\n */\nconst DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiDatePicker'\n });\n const {\n desktopModeMediaQuery = DEFAULT_DESKTOP_MODE_MEDIA_QUERY\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n // defaults to `true` in environments where `window.matchMedia` would not be available (i.e. test/jsdom)\n const isDesktop = useMediaQuery(desktopModeMediaQuery, {\n defaultMatches: true\n });\n if (isDesktop) {\n return /*#__PURE__*/_jsx(DesktopDatePicker, _extends({\n ref: ref\n }, other));\n }\n return /*#__PURE__*/_jsx(MobileDatePicker, _extends({\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? DatePicker.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * If `true`, the main element is focused during the first mount.\n * This main element is:\n * - the element chosen by the visible view if any (i.e: the selected day on the `day` view).\n * - the `input` element if there is a field rendered.\n */\n autoFocus: PropTypes.bool,\n className: PropTypes.string,\n /**\n * If `true`, the popover or modal will close after submitting the full date.\n * @default `true` for desktop, `false` for mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).\n */\n closeOnSelect: PropTypes.bool,\n /**\n * Formats the day of week displayed in the calendar header.\n * @param {TDate} date The date of the day of week provided by the adapter.\n * @returns {string} The name to display.\n * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()\n */\n dayOfWeekFormatter: PropTypes.func,\n /**\n * The default value.\n * Used when the component is not controlled.\n */\n defaultValue: PropTypes.object,\n /**\n * CSS media query when `Mobile` mode will be changed to `Desktop`.\n * @default '@media (pointer: fine)'\n * @example '@media (min-width: 720px)' or theme.breakpoints.up(\"sm\")\n */\n desktopModeMediaQuery: PropTypes.string,\n /**\n * If `true`, the picker and text field are disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, disable values after the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disableFuture: PropTypes.bool,\n /**\n * If `true`, today's date is rendering without highlighting with circle.\n * @default false\n */\n disableHighlightToday: PropTypes.bool,\n /**\n * If `true`, the open picker button will not be rendered (renders only the field).\n * @default false\n */\n disableOpenPicker: PropTypes.bool,\n /**\n * If `true`, disable values before the current date for date components, time for time components and both for date time components.\n * @default false\n */\n disablePast: PropTypes.bool,\n /**\n * If `true`, the week number will be display in the calendar.\n */\n displayWeekNumber: PropTypes.bool,\n /**\n * @default false\n */\n enableAccessibleFieldDOMStructure: PropTypes.any,\n /**\n * The day view will show as many weeks as needed after the end of the current month to match this value.\n * Put it to 6 to have a fixed number of weeks in Gregorian calendars\n */\n fixedWeekNumber: PropTypes.number,\n /**\n * Format of the date when rendered in the input(s).\n * Defaults to localized format based on the used `views`.\n */\n format: PropTypes.string,\n /**\n * Density of the format when rendered in the input.\n * Setting `formatDensity` to `\"spacious\"` will add a space before and after each `/`, `-` and `.` character.\n * @default \"dense\"\n */\n formatDensity: PropTypes.oneOf(['dense', 'spacious']),\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n /**\n * The label content.\n */\n label: PropTypes.node,\n /**\n * If `true`, calls `renderLoading` instead of rendering the day calendar.\n * Can be used to preload information and show it in calendar.\n * @default false\n */\n loading: PropTypes.bool,\n /**\n * Locale for components texts.\n * Allows overriding texts coming from `LocalizationProvider` and `theme`.\n */\n localeText: PropTypes.object,\n /**\n * Maximal selectable date.\n */\n maxDate: PropTypes.object,\n /**\n * Minimal selectable date.\n */\n minDate: PropTypes.object,\n /**\n * Months rendered per row.\n * @default 3\n */\n monthsPerRow: PropTypes.oneOf([3, 4]),\n /**\n * Name attribute used by the `input` element in the Field.\n */\n name: PropTypes.string,\n /**\n * Callback fired when the value is accepted.\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @param {TValue} value The value that was just accepted.\n */\n onAccept: PropTypes.func,\n /**\n * Callback fired when the value changes.\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.\n * @param {TValue} value The new value.\n * @param {FieldChangeHandlerContext} context The context containing the validation result of the current value.\n */\n onChange: PropTypes.func,\n /**\n * Callback fired when the popup requests to be closed.\n * Use in controlled mode (see `open`).\n */\n onClose: PropTypes.func,\n /**\n * Callback fired when the error associated to the current value changes.\n * If the error has a non-null value, then the `TextField` will be rendered in `error` state.\n *\n * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.\n * @template TError The validation error type. Will be either `string` or a `null`. Can be in `[start, end]` format in case of range value.\n * @param {TError} error The new error describing why the current value is not valid.\n * @param {TValue} value The value associated to the error.\n */\n onError: PropTypes.func,\n /**\n * Callback fired on month change.\n * @template TDate\n * @param {TDate} month The new month.\n */\n onMonthChange: PropTypes.func,\n /**\n * Callback fired when the popup requests to be opened.\n * Use in controlled mode (see `open`).\n */\n onOpen: PropTypes.func,\n /**\n * Callback fired when the selected sections change.\n * @param {FieldSelectedSections} newValue The new selected sections.\n */\n onSelectedSectionsChange: PropTypes.func,\n /**\n * Callback fired on view change.\n * @template TView\n * @param {TView} view The new view.\n */\n onViewChange: PropTypes.func,\n /**\n * Callback fired on year change.\n * @template TDate\n * @param {TDate} year The new year.\n */\n onYearChange: PropTypes.func,\n /**\n * Control the popup or dialog open state.\n * @default false\n */\n open: PropTypes.bool,\n /**\n * The default visible view.\n * Used when the component view is not controlled.\n * Must be a valid option from `views` list.\n */\n openTo: PropTypes.oneOf(['day', 'month', 'year']),\n /**\n * Force rendering in particular orientation.\n */\n orientation: PropTypes.oneOf(['landscape', 'portrait']),\n readOnly: PropTypes.bool,\n /**\n * If `true`, disable heavy animations.\n * @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13\n */\n reduceAnimations: PropTypes.bool,\n /**\n * The date used to generate the new value when both `value` and `defaultValue` are empty.\n * @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.\n */\n referenceDate: PropTypes.object,\n /**\n * Component displaying when passed `loading` true.\n * @returns {React.ReactNode} The node to render when loading.\n * @default () => ...\n */\n renderLoading: PropTypes.func,\n /**\n * The currently selected sections.\n * This prop accepts four formats:\n * 1. If a number is provided, the section at this index will be selected.\n * 2. If a string of type `FieldSectionType` is provided, the first section with that name will be selected.\n * 3. If `\"all\"` is provided, all the sections will be selected.\n * 4. If `null` is provided, no section will be selected.\n * If not provided, the selected sections will be handled internally.\n */\n selectedSections: PropTypes.oneOfType([PropTypes.oneOf(['all', 'day', 'empty', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'weekDay', 'year']), PropTypes.number]),\n /**\n * Disable specific date.\n *\n * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.\n *\n * @template TDate\n * @param {TDate} day The date to test.\n * @returns {boolean} If `true` the date will be disabled.\n */\n shouldDisableDate: PropTypes.func,\n /**\n * Disable specific month.\n * @template TDate\n * @param {TDate} month The month to test.\n * @returns {boolean} If `true`, the month will be disabled.\n */\n shouldDisableMonth: PropTypes.func,\n /**\n * Disable specific year.\n * @template TDate\n * @param {TDate} year The year to test.\n * @returns {boolean} If `true`, the year will be disabled.\n */\n shouldDisableYear: PropTypes.func,\n /**\n * If `true`, days outside the current month are rendered:\n *\n * - if `fixedWeekNumber` is defined, renders days to have the weeks requested.\n *\n * - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.\n *\n * - ignored if `calendars` equals more than `1` on range pickers.\n * @default false\n */\n showDaysOutsideCurrentMonth: PropTypes.bool,\n /**\n * The props used for each component slot.\n * @default {}\n */\n slotProps: PropTypes.object,\n /**\n * Overridable component slots.\n * @default {}\n */\n slots: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Choose which timezone to use for the value.\n * Example: \"default\", \"system\", \"UTC\", \"America/New_York\".\n * If you pass values from other timezones to some props, they will be converted to this timezone before being used.\n * @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.\n * @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.\n */\n timezone: PropTypes.string,\n /**\n * The selected value.\n * Used when the component is controlled.\n */\n value: PropTypes.object,\n /**\n * The visible view.\n * Used when the component view is controlled.\n * Must be a valid option from `views` list.\n */\n view: PropTypes.oneOf(['day', 'month', 'year']),\n /**\n * Define custom view renderers for each section.\n * If `null`, the section will only have field editing.\n * If `undefined`, internally defined view will be used.\n */\n viewRenderers: PropTypes.shape({\n day: PropTypes.func,\n month: PropTypes.func,\n year: PropTypes.func\n }),\n /**\n * Available views.\n */\n views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'month', 'year']).isRequired),\n /**\n * Years rendered per row.\n * @default 4 on desktop, 3 on mobile\n */\n yearsPerRow: PropTypes.oneOf([3, 4])\n} : void 0;\nexport { DatePicker };","import _extends from \"@babel/runtime/helpers/esm/extends\";\n/* eslint-disable class-methods-use-this */\nimport defaultMoment from 'moment';\n// From https://momentjs.com/docs/#/displaying/format/\nconst formatTokenMap = {\n // Year\n Y: 'year',\n YY: 'year',\n YYYY: {\n sectionType: 'year',\n contentType: 'digit',\n maxLength: 4\n },\n // Month\n M: {\n sectionType: 'month',\n contentType: 'digit',\n maxLength: 2\n },\n MM: 'month',\n MMM: {\n sectionType: 'month',\n contentType: 'letter'\n },\n MMMM: {\n sectionType: 'month',\n contentType: 'letter'\n },\n // Day of the month\n D: {\n sectionType: 'day',\n contentType: 'digit',\n maxLength: 2\n },\n DD: 'day',\n Do: {\n sectionType: 'day',\n contentType: 'digit-with-letter'\n },\n // Day of the week\n E: {\n sectionType: 'weekDay',\n contentType: 'digit',\n maxLength: 1\n },\n e: {\n sectionType: 'weekDay',\n contentType: 'digit',\n maxLength: 1\n },\n d: {\n sectionType: 'weekDay',\n contentType: 'digit',\n maxLength: 1\n },\n dd: {\n sectionType: 'weekDay',\n contentType: 'letter'\n },\n ddd: {\n sectionType: 'weekDay',\n contentType: 'letter'\n },\n dddd: {\n sectionType: 'weekDay',\n contentType: 'letter'\n },\n // Meridiem\n A: 'meridiem',\n a: 'meridiem',\n // Hours\n H: {\n sectionType: 'hours',\n contentType: 'digit',\n maxLength: 2\n },\n HH: 'hours',\n h: {\n sectionType: 'hours',\n contentType: 'digit',\n maxLength: 2\n },\n hh: 'hours',\n // Minutes\n m: {\n sectionType: 'minutes',\n contentType: 'digit',\n maxLength: 2\n },\n mm: 'minutes',\n // Seconds\n s: {\n sectionType: 'seconds',\n contentType: 'digit',\n maxLength: 2\n },\n ss: 'seconds'\n};\nconst defaultFormats = {\n year: 'YYYY',\n month: 'MMMM',\n monthShort: 'MMM',\n dayOfMonth: 'D',\n dayOfMonthFull: 'Do',\n weekday: 'dddd',\n weekdayShort: 'ddd',\n hours24h: 'HH',\n hours12h: 'hh',\n meridiem: 'A',\n minutes: 'mm',\n seconds: 'ss',\n fullDate: 'll',\n keyboardDate: 'L',\n shortDate: 'MMM D',\n normalDate: 'D MMMM',\n normalDateWithWeekday: 'ddd, MMM D',\n fullTime: 'LT',\n fullTime12h: 'hh:mm A',\n fullTime24h: 'HH:mm',\n keyboardDateTime: 'L LT',\n keyboardDateTime12h: 'L hh:mm A',\n keyboardDateTime24h: 'L HH:mm'\n};\nconst MISSING_TIMEZONE_PLUGIN = ['Missing timezone plugin', 'To be able to use timezones, you have to pass the default export from `moment-timezone` to the `dateLibInstance` prop of `LocalizationProvider`', 'Find more information on https://mui.com/x/react-date-pickers/timezone/#moment-and-timezone'].join('\\n');\n/**\n * Based on `@date-io/moment`\n *\n * MIT License\n *\n * Copyright (c) 2017 Dmitriy Kovalenko\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nexport class AdapterMoment {\n constructor({\n locale,\n formats,\n instance\n } = {}) {\n this.isMUIAdapter = true;\n this.isTimezoneCompatible = true;\n this.lib = 'moment';\n this.moment = void 0;\n this.locale = void 0;\n this.formats = void 0;\n this.escapedCharacters = {\n start: '[',\n end: ']'\n };\n this.formatTokenMap = formatTokenMap;\n this.setLocaleToValue = value => {\n const expectedLocale = this.getCurrentLocaleCode();\n if (expectedLocale === value.locale()) {\n return value;\n }\n return value.locale(expectedLocale);\n };\n this.hasTimezonePlugin = () => typeof this.moment.tz !== 'undefined';\n this.createSystemDate = value => {\n const parsedValue = this.moment(value).local();\n if (this.locale === undefined) {\n return parsedValue;\n }\n return parsedValue.locale(this.locale);\n };\n this.createUTCDate = value => {\n const parsedValue = this.moment.utc(value);\n if (this.locale === undefined) {\n return parsedValue;\n }\n return parsedValue.locale(this.locale);\n };\n this.createTZDate = (value, timezone) => {\n /* istanbul ignore next */\n if (!this.hasTimezonePlugin()) {\n throw new Error(MISSING_TIMEZONE_PLUGIN);\n }\n const parsedValue = timezone === 'default' ? this.moment(value) : this.moment.tz(value, timezone);\n if (this.locale === undefined) {\n return parsedValue;\n }\n return parsedValue.locale(this.locale);\n };\n this.date = (value, timezone = 'default') => {\n if (value === null) {\n return null;\n }\n if (timezone === 'UTC') {\n return this.createUTCDate(value);\n }\n if (timezone === 'system' || timezone === 'default' && !this.hasTimezonePlugin()) {\n return this.createSystemDate(value);\n }\n return this.createTZDate(value, timezone);\n };\n this.getInvalidDate = () => this.moment(new Date('Invalid Date'));\n this.getTimezone = value => {\n // @ts-ignore\n // eslint-disable-next-line no-underscore-dangle\n const zone = value._z?.name;\n const defaultZone = value.isUTC() ? 'UTC' : 'system';\n\n // @ts-ignore\n return zone ?? this.moment.defaultZone?.name ?? defaultZone;\n };\n this.setTimezone = (value, timezone) => {\n if (this.getTimezone(value) === timezone) {\n return value;\n }\n if (timezone === 'UTC') {\n return value.clone().utc();\n }\n if (timezone === 'system') {\n return value.clone().local();\n }\n if (!this.hasTimezonePlugin()) {\n /* istanbul ignore next */\n if (timezone !== 'default') {\n throw new Error(MISSING_TIMEZONE_PLUGIN);\n }\n return value;\n }\n const cleanZone = timezone === 'default' ?\n // @ts-ignore\n this.moment.defaultZone?.name ?? 'system' : timezone;\n if (cleanZone === 'system') {\n return value.clone().local();\n }\n const newValue = value.clone();\n newValue.tz(cleanZone);\n return newValue;\n };\n this.toJsDate = value => {\n return value.toDate();\n };\n this.parse = (value, format) => {\n if (value === '') {\n return null;\n }\n if (this.locale) {\n return this.moment(value, format, this.locale, true);\n }\n return this.moment(value, format, true);\n };\n this.getCurrentLocaleCode = () => {\n return this.locale || defaultMoment.locale();\n };\n this.is12HourCycleInCurrentLocale = () => {\n return /A|a/.test(defaultMoment.localeData(this.getCurrentLocaleCode()).longDateFormat('LT'));\n };\n this.expandFormat = format => {\n // @see https://github.com/moment/moment/blob/develop/src/lib/format/format.js#L6\n const localFormattingTokens = /(\\[[^[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})|./g;\n return format.match(localFormattingTokens).map(token => {\n const firstCharacter = token[0];\n if (firstCharacter === 'L' || firstCharacter === ';') {\n return defaultMoment.localeData(this.getCurrentLocaleCode()).longDateFormat(token);\n }\n return token;\n }).join('');\n };\n this.isValid = value => {\n if (value == null) {\n return false;\n }\n return value.isValid();\n };\n this.format = (value, formatKey) => {\n return this.formatByString(value, this.formats[formatKey]);\n };\n this.formatByString = (value, formatString) => {\n const clonedDate = value.clone();\n clonedDate.locale(this.getCurrentLocaleCode());\n return clonedDate.format(formatString);\n };\n this.formatNumber = numberToFormat => {\n return numberToFormat;\n };\n this.isEqual = (value, comparing) => {\n if (value === null && comparing === null) {\n return true;\n }\n if (value === null || comparing === null) {\n return false;\n }\n return value.isSame(comparing);\n };\n this.isSameYear = (value, comparing) => {\n return value.isSame(comparing, 'year');\n };\n this.isSameMonth = (value, comparing) => {\n return value.isSame(comparing, 'month');\n };\n this.isSameDay = (value, comparing) => {\n return value.isSame(comparing, 'day');\n };\n this.isSameHour = (value, comparing) => {\n return value.isSame(comparing, 'hour');\n };\n this.isAfter = (value, comparing) => {\n return value.isAfter(comparing);\n };\n this.isAfterYear = (value, comparing) => {\n return value.isAfter(comparing, 'year');\n };\n this.isAfterDay = (value, comparing) => {\n return value.isAfter(comparing, 'day');\n };\n this.isBefore = (value, comparing) => {\n return value.isBefore(comparing);\n };\n this.isBeforeYear = (value, comparing) => {\n return value.isBefore(comparing, 'year');\n };\n this.isBeforeDay = (value, comparing) => {\n return value.isBefore(comparing, 'day');\n };\n this.isWithinRange = (value, [start, end]) => {\n return value.isBetween(start, end, null, '[]');\n };\n this.startOfYear = value => {\n return value.clone().startOf('year');\n };\n this.startOfMonth = value => {\n return value.clone().startOf('month');\n };\n this.startOfWeek = value => {\n return value.clone().startOf('week');\n };\n this.startOfDay = value => {\n return value.clone().startOf('day');\n };\n this.endOfYear = value => {\n return value.clone().endOf('year');\n };\n this.endOfMonth = value => {\n return value.clone().endOf('month');\n };\n this.endOfWeek = value => {\n return value.clone().endOf('week');\n };\n this.endOfDay = value => {\n return value.clone().endOf('day');\n };\n this.addYears = (value, amount) => {\n return amount < 0 ? value.clone().subtract(Math.abs(amount), 'years') : value.clone().add(amount, 'years');\n };\n this.addMonths = (value, amount) => {\n return amount < 0 ? value.clone().subtract(Math.abs(amount), 'months') : value.clone().add(amount, 'months');\n };\n this.addWeeks = (value, amount) => {\n return amount < 0 ? value.clone().subtract(Math.abs(amount), 'weeks') : value.clone().add(amount, 'weeks');\n };\n this.addDays = (value, amount) => {\n return amount < 0 ? value.clone().subtract(Math.abs(amount), 'days') : value.clone().add(amount, 'days');\n };\n this.addHours = (value, amount) => {\n return amount < 0 ? value.clone().subtract(Math.abs(amount), 'hours') : value.clone().add(amount, 'hours');\n };\n this.addMinutes = (value, amount) => {\n return amount < 0 ? value.clone().subtract(Math.abs(amount), 'minutes') : value.clone().add(amount, 'minutes');\n };\n this.addSeconds = (value, amount) => {\n return amount < 0 ? value.clone().subtract(Math.abs(amount), 'seconds') : value.clone().add(amount, 'seconds');\n };\n this.getYear = value => {\n return value.get('year');\n };\n this.getMonth = value => {\n return value.get('month');\n };\n this.getDate = value => {\n return value.get('date');\n };\n this.getHours = value => {\n return value.get('hours');\n };\n this.getMinutes = value => {\n return value.get('minutes');\n };\n this.getSeconds = value => {\n return value.get('seconds');\n };\n this.getMilliseconds = value => {\n return value.get('milliseconds');\n };\n this.setYear = (value, year) => {\n return value.clone().year(year);\n };\n this.setMonth = (value, month) => {\n return value.clone().month(month);\n };\n this.setDate = (value, date) => {\n return value.clone().date(date);\n };\n this.setHours = (value, hours) => {\n return value.clone().hours(hours);\n };\n this.setMinutes = (value, minutes) => {\n return value.clone().minutes(minutes);\n };\n this.setSeconds = (value, seconds) => {\n return value.clone().seconds(seconds);\n };\n this.setMilliseconds = (value, milliseconds) => {\n return value.clone().milliseconds(milliseconds);\n };\n this.getDaysInMonth = value => {\n return value.daysInMonth();\n };\n this.getWeekArray = value => {\n const cleanValue = this.setLocaleToValue(value);\n const start = this.startOfWeek(this.startOfMonth(cleanValue));\n const end = this.endOfWeek(this.endOfMonth(cleanValue));\n let count = 0;\n let current = start;\n const nestedWeeks = [];\n while (current.isBefore(end)) {\n const weekNumber = Math.floor(count / 7);\n nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];\n nestedWeeks[weekNumber].push(current);\n current = this.addDays(current, 1);\n count += 1;\n }\n return nestedWeeks;\n };\n this.getWeekNumber = value => {\n return value.week();\n };\n this.getDayOfWeek = value => {\n return value.day() + 1;\n };\n this.moment = instance || defaultMoment;\n this.locale = locale;\n this.formats = _extends({}, defaultFormats, formats);\n }\n getYearRange([start, end]) {\n const startDate = this.startOfYear(start);\n const endDate = this.endOfYear(end);\n const years = [];\n let current = startDate;\n while (this.isBefore(current, endDate)) {\n years.push(current);\n current = this.addYears(current, 1);\n }\n return years;\n }\n}","import React, { useMemo } from 'react'\nimport { DatePicker as MuiDatePicker } from '@mui/x-date-pickers/DatePicker'\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'\nimport { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment'\nimport { Controller } from 'react-hook-form'\nimport useFormField from '../../hooks/useFormField'\n\nconst DatePicker = ({\n\tvariant = 'standard',\n\tlabel,\n\tcontrol,\n\trequired,\n\tname,\n\terrors,\n\tclearable = false,\n\tminDate,\n\t...rest\n}) => {\n\tconst { getError } = useFormField()\n\tconst error = getError(name, errors)\n\tconst labelTxt = useMemo(\n\t\t() => (required && label ? `${label} *` : label),\n\t\t[required, label]\n\t)\n\tconst slotProps = useMemo(\n\t\t() => ({\n\t\t\ttextField: {\n\t\t\t\tvariant,\n\t\t\t\terror: !!error,\n\t\t\t\thelperText: error ? error.message : undefined,\n\t\t\t},\n\t\t\tfield: { clearable },\n\t\t}),\n\t\t[variant, error, clearable]\n\t)\n\n\treturn (\n\t\t\n\t\t\t{control && (\n\t\t\t\t (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{!control && (\n\t\t\t\t\n\t\t\t)}\n\t\t\n\t)\n}\n\nexport default DatePicker\n","import React from 'react'\nimport clsx from 'clsx'\n\nexport type FormRowProps = {\n\tclassName?: string\n\tchildren: React.ReactNode\n}\n\nconst FormRow = ({ className, children }: FormRowProps) => {\n\treturn
    {children}
    \n}\n\nexport default FormRow\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","export const COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n ['aac', 'audio/aac'],\n ['abw', 'application/x-abiword'],\n ['arc', 'application/x-freearc'],\n ['avif', 'image/avif'],\n ['avi', 'video/x-msvideo'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bin', 'application/octet-stream'],\n ['bmp', 'image/bmp'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['cda', 'application/x-cdf'],\n ['csh', 'application/x-csh'],\n ['css', 'text/css'],\n ['csv', 'text/csv'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['epub', 'application/epub+zip'],\n ['gz', 'application/gzip'],\n ['gif', 'image/gif'],\n ['heic', 'image/heic'],\n ['heif', 'image/heif'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['ico', 'image/vnd.microsoft.icon'],\n ['ics', 'text/calendar'],\n ['jar', 'application/java-archive'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['js', 'text/javascript'],\n ['json', 'application/json'],\n ['jsonld', 'application/ld+json'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mjs', 'text/javascript'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mpeg', 'video/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['opus', 'audio/opus'],\n ['otf', 'font/otf'],\n ['png', 'image/png'],\n ['pdf', 'application/pdf'],\n ['php', 'application/x-httpd-php'],\n ['ppt', 'application/vnd.ms-powerpoint'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['rar', 'application/vnd.rar'],\n ['rtf', 'application/rtf'],\n ['sh', 'application/x-sh'],\n ['svg', 'image/svg+xml'],\n ['swf', 'application/x-shockwave-flash'],\n ['tar', 'application/x-tar'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['ts', 'video/mp2t'],\n ['ttf', 'font/ttf'],\n ['txt', 'text/plain'],\n ['vsd', 'application/vnd.visio'],\n ['wav', 'audio/wav'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['xhtml', 'application/xhtml+xml'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['zip', 'application/zip'],\n ['7z', 'application/x-7z-compressed'],\n\n // Others\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['msg', 'application/vnd.ms-outlook']\n]);\n\n\nexport function toFileWithPath(file: FileWithPath, path?: string): FileWithPath {\n const f = withMimeType(file);\n if (typeof f.path !== 'string') { // on electron, path is already set to the absolute path\n const {webkitRelativePath} = file;\n Object.defineProperty(f, 'path', {\n value: typeof path === 'string'\n ? path\n // If is set,\n // the File will have a {webkitRelativePath} property\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory\n : typeof webkitRelativePath === 'string' && webkitRelativePath.length > 0\n ? webkitRelativePath\n : file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n\n return f;\n}\n\nexport interface FileWithPath extends File {\n readonly path?: string;\n}\n\nfunction withMimeType(file: FileWithPath) {\n const {name} = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const ext = name.split('.')\n .pop()!.toLowerCase();\n const type = COMMON_MIME_TYPES.get(ext);\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n}\n","import {FileWithPath, toFileWithPath} from './file';\n\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n\n/**\n * Convert a DragEvent's DataTrasfer object to a list of File objects\n * NOTE: If some of the items are folders,\n * everything will be flattened and placed in the same list but the paths will be kept as a {path} property.\n *\n * EXPERIMENTAL: A list of https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle objects can also be passed as an arg\n * and a list of File objects will be returned.\n *\n * @param evt\n */\nexport async function fromEvent(evt: Event | any): Promise<(FileWithPath | DataTransferItem)[]> {\n if (isObject(evt) && isDataTransfer(evt.dataTransfer)) {\n return getDataTransferFiles(evt.dataTransfer, evt.type);\n } else if (isChangeEvt(evt)) {\n return getInputFiles(evt);\n } else if (Array.isArray(evt) && evt.every(item => 'getFile' in item && typeof item.getFile === 'function')) {\n return getFsHandleFiles(evt)\n }\n return [];\n}\n\nfunction isDataTransfer(value: any): value is DataTransfer {\n return isObject(value);\n}\n\nfunction isChangeEvt(value: any): value is Event {\n return isObject(value) && isObject(value.target);\n}\n\nfunction isObject(v: any): v is T {\n return typeof v === 'object' && v !== null\n}\n\nfunction getInputFiles(evt: Event) {\n return fromList((evt.target as HTMLInputElement).files).map(file => toFileWithPath(file));\n}\n\n// Ee expect each handle to be https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle\nasync function getFsHandleFiles(handles: any[]) {\n const files = await Promise.all(handles.map(h => h.getFile()));\n return files.map(file => toFileWithPath(file));\n}\n\n\nasync function getDataTransferFiles(dt: DataTransfer, type: string) {\n // IE11 does not support dataTransfer.items\n // See https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/items#Browser_compatibility\n if (dt.items) {\n const items = fromList(dt.items)\n .filter(item => item.kind === 'file');\n // According to https://html.spec.whatwg.org/multipage/dnd.html#dndevents,\n // only 'dragstart' and 'drop' has access to the data (source node)\n if (type !== 'drop') {\n return items;\n }\n const files = await Promise.all(items.map(toFilePromises));\n return noIgnoredFiles(flatten(files));\n }\n\n return noIgnoredFiles(fromList(dt.files)\n .map(file => toFileWithPath(file)));\n}\n\nfunction noIgnoredFiles(files: FileWithPath[]) {\n return files.filter(file => FILES_TO_IGNORE.indexOf(file.name) === -1);\n}\n\n// IE11 does not support Array.from()\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Browser_compatibility\n// https://developer.mozilla.org/en-US/docs/Web/API/FileList\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList\nfunction fromList(items: DataTransferItemList | FileList | null): T[] {\n if (items === null) {\n return [];\n }\n\n const files = [];\n\n // tslint:disable: prefer-for-of\n for (let i = 0; i < items.length; i++) {\n const file = items[i];\n files.push(file);\n }\n\n return files as any;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem\nfunction toFilePromises(item: DataTransferItem) {\n if (typeof item.webkitGetAsEntry !== 'function') {\n return fromDataTransferItem(item);\n }\n\n const entry = item.webkitGetAsEntry();\n\n // Safari supports dropping an image node from a different window and can be retrieved using\n // the DataTransferItem.getAsFile() API\n // NOTE: FileSystemEntry.file() throws if trying to get the file\n if (entry && entry.isDirectory) {\n return fromDirEntry(entry) as any;\n }\n\n return fromDataTransferItem(item);\n}\n\nfunction flatten(items: any[]): T[] {\n return items.reduce((acc, files) => [\n ...acc,\n ...(Array.isArray(files) ? flatten(files) : [files])\n ], []);\n}\n\nfunction fromDataTransferItem(item: DataTransferItem) {\n const file = item.getAsFile();\n if (!file) {\n return Promise.reject(`${item} is not a File`);\n }\n const fwp = toFileWithPath(file);\n return Promise.resolve(fwp);\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry\nasync function fromEntry(entry: any) {\n return entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry);\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry\nfunction fromDirEntry(entry: any) {\n const reader = entry.createReader();\n\n return new Promise((resolve, reject) => {\n const entries: Promise[] = [];\n\n function readEntries() {\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader\n // https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries\n reader.readEntries(async (batch: any[]) => {\n if (!batch.length) {\n // Done reading directory\n try {\n const files = await Promise.all(entries);\n resolve(files);\n } catch (err) {\n reject(err);\n }\n } else {\n const items = Promise.all(batch.map(fromEntry));\n entries.push(items);\n\n // Continue reading\n readEntries();\n }\n }, (err: any) => {\n reject(err);\n });\n }\n\n readEntries();\n });\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry\nasync function fromFileEntry(entry: any) {\n return new Promise((resolve, reject) => {\n entry.file((file: FileWithPath) => {\n const fwp = toFileWithPath(file, entry.fullPath);\n resolve(fwp);\n }, (err: any) => {\n reject(err);\n });\n });\n}\n\n// Infinite type recursion\n// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540\ninterface FileArray extends Array {}\ntype FileValue = FileWithPath\n | FileArray[];\n","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport accepts from \"attr-accept\"; // Error codes\n\nexport var FILE_INVALID_TYPE = \"file-invalid-type\";\nexport var FILE_TOO_LARGE = \"file-too-large\";\nexport var FILE_TOO_SMALL = \"file-too-small\";\nexport var TOO_MANY_FILES = \"too-many-files\";\nexport var ErrorCode = {\n FileInvalidType: FILE_INVALID_TYPE,\n FileTooLarge: FILE_TOO_LARGE,\n FileTooSmall: FILE_TOO_SMALL,\n TooManyFiles: TOO_MANY_FILES\n}; // File Errors\n\nexport var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {\n accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;\n var messageSuffix = Array.isArray(accept) ? \"one of \".concat(accept.join(\", \")) : accept;\n return {\n code: FILE_INVALID_TYPE,\n message: \"File type must be \".concat(messageSuffix)\n };\n};\nexport var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {\n return {\n code: FILE_TOO_LARGE,\n message: \"File is larger than \".concat(maxSize, \" \").concat(maxSize === 1 ? \"byte\" : \"bytes\")\n };\n};\nexport var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {\n return {\n code: FILE_TOO_SMALL,\n message: \"File is smaller than \".concat(minSize, \" \").concat(minSize === 1 ? \"byte\" : \"bytes\")\n };\n};\nexport var TOO_MANY_FILES_REJECTION = {\n code: TOO_MANY_FILES,\n message: \"Too many files\"\n}; // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n// that MIME type will always be accepted\n\nexport function fileAccepted(file, accept) {\n var isAcceptable = file.type === \"application/x-moz-file\" || accepts(file, accept);\n return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];\n}\nexport function fileMatchSize(file, minSize, maxSize) {\n if (isDefined(file.size)) {\n if (isDefined(minSize) && isDefined(maxSize)) {\n if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];\n } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n }\n\n return [true, null];\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n/**\n *\n * @param {object} options\n * @param {File[]} options.files\n * @param {string|string[]} [options.accept]\n * @param {number} [options.minSize]\n * @param {number} [options.maxSize]\n * @param {boolean} [options.multiple]\n * @param {number} [options.maxFiles]\n * @param {(f: File) => FileError|FileError[]|null} [options.validator]\n * @returns\n */\n\n\nexport function allFilesAccepted(_ref) {\n var files = _ref.files,\n accept = _ref.accept,\n minSize = _ref.minSize,\n maxSize = _ref.maxSize,\n multiple = _ref.multiple,\n maxFiles = _ref.maxFiles,\n validator = _ref.validator;\n\n if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {\n return false;\n }\n\n return files.every(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 1),\n accepted = _fileAccepted2[0];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1),\n sizeMatch = _fileMatchSize2[0];\n\n var customErrors = validator ? validator(file) : null;\n return accepted && sizeMatch && !customErrors;\n });\n} // React's synthetic events has event.isPropagationStopped,\n// but to remain compatibility with other libs (Preact) fall back\n// to check event.cancelBubble\n\nexport function isPropagationStopped(event) {\n if (typeof event.isPropagationStopped === \"function\") {\n return event.isPropagationStopped();\n } else if (typeof event.cancelBubble !== \"undefined\") {\n return event.cancelBubble;\n }\n\n return false;\n}\nexport function isEvtWithFiles(event) {\n if (!event.dataTransfer) {\n return !!event.target && !!event.target.files;\n } // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file\n\n\n return Array.prototype.some.call(event.dataTransfer.types, function (type) {\n return type === \"Files\" || type === \"application/x-moz-file\";\n });\n}\nexport function isKindFile(item) {\n return _typeof(item) === \"object\" && item !== null && item.kind === \"file\";\n} // allow the entire document to be a drag target\n\nexport function onDocumentDragOver(event) {\n event.preventDefault();\n}\n\nfunction isIe(userAgent) {\n return userAgent.indexOf(\"MSIE\") !== -1 || userAgent.indexOf(\"Trident/\") !== -1;\n}\n\nfunction isEdge(userAgent) {\n return userAgent.indexOf(\"Edge/\") !== -1;\n}\n\nexport function isIeOrEdge() {\n var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;\n return isIe(userAgent) || isEdge(userAgent);\n}\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls `event.isPropagationStopped()`.\n * Note that the check is done on the first invoke too,\n * meaning that if propagation was stopped before invoking the fns,\n * no handlers will be executed.\n *\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\n\nexport function composeEventHandlers() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return fns.some(function (fn) {\n if (!isPropagationStopped(event) && fn) {\n fn.apply(void 0, [event].concat(args));\n }\n\n return isPropagationStopped(event);\n });\n };\n}\n/**\n * canUseFileSystemAccessAPI checks if the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API)\n * is supported by the browser.\n * @returns {boolean}\n */\n\nexport function canUseFileSystemAccessAPI() {\n return \"showOpenFilePicker\" in window;\n}\n/**\n * Convert the `{accept}` dropzone prop to the\n * `{types}` option for https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n *\n * @param {AcceptProp} accept\n * @returns {{accept: string[]}[]}\n */\n\nexport function pickerOptionsFromAccept(accept) {\n if (isDefined(accept)) {\n var acceptForPicker = Object.entries(accept).filter(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n mimeType = _ref3[0],\n ext = _ref3[1];\n\n var ok = true;\n\n if (!isMIMEType(mimeType)) {\n console.warn(\"Skipped \\\"\".concat(mimeType, \"\\\" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.\"));\n ok = false;\n }\n\n if (!Array.isArray(ext) || !ext.every(isExt)) {\n console.warn(\"Skipped \\\"\".concat(mimeType, \"\\\" because an invalid file extension was provided.\"));\n ok = false;\n }\n\n return ok;\n }).reduce(function (agg, _ref4) {\n var _ref5 = _slicedToArray(_ref4, 2),\n mimeType = _ref5[0],\n ext = _ref5[1];\n\n return _objectSpread(_objectSpread({}, agg), {}, _defineProperty({}, mimeType, ext));\n }, {});\n return [{\n // description is required due to https://crbug.com/1264708\n description: \"Files\",\n accept: acceptForPicker\n }];\n }\n\n return accept;\n}\n/**\n * Convert the `{accept}` dropzone prop to an array of MIME types/extensions.\n * @param {AcceptProp} accept\n * @returns {string}\n */\n\nexport function acceptPropAsAcceptAttr(accept) {\n if (isDefined(accept)) {\n return Object.entries(accept).reduce(function (a, _ref6) {\n var _ref7 = _slicedToArray(_ref6, 2),\n mimeType = _ref7[0],\n ext = _ref7[1];\n\n return [].concat(_toConsumableArray(a), [mimeType], _toConsumableArray(ext));\n }, []) // Silently discard invalid entries as pickerOptionsFromAccept warns about these\n .filter(function (v) {\n return isMIMEType(v) || isExt(v);\n }).join(\",\");\n }\n\n return undefined;\n}\n/**\n * Check if v is an exception caused by aborting a request (e.g window.showOpenFilePicker()).\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.\n * @param {any} v\n * @returns {boolean} True if v is an abort exception.\n */\n\nexport function isAbort(v) {\n return v instanceof DOMException && (v.name === \"AbortError\" || v.code === v.ABORT_ERR);\n}\n/**\n * Check if v is a security error.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.\n * @param {any} v\n * @returns {boolean} True if v is a security error.\n */\n\nexport function isSecurityError(v) {\n return v instanceof DOMException && (v.name === \"SecurityError\" || v.code === v.SECURITY_ERR);\n}\n/**\n * Check if v is a MIME type string.\n *\n * See accepted format: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers.\n *\n * @param {string} v\n */\n\nexport function isMIMEType(v) {\n return v === \"audio/*\" || v === \"video/*\" || v === \"image/*\" || v === \"text/*\" || /\\w+\\/[-+.\\w]+/g.test(v);\n}\n/**\n * Check if v is a file extension.\n * @param {string} v\n */\n\nexport function isExt(v) {\n return /^.*\\.[\\w]+$/.test(v);\n}\n/**\n * @typedef {Object.} AcceptProp\n */\n\n/**\n * @typedef {object} FileError\n * @property {string} message\n * @property {ErrorCode|string} code\n */\n\n/**\n * @typedef {\"file-invalid-type\"|\"file-too-large\"|\"file-too-small\"|\"too-many-files\"} ErrorCode\n */","var _excluded = [\"children\"],\n _excluded2 = [\"open\"],\n _excluded3 = [\"refKey\", \"role\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"],\n _excluded4 = [\"refKey\", \"onChange\", \"onClick\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { fromEvent } from \"file-selector\";\nimport { acceptPropAsAcceptAttr, allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, canUseFileSystemAccessAPI, isAbort, isEvtWithFiles, isIeOrEdge, isPropagationStopped, isSecurityError, onDocumentDragOver, pickerOptionsFromAccept, TOO_MANY_FILES_REJECTION } from \"./utils/index\";\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * \n * {({getRootProps, getInputProps}) => (\n *
    \n * \n *

    Drag 'n' drop some files here, or click to select files

    \n *
    \n * )}\n *
    \n * ```\n */\n\nvar Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, _excluded);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, _excluded2);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {\n open: open\n })));\n});\nDropzone.displayName = \"Dropzone\"; // Add default props for react-docgen\n\nvar defaultProps = {\n disabled: false,\n getFilesFromEvent: fromEvent,\n maxSize: Infinity,\n minSize: 0,\n multiple: true,\n maxFiles: 0,\n preventDropOnDocument: true,\n noClick: false,\n noKeyboard: false,\n noDrag: false,\n noDragEventsBubbling: false,\n validator: null,\n useFsAccessApi: true,\n autoFocus: false\n};\nDropzone.defaultProps = defaultProps;\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).\n */\n accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Maximum accepted number of files\n * The default value is 0 which means there is no limitation to how many files are accepted.\n */\n maxFiles: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when opening the file dialog\n */\n onFileDialogOpen: PropTypes.func,\n\n /**\n * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n */\n useFsAccessApi: PropTypes.bool,\n\n /**\n * Set to true to focus the root element on render\n */\n autoFocus: PropTypes.bool,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func,\n\n /**\n * Cb for when there's some error from any of the promises.\n *\n * @param {Error} error\n */\n onError: PropTypes.func,\n\n /**\n * Custom validation function. It must return null if there's no errors.\n * @param {File} file\n * @returns {FileError|FileError[]|null}\n */\n validator: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {FileRejection[]} fileRejections List of rejected files and why they were rejected\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise)}\n */\n\n/**\n * An object with the current dropzone state.\n *\n * @typedef {object} DropzoneState\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} acceptedFiles Accepted files\n * @property {FileRejection[]} fileRejections Rejected files and why they were rejected\n */\n\n/**\n * An object with the dropzone methods.\n *\n * @typedef {object} DropzoneMethods\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n acceptedFiles: [],\n fileRejections: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n *
    \n * \n *

    Drag and drop some files here, or click to select files

    \n *
    \n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {import(\"./utils\").AcceptProp} [props.accept] Set accepted file types.\n * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {boolean} [props.useFsAccessApi] Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n * @param {boolean} autoFocus Set to true to auto focus the root element.\n * @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be an object with keys as a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) and the value an array of file extensions (optional).\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n * @param {(error: Error) => void} [props.onError]\n *\n * @returns {DropzoneState & DropzoneMethods}\n */\n\nexport function useDropzone() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),\n accept = _defaultProps$props.accept,\n disabled = _defaultProps$props.disabled,\n getFilesFromEvent = _defaultProps$props.getFilesFromEvent,\n maxSize = _defaultProps$props.maxSize,\n minSize = _defaultProps$props.minSize,\n multiple = _defaultProps$props.multiple,\n maxFiles = _defaultProps$props.maxFiles,\n onDragEnter = _defaultProps$props.onDragEnter,\n onDragLeave = _defaultProps$props.onDragLeave,\n onDragOver = _defaultProps$props.onDragOver,\n onDrop = _defaultProps$props.onDrop,\n onDropAccepted = _defaultProps$props.onDropAccepted,\n onDropRejected = _defaultProps$props.onDropRejected,\n onFileDialogCancel = _defaultProps$props.onFileDialogCancel,\n onFileDialogOpen = _defaultProps$props.onFileDialogOpen,\n useFsAccessApi = _defaultProps$props.useFsAccessApi,\n autoFocus = _defaultProps$props.autoFocus,\n preventDropOnDocument = _defaultProps$props.preventDropOnDocument,\n noClick = _defaultProps$props.noClick,\n noKeyboard = _defaultProps$props.noKeyboard,\n noDrag = _defaultProps$props.noDrag,\n noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling,\n onError = _defaultProps$props.onError,\n validator = _defaultProps$props.validator;\n\n var acceptAttr = useMemo(function () {\n return acceptPropAsAcceptAttr(accept);\n }, [accept]);\n var pickerTypes = useMemo(function () {\n return pickerOptionsFromAccept(accept);\n }, [accept]);\n var onFileDialogOpenCb = useMemo(function () {\n return typeof onFileDialogOpen === \"function\" ? onFileDialogOpen : noop;\n }, [onFileDialogOpen]);\n var onFileDialogCancelCb = useMemo(function () {\n return typeof onFileDialogCancel === \"function\" ? onFileDialogCancel : noop;\n }, [onFileDialogCancel]);\n /**\n * @constant\n * @type {React.MutableRefObject}\n */\n\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive;\n var fsAccessApiWorksRef = useRef(typeof window !== \"undefined\" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (!fsAccessApiWorksRef.current && isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: \"closeDialog\"\n });\n onFileDialogCancelCb();\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n window.addEventListener(\"focus\", onWindowFocus, false);\n return function () {\n window.removeEventListener(\"focus\", onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener(\"dragover\", onDocumentDragOver, false);\n document.addEventListener(\"drop\", onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener(\"dragover\", onDocumentDragOver);\n document.removeEventListener(\"drop\", onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]); // Auto focus the root when autoFocus is true\n\n useEffect(function () {\n if (!disabled && autoFocus && rootRef.current) {\n rootRef.current.focus();\n }\n\n return function () {};\n }, [rootRef, autoFocus, disabled]);\n var onErrCb = useCallback(function (e) {\n if (onError) {\n onError(e);\n } else {\n // Let the user know something's gone wrong if they haven't provided the onError cb.\n console.error(e);\n }\n }, [onError]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n var fileCount = files.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: files,\n accept: acceptAttr,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple,\n maxFiles: maxFiles,\n validator: validator\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n dispatch({\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isDragActive: true,\n type: \"setDraggedFiles\"\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n }).catch(function (e) {\n return onErrCb(e);\n });\n }\n }, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n var hasFiles = isEvtWithFiles(event);\n\n if (hasFiles && event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = \"copy\";\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (hasFiles && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return rootRef.current && rootRef.current.contains(target);\n }); // Make sure to remove a target present multiple times only once\n // (Firefox may fire dragenter/dragleave multiple times on the same element)\n\n var targetIdx = targets.indexOf(event.target);\n\n if (targetIdx !== -1) {\n targets.splice(targetIdx, 1);\n }\n\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n type: \"setDraggedFiles\",\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var setFiles = useCallback(function (files, event) {\n var acceptedFiles = [];\n var fileRejections = [];\n files.forEach(function (file) {\n var _fileAccepted = fileAccepted(file, acceptAttr),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 2),\n accepted = _fileAccepted2[0],\n acceptError = _fileAccepted2[1];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),\n sizeMatch = _fileMatchSize2[0],\n sizeError = _fileMatchSize2[1];\n\n var customErrors = validator ? validator(file) : null;\n\n if (accepted && sizeMatch && !customErrors) {\n acceptedFiles.push(file);\n } else {\n var errors = [acceptError, sizeError];\n\n if (customErrors) {\n errors = errors.concat(customErrors);\n }\n\n fileRejections.push({\n file: file,\n errors: errors.filter(function (e) {\n return e;\n })\n });\n }\n });\n\n if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {\n // Reject everything and empty accepted files\n acceptedFiles.forEach(function (file) {\n fileRejections.push({\n file: file,\n errors: [TOO_MANY_FILES_REJECTION]\n });\n });\n acceptedFiles.splice(0);\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n fileRejections: fileRejections,\n type: \"setFiles\"\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, fileRejections, event);\n }\n\n if (fileRejections.length > 0 && onDropRejected) {\n onDropRejected(fileRejections, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n }, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n setFiles(files, event);\n }).catch(function (e) {\n return onErrCb(e);\n });\n }\n\n dispatch({\n type: \"reset\"\n });\n }, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]); // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n // No point to use FS access APIs if context is not secure\n // https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#feature_detection\n if (fsAccessApiWorksRef.current) {\n dispatch({\n type: \"openDialog\"\n });\n onFileDialogOpenCb(); // https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n\n var opts = {\n multiple: multiple,\n types: pickerTypes\n };\n window.showOpenFilePicker(opts).then(function (handles) {\n return getFilesFromEvent(handles);\n }).then(function (files) {\n setFiles(files, null);\n dispatch({\n type: \"closeDialog\"\n });\n }).catch(function (e) {\n // AbortError means the user canceled\n if (isAbort(e)) {\n onFileDialogCancelCb(e);\n dispatch({\n type: \"closeDialog\"\n });\n } else if (isSecurityError(e)) {\n fsAccessApiWorksRef.current = false; // CORS, so cannot use this API\n // Try using the input\n\n if (inputRef.current) {\n inputRef.current.value = null;\n inputRef.current.click();\n } else {\n onErrCb(new Error(\"Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided.\"));\n }\n } else {\n onErrCb(e);\n }\n });\n return;\n }\n\n if (inputRef.current) {\n dispatch({\n type: \"openDialog\"\n });\n onFileDialogOpenCb();\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.key === \" \" || event.key === \"Enter\" || event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, openFileDialog]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: \"focus\"\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: \"blur\"\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [noClick, openFileDialog]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? \"ref\" : _ref2$refKey,\n role = _ref2.role,\n onKeyDown = _ref2.onKeyDown,\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick,\n onDragEnter = _ref2.onDragEnter,\n onDragOver = _ref2.onDragOver,\n onDragLeave = _ref2.onDragLeave,\n onDrop = _ref2.onDrop,\n rest = _objectWithoutProperties(_ref2, _excluded3);\n\n return _objectSpread(_objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),\n role: typeof role === \"string\" && role !== \"\" ? role : \"presentation\"\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}), rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? \"ref\" : _ref3$refKey,\n onChange = _ref3.onChange,\n onClick = _ref3.onClick,\n rest = _objectWithoutProperties(_ref3, _excluded4);\n\n var inputProps = _defineProperty({\n accept: acceptAttr,\n multiple: multiple,\n type: \"file\",\n style: {\n display: \"none\"\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread(_objectSpread({}, inputProps), rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n/**\n * @param {DropzoneState} state\n * @param {{type: string} & DropzoneState} action\n * @returns {DropzoneState}\n */\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case \"focus\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: true\n });\n\n case \"blur\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: false\n });\n\n case \"openDialog\":\n return _objectSpread(_objectSpread({}, initialState), {}, {\n isFileDialogActive: true\n });\n\n case \"closeDialog\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false\n });\n\n case \"setDraggedFiles\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isDragActive: action.isDragActive,\n isDragAccept: action.isDragAccept,\n isDragReject: action.isDragReject\n });\n\n case \"setFiles\":\n return _objectSpread(_objectSpread({}, state), {}, {\n acceptedFiles: action.acceptedFiles,\n fileRejections: action.fileRejections\n });\n\n case \"reset\":\n return _objectSpread({}, initialState);\n\n default:\n return state;\n }\n}\n\nfunction noop() {}\n\nexport { ErrorCode } from \"./utils\";","import React, { LabelHTMLAttributes } from 'react'\nimport clsx from 'clsx'\n\nexport type FieldLabelProps = {\n\tlabel: string\n\trequired?: boolean\n} & LabelHTMLAttributes\n\nconst FieldLabel = ({\n\tlabel,\n\trequired = false,\n\tclassName,\n\tchildren,\n\t...rest\n}: FieldLabelProps) => {\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/label-has-associated-control\n\t\t\n\t\t\t{label}\n\t\t\t{required ? '*' : ''}\n\t\t\t{children}\n\t\t\n\t)\n}\n\nexport default FieldLabel\n","import React, { useEffect, useState } from 'react'\nimport { Button, IconButton } from '@mui/material'\nimport { useDropzone } from 'react-dropzone'\nimport clsx from 'clsx'\nimport CloseIcon from '@mui/icons-material/Close'\nimport FieldLabel from './formControls/FieldLabel'\n\nconst ImagePicker = ({\n\tname,\n\tlabel,\n\tonChange,\n\timage = null,\n\terror,\n\thelperText,\n\trequired,\n\t...rest\n}) => {\n\tconst colorMap = {\n\t\tsuccess: 'text-green-900 border-green-600 bg-green-50',\n\t\tdanger: 'text-red-900 border-red-700 bg-red-50',\n\t}\n\n\tconst [color, setColor] = useState(null)\n\tconst [file, setFile] = useState(image)\n\n\tuseEffect(() => {\n\t\tif (error) {\n\t\t\tsetColor(colorMap.danger)\n\t\t} else {\n\t\t\tsetColor(null)\n\t\t}\n\t}, [error, colorMap.danger])\n\n\tconst onDragEnter = () => {\n\t\tsetColor(colorMap.success)\n\t}\n\n\tconst onDragLeave = () => {\n\t\tsetColor(null)\n\t}\n\n\tconst onDrop = () => {\n\t\tsetColor(null)\n\t}\n\n\tconst onAccepted = (dropFiles) => {\n\t\tsetFile(dropFiles[0])\n\t\tif (onChange) {\n\t\t\tonChange(dropFiles[0])\n\t\t}\n\t}\n\n\tconst onErrorOrRejected = () => {\n\t\tsetColor(colorMap.danger)\n\t}\n\n\tconst { getRootProps, getInputProps, open, acceptedFiles } =\n\t\tuseDropzone({\n\t\t\tonDrop,\n\t\t\tonDragEnter,\n\t\t\tonDragLeave,\n\t\t\tonDropRejected: onErrorOrRejected,\n\t\t\tonError: onErrorOrRejected,\n\t\t\tonDropAccepted: onAccepted,\n\t\t\tmultiple: false,\n\t\t\taccept: {\n\t\t\t\t'image/jpeg': [],\n\t\t\t\t'image/png': [],\n\t\t\t\t'image/gif': [],\n\t\t\t\t'image/webp': [],\n\t\t\t},\n\t\t\t...rest,\n\t\t})\n\n\tconst onRemoveClick = () => {\n\t\tacceptedFiles.splice(0, acceptedFiles.length)\n\t\tsetFile(null)\n\t\tif (onChange) {\n\t\t\tonChange(null)\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{!image && (\n\t\t\t\t\t\t

    \n\t\t\t\t\t\t\tDrag 'n' drop or click\n\t\t\t\t\t\t

    \n\t\t\t\t\t)}\n\t\t\t\t\t{image && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t
    \n\t\t\t\t\n\t\t\t\t\tBrowse\n\t\t\t\t\n\t\t\t\n\t\t\t{helperText && (\n\t\t\t\t\n\t\t\t\t\t{helperText}\n\t\t\t\t\n\t\t\t)}\n\t\t\t{file && (\n\t\t\t\t
    \n\t\t\t\t\t

    {file.name}

    \n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t)}\n\t\t\n\t)\n}\n\nexport default ImagePicker\n","import React from 'react'\nimport { Controller } from 'react-hook-form'\nimport useFormField from '../../hooks/useFormField'\nimport ImagePicker from '../ImagePicker'\n\nconst ImagePickerField = ({\n\tname,\n\tcontrol,\n\terrors,\n\thelperText,\n\t...rest\n}) => {\n\tconst { getError } = useFormField()\n\tconst error = getError(name, errors)\n\n\tif (!control) {\n\t\treturn \n\t}\n\n\treturn (\n\t\t (\n\t\t\t\t\n\t\t\t)}\n\t\t>\n\t)\n}\n\nexport default ImagePickerField\n","import React, { useEffect, useState } from 'react'\nimport { useDropzone } from 'react-dropzone'\nimport DriveFolderUploadIcon from '@mui/icons-material/DriveFolderUpload'\nimport clsx from 'clsx'\nimport FileList from './FileList'\nimport { formatBytes } from '../services/utils'\n\nconst Dropzone = ({\n\tonDropAccepted,\n\terror,\n\thelperText,\n\tmaxSize,\n\tmaxFiles,\n\t...rest\n}) => {\n\tconst colorMap = {\n\t\tprimary: 'text-indigo-800 border-indigo-600 bg-indigo-50',\n\t\tsuccess: 'text-green-800 border-green-600 bg-green-50',\n\t\tdanger: 'text-red-800 border-red-600 bg-red-50',\n\t}\n\n\tconst [color, setColor] = useState(colorMap.primary)\n\tconst [files, setFiles] = useState([])\n\n\tuseEffect(() => {\n\t\tif (error) {\n\t\t\tsetColor(colorMap.danger)\n\t\t}\n\t}, [error, colorMap.danger])\n\n\tconst onDragEnter = () => {\n\t\tsetColor(colorMap.success)\n\n\t\tif (isDragReject) {\n\t\t\tsetColor(colorMap.danger)\n\t\t}\n\t}\n\n\tconst onDragLeave = () => {\n\t\tsetColor(colorMap.primary)\n\t}\n\n\tconst onDrop = () => {\n\t\tsetColor(colorMap.primary)\n\t}\n\n\tconst onAccepted = (dropFiles) => {\n\t\tconst allFiles = [...files, ...dropFiles]\n\t\tsetFiles(allFiles)\n\t\tif (onDropAccepted) {\n\t\t\tonDropAccepted(allFiles)\n\t\t}\n\t}\n\n\tconst onErrorOrRejected = () => {\n\t\tsetColor(colorMap.danger)\n\t}\n\n\tconst {\n\t\tgetRootProps,\n\t\tgetInputProps,\n\t\tacceptedFiles,\n\t\tisDragReject,\n\t\tfileRejections,\n\t} = useDropzone({\n\t\tonDrop,\n\t\tonDragEnter,\n\t\tonDragLeave,\n\t\tisDragReject: onErrorOrRejected,\n\t\tonDropRejected: onErrorOrRejected,\n\t\tonError: onErrorOrRejected,\n\t\tonDropAccepted: onAccepted,\n\t\tmaxSize,\n\t\tmaxFiles,\n\t\t...rest,\n\t})\n\n\tconst onRemoveFile = (file) => {\n\t\tacceptedFiles.splice(acceptedFiles.indexOf(file), 1)\n\t\tconst newFiles = [...files]\n\t\tnewFiles.splice(files.indexOf(file), 1)\n\t\tsetFiles(newFiles)\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\tDrag 'n' drop files here or click to select files\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\n\t\t\t{(helperText || maxSize || maxFiles) && (\n\t\t\t\t\n\t\t\t\t\t
    {helperText}
    \n\t\t\t\t\t{(maxFiles || maxSize) && (\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t{maxFiles && Up to {maxFiles} files}\n\t\t\t\t\t\t\t{maxSize && (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{maxFiles ? '' : 'Up to '} {formatBytes(maxSize)}{' '}\n\t\t\t\t\t\t\t\t\teach\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t
    \n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t)}\n\t\t\t{fileRejections.length > 0 && (\n\t\t\t\t
    \n\t\t\t\t\t{fileRejections.map((fileRejection) => (\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t{fileRejection.errors.map((error) => (\n\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t{fileRejection.file.name}:{' '}\n\t\t\t\t\t\t\t\t\t{error.code === 'file-too-large' && maxSize\n\t\t\t\t\t\t\t\t\t\t? `File is larger than ${formatBytes(maxSize)} bytes`\n\t\t\t\t\t\t\t\t\t\t: error.message}\n\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t
    \n\t\t\t\t\t))}\n\t\t\t\t
    \n\t\t\t)}\n\t\t\t\n\t\t\n\t)\n}\n\nexport default Dropzone\n","import React from 'react'\nimport useFormField from '../../hooks/useFormField'\nimport Dropzone from '../Dropzone'\nimport { Controller } from 'react-hook-form'\n\nconst DropzoneField = ({\n\tname,\n\tcontrol,\n\terrors,\n\thelperText,\n\t...rest\n}) => {\n\tconst { getError } = useFormField()\n\tconst error = getError(name, errors)\n\n\tif (!control) {\n\t\treturn \n\t}\n\n\treturn (\n\t\t (\n\t\t\t\t\n\t\t\t)}\n\t\t/>\n\t)\n}\n\nexport default DropzoneField\n","import React, { useMemo } from 'react'\nimport TextField from './TextField'\nimport { IconButton, InputAdornment } from '@mui/material'\nimport { merge } from 'lodash'\nimport VisibilityIcon from '@mui/icons-material/Visibility'\nimport VisibilityOffIcon from '@mui/icons-material/VisibilityOff'\n\nconst PasswordField = ({ InputProps = undefined, ...rest }) => {\n\tconst [showPassword, setShowPassword] = React.useState(false)\n\n\tconst onTogglePasswordClick = () => {\n\t\tsetShowPassword(!showPassword)\n\t}\n\n\tconst mergedInputProps = useMemo(() => {\n\t\tconst pwInputProps = {\n\t\t\tendAdornment: (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{showPassword ? (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t),\n\t\t}\n\n\t\treturn InputProps ? merge(InputProps, pwInputProps) : pwInputProps\n\t}, [showPassword, InputProps, onTogglePasswordClick])\n\n\treturn (\n\t\t\n\t)\n}\n\nexport default PasswordField\n","import React from 'react'\nimport CheckIcon from '@mui/icons-material/Check'\nimport CloseIcon from '@mui/icons-material/Close'\nimport clsx from 'clsx'\n\nexport type TrueFalseIconProps = {\n\tvalue: boolean\n\tclassName?: string\n}\n\nconst TrueFalseIcon = ({ value, className }: TrueFalseIconProps) => {\n\tconst colorMap = {\n\t\tgreen: 'text-green-600',\n\t\tred: 'text-red-600',\n\t}\n\n\treturn value ? (\n\t\t\n\t) : (\n\t\t\n\t)\n}\n\nexport default TrueFalseIcon\n","import React from 'react'\nimport clsx from 'clsx'\n\nexport type LayoutRowProps = {\n\tclassName?: string\n\tchildren: React.ReactNode\n}\n\nconst LayoutRow = ({ className, children }: LayoutRowProps) => {\n\treturn
    {children}
    \n}\n\nLayoutRow.defaultProps = {\n\tclassName: undefined,\n}\n\nexport default LayoutRow\n","import React from 'react'\n\nexport type InnerPageProps = {\n\tchildren: React.ReactNode\n}\n\nconst InnerPage = ({ children }: InnerPageProps) => {\n\treturn
    {children}
    \n}\nexport default InnerPage\n","import React from 'react'\nimport clsx from 'clsx'\nimport { Card, CardContent } from '@mui/material'\n\nexport type LayoutCardProps = {\n\tclassName?: string\n\tchildren: React.ReactNode\n}\n\nconst LayoutCard = ({ className, children }: LayoutCardProps) => {\n\treturn (\n\t\t\n\t\t\t{children}\n\t\t\n\t)\n}\n\nLayoutCard.defaultProps = {\n\tclassName: undefined,\n}\n\nexport default LayoutCard\n","import React from 'react'\nimport clsx from 'clsx'\n\nexport type GridRowProps = {\n\tclassName?: string\n\tcolumns?: 2 | 3\n\tchildren?: React.ReactNode\n}\n\nconst LayoutRowGrid = ({\n\tclassName,\n\tcolumns,\n\tchildren,\n}: GridRowProps) => {\n\tlet mergedClassName = className\n\n\tif (columns === 2) {\n\t\tmergedClassName = clsx('md:grid-cols-2', mergedClassName)\n\t}\n\n\tif (columns === 3) {\n\t\tmergedClassName = clsx('md:grid-cols-3', mergedClassName)\n\t}\n\n\treturn (\n\t\t\n\t\t\t{children}\n\t\t\n\t)\n}\n\nLayoutRowGrid.defaultProps = {\n\tclassName: undefined,\n\tcolumns: undefined,\n}\n\nexport default LayoutRowGrid\n","import React from 'react'\nimport {\n\tDialog as MuiDialog,\n\tDialogContent,\n\tDialogTitle,\n} from '@mui/material'\nimport type { DialogProps as MuiDialogProps } from '@mui/material'\nimport { useTheme } from '@mui/material/styles'\nimport useMediaQuery from '@mui/material/useMediaQuery'\nimport CloseIcon from '@mui/icons-material/Close'\nimport IconButton from '@mui/material/IconButton'\n\nexport type DialogProps = {\n\ttitle?: string\n\tonClose?: () => void\n} & MuiDialogProps\n\nconst Dialog = ({\n\ttitle,\n\tonClose,\n\tchildren,\n\t...rest\n}: DialogProps) => {\n\tconst theme = useTheme()\n\tconst fullScreen = useMediaQuery(theme.breakpoints.down('sm'))\n\n\treturn (\n\t\t\n\t\t\t{title && (\n\t\t\t\t\n\t\t\t\t\t{title}{' '}\n\t\t\t\t\t{onClose && (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t)}\n\t\t\t{children}\n\t\t\n\t)\n}\n\nexport default Dialog\n","import { Dialog, Link, Typography } from '@mui/material'\nimport useMediaQuery from '@mui/material/useMediaQuery'\nimport { useTheme } from '@mui/material/styles'\nimport { Button } from '../Button'\nimport { getTheme } from '../../config'\nimport { isDarkMode } from '../../services/helper'\n\nconst siteTheme = getTheme()\n\nexport const ModalByPhone = ({ visible, siteConfig, setVisible }) => {\n\tconst theme = useTheme()\n\tconst fullScreen = useMediaQuery(theme.breakpoints.down('sm'))\n\n\treturn (\n\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tTo apply over the phone, please call us now at... \n\t\t\t\t\t\n\t\t\t\t\t

    \n\t\t\t\t\t\t window.open(`tel:${siteConfig.phone}`)}\n\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\tunderline=\"hover\"\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tcolor: siteTheme.siteConfig.color.primary,\n\t\t\t\t\t\t\t\tmarginTop: 16,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{siteConfig?.phone}\n\t\t\t\t\t\t\n\t\t\t\t\t

    \n\t\t\t\t
    \n\t\t\t\t{fullScreen && (\n\t\t\t\t\t window.open(`tel:${siteConfig.phone}`)}\n\t\t\t\t\t\tstyle={{ width: '90%', marginBottom: 10, marginTop: 20 }}\n\t\t\t\t\t\tvariant=\"contained\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t setVisible(false)}\n\t\t\t\t\tstyle={\n\t\t\t\t\t\tfullScreen\n\t\t\t\t\t\t\t? { width: '90%' }\n\t\t\t\t\t\t\t: { width: 290, marginTop: 20 }\n\t\t\t\t\t}\n\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t/>\n\t\t\t
    \n\t\t
    \n\t)\n}\n","import { useState } from 'react'\nimport { Dialog } from '@mui/material'\nimport useMediaQuery from '@mui/material/useMediaQuery'\nimport { useTheme } from '@mui/material/styles'\nimport Radio from '@mui/material/Radio'\nimport RadioGroup from '@mui/material/RadioGroup'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport FormControl from '@mui/material/FormControl'\nimport FormLabel from '@mui/material/FormLabel'\nimport { Button } from '../Button'\nimport { useAppContext } from '../AppContext'\nimport { isDarkMode } from '../../services/helper'\n\nexport const ModalExportData = ({ visible, setVisible, action }) => {\n\tconst { state } = useAppContext()\n\tconst { siteConfig } = state\n\tconst theme = useTheme()\n\tconst fullScreen = useMediaQuery(theme.breakpoints.down('sm'))\n\tconst [value, setValue] = useState('csv')\n\n\tconst handleChange = (event) => {\n\t\tsetValue(event.target.value)\n\t}\n\n\tconst exportData = () => {\n\t\tsetVisible(false)\n\t\taction(value)\n\t}\n\n\treturn (\n\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tChoose a file format to export\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel=\".csv\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel=\".xlsx\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel=\".json\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t setVisible(false)}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: fullScreen ? '90%' : 290,\n\t\t\t\t\t\tmarginBottom: 10,\n\t\t\t\t\t}}\n\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t/>\n\t\t\t
    \n\t\t
    \n\t)\n}\n","import Dialog from '@mui/material/Dialog'\nimport useMediaQuery from '@mui/material/useMediaQuery'\nimport { useTheme } from '@mui/material/styles'\nimport { Button, LoadingBtn } from '../Button'\nimport { Checkbox, FormControlLabel } from '@mui/material'\nimport { useState } from 'react'\nimport { Warning } from '@mui/icons-material'\n\n/**\n * @deprecated Use `ConfirmRestoreModal`, `ConfirmDeleteModal` or `ConfirmPermanentDeleteModal` instead.\n * This component is outdated and will be removed.\n */\nexport const ModalRemoveRestoreRecordConfirm = (props) => {\n\tconst theme = useTheme()\n\tconst fullScreen = useMediaQuery(theme.breakpoints.down('md'))\n\n\tconst closeModal = () => {\n\t\tsetNukeConfirm(false)\n\t\tprops.setRemoveModalVisible(false)\n\t}\n\n\tconst [nukeConfirm, setNukeConfirm] = useState(false)\n\n\treturn (\n\t\t\n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t\tConfirm{' '}\n\t\t\t\t\t{!props.restore\n\t\t\t\t\t\t? props.row?.nuke\n\t\t\t\t\t\t\t? 'Permanent Deletion'\n\t\t\t\t\t\t\t: 'Delete'\n\t\t\t\t\t\t: 'Reactivation'}\n\t\t\t\t

    \n\t\t\t\t{props.row?.nuke && (\n\t\t\t\t\t
    \n\t\t\t\t\t\t

    \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t

    \n\t\t\t\t\t\t

    \n\t\t\t\t\t\t\tWARNING: THIS CAN NOT BE UNDONE\n\t\t\t\t\t\t

    \n\t\t\t\t\t
    \n\t\t\t\t)}\n\t\t\t\t

    \n\t\t\t\t\t{!props.restore\n\t\t\t\t\t\t? props.row?.nuke\n\t\t\t\t\t\t\t? 'Permanently Delete'\n\t\t\t\t\t\t\t: 'Remove'\n\t\t\t\t\t\t: 'Restore'}{' '}\n\t\t\t\t\t\"\n\t\t\t\t\t{props.row?.name ||\n\t\t\t\t\t\tprops.row?.Name ||\n\t\t\t\t\t\tprops.name ||\n\t\t\t\t\t\t'Record'}\n\t\t\t\t\t\"{props.row?.nuke ? ' & All Associated Data?' : '?'}\n\t\t\t\t

    \n\t\t\t\t{props.row?.nuke && (\n\t\t\t\t\t
    \n\t\t\t\t\t\t setNukeConfirm(e.target.checked)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={`\n\t\t\t\t\t\t\t\tBy checking this box I confirm that I understand that this action can not be undone.\n\t\t\t\t\t\t\t`}\n\t\t\t\t\t\t/>\n\t\t\t\t\t
    \n\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t\t\t!props.restore ? props.remove() : props.restore()\n\t\t\t\t\t}\n\t\t\t\t\tstyle={\n\t\t\t\t\t\tfullScreen\n\t\t\t\t\t\t\t? { width: '90%', marginBottom: 10 }\n\t\t\t\t\t\t\t: { width: 290, marginBottom: 10 }\n\t\t\t\t\t}\n\t\t\t\t\tvariant=\"contained\"\n\t\t\t\t\tloading={props.loading}\n\t\t\t\t\tdisabled={props.row?.nuke === true && !nukeConfirm}\n\t\t\t\t/>\n\t\t\t\t\n\t\t\t
    \n\t\t\n\t)\n}\n","import Dialog from '@mui/material/Dialog'\nimport useMediaQuery from '@mui/material/useMediaQuery'\nimport { useTheme } from '@mui/material/styles'\nimport React from 'react'\nimport { Button, LoadingBtn } from '../Button'\nimport { isDarkMode } from '../../services/helper'\nimport { useAppContext } from '../AppContext'\n\nexport type ModalConfirmationProps = {\n\topen: boolean\n\ttext: string\n\tisOkButton?: boolean\n\tisSave?: boolean\n\tcanBeSaved?: boolean\n\tloadingText?: string\n}\n\nexport type ModalYesNoProps = {\n\tmodalConfirmation: ModalConfirmationProps\n\tsetModalConfirmation: (data: ModalConfirmationProps) => void\n\tmodalConfirm: (data: ModalConfirmationProps) => void\n\tmodalDismiss?: () => void\n\tsaveForm?: () => void\n\tyesButtonName?: string\n\tnoButtonName?: string\n\tloading?: boolean\n}\n\nexport const ModalYesNo = ({\n\tmodalConfirmation,\n\tsetModalConfirmation,\n\tmodalConfirm,\n\tmodalDismiss,\n\tsaveForm,\n\tyesButtonName,\n\tnoButtonName,\n\tloading,\n}: ModalYesNoProps) => {\n\tconst theme = useTheme()\n\tconst fullScreen = useMediaQuery(theme.breakpoints.down('md'))\n\tconst { state } = useAppContext()\n\tconst { siteConfig } = state\n\n\tconst typedSiteConfig = siteConfig as unknown as {\n\t\tdarkModeLogoUrl: string\n\t\tlogoUrl: string\n\t}\n\n\tconst handleYesClick = () => {\n\t\tif (modalConfirmation.isSave) {\n\t\t\tmodalConfirm({ ...modalConfirmation, canBeSaved: true })\n\t\t\tif (saveForm) {\n\t\t\t\tsaveForm()\n\t\t\t}\n\t\t} else {\n\t\t\tmodalConfirm(modalConfirmation)\n\t\t}\n\t}\n\n\tconst handleNoClick = () => {\n\t\tif (typeof modalDismiss === 'function') modalDismiss()\n\t\telse\n\t\t\tsetModalConfirmation({\n\t\t\t\t...modalConfirmation,\n\t\t\t\tcanBeSaved: false,\n\t\t\t\topen: false,\n\t\t\t})\n\t}\n\n\treturn (\n\t\t\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t

    \n\t\t\t\t\t{modalConfirmation.loadingText && loading\n\t\t\t\t\t\t? modalConfirmation.loadingText\n\t\t\t\t\t\t: modalConfirmation.text}\n\t\t\t\t

    \n\t\t\t\t{modalConfirmation.isOkButton ? (\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetModalConfirmation({\n\t\t\t\t\t\t\t\t...modalConfirmation,\n\t\t\t\t\t\t\t\tcanBeSaved: false,\n\t\t\t\t\t\t\t\topen: false,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstyle={fullScreen ? { width: '90%' } : { width: 290 }}\n\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t
    \n\t\t\n\t)\n}\n","import React from 'react'\nimport clsx from 'clsx'\n\nconst ActiveVersionAlert = ({ status }) => {\n\tconst activeVersionStyleMap = {\n\t\tinactive: 'bg-orange-100 text-orange-800 border-orange-200',\n\t\tactive: 'bg-green-100 text-green-800 border-green-200',\n\t}\n\n\treturn (\n\t\t\n\t\t\tEditing {status === 'inactive' ? 'an inactive' : 'the active'}{' '}\n\t\t\tversion\n\t\t\n\t)\n}\n\nexport default ActiveVersionAlert\n","import React from 'react'\nimport { navigationLinking } from '../services/navigation'\nimport { useAppContext } from './AppContext'\nimport { useNavigate } from 'react-router-dom'\n\nconst withAuth = (Component) => {\n\treturn function (props) {\n\t\tconst { state } = useAppContext()\n\t\tconst navigate = useNavigate()\n\t\tconst { user } = state\n\n\t\tif (!user?.isLoggedIn) {\n\t\t\treturn navigate(`/${navigationLinking.SignIn}`)\n\t\t}\n\n\t\treturn \n\t}\n}\n\nexport default withAuth\n","/**\n * @description Debug Token\n * @type {string}\n */\nconst debugToken =\n\t'eyJraWQiOiJ0TzlWcTRaWFRTUm9GSVp2emxQaHhjdlk5RGdudmVMXC9WcWxMcFBBaUdoQT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIxYjJjMDM1Yy1mYjhiLTRlMzItODllMC02OTBiNzY3MWU5NzkiLCJpc3MiOiJodHRwczpcL1wvY29nbml0by1pZHAudXMtZWFzdC0yLmFtYXpvbmF3cy5jb21cL3VzLWVhc3QtMl90S3ZjeDA5SEkiLCJjbGllbnRfaWQiOiI3ZnFxZzQyNDAzZWRoaGE3OWRuOG5vdGFnMyIsIm9yaWdpbl9qdGkiOiI4ZDU5YmI0My1kZTM5LTQ5MjgtODNhOS01ZWZjNGZhNDRhNzAiLCJldmVudF9pZCI6IjY2NTZkMmZmLWU0MWYtNGUzYi1iZDNjLTBmNjE4ZDI5OGJjMSIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiYXdzLmNvZ25pdG8uc2lnbmluLnVzZXIuYWRtaW4iLCJhdXRoX3RpbWUiOjE3MDcyMzE1MzksImV4cCI6MTcwNzIzNTEzOSwiaWF0IjoxNzA3MjMxNTM5LCJqdGkiOiI4ZTVkNTQ3Yy0xMTM1LTQ4YWEtOWI1NS1hZGU2OWRlMzVkNWIiLCJ1c2VybmFtZSI6IjFiMmMwMzVjLWZiOGItNGUzMi04OWUwLTY5MGI3NjcxZTk3OSJ9.qBUOsN16q35gCbcAAOT84JBc6f-kqDeSgyXJGQ6OKZn9nXaOLVuDD_NqGBM5hWPzKBjxKIYXN80Gq_Z24tDN6OJJPQnFO9256tdumTWtSzCUhhWIJno1HWTb9qwVkPgkBleg4CRvGB91wAMF34qzcgksvTFqCngtvSBGDqoO0bw5teZ9__FGMK0FIo-38FR-cI5umqUV2NvJf9sf9fwvtPwlKivrnjkiGaMbvj5m2B6yBh77kM-oeWT4Ohy2HgbSngrkyDxPwp_vv5dUn2xaRthgf7JKifk-zloz3NyAi1KWwb6hmBIV4dKj7Dxb8CaRPDz0P0nmRsi7wChG86xWaQ'\n\n/**\n * @description Debug Loan ID\n * @type {string}\n */\nconst debugLoanId = '{c1f3b00f-fe18-4efe-8f32-c2e1c1feb748}'\n\n/**\n * @description Debug Role\n * @type {string}\n */\n// const debugRole = 'Realtor' // Realtor\n// const debugRole = 'Borrower' // Borrower\n// const debugRole = 'LoanOfficer' // Loan Officer\nconst debugRole = 'Admin' // Admin\n\n/**\n * @description Debug Enabled\n * @type {boolean}\n */\nconst debugEnabled =\n\t(process.env.REACT_APP_DEBUG_ENABLED &&\n\t\tprocess.env.REACT_APP_DEBUG_ENABLED === 'true') ||\n\tfalse\n// const debugEnabled = true\n\n/**\n * @description Local host alias for running locally\n * @type {string}\n */\nconst localhostAlias =\n\tprocess.env.REACT_APP_LOCALHOST_ALIAS || 'www.thebigpos.dev'\n//\t'loanofficer.thebigpos.dev'\n// 'www.thebigpos.dev'\n// 'matt.thebigpos.dev'\n// 'joe.thebigpos.dev'\n// 'jagent.thebigpos.dev'\n// 'realtor.thebigpos.dev'\n// 'matthewv.ahmcloans.com'\n// 'joe.ahmcloans.com'\n\nconst theme = {\n\tmaintenance: process.env.REACT_APP_MAINTENANCE_MODE === 'true',\n\tisLocalHost: window.location.host.includes('localhost'),\n\tdebug: {\n\t\tenabled: debugEnabled,\n\t\ttoken: debugToken,\n\t\tloanId: debugLoanId,\n\t\tuser: {\n\t\t\taccountID: '34039be4-eb3c-4091-8a8b-5be79736c830',\n\t\t\trole: debugRole,\n\t\t\temail: 'aaquino@thebigpos.com',\n\t\t\tfirstName: 'Alex',\n\t\t\tlastName: 'Aquino',\n\t\t\tphone: '(555) 555-5555',\n\t\t\tloanIDs: [debugLoanId],\n\t\t\tloans: [\n\t\t\t\t{\n\t\t\t\t\tloanID: debugLoanId,\n\t\t\t\t\tloanNumber: '0003021286624',\n\t\t\t\t\tcreatedAt: '2022-11-10T21:04:25.151429Z',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\tapi: {\n\t\t// https://v2.absolute.thebigpos-api.com (Absolute)\n\t\t// https://shared.thebigpos-api.com (Shared)\n\t\t// https://api.thebigpos.dev (V2 Dev)\n\t\t// https://staging.thebigpos-api.com (Staging)\n\t\t_localhostAlias: localhostAlias,\n\t\thost: {\n\t\t\tproduction:\n\t\t\t\tprocess.env.REACT_APP_POS_API_HOST ||\n\t\t\t\t'https://shared.thebigpos-api.dev',\n\t\t\tdev:\n\t\t\t\tprocess.env.REACT_APP_POS_API_HOST ||\n\t\t\t\t'https://api.thebigpos.dev',\n\t\t\t// 'https://shared.thebigpos-api.com',\n\t\t\t// 'https://v2.absolute.thebigpos-api.com',\n\t\t\t// 'https://api.thebigpos.dev',\n\t\t},\n\t},\n\tencryption: {\n\t\tpassphrase: 'pU7zS5qP4qA8yG1zV2pT0vL8iB1eA8vL',\n\t},\n\tdefaultFont: 'Rubik',\n\tsecondaryFont: 'Montserrat',\n\tvalidation: {\n\t\tpasswordLength: 8,\n\t\tpasswordRegex:\n\t\t\t/^(?=.*[A-Z])(?=.*[!@#$&*])(?=.*[0-9])(?=.*[a-z]).{8,}$/,\n\t\tpasswordRequirements: [\n\t\t\t{\n\t\t\t\tkey: 'length',\n\t\t\t\tlabel: 'Contains a minimum of 8 characters',\n\t\t\t\tregex: /^.{8,}$/,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'upper',\n\t\t\t\tlabel: 'Contains 1 Uppercase Letter (A-Z)',\n\t\t\t\tregex: /^(?=.*[A-Z]).+$/,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'lower',\n\t\t\t\tlabel: 'Contains 1 Lowercase Letter (a-z)',\n\t\t\t\tregex: /^(?=.*[a-z]).+$/,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'number',\n\t\t\t\tlabel: 'Contains 1 Number (0-9)',\n\t\t\t\tregex: /^(?=.*[0-9]).+$/,\n\t\t\t},\n\t\t\t{\n\t\t\t\tkey: 'special',\n\t\t\t\tlabel: 'Contains 1 Special Character (!@#$&*)',\n\t\t\t\tregex: /^(?=.*[!@#$&*]).+$/,\n\t\t\t},\n\t\t],\n\t\tallowedDocumentTypes: [\n\t\t\t'application/pdf',\n\t\t\t'image/jpeg',\n\t\t\t'image/png',\n\t\t],\n\t},\n\tbreakpoints: {\n\t\tdataTable: 768,\n\t\tmobile: 360,\n\t},\n\tpagination: {\n\t\tdefaultPageSize: 25,\n\t\tdefaultSortColumn: 'createdAt',\n\t\tdefaultSortDirection: 'desc',\n\t},\n\tsiteConfig: {\n\t\tcolor: {\n\t\t\tprimary: '#000000',\n\t\t\tsecondary: '#c3c3c3',\n\t\t\ttext: '#303030',\n\t\t\taltText: '#FFFFFF',\n\t\t\ticon: '#000000',\n\t\t},\n\t},\n\tcolor: {\n\t\tprimary: {\n\t\t\tblack: '#303030',\n\t\t\thover_black: '#74798C',\n\t\t\tgrey: '#C7C9D1',\n\t\t\tblue: '#4A90E2',\n\t\t\tgreen: '#6fb265',\n\t\t\thover_blue: '#E6F1FF',\n\t\t\tborder_color: '#d0d0d0',\n\t\t\twhite: '#FFFFFF',\n\t\t\twarning: '#FF0000',\n\t\t\twarning_pink: '#F06D82',\n\t\t\tcyan: '#4ABACC',\n\t\t\tactive_blue: '#008bff',\n\t\t\tbottom_divider: '#C4CDD5',\n\t\t\tlight_gray: '#D5D5D5',\n\t\t\tvlight_gray: '#EBEBEB',\n\t\t\txlight_gray: '#EDEDED',\n\t\t\tdark_grey: '#858585',\n\t\t\tlight_black: '#454F5B',\n\t\t},\n\t\tshadow: {\n\t\t\tvlight_gray: '#E0E0E0',\n\t\t\tdark_grey: '#141414',\n\t\t},\n\t\tsecondary: {\n\t\t\tviolet: '#33DBEE',\n\t\t\thover_violet: '#6589C6',\n\t\t\tpink: '#F0569C',\n\t\t},\n\t\tbackground: {\n\t\t\tgrey: '#F5F7FA',\n\t\t\tdark_grey: '#979797',\n\t\t\tsoft_blue: '#819DF5',\n\t\t\tvery_pale: '#F3F9FF',\n\t\t\trates: '#e0edff',\n\t\t\tlanding_rates: '#4a90e2',\n\t\t\tlight_grayish_blue: '#E5E7EC',\n\t\t\tlight_gray: '#D5D5D5',\n\t\t\twhite: '#FFFFFF',\n\t\t\twarning: '#FF0000',\n\t\t\tblue: '#1E88E5',\n\t\t\tantiqueBlue: '#46637A',\n\t\t},\n\t\tborder: {\n\t\t\tgrey_blue: '#DDE7F2',\n\t\t\tsoft_blue: '#819DF5',\n\t\t\tgrayish_blue: '#BFC0C1',\n\t\t\tactive_blue: '#4A90E2',\n\t\t\tbottom_divider: '#C4CDD5',\n\t\t\tlight_gray: '#D5D5D5',\n\t\t\tvlight_gray: '#EBEBEB',\n\t\t\tblue: '#5099EE',\n\t\t\tcyan: '#4ACCBE',\n\t\t\tdark_grey: '#979797',\n\t\t},\n\t\tlanding: {\n\t\t\tbg_color: '#eaf1fb',\n\t\t\ttext: '#282d30',\n\t\t},\n\t\tnotification: '#F06D82',\n\t\tdisabled: '#a8aeaf',\n\t},\n\tsearch: {\n\t\tdebounce: 500,\n\t},\n\tborderRadius: 8,\n\tbutton: {\n\t\tdisabled: '#efefef',\n\t\tactive_blue: '#008bff',\n\t},\n\tstorageKeys: {\n\t\taccount: '@tbp:account',\n\t\tuser: '@tbp:user',\n\t\tsiteConfig: '@tbp:siteConfig',\n\t\tauthToken: '@tbp:token',\n\t\tauthTokenExp: '@tbp:tokenExp',\n\t\tpleaseWaitMessage: '@tbp:pleaseWaitMessage',\n\t\tinfoMessage: '@tbp:infoMessage',\n\t\terrorMessage: '@tbp:errorMessage',\n\t\tsuccessMessage: '@tbp:successMessage',\n\t\terrorObject: '@tbp:errorObject',\n\t\tsuccessObject: '@tbp:successObject',\n\t\tinfoObject: '@tbp:successObject',\n\t\tloanDraft: '@tbp:loanDraft',\n\t\tloanId: '@tbp:loanId',\n\t\tloanData: '@tbp:loanData',\n\t\tloanTasks: '@tbp:loanTasks',\n\t\tloanDocs: '@tbp:loanDocs',\n\t\tdocument: '@tbp:document',\n\t\ttempPassword: '@tbp:maybe',\n\t\tredirectRoute: '@tbp:redirectRoute',\n\t\teditingLoanApplicationId: '@tbp:editingLoanApplicationId',\n\t\teditingLoanOfficerId: '@tbp:editingLoanOfficerId',\n\t\teditingLoanOfficerSiteConfigurationId:\n\t\t\t'@tbp:editingLoanOfficerSiteConfigurationId',\n\t\teditingBranchId: '@tbp:editingBranchId',\n\t\teditingBranchSiteConfigurationId:\n\t\t\t'@tbp:editingBranchSiteConfigurationId',\n\t\teditingCorporateId: '@tbp:editingCorporateId',\n\t\teditingCorporateSiteConfigurationId:\n\t\t\t'@tbp:editingCorporateSiteConfigurationId',\n\t\teditingAccountId: '@tbp:editingAccountId',\n\t\teditingWorkflowId: '@tbp:editingWorkflowId',\n\t\tviewingLoanApplicationId: '@tbp:editingLoanApplicationId',\n\t\teditingLeadId: '@tbp:editingLeadId',\n\t\teditingOpenHouseId: '@tbp:editingOpenHouseId',\n\t\tviewingRuleId: '@tbp:viewingRuleId',\n\t\teditingRuleId: '@tbp:editingRuleId',\n\t\teditingTaskId: '@tbp:editingTaskId',\n\t\teditingPartnerId: '@tbp:editingPartnerId',\n\t\teditingPartnerSiteConfigurationId:\n\t\t\t'@tbp:editingPartnerSiteConfigurationId',\n\t\tappSubmitted: '@tbp:appSubmitted',\n\t\tappPosting: '@tbp:appPosting',\n\t\tappPosted: '@tbp:appPosted',\n\t\tfailoverModalVisible: '@tbp:failoverModalVisible',\n\t\tappFailed: '@tbp:appFailed',\n\t\tinviteCoBorrower: '@tbp:inviteCoBorrower',\n\t\tnewUser: '@tbp:newUser',\n\t\tfailedUser: '@tbp:failedUser',\n\t\tinvite: '@tbp:invite',\n\t\tpublicRates: '@tbp:publicRates',\n\t\tloanRates: '@tbp:loanRates',\n\t\tsocialLinks: '@tbp:socialLinks',\n\t\tlegalLinks: '@tbp:legalLinks',\n\t\tssoToken: '@tbp:ssoToken',\n\t\tdisclosurePackageInfo: '@tbp:disclosurePackageInfo',\n\t\tverificationRequestId: '@tbp:verificationRequestId',\n\t\tcoBorrowerRoute: '@tbp:coBorrowerRoute',\n\t\tcoBorrowerSubmitted: '@tbp:coBorrowerSubmitted',\n\t\teditingNotificationTemplateId:\n\t\t\t'@tbp:editingNotificationTemplateId',\n\t\teditingDocumentTemplateId: '@tbp:editingDocumentTemplateId',\n\t\tpostLoanData: '@tbp:postLoanData',\n\t\teditingDeviceId: '@tbp:editingDeviceId',\n\t\tisFirstLoad: '@tbp:isFirstLoad',\n\t\tloanOfficer: '@tbp:loanOfficer',\n\t},\n\tsupport: {\n\t\temail: 'support@thebigpos.com',\n\t\tphone: '(833) 327-9767',\n\t\twebsite: 'support.thebigpos.com',\n\t},\n\tgoogle: {\n\t\tapiKey: 'AIzaSyCeVODEpDP_qw8hMYiHS3834gfvZVTOcr4',\n\t\tregion: 'us',\n\t\tlanguage: 'en',\n\t\tplaces: {\n\t\t\turl: 'https://eas-cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api',\n\t\t},\n\t},\n\tmodal: {\n\t\tleavePageText:\n\t\t\t'You have unsaved changes. Navigating away from this page will result in the loss of these changes. Do you wish to proceed?',\n\t\toverwriteText:\n\t\t\t'The record has been changed since it was loaded. Your changes may overwrite the previous update. Are you sure you want to save?',\n\t\tlicensesText:\n\t\t\t'There are no licensed states selected. This site will not be able to accept applications. Do you wish to proceed?',\n\t\tleaveApplyPrequalifyPageText:\n\t\t\t\"Are you sure you want to leave this page? You will lose all data you've entered.\",\n\t},\n\tapi_messages: {\n\t\tserver_error:\n\t\t\t'There was an error processing the request. Please contact your administrator.',\n\t},\n\troles: [\n\t\t'Borrower', // 0\n\t\t'LoanOfficer', // 1\n\t\t'Admin', // 2\n\t\t'Co-Borrower', // 3\n\t\t'Realtor', // 4\n\t\t\"Loan Officer's Assistant\", // 5\n\t\t'Closer', // 6,\n\t\t'Post Closer', // 7\n\t\t'Buyer Agent', // 8\n\t\t'Listing Agent', // 9\n\t\t'Settlement Agent', // 10\n\t\t'Escrow Agent', // 11\n\t\t'Title Company', // 12,\n\t\t'Buyers Attorney', // 13\n\t\t'Sellers Attorney', // 14\n\t\t'Appraisal Management Company', // 15\n\t\t'Insurance Agent', // 16\n\t\t'Branch Manager', // 17\n\t],\n\ttaskTypes: [\n\t\t'Document',\n\t\t'Field',\n\t\t'E-Signature',\n\t\t'Disclosure',\n\t\t'Electronic Consent',\n\t\t'VOA',\n\t\t'VOI',\n\t\t'VOE',\n\t\t'VOC',\n\t\t'Payment',\n\t\t'VOIE',\n\t\t'IRS ID.ME',\n\t],\n\ttaskButtonTitles: [\n\t\t'Upload',\n\t\t'Answer',\n\t\t'Sign',\n\t\t'Sign',\n\t\t'Give Consent',\n\t\t'Verify',\n\t\t'Verify',\n\t\t'Verify',\n\t\t'Verify',\n\t\t'Make Payment',\n\t\t'Verify',\n\t\t'Verify',\n\t],\n\tsideMenu: 'open',\n\topenDocFolders: '',\n}\n\nexport const getTheme = () => theme\n\nexport const setThemeColorsAndImages = (siteConfig = {}) => {\n\ttheme.siteConfig.color.primary =\n\t\tsiteConfig.primaryColor || theme.siteConfig.color.primary\n\ttheme.siteConfig.color.secondary =\n\t\tsiteConfig.secondaryColor || theme.siteConfig.color.secondary\n\ttheme.siteConfig.color.text =\n\t\tsiteConfig.textColor || theme.siteConfig.color.text\n\ttheme.siteConfig.color.icon =\n\t\tsiteConfig.iconColor || theme.siteConfig.color.icon\n\ttheme.siteConfig.color.background =\n\t\tsiteConfig.backgroundColor || theme.siteConfig.color.background\n\ttheme.siteConfig.backgroundImage =\n\t\tsiteConfig.backgroundImageUrl || theme.siteConfig.backgroundImage\n}\n\nexport const setFavicon = (icon) => {\n\ticon &&\n\t\tdocument\n\t\t\t.querySelectorAll('link[rel=\"icon\"]')\n\t\t\t.forEach((item) => item.setAttribute('href', icon))\n\ticon &&\n\t\tdocument\n\t\t\t.querySelectorAll('link[rel=\"shortcut icon\"]')\n\t\t\t.forEach((item) => item.setAttribute('href', icon))\n}\n\nexport const setTitle = (title) => {\n\tif (title) document.title = title\n}\n\nconst logging = {\n\tsentryDSN:\n\t\tprocess.env.REACT_APP_SENTRY_DSN ||\n\t\t'https://d6286e162ded29df79a965709a885a82@o4506717415145472.ingest.sentry.io/4506717420716032',\n}\n\nconst exp = {\n\tgetTheme,\n\tsetTitle,\n\tsetFavicon,\n\ttheme,\n\tlogging,\n}\n\nexport default exp\n","import React from 'react'\nimport Form from '../components/formControls/Form'\nimport * as yup from 'yup'\nimport useForm from '../hooks/useForm'\nimport { Switch, TextField } from '../components/formControls'\nimport { LoadingBtn } from '../components/Button'\nimport { Button } from '@mui/material'\nimport { useFormContext, useWatch } from 'react-hook-form'\n\nconst NewVersionForm = ({\n\tonSubmit,\n\tonCancel = null,\n\tloading = false,\n\tcodeEditorName,\n\ttemplateType,\n}) => {\n\tconst schema = yup.object().shape({\n\t\tname: yup.string().required('Name is required'),\n\t})\n\n\tconst { control: templateFormControl } = useFormContext()\n\n\tlet plainBody,\n\t\ttextBody = ''\n\tconst code = useWatch({\n\t\ttemplateFormControl,\n\t\tname: codeEditorName,\n\t})\n\n\tif (templateType === 'notification') {\n\t\tplainBody = useWatch({\n\t\t\ttemplateFormControl,\n\t\t\tname: 'plainBody',\n\t\t})\n\t\ttextBody = useWatch({\n\t\t\ttemplateFormControl,\n\t\t\tname: 'textBody',\n\t\t})\n\t}\n\n\tconst form = useForm({\n\t\tschema,\n\t\tvalues: {\n\t\t\tname: '',\n\t\t\tisActive: false,\n\t\t\tcode: codeEditorName ? code : '',\n\t\t\tplainBody,\n\t\t\ttextBody,\n\t\t},\n\t\tresetOptions: {\n\t\t\tkeepDirtyValues: true,\n\t\t},\n\t})\n\n\tconst {\n\t\thandleSubmit,\n\t\tformState: { errors },\n\t\tcontrol,\n\t} = form\n\n\tconst submitForm = async (data) => {\n\t\tawait onSubmit(data)\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t\t
    \n\t\t\t\t{onCancel && (\n\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t)}\n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\t)\n}\n\nexport default NewVersionForm\n","import { useCallback } from 'react'\nimport { noop } from 'lodash'\nimport { useAlertsDispatch } from '../components/Alerts/AlertsContext'\nimport { alertsActions } from '../components/Alerts/AlertsReducer'\n\nconst defaultState = { dispatch: noop }\n\nexport function useAlert() {\n\tconst { dispatch } = useAlertsDispatch() ?? defaultState\n\n\t/**\n\t * @param {string} - text\n\t * param {object} - options\n\t * \talert(text, { severity: \"success\" })\n\t * \talert(text, { severity: \"warning\" })\n\t * \talert(text, { severity: \"info\" })\n\t * \talert(text, { severity: \"error\" })\n\t */\n\tconst alert = useCallback(\n\t\t(text, options = {}) => {\n\t\t\tdispatch({\n\t\t\t\ttype: alertsActions.add,\n\t\t\t\tpayload: { text, ...options },\n\t\t\t})\n\t\t},\n\t\t[dispatch]\n\t)\n\n\tconst remove = useCallback(\n\t\t(id) => {\n\t\t\tdispatch({ type: alertsActions.remove, payload: id })\n\t\t},\n\t\t[dispatch]\n\t)\n\n\tconst clear = useCallback(\n\t\t(id) => {\n\t\t\tdispatch({ type: alertsActions.clear })\n\t\t},\n\t\t[dispatch]\n\t)\n\n\treturn {\n\t\talert,\n\t\tremove,\n\t\tclear,\n\t}\n}\n","import { useLayoutEffect, useState } from 'react'\n\nexport function useWindowSize() {\n\tconst [size, setSize] = useState([0, 0])\n\n\tuseLayoutEffect(() => {\n\t\tfunction updateSize() {\n\t\t\tsetSize([window.innerWidth, window.innerHeight])\n\t\t}\n\n\t\twindow.addEventListener('resize', updateSize)\n\n\t\tupdateSize()\n\n\t\treturn () => window.removeEventListener('resize', updateSize)\n\t}, [])\n\n\treturn size\n}\n","import { useEffect, useState, useReducer } from 'react'\nimport { isDarkMode } from '../services/helper'\nimport {\n\tsetThemeColorsAndImages,\n\tsetFavicon,\n\tsetTitle,\n} from '../config'\nimport {\n\tfaFacebookF,\n\tfaXTwitter,\n\tfaInstagram,\n\tfaLinkedin,\n} from '@fortawesome/free-brands-svg-icons'\nimport {\n\tTheBigPOSApi,\n\tsetSiteConfiguration as setPOSApiSiteConfiguration,\n} from '../lib/TheBigPOSClient'\nimport { FormattedMessage, useIntl } from 'react-intl'\n\nconst initialState = {\n\tsiteConfig: null,\n\tsocialLinks: null,\n\tlegalLinks: null,\n\terrorStatus: null,\n}\n\nexport function useSiteConfig() {\n\tconst [state, dispatch] = useReducer(reducer, initialState, init)\n\tconst [isLoading, setIsLoading] = useState(true)\n\tconst { getSiteConfigurationByUrl } = TheBigPOSApi\n\tconst { formatMessage } = useIntl()\n\n\tuseEffect(() => {\n\t\tconst currentUrl =\n\t\t\twindow.location.hostname === 'localhost' ||\n\t\t\twindow.location.hostname.includes('ngrok-free')\n\t\t\t\t? process.env.REACT_APP_LOCALHOST_ALIAS\n\t\t\t\t: window.location.hostname\n\t\tgetSiteConfigurationByUrl({ url: currentUrl })\n\t\t\t.then((res) => {\n\t\t\t\tconst siteConfig = res.data\n\t\t\t\tsetPOSApiSiteConfiguration(siteConfig.id)\n\t\t\t\tsetThemeColorsAndImages(siteConfig)\n\t\t\t\tsetFavicon(\n\t\t\t\t\tisDarkMode() && siteConfig.darkModeIconUrl\n\t\t\t\t\t\t? siteConfig.darkModeIconUrl\n\t\t\t\t\t\t: siteConfig.iconUrl\n\t\t\t\t)\n\t\t\t\tsetTitle(siteConfig.name)\n\n\t\t\t\t// Set Social Links\n\t\t\t\tconst socialLinks = []\n\t\t\t\tif (siteConfig.facebookUrl)\n\t\t\t\t\tsocialLinks.push({\n\t\t\t\t\t\tlinkItem: 'Facebook',\n\t\t\t\t\t\tlink: siteConfig.facebookUrl,\n\t\t\t\t\t\ticon: faFacebookF,\n\t\t\t\t\t})\n\t\t\t\tif (siteConfig.twitterUrl)\n\t\t\t\t\tsocialLinks.push({\n\t\t\t\t\t\tlinkItem: 'Twitter',\n\t\t\t\t\t\tlink: siteConfig.twitterUrl,\n\t\t\t\t\t\ticon: faXTwitter,\n\t\t\t\t\t})\n\t\t\t\tif (siteConfig.instagramUrl)\n\t\t\t\t\tsocialLinks.push({\n\t\t\t\t\t\tlinkItem: 'Instagram',\n\t\t\t\t\t\tlink: siteConfig.instagramUrl,\n\t\t\t\t\t\ticon: faInstagram,\n\t\t\t\t\t})\n\t\t\t\tif (siteConfig.linkedInUrl)\n\t\t\t\t\tsocialLinks.push({\n\t\t\t\t\t\tlinkItem: 'LinkedIn',\n\t\t\t\t\t\tlink: siteConfig.linkedInUrl,\n\t\t\t\t\t\ticon: faLinkedin,\n\t\t\t\t\t})\n\n\t\t\t\t// Set Legal Links\n\t\t\t\tconst legalLinks = []\n\t\t\t\tif (siteConfig.companyUrl)\n\t\t\t\t\tlegalLinks.push({\n\t\t\t\t\t\tlinkItem: formatMessage({\n\t\t\t\t\t\t\tid: 'legal.website',\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tlink: siteConfig.companyUrl,\n\t\t\t\t\t})\n\t\t\t\tif (siteConfig.contactUsUrl)\n\t\t\t\t\tlegalLinks.push({\n\t\t\t\t\t\tlinkItem: formatMessage({\n\t\t\t\t\t\t\tid: 'legal.contact_us',\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tlink: siteConfig.contactUsUrl,\n\t\t\t\t\t})\n\t\t\t\tif (siteConfig.privacyPolicyUrl)\n\t\t\t\t\tlegalLinks.push({\n\t\t\t\t\t\tlinkItem: formatMessage({\n\t\t\t\t\t\t\tid: 'legal.privacy_policy',\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tlink: siteConfig.privacyPolicyUrl,\n\t\t\t\t\t})\n\t\t\t\tif (siteConfig.termsUrl)\n\t\t\t\t\tlegalLinks.push({\n\t\t\t\t\t\tlinkItem: formatMessage({\n\t\t\t\t\t\t\tid: 'legal.terms',\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tlink: siteConfig.termsUrl,\n\t\t\t\t\t})\n\t\t\t\tif (siteConfig.licenseInfoUrl)\n\t\t\t\t\tlegalLinks.push({\n\t\t\t\t\t\tlinkItem: formatMessage({\n\t\t\t\t\t\t\tid: 'legal.license_info',\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tlink: siteConfig.licenseInfoUrl,\n\t\t\t\t\t})\n\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: 'setSiteConfig',\n\t\t\t\t\tpayload: { siteConfig, socialLinks, legalLinks },\n\t\t\t\t})\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: 'setSiteConfig',\n\t\t\t\t\tpayload: {\n\t\t\t\t\t\terrorStatus: err?.status,\n\t\t\t\t\t\tsiteConfig: null,\n\t\t\t\t\t\tsocialLinks: null,\n\t\t\t\t\t\tlegalLinks: null,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tsetIsLoading(false)\n\t\t\t})\n\t}, [])\n\n\treturn {\n\t\tsiteConfig: state.siteConfig,\n\t\tsocialLinks: state.socialLinks,\n\t\tlegalLinks: state.legalLinks,\n\t\tisLoading,\n\t\terrorStatus: state.errorStatus,\n\t}\n}\n\nfunction init() {\n\treturn initialState\n}\n\nfunction reducer(state, action) {\n\tswitch (action.type) {\n\t\tcase 'setSiteConfig':\n\t\t\treturn {\n\t\t\t\tsiteConfig: action.payload.siteConfig,\n\t\t\t\tsocialLinks: action.payload.socialLinks,\n\t\t\t\tlegalLinks: action.payload.legalLinks,\n\t\t\t\terrorStatus: action.payload.errorStatus,\n\t\t\t}\n\t\tdefault:\n\t\t\tthrow new Error()\n\t}\n}\n","import {\n FieldError,\n FieldErrors,\n FieldValues,\n Ref,\n ResolverOptions,\n get,\n} from 'react-hook-form';\n\nconst setCustomValidity = (\n ref: Ref,\n fieldPath: string,\n errors: FieldErrors,\n) => {\n if (ref && 'reportValidity' in ref) {\n const error = get(errors, fieldPath) as FieldError | undefined;\n ref.setCustomValidity((error && error.message) || '');\n\n ref.reportValidity();\n }\n};\n\n// Native validation (web only)\nexport const validateFieldsNatively = (\n errors: FieldErrors,\n options: ResolverOptions,\n): void => {\n for (const fieldPath in options.fields) {\n const field = options.fields[fieldPath];\n if (field && field.ref && 'reportValidity' in field.ref) {\n setCustomValidity(field.ref, fieldPath, errors);\n } else if (field.refs) {\n field.refs.forEach((ref: HTMLInputElement) =>\n setCustomValidity(ref, fieldPath, errors),\n );\n }\n }\n};\n","import {\n Field,\n FieldErrors,\n FieldValues,\n InternalFieldName,\n ResolverOptions,\n get,\n set,\n} from 'react-hook-form';\nimport { validateFieldsNatively } from './validateFieldsNatively';\n\nexport const toNestErrors = (\n errors: FieldErrors,\n options: ResolverOptions,\n): FieldErrors => {\n options.shouldUseNativeValidation && validateFieldsNatively(errors, options);\n\n const fieldErrors = {} as FieldErrors;\n for (const path in errors) {\n const field = get(options.fields, path) as Field['_f'] | undefined;\n const error = Object.assign(errors[path] || {}, {\n ref: field && field.ref,\n });\n\n if (isNameInFieldArray(options.names || Object.keys(errors), path)) {\n const fieldArrayErrors = Object.assign({}, get(fieldErrors, path));\n\n set(fieldArrayErrors, 'root', error);\n set(fieldErrors, path, fieldArrayErrors);\n } else {\n set(fieldErrors, path, error);\n }\n }\n\n return fieldErrors;\n};\n\nconst isNameInFieldArray = (\n names: InternalFieldName[],\n name: InternalFieldName,\n) => names.some((n) => n.startsWith(name + '.'));\n","import { toNestErrors, validateFieldsNatively } from '@hookform/resolvers';\nimport {\n FieldError,\n FieldValues,\n Resolver,\n appendErrors,\n} from 'react-hook-form';\nimport * as Yup from 'yup';\n\n/**\n * Why `path!` ? because it could be `undefined` in some case\n * https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n */\nconst parseErrorSchema = (\n error: Yup.ValidationError,\n validateAllFieldCriteria: boolean,\n) => {\n return (error.inner || []).reduce>(\n (previous, error) => {\n if (!previous[error.path!]) {\n previous[error.path!] = { message: error.message, type: error.type! };\n }\n\n if (validateAllFieldCriteria) {\n const types = previous[error.path!].types;\n const messages = types && types[error.type!];\n\n previous[error.path!] = appendErrors(\n error.path!,\n validateAllFieldCriteria,\n previous,\n error.type!,\n messages\n ? ([] as string[]).concat(messages as string[], error.message)\n : error.message,\n ) as FieldError;\n }\n\n return previous;\n },\n {},\n );\n};\n\nexport function yupResolver(\n schema:\n | Yup.ObjectSchema\n | ReturnType>>,\n schemaOptions: Parameters<(typeof schema)['validate']>[1] = {},\n resolverOptions: {\n /**\n * @default async\n */\n mode?: 'async' | 'sync';\n /**\n * Return the raw input values rather than the parsed values.\n * @default false\n */\n raw?: boolean;\n } = {},\n): Resolver> {\n return async (values, context, options) => {\n try {\n if (schemaOptions.context && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n \"You should not used the yup options context. Please, use the 'useForm' context object instead\",\n );\n }\n\n const result = await schema[\n resolverOptions.mode === 'sync' ? 'validateSync' : 'validate'\n ](\n values,\n Object.assign({ abortEarly: false }, schemaOptions, { context }),\n );\n\n options.shouldUseNativeValidation && validateFieldsNatively({}, options);\n\n return {\n values: resolverOptions.raw ? values : result,\n errors: {},\n };\n } catch (e: any) {\n if (!e.inner) {\n throw e;\n }\n\n return {\n values: {},\n errors: toNestErrors(\n parseErrorSchema(\n e,\n !options.shouldUseNativeValidation &&\n options.criteriaMode === 'all',\n ),\n options,\n ),\n };\n }\n };\n}\n","import type {\n\tFieldValues,\n\tUseFormProps,\n\tUseFormReturn,\n} from 'react-hook-form'\nimport { useForm as reactHookUseForm } from 'react-hook-form'\nimport * as yup from 'yup'\nimport { yupResolver } from '@hookform/resolvers/yup'\n\nexport type ExtendedUseFormProps<\n\tT extends FieldValues = FieldValues,\n> = UseFormProps & {\n\tschema?: yup.AnyObjectSchema\n}\n\nexport type ExtendedUseFormReturn<\n\tT extends FieldValues = FieldValues,\n> = UseFormReturn & {\n\tschema?: yup.AnyObjectSchema\n}\n\nconst useForm = ({\n\tschema,\n\tmode = 'onBlur',\n\treValidateMode = 'onChange',\n\t...rest\n}: ExtendedUseFormProps): ExtendedUseFormReturn => {\n\treturn reactHookUseForm({\n\t\tresolver: schema ? yupResolver(schema) : undefined,\n\t\tmode,\n\t\treValidateMode,\n\t\t...rest,\n\t})\n}\n\nexport default useForm\n","import { get } from 'lodash'\n\nconst useFormField = () => {\n\tconst getError = (name, errors) => {\n\t\treturn errors ? get(errors, name) : undefined\n\t}\n\n\treturn {\n\t\tgetError,\n\t}\n}\n\nexport default useFormField\n","import { useCallback, useEffect, useState } from 'react'\n\nconst useLoanStatus = ({ loan }) => {\n\tconst { milestones } = loan\n\tconst [activeStep, setActiveStep] = useState(-1)\n\tconst [lastCompletedMilestone, setLastCompletedMilestone] =\n\t\tuseState(null)\n\tconst [nextMilestone, setNextMilestone] = useState(null)\n\n\tuseEffect(() => {\n\t\tlet lastCompletedStep = -1\n\t\tmilestones.forEach((milestone, i) => {\n\t\t\tif (milestone.completed) {\n\t\t\t\tlastCompletedStep = i\n\t\t\t}\n\t\t\tif (lastCompletedStep > -1) {\n\t\t\t\tsetLastCompletedMilestone(milestones[lastCompletedStep])\n\t\t\t\tsetActiveStep(lastCompletedStep)\n\t\t\t}\n\t\t\tconst nextStep = lastCompletedStep + 1\n\t\t\tsetActiveStep(nextStep)\n\t\t\tif (nextStep < milestones.length) {\n\t\t\t\tsetNextMilestone(milestones[nextStep])\n\t\t\t} else {\n\t\t\t\tsetNextMilestone(null)\n\t\t\t}\n\t\t})\n\t}, [milestones])\n\n\tconst getMonthlyPaymentChartData = useCallback(() => {\n\t\tconst chartProps = {\n\t\t\tMonthlyPaymentAmount: 'Monthly Payment',\n\t\t\tMonthlyPaymentTaxes: 'Taxes',\n\t\t\tMonthlyPaymentHOA: 'HOA',\n\t\t\tMonthlyPaymentInsurance: 'Insurance',\n\t\t\tMonthlyPaymentMortgageInsurance: 'Mortgage Insurance',\n\t\t}\n\t\tconst data = []\n\t\tObject.keys(chartProps).forEach((prop) => {\n\t\t\tdata.push(loan[prop] ? parseNumberString(loan[prop]) : 0)\n\t\t})\n\n\t\treturn {\n\t\t\tlabels: Object.values(chartProps),\n\t\t\tdatasets: [\n\t\t\t\t{\n\t\t\t\t\tdata,\n\t\t\t\t\tbackgroundColor: [\n\t\t\t\t\t\t'#0073c7',\n\t\t\t\t\t\t'#FF4069',\n\t\t\t\t\t\t'#FF9F40',\n\t\t\t\t\t\t'#FFCD56',\n\t\t\t\t\t\t'#4BC0C0',\n\t\t\t\t\t\t'#36A2EB',\n\t\t\t\t\t],\n\t\t\t\t\tborderColor: [\n\t\t\t\t\t\t'#005288',\n\t\t\t\t\t\t'#dc2850',\n\t\t\t\t\t\t'#d07d2b',\n\t\t\t\t\t\t'#dcac3a',\n\t\t\t\t\t\t'#35a9a9',\n\t\t\t\t\t\t'#2887c7',\n\t\t\t\t\t],\n\t\t\t\t\tborderWidth: 1,\n\t\t\t\t},\n\t\t\t],\n\t\t\ttotalMonthlyPayment: parseNumberString(\n\t\t\t\tloan.MonthlyPaymentPrincipalInterest\n\t\t\t),\n\t\t}\n\t}, [loan])\n\n\tconst parseNumberString = (str) => {\n\t\treturn str ? parseFloat(str.replace(/,/g, '')) : null\n\t}\n\n\treturn {\n\t\tactiveStep,\n\t\tlastCompletedMilestone,\n\t\tnextMilestone,\n\t\tgetMonthlyPaymentChartData,\n\t}\n}\n\nexport default useLoanStatus\n","import { useContext } from 'react'\nimport { MixpanelContext } from '../components/MixPanel/MixPanelProvider'\n\nexport const useMixpanel = () => {\n\tconst mixpanel = useContext(MixpanelContext)\n\n\tconst trackEvent = (eventName, properties) => {\n\t\ttry {\n\t\t\tmixpanel?.track(eventName, properties)\n\t\t} catch (error) {\n\t\t\tconsole.error(`Mixpanel Tracking Error: ${error}`)\n\t\t}\n\t}\n\n\tconst identifyAndSetUser = (me, siteConfig) => {\n\t\tlet { id, firstName, lastName, role, email, accountID } = me\n\t\ttry {\n\t\t\tmixpanel?.identify(id)\n\t\t\tmixpanel?.people?.set({\n\t\t\t\t$first_name: firstName,\n\t\t\t\t$last_name: lastName,\n\t\t\t\t$email: email,\n\t\t\t\t$id: id,\n\t\t\t\t$role: role,\n\t\t\t\t$siteConfigId: siteConfig.id,\n\t\t\t\t$siteConfigName: siteConfig.name,\n\t\t\t\t$accountID: accountID,\n\t\t\t})\n\t\t} catch (error) {\n\t\t\tconsole.error(`Mixpanel Identification Error: ${error}`)\n\t\t}\n\t}\n\n\tconst reset = () => {\n\t\ttry {\n\t\t\tmixpanel?.reset()\n\t\t} catch (error) {\n\t\t\tconsole.error(`Mixpanel Reset Error: ${error}`)\n\t\t}\n\t}\n\n\treturn { trackEvent, identifyAndSetUser, reset }\n}\n","import { useState } from 'react'\nimport { TableColumn } from 'react-data-table-component'\nimport { tableRowsPerPageOptions } from '../services/utils'\n\ntype UsePaginationProps = {\n\tdefaultSortBy: string\n\tdefaultSortDirection: 'asc' | 'desc'\n}\nconst usePagination = ({\n\tdefaultSortBy,\n\tdefaultSortDirection,\n}: UsePaginationProps) => {\n\tconst [pageNumber, setPageNumber] = useState(1)\n\tconst [pageSize, setPageSize] = useState(tableRowsPerPageOptions[0])\n\tconst [sortBy, setSortBy] = useState(defaultSortBy)\n\tconst [sortDirection, setSortDirection] = useState<'asc' | 'desc'>(\n\t\tdefaultSortDirection\n\t)\n\n\tconst handlePageChange = (pageNumber: number) => {\n\t\tsetPageNumber(pageNumber)\n\t}\n\n\tconst handleRowsPerPageChange = (\n\t\tnewPageSize: number,\n\t\tpageNumber: number\n\t) => {\n\t\tsetPageSize(newPageSize)\n\t\tsetPageNumber(pageNumber)\n\t}\n\n\tconst handleSort = (\n\t\tcolumn: TableColumn,\n\t\tdirection: 'asc' | 'desc'\n\t) => {\n\t\tsetSortBy(column?.sortField || defaultSortBy)\n\t\tsetSortDirection(direction)\n\t}\n\n\treturn {\n\t\tpageNumber,\n\t\tsortBy,\n\t\tsortDirection,\n\t\tpageSize,\n\t\thandleSort,\n\t\thandlePageChange,\n\t\thandleRowsPerPageChange,\n\t}\n}\n\nexport default usePagination\n","import { debounce } from 'lodash'\nimport React, { useEffect, useState } from 'react'\nimport { getTheme } from '../config'\n\ntype UseSearchProps = {\n\tonFetch?: () => void | undefined\n}\n\nconst theme = getTheme()\n\nconst useSearch = ({ onFetch }: UseSearchProps) => {\n\tconst [searchText, setSearchText] = useState('')\n\tconst { debounce: debounceWait } = theme.search\n\n\tconst handleSearchChange = (\n\t\te: React.ChangeEvent\n\t) => setSearchText(e.target.value)\n\n\tconst handleClearSearchClick = () => setSearchText('')\n\n\tconst searchRefetch = debounce(() => {\n\t\tif (onFetch) {\n\t\t\tonFetch()\n\t\t}\n\t}, debounceWait)\n\n\tuseEffect(() => {\n\t\tsearchRefetch()\n\t}, [searchText, onFetch, searchRefetch])\n\n\treturn {\n\t\tsearchText,\n\t\thandleSearchChange,\n\t\thandleClearSearchClick,\n\t}\n}\n\nexport default useSearch\n","import { debounce } from 'lodash'\nimport { getTheme } from '../config'\nimport { useEffect, useState } from 'react'\n\nconst theme = getTheme()\n\nconst useSearchText = ({ onFetch = undefined }) => {\n\tconst [searchText, setSearchText] = useState('')\n\tconst { debounce: debounceWait } = theme.search\n\n\tconst onChange = (e) => {\n\t\tsetSearchText(e.target.value)\n\t}\n\n\tconst onClear = () => {\n\t\tsetSearchText('')\n\t}\n\n\tconst searchRefetch = debounce(() => {\n\t\tif (onFetch) {\n\t\t\tonFetch()\n\t\t}\n\t}, debounceWait)\n\n\tuseEffect(() => {\n\t\tsearchRefetch()\n\t}, [searchText, onFetch])\n\n\treturn {\n\t\tsearchText,\n\t\tonChange,\n\t\tonClear,\n\t}\n}\n\nexport default useSearchText\n","/* eslint-disable camelcase, no-param-reassign */\nimport { useVenti } from 'venti'\nimport { useLocation, useNavigate } from 'react-router-dom'\nimport { useMemo } from 'react'\nimport { UpdateMeRequest } from '@matech/thebigpos-sdk'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { useAppContext } from '../components/AppContext'\nimport { getRouteFromInvite } from '../services/utils'\nimport { navigationLinking } from '../services/navigation'\nimport { Roles } from '../services/client'\nimport { useAppContextActions } from '../components/AppContext/AppHooks'\nimport { getTheme } from '../config'\nimport { useMixpanel } from './useMixpanel'\nimport {\n\tTheBigPOSApi,\n\tsetBearerToken as setPOSApiBearerToken,\n} from '../lib/TheBigPOSClient'\nimport {\n\tAppContextState,\n\tAuthData,\n\tLoanData,\n\tUserWithAuth,\n} from '../types'\nimport queryKeys from '../services/queryKeys'\n\nconst theme = getTheme()\nconst useUser = () => {\n\tconst adminRoles = useMemo(\n\t\t() => [Roles.admin, Roles.superAdmin],\n\t\t[]\n\t)\n\tconst { state } = useAppContext()\n\tconst { applyAuthToken, applyUser } = useAppContextActions()\n\tconst ventiState = useVenti()\n\tconst {\n\t\tuser: currentUser,\n\t\tsiteConfig,\n\t\tredirectRoute,\n\t\tinvite,\n\t} = state as unknown as AppContextState\n\tconst isLoggedIn: boolean = currentUser?.isLoggedIn || false\n\tconst navigate = useNavigate()\n\tconst location = useLocation()\n\tconst mixpanel = useMixpanel()\n\tconst queryClient = useQueryClient()\n\n\tconst postLoanData: LoanData =\n\t\tventiState.get(theme.storageKeys.postLoanData) || {}\n\n\tconst getSignInRedirectURL = (user?: UserWithAuth) => {\n\t\tif (location.state?.from) {\n\t\t\treturn location.state.from\n\t\t}\n\n\t\tconst signInUser = user || currentUser\n\t\tlet redirectRouteFromSignIn =\n\t\t\tredirectRoute || navigationLinking.Portal\n\n\t\tif (invite?.emailAddress) {\n\t\t\treturn getRouteFromInvite(invite, siteConfig)\n\t\t}\n\t\tconst loRoles = [Roles.loanOfficer, Roles.branchManager]\n\t\tconst isAppRedirect =\n\t\t\tredirectRouteFromSignIn.includes('Apply') ||\n\t\t\tredirectRouteFromSignIn.includes('Prequalify')\n\t\tif (\n\t\t\tloRoles.includes(signInUser.role) &&\n\t\t\tisAppRedirect &&\n\t\t\t!redirectRouteFromSignIn.includes('LO')\n\t\t) {\n\t\t\tredirectRouteFromSignIn = `LO${redirectRouteFromSignIn}`\n\t\t}\n\n\t\tif (\n\t\t\t// @ts-ignore\n\t\t\t!navigationLinking[redirectRouteFromSignIn] ||\n\t\t\tadminRoles.includes(signInUser.role)\n\t\t) {\n\t\t\tredirectRouteFromSignIn = navigationLinking.Portal\n\t\t}\n\t\treturn `/${redirectRouteFromSignIn}`\n\t}\n\n\tconst setUser = (data: UserWithAuth) => {\n\t\tapplyUser(data)\n\t\tventiState.set(theme.storageKeys.user, data)\n\t\treturn data\n\t}\n\n\tconst setAuthToken = (token: string, expiresIn: number) => {\n\t\tsetPOSApiBearerToken(token)\n\t\tapplyAuthToken(token)\n\t\tventiState.set(theme.storageKeys.authToken, token)\n\n\t\tconst authTokenExp = new Date()\n\t\tauthTokenExp.setMinutes(\n\t\t\tauthTokenExp.getMinutes() + expiresIn / 60 - 5\n\t\t)\n\t\tventiState.set(theme.storageKeys.authTokenExp, authTokenExp)\n\t}\n\n\tconst initUser = async (\n\t\tauthData: AuthData,\n\t\tredirectOnSuccess = true\n\t) => {\n\t\tconst { access_token: token, expires_in } = authData\n\t\tsetAuthToken(token, expires_in)\n\n\t\tconst expirationInMilliseconds = expires_in * 1000\n\t\tconst tokenExp = ventiState.set(\n\t\t\ttheme.storageKeys.authTokenExp,\n\t\t\tnew Date(new Date().getTime() + expirationInMilliseconds)\n\t\t)\n\n\t\tauthData.isLoggedIn = true\n\n\t\tconst getMeResponse = await TheBigPOSApi.getMe()\n\t\tconst me = getMeResponse.data\n\t\tmixpanel.identifyAndSetUser(me, siteConfig)\n\n\t\tif (\n\t\t\t[Roles.loanOfficer, Roles.branchManager].includes(me.role) &&\n\t\t\tme.id !== siteConfig.id &&\n\t\t\t!window.location.hostname.includes('localhost')\n\t\t) {\n\t\t\tconst getLoanOfficerResponse =\n\t\t\t\tawait TheBigPOSApi.getLoanOfficer(me.id)\n\t\t\tconst loanOfficer = getLoanOfficerResponse.data\n\t\t\t// TODO: if more than one siteConfigurationurl we should show a list to choose\n\t\t\tif (\n\t\t\t\t!loanOfficer.siteConfigurations.some(\n\t\t\t\t\t(s) => s.id === siteConfig.id\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\twindow.open(\n\t\t\t\t\t`https://${loanOfficer.siteConfigurations[0].url}`,\n\t\t\t\t\t'_blank',\n\t\t\t\t\t'noopener,noreferrer'\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tauthData.tokenExp = tokenExp\n\t\tconst userData = {\n\t\t\t...authData,\n\t\t\t...me,\n\t\t}\n\n\t\tconst user = setUser(userData)\n\n\t\tif (siteConfig.mfaPreference === 'Required' && !me.mfaEnabled) {\n\t\t\tnavigate(`/${navigationLinking.SMSVerification}`)\n\t\t\treturn\n\t\t}\n\n\t\tif (redirectOnSuccess) {\n\t\t\tconst redirectURL = getSignInRedirectURL(user)\n\t\t\tnavigate(redirectURL)\n\t\t}\n\n\t\t// If there's loan data to send, send it now\n\t\tif (postLoanData.BorrowerEmail) {\n\t\t\tventiState.set(theme.storageKeys.appPosting, true)\n\t\t\tventiState.set(theme.storageKeys.appSubmitted, true)\n\t\t\tconst createLoanResponse =\n\t\t\t\tawait TheBigPOSApi.createLoan(postLoanData)\n\t\t\tconst loanId = createLoanResponse.data\n\t\t\tventiState.set(theme.storageKeys.loanId, loanId)\n\t\t\tventiState.set(theme.storageKeys.appPosting, false)\n\t\t\tventiState.unset(theme.storageKeys.postLoanData)\n\t\t}\n\t}\n\n\tconst handleUpdateMe = async (data: UpdateMeRequest) => {\n\t\tconst replaceMeResponse = await TheBigPOSApi.replaceMe(data)\n\t\tawait queryClient.invalidateQueries({\n\t\t\tqueryKey: [queryKeys.user],\n\t\t})\n\t\tconst replaceMeResponseData = replaceMeResponse.data\n\t\tapplyUser({\n\t\t\t...data,\n\t\t\t...replaceMeResponseData,\n\t\t})\n\t}\n\n\tconst handleUpdateMyPhone = async (phone: string) => {\n\t\tawait TheBigPOSApi.updateMyPhone({ phone })\n\t\tapplyUser({ ...currentUser, phone })\n\t}\n\n\tconst isLoanOfficer: boolean = useMemo(\n\t\t() => currentUser && currentUser.role === Roles.loanOfficer,\n\t\t[currentUser]\n\t)\n\n\tconst isBorrower: boolean = useMemo(\n\t\t() => currentUser && currentUser.role === Roles.borrower,\n\t\t[currentUser]\n\t)\n\n\tconst isRealtor: boolean = useMemo(\n\t\t() => currentUser && currentUser.role === Roles.realtor,\n\t\t[currentUser]\n\t)\n\n\tconst isAdmin: boolean = useMemo(\n\t\t() => currentUser && adminRoles.includes(currentUser.role),\n\t\t[adminRoles, currentUser]\n\t)\n\n\tconst isSuperAdmin: boolean = useMemo(\n\t\t() => currentUser && currentUser.role === Roles.superAdmin,\n\t\t[currentUser]\n\t)\n\n\tconst isSettlementAgent: boolean = useMemo(\n\t\t() => currentUser && currentUser.role === Roles.settlementAgent,\n\t\t[currentUser]\n\t)\n\n\tconst isLoanAdmin: boolean = useMemo(() => {\n\t\tconst roles = [\n\t\t\tRoles.loanOfficer,\n\t\t\tRoles.branchManager,\n\t\t\tRoles.loanProcessor,\n\t\t\tRoles.loanOfficerAssistant,\n\t\t]\n\t\treturn currentUser && roles.includes(currentUser.role)\n\t}, [currentUser])\n\n\tconst canUseTasks: boolean = useMemo(() => {\n\t\tconst taskRoles: string[] = [\n\t\t\tRoles.borrower,\n\t\t\tRoles.branchManager,\n\t\t\tRoles.loanOfficer,\n\t\t\tRoles.loanProcessor,\n\t\t\tRoles.loanOfficerAssistant,\n\t\t]\n\t\treturn currentUser && taskRoles.includes(currentUser.role)\n\t}, [currentUser])\n\n\tconst canImpersonate: boolean = useMemo(() => {\n\t\treturn (\n\t\t\tcurrentUser?.role === Roles.superAdmin ||\n\t\t\t(currentUser?.role === Roles.admin &&\n\t\t\t\tcurrentUser?.canImpersonate)\n\t\t)\n\t}, [currentUser])\n\n\treturn {\n\t\tuser: currentUser,\n\t\tisLoggedIn,\n\t\tgetSignInRedirectURL,\n\t\tsetUser,\n\t\tsetAuthToken,\n\t\tinitUser,\n\t\tupdateMe: handleUpdateMe,\n\t\tupdateMyPhone: handleUpdateMyPhone,\n\t\tisLoanOfficer,\n\t\tisBorrower,\n\t\tisRealtor,\n\t\tisAdmin,\n\t\tisSuperAdmin,\n\t\tisLoanAdmin,\n\t\tisSettlementAgent,\n\t\tcanUseTasks,\n\t\tadminRoles,\n\t\tcanImpersonate,\n\t}\n}\n\nexport default useUser\n","/* eslint-disable */\n/* tslint:disable */\n/*\n * ---------------------------------------------------------------\n * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##\n * ## ##\n * ## AUTHOR: acacode ##\n * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##\n * ---------------------------------------------------------------\n */\n\nexport interface ASOSettings {\n enabled: boolean;\n softPull: boolean;\n triMerge: boolean;\n closingCosts: boolean;\n du: boolean;\n lp: boolean;\n iceIncomeAnalyzer: boolean;\n iceCreditAnalyzer: boolean;\n voa: boolean;\n voi: boolean;\n voie: boolean;\n voe: boolean;\n flood: boolean;\n avm: boolean;\n disclosures: boolean;\n preApproval: boolean;\n preQualification: boolean;\n mi: boolean;\n miRadian: boolean;\n miEssent: boolean;\n miNational: boolean;\n miEnact: boolean;\n mimgic: boolean;\n miArch: boolean;\n}\n\nexport interface Account {\n /** @format uuid */\n id: string;\n name: string;\n fusionCustomerID: string;\n mfaPreference: string;\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format int32 */\n allowedLoginsWithoutMFA: number;\n losSettings: LOSSettings;\n asoSettings?: ASOSettings | null;\n settings: AccountSettings;\n}\n\nexport interface AccountSettings {\n isSmsEnabled: boolean;\n smsNumber?: string | null;\n}\n\nexport interface AccountSettingsRequest {\n isSmsEnabled: boolean;\n smsNumber?: string | null;\n}\n\nexport interface Action {\n /** @format uuid */\n id: string;\n name: string;\n comments?: string | null;\n /** @format uuid */\n siteConfigurationID: string;\n applicationSettings?: any;\n surveysToken?: string | null;\n}\n\nexport interface AddFormToSiteConfigurationRequest {\n slug?: string | null;\n formType?: string | null;\n userRole?: string | null;\n borrowerType?: string | null;\n showProgressBar: boolean;\n showTile: boolean;\n tileLocation?: string | null;\n tileText?: string | null;\n tileSubtitle?: string | null;\n icon?: string | null;\n entityTypes?: string[] | null;\n}\n\nexport interface Address {\n /** @format uuid */\n id: string;\n street?: string | null;\n unit?: string | null;\n city?: string | null;\n state?: string | null;\n county?: string | null;\n postalCode?: string | null;\n}\n\nexport interface AddressRequest {\n /** @minLength 1 */\n street: string;\n unit?: string | null;\n /** @minLength 1 */\n city: string;\n /** @minLength 1 */\n state: string;\n county?: string | null;\n /** @minLength 1 */\n postalCode: string;\n}\n\nexport interface AdminAccessGetForms {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n /** @format int32 */\n type: number;\n target: string;\n name: string;\n isDefault: boolean;\n description?: string | null;\n slug?: string | null;\n status: string;\n language?: string | null;\n borrowerType?: BorrowerType | null;\n showProgressBar: boolean;\n}\n\nexport interface AdminAccessUser {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n role: string;\n firstName: string;\n lastName: string;\n email: string;\n phone?: string | null;\n title?: string | null;\n forcePasswordReset: boolean;\n mfaEnabled: boolean;\n phoneVerified: boolean;\n /** @format int32 */\n loginsWithoutMFACount: number;\n canImpersonate: boolean;\n loanIDs: string[];\n drafts: Draft[];\n notificationSettings?: UserNotificationSettings | null;\n /** @format uuid */\n accountID?: string | null;\n loans: UserLoan[];\n}\n\nexport interface AdminUser {\n firstName: string;\n lastName: string;\n email: string;\n password: string;\n}\n\nexport interface AllowImpersonationRequest {\n /**\n * @format email\n * @minLength 1\n */\n email: string;\n}\n\nexport interface ApplicationRowData {\n borrowerEmail?: string | null;\n borrowerFirstName?: string | null;\n borrowerLastName?: string | null;\n /** @deprecated */\n firstName?: string | null;\n /** @deprecated */\n lastName?: string | null;\n coBorrowerEmail?: string | null;\n coBorrowerFirstName?: string | null;\n coBorrowerLastName?: string | null;\n loanOfficer?: string | null;\n loanOfficerEmail?: string | null;\n loanID: string;\n /** @format date-time */\n applicationDate?: string | null;\n loanReferenceID: string;\n /** @format float */\n loanAmount?: number | null;\n loanNumber?: string | null;\n /** @deprecated */\n role?: string | null;\n /** @format date-time */\n initialDisclosureDate?: string | null;\n /** @format date-time */\n closingDisclosureDate?: string | null;\n /** @format date-time */\n underwritingApprovalDate?: string | null;\n /** @format date-time */\n closedDate?: string | null;\n /** @format date-time */\n fundingDate?: string | null;\n /** @format date-time */\n currentStatusDate?: string | null;\n channel?: string | null;\n currentMilestone?: string | null;\n lastMilestone?: string | null;\n loanStatus?: string | null;\n loanTerm?: string | null;\n subjectPropertyStreet?: string | null;\n subjectPropertyUnitType?: string | null;\n subjectPropertyUnitNumber?: string | null;\n subjectPropertyCity?: string | null;\n subjectPropertyState?: string | null;\n subjectPropertyZip?: string | null;\n loanPurpose?: string | null;\n buyerAgent?: LoanContact | null;\n sellerAgent?: LoanContact | null;\n settlementAgent?: LoanContact | null;\n escrowAgent?: LoanContact | null;\n titleInsuranceAgent?: LoanContact | null;\n}\n\nexport interface Attachment {\n fileName: string;\n base64Data: string;\n}\n\nexport type BorrowerRelationship = \"NotApplicable\" | \"Spouse\" | \"NonSpouse\";\n\nexport type BorrowerType = \"Borrower\" | \"CoBorrower\" | \"Unknown\";\n\nexport interface BranchBase {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n name: string;\n type: string;\n}\n\nexport interface BranchReduced {\n /** @format uuid */\n id: string;\n name: string;\n type: string;\n siteConfigurations: SiteConfigurationReduced[];\n}\n\nexport interface BranchSearchCriteria {\n searchText?: string | null;\n isActive?: boolean | null;\n brands?: string[] | null;\n type?: string | null;\n}\n\nexport type BranchType = \"Mortgage\" | \"RealEstate\";\n\nexport interface BranchUser {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n role: string;\n firstName: string;\n lastName: string;\n email: string;\n phone?: string | null;\n title?: string | null;\n forcePasswordReset: boolean;\n mfaEnabled: boolean;\n phoneVerified: boolean;\n /** @format int32 */\n loginsWithoutMFACount: number;\n canImpersonate: boolean;\n loanIDs: string[];\n drafts: Draft[];\n notificationSettings?: UserNotificationSettings | null;\n /** @format uuid */\n branchID: string;\n branchName: string;\n /** @format uuid */\n corporateID: string;\n corporateName: string;\n siteConfigurations: SiteConfigurationReduced[];\n}\n\nexport interface BranchUserPaginated {\n rows: BranchUser[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface BusinessRule {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n name: string;\n description?: string | null;\n tasks: Task[];\n filter: BusinessRuleCondition[];\n applyToAllBorrowerPairs: boolean;\n}\n\nexport interface BusinessRuleCondition {\n /** @format int32 */\n conditionType: number;\n targetFieldID: string;\n targetFieldValue: string;\n}\n\nexport interface BusinessRuleRequest {\n /**\n * @minLength 1\n * @maxLength 250\n */\n name: string;\n description?: string | null;\n tasks: TaskUpdateRequest[];\n filter: BusinessRuleCondition[];\n applyToAllBorrowerPairs: boolean;\n}\n\nexport interface ChangePasswordRequest {\n /** @minLength 1 */\n oldPassword: string;\n /** @minLength 8 */\n newPassword: string;\n}\n\nexport interface CommentUserInformation {\n entityId: string;\n entityType: string;\n entityName?: string | null;\n entityUri?: string | null;\n}\n\nexport interface Company {\n name?: string | null;\n siteUrl?: string | null;\n address?: string | null;\n address2?: string | null;\n city?: string | null;\n state?: string | null;\n zip?: string | null;\n phone?: string | null;\n fax?: string | null;\n nmlsid?: string | null;\n}\n\nexport interface CompanyAddress {\n address: string;\n address2?: string | null;\n city: string;\n state: string;\n zip: string;\n}\n\nexport interface ConditionComment {\n commentId: string;\n comments: string;\n /** @format int32 */\n forRoleId: number;\n forRole: CommentUserInformation;\n /** @format date-time */\n dateCreated: string;\n createdBy: string;\n createdByName: string;\n}\n\nexport interface Contact {\n /** @format uuid */\n id: string;\n firstName?: string | null;\n lastName?: string | null;\n name?: string | null;\n email?: string | null;\n}\n\nexport interface ContactInfo {\n phone: string;\n tollFreePhone?: string | null;\n fax?: string | null;\n}\n\nexport interface ContactRowData {\n companyName?: string | null;\n name?: string | null;\n license?: string | null;\n address?: string | null;\n city?: string | null;\n state?: string | null;\n zip?: string | null;\n phone?: string | null;\n cell?: string | null;\n email?: string | null;\n}\n\nexport interface Corporate {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n name: string;\n /** @uniqueItems true */\n branchIDs: string[];\n siteConfigurations: SiteConfigurationReduced[];\n}\n\nexport interface CorporateBase {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n name: string;\n}\n\nexport interface CorporatePaginated {\n rows: Corporate[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface CorporateRequest {\n /**\n * @minLength 1\n * @maxLength 250\n */\n name: string;\n}\n\nexport interface CorporateSearchCriteria {\n searchText?: string | null;\n isActive?: boolean | null;\n}\n\nexport interface CreateAccountRequest {\n /** @minLength 1 */\n name: string;\n /** @minLength 1 */\n domain: string;\n eConsentBucket?: string | null;\n ignoreCoBorrowerRelationship: boolean;\n user: AdminUser;\n companyAddress: CompanyAddress;\n contactInfo: ContactInfo;\n theme: Theme;\n /**\n * @format int64\n * @min 0\n */\n nlmsid: number;\n settings: AccountSettingsRequest;\n environment: \"Development\" | \"Staging\" | \"UAT\" | \"Production\";\n losIntegration: LOSIntegration;\n}\n\nexport interface CreateBranchRequest {\n /**\n * @minLength 1\n * @maxLength 250\n */\n name: string;\n /** @format uuid */\n corporateID: string;\n type: string;\n}\n\nexport interface CreateDocumentTemplateRequest {\n /** @minLength 1 */\n htmlBody: string;\n /**\n * @minLength 1\n * @maxLength 255\n */\n name: string;\n type: string;\n description?: string | null;\n destinationBucket?: string | null;\n status: string;\n}\n\nexport interface CreateInviteRequest {\n /** @minLength 1 */\n firstName: string;\n /** @minLength 1 */\n lastName: string;\n /** @format email */\n emailAddress: string;\n phoneNumber: string;\n relationship: \"NotApplicable\" | \"Spouse\" | \"NonSpouse\";\n loanID: string;\n route?: string | null;\n /** @format uuid */\n siteConfigurationID: string;\n userRole?: string | null;\n customData?: any;\n sourceUrl?: string | null;\n}\n\nexport interface CreateUserRelationRequest {\n /**\n * @format uuid\n * @minLength 1\n */\n userId1: string;\n /**\n * @format uuid\n * @minLength 1\n */\n userId2: string;\n /** @minLength 1 */\n relationType: string;\n}\n\nexport interface CreateUserRequest {\n /**\n * @format email\n * @minLength 1\n */\n email: string;\n phone?: string | null;\n /**\n * @minLength 1\n * @maxLength 255\n */\n firstName: string;\n /**\n * @minLength 1\n * @maxLength 255\n */\n lastName: string;\n title?: string | null;\n /** @format uuid */\n branchId?: string | null;\n /** @minLength 1 */\n userRole: string;\n}\n\nexport interface CustomLoanData {\n eConsentInformation?: EConsentInformation | null;\n}\n\nexport interface DetailedUser {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n role: string;\n firstName: string;\n lastName: string;\n email: string;\n phone?: string | null;\n title?: string | null;\n forcePasswordReset: boolean;\n mfaEnabled: boolean;\n phoneVerified: boolean;\n /** @format int32 */\n loginsWithoutMFACount: number;\n canImpersonate: boolean;\n loanIDs: string[];\n drafts: Draft[];\n notificationSettings?: UserNotificationSettings | null;\n}\n\nexport interface Device {\n /** @format uuid */\n id: string;\n /** @format uuid */\n accountID: string;\n serialNumber: string;\n apps: any;\n /** @format uuid */\n createdBy: string;\n /** @format uuid */\n updatedBy?: string | null;\n /** @format uuid */\n managedBy?: string | null;\n name?: string | null;\n type?: string | null;\n status?: string | null;\n comments?: string | null;\n}\n\nexport interface DeviceAction {\n is_enabled: boolean;\n localized_name?: string | null;\n name?: string | null;\n remarks?: string | null;\n localized_action_info?: string | null;\n status_code?: string | null;\n action_info?: string | null;\n localized_status_description?: string | null;\n status_description?: string | null;\n}\n\nexport interface DeviceMDM {\n managed_status?: string | null;\n device_id?: string | null;\n is_supervised: boolean;\n os_version?: string | null;\n is_lost_mode_enabled: boolean;\n owned_by?: string | null;\n is_removed?: string | null;\n product_name?: string | null;\n device_name?: string | null;\n device_type?: string | null;\n platform_type?: string | null;\n wifi_mac?: string | null;\n udid?: string | null;\n serial_number?: string | null;\n customer_name?: string | null;\n customer_id?: string | null;\n model?: string | null;\n last_contact_time?: string | null;\n platform_type_id?: string | null;\n device_capacity?: string | null;\n imei: string[];\n user?: MdmUser | null;\n actions?: DeviceAction[] | null;\n}\n\nexport interface DevicePaginated {\n rows: Device[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface DeviceRequest {\n apps: any;\n name?: string | null;\n comments?: string | null;\n}\n\nexport interface DocumentData {\n documentID: string;\n /** @format uuid */\n eSignRecordID: string;\n documentBucketTitle: string;\n documentName: string;\n /** @format date-time */\n createdAt: string;\n extension: string;\n password: string;\n systemGenerated: boolean;\n}\n\nexport interface DocumentDataRequest {\n documentID?: string | null;\n /** @format uuid */\n eSignRecordID: string;\n documentBucketTitle?: string | null;\n documentName?: string | null;\n /** @format date-time */\n createdAt: string;\n base64Data?: string | null;\n extension?: string | null;\n password?: string | null;\n systemGenerated: boolean;\n}\n\nexport interface DocumentTemplate {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n htmlBody: string;\n name: string;\n multipleCustomTemplates: boolean;\n isDefault: boolean;\n type: string;\n description?: string | null;\n destinationBucket?: string | null;\n isDestinationBucketConfigurable: boolean;\n status: string;\n versions: DocumentTemplateVersionBase[];\n}\n\nexport interface DocumentTemplateBase {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n htmlBody: string;\n name: string;\n multipleCustomTemplates: boolean;\n isDefault: boolean;\n type: string;\n description?: string | null;\n destinationBucket?: string | null;\n isDestinationBucketConfigurable: boolean;\n status: string;\n}\n\nexport interface DocumentTemplateVersion {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n /** @format int32 */\n version: number;\n name: string;\n isActive: boolean;\n htmlBody: string;\n documentTemplate: DocumentTemplateBase;\n}\n\nexport interface DocumentTemplateVersionBase {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n /** @format int32 */\n version: number;\n name?: string | null;\n isActive: boolean;\n htmlBody: string;\n}\n\nexport interface DocumentTemplateVersionRequest {\n /** @maxLength 255 */\n name?: string | null;\n isActive: boolean;\n htmlBody: string;\n}\n\nexport interface DocumentTemplateVersionUpdateRequest {\n /** @maxLength 255 */\n name: string;\n isActive: boolean;\n /** @minLength 1 */\n htmlBody: string;\n}\n\nexport interface Draft {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n customData: any;\n user: UserBase;\n loanOfficer: UserBase;\n siteConfiguration: SiteConfigurationReduced;\n}\n\nexport interface DraftContent {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n customData: any;\n user: UserBase;\n loanOfficer: UserBase;\n siteConfiguration: SiteConfigurationReduced;\n applicationPayload: any;\n}\n\nexport interface DraftContentPaginated {\n rows: DraftContent[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface DraftLoanOfficerReassignRequest {\n /** @format uuid */\n loanOfficerID: string;\n}\n\nexport interface DraftRequest {\n applicationPayload: any;\n customData?: any;\n}\n\nexport interface EConsentInformation {\n status: string;\n /** @format date-time */\n acceptedDate?: string | null;\n ipAddress?: string | null;\n source?: string | null;\n}\n\nexport interface EnabledServices {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n mobilePrequal?: boolean | null;\n fullApp?: boolean | null;\n mobileApp?: boolean | null;\n ringCentral?: boolean | null;\n pricingCalculator?: boolean | null;\n rates?: boolean | null;\n socialSurvey?: boolean | null;\n borrowerTasks?: boolean | null;\n docusign?: boolean | null;\n emailNotifications?: boolean | null;\n voc?: boolean | null;\n spanishPrequal?: boolean | null;\n spanishFullApp?: boolean | null;\n prequalLetter?: boolean | null;\n payments?: boolean | null;\n leadApp?: boolean | null;\n documents?: boolean | null;\n loanCalculator?: boolean | null;\n disclosures?: boolean | null;\n buyerClient?: boolean | null;\n sellerClient?: boolean | null;\n clientLifestyle?: boolean | null;\n loanDetails?: boolean | null;\n loanStatus?: boolean | null;\n loanStatusNotifications?: boolean | null;\n loanAndProperty?: boolean | null;\n personalInformation?: boolean | null;\n employment?: boolean | null;\n assets?: boolean | null;\n realEstate?: boolean | null;\n encompassWeb?: boolean | null;\n support?: boolean | null;\n leads?: boolean | null;\n openHouseForm?: boolean | null;\n listingOfferForm?: boolean | null;\n listings?: boolean | null;\n}\n\nexport type EntityType = \"Account\" | \"Corporate\" | \"Branch\" | \"LoanOfficer\" | \"Realtor\";\n\nexport type Environment = \"Development\" | \"Staging\" | \"UAT\" | \"Production\";\n\nexport interface Error {\n message: string;\n}\n\nexport interface ExtendedLoan {\n /** @format uuid */\n id: string;\n loanID: string;\n loanNumber?: string | null;\n /** @format date-time */\n initialDisclosureProvidedDate?: string | null;\n /** @format date-time */\n closingDisclosureSentDate?: string | null;\n /** @format date-time */\n underwritingApprovalDate?: string | null;\n /** @format date-time */\n closingDate?: string | null;\n /** @format date-time */\n fundingOrderDate?: string | null;\n /** @format date-time */\n currentStatusDate?: string | null;\n loanChannel?: string | null;\n /** @format double */\n totalLoanAmount?: number | null;\n currentLoanStatus?: string | null;\n currentMilestone?: string | null;\n lastCompletedMilestone?: string | null;\n /** @format date-time */\n startDate?: string | null;\n isInSync: boolean;\n /** @format date-time */\n syncDate?: string | null;\n fileStarter?: string | null;\n isPOSLoan?: boolean | null;\n referenceID: string;\n /** @format int32 */\n term?: number | null;\n loanProgram?: string | null;\n loanType?: string | null;\n status?: string | null;\n loanOfficer?: LoanOfficer | null;\n propertyAddress?: Address | null;\n borrowerContact?: Contact | null;\n coBorrowerContact?: Contact | null;\n loanLogs: LoanLog[];\n isLocked: boolean;\n source?: string | null;\n buyerAgentContact?: Contact | null;\n sellerAgentContact?: Contact | null;\n escrowAgentContact?: Contact | null;\n titleInsuranceAgentContact?: Contact | null;\n settlementAgentContact?: Contact | null;\n loanProcessorContact?: Contact | null;\n}\n\nexport interface ExtendedLoanPaginated {\n rows: ExtendedLoan[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface File {\n /** @format uuid */\n id: string;\n fileName: string;\n name: string;\n s3FilePath: string;\n user?: User | null;\n account?: Account | null;\n url: string;\n}\n\nexport interface FilePaginated {\n rows: File[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface FileRequest {\n /**\n * @minLength 1\n * @maxLength 250\n */\n name: string;\n}\n\nexport interface FileSearchCriteria {\n searchText?: string | null;\n isPublic?: boolean | null;\n}\n\nexport interface FileWithBytes {\n name: string;\n /** @format byte */\n data: string;\n fileName: string;\n mimeType?: string | null;\n extension?: string | null;\n}\n\nexport type FilterType =\n | \"DateGreaterThanOrEqualTo\"\n | \"DateGreaterThan\"\n | \"DateLessThan\"\n | \"DateLessThanOrEqualTo\"\n | \"DateEquals\"\n | \"DateDoesntEqual\"\n | \"DateNonEmpty\"\n | \"DateEmpty\"\n | \"StringContains\"\n | \"StringEquals\"\n | \"StringNotEmpty\"\n | \"StringNotEquals\"\n | \"StringNotContains\";\n\nexport interface Form {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n formJSON: any;\n /** @format int32 */\n type: number;\n target: string;\n authType: string;\n name: string;\n isDefault: boolean;\n description?: string | null;\n slug?: string | null;\n status: string;\n language?: string | null;\n showProgressBar: boolean;\n borrowerType?: BorrowerType | null;\n versions: FormVersion[];\n}\n\nexport interface FormRequest {\n formJSON: any;\n /** @format int32 */\n type: number;\n target: string;\n authType: string;\n inviteUser: boolean;\n name: string;\n description?: string | null;\n slug?: string | null;\n status: string;\n language?: string | null;\n borrowerType?: BorrowerType | null;\n showProgressBar: boolean;\n}\n\nexport interface FormSubmission {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n /** @format uuid */\n formID?: string | null;\n formName?: string | null;\n firstName?: string | null;\n lastName?: string | null;\n email?: string | null;\n contactPhone?: string | null;\n /** @format uuid */\n siteConfigurationID: string;\n siteConfiguration: SiteConfiguration;\n loanOfficerEmail?: string | null;\n /** @format uuid */\n loanOfficerID?: string | null;\n loanOfficer?: User | null;\n /** @format uuid */\n branchID?: string | null;\n branch?: GetBranch | null;\n status: string;\n subjectPropertyAddressStreet?: string | null;\n subjectPropertyAddressCity?: string | null;\n subjectPropertyAddressCounty?: string | null;\n subjectPropertyAddressState?: string | null;\n subjectPropertyAddressZip?: string | null;\n data?: any;\n /** @format uuid */\n listingID?: string | null;\n listing?: Listing | null;\n files: FormSubmissionFile[];\n}\n\nexport interface FormSubmissionFile {\n /** @format uuid */\n id: string;\n file: File;\n}\n\nexport interface FormSubmissionPaginated {\n rows: FormSubmission[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface FormSubmissionRequest {\n formID?: string | null;\n formName?: string | null;\n firstName?: string | null;\n lastName?: string | null;\n email?: string | null;\n contactPhone?: string | null;\n loanOfficerEmail?: string | null;\n /** @format uuid */\n loanOfficerID?: string | null;\n /** @format uuid */\n branchID?: string | null;\n status?: string | null;\n subjectPropertyAddressStreet?: string | null;\n subjectPropertyAddressCity?: string | null;\n subjectPropertyAddressCounty?: string | null;\n subjectPropertyAddressState?: string | null;\n subjectPropertyAddressZip?: string | null;\n data?: any;\n /** @format uuid */\n listingID?: string | null;\n}\n\nexport interface FormSubmissionSearchCriteria {\n searchText?: string | null;\n /** @format uuid */\n loanOfficerID?: string | null;\n /** @format uuid */\n branchID?: string | null;\n formName?: string | null;\n formNames?: string[] | null;\n email?: string | null;\n status?: string | null;\n /** @format uuid */\n listingID?: string | null;\n}\n\nexport interface FormVersion {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n /** @format int32 */\n version: number;\n name?: string | null;\n isActive: boolean;\n formJSON: any;\n form: GetForm;\n}\n\nexport interface FormVersionRequest {\n /** @maxLength 255 */\n name?: string | null;\n isActive: boolean;\n formJSON: any;\n}\n\nexport interface FormVersionUpdateRequest {\n /** @maxLength 255 */\n name?: string | null;\n isActive: boolean;\n formJSON: any;\n /** @format uuid */\n id: string;\n}\n\nexport interface FusionFieldDisplay {\n fieldValue: string;\n}\n\nexport interface FusionReportFilter {\n filterType:\n | \"DateGreaterThanOrEqualTo\"\n | \"DateGreaterThan\"\n | \"DateLessThan\"\n | \"DateLessThanOrEqualTo\"\n | \"DateEquals\"\n | \"DateDoesntEqual\"\n | \"DateNonEmpty\"\n | \"DateEmpty\"\n | \"StringContains\"\n | \"StringEquals\"\n | \"StringNotEmpty\"\n | \"StringNotEquals\"\n | \"StringNotContains\";\n targetField: string;\n targetValue: string;\n}\n\nexport interface GenerateDocumentRequest {\n /** @minLength 1 */\n loanID: string;\n /**\n * @format uuid\n * @minLength 1\n */\n templateID: string;\n /**\n * @format uuid\n * @minLength 1\n */\n siteConfigurationID: string;\n preview: boolean;\n}\n\nexport interface GetApplications {\n applications: ApplicationRowData[];\n}\n\nexport interface GetBranch {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n name: string;\n /** @format uuid */\n corporateID?: string | null;\n corporateName?: string | null;\n /** @uniqueItems true */\n loanOfficerIDs: string[];\n type: string;\n siteConfigurations: SiteConfigurationReduced[];\n}\n\nexport interface GetBranchPaginated {\n rows: GetBranch[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface GetForm {\n formJSON: any;\n /** @format int32 */\n type: number;\n target: string;\n authType: string;\n inviteUser: boolean;\n name: string;\n description?: string | null;\n slug?: string | null;\n status: string;\n language?: string | null;\n borrowerType?: BorrowerType | null;\n showProgressBar: boolean;\n /** @format uuid */\n id: string;\n}\n\nexport interface GetPricingCalculationRequest {\n eppsUserName?: string | null;\n /** @format int32 */\n loanAmount: number;\n /** @format int32 */\n totalMortgageAmount: number;\n /** @format int32 */\n propertyValue: number;\n propertyType?: string | null;\n zipCode?: string | null;\n county?: string | null;\n city?: string | null;\n state?: string | null;\n /** @minLength 1 */\n loanPurpose: string;\n propertyOccupancy?: string | null;\n escrow?: string | null;\n escrowInsurance: boolean;\n escrowTaxes: boolean;\n loanTerm?: string | null;\n loanType?: string | null;\n creditScore?: string | null;\n /** @format uuid */\n siteConfigurationId: string;\n}\n\nexport interface GetPricingForLoanOfficer {\n rates: PricingRates[];\n}\n\nexport interface GetReport {\n loanRecords: LoanRecord[];\n invalidFieldIDs: string[];\n}\n\nexport interface GetReportRequest {\n fields: FusionFieldDisplay[];\n filters?: FusionReportFilter[] | null;\n loanIDs?: string[] | null;\n /** @format int32 */\n startIndex?: number | null;\n /** @format int32 */\n limit?: number | null;\n}\n\nexport interface GetSiteConfigurationByLOUserIDRequest {\n loUserID: string;\n}\n\nexport interface GetSiteConfigurationRequest {\n url: string;\n}\n\nexport interface GetSiteFormRequest {\n /**\n * @format uuid\n * @minLength 1\n */\n siteConfigurationId: string;\n /** @format int32 */\n formType: number;\n slug?: string | null;\n}\n\nexport interface GetUserByEmailRequest {\n /**\n * @format email\n * @minLength 1\n */\n email: string;\n}\n\nexport interface GetWorkflowRequest {\n /** @minLength 1 */\n formType: string;\n borrowerType?: string | null;\n userRole?: string | null;\n language?: string | null;\n}\n\nexport interface ImportUserLoanTaskRequest {\n /**\n * @format uuid\n * @minLength 1\n */\n taskID: string;\n /**\n * @format uuid\n * @minLength 1\n */\n userID: string;\n}\n\nexport interface Invite {\n firstName: string;\n lastName: string;\n emailAddress: string;\n phoneNumber: string;\n relationship: string;\n loanID: string;\n route?: string | null;\n /** @format uuid */\n siteConfigurationID: string;\n isExistingAccount: boolean;\n completedLoanApplication: boolean;\n userRole: string;\n loanRole: string;\n customData: any;\n /** @format date-time */\n createdAt: string;\n}\n\n/** Array of operations to perform */\nexport type JsonPatchDocument = Operation[];\n\nexport interface LOSIntegration {\n instanceID: string;\n}\n\nexport interface LOSSettings {\n loanClosingDateFieldID: string;\n customEConsentBucketTitle?: string | null;\n loanMilestoneNotificationsEnabled: boolean;\n}\n\nexport interface LOSSettingsUpdateRequest {\n loanClosingDateFieldID: string;\n customEConsentBucketTitle?: string | null;\n loanMilestoneNotificationsEnabled: boolean;\n}\n\nexport type LOSStatus = \"Unknown\" | \"Pending\" | \"Retrying\" | \"Successful\" | \"Failed\" | \"FailedPermanently\";\n\nexport interface Listing {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n description?: string | null;\n mlsNumber?: string | null;\n address?: Address | null;\n /** @format int32 */\n salePrice?: number | null;\n /** @format date-time */\n activeDate: string;\n /** @format date-time */\n expirationDate?: string | null;\n zillowURL?: string | null;\n photos: ListingPhoto[];\n files: ListingFile[];\n backgroundImage?: File | null;\n /** @format date-time */\n openHouseDate?: string | null;\n /** @format double */\n buyerAgentCommissionPercent?: number | null;\n /** @format double */\n sellerAgentCommissionPercent?: number | null;\n isActive: boolean;\n slug: string;\n url?: string | null;\n loanOfficer?: LoanOfficer | null;\n siteConfiguration: SiteConfiguration;\n}\n\nexport interface ListingFile {\n /** @format uuid */\n id: string;\n type: string;\n file: File;\n /** @format int32 */\n weight: number;\n}\n\nexport interface ListingPaginated {\n rows: Listing[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface ListingPhoto {\n /** @format uuid */\n id: string;\n description?: string | null;\n file: File;\n /** @format int32 */\n weight: number;\n}\n\nexport interface ListingRequest {\n description?: string | null;\n mlsNumber?: string | null;\n address: AddressRequest;\n /**\n * @format int32\n * @min 0\n * @exclusiveMin true\n */\n salePrice?: number | null;\n /**\n * @format date-time\n * @minLength 1\n */\n activeDate: string;\n /** @format date-time */\n expirationDate?: string | null;\n zillowURL?: string | null;\n /** @format date-time */\n openHouseDate?: string | null;\n /** @format double */\n buyerAgentCommissionPercent?: number | null;\n /** @format double */\n sellerAgentCommissionPercent?: number | null;\n /** @format uuid */\n siteConfigurationId?: string | null;\n}\n\nexport interface ListingSearchCriteria {\n searchText?: string | null;\n isActive?: boolean | null;\n partnerIds?: string[] | null;\n}\n\nexport interface Loan {\n /** @format uuid */\n id: string;\n loanID: string;\n loanNumber?: string | null;\n /** @format date-time */\n initialDisclosureProvidedDate?: string | null;\n /** @format date-time */\n closingDisclosureSentDate?: string | null;\n /** @format date-time */\n underwritingApprovalDate?: string | null;\n /** @format date-time */\n closingDate?: string | null;\n /** @format date-time */\n fundingOrderDate?: string | null;\n /** @format date-time */\n currentStatusDate?: string | null;\n loanChannel?: string | null;\n /** @format double */\n totalLoanAmount?: number | null;\n currentLoanStatus?: string | null;\n currentMilestone?: string | null;\n lastCompletedMilestone?: string | null;\n /** @format date-time */\n startDate?: string | null;\n isInSync: boolean;\n /** @format date-time */\n syncDate?: string | null;\n fileStarter?: string | null;\n isPOSLoan?: boolean | null;\n referenceID: string;\n /** @format int32 */\n term?: number | null;\n loanProgram?: string | null;\n loanType?: string | null;\n status?: string | null;\n loanOfficer?: LoanOfficer | null;\n propertyAddress?: Address | null;\n borrowerContact?: Contact | null;\n coBorrowerContact?: Contact | null;\n loanLogs: LoanLog[];\n isLocked: boolean;\n source?: string | null;\n}\n\nexport interface LoanComparison {\n loanID: string;\n scenarios: LoanComparisonScenario[];\n loanLocked: boolean;\n}\n\nexport interface LoanComparisonScenario {\n loanProgram?: string | null;\n /** @minLength 1 */\n loanType: string;\n propertyValue?: string | null;\n purchasePrice?: string | null;\n downpaymentAmount?: string | null;\n downpaymentPercent?: string | null;\n loanAmount?: string | null;\n totalAssets?: string | null;\n monthlyPayment?: string | null;\n totalMortgageAmount?: string | null;\n dtiFront?: string | null;\n dtiBack?: string | null;\n ltvFront?: string | null;\n ltvBack?: string | null;\n totalCashToClose?: string | null;\n apr?: string | null;\n mi?: string | null;\n miFactor?: string | null;\n rate?: string | null;\n loanTerm1?: string | null;\n loanTerm2?: string | null;\n closingCosts?: string | null;\n prepaidCharges?: string | null;\n totalCost?: string | null;\n totalFinancing?: string | null;\n discount?: string | null;\n lenderCredit?: string | null;\n fundingFee?: string | null;\n}\n\nexport interface LoanContact {\n name?: string | null;\n email?: string | null;\n phone?: string | null;\n company?: string | null;\n}\n\nexport interface LoanDocument {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n name: string;\n loan: Loan;\n user?: User | null;\n initialBucket?: string | null;\n losDocumentID?: string | null;\n losStatus: string;\n contents?: string | null;\n failoverDocumentPath?: string | null;\n}\n\nexport interface LoanDraftSearchCriteria {\n searchText?: string | null;\n /** @format uuid */\n loanOfficerId?: string | null;\n /** @format uuid */\n siteConfigurationId?: string | null;\n isUnassigned?: boolean | null;\n}\n\nexport interface LoanLog {\n /** @format uuid */\n id: string;\n level: \"None\" | \"Info\" | \"Warning\" | \"Error\";\n type: \"Loan\" | \"Queue\" | \"POSFlagChanged\" | \"Verification\";\n message: string;\n /** @format date-time */\n createdAt: string;\n}\n\nexport type LoanLogType = \"Loan\" | \"Queue\" | \"POSFlagChanged\" | \"Verification\";\n\nexport interface LoanOfficer {\n /** @format uuid */\n id: string;\n name?: string | null;\n email: string;\n phone?: string | null;\n title?: string | null;\n nmlsid: string;\n profilePhotoUrl: string;\n siteConfiguration: SiteConfiguration;\n}\n\nexport interface LoanOfficerPublic {\n firstName: string;\n lastName: string;\n email: string;\n phone?: string | null;\n /** @format uuid */\n corporateID?: string | null;\n siteConfigurationIDs: string[];\n}\n\nexport interface LoanOfficerSearchCriteria {\n searchText?: string | null;\n isActive?: boolean | null;\n /** @format uuid */\n branch?: string | null;\n /** @format uuid */\n brand?: string | null;\n}\n\nexport interface LoanQueue {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n loan?: Loan | null;\n type: string;\n reason: string;\n status: string;\n details?: string | null;\n jobID?: string | null;\n user: UserPublic;\n loanOfficer: LoanOfficerPublic;\n siteConfiguration: SiteConfigurationReduced;\n}\n\nexport interface LoanQueuePaginated {\n rows: LoanQueue[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport type LoanQueueReason = \"Unknown\" | \"Locked\" | \"LOSError\" | \"Exception\";\n\nexport interface LoanQueueSearchCriteria {\n searchText?: string | null;\n loanID?: string | null;\n type?: LoanQueueType | null;\n status?: LOSStatus | null;\n reason?: LoanQueueReason | null;\n}\n\nexport type LoanQueueType = \"Unknown\" | \"New\" | \"Append\" | \"Update\" | \"FieldUpdates\" | \"Document\" | \"Buckets\";\n\nexport interface LoanQueueWithData {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n loan?: Loan | null;\n type: string;\n reason: string;\n status: string;\n details?: string | null;\n jobID?: string | null;\n user: UserPublic;\n loanOfficer: LoanOfficerPublic;\n siteConfiguration: SiteConfigurationReduced;\n data?: any;\n}\n\nexport interface LoanRecord {\n loanGuid: string;\n loanFields: Record;\n}\n\nexport interface LoanSearchCriteria {\n searchText?: string | null;\n /** @format uuid */\n loanOfficerId?: string | null;\n loanNumber?: string | null;\n isClosed?: boolean | null;\n loanPurpose?: string | null;\n loanType?: string | null;\n /** @format uuid */\n siteConfigurationId?: string | null;\n}\n\nexport interface LoanUser {\n /** @format uuid */\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n phone?: string | null;\n role: string;\n isUser: boolean;\n /** @format date-time */\n createdAt: string;\n}\n\nexport type LogLevel = \"None\" | \"Info\" | \"Warning\" | \"Error\";\n\nexport interface MdmUser {\n user_email?: string | null;\n user_id?: string | null;\n user_name?: string | null;\n}\n\nexport interface MilestoneConfiguration {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n name: string;\n description?: string | null;\n fieldID: string;\n /** @format int32 */\n weight: number;\n /** @format uuid */\n accountID: string;\n loanType: string;\n notificationsEnabled: boolean;\n}\n\nexport interface MilestoneConfigurationRequest {\n /** @minLength 1 */\n name: string;\n description?: string | null;\n /** @minLength 1 */\n fieldID: string;\n /**\n * @format int32\n * @min -1000\n * @max 1000\n */\n weight?: number | null;\n /** @minLength 1 */\n loanType: string;\n notificationsEnabled: boolean;\n}\n\nexport interface Module {\n /** @format uuid */\n id: string;\n name: string;\n moduleType: string;\n active: boolean;\n isInherited: boolean;\n moduleParameterValues: ModuleParameterValue[];\n}\n\nexport interface ModuleParameterValue {\n /** @format uuid */\n parameterID: string;\n parameterName: string;\n parameterType: string;\n value?: any;\n isInherited: boolean;\n}\n\nexport interface NotificationTemplate {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n htmlBody: string;\n name: string;\n plainBody: string;\n description?: string | null;\n subject: string;\n textEnabled: boolean;\n pushNotificationEnabled: boolean;\n emailEnabled: boolean;\n textBody?: string | null;\n pushNotificationBody: string;\n isDefault: boolean;\n status: string;\n useDefaultHeaderAndFooter: boolean;\n versions: NotificationTemplateVersionBase[];\n}\n\nexport interface NotificationTemplateBase {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n htmlBody: string;\n name: string;\n plainBody: string;\n description?: string | null;\n subject: string;\n textEnabled: boolean;\n pushNotificationEnabled: boolean;\n emailEnabled: boolean;\n textBody?: string | null;\n pushNotificationBody: string;\n isDefault: boolean;\n status: string;\n useDefaultHeaderAndFooter: boolean;\n}\n\nexport interface NotificationTemplateRequest {\n /** @minLength 1 */\n htmlBody: string;\n /** @minLength 1 */\n name: string;\n plainBody: string;\n description?: string | null;\n /** @minLength 1 */\n subject: string;\n textEnabled: boolean;\n pushNotificationEnabled: boolean;\n emailEnabled: boolean;\n textBody?: string | null;\n pushNotificationBody: string;\n status: string;\n useDefaultHeaderAndFooter: boolean;\n}\n\nexport interface NotificationTemplateVersion {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n /** @format int32 */\n version: number;\n name?: string | null;\n isActive: boolean;\n htmlBody: string;\n plainBody: string;\n textBody?: string | null;\n notificationTemplate: NotificationTemplate;\n}\n\nexport interface NotificationTemplateVersionBase {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n /** @format int32 */\n version: number;\n name?: string | null;\n isActive: boolean;\n htmlBody: string;\n plainBody: string;\n textBody?: string | null;\n}\n\nexport interface NotificationTemplateVersionRequest {\n /** @maxLength 255 */\n name?: string | null;\n isActive: boolean;\n htmlBody: string;\n plainBody: string;\n textBody?: string | null;\n}\n\nexport interface NotificationTemplateVersionUpdateRequest {\n /**\n * @minLength 1\n * @maxLength 255\n */\n name: string;\n isActive: boolean;\n /** @minLength 1 */\n htmlBody: string;\n /** @minLength 1 */\n plainBody: string;\n textBody?: string | null;\n}\n\nexport interface Operation {\n op?: string;\n value?: object | null;\n path?: string;\n}\n\nexport interface OverridePasswordRequest {\n /** @minLength 8 */\n password: string;\n}\n\nexport interface Pagination {\n /** @format int32 */\n pageNumber: number;\n /** @format int32 */\n pageSize: number;\n}\n\nexport interface PartnerSearchCriteria {\n searchText?: string | null;\n isActive?: boolean | null;\n brands?: string[] | null;\n roles?: UserRole[] | null;\n}\n\nexport interface PostLoanComparisonPdfRequest {\n /**\n * @format uuid\n * @minLength 1\n */\n siteConfigurationID: string;\n}\n\nexport interface PreliminaryCondition {\n /** @format uuid */\n id: string;\n conditionType: string;\n isRemoved: boolean;\n title: string;\n description?: string | null;\n forAllApplications: boolean;\n source?: string | null;\n /** @format date-time */\n expectedDate?: string | null;\n status: string;\n /** @format date-time */\n statusDate?: string | null;\n /** @format int32 */\n daysToReceive: number;\n requestedFrom?: string | null;\n /** @format date-time */\n createdDate?: string | null;\n createdBy?: CommentUserInformation | null;\n isRequested: boolean;\n /** @format date-time */\n requestedDate?: string | null;\n requestedBy?: CommentUserInformation | null;\n isReceived: boolean;\n /** @format date-time */\n receivedDate?: string | null;\n receivedBy?: CommentUserInformation | null;\n priorTo?: string | null;\n category?: string | null;\n isFulfilled: boolean;\n /** @format date-time */\n fulfilledDate?: string | null;\n fulfilledBy?: CommentUserInformation | null;\n comments: ConditionComment[];\n uwAccess?: string | null;\n isRerequested: boolean;\n /** @format date-time */\n rerequestedDate?: string | null;\n rerequestedBy?: CommentUserInformation | null;\n}\n\nexport interface PricingRates {\n rate: string;\n loanProgram: string;\n apr: string;\n /** @format float */\n price: number;\n /** @format float */\n payment: number;\n}\n\nexport interface ProblemDetails {\n type?: string | null;\n title?: string | null;\n /** @format int32 */\n status?: number | null;\n detail?: string | null;\n instance?: string | null;\n [key: string]: any;\n}\n\nexport interface RefreshTokenRequest {\n /** @minLength 1 */\n refreshToken: string;\n /** @minLength 1 */\n username: string;\n /** @format uuid */\n siteConfigurationId?: string | null;\n}\n\nexport interface RegisterUserRequest {\n /**\n * @format email\n * @minLength 1\n */\n email: string;\n /** @minLength 8 */\n password: string;\n phone?: string | null;\n /**\n * @minLength 1\n * @maxLength 255\n */\n firstName: string;\n /**\n * @minLength 1\n * @maxLength 255\n */\n lastName: string;\n /**\n * @format uuid\n * @minLength 1\n */\n siteConfigurationId: string;\n /** @format uuid */\n inviteCode?: string | null;\n}\n\nexport interface RequestImpersonationRequest {\n /**\n * @format email\n * @minLength 1\n */\n email: string;\n}\n\nexport interface RequestQueue {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n userEmail?: string | null;\n endpoint?: string | null;\n errorMessage?: string | null;\n status?: string | null;\n}\n\nexport interface RunLOCalculation {\n loanID: string;\n loanAmount?: string | null;\n totalMortgageAmount?: string | null;\n propertyValue?: string | null;\n propertyType?: string | null;\n loanType?: string | null;\n zipCode?: string | null;\n county?: string | null;\n loanPurpose?: string | null;\n propertyOccupancy?: string | null;\n escrow?: string | null;\n loanTerm1?: string | null;\n loanTerm2?: string | null;\n creditScore?: string | null;\n taxes?: string | null;\n insurance?: string | null;\n borrowerIncome?: string | null;\n loanProgram?: string | null;\n rate?: string | null;\n monthlyPayment?: string | null;\n principleAndInterestPITIField?: string | null;\n dtiFront?: string | null;\n dtiBack?: string | null;\n ltvFront?: string | null;\n ltvBack?: string | null;\n totalCashtoClose?: string | null;\n apr?: string | null;\n flood?: string | null;\n hoa?: string | null;\n miFactor?: string | null;\n mi?: string | null;\n totalAssets?: string | null;\n loanLocked: boolean;\n canGeneratePreQual: boolean;\n canGeneratePreApproval: boolean;\n preApprovalNotes?: string | null;\n additionalPreApprovalNotes?: string | null;\n downPaymentAmount?: string | null;\n downPaymentPercent?: string | null;\n lienType?: string | null;\n}\n\nexport interface RunLOCalculationRequest {\n /** @minLength 1 */\n loanID: string;\n /** @minLength 1 */\n loanAmount: string;\n /** @minLength 1 */\n propertyValue: string;\n propertyType?: string | null;\n zipCode?: string | null;\n county?: string | null;\n /** @minLength 1 */\n loanPurpose: string;\n propertyOccupancy?: string | null;\n escrow?: string | null;\n /** @minLength 1 */\n loanTerm1: string;\n /** @minLength 1 */\n loanTerm2: string;\n creditScore?: string | null;\n taxes?: string | null;\n insurance?: string | null;\n rate?: string | null;\n /** @minLength 1 */\n loanType: string;\n flood?: string | null;\n hoa?: string | null;\n miFactor?: string | null;\n downpaymentAmount?: string | null;\n /** @minLength 1 */\n lienType: string;\n preApprovalNotes?: string | null;\n additionalPreApprovalNotes?: string | null;\n}\n\nexport type SSOIntegrationType = \"ConsumerConnect\" | \"TheBigPOS\";\n\nexport interface SSOToken {\n /** @format uuid */\n ssoTokenForSignIn: string;\n ssoRedirectUriForSignIn: string;\n}\n\nexport interface SSOTokenRequest {\n /**\n * @format email\n * @minLength 1\n */\n email: string;\n /** @minLength 1 */\n redirectUri: string;\n}\n\nexport interface SamlMetadataRequest {\n ssoIntegration: \"ConsumerConnect\" | \"TheBigPOS\";\n}\n\nexport interface SendForgotPasswordRequest {\n /**\n * @format email\n * @minLength 1\n */\n email: string;\n /** @format uuid */\n siteConfigurationId?: string | null;\n}\n\nexport interface SendNotificationForLoanRequest {\n /** @minLength 1 */\n loanID: string;\n templateName: string;\n loanOfficerEmail?: string | null;\n /** @format uuid */\n siteConfigurationId?: string | null;\n /** @minLength 1 */\n email: string;\n phone?: string | null;\n attachments: Attachment[];\n}\n\nexport interface SiteConfiguration {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n type: \"None\" | \"Account\" | \"Corporate\" | \"Branch\" | \"LoanOfficer\" | \"Partner\";\n /** @format uuid */\n entityID: string;\n /** @format int32 */\n entityType: number;\n /** @minLength 1 */\n url: string;\n name: string;\n introduction?: string | null;\n introductionTitle?: string | null;\n /**\n * @format int64\n * @min 1000\n * @max 999999999999\n */\n nmlsid: number;\n address?: string | null;\n address2?: string | null;\n city?: string | null;\n state?: string | null;\n zip?: string | null;\n phone?: string | null;\n fax?: string | null;\n tollFree?: string | null;\n logoUrl?: string | null;\n portalLogoUrl?: string | null;\n mobileAppLogoUrl?: string | null;\n iconUrl?: string | null;\n bannerUrl?: string | null;\n secondaryBannerUrl?: string | null;\n profilePhotoUrl?: string | null;\n primaryColor?: string | null;\n secondaryColor?: string | null;\n textColor?: string | null;\n companyUrl?: string | null;\n termsUrl?: string | null;\n privacyPolicyUrl?: string | null;\n facebookUrl?: string | null;\n twitterUrl?: string | null;\n instagramUrl?: string | null;\n linkedInUrl?: string | null;\n licenses: string[];\n contactUsUrl?: string | null;\n licenseInfoUrl?: string | null;\n backgroundColor?: string | null;\n headerAlignment?: string | null;\n email?: string | null;\n /** @format int32 */\n landingPageType?: number | null;\n confirmPassword?: boolean | null;\n pageNotFoundUrl?: string | null;\n footerDisclaimerText1?: string | null;\n footerDisclaimerText2?: string | null;\n locationImageUrl?: string | null;\n eppsUserName?: string | null;\n mobilePrequalIconUrl?: string | null;\n fullAppIconUrl?: string | null;\n ringCenralIconUrl?: string | null;\n alexaIconUrl?: string | null;\n mobileAppIconUrl?: string | null;\n profilePhotoPlaceholderUrl?: string | null;\n losUserID?: string | null;\n iconColor?: string | null;\n /** @format uuid */\n byPhoneStaticIconID?: string | null;\n /** @format uuid */\n byPhoneAnimatedIconID?: string | null;\n /** @format uuid */\n shortAppStaticIconID?: string | null;\n /** @format uuid */\n shortAppAnimatedIconID?: string | null;\n /** @format uuid */\n fullAppStaticIconID?: string | null;\n /** @format uuid */\n fullAppAnimatedIconID?: string | null;\n /** @format uuid */\n rulesStaticIconID?: string | null;\n /** @format uuid */\n rulesAnimatedIconID?: string | null;\n /** @format uuid */\n myProfileStaticIconID?: string | null;\n /** @format uuid */\n myProfileAnimatedIconID?: string | null;\n /** @format uuid */\n accountSettingsStaticIconID?: string | null;\n /** @format uuid */\n accountSettingsAnimatedIconID?: string | null;\n /** @format uuid */\n brandStaticIconID?: string | null;\n /** @format uuid */\n brandAnimatedIconID?: string | null;\n /** @format uuid */\n branchesStaticIconID?: string | null;\n /** @format uuid */\n branchesAnimatedIconID?: string | null;\n /** @format uuid */\n loanOfficersStaticIconID?: string | null;\n /** @format uuid */\n loanOfficersAnimatedIconID?: string | null;\n /** @format uuid */\n usersStaticIconID?: string | null;\n /** @format uuid */\n usersAnimatedIconID?: string | null;\n counties: string[];\n /** @format uuid */\n pipelineStaticIconID?: string | null;\n /** @format uuid */\n pipelineAnimatedIconID?: string | null;\n /** @format uuid */\n loanApplicationsStaticIconID?: string | null;\n /** @format uuid */\n loanApplicationsAnimatedIconID?: string | null;\n /** @format uuid */\n documentsStaticIconID?: string | null;\n /** @format uuid */\n documentsAnimatedIconID?: string | null;\n /** @format uuid */\n calculatorStaticIconID?: string | null;\n /** @format uuid */\n calculatorAnimatedIconID?: string | null;\n /** @format uuid */\n dashboardStaticIconID?: string | null;\n /** @format uuid */\n dashboardAnimatedIconID?: string | null;\n /** @format uuid */\n signOutAnimatedIconID?: string | null;\n /** @format uuid */\n signInStaticIconID?: string | null;\n /** @format uuid */\n signInAnimatedIconID?: string | null;\n /** @format uuid */\n signOutStaticIconID?: string | null;\n backgroundImageUrl?: string | null;\n disclosuresUrl?: string | null;\n /** @format uuid */\n addCoBorrowerStaticIconID?: string | null;\n /** @format uuid */\n addCoBorrowerAnimatedIconID?: string | null;\n disclosuresSSOSiteID?: string | null;\n loanChannel?: string | null;\n loanFolder?: string | null;\n loanTemplate?: string | null;\n fromEmail?: string | null;\n ccEmails?: string | null;\n irsVerificationUrl?: string | null;\n byPhoneTitle?: string | null;\n byPhoneSubtitle?: string | null;\n shortAppTitle?: string | null;\n shortAppSubtitle?: string | null;\n fullAppTitle?: string | null;\n fullAppSubtitle?: string | null;\n spanishPrequalTitle?: string | null;\n spanishPrequalSubtitle?: string | null;\n spanishFullAppTitle?: string | null;\n spanishFullAppSubtitle?: string | null;\n userTitle?: string | null;\n darkModeLogoUrl?: string | null;\n darkModePortalLogoUrl?: string | null;\n darkModeIconUrl?: string | null;\n darkModePrimaryColor?: string | null;\n darkModeSecondaryColor?: string | null;\n calendarUrl?: string | null;\n surveysUrl?: string | null;\n enabledServices: EnabledServices;\n company: Company;\n companyName?: string | null;\n companySiteUrl?: string | null;\n companyAddress?: string | null;\n companyAddress2?: string | null;\n companyCity?: string | null;\n companyState?: string | null;\n companyZip?: string | null;\n companyPhone?: string | null;\n companyFax?: string | null;\n companyNMLSID?: string | null;\n branchName?: string | null;\n branchNMLSID?: string | null;\n mfaPreference?: string | null;\n /** @format int32 */\n allowedLoginsWithoutMFA: number;\n modules: Module[];\n user?: UserPublic | null;\n asoSettings?: ASOSettings | null;\n accountSettings: AccountSettings;\n}\n\nexport interface SiteConfigurationByUrl {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n type: \"None\" | \"Account\" | \"Corporate\" | \"Branch\" | \"LoanOfficer\" | \"Partner\";\n /** @format uuid */\n entityID: string;\n /** @format int32 */\n entityType: number;\n /** @minLength 1 */\n url: string;\n name: string;\n introduction?: string | null;\n introductionTitle?: string | null;\n /**\n * @format int64\n * @min 1000\n * @max 999999999999\n */\n nmlsid: number;\n address?: string | null;\n address2?: string | null;\n city?: string | null;\n state?: string | null;\n zip?: string | null;\n phone?: string | null;\n fax?: string | null;\n tollFree?: string | null;\n logoUrl?: string | null;\n portalLogoUrl?: string | null;\n mobileAppLogoUrl?: string | null;\n iconUrl?: string | null;\n bannerUrl?: string | null;\n secondaryBannerUrl?: string | null;\n profilePhotoUrl?: string | null;\n primaryColor?: string | null;\n secondaryColor?: string | null;\n textColor?: string | null;\n companyUrl?: string | null;\n termsUrl?: string | null;\n privacyPolicyUrl?: string | null;\n facebookUrl?: string | null;\n twitterUrl?: string | null;\n instagramUrl?: string | null;\n linkedInUrl?: string | null;\n licenses: string[];\n contactUsUrl?: string | null;\n licenseInfoUrl?: string | null;\n backgroundColor?: string | null;\n headerAlignment?: string | null;\n email?: string | null;\n /** @format int32 */\n landingPageType?: number | null;\n confirmPassword?: boolean | null;\n pageNotFoundUrl?: string | null;\n footerDisclaimerText1?: string | null;\n footerDisclaimerText2?: string | null;\n locationImageUrl?: string | null;\n eppsUserName?: string | null;\n mobilePrequalIconUrl?: string | null;\n fullAppIconUrl?: string | null;\n ringCenralIconUrl?: string | null;\n alexaIconUrl?: string | null;\n mobileAppIconUrl?: string | null;\n profilePhotoPlaceholderUrl?: string | null;\n losUserID?: string | null;\n iconColor?: string | null;\n /** @format uuid */\n byPhoneStaticIconID?: string | null;\n /** @format uuid */\n byPhoneAnimatedIconID?: string | null;\n /** @format uuid */\n shortAppStaticIconID?: string | null;\n /** @format uuid */\n shortAppAnimatedIconID?: string | null;\n /** @format uuid */\n fullAppStaticIconID?: string | null;\n /** @format uuid */\n fullAppAnimatedIconID?: string | null;\n /** @format uuid */\n rulesStaticIconID?: string | null;\n /** @format uuid */\n rulesAnimatedIconID?: string | null;\n /** @format uuid */\n myProfileStaticIconID?: string | null;\n /** @format uuid */\n myProfileAnimatedIconID?: string | null;\n /** @format uuid */\n accountSettingsStaticIconID?: string | null;\n /** @format uuid */\n accountSettingsAnimatedIconID?: string | null;\n /** @format uuid */\n brandStaticIconID?: string | null;\n /** @format uuid */\n brandAnimatedIconID?: string | null;\n /** @format uuid */\n branchesStaticIconID?: string | null;\n /** @format uuid */\n branchesAnimatedIconID?: string | null;\n /** @format uuid */\n loanOfficersStaticIconID?: string | null;\n /** @format uuid */\n loanOfficersAnimatedIconID?: string | null;\n /** @format uuid */\n usersStaticIconID?: string | null;\n /** @format uuid */\n usersAnimatedIconID?: string | null;\n counties: string[];\n /** @format uuid */\n pipelineStaticIconID?: string | null;\n /** @format uuid */\n pipelineAnimatedIconID?: string | null;\n /** @format uuid */\n loanApplicationsStaticIconID?: string | null;\n /** @format uuid */\n loanApplicationsAnimatedIconID?: string | null;\n /** @format uuid */\n documentsStaticIconID?: string | null;\n /** @format uuid */\n documentsAnimatedIconID?: string | null;\n /** @format uuid */\n calculatorStaticIconID?: string | null;\n /** @format uuid */\n calculatorAnimatedIconID?: string | null;\n /** @format uuid */\n dashboardStaticIconID?: string | null;\n /** @format uuid */\n dashboardAnimatedIconID?: string | null;\n /** @format uuid */\n signOutAnimatedIconID?: string | null;\n /** @format uuid */\n signInStaticIconID?: string | null;\n /** @format uuid */\n signInAnimatedIconID?: string | null;\n /** @format uuid */\n signOutStaticIconID?: string | null;\n backgroundImageUrl?: string | null;\n disclosuresUrl?: string | null;\n /** @format uuid */\n addCoBorrowerStaticIconID?: string | null;\n /** @format uuid */\n addCoBorrowerAnimatedIconID?: string | null;\n disclosuresSSOSiteID?: string | null;\n loanChannel?: string | null;\n loanFolder?: string | null;\n loanTemplate?: string | null;\n fromEmail?: string | null;\n ccEmails?: string | null;\n irsVerificationUrl?: string | null;\n byPhoneTitle?: string | null;\n byPhoneSubtitle?: string | null;\n shortAppTitle?: string | null;\n shortAppSubtitle?: string | null;\n fullAppTitle?: string | null;\n fullAppSubtitle?: string | null;\n spanishPrequalTitle?: string | null;\n spanishPrequalSubtitle?: string | null;\n spanishFullAppTitle?: string | null;\n spanishFullAppSubtitle?: string | null;\n userTitle?: string | null;\n darkModeLogoUrl?: string | null;\n darkModePortalLogoUrl?: string | null;\n darkModeIconUrl?: string | null;\n darkModePrimaryColor?: string | null;\n darkModeSecondaryColor?: string | null;\n calendarUrl?: string | null;\n surveysUrl?: string | null;\n enabledServices: EnabledServices;\n company: Company;\n companyName?: string | null;\n companySiteUrl?: string | null;\n companyAddress?: string | null;\n companyAddress2?: string | null;\n companyCity?: string | null;\n companyState?: string | null;\n companyZip?: string | null;\n companyPhone?: string | null;\n companyFax?: string | null;\n companyNMLSID?: string | null;\n branchName?: string | null;\n branchNMLSID?: string | null;\n mfaPreference?: string | null;\n /** @format int32 */\n allowedLoginsWithoutMFA: number;\n modules: Module[];\n user?: UserPublic | null;\n asoSettings?: ASOSettings | null;\n accountSettings: AccountSettings;\n workflows: Workflow[];\n}\n\nexport interface SiteConfigurationForm {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id?: string | null;\n /** @format uuid */\n siteConfigurationID: string;\n /** @format uuid */\n formID: string;\n formType?: string | null;\n slug?: string | null;\n userRole: string;\n borrowerType: string;\n tileLocation: string;\n icon: string;\n entityTypes: string[];\n}\n\nexport interface SiteConfigurationReduced {\n /** @format uuid */\n id: string;\n type: \"None\" | \"Account\" | \"Corporate\" | \"Branch\" | \"LoanOfficer\" | \"Partner\";\n url?: string | null;\n name: string;\n /** @format int64 */\n nmlsid: number;\n email?: string | null;\n companyName?: string | null;\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n}\n\nexport interface SiteConfigurationRequest {\n /** @format uuid */\n entityID: string;\n /** @format int32 */\n entityType: number;\n type: \"None\" | \"Account\" | \"Corporate\" | \"Branch\" | \"LoanOfficer\" | \"Partner\";\n url: string;\n name: string;\n introduction?: string | null;\n introductionTitle?: string | null;\n /** @format int64 */\n nmlsid: number;\n address?: string | null;\n address2?: string | null;\n city?: string | null;\n state?: string | null;\n zip?: string | null;\n phone?: string | null;\n fax?: string | null;\n tollFree?: string | null;\n logoUrl?: string | null;\n portalLogoUrl?: string | null;\n mobileAppLogoUrl?: string | null;\n iconUrl?: string | null;\n bannerUrl?: string | null;\n secondaryBannerUrl?: string | null;\n profilePhotoUrl?: string | null;\n primaryColor?: string | null;\n secondaryColor?: string | null;\n textColor?: string | null;\n companyUrl?: string | null;\n termsUrl?: string | null;\n privacyPolicyUrl?: string | null;\n facebookUrl?: string | null;\n twitterUrl?: string | null;\n instagramUrl?: string | null;\n linkedInUrl?: string | null;\n licenses: string[];\n contactUsUrl?: string | null;\n licenseInfoUrl?: string | null;\n backgroundColor?: string | null;\n headerAlignment?: string | null;\n email?: string | null;\n /** @format int32 */\n landingPageType?: number | null;\n confirmPassword?: boolean | null;\n pageNotFoundUrl?: string | null;\n footerDisclaimerText1?: string | null;\n footerDisclaimerText2?: string | null;\n locationImageUrl?: string | null;\n eppsUserName?: string | null;\n mobilePrequalIconUrl?: string | null;\n fullAppIconUrl?: string | null;\n ringCenralIconUrl?: string | null;\n alexaIconUrl?: string | null;\n mobileAppIconUrl?: string | null;\n profilePhotoPlaceholderUrl?: string | null;\n losUserID?: string | null;\n iconColor?: string | null;\n /** @format uuid */\n byPhoneStaticIconID?: string | null;\n /** @format uuid */\n byPhoneAnimatedIconID?: string | null;\n /** @format uuid */\n shortAppStaticIconID?: string | null;\n /** @format uuid */\n shortAppAnimatedIconID?: string | null;\n /** @format uuid */\n fullAppStaticIconID?: string | null;\n /** @format uuid */\n fullAppAnimatedIconID?: string | null;\n /** @format uuid */\n rulesStaticIconID?: string | null;\n /** @format uuid */\n rulesAnimatedIconID?: string | null;\n /** @format uuid */\n myProfileStaticIconID?: string | null;\n /** @format uuid */\n myProfileAnimatedIconID?: string | null;\n /** @format uuid */\n accountSettingsStaticIconID?: string | null;\n /** @format uuid */\n accountSettingsAnimatedIconID?: string | null;\n /** @format uuid */\n brandStaticIconID?: string | null;\n /** @format uuid */\n brandAnimatedIconID?: string | null;\n /** @format uuid */\n branchesStaticIconID?: string | null;\n /** @format uuid */\n branchesAnimatedIconID?: string | null;\n /** @format uuid */\n loanOfficersStaticIconID?: string | null;\n /** @format uuid */\n loanOfficersAnimatedIconID?: string | null;\n /** @format uuid */\n usersStaticIconID?: string | null;\n /** @format uuid */\n usersAnimatedIconID?: string | null;\n counties: string[];\n /** @format uuid */\n pipelineStaticIconID?: string | null;\n /** @format uuid */\n pipelineAnimatedIconID?: string | null;\n /** @format uuid */\n loanApplicationsStaticIconID?: string | null;\n /** @format uuid */\n loanApplicationsAnimatedIconID?: string | null;\n /** @format uuid */\n documentsStaticIconID?: string | null;\n /** @format uuid */\n documentsAnimatedIconID?: string | null;\n /** @format uuid */\n calculatorStaticIconID?: string | null;\n /** @format uuid */\n calculatorAnimatedIconID?: string | null;\n /** @format uuid */\n dashboardStaticIconID?: string | null;\n /** @format uuid */\n dashboardAnimatedIconID?: string | null;\n /** @format uuid */\n signOutAnimatedIconID?: string | null;\n /** @format uuid */\n signInStaticIconID?: string | null;\n /** @format uuid */\n signInAnimatedIconID?: string | null;\n /** @format uuid */\n signOutStaticIconID?: string | null;\n backgroundImageUrl?: string | null;\n disclosuresUrl?: string | null;\n /** @format uuid */\n addCoBorrowerStaticIconID?: string | null;\n /** @format uuid */\n addCoBorrowerAnimatedIconID?: string | null;\n disclosuresSSOSiteID?: string | null;\n loanChannel?: string | null;\n loanFolder?: string | null;\n loanTemplate?: string | null;\n fromEmail?: string | null;\n ccEmails?: string | null;\n irsVerificationUrl?: string | null;\n byPhoneTitle?: string | null;\n byPhoneSubtitle?: string | null;\n shortAppTitle?: string | null;\n shortAppSubtitle?: string | null;\n fullAppTitle?: string | null;\n fullAppSubtitle?: string | null;\n spanishPrequalTitle?: string | null;\n spanishPrequalSubtitle?: string | null;\n spanishFullAppTitle?: string | null;\n spanishFullAppSubtitle?: string | null;\n darkModeLogoUrl?: string | null;\n darkModePortalLogoUrl?: string | null;\n darkModeIconUrl?: string | null;\n darkModePrimaryColor?: string | null;\n darkModeSecondaryColor?: string | null;\n calendarUrl?: string | null;\n surveysUrl?: string | null;\n enabledServices: EnabledServices;\n modules?: Module[] | null;\n /** @format uuid */\n userID?: string | null;\n}\n\nexport interface SiteConfigurationSearchCriteria {\n searchText?: string | null;\n isActive?: boolean | null;\n entityType?: EntityType | null;\n /** @format uuid */\n branch?: string | null;\n /** @format uuid */\n brand?: string | null;\n role?: UserRole | null;\n branchType?: BranchType | null;\n}\n\nexport interface SiteConfigurationSummary {\n /** @format uuid */\n id: string;\n type: \"None\" | \"Account\" | \"Corporate\" | \"Branch\" | \"LoanOfficer\" | \"Partner\";\n url?: string | null;\n name: string;\n /** @format int64 */\n nmlsid: number;\n email?: string | null;\n companyName?: string | null;\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n branch?: BranchBase | null;\n corporate?: CorporateBase | null;\n loanOfficer?: User | null;\n realtor?: User | null;\n branchName?: string | null;\n}\n\nexport interface SiteConfigurationSummaryPaginated {\n rows: SiteConfigurationSummary[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport type SiteConfigurationType = \"None\" | \"Account\" | \"Corporate\" | \"Branch\" | \"LoanOfficer\" | \"Partner\";\n\nexport interface SiteConfigurationWithInherited {\n siteConfiguration: SiteConfiguration;\n inheritedSiteConfiguration?: SiteConfiguration | null;\n}\n\nexport interface SocialSurveyRecord {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n review: string;\n /** @format double */\n rating: number;\n firstName: string;\n lastName: string;\n /** @format date-time */\n reviewCompletedTimeStamp?: string | null;\n}\n\nexport interface SurveyEmailRequest {\n /** @minLength 1 */\n loanOfficerEmailAddress: string;\n}\n\nexport interface SystemTokenRequest {\n /** @minLength 1 */\n clientId: string;\n /** @minLength 1 */\n clientSecret: string;\n}\n\nexport interface Task {\n /** @format date-time */\n createdAt: string;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n name: string;\n description?: string | null;\n type: string;\n losTarget?: string | null;\n targetUserRole?: string | null;\n /** @format int32 */\n daysDueFromApplication?: number | null;\n /** @format int32 */\n weight: number;\n isGlobal: boolean;\n /** @format uuid */\n id: string;\n user?: User | null;\n isFromLegacySource: boolean;\n usedInBusinessRule: boolean;\n willAutocompleteAfterResponse: boolean;\n hasAutoPropagationOnAdd: boolean;\n}\n\nexport interface TaskComment {\n /** @format uuid */\n id: string;\n comment: string;\n createdBy: UserBase;\n /** @format date-time */\n createdAt: string;\n}\n\nexport interface TaskCommentPaginated {\n rows: TaskComment[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface TaskCommentRequest {\n comment: string;\n}\n\nexport interface TaskCommentSearchCriteria {\n searchText?: string | null;\n}\n\nexport interface TaskPaginated {\n rows: Task[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface TaskRequest {\n /** @minLength 1 */\n name: string;\n description?: string | null;\n losTarget?: string | null;\n type: string;\n targetUserRole?: string | null;\n /**\n * @format int32\n * @min 0\n */\n daysDueFromApplication?: number | null;\n /** @format int32 */\n weight: number;\n isGlobal: boolean;\n willAutocompleteAfterResponse: boolean;\n hasAutoPropagationOnAdd: boolean;\n}\n\nexport interface TaskSearchCriteria {\n searchText?: string | null;\n isBusinessRule?: boolean | null;\n isGlobal?: boolean | null;\n excludedIds?: string[] | null;\n}\n\nexport interface TaskUpdateRequest {\n /** @minLength 1 */\n name: string;\n description?: string | null;\n losTarget?: string | null;\n type: string;\n targetUserRole?: string | null;\n /**\n * @format int32\n * @min 0\n */\n daysDueFromApplication?: number | null;\n /** @format int32 */\n weight: number;\n isGlobal: boolean;\n willAutocompleteAfterResponse: boolean;\n hasAutoPropagationOnAdd: boolean;\n /** @format uuid */\n id: string;\n}\n\nexport interface TestSendNotificationForLoanRequest {\n loanData: Record;\n /** @format uuid */\n siteConfigurationId: string;\n toAddress?: string | null;\n toPhoneNumber?: string | null;\n templateName?: string | null;\n attachments: Attachment[];\n}\n\nexport interface Theme {\n logoURL: string;\n primaryColor: string;\n secondaryColor: string;\n backgroundColor?: string | null;\n textColor?: string | null;\n iconColor?: string | null;\n}\n\nexport interface Token {\n token_type: string;\n /** @format int32 */\n expires_in: number;\n access_token: string;\n refresh_token: string;\n scope: string;\n}\n\nexport interface TokenChallengeRequest {\n /** @format email */\n username: string;\n /** @minLength 1 */\n sessionId: string;\n /** @minLength 1 */\n code: string;\n /**\n * @format uuid\n * @minLength 1\n */\n siteConfigurationId: string;\n isSupport: boolean;\n}\n\nexport interface TokenRequest {\n /** @format email */\n username: string;\n /** @minLength 1 */\n password: string;\n /** @format uuid */\n siteConfigurationId?: string | null;\n isSupport: boolean;\n}\n\nexport interface UnderwritingCondition {\n /** @format uuid */\n id: string;\n conditionType: string;\n isRemoved: boolean;\n title: string;\n description?: string | null;\n forAllApplications: boolean;\n source?: string | null;\n /** @format date-time */\n expectedDate?: string | null;\n status: string;\n /** @format date-time */\n statusDate?: string | null;\n /** @format int32 */\n daysToReceive: number;\n requestedFrom?: string | null;\n /** @format date-time */\n createdDate?: string | null;\n createdBy?: CommentUserInformation | null;\n isRequested: boolean;\n /** @format date-time */\n requestedDate?: string | null;\n requestedBy?: CommentUserInformation | null;\n isReceived: boolean;\n /** @format date-time */\n receivedDate?: string | null;\n receivedBy?: CommentUserInformation | null;\n priorTo?: string | null;\n category?: string | null;\n isFulfilled: boolean;\n /** @format date-time */\n fulfilledDate?: string | null;\n fulfilledBy?: CommentUserInformation | null;\n comments: ConditionComment[];\n allowToClear: boolean;\n printExternally: boolean;\n printInternally: boolean;\n}\n\nexport interface UnprocessableEntity {\n message: string;\n errors: UnprocessableEntityError[];\n}\n\nexport interface UnprocessableEntityError {\n error: string;\n property: string;\n}\n\nexport interface UpdateAccountRequest {\n name: string;\n mfaPreference: string;\n /** @format int32 */\n allowedLoginsWithoutMFA: number;\n losSettings: LOSSettingsUpdateRequest;\n asoSettings?: ASOSettings | null;\n settings: AccountSettingsRequest;\n}\n\nexport interface UpdateDocumentTemplateRequest {\n /** @minLength 1 */\n htmlBody: string;\n /**\n * @minLength 1\n * @maxLength 255\n */\n name: string;\n description?: string | null;\n destinationBucket?: string | null;\n status: string;\n}\n\nexport interface UpdateListingFileRequest {\n /** @format uuid */\n id: string;\n /** @format int32 */\n weight: number;\n /**\n * @minLength 1\n * @maxLength 250\n */\n name: string;\n}\n\nexport interface UpdateListingPhotoRequest {\n /** @format uuid */\n id: string;\n /**\n * @minLength 1\n * @maxLength 250\n */\n name: string;\n /** @maxLength 500 */\n description?: string | null;\n /** @format int32 */\n weight: number;\n}\n\nexport interface UpdateLoanQueueRequest {\n data: any;\n}\n\nexport interface UpdateMeRequest {\n phone?: string | null;\n /**\n * @minLength 1\n * @maxLength 255\n */\n firstName: string;\n /**\n * @minLength 1\n * @maxLength 255\n */\n lastName: string;\n title?: string | null;\n forcePasswordReset: boolean;\n mfaEnabled: boolean;\n notificationSettings: UserNotificationSettingsUpdateRequest;\n}\n\nexport interface UpdateMobilePhoneRequest {\n phone: string;\n}\n\nexport interface UpdateUserRequest {\n phone?: string | null;\n /**\n * @minLength 1\n * @maxLength 255\n */\n firstName: string;\n /**\n * @minLength 1\n * @maxLength 255\n */\n lastName: string;\n title?: string | null;\n /** @format uuid */\n branchId?: string | null;\n forcePasswordReset: boolean;\n mfaEnabled: boolean;\n}\n\nexport interface User {\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n updatedAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n /** @format uuid */\n id: string;\n role: string;\n firstName: string;\n lastName: string;\n email: string;\n phone?: string | null;\n title?: string | null;\n forcePasswordReset: boolean;\n mfaEnabled: boolean;\n phoneVerified: boolean;\n /** @format int32 */\n loginsWithoutMFACount: number;\n canImpersonate: boolean;\n}\n\nexport interface UserAccountDeletionRequest {\n feedback: string;\n}\n\nexport interface UserBase {\n /** @format uuid */\n id: string;\n role: string;\n firstName: string;\n lastName: string;\n email: string;\n}\n\nexport interface UserLoan {\n loanID: string;\n customLoanData?: CustomLoanData | null;\n}\n\nexport interface UserLoanTask {\n /** @format uuid */\n id: string;\n status: string;\n /** @format date-time */\n statusChangedDate?: string | null;\n task: Task;\n user: User;\n value?: string | null;\n documents: LoanDocument[];\n loanID: string;\n /** @format date-time */\n completedDate?: string | null;\n /** @format date-time */\n createdAt: string;\n createdBy: User;\n submittedBy?: User | null;\n completedBy?: User | null;\n /** @format int32 */\n commentsCount: number;\n}\n\nexport interface UserLoanTaskRequest {\n value?: string | null;\n /**\n * @format uuid\n * @minLength 1\n */\n userID: string;\n}\n\nexport interface UserLoanTaskUpdateRequest {\n status?: string | null;\n value?: string | null;\n}\n\nexport interface UserMobilePhoneVerificationRequest {\n /** @minLength 1 */\n code: string;\n}\n\nexport interface UserNotificationSettings {\n emailEnabled: boolean;\n textEnabled: boolean;\n textOptIn?: boolean | null;\n}\n\nexport interface UserNotificationSettingsUpdateRequest {\n emailEnabled: boolean;\n textEnabled: boolean;\n textOptIn?: boolean | null;\n}\n\nexport interface UserPaginated {\n rows: User[];\n pagination: Pagination;\n /** @format int64 */\n count: number;\n}\n\nexport interface UserPublic {\n /** @format uuid */\n id: string;\n role: string;\n firstName: string;\n lastName: string;\n email: string;\n phone?: string | null;\n title?: string | null;\n}\n\nexport interface UserRelation {\n /**\n * @format uuid\n * @minLength 1\n */\n userId1: string;\n /**\n * @format uuid\n * @minLength 1\n */\n userId2: string;\n /** @minLength 1 */\n relationType: string;\n /** @format uuid */\n id: string;\n user1Email: string;\n user1Role: string;\n user2Email: string;\n user2Role: string;\n}\n\nexport interface UserRelationship {\n /** @format uuid */\n id: string;\n role: string;\n firstName?: string | null;\n lastName?: string | null;\n email?: string | null;\n phone?: string | null;\n siteConfigurations: SiteConfigurationReduced[];\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n}\n\nexport interface UserRelationshipProspect {\n /** @format uuid */\n id: string;\n role: string;\n firstName: string;\n lastName: string;\n email: string;\n contactPhone?: string | null;\n licenseNumber?: string | null;\n /** @format uuid */\n branchID: string;\n companyName?: string | null;\n /** @format date-time */\n createdAt?: string | null;\n /** @format date-time */\n deletedAt?: string | null;\n}\n\nexport type UserRole =\n | \"Borrower\"\n | \"LoanOfficer\"\n | \"Admin\"\n | \"SuperAdmin\"\n | \"Realtor\"\n | \"SettlementAgent\"\n | \"LoanProcessor\"\n | \"LoanOfficerAssistant\"\n | \"BranchManager\"\n | \"SystemAdmin\";\n\nexport interface UserSearchCriteria {\n searchText?: string | null;\n isActive?: boolean | null;\n roles?: string[] | null;\n}\n\nexport interface VerifyPasswordRequest {\n /**\n * @format email\n * @minLength 1\n */\n email: string;\n /** @minLength 1 */\n code: string;\n /** @minLength 8 */\n password: string;\n /** @format uuid */\n siteConfigurationId?: string | null;\n}\n\nexport interface Workflow {\n formType: string;\n target: string;\n authType: string;\n name: string;\n isDefault: boolean;\n description: string;\n slug: string;\n status: string;\n userRole: string;\n borrowerType: string;\n showProgressBar: boolean;\n showTile: boolean;\n tileLocation: string;\n tileText: string;\n tileSubtitle: string;\n icon: string;\n}\n\nimport type { AxiosInstance, AxiosRequestConfig, AxiosResponse, HeadersDefaults, ResponseType } from \"axios\";\nimport axios from \"axios\";\n\nexport type QueryParamsType = Record;\n\nexport interface FullRequestParams extends Omit {\n /** set parameter to `true` for call `securityWorker` for this request */\n secure?: boolean;\n /** request path */\n path: string;\n /** content type of request body */\n type?: ContentType;\n /** query params */\n query?: QueryParamsType;\n /** format of response (i.e. response.json() -> format: \"json\") */\n format?: ResponseType;\n /** request body */\n body?: unknown;\n}\n\nexport type RequestParams = Omit;\n\nexport interface ApiConfig extends Omit {\n securityWorker?: (\n securityData: SecurityDataType | null,\n ) => Promise | AxiosRequestConfig | void;\n secure?: boolean;\n format?: ResponseType;\n}\n\nexport enum ContentType {\n Json = \"application/json\",\n FormData = \"multipart/form-data\",\n UrlEncoded = \"application/x-www-form-urlencoded\",\n Text = \"text/plain\",\n}\n\nexport class HttpClient {\n public instance: AxiosInstance;\n private securityData: SecurityDataType | null = null;\n private securityWorker?: ApiConfig[\"securityWorker\"];\n private secure?: boolean;\n private format?: ResponseType;\n\n constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig = {}) {\n this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || \"\" });\n this.secure = secure;\n this.format = format;\n this.securityWorker = securityWorker;\n }\n\n public setSecurityData = (data: SecurityDataType | null) => {\n this.securityData = data;\n };\n\n protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig {\n const method = params1.method || (params2 && params2.method);\n\n return {\n ...this.instance.defaults,\n ...params1,\n ...(params2 || {}),\n headers: {\n ...((method && this.instance.defaults.headers[method.toLowerCase() as keyof HeadersDefaults]) || {}),\n ...(params1.headers || {}),\n ...((params2 && params2.headers) || {}),\n },\n };\n }\n\n protected stringifyFormItem(formItem: unknown) {\n if (typeof formItem === \"object\" && formItem !== null) {\n return JSON.stringify(formItem);\n } else {\n return `${formItem}`;\n }\n }\n\n protected createFormData(input: Record): FormData {\n if (input instanceof FormData) {\n return input;\n }\n return Object.keys(input || {}).reduce((formData, key) => {\n const property = input[key];\n const propertyContent: any[] = property instanceof Array ? property : [property];\n\n for (const formItem of propertyContent) {\n const isFileType = formItem instanceof Blob || formItem instanceof File;\n formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));\n }\n\n return formData;\n }, new FormData());\n }\n\n public request = async ({\n secure,\n path,\n type,\n query,\n format,\n body,\n ...params\n }: FullRequestParams): Promise> => {\n const secureParams =\n ((typeof secure === \"boolean\" ? secure : this.secure) &&\n this.securityWorker &&\n (await this.securityWorker(this.securityData))) ||\n {};\n const requestParams = this.mergeRequestParams(params, secureParams);\n const responseFormat = format || this.format || undefined;\n\n if (type === ContentType.FormData && body && body !== null && typeof body === \"object\") {\n body = this.createFormData(body as Record);\n }\n\n if (type === ContentType.Text && body && body !== null && typeof body !== \"string\") {\n body = JSON.stringify(body);\n }\n\n return this.instance.request({\n ...requestParams,\n headers: {\n ...(requestParams.headers || {}),\n ...(type ? { \"Content-Type\": type } : {}),\n },\n params: query,\n responseType: responseFormat,\n data: body,\n url: path,\n });\n };\n}\n\n/**\n * @title The Big POS API\n * @version v2.15.4\n * @termsOfService https://www.thebigpos.com/terms-of-use/\n * @contact Mortgage Automation Technologies (https://www.thebigpos.com/terms-of-use/)\n */\nexport class Api extends HttpClient {\n /**\n * No description\n *\n * @tags Saml\n * @name PostRoot\n * @request POST:/\n * @secure\n */\n postRoot = (params: RequestParams = {}) =>\n this.request({\n path: `/`,\n method: \"POST\",\n secure: true,\n ...params,\n });\n\n api = {\n /**\n * No description\n *\n * @tags Account\n * @name GetMyAccount\n * @summary Get\n * @request GET:/api/account\n * @secure\n */\n getMyAccount: (params: RequestParams = {}) =>\n this.request({\n path: `/api/account`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Account\n * @name ReplaceMyAccount\n * @summary Replace\n * @request PUT:/api/account\n * @secure\n */\n replaceMyAccount: (data: UpdateAccountRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/account`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Account\n * @name GetSiteConfigurationByAccount\n * @summary Get Site Configuration\n * @request GET:/api/account/site-configurations\n * @secure\n */\n getSiteConfigurationByAccount: (params: RequestParams = {}) =>\n this.request({\n path: `/api/account/site-configurations`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Account\n * @name UpdateSiteConfigurationForAccount\n * @summary Update Site Configuration\n * @request PUT:/api/account/site-configurations\n * @secure\n */\n updateSiteConfigurationForAccount: (data: SiteConfiguration, params: RequestParams = {}) =>\n this.request({\n path: `/api/account/site-configurations`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Accounts\n * @name GetAccounts\n * @summary Get All\n * @request GET:/api/accounts\n * @secure\n */\n getAccounts: (params: RequestParams = {}) =>\n this.request({\n path: `/api/accounts`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Accounts\n * @name CreateAccount\n * @summary Create\n * @request POST:/api/accounts\n * @secure\n */\n createAccount: (data: CreateAccountRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/accounts`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Accounts\n * @name GetAccount\n * @summary Get by ID\n * @request GET:/api/accounts/{id}\n * @secure\n */\n getAccount: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/accounts/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Accounts\n * @name DeleteAccount\n * @summary Delete\n * @request DELETE:/api/accounts/{id}\n * @secure\n */\n deleteAccount: (\n id: string,\n query?: {\n /** @default false */\n hardDelete?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/accounts/${id}`,\n method: \"DELETE\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Accounts\n * @name UpdateLoansByAccount\n * @summary Update Loans\n * @request PUT:/api/accounts/{id}/loan\n * @secure\n */\n updateLoansByAccount: (id: string, data: Loan[], params: RequestParams = {}) =>\n this.request({\n path: `/api/accounts/${id}/loan`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Accounts\n * @name GetLoansByAccount\n * @summary Get Loans\n * @request GET:/api/accounts/{id}/loan\n * @secure\n */\n getLoansByAccount: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/accounts/${id}/loan`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Authentication\n * @name GetTokenFromRefreshToken\n * @summary Generate Token From Refresh Token\n * @request POST:/api/refresh-token\n * @secure\n */\n getTokenFromRefreshToken: (data: RefreshTokenRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/refresh-token`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Authentication\n * @name GetToken\n * @summary Get Token\n * @request POST:/api/token\n * @secure\n */\n getToken: (data: TokenRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/token`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Authentication\n * @name GetTokenFromChallengeCode\n * @summary Get Token From Challenge Code\n * @request POST:/api/token/code\n * @secure\n */\n getTokenFromChallengeCode: (data: TokenChallengeRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/token/code`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Authentication\n * @name GetSystemToken\n * @summary Get System Token\n * @request POST:/api/oauth2/token\n * @secure\n */\n getSystemToken: (data: SystemTokenRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/oauth2/token`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Authentication\n * @name GetSsoToken\n * @summary Get SSO Guid Token\n * @request POST:/api/token/sso\n * @secure\n */\n getSsoToken: (data: SSOTokenRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/token/sso`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Branches\n * @name GetBranches\n * @summary Get All\n * @request GET:/api/branches\n * @secure\n */\n getBranches: (\n query?: {\n showAll?: boolean;\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/branches`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Branches\n * @name CreateBranch\n * @summary Create\n * @request POST:/api/branches\n * @secure\n */\n createBranch: (data: CreateBranchRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/branches`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Branches\n * @name SearchBranches\n * @summary Search\n * @request POST:/api/branches/search\n * @secure\n */\n searchBranches: (\n data: BranchSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/branches/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Branches\n * @name GetBranch\n * @summary Get by ID\n * @request GET:/api/branches/{branchId}\n * @secure\n */\n getBranch: (branchId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/branches/${branchId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Branches\n * @name ReplaceBranch\n * @summary Replace\n * @request PUT:/api/branches/{branchId}\n * @secure\n */\n replaceBranch: (branchId: string, data: CreateBranchRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/branches/${branchId}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Branches\n * @name DeleteBranch\n * @summary Delete\n * @request DELETE:/api/branches/{branchId}\n * @secure\n */\n deleteBranch: (branchId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/branches/${branchId}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Branches\n * @name RestoreBranch\n * @summary Restore\n * @request POST:/api/branches/{branchId}/restore\n * @secure\n */\n restoreBranch: (branchId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/branches/${branchId}/restore`,\n method: \"POST\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Branches\n * @name CreateBranchSiteConfiguration\n * @summary Create Branch Site Configuration\n * @request POST:/api/branches/{branchId}/site-configurations\n * @secure\n */\n createBranchSiteConfiguration: (branchId: string, data: SiteConfigurationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/branches/${branchId}/site-configurations`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Branches\n * @name GetBranchSiteConfiguration\n * @summary Get Branch Site Configuration\n * @request GET:/api/branches/{branchId}/site-configurations/{siteConfigurationId}\n * @secure\n */\n getBranchSiteConfiguration: (branchId: string, siteConfigurationId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/branches/${branchId}/site-configurations/${siteConfigurationId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Branches\n * @name ReplaceBranchSiteConfiguration\n * @summary Replace Branch Site Configuration\n * @request PUT:/api/branches/{branchId}/site-configurations/{siteConfigurationId}\n * @secure\n */\n replaceBranchSiteConfiguration: (\n branchId: string,\n siteConfigurationId: string,\n data: SiteConfigurationRequest,\n query?: {\n applyToChildren?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/branches/${branchId}/site-configurations/${siteConfigurationId}`,\n method: \"PUT\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Branches\n * @name GetLoanOfficersByBranch\n * @summary Get Branch Loan Officers\n * @request GET:/api/branches/{branchId}/loan-officers\n * @secure\n */\n getLoanOfficersByBranch: (branchId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/branches/${branchId}/loan-officers`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags BusinessRules\n * @name GetBusinessRules\n * @summary Get All\n * @request GET:/api/business-rules\n * @secure\n */\n getBusinessRules: (\n query?: {\n showAll?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/business-rules`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags BusinessRules\n * @name CreateBusinessRule\n * @summary Create\n * @request POST:/api/business-rules\n * @secure\n */\n createBusinessRule: (data: BusinessRuleRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/business-rules`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags BusinessRules\n * @name GetBusinessRule\n * @summary Get by ID\n * @request GET:/api/business-rules/{id}\n * @secure\n */\n getBusinessRule: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/business-rules/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags BusinessRules\n * @name ReplaceBusinessRule\n * @summary Replace\n * @request PUT:/api/business-rules/{id}\n * @secure\n */\n replaceBusinessRule: (id: string, data: BusinessRuleRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/business-rules/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags BusinessRules\n * @name DeleteBusinessRule\n * @summary Delete\n * @request DELETE:/api/business-rules/{id}\n * @secure\n */\n deleteBusinessRule: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/business-rules/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags BusinessRules\n * @name RestoreBusinessRule\n * @summary Restore\n * @request POST:/api/business-rules/{id}/restore\n * @secure\n */\n restoreBusinessRule: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/business-rules/${id}/restore`,\n method: \"POST\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name GetCorporates\n * @summary Get All\n * @request GET:/api/corporates\n * @secure\n */\n getCorporates: (\n query?: {\n showAll?: boolean;\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/corporates`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name CreateCorporate\n * @summary Create\n * @request POST:/api/corporates\n * @secure\n */\n createCorporate: (data: CorporateRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/corporates`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name SearchCorporate\n * @summary Search\n * @request POST:/api/corporates/search\n * @secure\n */\n searchCorporate: (\n data: CorporateSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/corporates/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name GetCorporate\n * @summary Get by ID\n * @request GET:/api/corporates/{id}\n * @secure\n */\n getCorporate: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/corporates/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name ReplaceCorporate\n * @summary Replace\n * @request PUT:/api/corporates/{id}\n * @secure\n */\n replaceCorporate: (id: string, data: CorporateRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/corporates/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name DeleteCorporate\n * @summary Delete\n * @request DELETE:/api/corporates/{id}\n * @secure\n */\n deleteCorporate: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/corporates/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name RestoreCorporate\n * @summary Restore\n * @request POST:/api/corporates/{id}/restore\n * @secure\n */\n restoreCorporate: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/corporates/${id}/restore`,\n method: \"POST\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name CreateCorporateSiteConfiguration\n * @summary Create Site Configuration\n * @request POST:/api/corporates/{corporateId}/site-configurations\n * @secure\n */\n createCorporateSiteConfiguration: (\n corporateId: string,\n data: SiteConfigurationRequest,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/corporates/${corporateId}/site-configurations`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name GetCorporateSiteConfiguration\n * @summary Get Site Configuration\n * @request GET:/api/corporates/{corporateId}/site-configurations/{siteConfigurationId}\n * @secure\n */\n getCorporateSiteConfiguration: (corporateId: string, siteConfigurationId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/corporates/${corporateId}/site-configurations/${siteConfigurationId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name ReplaceCorporateSiteConfiguration\n * @summary Replace Site Configuration\n * @request PUT:/api/corporates/{corporateId}/site-configurations/{siteConfigurationId}\n * @secure\n */\n replaceCorporateSiteConfiguration: (\n corporateId: string,\n siteConfigurationId: string,\n data: SiteConfigurationRequest,\n query?: {\n applyToChildren?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/corporates/${corporateId}/site-configurations/${siteConfigurationId}`,\n method: \"PUT\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name GetBranchesByCorporate\n * @summary Get Branches\n * @request GET:/api/corporates/{id}/branches\n * @secure\n */\n getBranchesByCorporate: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/corporates/${id}/branches`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Corporates\n * @name GetLoanOfficersByCorporate\n * @summary Get Loan Officers\n * @request GET:/api/corporates/{id}/loan-officers\n * @secure\n */\n getLoanOfficersByCorporate: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/corporates/${id}/loan-officers`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Devices\n * @name GetDevices\n * @summary Get All\n * @request GET:/api/devices\n * @secure\n */\n getDevices: (\n query?: {\n /** @format uuid */\n posAccountId?: string;\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/devices`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Devices\n * @name GetDevice\n * @summary Get by ID\n * @request GET:/api/devices/{id}\n * @secure\n */\n getDevice: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/devices/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Devices\n * @name UpdateDevice\n * @summary Update\n * @request PUT:/api/devices/{id}\n * @secure\n */\n updateDevice: (id: string, data: DeviceRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/devices/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Devices\n * @name GetDeviceBySerialNumber\n * @summary Get by Serial Number\n * @request GET:/api/devices/{sn}/profile\n * @secure\n */\n getDeviceBySerialNumber: (sn: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/devices/${sn}/profile`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Devices\n * @name CreateDeviceActionBySerialNumber\n * @summary Create Action by Serial Number\n * @request POST:/api/devices/{sn}/actions/{actionName}\n * @secure\n */\n createDeviceActionBySerialNumber: (sn: string, actionName: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/devices/${sn}/actions/${actionName}`,\n method: \"POST\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentBuckets\n * @name GetDocumentBuckets\n * @summary Get All\n * @request GET:/api/document-buckets\n * @secure\n */\n getDocumentBuckets: (\n query?: {\n /** @default false */\n includeSystemBuckets?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/document-buckets`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplates\n * @name GetDocumentTemplates\n * @summary Get All\n * @request GET:/api/document-templates\n * @secure\n */\n getDocumentTemplates: (\n query?: {\n showAll?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/document-templates`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplates\n * @name CreateDocumentTemplate\n * @summary Create\n * @request POST:/api/document-templates\n * @secure\n */\n createDocumentTemplate: (data: CreateDocumentTemplateRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/document-templates`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplates\n * @name GetCustomDocumentTemplates\n * @summary Get Custom\n * @request GET:/api/document-templates/{type}\n * @secure\n */\n getCustomDocumentTemplates: (\n type: string,\n query?: {\n /** @default false */\n showAll?: boolean;\n /** @default true */\n publishedOnly?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/document-templates/${type}`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplates\n * @name GetDocumentTemplate\n * @summary Get By ID\n * @request GET:/api/document-templates/{id}\n * @secure\n */\n getDocumentTemplate: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/document-templates/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplates\n * @name ReplaceDocumentTemplate\n * @summary Replace\n * @request PUT:/api/document-templates/{id}\n * @secure\n */\n replaceDocumentTemplate: (id: string, data: UpdateDocumentTemplateRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/document-templates/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplates\n * @name DeleteDocumentTemplate\n * @summary Delete\n * @request DELETE:/api/document-templates/{id}\n * @secure\n */\n deleteDocumentTemplate: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/document-templates/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplates\n * @name RestoreDocumentTemplate\n * @summary Restore\n * @request POST:/api/document-templates/{id}/restore\n * @secure\n */\n restoreDocumentTemplate: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/document-templates/${id}/restore`,\n method: \"POST\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplateVersions\n * @name GetDocumentTemplateVersions\n * @summary Get All\n * @request GET:/api/document-templates/{documentId}/versions\n * @secure\n */\n getDocumentTemplateVersions: (documentId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/document-templates/${documentId}/versions`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplateVersions\n * @name CreateDocumentTemplateVersion\n * @summary Create\n * @request POST:/api/document-templates/{documentId}/versions\n * @secure\n */\n createDocumentTemplateVersion: (\n documentId: string,\n data: DocumentTemplateVersionRequest,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/document-templates/${documentId}/versions`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplateVersions\n * @name GetDocumentTemplateVersion\n * @summary Get by ID\n * @request GET:/api/document-templates/{documentId}/versions/{id}\n * @secure\n */\n getDocumentTemplateVersion: (documentId: string, id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/document-templates/${documentId}/versions/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplateVersions\n * @name ReplaceDocumentTemplateVersion\n * @summary Replace\n * @request PUT:/api/document-templates/{documentId}/versions/{id}\n * @secure\n */\n replaceDocumentTemplateVersion: (\n documentId: string,\n id: string,\n data: DocumentTemplateVersionUpdateRequest,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/document-templates/${documentId}/versions/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags DocumentTemplateVersions\n * @name DeleteDocumentTemplateVersion\n * @summary Delete\n * @request DELETE:/api/document-templates/{documentId}/versions/{id}\n * @secure\n */\n deleteDocumentTemplateVersion: (documentId: string, id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/document-templates/${documentId}/versions/${id}`,\n method: \"DELETE\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Files\n * @name GetAllFiles\n * @summary Get All\n * @request GET:/api/files\n * @secure\n */\n getAllFiles: (\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n /** @default false */\n includeDeleted?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/files`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Files\n * @name UploadFile\n * @summary Upload\n * @request POST:/api/files\n * @secure\n */\n uploadFile: (\n data: {\n name?: string;\n /** @format binary */\n file?: File;\n isPublic?: boolean;\n bucket?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/files`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.FormData,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Files\n * @name GetFileById\n * @summary Get By ID\n * @request GET:/api/files/{id}\n * @secure\n */\n getFileById: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/files/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Files\n * @name ReplaceFile\n * @summary Replace\n * @request PUT:/api/files/{id}\n * @secure\n */\n replaceFile: (id: string, data: FileRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/files/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Files\n * @name DeleteFile\n * @summary Delete\n * @request DELETE:/api/files/{id}\n * @secure\n */\n deleteFile: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/files/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Files\n * @name SearchFiles\n * @summary Search\n * @request POST:/api/files/search\n * @secure\n */\n searchFiles: (\n data: FileSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/files/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Forms\n * @name GetForms\n * @summary Get All\n * @request GET:/api/forms\n * @secure\n */\n getForms: (\n query?: {\n showAll?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/forms`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Forms\n * @name CreateForm\n * @summary Create\n * @request POST:/api/forms\n * @secure\n */\n createForm: (data: FormRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Forms\n * @name GetForm\n * @summary Get By ID\n * @request GET:/api/forms/{id}\n * @secure\n */\n getForm: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Forms\n * @name ReplaceForm\n * @summary Replace\n * @request PUT:/api/forms/{id}\n * @secure\n */\n replaceForm: (id: string, data: FormRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Forms\n * @name DeleteForm\n * @summary Delete\n * @request DELETE:/api/forms/{id}\n * @secure\n */\n deleteForm: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Forms\n * @name RestoreForm\n * @summary Restore\n * @request POST:/api/forms/{id}/restore\n * @secure\n */\n restoreForm: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms/${id}/restore`,\n method: \"POST\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Forms\n * @name AddFormToSiteConfiguration\n * @summary Add to Site Configuration\n * @request POST:/api/forms/{formId}/site-configurations/{siteConfigurationId}\n * @secure\n */\n addFormToSiteConfiguration: (\n formId: string,\n siteConfigurationId: string,\n data: AddFormToSiteConfigurationRequest,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/forms/${formId}/site-configurations/${siteConfigurationId}`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Forms\n * @name RemoveFormFromSiteConfiguration\n * @summary Remove from Site Configuration\n * @request DELETE:/api/forms/{formId}/site-configurations/{siteConfigurationId}\n * @secure\n */\n removeFormFromSiteConfiguration: (formId: string, siteConfigurationId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms/${formId}/site-configurations/${siteConfigurationId}`,\n method: \"DELETE\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Forms\n * @name GetSiteConfigurationsByForm\n * @summary Get Site Configurations by Form\n * @request GET:/api/forms/{formId}/site-configurations\n * @secure\n */\n getSiteConfigurationsByForm: (formId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms/${formId}/site-configurations`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormSubmissionFiles\n * @name AddFormSubmissionFile\n * @summary Add\n * @request POST:/api/form-submissions/{formSubmissionId}/files\n * @secure\n */\n addFormSubmissionFile: (\n formSubmissionId: string,\n data: {\n /** @format binary */\n file?: File;\n name?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/form-submissions/${formSubmissionId}/files`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.FormData,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormSubmissionFiles\n * @name DeleteFormSubmissionFile\n * @summary Delete\n * @request DELETE:/api/form-submissions/{formSubmissionId}/files/{formSubmissionFileId}\n * @secure\n */\n deleteFormSubmissionFile: (formSubmissionFileId: string, formSubmissionId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/form-submissions/${formSubmissionId}/files/${formSubmissionFileId}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormSubmissionFiles\n * @name DownloadFormSubmissionFile\n * @summary Download by Id\n * @request GET:/api/form-submissions/{formSubmissionId}/files/{formSubmissionFileId}/download\n * @secure\n */\n downloadFormSubmissionFile: (\n formSubmissionFileId: string,\n formSubmissionId: string,\n query?: {\n /** @format uuid */\n siteConfigurationId?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/form-submissions/${formSubmissionId}/files/${formSubmissionFileId}/download`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormSubmissions\n * @name GetFormSubmissions\n * @summary Get All\n * @request GET:/api/form-submissions\n * @secure\n */\n getFormSubmissions: (\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/form-submissions`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormSubmissions\n * @name CreateFormSubmission\n * @summary Create\n * @request POST:/api/form-submissions\n * @secure\n */\n createFormSubmission: (\n data: FormSubmissionRequest,\n query?: {\n formID?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/form-submissions`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormSubmissions\n * @name GetFormSubmission\n * @summary Get by ID\n * @request GET:/api/form-submissions/{id}\n * @secure\n */\n getFormSubmission: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/form-submissions/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormSubmissions\n * @name ReplaceFormSubmission\n * @summary Replace\n * @request PUT:/api/form-submissions/{id}\n * @secure\n */\n replaceFormSubmission: (id: string, data: FormSubmissionRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/form-submissions/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormSubmissions\n * @name DeleteFormSubmission\n * @summary Delete\n * @request DELETE:/api/form-submissions/{id}\n * @secure\n */\n deleteFormSubmission: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/form-submissions/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormSubmissions\n * @name SearchFormSubmissions\n * @summary Search\n * @request POST:/api/form-submissions/search\n * @secure\n */\n searchFormSubmissions: (\n data: FormSubmissionSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/form-submissions/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormVersions\n * @name GetFormVersions\n * @summary Get All\n * @request GET:/api/forms/{formId}/versions\n * @secure\n */\n getFormVersions: (formId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms/${formId}/versions`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormVersions\n * @name CreateFormVersion\n * @summary Create\n * @request POST:/api/forms/{formId}/versions\n * @secure\n */\n createFormVersion: (formId: string, data: FormVersionRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms/${formId}/versions`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormVersions\n * @name GetFormVersion\n * @summary Get by ID\n * @request GET:/api/forms/{formId}/versions/{id}\n * @secure\n */\n getFormVersion: (formId: string, id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms/${formId}/versions/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormVersions\n * @name ReplaceFormVersion\n * @summary Replace\n * @request PUT:/api/forms/{formId}/versions/{id}\n * @secure\n */\n replaceFormVersion: (formId: string, id: string, data: FormVersionUpdateRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms/${formId}/versions/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags FormVersions\n * @name DeleteFormVersion\n * @summary Delete\n * @request DELETE:/api/forms/{formId}/versions/{id}\n * @secure\n */\n deleteFormVersion: (formId: string, id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/forms/${formId}/versions/${id}`,\n method: \"DELETE\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name GetLoanData\n * @summary Get By ID\n * @request GET:/api/los/loan/application/{loanID}\n * @secure\n */\n getLoanData: (loanId: string, params: RequestParams = {}) =>\n this.request, any>({\n path: `/api/los/loan/application/${loanId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name UpdateLoan\n * @summary Update Loan\n * @request PATCH:/api/los/loan/application/{loanID}\n * @secure\n */\n updateLoan: (loanId: string, data: JsonPatchDocument, params: RequestParams = {}) =>\n this.request({\n path: `/api/los/loan/application/${loanId}`,\n method: \"PATCH\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name GetLoansReport\n * @summary Get Report\n * @request POST:/api/los/loan/reports\n * @secure\n */\n getLoansReport: (data: GetReportRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/los/loan/reports`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name CreateLoan\n * @summary Create Loan\n * @request POST:/api/los/loan/application\n * @secure\n */\n createLoan: (data: any, params: RequestParams = {}) =>\n this.request({\n path: `/api/los/loan/application`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name GetTaskDocumentsByLoan\n * @summary Get Documents\n * @request GET:/api/los/loan/tasks/documents/{loanID}\n * @secure\n */\n getTaskDocumentsByLoan: (\n loanId: string,\n query?: {\n /** @default true */\n includeBase64?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/los/loan/tasks/documents/${loanId}`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name GetLoanDocumentContent\n * @summary Get Document Content\n * @request GET:/api/los/loan/{loanID}/document/{documentId}/content\n * @secure\n */\n getLoanDocumentContent: (\n loanId: string,\n documentId: string,\n query?: {\n /** @default \"base64\" */\n contentType?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/los/loan/${loanId}/document/${documentId}/content`,\n method: \"GET\",\n query: query,\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name GetLoanRecipients\n * @summary Get Loan Recipients\n * @request GET:/api/los/loan/recipients/{loanID}\n * @secure\n */\n getLoanRecipients: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/los/loan/recipients/${loanId}`,\n method: \"GET\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name GetLoanContactInformation\n * @summary Get Contact Information\n * @request GET:/api/los/loan/contacts/{loanID}\n * @secure\n */\n getLoanContactInformation: (loanId: string, params: RequestParams = {}) =>\n this.request, any>({\n path: `/api/los/loan/contacts/${loanId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name GetPreliminaryConditionsForLoan\n * @summary Get Preliminary Conditions\n * @request GET:/api/los/loan/{loanID}/conditions/preliminary\n * @secure\n */\n getPreliminaryConditionsForLoan: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/los/loan/${loanId}/conditions/preliminary`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name GetUnderwritingConditionsForLoan\n * @summary Get Underwriting Conditions\n * @request GET:/api/los/loan/{loanID}/conditions/underwriting\n * @secure\n */\n getUnderwritingConditionsForLoan: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/los/loan/${loanId}/conditions/underwriting`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name GetLoanEmbeddedSigningLink\n * @summary Get Embedded Signing Link\n * @request POST:/api/los/loan/embeddedsigning/{envelopeId}/{userName}/{email}\n * @secure\n */\n getLoanEmbeddedSigningLink: (envelopeId: string, userName: string, email: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/los/loan/embeddedsigning/${envelopeId}/${userName}/${email}`,\n method: \"POST\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LegacyLoan\n * @name CreateLegacyLoanDocument\n * @summary Create Document\n * @request POST:/api/los/loan/generatedocument\n * @deprecated\n * @secure\n */\n createLegacyLoanDocument: (data: GenerateDocumentRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/los/loan/generatedocument`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags ListingFiles\n * @name AddListingFile\n * @summary Add\n * @request POST:/api/listings/{listingId}/files\n * @secure\n */\n addListingFile: (\n listingId: string,\n data: {\n /** @format binary */\n file?: File;\n /** @format int32 */\n weight?: number;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/listings/${listingId}/files`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.FormData,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags ListingFiles\n * @name UpdateListingFiles\n * @summary Update\n * @request PATCH:/api/listings/{listingId}/files\n * @secure\n */\n updateListingFiles: (listingId: string, data: JsonPatchDocument, params: RequestParams = {}) =>\n this.request({\n path: `/api/listings/${listingId}/files`,\n method: \"PATCH\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags ListingFiles\n * @name RemoveListingFile\n * @summary Remove\n * @request DELETE:/api/listings/{listingId}/files/{id}\n * @secure\n */\n removeListingFile: (listingId: string, id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/listings/${listingId}/files/${id}`,\n method: \"DELETE\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags ListingPhotos\n * @name AddListingPhoto\n * @summary Add\n * @request POST:/api/listings/{listingId}/photos\n * @secure\n */\n addListingPhoto: (\n listingId: string,\n data: {\n name?: string;\n description?: string;\n /** @format binary */\n file?: File;\n /** @format int32 */\n weight?: number;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/listings/${listingId}/photos`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.FormData,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags ListingPhotos\n * @name UpdateListingPhotos\n * @summary Update\n * @request PATCH:/api/listings/{listingId}/photos\n * @secure\n */\n updateListingPhotos: (listingId: string, data: JsonPatchDocument, params: RequestParams = {}) =>\n this.request({\n path: `/api/listings/${listingId}/photos`,\n method: \"PATCH\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags ListingPhotos\n * @name RemoveListingPhoto\n * @summary Remove\n * @request DELETE:/api/listings/{listingId}/photos/{id}\n * @secure\n */\n removeListingPhoto: (listingId: string, id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/listings/${listingId}/photos/${id}`,\n method: \"DELETE\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Listings\n * @name GetListings\n * @summary Get All\n * @request GET:/api/listings\n * @secure\n */\n getListings: (\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/listings`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Listings\n * @name CreateListing\n * @summary Create\n * @request POST:/api/listings\n * @secure\n */\n createListing: (data: ListingRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/listings`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Listings\n * @name GetListingBySlug\n * @summary Get by Slug\n * @request GET:/api/listings/slug/{slug}\n * @secure\n */\n getListingBySlug: (slug: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/listings/slug/${slug}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Listings\n * @name GetListing\n * @summary Get by ID\n * @request GET:/api/listings/{id}\n * @secure\n */\n getListing: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/listings/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Listings\n * @name ReplaceListing\n * @summary Replace\n * @request PUT:/api/listings/{id}\n * @secure\n */\n replaceListing: (id: string, data: ListingRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/listings/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Listings\n * @name DeleteListing\n * @summary Delete\n * @request DELETE:/api/listings/{id}\n * @secure\n */\n deleteListing: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/listings/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Listings\n * @name SearchListings\n * @summary Search\n * @request POST:/api/listings/search\n * @secure\n */\n searchListings: (\n data: ListingSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/listings/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Listings\n * @name UpdateListingBackgroundImage\n * @summary Update Background Image\n * @request PUT:/api/listings/{id}/background-image\n * @secure\n */\n updateListingBackgroundImage: (\n id: string,\n data: {\n /** @format binary */\n file?: File;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/listings/${id}/background-image`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.FormData,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Listings\n * @name DeleteListingBackgroundImage\n * @summary Delete Background Image\n * @request DELETE:/api/listings/{id}/background-image\n * @secure\n */\n deleteListingBackgroundImage: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/listings/${id}/background-image`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Listings\n * @name GetListingOpenHouseFlyer\n * @summary Get Open House Flyer\n * @request GET:/api/listings/{id}/open-house-flyer\n * @secure\n */\n getListingOpenHouseFlyer: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/listings/${id}/open-house-flyer`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanCalculators\n * @name GetLoanCalculator\n * @summary Get\n * @request GET:/api/loans/{loanID}/calculators/loan-calculator\n * @secure\n */\n getLoanCalculator: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/calculators/loan-calculator`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanCalculators\n * @name RunLoanCalculator\n * @summary Run\n * @request POST:/api/loans/{loanID}/calculators/loan-calculator\n * @secure\n */\n runLoanCalculator: (loanId: string, data: RunLOCalculationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/calculators/loan-calculator`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanComparison\n * @name GetLoanComparisons\n * @summary Get All\n * @request GET:/api/loans/{loanID}/loan-comparison\n * @secure\n */\n getLoanComparisons: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/loan-comparison`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanComparison\n * @name CreateLoanComparison\n * @summary Create\n * @request POST:/api/loans/{loanID}/loan-comparison/{index}\n * @secure\n */\n createLoanComparison: (loanId: string, index: number, data: LoanComparisonScenario, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/loan-comparison/${index}`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanComparison\n * @name DeleteLoanComparison\n * @summary Delete\n * @request DELETE:/api/loans/{loanID}/loan-comparison/{index}\n * @secure\n */\n deleteLoanComparison: (loanId: string, index: number, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/loan-comparison/${index}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanComparison\n * @name CreateLoanComparisonPdf\n * @summary Create PDF\n * @request POST:/api/loans/{loanID}/loan-comparison/pdf\n * @secure\n */\n createLoanComparisonPdf: (loanId: string, data: PostLoanComparisonPdfRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/loan-comparison/pdf`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDocumentBuckets\n * @name GetLoanDocumentBuckets\n * @summary Get All\n * @request GET:/api/loans/{loanId}/documents/buckets\n * @secure\n */\n getLoanDocumentBuckets: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/documents/buckets`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDocumentBuckets\n * @name CreateLoanDocumentBuckets\n * @summary Create\n * @request POST:/api/loans/{loanId}/documents/buckets\n * @secure\n */\n createLoanDocumentBuckets: (loanId: string, data: string[], params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/documents/buckets`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDocuments\n * @name GetLoanDocument\n * @summary Get By ID\n * @request GET:/api/loans/{loanId}/documents/{documentId}\n * @secure\n */\n getLoanDocument: (\n loanId: string,\n documentId: string,\n query?: {\n /** @default false */\n preview?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loans/${loanId}/documents/${documentId}`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDocuments\n * @name DownloadLoanDocument\n * @summary Download By ID\n * @request GET:/api/loans/{loanId}/documents/{documentId}/download\n * @secure\n */\n downloadLoanDocument: (loanId: string, documentId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/documents/${documentId}/download`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDocuments\n * @name CreateLoanDocument\n * @summary Create\n * @request POST:/api/loans/{loanId}/documents\n * @secure\n */\n createLoanDocument: (\n loanId: string,\n data: {\n name?: string;\n /** @format binary */\n file?: File;\n bucket?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loans/${loanId}/documents`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.FormData,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDocuments\n * @name RetryFailedLoanDocument\n * @summary Retry\n * @request POST:/api/loans/{loanId}/documents/{documentId}/retry\n * @secure\n */\n retryFailedLoanDocument: (loanId: string, documentId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/documents/${documentId}/retry`,\n method: \"POST\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDrafts\n * @name CreateLoanDraft\n * @summary Create\n * @request POST:/api/loans/drafts\n * @secure\n */\n createLoanDraft: (data: DraftRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/drafts`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDrafts\n * @name GetLoanDrafts\n * @summary Get All\n * @request GET:/api/loans/drafts\n * @secure\n */\n getLoanDrafts: (params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/drafts`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDrafts\n * @name GetLoanDraft\n * @summary Get by ID\n * @request GET:/api/loans/drafts/{draftId}\n * @secure\n */\n getLoanDraft: (draftId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/drafts/${draftId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDrafts\n * @name ReplaceLoanDraft\n * @summary Replace\n * @request PUT:/api/loans/drafts/{draftId}\n * @secure\n */\n replaceLoanDraft: (draftId: string, data: DraftRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/drafts/${draftId}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDrafts\n * @name DeleteLoanDraft\n * @summary Delete\n * @request DELETE:/api/loans/drafts/{draftId}\n * @secure\n */\n deleteLoanDraft: (draftId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/drafts/${draftId}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDrafts\n * @name SearchLoanDrafts\n * @summary Search\n * @request POST:/api/loans/drafts/search\n * @secure\n */\n searchLoanDrafts: (\n data: LoanDraftSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loans/drafts/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanDrafts\n * @name ReassignLoanOfficer\n * @summary Reassign Loan officer\n * @request PUT:/api/loans/drafts/{draftId}/reassign\n * @secure\n */\n reassignLoanOfficer: (draftId: string, data: DraftLoanOfficerReassignRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/drafts/${draftId}/reassign`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanOfficers\n * @name GetLoanOfficers\n * @summary Get All\n * @request GET:/api/loan-officers\n * @secure\n */\n getLoanOfficers: (\n query?: {\n showAll?: boolean;\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loan-officers`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanOfficers\n * @name SearchLoanOfficers\n * @summary Search\n * @request POST:/api/loan-officers/search\n * @secure\n */\n searchLoanOfficers: (\n data: LoanOfficerSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loan-officers/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanOfficers\n * @name GetLoanOfficer\n * @summary Get by ID\n * @request GET:/api/loan-officers/{id}\n * @secure\n */\n getLoanOfficer: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loan-officers/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanOfficers\n * @name GetLoanOfficerLoans\n * @summary Get Loans\n * @request GET:/api/loan-officers/applications\n * @secure\n */\n getLoanOfficerLoans: (params: RequestParams = {}) =>\n this.request({\n path: `/api/loan-officers/applications`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanOfficers\n * @name CreateLoanOfficerSiteConfiguration\n * @summary Create Site Configuration\n * @request POST:/api/loan-officers/{loanOfficerId}/site-configurations\n * @secure\n */\n createLoanOfficerSiteConfiguration: (\n loanOfficerId: string,\n data: SiteConfigurationRequest,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loan-officers/${loanOfficerId}/site-configurations`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanOfficers\n * @name GetLoanOfficerSiteConfiguration\n * @summary Get Site Configuration\n * @request GET:/api/loan-officers/{loanOfficerId}/site-configurations/{siteConfigurationId}\n * @secure\n */\n getLoanOfficerSiteConfiguration: (loanOfficerId: string, siteConfigurationId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loan-officers/${loanOfficerId}/site-configurations/${siteConfigurationId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanOfficers\n * @name ReplaceLoanOfficerSiteConfiguration\n * @summary Replace Site Configuration\n * @request PUT:/api/loan-officers/{loanOfficerId}/site-configurations/{siteConfigurationId}\n * @secure\n */\n replaceLoanOfficerSiteConfiguration: (\n loanOfficerId: string,\n siteConfigurationId: string,\n data: SiteConfigurationRequest,\n query?: {\n applyToChildren?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loan-officers/${loanOfficerId}/site-configurations/${siteConfigurationId}`,\n method: \"PUT\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanQueue\n * @name SearchLoanQueue\n * @summary Search\n * @request POST:/api/loans/queue/search\n * @secure\n */\n searchLoanQueue: (\n data: LoanQueueSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loans/queue/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanQueue\n * @name GetLoanQueue\n * @summary Get Loan Queue Record\n * @request GET:/api/loans/queue/{loanQueueId}\n * @secure\n */\n getLoanQueue: (loanQueueId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/queue/${loanQueueId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanQueue\n * @name ReplaceLoanQueue\n * @summary Replace Loan Queue Record\n * @request PUT:/api/loans/queue/{loanQueueId}\n * @secure\n */\n replaceLoanQueue: (loanQueueId: string, data: UpdateLoanQueueRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/queue/${loanQueueId}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanQueue\n * @name DeleteLoanQueue\n * @summary Delete Loan Queue Item\n * @request DELETE:/api/loans/queue/{loanQueueId}\n * @secure\n */\n deleteLoanQueue: (loanQueueId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/queue/${loanQueueId}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanQueue\n * @name RetryLoanQueue\n * @summary Retry\n * @request POST:/api/loans/queue/{loanQueueId}/retry\n * @secure\n */\n retryLoanQueue: (loanQueueId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/queue/${loanQueueId}/retry`,\n method: \"POST\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Loans\n * @name GetLoans\n * @summary Get Loans\n * @request GET:/api/loans\n * @secure\n */\n getLoans: (params: RequestParams = {}) =>\n this.request({\n path: `/api/loans`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Loans\n * @name GetLoansByAccountSetting\n * @summary Get Loans by Account Setting\n * @request POST:/api/loans/temp-pipeline\n * @secure\n */\n getLoansByAccountSetting: (\n data: LoanSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loans/temp-pipeline`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Loans\n * @name GetLoan\n * @summary Get By ID\n * @request GET:/api/loans/{loanID}\n * @secure\n */\n getLoan: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Loans\n * @name SearchLoans\n * @summary Search\n * @request POST:/api/loans/search\n * @secure\n */\n searchLoans: (\n data: LoanSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loans/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Loans\n * @name ImportLoanFromLos\n * @summary Import from LOS\n * @request POST:/api/loans/import-from-los/{loanId}\n * @secure\n */\n importLoanFromLos: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/import-from-los/${loanId}`,\n method: \"POST\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTaskComments\n * @name SearchLoanTaskComments\n * @summary Search\n * @request POST:/api/loans/{loanId}/tasks/{userLoanTaskId}/comments/search\n * @secure\n */\n searchLoanTaskComments: (\n loanId: string,\n userLoanTaskId: string,\n data: TaskCommentSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${userLoanTaskId}/comments/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTaskComments\n * @name GetLoanTaskComment\n * @summary Get by ID\n * @request GET:/api/loans/{loanId}/tasks/{userLoanTaskId}/comments/{id}\n * @secure\n */\n getLoanTaskComment: (id: string, loanId: string, userLoanTaskId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${userLoanTaskId}/comments/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTaskComments\n * @name CreateLoanTaskComment\n * @summary Create\n * @request POST:/api/loans/{loanId}/tasks/{userLoanTaskId}/comments\n * @secure\n */\n createLoanTaskComment: (\n loanId: string,\n userLoanTaskId: string,\n data: TaskCommentRequest,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${userLoanTaskId}/comments`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTaskComments\n * @name ReplaceLoanTaskComment\n * @summary Replace\n * @request PUT:/api/loans/{loanId}/tasks/{userLoanTaskId}/comments/{commentId}\n * @secure\n */\n replaceLoanTaskComment: (\n loanId: string,\n userLoanTaskId: string,\n commentId: string,\n data: TaskCommentRequest,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${userLoanTaskId}/comments/${commentId}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTaskComments\n * @name DeleteLoanTaskComment\n * @summary Delete\n * @request DELETE:/api/loans/{loanId}/tasks/{userLoanTaskId}/comments/{commentId}\n * @secure\n */\n deleteLoanTaskComment: (loanId: string, userLoanTaskId: string, commentId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${userLoanTaskId}/comments/${commentId}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTaskDocuments\n * @name CreateLoanTaskDocument\n * @summary Create\n * @request POST:/api/loans/{loanID}/tasks/{loanTaskId}/documents\n * @secure\n */\n createLoanTaskDocument: (\n loanId: string,\n loanTaskId: string,\n data: {\n name?: string;\n /** @format binary */\n file?: File;\n bucket?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${loanTaskId}/documents`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.FormData,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTaskDocuments\n * @name CreateLoanTaskDocumentBucket\n * @summary Create Bucket\n * @request POST:/api/loans/{loanID}/tasks/{loanTaskId}/documents/bucket\n * @secure\n */\n createLoanTaskDocumentBucket: (loanId: string, loanTaskId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${loanTaskId}/documents/bucket`,\n method: \"POST\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTasks\n * @name GetLoanTasks\n * @summary Get All\n * @request GET:/api/loans/{loanID}/tasks\n * @secure\n */\n getLoanTasks: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/tasks`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTasks\n * @name GetLoanTask\n * @summary Get by ID\n * @request GET:/api/loans/{loanID}/tasks/{id}\n * @secure\n */\n getLoanTask: (id: string, loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * @description Get the difference between the current loan tasks and the tasks generated by business rules\n *\n * @tags LoanTasks\n * @name GetLoanTaskDifference\n * @summary Get Difference\n * @request GET:/api/loans/{loanID}/tasks/diff\n * @secure\n */\n getLoanTaskDifference: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/diff`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTasks\n * @name CreateLoanTask\n * @summary Create\n * @request POST:/api/loans/{loanID}/tasks/{taskID}\n * @secure\n */\n createLoanTask: (loanId: string, taskId: string, data: UserLoanTaskRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${taskId}`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTasks\n * @name ImportLoanTask\n * @summary Import\n * @request POST:/api/loans/{loanID}/tasks/import\n * @secure\n */\n importLoanTask: (loanId: string, data: ImportUserLoanTaskRequest[], params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/import`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTasks\n * @name ReplaceLoanTask\n * @summary Replace\n * @request PUT:/api/loans/{loanID}/tasks/{userLoanTaskID}\n * @secure\n */\n replaceLoanTask: (\n loanId: string,\n userLoanTaskId: string,\n data: UserLoanTaskUpdateRequest,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${userLoanTaskId}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTasks\n * @name DeleteLoanTask\n * @summary Delete\n * @request DELETE:/api/loans/{loanID}/tasks/{userLoanTaskID}\n * @secure\n */\n deleteLoanTask: (loanId: string, userLoanTaskId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${userLoanTaskId}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTasks\n * @name SendOutstandingLoanTaskNotification\n * @summary Send Outstanding Task Notification\n * @request POST:/api/loans/{loanID}/tasks/reminders/outstanding\n * @secure\n */\n sendOutstandingLoanTaskNotification: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/reminders/outstanding`,\n method: \"POST\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanTaskVerifications\n * @name CreateLoanTaskVerification\n * @summary Create\n * @request POST:/api/loans/{loanID}/tasks/{loanTaskId}/verifications\n * @secure\n */\n createLoanTaskVerification: (loanId: string, loanTaskId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/tasks/${loanTaskId}/verifications`,\n method: \"POST\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanUsers\n * @name GetLoanUsers\n * @summary Get All\n * @request GET:/api/loans/{loanId}/users\n * @secure\n */\n getLoanUsers: (loanId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/users`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanUsers\n * @name GetLoanUser\n * @summary Get Loan User\n * @request GET:/api/loans/{loanId}/users/{userId}\n * @secure\n */\n getLoanUser: (loanId: string, userId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/users/${userId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags LoanUsers\n * @name AddLoanUser\n * @summary Add User to Loan\n * @request POST:/api/loans/{loanId}/users/{userId}\n * @secure\n */\n addLoanUser: (loanId: string, userId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/loans/${loanId}/users/${userId}`,\n method: \"POST\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Milestones\n * @name GetMilestones\n * @summary Get All\n * @request GET:/api/milestones\n * @secure\n */\n getMilestones: (params: RequestParams = {}) =>\n this.request({\n path: `/api/milestones`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Milestones\n * @name CreateMilestone\n * @summary Create\n * @request POST:/api/milestones\n * @secure\n */\n createMilestone: (data: MilestoneConfigurationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/milestones`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Milestones\n * @name GetMilestone\n * @summary Get By ID\n * @request GET:/api/milestones/{id}\n * @secure\n */\n getMilestone: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/milestones/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Milestones\n * @name ReplaceMilestone\n * @summary Replace\n * @request PUT:/api/milestones/{id}\n * @secure\n */\n replaceMilestone: (id: string, data: MilestoneConfigurationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/milestones/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Milestones\n * @name DeleteMilestone\n * @summary Delete\n * @request DELETE:/api/milestones/{id}\n * @secure\n */\n deleteMilestone: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/milestones/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Notifications\n * @name SendNotificationForLoan\n * @summary Send Notification for Loan\n * @request POST:/api/notifications\n * @secure\n */\n sendNotificationForLoan: (data: SendNotificationForLoanRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/notifications`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Notifications\n * @name SendTestNotificationForLoan\n * @summary Send Test Notification for Loan\n * @request POST:/api/notifications/test\n * @secure\n */\n sendTestNotificationForLoan: (data: TestSendNotificationForLoanRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/notifications/test`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags NotificationTemplates\n * @name GetNotificationTemplates\n * @summary Get All\n * @request GET:/api/notification-templates\n * @secure\n */\n getNotificationTemplates: (\n query?: {\n showAll?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/notification-templates`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags NotificationTemplates\n * @name CreateNotificationTemplate\n * @summary Create\n * @request POST:/api/notification-templates\n * @secure\n */\n createNotificationTemplate: (data: NotificationTemplateRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/notification-templates`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags NotificationTemplates\n * @name GetNotificationTemplate\n * @summary Get by ID\n * @request GET:/api/notification-templates/{id}\n * @secure\n */\n getNotificationTemplate: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/notification-templates/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags NotificationTemplates\n * @name ReplaceNotificationTemplate\n * @summary Replace\n * @request PUT:/api/notification-templates/{id}\n * @secure\n */\n replaceNotificationTemplate: (id: string, data: NotificationTemplateRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/notification-templates/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags NotificationTemplates\n * @name DeleteNotificationTemplate\n * @summary Delete\n * @request DELETE:/api/notification-templates/{id}\n * @secure\n */\n deleteNotificationTemplate: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/notification-templates/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags NotificationTemplates\n * @name RestoreNotificationTemplate\n * @summary Restore\n * @request POST:/api/notification-templates/{id}/restore\n * @secure\n */\n restoreNotificationTemplate: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/notification-templates/${id}/restore`,\n method: \"POST\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags NotificationTemplateVersions\n * @name GetNotificationTemplateVersions\n * @summary Get All\n * @request GET:/api/notification-templates/{notificationId}/versions\n * @secure\n */\n getNotificationTemplateVersions: (notificationId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/notification-templates/${notificationId}/versions`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags NotificationTemplateVersions\n * @name CreateNotificationTemplateVersion\n * @summary Create\n * @request POST:/api/notification-templates/{notificationId}/versions\n * @secure\n */\n createNotificationTemplateVersion: (\n notificationId: string,\n data: NotificationTemplateVersionRequest,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/notification-templates/${notificationId}/versions`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags NotificationTemplateVersions\n * @name GetNotificationTemplateVersion\n * @summary Get by ID\n * @request GET:/api/notification-templates/{notificationId}/versions/{id}\n * @secure\n */\n getNotificationTemplateVersion: (notificationId: string, id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/notification-templates/${notificationId}/versions/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags NotificationTemplateVersions\n * @name ReplaceNotificationTemplateVersion\n * @summary Replace\n * @request PUT:/api/notification-templates/{notificationId}/versions/{id}\n * @secure\n */\n replaceNotificationTemplateVersion: (\n notificationId: string,\n id: string,\n data: NotificationTemplateVersionUpdateRequest,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/notification-templates/${notificationId}/versions/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags NotificationTemplateVersions\n * @name DeleteNotificationTemplateVersion\n * @summary Delete\n * @request DELETE:/api/notification-templates/{notificationId}/versions/{id}\n * @secure\n */\n deleteNotificationTemplateVersion: (notificationId: string, id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/notification-templates/${notificationId}/versions/${id}`,\n method: \"DELETE\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Partners\n * @name GetPartners\n * @summary Get All\n * @request GET:/api/partners\n * @secure\n */\n getPartners: (\n query?: {\n showAll?: boolean;\n /** @default \"Realtor\" */\n role?:\n | \"Borrower\"\n | \"LoanOfficer\"\n | \"Admin\"\n | \"SuperAdmin\"\n | \"Realtor\"\n | \"SettlementAgent\"\n | \"LoanProcessor\"\n | \"LoanOfficerAssistant\"\n | \"BranchManager\"\n | \"SystemAdmin\";\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/partners`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Partners\n * @name SearchPartners\n * @summary Search\n * @request POST:/api/partners/search\n * @secure\n */\n searchPartners: (\n data: PartnerSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/partners/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Partners\n * @name GetPartner\n * @summary Get by ID\n * @request GET:/api/partners/{id}\n * @secure\n */\n getPartner: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/partners/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Partners\n * @name CreatePartnerSiteConfiguration\n * @summary Create Site Configuration\n * @request POST:/api/partners/{realtorId}/site-configurations\n * @secure\n */\n createPartnerSiteConfiguration: (realtorId: string, data: SiteConfigurationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/partners/${realtorId}/site-configurations`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Partners\n * @name GetPartnerSiteConfiguration\n * @summary Get Site Configuration\n * @request GET:/api/partners/{realtorId}/site-configurations/{siteConfigurationId}\n * @secure\n */\n getPartnerSiteConfiguration: (realtorId: string, siteConfigurationId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/partners/${realtorId}/site-configurations/${siteConfigurationId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Partners\n * @name ReplacePartnerSiteConfiguration\n * @summary Replace Site Configuration\n * @request PUT:/api/partners/{realtorId}/site-configurations/{siteConfigurationId}\n * @secure\n */\n replacePartnerSiteConfiguration: (\n realtorId: string,\n siteConfigurationId: string,\n data: SiteConfigurationRequest,\n query?: {\n applyToChildren?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/partners/${realtorId}/site-configurations/${siteConfigurationId}`,\n method: \"PUT\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Pricing\n * @name GetPricingCalculation\n * @summary Get Pricing Calculation\n * @request POST:/api/pricing/calculator\n * @secure\n */\n getPricingCalculation: (data: GetPricingCalculationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/pricing/calculator`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags RequestQueue\n * @name GetRequestQueues\n * @summary Get All\n * @request GET:/api/request-queues\n * @deprecated\n * @secure\n */\n getRequestQueues: (params: RequestParams = {}) =>\n this.request({\n path: `/api/request-queues`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags RequestQueue\n * @name RunRequestQueue\n * @summary Run\n * @request POST:/api/request-queues/{id}/run\n * @deprecated\n * @secure\n */\n runRequestQueue: (\n id: string,\n query?: {\n /** @default false */\n force?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/request-queues/${id}/run`,\n method: \"POST\",\n query: query,\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags RequestQueue\n * @name DeleteQueueRequest\n * @summary Delete\n * @request DELETE:/api/request-queues/{id}\n * @deprecated\n * @secure\n */\n deleteQueueRequest: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/request-queues/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags SiteConfigurations\n * @name GetSiteConfiguration\n * @summary Get By ID\n * @request GET:/api/site-configurations/{id}\n * @secure\n */\n getSiteConfiguration: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/site-configurations/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags SiteConfigurations\n * @name SearchSiteConfigurationByUrl\n * @summary Search By URL\n * @request POST:/api/site-configurations/url\n * @deprecated\n * @secure\n */\n searchSiteConfigurationByUrl: (data: GetSiteConfigurationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/site-configurations/url`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags SiteConfigurations\n * @name GetSiteConfigurationByUrl\n * @summary Get By URL\n * @request GET:/api/site-configurations\n * @secure\n */\n getSiteConfigurationByUrl: (\n query?: {\n url?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/site-configurations`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags SiteConfigurations\n * @name SearchSiteConfigurationByLoanOfficerUser\n * @summary Search By Loan Officer User\n * @request POST:/api/site-configurations/louser\n * @deprecated\n * @secure\n */\n searchSiteConfigurationByLoanOfficerUser: (\n data: GetSiteConfigurationByLOUserIDRequest,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/site-configurations/louser`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags SiteConfigurations\n * @name GetSiteConfigurationByLoanOfficerUser\n * @summary Get By Loan Officer User\n * @request GET:/api/site-configurations/louser/{loUserId}\n * @secure\n */\n getSiteConfigurationByLoanOfficerUser: (loUserId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/site-configurations/louser/${loUserId}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags SiteConfigurations\n * @name SearchSiteConfigurations\n * @summary Search\n * @request POST:/api/site-configurations/search\n * @secure\n */\n searchSiteConfigurations: (\n data: SiteConfigurationSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/site-configurations/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags SiteConfigurations\n * @name GetFormsBySiteConfiguration\n * @summary Get Forms by Site Configuration\n * @request GET:/api/site-configurations/{id}/forms\n * @secure\n */\n getFormsBySiteConfiguration: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/site-configurations/${id}/forms`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags SiteConfigurations\n * @name GetSamlMetadata\n * @summary Get Saml Metadata\n * @request GET:/api/site-configurations/sso/saml/{ssoIntegration}/metadata\n * @secure\n */\n getSamlMetadata: (\n sSoIntegration: \"ConsumerConnect\" | \"TheBigPOS\",\n ssoIntegration: string,\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/site-configurations/sso/saml/${ssoIntegration}/metadata`,\n method: \"GET\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags SiteForms\n * @name GetFormBySiteConfigurationSlug\n * @summary Get By Site Configuration Slug\n * @request POST:/api/site-forms\n * @secure\n */\n getFormBySiteConfigurationSlug: (data: GetSiteFormRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/site-forms`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags SiteForms\n * @name GetSiteForms\n * @summary Get All Site Forms\n * @request GET:/api/site-forms\n * @secure\n */\n getSiteForms: (params: RequestParams = {}) =>\n this.request({\n path: `/api/site-forms`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Surveys\n * @name GetSurveysByUsers\n * @summary Get by Users\n * @request GET:/api/surveys\n * @secure\n */\n getSurveysByUsers: (\n query?: {\n /** @format int32 */\n limit?: number;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/surveys`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Surveys\n * @name GetSurveysByUser\n * @summary Get by User\n * @request POST:/api/surveys\n * @secure\n */\n getSurveysByUser: (data: SurveyEmailRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/surveys`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Tasks\n * @name GetTasks\n * @summary Get All\n * @request GET:/api/tasks\n * @secure\n */\n getTasks: (\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/tasks`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Tasks\n * @name CreateTask\n * @summary Create\n * @request POST:/api/tasks\n * @secure\n */\n createTask: (data: TaskRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/tasks`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Tasks\n * @name GetTask\n * @summary Get By ID\n * @request GET:/api/tasks/{id}\n * @secure\n */\n getTask: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/tasks/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Tasks\n * @name ReplaceTask\n * @summary Replace\n * @request PUT:/api/tasks/{id}\n * @secure\n */\n replaceTask: (id: string, data: TaskRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/tasks/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Tasks\n * @name DeleteTask\n * @summary Delete\n * @request DELETE:/api/tasks/{id}\n * @secure\n */\n deleteTask: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/tasks/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Tasks\n * @name SearchTasks\n * @summary Search\n * @request POST:/api/tasks/search\n * @secure\n */\n searchTasks: (\n data: TaskSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/tasks/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserImpersonation\n * @name RequestImpersonation\n * @summary Request Impersonation as Impersonator\n * @request POST:/api/users/impersonation/request\n * @secure\n */\n requestImpersonation: (data: RequestImpersonationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/impersonation/request`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserImpersonation\n * @name AllowImpersonation\n * @summary Allow Impersonation as Impersonatee\n * @request POST:/api/users/impersonation/allow\n * @secure\n */\n allowImpersonation: (data: AllowImpersonationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/impersonation/allow`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserImpersonation\n * @name AllowImpersonationWithGuid\n * @summary Allow Impersonation as Impersonatee via AllowGuid\n * @request POST:/api/users/impersonation/allow/{allowToken}\n * @secure\n */\n allowImpersonationWithGuid: (allowToken: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/impersonation/allow/${allowToken}`,\n method: \"POST\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserImpersonation\n * @name BeginImpersonation\n * @summary Begin Impersonation as Impersonator\n * @request POST:/api/users/impersonation\n * @secure\n */\n beginImpersonation: (params: RequestParams = {}) =>\n this.request({\n path: `/api/users/impersonation`,\n method: \"POST\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserImpersonation\n * @name StopImpersonation\n * @summary Stop Impersonation as either Impersonator or Impersonatee\n * @request DELETE:/api/users/impersonation\n * @secure\n */\n stopImpersonation: (params: RequestParams = {}) =>\n this.request({\n path: `/api/users/impersonation`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserImpersonation\n * @name ForceImpersonation\n * @summary Force Impersonation as Super Admin Impersonator\n * @request POST:/api/users/impersonation/force\n * @secure\n */\n forceImpersonation: (data: RequestImpersonationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/impersonation/force`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserImpersonation\n * @name ExtendImpersonation\n * @summary Extend Impersonation Session as Impersonator\n * @request POST:/api/users/impersonation/extend\n * @secure\n */\n extendImpersonation: (params: RequestParams = {}) =>\n this.request({\n path: `/api/users/impersonation/extend`,\n method: \"POST\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserInvites\n * @name InviteUser\n * @summary Invite\n * @request POST:/api/users/invites\n * @secure\n */\n inviteUser: (data: CreateInviteRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/invites`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserInvites\n * @name VerifyUserInvite\n * @summary Verify\n * @request GET:/api/users/invites/{token}/verify\n * @secure\n */\n verifyUserInvite: (token: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/invites/${token}/verify`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserRelations\n * @name GetUserRelations\n * @summary Get All\n * @request GET:/api/users/{userID}/relations\n * @secure\n */\n getUserRelations: (userId: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/${userId}/relations`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserRelations\n * @name CreateUserRelation\n * @summary Create\n * @request POST:/api/users/{userID}/relations\n * @secure\n */\n createUserRelation: (userId: string, data: CreateUserRelationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/${userId}/relations`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserRelations\n * @name GetUserRelation\n * @summary Get by ID\n * @request GET:/api/users/{userID}/relations/{id}\n * @secure\n */\n getUserRelation: (userId: string, id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/${userId}/relations/${id}`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UserRelations\n * @name DeleteUserRelation\n * @summary Delete\n * @request DELETE:/api/users/{userID}/relations/{id}\n * @secure\n */\n deleteUserRelation: (userId: string, id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/${userId}/relations/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name GetUsers\n * @summary Get All\n * @request GET:/api/users\n * @secure\n */\n getUsers: (\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/users`,\n method: \"GET\",\n query: query,\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name CreateUser\n * @summary Create\n * @request POST:/api/users\n * @secure\n */\n createUser: (data: CreateUserRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name SearchUsers\n * @summary Search\n * @request POST:/api/users/search\n * @secure\n */\n searchUsers: (\n data: UserSearchCriteria,\n query?: {\n /** @format int32 */\n pageSize?: number;\n /** @format int32 */\n pageNumber?: number;\n sortBy?: string;\n sortDirection?: string;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/users/search`,\n method: \"POST\",\n query: query,\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name GetUserByEmail\n * @summary Get by Email\n * @request POST:/api/users/byemail\n * @secure\n */\n getUserByEmail: (data: GetUserByEmailRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/byemail`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name SignUp\n * @summary Sign Up\n * @request POST:/api/users/register\n * @secure\n */\n signUp: (data: RegisterUserRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/register`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name ReplaceUser\n * @summary Update\n * @request PUT:/api/users/{id}\n * @secure\n */\n replaceUser: (id: string, data: UpdateUserRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/${id}`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name DeleteUser\n * @summary Delete\n * @request DELETE:/api/users/{id}\n * @secure\n */\n deleteUser: (\n id: string,\n query?: {\n /** @default false */\n permanent?: boolean;\n },\n params: RequestParams = {},\n ) =>\n this.request({\n path: `/api/users/${id}`,\n method: \"DELETE\",\n query: query,\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name RestoreUser\n * @summary Restore User\n * @request POST:/api/users/{id}/restore\n * @secure\n */\n restoreUser: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/${id}/restore`,\n method: \"POST\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name ChangePassword\n * @summary Change Password\n * @request POST:/api/users/change-password\n * @secure\n */\n changePassword: (data: ChangePasswordRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/change-password`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name VerifyPassword\n * @summary Verify Password\n * @request POST:/api/users/verify-password\n * @secure\n */\n verifyPassword: (data: VerifyPasswordRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/verify-password`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name OverridePassword\n * @summary Override Password\n * @request POST:/api/users/{id}/override-password\n * @secure\n */\n overridePassword: (id: string, data: OverridePasswordRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/${id}/override-password`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name ForgotPassword\n * @summary Forgot Password\n * @request POST:/api/users/forgot-password\n * @secure\n */\n forgotPassword: (data: SendForgotPasswordRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/forgot-password`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name SendMobilePhoneVerificationCode\n * @summary Send Verification Code\n * @request POST:/api/users/mobile-phone/send-code\n * @secure\n */\n sendMobilePhoneVerificationCode: (params: RequestParams = {}) =>\n this.request({\n path: `/api/users/mobile-phone/send-code`,\n method: \"POST\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Users\n * @name VerifyUserMobilePhone\n * @summary Verify Mobile Phone\n * @request PUT:/api/users/mobile-phone/verify-code\n * @secure\n */\n verifyUserMobilePhone: (data: UserMobilePhoneVerificationRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/mobile-phone/verify-code`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UsersMe\n * @name GetMe\n * @summary Get\n * @request GET:/api/users/me\n * @secure\n */\n getMe: (params: RequestParams = {}) =>\n this.request({\n path: `/api/users/me`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UsersMe\n * @name ReplaceMe\n * @summary Replace\n * @request PUT:/api/users/me\n * @secure\n */\n replaceMe: (data: UpdateMeRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/me`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * @description Update the phone number If changed will send a verification code to the new number\n *\n * @tags UsersMe\n * @name UpdateMyPhone\n * @summary Update Phone\n * @request PUT:/api/users/me/phone-number\n * @secure\n */\n updateMyPhone: (data: UpdateMobilePhoneRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/me/phone-number`,\n method: \"PUT\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UsersMe\n * @name GetMyRelationships\n * @summary Get Relationships\n * @request GET:/api/users/me/relationships\n * @secure\n */\n getMyRelationships: (params: RequestParams = {}) =>\n this.request({\n path: `/api/users/me/relationships`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UsersMe\n * @name GetMyRelationshipProspects\n * @summary Get Relationship Prospects\n * @request GET:/api/users/me/relationships/prospects\n * @secure\n */\n getMyRelationshipProspects: (params: RequestParams = {}) =>\n this.request({\n path: `/api/users/me/relationships/prospects`,\n method: \"GET\",\n secure: true,\n format: \"json\",\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UsersMe\n * @name DeleteRelationshipProspect\n * @summary Delete Relationship Prospect\n * @request DELETE:/api/users/me/relationships/prospects/{id}\n * @secure\n */\n deleteRelationshipProspect: (id: string, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/me/relationships/prospects/${id}`,\n method: \"DELETE\",\n secure: true,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags UsersMe\n * @name DeleteMe\n * @summary Delete\n * @request POST:/api/users/me/delete\n * @secure\n */\n deleteMe: (data: UserAccountDeletionRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/users/me/delete`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n ...params,\n }),\n\n /**\n * No description\n *\n * @tags Workflow\n * @name GetWorkflow\n * @summary Get Workflow\n * @request POST:/api/workflow\n * @secure\n */\n getWorkflow: (data: GetWorkflowRequest, params: RequestParams = {}) =>\n this.request({\n path: `/api/workflow`,\n method: \"POST\",\n body: data,\n secure: true,\n type: ContentType.Json,\n format: \"json\",\n ...params,\n }),\n };\n}\n","import { Api } from '@matech/thebigpos-sdk'\nimport { FixMeLater } from '../types'\n\nconst securityWorker = (data: FixMeLater) => {\n\treturn { headers: data }\n}\n\nconst TheBigPOSClient = new Api({\n\tbaseURL:\n\t\tprocess.env.REACT_APP_POS_API_HOST || 'https://api.thebigpos.com',\n\tsecurityWorker,\n})\n\nexport const setBearerToken = (token: string) => {\n\tTheBigPOSClient.instance.defaults.headers.common.Authorization = `Bearer ${token}`\n}\n\nexport const setSiteConfiguration = (siteConfigurationId: string) => {\n\tTheBigPOSClient.instance.defaults.headers.common[\n\t\t'Site-Configuration-ID'\n\t] = siteConfigurationId\n}\n\nexport const TheBigPOSApi = TheBigPOSClient.api\n\nexport default TheBigPOSClient\n","import React, { useState } from 'react'\nimport { CardItem } from '../../components/CardItem'\nimport { useNavigate } from 'react-router-dom'\nimport { ModalByPhone } from '../../components/modals/ModalByPhone'\nimport { useAppContext } from '../../components/AppContext'\n\nconst AppLinkCards = ({\n\tappLinks,\n\tsource = null,\n\tclassName = undefined,\n}) => {\n\tconst { state } = useAppContext()\n\tconst navigate = useNavigate()\n\tconst { siteConfig } = state\n\n\tconst [modalByPhoneVisible, setModalByPhoneVisible] =\n\t\tuseState(false)\n\n\tconst handleAppLink = async (appLink) => {\n\t\tif (appLink.external) await window.open(appLink.link)\n\t\telse\n\t\t\tswitch (appLink.fieldName) {\n\t\t\t\tcase 'RingCentral':\n\t\t\t\t\tsetModalByPhoneVisible(true)\n\t\t\t\t\tbreak\n\t\t\t\tcase 'ringCentral':\n\t\t\t\t\tsetModalByPhoneVisible(true)\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tnavigate(`/${appLink.link}`, { state: appLink } || {})\n\t\t\t}\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t\n\t\t\t
    \n\t\t\t\t{appLinks.map((app, index) => (\n\t\t\t\t\t handleAppLink(app)}\n\t\t\t\t\t\tsource={source}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t
    \n\t\t
    \n\t)\n}\n\nexport default AppLinkCards\n","import { state as ventiState } from 'venti'\nimport { getTheme } from '../config'\n\nconst theme = getTheme()\n\nexport const host =\n\tprocess.env.REACT_APP_POS_API_HOST || 'https://api.thebigpos.com'\n\nexport const Roles = {\n\tborrower: 'Borrower', // 0\n\tloanOfficer: 'LoanOfficer', // 1\n\tadmin: 'Admin', // 2\n\tsuperAdmin: 'SuperAdmin', // 3\n\trealtor: 'Realtor', // 4\n\tsettlementAgent: 'SettlementAgent',\n\tbranchManager: 'BranchManager', // 17\n\tloanProcessor: 'LoanProcessor', // 6\n\tloanOfficerAssistant: 'LoanOfficerAssistant', // 7\n}\n\nexport const SiteTypes = {\n\tadmin: 0,\n\tcorporate: 1,\n\tbranch: 2,\n\tloanOfficer: 3,\n\trealtor: 4,\n}\n\nexport function downloadFormSubmissionFile(\n\tformSubmissionId: string,\n\tformSubmissionFileId: string,\n\tsiteConfigurationId: string\n) {\n\treturn `${host}/api/form-submissions/${formSubmissionId}/files/${formSubmissionFileId}/download?&accessToken=${ventiState.get(theme.storageKeys.authToken)}&siteConfigurationId=${siteConfigurationId}`\n}\n\nexport function getLoanDocumentContentUrl({\n\tloanId,\n\tdocumentId,\n}: {\n\tloanId: string\n\tdocumentId: string\n}) {\n\treturn `${host}/api/los/loan/${loanId}/document/${documentId}/content?contentType=binary&accessToken=${ventiState.get(theme.storageKeys.authToken)}`\n}\n\nexport function getLoanDocumentUrl(\n\tloanId: string,\n\tdocumentId: string\n) {\n\treturn `${host}/api/loans/${loanId}/documents/${documentId}/download?&accessToken=${ventiState.get(theme.storageKeys.authToken)}`\n}\n\nexport function getListingOpenHouseFlyerUrl(id: string) {\n\treturn `${host}/api/listings/${id}/open-house-flyer`\n}\n","export const eventTypes = {\n\tFORGOT_PASSWORD_SUBMITTED: 'Forgot Password Submitted',\n\tBUSINESS_RULE_CREATED: 'Business Rule Created',\n\tBUSINESS_RULE_UPDATED: 'Business Rule Updated',\n\tBUSINESS_RULE_DELETED: 'Business Rule Deleted',\n\tBUSINESS_RULE_RESTORED: 'Business Rule Restored',\n\tBORROWER_CREATED: 'Borrower Created',\n\tUSER_CREATED: 'User Created',\n\tUSER_DELETED: 'User Deleted',\n\tUSER_NUKED: 'User Nuked',\n\tUSER_RESTORED: 'User Restored',\n\tIMPERSONATION_REQUESTED: 'Impersonation Requested',\n\tIMPERSONATION_FORCED: 'Impersonation Forced',\n\tIMPERSONATION_STARTED: 'Impersonation Started',\n\tIMPERSONATION_STOPPED: 'Impersonation Stopped',\n\tIMPERSONATION_AUTHORIZED: 'Impersonation Authorized',\n\tACCOUNT_SETTINGS_UPDATED: 'Account Settings Updated',\n\tMILESTONE_CONFIGURATION_CREATED: 'Milestone Configuration Created',\n\tMILESTONE_CONFIGURATION_UPDATED: 'Milestone Configuration Updated',\n\tMILESTONE_CONFIGURATION_DELETED: 'Milestone Configuration Deleted',\n\tTASK_CREATED: 'Task Created',\n\tTASK_UPDATED: 'Task Updated',\n\tLOAN_TASK_REMOVED: 'Loan Task Deleted',\n\tLOAN_TASK_CREATED: 'Loan Task Created',\n\tLOAN_TASK_UPDATED: 'Loan Task Updated',\n\tLOAN_TASKS_IMPORTED: 'Loan Tasks Imported',\n\tLOAN_TASK_COMPLETED: 'Loan Task Completed',\n\tLOAN_TASK_SUBMITTED: 'Loan Task Submitted',\n\tLOAN_TASK_REMINDER_SENT: 'Loan Tasks Reminder Sent',\n\tBUSINESS_RULE_TASK_REMOVED: 'Business Rule Task Deleted',\n\tBUSINESS_RULE_TASK_CREATED: 'Business Rule Task Created',\n\tBUSINESS_RULE_TASK_UPDATED: 'Business Rule Task Updated',\n\t//Loan Officer\n\tLOAN_OFFICER_UPDATED: 'Loan Officer Updated',\n\tLOAN_OFFICER_CREATED: 'Loan Officer Created',\n\tLOAN_OFFICER_DELETED: 'Loan Officer Deleted',\n\tLOAN_OFFICER_EXPORTED: 'Loan Officers Exported',\n\tLOAN_OFFICER_RESTORED: 'Loan Officers Restored',\n\tLEAD_CREATED: 'Lead Created',\n\tLEAD_UPDATED: 'Lead Updated',\n\tLEAD_DELETED: 'Lead Deleted',\n\tLOAN_CREATED: 'Loan Created',\n\tLISTING_CREATED: 'Listing Created',\n\tLISTING_UPDATED: 'Listing Updated',\n\tLISTING_DELETED: 'Listing Deleted',\n\tBRAND_CREATED: 'Brand Created',\n\tBRAND_UPDATED: 'Brand Updated',\n\tBRAND_RESTORED: 'Brand Restored',\n\tBRAND_DELETED: 'Brand Deleted',\n\tBRAND_EXPORTED: 'Brands Exported',\n\tBRANCH_CREATED: 'Branch Created',\n\tBRANCH_UPDATED: 'Branch Updated',\n\tBRANCH_DELETED: 'Branch Deleted',\n\tBRANCH_EXPORTED: 'Branches Exported',\n\tBRANCH_RESTORED: 'Branch Restored',\n\tPARTNER_CREATED: 'Partner Created',\n\tPARTNER_UPDATED: 'Partner Updated',\n\tPARTNER_DELETED: 'Partner Deleted',\n\tPARTNER_EXPORTED: 'Partners Exported',\n\tPARTNER_RESTORED: 'Partner Restored',\n\tNOTIFICATION_TEMPLATE_CREATED: 'Notification Template Created',\n\tNOTIFICATION_TEMPLATE_UPDATED: 'Notification Template Updated',\n\tNOTIFICATION_TEMPLATE_DELETED: 'Notification Template Deleted',\n\tNOTIFICATION_TEMPLATE_RESTORED: 'Notification Template Restored',\n\tNOTIFICATION_TEMPLATE_PREVIEWED: 'Notification Template Previewed',\n\tNOTIFICATION_TEMPLATE_TEST_SENT: 'Notification Template Test Sent',\n\tDOCUMENT_TEMPLATE_CREATED: 'Document Template Created',\n\tDOCUMENT_TEMPLATE_UPDATED: 'Document Template Updated',\n\tDOCUMENT_TEMPLATE_DELETED: 'Document Template Deleted',\n\tDOCUMENT_TEMPLATE_RESTORED: 'Document Template Restored',\n\tDOCUMENT_TEMPLATE_VERSION_UPDATED:\n\t\t'Document Template Version Updated',\n\tDOCUMENT_TEMPLATE_VERSION_DELETED:\n\t\t'Document Template Version Deleted',\n\tUSER_PROFILE_DARK_MODE_TOGGLED: 'User Profile Dark Mode Toggled',\n\tUSER_PROFILE_MFA_TOGGLED: 'User Profile MFA Toggled',\n\tACCOUNT_PROFILE_MFA_PREFERENCE_CHANGED:\n\t\t'Account Profile MFA Preference Changed',\n\tACCOUNT_PROFILE_MILESTONE_CONFIGURATION_CHANGED:\n\t\t'Account Profile Milestone Configuration Changed',\n\tACCOUNT_PROFILE_ASO_SETTINGS_TOGGLED:\n\t\t'Account Profile ASO Settings Toggled',\n\tUSER_PASSWORD_UPDATED: 'User Password Updated',\n\tWORKFLOW_CREATED: 'Workflow Created',\n\tWORKFLOW_UPDATED: 'Workflow Updated',\n\tWORKFLOW_DELETED: 'Workflow Deleted',\n\tWORKFLOW_PREVIEW: 'Workflow Preview',\n\tWORKFLOW_RESTORED: 'Workflow Restored',\n\t// WORKFLOW_PREVIEWED: 'Workflow Previewed', // not used\n\tACCOUNT_MFA_PREFERENCE_CHANGED: 'Account MFA Preference Changed',\n\tSEND_TEST_NOTIFICATION: 'Send Test Notification',\n\tPREVIEW_AFTER_LOAN_OFFICER_SELECTED:\n\t\t'Preview After Loan Officer Selected',\n\tGET_RATE: 'Get Rate',\n\tADD_BORROWER_MANUALLY: 'Add Borrower Manually',\n\tADD_BORROWER_BY_INVITATION: 'Add Borrower By Invitation',\n\tCALCULATE_LOAN_PAYMENT: 'Calculate Loan Payment',\n\tCREDIT_SOFT_PULL_REQUEST: 'Credit Soft Pull Request',\n\tCREDIT_AUS_PRICING: 'Credit AUS Pricing',\n\tGENERATE_PREQUAL_LETTER: 'Generate Prequal Letter',\n\tGENERATE_PREAPPROVAL_LETTER: 'Generate Preapproval Letter',\n\tSAVE_TO_S2_S3: 'Save to S2/S3',\n\tGENERATE_LOAN_COMPARISON_PDF: 'Generate Loan Comparison PDF',\n\tDOCUMENT_TEMPLATE_DOWNLOADED: 'Document Template Downloaded',\n\tDOCUMENT_TEMPLATE_PREVIEWED: 'Document Template Previewed',\n\tENCOMPASS_WEB: 'Encompass Web',\n\tNEED_HELP: 'Need Help',\n\tTASK_VERIFICATION_REQUEST: 'Task Verification Request',\n\tDOCUMENT_UPLOADED: 'Document Uploaded',\n\tWORKFLOW_COMPLETED: 'Workflow Completed',\n\tWORKFLOW_STARTED: 'Workflow Started',\n}\n","export const currencyToFloat = (currency) => {\n\tconst numbersOnly = currency.replace(/[^0-9.-]+/g, '')\n\treturn parseFloat(numbersOnly)\n}\n\nexport const percentToDecimal = (percent) => {\n\tif (percent) {\n\t\treturn parseFloat(percent) / 100\n\t}\n\treturn percent\n}\n\nexport const decimalToPercent = (decimal, suffix = null) => {\n\tif (!decimal) {\n\t\treturn null\n\t}\n\n\treturn (decimal * 100).toFixed(2) + (suffix ? suffix : '')\n}\n\nexport const addressToString = (address) => {\n\tlet addressStr = ''\n\tif (address.street) {\n\t\taddressStr += address.street\n\t\tif (address.unit) {\n\t\t\taddressStr += ' ' + address.unit\n\t\t}\n\t}\n\n\tif (address.city) {\n\t\taddressStr += ' ' + address.city\n\t}\n\n\tif (address.state) {\n\t\taddressStr += ' ' + address.state\n\t\tif (address.state && address.postalCode) {\n\t\t\taddressStr += ','\n\t\t}\n\t}\n\n\tif (address.postalCode) {\n\t\taddressStr += ' ' + address.postalCode\n\t}\n\n\treturn addressStr.trim()\n}\n\nexport const leadAddressToString = (lead) => {\n\tconst {\n\t\tsubjectPropertyAddressStreet,\n\t\tsubjectPropertyAddressCity,\n\t\tsubjectPropertyAddressState,\n\t\tsubjectPropertyAddressZip,\n\t} = lead\n\treturn `${subjectPropertyAddressStreet || ''} ${subjectPropertyAddressCity || ''} ${subjectPropertyAddressState || ''} ${subjectPropertyAddressZip || ''}`\n}\n\nexport const getLeadBorrowerName = (lead) => {\n\tconst { firstName, lastName, data } = lead\n\tif (data && (data.BorrowerFirstName || data.BorrowerLastName)) {\n\t\treturn `${data.BorrowerFirstName || ''} ${data.BorrowerLastName || ''}`\n\t}\n\treturn `${firstName || ''} ${lastName || ''}`.trim()\n}\n\nexport const formatPhoneWithCountryCode = (phone) => {\n\treturn `+1${phone.replace(/\\D/g, '')}`\n}\n","import moment from 'moment'\nimport { getTheme } from '../config'\nimport { isEmpty, forEach } from 'lodash'\nimport PrequalPNG from 'assets/lordicons/Questionnaire.png'\nimport PrequalGIF from 'assets/lordicons/QuestionnaireAnimated.gif'\nimport { navigationLinking } from './navigation'\n\nconst theme = getTheme()\n\n/**\n * @param {string} email\n * @returns {boolean} - return TRUE if valid\n */\nexport const isEmailValid = function (email) {\n\tif (!email) {\n\t\treturn false\n\t}\n\n\treturn (\n\t\t!email.includes(' ') &&\n\t\temail.split('@').length === 2 &&\n\t\t/[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$/.test(email.toLowerCase())\n\t)\n}\n\n/**\n * @param {string} phone\n * @returns {boolean} - return TRUE if valid\n */\nexport const isPhoneNumberValid = function (phone) {\n\treturn /^(\\+0?1\\s)?\\(?\\d{3}\\)?[\\s.-]\\d{3}[\\s.-]\\d{4}$/.test(phone)\n}\n\nexport const isValidNMLSId = (nmlsId) =>\n\t/^[1-9]\\d{3,11}$/.test(nmlsId)\n\n/**\n * Format time with am / pm\n * @param date\n * @returns {string|*}\n */\nexport const formatAMPM = (date) => {\n\tif (!date) return date\n\tlet hours = date.getHours()\n\tlet minutes = date.getMinutes().toString()\n\tlet ampm = hours >= 12 ? 'pm' : 'am'\n\thours = hours % 12\n\thours = hours ? hours : 12\n\tminutes = minutes.padStart(2, '0')\n\treturn hours + ':' + minutes + ' ' + ampm\n}\n\n/**\n * Format dates\n * @param date\n * @param includeTime\n * @returns {string|*}\n */\nexport const formatDate = (date, includeTime = true) => {\n\tif (!date) return date\n\tconst jsDate = new Date(date)\n\tlet ret =\n\t\tjsDate.getMonth() +\n\t\t1 +\n\t\t'/' +\n\t\tjsDate.getDate() +\n\t\t'/' +\n\t\tjsDate.getFullYear()\n\tif (includeTime) ret += ` ${formatAMPM(jsDate)}`\n\treturn ret\n}\n\nexport const getRoleName = (role) => {\n\treturn theme.roles[role || 0]\n}\n\nexport const getTaskCategoryName = (category) => {\n\tconst categories = [\n\t\t'Application',\n\t\t'Conditions',\n\t\t'Closing',\n\t\t'PostClosing',\n\t]\n\n\treturn categories[category || 0]\n}\n\nexport const getTaskType = (type) => {\n\tconst types = [\n\t\t'Document',\n\t\t'Field',\n\t\t'E-Signature',\n\t\t'Disclosure',\n\t\t'Electronic Consent',\n\t\t'VOA',\n\t\t'VOI',\n\t\t'VOE',\n\t\t'VOC',\n\t\t'Payment',\n\t\t'VOIE',\n\t\t'IRS ID.ME',\n\t\t'Verification',\n\t]\n\n\treturn types[type]\n}\n\nexport const a11yProps = (index) => {\n\treturn {\n\t\tid: `vertical-tab-${index}`,\n\t\t'aria-controls': `vertical-tabpanel-${index}`,\n\t}\n}\n\n/**\n * @param {string} ssn\n * @returns {boolean} - return TRUE if valid\n */\nexport const isSSNValid = function (ssn) {\n\treturn /^\\d{3}-?\\d{2}-?\\d{4}$/.test(ssn)\n}\n\n/**\n * @param {string} dob\n * @returns {boolean} - return TRUE if valid\n */\nexport const isDOBValid = function (dob) {\n\tif (dob.length < 10) return false\n\tconst m = moment(dob, 'MM/DD/YYYY')\n\tconst now = moment()\n\tconst diff = now.diff(m, 'seconds')\n\treturn dob.length === 10 && !isNaN(diff) && diff >= 567648000\n}\n\nexport const isDateValid = function (date) {\n\tif (date.length < 10) return false\n\tconst m = moment(date, 'MM/DD/YYYY')\n\tconst now = moment()\n\tconst diff = now.diff(m, 'seconds')\n\treturn date.length === 10 && !isNaN(diff) && diff >= 0\n}\n\nexport const isFutureDateValid = function (date) {\n\tif (date.length < 10) return false\n\tconst m = moment(date, 'MM/DD/YYYY')\n\tconst now = moment()\n\tconst diff = now.diff(m, 'seconds')\n\treturn date.length === 10 && !isNaN(diff) && diff < 0\n}\n\nexport const isValidYear = function (value) {\n\treturn (\n\t\tvalue &&\n\t\t!isNaN(value) &&\n\t\tvalue >= 1500 &&\n\t\tvalue <= new Date().getFullYear()\n\t)\n}\n\nexport const isValidYears = function (value) {\n\treturn value > -1 && !isNaN(value)\n}\n\nexport const isValidMonths = function (value) {\n\treturn !isNaN(value) && value > -1 && value < 12\n}\n\nexport const isValidCurrency = function (value) {\n\treturn parseFloat(value) >= 0 && !isNaN(parseFloat(value))\n}\nexport const isValidDecimal = function (value) {\n\treturn value > -1 && !isNaN(value)\n}\n\nexport const isPositiveInt = function (value) {\n\treturn value && !isNaN(value)\n}\n\nexport function closestToZero(numbers) {\n\tif (!numbers.length) {\n\t\treturn 0\n\t}\n\n\tlet closest = 0\n\n\tfor (let i = 0; i < numbers.length; i++) {\n\t\tif (closest === 0) {\n\t\t\tclosest = numbers[i]\n\t\t} else if (numbers[i] > 0 && numbers[i] <= Math.abs(closest)) {\n\t\t\tclosest = numbers[i]\n\t\t} else if (numbers[i] < 0 && -numbers[i] < Math.abs(closest)) {\n\t\t\tclosest = numbers[i]\n\t\t}\n\t}\n\n\treturn closest\n}\n\nexport const textIsValid = function (value, type = null) {\n\tlet valid\n\tswitch (type) {\n\t\tcase 'phone':\n\t\t\tvalid = isPhoneNumberValid(value)\n\t\t\tbreak\n\t\tcase 'email':\n\t\t\tvalid = isEmailValid(value)\n\t\t\tbreak\n\t\tcase 'ssn':\n\t\t\tvalid = isSSNValid(value)\n\t\t\tbreak\n\t\tcase 'dob':\n\t\t\tvalid = isDOBValid(value)\n\t\t\tbreak\n\t\tcase 'date':\n\t\t\tvalid = isDateValid(value)\n\t\t\tbreak\n\t\tcase 'futureDate':\n\t\t\tvalid = isFutureDateValid(value)\n\t\t\tbreak\n\t\tcase 'year':\n\t\t\tvalid = isValidYear(value)\n\t\t\tbreak\n\t\tcase 'years':\n\t\t\tvalid = isValidYears(value)\n\t\t\tbreak\n\t\tcase 'months':\n\t\t\tvalid = isValidMonths(value)\n\t\t\tbreak\n\t\tcase 'currency':\n\t\t\tvalid = isValidCurrency(value)\n\t\t\tbreak\n\t\tcase 'decimal':\n\t\t\tvalid = isValidDecimal(value)\n\t\t\tbreak\n\t\tcase 'positive':\n\t\t\tvalid = isPositiveInt(value)\n\t\t\tbreak\n\t\tcase 'alpha':\n\t\t\tvalid = !!value && value.length > 0\n\t\t\tbreak\n\t\tcase 'numeric':\n\t\t\tvalid = !isNaN(parseInt(value, 10))\n\t\t\tbreak\n\t\tcase 'alphanumeric':\n\t\t\tvalid = !!value && value.length > 0\n\t\t\tbreak\n\t\tcase 'zipcode':\n\t\t\tvalid = !isNaN(parseInt(value, 10)) && value.length === 5\n\t\t\tbreak\n\t\tcase 'password':\n\t\t\tvalid = theme.validation.passwordRegex.test(value)\n\t\t\tbreak\n\t\tcase null:\n\t\t\tvalid = !!value && value.length > 0\n\t\t\tbreak\n\t\tcase '':\n\t\t\tvalid = !!value && value.length > 0\n\t\t\tbreak\n\t\tdefault:\n\t\t\tconst exp = new RegExp(RegExp.escape(type))\n\t\t\tvalid = exp.test(value)\n\t}\n\n\treturn valid\n}\n\nexport const stateKeys = [\n\t'BorrowerCurrentEmploymentAddressState',\n\t'BorrowerCurrentEmploymentAddressState0',\n\t'BorrowerCurrentEmploymentAddressState1',\n\t'BorrowerCurrentEmploymentAddressState2',\n\t'BorrowerHomeAddressState',\n\t'BorrowerMailingAddressState',\n\t'BorrowerRealEstatePropertyAddressState',\n\t'BorrowerRealEstatePropertyAddressState0',\n\t'BorrowerRealEstatePropertyAddressState1',\n\t'BorrowerRealEstatePropertyAddressState2',\n\t'SubjectPropertyAddressState',\n]\n\nexport const states = [\n\t{ label: 'Alabama', value: 'AL' },\n\t{ label: 'Alaska', value: 'AK' },\n\t{ label: 'American Samoa', value: 'AS' },\n\t{ label: 'Arizona', value: 'AZ' },\n\t{ label: 'Arkansas', value: 'AR' },\n\t{ label: 'California', value: 'CA' },\n\t{ label: 'Colorado', value: 'CO' },\n\t{ label: 'Connecticut', value: 'CT' },\n\t{ label: 'Delaware', value: 'DE' },\n\t{ label: 'District of Columbia', value: 'DC' },\n\t{ label: 'States of Micronesia', value: 'FM' },\n\t{ label: 'Florida', value: 'FL' },\n\t{ label: 'Georgia', value: 'GA' },\n\t{ label: 'Guam', value: 'GU' },\n\t{ label: 'Hawaii', value: 'HI' },\n\t{ label: 'Idaho', value: 'ID' },\n\t{ label: 'Illinois', value: 'IL' },\n\t{ label: 'Indiana', value: 'IN' },\n\t{ label: 'Iowa', value: 'IA' },\n\t{ label: 'Kansas', value: 'KS' },\n\t{ label: 'Kentucky', value: 'KY' },\n\t{ label: 'Louisiana', value: 'LA' },\n\t{ label: 'Maine', value: 'ME' },\n\t{ label: 'Marshall Islands', value: 'MH' },\n\t{ label: 'Maryland', value: 'MD' },\n\t{ label: 'Massachusetts', value: 'MA' },\n\t{ label: 'Michigan', value: 'MI' },\n\t{ label: 'Minnesota', value: 'MN' },\n\t{ label: 'Mississippi', value: 'MS' },\n\t{ label: 'Missouri', value: 'MO' },\n\t{ label: 'Montana', value: 'MT' },\n\t{ label: 'Nebraska', value: 'NE' },\n\t{ label: 'Nevada', value: 'NV' },\n\t{ label: 'New Hampshire', value: 'NH' },\n\t{ label: 'New Jersey', value: 'NJ' },\n\t{ label: 'New Mexico', value: 'NM' },\n\t{ label: 'New York', value: 'NY' },\n\t{ label: 'North Carolina', value: 'NC' },\n\t{ label: 'North Dakota', value: 'ND' },\n\t{ label: 'Northern Mariana Islands', value: 'MP' },\n\t{ label: 'Ohio', value: 'OH' },\n\t{ label: 'Oklahoma', value: 'OK' },\n\t{ label: 'Oregon', value: 'OR' },\n\t{ label: 'Palau', value: 'PW' },\n\t{ label: 'Pennsylvania', value: 'PA' },\n\t{ label: 'Puerto Rico', value: 'PR' },\n\t{ label: 'Rhode Island', value: 'RI' },\n\t{ label: 'South Carolina', value: 'SC' },\n\t{ label: 'South Dakota', value: 'SD' },\n\t{ label: 'Tennessee', value: 'TN' },\n\t{ label: 'Texas', value: 'TX' },\n\t{ label: 'Utah', value: 'UT' },\n\t{ label: 'Vermont', value: 'VT' },\n\t{ label: 'Virgin Islands', value: 'VI' },\n\t{ label: 'Virginia', value: 'VA' },\n\t{ label: 'Washington', value: 'WA' },\n\t{ label: 'West Virginia', value: 'WV' },\n\t{ label: 'Wisconsin', value: 'WI' },\n\t{ label: 'Wyoming', value: 'WY' },\n]\n\n/**\n * Check if an Object is \"empty\"\n * @param {Object} obj\n * @returns {boolean}\n */\nexport const hasEmptyProperties = (obj) => {\n\tif (typeof obj !== 'object') return true\n\n\tconst values = Object.values(obj)\n\n\tfor (let i in values) {\n\t\tif (!values[i]) return true\n\t}\n\n\treturn false\n}\n\n/**\n * Get item from async storage\n * @param {string} key\n * @return {string|null}\n */\nexport const getItemAsyncStorage = async (key) => {\n\ttry {\n\t\treturn localStorage.getItem(key)\n\t} catch (error) {\n\t\treturn null\n\t}\n}\n\n/**\n * @param {string} key\n * @param {string} data\n */\nexport const setItemAsyncStorage = (key, data) => {\n\ttry {\n\t\tlocalStorage.setItem(key, data)\n\t} catch (error) {}\n}\n\n/**\n * Get task status name\n * @param {string} type\n * @returns {string}\n */\nexport const getTaskStatusName = (type) => {\n\tconst names = ['Incomplete', 'Under Review', 'Complete']\n\treturn names[type]\n}\n\nexport const getTaskButtonTitle = (task) => {\n\tif (task.taskType === 0 && task.taskStatus === 1)\n\t\treturn 'Upload Another'\n\n\treturn theme.taskButtonTitles[task.taskType]\n}\n\nexport const loanDisclosureText = `This information does not guarantee loan approval, nor is it an offer or commitment to make a loan at the above rates and terms. Interest rates and terms are subject to daily change without notice. Contact a Loan Officer at 888-342-0000 for current rates.`\nexport const loanPaymentNotice =\n\t'Please remember that we do not have all your information. The payment listed does not include taxes or insurance premiums. If your LTV > 80$, private mortgage insurance will be added to your monthly mortgage payment. Your actual payments will vary based on your individual situation and current rates.'\n\nexport const defaultOptions = [\n\t{ label: ' - Choose a Mail Merge Field to Copy - ', value: '' },\n]\n\nexport const siteConfigOptions = [\n\t{ label: 'Company Name', value: 'companyName' },\n\t{ label: 'Company Street Address', value: 'companyAddress' },\n\t{\n\t\tlabel: 'Company Street Address Line 2',\n\t\tvalue: 'companyAddress2',\n\t},\n\t{ label: 'Company Address City', value: 'companyCity' },\n\t{ label: 'Company Address State', value: 'companyState' },\n\t{ label: 'Company Address Zip', value: 'companyZip' },\n\t{ label: 'Company Phone', value: 'companyPhone' },\n\t{ label: 'Company Fax', value: 'companyFax' },\n\t{ label: 'Company NMLSIS', value: 'companyNMLSID' },\n\t{ label: 'Company Website URL', value: 'companyUrl' },\n\t{ label: 'Portal Background Image', value: 'backgroundImageUrl' },\n\t{ label: 'Location Image', value: 'locationImageUrl' },\n\t{\n\t\tlabel: 'Footer Disclaimer Text 1',\n\t\tvalue: 'footerDisclaimerText1',\n\t},\n\t{\n\t\tlabel: 'Footer Disclaimer Text 2',\n\t\tvalue: 'footerDisclaimerText2',\n\t},\n\t{ label: 'Contact Us URL', value: 'contactUsUrl' },\n\t{ label: 'License Info URL', value: 'licenseInfoUrl' },\n\t{ label: 'Background Color', value: 'backgroundColor' },\n\t{ label: 'Terms and Conditions Url', value: 'termsUrl' },\n\t{ label: 'Twitter URL', value: 'twitterUrl' },\n\t{ label: 'Facebook URL', value: 'facebookUrl' },\n\t{ label: 'LinkedIn URL', value: 'linkedInUrl' },\n\t{ label: 'Instagram URL', value: 'instagramUrl' },\n\t{ label: 'Logo', value: 'logoUrl' },\n\t{ label: 'Portal Logo', value: 'portalLogoUrl' },\n\t{ label: 'Icon', value: 'iconUrl' },\n\t{ label: 'Banner', value: 'bannerUrl' },\n\t{ label: 'Secondary Banner', value: 'secondaryBannerUrl' },\n\t{ label: 'Profile Photo', value: 'profilePhotoUrl' },\n\t{ label: 'Primary Color', value: 'primaryColor' },\n\t{ label: 'Secondary Color', value: 'secondaryColor' },\n\t{ label: 'TextColor', value: 'textColor' },\n\t{ label: 'Name', value: 'name' },\n\t{ label: 'Address', value: 'address' },\n\t{ label: 'Address2', value: 'address2' },\n\t{ label: 'City', value: 'city' },\n\t{ label: 'State', value: 'state' },\n\t{ label: 'Zip', value: 'zip' },\n\t{ label: 'Phone', value: 'phone' },\n\t{ label: 'Fax', value: 'fax' },\n\t{ label: 'Office', value: 'tollFree' },\n\t{ label: 'NMLSID', value: 'nmlsid' },\n\t{ label: 'Introduction Title', value: 'introductionTitle' },\n\t{ label: 'Introduction', value: 'introduction', html: true },\n].sort((a, b) => (a.label > b.label ? 1 : -1))\n\nexport const loanFieldOptions = [\n\t{ label: 'Loan Number', value: 'LoanNumber' },\n\t{ label: 'Loan Purpose', value: 'LoanPurpose' },\n\t{ label: 'Loan Type', value: 'CurrentLoanType' },\n\t{ label: 'Loan Amount', value: 'LoanAmount' },\n\t{ label: 'Down Payment Amount', value: 'DownPaymentAmount' },\n\t{ label: 'Loan Term', value: 'LoanTerm' },\n\t{ label: 'LTV', value: 'LTV' },\n\t{ label: 'CLTV', value: 'CLTV' },\n\t{ label: 'Rate', value: 'Rate' },\n\t{\n\t\tlabel: 'Texas Reviewed Additional Items',\n\t\tvalue: 'TXReviewedAdditionalItems',\n\t},\n\t{\n\t\tlabel: 'Texas Required Additional Items',\n\t\tvalue: 'TXRequiredAdditionalItems',\n\t},\n\t{ label: 'Borrower First Name', value: 'BorrowerFirstName' },\n\t{ label: 'Borrower Last Name', value: 'BorrowerLastName' },\n\t{ label: 'Borrower Email', value: 'BorrowerEmail' },\n\t{\n\t\tlabel: 'Subject Property Sale Price',\n\t\tvalue: 'SubjectPropertySalePrice',\n\t},\n\t{ label: 'Has a Co-Borrower', value: 'HasCoBorrower' },\n\t{ label: 'CoBorrower First Name', value: 'CoBorrowerFirstName' },\n\t{ label: 'CoBorrower Last Name', value: 'CoBorrowerLastName' },\n\t{ label: 'CoBorrower Email', value: 'CoBorrowerEmail' },\n\t{ label: 'Borrower Middle Initial', value: 'BorrowerLastName' },\n\t{ label: 'Borrower Suffix', value: 'BorrowerSuffix' },\n\t{ label: 'Referrer', value: 'Referrer' },\n\t{ label: 'Borrower DOB', value: 'BorrowerDOB' },\n\t{\n\t\tlabel: 'Borrower Marital Status',\n\t\tvalue: 'BorrowerMaritalStatus',\n\t},\n\t{\n\t\tlabel: 'Borrower Home Address Street',\n\t\tvalue: 'BorrowerHomeAddressStreet',\n\t},\n\t{\n\t\tlabel: 'Borrower Home Address Unit Type',\n\t\tvalue: 'BorrowerHomeAddressUnitType',\n\t},\n\t{\n\t\tlabel: 'Borrower Home Address Unit Number',\n\t\tvalue: 'BorrowerHomeAddressUnitNumber',\n\t},\n\t{\n\t\tlabel: 'Borrower Home Address City',\n\t\tvalue: 'BorrowerHomeAddressCity',\n\t},\n\t{\n\t\tlabel: 'Borrower Home Address State',\n\t\tvalue: 'BorrowerHomeAddressState',\n\t},\n\t{\n\t\tlabel: 'Borrower Home Address Zip',\n\t\tvalue: 'BorrowerHomeAddressZip',\n\t},\n\t{\n\t\tlabel: 'Borrower Mailing Address Street',\n\t\tvalue: 'BorrowerMailingAddressStreet',\n\t},\n\t{\n\t\tlabel: 'Borrower Mailing Address Unit Type',\n\t\tvalue: 'BorrowerMailingAddressUnitType',\n\t},\n\t{\n\t\tlabel: 'Borrower Mailing Address Unit Number',\n\t\tvalue: 'BorrowerMailingAddressUnitNumber',\n\t},\n\t{\n\t\tlabel: 'Borrower Mailing Address City',\n\t\tvalue: 'BorrowerMailingAddressCity',\n\t},\n\t{\n\t\tlabel: 'Borrower Mailing Address State',\n\t\tvalue: 'BorrowerMailingAddressState',\n\t},\n\t{\n\t\tlabel: 'Borrower Mailing Address Zip',\n\t\tvalue: 'BorrowerMailingAddressZip',\n\t},\n\t{\n\t\tlabel: 'Subject Property Address City',\n\t\tvalue: 'SubjectPropertyAddressCity',\n\t},\n\t{\n\t\tlabel: 'Subject Property Address State',\n\t\tvalue: 'SubjectPropertyAddressState',\n\t},\n\t{\n\t\tlabel: 'Subject Property Address Zip',\n\t\tvalue: 'SubjectPropertyAddressZip',\n\t},\n\t{\n\t\tlabel: 'Subject Property Num Units',\n\t\tvalue: 'SubjectPropertyNumUnits',\n\t},\n\t{\n\t\tlabel: 'Subject Property Year Built',\n\t\tvalue: 'SubjectPropertyYearBuilt',\n\t},\n\t{ label: 'Subject Property Use', value: 'SubjectPropertyUse' },\n\t{\n\t\tlabel: 'Subject Property Residency Type',\n\t\tvalue: 'SubjectPropertyResidencyType',\n\t},\n\t{\n\t\tlabel: 'Pre-Approval Notes',\n\t\tvalue: 'PreApprovalNotes',\n\t},\n\t{\n\t\tlabel: 'Additional Pre-Approval Notes',\n\t\tvalue: 'AdditionalPreApprovalNotes',\n\t},\n].sort((a, b) => (a.label > b.label ? 1 : -1))\n\nexport const groupedOptions = [\n\t{\n\t\tlabel: '',\n\t\toptions: defaultOptions,\n\t},\n\t{\n\t\tlabel: 'Website Configuration',\n\t\toptions: siteConfigOptions,\n\t},\n\t{\n\t\tlabel: 'Loan Fields',\n\t\toptions: loanFieldOptions,\n\t},\n]\n\nexport const getErrorMessage = (error, type = '') => {\n\tconst unprocessableEntity = 422\n\tif (\n\t\terror.status === unprocessableEntity &&\n\t\terror.response.data?.errors\n\t) {\n\t\tconst errorMessages = (error.response.data?.errors || []).map(\n\t\t\t(errorItem) =>\n\t\t\t\t`${errorItem.propertyName}: ${errorItem.errorMessage}`\n\t\t)\n\t\treturn errorMessages.join(', ')\n\t}\n\tif (\n\t\terror?.data?.message === 'Exception Occurred' &&\n\t\ttype === 'support'\n\t) {\n\t\treturn `There was a problem processing your request. Please contact Big POS customer support (${theme.support.email}).`\n\t}\n\n\tif (error?.data?.message === 'Exception Occurred') {\n\t\treturn `System Error. Please contact your administrator. ErrorId: ${error?.data?.logId}`\n\t}\n\n\tif (error?.response?.data?.message) {\n\t\treturn error?.response?.data?.message\n\t}\n\tif (error?.data?.message) {\n\t\treturn error?.data?.message\n\t}\n\n\treturn theme.api_messages.server_error\n}\n\nexport const validateSiteConfigurationData = (data) => {\n\tdelete data.entityID\n\n\tforEach(data, function (value, key) {\n\t\tif (isEmpty(data[key])) {\n\t\t\tdelete data[key]\n\t\t}\n\t})\n}\n\nexport const isDarkMode = () => {\n\treturn localStorage.theme === 'dark'\n}\n\nexport const isMobileDevice = () => {\n\treturn /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n\t\tnavigator.userAgent\n\t)\n}\n\nexport const newShade = (hexColor, magnitude) => {\n\thexColor = hexColor.replace(`#`, ``)\n\n\tif (hexColor.length === 6) {\n\t\tconst decimalColor = parseInt(hexColor, 16)\n\t\tlet r = (decimalColor >> 16) + magnitude\n\t\tr > 255 && (r = 255)\n\t\tr < 0 && (r = 0)\n\t\tlet g = (decimalColor & 0x0000ff) + magnitude\n\t\tg > 255 && (g = 255)\n\t\tg < 0 && (g = 0)\n\t\tlet b = ((decimalColor >> 8) & 0x00ff) + magnitude\n\t\tb > 255 && (b = 255)\n\t\tb < 0 && (b = 0)\n\n\t\treturn `#${(g | (b << 8) | (r << 16)).toString(16)}`\n\t} else {\n\t\treturn hexColor\n\t}\n}\n\nexport const getEntityName = (entity, plural = false) => {\n\tlet val = entity\n\t\t.replace(/([A-Z]+)([A-Z][a-z])/g, ' $1 $2')\n\t\t.replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n\t\t.replace(/([a-zA-Z])(\\d)/g, '$1 $2')\n\t\t.replace(/^./, function (str) {\n\t\t\treturn str.toUpperCase()\n\t\t})\n\t\t.trim()\n\tif (val === 'Corporate') val = 'Brand'\n\tif (!plural) return val\n\n\tif (val === 'Corporate') return 'Brands'\n\tif (val === 'Branch') return 'Branches'\n\treturn `${val}s`\n}\n\nexport const appChoices = [\n\t'Prequal',\n\t'Borrower',\n\t'CoBorrower',\n\t'LO Borrower',\n\t'LO CoBorrower',\n\t'LO Spanish Borrower',\n\t'Spanish Borrower',\n\t'Spanish Prequal',\n\t'Test',\n]\n\nexport const borrowerRelationships = [\n\t'Not Applicable',\n\t'Spouse',\n\t'NonSpouse',\n]\n\nexport const questionTypes = [\n\t{ label: 'Information', value: 'information' },\n\t{ label: 'Choice', value: 'choice' },\n\t{ label: 'Boolean', value: 'boolean' },\n\t{ label: 'Text Input', value: 'text' },\n\t{ label: 'SSN Input', value: 'ssn' },\n\t{ label: 'Email Input', value: 'email' },\n\t{ label: 'Phone Input', value: 'phone' },\n\t{ label: 'DOB Input', value: 'dob' },\n\t{ label: 'Currency Input', value: 'text' },\n\t{ label: 'Picker', value: 'picker' },\n\t{ label: 'State Picker', value: 'state' },\n\t{ label: 'Licensed State', value: 'licensedState' },\n\t{ label: 'Range / Slider', value: 'range' },\n\t{ label: 'Basic Input Group', value: 'group' },\n\t{ label: 'Google Places Lookup', value: 'place' },\n\t{ label: 'Address Group', value: 'addressGroup' },\n\t{ label: 'Contact Group', value: 'contactInfoGroup' },\n\t{ label: 'Declaration', value: 'declaration' },\n\t{ label: 'Authorization', value: 'authorization' },\n\t{ label: 'Upload', value: 'upload' },\n\t{ label: 'Photo', value: 'photo' },\n]\n\nexport const documentTemplateTypes = [\n\t{\n\t\tlabel: 'Prequal Letter',\n\t\tvalue: 'PrequalLetter',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Preapproval Letter',\n\t\tvalue: 'PreapprovalLetter',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'E-Consent',\n\t\tvalue: 'EConsent',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Credit Auth',\n\t\tvalue: 'CreditAuthorization',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Text Opt In',\n\t\tvalue: 'TextOptIn',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Open House Flyer',\n\t\tvalue: 'OpenHouseFlyer',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Loan Comparison',\n\t\tvalue: 'LoanComparison',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Buyer Agency Agreements',\n\t\tvalue: 'BuyerAgencyAgreements',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Listing Agreements',\n\t\tvalue: 'ListingAgreements',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Addendums',\n\t\tvalue: 'Addendums',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Rental Agreements',\n\t\tvalue: 'RentalAgreements',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Sales Contracts',\n\t\tvalue: 'SalesContracts',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Real Estate Market Flyer',\n\t\tvalue: 'RealEstateMarketFlyer',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Mortgage Marketing Flyer',\n\t\tvalue: 'MortgageMarketingFlyer',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Fee Itemization',\n\t\tvalue: 'FeeItemization',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Refinance Document',\n\t\tvalue: 'RefinanceDocument',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Certified Commitments',\n\t\tvalue: 'CertifiedCommitments',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Co-Branded Marketing Flyer',\n\t\tvalue: 'CoBrandedMarketingFlyer',\n\t\tactive: true,\n\t},\n]\n\nexport const notificationTemplateTypes = [\n\t{\n\t\tlabel: 'Prequal Letter',\n\t\tvalue: 'PrequalLetter',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Preapproval Letter',\n\t\tvalue: 'PreapprovalLetter',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'E-Consent',\n\t\tvalue: 'EConsent',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Credit Auth',\n\t\tvalue: 'CreditAuthorization',\n\t\tactive: false,\n\t},\n\t{\n\t\tlabel: 'Text Opt In',\n\t\tvalue: 'TextOptIn',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Open House Flyer',\n\t\tvalue: 'OpenHouseFlyer',\n\t\tactive: true,\n\t},\n\t{\n\t\tlabel: 'Agent Portal Documents',\n\t\tvalue: 'AgentPortalDocuments',\n\t\tactive: false,\n\t},\n]\n\nexport const borrowerTypes = [\n\t'Borrower',\n\t'CoBorrower',\n\t'Non-Borrowing Spouse',\n]\n\nexport const formAuthTypes = [\n\t'Borrower',\n\t'CoBorrower',\n\t'Non-Borrowing Spouse',\n]\n\nexport const formTypes = [\n\t'Prequal',\n\t'Full App',\n\t'Co-Borrower Invite Full App',\n\t'LO Borrower Full App',\n\t'LO Co-Borrower Full App',\n\t'Co-Borrower Invite Prequal',\n\t'Spanish Prequal',\n\t'Spanish Full App',\n\t'LO Borrower Prequal',\n\t'LO Co-Borrower Prequal',\n\t'LO Lead App',\n\t'Super-Short App',\n\t'Co-Borrower Prequal (by Borrower)',\n\t'Co-Borrower Full App (by Borrower)',\n\t'Open House From Listing',\n\t'Agent Client Buyer',\n\t'Agent Client Seller',\n\t'Agent Client Lifestyle',\n\t'Walmart',\n\t'Open House By Address',\n\t'EConsent & Credit Auth',\n\t'Realtor Partner Sign Up',\n\t'Open House With Listing Choice',\n\t'Listing Offer from Listing',\n\t'Listing Offer With Listing Choice',\n\t'Spanish LO Prequal',\n\t'Spanish LO Co-Borrower Prequal',\n\t'Spanish LO Full App',\n\t'Spanish LO Co-Borrower Full App',\n\t'Agent Referral',\n\t'Spanish Co-Borrower Invite Prequal',\n\t'Spanish Co-Borrower Invite Full App',\n]\n\nexport const validationOptions = [\n\t{\n\t\tlabel: 'Email Address',\n\t\tvalue: 'email',\n\t\tmessage: 'Please enter a valid email address',\n\t},\n\t{\n\t\tlabel: 'Phone Number',\n\t\tvalue: 'phone',\n\t\tmessage: 'Please enter a valid phone number',\n\t},\n\t{\n\t\tlabel: 'Past Date',\n\t\tvalue: 'date',\n\t\tmessage: 'Please enter a valid past date in mm/dd/yyyy format',\n\t},\n\t{\n\t\tlabel: 'Future Date',\n\t\tvalue: 'futureDate',\n\t\tmessage: 'Please enter a valid future date in mm/dd/yyyy format',\n\t},\n\t{\n\t\tlabel: 'Birthdate',\n\t\tvalue: 'dob',\n\t\tmessage: `Please enter a valid birthdate before ${moment().subtract(18, 'years').toDate().toLocaleDateString()}`,\n\t},\n\t{\n\t\tlabel: 'Social Security Number',\n\t\tvalue: 'ssn',\n\t\tmessage: 'Please enter a valid Social Security Number',\n\t},\n\t{\n\t\tlabel: 'Currency Integer ($1,250)',\n\t\tvalue: 'Please enter a valid dollar amount',\n\t},\n\t{\n\t\tlabel: 'Currency Float ($1,250.00)',\n\t\tvalue: 'Please enter a valid dollar amount',\n\t},\n\t{\n\t\tlabel: 'Letters Only',\n\t\tvalue: 'alpha',\n\t\tmessage: 'Please enter a value',\n\t},\n\t{\n\t\tlabel: 'Numbers Only',\n\t\tvalue: 'numeric',\n\t\tmessage: 'Please enter a number',\n\t},\n\t{\n\t\tlabel: 'Letters and Numbers',\n\t\tvalue: 'alphanumeric',\n\t\tmessage: 'Please enter a value',\n\t},\n\t{\n\t\tlabel: 'Year (YYYY)',\n\t\tvalue: 'year',\n\t\tmessage: 'Please enter a valid year',\n\t},\n\t{\n\t\tlabel: 'Years',\n\t\tvalue: 'years',\n\t\tmessage: 'Please enter a valid number of years',\n\t},\n\t{\n\t\tlabel: 'Months',\n\t\tvalue: 'months',\n\t\tmessage: 'Please enter a valid number of months',\n\t},\n\t{\n\t\tlabel: 'Positive Number',\n\t\tvalue: 'positive',\n\t\tmessage: 'Please enter a value',\n\t},\n\t{\n\t\tlabel: 'Zipcode',\n\t\tvalue: 'zipcode',\n\t\tmessage: 'Please enter a valid zipcode',\n\t},\n\t{\n\t\tlabel: 'Password',\n\t\tvalue: 'password',\n\t\tmessage: 'Password does not meet the criterion',\n\t},\n]\n\nexport const branchTypes = [\n\t{ label: 'Mortgage', value: 'Mortgage' },\n\t{ label: 'Real Estate', value: 'RealEstate' },\n]\n\nexport function getValidationMessage(type) {\n\tif (type === 'required') return 'Please enter a value'\n\treturn validationOptions.find((v) => v.value === type)?.message\n}\n\n/**\n * Get mixed panel user properties\n * @param user\n * @returns {null|{role, id, email}}\n */\nexport const getMixpanelUserProperties = (user) => {\n\tif (!user) return null\n\n\tconst { id, email, role } = user\n\treturn {\n\t\tid,\n\t\temail,\n\t\trole,\n\t}\n}\n\n/**\n * Recursive function to find properties in the specified workflow\n * @param {array} questions\n * @param {string} prop\n * @param {boolean} searchGroups\n * @param {boolean} searchOptions\n * @param {array} ids\n * @returns {array}\n */\nexport const findWorkflowProperties = ({\n\tquestions = [],\n\tprop = 'fieldId',\n\tsearchGroups = true,\n\tsearchOptions = false,\n\tids = [],\n}) => {\n\tquestions.forEach((q) => {\n\t\tif (q[prop]) ids.push(q[prop])\n\t\tif (!q.items || !q.items.length) {\n\t\t\tif (q[prop]) ids.push(q[prop])\n\t\t\tif (searchOptions && q.options?.length)\n\t\t\t\tq.options.forEach((o) => {\n\t\t\t\t\tif (o[prop]) ids.push(o[prop])\n\t\t\t\t})\n\t\t} else if (searchGroups) {\n\t\t\tfindWorkflowProperties({\n\t\t\t\tquestions: q.items,\n\t\t\t\tprop,\n\t\t\t\tsearchOptions,\n\t\t\t\tids,\n\t\t\t})\n\t\t}\n\t})\n\treturn ids\n}\n\nexport const iterateObject = (obj, stack = []) => {\n\tfor (const key in obj) {\n\t\tif (obj.hasOwnProperty(key)) {\n\t\t\tif (typeof obj[key] === 'object') {\n\t\t\t\titerateObject(obj[key], stack)\n\t\t\t} else {\n\t\t\t\tstack.push({ key, value: obj[key] })\n\t\t\t}\n\t\t}\n\t}\n\treturn stack\n}\n\nexport const inviteActions = {\n\tBorrower: [\n\t\t{\n\t\t\tname: 'Apply for a Loan',\n\t\t\tid: 'fullApp',\n\t\t\tstaticIcon: PrequalPNG,\n\t\t\tanimatedIcon: PrequalGIF,\n\t\t\troute: navigationLinking.Apply,\n\t\t\tdescription: 'Continue in English',\n\t\t},\n\t\t{\n\t\t\tname: 'Solicitar un Préstamo',\n\t\t\tid: 'spanishFullApp',\n\t\t\tstaticIcon: PrequalPNG,\n\t\t\tanimatedIcon: PrequalGIF,\n\t\t\troute: navigationLinking.ApplySpanish,\n\t\t\tdescription: 'Continuar en Español',\n\t\t},\n\t],\n\tCoBorrower: [\n\t\t{\n\t\t\tname: 'Co-Borrower Application',\n\t\t\tid: 'fullApp',\n\t\t\tstaticIcon: PrequalPNG,\n\t\t\tanimatedIcon: PrequalGIF,\n\t\t\troute: navigationLinking.InviteApply,\n\t\t\tdescription: 'Continue in English',\n\t\t},\n\t\t{\n\t\t\tname: 'Solicitud de Coprestatario',\n\t\t\tid: 'spanishFullApp',\n\t\t\tstaticIcon: PrequalPNG,\n\t\t\tanimatedIcon: PrequalGIF,\n\t\t\troute: navigationLinking.InviteApplySpanish,\n\t\t\tdescription: 'Continuar en Español',\n\t\t},\n\t],\n}\n\nexport const automatedServices = [\n\t{\n\t\tname: 'Credit Determination',\n\t\titems: [\n\t\t\t{\n\t\t\t\tname: 'Run Soft Pull Credit',\n\t\t\t\tsettingId: 'softPull',\n\t\t\t\tfieldId: 'CX.POS.WF.SOFTPULL',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Run Tri Merge Credit',\n\t\t\t\tsettingId: 'triMerge',\n\t\t\t\tfieldId: 'CX.POS.WF.CREDIT',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Run Closing Costs',\n\t\t\t\tsettingId: 'closingCosts',\n\t\t\t\tfieldId: 'CX.POS.WF.FEES',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Run DU',\n\t\t\t\tsettingId: 'du',\n\t\t\t\tfieldId: 'CX.POS.WF.DU',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Run LPA',\n\t\t\t\tsettingId: 'lp',\n\t\t\t\tfieldId: 'CX.POS.WF.LP',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Trigger ICE Mortgage Income Analyzers',\n\t\t\t\tsettingId: 'iceIncomeAnalyzer',\n\t\t\t\tfieldId: 'CX.POS.WF.INCOME.CALC',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Trigger ICE Credit Analyzers',\n\t\t\t\tsettingId: 'iceCreditAnalyzer',\n\t\t\t\tfieldId: 'CX.POS.WF.CA',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tname: 'Verifications',\n\t\titems: [\n\t\t\t{\n\t\t\t\tname: 'Run VOA',\n\t\t\t\tsettingId: 'voa',\n\t\t\t\tfieldId: 'CX.POS.WF.VOA',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Run VOI',\n\t\t\t\tsettingId: 'voi',\n\t\t\t\tfieldId: 'CX.POS.WF.VOI',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Run VOIE',\n\t\t\t\tsettingId: 'voie',\n\t\t\t\tfieldId: 'CX.POS.WF.VOIE',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Run VOE',\n\t\t\t\tsettingId: 'voe',\n\t\t\t\tfieldId: 'CX.POS.WF.VOE',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Run Flood',\n\t\t\t\tsettingId: 'flood',\n\t\t\t\tfieldId: 'CX.POS.WF.FLOOD',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Trigger AVM',\n\t\t\t\tsettingId: 'avm',\n\t\t\t\tfieldId: 'CX.POS.WF.AVM',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tname: 'Document Generation',\n\t\titems: [\n\t\t\t{\n\t\t\t\tname: 'Trigger Disclosures Package',\n\t\t\t\tsettingId: 'disclosures',\n\t\t\t\tfieldId: 'CX.POS.WF.DISCLOSURES',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Trigger Pre-Approval',\n\t\t\t\tsettingId: 'preApproval',\n\t\t\t\tfieldId: 'CX.POS.WF.PREAPPROVAL',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Trigger Pre-Qualification',\n\t\t\t\tsettingId: 'preQualification',\n\t\t\t\tfieldId: 'CX.POS.WF.PREQUAL',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tname: 'Mortgage Insurance',\n\t\titems: [\n\t\t\t{\n\t\t\t\tname: 'Run MI Calculator',\n\t\t\t\tsettingId: 'mi',\n\t\t\t\tfieldId: 'CX.POS.WF.MI.CALC',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'MI - Radian',\n\t\t\t\tsettingId: 'miRadian',\n\t\t\t\tfieldId: 'CX.POS.WF.RADIAN',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'MI - Essent',\n\t\t\t\tsettingId: 'miEssent',\n\t\t\t\tfieldId: 'CX.POS.WF.ESSENT',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'MI - National MI',\n\t\t\t\tsettingId: 'miNational',\n\t\t\t\tfieldId: 'CX.POS.WF.NMI',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'MI - Enact',\n\t\t\t\tsettingId: 'miEnact',\n\t\t\t\tfieldId: 'CX.POS.WF.ENACT',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'MI - MGIC',\n\t\t\t\tsettingId: 'mimgic',\n\t\t\t\tfieldId: 'CX.POS.WF.MGIC',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'MI - Arch',\n\t\t\t\tsettingId: 'miArch',\n\t\t\t\tfieldId: 'CX.POS.WF.ARCH',\n\t\t\t},\n\t\t],\n\t},\n]\n\nexport const borrowerTypesStringToEnum = {\n\tBorrower: 0,\n\tCoBorrower: 1,\n\tUnknown: 2,\n}\n\nexport const formattedUserRoles = new Map([\n\t['Admin', 'Admin'],\n\t['Borrower', 'Borrower'],\n\t['BranchManager', 'Branch Manager'],\n\t['LoanOfficerAssistant', 'Loan Officer Assistant'],\n\t['LoanOfficer', 'Loan Officer'],\n\t['LoanProcessor', 'Loan Processor'],\n\t['Realtor', 'Realtor'],\n\t['SettlementAgent', 'Settlement Agent'],\n])\n","import ApplicationPNG from 'assets/lordicons/Application.png'\nimport ApplicationGIF from 'assets/lordicons/ApplicationAnimated.gif'\nimport CalendarPNG from 'assets/lordicons/Calendar.png'\nimport CalendarGIF from 'assets/lordicons/CalendarAnimated.gif'\nimport PhonePNG from 'assets/lordicons/Phone.png'\nimport PhoneGIF from 'assets/lordicons/PhoneAnimated.gif'\nimport PrequalPNG from 'assets/lordicons/Questionnaire.png'\nimport PrequalGIF from 'assets/lordicons/QuestionnaireAnimated.gif'\nimport DollarCoinPNG from 'assets/lordicons/DollarCoin.png'\nimport DollarCoinGIF from 'assets/lordicons/DollarCoinAnimated.gif'\nimport QuickPricerPNG from 'assets/lordicons/QuickPricer.png'\nimport QuickPricerGIF from 'assets/lordicons/QuickPricer.gif'\nimport ListPNG from 'assets/lordicons/List.png'\nimport ListGIF from 'assets/lordicons/ListAnimated.gif'\nimport RulesPNG from 'assets/lordicons/Rules.png'\nimport RulesGIF from 'assets/lordicons/RulesAnimated.gif'\nimport PaymentPNG from 'assets/lordicons/Payment.png'\nimport PaymentGIF from 'assets/lordicons/PaymentAnimated.gif'\nimport LoanApplicationsPNG from 'assets/lordicons/LoanApplications.png'\nimport LoanApplicationsGIF from 'assets/lordicons/LoanApplicationsAnimated.gif'\nimport UserPNG from 'assets/lordicons/User.png'\nimport UserGIF from 'assets/lordicons/UserAnimated.gif'\nimport SignaturePNG from 'assets/lordicons/Signature.png'\nimport SignatureGIF from 'assets/lordicons/SignatureAnimated.gif'\nimport DocumentsPNG from 'assets/lordicons/Documents.png'\nimport CalculatorPNG from 'assets/lordicons/Calculator.png'\nimport AddCoBorrowerPNG from 'assets/lordicons/AddCoBorrower.png'\nimport LOConnectPNG from 'assets/lordicons/LOConnect.png'\nimport DocumentsGIF from 'assets/lordicons/DocumentsAnimated.gif'\nimport CalculatorGIF from 'assets/lordicons/CalculatorAnimated.gif'\nimport AddCoBorrowerGIF from 'assets/lordicons/AddCoBorrowerAnimated.gif'\nimport LOConnectGIF from 'assets/lordicons/LOConnectAnimated.gif'\nimport SettingsPNG from 'assets/lordicons/Settings.png'\nimport BrandsPNG from 'assets/lordicons/Brands.png'\nimport LocationPinPNG from 'assets/lordicons/LocationPin.png'\nimport LoanOfficersPNG from 'assets/lordicons/LoanOfficers.png'\nimport UsersPNG from 'assets/lordicons/Users.png'\nimport NotificationsPNG from 'assets/lordicons/Notifications.png'\nimport RequestQueuePNG from 'assets/lordicons/Queue.png'\nimport SettingsGIF from 'assets/lordicons/SettingsAnimated.gif'\nimport BrandsGIF from 'assets/lordicons/BrandsAnimated.gif'\nimport LocationPinGIF from 'assets/lordicons/LocationPinAnimated.gif'\nimport LoanOfficersGIF from 'assets/lordicons/LoanOfficersAnimated.gif'\nimport UsersGIF from 'assets/lordicons/UsersAnimated.gif'\nimport NotificationsGIF from 'assets/lordicons/NotificationsAnimated.gif'\nimport RequestQueueGIF from 'assets/lordicons/QueueAnimated.gif'\nimport TimerPNG from 'assets/lordicons/Timer.png'\nimport TimerGIF from 'assets/lordicons/TimerAnimated.gif'\nimport ReleaseNotesPNG from 'assets/lordicons/ReleaseNotes.png'\nimport ReleaseNotesGIF from 'assets/lordicons/ReleaseNotes.gif'\nimport SupportPNG from 'assets/lordicons/Support.png'\nimport SupportGIF from 'assets/lordicons/SupportAnimated.gif'\nimport BuyAHomePNG from 'assets/lordicons/BuyAHome.png'\nimport BuyAHomeGIF from 'assets/lordicons/BuyAHomeAnimated.gif'\nimport SellMyHomePNG from 'assets/lordicons/SellMyHome.png'\nimport SellMyHomeGIF from 'assets/lordicons/SellMyHomeAnimated.gif'\nimport ClientLifestylePNG from 'assets/lordicons/ClientLifestyle.png'\nimport ClientLifestyleGIF from 'assets/lordicons/ClientLifestyleAnimated.gif'\nimport ClientsPNG from 'assets/lordicons/Clients.png'\nimport ClientsGIF from 'assets/lordicons/ClientsAnimated.gif'\nimport PartnersPNG from 'assets/lordicons/Partners.png'\nimport PartnersGIF from 'assets/lordicons/PartnersAnimated.gif'\nimport KioskPNG from 'assets/lordicons/Kiosk.png'\nimport KioskGIF from 'assets/lordicons/KioskAnimated.gif'\nimport AgentListingsPNG from 'assets/lordicons/AgentListings.png'\nimport AgentListingsGIF from 'assets/lordicons/AgentListingsAnimated.gif'\nimport ReviewsPNG from 'assets/lordicons/Reviews.png'\nimport ReviewsGIF from 'assets/lordicons/ReviewsAnimated.gif'\nimport { Roles, SiteTypes, host } from './client'\nimport { generatePath } from 'react-router-dom'\nimport { addressToString } from './formattingUtils'\n\n/**\n * Navigation Linking\n */\nexport const navigationLinking = {\n\tLanding: '/',\n\tSignIn: 'sign-in',\n\tSupportSignIn: 'support/sign-in',\n\tAuthChallenge: 'sign-in/challenge',\n\tSMSVerification: 'sign-in/sms-verification',\n\tCreateAccount: 'create-account',\n\tVerifyInvite: 'verify/invite/:token',\n\tForgotPassword: 'forgot-password',\n\tSetPassword: 'set-password',\n\tPrequalify: 'prequalify',\n\tLeadApp: 'questionnaire',\n\tBuyerClient: 'buy-a-home',\n\tSellerClient: 'sell-my-home',\n\tClientLifestyle: 'client-lifestyle',\n\tOpenHouseWithListing: 'open-house/:address/:listingId',\n\tOpenHouse: 'open-house/:address',\n\tOpenHouseNoAddress: 'open-house',\n\tWalmart: 'walmart',\n\tLeadCheckIn: 'lead-check-in',\n\tPrequalifySpanish: 'prequalify/esp',\n\tPrequalifyCoBorrower: 'prequalify/co-borrower',\n\tApplyCoBorrower: 'apply/co-borrower',\n\tRealtorSignUp: 'partners/realtors/register',\n\tPricing: 'pricing',\n\tPricingTable: 'pricing/rates',\n\tPricingDetails: 'pricing/rates/details',\n\tPricingSettings: 'portal/pricing-settings',\n\tFees: 'portal/fees',\n\tDisclosures: 'portal/disclosures/:id?',\n\tDisclosuresSSO: 'portal/disclosures/sso',\n\tListingOffer: 'listings/make-an-offer',\n\tListingOfferWithListing: 'listings/make-an-offer/:listingId',\n\tListingLanding: 'listings/:slug',\n\tImpersonationConfirmation: 'impersonation-confirmation/:token',\n\n\t// Protected\n\tPortal: 'portal',\n\tLeads: 'portal/leads',\n\tLeadAdd: 'portal/leads/add',\n\tLeadEdit: 'portal/leads/edit/:id',\n\tLeadOpenHouses: 'portal/leads/open-houses',\n\tLeadOpenHouseDetail: 'portal/leads/open-houses/detail',\n\tLeadPropertyInfoBuyer: 'portal/leads/property-info/buyer',\n\tLeadPropertyInfoSeller: 'portal/leads/property-info/seller',\n\tLeadFinancingInfo: 'portal/leads/financing-info',\n\tLeadLifestyleInfo: 'portal/leads/lifestyle-info',\n\tListings: 'portal/listings',\n\tListingAdd: 'portal/listings/add',\n\tListingEdit: 'portal/listings/edit/:id',\n\tListingDetail: 'portal/listings/detail/:id',\n\tAgentReferral: 'portal/agent-referral',\n\tUserProfile: 'portal/profile',\n\tTasks: 'portal/application/:loanId/tasks',\n\tCameraView: 'portal/tasks/camera',\n\tDocuments: 'portal/application/:loanId/documents',\n\tDocument: 'portal/document',\n\tLoanApplications: 'portal/applications',\n\tLoanApplication: 'portal/application/:loanId/details',\n\tApply: 'apply',\n\tApplySpanish: 'apply/esp',\n\tLOLeadApp: 'portal/lead-app',\n\tLOApply: 'portal/apply/borrower',\n\tLOApplySpanish: 'portal/apply/esp',\n\tLOApplyCoBorrower: 'portal/apply/coborrower',\n\tLOApplyCoBorrowerSpanish: 'portal/apply/coborrower/esp',\n\tLOPrequal: 'portal/prequal/borrower',\n\tLOPrequalSpanish: 'portal/prequal/borrower/esp',\n\tLOPrequalCoBorrower: 'portal/prequal/coborrower',\n\tLOPrequalCoBorrowerSpanish: 'portal/prequal/coborrower/esp',\n\tInviteApply: 'invite/apply',\n\tInviteApplySpanish: 'invite/apply/esp',\n\tInvitePrequalify: 'invite/prequalify',\n\tInvitePrequalifySpanish: 'invite/prequalify/esp',\n\tCustomWorkflow: 'app/:slug',\n\n\tQuickPricer: 'portal/pricing',\n\tWorkflowEditor: 'portal/workflows',\n\tLoanCalculator: 'portal/application/:loanId/calculator',\n\tLoanPricingResults: 'portal/calculator/pricing',\n\tLoanComparison: 'portal/calculator/comparison',\n\tPartner: 'portal/my-partners',\n\tIncompleteLoans: 'portal/incomplete-loans',\n\n\t// Admin\n\tAdminAccount: 'portal/account',\n\tAdminAccountEdit: 'portal/account/edit',\n\n\tAdminCorporate: 'portal/corporations',\n\tAdminCorporateEdit: 'portal/corporations/:id',\n\n\tAdminBranch: 'portal/branches',\n\tAdminBranchEdit: 'portal/branches/:id',\n\n\tAdminLoanOfficer: 'portal/loanOfficers',\n\tAdminLoanOfficerEdit: 'portal/loanOfficers/:id',\n\n\tAdminPartner: 'portal/partners',\n\tAdminPartnerEdit: 'portal/partners/:id',\n\n\tAdminWorkflow: 'portal/workflows',\n\tAdminWorkflowEdit: 'portal/workflows/:id',\n\n\tAdminDevice: 'portal/kiosks',\n\tAdminDeviceEdit: 'portal/kiosks/:id',\n\n\tAdminNotificationTemplates: 'portal/notifications/templates',\n\tAdminNotificationTemplateAdd: 'portal/notifications/templates/new',\n\tAdminNotificationTemplateEdit: 'portal/notifications/templates/:id',\n\n\tAdminDocumentTemplates: 'portal/documents/templates',\n\tAdminDocumentTemplateAdd: 'portal/documents/templates/new',\n\tAdminDocumentTemplateEdit: 'portal/documents/templates/:id',\n\n\tAdminRules: 'portal/rules',\n\tAdminRuleTasks: 'portal/rules/:id/tasks',\n\n\tAdminUser: 'portal/users',\n\n\tAdminLoanQueue: 'portal/queue',\n}\n\n// @todo appLink functions should be moved to a hook\nexport const filterAppLinks = (links, siteConfig = {}) => {\n\treturn links.filter(\n\t\t(link) =>\n\t\t\t((siteConfig?.enabledServices[link.fieldName] !== undefined &&\n\t\t\t\tsiteConfig?.enabledServices[link.fieldName] !== false) ||\n\t\t\t\tsiteConfig[link.fieldName]) &&\n\t\t\tlink.entityTypes.includes(siteConfig.entityType)\n\t)\n}\n\n/**\n * Get Application Links\n *\n * @param siteConfig\n * @returns {[{staticIcon, fieldName: string, animatedIcon, name: string, link: string, description: string, entityTypes: number[], id: string}, {staticIcon, fieldName: string, animatedIcon, name: string, link: string, description: string, entityTypes: number[], id: string}, {staticIcon, fieldName: string, animatedIcon, name: string, link: string, description: string, entityTypes: number[], id: string}, {staticIcon: never, fieldName: string, animatedIcon: never, name: string, description: string, entityTypes: (number)[], id: string}, {staticIcon: never, fieldName: string, animatedIcon: never, name: string, link: string, description: string, entityTypes: (number)[], id: string}, null, null, null, null]}\n */\nexport const getAppLinks = (siteConfig = {}) => {\n\tconst appLinks = [\n\t\t{\n\t\t\tname: 'Buy a Home',\n\t\t\tid: 'BuyerClient',\n\t\t\tfieldName: 'buyerClient',\n\t\t\tstaticIcon: BuyAHomePNG,\n\t\t\tanimatedIcon: BuyAHomeGIF,\n\t\t\tdescription: 'Find the perfect home',\n\t\t\tlink: navigationLinking.BuyerClient,\n\t\t\tentityTypes: [SiteTypes.realtor],\n\t\t},\n\t\t{\n\t\t\tname: 'Sell my Home',\n\t\t\tid: 'SellerClient',\n\t\t\tfieldName: 'sellerClient',\n\t\t\tstaticIcon: SellMyHomePNG,\n\t\t\tanimatedIcon: SellMyHomeGIF,\n\t\t\tdescription: 'Sell my home',\n\t\t\tlink: navigationLinking.SellerClient,\n\t\t\tentityTypes: [SiteTypes.realtor],\n\t\t},\n\t\t{\n\t\t\tname: 'Client Lifestyle',\n\t\t\tid: 'ClientLifestyle',\n\t\t\tfieldName: 'clientLifestyle',\n\t\t\tstaticIcon: ClientLifestylePNG,\n\t\t\tanimatedIcon: ClientLifestyleGIF,\n\t\t\tdescription: 'Tailor my experience',\n\t\t\tlink: navigationLinking.ClientLifestyle,\n\t\t\tentityTypes: [SiteTypes.realtor],\n\t\t},\n\t\t{\n\t\t\tname: siteConfig.byPhoneTitle || 'By Phone',\n\t\t\tid: 'RingCentral',\n\t\t\tfieldName: 'ringCentral',\n\t\t\tstaticIcon: siteConfig.byPhoneStaticIcon || PhonePNG,\n\t\t\tanimatedIcon: siteConfig.byPhoneAnimatedIcon || PhoneGIF,\n\t\t\tdescription:\n\t\t\t\tsiteConfig.byPhoneSubtitle || 'Speak with an agent',\n\t\t\tentityTypes: [\n\t\t\t\tSiteTypes.corporate,\n\t\t\t\tSiteTypes.branch,\n\t\t\t\tSiteTypes.loanOfficer,\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tname: siteConfig.shortAppTitle || 'Get Pre-Qualified',\n\t\t\tid: 'Prequalify',\n\t\t\tfieldName: 'mobilePrequal',\n\t\t\tstaticIcon: siteConfig.shortAppStaticIcon || PrequalPNG,\n\t\t\tanimatedIcon: siteConfig.shortAppAnimatedIcon || PrequalGIF,\n\t\t\tdescription:\n\t\t\t\tsiteConfig.shortAppSubtitle || 'Pre-qualify for a loan',\n\t\t\tlink: navigationLinking.Prequalify,\n\t\t\tentityTypes: [\n\t\t\t\tSiteTypes.corporate,\n\t\t\t\tSiteTypes.branch,\n\t\t\t\tSiteTypes.loanOfficer,\n\t\t\t\tSiteTypes.realtor,\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tname: siteConfig.fullAppTitle || 'Get Pre-Approved',\n\t\t\tid: 'Apply',\n\t\t\tfieldName: 'fullApp',\n\t\t\tstaticIcon: siteConfig.fullAppStaticIcon || ApplicationPNG,\n\t\t\tanimatedIcon: siteConfig.fullAppAnimatedIcon || ApplicationGIF,\n\t\t\tdescription: siteConfig.fullAppSubtitle || 'Apply for a loan',\n\t\t\tlink: navigationLinking.Apply,\n\t\t\tentityTypes: [\n\t\t\t\tSiteTypes.corporate,\n\t\t\t\tSiteTypes.branch,\n\t\t\t\tSiteTypes.loanOfficer,\n\t\t\t\tSiteTypes.realtor,\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tname: 'Super Short App',\n\t\t\tid: 'LeadApp',\n\t\t\tfieldName: 'leadApp',\n\t\t\tstaticIcon: siteConfig.superShortAppStaticIcon || TimerPNG,\n\t\t\tanimatedIcon: siteConfig.superShortAppAnimatedIcon || TimerGIF,\n\t\t\tdescription: 'I just want some info',\n\t\t\tlink: navigationLinking.LeadApp,\n\t\t\tentityTypes: [\n\t\t\t\tSiteTypes.corporate,\n\t\t\t\tSiteTypes.branch,\n\t\t\t\tSiteTypes.loanOfficer,\n\t\t\t\tSiteTypes.realtor,\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tname: siteConfig.spanishPrequalTitle || 'Forma Corta',\n\t\t\tid: 'PrequalifySpanish',\n\t\t\tfieldName: 'spanishPrequal',\n\t\t\tstaticIcon: siteConfig.shortAppStaticIcon || PrequalPNG,\n\t\t\tanimatedIcon: siteConfig.shortAppAnimatedIcon || PrequalGIF,\n\t\t\tdescription:\n\t\t\t\tsiteConfig.spanishPrequalSubtitle ||\n\t\t\t\t'Obtenga una Precalificación',\n\t\t\tlink: navigationLinking.PrequalifySpanish,\n\t\t\tentityTypes: [\n\t\t\t\tSiteTypes.corporate,\n\t\t\t\tSiteTypes.branch,\n\t\t\t\tSiteTypes.loanOfficer,\n\t\t\t\tSiteTypes.realtor,\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tname: siteConfig.spanishFullAppTitle || 'Forma Completa',\n\t\t\tid: 'SpanishFullApp',\n\t\t\tfieldName: 'spanishFullApp',\n\t\t\tstaticIcon: siteConfig.fullAppStaticIcon || ApplicationPNG,\n\t\t\tanimatedIcon: siteConfig.fullAppAnimatedIcon || ApplicationGIF,\n\t\t\tdescription:\n\t\t\t\tsiteConfig.spanishFullAppSubtitle || 'Solicitar Préstamo',\n\t\t\tlink: navigationLinking.ApplySpanish,\n\t\t\tentityTypes: [\n\t\t\t\tSiteTypes.corporate,\n\t\t\t\tSiteTypes.branch,\n\t\t\t\tSiteTypes.loanOfficer,\n\t\t\t\tSiteTypes.realtor,\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tname: 'Open House',\n\t\t\tid: 'OpenHouse',\n\t\t\tfieldName: 'openHouseForm',\n\t\t\tstaticIcon: AgentListingsPNG,\n\t\t\tanimatedIcon: AgentListingsGIF,\n\t\t\tdescription: 'Check-in',\n\t\t\tlink: navigationLinking.OpenHouseNoAddress,\n\t\t\tentityTypes: [SiteTypes.realtor],\n\t\t},\n\t\t{\n\t\t\tname: 'Offer',\n\t\t\tid: 'Offer',\n\t\t\tfieldName: 'listingOfferForm',\n\t\t\tstaticIcon: DollarCoinPNG,\n\t\t\tanimatedIcon: DollarCoinGIF,\n\t\t\tdescription: 'Make an Offer',\n\t\t\tlink: navigationLinking.ListingOffer,\n\t\t\tentityTypes: [SiteTypes.realtor],\n\t\t},\n\t\t{\n\t\t\tname: 'Calendar',\n\t\t\tid: 'Calendar',\n\t\t\tfieldName: 'calendarUrl',\n\t\t\tstaticIcon: CalendarPNG,\n\t\t\tanimatedIcon: CalendarGIF,\n\t\t\tdescription: 'Schedule a Meeting',\n\t\t\tlink: siteConfig.calendarUrl,\n\t\t\tentityTypes: [SiteTypes.loanOfficer, SiteTypes.realtor],\n\t\t\texternal: true,\n\t\t},\n\t\t{\n\t\t\tname: 'Reviews',\n\t\t\tid: 'Reviews',\n\t\t\tfieldName: 'surveysUrl',\n\t\t\tstaticIcon: ReviewsPNG,\n\t\t\tanimatedIcon: ReviewsGIF,\n\t\t\tdescription: 'View Feedback',\n\t\t\tlink: siteConfig.surveysUrl,\n\t\t\tentityTypes: [SiteTypes.loanOfficer, SiteTypes.realtor],\n\t\t\texternal: true,\n\t\t},\n\t\t// { name: 'Mobile App', fieldName: 'MobileApp', staticIcon: siteConfig.FullAppStaticIcon || MobilePNG, animatedIcon: siteConfig.FullAppAnimatedIcon || MobileGIF, description: 'Tracking on the go', link: navigationLinking.CreateAccount },\n\t\t// { name: 'Alexa', fieldName: 'Alexa', staticIcon: siteConfig.AlexaStaticIcon || MobilePNG, animatedIcon: siteConfig.AlexaAnimatedIcon || MobileGIF, description: 'Apply with Alexa', link: siteConfig.alexaUrl || 'https://www.amazon.com/Francisco-Correal-loan-application/dp/B07Y7WDWQK/ref=sr_1_1?d[…]words=loan-application&qid=1610083950&s=digital-skills&sr=1-1' }\n\t]\n\n\treturn filterAppLinks(appLinks, siteConfig)\n}\n\nexport const getListingLinks = (listing, siteConfig) => {\n\tconst appLinks = [\n\t\t{\n\t\t\tname: 'Open House',\n\t\t\tid: 'OpenHouse',\n\t\t\tfieldName: 'openHouseForm',\n\t\t\tstaticIcon: AgentListingsPNG,\n\t\t\tanimatedIcon: AgentListingsGIF,\n\t\t\tdescription: 'Check-in',\n\t\t\tlink: generatePath(navigationLinking.OpenHouseWithListing, {\n\t\t\t\taddress: addressToString(listing.address),\n\t\t\t\tlistingId: listing.id,\n\t\t\t}),\n\t\t\tentityTypes: [SiteTypes.realtor],\n\t\t},\n\t\t{\n\t\t\tname: 'Offer',\n\t\t\tid: 'Offer',\n\t\t\tfieldName: 'listingOfferForm',\n\t\t\tstaticIcon: DollarCoinPNG,\n\t\t\tanimatedIcon: DollarCoinGIF,\n\t\t\tdescription: 'Make an Offer',\n\t\t\tlink: generatePath(navigationLinking.ListingOfferWithListing, {\n\t\t\t\tlistingId: listing.id,\n\t\t\t}),\n\t\t\tentityTypes: [SiteTypes.realtor],\n\t\t},\n\t]\n\n\treturn filterAppLinks(appLinks, siteConfig)\n}\n\n/**\n * Get route name from url path\n *\n * @param path\n * @returns {string}\n */\nexport const getRouteNameFromPath = (path) => {\n\tpath = path.substring(1)\n\tfor (const [key, value] of Object.entries(navigationLinking)) {\n\t\tif (value === path) return key\n\n\t\t// match routes with variables\n\t\tconst indexesToIgnore = []\n\t\tif (value.includes(':')) {\n\t\t\tconst valueParts = value.split('/')\n\t\t\tvalueParts.forEach((part, index) => {\n\t\t\t\tif (part.substring(0, 1) === ':') indexesToIgnore.push(index)\n\t\t\t})\n\n\t\t\tconst pathParts = path.split('/')\n\t\t\tif (pathParts.length === valueParts.length) {\n\t\t\t\tlet matching = true\n\t\t\t\tpathParts.forEach((part, index) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t!indexesToIgnore.includes(index) &&\n\t\t\t\t\t\tpart !== valueParts[index]\n\t\t\t\t\t)\n\t\t\t\t\t\tmatching = false\n\t\t\t\t})\n\t\t\t\tif (matching) return key\n\t\t\t}\n\t\t}\n\t}\n\treturn ''\n}\n\n/**\n * Get Actions for Portal / Nav by User Role\n * @param user\n * @param siteConfig\n * @param loan\n * @returns {*[]}\n */\nexport const getActionsByRole = (\n\tuser,\n\tsiteConfig = {},\n\tloan = { loanId: '', locked: false }\n) => {\n\tconst role = user.role\n\tconst loanId = loan?.loanId\n\n\tconst listingAction = {\n\t\tname: 'Listings',\n\t\tid: 'listings',\n\t\tstaticIcon: AgentListingsPNG,\n\t\tanimatedIcon: AgentListingsGIF,\n\t\troute: navigationLinking.Listings,\n\t\tdescription: 'View Listings',\n\t}\n\tconst myPipelineAction = {\n\t\tname: 'My Pipeline',\n\t\tid: 'loanApplications',\n\t\tstaticIcon: siteConfig.pipelineStaticIcon || DollarCoinPNG,\n\t\tanimatedIcon: siteConfig.pipelineAnimatedIcon || DollarCoinGIF,\n\t\troute: navigationLinking.LoanApplications,\n\t\tdescription: 'View My Loans',\n\t}\n\n\tconst loanDetailsAction = {\n\t\tname: 'Loan Details',\n\t\tid: 'loanDetails',\n\t\tstaticIcon: siteConfig.loanDetailsStaticIcon || ListPNG,\n\t\tanimatedIcon: siteConfig.loanDetailsAnimatedIcon || ListGIF,\n\t\tdescription: 'Loan Details',\n\t\taction: 'loanDetails',\n\t\troute: generatePath(`${navigationLinking.LoanApplication}`, {\n\t\t\tloanId,\n\t\t}),\n\t}\n\n\tconst tasksAction = {\n\t\tname: 'Tasks',\n\t\tid: 'tasks',\n\t\tstaticIcon: siteConfig.rulesStaticIcon || RulesPNG,\n\t\tanimatedIcon: siteConfig.rulesAnimatedIcon || RulesGIF,\n\t\troute: generatePath(`${navigationLinking.Tasks}`, {\n\t\t\tloanId,\n\t\t}),\n\t\tdescription: 'Borrower Tasks',\n\t}\n\n\tconst loanDocumentAction = {\n\t\tname: 'Documents',\n\t\tid: 'documents',\n\t\tstaticIcon: siteConfig.documentsStaticIcon || DocumentsPNG,\n\t\tanimatedIcon: siteConfig.documentsAnimatedIcon || DocumentsGIF,\n\t\troute: generatePath(`${navigationLinking.Documents}`, {\n\t\t\tloanId,\n\t\t}),\n\t\tdescription: 'Borrower Documents',\n\t}\n\n\tconst encompassWebAction = {\n\t\tname: 'Encompass Web',\n\t\tid: 'encompassWeb',\n\t\tstaticIcon: siteConfig.loConnectStaticIcon || LOConnectPNG,\n\t\tanimatedIcon: siteConfig.loConnectAnimatedIcon || LOConnectGIF,\n\t\tdescription: 'Edit Application',\n\t\taction: 'loConnect',\n\t}\n\n\tconst myProfileAction = {\n\t\tname: 'My Profile',\n\t\tid: 'myProfile',\n\t\tstaticIcon: siteConfig.myProfileStaticIcon || UserPNG,\n\t\tanimatedIcon: siteConfig.myProfileAnimatedIcon || UserGIF,\n\t\troute: navigationLinking.UserProfile,\n\t\tdescription: 'Security Credentials',\n\t}\n\n\tconst helpAction = {\n\t\tname: 'Need Help?',\n\t\tid: 'support',\n\t\tstaticIcon: siteConfig.supportStaticIcon || SupportPNG,\n\t\tanimatedIcon: siteConfig.supportAnimatedIcon || SupportGIF,\n\t\thref: 'https://support.thebigpos.com',\n\t\tdescription: 'Get Support',\n\t}\n\n\tlet actions = []\n\tswitch (true) {\n\t\t// Loan Officer\n\t\tcase [Roles.loanOfficer, Roles.branchManager].includes(role):\n\t\t\tactions = [\n\t\t\t\tmyPipelineAction,\n\t\t\t\t{\n\t\t\t\t\tname: 'Leads',\n\t\t\t\t\tid: 'leads',\n\t\t\t\t\tstaticIcon: UsersPNG,\n\t\t\t\t\tanimatedIcon: UsersGIF,\n\t\t\t\t\troute: navigationLinking.Leads,\n\t\t\t\t\tdescription: 'View My Leads',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Partners',\n\t\t\t\t\tid: 'partners',\n\t\t\t\t\tstaticIcon: PartnersPNG,\n\t\t\t\t\tanimatedIcon: PartnersGIF,\n\t\t\t\t\troute: navigationLinking.Partner,\n\t\t\t\t\tdescription: 'View My Partners',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Quick Pricer',\n\t\t\t\t\tid: 'pricingCalculator',\n\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\tsiteConfig.quickPricerStaticIcon || QuickPricerPNG,\n\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\tsiteConfig.quickPricerAnimatedIcon || QuickPricerGIF,\n\t\t\t\t\troute: navigationLinking.QuickPricer,\n\t\t\t\t\tdescription: 'Price a Loan',\n\t\t\t\t},\n\t\t\t\tlistingAction,\n\t\t\t]\n\t\t\tif (loanId) {\n\t\t\t\tactions = !siteConfig.enabledServices?.borrowerTasks\n\t\t\t\t\t? []\n\t\t\t\t\t: [tasksAction]\n\t\t\t\tactions = [\n\t\t\t\t\t...[\n\t\t\t\t\t\tloanDetailsAction,\n\t\t\t\t\t\t...actions,\n\t\t\t\t\t\tloanDocumentAction,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Loan Calculator',\n\t\t\t\t\t\t\tid: 'loanCalculator',\n\t\t\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\t\t\tsiteConfig.calculatorStaticIcon || CalculatorPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.calculatorAnimatedIcon || CalculatorGIF,\n\t\t\t\t\t\t\troute: generatePath(\n\t\t\t\t\t\t\t\t`${navigationLinking.LoanCalculator}`,\n\t\t\t\t\t\t\t\t{ loanId }\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tdescription: 'Calculate Payments',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Add a Co-Borrower',\n\t\t\t\t\t\t\tid: 'invite',\n\t\t\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\t\t\tsiteConfig.addCoBorrowerStaticIcon ||\n\t\t\t\t\t\t\t\tAddCoBorrowerPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.addCoBorrowerAnimatedIcon ||\n\t\t\t\t\t\t\t\tAddCoBorrowerGIF,\n\t\t\t\t\t\t\tdescription: 'Send an Invite',\n\t\t\t\t\t\t\taction: 'invite',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// { name: \"New Application\", id: \"LODuplicate\", staticIcon: siteConfig.fullAppStaticIcon || ApplicationPNG, animatedIcon: siteConfig.fullAppAnimatedIcon || ApplicationGIF, route: navigationLinking.LOApply, description: 'Duplicate Application' }\n\t\t\t\t\t],\n\t\t\t\t\t...[encompassWebAction, helpAction],\n\t\t\t\t]\n\t\t\t} else\n\t\t\t\tactions = [\n\t\t\t\t\t...actions,\n\t\t\t\t\t...[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'New Application',\n\t\t\t\t\t\t\tid: 'fullApp',\n\t\t\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\t\t\tsiteConfig.fullAppStaticIcon || ApplicationPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.fullAppAnimatedIcon || ApplicationGIF,\n\t\t\t\t\t\t\troute: navigationLinking.LOApply,\n\t\t\t\t\t\t\tdescription: 'Start New Application',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'New Prequal',\n\t\t\t\t\t\t\tid: 'mobilePrequal',\n\t\t\t\t\t\t\tstaticIcon: siteConfig.shortAppStaticIcon || PrequalPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.shortAppAnimatedIcon || PrequalGIF,\n\t\t\t\t\t\t\troute: navigationLinking.LOPrequal,\n\t\t\t\t\t\t\tdescription: 'Start New Prequal',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'New Short App',\n\t\t\t\t\t\t\tid: 'leadApp',\n\t\t\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\t\t\tsiteConfig.superShortAppStaticIcon || TimerPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.superShortAppAnimatedIcon || TimerGIF,\n\t\t\t\t\t\t\troute: navigationLinking.LOLeadApp,\n\t\t\t\t\t\t\tdescription: 'Super Short App',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmyProfileAction,\n\t\t\t\t\t\tencompassWebAction,\n\t\t\t\t\t\thelpAction,\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\tbreak\n\t\tcase [Roles.loanProcessor, Roles.loanOfficerAssistant].includes(\n\t\t\trole\n\t\t):\n\t\t\tactions = [myPipelineAction]\n\t\t\tif (loanId) {\n\t\t\t\tconst taskActionIncluded = !siteConfig.enabledServices\n\t\t\t\t\t?.borrowerTasks\n\t\t\t\t\t? []\n\t\t\t\t\t: [tasksAction]\n\t\t\t\tactions = [\n\t\t\t\t\tloanDetailsAction,\n\t\t\t\t\t...taskActionIncluded,\n\t\t\t\t\tloanDocumentAction,\n\t\t\t\t\tencompassWebAction,\n\t\t\t\t]\n\t\t\t}\n\n\t\t\tactions = [...actions, myProfileAction, helpAction]\n\t\t\tbreak\n\t\t// Borrower and Co-Borrower\n\t\tcase [Roles.borrower].includes(role):\n\t\t\tactions = [\n\t\t\t\t{\n\t\t\t\t\tname: 'Apply for a New Loan',\n\t\t\t\t\tid: 'fullApp',\n\t\t\t\t\tstaticIcon: siteConfig.shortAppStaticIcon || PrequalPNG,\n\t\t\t\t\tanimatedIcon: siteConfig.shortAppAnimatedIcon || PrequalGIF,\n\t\t\t\t\troute: navigationLinking.Apply,\n\t\t\t\t\tdescription: 'New Purchase / Refi',\n\t\t\t\t\taction: 'duplicate',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Aplicación Nueva',\n\t\t\t\t\tid: 'spanishFullApp',\n\t\t\t\t\tstaticIcon: siteConfig.shortAppStaticIcon || PrequalPNG,\n\t\t\t\t\tanimatedIcon: siteConfig.shortAppAnimatedIcon || PrequalGIF,\n\t\t\t\t\troute: navigationLinking.ApplySpanish,\n\t\t\t\t\tdescription: 'Nueva Compra / Refi',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Loan Applications',\n\t\t\t\t\tid: 'loanApplications',\n\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\tsiteConfig.loanApplicationsStaticIcon ||\n\t\t\t\t\t\tLoanApplicationsPNG,\n\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\tsiteConfig.loanApplicationsAnimatedIcon ||\n\t\t\t\t\t\tLoanApplicationsGIF,\n\t\t\t\t\troute: navigationLinking.LoanApplications,\n\t\t\t\t\tdescription: 'View My Loans',\n\t\t\t\t},\n\t\t\t]\n\t\t\tif (loanId)\n\t\t\t\tactions = [\n\t\t\t\t\t...[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Loan Details',\n\t\t\t\t\t\t\tid: 'loanDetails',\n\t\t\t\t\t\t\tstaticIcon: siteConfig.loanDetailsStaticIcon || ListPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.loanDetailsAnimatedIcon || ListGIF,\n\t\t\t\t\t\t\troute: generatePath(\n\t\t\t\t\t\t\t\t`${navigationLinking.LoanApplication}`,\n\t\t\t\t\t\t\t\t{ loanId }\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tdescription: 'Track Application',\n\t\t\t\t\t\t\taction: 'loanDetails',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Tasks',\n\t\t\t\t\t\t\tid: 'tasks',\n\t\t\t\t\t\t\tstaticIcon: siteConfig.rulesStaticIcon || RulesPNG,\n\t\t\t\t\t\t\tanimatedIcon: siteConfig.rulesAnimatedIcon || RulesGIF,\n\t\t\t\t\t\t\troute: generatePath(`${navigationLinking.Tasks}`, {\n\t\t\t\t\t\t\t\tloanId,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tdescription: 'View My Tasks',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'E-Sign Documents',\n\t\t\t\t\t\t\tid: 'disclosures',\n\t\t\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\t\t\tsiteConfig.signatureStaticIcon || SignaturePNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.signatureAnimatedIcon || SignatureGIF,\n\t\t\t\t\t\t\tdescription: 'Sign Documents',\n\t\t\t\t\t\t\taction: 'disclosures',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Documents',\n\t\t\t\t\t\t\tid: 'documents',\n\t\t\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\t\t\tsiteConfig.documentsStaticIcon || DocumentsPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.documentsAnimatedIcon || DocumentsGIF,\n\t\t\t\t\t\t\troute: generatePath(`${navigationLinking.Documents}`, {\n\t\t\t\t\t\t\t\tloanId,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tdescription: 'View My Documents',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// {\n\t\t\t\t\t\t// \tname: 'Payment',\n\t\t\t\t\t\t// \tid: 'payments',\n\t\t\t\t\t\t// \tstaticIcon: siteConfig.paymentStaticIcon || PaymentPNG,\n\t\t\t\t\t\t// \tanimatedIcon:\n\t\t\t\t\t\t// \t\tsiteConfig.paymentAnimatedIcon || PaymentGIF,\n\t\t\t\t\t\t// \tdescription: 'Make a Payment',\n\t\t\t\t\t\t// \taction: 'payment',\n\t\t\t\t\t\t// },\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Add a Co-Borrower',\n\t\t\t\t\t\t\tid: 'invite',\n\t\t\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\t\t\tsiteConfig.addCoBorrowerStaticIcon ||\n\t\t\t\t\t\t\t\tAddCoBorrowerPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.addCoBorrowerAnimatedIcon ||\n\t\t\t\t\t\t\t\tAddCoBorrowerGIF,\n\t\t\t\t\t\t\tdescription: 'Send an Invite',\n\t\t\t\t\t\t\taction: 'invite',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t...actions,\n\t\t\t\t]\n\t\t\tif (siteConfig.calendarUrl)\n\t\t\t\tactions.push({\n\t\t\t\t\tname: 'Request a Meeting',\n\t\t\t\t\tid: 'calendar',\n\t\t\t\t\tstaticIcon: CalendarPNG,\n\t\t\t\t\tanimatedIcon: CalendarGIF,\n\t\t\t\t\thref: siteConfig.calendarUrl,\n\t\t\t\t\tdescription: 'View Calendar',\n\t\t\t\t})\n\t\t\tactions = [\n\t\t\t\t...actions,\n\t\t\t\t...[\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'My Profile',\n\t\t\t\t\t\tid: 'myProfile',\n\t\t\t\t\t\tstaticIcon: siteConfig.myProfileStaticIcon || UserPNG,\n\t\t\t\t\t\tanimatedIcon: siteConfig.myProfileAnimatedIcon || UserGIF,\n\t\t\t\t\t\troute: navigationLinking.UserProfile,\n\t\t\t\t\t\tdescription: 'Security Credentials',\n\t\t\t\t\t},\n\t\t\t\t\t// { name: \"Need Help?\", id: \"Support\", staticIcon: siteConfig.supportStaticIcon || SupportPNG, animatedIcon: siteConfig.supportAnimatedIcon || SupportGIF, href: 'https://support.thebigpos.com', description: 'Get Support' }\n\t\t\t\t],\n\t\t\t]\n\t\t\tbreak\n\t\t// Admin\n\t\tcase [Roles.admin, Roles.superAdmin].includes(role):\n\t\t\tactions = [\n\t\t\t\t// { name: \"Loan Applications\", id: \"LoanApplications\", icon: CurrencyInputSVG, staticIcon: siteConfig.LoanApplicationsStaticIcon || DollarCoinPNG, animatedIcon: siteConfig.LoanApplicationsAnimatedIcon || DollarCoinGIF, route: navigationLinking.LoanApplications, description: 'View All Loans' },\n\t\t\t\t{\n\t\t\t\t\tname: 'Rules',\n\t\t\t\t\tid: 'Rules',\n\t\t\t\t\tstaticIcon: siteConfig.rulesStaticIcon || RulesPNG,\n\t\t\t\t\tanimatedIcon: siteConfig.rulesAnimatedIcon || RulesGIF,\n\t\t\t\t\troute: navigationLinking.AdminRules,\n\t\t\t\t\tdescription: 'Set Custom Rules',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Account Settings',\n\t\t\t\t\tid: 'accountSettings',\n\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\tsiteConfig.accountSettingsStaticIcon || SettingsPNG,\n\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\tsiteConfig.accountSettingsAnimatedIcon || SettingsGIF,\n\t\t\t\t\troute: navigationLinking.AdminAccountEdit,\n\t\t\t\t\tdescription: 'Billing & Profile',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Brands',\n\t\t\t\t\tid: 'corporations',\n\t\t\t\t\tstaticIcon: siteConfig.brandStaticIcon || BrandsPNG,\n\t\t\t\t\tanimatedIcon: siteConfig.brandAnimatedIcon || BrandsGIF,\n\t\t\t\t\troute: navigationLinking.AdminCorporate,\n\t\t\t\t\tdescription: 'Corporate Pages',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Branches',\n\t\t\t\t\tid: 'branches',\n\t\t\t\t\tstaticIcon: siteConfig.branchesStaticIcon || LocationPinPNG,\n\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\tsiteConfig.branchesAnimatedIcon || LocationPinGIF,\n\t\t\t\t\troute: navigationLinking.AdminBranch,\n\t\t\t\t\tdescription: 'Branch Pages',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Loan Officers',\n\t\t\t\t\tid: 'loanOfficers',\n\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\tsiteConfig.loanOfficersStaticIcon || LoanOfficersPNG,\n\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\tsiteConfig.loanOfficersAnimatedIcon || LoanOfficersGIF,\n\t\t\t\t\troute: navigationLinking.AdminLoanOfficer,\n\t\t\t\t\tdescription: 'Loan Officer Pages',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Partners',\n\t\t\t\t\tid: 'partners',\n\t\t\t\t\tstaticIcon: siteConfig.realtorsStaticIcon || PartnersPNG,\n\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\tsiteConfig.realtorsAnimatedIcon || PartnersGIF,\n\t\t\t\t\troute: navigationLinking.AdminPartner,\n\t\t\t\t\tdescription: 'Partner Pages',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Users',\n\t\t\t\t\tid: 'users',\n\t\t\t\t\tstaticIcon: siteConfig.usersStaticIcon || UsersPNG,\n\t\t\t\t\tanimatedIcon: siteConfig.usersAnimatedIcon || UsersGIF,\n\t\t\t\t\troute: navigationLinking.AdminUser,\n\t\t\t\t\tdescription: 'Create and Edit Users',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Notifications',\n\t\t\t\t\tid: 'notifications',\n\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\tsiteConfig.notificationsStaticIcon || NotificationsPNG,\n\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\tsiteConfig.notificationsAnimatedIcon || NotificationsGIF,\n\t\t\t\t\troute: navigationLinking.AdminNotificationTemplates,\n\t\t\t\t\tdescription: 'Manage Alerts',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Documents',\n\t\t\t\t\tid: 'generatedDocuments',\n\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\tsiteConfig.documentTemplatesStaticIcon || DocumentsPNG,\n\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\tsiteConfig.documentTemplatesAnimatedIcon || DocumentsGIF,\n\t\t\t\t\troute: navigationLinking.AdminDocumentTemplates,\n\t\t\t\t\tdescription: 'Generated Documents',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Kiosks',\n\t\t\t\t\tid: 'kiosks',\n\t\t\t\t\tstaticIcon: KioskPNG,\n\t\t\t\t\tanimatedIcon: KioskGIF,\n\t\t\t\t\troute: navigationLinking.AdminDevice,\n\t\t\t\t\tdescription: 'Manage Kiosks',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Loan Queue',\n\t\t\t\t\tid: 'queue',\n\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\tsiteConfig.requestQueueStaticIcon || RequestQueuePNG,\n\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\tsiteConfig.requestQueueAnimatedIcon || RequestQueueGIF,\n\t\t\t\t\troute: navigationLinking.AdminLoanQueue,\n\t\t\t\t\tdescription: 'View Queue',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"What's New?\",\n\t\t\t\t\tid: 'releaseNotes',\n\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\tsiteConfig.releaseNotesStaticIcon || ReleaseNotesPNG,\n\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\tsiteConfig.releaseNotesAnimatedIcon || ReleaseNotesGIF,\n\t\t\t\t\thref: 'https://thebigpos.launchnotes.io',\n\t\t\t\t\tdescription: 'Release Notes',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Need Help?',\n\t\t\t\t\tid: 'support',\n\t\t\t\t\tstaticIcon: siteConfig.supportStaticIcon || SupportPNG,\n\t\t\t\t\tanimatedIcon: siteConfig.supportAnimatedIcon || SupportGIF,\n\t\t\t\t\thref: 'https://support.thebigpos.com',\n\t\t\t\t\tdescription: 'Get Support',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'My Profile',\n\t\t\t\t\tid: 'myProfile',\n\t\t\t\t\tstaticIcon: siteConfig.myProfileStaticIcon || UserPNG,\n\t\t\t\t\tanimatedIcon: siteConfig.myProfileAnimatedIcon || UserGIF,\n\t\t\t\t\troute: navigationLinking.UserProfile,\n\t\t\t\t\tdescription: 'Security Credentials',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Workflows',\n\t\t\t\t\tid: 'Workflows',\n\t\t\t\t\tstaticIcon: siteConfig.workflowsStaticIcon || PrequalPNG,\n\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\tsiteConfig.workflowsAnimatedIcon || PrequalGIF,\n\t\t\t\t\troute: navigationLinking.WorkflowEditor,\n\t\t\t\t\tdescription: 'Manage Workflows',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Incomplete Loans',\n\t\t\t\t\tid: 'IncompleteLoans',\n\t\t\t\t\tstaticIcon: DollarCoinPNG,\n\t\t\t\t\tanimatedIcon: DollarCoinGIF,\n\t\t\t\t\troute: navigationLinking.IncompleteLoans,\n\t\t\t\t\tdescription: 'Manage Incomplete Loans',\n\t\t\t\t},\n\t\t\t]\n\t\t\tbreak\n\t\t// Realtor\n\t\tcase role === Roles.realtor:\n\t\t\tactions = [\n\t\t\t\t{\n\t\t\t\t\tname: 'Leads',\n\t\t\t\t\tid: 'leads',\n\t\t\t\t\tstaticIcon: UsersPNG,\n\t\t\t\t\tanimatedIcon: UsersGIF,\n\t\t\t\t\troute: navigationLinking.Leads,\n\t\t\t\t\tdescription: 'View Leads',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Clients',\n\t\t\t\t\tid: 'loanApplications',\n\t\t\t\t\tstaticIcon: siteConfig.usersStaticIcon || ClientsPNG,\n\t\t\t\t\tanimatedIcon: siteConfig.usersAnimatedIcon || ClientsGIF,\n\t\t\t\t\troute: navigationLinking.LoanApplications,\n\t\t\t\t\tdescription: 'View My Clients',\n\t\t\t\t},\n\t\t\t\tlistingAction,\n\t\t\t\t//{ name: \"Pricer\", id: \"PricingCalculator\", staticIcon: siteConfig.QuickPricerStaticIcon || QuickPricerPNG, animatedIcon: siteConfig.QuickPricerAnimatedIcon || QuickPricerGIF, route: navigationViews.QuickPricer, description: 'Price a Loan' }\n\t\t\t]\n\t\t\tif (loanId)\n\t\t\t\tactions = [\n\t\t\t\t\t...[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Loan Details',\n\t\t\t\t\t\t\tid: 'loanDetails',\n\t\t\t\t\t\t\tstaticIcon: siteConfig.loanDetailsStaticIcon || ListPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.loanDetailsAnimatedIcon || ListGIF,\n\t\t\t\t\t\t\tdescription: 'Loan Details',\n\t\t\t\t\t\t\taction: 'loanDetails',\n\t\t\t\t\t\t\troute: generatePath(\n\t\t\t\t\t\t\t\t`${navigationLinking.LoanApplication}`,\n\t\t\t\t\t\t\t\t{ loanId }\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Documents',\n\t\t\t\t\t\t\tid: 'documents',\n\t\t\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\t\t\tsiteConfig.documentsStaticIcon || DocumentsPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.documentsAnimatedIcon || DocumentsGIF,\n\t\t\t\t\t\t\troute: generatePath(`${navigationLinking.Documents}`, {\n\t\t\t\t\t\t\t\tloanId,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tdescription: 'Borrower Documents',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Loan Calculator',\n\t\t\t\t\t\t\tid: 'loanCalculator',\n\t\t\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\t\t\tsiteConfig.calculatorStaticIcon || CalculatorPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.calculatorAnimatedIcon || CalculatorGIF,\n\t\t\t\t\t\t\troute: generatePath(\n\t\t\t\t\t\t\t\t`${navigationLinking.LoanCalculator}`,\n\t\t\t\t\t\t\t\t{ loanId }\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tdescription: 'Calculate Payments',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// { name: \"Invite Co-Borrower\", id: \"Invite\", staticIcon: siteConfig.addCoBorrowerStaticIcon || AddCoBorrowerPNG, animatedIcon: siteConfig.addCoBorrowerAnimatedIcon || AddCoBorrowerGIF, description: 'Send an Invite', action: 'invite' },\n\t\t\t\t\t\t// { name: \"Duplicate\", id: \"LODuplicate\", staticIcon: siteConfig.fullAppStaticIcon || ApplicationPNG, animatedIcon: siteConfig.fullAppAnimatedIcon || ApplicationGIF, route: navigationViews.LOApply, description: 'Duplicate Application' }\n\t\t\t\t\t],\n\t\t\t\t\t...actions,\n\t\t\t\t]\n\t\t\telse\n\t\t\t\tactions = [\n\t\t\t\t\t...actions,\n\t\t\t\t\t...[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Refer New Client',\n\t\t\t\t\t\t\tid: 'agentReferral',\n\t\t\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\t\t\tsiteConfig.addCoBorrowerStaticIcon ||\n\t\t\t\t\t\t\t\tAddCoBorrowerPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.addCoBorrowerAnimatedIcon ||\n\t\t\t\t\t\t\t\tAddCoBorrowerGIF,\n\t\t\t\t\t\t\troute: navigationLinking.AgentReferral,\n\t\t\t\t\t\t\tdescription: 'New Application',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\tactions = [\n\t\t\t\t...actions,\n\t\t\t\t...[\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'My Profile',\n\t\t\t\t\t\tid: 'myProfile',\n\t\t\t\t\t\tstaticIcon: siteConfig.myProfileStaticIcon || UserPNG,\n\t\t\t\t\t\tanimatedIcon: siteConfig.myProfileAnimatedIcon || UserGIF,\n\t\t\t\t\t\troute: navigationLinking.UserProfile,\n\t\t\t\t\t\tdescription: 'Security Credentials',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Need Help?',\n\t\t\t\t\t\tid: 'support',\n\t\t\t\t\t\tstaticIcon: siteConfig.supportStaticIcon || SupportPNG,\n\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\tsiteConfig.supportAnimatedIcon || SupportGIF,\n\t\t\t\t\t\thref: 'https://support.thebigpos.com',\n\t\t\t\t\t\tdescription: 'Get Support',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t]\n\t\t\tbreak\n\t\t// All others default to clients and documents\n\t\tdefault:\n\t\t\tactions = [\n\t\t\t\t{\n\t\t\t\t\tname: 'Clients',\n\t\t\t\t\tid: 'loanApplications',\n\t\t\t\t\tstaticIcon: siteConfig.usersStaticIcon || ClientsPNG,\n\t\t\t\t\tanimatedIcon: siteConfig.usersAnimatedIcon || ClientsGIF,\n\t\t\t\t\troute: navigationLinking.LoanApplications,\n\t\t\t\t\tdescription: 'View My Clients',\n\t\t\t\t},\n\t\t\t]\n\t\t\tif (loanId)\n\t\t\t\tactions = [\n\t\t\t\t\t...[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Documents',\n\t\t\t\t\t\t\tid: 'documents',\n\t\t\t\t\t\t\tstaticIcon:\n\t\t\t\t\t\t\t\tsiteConfig.documentsStaticIcon || DocumentsPNG,\n\t\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\t\tsiteConfig.documentsAnimatedIcon || DocumentsGIF,\n\t\t\t\t\t\t\troute: generatePath(`${navigationLinking.Documents}`, {\n\t\t\t\t\t\t\t\tloanId,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tdescription: 'Borrower Documents',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\t...actions,\n\t\t\t\t]\n\t\t\tactions = [\n\t\t\t\t...actions,\n\t\t\t\t...[\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'My Profile',\n\t\t\t\t\t\tid: 'myProfile',\n\t\t\t\t\t\tstaticIcon: siteConfig.myProfileStaticIcon || UserPNG,\n\t\t\t\t\t\tanimatedIcon: siteConfig.myProfileAnimatedIcon || UserGIF,\n\t\t\t\t\t\troute: navigationLinking.UserProfile,\n\t\t\t\t\t\tdescription: 'Security Credentials',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Need Help?',\n\t\t\t\t\t\tid: 'support',\n\t\t\t\t\t\tstaticIcon: siteConfig.supportStaticIcon || SupportPNG,\n\t\t\t\t\t\tanimatedIcon:\n\t\t\t\t\t\t\tsiteConfig.supportAnimatedIcon || SupportGIF,\n\t\t\t\t\t\thref: 'https://support.thebigpos.com',\n\t\t\t\t\t\tdescription: 'Get Support',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t]\n\t\t\tbreak\n\t}\n\n\tif (loan.locked)\n\t\tactions = actions.filter((item) => item.id !== 'invite')\n\n\treturn actions\n}\n\n/**\n * Generate disclosures SSO login url\n * @param {object} siteConfig\n * @param {string} token\n * @returns string\n */\nexport function generateDisclosuresSSOLoginUrl(siteConfig, token) {\n\treturn `${host}/saml/signin?token=${token}&redirectUri=https://${siteConfig.company.siteUrl}/portal/disclosures`\n}\n\n/**\n * Generate disclosures SSO logout url\n * @param {object} siteConfig\n * @returns string\n */\nexport function generateDisclosuresSSOLogoutUrl(siteConfig) {\n\treturn `${host}/saml/signout?redirectUri=https://${siteConfig.company.siteUrl}/portal`\n}\n","const queryKeys = {\n\tlead: 'lead',\n\tuser: 'user',\n\tusers: 'users',\n\tkiosk: 'kiosk',\n\tleads: 'leads',\n\tkiosks: 'kiosks',\n\tbranch: 'branch',\n\taccount: 'account',\n\tpartner: 'partner',\n\tsurveys: 'surveys',\n\tlisting: 'listing',\n\tlistings: 'listings',\n\tallowImpersonation: 'allowImpersonation',\n\tpartners: 'partners',\n\tloanUsers: 'loanUsers',\n\tbusinessRules: 'businessRules',\n\tbusinessRule: 'businessRule',\n\tdocumentBuckets: 'documentBuckets',\n\tloanTasks: 'loanTasks',\n\tloanTasksDiff: 'loanTasksDiff',\n\tloanDocuments: 'loanDocuments',\n\tloanDrafts: 'loanDrafts',\n\tloanDraft: 'loanDraft',\n\tloanDocumentBuckets: 'loanDocumentBuckets',\n\tloan: 'loan',\n\tloanData: 'loanData',\n\tloans: 'loans',\n\tloanPreliminaryConditions: 'loanPreliminaryConditions',\n\tloanUnderwritingConditions: 'loanUnderwritingConditions',\n\ttasks: 'tasks',\n\tworkflow: 'workflow',\n\tbranches: 'branches',\n\tworkflows: 'workflows',\n\tloanOfficer: 'loanOfficer',\n\tcorporations: 'corporations',\n\tloanOfficers: 'loanOfficers',\n\tuserRelations: 'userRelations',\n\tlistingOffers: 'listingOffers',\n\trequestQueues: 'requestQueues',\n\tsurveysByEmail: 'surveysByEmail',\n\topenHouseLeads: 'openHouseLeads',\n\tdocumentTemplate: 'documentTemplate',\n\tdocumentTemplates: 'documentTemplates',\n\tnotificationTemplate: 'notificationTemplate',\n\trealtorApplications: 'realtorApplications',\n\tborrowerApplications: 'borrowerApplications',\n\tnotificationTemplates: 'notificationTemplates',\n\tcorporateLoanOfficers: 'corporateLoanOfficers',\n\tbranchSiteConfiguration: 'branchSiteConfiguration',\n\tmilestoneConfigurations: 'milestoneConfigurations',\n\tloanOfficerApplications: 'loanOfficerApplications',\n\tpartnerSiteConfiguration: 'partnerSiteConfiguration',\n\tcustomerSiteConfigurations: 'customerSiteConfigurations',\n\tsettlementAgentApplications: 'settlementAgentApplications',\n\tcorporationSiteConfiguration: 'corporationSiteConfiguration',\n\tsiteConfigurations: 'siteConfigurations',\n\tloanOfficerSiteConfiguration: 'loanOfficerSiteConfiguration',\n\tdocumentTemplateSiteConfiguration:\n\t\t'documentTemplateSiteConfiguration',\n\tnotificationTemplateSiteConfiguration:\n\t\t'notificationTemplateSiteConfiguration',\n\tloanDocumentContentUrl: 'loanDocumentContentUrl',\n\tloanDocumentContent: 'loanDocumentContent',\n\tuserLoanTaskComments: 'userLoanTaskComments',\n\tloanQueue: 'loanQueue',\n}\nexport default queryKeys\n","import {\n\tgenerateDisclosuresSSOLoginUrl,\n\tnavigationLinking,\n} from './navigation'\nimport * as FileSaver from 'file-saver'\nimport XLSX from 'sheetjs-style'\nimport { orderBy } from 'lodash'\n\nexport const applyMask = (value, maskType) => {\n\tif (!value) return value\n\tlet x, parts, val\n\tswitch (maskType) {\n\t\tcase 'ssn':\n\t\t\tx = value\n\t\t\t\t.replace(/\\D/g, '')\n\t\t\t\t.match(/(\\d{0,3})(\\d{0,2})(\\d{0,4})/)\n\t\t\treturn !x[2]\n\t\t\t\t? x[1]\n\t\t\t\t: x[1] + '-' + x[2] + (x[3] ? '-' + x[3] : '')\n\t\tcase 'date':\n\t\t\tx = value\n\t\t\t\t.replace(/\\D/g, '')\n\t\t\t\t.match(/(\\d{0,2})(\\d{0,2})(\\d{0,4})/)\n\t\t\treturn !x[2]\n\t\t\t\t? x[1]\n\t\t\t\t: x[1] + '/' + x[2] + (x[3] ? '/' + x[3] : '')\n\t\tcase 'futureDate':\n\t\t\tx = value\n\t\t\t\t.replace(/\\D/g, '')\n\t\t\t\t.match(/(\\d{0,2})(\\d{0,2})(\\d{0,4})/)\n\t\t\treturn !x[2]\n\t\t\t\t? x[1]\n\t\t\t\t: x[1] + '/' + x[2] + (x[3] ? '/' + x[3] : '')\n\t\tcase 'dob':\n\t\t\tx = value\n\t\t\t\t.replace(/\\D/g, '')\n\t\t\t\t.match(/(\\d{0,2})(\\d{0,2})(\\d{0,4})/)\n\t\t\treturn !x[2]\n\t\t\t\t? x[1]\n\t\t\t\t: x[1] + '/' + x[2] + (x[3] ? '/' + x[3] : '')\n\t\tcase 'phone':\n\t\t\tx = value\n\t\t\t\t.replace(/[+]1|\\D/g, '')\n\t\t\t\t.match(/(\\d{0,3})(\\d{0,3})(\\d{0,4})/)\n\t\t\treturn !x[2]\n\t\t\t\t? x[1]\n\t\t\t\t: '(' + x[1] + ') ' + x[2] + (x[3] ? '-' + x[3] : '')\n\t\tcase 'currency':\n\t\t\treturn value\n\t\t\t\t.toString()\n\t\t\t\t.replace(/[^0-9]/g, '')\n\t\t\t\t.replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1,')\n\t\tcase 'fullCurrency':\n\t\t\tconst dotCount = (value.toString().match(/\\./g) || []).length\n\t\t\tparts = value\n\t\t\t\t.toString()\n\t\t\t\t.replace(/[^0-9.]/g, '')\n\t\t\t\t.split('.')\n\t\t\tif (parts[1]) {\n\t\t\t\tparts[1] = parts[1].substring(0, 2)\n\t\t\t\tparts[0] = parts[0].replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1,')\n\t\t\t\tval = `${parts[0]}.${parts[1]}`\n\t\t\t} else {\n\t\t\t\tval = parts[0].replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1,')\n\t\t\t\tif (value.toString().includes('.') && dotCount < 2)\n\t\t\t\t\tval = val + '.'\n\t\t\t}\n\t\t\treturn val\n\t\tcase 'alpha':\n\t\t\treturn value.replace(/[^a-z ,-]+/gi, '')\n\t\tcase 'numeric':\n\t\t\treturn value.replace(/\\D/g, '')\n\t\tcase 'alphanumeric':\n\t\t\treturn value.replace(/[^\\w\\s,-]/gi, '')\n\t\tcase 'year':\n\t\t\treturn value.replace(/\\D/g, '').substring(0, 4)\n\t\tcase 'years':\n\t\t\treturn value.replace(/\\D/g, '')\n\t\tcase 'months':\n\t\t\treturn value.replace(/\\D/g, '')\n\t\tcase 'positive':\n\t\t\treturn value.replace(/\\D/g, '')\n\t\tcase 'email':\n\t\t\treturn value.trim().toLowerCase()\n\t\tdefault:\n\t\t\treturn value\n\t}\n}\n\nexport const adminMenu = [\n\t//{ name: 'My Dashboard', id: 'Dashboard', route: navigationViews.Portal },\n\t{\n\t\tname: 'My Profile',\n\t\tid: 'MyProfile',\n\t\troute: navigationLinking.UserProfile,\n\t},\n\t{ name: 'Log Out', id: 'SignOut' },\n]\n\nexport const getTitleByRole = (role) => {\n\tconst titles = ['', '', '', 'Loan Officer', 'Realtor']\n\treturn titles[role]\n}\n\nexport const getTitleByEntityType = (role) => {\n\tconst titles = ['', '', '', 'Loan Officer', 'Realtor']\n\treturn titles[role]\n}\n\nexport const getFilters = (entity, searchText) => {\n\tif (searchText === 'Search...') return (td) => td\n\tsearchText = searchText.toLowerCase()\n\tswitch (entity) {\n\t\tcase 'User':\n\t\t\treturn (td) =>\n\t\t\t\ttd.firstName?.toLowerCase().includes(searchText) ||\n\t\t\t\ttd.lastName?.toLowerCase().includes(searchText) ||\n\t\t\t\t`${td.firstName} ${td.lastName}`\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.includes(searchText) ||\n\t\t\t\ttd.email?.toLowerCase().includes(searchText) ||\n\t\t\t\ttd.nmlsid?.toString().includes(searchText)\n\t\tcase 'LoanOfficer':\n\t\t\treturn (td) =>\n\t\t\t\ttd.firstName?.toLowerCase().includes(searchText) ||\n\t\t\t\ttd.lastName?.toLowerCase().includes(searchText) ||\n\t\t\t\t`${td.firstName} ${td.lastName}`\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.includes(searchText) ||\n\t\t\t\ttd.email?.toLowerCase().includes(searchText) ||\n\t\t\t\ttd.title?.toLowerCase().includes(searchText) ||\n\t\t\t\ttd.nmlsid?.toString().includes(searchText)\n\t\tcase 'Branch':\n\t\t\treturn (td) =>\n\t\t\t\ttd.name.includes(searchText) ||\n\t\t\t\ttd.nmlsid?.toString().includes(searchText) ||\n\t\t\t\ttd.url?.includes(searchText)\n\t\tcase 'Corporate':\n\t\t\treturn (td) =>\n\t\t\t\ttd.name.toLowerCase().includes(searchText.toLowerCase()) ||\n\t\t\t\ttd.nmlsid?.toString().includes(searchText) ||\n\t\t\t\ttd.url?.includes(searchText)\n\t\tcase 'LoanApplication':\n\t\t\treturn (td) =>\n\t\t\t\ttd.firstName?.toLowerCase().includes(searchText) ||\n\t\t\t\ttd.lastName?.toLowerCase().includes(searchText) ||\n\t\t\t\t`${td.firstName} ${td.lastName}`\n\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t.includes(searchText) ||\n\t\t\t\ttd.loanOfficer?.toLowerCase().includes(searchText) ||\n\t\t\t\ttd.url?.includes(searchText) ||\n\t\t\t\ttd.loanNumber?.toLowerCase().includes(searchText)\n\t\tcase 'Rule':\n\t\t\treturn (td) =>\n\t\t\t\ttd.name?.toLowerCase().includes(searchText) ||\n\t\t\t\ttd.description?.toLowerCase().includes(searchText)\n\t\tcase 'Partners':\n\t\t\treturn (td) =>\n\t\t\t\ttd.firstName?.toLowerCase().includes(searchText) ||\n\t\t\t\ttd.lastName?.toLowerCase().includes(searchText)\n\t\tcase 'Partner':\n\t\t\treturn (td) =>\n\t\t\t\ttd.firstName?.toLowerCase().includes(searchText) ||\n\t\t\t\ttd.lastName?.toLowerCase().includes(searchText)\n\t\tcase 'Task':\n\t\t\treturn (td) =>\n\t\t\t\ttd.taskName?.toLowerCase().toString().includes(searchText) ||\n\t\t\t\ttd.taskDescription\n\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t.toString()\n\t\t\t\t\t.includes(searchText) ||\n\t\t\t\ttd.taskLOSIdentifier\n\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t.toString()\n\t\t\t\t\t.includes(searchText)\n\t\tcase 'RequestQueue':\n\t\t\treturn (td) =>\n\t\t\t\ttd.userEmail?.toLowerCase().toString().includes(searchText) ||\n\t\t\t\ttd.endpoint?.toLowerCase().toString().includes(searchText) ||\n\t\t\t\ttd.errorMessage\n\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t.toString()\n\t\t\t\t\t.includes(searchText) ||\n\t\t\t\ttd.status?.toLowerCase().toString().includes(searchText) ||\n\t\t\t\ttd.requestKey?.toLowerCase().toString().includes(searchText)\n\t\tcase 'NotificationTemplate':\n\t\t\treturn (td) =>\n\t\t\t\ttd.name?.toLowerCase().toString().includes(searchText) ||\n\t\t\t\ttd.description?.toLowerCase().toString().includes(searchText)\n\t\tcase 'DocumentTemplate':\n\t\t\treturn (td) =>\n\t\t\t\ttd.name?.toLowerCase().toString().includes(searchText) ||\n\t\t\t\ttd.description\n\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t.toString()\n\t\t\t\t\t.includes(searchText) ||\n\t\t\t\ttd.type?.toLowerCase().toString().includes(searchText)\n\t\tcase 'Workflow':\n\t\t\treturn (td) =>\n\t\t\t\ttd.name?.toLowerCase().toString().includes(searchText) ||\n\t\t\t\ttd.description\n\t\t\t\t\t?.toLowerCase()\n\t\t\t\t\t.toString()\n\t\t\t\t\t.includes(searchText) ||\n\t\t\t\ttd.type?.toLowerCase().toString().includes(searchText)\n\t}\n}\n\nexport const generateRandomPassword = () => {\n\tlet pass = ''\n\tconst allowed =\n\t\t'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +\n\t\t'abcdefghijklmnopqrstuvwxyz0123456789!@#$_-!'\n\n\tfor (let i = 1; i <= 100; i++) {\n\t\tlet char = Math.floor(Math.random() * allowed.length + 1)\n\n\t\tpass += allowed.charAt(char)\n\t}\n\n\treturn pass\n}\n\nexport const isJsonString = (str) => {\n\ttry {\n\t\tJSON.parse(str)\n\t} catch (e) {\n\t\treturn false\n\t}\n\treturn true\n}\n\nexport const setAutoFocusProp = (question) => {\n\tswitch (question.type) {\n\t\tcase 'group':\n\t\t\tif (question?.items?.length) {\n\t\t\t\tif (question?.items[0]?.type === 'text') {\n\t\t\t\t\tquestion.items[0].autoFocus = true\n\t\t\t\t} else if (\n\t\t\t\t\tquestion?.items[0]?.type === 'row' &&\n\t\t\t\t\tquestion?.items[0]?.items[0]?.type === 'text'\n\t\t\t\t) {\n\t\t\t\t\tquestion.items[0].items[0].autoFocus = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'text':\n\t\t\tquestion.autoFocus = true\n\t\t\tbreak\n\t}\n}\n\n// MB -> Bytes\nexport const fileMBSizes = {\n\t20: 20971520,\n\t150: 157286400,\n}\n\nexport const isiOSAndSafariBrowser = () => {\n\tconst isSafariBrowser = () =>\n\t\tnavigator.userAgent.indexOf('Safari') > -1 &&\n\t\tnavigator.userAgent.indexOf('Chrome') <= -1\n\tconst userAgent =\n\t\tnavigator.userAgent || navigator.vendor || window.opera\n\treturn (\n\t\t/iPad|iPhone|iPod/.test(userAgent) &&\n\t\t!window.MSStream &&\n\t\tisSafariBrowser()\n\t)\n}\n\nexport const siteConfigurationModel = {\n\tentityID: null,\n\tentityType: 0,\n\tintroduction: '',\n\tintroductionTitle: '',\n\temail: '',\n\turl: '',\n\tname: '',\n\tnmlsid: '',\n\taddress: '',\n\taddress2: '',\n\tcity: '',\n\tstate: '',\n\tzip: '',\n\tphone: '',\n\tfax: '',\n\ttollFree: '',\n\theaderAlignment: '',\n\tlogoUrl: '',\n\tdarkModeLogoUrl: '',\n\tportalLogoUrl: '',\n\tdarkModePortalLogoUrl: '',\n\tmobileAppLogoUrl: '',\n\ticonUrl: '',\n\tdarkModeIconUrl: '',\n\tbannerUrl: '',\n\tsecondaryBannerUrl: '',\n\tlicenseInfoUrl: '',\n\tcontactUsUrl: '',\n\tprofilePhotoUrl: '',\n\tlocationImageUrl: '',\n\tprimaryColor: '',\n\tdarkModePrimaryColor: '',\n\tsecondaryColor: '',\n\tdarkModeSecondaryColor: '',\n\tbackgroundColor: '',\n\tbackgroundImageUrl: '',\n\ttextColor: '',\n\ticonColor: '',\n\tlicenses: [],\n\ttermsUrl: '',\n\tcompanyUrl: '',\n\tcompanyName: '',\n\tcompanyAddress: '',\n\tcompanyAddress2: '',\n\tcompanyCity: '',\n\tcompanyState: '',\n\tcompanyZip: '',\n\tcompanyPhone: '',\n\tcompanyFax: '',\n\ttwitterUrl: '',\n\tfacebookUrl: '',\n\tlinkedInUrl: '',\n\tinstagramUrl: '',\n\tprivacyPolicyUrl: '',\n\tgoogleAnalyticsKey: '',\n\tlosUserID: '',\n\teppsUserName: '',\n\tfooterDisclaimerText1: '',\n\tfooterDisclaimerText2: '',\n\tbyPhoneStaticIconID: '',\n\tbyPhoneAnimatedIconID: '',\n\tcalculatorStaticIconID: '',\n\tcalculatorAnimatedIconID: '',\n\tshortAppStaticIconID: '',\n\tshortAppAnimatedIconID: '',\n\tfullAppStaticIconID: '',\n\tfullAppAnimatedIconID: '',\n\trulesStaticIconID: '',\n\trulesAnimatedIconID: '',\n\tmyProfileStaticIconID: '',\n\tmyProfileAnimatedIconID: '',\n\taccountSettingsStaticIconID: '',\n\taccountSettingsAnimatedIconID: '',\n\tbrandStaticIconID: '',\n\tbrandAnimatedIconID: '',\n\tbranchesStaticIconID: '',\n\tbranchesAnimatedIconID: '',\n\tloanOfficersStaticIconID: '',\n\tloanOfficersAnimatedIconID: '',\n\tusersStaticIconID: '',\n\tusersAnimatedIconID: '',\n\tpipelineStaticIconID: '',\n\tpipelineAnimatedIconID: '',\n\tloanApplicationsStaticIconID: '',\n\tloanApplicationsAnimatedIconID: '',\n\tdocumentsStaticIconID: '',\n\tdocumentsAnimatedIconID: '',\n\tdashboardStaticIconID: '',\n\tsignInStaticIconID: '',\n\tsignInAnimatedIconID: '',\n\tsignOutStaticIconID: '',\n\tsignOutAnimatedIconID: '',\n\taddCoBorrowerStaticIconID: '',\n\taddCoBorrowerAnimatedIconID: '',\n\tnotificationsStaticIconID: '',\n\tnotificationsAnimatedIconID: '',\n\tworkflowsStaticIconID: '',\n\tworkflowsAnimatedIconID: '',\n\trequestQueueStaticIconID: '',\n\trequestQueueAnimatedIconID: '',\n\tloanDetailsStaticIconID: '',\n\tloanDetailsAnimatedIconID: '',\n\tsignatureStaticIconID: '',\n\tsignatureAnimatedIconID: '',\n\thelpStaticIconID: '',\n\thelpAnimatedIconID: '',\n\tpaymentStaticIconID: '',\n\tpaymentAnimatedIconID: '',\n\tloConnectStaticIconID: '',\n\tloConnectAnimatedIconID: '',\n\tquickPricerStaticIconID: '',\n\tquickPricerAnimatedIconID: '',\n\tsuperShortAppStaticIconID: '',\n\tsuperShortAppAnimatedIconID: '',\n\treleaseNotesStaticIconID: '',\n\treleaseNotesAnimatedIconID: '',\n\tsupportStaticIconID: '',\n\tsupportAnimatedIconID: '',\n\tassetsStaticIconID: '',\n\tassetsAnimatedIconID: '',\n\tbyPhoneStaticIcon: '',\n\tbyPhoneAnimatedIcon: '',\n\tcalculatorStaticIcon: '',\n\tcalculatorAnimatedIcon: '',\n\tshortAppStaticIcon: '',\n\tshortAppAnimatedIcon: '',\n\tfullAppStaticIcon: '',\n\tfullAppAnimatedIcon: '',\n\trulesStaticIcon: '',\n\trulesAnimatedIcon: '',\n\tmyProfileStaticIcon: '',\n\tmyProfileAnimatedIcon: '',\n\taccountSettingsStaticIcon: '',\n\taccountSettingsAnimatedIcon: '',\n\tbrandStaticIcon: '',\n\tbrandAnimatedIcon: '',\n\tbranchesStaticIcon: '',\n\tbranchesAnimatedIcon: '',\n\tloanOfficersStaticIcon: '',\n\tloanOfficersAnimatedIcon: '',\n\tusersStaticIcon: '',\n\tusersAnimatedIcon: '',\n\tpipelineStaticIcon: '',\n\tpipelineAnimatedIcon: '',\n\tloanApplicationsStaticIcon: '',\n\tloanApplicationsAnimatedIcon: '',\n\tdocumentsStaticIcon: '',\n\tdocumentsAnimatedIcon: '',\n\tdashboardStaticIcon: '',\n\tdashboardAnimatedIcon: '',\n\tsignInStaticIcon: '',\n\tsignInAnimatedIcon: '',\n\tsignOutStaticIcon: '',\n\tsignOutAnimatedIcon: '',\n\taddCoBorrowerStaticIcon: '',\n\taddCoBorrowerAnimatedIcon: '',\n\tnotificationsStaticIcon: '',\n\tnotificationsAnimatedIcon: '',\n\tworkflowsStaticIcon: '',\n\tworkflowsAnimatedIcon: '',\n\trequestQueueStaticIcon: '',\n\trequestQueueAnimatedIcon: '',\n\tloanDetailsStaticIcon: '',\n\tloanDetailsAnimatedIcon: '',\n\tsignatureStaticIcon: '',\n\tsignatureAnimatedIcon: '',\n\thelpStaticIcon: '',\n\thelpAnimatedIcon: '',\n\tpaymentStaticIcon: '',\n\tpaymentAnimatedIcon: '',\n\tloConnectStaticIcon: '',\n\tloConnectAnimatedIcon: '',\n\tquickPricerStaticIcon: '',\n\tquickPricerAnimatedIcon: '',\n\tsuperShortAppStaticIcon: '',\n\tsuperShortAppAnimatedIcon: '',\n\tassetsStaticIcon: '',\n\tassetsAnimatedIcon: '',\n\treleaseNotesStaticIcon: '',\n\treleaseNotesAnimatedIcon: '',\n\tsupportStaticIcon: '',\n\tsupportAnimatedIcon: '',\n\tcounties: '',\n\tidentityProvider: '',\n\tdisclosuresSSOSiteID: '',\n\tloanChannel: '',\n\tloanFolder: '',\n\tloanTemplate: '',\n\tirsVerificationUrl: '',\n\tccEmails: '',\n\tbyPhoneTitle: '',\n\tbyPhoneSubtitle: '',\n\tshortAppTitle: '',\n\tshortAppSubtitle: '',\n\tfullAppTitle: '',\n\tfullAppSubtitle: '',\n\tspanishPrequalTitle: '',\n\tspanishPrequalSubtitle: '',\n\tspanishFullAppTitle: '',\n\tspanishFullAppSubtitle: '',\n\tdocumentTemplatesStaticIcon: '',\n\tdocumentTemplatesAnimatedIcon: '',\n\tcalendarUrl: '',\n\tsurveysUrl: '',\n\tenabledServices: {\n\t\talexa: false,\n\t\tborrowerMissions: false,\n\t\tborrowerTasks: false,\n\t\tdocusign: false,\n\t\tdisclosures: false,\n\t\tdocuments: false,\n\t\tloanCalculator: false,\n\t\temailNotifications: false,\n\t\tfullApp: false,\n\t\tmobileApp: false,\n\t\tmobilePrequal: false,\n\t\tpricingCalculator: false,\n\t\trates: false,\n\t\tringCentral: false,\n\t\tsocialSurvey: false,\n\t\tspanishPrequal: false,\n\t\tspanishFullApp: false,\n\t\tvoa: false,\n\t\tvoe: false,\n\t\tvoi: false,\n\t\tvoc: false,\n\t\ttextNotifications: false,\n\t\tprequalLetter: false,\n\t\tpayments: false,\n\t\tleadApp: false,\n\t\tloanStatus: false,\n\t\tloanAndProperty: true,\n\t\tpersonalInformation: true,\n\t\temployment: true,\n\t\tassets: true,\n\t\trealEstate: true,\n\t\tloanDetails: true,\n\t\tencompassWeb: true,\n\t\tsupport: true,\n\t\tleads: true,\n\t\topenHouseForm: false,\n\t\tlistingOfferForm: false,\n\t\tlistings: false,\n\t\tautomatedServiceOrders: false,\n\t},\n\tmodules: [],\n}\n\nexport const siteConfigurationModelWithNulls = {\n\t...siteConfigurationModel,\n\tenabledServices: {\n\t\talexa: null,\n\t\tborrowerMissions: null,\n\t\tborrowerTasks: null,\n\t\tdocusign: null,\n\t\tdisclosures: null,\n\t\tdocuments: null,\n\t\tloanCalculator: null,\n\t\temailNotifications: null,\n\t\tfullApp: null,\n\t\tmobileApp: null,\n\t\tmobilePrequal: null,\n\t\tpricingCalculator: null,\n\t\trates: null,\n\t\tringCentral: null,\n\t\tsocialSurvey: null,\n\t\tspanishPrequal: null,\n\t\tspanishFullApp: null,\n\t\tvoa: null,\n\t\tvoe: null,\n\t\tvoi: null,\n\t\tvoc: null,\n\t\ttextNotifications: null,\n\t\tprequalLetter: null,\n\t\tpayments: null,\n\t\tleadApp: null,\n\t\tloanStatus: null,\n\t\tloanAndProperty: null,\n\t\tpersonalInformation: null,\n\t\temployment: null,\n\t\tassets: null,\n\t\trealEstate: null,\n\t\tloanDetails: null,\n\t\tencompassWeb: null,\n\t\tsupport: null,\n\t\tleads: null,\n\t\topenHouseForm: null,\n\t\tlistingOfferForm: null,\n\t\tlistings: null,\n\t\tautomatedServiceOrders: null,\n\t},\n}\n\nexport const getExampleQuestionByType = (type) => {\n\tlet question\n\n\t// eslint-disable-next-line default-case\n\tswitch (type) {\n\t\tcase 'photo':\n\t\t\tquestion = {\n\t\t\t\tqId: '',\n\t\t\t\tname: '',\n\t\t\t\ttitle: '',\n\t\t\t\theading: '',\n\t\t\t\tquestion: '',\n\t\t\t\ttype: 'photo',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\toptional: false,\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'upload':\n\t\t\tquestion = {\n\t\t\t\tqId: '',\n\t\t\t\tname: '',\n\t\t\t\ttitle: '',\n\t\t\t\theading: '',\n\t\t\t\tquestion: '',\n\t\t\t\ttype: 'upload',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\toptional: false,\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'information':\n\t\t\tquestion = {\n\t\t\t\tqId: '',\n\t\t\t\tname: '',\n\t\t\t\ttitle: '',\n\t\t\t\theading: '',\n\t\t\t\tquestion:\n\t\t\t\t\t'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eu nunc dictum, porta erat nec, convallis arcu. Cras justo risus, porttitor placerat sagittis pharetra, varius a leo. Ut ac pulvinar nulla. Cras euismod scelerisque egestas. Morbi vulputate leo augue, vel viverra ex dignissim vitae. Duis vitae nisi vitae odio bibendum efficitur. Praesent quis feugiat lacus. Vestibulum maximus lectus et interdum dapibus. Vestibulum non ligula eu ipsum accumsan faucibus. Mauris laoreet elit et quam dictum mattis. Fusce bibendum purus quis ligula consequat lobortis.',\n\t\t\t\ttype: 'information',\n\t\t\t\tbuttonText: \"Let's Go\",\n\t\t\t\tlogo: true,\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'choice':\n\t\t\tquestion = {\n\t\t\t\tqId: '',\n\t\t\t\tname: '',\n\t\t\t\ttitle: '',\n\t\t\t\theading: '',\n\t\t\t\tquestion: 'What is your question?',\n\t\t\t\ttype: 'choice',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Choice 1',\n\t\t\t\t\t\tvalue: 'C1',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Choice 2',\n\t\t\t\t\t\tvalue: 'C2',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Choice 3',\n\t\t\t\t\t\tvalue: 'C3',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'boolean':\n\t\t\tquestion = {\n\t\t\t\tqId: '',\n\t\t\t\tname: '',\n\t\t\t\ttitle: '',\n\t\t\t\theading: '',\n\t\t\t\tquestion: 'Do you have a question?',\n\t\t\t\ttype: 'boolean',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Yes',\n\t\t\t\t\t\tvalue: true,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'No',\n\t\t\t\t\t\tvalue: false,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'text':\n\t\t\tquestion = {\n\t\t\t\tqId: '',\n\t\t\t\tname: '',\n\t\t\t\ttitle: '',\n\t\t\t\theading: '',\n\t\t\t\tquestion: 'What is your text question?',\n\t\t\t\ttype: 'text',\n\t\t\t\tplaceholder: 'Enter text',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\ttarget: '',\n\t\t\t\tvalidation: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'currency':\n\t\t\tquestion = {\n\t\t\t\tqId: '',\n\t\t\t\tname: '',\n\t\t\t\ttitle: '',\n\t\t\t\theading: '',\n\t\t\t\tquestion: 'What is your currency question?',\n\t\t\t\ttype: 'text',\n\t\t\t\tplaceholder: 'Enter currency',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\toptional: false,\n\t\t\t\ttarget: '',\n\t\t\t\tvalidation: 'currency',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'ssn':\n\t\t\tquestion = {\n\t\t\t\tqId: '',\n\t\t\t\tname: '',\n\t\t\t\ttitle: '',\n\t\t\t\theading: '',\n\t\t\t\tquestion: 'What is your SSN?',\n\t\t\t\ttype: 'text',\n\t\t\t\tplaceholder: 'Enter SSN',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\ttarget: '',\n\t\t\t\tvalidation: 'ssn',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'picker':\n\t\t\tquestion = {\n\t\t\t\tqId: '',\n\t\t\t\ttitle: '',\n\t\t\t\theading: '',\n\t\t\t\tquestion: 'What is your picker question?',\n\t\t\t\ttype: 'picker',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Option 1',\n\t\t\t\t\t\tvalue: 1,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Option 2',\n\t\t\t\t\t\tvalue: 2,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Option 3',\n\t\t\t\t\t\tvalue: 3,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Option 4',\n\t\t\t\t\t\tvalue: 4,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Option 5',\n\t\t\t\t\t\tvalue: 5,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'Default Picker Label',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\toptional: false,\n\t\t\t\tname: 'Picker Name',\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'range':\n\t\t\tquestion = {\n\t\t\t\tqId: '',\n\t\t\t\tname: '',\n\t\t\t\ttitle: '',\n\t\t\t\theading: '',\n\t\t\t\tquestion: 'What is your range?',\n\t\t\t\ttype: 'range',\n\t\t\t\tprefix: '$',\n\t\t\t\tmin: 0,\n\t\t\t\tmax: 1000,\n\t\t\t\tinitial: 100,\n\t\t\t\tstep: 10,\n\t\t\t\tplus: true,\n\t\t\t\tvalidation: 'currency',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\toptional: false,\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'state':\n\t\t\tquestion = {\n\t\t\t\ttitle: 'New Location Title',\n\t\t\t\theading: 'New Location Heading',\n\t\t\t\tquestion: 'Where are you located?',\n\t\t\t\ttype: 'picker',\n\t\t\t\tmodel: 'states',\n\t\t\t\tlicensesFilter: false,\n\t\t\t\toptions: [],\n\t\t\t\tqId: '',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\toptional: false,\n\t\t\t\tname: 'State Name',\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'licensedState':\n\t\t\tquestion = {\n\t\t\t\ttitle: 'New Location Title',\n\t\t\t\theading: 'New Location Heading',\n\t\t\t\tquestion: 'Where are you located?',\n\t\t\t\ttype: 'picker',\n\t\t\t\tmodel: 'states',\n\t\t\t\tlicensesFilter: true,\n\t\t\t\toptions: [],\n\t\t\t\tqId: '',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\toptional: false,\n\t\t\t\tname: 'Licensed State Name',\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'email':\n\t\t\tquestion = {\n\t\t\t\tquestion: 'What is your email?',\n\t\t\t\ttype: 'text',\n\t\t\t\tvalidation: 'email',\n\t\t\t\tplaceholder: 'Enter email',\n\t\t\t\tqId: '',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\toptional: false,\n\t\t\t\tname: 'Email',\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'phone':\n\t\t\tquestion = {\n\t\t\t\tqId: 'BorrowerContactPhone',\n\t\t\t\tname: 'Borrower Contact Phone #',\n\t\t\t\tquestion: 'What is your question?',\n\t\t\t\ttype: 'text',\n\t\t\t\tkeyboardType: 'number-pad',\n\t\t\t\tplaceholder: 'Enter contact number',\n\t\t\t\tfieldId: 'BorrowerContactPhone',\n\t\t\t\tisCustom: false,\n\t\t\t\toptional: false,\n\t\t\t\tvalidation: 'phone',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'dob':\n\t\t\tquestion = {\n\t\t\t\tqId: '',\n\t\t\t\tname: 'Borrower DOB',\n\t\t\t\tquestion: 'Date of Birth',\n\t\t\t\ttype: 'text',\n\t\t\t\tplaceholder: 'MM/DD/YYYY',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\toptional: false,\n\t\t\t\tmaxLength: 10,\n\t\t\t\tvalidation: 'dob',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'group':\n\t\t\tquestion = {\n\t\t\t\ttitle: 'New Group Title',\n\t\t\t\theading: 'New Group Heading',\n\t\t\t\ttype: 'group',\n\t\t\t\titems: [\n\t\t\t\t\t{\n\t\t\t\t\t\tqId: '',\n\t\t\t\t\t\tname: 'Group Text Question',\n\t\t\t\t\t\tquestion: 'What is your question?',\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\tkeyboardType: 'number-pad',\n\t\t\t\t\t\tplaceholder: 'Enter contact number',\n\t\t\t\t\t\tfieldId: '',\n\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\toptional: false,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'row',\n\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: '',\n\t\t\t\t\t\t\t\tqId: '',\n\t\t\t\t\t\t\t\tquestion: 'Row Question 1',\n\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\toptional: false,\n\t\t\t\t\t\t\t\tfieldId: '',\n\t\t\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\t\t\twidth: 200,\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\tflex: 1,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tvalidation: 'alphanumeric',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tqId: '',\n\t\t\t\t\t\t\t\tquestion: 'Row Question 2',\n\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\toptional: false,\n\t\t\t\t\t\t\t\tfieldId: 'RowQuestion2',\n\t\t\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\t\t\tname: 'Row Question 2',\n\t\t\t\t\t\t\t\twidth: 200,\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\tflex: 1,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tvalidation: 'alphanumeric',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\ttarget: '',\n\t\t\t\tqId: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'address':\n\t\t\tquestion = {\n\t\t\t\tquestion: 'What is your address?',\n\t\t\t\ttype: 'place',\n\t\t\t\tname: 'Place',\n\t\t\t\tvalidation: 'googlePlaces',\n\t\t\t\tplaceholder: 'Enter address',\n\t\t\t\tqId: '',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'addressGroup':\n\t\t\tquestion = {\n\t\t\t\tquestion: 'Please enter the address of the ...',\n\t\t\t\ttype: 'group',\n\t\t\t\titems: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Borrower Real Estate Property Address',\n\t\t\t\t\t\tquestion: 'Address Lookup',\n\t\t\t\t\t\ttype: 'place',\n\t\t\t\t\t\tqId: 'AddressLookup',\n\t\t\t\t\t\tfieldId: 'AddressLookup',\n\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\toptional: false,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: 'Street Address',\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\tqId: 'AddressStreet',\n\t\t\t\t\t\tfieldId: 'AddressStreet',\n\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\tname: 'Address Street',\n\t\t\t\t\t\tvalidation: 'alphanumeric',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'row',\n\t\t\t\t\t\titems: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tquestion: 'Unit Type',\n\t\t\t\t\t\t\t\ttype: 'picker',\n\t\t\t\t\t\t\t\tdefault: 'Unit Type',\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Apartment',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Apartment',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Basement',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Basement',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Building',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Building',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Condo',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Condo',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Department',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Department',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Floor',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Floor',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Front',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Front',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Hangar',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Hangar',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Key',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Key',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Lobby',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Lobby',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Lot',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Lot',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Lower',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Lower',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Office',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Office',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Penthouse',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Penthouse',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Pier',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Pier',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Rear',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Rear',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Room',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Room',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Side',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Side',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Space',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Space',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Stop',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Stop',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Suite',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Suite',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Trailer',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Trailer',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Unit',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Unit',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: 'Upper',\n\t\t\t\t\t\t\t\t\t\tvalue: 'Upper',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\toptional: false,\n\t\t\t\t\t\t\t\tqId: 'AddressUnitType',\n\t\t\t\t\t\t\t\tfieldId: 'AddressUnitType',\n\t\t\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\t\t\tname: 'Borrower Real Estate Property Address Unit Type',\n\t\t\t\t\t\t\t\twidth: 200,\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\tflex: 1,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tquestion: 'Unit / Apt #',\n\t\t\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\t\t\toptional: true,\n\t\t\t\t\t\t\t\tqId: 'AddressUnitType',\n\t\t\t\t\t\t\t\tfieldId: 'AddressUnit',\n\t\t\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\t\t\tname: 'Address Unit',\n\t\t\t\t\t\t\t\twidth: 200,\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\tflex: 1,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tvalidation: 'alphanumeric',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: 'City',\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\tqId: 'AddressCity',\n\t\t\t\t\t\tfieldId: 'AddressCity',\n\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\tname: 'Address City',\n\t\t\t\t\t\tvalidation: 'alpha',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: 'State',\n\t\t\t\t\t\tdefault: 'State',\n\t\t\t\t\t\ttype: 'picker',\n\t\t\t\t\t\toptions: [],\n\t\t\t\t\t\tmodel: 'states',\n\t\t\t\t\t\tlicensesFilter: false,\n\t\t\t\t\t\tqId: 'AddressState',\n\t\t\t\t\t\tfieldId: 'AddressState',\n\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\tname: 'Address State',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: 'Zip',\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\tqId: 'AddressZip',\n\t\t\t\t\t\tfieldId: 'AddressZip',\n\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\tname: 'Address Zip',\n\t\t\t\t\t\tmaxlength: 5,\n\t\t\t\t\t\tvalidation: 'numeric',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\ttarget: '',\n\t\t\t\tqId: '',\n\t\t\t\tname: 'Address Group Name',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'contactInfoGroup':\n\t\t\tquestion = {\n\t\t\t\theading: 'Contact Information',\n\t\t\t\ttype: 'group',\n\t\t\t\titems: [\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: 'First Name',\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\tqId: 'FirstName',\n\t\t\t\t\t\tfieldId: 'FirstName',\n\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\tname: 'First Name',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: 'Last Name',\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\tqId: 'LastName',\n\t\t\t\t\t\tfieldId: 'BorrowerLastName',\n\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\tname: 'Last Name',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: 'Middle Initial (optional)',\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\tqId: 'MiddleInitial',\n\t\t\t\t\t\tfieldId: 'MiddleInitial',\n\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\tname: 'Middle Initial',\n\t\t\t\t\t\tmaxLength: 1,\n\t\t\t\t\t\toptional: true,\n\t\t\t\t\t\tvalidation: 'alpha',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: 'Suffix (optional)',\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\tqId: 'Suffix',\n\t\t\t\t\t\tfieldId: 'Suffix',\n\t\t\t\t\t\tisCustom: false,\n\t\t\t\t\t\tname: 'Suffix',\n\t\t\t\t\t\toptional: true,\n\t\t\t\t\t\tvalidation: 'alpha',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\ttarget: '',\n\t\t\t\tqId: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'declaration':\n\t\t\tquestion = {\n\t\t\t\theading: 'Borrower Declarations',\n\t\t\t\tquestion: 'Will you do something?',\n\t\t\t\ttype: 'declaration',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Yes',\n\t\t\t\t\t\tvalue: true,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'No',\n\t\t\t\t\t\tvalue: false,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tqId: '',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\tname: 'Declaration',\n\t\t\t\ttarget: '',\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'authorization':\n\t\t\tquestion = {\n\t\t\t\theading: 'Consent to Receive Something',\n\t\t\t\tquestion:\n\t\t\t\t\t'Your Consent To Do Something\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ornare urna ac diam imperdiet maximus. Nulla facilisi. Donec sed pulvinar diam, in fermentum nunc. Duis ac scelerisque ipsum. Donec vitae gravida augue, non scelerisque nisi. Aliquam eget elementum leo. Vivamus feugiat non mi in mollis. Etiam gravida tempor egestas. Cras consectetur ultrices nisl.\\n\\nFusce eu scelerisque urna, a volutpat nisl. Donec augue quam, consequat in pharetra in, semper in diam. Aliquam erat volutpat. Curabitur cursus arcu vel purus consequat luctus id vitae magna. Maecenas malesuada arcu at ipsum varius molestie. Integer vitae neque purus. Phasellus urna magna, convallis et laoreet quis, congue id nisi. Sed mattis porta ex ornare consequat. Ut at dapibus justo, ac mattis metus. In nec sodales quam.\\n\\nCurabitur ac diam quis nunc facilisis consequat vel quis enim. Vestibulum varius mollis nulla a porttitor. Aenean sodales libero nec convallis dictum. Vivamus tempus, nisl nec placerat dictum, mauris risus auctor neque, vitae hendrerit magna diam et eros. Nam condimentum luctus ex sed aliquam. Pellentesque accumsan nisi in augue ullamcorper pretium. Vestibulum at ipsum a nulla molestie auctor at sed enim. Ut id libero vel neque imperdiet gravida rhoncus condimentum ante. Etiam luctus odio sed ornare tincidunt. Aenean pretium malesuada accumsan. Vivamus vitae eros sit amet quam ornare ullamcorper non dignissim neque. Integer eleifend nibh at nisi lacinia, sit amet efficitur nulla pellentesque. Morbi tempus risus dui, at ultricies nisi luctus eu.\\n\\nNulla facilisi. In vitae viverra lacus. Sed consectetur magna vitae diam volutpat, sed faucibus orci porta. Integer placerat orci nec quam aliquet sollicitudin non quis nibh. Vivamus vestibulum dui neque, vitae luctus arcu condimentum vitae. Pellentesque tempus rhoncus arcu. Mauris auctor turpis vel ultricies efficitur. Aenean pulvinar turpis dui, at malesuada ligula consectetur ut. Ut pharetra ac urna nec suscipit. Morbi dignissim nec libero at lacinia. Mauris porttitor arcu vitae lorem hendrerit, vel pulvinar lacus fringilla. Maecenas sollicitudin ipsum vitae nibh sodales, eu sagittis nunc fermentum.',\n\t\t\t\ttype: 'authorization',\n\t\t\t\tqId: '',\n\t\t\t\tfieldId: '',\n\t\t\t\tisCustom: false,\n\t\t\t\ttarget: '',\n\t\t\t\tname: 'Authorization',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'I consent to do something',\n\t\t\t\t\t\tvalue: true,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}\n\t\t\tbreak\n\t}\n\treturn question\n}\n\nexport const formatYesNo = (val) => {\n\tlet formattedVal = ''\n\tif (val) {\n\t\tformattedVal = val === 'yes' ? 'Y' : 'N'\n\t}\n\treturn formattedVal\n}\n\nexport const boolToYN = (val) => {\n\treturn val ? 'Y' : 'N'\n}\n\nexport const getWorkflowField = async (fileName, fieldId) => {\n\treturn new Promise((resolve, reject) => {\n\t\timport(`${__dirname}/../workflows/${fileName}.json`)\n\t\t\t.then((result) => {\n\t\t\t\tconst field = findWorkflowFieldById(result.default, fieldId)\n\t\t\t\tresolve(field)\n\t\t\t})\n\t\t\t.catch((e) => reject(e))\n\t})\n}\n\nconst findWorkflowFieldById = (workflowData, fieldId) => {\n\tfor (let i = 0; i < workflowData.length; i++) {\n\t\tconst field = workflowData[i]\n\t\tif (field.fieldId === fieldId) {\n\t\t\treturn field\n\t\t}\n\n\t\tif (['group', 'row'].includes(field.type) && field.items) {\n\t\t\tconst result = findWorkflowFieldById(field.items, fieldId)\n\t\t\tif (result) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst getDate = (date) => {\n\treturn typeof date === 'string' ? new Date(date) : date\n}\nexport const daysDiff = (date1, date2) => {\n\tconst dt1 = getDate(date1)\n\tconst dt2 = getDate(date2)\n\treturn Math.floor(\n\t\t(Date.UTC(dt2.getFullYear(), dt2.getMonth(), dt2.getDate()) -\n\t\t\tDate.UTC(dt1.getFullYear(), dt1.getMonth(), dt1.getDate())) /\n\t\t\t(1000 * 60 * 60 * 24)\n\t)\n}\n\nexport const getEncompassDateString = (encompassDateStr) =>\n\tencompassDateStr ? encompassDateStr.replace('//', '') : null\n\nexport const replaceVars = (str, data) => {\n\tlet vars = []\n\tlet re = /{{([^}]+)}}/g\n\tlet text\n\n\twhile ((text = re.exec(str))) {\n\t\tvars.push(text[1])\n\t}\n\n\tvars.forEach((v) => {\n\t\tstr = str.replace(`{{${v}}}`, data[v])\n\t})\n\n\treturn str\n}\n\nexport const exportToCsv = (\n\texportData,\n\tfileTitle,\n\tstandardized = true\n) => {\n\tlet data\n\tif (!standardized) {\n\t\tlet keys = []\n\t\t// get all of the keys\n\t\texportData.forEach(\n\t\t\t(row) => (keys = [...new Set([...keys, ...Object.keys(row)])])\n\t\t)\n\t\tkeys.sort()\n\t\tdata = exportData.map((row) => {\n\t\t\tconst obj = {}\n\t\t\tkeys.forEach((key) => (obj[key] = row[key] || ''))\n\t\t\treturn obj\n\t\t})\n\t} else data = exportData\n\tconst csvHeaders = [Object.keys(data[0]).join().toString()]\n\tlet csvData = data.map((entry) => {\n\t\tlet values = Object.values(entry)\n\t\tlet csvRow = values.map((row) => {\n\t\t\treturn `\"${row}\"`\n\t\t})\n\t\treturn Object.values(csvRow).join(',')\n\t})\n\n\tdownloadFile({\n\t\tdata: [...csvHeaders, ...csvData].join('\\n'),\n\t\tfileName: fileTitle + '.csv',\n\t\tfileType: 'text/csv',\n\t})\n}\n\nexport const exportToExcel = (\n\texportData,\n\tfileTitle,\n\tstandardized = true\n) => {\n\tconst xlsxFileType =\n\t\t'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8'\n\tconst xlxsFileExtension = '.xlsx'\n\tconst ws = XLSX.utils.json_to_sheet(exportData)\n\tconst wb = { Sheets: { data: ws }, SheetNames: ['data'] }\n\tconst excelBuffer = XLSX.write(wb, {\n\t\tbookType: 'xlsx',\n\t\ttype: 'array',\n\t})\n\tconst excelData = new Blob([excelBuffer], { type: xlsxFileType })\n\tFileSaver.saveAs(excelData, fileTitle + xlxsFileExtension)\n}\n\nexport const exportToJSON = (exportData, fileTitle) => {\n\tdownloadFile({\n\t\tdata: JSON.stringify(exportData, undefined, 4),\n\t\tfileName: fileTitle + '.json',\n\t\tfileType: 'text/json',\n\t})\n}\n\nexport const downloadFile = ({ data, fileName, fileType }) => {\n\tconst blob = new Blob([data], { type: fileType })\n\tconst a = document.createElement('a')\n\ta.download = fileName\n\ta.href = window.URL.createObjectURL(blob)\n\n\tconst clickEvt = new MouseEvent('click', {\n\t\tview: window,\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t})\n\ta.dispatchEvent(clickEvt)\n\ta.remove()\n}\n\nexport const stripHtmlTags = (str) => {\n\tif (!str) {\n\t\treturn ''\n\t}\n\treturn str.replace(/(<([^>]+)>)/gi, '')\n}\n\nexport const getRouteFromInvite = (invite, siteConfig) => {\n\tif (invite.route) {\n\t\tif (navigationLinking[invite.route])\n\t\t\treturn `/${navigationLinking[invite.route]}`\n\t\telse if (invite.route.includes('https://')) return invite.route\n\t\telse return `/${invite.route}`\n\t} else {\n\t\tif (\n\t\t\tinvite.completedLoanApplication ||\n\t\t\tsiteConfig.enabledServices.spanishFullApp\n\t\t)\n\t\t\treturn `/${navigationLinking.Portal}`\n\t\telse\n\t\t\treturn `/${invite?.loanRole === 'Borrower' ? navigationLinking.Apply : navigationLinking.InviteApply}`\n\t}\n}\n\nexport const disclosuresSSOSignIn = (siteConfig, token) => {\n\treturn window.open(\n\t\tgenerateDisclosuresSSOLoginUrl(siteConfig, token),\n\t\t'_blank',\n\t\t'noopener,noreferrer'\n\t)\n}\n\nexport const sortByField = (array, field = 'name', order = 'asc') => {\n\treturn orderBy(array, [field], [order])\n}\n\nexport const rowActions = { duplicate: 'duplicate', export: 'export' }\n\nexport const tableRowsPerPageOptions = [25, 50, 100, 200]\n\nexport function formatBytes(bytes, decimals = 2) {\n\tif (!+bytes) return '0 Bytes'\n\n\tconst k = 1024\n\tconst dm = decimals < 0 ? 0 : decimals\n\tconst sizes = [\n\t\t'Bytes',\n\t\t'KB',\n\t\t'MB',\n\t\t'GB',\n\t\t'TB',\n\t\t'PB',\n\t\t'EB',\n\t\t'ZB',\n\t\t'YB',\n\t]\n\n\tconst i = Math.floor(Math.log(bytes) / Math.log(k))\n\n\treturn `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`\n}\n\nexport const imageExists = (imageUrl) => {\n\tconst image = new Image()\n\timage.src = imageUrl\n\treturn image.width !== 0\n}\n\nexport function validateURL(url, requiredDomain) {\n\tconst requiredDomainSize = requiredDomain?.split('.').length\n\tconst urlParts = url.split('.')\n\tconst isMalformed = urlParts.some((part) => !part)\n\tif (urlParts.length < requiredDomainSize + 1 || isMalformed) {\n\t\treturn `The format of the URL you've entered (${url}) is not valid.\n\t\t\t\tIt should appear like branch.${requiredDomain}`\n\t}\n\n\tconst givenUrlPrefix = urlParts.slice(0, requiredDomainSize * -1)\n\n\tif (!url.endsWith(requiredDomain)) {\n\t\treturn `The domain you've entered does not match the domain of the branch.\n\t\tIt should appear like ${givenUrlPrefix.join('.')}.${requiredDomain}`\n\t}\n\treturn\n}\n","import * as yup from 'yup'\n\nconst yupOptionalNumberTransform = (value) =>\n\tNumber.isNaN(value) ? null : value\n\n/**\n * @deprecated use yup.mixed().optionalIntegerRange method instead\n */\nconst yupOptionalIntegerRange = (min, max) => {\n\treturn yup\n\t\t.number()\n\t\t.transform(yupOptionalNumberTransform)\n\t\t.nullable()\n\t\t.optional()\n\t\t.integer()\n\t\t.min(min)\n\t\t.max(max)\n}\n\nconst addCustomYupValidators = () => {\n\tyup.addMethod(yup.mixed, 'nullableNumber', function () {\n\t\treturn yup\n\t\t\t.number()\n\t\t\t.transform((v, o) => (o === '' ? null : v))\n\t\t\t.nullable()\n\t})\n\n\tyup.addMethod(yup.mixed, 'guid', function () {\n\t\treturn yup\n\t\t\t.string()\n\t\t\t.matches(\n\t\t\t\t/^{?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}}?$/,\n\t\t\t\t'Please provide a valid GUID'\n\t\t\t)\n\t})\n\n\tyup.addMethod(\n\t\tyup.mixed,\n\t\t'optionalIntegerRange',\n\t\tfunction (min, max) {\n\t\t\treturn yup\n\t\t\t\t.number()\n\t\t\t\t.transform(yupOptionalNumberTransform)\n\t\t\t\t.nullable()\n\t\t\t\t.optional()\n\t\t\t\t.integer()\n\t\t\t\t.min(min)\n\t\t\t\t.max(max)\n\t\t}\n\t)\n}\n\nexport { addCustomYupValidators, yupOptionalIntegerRange }\n","/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n// $FlowFixMe\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i];\n }\n }\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (process.env.NODE_ENV !== 'production') {\n var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;\n\n if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {\n // this would only cause problem in speedy mode\n // but we don't want enabling speedy to affect the observable behavior\n // so we report this error at all times\n console.error(\"You're attempting to insert the following rule:\\n\" + rule + '\\n\\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');\n }\n this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;\n }\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {\n console.error(\"There was a problem inserting the following rule: \\\"\" + rule + \"\\\"\", e);\n }\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n // $FlowFixMe\n this.tags.forEach(function (tag) {\n return tag.parentNode && tag.parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n\n if (process.env.NODE_ENV !== 'production') {\n this._alreadyInsertedOrderInsensitiveRule = false;\n }\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, COMMENT, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\nvar ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';\n\nvar isIgnoringComment = function isIgnoringComment(element) {\n return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;\n};\n\nvar createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {\n return function (element, index, children) {\n if (element.type !== 'rule' || cache.compat) return;\n var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);\n\n if (unsafePseudoClasses) {\n var isNested = !!element.parent; // in nested rules comments become children of the \"auto-inserted\" rule and that's always the `element.parent`\n //\n // considering this input:\n // .a {\n // .b /* comm */ {}\n // color: hotpink;\n // }\n // we get output corresponding to this:\n // .a {\n // & {\n // /* comm */\n // color: hotpink;\n // }\n // .b {}\n // }\n\n var commentContainer = isNested ? element.parent.children : // global rule at the root level\n children;\n\n for (var i = commentContainer.length - 1; i >= 0; i--) {\n var node = commentContainer[i];\n\n if (node.line < element.line) {\n break;\n } // it is quite weird but comments are *usually* put at `column: element.column - 1`\n // so we seek *from the end* for the node that is earlier than the rule's `element` and check that\n // this will also match inputs like this:\n // .a {\n // /* comm */\n // .b {}\n // }\n //\n // but that is fine\n //\n // it would be the easiest to change the placement of the comment to be the first child of the rule:\n // .a {\n // .b { /* comm */ }\n // }\n // with such inputs we wouldn't have to search for the comment at all\n // TODO: consider changing this comment placement in the next major version\n\n\n if (node.column < element.column) {\n if (isIgnoringComment(node)) {\n return;\n }\n\n break;\n }\n }\n\n unsafePseudoClasses.forEach(function (unsafePseudoClass) {\n console.error(\"The pseudo class \\\"\" + unsafePseudoClass + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + unsafePseudoClass.split('-child')[0] + \"-of-type\\\".\");\n });\n }\n };\n};\n\nvar isImportRule = function isImportRule(element) {\n return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;\n};\n\nvar isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {\n for (var i = index - 1; i >= 0; i--) {\n if (!isImportRule(children[i])) {\n return true;\n }\n }\n\n return false;\n}; // use this to remove incorrect elements from further processing\n// so they don't get handed to the `sheet` (or anything else)\n// as that could potentially lead to additional logs which in turn could be overhelming to the user\n\n\nvar nullifyElement = function nullifyElement(element) {\n element.type = '';\n element.value = '';\n element[\"return\"] = '';\n element.children = '';\n element.props = '';\n};\n\nvar incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {\n if (!isImportRule(element)) {\n return;\n }\n\n if (element.parent) {\n console.error(\"`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.\");\n nullifyElement(element);\n } else if (isPrependedWithRegularRules(index, children)) {\n console.error(\"`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.\");\n nullifyElement(element);\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (process.env.NODE_ENV !== 'production' && !key) {\n throw new Error(\"You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\\n\" + \"If multiple caches share the same key they might \\\"fight\\\" for each other's style elements.\");\n }\n\n if (key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' '); // $FlowFixMe\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n if (process.env.NODE_ENV !== 'production') {\n omnipresentPlugins.push(createUnsafeSelectorsAlarm({\n get compat() {\n return cache.compat;\n }\n\n }), incorrectImportAlarm);\n }\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {\n if (!element.root) {\n if (element[\"return\"]) {\n currentSheet.insert(element[\"return\"]);\n } else if (element.value && element.type !== COMMENT) {\n // insert empty rule in non-production environments\n // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet\n currentSheet.insert(element.value + \"{}\");\n }\n }\n } : rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n currentSheet = {\n insert: function insert(rule) {\n sheet.insert(rule + serialized.map);\n }\n };\n }\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","import * as React from 'react';\nimport { useContext, forwardRef } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar isBrowser = \"object\" !== 'undefined';\nvar hasOwn = {}.hasOwnProperty;\n\nvar EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nif (process.env.NODE_ENV !== 'production') {\n EmotionCacheContext.displayName = 'EmotionCacheContext';\n}\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache(func) {\n // $FlowFixMe\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nif (!isBrowser) {\n withEmotionCache = function withEmotionCache(func) {\n return function (props) {\n var cache = useContext(EmotionCacheContext);\n\n if (cache === null) {\n // yes, we're potentially creating this on every render\n // it doesn't actually matter though since it's only on the server\n // so there will only every be a single render\n // that could change in the future because of suspense and etc. but for now,\n // this works and i don't want to optimise for a future thing that we aren't sure about\n cache = createCache({\n key: 'css'\n });\n return /*#__PURE__*/React.createElement(EmotionCacheContext.Provider, {\n value: cache\n }, func(props, cache));\n } else {\n return func(props, cache);\n }\n };\n };\n}\n\nvar ThemeContext = /* #__PURE__ */React.createContext({});\n\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'EmotionThemeContext';\n}\n\nvar useTheme = function useTheme() {\n return React.useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {\n throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');\n }\n\n return mergedTheme;\n }\n\n if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {\n throw new Error('[ThemeProvider] Please make your theme prop a plain object');\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = React.useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/React.createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n\n var render = function render(props, ref) {\n var theme = React.useContext(ThemeContext);\n return /*#__PURE__*/React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n }; // $FlowFixMe\n\n\n var WithTheme = /*#__PURE__*/React.forwardRef(render);\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar getLastPart = function getLastPart(functionName) {\n // The match may be something like 'Object.createEmotionProps' or\n // 'Loader.prototype.render'\n var parts = functionName.split('.');\n return parts[parts.length - 1];\n};\n\nvar getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {\n // V8\n var match = /^\\s+at\\s+([A-Za-z0-9$.]+)\\s/.exec(line);\n if (match) return getLastPart(match[1]); // Safari / Firefox\n\n match = /^([A-Za-z0-9$.]+)@/.exec(line);\n if (match) return getLastPart(match[1]);\n return undefined;\n};\n\nvar internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS\n// identifiers, thus we only need to replace what is a valid character for JS,\n// but not for CSS.\n\nvar sanitizeIdentifier = function sanitizeIdentifier(identifier) {\n return identifier.replace(/\\$/g, '-');\n};\n\nvar getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {\n if (!stackTrace) return undefined;\n var lines = stackTrace.split('\\n');\n\n for (var i = 0; i < lines.length; i++) {\n var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just \"Error\"\n\n if (!functionName) continue; // If we reach one of these, we have gone too far and should quit\n\n if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an\n // uppercase letter\n\n if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);\n }\n\n return undefined;\n};\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' && // check if there is a css declaration\n props.css.indexOf(':') !== -1) {\n throw new Error(\"Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`\" + props.css + \"`\");\n }\n\n var newProps = {};\n\n for (var key in props) {\n if (hasOwn.call(props, key)) {\n newProps[key] = props[key];\n }\n }\n\n newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when\n // the label hasn't already been computed\n\n if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {\n var label = getLabelFromStackTrace(new Error().stack);\n if (label) newProps[labelPropName] = label;\n }\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));\n\n if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {\n var labelFromStack = props[labelPropName];\n\n if (labelFromStack) {\n serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);\n }\n }\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var key in props) {\n if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {\n newProps[key] = props[key];\n }\n }\n\n newProps.ref = ref;\n newProps.className = className;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Emotion.displayName = 'EmotionCssPropInternal';\n}\n\nvar Emotion$1 = Emotion;\n\nexport { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwn as h, isBrowser as i, useTheme as u, withEmotionCache as w };\n","import { h as hasOwn, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, i as isBrowser$1 } from './emotion-element-43c6fea0.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-43c6fea0.browser.esm.js';\nimport * as React from 'react';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { serializeStyles } from '@emotion/serialize';\nimport '@emotion/cache';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport 'hoist-non-react-statics';\n\nvar pkg = {\n\tname: \"@emotion/react\",\n\tversion: \"11.11.4\",\n\tmain: \"dist/emotion-react.cjs.js\",\n\tmodule: \"dist/emotion-react.esm.js\",\n\tbrowser: {\n\t\t\"./dist/emotion-react.esm.js\": \"./dist/emotion-react.browser.esm.js\"\n\t},\n\texports: {\n\t\t\".\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./dist/emotion-react.worker.esm.js\",\n\t\t\t\tbrowser: \"./dist/emotion-react.browser.esm.js\",\n\t\t\t\t\"default\": \"./dist/emotion-react.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./dist/emotion-react.cjs.mjs\",\n\t\t\t\"default\": \"./dist/emotion-react.cjs.js\"\n\t\t},\n\t\t\"./jsx-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs\",\n\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js\"\n\t\t},\n\t\t\"./_isolated-hnrs\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js\",\n\t\t\t\tbrowser: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js\",\n\t\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs\",\n\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js\"\n\t\t},\n\t\t\"./jsx-dev-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"import\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs\",\n\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\",\n\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\"./macro\": {\n\t\t\ttypes: {\n\t\t\t\t\"import\": \"./macro.d.mts\",\n\t\t\t\t\"default\": \"./macro.d.ts\"\n\t\t\t},\n\t\t\t\"default\": \"./macro.js\"\n\t\t}\n\t},\n\ttypes: \"types/index.d.ts\",\n\tfiles: [\n\t\t\"src\",\n\t\t\"dist\",\n\t\t\"jsx-runtime\",\n\t\t\"jsx-dev-runtime\",\n\t\t\"_isolated-hnrs\",\n\t\t\"types/*.d.ts\",\n\t\t\"macro.*\"\n\t],\n\tsideEffects: false,\n\tauthor: \"Emotion Contributors\",\n\tlicense: \"MIT\",\n\tscripts: {\n\t\t\"test:typescript\": \"dtslint types\"\n\t},\n\tdependencies: {\n\t\t\"@babel/runtime\": \"^7.18.3\",\n\t\t\"@emotion/babel-plugin\": \"^11.11.0\",\n\t\t\"@emotion/cache\": \"^11.11.0\",\n\t\t\"@emotion/serialize\": \"^1.1.3\",\n\t\t\"@emotion/use-insertion-effect-with-fallbacks\": \"^1.0.1\",\n\t\t\"@emotion/utils\": \"^1.2.1\",\n\t\t\"@emotion/weak-memoize\": \"^0.3.1\",\n\t\t\"hoist-non-react-statics\": \"^3.3.1\"\n\t},\n\tpeerDependencies: {\n\t\treact: \">=16.8.0\"\n\t},\n\tpeerDependenciesMeta: {\n\t\t\"@types/react\": {\n\t\t\toptional: true\n\t\t}\n\t},\n\tdevDependencies: {\n\t\t\"@definitelytyped/dtslint\": \"0.0.112\",\n\t\t\"@emotion/css\": \"11.11.2\",\n\t\t\"@emotion/css-prettifier\": \"1.1.3\",\n\t\t\"@emotion/server\": \"11.11.0\",\n\t\t\"@emotion/styled\": \"11.11.0\",\n\t\t\"html-tag-names\": \"^1.1.2\",\n\t\treact: \"16.14.0\",\n\t\t\"svg-tag-names\": \"^1.1.1\",\n\t\ttypescript: \"^4.5.5\"\n\t},\n\trepository: \"https://github.com/emotion-js/emotion/tree/main/packages/react\",\n\tpublishConfig: {\n\t\taccess: \"public\"\n\t},\n\t\"umd:main\": \"dist/emotion-react.umd.min.js\",\n\tpreconstruct: {\n\t\tentrypoints: [\n\t\t\t\"./index.js\",\n\t\t\t\"./jsx-runtime.js\",\n\t\t\t\"./jsx-dev-runtime.js\",\n\t\t\t\"./_isolated-hnrs.js\"\n\t\t],\n\t\tumdName: \"emotionReact\",\n\t\texports: {\n\t\t\tenvConditions: [\n\t\t\t\t\"browser\",\n\t\t\t\t\"worker\"\n\t\t\t],\n\t\t\textra: {\n\t\t\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\t\t\"./macro\": {\n\t\t\t\t\ttypes: {\n\t\t\t\t\t\t\"import\": \"./macro.d.mts\",\n\t\t\t\t\t\t\"default\": \"./macro.d.ts\"\n\t\t\t\t\t},\n\t\t\t\t\t\"default\": \"./macro.js\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar jsx = function jsx(type, props) {\n var args = arguments;\n\n if (props == null || !hasOwn.call(props, 'css')) {\n // $FlowFixMe\n return React.createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n } // $FlowFixMe\n\n\n return React.createElement.apply(null, createElementArgArray);\n};\n\nvar warnedAboutCssPropForGlobal = false; // maintain place over rerenders.\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is\n // probably using the custom createElement which\n // means it will be turned into a className prop\n // $FlowFixMe I don't really want to add it to the type since it shouldn't be used\n props.className || props.css)) {\n console.error(\"It looks like you're using the css prop on Global, did you mean to use the styles prop instead?\");\n warnedAboutCssPropForGlobal = true;\n }\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));\n\n if (!isBrowser$1) {\n var _ref;\n\n var serializedNames = serialized.name;\n var serializedStyles = serialized.styles;\n var next = serialized.next;\n\n while (next !== undefined) {\n serializedNames += ' ' + next.name;\n serializedStyles += next.styles;\n next = next.next;\n }\n\n var shouldCache = cache.compat === true;\n var rules = cache.insert(\"\", {\n name: serializedNames,\n styles: serializedStyles\n }, cache.sheet, shouldCache);\n\n if (shouldCache) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"style\", (_ref = {}, _ref[\"data-emotion\"] = cache.key + \"-global \" + serializedNames, _ref.dangerouslySetInnerHTML = {\n __html: rules\n }, _ref.nonce = cache.sheet.nonce, _ref));\n } // yes, i know these hooks are used conditionally\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = React.useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false; // $FlowFixMe\n\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Global.displayName = 'EmotionGlobal';\n}\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nvar keyframes = function keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name; // $FlowFixMe\n\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n};\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {\n console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.');\n }\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: React.useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nif (process.env.NODE_ENV !== 'production') {\n ClassNames.displayName = 'EmotionClassNames';\n}\n\nif (process.env.NODE_ENV !== 'production') {\n var isBrowser = \"object\" !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked\n\n var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';\n\n if (isBrowser && !isTestEnv) {\n // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later\n var globalContext = // $FlowIgnore\n typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef\n : isBrowser ? window : global;\n var globalKey = \"__EMOTION_REACT_\" + pkg.version.split('.')[0] + \"__\";\n\n if (globalContext[globalKey]) {\n console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');\n }\n\n globalContext[globalKey] = true;\n }\n}\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\\(|(no-)?(open|close)-quote/;\n var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n throw new Error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error(noComponentSelectorMessage);\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n return cached !== undefined ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*(;|$)/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//g;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport { murmur2 as default };\n","var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n","import * as React from 'react';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n","var isBrowser = \"object\" !== 'undefined';\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","//\n// Main\n//\nexport function memoize(fn, options) {\n var cache = options && options.cache ? options.cache : cacheDefault;\n var serializer = options && options.serializer ? options.serializer : serializerDefault;\n var strategy = options && options.strategy ? options.strategy : strategyDefault;\n return strategy(fn, {\n cache: cache,\n serializer: serializer,\n });\n}\n//\n// Strategy\n//\nfunction isPrimitive(value) {\n return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\nfunction monadic(fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3);\n var cacheKey = serializer(args);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n return strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic;\n return assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n return assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n return assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\n//\n// Serializer\n//\nvar serializerDefault = function () {\n return JSON.stringify(arguments);\n};\n//\n// Cache\n//\nvar ObjectWithoutPrototypeCache = /** @class */ (function () {\n function ObjectWithoutPrototypeCache() {\n this.cache = Object.create(null);\n }\n ObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key];\n };\n ObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value;\n };\n return ObjectWithoutPrototypeCache;\n}());\nvar cacheDefault = {\n create: function create() {\n return new ObjectWithoutPrototypeCache();\n },\n};\nexport var strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic,\n};\n","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `foo) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","// @generated from regex-gen.ts\nexport var SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: milliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","// @generated from regex-gen.ts\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import { __assign } from \"tslib\";\nimport { WHITE_SPACE_REGEX } from './regex.generated';\nexport function parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n case 'rounding-mode-floor':\n result.roundingMode = 'floor';\n continue;\n case 'rounding-mode-ceiling':\n result.roundingMode = 'ceil';\n continue;\n case 'rounding-mode-down':\n result.roundingMode = 'trunc';\n continue;\n case 'rounding-mode-up':\n result.roundingMode = 'expand';\n continue;\n case 'rounding-mode-half-even':\n result.roundingMode = 'halfEven';\n continue;\n case 'rounding-mode-half-down':\n result.roundingMode = 'halfTrunc';\n continue;\n case 'rounding-mode-half-up':\n result.roundingMode = 'halfExpand';\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = __assign(__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = __assign(__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","// @generated from time-data-gen.ts\n// prettier-ignore \nexport var timeData = {\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"419\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"AX\": [\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BI\": [\n \"H\",\n \"h\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"BO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BY\": [\n \"H\",\n \"h\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CL\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"CW\": [\n \"H\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EC\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FO\": [\n \"H\",\n \"h\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GL\": [\n \"H\",\n \"h\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GT\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HN\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"HU\": [\n \"H\",\n \"h\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JP\": [\n \"H\",\n \"K\",\n \"h\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MG\": [\n \"H\",\n \"h\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MT\": [\n \"H\",\n \"h\"\n ],\n \"MU\": [\n \"H\",\n \"h\"\n ],\n \"MV\": [\n \"H\",\n \"h\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MX\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NI\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"NO\": [\n \"H\",\n \"h\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PL\": [\n \"H\",\n \"h\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"PY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"RW\": [\n \"H\",\n \"h\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"SV\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TH\": [\n \"H\",\n \"h\"\n ],\n \"TJ\": [\n \"H\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TM\": [\n \"H\",\n \"h\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VN\": [\n \"H\",\n \"h\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZW\": [\n \"H\",\n \"h\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-HK\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-IL\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"en-MY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ]\n};\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith && '_a'.startsWith('a', 1);\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","import { timeData } from './time-data.generated';\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[\"\".concat(languageTag, \"-001\")] ||\n timeData['001'];\n return hourCycles[0];\n}\n","import { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { Parser } from './parser';\nimport { isDateElement, isDateTimeSkeleton, isNumberElement, isNumberSkeleton, isPluralElement, isSelectElement, isTagElement, isTimeElement, } from './types';\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if (isSelectElement(el) || isPluralElement(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location;\n }\n else if ((isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)) {\n delete el.style.location;\n }\n else if (isTagElement(el)) {\n pruneLocation(el.children);\n }\n });\n}\nexport function parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\nexport * from './types';\n// only for testing\nexport var _Parser = Parser;\nexport { isStructurallySame } from './manipulator';\n","import { __extends } from \"tslib\";\nexport var IntlErrorCode;\n(function (IntlErrorCode) {\n IntlErrorCode[\"FORMAT_ERROR\"] = \"FORMAT_ERROR\";\n IntlErrorCode[\"UNSUPPORTED_FORMATTER\"] = \"UNSUPPORTED_FORMATTER\";\n IntlErrorCode[\"INVALID_CONFIG\"] = \"INVALID_CONFIG\";\n IntlErrorCode[\"MISSING_DATA\"] = \"MISSING_DATA\";\n IntlErrorCode[\"MISSING_TRANSLATION\"] = \"MISSING_TRANSLATION\";\n})(IntlErrorCode || (IntlErrorCode = {}));\nvar IntlError = /** @class */ (function (_super) {\n __extends(IntlError, _super);\n function IntlError(code, message, exception) {\n var _this = this;\n var err = exception\n ? exception instanceof Error\n ? exception\n : new Error(String(exception))\n : undefined;\n _this = _super.call(this, \"[@formatjs/intl Error \".concat(code, \"] \").concat(message, \"\\n\").concat(err ? \"\\n\".concat(err.message, \"\\n\").concat(err.stack) : '')) || this;\n _this.code = code;\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (typeof Error.captureStackTrace === 'function') {\n // @ts-ignore just so we don't need to declare dep on @types/node\n Error.captureStackTrace(_this, IntlError);\n }\n return _this;\n }\n return IntlError;\n}(Error));\nexport { IntlError };\nvar UnsupportedFormatterError = /** @class */ (function (_super) {\n __extends(UnsupportedFormatterError, _super);\n function UnsupportedFormatterError(message, exception) {\n return _super.call(this, IntlErrorCode.UNSUPPORTED_FORMATTER, message, exception) || this;\n }\n return UnsupportedFormatterError;\n}(IntlError));\nexport { UnsupportedFormatterError };\nvar InvalidConfigError = /** @class */ (function (_super) {\n __extends(InvalidConfigError, _super);\n function InvalidConfigError(message, exception) {\n return _super.call(this, IntlErrorCode.INVALID_CONFIG, message, exception) || this;\n }\n return InvalidConfigError;\n}(IntlError));\nexport { InvalidConfigError };\nvar MissingDataError = /** @class */ (function (_super) {\n __extends(MissingDataError, _super);\n function MissingDataError(message, exception) {\n return _super.call(this, IntlErrorCode.MISSING_DATA, message, exception) || this;\n }\n return MissingDataError;\n}(IntlError));\nexport { MissingDataError };\nvar IntlFormatError = /** @class */ (function (_super) {\n __extends(IntlFormatError, _super);\n function IntlFormatError(message, locale, exception) {\n var _this = _super.call(this, IntlErrorCode.FORMAT_ERROR, \"\".concat(message, \"\\nLocale: \").concat(locale, \"\\n\"), exception) || this;\n _this.locale = locale;\n return _this;\n }\n return IntlFormatError;\n}(IntlError));\nexport { IntlFormatError };\nvar MessageFormatError = /** @class */ (function (_super) {\n __extends(MessageFormatError, _super);\n function MessageFormatError(message, locale, descriptor, exception) {\n var _this = _super.call(this, \"\".concat(message, \"\\nMessageID: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, \"\\nDefault Message: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, \"\\nDescription: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, \"\\n\"), locale, exception) || this;\n _this.descriptor = descriptor;\n _this.locale = locale;\n return _this;\n }\n return MessageFormatError;\n}(IntlFormatError));\nexport { MessageFormatError };\nvar MissingTranslationError = /** @class */ (function (_super) {\n __extends(MissingTranslationError, _super);\n function MissingTranslationError(descriptor, locale) {\n var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, \"Missing message: \\\"\".concat(descriptor.id, \"\\\" for locale \\\"\").concat(locale, \"\\\", using \").concat(descriptor.defaultMessage\n ? \"default message (\".concat(typeof descriptor.defaultMessage === 'string'\n ? descriptor.defaultMessage\n : descriptor.defaultMessage\n .map(function (e) { var _a; return (_a = e.value) !== null && _a !== void 0 ? _a : JSON.stringify(e); })\n .join(), \")\")\n : 'id', \" as fallback.\")) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MissingTranslationError;\n}(IntlError));\nexport { MissingTranslationError };\n","import { __assign, __spreadArray } from \"tslib\";\nimport { memoize, strategies } from '@formatjs/fast-memoize';\nimport { IntlMessageFormat } from 'intl-messageformat';\nimport { UnsupportedFormatterError } from './error';\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\nexport function filterProps(props, allowlist, defaults) {\n if (defaults === void 0) { defaults = {}; }\n return allowlist.reduce(function (filtered, name) {\n if (name in props) {\n filtered[name] = props[name];\n }\n else if (name in defaults) {\n filtered[name] = defaults[name];\n }\n return filtered;\n }, {});\n}\nvar defaultErrorHandler = function (error) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.error(error);\n }\n};\nvar defaultWarnHandler = function (warning) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n};\nexport var DEFAULT_INTL_CONFIG = {\n formats: {},\n messages: {},\n timeZone: undefined,\n defaultLocale: 'en',\n defaultFormats: {},\n fallbackOnEmptyString: true,\n onError: defaultErrorHandler,\n onWarn: defaultWarnHandler,\n};\nexport function createIntlCache() {\n return {\n dateTime: {},\n number: {},\n message: {},\n relativeTime: {},\n pluralRules: {},\n list: {},\n displayNames: {},\n };\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\n/**\n * Create intl formatters and populate cache\n * @param cache explicit cache to prevent leaking memory\n */\nexport function createFormatters(cache) {\n if (cache === void 0) { cache = createIntlCache(); }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n var ListFormat = Intl.ListFormat;\n var DisplayNames = Intl.DisplayNames;\n var getDateTimeFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n });\n var getNumberFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n });\n var getPluralRules = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n });\n return {\n getDateTimeFormat: getDateTimeFormat,\n getNumberFormat: getNumberFormat,\n getMessageFormat: memoize(function (message, locales, overrideFormats, opts) {\n return new IntlMessageFormat(message, locales, overrideFormats, __assign({ formatters: {\n getNumberFormat: getNumberFormat,\n getDateTimeFormat: getDateTimeFormat,\n getPluralRules: getPluralRules,\n } }, (opts || {})));\n }, {\n cache: createFastMemoizeCache(cache.message),\n strategy: strategies.variadic,\n }),\n getRelativeTimeFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.relativeTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: getPluralRules,\n getListFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.list),\n strategy: strategies.variadic,\n }),\n getDisplayNames: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.displayNames),\n strategy: strategies.variadic,\n }),\n };\n}\nexport function getNamedFormat(formats, type, name, onError) {\n var formatType = formats && formats[type];\n var format;\n if (formatType) {\n format = formatType[name];\n }\n if (format) {\n return format;\n }\n onError(new UnsupportedFormatterError(\"No \".concat(type, \" format named: \").concat(name)));\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nvar DEFAULT_SIZE = 24;\n\nexports.default = function (_ref) {\n var _ref$fill = _ref.fill,\n fill = _ref$fill === undefined ? 'currentColor' : _ref$fill,\n _ref$width = _ref.width,\n width = _ref$width === undefined ? DEFAULT_SIZE : _ref$width,\n _ref$height = _ref.height,\n height = _ref$height === undefined ? DEFAULT_SIZE : _ref$height,\n _ref$style = _ref.style,\n style = _ref$style === undefined ? {} : _ref$style,\n props = _objectWithoutProperties(_ref, ['fill', 'width', 'height', 'style']);\n\n return _react2.default.createElement(\n 'svg',\n _extends({\n viewBox: '0 0 ' + DEFAULT_SIZE + ' ' + DEFAULT_SIZE,\n style: _extends({ fill: fill, width: width, height: height }, style)\n }, props),\n _react2.default.createElement('path', { d: 'M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z' })\n );\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nvar DEFAULT_SIZE = 24;\n\nexports.default = function (_ref) {\n var _ref$fill = _ref.fill,\n fill = _ref$fill === undefined ? 'currentColor' : _ref$fill,\n _ref$width = _ref.width,\n width = _ref$width === undefined ? DEFAULT_SIZE : _ref$width,\n _ref$height = _ref.height,\n height = _ref$height === undefined ? DEFAULT_SIZE : _ref$height,\n _ref$style = _ref.style,\n style = _ref$style === undefined ? {} : _ref$style,\n props = _objectWithoutProperties(_ref, ['fill', 'width', 'height', 'style']);\n\n return _react2.default.createElement(\n 'svg',\n _extends({\n viewBox: '0 0 ' + DEFAULT_SIZE + ' ' + DEFAULT_SIZE,\n style: _extends({ fill: fill, width: width, height: height }, style)\n }, props),\n _react2.default.createElement('path', { d: 'M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z' })\n );\n};","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HttpTransportType } from \"./ITransport\";\r\n\r\n/** Error thrown when an HTTP request fails. */\r\nexport class HttpError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The HTTP status code represented by this error. */\r\n public statusCode: number;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n * @param {number} statusCode The HTTP status code represented by this error.\r\n */\r\n constructor(errorMessage: string, statusCode: number) {\r\n const trueProto = new.target.prototype;\r\n super(`${errorMessage}: Status code '${statusCode}'`);\r\n this.statusCode = statusCode;\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when a timeout elapses. */\r\nexport class TimeoutError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.TimeoutError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n constructor(errorMessage: string = \"A timeout occurred.\") {\r\n const trueProto = new.target.prototype;\r\n super(errorMessage);\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when an action is aborted. */\r\nexport class AbortError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** Constructs a new instance of {@link AbortError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n constructor(errorMessage: string = \"An abort occurred.\") {\r\n const trueProto = new.target.prototype;\r\n super(errorMessage);\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the selected transport is unsupported by the browser. */\r\n/** @private */\r\nexport class UnsupportedTransportError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r\n public transport: HttpTransportType;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.UnsupportedTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message: string, transport: HttpTransportType) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'UnsupportedTransportError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the selected transport is disabled by the browser. */\r\n/** @private */\r\nexport class DisabledTransportError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r\n public transport: HttpTransportType;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.DisabledTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message: string, transport: HttpTransportType) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'DisabledTransportError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the selected transport cannot be started. */\r\n/** @private */\r\nexport class FailedToStartTransportError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r\n public transport: HttpTransportType;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.FailedToStartTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message: string, transport: HttpTransportType) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'FailedToStartTransportError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the negotiation with the server failed to complete. */\r\n/** @private */\r\nexport class FailedToNegotiateWithServerError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.FailedToNegotiateWithServerError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n */\r\n constructor(message: string) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.errorType = 'FailedToNegotiateWithServerError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when multiple errors have occurred. */\r\n/** @private */\r\nexport class AggregateErrors extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The collection of errors this error is aggregating. */\r\n public innerErrors: Error[];\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.AggregateErrors}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {Error[]} innerErrors The collection of errors this error is aggregating.\r\n */\r\n constructor(message: string, innerErrors: Error[]) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n\r\n this.innerErrors = innerErrors;\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortSignal } from \"./AbortController\";\r\nimport { MessageHeaders } from \"./IHubProtocol\";\r\n\r\n/** Represents an HTTP request. */\r\nexport interface HttpRequest {\r\n /** The HTTP method to use for the request. */\r\n method?: string;\r\n\r\n /** The URL for the request. */\r\n url?: string;\r\n\r\n /** The body content for the request. May be a string or an ArrayBuffer (for binary data). */\r\n content?: string | ArrayBuffer;\r\n\r\n /** An object describing headers to apply to the request. */\r\n headers?: MessageHeaders;\r\n\r\n /** The XMLHttpRequestResponseType to apply to the request. */\r\n responseType?: XMLHttpRequestResponseType;\r\n\r\n /** An AbortSignal that can be monitored for cancellation. */\r\n abortSignal?: AbortSignal;\r\n\r\n /** The time to wait for the request to complete before throwing a TimeoutError. Measured in milliseconds. */\r\n timeout?: number;\r\n\r\n /** This controls whether credentials such as cookies are sent in cross-site requests. */\r\n withCredentials?: boolean;\r\n}\r\n\r\n/** Represents an HTTP response. */\r\nexport class HttpResponse {\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n */\r\n constructor(statusCode: number);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code and message.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n */\r\n constructor(statusCode: number, statusText: string);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and string content.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n * @param {string} content The content of the response.\r\n */\r\n constructor(statusCode: number, statusText: string, content: string);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and binary content.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n * @param {ArrayBuffer} content The content of the response.\r\n */\r\n constructor(statusCode: number, statusText: string, content: ArrayBuffer);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and binary content.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n * @param {string | ArrayBuffer} content The content of the response.\r\n */\r\n constructor(statusCode: number, statusText: string, content: string | ArrayBuffer);\r\n constructor(\r\n public readonly statusCode: number,\r\n public readonly statusText?: string,\r\n public readonly content?: string | ArrayBuffer) {\r\n }\r\n}\r\n\r\n/** Abstraction over an HTTP client.\r\n *\r\n * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.\r\n */\r\nexport abstract class HttpClient {\r\n /** Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public get(url: string): Promise;\r\n\r\n /** Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r\n * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public get(url: string, options: HttpRequest): Promise;\r\n public get(url: string, options?: HttpRequest): Promise {\r\n return this.send({\r\n ...options,\r\n method: \"GET\",\r\n url,\r\n });\r\n }\r\n\r\n /** Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public post(url: string): Promise;\r\n\r\n /** Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r\n * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public post(url: string, options: HttpRequest): Promise;\r\n public post(url: string, options?: HttpRequest): Promise {\r\n return this.send({\r\n ...options,\r\n method: \"POST\",\r\n url,\r\n });\r\n }\r\n\r\n /** Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public delete(url: string): Promise;\r\n\r\n /** Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r\n * @returns {Promise} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public delete(url: string, options: HttpRequest): Promise;\r\n public delete(url: string, options?: HttpRequest): Promise {\r\n return this.send({\r\n ...options,\r\n method: \"DELETE\",\r\n url,\r\n });\r\n }\r\n\r\n /** Issues an HTTP request to the specified URL, returning a {@link Promise} that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {HttpRequest} request An {@link @microsoft/signalr.HttpRequest} describing the request to send.\r\n * @returns {Promise} A Promise that resolves with an HttpResponse describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public abstract send(request: HttpRequest): Promise;\r\n\r\n /** Gets all cookies that apply to the specified URL.\r\n *\r\n * @param url The URL that the cookies are valid for.\r\n * @returns {string} A string containing all the key-value cookie pairs for the specified URL.\r\n */\r\n // @ts-ignore\r\n public getCookieString(url: string): string {\r\n return \"\";\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here.\r\n/** Indicates the severity of a log message.\r\n *\r\n * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc.\r\n */\r\nexport enum LogLevel {\r\n /** Log level for very low severity diagnostic messages. */\r\n Trace = 0,\r\n /** Log level for low severity diagnostic messages. */\r\n Debug = 1,\r\n /** Log level for informational diagnostic messages. */\r\n Information = 2,\r\n /** Log level for diagnostic messages that indicate a non-fatal problem. */\r\n Warning = 3,\r\n /** Log level for diagnostic messages that indicate a failure in the current operation. */\r\n Error = 4,\r\n /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */\r\n Critical = 5,\r\n /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */\r\n None = 6,\r\n}\r\n\r\n/** An abstraction that provides a sink for diagnostic messages. */\r\nexport interface ILogger {\r\n /** Called by the framework to emit a diagnostic message.\r\n *\r\n * @param {LogLevel} logLevel The severity level of the message.\r\n * @param {string} message The message.\r\n */\r\n log(logLevel: LogLevel, message: string): void;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\n\r\n/** A logger that does nothing when log messages are sent to it. */\r\nexport class NullLogger implements ILogger {\r\n /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */\r\n public static instance: ILogger = new NullLogger();\r\n\r\n private constructor() {}\r\n\r\n /** @inheritDoc */\r\n // eslint-disable-next-line\r\n public log(_logLevel: LogLevel, _message: string): void {\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { IStreamSubscriber, ISubscription } from \"./Stream\";\r\nimport { Subject } from \"./Subject\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\n\r\n// Version token that will be replaced by the prepack command\r\n/** The version of the SignalR client. */\r\n\r\nexport const VERSION: string = \"0.0.0-DEV_BUILD\";\r\n/** @private */\r\nexport class Arg {\r\n public static isRequired(val: any, name: string): void {\r\n if (val === null || val === undefined) {\r\n throw new Error(`The '${name}' argument is required.`);\r\n }\r\n }\r\n public static isNotEmpty(val: string, name: string): void {\r\n if (!val || val.match(/^\\s*$/)) {\r\n throw new Error(`The '${name}' argument should not be empty.`);\r\n }\r\n }\r\n\r\n public static isIn(val: any, values: any, name: string): void {\r\n // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself.\r\n if (!(val in values)) {\r\n throw new Error(`Unknown ${name} value: ${val}.`);\r\n }\r\n }\r\n}\r\n\r\n/** @private */\r\nexport class Platform {\r\n // react-native has a window but no document so we should check both\r\n public static get isBrowser(): boolean {\r\n return !Platform.isNode && typeof window === \"object\" && typeof window.document === \"object\";\r\n }\r\n\r\n // WebWorkers don't have a window object so the isBrowser check would fail\r\n public static get isWebWorker(): boolean {\r\n return !Platform.isNode && typeof self === \"object\" && \"importScripts\" in self;\r\n }\r\n\r\n // react-native has a window but no document\r\n static get isReactNative(): boolean {\r\n return !Platform.isNode && typeof window === \"object\" && typeof window.document === \"undefined\";\r\n }\r\n\r\n // Node apps shouldn't have a window object, but WebWorkers don't either\r\n // so we need to check for both WebWorker and window\r\n public static get isNode(): boolean {\r\n return typeof process !== \"undefined\" && process.release && process.release.name === \"node\";\r\n }\r\n}\r\n\r\n/** @private */\r\nexport function getDataDetail(data: any, includeContent: boolean): string {\r\n let detail = \"\";\r\n if (isArrayBuffer(data)) {\r\n detail = `Binary data of length ${data.byteLength}`;\r\n if (includeContent) {\r\n detail += `. Content: '${formatArrayBuffer(data)}'`;\r\n }\r\n } else if (typeof data === \"string\") {\r\n detail = `String data of length ${data.length}`;\r\n if (includeContent) {\r\n detail += `. Content: '${data}'`;\r\n }\r\n }\r\n return detail;\r\n}\r\n\r\n/** @private */\r\nexport function formatArrayBuffer(data: ArrayBuffer): string {\r\n const view = new Uint8Array(data);\r\n\r\n // Uint8Array.map only supports returning another Uint8Array?\r\n let str = \"\";\r\n view.forEach((num) => {\r\n const pad = num < 16 ? \"0\" : \"\";\r\n str += `0x${pad}${num.toString(16)} `;\r\n });\r\n\r\n // Trim of trailing space.\r\n return str.substr(0, str.length - 1);\r\n}\r\n\r\n// Also in signalr-protocol-msgpack/Utils.ts\r\n/** @private */\r\nexport function isArrayBuffer(val: any): val is ArrayBuffer {\r\n return val && typeof ArrayBuffer !== \"undefined\" &&\r\n (val instanceof ArrayBuffer ||\r\n // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof\r\n (val.constructor && val.constructor.name === \"ArrayBuffer\"));\r\n}\r\n\r\n/** @private */\r\nexport async function sendMessage(logger: ILogger, transportName: string, httpClient: HttpClient, url: string,\r\n content: string | ArrayBuffer, options: IHttpConnectionOptions): Promise {\r\n const headers: {[k: string]: string} = {};\r\n\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n logger.log(LogLevel.Trace, `(${transportName} transport) sending data. ${getDataDetail(content, options.logMessageContent!)}.`);\r\n\r\n const responseType = isArrayBuffer(content) ? \"arraybuffer\" : \"text\";\r\n const response = await httpClient.post(url, {\r\n content,\r\n headers: { ...headers, ...options.headers},\r\n responseType,\r\n timeout: options.timeout,\r\n withCredentials: options.withCredentials,\r\n });\r\n\r\n logger.log(LogLevel.Trace, `(${transportName} transport) request complete. Response status: ${response.statusCode}.`);\r\n}\r\n\r\n/** @private */\r\nexport function createLogger(logger?: ILogger | LogLevel): ILogger {\r\n if (logger === undefined) {\r\n return new ConsoleLogger(LogLevel.Information);\r\n }\r\n\r\n if (logger === null) {\r\n return NullLogger.instance;\r\n }\r\n\r\n if ((logger as ILogger).log !== undefined) {\r\n return logger as ILogger;\r\n }\r\n\r\n return new ConsoleLogger(logger as LogLevel);\r\n}\r\n\r\n/** @private */\r\nexport class SubjectSubscription implements ISubscription {\r\n private _subject: Subject;\r\n private _observer: IStreamSubscriber;\r\n\r\n constructor(subject: Subject, observer: IStreamSubscriber) {\r\n this._subject = subject;\r\n this._observer = observer;\r\n }\r\n\r\n public dispose(): void {\r\n const index: number = this._subject.observers.indexOf(this._observer);\r\n if (index > -1) {\r\n this._subject.observers.splice(index, 1);\r\n }\r\n\r\n if (this._subject.observers.length === 0 && this._subject.cancelCallback) {\r\n this._subject.cancelCallback().catch((_) => { });\r\n }\r\n }\r\n}\r\n\r\n/** @private */\r\nexport class ConsoleLogger implements ILogger {\r\n private readonly _minLevel: LogLevel;\r\n\r\n // Public for testing purposes.\r\n public out: {\r\n error(message: any): void,\r\n warn(message: any): void,\r\n info(message: any): void,\r\n log(message: any): void,\r\n };\r\n\r\n constructor(minimumLogLevel: LogLevel) {\r\n this._minLevel = minimumLogLevel;\r\n this.out = console;\r\n }\r\n\r\n public log(logLevel: LogLevel, message: string): void {\r\n if (logLevel >= this._minLevel) {\r\n const msg = `[${new Date().toISOString()}] ${LogLevel[logLevel]}: ${message}`;\r\n switch (logLevel) {\r\n case LogLevel.Critical:\r\n case LogLevel.Error:\r\n this.out.error(msg);\r\n break;\r\n case LogLevel.Warning:\r\n this.out.warn(msg);\r\n break;\r\n case LogLevel.Information:\r\n this.out.info(msg);\r\n break;\r\n default:\r\n // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug\r\n this.out.log(msg);\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** @private */\r\nexport function getUserAgentHeader(): [string, string] {\r\n let userAgentHeaderName = \"X-SignalR-User-Agent\";\r\n if (Platform.isNode) {\r\n userAgentHeaderName = \"User-Agent\";\r\n }\r\n return [ userAgentHeaderName, constructUserAgent(VERSION, getOsName(), getRuntime(), getRuntimeVersion()) ];\r\n}\r\n\r\n/** @private */\r\nexport function constructUserAgent(version: string, os: string, runtime: string, runtimeVersion: string | undefined): string {\r\n // Microsoft SignalR/[Version] ([Detailed Version]; [Operating System]; [Runtime]; [Runtime Version])\r\n let userAgent: string = \"Microsoft SignalR/\";\r\n\r\n const majorAndMinor = version.split(\".\");\r\n userAgent += `${majorAndMinor[0]}.${majorAndMinor[1]}`;\r\n userAgent += ` (${version}; `;\r\n\r\n if (os && os !== \"\") {\r\n userAgent += `${os}; `;\r\n } else {\r\n userAgent += \"Unknown OS; \";\r\n }\r\n\r\n userAgent += `${runtime}`;\r\n\r\n if (runtimeVersion) {\r\n userAgent += `; ${runtimeVersion}`;\r\n } else {\r\n userAgent += \"; Unknown Runtime Version\";\r\n }\r\n\r\n userAgent += \")\";\r\n return userAgent;\r\n}\r\n\r\n// eslint-disable-next-line spaced-comment\r\n/*#__PURE__*/ function getOsName(): string {\r\n if (Platform.isNode) {\r\n switch (process.platform) {\r\n case \"win32\":\r\n return \"Windows NT\";\r\n case \"darwin\":\r\n return \"macOS\";\r\n case \"linux\":\r\n return \"Linux\";\r\n default:\r\n return process.platform;\r\n }\r\n } else {\r\n return \"\";\r\n }\r\n}\r\n\r\n// eslint-disable-next-line spaced-comment\r\n/*#__PURE__*/ function getRuntimeVersion(): string | undefined {\r\n if (Platform.isNode) {\r\n return process.versions.node;\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction getRuntime(): string {\r\n if (Platform.isNode) {\r\n return \"NodeJS\";\r\n } else {\r\n return \"Browser\";\r\n }\r\n}\r\n\r\n/** @private */\r\nexport function getErrorString(e: any): string {\r\n if (e.stack) {\r\n return e.stack;\r\n } else if (e.message) {\r\n return e.message;\r\n }\r\n return `${e}`;\r\n}\r\n\r\n/** @private */\r\nexport function getGlobalThis(): unknown {\r\n // globalThis is semi-new and not available in Node until v12\r\n if (typeof globalThis !== \"undefined\") {\r\n return globalThis;\r\n }\r\n if (typeof self !== \"undefined\") {\r\n return self;\r\n }\r\n if (typeof window !== \"undefined\") {\r\n return window;\r\n }\r\n if (typeof global !== \"undefined\") {\r\n return global;\r\n }\r\n throw new Error(\"could not find global\");\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// @ts-ignore: This will be removed from built files and is here to make the types available during dev work\r\nimport { CookieJar } from \"@types/tough-cookie\";\r\n\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { Platform, getGlobalThis, isArrayBuffer } from \"./Utils\";\r\nimport { configureAbortController, configureFetch } from \"./DynamicImports\";\r\n\r\nexport class FetchHttpClient extends HttpClient {\r\n private readonly _abortControllerType: { prototype: AbortController, new(): AbortController };\r\n private readonly _fetchType: (input: RequestInfo, init?: RequestInit) => Promise;\r\n private readonly _jar?: CookieJar;\r\n\r\n private readonly _logger: ILogger;\r\n\r\n public constructor(logger: ILogger) {\r\n super();\r\n this._logger = logger;\r\n\r\n // This is how you do \"reference\" arguments\r\n const fetchObj = { _fetchType: undefined, _jar: undefined };\r\n if (configureFetch(fetchObj)) {\r\n this._fetchType = fetchObj._fetchType!;\r\n this._jar = fetchObj._jar;\r\n } else {\r\n this._fetchType = fetch.bind(getGlobalThis());\r\n }\r\n\r\n this._abortControllerType = AbortController;\r\n const abortObj = { _abortControllerType: this._abortControllerType };\r\n if (configureAbortController(abortObj)) {\r\n this._abortControllerType = abortObj._abortControllerType;\r\n }\r\n }\r\n\r\n /** @inheritDoc */\r\n public async send(request: HttpRequest): Promise {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n throw new AbortError();\r\n }\r\n\r\n if (!request.method) {\r\n throw new Error(\"No method defined.\");\r\n }\r\n if (!request.url) {\r\n throw new Error(\"No url defined.\");\r\n }\r\n\r\n const abortController = new this._abortControllerType();\r\n\r\n let error: any;\r\n // Hook our abortSignal into the abort controller\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = () => {\r\n abortController.abort();\r\n error = new AbortError();\r\n };\r\n }\r\n\r\n // If a timeout has been passed in, setup a timeout to call abort\r\n // Type needs to be any to fit window.setTimeout and NodeJS.setTimeout\r\n let timeoutId: any = null;\r\n if (request.timeout) {\r\n const msTimeout = request.timeout!;\r\n timeoutId = setTimeout(() => {\r\n abortController.abort();\r\n this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r\n error = new TimeoutError();\r\n }, msTimeout);\r\n }\r\n\r\n if (request.content === \"\") {\r\n request.content = undefined;\r\n }\r\n if (request.content) {\r\n // Explicitly setting the Content-Type header for React Native on Android platform.\r\n request.headers = request.headers || {};\r\n if (isArrayBuffer(request.content)) {\r\n request.headers[\"Content-Type\"] = \"application/octet-stream\";\r\n } else {\r\n request.headers[\"Content-Type\"] = \"text/plain;charset=UTF-8\";\r\n }\r\n }\r\n\r\n let response: Response;\r\n try {\r\n response = await this._fetchType(request.url!, {\r\n body: request.content,\r\n cache: \"no-cache\",\r\n credentials: request.withCredentials === true ? \"include\" : \"same-origin\",\r\n headers: {\r\n \"X-Requested-With\": \"XMLHttpRequest\",\r\n ...request.headers,\r\n },\r\n method: request.method!,\r\n mode: \"cors\",\r\n redirect: \"follow\",\r\n signal: abortController.signal,\r\n });\r\n } catch (e) {\r\n if (error) {\r\n throw error;\r\n }\r\n this._logger.log(\r\n LogLevel.Warning,\r\n `Error from HTTP request. ${e}.`,\r\n );\r\n throw e;\r\n } finally {\r\n if (timeoutId) {\r\n clearTimeout(timeoutId);\r\n }\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n }\r\n\r\n if (!response.ok) {\r\n const errorMessage = await deserializeContent(response, \"text\") as string;\r\n throw new HttpError(errorMessage || response.statusText, response.status);\r\n }\r\n\r\n const content = deserializeContent(response, request.responseType);\r\n const payload = await content;\r\n\r\n return new HttpResponse(\r\n response.status,\r\n response.statusText,\r\n payload,\r\n );\r\n }\r\n\r\n public getCookieString(url: string): string {\r\n let cookies: string = \"\";\r\n if (Platform.isNode && this._jar) {\r\n // @ts-ignore: unused variable\r\n this._jar.getCookies(url, (e, c) => cookies = c.join(\"; \"));\r\n }\r\n return cookies;\r\n }\r\n}\r\n\r\nfunction deserializeContent(response: Response, responseType?: XMLHttpRequestResponseType): Promise {\r\n let content;\r\n switch (responseType) {\r\n case \"arraybuffer\":\r\n content = response.arrayBuffer();\r\n break;\r\n case \"text\":\r\n content = response.text();\r\n break;\r\n case \"blob\":\r\n case \"document\":\r\n case \"json\":\r\n throw new Error(`${responseType} is not supported.`);\r\n default:\r\n content = response.text();\r\n break;\r\n }\r\n\r\n return content;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// @ts-ignore: This will be removed from built files and is here to make the types available during dev work\r\nimport { CookieJar } from \"@types/tough-cookie\";\r\nimport { Platform } from \"./Utils\";\r\n\r\n/** @private */\r\nexport function configureFetch(obj: { _fetchType?: (input: RequestInfo, init?: RequestInit) => Promise,\r\n _jar?: CookieJar }): boolean\r\n{\r\n // Node added a fetch implementation to the global scope starting in v18.\r\n // We need to add a cookie jar in node to be able to share cookies with WebSocket\r\n if (typeof fetch === \"undefined\" || Platform.isNode) {\r\n // Cookies aren't automatically handled in Node so we need to add a CookieJar to preserve cookies across requests\r\n // eslint-disable-next-line @typescript-eslint/no-var-requires\r\n obj._jar = new (require(\"tough-cookie\")).CookieJar();\r\n\r\n if (typeof fetch === \"undefined\") {\r\n // eslint-disable-next-line @typescript-eslint/no-var-requires\r\n obj._fetchType = require(\"node-fetch\");\r\n } else {\r\n // Use fetch from Node if available\r\n obj._fetchType = fetch;\r\n }\r\n\r\n // node-fetch doesn't have a nice API for getting and setting cookies\r\n // fetch-cookie will wrap a fetch implementation with a default CookieJar or a provided one\r\n // eslint-disable-next-line @typescript-eslint/no-var-requires\r\n obj._fetchType = require(\"fetch-cookie\")(obj._fetchType, obj._jar);\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/** @private */\r\nexport function configureAbortController(obj: { _abortControllerType: { prototype: AbortController, new(): AbortController } }): boolean {\r\n if (typeof AbortController === \"undefined\") {\r\n // Node needs EventListener methods on AbortController which our custom polyfill doesn't provide\r\n obj._abortControllerType = require(\"abort-controller\");\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/** @private */\r\nexport function getWS(): any {\r\n return require(\"ws\");\r\n}\r\n\r\n/** @private */\r\nexport function getEventSource(): any {\r\n return require(\"eventsource\");\r\n}","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n\r\nexport class XhrHttpClient extends HttpClient {\r\n private readonly _logger: ILogger;\r\n\r\n public constructor(logger: ILogger) {\r\n super();\r\n this._logger = logger;\r\n }\r\n\r\n /** @inheritDoc */\r\n public send(request: HttpRequest): Promise {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const xhr = new XMLHttpRequest();\r\n\r\n xhr.open(request.method!, request.url!, true);\r\n xhr.withCredentials = request.withCredentials === undefined ? true : request.withCredentials;\r\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n if (request.content === \"\") {\r\n request.content = undefined;\r\n }\r\n if (request.content) {\r\n // Explicitly setting the Content-Type header for React Native on Android platform.\r\n if (isArrayBuffer(request.content)) {\r\n xhr.setRequestHeader(\"Content-Type\", \"application/octet-stream\");\r\n } else {\r\n xhr.setRequestHeader(\"Content-Type\", \"text/plain;charset=UTF-8\");\r\n }\r\n }\r\n\r\n const headers = request.headers;\r\n if (headers) {\r\n Object.keys(headers)\r\n .forEach((header) => {\r\n xhr.setRequestHeader(header, headers[header]);\r\n });\r\n }\r\n\r\n if (request.responseType) {\r\n xhr.responseType = request.responseType;\r\n }\r\n\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = () => {\r\n xhr.abort();\r\n reject(new AbortError());\r\n };\r\n }\r\n\r\n if (request.timeout) {\r\n xhr.timeout = request.timeout;\r\n }\r\n\r\n xhr.onload = () => {\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n\r\n if (xhr.status >= 200 && xhr.status < 300) {\r\n resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText));\r\n } else {\r\n reject(new HttpError(xhr.response || xhr.responseText || xhr.statusText, xhr.status));\r\n }\r\n };\r\n\r\n xhr.onerror = () => {\r\n this._logger.log(LogLevel.Warning, `Error from HTTP request. ${xhr.status}: ${xhr.statusText}.`);\r\n reject(new HttpError(xhr.statusText, xhr.status));\r\n };\r\n\r\n xhr.ontimeout = () => {\r\n this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r\n reject(new TimeoutError());\r\n };\r\n\r\n xhr.send(request.content);\r\n });\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortError } from \"./Errors\";\r\nimport { FetchHttpClient } from \"./FetchHttpClient\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\nimport { ILogger } from \"./ILogger\";\r\nimport { Platform } from \"./Utils\";\r\nimport { XhrHttpClient } from \"./XhrHttpClient\";\r\n\r\n/** Default implementation of {@link @microsoft/signalr.HttpClient}. */\r\nexport class DefaultHttpClient extends HttpClient {\r\n private readonly _httpClient: HttpClient;\r\n\r\n /** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */\r\n public constructor(logger: ILogger) {\r\n super();\r\n\r\n if (typeof fetch !== \"undefined\" || Platform.isNode) {\r\n this._httpClient = new FetchHttpClient(logger);\r\n } else if (typeof XMLHttpRequest !== \"undefined\") {\r\n this._httpClient = new XhrHttpClient(logger);\r\n } else {\r\n throw new Error(\"No usable HttpClient found.\");\r\n }\r\n }\r\n\r\n /** @inheritDoc */\r\n public send(request: HttpRequest): Promise {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n\r\n return this._httpClient.send(request);\r\n }\r\n\r\n public getCookieString(url: string): string {\r\n return this._httpClient.getCookieString(url);\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Not exported from index\r\n/** @private */\r\nexport class TextMessageFormat {\r\n public static RecordSeparatorCode = 0x1e;\r\n public static RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode);\r\n\r\n public static write(output: string): string {\r\n return `${output}${TextMessageFormat.RecordSeparator}`;\r\n }\r\n\r\n public static parse(input: string): string[] {\r\n if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n\r\n const messages = input.split(TextMessageFormat.RecordSeparator);\r\n messages.pop();\r\n return messages;\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n\r\n/** @private */\r\nexport interface HandshakeRequestMessage {\r\n readonly protocol: string;\r\n readonly version: number;\r\n}\r\n\r\n/** @private */\r\nexport interface HandshakeResponseMessage {\r\n readonly error: string;\r\n readonly minorVersion: number;\r\n}\r\n\r\n/** @private */\r\nexport class HandshakeProtocol {\r\n // Handshake request is always JSON\r\n public writeHandshakeRequest(handshakeRequest: HandshakeRequestMessage): string {\r\n return TextMessageFormat.write(JSON.stringify(handshakeRequest));\r\n }\r\n\r\n public parseHandshakeResponse(data: any): [any, HandshakeResponseMessage] {\r\n let messageData: string;\r\n let remainingData: any;\r\n\r\n if (isArrayBuffer(data)) {\r\n // Format is binary but still need to read JSON text from handshake response\r\n const binaryData = new Uint8Array(data);\r\n const separatorIndex = binaryData.indexOf(TextMessageFormat.RecordSeparatorCode);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n const responseLength = separatorIndex + 1;\r\n messageData = String.fromCharCode.apply(null, Array.prototype.slice.call(binaryData.slice(0, responseLength)));\r\n remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;\r\n } else {\r\n const textData: string = data;\r\n const separatorIndex = textData.indexOf(TextMessageFormat.RecordSeparator);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n const responseLength = separatorIndex + 1;\r\n messageData = textData.substring(0, responseLength);\r\n remainingData = (textData.length > responseLength) ? textData.substring(responseLength) : null;\r\n }\r\n\r\n // At this point we should have just the single handshake message\r\n const messages = TextMessageFormat.parse(messageData);\r\n const response = JSON.parse(messages[0]);\r\n if (response.type) {\r\n throw new Error(\"Expected a handshake response from the server.\");\r\n }\r\n const responseMessage: HandshakeResponseMessage = response;\r\n\r\n // multiple messages could have arrived with handshake\r\n // return additional data to be parsed as usual, or null if all parsed\r\n return [remainingData, responseMessage];\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { ILogger } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\n\r\n/** Defines the type of a Hub Message. */\r\nexport enum MessageType {\r\n /** Indicates the message is an Invocation message and implements the {@link @microsoft/signalr.InvocationMessage} interface. */\r\n Invocation = 1,\r\n /** Indicates the message is a StreamItem message and implements the {@link @microsoft/signalr.StreamItemMessage} interface. */\r\n StreamItem = 2,\r\n /** Indicates the message is a Completion message and implements the {@link @microsoft/signalr.CompletionMessage} interface. */\r\n Completion = 3,\r\n /** Indicates the message is a Stream Invocation message and implements the {@link @microsoft/signalr.StreamInvocationMessage} interface. */\r\n StreamInvocation = 4,\r\n /** Indicates the message is a Cancel Invocation message and implements the {@link @microsoft/signalr.CancelInvocationMessage} interface. */\r\n CancelInvocation = 5,\r\n /** Indicates the message is a Ping message and implements the {@link @microsoft/signalr.PingMessage} interface. */\r\n Ping = 6,\r\n /** Indicates the message is a Close message and implements the {@link @microsoft/signalr.CloseMessage} interface. */\r\n Close = 7,\r\n Ack = 8,\r\n Sequence = 9\r\n}\r\n\r\n/** Defines a dictionary of string keys and string values representing headers attached to a Hub message. */\r\nexport interface MessageHeaders {\r\n /** Gets or sets the header with the specified key. */\r\n [key: string]: string;\r\n}\r\n\r\n/** Union type of all known Hub messages. */\r\nexport type HubMessage =\r\n InvocationMessage |\r\n StreamInvocationMessage |\r\n StreamItemMessage |\r\n CompletionMessage |\r\n CancelInvocationMessage |\r\n PingMessage |\r\n CloseMessage |\r\n AckMessage |\r\n SequenceMessage;\r\n\r\n/** Defines properties common to all Hub messages. */\r\nexport interface HubMessageBase {\r\n /** A {@link @microsoft/signalr.MessageType} value indicating the type of this message. */\r\n readonly type: MessageType;\r\n}\r\n\r\n/** Defines properties common to all Hub messages relating to a specific invocation. */\r\nexport interface HubInvocationMessage extends HubMessageBase {\r\n /** A {@link @microsoft/signalr.MessageHeaders} dictionary containing headers attached to the message. */\r\n readonly headers?: MessageHeaders;\r\n /** The ID of the invocation relating to this message.\r\n *\r\n * This is expected to be present for {@link @microsoft/signalr.StreamInvocationMessage} and {@link @microsoft/signalr.CompletionMessage}. It may\r\n * be 'undefined' for an {@link @microsoft/signalr.InvocationMessage} if the sender does not expect a response.\r\n */\r\n readonly invocationId?: string;\r\n}\r\n\r\n/** A hub message representing a non-streaming invocation. */\r\nexport interface InvocationMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Invocation;\r\n /** The target method name. */\r\n readonly target: string;\r\n /** The target method arguments. */\r\n readonly arguments: any[];\r\n /** The target methods stream IDs. */\r\n readonly streamIds?: string[];\r\n}\r\n\r\n/** A hub message representing a streaming invocation. */\r\nexport interface StreamInvocationMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.StreamInvocation;\r\n\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n /** The target method name. */\r\n readonly target: string;\r\n /** The target method arguments. */\r\n readonly arguments: any[];\r\n /** The target methods stream IDs. */\r\n readonly streamIds?: string[];\r\n}\r\n\r\n/** A hub message representing a single item produced as part of a result stream. */\r\nexport interface StreamItemMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.StreamItem;\r\n\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n\r\n /** The item produced by the server. */\r\n readonly item?: any;\r\n}\r\n\r\n/** A hub message representing the result of an invocation. */\r\nexport interface CompletionMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Completion;\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n /** The error produced by the invocation, if any.\r\n *\r\n * Either {@link @microsoft/signalr.CompletionMessage.error} or {@link @microsoft/signalr.CompletionMessage.result} must be defined, but not both.\r\n */\r\n readonly error?: string;\r\n /** The result produced by the invocation, if any.\r\n *\r\n * Either {@link @microsoft/signalr.CompletionMessage.error} or {@link @microsoft/signalr.CompletionMessage.result} must be defined, but not both.\r\n */\r\n readonly result?: any;\r\n}\r\n\r\n/** A hub message indicating that the sender is still active. */\r\nexport interface PingMessage extends HubMessageBase {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Ping;\r\n}\r\n\r\n/** A hub message indicating that the sender is closing the connection.\r\n *\r\n * If {@link @microsoft/signalr.CloseMessage.error} is defined, the sender is closing the connection due to an error.\r\n */\r\nexport interface CloseMessage extends HubMessageBase {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Close;\r\n /** The error that triggered the close, if any.\r\n *\r\n * If this property is undefined, the connection was closed normally and without error.\r\n */\r\n readonly error?: string;\r\n\r\n /** If true, clients with automatic reconnects enabled should attempt to reconnect after receiving the CloseMessage. Otherwise, they should not. */\r\n readonly allowReconnect?: boolean;\r\n}\r\n\r\n/** A hub message sent to request that a streaming invocation be canceled. */\r\nexport interface CancelInvocationMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.CancelInvocation;\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n}\r\n\r\nexport interface AckMessage extends HubMessageBase\r\n{\r\n readonly type: MessageType.Ack;\r\n\r\n readonly sequenceId: number;\r\n}\r\n\r\nexport interface SequenceMessage extends HubMessageBase\r\n{\r\n readonly type: MessageType.Sequence;\r\n\r\n readonly sequenceId: number;\r\n}\r\n\r\n/** A protocol abstraction for communicating with SignalR Hubs. */\r\nexport interface IHubProtocol {\r\n /** The name of the protocol. This is used by SignalR to resolve the protocol between the client and server. */\r\n readonly name: string;\r\n /** The version of the protocol. */\r\n readonly version: number;\r\n /** The {@link @microsoft/signalr.TransferFormat} of the protocol. */\r\n readonly transferFormat: TransferFormat;\r\n\r\n /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.\r\n *\r\n * If {@link @microsoft/signalr.IHubProtocol.transferFormat} is 'Text', the `input` parameter must be a string, otherwise it must be an ArrayBuffer.\r\n *\r\n * @param {string | ArrayBuffer} input A string or ArrayBuffer containing the serialized representation.\r\n * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r\n */\r\n parseMessages(input: string | ArrayBuffer, logger: ILogger): HubMessage[];\r\n\r\n /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string or ArrayBuffer and returns it.\r\n *\r\n * If {@link @microsoft/signalr.IHubProtocol.transferFormat} is 'Text', the result of this method will be a string, otherwise it will be an ArrayBuffer.\r\n *\r\n * @param {HubMessage} message The message to write.\r\n * @returns {string | ArrayBuffer} A string or ArrayBuffer containing the serialized representation of the message.\r\n */\r\n writeMessage(message: HubMessage): string | ArrayBuffer;\r\n}","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { IStreamResult, IStreamSubscriber, ISubscription } from \"./Stream\";\r\nimport { SubjectSubscription } from \"./Utils\";\r\n\r\n/** Stream implementation to stream items to the server. */\r\nexport class Subject implements IStreamResult {\r\n /** @internal */\r\n public observers: IStreamSubscriber[];\r\n\r\n /** @internal */\r\n public cancelCallback?: () => Promise;\r\n\r\n constructor() {\r\n this.observers = [];\r\n }\r\n\r\n public next(item: T): void {\r\n for (const observer of this.observers) {\r\n observer.next(item);\r\n }\r\n }\r\n\r\n public error(err: any): void {\r\n for (const observer of this.observers) {\r\n if (observer.error) {\r\n observer.error(err);\r\n }\r\n }\r\n }\r\n\r\n public complete(): void {\r\n for (const observer of this.observers) {\r\n if (observer.complete) {\r\n observer.complete();\r\n }\r\n }\r\n }\r\n\r\n public subscribe(observer: IStreamSubscriber): ISubscription {\r\n this.observers.push(observer);\r\n return new SubjectSubscription(this, observer);\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { IConnection } from \"./IConnection\";\r\nimport { AckMessage, HubMessage, IHubProtocol, MessageType, SequenceMessage } from \"./IHubProtocol\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n\r\n/** @private */\r\nexport class MessageBuffer {\r\n private readonly _protocol: IHubProtocol;\r\n private readonly _connection: IConnection;\r\n\r\n private readonly _bufferSize: number = 100_000;\r\n\r\n private _messages: BufferedItem[] = [];\r\n private _totalMessageCount: number = 0;\r\n private _waitForSequenceMessage: boolean = false;\r\n\r\n // Message IDs start at 1 and always increment by 1\r\n private _nextReceivingSequenceId = 1;\r\n private _latestReceivedSequenceId = 0;\r\n private _bufferedByteCount: number = 0;\r\n private _reconnectInProgress: boolean = false;\r\n\r\n private _ackTimerHandle?: any;\r\n\r\n constructor(protocol: IHubProtocol, connection: IConnection, bufferSize: number) {\r\n this._protocol = protocol;\r\n this._connection = connection;\r\n this._bufferSize = bufferSize;\r\n }\r\n\r\n public async _send(message: HubMessage): Promise {\r\n const serializedMessage = this._protocol.writeMessage(message);\r\n\r\n let backpressurePromise: Promise = Promise.resolve();\r\n\r\n // Only count invocation messages. Acks, pings, etc. don't need to be resent on reconnect\r\n if (this._isInvocationMessage(message)) {\r\n this._totalMessageCount++;\r\n let backpressurePromiseResolver: (value: void) => void = () => {};\r\n let backpressurePromiseRejector: (value?: void) => void = () => {};\r\n\r\n if (isArrayBuffer(serializedMessage)) {\r\n this._bufferedByteCount += serializedMessage.byteLength;\r\n } else {\r\n this._bufferedByteCount += serializedMessage.length;\r\n }\r\n\r\n if (this._bufferedByteCount >= this._bufferSize) {\r\n backpressurePromise = new Promise((resolve, reject) => {\r\n backpressurePromiseResolver = resolve;\r\n backpressurePromiseRejector = reject;\r\n });\r\n }\r\n\r\n this._messages.push(new BufferedItem(serializedMessage, this._totalMessageCount,\r\n backpressurePromiseResolver, backpressurePromiseRejector));\r\n }\r\n\r\n try {\r\n // If this is set it means we are reconnecting or resending\r\n // We don't want to send on a disconnected connection\r\n // And we don't want to send if resend is running since that would mean sending\r\n // this message twice\r\n if (!this._reconnectInProgress) {\r\n await this._connection.send(serializedMessage);\r\n }\r\n } catch {\r\n this._disconnected();\r\n }\r\n await backpressurePromise;\r\n }\r\n\r\n public _ack(ackMessage: AckMessage): void {\r\n let newestAckedMessage = -1;\r\n\r\n // Find index of newest message being acked\r\n for (let index = 0; index < this._messages.length; index++) {\r\n const element = this._messages[index];\r\n if (element._id <= ackMessage.sequenceId) {\r\n newestAckedMessage = index;\r\n if (isArrayBuffer(element._message)) {\r\n this._bufferedByteCount -= element._message.byteLength;\r\n } else {\r\n this._bufferedByteCount -= element._message.length;\r\n }\r\n // resolve items that have already been sent and acked\r\n element._resolver();\r\n } else if (this._bufferedByteCount < this._bufferSize) {\r\n // resolve items that now fall under the buffer limit but haven't been acked\r\n element._resolver();\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n if (newestAckedMessage !== -1) {\r\n // We're removing everything including the message pointed to, so add 1\r\n this._messages = this._messages.slice(newestAckedMessage + 1);\r\n }\r\n }\r\n\r\n public _shouldProcessMessage(message: HubMessage): boolean {\r\n if (this._waitForSequenceMessage) {\r\n if (message.type !== MessageType.Sequence) {\r\n return false;\r\n } else {\r\n this._waitForSequenceMessage = false;\r\n return true;\r\n }\r\n }\r\n\r\n // No special processing for acks, pings, etc.\r\n if (!this._isInvocationMessage(message)) {\r\n return true;\r\n }\r\n\r\n const currentId = this._nextReceivingSequenceId;\r\n this._nextReceivingSequenceId++;\r\n if (currentId <= this._latestReceivedSequenceId) {\r\n if (currentId === this._latestReceivedSequenceId) {\r\n // Should only hit this if we just reconnected and the server is sending\r\n // Messages it has buffered, which would mean it hasn't seen an Ack for these messages\r\n this._ackTimer();\r\n }\r\n // Ignore, this is a duplicate message\r\n return false;\r\n }\r\n\r\n this._latestReceivedSequenceId = currentId;\r\n\r\n // Only start the timer for sending an Ack message when we have a message to ack. This also conveniently solves\r\n // timer throttling by not having a recursive timer, and by starting the timer via a network call (recv)\r\n this._ackTimer();\r\n return true;\r\n }\r\n\r\n public _resetSequence(message: SequenceMessage): void {\r\n if (message.sequenceId > this._nextReceivingSequenceId) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._connection.stop(new Error(\"Sequence ID greater than amount of messages we've received.\"));\r\n return;\r\n }\r\n\r\n this._nextReceivingSequenceId = message.sequenceId;\r\n }\r\n\r\n public _disconnected(): void {\r\n this._reconnectInProgress = true;\r\n this._waitForSequenceMessage = true;\r\n }\r\n\r\n public async _resend(): Promise {\r\n const sequenceId = this._messages.length !== 0\r\n ? this._messages[0]._id\r\n : this._totalMessageCount + 1;\r\n await this._connection.send(this._protocol.writeMessage({ type: MessageType.Sequence, sequenceId }));\r\n\r\n // Get a local variable to the _messages, just in case messages are acked while resending\r\n // Which would slice the _messages array (which creates a new copy)\r\n const messages = this._messages;\r\n for (const element of messages) {\r\n await this._connection.send(element._message);\r\n }\r\n\r\n this._reconnectInProgress = false;\r\n }\r\n\r\n public _dispose(error?: Error): void {\r\n error ??= new Error(\"Unable to reconnect to server.\")\r\n\r\n // Unblock backpressure if any\r\n for (const element of this._messages) {\r\n element._rejector(error);\r\n }\r\n }\r\n\r\n private _isInvocationMessage(message: HubMessage): boolean {\r\n // There is no way to check if something implements an interface.\r\n // So we individually check the messages in a switch statement.\r\n // To make sure we don't miss any message types we rely on the compiler\r\n // seeing the function returns a value and it will do the\r\n // exhaustive check for us on the switch statement, since we don't use 'case default'\r\n switch (message.type) {\r\n case MessageType.Invocation:\r\n case MessageType.StreamItem:\r\n case MessageType.Completion:\r\n case MessageType.StreamInvocation:\r\n case MessageType.CancelInvocation:\r\n return true;\r\n case MessageType.Close:\r\n case MessageType.Sequence:\r\n case MessageType.Ping:\r\n case MessageType.Ack:\r\n return false;\r\n }\r\n }\r\n\r\n private _ackTimer(): void {\r\n if (this._ackTimerHandle === undefined) {\r\n this._ackTimerHandle = setTimeout(async () => {\r\n try {\r\n if (!this._reconnectInProgress) {\r\n await this._connection.send(this._protocol.writeMessage({ type: MessageType.Ack, sequenceId: this._latestReceivedSequenceId }))\r\n }\r\n // Ignore errors, that means the connection is closed and we don't care about the Ack message anymore.\r\n } catch { }\r\n\r\n clearTimeout(this._ackTimerHandle);\r\n this._ackTimerHandle = undefined;\r\n // 1 second delay so we don't spam Ack messages if there are many messages being received at once.\r\n }, 1000);\r\n }\r\n }\r\n}\r\n\r\nclass BufferedItem {\r\n constructor(message: string | ArrayBuffer, id: number, resolver: (value: void) => void, rejector: (value?: any) => void) {\r\n this._message = message;\r\n this._id = id;\r\n this._resolver = resolver;\r\n this._rejector = rejector;\r\n }\r\n\r\n _message: string | ArrayBuffer;\r\n _id: number;\r\n _resolver: (value: void) => void;\r\n _rejector: (value?: any) => void;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HandshakeProtocol, HandshakeRequestMessage, HandshakeResponseMessage } from \"./HandshakeProtocol\";\r\nimport { IConnection } from \"./IConnection\";\r\nimport { AbortError } from \"./Errors\";\r\nimport { CancelInvocationMessage, CloseMessage, CompletionMessage, IHubProtocol, InvocationMessage, MessageType, StreamInvocationMessage, StreamItemMessage } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { IRetryPolicy } from \"./IRetryPolicy\";\r\nimport { IStreamResult } from \"./Stream\";\r\nimport { Subject } from \"./Subject\";\r\nimport { Arg, getErrorString, Platform } from \"./Utils\";\r\nimport { MessageBuffer } from \"./MessageBuffer\";\r\n\r\nconst DEFAULT_TIMEOUT_IN_MS: number = 30 * 1000;\r\nconst DEFAULT_PING_INTERVAL_IN_MS: number = 15 * 1000;\r\nconst DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE = 100_000;\r\n\r\n/** Describes the current state of the {@link HubConnection} to the server. */\r\nexport enum HubConnectionState {\r\n /** The hub connection is disconnected. */\r\n Disconnected = \"Disconnected\",\r\n /** The hub connection is connecting. */\r\n Connecting = \"Connecting\",\r\n /** The hub connection is connected. */\r\n Connected = \"Connected\",\r\n /** The hub connection is disconnecting. */\r\n Disconnecting = \"Disconnecting\",\r\n /** The hub connection is reconnecting. */\r\n Reconnecting = \"Reconnecting\",\r\n}\r\n\r\n/** Represents a connection to a SignalR Hub. */\r\nexport class HubConnection {\r\n private readonly _cachedPingMessage: string | ArrayBuffer;\r\n // Needs to not start with _ for tests\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private readonly connection: IConnection;\r\n private readonly _logger: ILogger;\r\n private readonly _reconnectPolicy?: IRetryPolicy;\r\n private readonly _statefulReconnectBufferSize: number;\r\n private _protocol: IHubProtocol;\r\n private _handshakeProtocol: HandshakeProtocol;\r\n private _callbacks: { [invocationId: string]: (invocationEvent: StreamItemMessage | CompletionMessage | null, error?: Error) => void };\r\n private _methods: { [name: string]: (((...args: any[]) => void) | ((...args: any[]) => any))[] };\r\n private _invocationId: number;\r\n private _messageBuffer?: MessageBuffer;\r\n\r\n private _closedCallbacks: ((error?: Error) => void)[];\r\n private _reconnectingCallbacks: ((error?: Error) => void)[];\r\n private _reconnectedCallbacks: ((connectionId?: string) => void)[];\r\n\r\n private _receivedHandshakeResponse: boolean;\r\n private _handshakeResolver!: (value?: PromiseLike<{}>) => void;\r\n private _handshakeRejecter!: (reason?: any) => void;\r\n private _stopDuringStartError?: Error;\r\n\r\n private _connectionState: HubConnectionState;\r\n // connectionStarted is tracked independently from connectionState, so we can check if the\r\n // connection ever did successfully transition from connecting to connected before disconnecting.\r\n private _connectionStarted: boolean;\r\n private _startPromise?: Promise;\r\n private _stopPromise?: Promise;\r\n private _nextKeepAlive: number = 0;\r\n\r\n // The type of these a) doesn't matter and b) varies when building in browser and node contexts\r\n // Since we're building the WebPack bundle directly from the TypeScript, this matters (previously\r\n // we built the bundle from the compiled JavaScript).\r\n private _reconnectDelayHandle?: any;\r\n private _timeoutHandle?: any;\r\n private _pingServerHandle?: any;\r\n\r\n private _freezeEventListener = () =>\r\n {\r\n this._logger.log(LogLevel.Warning, \"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep\");\r\n };\r\n\r\n /** The server timeout in milliseconds.\r\n *\r\n * If this timeout elapses without receiving any messages from the server, the connection will be terminated with an error.\r\n * The default timeout value is 30,000 milliseconds (30 seconds).\r\n */\r\n public serverTimeoutInMilliseconds: number;\r\n\r\n /** Default interval at which to ping the server.\r\n *\r\n * The default value is 15,000 milliseconds (15 seconds).\r\n * Allows the server to detect hard disconnects (like when a client unplugs their computer).\r\n * The ping will happen at most as often as the server pings.\r\n * If the server pings every 5 seconds, a value lower than 5 will ping every 5 seconds.\r\n */\r\n public keepAliveIntervalInMilliseconds: number;\r\n\r\n /** @internal */\r\n // Using a public static factory method means we can have a private constructor and an _internal_\r\n // create method that can be used by HubConnectionBuilder. An \"internal\" constructor would just\r\n // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a\r\n // public parameter-less constructor.\r\n public static create(\r\n connection: IConnection,\r\n logger: ILogger,\r\n protocol: IHubProtocol,\r\n reconnectPolicy?: IRetryPolicy,\r\n serverTimeoutInMilliseconds?: number,\r\n keepAliveIntervalInMilliseconds?: number,\r\n statefulReconnectBufferSize?: number): HubConnection {\r\n return new HubConnection(connection, logger, protocol, reconnectPolicy,\r\n serverTimeoutInMilliseconds, keepAliveIntervalInMilliseconds, statefulReconnectBufferSize);\r\n }\r\n\r\n private constructor(\r\n connection: IConnection,\r\n logger: ILogger,\r\n protocol: IHubProtocol,\r\n reconnectPolicy?: IRetryPolicy,\r\n serverTimeoutInMilliseconds?: number,\r\n keepAliveIntervalInMilliseconds?: number,\r\n statefulReconnectBufferSize?: number) {\r\n Arg.isRequired(connection, \"connection\");\r\n Arg.isRequired(logger, \"logger\");\r\n Arg.isRequired(protocol, \"protocol\");\r\n\r\n this.serverTimeoutInMilliseconds = serverTimeoutInMilliseconds ?? DEFAULT_TIMEOUT_IN_MS;\r\n this.keepAliveIntervalInMilliseconds = keepAliveIntervalInMilliseconds ?? DEFAULT_PING_INTERVAL_IN_MS;\r\n\r\n this._statefulReconnectBufferSize = statefulReconnectBufferSize ?? DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE;\r\n\r\n this._logger = logger;\r\n this._protocol = protocol;\r\n this.connection = connection;\r\n this._reconnectPolicy = reconnectPolicy;\r\n this._handshakeProtocol = new HandshakeProtocol();\r\n\r\n this.connection.onreceive = (data: any) => this._processIncomingData(data);\r\n this.connection.onclose = (error?: Error) => this._connectionClosed(error);\r\n\r\n this._callbacks = {};\r\n this._methods = {};\r\n this._closedCallbacks = [];\r\n this._reconnectingCallbacks = [];\r\n this._reconnectedCallbacks = [];\r\n this._invocationId = 0;\r\n this._receivedHandshakeResponse = false;\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n\r\n this._cachedPingMessage = this._protocol.writeMessage({ type: MessageType.Ping });\r\n }\r\n\r\n /** Indicates the state of the {@link HubConnection} to the server. */\r\n get state(): HubConnectionState {\r\n return this._connectionState;\r\n }\r\n\r\n /** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either\r\n * in the disconnected state or if the negotiation step was skipped.\r\n */\r\n get connectionId(): string | null {\r\n return this.connection ? (this.connection.connectionId || null) : null;\r\n }\r\n\r\n /** Indicates the url of the {@link HubConnection} to the server. */\r\n get baseUrl(): string {\r\n return this.connection.baseUrl || \"\";\r\n }\r\n\r\n /**\r\n * Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or\r\n * Reconnecting states.\r\n * @param {string} url The url to connect to.\r\n */\r\n set baseUrl(url: string) {\r\n if (this._connectionState !== HubConnectionState.Disconnected && this._connectionState !== HubConnectionState.Reconnecting) {\r\n throw new Error(\"The HubConnection must be in the Disconnected or Reconnecting state to change the url.\");\r\n }\r\n\r\n if (!url) {\r\n throw new Error(\"The HubConnection url must be a valid url.\");\r\n }\r\n\r\n this.connection.baseUrl = url;\r\n }\r\n\r\n /** Starts the connection.\r\n *\r\n * @returns {Promise} A Promise that resolves when the connection has been successfully established, or rejects with an error.\r\n */\r\n public start(): Promise {\r\n this._startPromise = this._startWithStateTransitions();\r\n return this._startPromise;\r\n }\r\n\r\n private async _startWithStateTransitions(): Promise {\r\n if (this._connectionState !== HubConnectionState.Disconnected) {\r\n return Promise.reject(new Error(\"Cannot start a HubConnection that is not in the 'Disconnected' state.\"));\r\n }\r\n\r\n this._connectionState = HubConnectionState.Connecting;\r\n this._logger.log(LogLevel.Debug, \"Starting HubConnection.\");\r\n\r\n try {\r\n await this._startInternal();\r\n\r\n if (Platform.isBrowser) {\r\n // Log when the browser freezes the tab so users know why their connection unexpectedly stopped working\r\n window.document.addEventListener(\"freeze\", this._freezeEventListener);\r\n }\r\n\r\n this._connectionState = HubConnectionState.Connected;\r\n this._connectionStarted = true;\r\n this._logger.log(LogLevel.Debug, \"HubConnection connected successfully.\");\r\n } catch (e) {\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._logger.log(LogLevel.Debug, `HubConnection failed to start successfully because of error '${e}'.`);\r\n return Promise.reject(e);\r\n }\r\n }\r\n\r\n private async _startInternal() {\r\n this._stopDuringStartError = undefined;\r\n this._receivedHandshakeResponse = false;\r\n // Set up the promise before any connection is (re)started otherwise it could race with received messages\r\n const handshakePromise = new Promise((resolve, reject) => {\r\n this._handshakeResolver = resolve;\r\n this._handshakeRejecter = reject;\r\n });\r\n\r\n await this.connection.start(this._protocol.transferFormat);\r\n\r\n try {\r\n let version = this._protocol.version;\r\n if (!this.connection.features.reconnect) {\r\n // Stateful Reconnect starts with HubProtocol version 2, newer clients connecting to older servers will fail to connect due to\r\n // the handshake only supporting version 1, so we will try to send version 1 during the handshake to keep old servers working.\r\n version = 1;\r\n }\r\n\r\n const handshakeRequest: HandshakeRequestMessage = {\r\n protocol: this._protocol.name,\r\n version,\r\n };\r\n\r\n this._logger.log(LogLevel.Debug, \"Sending handshake request.\");\r\n\r\n await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(handshakeRequest));\r\n\r\n this._logger.log(LogLevel.Information, `Using HubProtocol '${this._protocol.name}'.`);\r\n\r\n // defensively cleanup timeout in case we receive a message from the server before we finish start\r\n this._cleanupTimeout();\r\n this._resetTimeoutPeriod();\r\n this._resetKeepAliveInterval();\r\n\r\n await handshakePromise;\r\n\r\n // It's important to check the stopDuringStartError instead of just relying on the handshakePromise\r\n // being rejected on close, because this continuation can run after both the handshake completed successfully\r\n // and the connection was closed.\r\n if (this._stopDuringStartError) {\r\n // It's important to throw instead of returning a rejected promise, because we don't want to allow any state\r\n // transitions to occur between now and the calling code observing the exceptions. Returning a rejected promise\r\n // will cause the calling continuation to get scheduled to run later.\r\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\r\n throw this._stopDuringStartError;\r\n }\r\n\r\n const useStatefulReconnect = this.connection.features.reconnect || false;\r\n if (useStatefulReconnect) {\r\n this._messageBuffer = new MessageBuffer(this._protocol, this.connection, this._statefulReconnectBufferSize);\r\n this.connection.features.disconnected = this._messageBuffer._disconnected.bind(this._messageBuffer);\r\n this.connection.features.resend = () => {\r\n if (this._messageBuffer) {\r\n return this._messageBuffer._resend();\r\n }\r\n }\r\n }\r\n\r\n if (!this.connection.features.inherentKeepAlive) {\r\n await this._sendMessage(this._cachedPingMessage);\r\n }\r\n } catch (e) {\r\n this._logger.log(LogLevel.Debug, `Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`);\r\n\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n\r\n // HttpConnection.stop() should not complete until after the onclose callback is invoked.\r\n // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes.\r\n await this.connection.stop(e);\r\n throw e;\r\n }\r\n }\r\n\r\n /** Stops the connection.\r\n *\r\n * @returns {Promise} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.\r\n */\r\n public async stop(): Promise {\r\n // Capture the start promise before the connection might be restarted in an onclose callback.\r\n const startPromise = this._startPromise;\r\n this.connection.features.reconnect = false;\r\n\r\n this._stopPromise = this._stopInternal();\r\n await this._stopPromise;\r\n\r\n try {\r\n // Awaiting undefined continues immediately\r\n await startPromise;\r\n } catch (e) {\r\n // This exception is returned to the user as a rejected Promise from the start method.\r\n }\r\n }\r\n\r\n private _stopInternal(error?: Error): Promise {\r\n if (this._connectionState === HubConnectionState.Disconnected) {\r\n this._logger.log(LogLevel.Debug, `Call to HubConnection.stop(${error}) ignored because it is already in the disconnected state.`);\r\n return Promise.resolve();\r\n }\r\n\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r\n return this._stopPromise!;\r\n }\r\n\r\n const state = this._connectionState;\r\n this._connectionState = HubConnectionState.Disconnecting;\r\n\r\n this._logger.log(LogLevel.Debug, \"Stopping HubConnection.\");\r\n\r\n if (this._reconnectDelayHandle) {\r\n // We're in a reconnect delay which means the underlying connection is currently already stopped.\r\n // Just clear the handle to stop the reconnect loop (which no one is waiting on thankfully) and\r\n // fire the onclose callbacks.\r\n this._logger.log(LogLevel.Debug, \"Connection stopped during reconnect delay. Done reconnecting.\");\r\n\r\n clearTimeout(this._reconnectDelayHandle);\r\n this._reconnectDelayHandle = undefined;\r\n\r\n this._completeClose();\r\n return Promise.resolve();\r\n }\r\n\r\n if (state === HubConnectionState.Connected) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._sendCloseMessage();\r\n }\r\n\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n this._stopDuringStartError = error || new AbortError(\"The connection was stopped before the hub handshake could complete.\");\r\n\r\n // HttpConnection.stop() should not complete until after either HttpConnection.start() fails\r\n // or the onclose callback is invoked. The onclose callback will transition the HubConnection\r\n // to the disconnected state if need be before HttpConnection.stop() completes.\r\n return this.connection.stop(error);\r\n }\r\n\r\n private async _sendCloseMessage() {\r\n try {\r\n await this._sendWithProtocol(this._createCloseMessage());\r\n } catch {\r\n // Ignore, this is a best effort attempt to let the server know the client closed gracefully.\r\n }\r\n }\r\n\r\n /** Invokes a streaming hub method on the server using the specified name and arguments.\r\n *\r\n * @typeparam T The type of the items returned by the server.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {IStreamResult} An object that yields results from the server as they are received.\r\n */\r\n public stream(methodName: string, ...args: any[]): IStreamResult {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const invocationDescriptor = this._createStreamInvocation(methodName, args, streamIds);\r\n\r\n // eslint-disable-next-line prefer-const\r\n let promiseQueue: Promise;\r\n\r\n const subject = new Subject();\r\n subject.cancelCallback = () => {\r\n const cancelInvocation: CancelInvocationMessage = this._createCancelInvocation(invocationDescriptor.invocationId);\r\n\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n\r\n return promiseQueue.then(() => {\r\n return this._sendWithProtocol(cancelInvocation);\r\n });\r\n };\r\n\r\n this._callbacks[invocationDescriptor.invocationId] = (invocationEvent: CompletionMessage | StreamItemMessage | null, error?: Error) => {\r\n if (error) {\r\n subject.error(error);\r\n return;\r\n } else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n subject.error(new Error(invocationEvent.error));\r\n } else {\r\n subject.complete();\r\n }\r\n } else {\r\n subject.next((invocationEvent.item) as T);\r\n }\r\n }\r\n };\r\n\r\n promiseQueue = this._sendWithProtocol(invocationDescriptor)\r\n .catch((e) => {\r\n subject.error(e);\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n });\r\n\r\n this._launchStreams(streams, promiseQueue);\r\n\r\n return subject;\r\n }\r\n\r\n private _sendMessage(message: any) {\r\n this._resetKeepAliveInterval();\r\n return this.connection.send(message);\r\n }\r\n\r\n /**\r\n * Sends a js object to the server.\r\n * @param message The js object to serialize and send.\r\n */\r\n private _sendWithProtocol(message: any) {\r\n if (this._messageBuffer) {\r\n return this._messageBuffer._send(message);\r\n } else {\r\n return this._sendMessage(this._protocol.writeMessage(message));\r\n }\r\n }\r\n\r\n /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.\r\n *\r\n * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still\r\n * be processing the invocation.\r\n *\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise} A Promise that resolves when the invocation has been successfully sent, or rejects with an error.\r\n */\r\n public send(methodName: string, ...args: any[]): Promise {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const sendPromise = this._sendWithProtocol(this._createInvocation(methodName, args, true, streamIds));\r\n\r\n this._launchStreams(streams, sendPromise);\r\n\r\n return sendPromise;\r\n }\r\n\r\n /** Invokes a hub method on the server using the specified name and arguments.\r\n *\r\n * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise\r\n * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of\r\n * resolving the Promise.\r\n *\r\n * @typeparam T The expected return type.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise} A Promise that resolves with the result of the server method (if any), or rejects with an error.\r\n */\r\n public invoke(methodName: string, ...args: any[]): Promise {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const invocationDescriptor = this._createInvocation(methodName, args, false, streamIds);\r\n\r\n const p = new Promise((resolve, reject) => {\r\n // invocationId will always have a value for a non-blocking invocation\r\n this._callbacks[invocationDescriptor.invocationId!] = (invocationEvent: StreamItemMessage | CompletionMessage | null, error?: Error) => {\r\n if (error) {\r\n reject(error);\r\n return;\r\n } else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n reject(new Error(invocationEvent.error));\r\n } else {\r\n resolve(invocationEvent.result);\r\n }\r\n } else {\r\n reject(new Error(`Unexpected message type: ${invocationEvent.type}`));\r\n }\r\n }\r\n };\r\n\r\n const promiseQueue = this._sendWithProtocol(invocationDescriptor)\r\n .catch((e) => {\r\n reject(e);\r\n // invocationId will always have a value for a non-blocking invocation\r\n delete this._callbacks[invocationDescriptor.invocationId!];\r\n });\r\n\r\n this._launchStreams(streams, promiseQueue);\r\n });\r\n\r\n return p;\r\n }\r\n\r\n /** Registers a handler that will be invoked when the hub method with the specified method name is invoked.\r\n *\r\n * @param {string} methodName The name of the hub method to define.\r\n * @param {Function} newMethod The handler that will be raised when the hub method is invoked.\r\n */\r\n public on(methodName: string, newMethod: (...args: any[]) => any): void\r\n public on(methodName: string, newMethod: (...args: any[]) => void): void {\r\n if (!methodName || !newMethod) {\r\n return;\r\n }\r\n\r\n methodName = methodName.toLowerCase();\r\n if (!this._methods[methodName]) {\r\n this._methods[methodName] = [];\r\n }\r\n\r\n // Preventing adding the same handler multiple times.\r\n if (this._methods[methodName].indexOf(newMethod) !== -1) {\r\n return;\r\n }\r\n\r\n this._methods[methodName].push(newMethod);\r\n }\r\n\r\n /** Removes all handlers for the specified hub method.\r\n *\r\n * @param {string} methodName The name of the method to remove handlers for.\r\n */\r\n public off(methodName: string): void;\r\n\r\n /** Removes the specified handler for the specified hub method.\r\n *\r\n * You must pass the exact same Function instance as was previously passed to {@link @microsoft/signalr.HubConnection.on}. Passing a different instance (even if the function\r\n * body is the same) will not remove the handler.\r\n *\r\n * @param {string} methodName The name of the method to remove handlers for.\r\n * @param {Function} method The handler to remove. This must be the same Function instance as the one passed to {@link @microsoft/signalr.HubConnection.on}.\r\n */\r\n public off(methodName: string, method: (...args: any[]) => void): void;\r\n public off(methodName: string, method?: (...args: any[]) => void): void {\r\n if (!methodName) {\r\n return;\r\n }\r\n\r\n methodName = methodName.toLowerCase();\r\n const handlers = this._methods[methodName];\r\n if (!handlers) {\r\n return;\r\n }\r\n if (method) {\r\n const removeIdx = handlers.indexOf(method);\r\n if (removeIdx !== -1) {\r\n handlers.splice(removeIdx, 1);\r\n if (handlers.length === 0) {\r\n delete this._methods[methodName];\r\n }\r\n }\r\n } else {\r\n delete this._methods[methodName];\r\n }\r\n\r\n }\r\n\r\n /** Registers a handler that will be invoked when the connection is closed.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any).\r\n */\r\n public onclose(callback: (error?: Error) => void): void {\r\n if (callback) {\r\n this._closedCallbacks.push(callback);\r\n }\r\n }\r\n\r\n /** Registers a handler that will be invoked when the connection starts reconnecting.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any).\r\n */\r\n public onreconnecting(callback: (error?: Error) => void): void {\r\n if (callback) {\r\n this._reconnectingCallbacks.push(callback);\r\n }\r\n }\r\n\r\n /** Registers a handler that will be invoked when the connection successfully reconnects.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection successfully reconnects.\r\n */\r\n public onreconnected(callback: (connectionId?: string) => void): void {\r\n if (callback) {\r\n this._reconnectedCallbacks.push(callback);\r\n }\r\n }\r\n\r\n private _processIncomingData(data: any) {\r\n this._cleanupTimeout();\r\n\r\n if (!this._receivedHandshakeResponse) {\r\n data = this._processHandshakeResponse(data);\r\n this._receivedHandshakeResponse = true;\r\n }\r\n\r\n // Data may have all been read when processing handshake response\r\n if (data) {\r\n // Parse the messages\r\n const messages = this._protocol.parseMessages(data, this._logger);\r\n\r\n for (const message of messages) {\r\n if (this._messageBuffer && !this._messageBuffer._shouldProcessMessage(message)) {\r\n // Don't process the message, we are either waiting for a SequenceMessage or received a duplicate message\r\n continue;\r\n }\r\n\r\n switch (message.type) {\r\n case MessageType.Invocation:\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._invokeClientMethod(message);\r\n break;\r\n case MessageType.StreamItem:\r\n case MessageType.Completion: {\r\n const callback = this._callbacks[message.invocationId];\r\n if (callback) {\r\n if (message.type === MessageType.Completion) {\r\n delete this._callbacks[message.invocationId];\r\n }\r\n try {\r\n callback(message);\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `Stream callback threw error: ${getErrorString(e)}`);\r\n }\r\n }\r\n break;\r\n }\r\n case MessageType.Ping:\r\n // Don't care about pings\r\n break;\r\n case MessageType.Close: {\r\n this._logger.log(LogLevel.Information, \"Close message received from server.\");\r\n\r\n const error = message.error ? new Error(\"Server returned an error on close: \" + message.error) : undefined;\r\n\r\n if (message.allowReconnect === true) {\r\n // It feels wrong not to await connection.stop() here, but processIncomingData is called as part of an onreceive callback which is not async,\r\n // this is already the behavior for serverTimeout(), and HttpConnection.Stop() should catch and log all possible exceptions.\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.connection.stop(error);\r\n } else {\r\n // We cannot await stopInternal() here, but subsequent calls to stop() will await this if stopInternal() is still ongoing.\r\n this._stopPromise = this._stopInternal(error);\r\n }\r\n\r\n break;\r\n }\r\n case MessageType.Ack:\r\n if (this._messageBuffer) {\r\n this._messageBuffer._ack(message);\r\n }\r\n break;\r\n case MessageType.Sequence:\r\n if (this._messageBuffer) {\r\n this._messageBuffer._resetSequence(message);\r\n }\r\n break;\r\n default:\r\n this._logger.log(LogLevel.Warning, `Invalid message type: ${message.type}.`);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this._resetTimeoutPeriod();\r\n }\r\n\r\n private _processHandshakeResponse(data: any): any {\r\n let responseMessage: HandshakeResponseMessage;\r\n let remainingData: any;\r\n\r\n try {\r\n [remainingData, responseMessage] = this._handshakeProtocol.parseHandshakeResponse(data);\r\n } catch (e) {\r\n const message = \"Error parsing handshake response: \" + e;\r\n this._logger.log(LogLevel.Error, message);\r\n\r\n const error = new Error(message);\r\n this._handshakeRejecter(error);\r\n throw error;\r\n }\r\n if (responseMessage.error) {\r\n const message = \"Server returned handshake error: \" + responseMessage.error;\r\n this._logger.log(LogLevel.Error, message);\r\n\r\n const error = new Error(message);\r\n this._handshakeRejecter(error);\r\n throw error;\r\n } else {\r\n this._logger.log(LogLevel.Debug, \"Server handshake complete.\");\r\n }\r\n\r\n this._handshakeResolver();\r\n return remainingData;\r\n }\r\n\r\n private _resetKeepAliveInterval() {\r\n if (this.connection.features.inherentKeepAlive) {\r\n return;\r\n }\r\n\r\n // Set the time we want the next keep alive to be sent\r\n // Timer will be setup on next message receive\r\n this._nextKeepAlive = new Date().getTime() + this.keepAliveIntervalInMilliseconds;\r\n\r\n this._cleanupPingTimer();\r\n }\r\n\r\n private _resetTimeoutPeriod() {\r\n if (!this.connection.features || !this.connection.features.inherentKeepAlive) {\r\n // Set the timeout timer\r\n this._timeoutHandle = setTimeout(() => this.serverTimeout(), this.serverTimeoutInMilliseconds);\r\n\r\n // Set keepAlive timer if there isn't one\r\n if (this._pingServerHandle === undefined)\r\n {\r\n let nextPing = this._nextKeepAlive - new Date().getTime();\r\n if (nextPing < 0) {\r\n nextPing = 0;\r\n }\r\n\r\n // The timer needs to be set from a networking callback to avoid Chrome timer throttling from causing timers to run once a minute\r\n this._pingServerHandle = setTimeout(async () => {\r\n if (this._connectionState === HubConnectionState.Connected) {\r\n try {\r\n await this._sendMessage(this._cachedPingMessage);\r\n } catch {\r\n // We don't care about the error. It should be seen elsewhere in the client.\r\n // The connection is probably in a bad or closed state now, cleanup the timer so it stops triggering\r\n this._cleanupPingTimer();\r\n }\r\n }\r\n }, nextPing);\r\n }\r\n }\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private serverTimeout() {\r\n // The server hasn't talked to us in a while. It doesn't like us anymore ... :(\r\n // Terminate the connection, but we don't need to wait on the promise. This could trigger reconnecting.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.connection.stop(new Error(\"Server timeout elapsed without receiving a message from the server.\"));\r\n }\r\n\r\n private async _invokeClientMethod(invocationMessage: InvocationMessage) {\r\n const methodName = invocationMessage.target.toLowerCase();\r\n const methods = this._methods[methodName];\r\n if (!methods) {\r\n this._logger.log(LogLevel.Warning, `No client method with the name '${methodName}' found.`);\r\n\r\n // No handlers provided by client but the server is expecting a response still, so we send an error\r\n if (invocationMessage.invocationId) {\r\n this._logger.log(LogLevel.Warning, `No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);\r\n await this._sendWithProtocol(this._createCompletionMessage(invocationMessage.invocationId, \"Client didn't provide a result.\", null));\r\n }\r\n return;\r\n }\r\n\r\n // Avoid issues with handlers removing themselves thus modifying the list while iterating through it\r\n const methodsCopy = methods.slice();\r\n\r\n // Server expects a response\r\n const expectsResponse = invocationMessage.invocationId ? true : false;\r\n // We preserve the last result or exception but still call all handlers\r\n let res;\r\n let exception;\r\n let completionMessage;\r\n for (const m of methodsCopy) {\r\n try {\r\n const prevRes = res;\r\n res = await m.apply(this, invocationMessage.arguments);\r\n if (expectsResponse && res && prevRes) {\r\n this._logger.log(LogLevel.Error, `Multiple results provided for '${methodName}'. Sending error to server.`);\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, `Client provided multiple results.`, null);\r\n }\r\n // Ignore exception if we got a result after, the exception will be logged\r\n exception = undefined;\r\n } catch (e) {\r\n exception = e;\r\n this._logger.log(LogLevel.Error, `A callback for the method '${methodName}' threw error '${e}'.`);\r\n }\r\n }\r\n if (completionMessage) {\r\n await this._sendWithProtocol(completionMessage);\r\n } else if (expectsResponse) {\r\n // If there is an exception that means either no result was given or a handler after a result threw\r\n if (exception) {\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, `${exception}`, null);\r\n } else if (res !== undefined) {\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, null, res);\r\n } else {\r\n this._logger.log(LogLevel.Warning, `No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);\r\n // Client didn't provide a result or throw from a handler, server expects a response so we send an error\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, \"Client didn't provide a result.\", null);\r\n }\r\n await this._sendWithProtocol(completionMessage);\r\n } else {\r\n if (res) {\r\n this._logger.log(LogLevel.Error, `Result given for '${methodName}' method but server is not expecting a result.`);\r\n }\r\n }\r\n }\r\n\r\n private _connectionClosed(error?: Error) {\r\n this._logger.log(LogLevel.Debug, `HubConnection.connectionClosed(${error}) called while in state ${this._connectionState}.`);\r\n\r\n // Triggering this.handshakeRejecter is insufficient because it could already be resolved without the continuation having run yet.\r\n this._stopDuringStartError = this._stopDuringStartError || error || new AbortError(\"The underlying connection was closed before the hub handshake could complete.\");\r\n\r\n // If the handshake is in progress, start will be waiting for the handshake promise, so we complete it.\r\n // If it has already completed, this should just noop.\r\n if (this._handshakeResolver) {\r\n this._handshakeResolver();\r\n }\r\n\r\n this._cancelCallbacksWithError(error || new Error(\"Invocation canceled due to the underlying connection being closed.\"));\r\n\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._completeClose(error);\r\n } else if (this._connectionState === HubConnectionState.Connected && this._reconnectPolicy) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._reconnect(error);\r\n } else if (this._connectionState === HubConnectionState.Connected) {\r\n this._completeClose(error);\r\n }\r\n\r\n // If none of the above if conditions were true were called the HubConnection must be in either:\r\n // 1. The Connecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail it.\r\n // 2. The Reconnecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail the current reconnect attempt\r\n // and potentially continue the reconnect() loop.\r\n // 3. The Disconnected state in which case we're already done.\r\n }\r\n\r\n private _completeClose(error?: Error) {\r\n if (this._connectionStarted) {\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n if (this._messageBuffer) {\r\n this._messageBuffer._dispose(error ?? new Error(\"Connection closed.\"));\r\n this._messageBuffer = undefined;\r\n }\r\n\r\n if (Platform.isBrowser) {\r\n window.document.removeEventListener(\"freeze\", this._freezeEventListener);\r\n }\r\n\r\n try {\r\n this._closedCallbacks.forEach((c) => c.apply(this, [error]));\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `An onclose callback called with error '${error}' threw error '${e}'.`);\r\n }\r\n }\r\n }\r\n\r\n private async _reconnect(error?: Error) {\r\n const reconnectStartTime = Date.now();\r\n let previousReconnectAttempts = 0;\r\n let retryError = error !== undefined ? error : new Error(\"Attempting to reconnect due to a unknown error.\");\r\n\r\n let nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, 0, retryError);\r\n\r\n if (nextRetryDelay === null) {\r\n this._logger.log(LogLevel.Debug, \"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.\");\r\n this._completeClose(error);\r\n return;\r\n }\r\n\r\n this._connectionState = HubConnectionState.Reconnecting;\r\n\r\n if (error) {\r\n this._logger.log(LogLevel.Information, `Connection reconnecting because of error '${error}'.`);\r\n } else {\r\n this._logger.log(LogLevel.Information, \"Connection reconnecting.\");\r\n }\r\n\r\n if (this._reconnectingCallbacks.length !== 0) {\r\n try {\r\n this._reconnectingCallbacks.forEach((c) => c.apply(this, [error]));\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `An onreconnecting callback called with error '${error}' threw error '${e}'.`);\r\n }\r\n\r\n // Exit early if an onreconnecting callback called connection.stop().\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.\");\r\n return;\r\n }\r\n }\r\n\r\n while (nextRetryDelay !== null) {\r\n this._logger.log(LogLevel.Information, `Reconnect attempt number ${previousReconnectAttempts} will start in ${nextRetryDelay} ms.`);\r\n\r\n await new Promise((resolve) => {\r\n this._reconnectDelayHandle = setTimeout(resolve, nextRetryDelay!);\r\n });\r\n this._reconnectDelayHandle = undefined;\r\n\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state during reconnect delay. Done reconnecting.\");\r\n return;\r\n }\r\n\r\n try {\r\n await this._startInternal();\r\n\r\n this._connectionState = HubConnectionState.Connected;\r\n this._logger.log(LogLevel.Information, \"HubConnection reconnected successfully.\");\r\n\r\n if (this._reconnectedCallbacks.length !== 0) {\r\n try {\r\n this._reconnectedCallbacks.forEach((c) => c.apply(this, [this.connection.connectionId]));\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`);\r\n }\r\n }\r\n\r\n return;\r\n } catch (e) {\r\n this._logger.log(LogLevel.Information, `Reconnect attempt failed because of error '${e}'.`);\r\n\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, `Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`);\r\n // The TypeScript compiler thinks that connectionState must be Connected here. The TypeScript compiler is wrong.\r\n if (this._connectionState as any === HubConnectionState.Disconnecting) {\r\n this._completeClose();\r\n }\r\n return;\r\n }\r\n\r\n retryError = e instanceof Error ? e : new Error((e as any).toString());\r\n nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, Date.now() - reconnectStartTime, retryError);\r\n }\r\n }\r\n\r\n this._logger.log(LogLevel.Information, `Reconnect retries have been exhausted after ${Date.now() - reconnectStartTime} ms and ${previousReconnectAttempts} failed attempts. Connection disconnecting.`);\r\n\r\n this._completeClose();\r\n }\r\n\r\n private _getNextRetryDelay(previousRetryCount: number, elapsedMilliseconds: number, retryReason: Error) {\r\n try {\r\n return this._reconnectPolicy!.nextRetryDelayInMilliseconds({\r\n elapsedMilliseconds,\r\n previousRetryCount,\r\n retryReason,\r\n });\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `IRetryPolicy.nextRetryDelayInMilliseconds(${previousRetryCount}, ${elapsedMilliseconds}) threw error '${e}'.`);\r\n return null;\r\n }\r\n }\r\n\r\n private _cancelCallbacksWithError(error: Error) {\r\n const callbacks = this._callbacks;\r\n this._callbacks = {};\r\n\r\n Object.keys(callbacks)\r\n .forEach((key) => {\r\n const callback = callbacks[key];\r\n try {\r\n callback(null, error);\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `Stream 'error' callback called with '${error}' threw error: ${getErrorString(e)}`);\r\n }\r\n });\r\n }\r\n\r\n private _cleanupPingTimer(): void {\r\n if (this._pingServerHandle) {\r\n clearTimeout(this._pingServerHandle);\r\n this._pingServerHandle = undefined;\r\n }\r\n }\r\n\r\n private _cleanupTimeout(): void {\r\n if (this._timeoutHandle) {\r\n clearTimeout(this._timeoutHandle);\r\n }\r\n }\r\n\r\n private _createInvocation(methodName: string, args: any[], nonblocking: boolean, streamIds: string[]): InvocationMessage {\r\n if (nonblocking) {\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n } else {\r\n return {\r\n arguments: args,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n } else {\r\n const invocationId = this._invocationId;\r\n this._invocationId++;\r\n\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n } else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n }\r\n }\r\n\r\n private _launchStreams(streams: IStreamResult[], promiseQueue: Promise): void {\r\n if (streams.length === 0) {\r\n return;\r\n }\r\n\r\n // Synchronize stream data so they arrive in-order on the server\r\n if (!promiseQueue) {\r\n promiseQueue = Promise.resolve();\r\n }\r\n\r\n // We want to iterate over the keys, since the keys are the stream ids\r\n // eslint-disable-next-line guard-for-in\r\n for (const streamId in streams) {\r\n streams[streamId].subscribe({\r\n complete: () => {\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId)));\r\n },\r\n error: (err) => {\r\n let message: string;\r\n if (err instanceof Error) {\r\n message = err.message;\r\n } else if (err && err.toString) {\r\n message = err.toString();\r\n } else {\r\n message = \"Unknown error\";\r\n }\r\n\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId, message)));\r\n },\r\n next: (item) => {\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createStreamItemMessage(streamId, item)));\r\n },\r\n });\r\n }\r\n }\r\n\r\n private _replaceStreamingParams(args: any[]): [IStreamResult[], string[]] {\r\n const streams: IStreamResult[] = [];\r\n const streamIds: string[] = [];\r\n for (let i = 0; i < args.length; i++) {\r\n const argument = args[i];\r\n if (this._isObservable(argument)) {\r\n const streamId = this._invocationId;\r\n this._invocationId++;\r\n // Store the stream for later use\r\n streams[streamId] = argument;\r\n streamIds.push(streamId.toString());\r\n\r\n // remove stream from args\r\n args.splice(i, 1);\r\n }\r\n }\r\n\r\n return [streams, streamIds];\r\n }\r\n\r\n private _isObservable(arg: any): arg is IStreamResult {\r\n // This allows other stream implementations to just work (like rxjs)\r\n return arg && arg.subscribe && typeof arg.subscribe === \"function\";\r\n }\r\n\r\n private _createStreamInvocation(methodName: string, args: any[], streamIds: string[]): StreamInvocationMessage {\r\n const invocationId = this._invocationId;\r\n this._invocationId++;\r\n\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n } else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n }\r\n }\r\n\r\n private _createCancelInvocation(id: string): CancelInvocationMessage {\r\n return {\r\n invocationId: id,\r\n type: MessageType.CancelInvocation,\r\n };\r\n }\r\n\r\n private _createStreamItemMessage(id: string, item: any): StreamItemMessage {\r\n return {\r\n invocationId: id,\r\n item,\r\n type: MessageType.StreamItem,\r\n };\r\n }\r\n\r\n private _createCompletionMessage(id: string, error?: any, result?: any): CompletionMessage {\r\n if (error) {\r\n return {\r\n error,\r\n invocationId: id,\r\n type: MessageType.Completion,\r\n };\r\n }\r\n\r\n return {\r\n invocationId: id,\r\n result,\r\n type: MessageType.Completion,\r\n };\r\n }\r\n\r\n private _createCloseMessage(): CloseMessage {\r\n return { type: MessageType.Close };\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { IRetryPolicy, RetryContext } from \"./IRetryPolicy\";\r\n\r\n// 0, 2, 10, 30 second delays before reconnect attempts.\r\nconst DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];\r\n\r\n/** @private */\r\nexport class DefaultReconnectPolicy implements IRetryPolicy {\r\n private readonly _retryDelays: (number | null)[];\r\n\r\n constructor(retryDelays?: number[]) {\r\n this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;\r\n }\r\n\r\n public nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null {\r\n return this._retryDelays[retryContext.previousRetryCount];\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nexport abstract class HeaderNames {\r\n static readonly Authorization = \"Authorization\";\r\n static readonly Cookie = \"Cookie\";\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\n\r\n/** @private */\r\nexport class AccessTokenHttpClient extends HttpClient {\r\n private _innerClient: HttpClient;\r\n _accessToken: string | undefined;\r\n _accessTokenFactory: (() => string | Promise) | undefined;\r\n\r\n constructor(innerClient: HttpClient, accessTokenFactory: (() => string | Promise) | undefined) {\r\n super();\r\n\r\n this._innerClient = innerClient;\r\n this._accessTokenFactory = accessTokenFactory;\r\n }\r\n\r\n public async send(request: HttpRequest): Promise {\r\n let allowRetry = true;\r\n if (this._accessTokenFactory && (!this._accessToken || (request.url && request.url.indexOf(\"/negotiate?\") > 0))) {\r\n // don't retry if the request is a negotiate or if we just got a potentially new token from the access token factory\r\n allowRetry = false;\r\n this._accessToken = await this._accessTokenFactory();\r\n }\r\n this._setAuthorizationHeader(request);\r\n const response = await this._innerClient.send(request);\r\n\r\n if (allowRetry && response.statusCode === 401 && this._accessTokenFactory) {\r\n this._accessToken = await this._accessTokenFactory();\r\n this._setAuthorizationHeader(request);\r\n return await this._innerClient.send(request);\r\n }\r\n return response;\r\n }\r\n\r\n private _setAuthorizationHeader(request: HttpRequest) {\r\n if (!request.headers) {\r\n request.headers = {};\r\n }\r\n if (this._accessToken) {\r\n request.headers[HeaderNames.Authorization] = `Bearer ${this._accessToken}`\r\n }\r\n // don't remove the header if there isn't an access token factory, the user manually added the header in this case\r\n else if (this._accessTokenFactory) {\r\n if (request.headers[HeaderNames.Authorization]) {\r\n delete request.headers[HeaderNames.Authorization];\r\n }\r\n }\r\n }\r\n\r\n public getCookieString(url: string): string {\r\n return this._innerClient.getCookieString(url);\r\n }\r\n}","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// This will be treated as a bit flag in the future, so we keep it using power-of-two values.\r\n/** Specifies a specific HTTP transport type. */\r\nexport enum HttpTransportType {\r\n /** Specifies no transport preference. */\r\n None = 0,\r\n /** Specifies the WebSockets transport. */\r\n WebSockets = 1,\r\n /** Specifies the Server-Sent Events transport. */\r\n ServerSentEvents = 2,\r\n /** Specifies the Long Polling transport. */\r\n LongPolling = 4,\r\n}\r\n\r\n/** Specifies the transfer format for a connection. */\r\nexport enum TransferFormat {\r\n /** Specifies that only text data will be transmitted over the connection. */\r\n Text = 1,\r\n /** Specifies that binary data will be transmitted over the connection. */\r\n Binary = 2,\r\n}\r\n\r\n/** An abstraction over the behavior of transports. This is designed to support the framework and not intended for use by applications. */\r\nexport interface ITransport {\r\n connect(url: string, transferFormat: TransferFormat): Promise;\r\n send(data: any): Promise;\r\n stop(): Promise;\r\n onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n onclose: ((error?: Error) => void) | null;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController\r\n// We don't actually ever use the API being polyfilled, we always use the polyfill because\r\n// it's a very new API right now.\r\n\r\n// Not exported from index.\r\n/** @private */\r\nexport class AbortController implements AbortSignal {\r\n private _isAborted: boolean = false;\r\n public onabort: (() => void) | null = null;\r\n\r\n public abort(): void {\r\n if (!this._isAborted) {\r\n this._isAborted = true;\r\n if (this.onabort) {\r\n this.onabort();\r\n }\r\n }\r\n }\r\n\r\n get signal(): AbortSignal {\r\n return this;\r\n }\r\n\r\n get aborted(): boolean {\r\n return this._isAborted;\r\n }\r\n}\r\n\r\n/** Represents a signal that can be monitored to determine if a request has been aborted. */\r\nexport interface AbortSignal {\r\n /** Indicates if the request has been aborted. */\r\n aborted: boolean;\r\n /** Set this to a handler that will be invoked when the request is aborted. */\r\n onabort: (() => void) | null;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortController } from \"./AbortController\";\r\nimport { HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpRequest } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { ITransport, TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, sendMessage } from \"./Utils\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\n\r\n// Not exported from 'index', this type is internal.\r\n/** @private */\r\nexport class LongPollingTransport implements ITransport {\r\n private readonly _httpClient: HttpClient;\r\n private readonly _logger: ILogger;\r\n private readonly _options: IHttpConnectionOptions;\r\n private readonly _pollAbort: AbortController;\r\n\r\n private _url?: string;\r\n private _running: boolean;\r\n private _receiving?: Promise;\r\n private _closeError?: Error | unknown;\r\n\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((error?: Error | unknown) => void) | null;\r\n\r\n // This is an internal type, not exported from 'index' so this is really just internal.\r\n public get pollAborted(): boolean {\r\n return this._pollAbort.aborted;\r\n }\r\n\r\n constructor(httpClient: HttpClient, logger: ILogger, options: IHttpConnectionOptions) {\r\n this._httpClient = httpClient;\r\n this._logger = logger;\r\n this._pollAbort = new AbortController();\r\n this._options = options;\r\n\r\n this._running = false;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n\r\n public async connect(url: string, transferFormat: TransferFormat): Promise {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n\r\n this._url = url;\r\n\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Connecting.\");\r\n\r\n // Allow binary format on Node and Browsers that support binary content (indicated by the presence of responseType property)\r\n if (transferFormat === TransferFormat.Binary &&\r\n (typeof XMLHttpRequest !== \"undefined\" && typeof new XMLHttpRequest().responseType !== \"string\")) {\r\n throw new Error(\"Binary protocols over XmlHttpRequest not implementing advanced features are not supported.\");\r\n }\r\n\r\n const [name, value] = getUserAgentHeader();\r\n const headers = { [name]: value, ...this._options.headers };\r\n\r\n const pollOptions: HttpRequest = {\r\n abortSignal: this._pollAbort.signal,\r\n headers,\r\n timeout: 100000,\r\n withCredentials: this._options.withCredentials,\r\n };\r\n\r\n if (transferFormat === TransferFormat.Binary) {\r\n pollOptions.responseType = \"arraybuffer\";\r\n }\r\n\r\n // Make initial long polling request\r\n // Server uses first long polling request to finish initializing connection and it returns without data\r\n const pollUrl = `${url}&_=${Date.now()}`;\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r\n const response = await this._httpClient.get(pollUrl, pollOptions);\r\n if (response.statusCode !== 200) {\r\n this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\n\r\n // Mark running as false so that the poll immediately ends and runs the close logic\r\n this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this._running = false;\r\n } else {\r\n this._running = true;\r\n }\r\n\r\n this._receiving = this._poll(this._url, pollOptions);\r\n }\r\n\r\n private async _poll(url: string, pollOptions: HttpRequest): Promise {\r\n try {\r\n while (this._running) {\r\n try {\r\n const pollUrl = `${url}&_=${Date.now()}`;\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r\n const response = await this._httpClient.get(pollUrl, pollOptions);\r\n\r\n if (response.statusCode === 204) {\r\n this._logger.log(LogLevel.Information, \"(LongPolling transport) Poll terminated by server.\");\r\n\r\n this._running = false;\r\n } else if (response.statusCode !== 200) {\r\n this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\n\r\n // Unexpected status code\r\n this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this._running = false;\r\n } else {\r\n // Process the response\r\n if (response.content) {\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) data received. ${getDataDetail(response.content, this._options.logMessageContent!)}.`);\r\n if (this.onreceive) {\r\n this.onreceive(response.content);\r\n }\r\n } else {\r\n // This is another way timeout manifest.\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n }\r\n }\r\n } catch (e) {\r\n if (!this._running) {\r\n // Log but disregard errors that occur after stopping\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) Poll errored after shutdown: ${(e as any).message}`);\r\n } else {\r\n if (e instanceof TimeoutError) {\r\n // Ignore timeouts and reissue the poll.\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n } else {\r\n // Close the connection with the error as the result.\r\n this._closeError = e;\r\n this._running = false;\r\n }\r\n }\r\n }\r\n }\r\n } finally {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Polling complete.\");\r\n\r\n // We will reach here with pollAborted==false when the server returned a response causing the transport to stop.\r\n // If pollAborted==true then client initiated the stop and the stop method will raise the close event after DELETE is sent.\r\n if (!this.pollAborted) {\r\n this._raiseOnClose();\r\n }\r\n }\r\n }\r\n\r\n public async send(data: any): Promise {\r\n if (!this._running) {\r\n return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r\n }\r\n return sendMessage(this._logger, \"LongPolling\", this._httpClient, this._url!, data, this._options);\r\n }\r\n\r\n public async stop(): Promise {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stopping polling.\");\r\n\r\n // Tell receiving loop to stop, abort any current request, and then wait for it to finish\r\n this._running = false;\r\n this._pollAbort.abort();\r\n\r\n try {\r\n await this._receiving;\r\n\r\n // Send DELETE to clean up long polling on the server\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) sending DELETE request to ${this._url}.`);\r\n\r\n const headers: {[k: string]: string} = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n const deleteOptions: HttpRequest = {\r\n headers: { ...headers, ...this._options.headers },\r\n timeout: this._options.timeout,\r\n withCredentials: this._options.withCredentials,\r\n };\r\n\r\n let error;\r\n try {\r\n await this._httpClient.delete(this._url!, deleteOptions);\r\n } catch (err) {\r\n error = err;\r\n }\r\n\r\n if (error) {\r\n if (error instanceof HttpError) {\r\n if (error.statusCode === 404) {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) A 404 response was returned from sending a DELETE request.\");\r\n } else {\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) Error sending a DELETE request: ${error}`);\r\n }\r\n }\r\n } else {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) DELETE request accepted.\");\r\n }\r\n\r\n } finally {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stop finished.\");\r\n\r\n // Raise close event here instead of in polling\r\n // It needs to happen after the DELETE request is sent\r\n this._raiseOnClose();\r\n }\r\n }\r\n\r\n private _raiseOnClose() {\r\n if (this.onclose) {\r\n let logMessage = \"(LongPolling transport) Firing onclose event.\";\r\n if (this._closeError) {\r\n logMessage += \" Error: \" + this._closeError;\r\n }\r\n this._logger.log(LogLevel.Trace, logMessage);\r\n this.onclose(this._closeError);\r\n }\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { MessageHeaders } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { ITransport, TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform, sendMessage } from \"./Utils\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\n\r\n/** @private */\r\nexport class ServerSentEventsTransport implements ITransport {\r\n private readonly _httpClient: HttpClient;\r\n private readonly _accessToken: string | undefined;\r\n private readonly _logger: ILogger;\r\n private readonly _options: IHttpConnectionOptions;\r\n private _eventSource?: EventSource;\r\n private _url?: string;\r\n\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((error?: Error | unknown) => void) | null;\r\n\r\n constructor(httpClient: HttpClient, accessToken: string | undefined, logger: ILogger,\r\n options: IHttpConnectionOptions) {\r\n this._httpClient = httpClient;\r\n this._accessToken = accessToken;\r\n this._logger = logger;\r\n this._options = options;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n\r\n public async connect(url: string, transferFormat: TransferFormat): Promise {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n\r\n this._logger.log(LogLevel.Trace, \"(SSE transport) Connecting.\");\r\n\r\n // set url before accessTokenFactory because this._url is only for send and we set the auth header instead of the query string for send\r\n this._url = url;\r\n\r\n if (this._accessToken) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(this._accessToken)}`;\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n let opened = false;\r\n if (transferFormat !== TransferFormat.Text) {\r\n reject(new Error(\"The Server-Sent Events transport only supports the 'Text' transfer format\"));\r\n return;\r\n }\r\n\r\n let eventSource: EventSource;\r\n if (Platform.isBrowser || Platform.isWebWorker) {\r\n eventSource = new this._options.EventSource!(url, { withCredentials: this._options.withCredentials });\r\n } else {\r\n // Non-browser passes cookies via the dictionary\r\n const cookies = this._httpClient.getCookieString(url);\r\n const headers: MessageHeaders = {};\r\n headers.Cookie = cookies;\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n eventSource = new this._options.EventSource!(url, { withCredentials: this._options.withCredentials, headers: { ...headers, ...this._options.headers} } as EventSourceInit);\r\n }\r\n\r\n try {\r\n eventSource.onmessage = (e: MessageEvent) => {\r\n if (this.onreceive) {\r\n try {\r\n this._logger.log(LogLevel.Trace, `(SSE transport) data received. ${getDataDetail(e.data, this._options.logMessageContent!)}.`);\r\n this.onreceive(e.data);\r\n } catch (error) {\r\n this._close(error);\r\n return;\r\n }\r\n }\r\n };\r\n\r\n // @ts-ignore: not using event on purpose\r\n eventSource.onerror = (e: Event) => {\r\n // EventSource doesn't give any useful information about server side closes.\r\n if (opened) {\r\n this._close();\r\n } else {\r\n reject(new Error(\"EventSource failed to connect. The connection could not be found on the server,\"\r\n + \" either the connection ID is not present on the server, or a proxy is refusing/buffering the connection.\"\r\n + \" If you have multiple servers check that sticky sessions are enabled.\"));\r\n }\r\n };\r\n\r\n eventSource.onopen = () => {\r\n this._logger.log(LogLevel.Information, `SSE connected to ${this._url}`);\r\n this._eventSource = eventSource;\r\n opened = true;\r\n resolve();\r\n };\r\n } catch (e) {\r\n reject(e);\r\n return;\r\n }\r\n });\r\n }\r\n\r\n public async send(data: any): Promise {\r\n if (!this._eventSource) {\r\n return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r\n }\r\n return sendMessage(this._logger, \"SSE\", this._httpClient, this._url!, data, this._options);\r\n }\r\n\r\n public stop(): Promise {\r\n this._close();\r\n return Promise.resolve();\r\n }\r\n\r\n private _close(e?: Error | unknown) {\r\n if (this._eventSource) {\r\n this._eventSource.close();\r\n this._eventSource = undefined;\r\n\r\n if (this.onclose) {\r\n this.onclose(e);\r\n }\r\n }\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { MessageHeaders } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { ITransport, TransferFormat } from \"./ITransport\";\r\nimport { WebSocketConstructor } from \"./Polyfills\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform } from \"./Utils\";\r\n\r\n/** @private */\r\nexport class WebSocketTransport implements ITransport {\r\n private readonly _logger: ILogger;\r\n private readonly _accessTokenFactory: (() => string | Promise) | undefined;\r\n private readonly _logMessageContent: boolean;\r\n private readonly _webSocketConstructor: WebSocketConstructor;\r\n private readonly _httpClient: HttpClient;\r\n private _webSocket?: WebSocket;\r\n private _headers: MessageHeaders;\r\n\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((error?: Error) => void) | null;\r\n\r\n constructor(httpClient: HttpClient, accessTokenFactory: (() => string | Promise) | undefined, logger: ILogger,\r\n logMessageContent: boolean, webSocketConstructor: WebSocketConstructor, headers: MessageHeaders) {\r\n this._logger = logger;\r\n this._accessTokenFactory = accessTokenFactory;\r\n this._logMessageContent = logMessageContent;\r\n this._webSocketConstructor = webSocketConstructor;\r\n this._httpClient = httpClient;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n this._headers = headers;\r\n }\r\n\r\n public async connect(url: string, transferFormat: TransferFormat): Promise {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this._logger.log(LogLevel.Trace, \"(WebSockets transport) Connecting.\");\r\n\r\n let token: string;\r\n if (this._accessTokenFactory) {\r\n token = await this._accessTokenFactory();\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n url = url.replace(/^http/, \"ws\");\r\n let webSocket: WebSocket | undefined;\r\n const cookies = this._httpClient.getCookieString(url);\r\n let opened = false;\r\n\r\n if (Platform.isNode || Platform.isReactNative) {\r\n const headers: {[k: string]: string} = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n if (token) {\r\n headers[HeaderNames.Authorization] = `Bearer ${token}`;\r\n }\r\n\r\n if (cookies) {\r\n headers[HeaderNames.Cookie] = cookies;\r\n }\r\n\r\n // Only pass headers when in non-browser environments\r\n webSocket = new this._webSocketConstructor(url, undefined, {\r\n headers: { ...headers, ...this._headers },\r\n });\r\n }\r\n else\r\n {\r\n if (token) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(token)}`;\r\n }\r\n }\r\n\r\n if (!webSocket) {\r\n // Chrome is not happy with passing 'undefined' as protocol\r\n webSocket = new this._webSocketConstructor(url);\r\n }\r\n\r\n if (transferFormat === TransferFormat.Binary) {\r\n webSocket.binaryType = \"arraybuffer\";\r\n }\r\n\r\n webSocket.onopen = (_event: Event) => {\r\n this._logger.log(LogLevel.Information, `WebSocket connected to ${url}.`);\r\n this._webSocket = webSocket;\r\n opened = true;\r\n resolve();\r\n };\r\n\r\n webSocket.onerror = (event: Event) => {\r\n let error: any = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n } else {\r\n error = \"There was an error with the transport\";\r\n }\r\n\r\n this._logger.log(LogLevel.Information, `(WebSockets transport) ${error}.`);\r\n };\r\n\r\n webSocket.onmessage = (message: MessageEvent) => {\r\n this._logger.log(LogLevel.Trace, `(WebSockets transport) data received. ${getDataDetail(message.data, this._logMessageContent)}.`);\r\n if (this.onreceive) {\r\n try {\r\n this.onreceive(message.data);\r\n } catch (error) {\r\n this._close(error);\r\n return;\r\n }\r\n }\r\n };\r\n\r\n webSocket.onclose = (event: CloseEvent) => {\r\n // Don't call close handler if connection was never established\r\n // We'll reject the connect call instead\r\n if (opened) {\r\n this._close(event);\r\n } else {\r\n let error: any = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n } else {\r\n error = \"WebSocket failed to connect. The connection could not be found on the server,\"\r\n + \" either the endpoint may not be a SignalR endpoint,\"\r\n + \" the connection ID is not present on the server, or there is a proxy blocking WebSockets.\"\r\n + \" If you have multiple servers check that sticky sessions are enabled.\";\r\n }\r\n\r\n reject(new Error(error));\r\n }\r\n };\r\n });\r\n }\r\n\r\n public send(data: any): Promise {\r\n if (this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN) {\r\n this._logger.log(LogLevel.Trace, `(WebSockets transport) sending data. ${getDataDetail(data, this._logMessageContent)}.`);\r\n this._webSocket.send(data);\r\n return Promise.resolve();\r\n }\r\n\r\n return Promise.reject(\"WebSocket is not in the OPEN state\");\r\n }\r\n\r\n public stop(): Promise {\r\n if (this._webSocket) {\r\n // Manually invoke onclose callback inline so we know the HttpConnection was closed properly before returning\r\n // This also solves an issue where websocket.onclose could take 18+ seconds to trigger during network disconnects\r\n this._close(undefined);\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n private _close(event: CloseEvent | Error | unknown): void {\r\n // webSocket will be null if the transport did not start successfully\r\n if (this._webSocket) {\r\n // Clear websocket handlers because we are considering the socket closed now\r\n this._webSocket.onclose = () => {};\r\n this._webSocket.onmessage = () => {};\r\n this._webSocket.onerror = () => {};\r\n this._webSocket.close();\r\n this._webSocket = undefined;\r\n }\r\n\r\n this._logger.log(LogLevel.Trace, \"(WebSockets transport) socket closed.\");\r\n\r\n if (this.onclose) {\r\n if (this._isCloseEvent(event) && (event.wasClean === false || event.code !== 1000)) {\r\n this.onclose(new Error(`WebSocket closed with status code: ${event.code} (${event.reason || \"no reason given\"}).`));\r\n } else if (event instanceof Error) {\r\n this.onclose(event);\r\n } else {\r\n this.onclose();\r\n }\r\n }\r\n }\r\n\r\n private _isCloseEvent(event?: any): event is CloseEvent {\r\n return event && typeof event.wasClean === \"boolean\" && typeof event.code === \"number\";\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AccessTokenHttpClient } from \"./AccessTokenHttpClient\";\r\nimport { DefaultHttpClient } from \"./DefaultHttpClient\";\r\nimport { getEventSource, getWS } from \"./DynamicImports\";\r\nimport { AggregateErrors, DisabledTransportError, FailedToNegotiateWithServerError, FailedToStartTransportError, HttpError, UnsupportedTransportError, AbortError } from \"./Errors\";\r\nimport { IConnection } from \"./IConnection\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { HttpTransportType, ITransport, TransferFormat } from \"./ITransport\";\r\nimport { LongPollingTransport } from \"./LongPollingTransport\";\r\nimport { ServerSentEventsTransport } from \"./ServerSentEventsTransport\";\r\nimport { Arg, createLogger, getUserAgentHeader, Platform } from \"./Utils\";\r\nimport { WebSocketTransport } from \"./WebSocketTransport\";\r\n\r\n/** @private */\r\nconst enum ConnectionState {\r\n Connecting = \"Connecting\",\r\n Connected = \"Connected\",\r\n Disconnected = \"Disconnected\",\r\n Disconnecting = \"Disconnecting\",\r\n}\r\n\r\n/** @private */\r\nexport interface INegotiateResponse {\r\n connectionId?: string;\r\n connectionToken?: string;\r\n negotiateVersion?: number;\r\n availableTransports?: IAvailableTransport[];\r\n url?: string;\r\n accessToken?: string;\r\n error?: string;\r\n useStatefulReconnect?: boolean;\r\n}\r\n\r\n/** @private */\r\nexport interface IAvailableTransport {\r\n transport: keyof typeof HttpTransportType;\r\n transferFormats: (keyof typeof TransferFormat)[];\r\n}\r\n\r\nconst MAX_REDIRECTS = 100;\r\n\r\n/** @private */\r\nexport class HttpConnection implements IConnection {\r\n private _connectionState: ConnectionState;\r\n // connectionStarted is tracked independently from connectionState, so we can check if the\r\n // connection ever did successfully transition from connecting to connected before disconnecting.\r\n private _connectionStarted: boolean;\r\n private readonly _httpClient: AccessTokenHttpClient;\r\n private readonly _logger: ILogger;\r\n private readonly _options: IHttpConnectionOptions;\r\n // Needs to not start with _ to be available for tests\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private transport?: ITransport;\r\n private _startInternalPromise?: Promise;\r\n private _stopPromise?: Promise;\r\n private _stopPromiseResolver: (value?: PromiseLike) => void = () => {};\r\n private _stopError?: Error;\r\n private _accessTokenFactory?: () => string | Promise;\r\n private _sendQueue?: TransportSendQueue;\r\n\r\n public readonly features: any = {};\r\n public baseUrl: string;\r\n public connectionId?: string;\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((e?: Error) => void) | null;\r\n\r\n private readonly _negotiateVersion: number = 1;\r\n\r\n constructor(url: string, options: IHttpConnectionOptions = {}) {\r\n Arg.isRequired(url, \"url\");\r\n\r\n this._logger = createLogger(options.logger);\r\n this.baseUrl = this._resolveUrl(url);\r\n\r\n options = options || {};\r\n options.logMessageContent = options.logMessageContent === undefined ? false : options.logMessageContent;\r\n if (typeof options.withCredentials === \"boolean\" || options.withCredentials === undefined) {\r\n options.withCredentials = options.withCredentials === undefined ? true : options.withCredentials;\r\n } else {\r\n throw new Error(\"withCredentials option was not a 'boolean' or 'undefined' value\");\r\n }\r\n options.timeout = options.timeout === undefined ? 100 * 1000 : options.timeout;\r\n\r\n let webSocketModule: any = null;\r\n let eventSourceModule: any = null;\r\n\r\n if (Platform.isNode && typeof require !== \"undefined\") {\r\n webSocketModule = getWS();\r\n eventSourceModule = getEventSource();\r\n }\r\n\r\n if (!Platform.isNode && typeof WebSocket !== \"undefined\" && !options.WebSocket) {\r\n options.WebSocket = WebSocket;\r\n } else if (Platform.isNode && !options.WebSocket) {\r\n if (webSocketModule) {\r\n options.WebSocket = webSocketModule;\r\n }\r\n }\r\n\r\n if (!Platform.isNode && typeof EventSource !== \"undefined\" && !options.EventSource) {\r\n options.EventSource = EventSource;\r\n } else if (Platform.isNode && !options.EventSource) {\r\n if (typeof eventSourceModule !== \"undefined\") {\r\n options.EventSource = eventSourceModule;\r\n }\r\n }\r\n\r\n this._httpClient = new AccessTokenHttpClient(options.httpClient || new DefaultHttpClient(this._logger), options.accessTokenFactory);\r\n this._connectionState = ConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n this._options = options;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n\r\n public start(): Promise;\r\n public start(transferFormat: TransferFormat): Promise;\r\n public async start(transferFormat?: TransferFormat): Promise {\r\n transferFormat = transferFormat || TransferFormat.Binary;\r\n\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n\r\n this._logger.log(LogLevel.Debug, `Starting connection with transfer format '${TransferFormat[transferFormat]}'.`);\r\n\r\n if (this._connectionState !== ConnectionState.Disconnected) {\r\n return Promise.reject(new Error(\"Cannot start an HttpConnection that is not in the 'Disconnected' state.\"));\r\n }\r\n\r\n this._connectionState = ConnectionState.Connecting;\r\n\r\n this._startInternalPromise = this._startInternal(transferFormat);\r\n await this._startInternalPromise;\r\n\r\n // The TypeScript compiler thinks that connectionState must be Connecting here. The TypeScript compiler is wrong.\r\n if (this._connectionState as any === ConnectionState.Disconnecting) {\r\n // stop() was called and transitioned the client into the Disconnecting state.\r\n const message = \"Failed to start the HttpConnection before stop() was called.\";\r\n this._logger.log(LogLevel.Error, message);\r\n\r\n // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise.\r\n await this._stopPromise;\r\n\r\n return Promise.reject(new AbortError(message));\r\n } else if (this._connectionState as any !== ConnectionState.Connected) {\r\n // stop() was called and transitioned the client into the Disconnecting state.\r\n const message = \"HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!\";\r\n this._logger.log(LogLevel.Error, message);\r\n return Promise.reject(new AbortError(message));\r\n }\r\n\r\n this._connectionStarted = true;\r\n }\r\n\r\n public send(data: string | ArrayBuffer): Promise {\r\n if (this._connectionState !== ConnectionState.Connected) {\r\n return Promise.reject(new Error(\"Cannot send data if the connection is not in the 'Connected' State.\"));\r\n }\r\n\r\n if (!this._sendQueue) {\r\n this._sendQueue = new TransportSendQueue(this.transport!);\r\n }\r\n\r\n // Transport will not be null if state is connected\r\n return this._sendQueue.send(data);\r\n }\r\n\r\n public async stop(error?: Error): Promise {\r\n if (this._connectionState === ConnectionState.Disconnected) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnected state.`);\r\n return Promise.resolve();\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Disconnecting) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r\n return this._stopPromise;\r\n }\r\n\r\n this._connectionState = ConnectionState.Disconnecting;\r\n\r\n this._stopPromise = new Promise((resolve) => {\r\n // Don't complete stop() until stopConnection() completes.\r\n this._stopPromiseResolver = resolve;\r\n });\r\n\r\n // stopInternal should never throw so just observe it.\r\n await this._stopInternal(error);\r\n await this._stopPromise;\r\n }\r\n\r\n private async _stopInternal(error?: Error): Promise {\r\n // Set error as soon as possible otherwise there is a race between\r\n // the transport closing and providing an error and the error from a close message\r\n // We would prefer the close message error.\r\n this._stopError = error;\r\n\r\n try {\r\n await this._startInternalPromise;\r\n } catch (e) {\r\n // This exception is returned to the user as a rejected Promise from the start method.\r\n }\r\n\r\n // The transport's onclose will trigger stopConnection which will run our onclose event.\r\n // The transport should always be set if currently connected. If it wasn't set, it's likely because\r\n // stop was called during start() and start() failed.\r\n if (this.transport) {\r\n try {\r\n await this.transport.stop();\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `HttpConnection.transport.stop() threw error '${e}'.`);\r\n this._stopConnection();\r\n }\r\n\r\n this.transport = undefined;\r\n } else {\r\n this._logger.log(LogLevel.Debug, \"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.\");\r\n }\r\n }\r\n\r\n private async _startInternal(transferFormat: TransferFormat): Promise {\r\n // Store the original base url and the access token factory since they may change\r\n // as part of negotiating\r\n let url = this.baseUrl;\r\n this._accessTokenFactory = this._options.accessTokenFactory;\r\n this._httpClient._accessTokenFactory = this._accessTokenFactory;\r\n\r\n try {\r\n if (this._options.skipNegotiation) {\r\n if (this._options.transport === HttpTransportType.WebSockets) {\r\n // No need to add a connection ID in this case\r\n this.transport = this._constructTransport(HttpTransportType.WebSockets);\r\n // We should just call connect directly in this case.\r\n // No fallback or negotiate in this case.\r\n await this._startTransport(url, transferFormat);\r\n } else {\r\n throw new Error(\"Negotiation can only be skipped when using the WebSocket transport directly.\");\r\n }\r\n } else {\r\n let negotiateResponse: INegotiateResponse | null = null;\r\n let redirects = 0;\r\n\r\n do {\r\n negotiateResponse = await this._getNegotiationResponse(url);\r\n // the user tries to stop the connection when it is being started\r\n if (this._connectionState === ConnectionState.Disconnecting || this._connectionState === ConnectionState.Disconnected) {\r\n throw new AbortError(\"The connection was stopped during negotiation.\");\r\n }\r\n\r\n if (negotiateResponse.error) {\r\n throw new Error(negotiateResponse.error);\r\n }\r\n\r\n if ((negotiateResponse as any).ProtocolVersion) {\r\n throw new Error(\"Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.\");\r\n }\r\n\r\n if (negotiateResponse.url) {\r\n url = negotiateResponse.url;\r\n }\r\n\r\n if (negotiateResponse.accessToken) {\r\n // Replace the current access token factory with one that uses\r\n // the returned access token\r\n const accessToken = negotiateResponse.accessToken;\r\n this._accessTokenFactory = () => accessToken;\r\n // set the factory to undefined so the AccessTokenHttpClient won't retry with the same token, since we know it won't change until a connection restart\r\n this._httpClient._accessToken = accessToken;\r\n this._httpClient._accessTokenFactory = undefined;\r\n }\r\n\r\n redirects++;\r\n }\r\n while (negotiateResponse.url && redirects < MAX_REDIRECTS);\r\n\r\n if (redirects === MAX_REDIRECTS && negotiateResponse.url) {\r\n throw new Error(\"Negotiate redirection limit exceeded.\");\r\n }\r\n\r\n await this._createTransport(url, this._options.transport, negotiateResponse, transferFormat);\r\n }\r\n\r\n if (this.transport instanceof LongPollingTransport) {\r\n this.features.inherentKeepAlive = true;\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Connecting) {\r\n // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise.\r\n // start() will handle the case when stop was called and startInternal exits still in the disconnecting state.\r\n this._logger.log(LogLevel.Debug, \"The HttpConnection connected successfully.\");\r\n this._connectionState = ConnectionState.Connected;\r\n }\r\n\r\n // stop() is waiting on us via this.startInternalPromise so keep this.transport around so it can clean up.\r\n // This is the only case startInternal can exit in neither the connected nor disconnected state because stopConnection()\r\n // will transition to the disconnected state. start() will wait for the transition using the stopPromise.\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, \"Failed to start the connection: \" + e);\r\n this._connectionState = ConnectionState.Disconnected;\r\n this.transport = undefined;\r\n\r\n // if start fails, any active calls to stop assume that start will complete the stop promise\r\n this._stopPromiseResolver();\r\n return Promise.reject(e);\r\n }\r\n }\r\n\r\n private async _getNegotiationResponse(url: string): Promise {\r\n const headers: {[k: string]: string} = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n const negotiateUrl = this._resolveNegotiateUrl(url);\r\n this._logger.log(LogLevel.Debug, `Sending negotiation request: ${negotiateUrl}.`);\r\n try {\r\n const response = await this._httpClient.post(negotiateUrl, {\r\n content: \"\",\r\n headers: { ...headers, ...this._options.headers },\r\n timeout: this._options.timeout,\r\n withCredentials: this._options.withCredentials,\r\n });\r\n\r\n if (response.statusCode !== 200) {\r\n return Promise.reject(new Error(`Unexpected status code returned from negotiate '${response.statusCode}'`));\r\n }\r\n\r\n const negotiateResponse = JSON.parse(response.content as string) as INegotiateResponse;\r\n if (!negotiateResponse.negotiateVersion || negotiateResponse.negotiateVersion < 1) {\r\n // Negotiate version 0 doesn't use connectionToken\r\n // So we set it equal to connectionId so all our logic can use connectionToken without being aware of the negotiate version\r\n negotiateResponse.connectionToken = negotiateResponse.connectionId;\r\n }\r\n\r\n if (negotiateResponse.useStatefulReconnect && this._options._useStatefulReconnect !== true) {\r\n return Promise.reject(new FailedToNegotiateWithServerError(\"Client didn't negotiate Stateful Reconnect but the server did.\"));\r\n }\r\n\r\n return negotiateResponse;\r\n } catch (e) {\r\n let errorMessage = \"Failed to complete negotiation with the server: \" + e;\r\n if (e instanceof HttpError) {\r\n if (e.statusCode === 404) {\r\n errorMessage = errorMessage + \" Either this is not a SignalR endpoint or there is a proxy blocking the connection.\";\r\n }\r\n }\r\n this._logger.log(LogLevel.Error, errorMessage);\r\n\r\n return Promise.reject(new FailedToNegotiateWithServerError(errorMessage));\r\n }\r\n }\r\n\r\n private _createConnectUrl(url: string, connectionToken: string | null | undefined) {\r\n if (!connectionToken) {\r\n return url;\r\n }\r\n\r\n return url + (url.indexOf(\"?\") === -1 ? \"?\" : \"&\") + `id=${connectionToken}`;\r\n }\r\n\r\n private async _createTransport(url: string, requestedTransport: HttpTransportType | ITransport | undefined, negotiateResponse: INegotiateResponse, requestedTransferFormat: TransferFormat): Promise {\r\n let connectUrl = this._createConnectUrl(url, negotiateResponse.connectionToken);\r\n if (this._isITransport(requestedTransport)) {\r\n this._logger.log(LogLevel.Debug, \"Connection was provided an instance of ITransport, using that directly.\");\r\n this.transport = requestedTransport;\r\n await this._startTransport(connectUrl, requestedTransferFormat);\r\n\r\n this.connectionId = negotiateResponse.connectionId;\r\n return;\r\n }\r\n\r\n const transportExceptions: any[] = [];\r\n const transports = negotiateResponse.availableTransports || [];\r\n let negotiate: INegotiateResponse | undefined = negotiateResponse;\r\n for (const endpoint of transports) {\r\n const transportOrError = this._resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat,\r\n negotiate?.useStatefulReconnect === true);\r\n if (transportOrError instanceof Error) {\r\n // Store the error and continue, we don't want to cause a re-negotiate in these cases\r\n transportExceptions.push(`${endpoint.transport} failed:`);\r\n transportExceptions.push(transportOrError);\r\n } else if (this._isITransport(transportOrError)) {\r\n this.transport = transportOrError;\r\n if (!negotiate) {\r\n try {\r\n negotiate = await this._getNegotiationResponse(url);\r\n } catch (ex) {\r\n return Promise.reject(ex);\r\n }\r\n connectUrl = this._createConnectUrl(url, negotiate.connectionToken);\r\n }\r\n try {\r\n await this._startTransport(connectUrl, requestedTransferFormat);\r\n this.connectionId = negotiate.connectionId;\r\n return;\r\n } catch (ex) {\r\n this._logger.log(LogLevel.Error, `Failed to start the transport '${endpoint.transport}': ${ex}`);\r\n negotiate = undefined;\r\n transportExceptions.push(new FailedToStartTransportError(`${endpoint.transport} failed: ${ex}`, HttpTransportType[endpoint.transport]));\r\n\r\n if (this._connectionState !== ConnectionState.Connecting) {\r\n const message = \"Failed to select transport before stop() was called.\";\r\n this._logger.log(LogLevel.Debug, message);\r\n return Promise.reject(new AbortError(message));\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (transportExceptions.length > 0) {\r\n return Promise.reject(new AggregateErrors(`Unable to connect to the server with any of the available transports. ${transportExceptions.join(\" \")}`, transportExceptions));\r\n }\r\n return Promise.reject(new Error(\"None of the transports supported by the client are supported by the server.\"));\r\n }\r\n\r\n private _constructTransport(transport: HttpTransportType): ITransport {\r\n switch (transport) {\r\n case HttpTransportType.WebSockets:\r\n if (!this._options.WebSocket) {\r\n throw new Error(\"'WebSocket' is not supported in your environment.\");\r\n }\r\n return new WebSocketTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent!,\r\n this._options.WebSocket, this._options.headers || {});\r\n case HttpTransportType.ServerSentEvents:\r\n if (!this._options.EventSource) {\r\n throw new Error(\"'EventSource' is not supported in your environment.\");\r\n }\r\n return new ServerSentEventsTransport(this._httpClient, this._httpClient._accessToken, this._logger, this._options);\r\n case HttpTransportType.LongPolling:\r\n return new LongPollingTransport(this._httpClient, this._logger, this._options);\r\n default:\r\n throw new Error(`Unknown transport: ${transport}.`);\r\n }\r\n }\r\n\r\n private _startTransport(url: string, transferFormat: TransferFormat): Promise {\r\n this.transport!.onreceive = this.onreceive;\r\n if (this.features.reconnect) {\r\n this.transport!.onclose = async (e) => {\r\n let callStop = false;\r\n if (this.features.reconnect) {\r\n try {\r\n this.features.disconnected();\r\n await this.transport!.connect(url, transferFormat);\r\n await this.features.resend();\r\n } catch {\r\n callStop = true;\r\n }\r\n } else {\r\n this._stopConnection(e);\r\n return;\r\n }\r\n\r\n if (callStop) {\r\n this._stopConnection(e);\r\n }\r\n };\r\n } else {\r\n this.transport!.onclose = (e) => this._stopConnection(e);\r\n }\r\n return this.transport!.connect(url, transferFormat);\r\n }\r\n\r\n private _resolveTransportOrError(endpoint: IAvailableTransport, requestedTransport: HttpTransportType | undefined,\r\n requestedTransferFormat: TransferFormat, useStatefulReconnect: boolean): ITransport | Error | unknown {\r\n const transport = HttpTransportType[endpoint.transport];\r\n if (transport === null || transport === undefined) {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r\n return new Error(`Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r\n } else {\r\n if (transportMatches(requestedTransport, transport)) {\r\n const transferFormats = endpoint.transferFormats.map((s) => TransferFormat[s]);\r\n if (transferFormats.indexOf(requestedTransferFormat) >= 0) {\r\n if ((transport === HttpTransportType.WebSockets && !this._options.WebSocket) ||\r\n (transport === HttpTransportType.ServerSentEvents && !this._options.EventSource)) {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it is not supported in your environment.'`);\r\n return new UnsupportedTransportError(`'${HttpTransportType[transport]}' is not supported in your environment.`, transport);\r\n } else {\r\n this._logger.log(LogLevel.Debug, `Selecting transport '${HttpTransportType[transport]}'.`);\r\n try {\r\n this.features.reconnect = transport === HttpTransportType.WebSockets ? useStatefulReconnect : undefined;\r\n return this._constructTransport(transport);\r\n } catch (ex) {\r\n return ex;\r\n }\r\n }\r\n } else {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it does not support the requested transfer format '${TransferFormat[requestedTransferFormat]}'.`);\r\n return new Error(`'${HttpTransportType[transport]}' does not support ${TransferFormat[requestedTransferFormat]}.`);\r\n }\r\n } else {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it was disabled by the client.`);\r\n return new DisabledTransportError(`'${HttpTransportType[transport]}' is disabled by the client.`, transport);\r\n }\r\n }\r\n }\r\n\r\n private _isITransport(transport: any): transport is ITransport {\r\n return transport && typeof (transport) === \"object\" && \"connect\" in transport;\r\n }\r\n\r\n private _stopConnection(error?: Error): void {\r\n this._logger.log(LogLevel.Debug, `HttpConnection.stopConnection(${error}) called while in state ${this._connectionState}.`);\r\n\r\n this.transport = undefined;\r\n\r\n // If we have a stopError, it takes precedence over the error from the transport\r\n error = this._stopError || error;\r\n this._stopError = undefined;\r\n\r\n if (this._connectionState === ConnectionState.Disconnected) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is already in the disconnected state.`);\r\n return;\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Connecting) {\r\n this._logger.log(LogLevel.Warning, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is still in the connecting state.`);\r\n throw new Error(`HttpConnection.stopConnection(${error}) was called while the connection is still in the connecting state.`);\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Disconnecting) {\r\n // A call to stop() induced this call to stopConnection and needs to be completed.\r\n // Any stop() awaiters will be scheduled to continue after the onclose callback fires.\r\n this._stopPromiseResolver();\r\n }\r\n\r\n if (error) {\r\n this._logger.log(LogLevel.Error, `Connection disconnected with error '${error}'.`);\r\n } else {\r\n this._logger.log(LogLevel.Information, \"Connection disconnected.\");\r\n }\r\n\r\n if (this._sendQueue) {\r\n this._sendQueue.stop().catch((e) => {\r\n this._logger.log(LogLevel.Error, `TransportSendQueue.stop() threw error '${e}'.`);\r\n });\r\n this._sendQueue = undefined;\r\n }\r\n\r\n this.connectionId = undefined;\r\n this._connectionState = ConnectionState.Disconnected;\r\n\r\n if (this._connectionStarted) {\r\n this._connectionStarted = false;\r\n try {\r\n if (this.onclose) {\r\n this.onclose(error);\r\n }\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `HttpConnection.onclose(${error}) threw error '${e}'.`);\r\n }\r\n }\r\n }\r\n\r\n private _resolveUrl(url: string): string {\r\n // startsWith is not supported in IE\r\n if (url.lastIndexOf(\"https://\", 0) === 0 || url.lastIndexOf(\"http://\", 0) === 0) {\r\n return url;\r\n }\r\n\r\n if (!Platform.isBrowser) {\r\n throw new Error(`Cannot resolve '${url}'.`);\r\n }\r\n\r\n // Setting the url to the href propery of an anchor tag handles normalization\r\n // for us. There are 3 main cases.\r\n // 1. Relative path normalization e.g \"b\" -> \"http://localhost:5000/a/b\"\r\n // 2. Absolute path normalization e.g \"/a/b\" -> \"http://localhost:5000/a/b\"\r\n // 3. Networkpath reference normalization e.g \"//localhost:5000/a/b\" -> \"http://localhost:5000/a/b\"\r\n const aTag = window.document.createElement(\"a\");\r\n aTag.href = url;\r\n\r\n this._logger.log(LogLevel.Information, `Normalizing '${url}' to '${aTag.href}'.`);\r\n return aTag.href;\r\n }\r\n\r\n private _resolveNegotiateUrl(url: string): string {\r\n const negotiateUrl = new URL(url);\r\n\r\n if (negotiateUrl.pathname.endsWith('/')) {\r\n negotiateUrl.pathname += \"negotiate\";\r\n } else {\r\n negotiateUrl.pathname += \"/negotiate\";\r\n }\r\n const searchParams = new URLSearchParams(negotiateUrl.searchParams);\r\n\r\n if (!searchParams.has(\"negotiateVersion\")) {\r\n searchParams.append(\"negotiateVersion\", this._negotiateVersion.toString());\r\n }\r\n\r\n if (searchParams.has(\"useStatefulReconnect\")) {\r\n if (searchParams.get(\"useStatefulReconnect\") === \"true\") {\r\n this._options._useStatefulReconnect = true;\r\n }\r\n } else if (this._options._useStatefulReconnect === true) {\r\n searchParams.append(\"useStatefulReconnect\", \"true\");\r\n }\r\n\r\n negotiateUrl.search = searchParams.toString();\r\n\r\n return negotiateUrl.toString();\r\n }\r\n}\r\n\r\nfunction transportMatches(requestedTransport: HttpTransportType | undefined, actualTransport: HttpTransportType) {\r\n return !requestedTransport || ((actualTransport & requestedTransport) !== 0);\r\n}\r\n\r\n/** @private */\r\nexport class TransportSendQueue {\r\n private _buffer: any[] = [];\r\n private _sendBufferedData: PromiseSource;\r\n private _executing: boolean = true;\r\n private _transportResult?: PromiseSource;\r\n private _sendLoopPromise: Promise;\r\n\r\n constructor(private readonly _transport: ITransport) {\r\n this._sendBufferedData = new PromiseSource();\r\n this._transportResult = new PromiseSource();\r\n\r\n this._sendLoopPromise = this._sendLoop();\r\n }\r\n\r\n public send(data: string | ArrayBuffer): Promise {\r\n this._bufferData(data);\r\n if (!this._transportResult) {\r\n this._transportResult = new PromiseSource();\r\n }\r\n return this._transportResult.promise;\r\n }\r\n\r\n public stop(): Promise {\r\n this._executing = false;\r\n this._sendBufferedData.resolve();\r\n return this._sendLoopPromise;\r\n }\r\n\r\n private _bufferData(data: string | ArrayBuffer): void {\r\n if (this._buffer.length && typeof(this._buffer[0]) !== typeof(data)) {\r\n throw new Error(`Expected data to be of type ${typeof(this._buffer)} but was of type ${typeof(data)}`);\r\n }\r\n\r\n this._buffer.push(data);\r\n this._sendBufferedData.resolve();\r\n }\r\n\r\n private async _sendLoop(): Promise {\r\n while (true) {\r\n await this._sendBufferedData.promise;\r\n\r\n if (!this._executing) {\r\n if (this._transportResult) {\r\n this._transportResult.reject(\"Connection stopped.\");\r\n }\r\n\r\n break;\r\n }\r\n\r\n this._sendBufferedData = new PromiseSource();\r\n\r\n const transportResult = this._transportResult!;\r\n this._transportResult = undefined;\r\n\r\n const data = typeof(this._buffer[0]) === \"string\" ?\r\n this._buffer.join(\"\") :\r\n TransportSendQueue._concatBuffers(this._buffer);\r\n\r\n this._buffer.length = 0;\r\n\r\n try {\r\n await this._transport.send(data);\r\n transportResult.resolve();\r\n } catch (error) {\r\n transportResult.reject(error);\r\n }\r\n }\r\n }\r\n\r\n private static _concatBuffers(arrayBuffers: ArrayBuffer[]): ArrayBuffer {\r\n const totalLength = arrayBuffers.map((b) => b.byteLength).reduce((a, b) => a + b);\r\n const result = new Uint8Array(totalLength);\r\n let offset = 0;\r\n for (const item of arrayBuffers) {\r\n result.set(new Uint8Array(item), offset);\r\n offset += item.byteLength;\r\n }\r\n\r\n return result.buffer;\r\n }\r\n}\r\n\r\nclass PromiseSource {\r\n private _resolver?: () => void;\r\n private _rejecter!: (reason?: any) => void;\r\n public promise: Promise;\r\n\r\n constructor() {\r\n this.promise = new Promise((resolve, reject) => [this._resolver, this._rejecter] = [resolve, reject]);\r\n }\r\n\r\n public resolve(): void {\r\n this._resolver!();\r\n }\r\n\r\n public reject(reason?: any): void {\r\n this._rejecter!(reason);\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AckMessage, CompletionMessage, HubMessage, IHubProtocol, InvocationMessage, MessageType, SequenceMessage, StreamItemMessage } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\n\r\nconst JSON_HUB_PROTOCOL_NAME: string = \"json\";\r\n\r\n/** Implements the JSON Hub Protocol. */\r\nexport class JsonHubProtocol implements IHubProtocol {\r\n\r\n /** @inheritDoc */\r\n public readonly name: string = JSON_HUB_PROTOCOL_NAME;\r\n /** @inheritDoc */\r\n public readonly version: number = 2;\r\n\r\n /** @inheritDoc */\r\n public readonly transferFormat: TransferFormat = TransferFormat.Text;\r\n\r\n /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.\r\n *\r\n * @param {string} input A string containing the serialized representation.\r\n * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r\n */\r\n public parseMessages(input: string, logger: ILogger): HubMessage[] {\r\n // The interface does allow \"ArrayBuffer\" to be passed in, but this implementation does not. So let's throw a useful error.\r\n if (typeof input !== \"string\") {\r\n throw new Error(\"Invalid input for JSON hub protocol. Expected a string.\");\r\n }\r\n\r\n if (!input) {\r\n return [];\r\n }\r\n\r\n if (logger === null) {\r\n logger = NullLogger.instance;\r\n }\r\n\r\n // Parse the messages\r\n const messages = TextMessageFormat.parse(input);\r\n\r\n const hubMessages = [];\r\n for (const message of messages) {\r\n const parsedMessage = JSON.parse(message) as HubMessage;\r\n if (typeof parsedMessage.type !== \"number\") {\r\n throw new Error(\"Invalid payload.\");\r\n }\r\n switch (parsedMessage.type) {\r\n case MessageType.Invocation:\r\n this._isInvocationMessage(parsedMessage);\r\n break;\r\n case MessageType.StreamItem:\r\n this._isStreamItemMessage(parsedMessage);\r\n break;\r\n case MessageType.Completion:\r\n this._isCompletionMessage(parsedMessage);\r\n break;\r\n case MessageType.Ping:\r\n // Single value, no need to validate\r\n break;\r\n case MessageType.Close:\r\n // All optional values, no need to validate\r\n break;\r\n case MessageType.Ack:\r\n this._isAckMessage(parsedMessage);\r\n break;\r\n case MessageType.Sequence:\r\n this._isSequenceMessage(parsedMessage);\r\n break;\r\n default:\r\n // Future protocol changes can add message types, old clients can ignore them\r\n logger.log(LogLevel.Information, \"Unknown message type '\" + parsedMessage.type + \"' ignored.\");\r\n continue;\r\n }\r\n hubMessages.push(parsedMessage);\r\n }\r\n\r\n return hubMessages;\r\n }\r\n\r\n /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it.\r\n *\r\n * @param {HubMessage} message The message to write.\r\n * @returns {string} A string containing the serialized representation of the message.\r\n */\r\n public writeMessage(message: HubMessage): string {\r\n return TextMessageFormat.write(JSON.stringify(message));\r\n }\r\n\r\n private _isInvocationMessage(message: InvocationMessage): void {\r\n this._assertNotEmptyString(message.target, \"Invalid payload for Invocation message.\");\r\n\r\n if (message.invocationId !== undefined) {\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for Invocation message.\");\r\n }\r\n }\r\n\r\n private _isStreamItemMessage(message: StreamItemMessage): void {\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for StreamItem message.\");\r\n\r\n if (message.item === undefined) {\r\n throw new Error(\"Invalid payload for StreamItem message.\");\r\n }\r\n }\r\n\r\n private _isCompletionMessage(message: CompletionMessage): void {\r\n if (message.result && message.error) {\r\n throw new Error(\"Invalid payload for Completion message.\");\r\n }\r\n\r\n if (!message.result && message.error) {\r\n this._assertNotEmptyString(message.error, \"Invalid payload for Completion message.\");\r\n }\r\n\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for Completion message.\");\r\n }\r\n\r\n private _isAckMessage(message: AckMessage): void {\r\n if (typeof message.sequenceId !== 'number') {\r\n throw new Error(\"Invalid SequenceId for Ack message.\");\r\n }\r\n }\r\n\r\n private _isSequenceMessage(message: SequenceMessage): void {\r\n if (typeof message.sequenceId !== 'number') {\r\n throw new Error(\"Invalid SequenceId for Sequence message.\");\r\n }\r\n }\r\n\r\n private _assertNotEmptyString(value: any, errorMessage: string): void {\r\n if (typeof value !== \"string\" || value === \"\") {\r\n throw new Error(errorMessage);\r\n }\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { DefaultReconnectPolicy } from \"./DefaultReconnectPolicy\";\r\nimport { HttpConnection } from \"./HttpConnection\";\r\nimport { HubConnection } from \"./HubConnection\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\nimport { IHubProtocol } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { IRetryPolicy } from \"./IRetryPolicy\";\r\nimport { IStatefulReconnectOptions } from \"./IStatefulReconnectOptions\";\r\nimport { HttpTransportType } from \"./ITransport\";\r\nimport { JsonHubProtocol } from \"./JsonHubProtocol\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { Arg, ConsoleLogger } from \"./Utils\";\r\n\r\nconst LogLevelNameMapping: {[k: string]: LogLevel} = {\r\n trace: LogLevel.Trace,\r\n debug: LogLevel.Debug,\r\n info: LogLevel.Information,\r\n information: LogLevel.Information,\r\n warn: LogLevel.Warning,\r\n warning: LogLevel.Warning,\r\n error: LogLevel.Error,\r\n critical: LogLevel.Critical,\r\n none: LogLevel.None,\r\n};\r\n\r\nfunction parseLogLevel(name: string): LogLevel {\r\n // Case-insensitive matching via lower-casing\r\n // Yes, I know case-folding is a complicated problem in Unicode, but we only support\r\n // the ASCII strings defined in LogLevelNameMapping anyway, so it's fine -anurse.\r\n const mapping = LogLevelNameMapping[name.toLowerCase()];\r\n if (typeof mapping !== \"undefined\") {\r\n return mapping;\r\n } else {\r\n throw new Error(`Unknown log level: ${name}`);\r\n }\r\n}\r\n\r\n/** A builder for configuring {@link @microsoft/signalr.HubConnection} instances. */\r\nexport class HubConnectionBuilder {\r\n private _serverTimeoutInMilliseconds?: number;\r\n private _keepAliveIntervalInMilliseconds ?: number;\r\n\r\n /** @internal */\r\n public protocol?: IHubProtocol;\r\n /** @internal */\r\n public httpConnectionOptions?: IHttpConnectionOptions;\r\n /** @internal */\r\n public url?: string;\r\n /** @internal */\r\n public logger?: ILogger;\r\n\r\n /** If defined, this indicates the client should automatically attempt to reconnect if the connection is lost. */\r\n /** @internal */\r\n public reconnectPolicy?: IRetryPolicy;\r\n\r\n private _statefulReconnectBufferSize?: number;\r\n\r\n /** Configures console logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {LogLevel} logLevel The minimum level of messages to log. Anything at this level, or a more severe level, will be logged.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public configureLogging(logLevel: LogLevel): HubConnectionBuilder;\r\n\r\n /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {ILogger} logger An object implementing the {@link @microsoft/signalr.ILogger} interface, which will be used to write all log messages.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public configureLogging(logger: ILogger): HubConnectionBuilder;\r\n\r\n /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {string} logLevel A string representing a LogLevel setting a minimum level of messages to log.\r\n * See {@link https://learn.microsoft.com/aspnet/core/signalr/configuration#configure-logging|the documentation for client logging configuration} for more details.\r\n */\r\n public configureLogging(logLevel: string): HubConnectionBuilder;\r\n\r\n /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {LogLevel | string | ILogger} logging A {@link @microsoft/signalr.LogLevel}, a string representing a LogLevel, or an object implementing the {@link @microsoft/signalr.ILogger} interface.\r\n * See {@link https://learn.microsoft.com/aspnet/core/signalr/configuration#configure-logging|the documentation for client logging configuration} for more details.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public configureLogging(logging: LogLevel | string | ILogger): HubConnectionBuilder;\r\n public configureLogging(logging: LogLevel | string | ILogger): HubConnectionBuilder {\r\n Arg.isRequired(logging, \"logging\");\r\n\r\n if (isLogger(logging)) {\r\n this.logger = logging;\r\n } else if (typeof logging === \"string\") {\r\n const logLevel = parseLogLevel(logging);\r\n this.logger = new ConsoleLogger(logLevel);\r\n } else {\r\n this.logger = new ConsoleLogger(logging);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use HTTP-based transports to connect to the specified URL.\r\n *\r\n * The transport will be selected automatically based on what the server and client support.\r\n *\r\n * @param {string} url The URL the connection will use.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withUrl(url: string): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified HTTP-based transport to connect to the specified URL.\r\n *\r\n * @param {string} url The URL the connection will use.\r\n * @param {HttpTransportType} transportType The specific transport to use.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withUrl(url: string, transportType: HttpTransportType): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use HTTP-based transports to connect to the specified URL.\r\n *\r\n * @param {string} url The URL the connection will use.\r\n * @param {IHttpConnectionOptions} options An options object used to configure the connection.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withUrl(url: string, options: IHttpConnectionOptions): HubConnectionBuilder;\r\n public withUrl(url: string, transportTypeOrOptions?: IHttpConnectionOptions | HttpTransportType): HubConnectionBuilder {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isNotEmpty(url, \"url\");\r\n\r\n this.url = url;\r\n\r\n // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed\r\n // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called.\r\n if (typeof transportTypeOrOptions === \"object\") {\r\n this.httpConnectionOptions = { ...this.httpConnectionOptions, ...transportTypeOrOptions };\r\n } else {\r\n this.httpConnectionOptions = {\r\n ...this.httpConnectionOptions,\r\n transport: transportTypeOrOptions,\r\n };\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified Hub Protocol.\r\n *\r\n * @param {IHubProtocol} protocol The {@link @microsoft/signalr.IHubProtocol} implementation to use.\r\n */\r\n public withHubProtocol(protocol: IHubProtocol): HubConnectionBuilder {\r\n Arg.isRequired(protocol, \"protocol\");\r\n\r\n this.protocol = protocol;\r\n return this;\r\n }\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r\n * By default, the client will wait 0, 2, 10 and 30 seconds respectively before trying up to 4 reconnect attempts.\r\n */\r\n public withAutomaticReconnect(): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r\n *\r\n * @param {number[]} retryDelays An array containing the delays in milliseconds before trying each reconnect attempt.\r\n * The length of the array represents how many failed reconnect attempts it takes before the client will stop attempting to reconnect.\r\n */\r\n public withAutomaticReconnect(retryDelays: number[]): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r\n *\r\n * @param {IRetryPolicy} reconnectPolicy An {@link @microsoft/signalR.IRetryPolicy} that controls the timing and number of reconnect attempts.\r\n */\r\n public withAutomaticReconnect(reconnectPolicy: IRetryPolicy): HubConnectionBuilder;\r\n public withAutomaticReconnect(retryDelaysOrReconnectPolicy?: number[] | IRetryPolicy): HubConnectionBuilder {\r\n if (this.reconnectPolicy) {\r\n throw new Error(\"A reconnectPolicy has already been set.\");\r\n }\r\n\r\n if (!retryDelaysOrReconnectPolicy) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy();\r\n } else if (Array.isArray(retryDelaysOrReconnectPolicy)) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy(retryDelaysOrReconnectPolicy);\r\n } else {\r\n this.reconnectPolicy = retryDelaysOrReconnectPolicy;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Configures {@link @microsoft/signalr.HubConnection.serverTimeoutInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withServerTimeout(milliseconds: number): HubConnectionBuilder {\r\n Arg.isRequired(milliseconds, \"milliseconds\");\r\n\r\n this._serverTimeoutInMilliseconds = milliseconds;\r\n\r\n return this;\r\n }\r\n\r\n /** Configures {@link @microsoft/signalr.HubConnection.keepAliveIntervalInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withKeepAliveInterval(milliseconds: number): HubConnectionBuilder {\r\n Arg.isRequired(milliseconds, \"milliseconds\");\r\n\r\n this._keepAliveIntervalInMilliseconds = milliseconds;\r\n\r\n return this;\r\n }\r\n\r\n /** Enables and configures options for the Stateful Reconnect feature.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withStatefulReconnect(options?: IStatefulReconnectOptions): HubConnectionBuilder {\r\n if (this.httpConnectionOptions === undefined) {\r\n this.httpConnectionOptions = {};\r\n }\r\n this.httpConnectionOptions._useStatefulReconnect = true;\r\n\r\n this._statefulReconnectBufferSize = options?.bufferSize;\r\n\r\n return this;\r\n }\r\n\r\n /** Creates a {@link @microsoft/signalr.HubConnection} from the configuration options specified in this builder.\r\n *\r\n * @returns {HubConnection} The configured {@link @microsoft/signalr.HubConnection}.\r\n */\r\n public build(): HubConnection {\r\n // If httpConnectionOptions has a logger, use it. Otherwise, override it with the one\r\n // provided to configureLogger\r\n const httpConnectionOptions = this.httpConnectionOptions || {};\r\n\r\n // If it's 'null', the user **explicitly** asked for null, don't mess with it.\r\n if (httpConnectionOptions.logger === undefined) {\r\n // If our logger is undefined or null, that's OK, the HttpConnection constructor will handle it.\r\n httpConnectionOptions.logger = this.logger;\r\n }\r\n\r\n // Now create the connection\r\n if (!this.url) {\r\n throw new Error(\"The 'HubConnectionBuilder.withUrl' method must be called before building the connection.\");\r\n }\r\n const connection = new HttpConnection(this.url, httpConnectionOptions);\r\n\r\n return HubConnection.create(\r\n connection,\r\n this.logger || NullLogger.instance,\r\n this.protocol || new JsonHubProtocol(),\r\n this.reconnectPolicy,\r\n this._serverTimeoutInMilliseconds,\r\n this._keepAliveIntervalInMilliseconds,\r\n this._statefulReconnectBufferSize);\r\n }\r\n}\r\n\r\nfunction isLogger(logger: any): logger is ILogger {\r\n return logger.log !== undefined;\r\n}\r\n","'use client';\n\n/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex */\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp, elementAcceptingRef, unstable_useForkRef as useForkRef, unstable_ownerDocument as ownerDocument } from '@mui/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n// Inspired by https://github.com/focus-trap/tabbable\nconst candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable=\"false\"])'].join(',');\nfunction getTabIndex(node) {\n const tabindexAttr = parseInt(node.getAttribute('tabindex') || '', 10);\n if (!Number.isNaN(tabindexAttr)) {\n return tabindexAttr;\n }\n\n // Browsers do not return `tabIndex` correctly for contentEditable nodes;\n // https://bugs.chromium.org/p/chromium/issues/detail?id=661108&q=contenteditable%20tabindex&can=2\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n // in Chrome,
    ,