@adyen/adyen-platform-experience-web 0.1.1 → 1.0.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -13
- package/dist/AmountSkeleton.css +23 -0
- package/dist/BalanceAccountSelector.css +4 -0
- package/dist/BaseButton.css +14 -0
- package/dist/BaseList.css +5 -0
- package/dist/Button.css +114 -0
- package/dist/ButtonActions-eb064f69.mjs +46 -0
- package/dist/ButtonActions.css +28 -0
- package/dist/CalendarGrid.css +113 -0
- package/dist/CopyText.css +18 -0
- package/dist/DatePicker.css +64 -0
- package/dist/ErrorMessageDisplay.css +20 -0
- package/dist/ErrorPanel.css +15 -0
- package/dist/ExpandableCard.css +71 -0
- package/dist/FilterBar.css +40 -0
- package/dist/FilterButton.css +48 -0
- package/dist/Img.css +7 -0
- package/dist/InputBase.css +175 -0
- package/dist/Modal.css +110 -0
- package/dist/Pagination.css +25 -0
- package/dist/Popover.css +127 -0
- package/dist/PopoverDismissButton.css +12 -0
- package/dist/RangeSelection.css +26 -0
- package/dist/Select.css +149 -0
- package/dist/SkeletonBody.css +154 -0
- package/dist/Spinner.css +50 -0
- package/dist/SummaryItem.css +37 -0
- package/dist/Tag-6d02fd64.mjs +32 -0
- package/dist/Tag.css +34 -0
- package/dist/Tooltip.css +7 -0
- package/dist/TotalsCard.css +14 -0
- package/dist/TransactionDetails.css +74 -0
- package/dist/TransactionsDisplay.css +4 -0
- package/dist/TransactionsOverview.css +29 -0
- package/dist/TransactionsOverviewContainer.css +3 -0
- package/dist/TransactionsTable.css +18 -0
- package/dist/Typography-11b95870.mjs +68 -0
- package/dist/Typography.css +57 -0
- package/dist/cjs/ModalContent-f4990141.js +10 -0
- package/dist/cjs/ModalContent-f4990141.js.map +1 -0
- package/dist/cjs/index-8c098f20.js +10401 -0
- package/dist/cjs/index-8c098f20.js.map +1 -0
- package/dist/cjs/index.css +1709 -0
- package/dist/cjs/index.js +35 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/compat.module-a4d537ff.mjs +237 -0
- package/dist/en-US-1daadfc1.mjs +371 -0
- package/dist/es/components/external/BaseElement.js +89 -49
- package/dist/es/components/external/EventEmitter.js +28 -17
- package/dist/es/components/external/FormElement.js +78 -0
- package/dist/es/components/external/TransactionDetails/TransactionDetails.js +20 -15
- package/dist/es/components/external/TransactionDetails/components/TransactionData.js +43 -42
- package/dist/es/components/external/TransactionDetails/components/TransactionDataSkeleton.js +13 -10
- package/dist/es/components/external/TransactionDetails/components/TransactionDetails.js +39 -28
- package/dist/es/components/external/TransactionDetails/index.js +4 -0
- package/dist/es/components/external/TransactionsOverview/TransactionsOverviewElement.js +35 -0
- package/dist/es/components/external/TransactionsOverview/components/AmountSkeleton/AmountSkeleton.js +12 -0
- package/dist/es/components/external/TransactionsOverview/components/AmountSkeleton/constants.js +8 -0
- package/dist/es/components/external/TransactionsOverview/components/BalanceAccountSelector/BalanceAccountSelector.js +31 -0
- package/dist/es/components/external/TransactionsOverview/components/BalanceAccountSelector/index.js +6 -0
- package/dist/es/components/external/TransactionsOverview/components/BalanceAccountSelector/useBalanceAccountSelection.js +25 -0
- package/dist/es/components/external/TransactionsOverview/components/BalanceItem/BalanceItem.js +41 -0
- package/dist/es/components/external/TransactionsOverview/components/Balances/Balances.js +56 -0
- package/dist/es/components/external/TransactionsOverview/components/Balances/constants.js +4 -0
- package/dist/es/components/external/TransactionsOverview/components/Category/Category.js +12 -0
- package/dist/es/components/external/TransactionsOverview/components/ModalContent.js +12 -0
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/MultiSelectionFilter.js +33 -0
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/index.js +15 -0
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/constants.js +27 -0
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/index.js +13 -0
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/useMultiSelectionFilter.js +31 -0
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/utils.js +11 -0
- package/dist/es/components/external/TransactionsOverview/components/SummaryItem/SummaryItem.js +60 -0
- package/dist/es/components/external/TransactionsOverview/components/SummaryItem/SummaryItemLabel.js +22 -0
- package/dist/es/components/external/TransactionsOverview/components/SummaryItem/constants.js +16 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionListError/TransactionListError.js +21 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotalItem/TransactionTotalItem.js +61 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotals/TotalsCard.js +50 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotals/TransactionTotals.js +66 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotals/constants.js +6 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsDisplay/TransactionsDisplay.js +91 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsDisplay/constants.js +6 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverview/TransactionsOverview.js +179 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverview/constants.js +8 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverviewContainer/TransactionsOverviewContainer.js +52 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverviewContainer/constants.js +6 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverviewDateFilter.js +71 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsTable/TransactionsTable.js +112 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsTable/constants.js +12 -0
- package/dist/es/components/external/{Transactions → TransactionsOverview}/components/utils.js +13 -7
- package/dist/es/components/external/TransactionsOverview/hooks/useDefaultTransactionsOverviewFilterParams.js +41 -0
- package/dist/es/components/external/TransactionsOverview/hooks/useMaxWidths.js +16 -0
- package/dist/es/components/external/TransactionsOverview/hooks/useMediaQuery.js +37 -0
- package/dist/es/components/external/TransactionsOverview/hooks/useTransactionsOverviewMultiSelectionFilters.js +33 -0
- package/dist/es/components/external/TransactionsOverview/index.js +6 -0
- package/dist/es/components/external/UIElement.js +51 -39
- package/dist/es/components/external/index.js +8 -0
- package/dist/es/components/index.js +11 -0
- package/dist/es/components/internal/BaseButton/BaseButton.js +22 -13
- package/dist/es/components/internal/BaseButton/constants.js +2 -2
- package/dist/es/components/internal/BaseButton/index.js +4 -0
- package/dist/es/components/internal/BaseList/BaseList.js +8 -5
- package/dist/es/components/internal/BaseList/constants.js +2 -2
- package/dist/es/components/internal/Button/Button.js +41 -39
- package/dist/es/components/internal/Button/ButtonActions/ButtonActions.js +8 -27
- package/dist/es/components/internal/Button/constants.js +16 -9
- package/dist/es/components/internal/Button/hooks/useButton.js +16 -12
- package/dist/es/components/internal/Button/index.js +4 -0
- package/dist/es/components/internal/Calendar/Calendar.js +21 -20
- package/dist/es/components/internal/Calendar/calendar/constants.js +70 -35
- package/dist/es/components/internal/Calendar/calendar/facade/Calendar.js +554 -317
- package/dist/es/components/internal/Calendar/calendar/facade/index.js +46 -37
- package/dist/es/components/internal/Calendar/calendar/index.js +4 -0
- package/dist/es/components/internal/Calendar/calendar/shared/indexed/index.js +46 -34
- package/dist/es/components/internal/Calendar/calendar/timeframe/common/flags.js +5 -31
- package/dist/es/components/internal/Calendar/calendar/timeframe/common/utils.js +16 -14
- package/dist/es/components/internal/Calendar/calendar/timeframe/frames/MonthFrame.js +221 -122
- package/dist/es/components/internal/Calendar/calendar/timeframe/frames/TimeFrame.js +418 -238
- package/dist/es/components/internal/Calendar/calendar/timeframe/frames/YearFrame.js +197 -0
- package/dist/es/components/internal/Calendar/calendar/timeframe/index.js +8 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/factory.js +63 -40
- package/dist/es/components/internal/Calendar/calendar/timerange/factory.test.js +139 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/index.js +4 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/index.js +14 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastMonth.js +3 -3
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastMonth.test.js +69 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastNDays.js +27 -16
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastNDays.test.js +69 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastWeek.js +3 -3
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastWeek.test.js +108 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/shared/offsetMonth.js +23 -14
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/shared/offsetWeek.js +29 -21
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/testing/fixtures.js +15 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/testing/helpers.js +19 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/thisMonth.js +3 -3
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/thisMonth.test.js +46 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/thisWeek.js +3 -3
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/thisWeek.test.js +85 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/yearToDate.js +13 -9
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/yearToDate.test.js +49 -0
- package/dist/es/components/internal/Calendar/calendar/timerange/utils.js +83 -49
- package/dist/es/components/internal/Calendar/calendar/timeslice/TimeSlice.js +61 -38
- package/dist/es/components/internal/Calendar/calendar/timeslice/index.js +21 -17
- package/dist/es/components/internal/Calendar/calendar/utils.js +22 -15
- package/dist/es/components/internal/Calendar/clock/clock.js +41 -23
- package/dist/es/components/internal/Calendar/clock/clock.test.js +43 -0
- package/dist/es/components/internal/Calendar/clock/index.js +7 -0
- package/dist/es/components/internal/Calendar/clock/testing/fixtures.js +60 -0
- package/dist/es/components/internal/Calendar/clock/today.js +57 -37
- package/dist/es/components/internal/Calendar/clock/today.test.js +98 -0
- package/dist/es/components/internal/Calendar/components/CalendarControls/CalendarControls.js +12 -7
- package/dist/es/components/internal/Calendar/components/CalendarControls/index.js +4 -0
- package/dist/es/components/internal/Calendar/components/CalendarGrid/CalendarGrid.js +29 -27
- package/dist/es/components/internal/Calendar/components/CalendarGrid/CalendarGridDate.js +58 -33
- package/dist/es/components/internal/Calendar/components/CalendarGrid/CalendarGridDayOfWeek.js +40 -30
- package/dist/es/components/internal/Calendar/components/CalendarGrid/index.js +4 -0
- package/dist/es/components/internal/Calendar/components/CalendarGrid/utils.js +49 -44
- package/dist/es/components/internal/Calendar/hooks/useCalendar.js +115 -84
- package/dist/es/components/internal/Calendar/hooks/useCalendarControlsRendering.js +40 -35
- package/dist/es/components/internal/Calendar/hooks/useTimezone.js +45 -23
- package/dist/es/components/internal/Calendar/index.js +4 -0
- package/dist/es/components/internal/CopyText/CopyText.js +41 -0
- package/dist/es/components/internal/DataGrid/DataGrid.js +10 -84
- package/dist/es/components/internal/DataGrid/DataGridCell.js +4 -4
- package/dist/es/components/internal/DataGrid/components/InteractiveBody.js +8 -31
- package/dist/es/components/internal/DataGrid/components/SkeletonBody.js +16 -14
- package/dist/es/components/internal/DataGrid/components/TableBody.js +26 -9
- package/dist/es/components/internal/DataGrid/components/TableCells.js +25 -17
- package/dist/es/components/internal/DataGrid/hooks/useInteractiveDataGrid.js +5 -76
- package/dist/es/components/internal/DataGrid/index.js +4 -0
- package/dist/es/components/internal/DataGrid/tests/DataGrid.test.js +190 -0
- package/dist/es/components/internal/DatePicker/DatePicker.js +62 -45
- package/dist/es/components/internal/DatePicker/components/TimeRangeSelector/TimeRangeSelector.js +46 -19
- package/dist/es/components/internal/DatePicker/components/TimeRangeSelector/index.js +7 -0
- package/dist/es/components/internal/DatePicker/components/TimeRangeSelector/useTimeRangeSelection.js +85 -56
- package/dist/es/components/internal/DatePicker/index.js +4 -0
- package/dist/es/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.js +53 -40
- package/dist/es/components/internal/ExpandableCard/ExpandableCard.js +74 -51
- package/dist/es/components/internal/ExpandableCard/ExpandableCard.test.js +45 -0
- package/dist/es/components/internal/ExpandableCard/constants.js +20 -11
- package/dist/es/components/internal/FilterBar/FilterBar.js +46 -11
- package/dist/es/components/internal/FilterBar/components/FilterButton/FilterButton.js +17 -15
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/AmountFilter.js +68 -29
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/RangeSelection.js +68 -60
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/constants.js +4 -0
- package/dist/es/components/internal/FilterBar/filters/BaseFilter/BaseFilter.js +155 -99
- package/dist/es/components/internal/FilterBar/filters/BaseFilter/index.js +4 -0
- package/dist/es/components/internal/FilterBar/filters/DateFilter/DateFilter.js +10 -107
- package/dist/es/components/internal/FilterBar/filters/DateFilter/index.js +4 -0
- package/dist/es/components/internal/FilterBar/filters/TextFilter/TextFilter.js +8 -0
- package/dist/es/components/internal/FilterBar/filters/TextFilter/index.js +4 -0
- package/dist/es/components/internal/FilterBar/index.js +4 -0
- package/dist/es/components/internal/FormFields/InputBase.js +67 -54
- package/dist/es/components/internal/FormFields/InputText.js +6 -6
- package/dist/es/components/internal/FormFields/Select/Select.js +246 -182
- package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +73 -69
- package/dist/es/components/internal/FormFields/Select/components/SelectList.js +71 -49
- package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js +41 -37
- package/dist/es/components/internal/FormFields/Select/constants.js +49 -27
- package/dist/es/components/internal/FormFields/Select/hooks/useSelect.js +35 -27
- package/dist/es/components/internal/FormFields/Select/index.js +4 -0
- package/dist/es/components/internal/FormFields/index.js +18 -0
- package/dist/es/components/internal/FormFields/utils.js +4 -0
- package/dist/es/components/internal/Image/Image.js +10 -10
- package/dist/es/components/internal/Img/Img.js +33 -19
- package/dist/es/components/internal/Img/index.js +4 -0
- package/dist/es/components/internal/Modal/Modal.js +79 -66
- package/dist/es/components/internal/Modal/index.js +4 -0
- package/dist/es/components/internal/Pagination/Pagination.js +61 -45
- package/dist/es/components/internal/Pagination/components/LimitSelect.js +1 -0
- package/dist/es/components/internal/Pagination/constants.js +6 -4
- package/dist/es/components/internal/Pagination/hooks/index.js +6 -0
- package/dist/es/components/internal/Pagination/hooks/useCursorPaginatedRecords.js +8 -7
- package/dist/es/components/internal/Pagination/hooks/useCursorPagination.js +30 -18
- package/dist/es/components/internal/Pagination/hooks/useOffsetPaginatedRecords.js +10 -0
- package/dist/es/components/internal/Pagination/hooks/useOffsetPagination.js +21 -14
- package/dist/es/components/internal/Pagination/hooks/usePageLimit.js +60 -52
- package/dist/es/components/internal/Pagination/hooks/usePaginatedRecords.js +11 -78
- package/dist/es/components/internal/Pagination/hooks/usePaginatedRecordsFilters.js +13 -12
- package/dist/es/components/internal/Pagination/hooks/usePagination.js +87 -41
- package/dist/es/components/internal/Pagination/index.js +4 -0
- package/dist/es/components/internal/Pagination/utils.js +5 -5
- package/dist/es/components/internal/Popover/Popover.js +160 -102
- package/dist/es/components/internal/Popover/Popover.test.js +119 -0
- package/dist/es/components/internal/Popover/PopoverDismissButton/PopoverDismissButton.js +22 -18
- package/dist/es/components/internal/Popover/PopoverTitle/PopoverTitle.js +10 -8
- package/dist/es/components/internal/Popover/constants.js +16 -7
- package/dist/es/components/internal/Popover/utils/popoverUtil.js +51 -0
- package/dist/es/components/internal/Popover/utils/utils.js +28 -22
- package/dist/es/components/internal/SVGIcons/CheckedBox.js +5 -5
- package/dist/es/components/internal/SVGIcons/Checkmark.js +6 -6
- package/dist/es/components/internal/SVGIcons/ChevronDown.js +6 -6
- package/dist/es/components/internal/SVGIcons/ChevronLeft.js +8 -8
- package/dist/es/components/internal/SVGIcons/ChevronRight.js +8 -8
- package/dist/es/components/internal/SVGIcons/ChevronUp.js +7 -7
- package/dist/es/components/internal/SVGIcons/Close.js +13 -0
- package/dist/es/components/internal/SVGIcons/Copy.js +5 -0
- package/dist/es/components/internal/SVGIcons/Filter.js +11 -0
- package/dist/es/components/internal/SVGIcons/UncheckedBox.js +5 -5
- package/dist/es/components/internal/Spinner/Spinner.js +5 -4
- package/dist/es/components/internal/Spinner/index.js +4 -0
- package/dist/es/components/internal/Tag/Tag.js +5 -19
- package/dist/es/components/internal/Tooltip/Tooltip.js +48 -0
- package/dist/es/components/internal/Tooltip/useTooltipListeners.js +31 -0
- package/dist/es/components/internal/Typography/Typography.js +7 -33
- package/dist/es/components/internal/Typography/constants.js +2 -2
- package/dist/es/components/utils/transactionResourceErrorCodes.js +17 -13
- package/dist/es/components/utils/utils.js +34 -0
- package/dist/es/constants.js +8 -0
- package/dist/es/core/Analytics/Analytics.js +63 -0
- package/dist/es/core/Analytics/EventsQueue.js +22 -0
- package/dist/es/core/Analytics/index.js +4 -0
- package/dist/es/core/Auth/AuthContext.js +7 -5
- package/dist/es/core/Auth/AuthProvider.js +24 -5
- package/dist/es/core/Auth/useAuthContext.js +4 -4
- package/dist/es/core/Context/CoreContext.js +5 -5
- package/dist/es/core/Context/CoreProvider.js +23 -17
- package/dist/es/core/Context/useCoreContext.js +4 -4
- package/dist/es/core/Errors/AdyenPlatformExperienceError.js +21 -0
- package/dist/es/core/Errors/ErrorPanel.js +19 -0
- package/dist/es/core/Errors/constants.js +4 -2
- package/dist/es/core/Localization/Localization.js +12 -145
- package/dist/es/core/Localization/Localization.test.js +70 -0
- package/dist/es/core/Localization/amount/amount-util.js +42 -19
- package/dist/es/core/Localization/amount/amount-util.test.js +54 -0
- package/dist/es/core/Localization/constants/currency-codes.js +3 -3
- package/dist/es/core/Localization/constants/currency-decimals.js +3 -3
- package/dist/es/core/Localization/constants/locale.js +7 -5
- package/dist/es/core/Localization/constants/localization.js +9 -6
- package/dist/es/core/Localization/datetime/restamper/constants.js +29 -20
- package/dist/es/core/Localization/datetime/restamper/index.js +9 -0
- package/dist/es/core/Localization/datetime/restamper/restamper.js +44 -32
- package/dist/es/core/Localization/datetime/restamper/restamper.test.js +179 -0
- package/dist/es/core/Localization/datetime/restamper/testing/fixtures.js +21 -0
- package/dist/es/core/Localization/datetime/restamper/testing/helpers.js +27 -0
- package/dist/es/core/Localization/datetime/restamper/utils.js +44 -26
- package/dist/es/core/Localization/index.js +32 -0
- package/dist/es/core/Localization/localization-utils.js +7 -31
- package/dist/es/core/Localization/translations/index.js +356 -79
- package/dist/es/core/Localization/utils.js +72 -44
- package/dist/es/core/Localization/utils.test.js +215 -0
- package/dist/es/core/ProcessResponse/index.js +4 -0
- package/dist/es/core/ProcessResponse/process-response.js +40 -0
- package/dist/es/core/Services/analytics/collect-id.js +37 -0
- package/dist/es/core/Services/analytics/log-event.js +14 -0
- package/dist/es/core/Services/analytics/post-telemetry.js +22 -0
- package/dist/es/core/Services/data-set.js +1 -0
- package/dist/es/core/Services/get-dataset.js +13 -0
- package/dist/es/core/Services/requests/endpoints.js +9 -0
- package/dist/es/core/Services/requests/http.js +55 -28
- package/dist/es/core/Services/requests/utils.js +49 -34
- package/dist/es/core/Services/sessions/constants.js +2 -2
- package/dist/es/core/Services/sessions/setup-session.js +9 -9
- package/dist/es/core/Session/Session.js +38 -23
- package/dist/es/core/Session/index.js +4 -0
- package/dist/es/core/Session/utils.js +5 -5
- package/dist/es/core/config.js +6 -2
- package/dist/es/core/core.js +87 -45
- package/dist/es/core/index.js +36 -0
- package/dist/es/core/utils.js +10 -8
- package/dist/es/hooks/element/useClickOutside.js +75 -18
- package/dist/es/hooks/element/useDetachedRender.js +17 -15
- package/dist/es/hooks/element/useFocusCursor.js +18 -13
- package/dist/es/hooks/element/useFocusTrap.js +90 -47
- package/dist/es/hooks/element/useIdentifierString.js +61 -0
- package/dist/es/hooks/element/usePopoverPositioner.js +5 -69
- package/dist/es/hooks/element/useUniqueIdentifier.js +16 -12
- package/dist/es/hooks/useBooleanState/index.js +4 -0
- package/dist/es/hooks/useBooleanState/useBooleanState.js +8 -6
- package/dist/es/hooks/useCommitAction/index.js +6 -0
- package/dist/es/hooks/useCommitAction/useCommitAction.js +38 -27
- package/dist/es/hooks/useDefinedValue/index.js +4 -0
- package/dist/es/hooks/useDefinedValue/useDefinedValue.js +16 -0
- package/dist/es/hooks/useFetch/useFetch.js +37 -27
- package/dist/es/hooks/useImageUrl/useImageUrl.js +26 -22
- package/dist/es/hooks/useModalDetails/useModalDetails.js +38 -23
- package/dist/es/hooks/useMounted/index.js +4 -0
- package/dist/es/hooks/useMounted/useMounted.js +14 -8
- package/dist/es/hooks/useReactiveState/index.js +4 -0
- package/dist/es/hooks/useReactiveState/useReactiveState.js +53 -27
- package/dist/es/hooks/useReflex/constants.js +2 -2
- package/dist/es/hooks/useReflex/core/reflex.js +66 -47
- package/dist/es/hooks/useReflex/core/reflex.test.js +170 -0
- package/dist/es/hooks/useReflex/core/registry.js +68 -46
- package/dist/es/hooks/useReflex/core/registry.test.js +114 -0
- package/dist/es/hooks/useReflex/core/utils.js +18 -16
- package/dist/es/hooks/useReflex/core/utils.test.js +59 -0
- package/dist/es/hooks/useReflex/errors.js +6 -6
- package/dist/es/hooks/useReflex/hooks/useReflex.js +12 -7
- package/dist/es/hooks/useReflex/index.js +8 -0
- package/dist/es/hooks/useSessionAwareRequest/useSessionAwareRequest.js +37 -20
- package/dist/es/hooks/useSetupEndpoint/useSetupEndpoint.js +26 -20
- package/dist/es/index.js +45 -41
- package/dist/es/utils/Storage.js +21 -17
- package/dist/es/utils/Validator/ValidationRuleResult.js +28 -0
- package/dist/es/utils/Validator/Validator.js +67 -0
- package/dist/es/utils/Validator/Validator.test.js +27 -0
- package/dist/es/utils/Validator/defaultRules.js +12 -0
- package/dist/es/utils/Validator/index.js +4 -0
- package/dist/es/utils/class-name-utils.js +11 -5
- package/dist/es/utils/common/constants.js +10 -6
- package/dist/es/utils/common/index.js +59 -32
- package/dist/es/utils/fixedForwardRef.js +3 -3
- package/dist/es/utils/get-image.js +12 -11
- package/dist/es/utils/get-image.test.js +38 -0
- package/dist/es/utils/idGenerator.js +6 -3
- package/dist/es/utils/memoComparator/index.js +4 -0
- package/dist/es/utils/memoComparator/memoComparator.js +26 -17
- package/dist/es/utils/regex.js +6 -0
- package/dist/es/utils/tabbable.js +109 -70
- package/dist/es/utils/useForm/index.js +4 -0
- package/dist/es/utils/useForm/reducer.js +153 -0
- package/dist/es/utils/useForm/useForm.js +85 -0
- package/dist/es/utils/useForm/useForm.test.js +107 -0
- package/dist/es/utils/uuid.js +5 -5
- package/dist/es/utils/uuid.test.js +13 -0
- package/dist/es/utils/validator-utils.js +44 -3
- package/dist/es/utils/watchable/constants.js +2 -2
- package/dist/es/utils/watchable/core/Watchable.js +83 -45
- package/dist/es/utils/watchable/core/Watchable.test.js +103 -0
- package/dist/es/utils/watchable/core/helpers.js +26 -19
- package/dist/es/utils/watchable/core/helpers.test.js +106 -0
- package/dist/es/utils/watchable/core/syncEffect.js +19 -15
- package/dist/es/utils/watchable/core/syncEffect.test.js +103 -0
- package/dist/es/utils/watchable/index.js +17 -16
- package/dist/flags-41c36e13.mjs +83 -0
- package/dist/hooks.module-8565d716.mjs +161 -0
- package/dist/index-2c0f6175.mjs +12069 -0
- package/dist/index-6e47f755.mjs +231 -0
- package/dist/index-944be685.mjs +6609 -0
- package/dist/index-c88cd37e.mjs +243 -0
- package/dist/index-f5bc0382.mjs +155 -0
- package/dist/index.css +65 -0
- package/dist/index2.css +4 -0
- package/dist/jsxRuntime.module-69493d81.mjs +15 -0
- package/dist/magic-string.es-219c273f.mjs +1146 -0
- package/dist/preact.module-38e5a571.mjs +323 -0
- package/dist/types/components/external/TransactionDetails/components/TransactionDataSkeleton.d.ts.map +1 -1
- package/dist/types/components/external/TransactionDetails/index.d.ts +1 -1
- package/dist/types/components/external/TransactionDetails/index.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/TransactionsOverviewElement.d.ts.map +1 -0
- package/dist/types/components/external/{Transactions → TransactionsOverview}/components/AmountSkeleton/AmountSkeleton.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/AmountSkeleton/AmountSkeleton.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/AmountSkeleton/constants.d.ts +4 -0
- package/dist/types/components/external/TransactionsOverview/components/AmountSkeleton/constants.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/AmountSkeleton/types.d.ts.map +1 -0
- package/dist/types/components/external/{Transactions → TransactionsOverview}/components/BalanceAccountSelector/BalanceAccountSelector.d.ts +1 -0
- package/dist/types/components/external/TransactionsOverview/components/BalanceAccountSelector/BalanceAccountSelector.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/BalanceAccountSelector/index.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/BalanceAccountSelector/useBalanceAccountSelection.d.ts.map +1 -0
- package/dist/types/components/external/{Transactions → TransactionsOverview}/components/BalanceItem/BalanceItem.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/BalanceItem/BalanceItem.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/BalanceItem/types.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/Balances/Balances.d.ts +11 -0
- package/dist/types/components/external/TransactionsOverview/components/Balances/Balances.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/Balances/constants.d.ts +2 -0
- package/dist/types/components/external/TransactionsOverview/components/Balances/constants.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/Category/Category.d.ts +4 -0
- package/dist/types/components/external/TransactionsOverview/components/Category/Category.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/Category/types.d.ts +7 -0
- package/dist/types/components/external/TransactionsOverview/components/Category/types.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/ModalContent.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/MultiSelectionFilter.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/index.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/constants.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/index.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/types.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/useMultiSelectionFilter.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/utils.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/SummaryItem.d.ts +4 -0
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/SummaryItem.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/SummaryItemLabel.d.ts +14 -0
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/SummaryItemLabel.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/constants.d.ts +8 -0
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/constants.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/types.d.ts +36 -0
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/types.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionListError/TransactionListError.d.ts +7 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionListError/TransactionListError.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotalItem/TransactionTotalItem.d.ts +3 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotalItem/TransactionTotalItem.d.ts.map +1 -0
- package/dist/types/components/external/{Transactions → TransactionsOverview}/components/TransactionTotalItem/types.d.ts +2 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotalItem/types.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotals/TotalsCard.d.ts +11 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotals/TotalsCard.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotals/TransactionTotals.d.ts +12 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotals/TransactionTotals.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotals/constants.d.ts +3 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotals/constants.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsDisplay/TransactionsDisplay.d.ts +5 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsDisplay/TransactionsDisplay.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsDisplay/constants.d.ts +3 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsDisplay/constants.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsDisplay/types.d.ts +5 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsDisplay/types.d.ts.map +1 -0
- package/dist/types/components/external/{Transactions/components → TransactionsOverview/components/TransactionsOverview}/TransactionsOverview.d.ts +2 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverview/TransactionsOverview.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverview/constants.d.ts +4 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverview/constants.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverviewContainer/TransactionsOverviewContainer.d.ts +6 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverviewContainer/TransactionsOverviewContainer.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverviewContainer/constants.d.ts +3 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverviewContainer/constants.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverviewDateFilter.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/TransactionsTable.d.ts +5 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/TransactionsTable.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/constants.d.ts +6 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/constants.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/types.d.ts +18 -0
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/types.d.ts.map +1 -0
- package/dist/types/components/external/{Transactions → TransactionsOverview}/components/utils.d.ts +2 -2
- package/dist/types/components/external/TransactionsOverview/components/utils.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/hooks/useDefaultTransactionsOverviewFilterParams.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/hooks/useMaxWidths.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/hooks/useMediaQuery.d.ts +26 -0
- package/dist/types/components/external/TransactionsOverview/hooks/useMediaQuery.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/hooks/useTransactionsOverviewMultiSelectionFilters.d.ts.map +1 -0
- package/dist/types/components/external/TransactionsOverview/index.d.ts +3 -0
- package/dist/types/components/external/TransactionsOverview/index.d.ts.map +1 -0
- package/dist/types/components/external/{Transactions → TransactionsOverview}/types.d.ts +3 -16
- package/dist/types/components/external/TransactionsOverview/types.d.ts.map +1 -0
- package/dist/types/components/external/index.d.ts +1 -1
- package/dist/types/components/external/index.d.ts.map +1 -1
- package/dist/types/components/internal/BaseButton/BaseButton.d.ts.map +1 -1
- package/dist/types/components/internal/BaseButton/constants.d.ts +1 -1
- package/dist/types/components/internal/BaseButton/types.d.ts +1 -0
- package/dist/types/components/internal/BaseButton/types.d.ts.map +1 -1
- package/dist/types/components/internal/BaseList/constants.d.ts +1 -1
- package/dist/types/components/internal/Button/constants.d.ts +1 -1
- package/dist/types/components/internal/Calendar/calendar/facade/Calendar.d.ts.map +1 -1
- package/dist/types/components/internal/CopyText/CopyText.d.ts +6 -0
- package/dist/types/components/internal/CopyText/CopyText.d.ts.map +1 -0
- package/dist/types/components/internal/DataGrid/DataGrid.d.ts +2 -0
- package/dist/types/components/internal/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/components/InteractiveBody.d.ts +1 -1
- package/dist/types/components/internal/DataGrid/components/InteractiveBody.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/components/TableBody.d.ts +1 -1
- package/dist/types/components/internal/DataGrid/components/TableBody.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/components/TableCells.d.ts +2 -1
- package/dist/types/components/internal/DataGrid/components/TableCells.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/types.d.ts +2 -0
- package/dist/types/components/internal/DataGrid/types.d.ts.map +1 -1
- package/dist/types/components/internal/DatePicker/components/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -1
- package/dist/types/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.d.ts +5 -1
- package/dist/types/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.d.ts.map +1 -1
- package/dist/types/components/internal/ExpandableCard/ExpandableCard.d.ts +1 -1
- package/dist/types/components/internal/ExpandableCard/ExpandableCard.d.ts.map +1 -1
- package/dist/types/components/internal/ExpandableCard/constants.d.ts +1 -1
- package/dist/types/components/internal/ExpandableCard/types.d.ts +5 -0
- package/dist/types/components/internal/ExpandableCard/types.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/FilterBar.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/AmountFilter/AmountFilter.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/AmountFilter/RangeSelection.d.ts +1 -1
- package/dist/types/components/internal/FilterBar/filters/AmountFilter/RangeSelection.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/AmountFilter/constants.d.ts +2 -0
- package/dist/types/components/internal/FilterBar/filters/AmountFilter/constants.d.ts.map +1 -0
- package/dist/types/components/internal/FilterBar/filters/AmountFilter/types.d.ts +0 -2
- package/dist/types/components/internal/FilterBar/filters/AmountFilter/types.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/BaseFilter/BaseFilter.d.ts +0 -1
- package/dist/types/components/internal/FilterBar/filters/BaseFilter/BaseFilter.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/DateFilter/DateFilter.d.ts.map +1 -1
- package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Select/Select.d.ts.map +1 -1
- package/dist/types/components/internal/FormFields/Select/components/SelectList.d.ts.map +1 -1
- package/dist/types/components/internal/FormFields/Select/constants.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Select/types.d.ts +9 -0
- package/dist/types/components/internal/FormFields/Select/types.d.ts.map +1 -1
- package/dist/types/components/internal/FormFields/index.d.ts +3 -18
- package/dist/types/components/internal/FormFields/index.d.ts.map +1 -1
- package/dist/types/components/internal/Img/types.d.ts +1 -1
- package/dist/types/components/internal/Modal/Modal.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/Pagination.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/constants.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/types.d.ts +3 -3
- package/dist/types/components/internal/Pagination/hooks/types.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/usePaginatedRecords.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/usePagination.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/types.d.ts +2 -1
- package/dist/types/components/internal/Pagination/types.d.ts.map +1 -1
- package/dist/types/components/internal/Popover/Popover.d.ts +1 -2
- package/dist/types/components/internal/Popover/Popover.d.ts.map +1 -1
- package/dist/types/components/internal/Popover/constants.d.ts +3 -1
- package/dist/types/components/internal/Popover/constants.d.ts.map +1 -1
- package/dist/types/components/internal/Popover/types.d.ts +6 -0
- package/dist/types/components/internal/Popover/types.d.ts.map +1 -1
- package/dist/types/components/internal/Popover/utils/popoverUtil.d.ts +7 -0
- package/dist/types/components/internal/Popover/utils/popoverUtil.d.ts.map +1 -0
- package/dist/types/components/internal/SVGIcons/Close.d.ts +4 -0
- package/dist/types/components/internal/SVGIcons/Close.d.ts.map +1 -0
- package/dist/types/components/internal/SVGIcons/Copy.d.ts +4 -0
- package/dist/types/components/internal/SVGIcons/Copy.d.ts.map +1 -0
- package/dist/types/components/internal/SVGIcons/Filter.d.ts +4 -0
- package/dist/types/components/internal/SVGIcons/Filter.d.ts.map +1 -0
- package/dist/types/components/internal/Tooltip/Tooltip.d.ts +5 -0
- package/dist/types/components/internal/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/types/components/internal/Tooltip/types.d.ts +13 -0
- package/dist/types/components/internal/Tooltip/types.d.ts.map +1 -0
- package/dist/types/components/internal/Tooltip/useTooltipListeners.d.ts +12 -0
- package/dist/types/components/internal/Tooltip/useTooltipListeners.d.ts.map +1 -0
- package/dist/types/components/internal/Typography/constants.d.ts +1 -1
- package/dist/types/components/utils/transactionResourceErrorCodes.d.ts +6 -2
- package/dist/types/components/utils/transactionResourceErrorCodes.d.ts.map +1 -1
- package/dist/types/constants.d.ts +6 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/core/Auth/AuthContext.d.ts +2 -2
- package/dist/types/core/Auth/AuthContext.d.ts.map +1 -1
- package/dist/types/core/Auth/AuthProvider.d.ts.map +1 -1
- package/dist/types/core/Auth/types.d.ts +9 -2
- package/dist/types/core/Auth/types.d.ts.map +1 -1
- package/dist/types/core/Auth/useAuthContext.d.ts +1 -1
- package/dist/types/core/Auth/useAuthContext.d.ts.map +1 -1
- package/dist/types/core/Errors/AdyenPlatformExperienceError.d.ts +9 -0
- package/dist/types/core/Errors/AdyenPlatformExperienceError.d.ts.map +1 -0
- package/dist/types/core/Localization/Localization.d.ts +7 -0
- package/dist/types/core/Localization/Localization.d.ts.map +1 -1
- package/dist/types/core/Localization/amount/amount-util.d.ts +1 -5
- package/dist/types/core/Localization/amount/amount-util.d.ts.map +1 -1
- package/dist/types/core/Localization/constants/locale.d.ts +17 -7
- package/dist/types/core/Localization/constants/locale.d.ts.map +1 -1
- package/dist/types/core/Localization/localization-utils.d.ts +1 -0
- package/dist/types/core/Localization/localization-utils.d.ts.map +1 -1
- package/dist/types/core/Localization/translations/index.d.ts +17 -7
- package/dist/types/core/Localization/translations/index.d.ts.map +1 -1
- package/dist/types/core/Localization/utils.d.ts +17 -7
- package/dist/types/core/Localization/utils.d.ts.map +1 -1
- package/dist/types/core/Services/requests/http.d.ts.map +1 -1
- package/dist/types/core/Services/requests/types.d.ts +2 -0
- package/dist/types/core/Services/requests/types.d.ts.map +1 -1
- package/dist/types/core/Services/requests/utils.d.ts +2 -1
- package/dist/types/core/Services/requests/utils.d.ts.map +1 -1
- package/dist/types/core/core.d.ts +1 -0
- package/dist/types/core/core.d.ts.map +1 -1
- package/dist/types/core/types.d.ts +1 -0
- package/dist/types/core/types.d.ts.map +1 -1
- package/dist/types/hooks/element/useClickOutside.d.ts +5 -1
- package/dist/types/hooks/element/useClickOutside.d.ts.map +1 -1
- package/dist/types/hooks/element/usePopoverPositioner.d.ts +2 -2
- package/dist/types/hooks/element/usePopoverPositioner.d.ts.map +1 -1
- package/dist/types/hooks/useModalDetails/types.d.ts +1 -1
- package/dist/types/hooks/useModalDetails/types.d.ts.map +1 -1
- package/dist/types/hooks/useSessionAwareRequest/useSessionAwareRequest.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/types.d.ts +1 -1
- package/dist/types/utils/types.d.ts.map +1 -1
- package/dist/types-0027b7c2.mjs +9 -0
- package/dist/types-0aaff3aa.mjs +19 -0
- package/dist/types-7ad6576a.mjs +10 -0
- package/dist/types-e4bbd37f.mjs +13 -0
- package/dist/types-e6a6a3ff.mjs +9 -0
- package/dist/usePaginatedRecords-63a69bf1.mjs +131 -0
- package/dist/usePopoverPositioner-882fea89.mjs +182 -0
- package/dist/vendor-vi.a3ff54b1-5e924357.mjs +22389 -0
- package/package.json +12 -9
- package/dist/ModalContent-83a84ba5.js +0 -2
- package/dist/ModalContent-83a84ba5.js.map +0 -1
- package/dist/es/components/external/TransactionDetails/components/TransactionDetails.scss.js +0 -4
- package/dist/es/components/external/Transactions/TransactionsOverviewElement.js +0 -28
- package/dist/es/components/external/Transactions/components/AmountSkeleton/AmountSkeleton.js +0 -9
- package/dist/es/components/external/Transactions/components/AmountSkeleton/AmountSkeleton.scss.js +0 -4
- package/dist/es/components/external/Transactions/components/AmountSkeleton/constants.js +0 -6
- package/dist/es/components/external/Transactions/components/BalanceAccountSelector/BalanceAccountSelector.js +0 -23
- package/dist/es/components/external/Transactions/components/BalanceAccountSelector/useBalanceAccountSelection.js +0 -17
- package/dist/es/components/external/Transactions/components/BalanceItem/BalanceItem.js +0 -35
- package/dist/es/components/external/Transactions/components/Balances/Balances.js +0 -50
- package/dist/es/components/external/Transactions/components/Balances/constants.js +0 -4
- package/dist/es/components/external/Transactions/components/ModalContent.js +0 -12
- package/dist/es/components/external/Transactions/components/MultiSelectionFilter/MultiSelectionFilter.js +0 -25
- package/dist/es/components/external/Transactions/components/MultiSelectionFilter/useMultiSelectionFilter/constants.js +0 -24
- package/dist/es/components/external/Transactions/components/MultiSelectionFilter/useMultiSelectionFilter/useMultiSelectionFilter.js +0 -21
- package/dist/es/components/external/Transactions/components/MultiSelectionFilter/useMultiSelectionFilter/utils.js +0 -9
- package/dist/es/components/external/Transactions/components/SummaryItem/SummaryItem.js +0 -42
- package/dist/es/components/external/Transactions/components/SummaryItem/SummaryItem.scss.js +0 -4
- package/dist/es/components/external/Transactions/components/SummaryItem/constants.js +0 -7
- package/dist/es/components/external/Transactions/components/TransactionList.js +0 -127
- package/dist/es/components/external/Transactions/components/TransactionList.scss.js +0 -4
- package/dist/es/components/external/Transactions/components/TransactionListError/TransactionListError.js +0 -20
- package/dist/es/components/external/Transactions/components/TransactionTotalItem/TransactionTotalItem.js +0 -48
- package/dist/es/components/external/Transactions/components/TransactionTotals/TransactionTotals.js +0 -60
- package/dist/es/components/external/Transactions/components/TransactionTotals/constants.js +0 -4
- package/dist/es/components/external/Transactions/components/TransactionsOverview.js +0 -148
- package/dist/es/components/external/Transactions/components/TransactionsOverviewContainer.js +0 -36
- package/dist/es/components/external/Transactions/components/TransactionsOverviewDateFilter.js +0 -61
- package/dist/es/components/external/Transactions/hooks/useDefaultTransactionsOverviewFilterParams.js +0 -22
- package/dist/es/components/external/Transactions/hooks/useMaxWidths.js +0 -15
- package/dist/es/components/external/Transactions/hooks/useTransactionsOverviewMultiSelectionFilters.js +0 -29
- package/dist/es/components/external/Transactions/types.js +0 -4
- package/dist/es/components/internal/BaseButton/BaseButton.scss.js +0 -4
- package/dist/es/components/internal/BaseList/BaseList.scss.js +0 -4
- package/dist/es/components/internal/Button/Button.scss.js +0 -4
- package/dist/es/components/internal/Button/ButtonActions/ButtonActions.scss.js +0 -4
- package/dist/es/components/internal/Button/ButtonActions/types.js +0 -7
- package/dist/es/components/internal/Button/types.js +0 -4
- package/dist/es/components/internal/Calendar/Calendar.scss.js +0 -4
- package/dist/es/components/internal/Calendar/calendar/types.js +0 -15
- package/dist/es/components/internal/Calendar/types.js +0 -4
- package/dist/es/components/internal/DataGrid/DataGrid.scss.js +0 -4
- package/dist/es/components/internal/DataGrid/types.js +0 -4
- package/dist/es/components/internal/DatePicker/DatePicker.scss.js +0 -4
- package/dist/es/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.scss.js +0 -4
- package/dist/es/components/internal/ExpandableCard/ExpandableCard.scss.js +0 -4
- package/dist/es/components/internal/FilterBar/FilterBar.scss.js +0 -4
- package/dist/es/components/internal/FilterBar/components/FilterButton/FilterButton.scss.js +0 -4
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/AmountFilter.scss.js +0 -4
- package/dist/es/components/internal/FilterBar/filters/BaseFilter/BaseFilter.scss.js +0 -4
- package/dist/es/components/internal/FilterBar/filters/DateFilter/DateFilter.scss.js +0 -4
- package/dist/es/components/internal/FilterBar/filters/DateFilter/types.js +0 -4
- package/dist/es/components/internal/FormFields/FormFields.scss.js +0 -4
- package/dist/es/components/internal/FormFields/Select/Select.scss.js +0 -4
- package/dist/es/components/internal/Img/Img.scss.js +0 -4
- package/dist/es/components/internal/Modal/Modal.scss.js +0 -4
- package/dist/es/components/internal/Pagination/Pagination.scss.js +0 -4
- package/dist/es/components/internal/Pagination/types.js +0 -5
- package/dist/es/components/internal/Popover/Popover.scss.js +0 -4
- package/dist/es/components/internal/Popover/PopoverContainer.scss.js +0 -4
- package/dist/es/components/internal/Popover/PopoverDismissButton/PopoverDismissButton.scss.js +0 -4
- package/dist/es/components/internal/Popover/types.js +0 -6
- package/dist/es/components/internal/Spinner/Spinner.scss.js +0 -4
- package/dist/es/components/internal/Tag/Tag.scss.js +0 -4
- package/dist/es/components/internal/Tag/types.js +0 -4
- package/dist/es/components/internal/Typography/Typography.scss.js +0 -4
- package/dist/es/components/internal/Typography/types.js +0 -6
- package/dist/es/components/shared.scss.js +0 -4
- package/dist/es/components/types.js +0 -4
- package/dist/es/core/Errors/AdyenFPError.js +0 -15
- package/dist/es/core/Localization/translations/ar.json.js +0 -4
- package/dist/es/core/Localization/translations/cs-CZ.json.js +0 -4
- package/dist/es/core/Localization/translations/da-DK.json.js +0 -4
- package/dist/es/core/Localization/translations/de-DE.json.js +0 -4
- package/dist/es/core/Localization/translations/el-GR.json.js +0 -4
- package/dist/es/core/Localization/translations/en-US.json.js +0 -358
- package/dist/es/core/Localization/translations/es-ES.json.js +0 -255
- package/dist/es/core/Localization/translations/fi-FI.json.js +0 -4
- package/dist/es/core/Localization/translations/fr-FR.json.js +0 -4
- package/dist/es/core/Localization/translations/hr-HR.json.js +0 -4
- package/dist/es/core/Localization/translations/hu-HU.json.js +0 -4
- package/dist/es/core/Localization/translations/it-IT.json.js +0 -4
- package/dist/es/core/Localization/translations/ja-JP.json.js +0 -4
- package/dist/es/core/Localization/translations/ko-KR.json.js +0 -4
- package/dist/es/core/Localization/translations/nl-NL.json.js +0 -4
- package/dist/es/core/Localization/translations/no-NO.json.js +0 -4
- package/dist/es/core/Localization/translations/pl-PL.json.js +0 -4
- package/dist/es/core/Localization/translations/pt-BR.json.js +0 -4
- package/dist/es/core/Localization/translations/pt-PT.json.js +0 -4
- package/dist/es/core/Localization/translations/ro-RO.json.js +0 -4
- package/dist/es/core/Localization/translations/ru-RU.json.js +0 -4
- package/dist/es/core/Localization/translations/sk-SK.json.js +0 -4
- package/dist/es/core/Localization/translations/sl-SI.json.js +0 -4
- package/dist/es/core/Localization/translations/sv-SE.json.js +0 -4
- package/dist/es/core/Localization/translations/zh-CN.json.js +0 -4
- package/dist/es/core/Localization/translations/zh-TW.json.js +0 -4
- package/dist/es/external/preact/compat/dist/compat.module.js +0 -254
- package/dist/es/external/preact/hooks/dist/hooks.module.js +0 -161
- package/dist/es/external/preact/jsx-runtime/dist/jsxRuntime.module.js +0 -19
- package/dist/es/hooks/useCommitAction/types.js +0 -4
- package/dist/es/hooks/useModalDetails/types.js +0 -6
- package/dist/es/images/no-data-female.svg.js +0 -4
- package/dist/es/images/no-results.svg.js +0 -4
- package/dist/es/style/index.scss.js +0 -4
- package/dist/index-ff45d757.js +0 -12
- package/dist/index-ff45d757.js.map +0 -1
- package/dist/style.css +0 -1
- package/dist/types/components/external/Transactions/TransactionsOverviewElement.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/AmountSkeleton/AmountSkeleton.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/AmountSkeleton/constants.d.ts +0 -4
- package/dist/types/components/external/Transactions/components/AmountSkeleton/constants.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/AmountSkeleton/types.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/BalanceAccountSelector/BalanceAccountSelector.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/BalanceAccountSelector/index.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/BalanceAccountSelector/useBalanceAccountSelection.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/BalanceItem/BalanceItem.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/BalanceItem/types.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/Balances/Balances.d.ts +0 -11
- package/dist/types/components/external/Transactions/components/Balances/Balances.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/Balances/constants.d.ts +0 -2
- package/dist/types/components/external/Transactions/components/Balances/constants.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/ModalContent.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/MultiSelectionFilter/MultiSelectionFilter.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/MultiSelectionFilter/index.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/MultiSelectionFilter/useMultiSelectionFilter/constants.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/MultiSelectionFilter/useMultiSelectionFilter/index.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/MultiSelectionFilter/useMultiSelectionFilter/types.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/MultiSelectionFilter/useMultiSelectionFilter/useMultiSelectionFilter.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/MultiSelectionFilter/useMultiSelectionFilter/utils.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/SummaryItem/SummaryItem.d.ts +0 -4
- package/dist/types/components/external/Transactions/components/SummaryItem/SummaryItem.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/SummaryItem/constants.d.ts +0 -5
- package/dist/types/components/external/Transactions/components/SummaryItem/constants.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/SummaryItem/types.d.ts +0 -20
- package/dist/types/components/external/Transactions/components/SummaryItem/types.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/TransactionList.d.ts +0 -6
- package/dist/types/components/external/Transactions/components/TransactionList.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/TransactionListError/TransactionListError.d.ts +0 -7
- package/dist/types/components/external/Transactions/components/TransactionListError/TransactionListError.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/TransactionTotalItem/TransactionTotalItem.d.ts +0 -3
- package/dist/types/components/external/Transactions/components/TransactionTotalItem/TransactionTotalItem.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/TransactionTotalItem/types.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/TransactionTotals/TransactionTotals.d.ts +0 -9
- package/dist/types/components/external/Transactions/components/TransactionTotals/TransactionTotals.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/TransactionTotals/constants.d.ts +0 -2
- package/dist/types/components/external/Transactions/components/TransactionTotals/constants.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/TransactionsOverview.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/TransactionsOverviewContainer.d.ts +0 -6
- package/dist/types/components/external/Transactions/components/TransactionsOverviewContainer.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/TransactionsOverviewDateFilter.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/components/utils.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/hooks/useDefaultTransactionsOverviewFilterParams.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/hooks/useMaxWidths.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/hooks/useTransactionsOverviewMultiSelectionFilters.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/index.d.ts +0 -3
- package/dist/types/components/external/Transactions/index.d.ts.map +0 -1
- package/dist/types/components/external/Transactions/types.d.ts.map +0 -1
- package/dist/types/components/internal/FormFields/Checkbox/Checkbox.d.ts +0 -22
- package/dist/types/components/internal/FormFields/Checkbox/Checkbox.d.ts.map +0 -1
- package/dist/types/components/internal/FormFields/Checkbox/index.d.ts +0 -2
- package/dist/types/components/internal/FormFields/Checkbox/index.d.ts.map +0 -1
- package/dist/types/components/internal/FormFields/InputDate/InputDate.d.ts +0 -3
- package/dist/types/components/internal/FormFields/InputDate/InputDate.d.ts.map +0 -1
- package/dist/types/components/internal/FormFields/InputDate/index.d.ts +0 -2
- package/dist/types/components/internal/FormFields/InputDate/index.d.ts.map +0 -1
- package/dist/types/components/internal/FormFields/InputDate/utils.d.ts +0 -22
- package/dist/types/components/internal/FormFields/InputDate/utils.d.ts.map +0 -1
- package/dist/types/components/internal/FormFields/InputEmail.d.ts +0 -3
- package/dist/types/components/internal/FormFields/InputEmail.d.ts.map +0 -1
- package/dist/types/components/internal/FormFields/InputTelephone.d.ts +0 -3
- package/dist/types/components/internal/FormFields/InputTelephone.d.ts.map +0 -1
- package/dist/types/components/internal/FormFields/RadioGroup/RadioGroup.d.ts +0 -11
- package/dist/types/components/internal/FormFields/RadioGroup/RadioGroup.d.ts.map +0 -1
- package/dist/types/components/internal/FormFields/RadioGroup/index.d.ts +0 -2
- package/dist/types/components/internal/FormFields/RadioGroup/index.d.ts.map +0 -1
- package/dist/types/components/internal/FormFields/RadioGroup/types.d.ts +0 -19
- package/dist/types/components/internal/FormFields/RadioGroup/types.d.ts.map +0 -1
- package/dist/types/core/Errors/AdyenFPError.d.ts +0 -8
- package/dist/types/core/Errors/AdyenFPError.d.ts.map +0 -1
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/TransactionsOverviewElement.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/AmountSkeleton/types.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/BalanceAccountSelector/index.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/BalanceAccountSelector/useBalanceAccountSelection.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/BalanceItem/types.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/ModalContent.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/MultiSelectionFilter/MultiSelectionFilter.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/MultiSelectionFilter/index.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/MultiSelectionFilter/useMultiSelectionFilter/constants.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/MultiSelectionFilter/useMultiSelectionFilter/index.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/MultiSelectionFilter/useMultiSelectionFilter/types.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/MultiSelectionFilter/useMultiSelectionFilter/useMultiSelectionFilter.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/MultiSelectionFilter/useMultiSelectionFilter/utils.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/components/TransactionsOverviewDateFilter.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/hooks/useDefaultTransactionsOverviewFilterParams.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/hooks/useMaxWidths.d.ts +0 -0
- /package/dist/types/components/external/{Transactions → TransactionsOverview}/hooks/useTransactionsOverviewMultiSelectionFilters.d.ts +0 -0
|
@@ -0,0 +1,1146 @@
|
|
|
1
|
+
import { f as commonjsGlobal } from "./vendor-vi.a3ff54b1-5e924357.mjs";
|
|
2
|
+
var sourcemapCodec_umd = { exports: {} };
|
|
3
|
+
(function(module, exports) {
|
|
4
|
+
(function(global, factory) {
|
|
5
|
+
factory(exports);
|
|
6
|
+
})(commonjsGlobal, function(exports2) {
|
|
7
|
+
const comma = ",".charCodeAt(0);
|
|
8
|
+
const semicolon = ";".charCodeAt(0);
|
|
9
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
10
|
+
const intToChar = new Uint8Array(64);
|
|
11
|
+
const charToInt = new Uint8Array(128);
|
|
12
|
+
for (let i = 0; i < chars.length; i++) {
|
|
13
|
+
const c = chars.charCodeAt(i);
|
|
14
|
+
intToChar[i] = c;
|
|
15
|
+
charToInt[c] = i;
|
|
16
|
+
}
|
|
17
|
+
const td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
18
|
+
decode(buf) {
|
|
19
|
+
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
20
|
+
return out.toString();
|
|
21
|
+
}
|
|
22
|
+
} : {
|
|
23
|
+
decode(buf) {
|
|
24
|
+
let out = "";
|
|
25
|
+
for (let i = 0; i < buf.length; i++) {
|
|
26
|
+
out += String.fromCharCode(buf[i]);
|
|
27
|
+
}
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
function decode(mappings) {
|
|
32
|
+
const state = new Int32Array(5);
|
|
33
|
+
const decoded = [];
|
|
34
|
+
let index = 0;
|
|
35
|
+
do {
|
|
36
|
+
const semi = indexOf(mappings, index);
|
|
37
|
+
const line = [];
|
|
38
|
+
let sorted = true;
|
|
39
|
+
let lastCol = 0;
|
|
40
|
+
state[0] = 0;
|
|
41
|
+
for (let i = index; i < semi; i++) {
|
|
42
|
+
let seg;
|
|
43
|
+
i = decodeInteger(mappings, i, state, 0);
|
|
44
|
+
const col = state[0];
|
|
45
|
+
if (col < lastCol)
|
|
46
|
+
sorted = false;
|
|
47
|
+
lastCol = col;
|
|
48
|
+
if (hasMoreVlq(mappings, i, semi)) {
|
|
49
|
+
i = decodeInteger(mappings, i, state, 1);
|
|
50
|
+
i = decodeInteger(mappings, i, state, 2);
|
|
51
|
+
i = decodeInteger(mappings, i, state, 3);
|
|
52
|
+
if (hasMoreVlq(mappings, i, semi)) {
|
|
53
|
+
i = decodeInteger(mappings, i, state, 4);
|
|
54
|
+
seg = [col, state[1], state[2], state[3], state[4]];
|
|
55
|
+
} else {
|
|
56
|
+
seg = [col, state[1], state[2], state[3]];
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
seg = [col];
|
|
60
|
+
}
|
|
61
|
+
line.push(seg);
|
|
62
|
+
}
|
|
63
|
+
if (!sorted)
|
|
64
|
+
sort(line);
|
|
65
|
+
decoded.push(line);
|
|
66
|
+
index = semi + 1;
|
|
67
|
+
} while (index <= mappings.length);
|
|
68
|
+
return decoded;
|
|
69
|
+
}
|
|
70
|
+
function indexOf(mappings, index) {
|
|
71
|
+
const idx = mappings.indexOf(";", index);
|
|
72
|
+
return idx === -1 ? mappings.length : idx;
|
|
73
|
+
}
|
|
74
|
+
function decodeInteger(mappings, pos, state, j) {
|
|
75
|
+
let value = 0;
|
|
76
|
+
let shift = 0;
|
|
77
|
+
let integer = 0;
|
|
78
|
+
do {
|
|
79
|
+
const c = mappings.charCodeAt(pos++);
|
|
80
|
+
integer = charToInt[c];
|
|
81
|
+
value |= (integer & 31) << shift;
|
|
82
|
+
shift += 5;
|
|
83
|
+
} while (integer & 32);
|
|
84
|
+
const shouldNegate = value & 1;
|
|
85
|
+
value >>>= 1;
|
|
86
|
+
if (shouldNegate) {
|
|
87
|
+
value = -2147483648 | -value;
|
|
88
|
+
}
|
|
89
|
+
state[j] += value;
|
|
90
|
+
return pos;
|
|
91
|
+
}
|
|
92
|
+
function hasMoreVlq(mappings, i, length) {
|
|
93
|
+
if (i >= length)
|
|
94
|
+
return false;
|
|
95
|
+
return mappings.charCodeAt(i) !== comma;
|
|
96
|
+
}
|
|
97
|
+
function sort(line) {
|
|
98
|
+
line.sort(sortComparator);
|
|
99
|
+
}
|
|
100
|
+
function sortComparator(a, b) {
|
|
101
|
+
return a[0] - b[0];
|
|
102
|
+
}
|
|
103
|
+
function encode(decoded) {
|
|
104
|
+
const state = new Int32Array(5);
|
|
105
|
+
const bufLength = 1024 * 16;
|
|
106
|
+
const subLength = bufLength - 36;
|
|
107
|
+
const buf = new Uint8Array(bufLength);
|
|
108
|
+
const sub = buf.subarray(0, subLength);
|
|
109
|
+
let pos = 0;
|
|
110
|
+
let out = "";
|
|
111
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
112
|
+
const line = decoded[i];
|
|
113
|
+
if (i > 0) {
|
|
114
|
+
if (pos === bufLength) {
|
|
115
|
+
out += td.decode(buf);
|
|
116
|
+
pos = 0;
|
|
117
|
+
}
|
|
118
|
+
buf[pos++] = semicolon;
|
|
119
|
+
}
|
|
120
|
+
if (line.length === 0)
|
|
121
|
+
continue;
|
|
122
|
+
state[0] = 0;
|
|
123
|
+
for (let j = 0; j < line.length; j++) {
|
|
124
|
+
const segment = line[j];
|
|
125
|
+
if (pos > subLength) {
|
|
126
|
+
out += td.decode(sub);
|
|
127
|
+
buf.copyWithin(0, subLength, pos);
|
|
128
|
+
pos -= subLength;
|
|
129
|
+
}
|
|
130
|
+
if (j > 0)
|
|
131
|
+
buf[pos++] = comma;
|
|
132
|
+
pos = encodeInteger(buf, pos, state, segment, 0);
|
|
133
|
+
if (segment.length === 1)
|
|
134
|
+
continue;
|
|
135
|
+
pos = encodeInteger(buf, pos, state, segment, 1);
|
|
136
|
+
pos = encodeInteger(buf, pos, state, segment, 2);
|
|
137
|
+
pos = encodeInteger(buf, pos, state, segment, 3);
|
|
138
|
+
if (segment.length === 4)
|
|
139
|
+
continue;
|
|
140
|
+
pos = encodeInteger(buf, pos, state, segment, 4);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return out + td.decode(buf.subarray(0, pos));
|
|
144
|
+
}
|
|
145
|
+
function encodeInteger(buf, pos, state, segment, j) {
|
|
146
|
+
const next = segment[j];
|
|
147
|
+
let num = next - state[j];
|
|
148
|
+
state[j] = next;
|
|
149
|
+
num = num < 0 ? -num << 1 | 1 : num << 1;
|
|
150
|
+
do {
|
|
151
|
+
let clamped = num & 31;
|
|
152
|
+
num >>>= 5;
|
|
153
|
+
if (num > 0)
|
|
154
|
+
clamped |= 32;
|
|
155
|
+
buf[pos++] = intToChar[clamped];
|
|
156
|
+
} while (num > 0);
|
|
157
|
+
return pos;
|
|
158
|
+
}
|
|
159
|
+
exports2.decode = decode;
|
|
160
|
+
exports2.encode = encode;
|
|
161
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
162
|
+
});
|
|
163
|
+
})(sourcemapCodec_umd, sourcemapCodec_umd.exports);
|
|
164
|
+
var sourcemapCodec_umdExports = sourcemapCodec_umd.exports;
|
|
165
|
+
class BitSet {
|
|
166
|
+
constructor(arg) {
|
|
167
|
+
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
168
|
+
}
|
|
169
|
+
add(n2) {
|
|
170
|
+
this.bits[n2 >> 5] |= 1 << (n2 & 31);
|
|
171
|
+
}
|
|
172
|
+
has(n2) {
|
|
173
|
+
return !!(this.bits[n2 >> 5] & 1 << (n2 & 31));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
class Chunk {
|
|
177
|
+
constructor(start, end, content) {
|
|
178
|
+
this.start = start;
|
|
179
|
+
this.end = end;
|
|
180
|
+
this.original = content;
|
|
181
|
+
this.intro = "";
|
|
182
|
+
this.outro = "";
|
|
183
|
+
this.content = content;
|
|
184
|
+
this.storeName = false;
|
|
185
|
+
this.edited = false;
|
|
186
|
+
{
|
|
187
|
+
this.previous = null;
|
|
188
|
+
this.next = null;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
appendLeft(content) {
|
|
192
|
+
this.outro += content;
|
|
193
|
+
}
|
|
194
|
+
appendRight(content) {
|
|
195
|
+
this.intro = this.intro + content;
|
|
196
|
+
}
|
|
197
|
+
clone() {
|
|
198
|
+
const chunk = new Chunk(this.start, this.end, this.original);
|
|
199
|
+
chunk.intro = this.intro;
|
|
200
|
+
chunk.outro = this.outro;
|
|
201
|
+
chunk.content = this.content;
|
|
202
|
+
chunk.storeName = this.storeName;
|
|
203
|
+
chunk.edited = this.edited;
|
|
204
|
+
return chunk;
|
|
205
|
+
}
|
|
206
|
+
contains(index) {
|
|
207
|
+
return this.start < index && index < this.end;
|
|
208
|
+
}
|
|
209
|
+
eachNext(fn) {
|
|
210
|
+
let chunk = this;
|
|
211
|
+
while (chunk) {
|
|
212
|
+
fn(chunk);
|
|
213
|
+
chunk = chunk.next;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
eachPrevious(fn) {
|
|
217
|
+
let chunk = this;
|
|
218
|
+
while (chunk) {
|
|
219
|
+
fn(chunk);
|
|
220
|
+
chunk = chunk.previous;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
edit(content, storeName, contentOnly) {
|
|
224
|
+
this.content = content;
|
|
225
|
+
if (!contentOnly) {
|
|
226
|
+
this.intro = "";
|
|
227
|
+
this.outro = "";
|
|
228
|
+
}
|
|
229
|
+
this.storeName = storeName;
|
|
230
|
+
this.edited = true;
|
|
231
|
+
return this;
|
|
232
|
+
}
|
|
233
|
+
prependLeft(content) {
|
|
234
|
+
this.outro = content + this.outro;
|
|
235
|
+
}
|
|
236
|
+
prependRight(content) {
|
|
237
|
+
this.intro = content + this.intro;
|
|
238
|
+
}
|
|
239
|
+
split(index) {
|
|
240
|
+
const sliceIndex = index - this.start;
|
|
241
|
+
const originalBefore = this.original.slice(0, sliceIndex);
|
|
242
|
+
const originalAfter = this.original.slice(sliceIndex);
|
|
243
|
+
this.original = originalBefore;
|
|
244
|
+
const newChunk = new Chunk(index, this.end, originalAfter);
|
|
245
|
+
newChunk.outro = this.outro;
|
|
246
|
+
this.outro = "";
|
|
247
|
+
this.end = index;
|
|
248
|
+
if (this.edited) {
|
|
249
|
+
newChunk.edit("", false);
|
|
250
|
+
this.content = "";
|
|
251
|
+
} else {
|
|
252
|
+
this.content = originalBefore;
|
|
253
|
+
}
|
|
254
|
+
newChunk.next = this.next;
|
|
255
|
+
if (newChunk.next)
|
|
256
|
+
newChunk.next.previous = newChunk;
|
|
257
|
+
newChunk.previous = this;
|
|
258
|
+
this.next = newChunk;
|
|
259
|
+
return newChunk;
|
|
260
|
+
}
|
|
261
|
+
toString() {
|
|
262
|
+
return this.intro + this.content + this.outro;
|
|
263
|
+
}
|
|
264
|
+
trimEnd(rx) {
|
|
265
|
+
this.outro = this.outro.replace(rx, "");
|
|
266
|
+
if (this.outro.length)
|
|
267
|
+
return true;
|
|
268
|
+
const trimmed = this.content.replace(rx, "");
|
|
269
|
+
if (trimmed.length) {
|
|
270
|
+
if (trimmed !== this.content) {
|
|
271
|
+
this.split(this.start + trimmed.length).edit("", void 0, true);
|
|
272
|
+
if (this.edited) {
|
|
273
|
+
this.edit(trimmed, this.storeName, true);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return true;
|
|
277
|
+
} else {
|
|
278
|
+
this.edit("", void 0, true);
|
|
279
|
+
this.intro = this.intro.replace(rx, "");
|
|
280
|
+
if (this.intro.length)
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
trimStart(rx) {
|
|
285
|
+
this.intro = this.intro.replace(rx, "");
|
|
286
|
+
if (this.intro.length)
|
|
287
|
+
return true;
|
|
288
|
+
const trimmed = this.content.replace(rx, "");
|
|
289
|
+
if (trimmed.length) {
|
|
290
|
+
if (trimmed !== this.content) {
|
|
291
|
+
const newChunk = this.split(this.end - trimmed.length);
|
|
292
|
+
if (this.edited) {
|
|
293
|
+
newChunk.edit(trimmed, this.storeName, true);
|
|
294
|
+
}
|
|
295
|
+
this.edit("", void 0, true);
|
|
296
|
+
}
|
|
297
|
+
return true;
|
|
298
|
+
} else {
|
|
299
|
+
this.edit("", void 0, true);
|
|
300
|
+
this.outro = this.outro.replace(rx, "");
|
|
301
|
+
if (this.outro.length)
|
|
302
|
+
return true;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function getBtoa() {
|
|
307
|
+
if (typeof window !== "undefined" && typeof window.btoa === "function") {
|
|
308
|
+
return (str) => window.btoa(unescape(encodeURIComponent(str)));
|
|
309
|
+
} else if (typeof Buffer === "function") {
|
|
310
|
+
return (str) => Buffer.from(str, "utf-8").toString("base64");
|
|
311
|
+
} else {
|
|
312
|
+
return () => {
|
|
313
|
+
throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
const btoa = /* @__PURE__ */ getBtoa();
|
|
318
|
+
class SourceMap {
|
|
319
|
+
constructor(properties) {
|
|
320
|
+
this.version = 3;
|
|
321
|
+
this.file = properties.file;
|
|
322
|
+
this.sources = properties.sources;
|
|
323
|
+
this.sourcesContent = properties.sourcesContent;
|
|
324
|
+
this.names = properties.names;
|
|
325
|
+
this.mappings = sourcemapCodec_umdExports.encode(properties.mappings);
|
|
326
|
+
if (typeof properties.x_google_ignoreList !== "undefined") {
|
|
327
|
+
this.x_google_ignoreList = properties.x_google_ignoreList;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
toString() {
|
|
331
|
+
return JSON.stringify(this);
|
|
332
|
+
}
|
|
333
|
+
toUrl() {
|
|
334
|
+
return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function guessIndent(code) {
|
|
338
|
+
const lines = code.split("\n");
|
|
339
|
+
const tabbed = lines.filter((line) => /^\t+/.test(line));
|
|
340
|
+
const spaced = lines.filter((line) => /^ {2,}/.test(line));
|
|
341
|
+
if (tabbed.length === 0 && spaced.length === 0) {
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
if (tabbed.length >= spaced.length) {
|
|
345
|
+
return " ";
|
|
346
|
+
}
|
|
347
|
+
const min = spaced.reduce((previous, current) => {
|
|
348
|
+
const numSpaces = /^ +/.exec(current)[0].length;
|
|
349
|
+
return Math.min(numSpaces, previous);
|
|
350
|
+
}, Infinity);
|
|
351
|
+
return new Array(min + 1).join(" ");
|
|
352
|
+
}
|
|
353
|
+
function getRelativePath(from, to) {
|
|
354
|
+
const fromParts = from.split(/[/\\]/);
|
|
355
|
+
const toParts = to.split(/[/\\]/);
|
|
356
|
+
fromParts.pop();
|
|
357
|
+
while (fromParts[0] === toParts[0]) {
|
|
358
|
+
fromParts.shift();
|
|
359
|
+
toParts.shift();
|
|
360
|
+
}
|
|
361
|
+
if (fromParts.length) {
|
|
362
|
+
let i = fromParts.length;
|
|
363
|
+
while (i--)
|
|
364
|
+
fromParts[i] = "..";
|
|
365
|
+
}
|
|
366
|
+
return fromParts.concat(toParts).join("/");
|
|
367
|
+
}
|
|
368
|
+
const toString = Object.prototype.toString;
|
|
369
|
+
function isObject(thing) {
|
|
370
|
+
return toString.call(thing) === "[object Object]";
|
|
371
|
+
}
|
|
372
|
+
function getLocator(source) {
|
|
373
|
+
const originalLines = source.split("\n");
|
|
374
|
+
const lineOffsets = [];
|
|
375
|
+
for (let i = 0, pos = 0; i < originalLines.length; i++) {
|
|
376
|
+
lineOffsets.push(pos);
|
|
377
|
+
pos += originalLines[i].length + 1;
|
|
378
|
+
}
|
|
379
|
+
return function locate(index) {
|
|
380
|
+
let i = 0;
|
|
381
|
+
let j = lineOffsets.length;
|
|
382
|
+
while (i < j) {
|
|
383
|
+
const m = i + j >> 1;
|
|
384
|
+
if (index < lineOffsets[m]) {
|
|
385
|
+
j = m;
|
|
386
|
+
} else {
|
|
387
|
+
i = m + 1;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
const line = i - 1;
|
|
391
|
+
const column = index - lineOffsets[line];
|
|
392
|
+
return { line, column };
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
const wordRegex = /\w/;
|
|
396
|
+
class Mappings {
|
|
397
|
+
constructor(hires) {
|
|
398
|
+
this.hires = hires;
|
|
399
|
+
this.generatedCodeLine = 0;
|
|
400
|
+
this.generatedCodeColumn = 0;
|
|
401
|
+
this.raw = [];
|
|
402
|
+
this.rawSegments = this.raw[this.generatedCodeLine] = [];
|
|
403
|
+
this.pending = null;
|
|
404
|
+
}
|
|
405
|
+
addEdit(sourceIndex, content, loc, nameIndex) {
|
|
406
|
+
if (content.length) {
|
|
407
|
+
let contentLineEnd = content.indexOf("\n", 0);
|
|
408
|
+
let previousContentLineEnd = -1;
|
|
409
|
+
while (contentLineEnd >= 0) {
|
|
410
|
+
const segment2 = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
411
|
+
if (nameIndex >= 0) {
|
|
412
|
+
segment2.push(nameIndex);
|
|
413
|
+
}
|
|
414
|
+
this.rawSegments.push(segment2);
|
|
415
|
+
this.generatedCodeLine += 1;
|
|
416
|
+
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
417
|
+
this.generatedCodeColumn = 0;
|
|
418
|
+
previousContentLineEnd = contentLineEnd;
|
|
419
|
+
contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
|
|
420
|
+
}
|
|
421
|
+
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
422
|
+
if (nameIndex >= 0) {
|
|
423
|
+
segment.push(nameIndex);
|
|
424
|
+
}
|
|
425
|
+
this.rawSegments.push(segment);
|
|
426
|
+
this.advance(content.slice(previousContentLineEnd + 1));
|
|
427
|
+
} else if (this.pending) {
|
|
428
|
+
this.rawSegments.push(this.pending);
|
|
429
|
+
this.advance(content);
|
|
430
|
+
}
|
|
431
|
+
this.pending = null;
|
|
432
|
+
}
|
|
433
|
+
addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
|
|
434
|
+
let originalCharIndex = chunk.start;
|
|
435
|
+
let first = true;
|
|
436
|
+
let charInHiresBoundary = false;
|
|
437
|
+
while (originalCharIndex < chunk.end) {
|
|
438
|
+
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
|
439
|
+
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
440
|
+
if (this.hires === "boundary") {
|
|
441
|
+
if (wordRegex.test(original[originalCharIndex])) {
|
|
442
|
+
if (!charInHiresBoundary) {
|
|
443
|
+
this.rawSegments.push(segment);
|
|
444
|
+
charInHiresBoundary = true;
|
|
445
|
+
}
|
|
446
|
+
} else {
|
|
447
|
+
this.rawSegments.push(segment);
|
|
448
|
+
charInHiresBoundary = false;
|
|
449
|
+
}
|
|
450
|
+
} else {
|
|
451
|
+
this.rawSegments.push(segment);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
if (original[originalCharIndex] === "\n") {
|
|
455
|
+
loc.line += 1;
|
|
456
|
+
loc.column = 0;
|
|
457
|
+
this.generatedCodeLine += 1;
|
|
458
|
+
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
459
|
+
this.generatedCodeColumn = 0;
|
|
460
|
+
first = true;
|
|
461
|
+
} else {
|
|
462
|
+
loc.column += 1;
|
|
463
|
+
this.generatedCodeColumn += 1;
|
|
464
|
+
first = false;
|
|
465
|
+
}
|
|
466
|
+
originalCharIndex += 1;
|
|
467
|
+
}
|
|
468
|
+
this.pending = null;
|
|
469
|
+
}
|
|
470
|
+
advance(str) {
|
|
471
|
+
if (!str)
|
|
472
|
+
return;
|
|
473
|
+
const lines = str.split("\n");
|
|
474
|
+
if (lines.length > 1) {
|
|
475
|
+
for (let i = 0; i < lines.length - 1; i++) {
|
|
476
|
+
this.generatedCodeLine++;
|
|
477
|
+
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
478
|
+
}
|
|
479
|
+
this.generatedCodeColumn = 0;
|
|
480
|
+
}
|
|
481
|
+
this.generatedCodeColumn += lines[lines.length - 1].length;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
const n = "\n";
|
|
485
|
+
const warned = {
|
|
486
|
+
insertLeft: false,
|
|
487
|
+
insertRight: false,
|
|
488
|
+
storeName: false
|
|
489
|
+
};
|
|
490
|
+
class MagicString {
|
|
491
|
+
constructor(string, options = {}) {
|
|
492
|
+
const chunk = new Chunk(0, string.length, string);
|
|
493
|
+
Object.defineProperties(this, {
|
|
494
|
+
original: { writable: true, value: string },
|
|
495
|
+
outro: { writable: true, value: "" },
|
|
496
|
+
intro: { writable: true, value: "" },
|
|
497
|
+
firstChunk: { writable: true, value: chunk },
|
|
498
|
+
lastChunk: { writable: true, value: chunk },
|
|
499
|
+
lastSearchedChunk: { writable: true, value: chunk },
|
|
500
|
+
byStart: { writable: true, value: {} },
|
|
501
|
+
byEnd: { writable: true, value: {} },
|
|
502
|
+
filename: { writable: true, value: options.filename },
|
|
503
|
+
indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
|
|
504
|
+
sourcemapLocations: { writable: true, value: new BitSet() },
|
|
505
|
+
storedNames: { writable: true, value: {} },
|
|
506
|
+
indentStr: { writable: true, value: void 0 },
|
|
507
|
+
ignoreList: { writable: true, value: options.ignoreList }
|
|
508
|
+
});
|
|
509
|
+
this.byStart[0] = chunk;
|
|
510
|
+
this.byEnd[string.length] = chunk;
|
|
511
|
+
}
|
|
512
|
+
addSourcemapLocation(char) {
|
|
513
|
+
this.sourcemapLocations.add(char);
|
|
514
|
+
}
|
|
515
|
+
append(content) {
|
|
516
|
+
if (typeof content !== "string")
|
|
517
|
+
throw new TypeError("outro content must be a string");
|
|
518
|
+
this.outro += content;
|
|
519
|
+
return this;
|
|
520
|
+
}
|
|
521
|
+
appendLeft(index, content) {
|
|
522
|
+
if (typeof content !== "string")
|
|
523
|
+
throw new TypeError("inserted content must be a string");
|
|
524
|
+
this._split(index);
|
|
525
|
+
const chunk = this.byEnd[index];
|
|
526
|
+
if (chunk) {
|
|
527
|
+
chunk.appendLeft(content);
|
|
528
|
+
} else {
|
|
529
|
+
this.intro += content;
|
|
530
|
+
}
|
|
531
|
+
return this;
|
|
532
|
+
}
|
|
533
|
+
appendRight(index, content) {
|
|
534
|
+
if (typeof content !== "string")
|
|
535
|
+
throw new TypeError("inserted content must be a string");
|
|
536
|
+
this._split(index);
|
|
537
|
+
const chunk = this.byStart[index];
|
|
538
|
+
if (chunk) {
|
|
539
|
+
chunk.appendRight(content);
|
|
540
|
+
} else {
|
|
541
|
+
this.outro += content;
|
|
542
|
+
}
|
|
543
|
+
return this;
|
|
544
|
+
}
|
|
545
|
+
clone() {
|
|
546
|
+
const cloned = new MagicString(this.original, { filename: this.filename });
|
|
547
|
+
let originalChunk = this.firstChunk;
|
|
548
|
+
let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
|
|
549
|
+
while (originalChunk) {
|
|
550
|
+
cloned.byStart[clonedChunk.start] = clonedChunk;
|
|
551
|
+
cloned.byEnd[clonedChunk.end] = clonedChunk;
|
|
552
|
+
const nextOriginalChunk = originalChunk.next;
|
|
553
|
+
const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
|
|
554
|
+
if (nextClonedChunk) {
|
|
555
|
+
clonedChunk.next = nextClonedChunk;
|
|
556
|
+
nextClonedChunk.previous = clonedChunk;
|
|
557
|
+
clonedChunk = nextClonedChunk;
|
|
558
|
+
}
|
|
559
|
+
originalChunk = nextOriginalChunk;
|
|
560
|
+
}
|
|
561
|
+
cloned.lastChunk = clonedChunk;
|
|
562
|
+
if (this.indentExclusionRanges) {
|
|
563
|
+
cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
|
|
564
|
+
}
|
|
565
|
+
cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
|
|
566
|
+
cloned.intro = this.intro;
|
|
567
|
+
cloned.outro = this.outro;
|
|
568
|
+
return cloned;
|
|
569
|
+
}
|
|
570
|
+
generateDecodedMap(options) {
|
|
571
|
+
options = options || {};
|
|
572
|
+
const sourceIndex = 0;
|
|
573
|
+
const names = Object.keys(this.storedNames);
|
|
574
|
+
const mappings = new Mappings(options.hires);
|
|
575
|
+
const locate = getLocator(this.original);
|
|
576
|
+
if (this.intro) {
|
|
577
|
+
mappings.advance(this.intro);
|
|
578
|
+
}
|
|
579
|
+
this.firstChunk.eachNext((chunk) => {
|
|
580
|
+
const loc = locate(chunk.start);
|
|
581
|
+
if (chunk.intro.length)
|
|
582
|
+
mappings.advance(chunk.intro);
|
|
583
|
+
if (chunk.edited) {
|
|
584
|
+
mappings.addEdit(
|
|
585
|
+
sourceIndex,
|
|
586
|
+
chunk.content,
|
|
587
|
+
loc,
|
|
588
|
+
chunk.storeName ? names.indexOf(chunk.original) : -1
|
|
589
|
+
);
|
|
590
|
+
} else {
|
|
591
|
+
mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
|
|
592
|
+
}
|
|
593
|
+
if (chunk.outro.length)
|
|
594
|
+
mappings.advance(chunk.outro);
|
|
595
|
+
});
|
|
596
|
+
return {
|
|
597
|
+
file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
|
|
598
|
+
sources: [
|
|
599
|
+
options.source ? getRelativePath(options.file || "", options.source) : options.file || ""
|
|
600
|
+
],
|
|
601
|
+
sourcesContent: options.includeContent ? [this.original] : void 0,
|
|
602
|
+
names,
|
|
603
|
+
mappings: mappings.raw,
|
|
604
|
+
x_google_ignoreList: this.ignoreList ? [sourceIndex] : void 0
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
generateMap(options) {
|
|
608
|
+
return new SourceMap(this.generateDecodedMap(options));
|
|
609
|
+
}
|
|
610
|
+
_ensureindentStr() {
|
|
611
|
+
if (this.indentStr === void 0) {
|
|
612
|
+
this.indentStr = guessIndent(this.original);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
_getRawIndentString() {
|
|
616
|
+
this._ensureindentStr();
|
|
617
|
+
return this.indentStr;
|
|
618
|
+
}
|
|
619
|
+
getIndentString() {
|
|
620
|
+
this._ensureindentStr();
|
|
621
|
+
return this.indentStr === null ? " " : this.indentStr;
|
|
622
|
+
}
|
|
623
|
+
indent(indentStr, options) {
|
|
624
|
+
const pattern = /^[^\r\n]/gm;
|
|
625
|
+
if (isObject(indentStr)) {
|
|
626
|
+
options = indentStr;
|
|
627
|
+
indentStr = void 0;
|
|
628
|
+
}
|
|
629
|
+
if (indentStr === void 0) {
|
|
630
|
+
this._ensureindentStr();
|
|
631
|
+
indentStr = this.indentStr || " ";
|
|
632
|
+
}
|
|
633
|
+
if (indentStr === "")
|
|
634
|
+
return this;
|
|
635
|
+
options = options || {};
|
|
636
|
+
const isExcluded = {};
|
|
637
|
+
if (options.exclude) {
|
|
638
|
+
const exclusions = typeof options.exclude[0] === "number" ? [options.exclude] : options.exclude;
|
|
639
|
+
exclusions.forEach((exclusion) => {
|
|
640
|
+
for (let i = exclusion[0]; i < exclusion[1]; i += 1) {
|
|
641
|
+
isExcluded[i] = true;
|
|
642
|
+
}
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
let shouldIndentNextCharacter = options.indentStart !== false;
|
|
646
|
+
const replacer = (match) => {
|
|
647
|
+
if (shouldIndentNextCharacter)
|
|
648
|
+
return `${indentStr}${match}`;
|
|
649
|
+
shouldIndentNextCharacter = true;
|
|
650
|
+
return match;
|
|
651
|
+
};
|
|
652
|
+
this.intro = this.intro.replace(pattern, replacer);
|
|
653
|
+
let charIndex = 0;
|
|
654
|
+
let chunk = this.firstChunk;
|
|
655
|
+
while (chunk) {
|
|
656
|
+
const end = chunk.end;
|
|
657
|
+
if (chunk.edited) {
|
|
658
|
+
if (!isExcluded[charIndex]) {
|
|
659
|
+
chunk.content = chunk.content.replace(pattern, replacer);
|
|
660
|
+
if (chunk.content.length) {
|
|
661
|
+
shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n";
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
} else {
|
|
665
|
+
charIndex = chunk.start;
|
|
666
|
+
while (charIndex < end) {
|
|
667
|
+
if (!isExcluded[charIndex]) {
|
|
668
|
+
const char = this.original[charIndex];
|
|
669
|
+
if (char === "\n") {
|
|
670
|
+
shouldIndentNextCharacter = true;
|
|
671
|
+
} else if (char !== "\r" && shouldIndentNextCharacter) {
|
|
672
|
+
shouldIndentNextCharacter = false;
|
|
673
|
+
if (charIndex === chunk.start) {
|
|
674
|
+
chunk.prependRight(indentStr);
|
|
675
|
+
} else {
|
|
676
|
+
this._splitChunk(chunk, charIndex);
|
|
677
|
+
chunk = chunk.next;
|
|
678
|
+
chunk.prependRight(indentStr);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
charIndex += 1;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
charIndex = chunk.end;
|
|
686
|
+
chunk = chunk.next;
|
|
687
|
+
}
|
|
688
|
+
this.outro = this.outro.replace(pattern, replacer);
|
|
689
|
+
return this;
|
|
690
|
+
}
|
|
691
|
+
insert() {
|
|
692
|
+
throw new Error(
|
|
693
|
+
"magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)"
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
insertLeft(index, content) {
|
|
697
|
+
if (!warned.insertLeft) {
|
|
698
|
+
console.warn(
|
|
699
|
+
"magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
|
|
700
|
+
);
|
|
701
|
+
warned.insertLeft = true;
|
|
702
|
+
}
|
|
703
|
+
return this.appendLeft(index, content);
|
|
704
|
+
}
|
|
705
|
+
insertRight(index, content) {
|
|
706
|
+
if (!warned.insertRight) {
|
|
707
|
+
console.warn(
|
|
708
|
+
"magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
|
|
709
|
+
);
|
|
710
|
+
warned.insertRight = true;
|
|
711
|
+
}
|
|
712
|
+
return this.prependRight(index, content);
|
|
713
|
+
}
|
|
714
|
+
move(start, end, index) {
|
|
715
|
+
if (index >= start && index <= end)
|
|
716
|
+
throw new Error("Cannot move a selection inside itself");
|
|
717
|
+
this._split(start);
|
|
718
|
+
this._split(end);
|
|
719
|
+
this._split(index);
|
|
720
|
+
const first = this.byStart[start];
|
|
721
|
+
const last = this.byEnd[end];
|
|
722
|
+
const oldLeft = first.previous;
|
|
723
|
+
const oldRight = last.next;
|
|
724
|
+
const newRight = this.byStart[index];
|
|
725
|
+
if (!newRight && last === this.lastChunk)
|
|
726
|
+
return this;
|
|
727
|
+
const newLeft = newRight ? newRight.previous : this.lastChunk;
|
|
728
|
+
if (oldLeft)
|
|
729
|
+
oldLeft.next = oldRight;
|
|
730
|
+
if (oldRight)
|
|
731
|
+
oldRight.previous = oldLeft;
|
|
732
|
+
if (newLeft)
|
|
733
|
+
newLeft.next = first;
|
|
734
|
+
if (newRight)
|
|
735
|
+
newRight.previous = last;
|
|
736
|
+
if (!first.previous)
|
|
737
|
+
this.firstChunk = last.next;
|
|
738
|
+
if (!last.next) {
|
|
739
|
+
this.lastChunk = first.previous;
|
|
740
|
+
this.lastChunk.next = null;
|
|
741
|
+
}
|
|
742
|
+
first.previous = newLeft;
|
|
743
|
+
last.next = newRight || null;
|
|
744
|
+
if (!newLeft)
|
|
745
|
+
this.firstChunk = first;
|
|
746
|
+
if (!newRight)
|
|
747
|
+
this.lastChunk = last;
|
|
748
|
+
return this;
|
|
749
|
+
}
|
|
750
|
+
overwrite(start, end, content, options) {
|
|
751
|
+
options = options || {};
|
|
752
|
+
return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
|
|
753
|
+
}
|
|
754
|
+
update(start, end, content, options) {
|
|
755
|
+
if (typeof content !== "string")
|
|
756
|
+
throw new TypeError("replacement content must be a string");
|
|
757
|
+
while (start < 0)
|
|
758
|
+
start += this.original.length;
|
|
759
|
+
while (end < 0)
|
|
760
|
+
end += this.original.length;
|
|
761
|
+
if (end > this.original.length)
|
|
762
|
+
throw new Error("end is out of bounds");
|
|
763
|
+
if (start === end)
|
|
764
|
+
throw new Error(
|
|
765
|
+
"Cannot overwrite a zero-length range – use appendLeft or prependRight instead"
|
|
766
|
+
);
|
|
767
|
+
this._split(start);
|
|
768
|
+
this._split(end);
|
|
769
|
+
if (options === true) {
|
|
770
|
+
if (!warned.storeName) {
|
|
771
|
+
console.warn(
|
|
772
|
+
"The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
|
|
773
|
+
);
|
|
774
|
+
warned.storeName = true;
|
|
775
|
+
}
|
|
776
|
+
options = { storeName: true };
|
|
777
|
+
}
|
|
778
|
+
const storeName = options !== void 0 ? options.storeName : false;
|
|
779
|
+
const overwrite = options !== void 0 ? options.overwrite : false;
|
|
780
|
+
if (storeName) {
|
|
781
|
+
const original = this.original.slice(start, end);
|
|
782
|
+
Object.defineProperty(this.storedNames, original, {
|
|
783
|
+
writable: true,
|
|
784
|
+
value: true,
|
|
785
|
+
enumerable: true
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
const first = this.byStart[start];
|
|
789
|
+
const last = this.byEnd[end];
|
|
790
|
+
if (first) {
|
|
791
|
+
let chunk = first;
|
|
792
|
+
while (chunk !== last) {
|
|
793
|
+
if (chunk.next !== this.byStart[chunk.end]) {
|
|
794
|
+
throw new Error("Cannot overwrite across a split point");
|
|
795
|
+
}
|
|
796
|
+
chunk = chunk.next;
|
|
797
|
+
chunk.edit("", false);
|
|
798
|
+
}
|
|
799
|
+
first.edit(content, storeName, !overwrite);
|
|
800
|
+
} else {
|
|
801
|
+
const newChunk = new Chunk(start, end, "").edit(content, storeName);
|
|
802
|
+
last.next = newChunk;
|
|
803
|
+
newChunk.previous = last;
|
|
804
|
+
}
|
|
805
|
+
return this;
|
|
806
|
+
}
|
|
807
|
+
prepend(content) {
|
|
808
|
+
if (typeof content !== "string")
|
|
809
|
+
throw new TypeError("outro content must be a string");
|
|
810
|
+
this.intro = content + this.intro;
|
|
811
|
+
return this;
|
|
812
|
+
}
|
|
813
|
+
prependLeft(index, content) {
|
|
814
|
+
if (typeof content !== "string")
|
|
815
|
+
throw new TypeError("inserted content must be a string");
|
|
816
|
+
this._split(index);
|
|
817
|
+
const chunk = this.byEnd[index];
|
|
818
|
+
if (chunk) {
|
|
819
|
+
chunk.prependLeft(content);
|
|
820
|
+
} else {
|
|
821
|
+
this.intro = content + this.intro;
|
|
822
|
+
}
|
|
823
|
+
return this;
|
|
824
|
+
}
|
|
825
|
+
prependRight(index, content) {
|
|
826
|
+
if (typeof content !== "string")
|
|
827
|
+
throw new TypeError("inserted content must be a string");
|
|
828
|
+
this._split(index);
|
|
829
|
+
const chunk = this.byStart[index];
|
|
830
|
+
if (chunk) {
|
|
831
|
+
chunk.prependRight(content);
|
|
832
|
+
} else {
|
|
833
|
+
this.outro = content + this.outro;
|
|
834
|
+
}
|
|
835
|
+
return this;
|
|
836
|
+
}
|
|
837
|
+
remove(start, end) {
|
|
838
|
+
while (start < 0)
|
|
839
|
+
start += this.original.length;
|
|
840
|
+
while (end < 0)
|
|
841
|
+
end += this.original.length;
|
|
842
|
+
if (start === end)
|
|
843
|
+
return this;
|
|
844
|
+
if (start < 0 || end > this.original.length)
|
|
845
|
+
throw new Error("Character is out of bounds");
|
|
846
|
+
if (start > end)
|
|
847
|
+
throw new Error("end must be greater than start");
|
|
848
|
+
this._split(start);
|
|
849
|
+
this._split(end);
|
|
850
|
+
let chunk = this.byStart[start];
|
|
851
|
+
while (chunk) {
|
|
852
|
+
chunk.intro = "";
|
|
853
|
+
chunk.outro = "";
|
|
854
|
+
chunk.edit("");
|
|
855
|
+
chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
856
|
+
}
|
|
857
|
+
return this;
|
|
858
|
+
}
|
|
859
|
+
lastChar() {
|
|
860
|
+
if (this.outro.length)
|
|
861
|
+
return this.outro[this.outro.length - 1];
|
|
862
|
+
let chunk = this.lastChunk;
|
|
863
|
+
do {
|
|
864
|
+
if (chunk.outro.length)
|
|
865
|
+
return chunk.outro[chunk.outro.length - 1];
|
|
866
|
+
if (chunk.content.length)
|
|
867
|
+
return chunk.content[chunk.content.length - 1];
|
|
868
|
+
if (chunk.intro.length)
|
|
869
|
+
return chunk.intro[chunk.intro.length - 1];
|
|
870
|
+
} while (chunk = chunk.previous);
|
|
871
|
+
if (this.intro.length)
|
|
872
|
+
return this.intro[this.intro.length - 1];
|
|
873
|
+
return "";
|
|
874
|
+
}
|
|
875
|
+
lastLine() {
|
|
876
|
+
let lineIndex = this.outro.lastIndexOf(n);
|
|
877
|
+
if (lineIndex !== -1)
|
|
878
|
+
return this.outro.substr(lineIndex + 1);
|
|
879
|
+
let lineStr = this.outro;
|
|
880
|
+
let chunk = this.lastChunk;
|
|
881
|
+
do {
|
|
882
|
+
if (chunk.outro.length > 0) {
|
|
883
|
+
lineIndex = chunk.outro.lastIndexOf(n);
|
|
884
|
+
if (lineIndex !== -1)
|
|
885
|
+
return chunk.outro.substr(lineIndex + 1) + lineStr;
|
|
886
|
+
lineStr = chunk.outro + lineStr;
|
|
887
|
+
}
|
|
888
|
+
if (chunk.content.length > 0) {
|
|
889
|
+
lineIndex = chunk.content.lastIndexOf(n);
|
|
890
|
+
if (lineIndex !== -1)
|
|
891
|
+
return chunk.content.substr(lineIndex + 1) + lineStr;
|
|
892
|
+
lineStr = chunk.content + lineStr;
|
|
893
|
+
}
|
|
894
|
+
if (chunk.intro.length > 0) {
|
|
895
|
+
lineIndex = chunk.intro.lastIndexOf(n);
|
|
896
|
+
if (lineIndex !== -1)
|
|
897
|
+
return chunk.intro.substr(lineIndex + 1) + lineStr;
|
|
898
|
+
lineStr = chunk.intro + lineStr;
|
|
899
|
+
}
|
|
900
|
+
} while (chunk = chunk.previous);
|
|
901
|
+
lineIndex = this.intro.lastIndexOf(n);
|
|
902
|
+
if (lineIndex !== -1)
|
|
903
|
+
return this.intro.substr(lineIndex + 1) + lineStr;
|
|
904
|
+
return this.intro + lineStr;
|
|
905
|
+
}
|
|
906
|
+
slice(start = 0, end = this.original.length) {
|
|
907
|
+
while (start < 0)
|
|
908
|
+
start += this.original.length;
|
|
909
|
+
while (end < 0)
|
|
910
|
+
end += this.original.length;
|
|
911
|
+
let result = "";
|
|
912
|
+
let chunk = this.firstChunk;
|
|
913
|
+
while (chunk && (chunk.start > start || chunk.end <= start)) {
|
|
914
|
+
if (chunk.start < end && chunk.end >= end) {
|
|
915
|
+
return result;
|
|
916
|
+
}
|
|
917
|
+
chunk = chunk.next;
|
|
918
|
+
}
|
|
919
|
+
if (chunk && chunk.edited && chunk.start !== start)
|
|
920
|
+
throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
|
|
921
|
+
const startChunk = chunk;
|
|
922
|
+
while (chunk) {
|
|
923
|
+
if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
|
|
924
|
+
result += chunk.intro;
|
|
925
|
+
}
|
|
926
|
+
const containsEnd = chunk.start < end && chunk.end >= end;
|
|
927
|
+
if (containsEnd && chunk.edited && chunk.end !== end)
|
|
928
|
+
throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
|
|
929
|
+
const sliceStart = startChunk === chunk ? start - chunk.start : 0;
|
|
930
|
+
const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
|
|
931
|
+
result += chunk.content.slice(sliceStart, sliceEnd);
|
|
932
|
+
if (chunk.outro && (!containsEnd || chunk.end === end)) {
|
|
933
|
+
result += chunk.outro;
|
|
934
|
+
}
|
|
935
|
+
if (containsEnd) {
|
|
936
|
+
break;
|
|
937
|
+
}
|
|
938
|
+
chunk = chunk.next;
|
|
939
|
+
}
|
|
940
|
+
return result;
|
|
941
|
+
}
|
|
942
|
+
// TODO deprecate this? not really very useful
|
|
943
|
+
snip(start, end) {
|
|
944
|
+
const clone = this.clone();
|
|
945
|
+
clone.remove(0, start);
|
|
946
|
+
clone.remove(end, clone.original.length);
|
|
947
|
+
return clone;
|
|
948
|
+
}
|
|
949
|
+
_split(index) {
|
|
950
|
+
if (this.byStart[index] || this.byEnd[index])
|
|
951
|
+
return;
|
|
952
|
+
let chunk = this.lastSearchedChunk;
|
|
953
|
+
const searchForward = index > chunk.end;
|
|
954
|
+
while (chunk) {
|
|
955
|
+
if (chunk.contains(index))
|
|
956
|
+
return this._splitChunk(chunk, index);
|
|
957
|
+
chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
_splitChunk(chunk, index) {
|
|
961
|
+
if (chunk.edited && chunk.content.length) {
|
|
962
|
+
const loc = getLocator(this.original)(index);
|
|
963
|
+
throw new Error(
|
|
964
|
+
`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`
|
|
965
|
+
);
|
|
966
|
+
}
|
|
967
|
+
const newChunk = chunk.split(index);
|
|
968
|
+
this.byEnd[index] = chunk;
|
|
969
|
+
this.byStart[index] = newChunk;
|
|
970
|
+
this.byEnd[newChunk.end] = newChunk;
|
|
971
|
+
if (chunk === this.lastChunk)
|
|
972
|
+
this.lastChunk = newChunk;
|
|
973
|
+
this.lastSearchedChunk = chunk;
|
|
974
|
+
return true;
|
|
975
|
+
}
|
|
976
|
+
toString() {
|
|
977
|
+
let str = this.intro;
|
|
978
|
+
let chunk = this.firstChunk;
|
|
979
|
+
while (chunk) {
|
|
980
|
+
str += chunk.toString();
|
|
981
|
+
chunk = chunk.next;
|
|
982
|
+
}
|
|
983
|
+
return str + this.outro;
|
|
984
|
+
}
|
|
985
|
+
isEmpty() {
|
|
986
|
+
let chunk = this.firstChunk;
|
|
987
|
+
do {
|
|
988
|
+
if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim())
|
|
989
|
+
return false;
|
|
990
|
+
} while (chunk = chunk.next);
|
|
991
|
+
return true;
|
|
992
|
+
}
|
|
993
|
+
length() {
|
|
994
|
+
let chunk = this.firstChunk;
|
|
995
|
+
let length = 0;
|
|
996
|
+
do {
|
|
997
|
+
length += chunk.intro.length + chunk.content.length + chunk.outro.length;
|
|
998
|
+
} while (chunk = chunk.next);
|
|
999
|
+
return length;
|
|
1000
|
+
}
|
|
1001
|
+
trimLines() {
|
|
1002
|
+
return this.trim("[\\r\\n]");
|
|
1003
|
+
}
|
|
1004
|
+
trim(charType) {
|
|
1005
|
+
return this.trimStart(charType).trimEnd(charType);
|
|
1006
|
+
}
|
|
1007
|
+
trimEndAborted(charType) {
|
|
1008
|
+
const rx = new RegExp((charType || "\\s") + "+$");
|
|
1009
|
+
this.outro = this.outro.replace(rx, "");
|
|
1010
|
+
if (this.outro.length)
|
|
1011
|
+
return true;
|
|
1012
|
+
let chunk = this.lastChunk;
|
|
1013
|
+
do {
|
|
1014
|
+
const end = chunk.end;
|
|
1015
|
+
const aborted = chunk.trimEnd(rx);
|
|
1016
|
+
if (chunk.end !== end) {
|
|
1017
|
+
if (this.lastChunk === chunk) {
|
|
1018
|
+
this.lastChunk = chunk.next;
|
|
1019
|
+
}
|
|
1020
|
+
this.byEnd[chunk.end] = chunk;
|
|
1021
|
+
this.byStart[chunk.next.start] = chunk.next;
|
|
1022
|
+
this.byEnd[chunk.next.end] = chunk.next;
|
|
1023
|
+
}
|
|
1024
|
+
if (aborted)
|
|
1025
|
+
return true;
|
|
1026
|
+
chunk = chunk.previous;
|
|
1027
|
+
} while (chunk);
|
|
1028
|
+
return false;
|
|
1029
|
+
}
|
|
1030
|
+
trimEnd(charType) {
|
|
1031
|
+
this.trimEndAborted(charType);
|
|
1032
|
+
return this;
|
|
1033
|
+
}
|
|
1034
|
+
trimStartAborted(charType) {
|
|
1035
|
+
const rx = new RegExp("^" + (charType || "\\s") + "+");
|
|
1036
|
+
this.intro = this.intro.replace(rx, "");
|
|
1037
|
+
if (this.intro.length)
|
|
1038
|
+
return true;
|
|
1039
|
+
let chunk = this.firstChunk;
|
|
1040
|
+
do {
|
|
1041
|
+
const end = chunk.end;
|
|
1042
|
+
const aborted = chunk.trimStart(rx);
|
|
1043
|
+
if (chunk.end !== end) {
|
|
1044
|
+
if (chunk === this.lastChunk)
|
|
1045
|
+
this.lastChunk = chunk.next;
|
|
1046
|
+
this.byEnd[chunk.end] = chunk;
|
|
1047
|
+
this.byStart[chunk.next.start] = chunk.next;
|
|
1048
|
+
this.byEnd[chunk.next.end] = chunk.next;
|
|
1049
|
+
}
|
|
1050
|
+
if (aborted)
|
|
1051
|
+
return true;
|
|
1052
|
+
chunk = chunk.next;
|
|
1053
|
+
} while (chunk);
|
|
1054
|
+
return false;
|
|
1055
|
+
}
|
|
1056
|
+
trimStart(charType) {
|
|
1057
|
+
this.trimStartAborted(charType);
|
|
1058
|
+
return this;
|
|
1059
|
+
}
|
|
1060
|
+
hasChanged() {
|
|
1061
|
+
return this.original !== this.toString();
|
|
1062
|
+
}
|
|
1063
|
+
_replaceRegexp(searchValue, replacement) {
|
|
1064
|
+
function getReplacement(match, str) {
|
|
1065
|
+
if (typeof replacement === "string") {
|
|
1066
|
+
return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
|
|
1067
|
+
if (i === "$")
|
|
1068
|
+
return "$";
|
|
1069
|
+
if (i === "&")
|
|
1070
|
+
return match[0];
|
|
1071
|
+
const num = +i;
|
|
1072
|
+
if (num < match.length)
|
|
1073
|
+
return match[+i];
|
|
1074
|
+
return `$${i}`;
|
|
1075
|
+
});
|
|
1076
|
+
} else {
|
|
1077
|
+
return replacement(...match, match.index, str, match.groups);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
function matchAll(re, str) {
|
|
1081
|
+
let match;
|
|
1082
|
+
const matches = [];
|
|
1083
|
+
while (match = re.exec(str)) {
|
|
1084
|
+
matches.push(match);
|
|
1085
|
+
}
|
|
1086
|
+
return matches;
|
|
1087
|
+
}
|
|
1088
|
+
if (searchValue.global) {
|
|
1089
|
+
const matches = matchAll(searchValue, this.original);
|
|
1090
|
+
matches.forEach((match) => {
|
|
1091
|
+
if (match.index != null)
|
|
1092
|
+
this.overwrite(
|
|
1093
|
+
match.index,
|
|
1094
|
+
match.index + match[0].length,
|
|
1095
|
+
getReplacement(match, this.original)
|
|
1096
|
+
);
|
|
1097
|
+
});
|
|
1098
|
+
} else {
|
|
1099
|
+
const match = this.original.match(searchValue);
|
|
1100
|
+
if (match && match.index != null)
|
|
1101
|
+
this.overwrite(
|
|
1102
|
+
match.index,
|
|
1103
|
+
match.index + match[0].length,
|
|
1104
|
+
getReplacement(match, this.original)
|
|
1105
|
+
);
|
|
1106
|
+
}
|
|
1107
|
+
return this;
|
|
1108
|
+
}
|
|
1109
|
+
_replaceString(string, replacement) {
|
|
1110
|
+
const { original } = this;
|
|
1111
|
+
const index = original.indexOf(string);
|
|
1112
|
+
if (index !== -1) {
|
|
1113
|
+
this.overwrite(index, index + string.length, replacement);
|
|
1114
|
+
}
|
|
1115
|
+
return this;
|
|
1116
|
+
}
|
|
1117
|
+
replace(searchValue, replacement) {
|
|
1118
|
+
if (typeof searchValue === "string") {
|
|
1119
|
+
return this._replaceString(searchValue, replacement);
|
|
1120
|
+
}
|
|
1121
|
+
return this._replaceRegexp(searchValue, replacement);
|
|
1122
|
+
}
|
|
1123
|
+
_replaceAllString(string, replacement) {
|
|
1124
|
+
const { original } = this;
|
|
1125
|
+
const stringLength = string.length;
|
|
1126
|
+
for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
|
|
1127
|
+
this.overwrite(index, index + stringLength, replacement);
|
|
1128
|
+
}
|
|
1129
|
+
return this;
|
|
1130
|
+
}
|
|
1131
|
+
replaceAll(searchValue, replacement) {
|
|
1132
|
+
if (typeof searchValue === "string") {
|
|
1133
|
+
return this._replaceAllString(searchValue, replacement);
|
|
1134
|
+
}
|
|
1135
|
+
if (!searchValue.global) {
|
|
1136
|
+
throw new TypeError(
|
|
1137
|
+
"MagicString.prototype.replaceAll called with a non-global RegExp argument"
|
|
1138
|
+
);
|
|
1139
|
+
}
|
|
1140
|
+
return this._replaceRegexp(searchValue, replacement);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
export {
|
|
1144
|
+
SourceMap,
|
|
1145
|
+
MagicString as default
|
|
1146
|
+
};
|