@devtron-labs/devtron-fe-common-lib 1.23.3-beta-2 → 1.23.3-beta-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{@code-editor-DgeHx8pv.js → @code-editor-D6qrr0WG.js} +11759 -12224
- package/dist/@common-rjsf-5PXacsvc.js +604 -0
- package/dist/@framer-motion-Bi7d_Mil.js +3606 -0
- package/dist/{@moment-DMLRxgRE.js → @moment-CGWt8tF2.js} +532 -501
- package/dist/@react-dates-CR-uCH60.js +7634 -0
- package/dist/{@react-select-BVtCLxA7.js → @react-select-C5q5RdNV.js} +3 -3
- package/dist/{@react-virtualized-sticky-tree-CxV5rldm.js → @react-virtualized-sticky-tree-LXSXNrbc.js} +1 -1
- package/dist/@vendor-CtCMPfdc.js +81580 -0
- package/dist/Common/API/QueryClientProvider.d.ts +1 -1
- package/dist/Common/API/reactQueryHooks.d.ts +2 -2
- package/dist/Common/AddCDButton/AddCDButton.d.ts +1 -1
- package/dist/Common/BreadCrumb/BreadCrumb.d.ts +1 -1
- package/dist/Common/BreadCrumb/BreadcrumbStore.d.ts +3 -3
- package/dist/Common/BreadCrumb/NestedBreadCrumb.d.ts +1 -1
- package/dist/Common/BreadCrumb/Types.d.ts +0 -1
- package/dist/Common/ChartVersionAndTypeSelector.d.ts +1 -1
- package/dist/Common/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Common/ClipboardButton/ClipboardButton.d.ts +1 -1
- package/dist/Common/Constants.d.ts +71 -2
- package/dist/Common/CustomTagSelector/PropagateTagInfo.d.ts +1 -1
- package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
- package/dist/Common/CustomTagSelector/TagDetails.d.ts +1 -1
- package/dist/Common/CustomTagSelector/TagLabelValueSelector.d.ts +1 -1
- package/dist/Common/DebouncedSearch/DebouncedSearch.d.ts +1 -1
- package/dist/Common/DeleteCINodeButton/DeleteCINodeButton.d.ts +1 -1
- package/dist/Common/DevtronCopyright.d.ts +1 -1
- package/dist/Common/DevtronProgressing/DevtronProgressing.d.ts +0 -1
- package/dist/Common/Dialogs/DialogForm.d.ts +6 -6
- package/dist/Common/DraggableWrapper/DraggableButton.d.ts +1 -1
- package/dist/Common/DraggableWrapper/DraggableWrapper.d.ts +1 -1
- package/dist/Common/Drawer/Drawer.d.ts +2 -2
- package/dist/Common/EmptyState/GenericEmptyState.d.ts +0 -1
- package/dist/Common/EmptyState/GenericFilterEmptyState.d.ts +1 -1
- package/dist/Common/ErrorPage.d.ts +1 -1
- package/dist/Common/ErrorScreenManager.d.ts +1 -1
- package/dist/Common/ErrorScreenNotAuthorized.d.ts +1 -1
- package/dist/Common/GenericDescription/GenericDescription.d.ts +1 -1
- package/dist/Common/GenericDescription/constant.d.ts +0 -40
- package/dist/Common/GenericDescription/types.d.ts +6 -1
- package/dist/Common/GenericDescription/utils.d.ts +1 -0
- package/dist/Common/Grid/Grid.d.ts +1 -1
- package/dist/Common/Helper.d.ts +4 -4
- package/dist/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutProvider.d.ts +1 -1
- package/dist/Common/Hooks/UseRegisterShortcut/utils.d.ts +1 -1
- package/dist/Common/ImageTags.d.ts +2 -2
- package/dist/Common/InteractiveCellText/InteractiveCellText.d.ts +1 -1
- package/dist/Common/Markdown/MarkDown.d.ts +1 -1
- package/dist/Common/Markdown/constant.d.ts +28 -0
- package/dist/Common/Modals/Modal.d.ts +1 -1
- package/dist/Common/Modals/VisibleModal.d.ts +5 -4
- package/dist/Common/Modals/VisibleModal2.d.ts +4 -4
- package/dist/Common/MultiSelectCustomization.d.ts +7 -7
- package/dist/Common/Pagination/PageSizeSelector.d.ts +1 -1
- package/dist/Common/Pagination/Pagination.d.ts +1 -1
- package/dist/Common/PopupMenu.d.ts +2 -2
- package/dist/Common/Progressing.d.ts +0 -1
- package/dist/Common/RJSF/Form.d.ts +2 -1
- package/dist/Common/RJSF/common/FieldRow.d.ts +1 -1
- package/dist/Common/RJSF/templates/ArrayFieldItemTemplate.d.ts +2 -2
- package/dist/Common/RJSF/templates/ArrayFieldTemplate.d.ts +1 -1
- package/dist/Common/RJSF/templates/BaseInput.d.ts +1 -1
- package/dist/Common/RJSF/templates/ButtonTemplates/AddButton.d.ts +1 -1
- package/dist/Common/RJSF/templates/ButtonTemplates/RemoveButton.d.ts +1 -1
- package/dist/Common/RJSF/templates/ButtonTemplates/SubmitButton.d.ts +1 -1
- package/dist/Common/RJSF/templates/Field.d.ts +1 -1
- package/dist/Common/RJSF/templates/FieldErrorTemplate.d.ts +1 -1
- package/dist/Common/RJSF/templates/ObjectFieldTemplate.d.ts +1 -1
- package/dist/Common/RJSF/templates/TitleField.d.ts +2 -3
- package/dist/Common/RJSF/templates/WrapIfAdditionalTemplate.d.ts +1 -1
- package/dist/Common/RJSF/utils.d.ts +1 -1
- package/dist/Common/RJSF/widgets/Checkbox.d.ts +1 -1
- package/dist/Common/RJSF/widgets/Select.d.ts +1 -1
- package/dist/Common/RadioGroup.d.ts +1 -1
- package/dist/Common/RadioGroupItem.d.ts +1 -1
- package/dist/Common/Reload.d.ts +1 -1
- package/dist/Common/SearchBar/SearchBar.component.d.ts +1 -1
- package/dist/Common/SegmentedControl/Segment.d.ts +1 -1
- package/dist/Common/SegmentedControl/SegmentedControl.component.d.ts +1 -1
- package/dist/Common/SortableTableHeaderCell/SortableTableHeaderCell.d.ts +1 -1
- package/dist/Common/TippyCustomized.d.ts +1 -1
- package/dist/Common/Tooltip/ShortcutKeyComboTooltipContent.d.ts +1 -1
- package/dist/Common/Tooltip/Tooltip.d.ts +1 -1
- package/dist/Common/Types.d.ts +77 -84
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/DTApplicationMetricsFormField.d.ts +1 -1
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/OverrideStrategyTippyContent.d.ts +1 -1
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/utils.d.ts +1 -1
- package/dist/Pages/Applications/DevtronApps/Details/CIPipeline/components/FileConfigTippy.d.ts +1 -1
- package/dist/Pages/Applications/DevtronApps/Details/CIPipeline/components/SystemVariableIcon.d.ts +1 -1
- package/dist/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/UserRoleGroupTableRow.d.ts +1 -1
- package/dist/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/UserRoleGroupsTable.component.d.ts +1 -1
- package/dist/Pages/GlobalConfigurations/BuildInfra/Descriptor.d.ts +1 -1
- package/dist/Pages/GlobalConfigurations/ClustersAndEnvironments/VirtualClusterSidebar.d.ts +1 -1
- package/dist/Pages/GlobalConfigurations/ScopedVariables/types.d.ts +2 -2
- package/dist/Pages/ResourceBrowser/ClusterMap/ClusterMap.d.ts +1 -1
- package/dist/Pages/ResourceBrowser/ForceDeleteOption.d.ts +1 -1
- package/dist/Pages/ResourceBrowser/NodeDrainOptions.d.ts +1 -1
- package/dist/Pages/ResourceBrowser/constants.d.ts +11 -1
- package/dist/Pages/ResourceBrowser/types.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/ApplicationManagement/Shared/ApplicationManagementIcon/ApplicationManagementIcon.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/ApplicationManagement/Shared/ApplicationManagementIcon/utils.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/Automation&Enablement/Overview/Overview.d.ts +1 -0
- package/dist/Pages-Devtron-2.0/Automation&Enablement/Overview/index.d.ts +1 -0
- package/dist/Pages-Devtron-2.0/Automation&Enablement/index.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/CostVisibility/Overview/Overview.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/CostVisibility/Shared/types.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/GlobalConfiguration/Overview/Overview.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/GlobalOverview/GlobalOverview.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/InfrastructureManagement/Shared/InfrastructureManagementIcon/InfrastructureManagementIcon.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/InfrastructureManagement/Shared/InfrastructureManagementIcon/utils.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/InfrastructureManagement/utils.d.ts +11 -0
- package/dist/Pages-Devtron-2.0/Navigation/types.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/SecurityCenter/Shared/SecurityCenterIcon/SecurityCenterIcon.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/SecurityCenter/Shared/SecurityCenterIcon/utils.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/Shared/Overview/components.d.ts +4 -4
- package/dist/Pages-Devtron-2.0/Shared/index.d.ts +0 -1
- package/dist/Pages-Devtron-2.0/SoftwareReleaseManagement/Overview/Overview.d.ts +1 -1
- package/dist/Pages-Devtron-2.0/index.d.ts +0 -1
- package/dist/Shared/Components/APIResponseHandler/APIResponseHandler.d.ts +1 -1
- package/dist/Shared/Components/AboutDevtron/AboutDevtronBody.d.ts +1 -1
- package/dist/Shared/Components/AboutDevtron/AboutDevtronDialog.d.ts +1 -1
- package/dist/Shared/Components/ActionMenu/ActionMenu.component.d.ts +1 -1
- package/dist/Shared/Components/ActionMenu/ActionMenuItem.d.ts +1 -1
- package/dist/Shared/Components/ActionMenu/useActionMenu.hook.d.ts +41 -66
- package/dist/Shared/Components/ActivityIndicator/ActivityIndicator.d.ts +1 -1
- package/dist/Shared/Components/AnimatedDeployButton/AnimatedDeployButton.d.ts +1 -1
- package/dist/Shared/Components/AnimatedTimer/AnimatedTimer.component.d.ts +1 -1
- package/dist/Shared/Components/AppStatusModal/AppStatusBody.d.ts +1 -1
- package/dist/Shared/Components/AppStatusModal/AppStatusContent.d.ts +1 -1
- package/dist/Shared/Components/AppStatusModal/AppStatusModal.component.d.ts +1 -1
- package/dist/Shared/Components/AppStatusModal/AppStatusModalTabList.d.ts +1 -1
- package/dist/Shared/Components/ArtifactInfoModal/ArtifactInfoModal.component.d.ts +1 -1
- package/dist/Shared/Components/Backdrop/Backdrop.d.ts +1 -1
- package/dist/Shared/Components/Backdrop/types.d.ts +1 -1
- package/dist/Shared/Components/Badge/Badge.d.ts +1 -1
- package/dist/Shared/Components/BulkOperations/BulkOperations.component.d.ts +1 -1
- package/dist/Shared/Components/BulkOperations/BulkOperationsResultModal.d.ts +1 -1
- package/dist/Shared/Components/BulkOperations/types.d.ts +1 -1
- package/dist/Shared/Components/BulkSelection/BulkSelection.d.ts +1 -1
- package/dist/Shared/Components/BulkSelection/BulkSelectionProvider.d.ts +1 -1
- package/dist/Shared/Components/BulkSelection/types.d.ts +0 -2
- package/dist/Shared/Components/Button/Button.component.d.ts +388 -2
- package/dist/Shared/Components/ButtonWithLoader/ButtonWithLoader.d.ts +1 -1
- package/dist/Shared/Components/ButtonWithSelector/ButtonWithSelector.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/Artifacts.d.ts +2 -2
- package/dist/Shared/Components/CICDHistory/BuildAndTaskSummaryTooltipCard.d.ts +0 -1
- package/dist/Shared/Components/CICDHistory/CDEmptyState.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/CiPipelineSourceConfig.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/ConflictedResourcesTable.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentDetailSteps.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryConfigDiff.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryConfigDiffCompare.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/helpers.d.ts +2 -2
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/types.d.ts +6 -6
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/utils.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentStatusBreakdown.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentStatusDetailRow.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/GitTriggerList.d.ts +0 -1
- package/dist/Shared/Components/CICDHistory/History.components.d.ts +1 -2
- package/dist/Shared/Components/CICDHistory/LogStageAccordion.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/LogsRenderer.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/ResourceConflictDeployDialog.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/ResourceConflictDetailsModal.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/Sidebar.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/StatusFilterButtonComponent.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/TriggerDetails.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/TriggerOutput.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/WorkerStatus.d.ts +0 -1
- package/dist/Shared/Components/CICDHistory/constants.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/types.d.ts +7 -9
- package/dist/Shared/Components/CICDHistory/utils.d.ts +3 -3
- package/dist/Shared/Components/CMCS/ConfigMapSecretReadyOnly.d.ts +1 -1
- package/dist/Shared/Components/CMCS/helpers.d.ts +1 -1
- package/dist/Shared/Components/Card/Card.component.d.ts +1 -1
- package/dist/Shared/Components/Charts/Chart.component.d.ts +1 -1
- package/dist/Shared/Components/Charts/utils.d.ts +1 -1
- package/dist/Shared/Components/Chip/Chip.component.d.ts +1 -1
- package/dist/Shared/Components/ClusterStatusIcon/ClusterStatusIcon.d.ts +1 -1
- package/dist/Shared/Components/CodeEditor/CodeEditor.components.d.ts +6 -6
- package/dist/Shared/Components/CodeEditor/CodeEditor.d.ts +7 -7
- package/dist/Shared/Components/CodeEditor/CodeEditorRenderer.d.ts +1 -1
- package/dist/Shared/Components/CodeEditor/Extensions/DiffMinimap.d.ts +1 -1
- package/dist/Shared/Components/CodeEditor/types.d.ts +1 -1
- package/dist/Shared/Components/CodeEditor/utils.d.ts +1 -1
- package/dist/Shared/Components/Collapse/Collapse.d.ts +1 -1
- package/dist/Shared/Components/CollapsibleList/CollapsibleList.component.d.ts +1 -1
- package/dist/Shared/Components/CollapsibleList/CollapsibleList.types.d.ts +2 -1
- package/dist/Shared/Components/CommitChipCell/CommitChipCell.d.ts +1 -1
- package/dist/Shared/Components/Confetti/Confetti.component.d.ts +1 -1
- package/dist/Shared/Components/ConfirmationModal/CannotDeleteModal.d.ts +1 -1
- package/dist/Shared/Components/ConfirmationModal/ConfirmationModal.d.ts +1 -1
- package/dist/Shared/Components/ConfirmationModal/ConfirmationModalContext.d.ts +1 -1
- package/dist/Shared/Components/ConfirmationModal/ForceDeleteConfirmationModal.d.ts +1 -1
- package/dist/Shared/Components/ConfirmationModal/types.d.ts +1 -0
- package/dist/Shared/Components/ContextSwitcher/ContextSwitcher.d.ts +1 -1
- package/dist/Shared/Components/CountrySelect/CountrySelect.component.d.ts +1 -1
- package/dist/Shared/Components/CustomInput/CustomInput.d.ts +1 -1
- package/dist/Shared/Components/CustomInput/PasswordField.d.ts +1 -1
- package/dist/Shared/Components/DTFocusTrap/DTFocusTrap.d.ts +1 -1
- package/dist/Shared/Components/DTFocusTrap/types.d.ts +1 -0
- package/dist/Shared/Components/DatePicker/DateTimePicker.d.ts +1 -1
- package/dist/Shared/Components/DatePicker/DayPickerRangeController.d.ts +2 -0
- package/dist/Shared/Components/DatePicker/MonthlySelect.d.ts +1 -1
- package/dist/Shared/Components/DatePicker/SingleDatePickerComponent.d.ts +11 -0
- package/dist/Shared/Components/DatePicker/TimeSelect.d.ts +1 -1
- package/dist/Shared/Components/DatePicker/constants.d.ts +112 -2
- package/dist/Shared/Components/DatePicker/index.d.ts +2 -0
- package/dist/Shared/Components/DatePicker/types.d.ts +29 -34
- package/dist/Shared/Components/DatePicker/utils.d.ts +1 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.d.ts +1 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffAccordion.d.ts +1 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.d.ts +1 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.d.ts +1 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffRadioSelect.d.ts +1 -1
- package/dist/Shared/Components/DetectBottom/DetectBottom.component.d.ts +1 -1
- package/dist/Shared/Components/DocLink/DocLink.d.ts +1 -1
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTable.d.ts +1 -1
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTableHeader.d.ts +1 -1
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTableRow.d.ts +1 -1
- package/dist/Shared/Components/EditImageFormField/EditImageFormField.d.ts +1 -1
- package/dist/Shared/Components/EditableTextArea/EditableTextArea.d.ts +1 -1
- package/dist/Shared/Components/EnvironmentSelector/EnvironmentSelector.component.d.ts +1 -1
- package/dist/Shared/Components/Error/ErrorBar.d.ts +1 -1
- package/dist/Shared/Components/Error/utils.d.ts +1 -1
- package/dist/Shared/Components/ExcludedImageNode/ExcludedImageNode.d.ts +1 -1
- package/dist/Shared/Components/ExportToCsv/ExportToCsv.d.ts +1 -1
- package/dist/Shared/Components/ExportToCsv/ExportToCsvDialog.d.ts +1 -1
- package/dist/Shared/Components/ExportToCsv/types.d.ts +0 -1
- package/dist/Shared/Components/FeatureDescription/FeatureDescriptionModal.d.ts +1 -1
- package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +1 -1
- package/dist/Shared/Components/FeatureDescription/types.d.ts +2 -7
- package/dist/Shared/Components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/Shared/Components/FilterChips/FilterChips.component.d.ts +1 -1
- package/dist/Shared/Components/FlagImage/FlagImage.component.d.ts +1 -1
- package/dist/Shared/Components/FloatingVariablesSuggestions/FloatingVariablesSuggestions.d.ts +1 -1
- package/dist/Shared/Components/FloatingVariablesSuggestions/SuggestionItem.d.ts +1 -1
- package/dist/Shared/Components/FloatingVariablesSuggestions/Suggestions.d.ts +1 -1
- package/dist/Shared/Components/FloatingVariablesSuggestions/SuggestionsInfo.d.ts +1 -1
- package/dist/Shared/Components/FormFieldWrapper/FormFieldInfo.d.ts +1 -1
- package/dist/Shared/Components/FormFieldWrapper/FormFieldLabel.d.ts +1 -1
- package/dist/Shared/Components/FormFieldWrapper/FormFieldWrapper.d.ts +1 -1
- package/dist/Shared/Components/GenericInfoCard/GenericInfoCard.component.d.ts +1 -1
- package/dist/Shared/Components/GenericInfoCard/GenericInfoCardListing.d.ts +1 -1
- package/dist/Shared/Components/GenericInfoCard/GenericInfoListSkeleton.d.ts +1 -1
- package/dist/Shared/Components/GenericModal/GenericModal.component.d.ts +4 -4
- package/dist/Shared/Components/GenericModal/GenericModal.context.d.ts +1 -1
- package/dist/Shared/Components/GenericModal/types.d.ts +1 -1
- package/dist/Shared/Components/GenericSectionErrorState/GenericSectionErrorState.component.d.ts +1 -1
- package/dist/Shared/Components/GenericSectionErrorState/types.d.ts +1 -1
- package/dist/Shared/Components/GettingStartedCard/GettingStarted.d.ts +1 -1
- package/dist/Shared/Components/GitCommitInfoGeneric/GitCommitInfoGeneric.d.ts +1 -1
- package/dist/Shared/Components/GitCommitInfoGeneric/GitMaterialInfoHeader.d.ts +1 -1
- package/dist/Shared/Components/GitProviderIcon/GitProviderIcon.d.ts +1 -1
- package/dist/Shared/Components/GraphVisualizer/GraphVisualizer.d.ts +1 -1
- package/dist/Shared/Components/GraphVisualizer/components/BaseNode.d.ts +1 -1
- package/dist/Shared/Components/GraphVisualizer/components/DropdownNode.d.ts +1 -1
- package/dist/Shared/Components/GraphVisualizer/components/IconNode.d.ts +1 -1
- package/dist/Shared/Components/GraphVisualizer/components/TextNode.d.ts +1 -1
- package/dist/Shared/Components/GraphVisualizer/constants.d.ts +3 -3
- package/dist/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.d.ts +1 -1
- package/dist/Shared/Components/Header/HeaderWithCreateButton/utils.d.ts +1 -1
- package/dist/Shared/Components/Header/HelpButton.d.ts +1 -1
- package/dist/Shared/Components/Header/IframePromoButton.d.ts +1 -1
- package/dist/Shared/Components/Header/PageHeader.d.ts +1 -1
- package/dist/Shared/Components/Header/ProfileMenu.d.ts +1 -1
- package/dist/Shared/Components/Header/types.d.ts +0 -1
- package/dist/Shared/Components/Icon/Icon.d.ts +1 -1
- package/dist/Shared/Components/Icon/IconBase.d.ts +1 -1
- package/dist/Shared/Components/IframeContainer/IframeContainer.component.d.ts +1 -1
- package/dist/Shared/Components/IframeContainer/IframeElement.d.ts +1 -1
- package/dist/Shared/Components/Illustration/Illustration.d.ts +2 -1
- package/dist/Shared/Components/Illustration/IllustrationBase.d.ts +1 -1
- package/dist/Shared/Components/ImageCard/ArtifactInfo/ArtifactInfo.d.ts +1 -1
- package/dist/Shared/Components/ImageCard/ImageCard.d.ts +1 -1
- package/dist/Shared/Components/ImageCard/SequentialCDCardTitle/DeploymentEnvState/DeploymentEnvState.d.ts +1 -1
- package/dist/Shared/Components/ImageCard/SequentialCDCardTitle/SequentialCDCardTitle.d.ts +1 -1
- package/dist/Shared/Components/ImageCardAccordion/ImageCardAccordion.d.ts +1 -1
- package/dist/Shared/Components/ImageChipCell/ImageChipCell.component.d.ts +1 -1
- package/dist/Shared/Components/ImageWithFallback/ImageWithFallback.component.d.ts +1 -1
- package/dist/Shared/Components/ImageWithFallback/types.d.ts +1 -1
- package/dist/Shared/Components/InfoBlock/InfoBlock.component.d.ts +1 -1
- package/dist/Shared/Components/InfoIconTippy/InfoIconTippy.d.ts +1 -1
- package/dist/Shared/Components/InvalidYAMLTippy/InvalidYAMLTippyWrapper.d.ts +1 -1
- package/dist/Shared/Components/InvalidYAMLTippy/utils.d.ts +1 -1
- package/dist/Shared/Components/KeyValueTable/KeyValueTable.component.d.ts +1 -1
- package/dist/Shared/Components/KeyboardShortcut/KeyboardShortcut.component.d.ts +1 -1
- package/dist/Shared/Components/License/ActivateLicenseDialog.d.ts +1 -1
- package/dist/Shared/Components/License/DevtronLicenseCard.d.ts +1 -1
- package/dist/Shared/Components/License/License.components.d.ts +3 -3
- package/dist/Shared/Components/LoadingCard.d.ts +1 -1
- package/dist/Shared/Components/LoginBanner/LoginBanner.d.ts +1 -1
- package/dist/Shared/Components/LoginBanner/Testimonials.components.d.ts +1 -1
- package/dist/Shared/Components/LoginBanner/types.d.ts +1 -1
- package/dist/Shared/Components/MaterialHistory/MaterialHistory.component.d.ts +1 -1
- package/dist/Shared/Components/ModalSidebarPanel/ModalSidebarPanel.component.d.ts +1 -1
- package/dist/Shared/Components/ModalSidebarPanel/types.d.ts +1 -1
- package/dist/Shared/Components/NumbersCount/NumbersCount.component.d.ts +1 -1
- package/dist/Shared/Components/PhoneInput/PhoneInput.component.d.ts +1 -1
- package/dist/Shared/Components/Plugin/PluginCard.d.ts +1 -1
- package/dist/Shared/Components/Plugin/PluginCardSkeletonList.d.ts +1 -1
- package/dist/Shared/Components/Plugin/PluginImageContainer.d.ts +1 -1
- package/dist/Shared/Components/Plugin/PluginList.d.ts +1 -1
- package/dist/Shared/Components/Plugin/PluginListContainer.d.ts +1 -1
- package/dist/Shared/Components/Plugin/PluginTagSelect.d.ts +1 -1
- package/dist/Shared/Components/Plugin/PluginTagsContainer.d.ts +1 -1
- package/dist/Shared/Components/Plugin/types.d.ts +2 -2
- package/dist/Shared/Components/Popover/Popover.component.d.ts +1 -1
- package/dist/Shared/Components/Popover/types.d.ts +4 -0
- package/dist/Shared/Components/Popover/utils.d.ts +1 -1
- package/dist/Shared/Components/ProgressBar/ProgressBar.component.d.ts +1 -1
- package/dist/Shared/Components/PrometheusConfigurations/PrometheusConfigCard.d.ts +1 -1
- package/dist/Shared/Components/QRCode.d.ts +1 -1
- package/dist/Shared/Components/ReactSelect/constants.d.ts +1 -1
- package/dist/Shared/Components/ReactSelect/utils.d.ts +4 -4
- package/dist/Shared/Components/RegistryIcon/RegistryIcon.d.ts +1 -1
- package/dist/Shared/Components/SSOProviderIcon/SSOProviderIcon.d.ts +1 -1
- package/dist/Shared/Components/Security/SecurityDetailsCards/SecurityCard.d.ts +1 -1
- package/dist/Shared/Components/Security/SecurityDetailsCards/SecurityDetailsCards.d.ts +1 -1
- package/dist/Shared/Components/Security/SecurityModal/components/OpenDetailViewButton.d.ts +1 -1
- package/dist/Shared/Components/Security/SecurityModal/config/CodeScan.d.ts +97 -5
- package/dist/Shared/Components/Security/SecurityModal/config/ImageScan.d.ts +1 -1
- package/dist/Shared/Components/Security/SecurityModal/types.d.ts +1 -1
- package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +2 -2
- package/dist/Shared/Components/Security/SeverityChip.d.ts +1 -1
- package/dist/Shared/Components/Security/Vulnerabilities/Vulnerabilities.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/FilterSelectPicker.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/GroupedFilterSelectPicker.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/SelectPickerTextArea.component.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/common.d.ts +12 -12
- package/dist/Shared/Components/SelectPicker/type.d.ts +19 -2
- package/dist/Shared/Components/ShowMoreText/ShowMoreText.d.ts +1 -1
- package/dist/Shared/Components/SideNavigation/SideNavigation.d.ts +1 -1
- package/dist/Shared/Components/StatusComponent/AppStatus.d.ts +1 -1
- package/dist/Shared/Components/StatusComponent/DeploymentStatus.d.ts +1 -1
- package/dist/Shared/Components/StatusComponent/StatusComponent.d.ts +1 -1
- package/dist/Shared/Components/Switch/Switch.component.d.ts +1 -1
- package/dist/Shared/Components/SwitchThemeDialog/SwitchThemeDialog.component.d.ts +1 -1
- package/dist/Shared/Components/TabGroup/TabGroup.component.d.ts +1 -1
- package/dist/Shared/Components/TabGroup/TabGroup.helpers.d.ts +4 -4
- package/dist/Shared/Components/TabGroup/TabGroup.types.d.ts +0 -1
- package/dist/Shared/Components/Table/BulkSelectionActionWidget.d.ts +1 -1
- package/dist/Shared/Components/Table/InternalTable.d.ts +1 -1
- package/dist/Shared/Components/Table/Table.component.d.ts +1 -1
- package/dist/Shared/Components/Table/TableContent.d.ts +1 -1
- package/dist/Shared/Components/TagsKeyValueTable/TagsContainer.d.ts +1 -1
- package/dist/Shared/Components/TargetPlatforms/TargetPlatformBadgeList.d.ts +1 -1
- package/dist/Shared/Components/TargetPlatforms/TargetPlatformListTooltip.d.ts +1 -1
- package/dist/Shared/Components/TempAppWindow/TempAppWindow.d.ts +1 -1
- package/dist/Shared/Components/Textarea/Textarea.component.d.ts +1 -1
- package/dist/Shared/Components/ThemeSwitcher/ThemeSwitcher.component.d.ts +1 -1
- package/dist/Shared/Components/ToggleResolveScopedVariables/ToggleResolveScopedVariables.component.d.ts +1 -1
- package/dist/Shared/Components/TrailingItem/TrailingItem.component.d.ts +1 -1
- package/dist/Shared/Components/TreeView/TreeView.component.d.ts +1 -1
- package/dist/Shared/Components/TreeView/TreeViewNodeContent.d.ts +1 -1
- package/dist/Shared/Components/TreeView/types.d.ts +1 -1
- package/dist/Shared/Components/Typewriter/BlinkingCursor.d.ts +1 -1
- package/dist/Shared/Components/UnsavedChanges/UnsavedChanges.component.d.ts +1 -1
- package/dist/Shared/Components/UnsavedChangesDialog/UnsavedChangesDialog.component.d.ts +1 -1
- package/dist/Shared/Components/UserIdentifier/UserIdentifier.d.ts +1 -1
- package/dist/Shared/Components/VirtualizedList/VirtualizedList.component.d.ts +1 -1
- package/dist/Shared/Components/WorkflowOptionsModal/SourceTypeCard.d.ts +1 -1
- package/dist/Shared/Components/WorkflowOptionsModal/WorkflowOptionsModal.d.ts +1 -1
- package/dist/Shared/Components/WorkflowOptionsModal/utils.d.ts +3 -3
- package/dist/Shared/Helpers.d.ts +14 -4
- package/dist/Shared/Hooks/UsePrompt/UsePrompt.d.ts +2 -1
- package/dist/Shared/Hooks/UsePrompt/types.d.ts +0 -1
- package/dist/Shared/Hooks/useForm/useForm.d.ts +1 -1
- package/dist/Shared/Providers/ImageSelectionUtility/ImageSelectionUtility.d.ts +1 -1
- package/dist/Shared/Providers/MainContextProvider/MainContextProvider.d.ts +1 -1
- package/dist/Shared/Providers/MainContextProvider/types.d.ts +1 -1
- package/dist/Shared/Providers/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/Shared/Providers/UserEmailProvider/UserEmailProvider.d.ts +3 -3
- package/dist/Shared/Services/ToastManager/ToastContent.d.ts +2 -2
- package/dist/Shared/Services/ToastManager/toastManager.service.d.ts +80 -0
- package/dist/Shared/Store/IndexStore.d.ts +1 -1
- package/dist/Shared/types.d.ts +3 -174
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/@react-dates.css +1 -0
- package/dist/assets/@vendor.css +1 -1
- package/dist/assets/cmd-bar-visual.340d6226.webp +0 -0
- package/dist/assets/ic-calender-blank.963e3423.svg +19 -0
- package/dist/index.d.ts +185 -16
- package/dist/index.js +1152 -1019
- package/package.json +28 -25
- package/dist/@common-rjsf-DLmLwuQ5.js +0 -592
- package/dist/@framer-motion-HHs3GM1L.js +0 -4959
- package/dist/@vendor-9kEu4wD5.js +0 -204287
- package/dist/Pages-Devtron-2.0/Automation&Enablement/AutomationEnablementIcon/AutomationEnablementIcon.d.ts +0 -1
- package/dist/Pages-Devtron-2.0/Automation&Enablement/AutomationEnablementIcon/index.d.ts +0 -2
- package/dist/Pages-Devtron-2.0/Automation&Enablement/AutomationEnablementIcon/utils.d.ts +0 -6
- package/dist/Pages-Devtron-2.0/Shared/Routes/index.d.ts +0 -1
- package/dist/Pages-Devtron-2.0/Shared/Routes/routes.d.ts +0 -563
|
@@ -1,4959 +0,0 @@
|
|
|
1
|
-
import { j as Y, n as K, w as Ut, i as G, a as le, s as $, m as X, c as Qs, b as jo, g as Io, d as No, p as yt, e as Uo, f as _o, h as Ko, k as kn, l as $o, o as Ye, G as ti, q as ei, r as Wo, t as Go, u as zo, v as Ho, x as Yo } from "./@vendor-9kEu4wD5.js";
|
|
2
|
-
import * as Xe from "react";
|
|
3
|
-
import { createContext as Pt, useRef as W, useId as qe, useContext as k, useInsertionEffect as Ze, useCallback as Je, useMemo as at, useEffect as ue, Children as Xo, isValidElement as qo, useLayoutEffect as Zo, useState as Le, forwardRef as Jo, Fragment as ni, createElement as Qo, Component as tr } from "react";
|
|
4
|
-
const Qe = Pt({});
|
|
5
|
-
function At(t) {
|
|
6
|
-
const e = W(null);
|
|
7
|
-
return e.current === null && (e.current = t()), e.current;
|
|
8
|
-
}
|
|
9
|
-
const ce = Pt(null), _t = Pt({
|
|
10
|
-
transformPagePoint: (t) => t,
|
|
11
|
-
isStatic: !1,
|
|
12
|
-
reducedMotion: "never"
|
|
13
|
-
});
|
|
14
|
-
class er extends Xe.Component {
|
|
15
|
-
getSnapshotBeforeUpdate(e) {
|
|
16
|
-
const n = this.props.childRef.current;
|
|
17
|
-
if (n && e.isPresent && !this.props.isPresent) {
|
|
18
|
-
const s = this.props.sizeRef.current;
|
|
19
|
-
s.height = n.offsetHeight || 0, s.width = n.offsetWidth || 0, s.top = n.offsetTop, s.left = n.offsetLeft;
|
|
20
|
-
}
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Required with getSnapshotBeforeUpdate to stop React complaining.
|
|
25
|
-
*/
|
|
26
|
-
componentDidUpdate() {
|
|
27
|
-
}
|
|
28
|
-
render() {
|
|
29
|
-
return this.props.children;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
function nr({ children: t, isPresent: e }) {
|
|
33
|
-
const n = qe(), s = W(null), i = W({
|
|
34
|
-
width: 0,
|
|
35
|
-
height: 0,
|
|
36
|
-
top: 0,
|
|
37
|
-
left: 0
|
|
38
|
-
}), { nonce: r } = k(_t);
|
|
39
|
-
return Ze(() => {
|
|
40
|
-
const { width: o, height: a, top: l, left: u } = i.current;
|
|
41
|
-
if (e || !s.current || !o || !a)
|
|
42
|
-
return;
|
|
43
|
-
s.current.dataset.motionPopId = n;
|
|
44
|
-
const c = document.createElement("style");
|
|
45
|
-
return r && (c.nonce = r), document.head.appendChild(c), c.sheet && c.sheet.insertRule(`
|
|
46
|
-
[data-motion-pop-id="${n}"] {
|
|
47
|
-
position: absolute !important;
|
|
48
|
-
width: ${o}px !important;
|
|
49
|
-
height: ${a}px !important;
|
|
50
|
-
top: ${l}px !important;
|
|
51
|
-
left: ${u}px !important;
|
|
52
|
-
}
|
|
53
|
-
`), () => {
|
|
54
|
-
document.head.removeChild(c);
|
|
55
|
-
};
|
|
56
|
-
}, [e]), Y.jsx(er, { isPresent: e, childRef: s, sizeRef: i, children: Xe.cloneElement(t, { ref: s }) });
|
|
57
|
-
}
|
|
58
|
-
const sr = ({ children: t, initial: e, isPresent: n, onExitComplete: s, custom: i, presenceAffectsLayout: r, mode: o }) => {
|
|
59
|
-
const a = At(ir), l = qe(), u = Je((h) => {
|
|
60
|
-
a.set(h, !0);
|
|
61
|
-
for (const f of a.values())
|
|
62
|
-
if (!f)
|
|
63
|
-
return;
|
|
64
|
-
s && s();
|
|
65
|
-
}, [a, s]), c = at(
|
|
66
|
-
() => ({
|
|
67
|
-
id: l,
|
|
68
|
-
initial: e,
|
|
69
|
-
isPresent: n,
|
|
70
|
-
custom: i,
|
|
71
|
-
onExitComplete: u,
|
|
72
|
-
register: (h) => (a.set(h, !1), () => a.delete(h))
|
|
73
|
-
}),
|
|
74
|
-
/**
|
|
75
|
-
* If the presence of a child affects the layout of the components around it,
|
|
76
|
-
* we want to make a new context value to ensure they get re-rendered
|
|
77
|
-
* so they can detect that layout change.
|
|
78
|
-
*/
|
|
79
|
-
r ? [Math.random(), u] : [n, u]
|
|
80
|
-
);
|
|
81
|
-
return at(() => {
|
|
82
|
-
a.forEach((h, f) => a.set(f, !1));
|
|
83
|
-
}, [n]), Xe.useEffect(() => {
|
|
84
|
-
!n && !a.size && s && s();
|
|
85
|
-
}, [n]), o === "popLayout" && (t = Y.jsx(nr, { isPresent: n, children: t })), Y.jsx(ce.Provider, { value: c, children: t });
|
|
86
|
-
};
|
|
87
|
-
function ir() {
|
|
88
|
-
return /* @__PURE__ */ new Map();
|
|
89
|
-
}
|
|
90
|
-
function si(t = !0) {
|
|
91
|
-
const e = k(ce);
|
|
92
|
-
if (e === null)
|
|
93
|
-
return [!0, null];
|
|
94
|
-
const { isPresent: n, onExitComplete: s, register: i } = e, r = qe();
|
|
95
|
-
ue(() => {
|
|
96
|
-
t && i(r);
|
|
97
|
-
}, [t]);
|
|
98
|
-
const o = Je(() => t && s && s(r), [r, s, t]);
|
|
99
|
-
return !n && s ? [!1, o] : [!0];
|
|
100
|
-
}
|
|
101
|
-
const Xt = (t) => t.key || "";
|
|
102
|
-
function On(t) {
|
|
103
|
-
const e = [];
|
|
104
|
-
return Xo.forEach(t, (n) => {
|
|
105
|
-
qo(n) && e.push(n);
|
|
106
|
-
}), e;
|
|
107
|
-
}
|
|
108
|
-
const tn = typeof window < "u", Kt = tn ? Zo : ue, Oc = ({ children: t, custom: e, initial: n = !0, onExitComplete: s, presenceAffectsLayout: i = !0, mode: r = "sync", propagate: o = !1 }) => {
|
|
109
|
-
const [a, l] = si(o), u = at(() => On(t), [t]), c = o && !a ? [] : u.map(Xt), h = W(!0), f = W(u), d = At(() => /* @__PURE__ */ new Map()), [p, m] = Le(u), [y, g] = Le(u);
|
|
110
|
-
Kt(() => {
|
|
111
|
-
h.current = !1, f.current = u;
|
|
112
|
-
for (let P = 0; P < y.length; P++) {
|
|
113
|
-
const x = Xt(y[P]);
|
|
114
|
-
c.includes(x) ? d.delete(x) : d.get(x) !== !0 && d.set(x, !1);
|
|
115
|
-
}
|
|
116
|
-
}, [y, c.length, c.join("-")]);
|
|
117
|
-
const v = [];
|
|
118
|
-
if (u !== p) {
|
|
119
|
-
let P = [...u];
|
|
120
|
-
for (let x = 0; x < y.length; x++) {
|
|
121
|
-
const b = y[x], w = Xt(b);
|
|
122
|
-
c.includes(w) || (P.splice(x, 0, b), v.push(b));
|
|
123
|
-
}
|
|
124
|
-
r === "wait" && v.length && (P = v), g(On(P)), m(u);
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
process.env.NODE_ENV !== "production" && r === "wait" && y.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
128
|
-
const { forceRender: T } = k(Qe);
|
|
129
|
-
return Y.jsx(Y.Fragment, { children: y.map((P) => {
|
|
130
|
-
const x = Xt(P), b = o && !a ? !1 : u === y || c.includes(x), w = () => {
|
|
131
|
-
if (d.has(x))
|
|
132
|
-
d.set(x, !0);
|
|
133
|
-
else
|
|
134
|
-
return;
|
|
135
|
-
let A = !0;
|
|
136
|
-
d.forEach((V) => {
|
|
137
|
-
V || (A = !1);
|
|
138
|
-
}), A && (T?.(), g(f.current), o && l?.(), s && s());
|
|
139
|
-
};
|
|
140
|
-
return Y.jsx(sr, { isPresent: b, initial: !h.current || n ? void 0 : !1, custom: b ? void 0 : e, presenceAffectsLayout: i, mode: r, onExitComplete: b ? void 0 : w, children: P }, x);
|
|
141
|
-
}) });
|
|
142
|
-
}, or = {
|
|
143
|
-
useManualTiming: !1
|
|
144
|
-
};
|
|
145
|
-
function rr(t) {
|
|
146
|
-
let e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = !1, i = !1;
|
|
147
|
-
const r = /* @__PURE__ */ new WeakSet();
|
|
148
|
-
let o = {
|
|
149
|
-
delta: 0,
|
|
150
|
-
timestamp: 0,
|
|
151
|
-
isProcessing: !1
|
|
152
|
-
};
|
|
153
|
-
function a(u) {
|
|
154
|
-
r.has(u) && (l.schedule(u), t()), u(o);
|
|
155
|
-
}
|
|
156
|
-
const l = {
|
|
157
|
-
/**
|
|
158
|
-
* Schedule a process to run on the next frame.
|
|
159
|
-
*/
|
|
160
|
-
schedule: (u, c = !1, h = !1) => {
|
|
161
|
-
const d = h && s ? e : n;
|
|
162
|
-
return c && r.add(u), d.has(u) || d.add(u), u;
|
|
163
|
-
},
|
|
164
|
-
/**
|
|
165
|
-
* Cancel the provided callback from running on the next frame.
|
|
166
|
-
*/
|
|
167
|
-
cancel: (u) => {
|
|
168
|
-
n.delete(u), r.delete(u);
|
|
169
|
-
},
|
|
170
|
-
/**
|
|
171
|
-
* Execute all schedule callbacks.
|
|
172
|
-
*/
|
|
173
|
-
process: (u) => {
|
|
174
|
-
if (o = u, s) {
|
|
175
|
-
i = !0;
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
s = !0, [e, n] = [n, e], e.forEach(a), e.clear(), s = !1, i && (i = !1, l.process(u));
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
return l;
|
|
182
|
-
}
|
|
183
|
-
const qt = [
|
|
184
|
-
"read",
|
|
185
|
-
// Read
|
|
186
|
-
"resolveKeyframes",
|
|
187
|
-
// Write/Read/Write/Read
|
|
188
|
-
"update",
|
|
189
|
-
// Compute
|
|
190
|
-
"preRender",
|
|
191
|
-
// Compute
|
|
192
|
-
"render",
|
|
193
|
-
// Write
|
|
194
|
-
"postRender"
|
|
195
|
-
// Compute
|
|
196
|
-
], ar = 40;
|
|
197
|
-
function ii(t, e) {
|
|
198
|
-
let n = !1, s = !0;
|
|
199
|
-
const i = {
|
|
200
|
-
delta: 0,
|
|
201
|
-
timestamp: 0,
|
|
202
|
-
isProcessing: !1
|
|
203
|
-
}, r = () => n = !0, o = qt.reduce((g, v) => (g[v] = rr(r), g), {}), { read: a, resolveKeyframes: l, update: u, preRender: c, render: h, postRender: f } = o, d = () => {
|
|
204
|
-
const g = performance.now();
|
|
205
|
-
n = !1, i.delta = s ? 1e3 / 60 : Math.max(Math.min(g - i.timestamp, ar), 1), i.timestamp = g, i.isProcessing = !0, a.process(i), l.process(i), u.process(i), c.process(i), h.process(i), f.process(i), i.isProcessing = !1, n && e && (s = !1, t(d));
|
|
206
|
-
}, p = () => {
|
|
207
|
-
n = !0, s = !0, i.isProcessing || t(d);
|
|
208
|
-
};
|
|
209
|
-
return { schedule: qt.reduce((g, v) => {
|
|
210
|
-
const T = o[v];
|
|
211
|
-
return g[v] = (P, x = !1, b = !1) => (n || p(), T.schedule(P, x, b)), g;
|
|
212
|
-
}, {}), cancel: (g) => {
|
|
213
|
-
for (let v = 0; v < qt.length; v++)
|
|
214
|
-
o[qt[v]].cancel(g);
|
|
215
|
-
}, state: i, steps: o };
|
|
216
|
-
}
|
|
217
|
-
const { schedule: D, cancel: q, state: B, steps: Te } = ii(typeof requestAnimationFrame < "u" ? requestAnimationFrame : K, !0), oi = Pt({ strict: !1 }), jn = {
|
|
218
|
-
animation: [
|
|
219
|
-
"animate",
|
|
220
|
-
"variants",
|
|
221
|
-
"whileHover",
|
|
222
|
-
"whileTap",
|
|
223
|
-
"exit",
|
|
224
|
-
"whileInView",
|
|
225
|
-
"whileFocus",
|
|
226
|
-
"whileDrag"
|
|
227
|
-
],
|
|
228
|
-
exit: ["exit"],
|
|
229
|
-
drag: ["drag", "dragControls"],
|
|
230
|
-
focus: ["whileFocus"],
|
|
231
|
-
hover: ["whileHover", "onHoverStart", "onHoverEnd"],
|
|
232
|
-
tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
|
|
233
|
-
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
234
|
-
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
235
|
-
layout: ["layout", "layoutId"]
|
|
236
|
-
}, vt = {};
|
|
237
|
-
for (const t in jn)
|
|
238
|
-
vt[t] = {
|
|
239
|
-
isEnabled: (e) => jn[t].some((n) => !!e[n])
|
|
240
|
-
};
|
|
241
|
-
function lr(t) {
|
|
242
|
-
for (const e in t)
|
|
243
|
-
vt[e] = {
|
|
244
|
-
...vt[e],
|
|
245
|
-
...t[e]
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
const ur = /* @__PURE__ */ new Set([
|
|
249
|
-
"animate",
|
|
250
|
-
"exit",
|
|
251
|
-
"variants",
|
|
252
|
-
"initial",
|
|
253
|
-
"style",
|
|
254
|
-
"values",
|
|
255
|
-
"variants",
|
|
256
|
-
"transition",
|
|
257
|
-
"transformTemplate",
|
|
258
|
-
"custom",
|
|
259
|
-
"inherit",
|
|
260
|
-
"onBeforeLayoutMeasure",
|
|
261
|
-
"onAnimationStart",
|
|
262
|
-
"onAnimationComplete",
|
|
263
|
-
"onUpdate",
|
|
264
|
-
"onDragStart",
|
|
265
|
-
"onDrag",
|
|
266
|
-
"onDragEnd",
|
|
267
|
-
"onMeasureDragConstraints",
|
|
268
|
-
"onDirectionLock",
|
|
269
|
-
"onDragTransitionEnd",
|
|
270
|
-
"_dragX",
|
|
271
|
-
"_dragY",
|
|
272
|
-
"onHoverStart",
|
|
273
|
-
"onHoverEnd",
|
|
274
|
-
"onViewportEnter",
|
|
275
|
-
"onViewportLeave",
|
|
276
|
-
"globalTapTarget",
|
|
277
|
-
"ignoreStrict",
|
|
278
|
-
"viewport"
|
|
279
|
-
]);
|
|
280
|
-
function ne(t) {
|
|
281
|
-
return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || ur.has(t);
|
|
282
|
-
}
|
|
283
|
-
let ri = (t) => !ne(t);
|
|
284
|
-
function cr(t) {
|
|
285
|
-
t && (ri = (e) => e.startsWith("on") ? !ne(e) : t(e));
|
|
286
|
-
}
|
|
287
|
-
try {
|
|
288
|
-
cr(require("@emotion/is-prop-valid").default);
|
|
289
|
-
} catch {
|
|
290
|
-
}
|
|
291
|
-
function hr(t, e, n) {
|
|
292
|
-
const s = {};
|
|
293
|
-
for (const i in t)
|
|
294
|
-
i === "values" && typeof t.values == "object" || (ri(i) || n === !0 && ne(i) || !e && !ne(i) || // If trying to use native HTML drag events, forward drag listeners
|
|
295
|
-
t.draggable && i.startsWith("onDrag")) && (s[i] = t[i]);
|
|
296
|
-
return s;
|
|
297
|
-
}
|
|
298
|
-
const In = /* @__PURE__ */ new Set();
|
|
299
|
-
function he(t, e, n) {
|
|
300
|
-
t || In.has(e) || (console.warn(e), In.add(e));
|
|
301
|
-
}
|
|
302
|
-
function fr(t) {
|
|
303
|
-
if (typeof Proxy > "u")
|
|
304
|
-
return t;
|
|
305
|
-
const e = /* @__PURE__ */ new Map(), n = (...s) => (process.env.NODE_ENV !== "production" && he(!1, "motion() is deprecated. Use motion.create() instead."), t(...s));
|
|
306
|
-
return new Proxy(n, {
|
|
307
|
-
/**
|
|
308
|
-
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
|
|
309
|
-
* The prop name is passed through as `key` and we can use that to generate a `motion`
|
|
310
|
-
* DOM component with that name.
|
|
311
|
-
*/
|
|
312
|
-
get: (s, i) => i === "create" ? t : (e.has(i) || e.set(i, t(i)), e.get(i))
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
const fe = Pt({});
|
|
316
|
-
function Ot(t) {
|
|
317
|
-
return typeof t == "string" || Array.isArray(t);
|
|
318
|
-
}
|
|
319
|
-
function de(t) {
|
|
320
|
-
return t !== null && typeof t == "object" && typeof t.start == "function";
|
|
321
|
-
}
|
|
322
|
-
const en = [
|
|
323
|
-
"animate",
|
|
324
|
-
"whileInView",
|
|
325
|
-
"whileFocus",
|
|
326
|
-
"whileHover",
|
|
327
|
-
"whileTap",
|
|
328
|
-
"whileDrag",
|
|
329
|
-
"exit"
|
|
330
|
-
], nn = ["initial", ...en];
|
|
331
|
-
function pe(t) {
|
|
332
|
-
return de(t.animate) || nn.some((e) => Ot(t[e]));
|
|
333
|
-
}
|
|
334
|
-
function ai(t) {
|
|
335
|
-
return !!(pe(t) || t.variants);
|
|
336
|
-
}
|
|
337
|
-
function dr(t, e) {
|
|
338
|
-
if (pe(t)) {
|
|
339
|
-
const { initial: n, animate: s } = t;
|
|
340
|
-
return {
|
|
341
|
-
initial: n === !1 || Ot(n) ? n : void 0,
|
|
342
|
-
animate: Ot(s) ? s : void 0
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
return t.inherit !== !1 ? e : {};
|
|
346
|
-
}
|
|
347
|
-
function pr(t) {
|
|
348
|
-
const { initial: e, animate: n } = dr(t, k(fe));
|
|
349
|
-
return at(() => ({ initial: e, animate: n }), [Nn(e), Nn(n)]);
|
|
350
|
-
}
|
|
351
|
-
function Nn(t) {
|
|
352
|
-
return Array.isArray(t) ? t.join(" ") : t;
|
|
353
|
-
}
|
|
354
|
-
const mr = Symbol.for("motionComponentSymbol");
|
|
355
|
-
function ft(t) {
|
|
356
|
-
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
|
|
357
|
-
}
|
|
358
|
-
function gr(t, e, n) {
|
|
359
|
-
return Je(
|
|
360
|
-
(s) => {
|
|
361
|
-
s && t.onMount && t.onMount(s), e && (s ? e.mount(s) : e.unmount()), n && (typeof n == "function" ? n(s) : ft(n) && (n.current = s));
|
|
362
|
-
},
|
|
363
|
-
/**
|
|
364
|
-
* Only pass a new ref callback to React if we've received a visual element
|
|
365
|
-
* factory. Otherwise we'll be mounting/remounting every time externalRef
|
|
366
|
-
* or other dependencies change.
|
|
367
|
-
*/
|
|
368
|
-
[e]
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
const sn = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), yr = "framerAppearId", li = "data-" + sn(yr), { schedule: on } = ii(queueMicrotask, !1), ui = Pt({});
|
|
372
|
-
function vr(t, e, n, s, i) {
|
|
373
|
-
var r, o;
|
|
374
|
-
const { visualElement: a } = k(fe), l = k(oi), u = k(ce), c = k(_t).reducedMotion, h = W(null);
|
|
375
|
-
s = s || l.renderer, !h.current && s && (h.current = s(t, {
|
|
376
|
-
visualState: e,
|
|
377
|
-
parent: a,
|
|
378
|
-
props: n,
|
|
379
|
-
presenceContext: u,
|
|
380
|
-
blockInitialAnimation: u ? u.initial === !1 : !1,
|
|
381
|
-
reducedMotionConfig: c
|
|
382
|
-
}));
|
|
383
|
-
const f = h.current, d = k(ui);
|
|
384
|
-
f && !f.projection && i && (f.type === "html" || f.type === "svg") && xr(h.current, n, i, d);
|
|
385
|
-
const p = W(!1);
|
|
386
|
-
Ze(() => {
|
|
387
|
-
f && p.current && f.update(n, u);
|
|
388
|
-
});
|
|
389
|
-
const m = n[li], y = W(!!m && !(!((r = window.MotionHandoffIsComplete) === null || r === void 0) && r.call(window, m)) && ((o = window.MotionHasOptimisedAnimation) === null || o === void 0 ? void 0 : o.call(window, m)));
|
|
390
|
-
return Kt(() => {
|
|
391
|
-
f && (p.current = !0, window.MotionIsMounted = !0, f.updateFeatures(), on.render(f.render), y.current && f.animationState && f.animationState.animateChanges());
|
|
392
|
-
}), ue(() => {
|
|
393
|
-
f && (!y.current && f.animationState && f.animationState.animateChanges(), y.current && (queueMicrotask(() => {
|
|
394
|
-
var g;
|
|
395
|
-
(g = window.MotionHandoffMarkAsComplete) === null || g === void 0 || g.call(window, m);
|
|
396
|
-
}), y.current = !1));
|
|
397
|
-
}), f;
|
|
398
|
-
}
|
|
399
|
-
function xr(t, e, n, s) {
|
|
400
|
-
const { layoutId: i, layout: r, drag: o, dragConstraints: a, layoutScroll: l, layoutRoot: u } = e;
|
|
401
|
-
t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : ci(t.parent)), t.projection.setOptions({
|
|
402
|
-
layoutId: i,
|
|
403
|
-
layout: r,
|
|
404
|
-
alwaysMeasureLayout: !!o || a && ft(a),
|
|
405
|
-
visualElement: t,
|
|
406
|
-
/**
|
|
407
|
-
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
408
|
-
* to update by the time layout animations run.
|
|
409
|
-
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
|
|
410
|
-
* ensuring it gets called if there's no potential layout animations.
|
|
411
|
-
*
|
|
412
|
-
*/
|
|
413
|
-
animationType: typeof r == "string" ? r : "both",
|
|
414
|
-
initialPromotionConfig: s,
|
|
415
|
-
layoutScroll: l,
|
|
416
|
-
layoutRoot: u
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
function ci(t) {
|
|
420
|
-
if (t)
|
|
421
|
-
return t.options.allowProjection !== !1 ? t.projection : ci(t.parent);
|
|
422
|
-
}
|
|
423
|
-
function Tr({ preloadedFeatures: t, createVisualElement: e, useRender: n, useVisualState: s, Component: i }) {
|
|
424
|
-
var r, o;
|
|
425
|
-
t && lr(t);
|
|
426
|
-
function a(u, c) {
|
|
427
|
-
let h;
|
|
428
|
-
const f = {
|
|
429
|
-
...k(_t),
|
|
430
|
-
...u,
|
|
431
|
-
layoutId: Sr(u)
|
|
432
|
-
}, { isStatic: d } = f, p = pr(u), m = s(u, d);
|
|
433
|
-
if (!d && tn) {
|
|
434
|
-
Pr(f, t);
|
|
435
|
-
const y = Ar(f);
|
|
436
|
-
h = y.MeasureLayout, p.visualElement = vr(i, m, f, e, y.ProjectionNode);
|
|
437
|
-
}
|
|
438
|
-
return Y.jsxs(fe.Provider, { value: p, children: [h && p.visualElement ? Y.jsx(h, { visualElement: p.visualElement, ...f }) : null, n(i, u, gr(m, p.visualElement, c), m, d, p.visualElement)] });
|
|
439
|
-
}
|
|
440
|
-
a.displayName = `motion.${typeof i == "string" ? i : `create(${(o = (r = i.displayName) !== null && r !== void 0 ? r : i.name) !== null && o !== void 0 ? o : ""})`}`;
|
|
441
|
-
const l = Jo(a);
|
|
442
|
-
return l[mr] = i, l;
|
|
443
|
-
}
|
|
444
|
-
function Sr({ layoutId: t }) {
|
|
445
|
-
const e = k(Qe).id;
|
|
446
|
-
return e && t !== void 0 ? e + "-" + t : t;
|
|
447
|
-
}
|
|
448
|
-
function Pr(t, e) {
|
|
449
|
-
const n = k(oi).strict;
|
|
450
|
-
if (process.env.NODE_ENV !== "production" && e && n) {
|
|
451
|
-
const s = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
452
|
-
t.ignoreStrict ? Ut(!1, s) : G(!1, s);
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
function Ar(t) {
|
|
456
|
-
const { drag: e, layout: n } = vt;
|
|
457
|
-
if (!e && !n)
|
|
458
|
-
return {};
|
|
459
|
-
const s = { ...e, ...n };
|
|
460
|
-
return {
|
|
461
|
-
MeasureLayout: e?.isEnabled(t) || n?.isEnabled(t) ? s.MeasureLayout : void 0,
|
|
462
|
-
ProjectionNode: s.ProjectionNode
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
const br = [
|
|
466
|
-
"animate",
|
|
467
|
-
"circle",
|
|
468
|
-
"defs",
|
|
469
|
-
"desc",
|
|
470
|
-
"ellipse",
|
|
471
|
-
"g",
|
|
472
|
-
"image",
|
|
473
|
-
"line",
|
|
474
|
-
"filter",
|
|
475
|
-
"marker",
|
|
476
|
-
"mask",
|
|
477
|
-
"metadata",
|
|
478
|
-
"path",
|
|
479
|
-
"pattern",
|
|
480
|
-
"polygon",
|
|
481
|
-
"polyline",
|
|
482
|
-
"rect",
|
|
483
|
-
"stop",
|
|
484
|
-
"switch",
|
|
485
|
-
"symbol",
|
|
486
|
-
"svg",
|
|
487
|
-
"text",
|
|
488
|
-
"tspan",
|
|
489
|
-
"use",
|
|
490
|
-
"view"
|
|
491
|
-
];
|
|
492
|
-
function rn(t) {
|
|
493
|
-
return (
|
|
494
|
-
/**
|
|
495
|
-
* If it's not a string, it's a custom React component. Currently we only support
|
|
496
|
-
* HTML custom React components.
|
|
497
|
-
*/
|
|
498
|
-
typeof t != "string" || /**
|
|
499
|
-
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
500
|
-
*/
|
|
501
|
-
t.includes("-") ? !1 : (
|
|
502
|
-
/**
|
|
503
|
-
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
504
|
-
*/
|
|
505
|
-
!!(br.indexOf(t) > -1 || /**
|
|
506
|
-
* If it contains a capital letter, it's an SVG component
|
|
507
|
-
*/
|
|
508
|
-
/[A-Z]/u.test(t))
|
|
509
|
-
)
|
|
510
|
-
);
|
|
511
|
-
}
|
|
512
|
-
function Un(t) {
|
|
513
|
-
const e = [{}, {}];
|
|
514
|
-
return t?.values.forEach((n, s) => {
|
|
515
|
-
e[0][s] = n.get(), e[1][s] = n.getVelocity();
|
|
516
|
-
}), e;
|
|
517
|
-
}
|
|
518
|
-
function an(t, e, n, s) {
|
|
519
|
-
if (typeof e == "function") {
|
|
520
|
-
const [i, r] = Un(s);
|
|
521
|
-
e = e(n !== void 0 ? n : t.custom, i, r);
|
|
522
|
-
}
|
|
523
|
-
if (typeof e == "string" && (e = t.variants && t.variants[e]), typeof e == "function") {
|
|
524
|
-
const [i, r] = Un(s);
|
|
525
|
-
e = e(n !== void 0 ? n : t.custom, i, r);
|
|
526
|
-
}
|
|
527
|
-
return e;
|
|
528
|
-
}
|
|
529
|
-
const Fe = (t) => Array.isArray(t), Vr = (t) => !!(t && typeof t == "object" && t.mix && t.toValue), wr = (t) => Fe(t) ? t[t.length - 1] || 0 : t, L = (t) => !!(t && t.getVelocity);
|
|
530
|
-
function Qt(t) {
|
|
531
|
-
const e = L(t) ? t.get() : t;
|
|
532
|
-
return Vr(e) ? e.toValue() : e;
|
|
533
|
-
}
|
|
534
|
-
function Dr({ scrapeMotionValuesFromProps: t, createRenderState: e, onUpdate: n }, s, i, r) {
|
|
535
|
-
const o = {
|
|
536
|
-
latestValues: Cr(s, i, r, t),
|
|
537
|
-
renderState: e()
|
|
538
|
-
};
|
|
539
|
-
return n && (o.onMount = (a) => n({ props: s, current: a, ...o }), o.onUpdate = (a) => n(a)), o;
|
|
540
|
-
}
|
|
541
|
-
const hi = (t) => (e, n) => {
|
|
542
|
-
const s = k(fe), i = k(ce), r = () => Dr(t, e, s, i);
|
|
543
|
-
return n ? r() : At(r);
|
|
544
|
-
};
|
|
545
|
-
function Cr(t, e, n, s) {
|
|
546
|
-
const i = {}, r = s(t, {});
|
|
547
|
-
for (const f in r)
|
|
548
|
-
i[f] = Qt(r[f]);
|
|
549
|
-
let { initial: o, animate: a } = t;
|
|
550
|
-
const l = pe(t), u = ai(t);
|
|
551
|
-
e && u && !l && t.inherit !== !1 && (o === void 0 && (o = e.initial), a === void 0 && (a = e.animate));
|
|
552
|
-
let c = n ? n.initial === !1 : !1;
|
|
553
|
-
c = c || o === !1;
|
|
554
|
-
const h = c ? a : o;
|
|
555
|
-
if (h && typeof h != "boolean" && !de(h)) {
|
|
556
|
-
const f = Array.isArray(h) ? h : [h];
|
|
557
|
-
for (let d = 0; d < f.length; d++) {
|
|
558
|
-
const p = an(t, f[d]);
|
|
559
|
-
if (p) {
|
|
560
|
-
const { transitionEnd: m, transition: y, ...g } = p;
|
|
561
|
-
for (const v in g) {
|
|
562
|
-
let T = g[v];
|
|
563
|
-
if (Array.isArray(T)) {
|
|
564
|
-
const P = c ? T.length - 1 : 0;
|
|
565
|
-
T = T[P];
|
|
566
|
-
}
|
|
567
|
-
T !== null && (i[v] = T);
|
|
568
|
-
}
|
|
569
|
-
for (const v in m)
|
|
570
|
-
i[v] = m[v];
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
return i;
|
|
575
|
-
}
|
|
576
|
-
const bt = [
|
|
577
|
-
"transformPerspective",
|
|
578
|
-
"x",
|
|
579
|
-
"y",
|
|
580
|
-
"z",
|
|
581
|
-
"translateX",
|
|
582
|
-
"translateY",
|
|
583
|
-
"translateZ",
|
|
584
|
-
"scale",
|
|
585
|
-
"scaleX",
|
|
586
|
-
"scaleY",
|
|
587
|
-
"rotate",
|
|
588
|
-
"rotateX",
|
|
589
|
-
"rotateY",
|
|
590
|
-
"rotateZ",
|
|
591
|
-
"skew",
|
|
592
|
-
"skewX",
|
|
593
|
-
"skewY"
|
|
594
|
-
], lt = new Set(bt), fi = (t) => (e) => typeof e == "string" && e.startsWith(t), di = /* @__PURE__ */ fi("--"), Mr = /* @__PURE__ */ fi("var(--"), ln = (t) => Mr(t) ? Rr.test(t.split("/*")[0].trim()) : !1, Rr = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, pi = (t, e) => e && typeof t == "number" ? e.transform(t) : t, Z = (t, e, n) => n > e ? e : n < t ? t : n, Vt = {
|
|
595
|
-
test: (t) => typeof t == "number",
|
|
596
|
-
parse: parseFloat,
|
|
597
|
-
transform: (t) => t
|
|
598
|
-
}, jt = {
|
|
599
|
-
...Vt,
|
|
600
|
-
transform: (t) => Z(0, 1, t)
|
|
601
|
-
}, Zt = {
|
|
602
|
-
...Vt,
|
|
603
|
-
default: 1
|
|
604
|
-
}, $t = (t) => ({
|
|
605
|
-
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
|
|
606
|
-
parse: parseFloat,
|
|
607
|
-
transform: (e) => `${e}${t}`
|
|
608
|
-
}), J = /* @__PURE__ */ $t("deg"), z = /* @__PURE__ */ $t("%"), S = /* @__PURE__ */ $t("px"), Er = /* @__PURE__ */ $t("vh"), Lr = /* @__PURE__ */ $t("vw"), _n = {
|
|
609
|
-
...z,
|
|
610
|
-
parse: (t) => z.parse(t) / 100,
|
|
611
|
-
transform: (t) => z.transform(t * 100)
|
|
612
|
-
}, Fr = {
|
|
613
|
-
// Border props
|
|
614
|
-
borderWidth: S,
|
|
615
|
-
borderTopWidth: S,
|
|
616
|
-
borderRightWidth: S,
|
|
617
|
-
borderBottomWidth: S,
|
|
618
|
-
borderLeftWidth: S,
|
|
619
|
-
borderRadius: S,
|
|
620
|
-
radius: S,
|
|
621
|
-
borderTopLeftRadius: S,
|
|
622
|
-
borderTopRightRadius: S,
|
|
623
|
-
borderBottomRightRadius: S,
|
|
624
|
-
borderBottomLeftRadius: S,
|
|
625
|
-
// Positioning props
|
|
626
|
-
width: S,
|
|
627
|
-
maxWidth: S,
|
|
628
|
-
height: S,
|
|
629
|
-
maxHeight: S,
|
|
630
|
-
top: S,
|
|
631
|
-
right: S,
|
|
632
|
-
bottom: S,
|
|
633
|
-
left: S,
|
|
634
|
-
// Spacing props
|
|
635
|
-
padding: S,
|
|
636
|
-
paddingTop: S,
|
|
637
|
-
paddingRight: S,
|
|
638
|
-
paddingBottom: S,
|
|
639
|
-
paddingLeft: S,
|
|
640
|
-
margin: S,
|
|
641
|
-
marginTop: S,
|
|
642
|
-
marginRight: S,
|
|
643
|
-
marginBottom: S,
|
|
644
|
-
marginLeft: S,
|
|
645
|
-
// Misc
|
|
646
|
-
backgroundPositionX: S,
|
|
647
|
-
backgroundPositionY: S
|
|
648
|
-
}, Br = {
|
|
649
|
-
rotate: J,
|
|
650
|
-
rotateX: J,
|
|
651
|
-
rotateY: J,
|
|
652
|
-
rotateZ: J,
|
|
653
|
-
scale: Zt,
|
|
654
|
-
scaleX: Zt,
|
|
655
|
-
scaleY: Zt,
|
|
656
|
-
scaleZ: Zt,
|
|
657
|
-
skew: J,
|
|
658
|
-
skewX: J,
|
|
659
|
-
skewY: J,
|
|
660
|
-
distance: S,
|
|
661
|
-
translateX: S,
|
|
662
|
-
translateY: S,
|
|
663
|
-
translateZ: S,
|
|
664
|
-
x: S,
|
|
665
|
-
y: S,
|
|
666
|
-
z: S,
|
|
667
|
-
perspective: S,
|
|
668
|
-
transformPerspective: S,
|
|
669
|
-
opacity: jt,
|
|
670
|
-
originX: _n,
|
|
671
|
-
originY: _n,
|
|
672
|
-
originZ: S
|
|
673
|
-
}, Kn = {
|
|
674
|
-
...Vt,
|
|
675
|
-
transform: Math.round
|
|
676
|
-
}, un = {
|
|
677
|
-
...Fr,
|
|
678
|
-
...Br,
|
|
679
|
-
zIndex: Kn,
|
|
680
|
-
size: S,
|
|
681
|
-
// SVG
|
|
682
|
-
fillOpacity: jt,
|
|
683
|
-
strokeOpacity: jt,
|
|
684
|
-
numOctaves: Kn
|
|
685
|
-
}, kr = {
|
|
686
|
-
x: "translateX",
|
|
687
|
-
y: "translateY",
|
|
688
|
-
z: "translateZ",
|
|
689
|
-
transformPerspective: "perspective"
|
|
690
|
-
}, Or = bt.length;
|
|
691
|
-
function jr(t, e, n) {
|
|
692
|
-
let s = "", i = !0;
|
|
693
|
-
for (let r = 0; r < Or; r++) {
|
|
694
|
-
const o = bt[r], a = t[o];
|
|
695
|
-
if (a === void 0)
|
|
696
|
-
continue;
|
|
697
|
-
let l = !0;
|
|
698
|
-
if (typeof a == "number" ? l = a === (o.startsWith("scale") ? 1 : 0) : l = parseFloat(a) === 0, !l || n) {
|
|
699
|
-
const u = pi(a, un[o]);
|
|
700
|
-
if (!l) {
|
|
701
|
-
i = !1;
|
|
702
|
-
const c = kr[o] || o;
|
|
703
|
-
s += `${c}(${u}) `;
|
|
704
|
-
}
|
|
705
|
-
n && (e[o] = u);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
return s = s.trim(), n ? s = n(e, i ? "" : s) : i && (s = "none"), s;
|
|
709
|
-
}
|
|
710
|
-
function cn(t, e, n) {
|
|
711
|
-
const { style: s, vars: i, transformOrigin: r } = t;
|
|
712
|
-
let o = !1, a = !1;
|
|
713
|
-
for (const l in e) {
|
|
714
|
-
const u = e[l];
|
|
715
|
-
if (lt.has(l)) {
|
|
716
|
-
o = !0;
|
|
717
|
-
continue;
|
|
718
|
-
} else if (di(l)) {
|
|
719
|
-
i[l] = u;
|
|
720
|
-
continue;
|
|
721
|
-
} else {
|
|
722
|
-
const c = pi(u, un[l]);
|
|
723
|
-
l.startsWith("origin") ? (a = !0, r[l] = c) : s[l] = c;
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
if (e.transform || (o || n ? s.transform = jr(e, t.transform, n) : s.transform && (s.transform = "none")), a) {
|
|
727
|
-
const { originX: l = "50%", originY: u = "50%", originZ: c = 0 } = r;
|
|
728
|
-
s.transformOrigin = `${l} ${u} ${c}`;
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
const Ir = {
|
|
732
|
-
offset: "stroke-dashoffset",
|
|
733
|
-
array: "stroke-dasharray"
|
|
734
|
-
}, Nr = {
|
|
735
|
-
offset: "strokeDashoffset",
|
|
736
|
-
array: "strokeDasharray"
|
|
737
|
-
};
|
|
738
|
-
function Ur(t, e, n = 1, s = 0, i = !0) {
|
|
739
|
-
t.pathLength = 1;
|
|
740
|
-
const r = i ? Ir : Nr;
|
|
741
|
-
t[r.offset] = S.transform(-s);
|
|
742
|
-
const o = S.transform(e), a = S.transform(n);
|
|
743
|
-
t[r.array] = `${o} ${a}`;
|
|
744
|
-
}
|
|
745
|
-
function $n(t, e, n) {
|
|
746
|
-
return typeof t == "string" ? t : S.transform(e + n * t);
|
|
747
|
-
}
|
|
748
|
-
function _r(t, e, n) {
|
|
749
|
-
const s = $n(e, t.x, t.width), i = $n(n, t.y, t.height);
|
|
750
|
-
return `${s} ${i}`;
|
|
751
|
-
}
|
|
752
|
-
function hn(t, {
|
|
753
|
-
attrX: e,
|
|
754
|
-
attrY: n,
|
|
755
|
-
attrScale: s,
|
|
756
|
-
originX: i,
|
|
757
|
-
originY: r,
|
|
758
|
-
pathLength: o,
|
|
759
|
-
pathSpacing: a = 1,
|
|
760
|
-
pathOffset: l = 0,
|
|
761
|
-
// This is object creation, which we try to avoid per-frame.
|
|
762
|
-
...u
|
|
763
|
-
}, c, h) {
|
|
764
|
-
if (cn(t, u, h), c) {
|
|
765
|
-
t.style.viewBox && (t.attrs.viewBox = t.style.viewBox);
|
|
766
|
-
return;
|
|
767
|
-
}
|
|
768
|
-
t.attrs = t.style, t.style = {};
|
|
769
|
-
const { attrs: f, style: d, dimensions: p } = t;
|
|
770
|
-
f.transform && (p && (d.transform = f.transform), delete f.transform), p && (i !== void 0 || r !== void 0 || d.transform) && (d.transformOrigin = _r(p, i !== void 0 ? i : 0.5, r !== void 0 ? r : 0.5)), e !== void 0 && (f.x = e), n !== void 0 && (f.y = n), s !== void 0 && (f.scale = s), o !== void 0 && Ur(f, o, a, l, !1);
|
|
771
|
-
}
|
|
772
|
-
const fn = () => ({
|
|
773
|
-
style: {},
|
|
774
|
-
transform: {},
|
|
775
|
-
transformOrigin: {},
|
|
776
|
-
vars: {}
|
|
777
|
-
}), mi = () => ({
|
|
778
|
-
...fn(),
|
|
779
|
-
attrs: {}
|
|
780
|
-
}), dn = (t) => typeof t == "string" && t.toLowerCase() === "svg";
|
|
781
|
-
function gi(t, { style: e, vars: n }, s, i) {
|
|
782
|
-
Object.assign(t.style, e, i && i.getProjectionStyles(s));
|
|
783
|
-
for (const r in n)
|
|
784
|
-
t.style.setProperty(r, n[r]);
|
|
785
|
-
}
|
|
786
|
-
const yi = /* @__PURE__ */ new Set([
|
|
787
|
-
"baseFrequency",
|
|
788
|
-
"diffuseConstant",
|
|
789
|
-
"kernelMatrix",
|
|
790
|
-
"kernelUnitLength",
|
|
791
|
-
"keySplines",
|
|
792
|
-
"keyTimes",
|
|
793
|
-
"limitingConeAngle",
|
|
794
|
-
"markerHeight",
|
|
795
|
-
"markerWidth",
|
|
796
|
-
"numOctaves",
|
|
797
|
-
"targetX",
|
|
798
|
-
"targetY",
|
|
799
|
-
"surfaceScale",
|
|
800
|
-
"specularConstant",
|
|
801
|
-
"specularExponent",
|
|
802
|
-
"stdDeviation",
|
|
803
|
-
"tableValues",
|
|
804
|
-
"viewBox",
|
|
805
|
-
"gradientTransform",
|
|
806
|
-
"pathLength",
|
|
807
|
-
"startOffset",
|
|
808
|
-
"textLength",
|
|
809
|
-
"lengthAdjust"
|
|
810
|
-
]);
|
|
811
|
-
function vi(t, e, n, s) {
|
|
812
|
-
gi(t, e, void 0, s);
|
|
813
|
-
for (const i in e.attrs)
|
|
814
|
-
t.setAttribute(yi.has(i) ? i : sn(i), e.attrs[i]);
|
|
815
|
-
}
|
|
816
|
-
const se = {};
|
|
817
|
-
function Kr(t) {
|
|
818
|
-
Object.assign(se, t);
|
|
819
|
-
}
|
|
820
|
-
function xi(t, { layout: e, layoutId: n }) {
|
|
821
|
-
return lt.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!se[t] || t === "opacity");
|
|
822
|
-
}
|
|
823
|
-
function pn(t, e, n) {
|
|
824
|
-
var s;
|
|
825
|
-
const { style: i } = t, r = {};
|
|
826
|
-
for (const o in i)
|
|
827
|
-
(L(i[o]) || e.style && L(e.style[o]) || xi(o, t) || ((s = n?.getValue(o)) === null || s === void 0 ? void 0 : s.liveStyle) !== void 0) && (r[o] = i[o]);
|
|
828
|
-
return r;
|
|
829
|
-
}
|
|
830
|
-
function Ti(t, e, n) {
|
|
831
|
-
const s = pn(t, e, n);
|
|
832
|
-
for (const i in t)
|
|
833
|
-
if (L(t[i]) || L(e[i])) {
|
|
834
|
-
const r = bt.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
|
|
835
|
-
s[r] = t[i];
|
|
836
|
-
}
|
|
837
|
-
return s;
|
|
838
|
-
}
|
|
839
|
-
function $r(t, e) {
|
|
840
|
-
try {
|
|
841
|
-
e.dimensions = typeof t.getBBox == "function" ? t.getBBox() : t.getBoundingClientRect();
|
|
842
|
-
} catch {
|
|
843
|
-
e.dimensions = {
|
|
844
|
-
x: 0,
|
|
845
|
-
y: 0,
|
|
846
|
-
width: 0,
|
|
847
|
-
height: 0
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
const Wn = ["x", "y", "width", "height", "cx", "cy", "r"], Wr = {
|
|
852
|
-
useVisualState: hi({
|
|
853
|
-
scrapeMotionValuesFromProps: Ti,
|
|
854
|
-
createRenderState: mi,
|
|
855
|
-
onUpdate: ({ props: t, prevProps: e, current: n, renderState: s, latestValues: i }) => {
|
|
856
|
-
if (!n)
|
|
857
|
-
return;
|
|
858
|
-
let r = !!t.drag;
|
|
859
|
-
if (!r) {
|
|
860
|
-
for (const a in i)
|
|
861
|
-
if (lt.has(a)) {
|
|
862
|
-
r = !0;
|
|
863
|
-
break;
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
if (!r)
|
|
867
|
-
return;
|
|
868
|
-
let o = !e;
|
|
869
|
-
if (e)
|
|
870
|
-
for (let a = 0; a < Wn.length; a++) {
|
|
871
|
-
const l = Wn[a];
|
|
872
|
-
t[l] !== e[l] && (o = !0);
|
|
873
|
-
}
|
|
874
|
-
o && D.read(() => {
|
|
875
|
-
$r(n, s), D.render(() => {
|
|
876
|
-
hn(s, i, dn(n.tagName), t.transformTemplate), vi(n, s);
|
|
877
|
-
});
|
|
878
|
-
});
|
|
879
|
-
}
|
|
880
|
-
})
|
|
881
|
-
}, Gr = {
|
|
882
|
-
useVisualState: hi({
|
|
883
|
-
scrapeMotionValuesFromProps: pn,
|
|
884
|
-
createRenderState: fn
|
|
885
|
-
})
|
|
886
|
-
};
|
|
887
|
-
function Si(t, e, n) {
|
|
888
|
-
for (const s in e)
|
|
889
|
-
!L(e[s]) && !xi(s, n) && (t[s] = e[s]);
|
|
890
|
-
}
|
|
891
|
-
function zr({ transformTemplate: t }, e) {
|
|
892
|
-
return at(() => {
|
|
893
|
-
const n = fn();
|
|
894
|
-
return cn(n, e, t), Object.assign({}, n.vars, n.style);
|
|
895
|
-
}, [e]);
|
|
896
|
-
}
|
|
897
|
-
function Hr(t, e) {
|
|
898
|
-
const n = t.style || {}, s = {};
|
|
899
|
-
return Si(s, n, t), Object.assign(s, zr(t, e)), s;
|
|
900
|
-
}
|
|
901
|
-
function Yr(t, e) {
|
|
902
|
-
const n = {}, s = Hr(t, e);
|
|
903
|
-
return t.drag && t.dragListener !== !1 && (n.draggable = !1, s.userSelect = s.WebkitUserSelect = s.WebkitTouchCallout = "none", s.touchAction = t.drag === !0 ? "none" : `pan-${t.drag === "x" ? "y" : "x"}`), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = s, n;
|
|
904
|
-
}
|
|
905
|
-
function Xr(t, e, n, s) {
|
|
906
|
-
const i = at(() => {
|
|
907
|
-
const r = mi();
|
|
908
|
-
return hn(r, e, dn(s), t.transformTemplate), {
|
|
909
|
-
...r.attrs,
|
|
910
|
-
style: { ...r.style }
|
|
911
|
-
};
|
|
912
|
-
}, [e]);
|
|
913
|
-
if (t.style) {
|
|
914
|
-
const r = {};
|
|
915
|
-
Si(r, t.style, t), i.style = { ...r, ...i.style };
|
|
916
|
-
}
|
|
917
|
-
return i;
|
|
918
|
-
}
|
|
919
|
-
function qr(t = !1) {
|
|
920
|
-
return (n, s, i, { latestValues: r }, o) => {
|
|
921
|
-
const l = (rn(n) ? Xr : Yr)(s, r, o, n), u = hr(s, typeof n == "string", t), c = n !== ni ? { ...u, ...l, ref: i } : {}, { children: h } = s, f = at(() => L(h) ? h.get() : h, [h]);
|
|
922
|
-
return Qo(n, {
|
|
923
|
-
...c,
|
|
924
|
-
children: f
|
|
925
|
-
});
|
|
926
|
-
};
|
|
927
|
-
}
|
|
928
|
-
function Zr(t, e) {
|
|
929
|
-
return function(s, { forwardMotionProps: i } = { forwardMotionProps: !1 }) {
|
|
930
|
-
const o = {
|
|
931
|
-
...rn(s) ? Wr : Gr,
|
|
932
|
-
preloadedFeatures: t,
|
|
933
|
-
useRender: qr(i),
|
|
934
|
-
createVisualElement: e,
|
|
935
|
-
Component: s
|
|
936
|
-
};
|
|
937
|
-
return Tr(o);
|
|
938
|
-
};
|
|
939
|
-
}
|
|
940
|
-
function Pi(t, e) {
|
|
941
|
-
if (!Array.isArray(e))
|
|
942
|
-
return !1;
|
|
943
|
-
const n = e.length;
|
|
944
|
-
if (n !== t.length)
|
|
945
|
-
return !1;
|
|
946
|
-
for (let s = 0; s < n; s++)
|
|
947
|
-
if (e[s] !== t[s])
|
|
948
|
-
return !1;
|
|
949
|
-
return !0;
|
|
950
|
-
}
|
|
951
|
-
function me(t, e, n) {
|
|
952
|
-
const s = t.getProps();
|
|
953
|
-
return an(s, e, n !== void 0 ? n : s.custom, t);
|
|
954
|
-
}
|
|
955
|
-
const Ai = /* @__PURE__ */ new Set([
|
|
956
|
-
"width",
|
|
957
|
-
"height",
|
|
958
|
-
"top",
|
|
959
|
-
"left",
|
|
960
|
-
"right",
|
|
961
|
-
"bottom",
|
|
962
|
-
...bt
|
|
963
|
-
]);
|
|
964
|
-
let te;
|
|
965
|
-
function Jr() {
|
|
966
|
-
te = void 0;
|
|
967
|
-
}
|
|
968
|
-
const H = {
|
|
969
|
-
now: () => (te === void 0 && H.set(B.isProcessing || or.useManualTiming ? B.timestamp : performance.now()), te),
|
|
970
|
-
set: (t) => {
|
|
971
|
-
te = t, queueMicrotask(Jr);
|
|
972
|
-
}
|
|
973
|
-
};
|
|
974
|
-
function mn(t, e) {
|
|
975
|
-
t.indexOf(e) === -1 && t.push(e);
|
|
976
|
-
}
|
|
977
|
-
function ge(t, e) {
|
|
978
|
-
const n = t.indexOf(e);
|
|
979
|
-
n > -1 && t.splice(n, 1);
|
|
980
|
-
}
|
|
981
|
-
class gn {
|
|
982
|
-
constructor() {
|
|
983
|
-
this.subscriptions = [];
|
|
984
|
-
}
|
|
985
|
-
add(e) {
|
|
986
|
-
return mn(this.subscriptions, e), () => ge(this.subscriptions, e);
|
|
987
|
-
}
|
|
988
|
-
notify(e, n, s) {
|
|
989
|
-
const i = this.subscriptions.length;
|
|
990
|
-
if (i)
|
|
991
|
-
if (i === 1)
|
|
992
|
-
this.subscriptions[0](e, n, s);
|
|
993
|
-
else
|
|
994
|
-
for (let r = 0; r < i; r++) {
|
|
995
|
-
const o = this.subscriptions[r];
|
|
996
|
-
o && o(e, n, s);
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
getSize() {
|
|
1000
|
-
return this.subscriptions.length;
|
|
1001
|
-
}
|
|
1002
|
-
clear() {
|
|
1003
|
-
this.subscriptions.length = 0;
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
function bi(t, e) {
|
|
1007
|
-
return e ? t * (1e3 / e) : 0;
|
|
1008
|
-
}
|
|
1009
|
-
const Gn = 30, Qr = (t) => !isNaN(parseFloat(t)), Et = {
|
|
1010
|
-
current: void 0
|
|
1011
|
-
};
|
|
1012
|
-
class ta {
|
|
1013
|
-
/**
|
|
1014
|
-
* @param init - The initiating value
|
|
1015
|
-
* @param config - Optional configuration options
|
|
1016
|
-
*
|
|
1017
|
-
* - `transformer`: A function to transform incoming values with.
|
|
1018
|
-
*
|
|
1019
|
-
* @internal
|
|
1020
|
-
*/
|
|
1021
|
-
constructor(e, n = {}) {
|
|
1022
|
-
this.version = "11.18.2", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (s, i = !0) => {
|
|
1023
|
-
const r = H.now();
|
|
1024
|
-
this.updatedAt !== r && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(s), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), i && this.events.renderRequest && this.events.renderRequest.notify(this.current);
|
|
1025
|
-
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = n.owner;
|
|
1026
|
-
}
|
|
1027
|
-
setCurrent(e) {
|
|
1028
|
-
this.current = e, this.updatedAt = H.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = Qr(this.current));
|
|
1029
|
-
}
|
|
1030
|
-
setPrevFrameValue(e = this.current) {
|
|
1031
|
-
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
1032
|
-
}
|
|
1033
|
-
/**
|
|
1034
|
-
* Adds a function that will be notified when the `MotionValue` is updated.
|
|
1035
|
-
*
|
|
1036
|
-
* It returns a function that, when called, will cancel the subscription.
|
|
1037
|
-
*
|
|
1038
|
-
* When calling `onChange` inside a React component, it should be wrapped with the
|
|
1039
|
-
* `useEffect` hook. As it returns an unsubscribe function, this should be returned
|
|
1040
|
-
* from the `useEffect` function to ensure you don't add duplicate subscribers..
|
|
1041
|
-
*
|
|
1042
|
-
* ```jsx
|
|
1043
|
-
* export const MyComponent = () => {
|
|
1044
|
-
* const x = useMotionValue(0)
|
|
1045
|
-
* const y = useMotionValue(0)
|
|
1046
|
-
* const opacity = useMotionValue(1)
|
|
1047
|
-
*
|
|
1048
|
-
* useEffect(() => {
|
|
1049
|
-
* function updateOpacity() {
|
|
1050
|
-
* const maxXY = Math.max(x.get(), y.get())
|
|
1051
|
-
* const newOpacity = transform(maxXY, [0, 100], [1, 0])
|
|
1052
|
-
* opacity.set(newOpacity)
|
|
1053
|
-
* }
|
|
1054
|
-
*
|
|
1055
|
-
* const unsubscribeX = x.on("change", updateOpacity)
|
|
1056
|
-
* const unsubscribeY = y.on("change", updateOpacity)
|
|
1057
|
-
*
|
|
1058
|
-
* return () => {
|
|
1059
|
-
* unsubscribeX()
|
|
1060
|
-
* unsubscribeY()
|
|
1061
|
-
* }
|
|
1062
|
-
* }, [])
|
|
1063
|
-
*
|
|
1064
|
-
* return <motion.div style={{ x }} />
|
|
1065
|
-
* }
|
|
1066
|
-
* ```
|
|
1067
|
-
*
|
|
1068
|
-
* @param subscriber - A function that receives the latest value.
|
|
1069
|
-
* @returns A function that, when called, will cancel this subscription.
|
|
1070
|
-
*
|
|
1071
|
-
* @deprecated
|
|
1072
|
-
*/
|
|
1073
|
-
onChange(e) {
|
|
1074
|
-
return process.env.NODE_ENV !== "production" && he(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", e);
|
|
1075
|
-
}
|
|
1076
|
-
on(e, n) {
|
|
1077
|
-
this.events[e] || (this.events[e] = new gn());
|
|
1078
|
-
const s = this.events[e].add(n);
|
|
1079
|
-
return e === "change" ? () => {
|
|
1080
|
-
s(), D.read(() => {
|
|
1081
|
-
this.events.change.getSize() || this.stop();
|
|
1082
|
-
});
|
|
1083
|
-
} : s;
|
|
1084
|
-
}
|
|
1085
|
-
clearListeners() {
|
|
1086
|
-
for (const e in this.events)
|
|
1087
|
-
this.events[e].clear();
|
|
1088
|
-
}
|
|
1089
|
-
/**
|
|
1090
|
-
* Attaches a passive effect to the `MotionValue`.
|
|
1091
|
-
*
|
|
1092
|
-
* @internal
|
|
1093
|
-
*/
|
|
1094
|
-
attach(e, n) {
|
|
1095
|
-
this.passiveEffect = e, this.stopPassiveEffect = n;
|
|
1096
|
-
}
|
|
1097
|
-
/**
|
|
1098
|
-
* Sets the state of the `MotionValue`.
|
|
1099
|
-
*
|
|
1100
|
-
* @remarks
|
|
1101
|
-
*
|
|
1102
|
-
* ```jsx
|
|
1103
|
-
* const x = useMotionValue(0)
|
|
1104
|
-
* x.set(10)
|
|
1105
|
-
* ```
|
|
1106
|
-
*
|
|
1107
|
-
* @param latest - Latest value to set.
|
|
1108
|
-
* @param render - Whether to notify render subscribers. Defaults to `true`
|
|
1109
|
-
*
|
|
1110
|
-
* @public
|
|
1111
|
-
*/
|
|
1112
|
-
set(e, n = !0) {
|
|
1113
|
-
!n || !this.passiveEffect ? this.updateAndNotify(e, n) : this.passiveEffect(e, this.updateAndNotify);
|
|
1114
|
-
}
|
|
1115
|
-
setWithVelocity(e, n, s) {
|
|
1116
|
-
this.set(n), this.prev = void 0, this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt - s;
|
|
1117
|
-
}
|
|
1118
|
-
/**
|
|
1119
|
-
* Set the state of the `MotionValue`, stopping any active animations,
|
|
1120
|
-
* effects, and resets velocity to `0`.
|
|
1121
|
-
*/
|
|
1122
|
-
jump(e, n = !0) {
|
|
1123
|
-
this.updateAndNotify(e), this.prev = e, this.prevUpdatedAt = this.prevFrameValue = void 0, n && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1124
|
-
}
|
|
1125
|
-
/**
|
|
1126
|
-
* Returns the latest state of `MotionValue`
|
|
1127
|
-
*
|
|
1128
|
-
* @returns - The latest state of `MotionValue`
|
|
1129
|
-
*
|
|
1130
|
-
* @public
|
|
1131
|
-
*/
|
|
1132
|
-
get() {
|
|
1133
|
-
return Et.current && Et.current.push(this), this.current;
|
|
1134
|
-
}
|
|
1135
|
-
/**
|
|
1136
|
-
* @public
|
|
1137
|
-
*/
|
|
1138
|
-
getPrevious() {
|
|
1139
|
-
return this.prev;
|
|
1140
|
-
}
|
|
1141
|
-
/**
|
|
1142
|
-
* Returns the latest velocity of `MotionValue`
|
|
1143
|
-
*
|
|
1144
|
-
* @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
|
|
1145
|
-
*
|
|
1146
|
-
* @public
|
|
1147
|
-
*/
|
|
1148
|
-
getVelocity() {
|
|
1149
|
-
const e = H.now();
|
|
1150
|
-
if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Gn)
|
|
1151
|
-
return 0;
|
|
1152
|
-
const n = Math.min(this.updatedAt - this.prevUpdatedAt, Gn);
|
|
1153
|
-
return bi(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
|
|
1154
|
-
}
|
|
1155
|
-
/**
|
|
1156
|
-
* Registers a new animation to control this `MotionValue`. Only one
|
|
1157
|
-
* animation can drive a `MotionValue` at one time.
|
|
1158
|
-
*
|
|
1159
|
-
* ```jsx
|
|
1160
|
-
* value.start()
|
|
1161
|
-
* ```
|
|
1162
|
-
*
|
|
1163
|
-
* @param animation - A function that starts the provided animation
|
|
1164
|
-
*
|
|
1165
|
-
* @internal
|
|
1166
|
-
*/
|
|
1167
|
-
start(e) {
|
|
1168
|
-
return this.stop(), new Promise((n) => {
|
|
1169
|
-
this.hasAnimated = !0, this.animation = e(n), this.events.animationStart && this.events.animationStart.notify();
|
|
1170
|
-
}).then(() => {
|
|
1171
|
-
this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation();
|
|
1172
|
-
});
|
|
1173
|
-
}
|
|
1174
|
-
/**
|
|
1175
|
-
* Stop the currently active animation.
|
|
1176
|
-
*
|
|
1177
|
-
* @public
|
|
1178
|
-
*/
|
|
1179
|
-
stop() {
|
|
1180
|
-
this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation();
|
|
1181
|
-
}
|
|
1182
|
-
/**
|
|
1183
|
-
* Returns `true` if this value is currently animating.
|
|
1184
|
-
*
|
|
1185
|
-
* @public
|
|
1186
|
-
*/
|
|
1187
|
-
isAnimating() {
|
|
1188
|
-
return !!this.animation;
|
|
1189
|
-
}
|
|
1190
|
-
clearAnimation() {
|
|
1191
|
-
delete this.animation;
|
|
1192
|
-
}
|
|
1193
|
-
/**
|
|
1194
|
-
* Destroy and clean up subscribers to this `MotionValue`.
|
|
1195
|
-
*
|
|
1196
|
-
* The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
|
|
1197
|
-
* handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
|
|
1198
|
-
* created a `MotionValue` via the `motionValue` function.
|
|
1199
|
-
*
|
|
1200
|
-
* @public
|
|
1201
|
-
*/
|
|
1202
|
-
destroy() {
|
|
1203
|
-
this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
function xt(t, e) {
|
|
1207
|
-
return new ta(t, e);
|
|
1208
|
-
}
|
|
1209
|
-
function ea(t, e, n) {
|
|
1210
|
-
t.hasValue(e) ? t.getValue(e).set(n) : t.addValue(e, xt(n));
|
|
1211
|
-
}
|
|
1212
|
-
function yn(t, e) {
|
|
1213
|
-
const n = me(t, e);
|
|
1214
|
-
let { transitionEnd: s = {}, transition: i = {}, ...r } = n || {};
|
|
1215
|
-
r = { ...r, ...s };
|
|
1216
|
-
for (const o in r) {
|
|
1217
|
-
const a = wr(r[o]);
|
|
1218
|
-
ea(t, o, a);
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
|
-
function na(t) {
|
|
1222
|
-
return !!(L(t) && t.add);
|
|
1223
|
-
}
|
|
1224
|
-
function Be(t, e) {
|
|
1225
|
-
const n = t.getValue("willChange");
|
|
1226
|
-
if (na(n))
|
|
1227
|
-
return n.add(e);
|
|
1228
|
-
}
|
|
1229
|
-
function Vi(t) {
|
|
1230
|
-
return t.props[li];
|
|
1231
|
-
}
|
|
1232
|
-
const wi = (t, e, n) => (((1 - 3 * n + 3 * e) * t + (3 * n - 6 * e)) * t + 3 * e) * t, sa = 1e-7, ia = 12;
|
|
1233
|
-
function oa(t, e, n, s, i) {
|
|
1234
|
-
let r, o, a = 0;
|
|
1235
|
-
do
|
|
1236
|
-
o = e + (n - e) / 2, r = wi(o, s, i) - t, r > 0 ? n = o : e = o;
|
|
1237
|
-
while (Math.abs(r) > sa && ++a < ia);
|
|
1238
|
-
return o;
|
|
1239
|
-
}
|
|
1240
|
-
function Wt(t, e, n, s) {
|
|
1241
|
-
if (t === e && n === s)
|
|
1242
|
-
return K;
|
|
1243
|
-
const i = (r) => oa(r, 0, 1, t, n);
|
|
1244
|
-
return (r) => r === 0 || r === 1 ? r : wi(i(r), e, s);
|
|
1245
|
-
}
|
|
1246
|
-
const Di = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Ci = (t) => (e) => 1 - t(1 - e), Mi = /* @__PURE__ */ Wt(0.33, 1.53, 0.69, 0.99), vn = /* @__PURE__ */ Ci(Mi), Ri = /* @__PURE__ */ Di(vn), Ei = (t) => (t *= 2) < 1 ? 0.5 * vn(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), xn = (t) => 1 - Math.sin(Math.acos(t)), Li = Ci(xn), Fi = Di(xn), Bi = (t) => /^0[^.\s]+$/u.test(t);
|
|
1247
|
-
function ra(t) {
|
|
1248
|
-
return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Bi(t) : !0;
|
|
1249
|
-
}
|
|
1250
|
-
const Lt = (t) => Math.round(t * 1e5) / 1e5, Tn = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
1251
|
-
function aa(t) {
|
|
1252
|
-
return t == null;
|
|
1253
|
-
}
|
|
1254
|
-
const la = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, Sn = (t, e) => (n) => !!(typeof n == "string" && la.test(n) && n.startsWith(t) || e && !aa(n) && Object.prototype.hasOwnProperty.call(n, e)), ki = (t, e, n) => (s) => {
|
|
1255
|
-
if (typeof s != "string")
|
|
1256
|
-
return s;
|
|
1257
|
-
const [i, r, o, a] = s.match(Tn);
|
|
1258
|
-
return {
|
|
1259
|
-
[t]: parseFloat(i),
|
|
1260
|
-
[e]: parseFloat(r),
|
|
1261
|
-
[n]: parseFloat(o),
|
|
1262
|
-
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
1263
|
-
};
|
|
1264
|
-
}, ua = (t) => Z(0, 255, t), Se = {
|
|
1265
|
-
...Vt,
|
|
1266
|
-
transform: (t) => Math.round(ua(t))
|
|
1267
|
-
}, ot = {
|
|
1268
|
-
test: /* @__PURE__ */ Sn("rgb", "red"),
|
|
1269
|
-
parse: /* @__PURE__ */ ki("red", "green", "blue"),
|
|
1270
|
-
transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + Se.transform(t) + ", " + Se.transform(e) + ", " + Se.transform(n) + ", " + Lt(jt.transform(s)) + ")"
|
|
1271
|
-
};
|
|
1272
|
-
function ca(t) {
|
|
1273
|
-
let e = "", n = "", s = "", i = "";
|
|
1274
|
-
return t.length > 5 ? (e = t.substring(1, 3), n = t.substring(3, 5), s = t.substring(5, 7), i = t.substring(7, 9)) : (e = t.substring(1, 2), n = t.substring(2, 3), s = t.substring(3, 4), i = t.substring(4, 5), e += e, n += n, s += s, i += i), {
|
|
1275
|
-
red: parseInt(e, 16),
|
|
1276
|
-
green: parseInt(n, 16),
|
|
1277
|
-
blue: parseInt(s, 16),
|
|
1278
|
-
alpha: i ? parseInt(i, 16) / 255 : 1
|
|
1279
|
-
};
|
|
1280
|
-
}
|
|
1281
|
-
const ke = {
|
|
1282
|
-
test: /* @__PURE__ */ Sn("#"),
|
|
1283
|
-
parse: ca,
|
|
1284
|
-
transform: ot.transform
|
|
1285
|
-
}, dt = {
|
|
1286
|
-
test: /* @__PURE__ */ Sn("hsl", "hue"),
|
|
1287
|
-
parse: /* @__PURE__ */ ki("hue", "saturation", "lightness"),
|
|
1288
|
-
transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + z.transform(Lt(e)) + ", " + z.transform(Lt(n)) + ", " + Lt(jt.transform(s)) + ")"
|
|
1289
|
-
}, I = {
|
|
1290
|
-
test: (t) => ot.test(t) || ke.test(t) || dt.test(t),
|
|
1291
|
-
parse: (t) => ot.test(t) ? ot.parse(t) : dt.test(t) ? dt.parse(t) : ke.parse(t),
|
|
1292
|
-
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? ot.transform(t) : dt.transform(t)
|
|
1293
|
-
}, ha = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
1294
|
-
function fa(t) {
|
|
1295
|
-
var e, n;
|
|
1296
|
-
return isNaN(t) && typeof t == "string" && (((e = t.match(Tn)) === null || e === void 0 ? void 0 : e.length) || 0) + (((n = t.match(ha)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
|
|
1297
|
-
}
|
|
1298
|
-
const Oi = "number", ji = "color", da = "var", pa = "var(", zn = "${}", ma = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
1299
|
-
function It(t) {
|
|
1300
|
-
const e = t.toString(), n = [], s = {
|
|
1301
|
-
color: [],
|
|
1302
|
-
number: [],
|
|
1303
|
-
var: []
|
|
1304
|
-
}, i = [];
|
|
1305
|
-
let r = 0;
|
|
1306
|
-
const a = e.replace(ma, (l) => (I.test(l) ? (s.color.push(r), i.push(ji), n.push(I.parse(l))) : l.startsWith(pa) ? (s.var.push(r), i.push(da), n.push(l)) : (s.number.push(r), i.push(Oi), n.push(parseFloat(l))), ++r, zn)).split(zn);
|
|
1307
|
-
return { values: n, split: a, indexes: s, types: i };
|
|
1308
|
-
}
|
|
1309
|
-
function Ii(t) {
|
|
1310
|
-
return It(t).values;
|
|
1311
|
-
}
|
|
1312
|
-
function Ni(t) {
|
|
1313
|
-
const { split: e, types: n } = It(t), s = e.length;
|
|
1314
|
-
return (i) => {
|
|
1315
|
-
let r = "";
|
|
1316
|
-
for (let o = 0; o < s; o++)
|
|
1317
|
-
if (r += e[o], i[o] !== void 0) {
|
|
1318
|
-
const a = n[o];
|
|
1319
|
-
a === Oi ? r += Lt(i[o]) : a === ji ? r += I.transform(i[o]) : r += i[o];
|
|
1320
|
-
}
|
|
1321
|
-
return r;
|
|
1322
|
-
};
|
|
1323
|
-
}
|
|
1324
|
-
const ga = (t) => typeof t == "number" ? 0 : t;
|
|
1325
|
-
function ya(t) {
|
|
1326
|
-
const e = Ii(t);
|
|
1327
|
-
return Ni(t)(e.map(ga));
|
|
1328
|
-
}
|
|
1329
|
-
const Q = {
|
|
1330
|
-
test: fa,
|
|
1331
|
-
parse: Ii,
|
|
1332
|
-
createTransformer: Ni,
|
|
1333
|
-
getAnimatableNone: ya
|
|
1334
|
-
}, va = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
1335
|
-
function xa(t) {
|
|
1336
|
-
const [e, n] = t.slice(0, -1).split("(");
|
|
1337
|
-
if (e === "drop-shadow")
|
|
1338
|
-
return t;
|
|
1339
|
-
const [s] = n.match(Tn) || [];
|
|
1340
|
-
if (!s)
|
|
1341
|
-
return t;
|
|
1342
|
-
const i = n.replace(s, "");
|
|
1343
|
-
let r = va.has(e) ? 1 : 0;
|
|
1344
|
-
return s !== n && (r *= 100), e + "(" + r + i + ")";
|
|
1345
|
-
}
|
|
1346
|
-
const Ta = /\b([a-z-]*)\(.*?\)/gu, Oe = {
|
|
1347
|
-
...Q,
|
|
1348
|
-
getAnimatableNone: (t) => {
|
|
1349
|
-
const e = t.match(Ta);
|
|
1350
|
-
return e ? e.map(xa).join(" ") : t;
|
|
1351
|
-
}
|
|
1352
|
-
}, Sa = {
|
|
1353
|
-
...un,
|
|
1354
|
-
// Color props
|
|
1355
|
-
color: I,
|
|
1356
|
-
backgroundColor: I,
|
|
1357
|
-
outlineColor: I,
|
|
1358
|
-
fill: I,
|
|
1359
|
-
stroke: I,
|
|
1360
|
-
// Border props
|
|
1361
|
-
borderColor: I,
|
|
1362
|
-
borderTopColor: I,
|
|
1363
|
-
borderRightColor: I,
|
|
1364
|
-
borderBottomColor: I,
|
|
1365
|
-
borderLeftColor: I,
|
|
1366
|
-
filter: Oe,
|
|
1367
|
-
WebkitFilter: Oe
|
|
1368
|
-
}, Pn = (t) => Sa[t];
|
|
1369
|
-
function Ui(t, e) {
|
|
1370
|
-
let n = Pn(t);
|
|
1371
|
-
return n !== Oe && (n = Q), n.getAnimatableNone ? n.getAnimatableNone(e) : void 0;
|
|
1372
|
-
}
|
|
1373
|
-
const Pa = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
1374
|
-
function Aa(t, e, n) {
|
|
1375
|
-
let s = 0, i;
|
|
1376
|
-
for (; s < t.length && !i; ) {
|
|
1377
|
-
const r = t[s];
|
|
1378
|
-
typeof r == "string" && !Pa.has(r) && It(r).values.length && (i = t[s]), s++;
|
|
1379
|
-
}
|
|
1380
|
-
if (i && n)
|
|
1381
|
-
for (const r of e)
|
|
1382
|
-
t[r] = Ui(n, i);
|
|
1383
|
-
}
|
|
1384
|
-
const Hn = (t) => t === Vt || t === S, Yn = (t, e) => parseFloat(t.split(", ")[e]), Xn = (t, e) => (n, { transform: s }) => {
|
|
1385
|
-
if (s === "none" || !s)
|
|
1386
|
-
return 0;
|
|
1387
|
-
const i = s.match(/^matrix3d\((.+)\)$/u);
|
|
1388
|
-
if (i)
|
|
1389
|
-
return Yn(i[1], e);
|
|
1390
|
-
{
|
|
1391
|
-
const r = s.match(/^matrix\((.+)\)$/u);
|
|
1392
|
-
return r ? Yn(r[1], t) : 0;
|
|
1393
|
-
}
|
|
1394
|
-
}, ba = /* @__PURE__ */ new Set(["x", "y", "z"]), Va = bt.filter((t) => !ba.has(t));
|
|
1395
|
-
function wa(t) {
|
|
1396
|
-
const e = [];
|
|
1397
|
-
return Va.forEach((n) => {
|
|
1398
|
-
const s = t.getValue(n);
|
|
1399
|
-
s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
|
|
1400
|
-
}), e;
|
|
1401
|
-
}
|
|
1402
|
-
const Tt = {
|
|
1403
|
-
// Dimensions
|
|
1404
|
-
width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
1405
|
-
height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
1406
|
-
top: (t, { top: e }) => parseFloat(e),
|
|
1407
|
-
left: (t, { left: e }) => parseFloat(e),
|
|
1408
|
-
bottom: ({ y: t }, { top: e }) => parseFloat(e) + (t.max - t.min),
|
|
1409
|
-
right: ({ x: t }, { left: e }) => parseFloat(e) + (t.max - t.min),
|
|
1410
|
-
// Transform
|
|
1411
|
-
x: Xn(4, 13),
|
|
1412
|
-
y: Xn(5, 14)
|
|
1413
|
-
};
|
|
1414
|
-
Tt.translateX = Tt.x;
|
|
1415
|
-
Tt.translateY = Tt.y;
|
|
1416
|
-
const rt = /* @__PURE__ */ new Set();
|
|
1417
|
-
let je = !1, Ie = !1;
|
|
1418
|
-
function _i() {
|
|
1419
|
-
if (Ie) {
|
|
1420
|
-
const t = Array.from(rt).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
|
|
1421
|
-
e.forEach((s) => {
|
|
1422
|
-
const i = wa(s);
|
|
1423
|
-
i.length && (n.set(s, i), s.render());
|
|
1424
|
-
}), t.forEach((s) => s.measureInitialState()), e.forEach((s) => {
|
|
1425
|
-
s.render();
|
|
1426
|
-
const i = n.get(s);
|
|
1427
|
-
i && i.forEach(([r, o]) => {
|
|
1428
|
-
var a;
|
|
1429
|
-
(a = s.getValue(r)) === null || a === void 0 || a.set(o);
|
|
1430
|
-
});
|
|
1431
|
-
}), t.forEach((s) => s.measureEndState()), t.forEach((s) => {
|
|
1432
|
-
s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
|
|
1433
|
-
});
|
|
1434
|
-
}
|
|
1435
|
-
Ie = !1, je = !1, rt.forEach((t) => t.complete()), rt.clear();
|
|
1436
|
-
}
|
|
1437
|
-
function Ki() {
|
|
1438
|
-
rt.forEach((t) => {
|
|
1439
|
-
t.readKeyframes(), t.needsMeasurement && (Ie = !0);
|
|
1440
|
-
});
|
|
1441
|
-
}
|
|
1442
|
-
function Da() {
|
|
1443
|
-
Ki(), _i();
|
|
1444
|
-
}
|
|
1445
|
-
class An {
|
|
1446
|
-
constructor(e, n, s, i, r, o = !1) {
|
|
1447
|
-
this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = r, this.isAsync = o;
|
|
1448
|
-
}
|
|
1449
|
-
scheduleResolve() {
|
|
1450
|
-
this.isScheduled = !0, this.isAsync ? (rt.add(this), je || (je = !0, D.read(Ki), D.resolveKeyframes(_i))) : (this.readKeyframes(), this.complete());
|
|
1451
|
-
}
|
|
1452
|
-
readKeyframes() {
|
|
1453
|
-
const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
|
|
1454
|
-
for (let r = 0; r < e.length; r++)
|
|
1455
|
-
if (e[r] === null)
|
|
1456
|
-
if (r === 0) {
|
|
1457
|
-
const o = i?.get(), a = e[e.length - 1];
|
|
1458
|
-
if (o !== void 0)
|
|
1459
|
-
e[0] = o;
|
|
1460
|
-
else if (s && n) {
|
|
1461
|
-
const l = s.readValue(n, a);
|
|
1462
|
-
l != null && (e[0] = l);
|
|
1463
|
-
}
|
|
1464
|
-
e[0] === void 0 && (e[0] = a), i && o === void 0 && i.set(e[0]);
|
|
1465
|
-
} else
|
|
1466
|
-
e[r] = e[r - 1];
|
|
1467
|
-
}
|
|
1468
|
-
setFinalKeyframe() {
|
|
1469
|
-
}
|
|
1470
|
-
measureInitialState() {
|
|
1471
|
-
}
|
|
1472
|
-
renderEndStyles() {
|
|
1473
|
-
}
|
|
1474
|
-
measureEndState() {
|
|
1475
|
-
}
|
|
1476
|
-
complete() {
|
|
1477
|
-
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), rt.delete(this);
|
|
1478
|
-
}
|
|
1479
|
-
cancel() {
|
|
1480
|
-
this.isComplete || (this.isScheduled = !1, rt.delete(this));
|
|
1481
|
-
}
|
|
1482
|
-
resume() {
|
|
1483
|
-
this.isComplete || this.scheduleResolve();
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1486
|
-
const $i = (t) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t), Ca = (
|
|
1487
|
-
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
1488
|
-
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
1489
|
-
);
|
|
1490
|
-
function Ma(t) {
|
|
1491
|
-
const e = Ca.exec(t);
|
|
1492
|
-
if (!e)
|
|
1493
|
-
return [,];
|
|
1494
|
-
const [, n, s, i] = e;
|
|
1495
|
-
return [`--${n ?? s}`, i];
|
|
1496
|
-
}
|
|
1497
|
-
const Ra = 4;
|
|
1498
|
-
function Wi(t, e, n = 1) {
|
|
1499
|
-
G(n <= Ra, `Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);
|
|
1500
|
-
const [s, i] = Ma(t);
|
|
1501
|
-
if (!s)
|
|
1502
|
-
return;
|
|
1503
|
-
const r = window.getComputedStyle(e).getPropertyValue(s);
|
|
1504
|
-
if (r) {
|
|
1505
|
-
const o = r.trim();
|
|
1506
|
-
return $i(o) ? parseFloat(o) : o;
|
|
1507
|
-
}
|
|
1508
|
-
return ln(i) ? Wi(i, e, n + 1) : i;
|
|
1509
|
-
}
|
|
1510
|
-
const Gi = (t) => (e) => e.test(t), Ea = {
|
|
1511
|
-
test: (t) => t === "auto",
|
|
1512
|
-
parse: (t) => t
|
|
1513
|
-
}, zi = [Vt, S, z, J, Lr, Er, Ea], qn = (t) => zi.find(Gi(t));
|
|
1514
|
-
class Hi extends An {
|
|
1515
|
-
constructor(e, n, s, i, r) {
|
|
1516
|
-
super(e, n, s, i, r, !0);
|
|
1517
|
-
}
|
|
1518
|
-
readKeyframes() {
|
|
1519
|
-
const { unresolvedKeyframes: e, element: n, name: s } = this;
|
|
1520
|
-
if (!n || !n.current)
|
|
1521
|
-
return;
|
|
1522
|
-
super.readKeyframes();
|
|
1523
|
-
for (let l = 0; l < e.length; l++) {
|
|
1524
|
-
let u = e[l];
|
|
1525
|
-
if (typeof u == "string" && (u = u.trim(), ln(u))) {
|
|
1526
|
-
const c = Wi(u, n.current);
|
|
1527
|
-
c !== void 0 && (e[l] = c), l === e.length - 1 && (this.finalKeyframe = u);
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
if (this.resolveNoneKeyframes(), !Ai.has(s) || e.length !== 2)
|
|
1531
|
-
return;
|
|
1532
|
-
const [i, r] = e, o = qn(i), a = qn(r);
|
|
1533
|
-
if (o !== a)
|
|
1534
|
-
if (Hn(o) && Hn(a))
|
|
1535
|
-
for (let l = 0; l < e.length; l++) {
|
|
1536
|
-
const u = e[l];
|
|
1537
|
-
typeof u == "string" && (e[l] = parseFloat(u));
|
|
1538
|
-
}
|
|
1539
|
-
else
|
|
1540
|
-
this.needsMeasurement = !0;
|
|
1541
|
-
}
|
|
1542
|
-
resolveNoneKeyframes() {
|
|
1543
|
-
const { unresolvedKeyframes: e, name: n } = this, s = [];
|
|
1544
|
-
for (let i = 0; i < e.length; i++)
|
|
1545
|
-
ra(e[i]) && s.push(i);
|
|
1546
|
-
s.length && Aa(e, s, n);
|
|
1547
|
-
}
|
|
1548
|
-
measureInitialState() {
|
|
1549
|
-
const { element: e, unresolvedKeyframes: n, name: s } = this;
|
|
1550
|
-
if (!e || !e.current)
|
|
1551
|
-
return;
|
|
1552
|
-
s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Tt[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
|
|
1553
|
-
const i = n[n.length - 1];
|
|
1554
|
-
i !== void 0 && e.getValue(s, i).jump(i, !1);
|
|
1555
|
-
}
|
|
1556
|
-
measureEndState() {
|
|
1557
|
-
var e;
|
|
1558
|
-
const { element: n, name: s, unresolvedKeyframes: i } = this;
|
|
1559
|
-
if (!n || !n.current)
|
|
1560
|
-
return;
|
|
1561
|
-
const r = n.getValue(s);
|
|
1562
|
-
r && r.jump(this.measuredOrigin, !1);
|
|
1563
|
-
const o = i.length - 1, a = i[o];
|
|
1564
|
-
i[o] = Tt[s](n.measureViewportBox(), window.getComputedStyle(n.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), !((e = this.removedTransforms) === null || e === void 0) && e.length && this.removedTransforms.forEach(([l, u]) => {
|
|
1565
|
-
n.getValue(l).set(u);
|
|
1566
|
-
}), this.resolveNoneKeyframes();
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
const Zn = (t, e) => e === "zIndex" ? !1 : !!(typeof t == "number" || Array.isArray(t) || typeof t == "string" && // It's animatable if we have a string
|
|
1570
|
-
(Q.test(t) || t === "0") && // And it contains numbers and/or colors
|
|
1571
|
-
!t.startsWith("url("));
|
|
1572
|
-
function La(t) {
|
|
1573
|
-
const e = t[0];
|
|
1574
|
-
if (t.length === 1)
|
|
1575
|
-
return !0;
|
|
1576
|
-
for (let n = 0; n < t.length; n++)
|
|
1577
|
-
if (t[n] !== e)
|
|
1578
|
-
return !0;
|
|
1579
|
-
}
|
|
1580
|
-
function Fa(t, e, n, s) {
|
|
1581
|
-
const i = t[0];
|
|
1582
|
-
if (i === null)
|
|
1583
|
-
return !1;
|
|
1584
|
-
if (e === "display" || e === "visibility")
|
|
1585
|
-
return !0;
|
|
1586
|
-
const r = t[t.length - 1], o = Zn(i, e), a = Zn(r, e);
|
|
1587
|
-
return Ut(o === a, `You are trying to animate ${e} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`), !o || !a ? !1 : La(t) || (n === "spring" || le(n)) && s;
|
|
1588
|
-
}
|
|
1589
|
-
const Ba = (t) => t !== null;
|
|
1590
|
-
function ye(t, { repeat: e, repeatType: n = "loop" }, s) {
|
|
1591
|
-
const i = t.filter(Ba), r = e && n !== "loop" && e % 2 === 1 ? 0 : i.length - 1;
|
|
1592
|
-
return !r || s === void 0 ? i[r] : s;
|
|
1593
|
-
}
|
|
1594
|
-
const ka = 40;
|
|
1595
|
-
class Yi {
|
|
1596
|
-
constructor({ autoplay: e = !0, delay: n = 0, type: s = "keyframes", repeat: i = 0, repeatDelay: r = 0, repeatType: o = "loop", ...a }) {
|
|
1597
|
-
this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = H.now(), this.options = {
|
|
1598
|
-
autoplay: e,
|
|
1599
|
-
delay: n,
|
|
1600
|
-
type: s,
|
|
1601
|
-
repeat: i,
|
|
1602
|
-
repeatDelay: r,
|
|
1603
|
-
repeatType: o,
|
|
1604
|
-
...a
|
|
1605
|
-
}, this.updateFinishedPromise();
|
|
1606
|
-
}
|
|
1607
|
-
/**
|
|
1608
|
-
* This method uses the createdAt and resolvedAt to calculate the
|
|
1609
|
-
* animation startTime. *Ideally*, we would use the createdAt time as t=0
|
|
1610
|
-
* as the following frame would then be the first frame of the animation in
|
|
1611
|
-
* progress, which would feel snappier.
|
|
1612
|
-
*
|
|
1613
|
-
* However, if there's a delay (main thread work) between the creation of
|
|
1614
|
-
* the animation and the first commited frame, we prefer to use resolvedAt
|
|
1615
|
-
* to avoid a sudden jump into the animation.
|
|
1616
|
-
*/
|
|
1617
|
-
calcStartTime() {
|
|
1618
|
-
return this.resolvedAt ? this.resolvedAt - this.createdAt > ka ? this.resolvedAt : this.createdAt : this.createdAt;
|
|
1619
|
-
}
|
|
1620
|
-
/**
|
|
1621
|
-
* A getter for resolved data. If keyframes are not yet resolved, accessing
|
|
1622
|
-
* this.resolved will synchronously flush all pending keyframe resolvers.
|
|
1623
|
-
* This is a deoptimisation, but at its worst still batches read/writes.
|
|
1624
|
-
*/
|
|
1625
|
-
get resolved() {
|
|
1626
|
-
return !this._resolved && !this.hasAttemptedResolve && Da(), this._resolved;
|
|
1627
|
-
}
|
|
1628
|
-
/**
|
|
1629
|
-
* A method to be called when the keyframes resolver completes. This method
|
|
1630
|
-
* will check if its possible to run the animation and, if not, skip it.
|
|
1631
|
-
* Otherwise, it will call initPlayback on the implementing class.
|
|
1632
|
-
*/
|
|
1633
|
-
onKeyframesResolved(e, n) {
|
|
1634
|
-
this.resolvedAt = H.now(), this.hasAttemptedResolve = !0;
|
|
1635
|
-
const { name: s, type: i, velocity: r, delay: o, onComplete: a, onUpdate: l, isGenerator: u } = this.options;
|
|
1636
|
-
if (!u && !Fa(e, s, i, r))
|
|
1637
|
-
if (o)
|
|
1638
|
-
this.options.duration = 0;
|
|
1639
|
-
else {
|
|
1640
|
-
l && l(ye(e, this.options, n)), a && a(), this.resolveFinishedPromise();
|
|
1641
|
-
return;
|
|
1642
|
-
}
|
|
1643
|
-
const c = this.initPlayback(e, n);
|
|
1644
|
-
c !== !1 && (this._resolved = {
|
|
1645
|
-
keyframes: e,
|
|
1646
|
-
finalKeyframe: n,
|
|
1647
|
-
...c
|
|
1648
|
-
}, this.onPostResolved());
|
|
1649
|
-
}
|
|
1650
|
-
onPostResolved() {
|
|
1651
|
-
}
|
|
1652
|
-
/**
|
|
1653
|
-
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
1654
|
-
* resolves when the animation finishes at all but in a future update could/should
|
|
1655
|
-
* reject if its cancels.
|
|
1656
|
-
*/
|
|
1657
|
-
then(e, n) {
|
|
1658
|
-
return this.currentFinishedPromise.then(e, n);
|
|
1659
|
-
}
|
|
1660
|
-
flatten() {
|
|
1661
|
-
this.options.type = "keyframes", this.options.ease = "linear";
|
|
1662
|
-
}
|
|
1663
|
-
updateFinishedPromise() {
|
|
1664
|
-
this.currentFinishedPromise = new Promise((e) => {
|
|
1665
|
-
this.resolveFinishedPromise = e;
|
|
1666
|
-
});
|
|
1667
|
-
}
|
|
1668
|
-
}
|
|
1669
|
-
const M = (t, e, n) => t + (e - t) * n;
|
|
1670
|
-
function Pe(t, e, n) {
|
|
1671
|
-
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t;
|
|
1672
|
-
}
|
|
1673
|
-
function Oa({ hue: t, saturation: e, lightness: n, alpha: s }) {
|
|
1674
|
-
t /= 360, e /= 100, n /= 100;
|
|
1675
|
-
let i = 0, r = 0, o = 0;
|
|
1676
|
-
if (!e)
|
|
1677
|
-
i = r = o = n;
|
|
1678
|
-
else {
|
|
1679
|
-
const a = n < 0.5 ? n * (1 + e) : n + e - n * e, l = 2 * n - a;
|
|
1680
|
-
i = Pe(l, a, t + 1 / 3), r = Pe(l, a, t), o = Pe(l, a, t - 1 / 3);
|
|
1681
|
-
}
|
|
1682
|
-
return {
|
|
1683
|
-
red: Math.round(i * 255),
|
|
1684
|
-
green: Math.round(r * 255),
|
|
1685
|
-
blue: Math.round(o * 255),
|
|
1686
|
-
alpha: s
|
|
1687
|
-
};
|
|
1688
|
-
}
|
|
1689
|
-
function ie(t, e) {
|
|
1690
|
-
return (n) => n > 0 ? e : t;
|
|
1691
|
-
}
|
|
1692
|
-
const Ae = (t, e, n) => {
|
|
1693
|
-
const s = t * t, i = n * (e * e - s) + s;
|
|
1694
|
-
return i < 0 ? 0 : Math.sqrt(i);
|
|
1695
|
-
}, ja = [ke, ot, dt], Ia = (t) => ja.find((e) => e.test(t));
|
|
1696
|
-
function Jn(t) {
|
|
1697
|
-
const e = Ia(t);
|
|
1698
|
-
if (Ut(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
1699
|
-
return !1;
|
|
1700
|
-
let n = e.parse(t);
|
|
1701
|
-
return e === dt && (n = Oa(n)), n;
|
|
1702
|
-
}
|
|
1703
|
-
const Qn = (t, e) => {
|
|
1704
|
-
const n = Jn(t), s = Jn(e);
|
|
1705
|
-
if (!n || !s)
|
|
1706
|
-
return ie(t, e);
|
|
1707
|
-
const i = { ...n };
|
|
1708
|
-
return (r) => (i.red = Ae(n.red, s.red, r), i.green = Ae(n.green, s.green, r), i.blue = Ae(n.blue, s.blue, r), i.alpha = M(n.alpha, s.alpha, r), ot.transform(i));
|
|
1709
|
-
}, Na = (t, e) => (n) => e(t(n)), Gt = (...t) => t.reduce(Na), Ne = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
1710
|
-
function Ua(t, e) {
|
|
1711
|
-
return Ne.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
|
|
1712
|
-
}
|
|
1713
|
-
function _a(t, e) {
|
|
1714
|
-
return (n) => M(t, e, n);
|
|
1715
|
-
}
|
|
1716
|
-
function bn(t) {
|
|
1717
|
-
return typeof t == "number" ? _a : typeof t == "string" ? ln(t) ? ie : I.test(t) ? Qn : Wa : Array.isArray(t) ? Xi : typeof t == "object" ? I.test(t) ? Qn : Ka : ie;
|
|
1718
|
-
}
|
|
1719
|
-
function Xi(t, e) {
|
|
1720
|
-
const n = [...t], s = n.length, i = t.map((r, o) => bn(r)(r, e[o]));
|
|
1721
|
-
return (r) => {
|
|
1722
|
-
for (let o = 0; o < s; o++)
|
|
1723
|
-
n[o] = i[o](r);
|
|
1724
|
-
return n;
|
|
1725
|
-
};
|
|
1726
|
-
}
|
|
1727
|
-
function Ka(t, e) {
|
|
1728
|
-
const n = { ...t, ...e }, s = {};
|
|
1729
|
-
for (const i in n)
|
|
1730
|
-
t[i] !== void 0 && e[i] !== void 0 && (s[i] = bn(t[i])(t[i], e[i]));
|
|
1731
|
-
return (i) => {
|
|
1732
|
-
for (const r in s)
|
|
1733
|
-
n[r] = s[r](i);
|
|
1734
|
-
return n;
|
|
1735
|
-
};
|
|
1736
|
-
}
|
|
1737
|
-
function $a(t, e) {
|
|
1738
|
-
var n;
|
|
1739
|
-
const s = [], i = { color: 0, var: 0, number: 0 };
|
|
1740
|
-
for (let r = 0; r < e.values.length; r++) {
|
|
1741
|
-
const o = e.types[r], a = t.indexes[o][i[o]], l = (n = t.values[a]) !== null && n !== void 0 ? n : 0;
|
|
1742
|
-
s[r] = l, i[o]++;
|
|
1743
|
-
}
|
|
1744
|
-
return s;
|
|
1745
|
-
}
|
|
1746
|
-
const Wa = (t, e) => {
|
|
1747
|
-
const n = Q.createTransformer(e), s = It(t), i = It(e);
|
|
1748
|
-
return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? Ne.has(t) && !i.values.length || Ne.has(e) && !s.values.length ? Ua(t, e) : Gt(Xi($a(s, i), i.values), n) : (Ut(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), ie(t, e));
|
|
1749
|
-
};
|
|
1750
|
-
function qi(t, e, n) {
|
|
1751
|
-
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? M(t, e, n) : bn(t)(t, e);
|
|
1752
|
-
}
|
|
1753
|
-
const Ga = 5;
|
|
1754
|
-
function Zi(t, e, n) {
|
|
1755
|
-
const s = Math.max(e - Ga, 0);
|
|
1756
|
-
return bi(n - t(s), e - s);
|
|
1757
|
-
}
|
|
1758
|
-
const R = {
|
|
1759
|
-
// Default spring physics
|
|
1760
|
-
stiffness: 100,
|
|
1761
|
-
damping: 10,
|
|
1762
|
-
mass: 1,
|
|
1763
|
-
velocity: 0,
|
|
1764
|
-
// Default duration/bounce-based options
|
|
1765
|
-
duration: 800,
|
|
1766
|
-
// in ms
|
|
1767
|
-
bounce: 0.3,
|
|
1768
|
-
visualDuration: 0.3,
|
|
1769
|
-
// in seconds
|
|
1770
|
-
// Rest thresholds
|
|
1771
|
-
restSpeed: {
|
|
1772
|
-
granular: 0.01,
|
|
1773
|
-
default: 2
|
|
1774
|
-
},
|
|
1775
|
-
restDelta: {
|
|
1776
|
-
granular: 5e-3,
|
|
1777
|
-
default: 0.5
|
|
1778
|
-
},
|
|
1779
|
-
// Limits
|
|
1780
|
-
minDuration: 0.01,
|
|
1781
|
-
// in seconds
|
|
1782
|
-
maxDuration: 10,
|
|
1783
|
-
// in seconds
|
|
1784
|
-
minDamping: 0.05,
|
|
1785
|
-
maxDamping: 1
|
|
1786
|
-
}, be = 1e-3;
|
|
1787
|
-
function za({ duration: t = R.duration, bounce: e = R.bounce, velocity: n = R.velocity, mass: s = R.mass }) {
|
|
1788
|
-
let i, r;
|
|
1789
|
-
Ut(t <= $(R.maxDuration), "Spring duration must be 10 seconds or less");
|
|
1790
|
-
let o = 1 - e;
|
|
1791
|
-
o = Z(R.minDamping, R.maxDamping, o), t = Z(R.minDuration, R.maxDuration, X(t)), o < 1 ? (i = (u) => {
|
|
1792
|
-
const c = u * o, h = c * t, f = c - n, d = Ue(u, o), p = Math.exp(-h);
|
|
1793
|
-
return be - f / d * p;
|
|
1794
|
-
}, r = (u) => {
|
|
1795
|
-
const h = u * o * t, f = h * n + n, d = Math.pow(o, 2) * Math.pow(u, 2) * t, p = Math.exp(-h), m = Ue(Math.pow(u, 2), o);
|
|
1796
|
-
return (-i(u) + be > 0 ? -1 : 1) * ((f - d) * p) / m;
|
|
1797
|
-
}) : (i = (u) => {
|
|
1798
|
-
const c = Math.exp(-u * t), h = (u - n) * t + 1;
|
|
1799
|
-
return -be + c * h;
|
|
1800
|
-
}, r = (u) => {
|
|
1801
|
-
const c = Math.exp(-u * t), h = (n - u) * (t * t);
|
|
1802
|
-
return c * h;
|
|
1803
|
-
});
|
|
1804
|
-
const a = 5 / t, l = Ya(i, r, a);
|
|
1805
|
-
if (t = $(t), isNaN(l))
|
|
1806
|
-
return {
|
|
1807
|
-
stiffness: R.stiffness,
|
|
1808
|
-
damping: R.damping,
|
|
1809
|
-
duration: t
|
|
1810
|
-
};
|
|
1811
|
-
{
|
|
1812
|
-
const u = Math.pow(l, 2) * s;
|
|
1813
|
-
return {
|
|
1814
|
-
stiffness: u,
|
|
1815
|
-
damping: o * 2 * Math.sqrt(s * u),
|
|
1816
|
-
duration: t
|
|
1817
|
-
};
|
|
1818
|
-
}
|
|
1819
|
-
}
|
|
1820
|
-
const Ha = 12;
|
|
1821
|
-
function Ya(t, e, n) {
|
|
1822
|
-
let s = n;
|
|
1823
|
-
for (let i = 1; i < Ha; i++)
|
|
1824
|
-
s = s - t(s) / e(s);
|
|
1825
|
-
return s;
|
|
1826
|
-
}
|
|
1827
|
-
function Ue(t, e) {
|
|
1828
|
-
return t * Math.sqrt(1 - e * e);
|
|
1829
|
-
}
|
|
1830
|
-
const Xa = ["duration", "bounce"], qa = ["stiffness", "damping", "mass"];
|
|
1831
|
-
function ts(t, e) {
|
|
1832
|
-
return e.some((n) => t[n] !== void 0);
|
|
1833
|
-
}
|
|
1834
|
-
function Za(t) {
|
|
1835
|
-
let e = {
|
|
1836
|
-
velocity: R.velocity,
|
|
1837
|
-
stiffness: R.stiffness,
|
|
1838
|
-
damping: R.damping,
|
|
1839
|
-
mass: R.mass,
|
|
1840
|
-
isResolvedFromDuration: !1,
|
|
1841
|
-
...t
|
|
1842
|
-
};
|
|
1843
|
-
if (!ts(t, qa) && ts(t, Xa))
|
|
1844
|
-
if (t.visualDuration) {
|
|
1845
|
-
const n = t.visualDuration, s = 2 * Math.PI / (n * 1.2), i = s * s, r = 2 * Z(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(i);
|
|
1846
|
-
e = {
|
|
1847
|
-
...e,
|
|
1848
|
-
mass: R.mass,
|
|
1849
|
-
stiffness: i,
|
|
1850
|
-
damping: r
|
|
1851
|
-
};
|
|
1852
|
-
} else {
|
|
1853
|
-
const n = za(t);
|
|
1854
|
-
e = {
|
|
1855
|
-
...e,
|
|
1856
|
-
...n,
|
|
1857
|
-
mass: R.mass
|
|
1858
|
-
}, e.isResolvedFromDuration = !0;
|
|
1859
|
-
}
|
|
1860
|
-
return e;
|
|
1861
|
-
}
|
|
1862
|
-
function Vn(t = R.visualDuration, e = R.bounce) {
|
|
1863
|
-
const n = typeof t != "object" ? {
|
|
1864
|
-
visualDuration: t,
|
|
1865
|
-
keyframes: [0, 1],
|
|
1866
|
-
bounce: e
|
|
1867
|
-
} : t;
|
|
1868
|
-
let { restSpeed: s, restDelta: i } = n;
|
|
1869
|
-
const r = n.keyframes[0], o = n.keyframes[n.keyframes.length - 1], a = { done: !1, value: r }, { stiffness: l, damping: u, mass: c, duration: h, velocity: f, isResolvedFromDuration: d } = Za({
|
|
1870
|
-
...n,
|
|
1871
|
-
velocity: -X(n.velocity || 0)
|
|
1872
|
-
}), p = f || 0, m = u / (2 * Math.sqrt(l * c)), y = o - r, g = X(Math.sqrt(l / c)), v = Math.abs(y) < 5;
|
|
1873
|
-
s || (s = v ? R.restSpeed.granular : R.restSpeed.default), i || (i = v ? R.restDelta.granular : R.restDelta.default);
|
|
1874
|
-
let T;
|
|
1875
|
-
if (m < 1) {
|
|
1876
|
-
const x = Ue(g, m);
|
|
1877
|
-
T = (b) => {
|
|
1878
|
-
const w = Math.exp(-m * g * b);
|
|
1879
|
-
return o - w * ((p + m * g * y) / x * Math.sin(x * b) + y * Math.cos(x * b));
|
|
1880
|
-
};
|
|
1881
|
-
} else if (m === 1)
|
|
1882
|
-
T = (x) => o - Math.exp(-g * x) * (y + (p + g * y) * x);
|
|
1883
|
-
else {
|
|
1884
|
-
const x = g * Math.sqrt(m * m - 1);
|
|
1885
|
-
T = (b) => {
|
|
1886
|
-
const w = Math.exp(-m * g * b), A = Math.min(x * b, 300);
|
|
1887
|
-
return o - w * ((p + m * g * y) * Math.sinh(A) + x * y * Math.cosh(A)) / x;
|
|
1888
|
-
};
|
|
1889
|
-
}
|
|
1890
|
-
const P = {
|
|
1891
|
-
calculatedDuration: d && h || null,
|
|
1892
|
-
next: (x) => {
|
|
1893
|
-
const b = T(x);
|
|
1894
|
-
if (d)
|
|
1895
|
-
a.done = x >= h;
|
|
1896
|
-
else {
|
|
1897
|
-
let w = 0;
|
|
1898
|
-
m < 1 && (w = x === 0 ? $(p) : Zi(T, x, b));
|
|
1899
|
-
const A = Math.abs(w) <= s, V = Math.abs(o - b) <= i;
|
|
1900
|
-
a.done = A && V;
|
|
1901
|
-
}
|
|
1902
|
-
return a.value = a.done ? o : b, a;
|
|
1903
|
-
},
|
|
1904
|
-
toString: () => {
|
|
1905
|
-
const x = Math.min(Qs(P), jo), b = Io((w) => P.next(x * w).value, x, 30);
|
|
1906
|
-
return x + "ms " + b;
|
|
1907
|
-
}
|
|
1908
|
-
};
|
|
1909
|
-
return P;
|
|
1910
|
-
}
|
|
1911
|
-
function es({ keyframes: t, velocity: e = 0, power: n = 0.8, timeConstant: s = 325, bounceDamping: i = 10, bounceStiffness: r = 500, modifyTarget: o, min: a, max: l, restDelta: u = 0.5, restSpeed: c }) {
|
|
1912
|
-
const h = t[0], f = {
|
|
1913
|
-
done: !1,
|
|
1914
|
-
value: h
|
|
1915
|
-
}, d = (A) => a !== void 0 && A < a || l !== void 0 && A > l, p = (A) => a === void 0 ? l : l === void 0 || Math.abs(a - A) < Math.abs(l - A) ? a : l;
|
|
1916
|
-
let m = n * e;
|
|
1917
|
-
const y = h + m, g = o === void 0 ? y : o(y);
|
|
1918
|
-
g !== y && (m = g - h);
|
|
1919
|
-
const v = (A) => -m * Math.exp(-A / s), T = (A) => g + v(A), P = (A) => {
|
|
1920
|
-
const V = v(A), O = T(A);
|
|
1921
|
-
f.done = Math.abs(V) <= u, f.value = f.done ? g : O;
|
|
1922
|
-
};
|
|
1923
|
-
let x, b;
|
|
1924
|
-
const w = (A) => {
|
|
1925
|
-
d(f.value) && (x = A, b = Vn({
|
|
1926
|
-
keyframes: [f.value, p(f.value)],
|
|
1927
|
-
velocity: Zi(T, A, f.value),
|
|
1928
|
-
// TODO: This should be passing * 1000
|
|
1929
|
-
damping: i,
|
|
1930
|
-
stiffness: r,
|
|
1931
|
-
restDelta: u,
|
|
1932
|
-
restSpeed: c
|
|
1933
|
-
}));
|
|
1934
|
-
};
|
|
1935
|
-
return w(0), {
|
|
1936
|
-
calculatedDuration: null,
|
|
1937
|
-
next: (A) => {
|
|
1938
|
-
let V = !1;
|
|
1939
|
-
return !b && x === void 0 && (V = !0, P(A), w(A)), x !== void 0 && A >= x ? b.next(A - x) : (!V && P(A), f);
|
|
1940
|
-
}
|
|
1941
|
-
};
|
|
1942
|
-
}
|
|
1943
|
-
const Ja = /* @__PURE__ */ Wt(0.42, 0, 1, 1), Qa = /* @__PURE__ */ Wt(0, 0, 0.58, 1), Ji = /* @__PURE__ */ Wt(0.42, 0, 0.58, 1), Qi = (t) => Array.isArray(t) && typeof t[0] != "number", ns = {
|
|
1944
|
-
linear: K,
|
|
1945
|
-
easeIn: Ja,
|
|
1946
|
-
easeInOut: Ji,
|
|
1947
|
-
easeOut: Qa,
|
|
1948
|
-
circIn: xn,
|
|
1949
|
-
circInOut: Fi,
|
|
1950
|
-
circOut: Li,
|
|
1951
|
-
backIn: vn,
|
|
1952
|
-
backInOut: Ri,
|
|
1953
|
-
backOut: Mi,
|
|
1954
|
-
anticipate: Ei
|
|
1955
|
-
}, ss = (t) => {
|
|
1956
|
-
if (No(t)) {
|
|
1957
|
-
G(t.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
1958
|
-
const [e, n, s, i] = t;
|
|
1959
|
-
return Wt(e, n, s, i);
|
|
1960
|
-
} else if (typeof t == "string")
|
|
1961
|
-
return G(ns[t] !== void 0, `Invalid easing type '${t}'`), ns[t];
|
|
1962
|
-
return t;
|
|
1963
|
-
};
|
|
1964
|
-
function tl(t, e, n) {
|
|
1965
|
-
const s = [], i = n || qi, r = t.length - 1;
|
|
1966
|
-
for (let o = 0; o < r; o++) {
|
|
1967
|
-
let a = i(t[o], t[o + 1]);
|
|
1968
|
-
if (e) {
|
|
1969
|
-
const l = Array.isArray(e) ? e[o] || K : e;
|
|
1970
|
-
a = Gt(l, a);
|
|
1971
|
-
}
|
|
1972
|
-
s.push(a);
|
|
1973
|
-
}
|
|
1974
|
-
return s;
|
|
1975
|
-
}
|
|
1976
|
-
function to(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
|
|
1977
|
-
const r = t.length;
|
|
1978
|
-
if (G(r === e.length, "Both input and output ranges must be the same length"), r === 1)
|
|
1979
|
-
return () => e[0];
|
|
1980
|
-
if (r === 2 && e[0] === e[1])
|
|
1981
|
-
return () => e[1];
|
|
1982
|
-
const o = t[0] === t[1];
|
|
1983
|
-
t[0] > t[r - 1] && (t = [...t].reverse(), e = [...e].reverse());
|
|
1984
|
-
const a = tl(e, s, i), l = a.length, u = (c) => {
|
|
1985
|
-
if (o && c < t[0])
|
|
1986
|
-
return e[0];
|
|
1987
|
-
let h = 0;
|
|
1988
|
-
if (l > 1)
|
|
1989
|
-
for (; h < t.length - 2 && !(c < t[h + 1]); h++)
|
|
1990
|
-
;
|
|
1991
|
-
const f = yt(t[h], t[h + 1], c);
|
|
1992
|
-
return a[h](f);
|
|
1993
|
-
};
|
|
1994
|
-
return n ? (c) => u(Z(t[0], t[r - 1], c)) : u;
|
|
1995
|
-
}
|
|
1996
|
-
function eo(t, e) {
|
|
1997
|
-
const n = t[t.length - 1];
|
|
1998
|
-
for (let s = 1; s <= e; s++) {
|
|
1999
|
-
const i = yt(0, e, s);
|
|
2000
|
-
t.push(M(n, 1, i));
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
|
-
function no(t) {
|
|
2004
|
-
const e = [0];
|
|
2005
|
-
return eo(e, t.length - 1), e;
|
|
2006
|
-
}
|
|
2007
|
-
function el(t, e) {
|
|
2008
|
-
return t.map((n) => n * e);
|
|
2009
|
-
}
|
|
2010
|
-
function nl(t, e) {
|
|
2011
|
-
return t.map(() => e || Ji).splice(0, t.length - 1);
|
|
2012
|
-
}
|
|
2013
|
-
function oe({ duration: t = 300, keyframes: e, times: n, ease: s = "easeInOut" }) {
|
|
2014
|
-
const i = Qi(s) ? s.map(ss) : ss(s), r = {
|
|
2015
|
-
done: !1,
|
|
2016
|
-
value: e[0]
|
|
2017
|
-
}, o = el(
|
|
2018
|
-
// Only use the provided offsets if they're the correct length
|
|
2019
|
-
// TODO Maybe we should warn here if there's a length mismatch
|
|
2020
|
-
n && n.length === e.length ? n : no(e),
|
|
2021
|
-
t
|
|
2022
|
-
), a = to(o, e, {
|
|
2023
|
-
ease: Array.isArray(i) ? i : nl(e, i)
|
|
2024
|
-
});
|
|
2025
|
-
return {
|
|
2026
|
-
calculatedDuration: t,
|
|
2027
|
-
next: (l) => (r.value = a(l), r.done = l >= t, r)
|
|
2028
|
-
};
|
|
2029
|
-
}
|
|
2030
|
-
const sl = (t) => {
|
|
2031
|
-
const e = ({ timestamp: n }) => t(n);
|
|
2032
|
-
return {
|
|
2033
|
-
start: () => D.update(e, !0),
|
|
2034
|
-
stop: () => q(e),
|
|
2035
|
-
/**
|
|
2036
|
-
* If we're processing this frame we can use the
|
|
2037
|
-
* framelocked timestamp to keep things in sync.
|
|
2038
|
-
*/
|
|
2039
|
-
now: () => B.isProcessing ? B.timestamp : H.now()
|
|
2040
|
-
};
|
|
2041
|
-
}, il = {
|
|
2042
|
-
decay: es,
|
|
2043
|
-
inertia: es,
|
|
2044
|
-
tween: oe,
|
|
2045
|
-
keyframes: oe,
|
|
2046
|
-
spring: Vn
|
|
2047
|
-
}, ol = (t) => t / 100;
|
|
2048
|
-
class ve extends Yi {
|
|
2049
|
-
constructor(e) {
|
|
2050
|
-
super(e), this.holdTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.startTime = null, this.state = "idle", this.stop = () => {
|
|
2051
|
-
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
2052
|
-
return;
|
|
2053
|
-
this.teardown();
|
|
2054
|
-
const { onStop: l } = this.options;
|
|
2055
|
-
l && l();
|
|
2056
|
-
};
|
|
2057
|
-
const { name: n, motionValue: s, element: i, keyframes: r } = this.options, o = i?.KeyframeResolver || An, a = (l, u) => this.onKeyframesResolved(l, u);
|
|
2058
|
-
this.resolver = new o(r, a, n, s, i), this.resolver.scheduleResolve();
|
|
2059
|
-
}
|
|
2060
|
-
flatten() {
|
|
2061
|
-
super.flatten(), this._resolved && Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));
|
|
2062
|
-
}
|
|
2063
|
-
initPlayback(e) {
|
|
2064
|
-
const { type: n = "keyframes", repeat: s = 0, repeatDelay: i = 0, repeatType: r, velocity: o = 0 } = this.options, a = le(n) ? n : il[n] || oe;
|
|
2065
|
-
let l, u;
|
|
2066
|
-
a !== oe && typeof e[0] != "number" && (process.env.NODE_ENV !== "production" && G(e.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`), l = Gt(ol, qi(e[0], e[1])), e = [0, 100]);
|
|
2067
|
-
const c = a({ ...this.options, keyframes: e });
|
|
2068
|
-
r === "mirror" && (u = a({
|
|
2069
|
-
...this.options,
|
|
2070
|
-
keyframes: [...e].reverse(),
|
|
2071
|
-
velocity: -o
|
|
2072
|
-
})), c.calculatedDuration === null && (c.calculatedDuration = Qs(c));
|
|
2073
|
-
const { calculatedDuration: h } = c, f = h + i, d = f * (s + 1) - i;
|
|
2074
|
-
return {
|
|
2075
|
-
generator: c,
|
|
2076
|
-
mirroredGenerator: u,
|
|
2077
|
-
mapPercentToKeyframes: l,
|
|
2078
|
-
calculatedDuration: h,
|
|
2079
|
-
resolvedDuration: f,
|
|
2080
|
-
totalDuration: d
|
|
2081
|
-
};
|
|
2082
|
-
}
|
|
2083
|
-
onPostResolved() {
|
|
2084
|
-
const { autoplay: e = !0 } = this.options;
|
|
2085
|
-
this.play(), this.pendingPlayState === "paused" || !e ? this.pause() : this.state = this.pendingPlayState;
|
|
2086
|
-
}
|
|
2087
|
-
tick(e, n = !1) {
|
|
2088
|
-
const { resolved: s } = this;
|
|
2089
|
-
if (!s) {
|
|
2090
|
-
const { keyframes: A } = this.options;
|
|
2091
|
-
return { done: !0, value: A[A.length - 1] };
|
|
2092
|
-
}
|
|
2093
|
-
const { finalKeyframe: i, generator: r, mirroredGenerator: o, mapPercentToKeyframes: a, keyframes: l, calculatedDuration: u, totalDuration: c, resolvedDuration: h } = s;
|
|
2094
|
-
if (this.startTime === null)
|
|
2095
|
-
return r.next(0);
|
|
2096
|
-
const { delay: f, repeat: d, repeatType: p, repeatDelay: m, onUpdate: y } = this.options;
|
|
2097
|
-
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - c / this.speed, this.startTime)), n ? this.currentTime = e : this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = Math.round(e - this.startTime) * this.speed;
|
|
2098
|
-
const g = this.currentTime - f * (this.speed >= 0 ? 1 : -1), v = this.speed >= 0 ? g < 0 : g > c;
|
|
2099
|
-
this.currentTime = Math.max(g, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = c);
|
|
2100
|
-
let T = this.currentTime, P = r;
|
|
2101
|
-
if (d) {
|
|
2102
|
-
const A = Math.min(this.currentTime, c) / h;
|
|
2103
|
-
let V = Math.floor(A), O = A % 1;
|
|
2104
|
-
!O && A >= 1 && (O = 1), O === 1 && V--, V = Math.min(V, d + 1), !!(V % 2) && (p === "reverse" ? (O = 1 - O, m && (O -= m / h)) : p === "mirror" && (P = o)), T = Z(0, 1, O) * h;
|
|
2105
|
-
}
|
|
2106
|
-
const x = v ? { done: !1, value: l[0] } : P.next(T);
|
|
2107
|
-
a && (x.value = a(x.value));
|
|
2108
|
-
let { done: b } = x;
|
|
2109
|
-
!v && u !== null && (b = this.speed >= 0 ? this.currentTime >= c : this.currentTime <= 0);
|
|
2110
|
-
const w = this.holdTime === null && (this.state === "finished" || this.state === "running" && b);
|
|
2111
|
-
return w && i !== void 0 && (x.value = ye(l, this.options, i)), y && y(x.value), w && this.finish(), x;
|
|
2112
|
-
}
|
|
2113
|
-
get duration() {
|
|
2114
|
-
const { resolved: e } = this;
|
|
2115
|
-
return e ? X(e.calculatedDuration) : 0;
|
|
2116
|
-
}
|
|
2117
|
-
get time() {
|
|
2118
|
-
return X(this.currentTime);
|
|
2119
|
-
}
|
|
2120
|
-
set time(e) {
|
|
2121
|
-
e = $(e), this.currentTime = e, this.holdTime !== null || this.speed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.speed);
|
|
2122
|
-
}
|
|
2123
|
-
get speed() {
|
|
2124
|
-
return this.playbackSpeed;
|
|
2125
|
-
}
|
|
2126
|
-
set speed(e) {
|
|
2127
|
-
const n = this.playbackSpeed !== e;
|
|
2128
|
-
this.playbackSpeed = e, n && (this.time = X(this.currentTime));
|
|
2129
|
-
}
|
|
2130
|
-
play() {
|
|
2131
|
-
if (this.resolver.isScheduled || this.resolver.resume(), !this._resolved) {
|
|
2132
|
-
this.pendingPlayState = "running";
|
|
2133
|
-
return;
|
|
2134
|
-
}
|
|
2135
|
-
if (this.isStopped)
|
|
2136
|
-
return;
|
|
2137
|
-
const { driver: e = sl, onPlay: n, startTime: s } = this.options;
|
|
2138
|
-
this.driver || (this.driver = e((r) => this.tick(r))), n && n();
|
|
2139
|
-
const i = this.driver.now();
|
|
2140
|
-
this.holdTime !== null ? this.startTime = i - this.holdTime : this.startTime ? this.state === "finished" && (this.startTime = i) : this.startTime = s ?? this.calcStartTime(), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
|
|
2141
|
-
}
|
|
2142
|
-
pause() {
|
|
2143
|
-
var e;
|
|
2144
|
-
if (!this._resolved) {
|
|
2145
|
-
this.pendingPlayState = "paused";
|
|
2146
|
-
return;
|
|
2147
|
-
}
|
|
2148
|
-
this.state = "paused", this.holdTime = (e = this.currentTime) !== null && e !== void 0 ? e : 0;
|
|
2149
|
-
}
|
|
2150
|
-
complete() {
|
|
2151
|
-
this.state !== "running" && this.play(), this.pendingPlayState = this.state = "finished", this.holdTime = null;
|
|
2152
|
-
}
|
|
2153
|
-
finish() {
|
|
2154
|
-
this.teardown(), this.state = "finished";
|
|
2155
|
-
const { onComplete: e } = this.options;
|
|
2156
|
-
e && e();
|
|
2157
|
-
}
|
|
2158
|
-
cancel() {
|
|
2159
|
-
this.cancelTime !== null && this.tick(this.cancelTime), this.teardown(), this.updateFinishedPromise();
|
|
2160
|
-
}
|
|
2161
|
-
teardown() {
|
|
2162
|
-
this.state = "idle", this.stopDriver(), this.resolveFinishedPromise(), this.updateFinishedPromise(), this.startTime = this.cancelTime = null, this.resolver.cancel();
|
|
2163
|
-
}
|
|
2164
|
-
stopDriver() {
|
|
2165
|
-
this.driver && (this.driver.stop(), this.driver = void 0);
|
|
2166
|
-
}
|
|
2167
|
-
sample(e) {
|
|
2168
|
-
return this.startTime = 0, this.tick(e, !0);
|
|
2169
|
-
}
|
|
2170
|
-
}
|
|
2171
|
-
function rl(t) {
|
|
2172
|
-
return new ve(t);
|
|
2173
|
-
}
|
|
2174
|
-
const al = /* @__PURE__ */ new Set([
|
|
2175
|
-
"opacity",
|
|
2176
|
-
"clipPath",
|
|
2177
|
-
"filter",
|
|
2178
|
-
"transform"
|
|
2179
|
-
// TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
|
|
2180
|
-
// or until we implement support for linear() easing.
|
|
2181
|
-
// "background-color"
|
|
2182
|
-
]);
|
|
2183
|
-
function ll(t, e, n, { delay: s = 0, duration: i = 300, repeat: r = 0, repeatType: o = "loop", ease: a = "easeInOut", times: l } = {}) {
|
|
2184
|
-
const u = { [e]: n };
|
|
2185
|
-
l && (u.offset = l);
|
|
2186
|
-
const c = Uo(a, i);
|
|
2187
|
-
return Array.isArray(c) && (u.easing = c), t.animate(u, {
|
|
2188
|
-
delay: s,
|
|
2189
|
-
duration: i,
|
|
2190
|
-
easing: Array.isArray(c) ? "linear" : c,
|
|
2191
|
-
fill: "both",
|
|
2192
|
-
iterations: r + 1,
|
|
2193
|
-
direction: o === "reverse" ? "alternate" : "normal"
|
|
2194
|
-
});
|
|
2195
|
-
}
|
|
2196
|
-
const ul = /* @__PURE__ */ _o(() => Object.hasOwnProperty.call(Element.prototype, "animate")), re = 10, cl = 2e4;
|
|
2197
|
-
function hl(t) {
|
|
2198
|
-
return le(t.type) || t.type === "spring" || !$o(t.ease);
|
|
2199
|
-
}
|
|
2200
|
-
function fl(t, e) {
|
|
2201
|
-
const n = new ve({
|
|
2202
|
-
...e,
|
|
2203
|
-
keyframes: t,
|
|
2204
|
-
repeat: 0,
|
|
2205
|
-
delay: 0,
|
|
2206
|
-
isGenerator: !0
|
|
2207
|
-
});
|
|
2208
|
-
let s = { done: !1, value: t[0] };
|
|
2209
|
-
const i = [];
|
|
2210
|
-
let r = 0;
|
|
2211
|
-
for (; !s.done && r < cl; )
|
|
2212
|
-
s = n.sample(r), i.push(s.value), r += re;
|
|
2213
|
-
return {
|
|
2214
|
-
times: void 0,
|
|
2215
|
-
keyframes: i,
|
|
2216
|
-
duration: r - re,
|
|
2217
|
-
ease: "linear"
|
|
2218
|
-
};
|
|
2219
|
-
}
|
|
2220
|
-
const so = {
|
|
2221
|
-
anticipate: Ei,
|
|
2222
|
-
backInOut: Ri,
|
|
2223
|
-
circInOut: Fi
|
|
2224
|
-
};
|
|
2225
|
-
function dl(t) {
|
|
2226
|
-
return t in so;
|
|
2227
|
-
}
|
|
2228
|
-
class is extends Yi {
|
|
2229
|
-
constructor(e) {
|
|
2230
|
-
super(e);
|
|
2231
|
-
const { name: n, motionValue: s, element: i, keyframes: r } = this.options;
|
|
2232
|
-
this.resolver = new Hi(r, (o, a) => this.onKeyframesResolved(o, a), n, s, i), this.resolver.scheduleResolve();
|
|
2233
|
-
}
|
|
2234
|
-
initPlayback(e, n) {
|
|
2235
|
-
let { duration: s = 300, times: i, ease: r, type: o, motionValue: a, name: l, startTime: u } = this.options;
|
|
2236
|
-
if (!a.owner || !a.owner.current)
|
|
2237
|
-
return !1;
|
|
2238
|
-
if (typeof r == "string" && Ko() && dl(r) && (r = so[r]), hl(this.options)) {
|
|
2239
|
-
const { onComplete: h, onUpdate: f, motionValue: d, element: p, ...m } = this.options, y = fl(e, m);
|
|
2240
|
-
e = y.keyframes, e.length === 1 && (e[1] = e[0]), s = y.duration, i = y.times, r = y.ease, o = "keyframes";
|
|
2241
|
-
}
|
|
2242
|
-
const c = ll(a.owner.current, l, e, { ...this.options, duration: s, times: i, ease: r });
|
|
2243
|
-
return c.startTime = u ?? this.calcStartTime(), this.pendingTimeline ? (kn(c, this.pendingTimeline), this.pendingTimeline = void 0) : c.onfinish = () => {
|
|
2244
|
-
const { onComplete: h } = this.options;
|
|
2245
|
-
a.set(ye(e, this.options, n)), h && h(), this.cancel(), this.resolveFinishedPromise();
|
|
2246
|
-
}, {
|
|
2247
|
-
animation: c,
|
|
2248
|
-
duration: s,
|
|
2249
|
-
times: i,
|
|
2250
|
-
type: o,
|
|
2251
|
-
ease: r,
|
|
2252
|
-
keyframes: e
|
|
2253
|
-
};
|
|
2254
|
-
}
|
|
2255
|
-
get duration() {
|
|
2256
|
-
const { resolved: e } = this;
|
|
2257
|
-
if (!e)
|
|
2258
|
-
return 0;
|
|
2259
|
-
const { duration: n } = e;
|
|
2260
|
-
return X(n);
|
|
2261
|
-
}
|
|
2262
|
-
get time() {
|
|
2263
|
-
const { resolved: e } = this;
|
|
2264
|
-
if (!e)
|
|
2265
|
-
return 0;
|
|
2266
|
-
const { animation: n } = e;
|
|
2267
|
-
return X(n.currentTime || 0);
|
|
2268
|
-
}
|
|
2269
|
-
set time(e) {
|
|
2270
|
-
const { resolved: n } = this;
|
|
2271
|
-
if (!n)
|
|
2272
|
-
return;
|
|
2273
|
-
const { animation: s } = n;
|
|
2274
|
-
s.currentTime = $(e);
|
|
2275
|
-
}
|
|
2276
|
-
get speed() {
|
|
2277
|
-
const { resolved: e } = this;
|
|
2278
|
-
if (!e)
|
|
2279
|
-
return 1;
|
|
2280
|
-
const { animation: n } = e;
|
|
2281
|
-
return n.playbackRate;
|
|
2282
|
-
}
|
|
2283
|
-
set speed(e) {
|
|
2284
|
-
const { resolved: n } = this;
|
|
2285
|
-
if (!n)
|
|
2286
|
-
return;
|
|
2287
|
-
const { animation: s } = n;
|
|
2288
|
-
s.playbackRate = e;
|
|
2289
|
-
}
|
|
2290
|
-
get state() {
|
|
2291
|
-
const { resolved: e } = this;
|
|
2292
|
-
if (!e)
|
|
2293
|
-
return "idle";
|
|
2294
|
-
const { animation: n } = e;
|
|
2295
|
-
return n.playState;
|
|
2296
|
-
}
|
|
2297
|
-
get startTime() {
|
|
2298
|
-
const { resolved: e } = this;
|
|
2299
|
-
if (!e)
|
|
2300
|
-
return null;
|
|
2301
|
-
const { animation: n } = e;
|
|
2302
|
-
return n.startTime;
|
|
2303
|
-
}
|
|
2304
|
-
/**
|
|
2305
|
-
* Replace the default DocumentTimeline with another AnimationTimeline.
|
|
2306
|
-
* Currently used for scroll animations.
|
|
2307
|
-
*/
|
|
2308
|
-
attachTimeline(e) {
|
|
2309
|
-
if (!this._resolved)
|
|
2310
|
-
this.pendingTimeline = e;
|
|
2311
|
-
else {
|
|
2312
|
-
const { resolved: n } = this;
|
|
2313
|
-
if (!n)
|
|
2314
|
-
return K;
|
|
2315
|
-
const { animation: s } = n;
|
|
2316
|
-
kn(s, e);
|
|
2317
|
-
}
|
|
2318
|
-
return K;
|
|
2319
|
-
}
|
|
2320
|
-
play() {
|
|
2321
|
-
if (this.isStopped)
|
|
2322
|
-
return;
|
|
2323
|
-
const { resolved: e } = this;
|
|
2324
|
-
if (!e)
|
|
2325
|
-
return;
|
|
2326
|
-
const { animation: n } = e;
|
|
2327
|
-
n.playState === "finished" && this.updateFinishedPromise(), n.play();
|
|
2328
|
-
}
|
|
2329
|
-
pause() {
|
|
2330
|
-
const { resolved: e } = this;
|
|
2331
|
-
if (!e)
|
|
2332
|
-
return;
|
|
2333
|
-
const { animation: n } = e;
|
|
2334
|
-
n.pause();
|
|
2335
|
-
}
|
|
2336
|
-
stop() {
|
|
2337
|
-
if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
|
|
2338
|
-
return;
|
|
2339
|
-
this.resolveFinishedPromise(), this.updateFinishedPromise();
|
|
2340
|
-
const { resolved: e } = this;
|
|
2341
|
-
if (!e)
|
|
2342
|
-
return;
|
|
2343
|
-
const { animation: n, keyframes: s, duration: i, type: r, ease: o, times: a } = e;
|
|
2344
|
-
if (n.playState === "idle" || n.playState === "finished")
|
|
2345
|
-
return;
|
|
2346
|
-
if (this.time) {
|
|
2347
|
-
const { motionValue: u, onUpdate: c, onComplete: h, element: f, ...d } = this.options, p = new ve({
|
|
2348
|
-
...d,
|
|
2349
|
-
keyframes: s,
|
|
2350
|
-
duration: i,
|
|
2351
|
-
type: r,
|
|
2352
|
-
ease: o,
|
|
2353
|
-
times: a,
|
|
2354
|
-
isGenerator: !0
|
|
2355
|
-
}), m = $(this.time);
|
|
2356
|
-
u.setWithVelocity(p.sample(m - re).value, p.sample(m).value, re);
|
|
2357
|
-
}
|
|
2358
|
-
const { onStop: l } = this.options;
|
|
2359
|
-
l && l(), this.cancel();
|
|
2360
|
-
}
|
|
2361
|
-
complete() {
|
|
2362
|
-
const { resolved: e } = this;
|
|
2363
|
-
e && e.animation.finish();
|
|
2364
|
-
}
|
|
2365
|
-
cancel() {
|
|
2366
|
-
const { resolved: e } = this;
|
|
2367
|
-
e && e.animation.cancel();
|
|
2368
|
-
}
|
|
2369
|
-
static supports(e) {
|
|
2370
|
-
const { motionValue: n, name: s, repeatDelay: i, repeatType: r, damping: o, type: a } = e;
|
|
2371
|
-
if (!n || !n.owner || !(n.owner.current instanceof HTMLElement))
|
|
2372
|
-
return !1;
|
|
2373
|
-
const { onUpdate: l, transformTemplate: u } = n.owner.getProps();
|
|
2374
|
-
return ul() && s && al.has(s) && /**
|
|
2375
|
-
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
2376
|
-
* no way to read the value from WAAPI every frame.
|
|
2377
|
-
*/
|
|
2378
|
-
!l && !u && !i && r !== "mirror" && o !== 0 && a !== "inertia";
|
|
2379
|
-
}
|
|
2380
|
-
}
|
|
2381
|
-
const pl = {
|
|
2382
|
-
type: "spring",
|
|
2383
|
-
stiffness: 500,
|
|
2384
|
-
damping: 25,
|
|
2385
|
-
restSpeed: 10
|
|
2386
|
-
}, ml = (t) => ({
|
|
2387
|
-
type: "spring",
|
|
2388
|
-
stiffness: 550,
|
|
2389
|
-
damping: t === 0 ? 2 * Math.sqrt(550) : 30,
|
|
2390
|
-
restSpeed: 10
|
|
2391
|
-
}), gl = {
|
|
2392
|
-
type: "keyframes",
|
|
2393
|
-
duration: 0.8
|
|
2394
|
-
}, yl = {
|
|
2395
|
-
type: "keyframes",
|
|
2396
|
-
ease: [0.25, 0.1, 0.35, 1],
|
|
2397
|
-
duration: 0.3
|
|
2398
|
-
}, vl = (t, { keyframes: e }) => e.length > 2 ? gl : lt.has(t) ? t.startsWith("scale") ? ml(e[1]) : pl : yl;
|
|
2399
|
-
function xl({ when: t, delay: e, delayChildren: n, staggerChildren: s, staggerDirection: i, repeat: r, repeatType: o, repeatDelay: a, from: l, elapsed: u, ...c }) {
|
|
2400
|
-
return !!Object.keys(c).length;
|
|
2401
|
-
}
|
|
2402
|
-
const wn = (t, e, n, s = {}, i, r) => (o) => {
|
|
2403
|
-
const a = Ye(s, t) || {}, l = a.delay || s.delay || 0;
|
|
2404
|
-
let { elapsed: u = 0 } = s;
|
|
2405
|
-
u = u - $(l);
|
|
2406
|
-
let c = {
|
|
2407
|
-
keyframes: Array.isArray(n) ? n : [null, n],
|
|
2408
|
-
ease: "easeOut",
|
|
2409
|
-
velocity: e.getVelocity(),
|
|
2410
|
-
...a,
|
|
2411
|
-
delay: -u,
|
|
2412
|
-
onUpdate: (f) => {
|
|
2413
|
-
e.set(f), a.onUpdate && a.onUpdate(f);
|
|
2414
|
-
},
|
|
2415
|
-
onComplete: () => {
|
|
2416
|
-
o(), a.onComplete && a.onComplete();
|
|
2417
|
-
},
|
|
2418
|
-
name: t,
|
|
2419
|
-
motionValue: e,
|
|
2420
|
-
element: r ? void 0 : i
|
|
2421
|
-
};
|
|
2422
|
-
xl(a) || (c = {
|
|
2423
|
-
...c,
|
|
2424
|
-
...vl(t, c)
|
|
2425
|
-
}), c.duration && (c.duration = $(c.duration)), c.repeatDelay && (c.repeatDelay = $(c.repeatDelay)), c.from !== void 0 && (c.keyframes[0] = c.from);
|
|
2426
|
-
let h = !1;
|
|
2427
|
-
if ((c.type === !1 || c.duration === 0 && !c.repeatDelay) && (c.duration = 0, c.delay === 0 && (h = !0)), h && !r && e.get() !== void 0) {
|
|
2428
|
-
const f = ye(c.keyframes, a);
|
|
2429
|
-
if (f !== void 0)
|
|
2430
|
-
return D.update(() => {
|
|
2431
|
-
c.onUpdate(f), c.onComplete();
|
|
2432
|
-
}), new ti([]);
|
|
2433
|
-
}
|
|
2434
|
-
return !r && is.supports(c) ? new is(c) : new ve(c);
|
|
2435
|
-
};
|
|
2436
|
-
function Tl({ protectedKeys: t, needsAnimating: e }, n) {
|
|
2437
|
-
const s = t.hasOwnProperty(n) && e[n] !== !0;
|
|
2438
|
-
return e[n] = !1, s;
|
|
2439
|
-
}
|
|
2440
|
-
function Dn(t, e, { delay: n = 0, transitionOverride: s, type: i } = {}) {
|
|
2441
|
-
var r;
|
|
2442
|
-
let { transition: o = t.getDefaultTransition(), transitionEnd: a, ...l } = e;
|
|
2443
|
-
s && (o = s);
|
|
2444
|
-
const u = [], c = i && t.animationState && t.animationState.getState()[i];
|
|
2445
|
-
for (const h in l) {
|
|
2446
|
-
const f = t.getValue(h, (r = t.latestValues[h]) !== null && r !== void 0 ? r : null), d = l[h];
|
|
2447
|
-
if (d === void 0 || c && Tl(c, h))
|
|
2448
|
-
continue;
|
|
2449
|
-
const p = {
|
|
2450
|
-
delay: n,
|
|
2451
|
-
...Ye(o || {}, h)
|
|
2452
|
-
};
|
|
2453
|
-
let m = !1;
|
|
2454
|
-
if (window.MotionHandoffAnimation) {
|
|
2455
|
-
const g = Vi(t);
|
|
2456
|
-
if (g) {
|
|
2457
|
-
const v = window.MotionHandoffAnimation(g, h, D);
|
|
2458
|
-
v !== null && (p.startTime = v, m = !0);
|
|
2459
|
-
}
|
|
2460
|
-
}
|
|
2461
|
-
Be(t, h), f.start(wn(h, f, d, t.shouldReduceMotion && Ai.has(h) ? { type: !1 } : p, t, m));
|
|
2462
|
-
const y = f.animation;
|
|
2463
|
-
y && u.push(y);
|
|
2464
|
-
}
|
|
2465
|
-
return a && Promise.all(u).then(() => {
|
|
2466
|
-
D.update(() => {
|
|
2467
|
-
a && yn(t, a);
|
|
2468
|
-
});
|
|
2469
|
-
}), u;
|
|
2470
|
-
}
|
|
2471
|
-
function _e(t, e, n = {}) {
|
|
2472
|
-
var s;
|
|
2473
|
-
const i = me(t, e, n.type === "exit" ? (s = t.presenceContext) === null || s === void 0 ? void 0 : s.custom : void 0);
|
|
2474
|
-
let { transition: r = t.getDefaultTransition() || {} } = i || {};
|
|
2475
|
-
n.transitionOverride && (r = n.transitionOverride);
|
|
2476
|
-
const o = i ? () => Promise.all(Dn(t, i, n)) : () => Promise.resolve(), a = t.variantChildren && t.variantChildren.size ? (u = 0) => {
|
|
2477
|
-
const { delayChildren: c = 0, staggerChildren: h, staggerDirection: f } = r;
|
|
2478
|
-
return Sl(t, e, c + u, h, f, n);
|
|
2479
|
-
} : () => Promise.resolve(), { when: l } = r;
|
|
2480
|
-
if (l) {
|
|
2481
|
-
const [u, c] = l === "beforeChildren" ? [o, a] : [a, o];
|
|
2482
|
-
return u().then(() => c());
|
|
2483
|
-
} else
|
|
2484
|
-
return Promise.all([o(), a(n.delay)]);
|
|
2485
|
-
}
|
|
2486
|
-
function Sl(t, e, n = 0, s = 0, i = 1, r) {
|
|
2487
|
-
const o = [], a = (t.variantChildren.size - 1) * s, l = i === 1 ? (u = 0) => u * s : (u = 0) => a - u * s;
|
|
2488
|
-
return Array.from(t.variantChildren).sort(Pl).forEach((u, c) => {
|
|
2489
|
-
u.notify("AnimationStart", e), o.push(_e(u, e, {
|
|
2490
|
-
...r,
|
|
2491
|
-
delay: n + l(c)
|
|
2492
|
-
}).then(() => u.notify("AnimationComplete", e)));
|
|
2493
|
-
}), Promise.all(o);
|
|
2494
|
-
}
|
|
2495
|
-
function Pl(t, e) {
|
|
2496
|
-
return t.sortNodePosition(e);
|
|
2497
|
-
}
|
|
2498
|
-
function io(t, e, n = {}) {
|
|
2499
|
-
t.notify("AnimationStart", e);
|
|
2500
|
-
let s;
|
|
2501
|
-
if (Array.isArray(e)) {
|
|
2502
|
-
const i = e.map((r) => _e(t, r, n));
|
|
2503
|
-
s = Promise.all(i);
|
|
2504
|
-
} else if (typeof e == "string")
|
|
2505
|
-
s = _e(t, e, n);
|
|
2506
|
-
else {
|
|
2507
|
-
const i = typeof e == "function" ? me(t, e, n.custom) : e;
|
|
2508
|
-
s = Promise.all(Dn(t, i, n));
|
|
2509
|
-
}
|
|
2510
|
-
return s.then(() => {
|
|
2511
|
-
t.notify("AnimationComplete", e);
|
|
2512
|
-
});
|
|
2513
|
-
}
|
|
2514
|
-
const Al = nn.length;
|
|
2515
|
-
function oo(t) {
|
|
2516
|
-
if (!t)
|
|
2517
|
-
return;
|
|
2518
|
-
if (!t.isControllingVariants) {
|
|
2519
|
-
const n = t.parent ? oo(t.parent) || {} : {};
|
|
2520
|
-
return t.props.initial !== void 0 && (n.initial = t.props.initial), n;
|
|
2521
|
-
}
|
|
2522
|
-
const e = {};
|
|
2523
|
-
for (let n = 0; n < Al; n++) {
|
|
2524
|
-
const s = nn[n], i = t.props[s];
|
|
2525
|
-
(Ot(i) || i === !1) && (e[s] = i);
|
|
2526
|
-
}
|
|
2527
|
-
return e;
|
|
2528
|
-
}
|
|
2529
|
-
const bl = [...en].reverse(), Vl = en.length;
|
|
2530
|
-
function wl(t) {
|
|
2531
|
-
return (e) => Promise.all(e.map(({ animation: n, options: s }) => io(t, n, s)));
|
|
2532
|
-
}
|
|
2533
|
-
function Dl(t) {
|
|
2534
|
-
let e = wl(t), n = os(), s = !0;
|
|
2535
|
-
const i = (l) => (u, c) => {
|
|
2536
|
-
var h;
|
|
2537
|
-
const f = me(t, c, l === "exit" ? (h = t.presenceContext) === null || h === void 0 ? void 0 : h.custom : void 0);
|
|
2538
|
-
if (f) {
|
|
2539
|
-
const { transition: d, transitionEnd: p, ...m } = f;
|
|
2540
|
-
u = { ...u, ...m, ...p };
|
|
2541
|
-
}
|
|
2542
|
-
return u;
|
|
2543
|
-
};
|
|
2544
|
-
function r(l) {
|
|
2545
|
-
e = l(t);
|
|
2546
|
-
}
|
|
2547
|
-
function o(l) {
|
|
2548
|
-
const { props: u } = t, c = oo(t.parent) || {}, h = [], f = /* @__PURE__ */ new Set();
|
|
2549
|
-
let d = {}, p = 1 / 0;
|
|
2550
|
-
for (let y = 0; y < Vl; y++) {
|
|
2551
|
-
const g = bl[y], v = n[g], T = u[g] !== void 0 ? u[g] : c[g], P = Ot(T), x = g === l ? v.isActive : null;
|
|
2552
|
-
x === !1 && (p = y);
|
|
2553
|
-
let b = T === c[g] && T !== u[g] && P;
|
|
2554
|
-
if (b && s && t.manuallyAnimateOnMount && (b = !1), v.protectedKeys = { ...d }, // If it isn't active and hasn't *just* been set as inactive
|
|
2555
|
-
!v.isActive && x === null || // If we didn't and don't have any defined prop for this animation type
|
|
2556
|
-
!T && !v.prevProp || // Or if the prop doesn't define an animation
|
|
2557
|
-
de(T) || typeof T == "boolean")
|
|
2558
|
-
continue;
|
|
2559
|
-
const w = Cl(v.prevProp, T);
|
|
2560
|
-
let A = w || // If we're making this variant active, we want to always make it active
|
|
2561
|
-
g === l && v.isActive && !b && P || // If we removed a higher-priority variant (i is in reverse order)
|
|
2562
|
-
y > p && P, V = !1;
|
|
2563
|
-
const O = Array.isArray(T) ? T : [T];
|
|
2564
|
-
let j = O.reduce(i(g), {});
|
|
2565
|
-
x === !1 && (j = {});
|
|
2566
|
-
const { prevResolvedValues: ut = {} } = v, et = {
|
|
2567
|
-
...ut,
|
|
2568
|
-
...j
|
|
2569
|
-
}, xe = (C) => {
|
|
2570
|
-
A = !0, f.has(C) && (V = !0, f.delete(C)), v.needsAnimating[C] = !0;
|
|
2571
|
-
const F = t.getValue(C);
|
|
2572
|
-
F && (F.liveStyle = !1);
|
|
2573
|
-
};
|
|
2574
|
-
for (const C in et) {
|
|
2575
|
-
const F = j[C], ct = ut[C];
|
|
2576
|
-
if (d.hasOwnProperty(C))
|
|
2577
|
-
continue;
|
|
2578
|
-
let ht = !1;
|
|
2579
|
-
Fe(F) && Fe(ct) ? ht = !Pi(F, ct) : ht = F !== ct, ht ? F != null ? xe(C) : f.add(C) : F !== void 0 && f.has(C) ? xe(C) : v.protectedKeys[C] = !0;
|
|
2580
|
-
}
|
|
2581
|
-
v.prevProp = T, v.prevResolvedValues = j, v.isActive && (d = { ...d, ...j }), s && t.blockInitialAnimation && (A = !1), A && (!(b && w) || V) && h.push(...O.map((C) => ({
|
|
2582
|
-
animation: C,
|
|
2583
|
-
options: { type: g }
|
|
2584
|
-
})));
|
|
2585
|
-
}
|
|
2586
|
-
if (f.size) {
|
|
2587
|
-
const y = {};
|
|
2588
|
-
f.forEach((g) => {
|
|
2589
|
-
const v = t.getBaseTarget(g), T = t.getValue(g);
|
|
2590
|
-
T && (T.liveStyle = !0), y[g] = v ?? null;
|
|
2591
|
-
}), h.push({ animation: y });
|
|
2592
|
-
}
|
|
2593
|
-
let m = !!h.length;
|
|
2594
|
-
return s && (u.initial === !1 || u.initial === u.animate) && !t.manuallyAnimateOnMount && (m = !1), s = !1, m ? e(h) : Promise.resolve();
|
|
2595
|
-
}
|
|
2596
|
-
function a(l, u) {
|
|
2597
|
-
var c;
|
|
2598
|
-
if (n[l].isActive === u)
|
|
2599
|
-
return Promise.resolve();
|
|
2600
|
-
(c = t.variantChildren) === null || c === void 0 || c.forEach((f) => {
|
|
2601
|
-
var d;
|
|
2602
|
-
return (d = f.animationState) === null || d === void 0 ? void 0 : d.setActive(l, u);
|
|
2603
|
-
}), n[l].isActive = u;
|
|
2604
|
-
const h = o(l);
|
|
2605
|
-
for (const f in n)
|
|
2606
|
-
n[f].protectedKeys = {};
|
|
2607
|
-
return h;
|
|
2608
|
-
}
|
|
2609
|
-
return {
|
|
2610
|
-
animateChanges: o,
|
|
2611
|
-
setActive: a,
|
|
2612
|
-
setAnimateFunction: r,
|
|
2613
|
-
getState: () => n,
|
|
2614
|
-
reset: () => {
|
|
2615
|
-
n = os(), s = !0;
|
|
2616
|
-
}
|
|
2617
|
-
};
|
|
2618
|
-
}
|
|
2619
|
-
function Cl(t, e) {
|
|
2620
|
-
return typeof e == "string" ? e !== t : Array.isArray(e) ? !Pi(e, t) : !1;
|
|
2621
|
-
}
|
|
2622
|
-
function nt(t = !1) {
|
|
2623
|
-
return {
|
|
2624
|
-
isActive: t,
|
|
2625
|
-
protectedKeys: {},
|
|
2626
|
-
needsAnimating: {},
|
|
2627
|
-
prevResolvedValues: {}
|
|
2628
|
-
};
|
|
2629
|
-
}
|
|
2630
|
-
function os() {
|
|
2631
|
-
return {
|
|
2632
|
-
animate: nt(!0),
|
|
2633
|
-
whileInView: nt(),
|
|
2634
|
-
whileHover: nt(),
|
|
2635
|
-
whileTap: nt(),
|
|
2636
|
-
whileDrag: nt(),
|
|
2637
|
-
whileFocus: nt(),
|
|
2638
|
-
exit: nt()
|
|
2639
|
-
};
|
|
2640
|
-
}
|
|
2641
|
-
class tt {
|
|
2642
|
-
constructor(e) {
|
|
2643
|
-
this.isMounted = !1, this.node = e;
|
|
2644
|
-
}
|
|
2645
|
-
update() {
|
|
2646
|
-
}
|
|
2647
|
-
}
|
|
2648
|
-
class Ml extends tt {
|
|
2649
|
-
/**
|
|
2650
|
-
* We dynamically generate the AnimationState manager as it contains a reference
|
|
2651
|
-
* to the underlying animation library. We only want to load that if we load this,
|
|
2652
|
-
* so people can optionally code split it out using the `m` component.
|
|
2653
|
-
*/
|
|
2654
|
-
constructor(e) {
|
|
2655
|
-
super(e), e.animationState || (e.animationState = Dl(e));
|
|
2656
|
-
}
|
|
2657
|
-
updateAnimationControlsSubscription() {
|
|
2658
|
-
const { animate: e } = this.node.getProps();
|
|
2659
|
-
de(e) && (this.unmountControls = e.subscribe(this.node));
|
|
2660
|
-
}
|
|
2661
|
-
/**
|
|
2662
|
-
* Subscribe any provided AnimationControls to the component's VisualElement
|
|
2663
|
-
*/
|
|
2664
|
-
mount() {
|
|
2665
|
-
this.updateAnimationControlsSubscription();
|
|
2666
|
-
}
|
|
2667
|
-
update() {
|
|
2668
|
-
const { animate: e } = this.node.getProps(), { animate: n } = this.node.prevProps || {};
|
|
2669
|
-
e !== n && this.updateAnimationControlsSubscription();
|
|
2670
|
-
}
|
|
2671
|
-
unmount() {
|
|
2672
|
-
var e;
|
|
2673
|
-
this.node.animationState.reset(), (e = this.unmountControls) === null || e === void 0 || e.call(this);
|
|
2674
|
-
}
|
|
2675
|
-
}
|
|
2676
|
-
let Rl = 0;
|
|
2677
|
-
class El extends tt {
|
|
2678
|
-
constructor() {
|
|
2679
|
-
super(...arguments), this.id = Rl++;
|
|
2680
|
-
}
|
|
2681
|
-
update() {
|
|
2682
|
-
if (!this.node.presenceContext)
|
|
2683
|
-
return;
|
|
2684
|
-
const { isPresent: e, onExitComplete: n } = this.node.presenceContext, { isPresent: s } = this.node.prevPresenceContext || {};
|
|
2685
|
-
if (!this.node.animationState || e === s)
|
|
2686
|
-
return;
|
|
2687
|
-
const i = this.node.animationState.setActive("exit", !e);
|
|
2688
|
-
n && !e && i.then(() => n(this.id));
|
|
2689
|
-
}
|
|
2690
|
-
mount() {
|
|
2691
|
-
const { register: e } = this.node.presenceContext || {};
|
|
2692
|
-
e && (this.unmount = e(this.id));
|
|
2693
|
-
}
|
|
2694
|
-
unmount() {
|
|
2695
|
-
}
|
|
2696
|
-
}
|
|
2697
|
-
const Ll = {
|
|
2698
|
-
animation: {
|
|
2699
|
-
Feature: Ml
|
|
2700
|
-
},
|
|
2701
|
-
exit: {
|
|
2702
|
-
Feature: El
|
|
2703
|
-
}
|
|
2704
|
-
};
|
|
2705
|
-
function Nt(t, e, n, s = { passive: !0 }) {
|
|
2706
|
-
return t.addEventListener(e, n, s), () => t.removeEventListener(e, n);
|
|
2707
|
-
}
|
|
2708
|
-
function zt(t) {
|
|
2709
|
-
return {
|
|
2710
|
-
point: {
|
|
2711
|
-
x: t.pageX,
|
|
2712
|
-
y: t.pageY
|
|
2713
|
-
}
|
|
2714
|
-
};
|
|
2715
|
-
}
|
|
2716
|
-
const Fl = (t) => (e) => ei(e) && t(e, zt(e));
|
|
2717
|
-
function Ft(t, e, n, s) {
|
|
2718
|
-
return Nt(t, e, Fl(n), s);
|
|
2719
|
-
}
|
|
2720
|
-
const rs = (t, e) => Math.abs(t - e);
|
|
2721
|
-
function Bl(t, e) {
|
|
2722
|
-
const n = rs(t.x, e.x), s = rs(t.y, e.y);
|
|
2723
|
-
return Math.sqrt(n ** 2 + s ** 2);
|
|
2724
|
-
}
|
|
2725
|
-
class ro {
|
|
2726
|
-
constructor(e, n, { transformPagePoint: s, contextWindow: i, dragSnapToOrigin: r = !1 } = {}) {
|
|
2727
|
-
if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.handlers = {}, this.contextWindow = window, this.updatePoint = () => {
|
|
2728
|
-
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
2729
|
-
return;
|
|
2730
|
-
const h = we(this.lastMoveEventInfo, this.history), f = this.startEvent !== null, d = Bl(h.offset, { x: 0, y: 0 }) >= 3;
|
|
2731
|
-
if (!f && !d)
|
|
2732
|
-
return;
|
|
2733
|
-
const { point: p } = h, { timestamp: m } = B;
|
|
2734
|
-
this.history.push({ ...p, timestamp: m });
|
|
2735
|
-
const { onStart: y, onMove: g } = this.handlers;
|
|
2736
|
-
f || (y && y(this.lastMoveEvent, h), this.startEvent = this.lastMoveEvent), g && g(this.lastMoveEvent, h);
|
|
2737
|
-
}, this.handlePointerMove = (h, f) => {
|
|
2738
|
-
this.lastMoveEvent = h, this.lastMoveEventInfo = Ve(f, this.transformPagePoint), D.update(this.updatePoint, !0);
|
|
2739
|
-
}, this.handlePointerUp = (h, f) => {
|
|
2740
|
-
this.end();
|
|
2741
|
-
const { onEnd: d, onSessionEnd: p, resumeAnimation: m } = this.handlers;
|
|
2742
|
-
if (this.dragSnapToOrigin && m && m(), !(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
2743
|
-
return;
|
|
2744
|
-
const y = we(h.type === "pointercancel" ? this.lastMoveEventInfo : Ve(f, this.transformPagePoint), this.history);
|
|
2745
|
-
this.startEvent && d && d(h, y), p && p(h, y);
|
|
2746
|
-
}, !ei(e))
|
|
2747
|
-
return;
|
|
2748
|
-
this.dragSnapToOrigin = r, this.handlers = n, this.transformPagePoint = s, this.contextWindow = i || window;
|
|
2749
|
-
const o = zt(e), a = Ve(o, this.transformPagePoint), { point: l } = a, { timestamp: u } = B;
|
|
2750
|
-
this.history = [{ ...l, timestamp: u }];
|
|
2751
|
-
const { onSessionStart: c } = n;
|
|
2752
|
-
c && c(e, we(a, this.history)), this.removeListeners = Gt(Ft(this.contextWindow, "pointermove", this.handlePointerMove), Ft(this.contextWindow, "pointerup", this.handlePointerUp), Ft(this.contextWindow, "pointercancel", this.handlePointerUp));
|
|
2753
|
-
}
|
|
2754
|
-
updateHandlers(e) {
|
|
2755
|
-
this.handlers = e;
|
|
2756
|
-
}
|
|
2757
|
-
end() {
|
|
2758
|
-
this.removeListeners && this.removeListeners(), q(this.updatePoint);
|
|
2759
|
-
}
|
|
2760
|
-
}
|
|
2761
|
-
function Ve(t, e) {
|
|
2762
|
-
return e ? { point: e(t.point) } : t;
|
|
2763
|
-
}
|
|
2764
|
-
function as(t, e) {
|
|
2765
|
-
return { x: t.x - e.x, y: t.y - e.y };
|
|
2766
|
-
}
|
|
2767
|
-
function we({ point: t }, e) {
|
|
2768
|
-
return {
|
|
2769
|
-
point: t,
|
|
2770
|
-
delta: as(t, ao(e)),
|
|
2771
|
-
offset: as(t, kl(e)),
|
|
2772
|
-
velocity: Ol(e, 0.1)
|
|
2773
|
-
};
|
|
2774
|
-
}
|
|
2775
|
-
function kl(t) {
|
|
2776
|
-
return t[0];
|
|
2777
|
-
}
|
|
2778
|
-
function ao(t) {
|
|
2779
|
-
return t[t.length - 1];
|
|
2780
|
-
}
|
|
2781
|
-
function Ol(t, e) {
|
|
2782
|
-
if (t.length < 2)
|
|
2783
|
-
return { x: 0, y: 0 };
|
|
2784
|
-
let n = t.length - 1, s = null;
|
|
2785
|
-
const i = ao(t);
|
|
2786
|
-
for (; n >= 0 && (s = t[n], !(i.timestamp - s.timestamp > $(e))); )
|
|
2787
|
-
n--;
|
|
2788
|
-
if (!s)
|
|
2789
|
-
return { x: 0, y: 0 };
|
|
2790
|
-
const r = X(i.timestamp - s.timestamp);
|
|
2791
|
-
if (r === 0)
|
|
2792
|
-
return { x: 0, y: 0 };
|
|
2793
|
-
const o = {
|
|
2794
|
-
x: (i.x - s.x) / r,
|
|
2795
|
-
y: (i.y - s.y) / r
|
|
2796
|
-
};
|
|
2797
|
-
return o.x === 1 / 0 && (o.x = 0), o.y === 1 / 0 && (o.y = 0), o;
|
|
2798
|
-
}
|
|
2799
|
-
const lo = 1e-4, jl = 1 - lo, Il = 1 + lo, uo = 0.01, Nl = 0 - uo, Ul = 0 + uo;
|
|
2800
|
-
function N(t) {
|
|
2801
|
-
return t.max - t.min;
|
|
2802
|
-
}
|
|
2803
|
-
function _l(t, e, n) {
|
|
2804
|
-
return Math.abs(t - e) <= n;
|
|
2805
|
-
}
|
|
2806
|
-
function ls(t, e, n, s = 0.5) {
|
|
2807
|
-
t.origin = s, t.originPoint = M(e.min, e.max, t.origin), t.scale = N(n) / N(e), t.translate = M(n.min, n.max, t.origin) - t.originPoint, (t.scale >= jl && t.scale <= Il || isNaN(t.scale)) && (t.scale = 1), (t.translate >= Nl && t.translate <= Ul || isNaN(t.translate)) && (t.translate = 0);
|
|
2808
|
-
}
|
|
2809
|
-
function Bt(t, e, n, s) {
|
|
2810
|
-
ls(t.x, e.x, n.x, s ? s.originX : void 0), ls(t.y, e.y, n.y, s ? s.originY : void 0);
|
|
2811
|
-
}
|
|
2812
|
-
function us(t, e, n) {
|
|
2813
|
-
t.min = n.min + e.min, t.max = t.min + N(e);
|
|
2814
|
-
}
|
|
2815
|
-
function Kl(t, e, n) {
|
|
2816
|
-
us(t.x, e.x, n.x), us(t.y, e.y, n.y);
|
|
2817
|
-
}
|
|
2818
|
-
function cs(t, e, n) {
|
|
2819
|
-
t.min = e.min - n.min, t.max = t.min + N(e);
|
|
2820
|
-
}
|
|
2821
|
-
function kt(t, e, n) {
|
|
2822
|
-
cs(t.x, e.x, n.x), cs(t.y, e.y, n.y);
|
|
2823
|
-
}
|
|
2824
|
-
function $l(t, { min: e, max: n }, s) {
|
|
2825
|
-
return e !== void 0 && t < e ? t = s ? M(e, t, s.min) : Math.max(t, e) : n !== void 0 && t > n && (t = s ? M(n, t, s.max) : Math.min(t, n)), t;
|
|
2826
|
-
}
|
|
2827
|
-
function hs(t, e, n) {
|
|
2828
|
-
return {
|
|
2829
|
-
min: e !== void 0 ? t.min + e : void 0,
|
|
2830
|
-
max: n !== void 0 ? t.max + n - (t.max - t.min) : void 0
|
|
2831
|
-
};
|
|
2832
|
-
}
|
|
2833
|
-
function Wl(t, { top: e, left: n, bottom: s, right: i }) {
|
|
2834
|
-
return {
|
|
2835
|
-
x: hs(t.x, n, i),
|
|
2836
|
-
y: hs(t.y, e, s)
|
|
2837
|
-
};
|
|
2838
|
-
}
|
|
2839
|
-
function fs(t, e) {
|
|
2840
|
-
let n = e.min - t.min, s = e.max - t.max;
|
|
2841
|
-
return e.max - e.min < t.max - t.min && ([n, s] = [s, n]), { min: n, max: s };
|
|
2842
|
-
}
|
|
2843
|
-
function Gl(t, e) {
|
|
2844
|
-
return {
|
|
2845
|
-
x: fs(t.x, e.x),
|
|
2846
|
-
y: fs(t.y, e.y)
|
|
2847
|
-
};
|
|
2848
|
-
}
|
|
2849
|
-
function zl(t, e) {
|
|
2850
|
-
let n = 0.5;
|
|
2851
|
-
const s = N(t), i = N(e);
|
|
2852
|
-
return i > s ? n = yt(e.min, e.max - s, t.min) : s > i && (n = yt(t.min, t.max - i, e.min)), Z(0, 1, n);
|
|
2853
|
-
}
|
|
2854
|
-
function Hl(t, e) {
|
|
2855
|
-
const n = {};
|
|
2856
|
-
return e.min !== void 0 && (n.min = e.min - t.min), e.max !== void 0 && (n.max = e.max - t.min), n;
|
|
2857
|
-
}
|
|
2858
|
-
const Ke = 0.35;
|
|
2859
|
-
function Yl(t = Ke) {
|
|
2860
|
-
return t === !1 ? t = 0 : t === !0 && (t = Ke), {
|
|
2861
|
-
x: ds(t, "left", "right"),
|
|
2862
|
-
y: ds(t, "top", "bottom")
|
|
2863
|
-
};
|
|
2864
|
-
}
|
|
2865
|
-
function ds(t, e, n) {
|
|
2866
|
-
return {
|
|
2867
|
-
min: ps(t, e),
|
|
2868
|
-
max: ps(t, n)
|
|
2869
|
-
};
|
|
2870
|
-
}
|
|
2871
|
-
function ps(t, e) {
|
|
2872
|
-
return typeof t == "number" ? t : t[e] || 0;
|
|
2873
|
-
}
|
|
2874
|
-
const ms = () => ({
|
|
2875
|
-
translate: 0,
|
|
2876
|
-
scale: 1,
|
|
2877
|
-
origin: 0,
|
|
2878
|
-
originPoint: 0
|
|
2879
|
-
}), pt = () => ({
|
|
2880
|
-
x: ms(),
|
|
2881
|
-
y: ms()
|
|
2882
|
-
}), gs = () => ({ min: 0, max: 0 }), E = () => ({
|
|
2883
|
-
x: gs(),
|
|
2884
|
-
y: gs()
|
|
2885
|
-
});
|
|
2886
|
-
function _(t) {
|
|
2887
|
-
return [t("x"), t("y")];
|
|
2888
|
-
}
|
|
2889
|
-
function co({ top: t, left: e, right: n, bottom: s }) {
|
|
2890
|
-
return {
|
|
2891
|
-
x: { min: e, max: n },
|
|
2892
|
-
y: { min: t, max: s }
|
|
2893
|
-
};
|
|
2894
|
-
}
|
|
2895
|
-
function Xl({ x: t, y: e }) {
|
|
2896
|
-
return { top: e.min, right: t.max, bottom: e.max, left: t.min };
|
|
2897
|
-
}
|
|
2898
|
-
function ql(t, e) {
|
|
2899
|
-
if (!e)
|
|
2900
|
-
return t;
|
|
2901
|
-
const n = e({ x: t.left, y: t.top }), s = e({ x: t.right, y: t.bottom });
|
|
2902
|
-
return {
|
|
2903
|
-
top: n.y,
|
|
2904
|
-
left: n.x,
|
|
2905
|
-
bottom: s.y,
|
|
2906
|
-
right: s.x
|
|
2907
|
-
};
|
|
2908
|
-
}
|
|
2909
|
-
function De(t) {
|
|
2910
|
-
return t === void 0 || t === 1;
|
|
2911
|
-
}
|
|
2912
|
-
function $e({ scale: t, scaleX: e, scaleY: n }) {
|
|
2913
|
-
return !De(t) || !De(e) || !De(n);
|
|
2914
|
-
}
|
|
2915
|
-
function st(t) {
|
|
2916
|
-
return $e(t) || ho(t) || t.z || t.rotate || t.rotateX || t.rotateY || t.skewX || t.skewY;
|
|
2917
|
-
}
|
|
2918
|
-
function ho(t) {
|
|
2919
|
-
return ys(t.x) || ys(t.y);
|
|
2920
|
-
}
|
|
2921
|
-
function ys(t) {
|
|
2922
|
-
return t && t !== "0%";
|
|
2923
|
-
}
|
|
2924
|
-
function ae(t, e, n) {
|
|
2925
|
-
const s = t - n, i = e * s;
|
|
2926
|
-
return n + i;
|
|
2927
|
-
}
|
|
2928
|
-
function vs(t, e, n, s, i) {
|
|
2929
|
-
return i !== void 0 && (t = ae(t, i, s)), ae(t, n, s) + e;
|
|
2930
|
-
}
|
|
2931
|
-
function We(t, e = 0, n = 1, s, i) {
|
|
2932
|
-
t.min = vs(t.min, e, n, s, i), t.max = vs(t.max, e, n, s, i);
|
|
2933
|
-
}
|
|
2934
|
-
function fo(t, { x: e, y: n }) {
|
|
2935
|
-
We(t.x, e.translate, e.scale, e.originPoint), We(t.y, n.translate, n.scale, n.originPoint);
|
|
2936
|
-
}
|
|
2937
|
-
const xs = 0.999999999999, Ts = 1.0000000000001;
|
|
2938
|
-
function Zl(t, e, n, s = !1) {
|
|
2939
|
-
const i = n.length;
|
|
2940
|
-
if (!i)
|
|
2941
|
-
return;
|
|
2942
|
-
e.x = e.y = 1;
|
|
2943
|
-
let r, o;
|
|
2944
|
-
for (let a = 0; a < i; a++) {
|
|
2945
|
-
r = n[a], o = r.projectionDelta;
|
|
2946
|
-
const { visualElement: l } = r.options;
|
|
2947
|
-
l && l.props.style && l.props.style.display === "contents" || (s && r.options.layoutScroll && r.scroll && r !== r.root && gt(t, {
|
|
2948
|
-
x: -r.scroll.offset.x,
|
|
2949
|
-
y: -r.scroll.offset.y
|
|
2950
|
-
}), o && (e.x *= o.x.scale, e.y *= o.y.scale, fo(t, o)), s && st(r.latestValues) && gt(t, r.latestValues));
|
|
2951
|
-
}
|
|
2952
|
-
e.x < Ts && e.x > xs && (e.x = 1), e.y < Ts && e.y > xs && (e.y = 1);
|
|
2953
|
-
}
|
|
2954
|
-
function mt(t, e) {
|
|
2955
|
-
t.min = t.min + e, t.max = t.max + e;
|
|
2956
|
-
}
|
|
2957
|
-
function Ss(t, e, n, s, i = 0.5) {
|
|
2958
|
-
const r = M(t.min, t.max, i);
|
|
2959
|
-
We(t, e, n, r, s);
|
|
2960
|
-
}
|
|
2961
|
-
function gt(t, e) {
|
|
2962
|
-
Ss(t.x, e.x, e.scaleX, e.scale, e.originX), Ss(t.y, e.y, e.scaleY, e.scale, e.originY);
|
|
2963
|
-
}
|
|
2964
|
-
function po(t, e) {
|
|
2965
|
-
return co(ql(t.getBoundingClientRect(), e));
|
|
2966
|
-
}
|
|
2967
|
-
function Jl(t, e, n) {
|
|
2968
|
-
const s = po(t, n), { scroll: i } = e;
|
|
2969
|
-
return i && (mt(s.x, i.offset.x), mt(s.y, i.offset.y)), s;
|
|
2970
|
-
}
|
|
2971
|
-
const mo = ({ current: t }) => t ? t.ownerDocument.defaultView : null, Ql = /* @__PURE__ */ new WeakMap();
|
|
2972
|
-
class tu {
|
|
2973
|
-
constructor(e) {
|
|
2974
|
-
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = E(), this.visualElement = e;
|
|
2975
|
-
}
|
|
2976
|
-
start(e, { snapToCursor: n = !1 } = {}) {
|
|
2977
|
-
const { presenceContext: s } = this.visualElement;
|
|
2978
|
-
if (s && s.isPresent === !1)
|
|
2979
|
-
return;
|
|
2980
|
-
const i = (c) => {
|
|
2981
|
-
const { dragSnapToOrigin: h } = this.getProps();
|
|
2982
|
-
h ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor(zt(c).point);
|
|
2983
|
-
}, r = (c, h) => {
|
|
2984
|
-
const { drag: f, dragPropagation: d, onDragStart: p } = this.getProps();
|
|
2985
|
-
if (f && !d && (this.openDragLock && this.openDragLock(), this.openDragLock = Wo(f), !this.openDragLock))
|
|
2986
|
-
return;
|
|
2987
|
-
this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), _((y) => {
|
|
2988
|
-
let g = this.getAxisMotionValue(y).get() || 0;
|
|
2989
|
-
if (z.test(g)) {
|
|
2990
|
-
const { projection: v } = this.visualElement;
|
|
2991
|
-
if (v && v.layout) {
|
|
2992
|
-
const T = v.layout.layoutBox[y];
|
|
2993
|
-
T && (g = N(T) * (parseFloat(g) / 100));
|
|
2994
|
-
}
|
|
2995
|
-
}
|
|
2996
|
-
this.originPoint[y] = g;
|
|
2997
|
-
}), p && D.postRender(() => p(c, h)), Be(this.visualElement, "transform");
|
|
2998
|
-
const { animationState: m } = this.visualElement;
|
|
2999
|
-
m && m.setActive("whileDrag", !0);
|
|
3000
|
-
}, o = (c, h) => {
|
|
3001
|
-
const { dragPropagation: f, dragDirectionLock: d, onDirectionLock: p, onDrag: m } = this.getProps();
|
|
3002
|
-
if (!f && !this.openDragLock)
|
|
3003
|
-
return;
|
|
3004
|
-
const { offset: y } = h;
|
|
3005
|
-
if (d && this.currentDirection === null) {
|
|
3006
|
-
this.currentDirection = eu(y), this.currentDirection !== null && p && p(this.currentDirection);
|
|
3007
|
-
return;
|
|
3008
|
-
}
|
|
3009
|
-
this.updateAxis("x", h.point, y), this.updateAxis("y", h.point, y), this.visualElement.render(), m && m(c, h);
|
|
3010
|
-
}, a = (c, h) => this.stop(c, h), l = () => _((c) => {
|
|
3011
|
-
var h;
|
|
3012
|
-
return this.getAnimationState(c) === "paused" && ((h = this.getAxisMotionValue(c).animation) === null || h === void 0 ? void 0 : h.play());
|
|
3013
|
-
}), { dragSnapToOrigin: u } = this.getProps();
|
|
3014
|
-
this.panSession = new ro(e, {
|
|
3015
|
-
onSessionStart: i,
|
|
3016
|
-
onStart: r,
|
|
3017
|
-
onMove: o,
|
|
3018
|
-
onSessionEnd: a,
|
|
3019
|
-
resumeAnimation: l
|
|
3020
|
-
}, {
|
|
3021
|
-
transformPagePoint: this.visualElement.getTransformPagePoint(),
|
|
3022
|
-
dragSnapToOrigin: u,
|
|
3023
|
-
contextWindow: mo(this.visualElement)
|
|
3024
|
-
});
|
|
3025
|
-
}
|
|
3026
|
-
stop(e, n) {
|
|
3027
|
-
const s = this.isDragging;
|
|
3028
|
-
if (this.cancel(), !s)
|
|
3029
|
-
return;
|
|
3030
|
-
const { velocity: i } = n;
|
|
3031
|
-
this.startAnimation(i);
|
|
3032
|
-
const { onDragEnd: r } = this.getProps();
|
|
3033
|
-
r && D.postRender(() => r(e, n));
|
|
3034
|
-
}
|
|
3035
|
-
cancel() {
|
|
3036
|
-
this.isDragging = !1;
|
|
3037
|
-
const { projection: e, animationState: n } = this.visualElement;
|
|
3038
|
-
e && (e.isAnimationBlocked = !1), this.panSession && this.panSession.end(), this.panSession = void 0;
|
|
3039
|
-
const { dragPropagation: s } = this.getProps();
|
|
3040
|
-
!s && this.openDragLock && (this.openDragLock(), this.openDragLock = null), n && n.setActive("whileDrag", !1);
|
|
3041
|
-
}
|
|
3042
|
-
updateAxis(e, n, s) {
|
|
3043
|
-
const { drag: i } = this.getProps();
|
|
3044
|
-
if (!s || !Jt(e, i, this.currentDirection))
|
|
3045
|
-
return;
|
|
3046
|
-
const r = this.getAxisMotionValue(e);
|
|
3047
|
-
let o = this.originPoint[e] + s[e];
|
|
3048
|
-
this.constraints && this.constraints[e] && (o = $l(o, this.constraints[e], this.elastic[e])), r.set(o);
|
|
3049
|
-
}
|
|
3050
|
-
resolveConstraints() {
|
|
3051
|
-
var e;
|
|
3052
|
-
const { dragConstraints: n, dragElastic: s } = this.getProps(), i = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : (e = this.visualElement.projection) === null || e === void 0 ? void 0 : e.layout, r = this.constraints;
|
|
3053
|
-
n && ft(n) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : n && i ? this.constraints = Wl(i.layoutBox, n) : this.constraints = !1, this.elastic = Yl(s), r !== this.constraints && i && this.constraints && !this.hasMutatedConstraints && _((o) => {
|
|
3054
|
-
this.constraints !== !1 && this.getAxisMotionValue(o) && (this.constraints[o] = Hl(i.layoutBox[o], this.constraints[o]));
|
|
3055
|
-
});
|
|
3056
|
-
}
|
|
3057
|
-
resolveRefConstraints() {
|
|
3058
|
-
const { dragConstraints: e, onMeasureDragConstraints: n } = this.getProps();
|
|
3059
|
-
if (!e || !ft(e))
|
|
3060
|
-
return !1;
|
|
3061
|
-
const s = e.current;
|
|
3062
|
-
G(s !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
|
|
3063
|
-
const { projection: i } = this.visualElement;
|
|
3064
|
-
if (!i || !i.layout)
|
|
3065
|
-
return !1;
|
|
3066
|
-
const r = Jl(s, i.root, this.visualElement.getTransformPagePoint());
|
|
3067
|
-
let o = Gl(i.layout.layoutBox, r);
|
|
3068
|
-
if (n) {
|
|
3069
|
-
const a = n(Xl(o));
|
|
3070
|
-
this.hasMutatedConstraints = !!a, a && (o = co(a));
|
|
3071
|
-
}
|
|
3072
|
-
return o;
|
|
3073
|
-
}
|
|
3074
|
-
startAnimation(e) {
|
|
3075
|
-
const { drag: n, dragMomentum: s, dragElastic: i, dragTransition: r, dragSnapToOrigin: o, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, u = _((c) => {
|
|
3076
|
-
if (!Jt(c, n, this.currentDirection))
|
|
3077
|
-
return;
|
|
3078
|
-
let h = l && l[c] || {};
|
|
3079
|
-
o && (h = { min: 0, max: 0 });
|
|
3080
|
-
const f = i ? 200 : 1e6, d = i ? 40 : 1e7, p = {
|
|
3081
|
-
type: "inertia",
|
|
3082
|
-
velocity: s ? e[c] : 0,
|
|
3083
|
-
bounceStiffness: f,
|
|
3084
|
-
bounceDamping: d,
|
|
3085
|
-
timeConstant: 750,
|
|
3086
|
-
restDelta: 1,
|
|
3087
|
-
restSpeed: 10,
|
|
3088
|
-
...r,
|
|
3089
|
-
...h
|
|
3090
|
-
};
|
|
3091
|
-
return this.startAxisValueAnimation(c, p);
|
|
3092
|
-
});
|
|
3093
|
-
return Promise.all(u).then(a);
|
|
3094
|
-
}
|
|
3095
|
-
startAxisValueAnimation(e, n) {
|
|
3096
|
-
const s = this.getAxisMotionValue(e);
|
|
3097
|
-
return Be(this.visualElement, e), s.start(wn(e, s, 0, n, this.visualElement, !1));
|
|
3098
|
-
}
|
|
3099
|
-
stopAnimation() {
|
|
3100
|
-
_((e) => this.getAxisMotionValue(e).stop());
|
|
3101
|
-
}
|
|
3102
|
-
pauseAnimation() {
|
|
3103
|
-
_((e) => {
|
|
3104
|
-
var n;
|
|
3105
|
-
return (n = this.getAxisMotionValue(e).animation) === null || n === void 0 ? void 0 : n.pause();
|
|
3106
|
-
});
|
|
3107
|
-
}
|
|
3108
|
-
getAnimationState(e) {
|
|
3109
|
-
var n;
|
|
3110
|
-
return (n = this.getAxisMotionValue(e).animation) === null || n === void 0 ? void 0 : n.state;
|
|
3111
|
-
}
|
|
3112
|
-
/**
|
|
3113
|
-
* Drag works differently depending on which props are provided.
|
|
3114
|
-
*
|
|
3115
|
-
* - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
|
|
3116
|
-
* - Otherwise, we apply the delta to the x/y motion values.
|
|
3117
|
-
*/
|
|
3118
|
-
getAxisMotionValue(e) {
|
|
3119
|
-
const n = `_drag${e.toUpperCase()}`, s = this.visualElement.getProps(), i = s[n];
|
|
3120
|
-
return i || this.visualElement.getValue(e, (s.initial ? s.initial[e] : void 0) || 0);
|
|
3121
|
-
}
|
|
3122
|
-
snapToCursor(e) {
|
|
3123
|
-
_((n) => {
|
|
3124
|
-
const { drag: s } = this.getProps();
|
|
3125
|
-
if (!Jt(n, s, this.currentDirection))
|
|
3126
|
-
return;
|
|
3127
|
-
const { projection: i } = this.visualElement, r = this.getAxisMotionValue(n);
|
|
3128
|
-
if (i && i.layout) {
|
|
3129
|
-
const { min: o, max: a } = i.layout.layoutBox[n];
|
|
3130
|
-
r.set(e[n] - M(o, a, 0.5));
|
|
3131
|
-
}
|
|
3132
|
-
});
|
|
3133
|
-
}
|
|
3134
|
-
/**
|
|
3135
|
-
* When the viewport resizes we want to check if the measured constraints
|
|
3136
|
-
* have changed and, if so, reposition the element within those new constraints
|
|
3137
|
-
* relative to where it was before the resize.
|
|
3138
|
-
*/
|
|
3139
|
-
scalePositionWithinConstraints() {
|
|
3140
|
-
if (!this.visualElement.current)
|
|
3141
|
-
return;
|
|
3142
|
-
const { drag: e, dragConstraints: n } = this.getProps(), { projection: s } = this.visualElement;
|
|
3143
|
-
if (!ft(n) || !s || !this.constraints)
|
|
3144
|
-
return;
|
|
3145
|
-
this.stopAnimation();
|
|
3146
|
-
const i = { x: 0, y: 0 };
|
|
3147
|
-
_((o) => {
|
|
3148
|
-
const a = this.getAxisMotionValue(o);
|
|
3149
|
-
if (a && this.constraints !== !1) {
|
|
3150
|
-
const l = a.get();
|
|
3151
|
-
i[o] = zl({ min: l, max: l }, this.constraints[o]);
|
|
3152
|
-
}
|
|
3153
|
-
});
|
|
3154
|
-
const { transformTemplate: r } = this.visualElement.getProps();
|
|
3155
|
-
this.visualElement.current.style.transform = r ? r({}, "") : "none", s.root && s.root.updateScroll(), s.updateLayout(), this.resolveConstraints(), _((o) => {
|
|
3156
|
-
if (!Jt(o, e, null))
|
|
3157
|
-
return;
|
|
3158
|
-
const a = this.getAxisMotionValue(o), { min: l, max: u } = this.constraints[o];
|
|
3159
|
-
a.set(M(l, u, i[o]));
|
|
3160
|
-
});
|
|
3161
|
-
}
|
|
3162
|
-
addListeners() {
|
|
3163
|
-
if (!this.visualElement.current)
|
|
3164
|
-
return;
|
|
3165
|
-
Ql.set(this.visualElement, this);
|
|
3166
|
-
const e = this.visualElement.current, n = Ft(e, "pointerdown", (l) => {
|
|
3167
|
-
const { drag: u, dragListener: c = !0 } = this.getProps();
|
|
3168
|
-
u && c && this.start(l);
|
|
3169
|
-
}), s = () => {
|
|
3170
|
-
const { dragConstraints: l } = this.getProps();
|
|
3171
|
-
ft(l) && l.current && (this.constraints = this.resolveRefConstraints());
|
|
3172
|
-
}, { projection: i } = this.visualElement, r = i.addEventListener("measure", s);
|
|
3173
|
-
i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), D.read(s);
|
|
3174
|
-
const o = Nt(window, "resize", () => this.scalePositionWithinConstraints()), a = i.addEventListener("didUpdate", (({ delta: l, hasLayoutChanged: u }) => {
|
|
3175
|
-
this.isDragging && u && (_((c) => {
|
|
3176
|
-
const h = this.getAxisMotionValue(c);
|
|
3177
|
-
h && (this.originPoint[c] += l[c].translate, h.set(h.get() + l[c].translate));
|
|
3178
|
-
}), this.visualElement.render());
|
|
3179
|
-
}));
|
|
3180
|
-
return () => {
|
|
3181
|
-
o(), n(), r(), a && a();
|
|
3182
|
-
};
|
|
3183
|
-
}
|
|
3184
|
-
getProps() {
|
|
3185
|
-
const e = this.visualElement.getProps(), { drag: n = !1, dragDirectionLock: s = !1, dragPropagation: i = !1, dragConstraints: r = !1, dragElastic: o = Ke, dragMomentum: a = !0 } = e;
|
|
3186
|
-
return {
|
|
3187
|
-
...e,
|
|
3188
|
-
drag: n,
|
|
3189
|
-
dragDirectionLock: s,
|
|
3190
|
-
dragPropagation: i,
|
|
3191
|
-
dragConstraints: r,
|
|
3192
|
-
dragElastic: o,
|
|
3193
|
-
dragMomentum: a
|
|
3194
|
-
};
|
|
3195
|
-
}
|
|
3196
|
-
}
|
|
3197
|
-
function Jt(t, e, n) {
|
|
3198
|
-
return (e === !0 || e === t) && (n === null || n === t);
|
|
3199
|
-
}
|
|
3200
|
-
function eu(t, e = 10) {
|
|
3201
|
-
let n = null;
|
|
3202
|
-
return Math.abs(t.y) > e ? n = "y" : Math.abs(t.x) > e && (n = "x"), n;
|
|
3203
|
-
}
|
|
3204
|
-
class nu extends tt {
|
|
3205
|
-
constructor(e) {
|
|
3206
|
-
super(e), this.removeGroupControls = K, this.removeListeners = K, this.controls = new tu(e);
|
|
3207
|
-
}
|
|
3208
|
-
mount() {
|
|
3209
|
-
const { dragControls: e } = this.node.getProps();
|
|
3210
|
-
e && (this.removeGroupControls = e.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || K;
|
|
3211
|
-
}
|
|
3212
|
-
unmount() {
|
|
3213
|
-
this.removeGroupControls(), this.removeListeners();
|
|
3214
|
-
}
|
|
3215
|
-
}
|
|
3216
|
-
const Ps = (t) => (e, n) => {
|
|
3217
|
-
t && D.postRender(() => t(e, n));
|
|
3218
|
-
};
|
|
3219
|
-
class su extends tt {
|
|
3220
|
-
constructor() {
|
|
3221
|
-
super(...arguments), this.removePointerDownListener = K;
|
|
3222
|
-
}
|
|
3223
|
-
onPointerDown(e) {
|
|
3224
|
-
this.session = new ro(e, this.createPanHandlers(), {
|
|
3225
|
-
transformPagePoint: this.node.getTransformPagePoint(),
|
|
3226
|
-
contextWindow: mo(this.node)
|
|
3227
|
-
});
|
|
3228
|
-
}
|
|
3229
|
-
createPanHandlers() {
|
|
3230
|
-
const { onPanSessionStart: e, onPanStart: n, onPan: s, onPanEnd: i } = this.node.getProps();
|
|
3231
|
-
return {
|
|
3232
|
-
onSessionStart: Ps(e),
|
|
3233
|
-
onStart: Ps(n),
|
|
3234
|
-
onMove: s,
|
|
3235
|
-
onEnd: (r, o) => {
|
|
3236
|
-
delete this.session, i && D.postRender(() => i(r, o));
|
|
3237
|
-
}
|
|
3238
|
-
};
|
|
3239
|
-
}
|
|
3240
|
-
mount() {
|
|
3241
|
-
this.removePointerDownListener = Ft(this.node.current, "pointerdown", (e) => this.onPointerDown(e));
|
|
3242
|
-
}
|
|
3243
|
-
update() {
|
|
3244
|
-
this.session && this.session.updateHandlers(this.createPanHandlers());
|
|
3245
|
-
}
|
|
3246
|
-
unmount() {
|
|
3247
|
-
this.removePointerDownListener(), this.session && this.session.end();
|
|
3248
|
-
}
|
|
3249
|
-
}
|
|
3250
|
-
const ee = {
|
|
3251
|
-
/**
|
|
3252
|
-
* Global flag as to whether the tree has animated since the last time
|
|
3253
|
-
* we resized the window
|
|
3254
|
-
*/
|
|
3255
|
-
hasAnimatedSinceResize: !0,
|
|
3256
|
-
/**
|
|
3257
|
-
* We set this to true once, on the first update. Any nodes added to the tree beyond that
|
|
3258
|
-
* update will be given a `data-projection-id` attribute.
|
|
3259
|
-
*/
|
|
3260
|
-
hasEverUpdated: !1
|
|
3261
|
-
};
|
|
3262
|
-
function As(t, e) {
|
|
3263
|
-
return e.max === e.min ? 0 : t / (e.max - e.min) * 100;
|
|
3264
|
-
}
|
|
3265
|
-
const Mt = {
|
|
3266
|
-
correct: (t, e) => {
|
|
3267
|
-
if (!e.target)
|
|
3268
|
-
return t;
|
|
3269
|
-
if (typeof t == "string")
|
|
3270
|
-
if (S.test(t))
|
|
3271
|
-
t = parseFloat(t);
|
|
3272
|
-
else
|
|
3273
|
-
return t;
|
|
3274
|
-
const n = As(t, e.target.x), s = As(t, e.target.y);
|
|
3275
|
-
return `${n}% ${s}%`;
|
|
3276
|
-
}
|
|
3277
|
-
}, iu = {
|
|
3278
|
-
correct: (t, { treeScale: e, projectionDelta: n }) => {
|
|
3279
|
-
const s = t, i = Q.parse(t);
|
|
3280
|
-
if (i.length > 5)
|
|
3281
|
-
return s;
|
|
3282
|
-
const r = Q.createTransformer(t), o = typeof i[0] != "number" ? 1 : 0, a = n.x.scale * e.x, l = n.y.scale * e.y;
|
|
3283
|
-
i[0 + o] /= a, i[1 + o] /= l;
|
|
3284
|
-
const u = M(a, l, 0.5);
|
|
3285
|
-
return typeof i[2 + o] == "number" && (i[2 + o] /= u), typeof i[3 + o] == "number" && (i[3 + o] /= u), r(i);
|
|
3286
|
-
}
|
|
3287
|
-
};
|
|
3288
|
-
class ou extends tr {
|
|
3289
|
-
/**
|
|
3290
|
-
* This only mounts projection nodes for components that
|
|
3291
|
-
* need measuring, we might want to do it for all components
|
|
3292
|
-
* in order to incorporate transforms
|
|
3293
|
-
*/
|
|
3294
|
-
componentDidMount() {
|
|
3295
|
-
const { visualElement: e, layoutGroup: n, switchLayoutGroup: s, layoutId: i } = this.props, { projection: r } = e;
|
|
3296
|
-
Kr(ru), r && (n.group && n.group.add(r), s && s.register && i && s.register(r), r.root.didUpdate(), r.addEventListener("animationComplete", () => {
|
|
3297
|
-
this.safeToRemove();
|
|
3298
|
-
}), r.setOptions({
|
|
3299
|
-
...r.options,
|
|
3300
|
-
onExitComplete: () => this.safeToRemove()
|
|
3301
|
-
})), ee.hasEverUpdated = !0;
|
|
3302
|
-
}
|
|
3303
|
-
getSnapshotBeforeUpdate(e) {
|
|
3304
|
-
const { layoutDependency: n, visualElement: s, drag: i, isPresent: r } = this.props, o = s.projection;
|
|
3305
|
-
return o && (o.isPresent = r, i || e.layoutDependency !== n || n === void 0 ? o.willUpdate() : this.safeToRemove(), e.isPresent !== r && (r ? o.promote() : o.relegate() || D.postRender(() => {
|
|
3306
|
-
const a = o.getStack();
|
|
3307
|
-
(!a || !a.members.length) && this.safeToRemove();
|
|
3308
|
-
}))), null;
|
|
3309
|
-
}
|
|
3310
|
-
componentDidUpdate() {
|
|
3311
|
-
const { projection: e } = this.props.visualElement;
|
|
3312
|
-
e && (e.root.didUpdate(), on.postRender(() => {
|
|
3313
|
-
!e.currentAnimation && e.isLead() && this.safeToRemove();
|
|
3314
|
-
}));
|
|
3315
|
-
}
|
|
3316
|
-
componentWillUnmount() {
|
|
3317
|
-
const { visualElement: e, layoutGroup: n, switchLayoutGroup: s } = this.props, { projection: i } = e;
|
|
3318
|
-
i && (i.scheduleCheckAfterUnmount(), n && n.group && n.group.remove(i), s && s.deregister && s.deregister(i));
|
|
3319
|
-
}
|
|
3320
|
-
safeToRemove() {
|
|
3321
|
-
const { safeToRemove: e } = this.props;
|
|
3322
|
-
e && e();
|
|
3323
|
-
}
|
|
3324
|
-
render() {
|
|
3325
|
-
return null;
|
|
3326
|
-
}
|
|
3327
|
-
}
|
|
3328
|
-
function go(t) {
|
|
3329
|
-
const [e, n] = si(), s = k(Qe);
|
|
3330
|
-
return Y.jsx(ou, { ...t, layoutGroup: s, switchLayoutGroup: k(ui), isPresent: e, safeToRemove: n });
|
|
3331
|
-
}
|
|
3332
|
-
const ru = {
|
|
3333
|
-
borderRadius: {
|
|
3334
|
-
...Mt,
|
|
3335
|
-
applyTo: [
|
|
3336
|
-
"borderTopLeftRadius",
|
|
3337
|
-
"borderTopRightRadius",
|
|
3338
|
-
"borderBottomLeftRadius",
|
|
3339
|
-
"borderBottomRightRadius"
|
|
3340
|
-
]
|
|
3341
|
-
},
|
|
3342
|
-
borderTopLeftRadius: Mt,
|
|
3343
|
-
borderTopRightRadius: Mt,
|
|
3344
|
-
borderBottomLeftRadius: Mt,
|
|
3345
|
-
borderBottomRightRadius: Mt,
|
|
3346
|
-
boxShadow: iu
|
|
3347
|
-
};
|
|
3348
|
-
function yo(t, e, n) {
|
|
3349
|
-
const s = L(t) ? t : xt(t);
|
|
3350
|
-
return s.start(wn("", s, e, n)), s.animation;
|
|
3351
|
-
}
|
|
3352
|
-
function vo(t) {
|
|
3353
|
-
return t instanceof SVGElement && t.tagName !== "svg";
|
|
3354
|
-
}
|
|
3355
|
-
const au = (t, e) => t.depth - e.depth;
|
|
3356
|
-
class lu {
|
|
3357
|
-
constructor() {
|
|
3358
|
-
this.children = [], this.isDirty = !1;
|
|
3359
|
-
}
|
|
3360
|
-
add(e) {
|
|
3361
|
-
mn(this.children, e), this.isDirty = !0;
|
|
3362
|
-
}
|
|
3363
|
-
remove(e) {
|
|
3364
|
-
ge(this.children, e), this.isDirty = !0;
|
|
3365
|
-
}
|
|
3366
|
-
forEach(e) {
|
|
3367
|
-
this.isDirty && this.children.sort(au), this.isDirty = !1, this.children.forEach(e);
|
|
3368
|
-
}
|
|
3369
|
-
}
|
|
3370
|
-
function uu(t, e) {
|
|
3371
|
-
const n = H.now(), s = ({ timestamp: i }) => {
|
|
3372
|
-
const r = i - n;
|
|
3373
|
-
r >= e && (q(s), t(r - e));
|
|
3374
|
-
};
|
|
3375
|
-
return D.read(s, !0), () => q(s);
|
|
3376
|
-
}
|
|
3377
|
-
const xo = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], cu = xo.length, bs = (t) => typeof t == "string" ? parseFloat(t) : t, Vs = (t) => typeof t == "number" || S.test(t);
|
|
3378
|
-
function hu(t, e, n, s, i, r) {
|
|
3379
|
-
i ? (t.opacity = M(
|
|
3380
|
-
0,
|
|
3381
|
-
// TODO Reinstate this if only child
|
|
3382
|
-
n.opacity !== void 0 ? n.opacity : 1,
|
|
3383
|
-
fu(s)
|
|
3384
|
-
), t.opacityExit = M(e.opacity !== void 0 ? e.opacity : 1, 0, du(s))) : r && (t.opacity = M(e.opacity !== void 0 ? e.opacity : 1, n.opacity !== void 0 ? n.opacity : 1, s));
|
|
3385
|
-
for (let o = 0; o < cu; o++) {
|
|
3386
|
-
const a = `border${xo[o]}Radius`;
|
|
3387
|
-
let l = ws(e, a), u = ws(n, a);
|
|
3388
|
-
if (l === void 0 && u === void 0)
|
|
3389
|
-
continue;
|
|
3390
|
-
l || (l = 0), u || (u = 0), l === 0 || u === 0 || Vs(l) === Vs(u) ? (t[a] = Math.max(M(bs(l), bs(u), s), 0), (z.test(u) || z.test(l)) && (t[a] += "%")) : t[a] = u;
|
|
3391
|
-
}
|
|
3392
|
-
(e.rotate || n.rotate) && (t.rotate = M(e.rotate || 0, n.rotate || 0, s));
|
|
3393
|
-
}
|
|
3394
|
-
function ws(t, e) {
|
|
3395
|
-
return t[e] !== void 0 ? t[e] : t.borderRadius;
|
|
3396
|
-
}
|
|
3397
|
-
const fu = /* @__PURE__ */ To(0, 0.5, Li), du = /* @__PURE__ */ To(0.5, 0.95, K);
|
|
3398
|
-
function To(t, e, n) {
|
|
3399
|
-
return (s) => s < t ? 0 : s > e ? 1 : n(yt(t, e, s));
|
|
3400
|
-
}
|
|
3401
|
-
function Ds(t, e) {
|
|
3402
|
-
t.min = e.min, t.max = e.max;
|
|
3403
|
-
}
|
|
3404
|
-
function U(t, e) {
|
|
3405
|
-
Ds(t.x, e.x), Ds(t.y, e.y);
|
|
3406
|
-
}
|
|
3407
|
-
function Cs(t, e) {
|
|
3408
|
-
t.translate = e.translate, t.scale = e.scale, t.originPoint = e.originPoint, t.origin = e.origin;
|
|
3409
|
-
}
|
|
3410
|
-
function Ms(t, e, n, s, i) {
|
|
3411
|
-
return t -= e, t = ae(t, 1 / n, s), i !== void 0 && (t = ae(t, 1 / i, s)), t;
|
|
3412
|
-
}
|
|
3413
|
-
function pu(t, e = 0, n = 1, s = 0.5, i, r = t, o = t) {
|
|
3414
|
-
if (z.test(e) && (e = parseFloat(e), e = M(o.min, o.max, e / 100) - o.min), typeof e != "number")
|
|
3415
|
-
return;
|
|
3416
|
-
let a = M(r.min, r.max, s);
|
|
3417
|
-
t === r && (a -= e), t.min = Ms(t.min, e, n, a, i), t.max = Ms(t.max, e, n, a, i);
|
|
3418
|
-
}
|
|
3419
|
-
function Rs(t, e, [n, s, i], r, o) {
|
|
3420
|
-
pu(t, e[n], e[s], e[i], e.scale, r, o);
|
|
3421
|
-
}
|
|
3422
|
-
const mu = ["x", "scaleX", "originX"], gu = ["y", "scaleY", "originY"];
|
|
3423
|
-
function Es(t, e, n, s) {
|
|
3424
|
-
Rs(t.x, e, mu, n ? n.x : void 0, s ? s.x : void 0), Rs(t.y, e, gu, n ? n.y : void 0, s ? s.y : void 0);
|
|
3425
|
-
}
|
|
3426
|
-
function Ls(t) {
|
|
3427
|
-
return t.translate === 0 && t.scale === 1;
|
|
3428
|
-
}
|
|
3429
|
-
function So(t) {
|
|
3430
|
-
return Ls(t.x) && Ls(t.y);
|
|
3431
|
-
}
|
|
3432
|
-
function Fs(t, e) {
|
|
3433
|
-
return t.min === e.min && t.max === e.max;
|
|
3434
|
-
}
|
|
3435
|
-
function yu(t, e) {
|
|
3436
|
-
return Fs(t.x, e.x) && Fs(t.y, e.y);
|
|
3437
|
-
}
|
|
3438
|
-
function Bs(t, e) {
|
|
3439
|
-
return Math.round(t.min) === Math.round(e.min) && Math.round(t.max) === Math.round(e.max);
|
|
3440
|
-
}
|
|
3441
|
-
function Po(t, e) {
|
|
3442
|
-
return Bs(t.x, e.x) && Bs(t.y, e.y);
|
|
3443
|
-
}
|
|
3444
|
-
function ks(t) {
|
|
3445
|
-
return N(t.x) / N(t.y);
|
|
3446
|
-
}
|
|
3447
|
-
function Os(t, e) {
|
|
3448
|
-
return t.translate === e.translate && t.scale === e.scale && t.originPoint === e.originPoint;
|
|
3449
|
-
}
|
|
3450
|
-
class vu {
|
|
3451
|
-
constructor() {
|
|
3452
|
-
this.members = [];
|
|
3453
|
-
}
|
|
3454
|
-
add(e) {
|
|
3455
|
-
mn(this.members, e), e.scheduleRender();
|
|
3456
|
-
}
|
|
3457
|
-
remove(e) {
|
|
3458
|
-
if (ge(this.members, e), e === this.prevLead && (this.prevLead = void 0), e === this.lead) {
|
|
3459
|
-
const n = this.members[this.members.length - 1];
|
|
3460
|
-
n && this.promote(n);
|
|
3461
|
-
}
|
|
3462
|
-
}
|
|
3463
|
-
relegate(e) {
|
|
3464
|
-
const n = this.members.findIndex((i) => e === i);
|
|
3465
|
-
if (n === 0)
|
|
3466
|
-
return !1;
|
|
3467
|
-
let s;
|
|
3468
|
-
for (let i = n; i >= 0; i--) {
|
|
3469
|
-
const r = this.members[i];
|
|
3470
|
-
if (r.isPresent !== !1) {
|
|
3471
|
-
s = r;
|
|
3472
|
-
break;
|
|
3473
|
-
}
|
|
3474
|
-
}
|
|
3475
|
-
return s ? (this.promote(s), !0) : !1;
|
|
3476
|
-
}
|
|
3477
|
-
promote(e, n) {
|
|
3478
|
-
const s = this.lead;
|
|
3479
|
-
if (e !== s && (this.prevLead = s, this.lead = e, e.show(), s)) {
|
|
3480
|
-
s.instance && s.scheduleRender(), e.scheduleRender(), e.resumeFrom = s, n && (e.resumeFrom.preserveOpacity = !0), s.snapshot && (e.snapshot = s.snapshot, e.snapshot.latestValues = s.animationValues || s.latestValues), e.root && e.root.isUpdating && (e.isLayoutDirty = !0);
|
|
3481
|
-
const { crossfade: i } = e.options;
|
|
3482
|
-
i === !1 && s.hide();
|
|
3483
|
-
}
|
|
3484
|
-
}
|
|
3485
|
-
exitAnimationComplete() {
|
|
3486
|
-
this.members.forEach((e) => {
|
|
3487
|
-
const { options: n, resumingFrom: s } = e;
|
|
3488
|
-
n.onExitComplete && n.onExitComplete(), s && s.options.onExitComplete && s.options.onExitComplete();
|
|
3489
|
-
});
|
|
3490
|
-
}
|
|
3491
|
-
scheduleRender() {
|
|
3492
|
-
this.members.forEach((e) => {
|
|
3493
|
-
e.instance && e.scheduleRender(!1);
|
|
3494
|
-
});
|
|
3495
|
-
}
|
|
3496
|
-
/**
|
|
3497
|
-
* Clear any leads that have been removed this render to prevent them from being
|
|
3498
|
-
* used in future animations and to prevent memory leaks
|
|
3499
|
-
*/
|
|
3500
|
-
removeLeadSnapshot() {
|
|
3501
|
-
this.lead && this.lead.snapshot && (this.lead.snapshot = void 0);
|
|
3502
|
-
}
|
|
3503
|
-
}
|
|
3504
|
-
function xu(t, e, n) {
|
|
3505
|
-
let s = "";
|
|
3506
|
-
const i = t.x.translate / e.x, r = t.y.translate / e.y, o = n?.z || 0;
|
|
3507
|
-
if ((i || r || o) && (s = `translate3d(${i}px, ${r}px, ${o}px) `), (e.x !== 1 || e.y !== 1) && (s += `scale(${1 / e.x}, ${1 / e.y}) `), n) {
|
|
3508
|
-
const { transformPerspective: u, rotate: c, rotateX: h, rotateY: f, skewX: d, skewY: p } = n;
|
|
3509
|
-
u && (s = `perspective(${u}px) ${s}`), c && (s += `rotate(${c}deg) `), h && (s += `rotateX(${h}deg) `), f && (s += `rotateY(${f}deg) `), d && (s += `skewX(${d}deg) `), p && (s += `skewY(${p}deg) `);
|
|
3510
|
-
}
|
|
3511
|
-
const a = t.x.scale * e.x, l = t.y.scale * e.y;
|
|
3512
|
-
return (a !== 1 || l !== 1) && (s += `scale(${a}, ${l})`), s || "none";
|
|
3513
|
-
}
|
|
3514
|
-
const it = {
|
|
3515
|
-
type: "projectionFrame",
|
|
3516
|
-
totalNodes: 0,
|
|
3517
|
-
resolvedTargetDeltas: 0,
|
|
3518
|
-
recalculatedProjection: 0
|
|
3519
|
-
}, Rt = typeof window < "u" && window.MotionDebug !== void 0, Ce = ["", "X", "Y", "Z"], Tu = { visibility: "hidden" }, js = 1e3;
|
|
3520
|
-
let Su = 0;
|
|
3521
|
-
function Me(t, e, n, s) {
|
|
3522
|
-
const { latestValues: i } = e;
|
|
3523
|
-
i[t] && (n[t] = i[t], e.setStaticValue(t, 0), s && (s[t] = 0));
|
|
3524
|
-
}
|
|
3525
|
-
function Ao(t) {
|
|
3526
|
-
if (t.hasCheckedOptimisedAppear = !0, t.root === t)
|
|
3527
|
-
return;
|
|
3528
|
-
const { visualElement: e } = t.options;
|
|
3529
|
-
if (!e)
|
|
3530
|
-
return;
|
|
3531
|
-
const n = Vi(e);
|
|
3532
|
-
if (window.MotionHasOptimisedAnimation(n, "transform")) {
|
|
3533
|
-
const { layout: i, layoutId: r } = t.options;
|
|
3534
|
-
window.MotionCancelOptimisedAnimation(n, "transform", D, !(i || r));
|
|
3535
|
-
}
|
|
3536
|
-
const { parent: s } = t;
|
|
3537
|
-
s && !s.hasCheckedOptimisedAppear && Ao(s);
|
|
3538
|
-
}
|
|
3539
|
-
function bo({ attachResizeListener: t, defaultParent: e, measureScroll: n, checkIsScrollRoot: s, resetTransform: i }) {
|
|
3540
|
-
return class {
|
|
3541
|
-
constructor(o = {}, a = e?.()) {
|
|
3542
|
-
this.id = Su++, this.animationId = 0, this.children = /* @__PURE__ */ new Set(), this.options = {}, this.isTreeAnimating = !1, this.isAnimationBlocked = !1, this.isLayoutDirty = !1, this.isProjectionDirty = !1, this.isSharedProjectionDirty = !1, this.isTransformDirty = !1, this.updateManuallyBlocked = !1, this.updateBlockedByResize = !1, this.isUpdating = !1, this.isSVG = !1, this.needsReset = !1, this.shouldResetTransform = !1, this.hasCheckedOptimisedAppear = !1, this.treeScale = { x: 1, y: 1 }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = !1, this.updateScheduled = !1, this.scheduleUpdate = () => this.update(), this.projectionUpdateScheduled = !1, this.checkUpdateFailed = () => {
|
|
3543
|
-
this.isUpdating && (this.isUpdating = !1, this.clearAllSnapshots());
|
|
3544
|
-
}, this.updateProjection = () => {
|
|
3545
|
-
this.projectionUpdateScheduled = !1, Rt && (it.totalNodes = it.resolvedTargetDeltas = it.recalculatedProjection = 0), this.nodes.forEach(bu), this.nodes.forEach(Mu), this.nodes.forEach(Ru), this.nodes.forEach(Vu), Rt && window.MotionDebug.record(it);
|
|
3546
|
-
}, this.resolvedRelativeTargetAt = 0, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = o, this.root = a ? a.root || a : this, this.path = a ? [...a.path, a] : [], this.parent = a, this.depth = a ? a.depth + 1 : 0;
|
|
3547
|
-
for (let l = 0; l < this.path.length; l++)
|
|
3548
|
-
this.path[l].shouldResetTransform = !0;
|
|
3549
|
-
this.root === this && (this.nodes = new lu());
|
|
3550
|
-
}
|
|
3551
|
-
addEventListener(o, a) {
|
|
3552
|
-
return this.eventHandlers.has(o) || this.eventHandlers.set(o, new gn()), this.eventHandlers.get(o).add(a);
|
|
3553
|
-
}
|
|
3554
|
-
notifyListeners(o, ...a) {
|
|
3555
|
-
const l = this.eventHandlers.get(o);
|
|
3556
|
-
l && l.notify(...a);
|
|
3557
|
-
}
|
|
3558
|
-
hasListeners(o) {
|
|
3559
|
-
return this.eventHandlers.has(o);
|
|
3560
|
-
}
|
|
3561
|
-
/**
|
|
3562
|
-
* Lifecycles
|
|
3563
|
-
*/
|
|
3564
|
-
mount(o, a = this.root.hasTreeAnimated) {
|
|
3565
|
-
if (this.instance)
|
|
3566
|
-
return;
|
|
3567
|
-
this.isSVG = vo(o), this.instance = o;
|
|
3568
|
-
const { layoutId: l, layout: u, visualElement: c } = this.options;
|
|
3569
|
-
if (c && !c.current && c.mount(o), this.root.nodes.add(this), this.parent && this.parent.children.add(this), a && (u || l) && (this.isLayoutDirty = !0), t) {
|
|
3570
|
-
let h;
|
|
3571
|
-
const f = () => this.root.updateBlockedByResize = !1;
|
|
3572
|
-
t(o, () => {
|
|
3573
|
-
this.root.updateBlockedByResize = !0, h && h(), h = uu(f, 250), ee.hasAnimatedSinceResize && (ee.hasAnimatedSinceResize = !1, this.nodes.forEach(Ns));
|
|
3574
|
-
});
|
|
3575
|
-
}
|
|
3576
|
-
l && this.root.registerSharedNode(l, this), this.options.animate !== !1 && c && (l || u) && this.addEventListener("didUpdate", ({ delta: h, hasLayoutChanged: f, hasRelativeTargetChanged: d, layout: p }) => {
|
|
3577
|
-
if (this.isTreeAnimationBlocked()) {
|
|
3578
|
-
this.target = void 0, this.relativeTarget = void 0;
|
|
3579
|
-
return;
|
|
3580
|
-
}
|
|
3581
|
-
const m = this.options.transition || c.getDefaultTransition() || ku, { onLayoutAnimationStart: y, onLayoutAnimationComplete: g } = c.getProps(), v = !this.targetLayout || !Po(this.targetLayout, p) || d, T = !f && d;
|
|
3582
|
-
if (this.options.layoutRoot || this.resumeFrom && this.resumeFrom.instance || T || f && (v || !this.currentAnimation)) {
|
|
3583
|
-
this.resumeFrom && (this.resumingFrom = this.resumeFrom, this.resumingFrom.resumingFrom = void 0), this.setAnimationOrigin(h, T);
|
|
3584
|
-
const P = {
|
|
3585
|
-
...Ye(m, "layout"),
|
|
3586
|
-
onPlay: y,
|
|
3587
|
-
onComplete: g
|
|
3588
|
-
};
|
|
3589
|
-
(c.shouldReduceMotion || this.options.layoutRoot) && (P.delay = 0, P.type = !1), this.startAnimation(P);
|
|
3590
|
-
} else
|
|
3591
|
-
f || Ns(this), this.isLead() && this.options.onExitComplete && this.options.onExitComplete();
|
|
3592
|
-
this.targetLayout = p;
|
|
3593
|
-
});
|
|
3594
|
-
}
|
|
3595
|
-
unmount() {
|
|
3596
|
-
this.options.layoutId && this.willUpdate(), this.root.nodes.remove(this);
|
|
3597
|
-
const o = this.getStack();
|
|
3598
|
-
o && o.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0, q(this.updateProjection);
|
|
3599
|
-
}
|
|
3600
|
-
// only on the root
|
|
3601
|
-
blockUpdate() {
|
|
3602
|
-
this.updateManuallyBlocked = !0;
|
|
3603
|
-
}
|
|
3604
|
-
unblockUpdate() {
|
|
3605
|
-
this.updateManuallyBlocked = !1;
|
|
3606
|
-
}
|
|
3607
|
-
isUpdateBlocked() {
|
|
3608
|
-
return this.updateManuallyBlocked || this.updateBlockedByResize;
|
|
3609
|
-
}
|
|
3610
|
-
isTreeAnimationBlocked() {
|
|
3611
|
-
return this.isAnimationBlocked || this.parent && this.parent.isTreeAnimationBlocked() || !1;
|
|
3612
|
-
}
|
|
3613
|
-
// Note: currently only running on root node
|
|
3614
|
-
startUpdate() {
|
|
3615
|
-
this.isUpdateBlocked() || (this.isUpdating = !0, this.nodes && this.nodes.forEach(Eu), this.animationId++);
|
|
3616
|
-
}
|
|
3617
|
-
getTransformTemplate() {
|
|
3618
|
-
const { visualElement: o } = this.options;
|
|
3619
|
-
return o && o.getProps().transformTemplate;
|
|
3620
|
-
}
|
|
3621
|
-
willUpdate(o = !0) {
|
|
3622
|
-
if (this.root.hasTreeAnimated = !0, this.root.isUpdateBlocked()) {
|
|
3623
|
-
this.options.onExitComplete && this.options.onExitComplete();
|
|
3624
|
-
return;
|
|
3625
|
-
}
|
|
3626
|
-
if (window.MotionCancelOptimisedAnimation && !this.hasCheckedOptimisedAppear && Ao(this), !this.root.isUpdating && this.root.startUpdate(), this.isLayoutDirty)
|
|
3627
|
-
return;
|
|
3628
|
-
this.isLayoutDirty = !0;
|
|
3629
|
-
for (let c = 0; c < this.path.length; c++) {
|
|
3630
|
-
const h = this.path[c];
|
|
3631
|
-
h.shouldResetTransform = !0, h.updateScroll("snapshot"), h.options.layoutRoot && h.willUpdate(!1);
|
|
3632
|
-
}
|
|
3633
|
-
const { layoutId: a, layout: l } = this.options;
|
|
3634
|
-
if (a === void 0 && !l)
|
|
3635
|
-
return;
|
|
3636
|
-
const u = this.getTransformTemplate();
|
|
3637
|
-
this.prevTransformTemplateValue = u ? u(this.latestValues, "") : void 0, this.updateSnapshot(), o && this.notifyListeners("willUpdate");
|
|
3638
|
-
}
|
|
3639
|
-
update() {
|
|
3640
|
-
if (this.updateScheduled = !1, this.isUpdateBlocked()) {
|
|
3641
|
-
this.unblockUpdate(), this.clearAllSnapshots(), this.nodes.forEach(Is);
|
|
3642
|
-
return;
|
|
3643
|
-
}
|
|
3644
|
-
this.isUpdating || this.nodes.forEach(Du), this.isUpdating = !1, this.nodes.forEach(Cu), this.nodes.forEach(Pu), this.nodes.forEach(Au), this.clearAllSnapshots();
|
|
3645
|
-
const a = H.now();
|
|
3646
|
-
B.delta = Z(0, 1e3 / 60, a - B.timestamp), B.timestamp = a, B.isProcessing = !0, Te.update.process(B), Te.preRender.process(B), Te.render.process(B), B.isProcessing = !1;
|
|
3647
|
-
}
|
|
3648
|
-
didUpdate() {
|
|
3649
|
-
this.updateScheduled || (this.updateScheduled = !0, on.read(this.scheduleUpdate));
|
|
3650
|
-
}
|
|
3651
|
-
clearAllSnapshots() {
|
|
3652
|
-
this.nodes.forEach(wu), this.sharedNodes.forEach(Lu);
|
|
3653
|
-
}
|
|
3654
|
-
scheduleUpdateProjection() {
|
|
3655
|
-
this.projectionUpdateScheduled || (this.projectionUpdateScheduled = !0, D.preRender(this.updateProjection, !1, !0));
|
|
3656
|
-
}
|
|
3657
|
-
scheduleCheckAfterUnmount() {
|
|
3658
|
-
D.postRender(() => {
|
|
3659
|
-
this.isLayoutDirty ? this.root.didUpdate() : this.root.checkUpdateFailed();
|
|
3660
|
-
});
|
|
3661
|
-
}
|
|
3662
|
-
/**
|
|
3663
|
-
* Update measurements
|
|
3664
|
-
*/
|
|
3665
|
-
updateSnapshot() {
|
|
3666
|
-
this.snapshot || !this.instance || (this.snapshot = this.measure());
|
|
3667
|
-
}
|
|
3668
|
-
updateLayout() {
|
|
3669
|
-
if (!this.instance || (this.updateScroll(), !(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty))
|
|
3670
|
-
return;
|
|
3671
|
-
if (this.resumeFrom && !this.resumeFrom.instance)
|
|
3672
|
-
for (let l = 0; l < this.path.length; l++)
|
|
3673
|
-
this.path[l].updateScroll();
|
|
3674
|
-
const o = this.layout;
|
|
3675
|
-
this.layout = this.measure(!1), this.layoutCorrected = E(), this.isLayoutDirty = !1, this.projectionDelta = void 0, this.notifyListeners("measure", this.layout.layoutBox);
|
|
3676
|
-
const { visualElement: a } = this.options;
|
|
3677
|
-
a && a.notify("LayoutMeasure", this.layout.layoutBox, o ? o.layoutBox : void 0);
|
|
3678
|
-
}
|
|
3679
|
-
updateScroll(o = "measure") {
|
|
3680
|
-
let a = !!(this.options.layoutScroll && this.instance);
|
|
3681
|
-
if (this.scroll && this.scroll.animationId === this.root.animationId && this.scroll.phase === o && (a = !1), a) {
|
|
3682
|
-
const l = s(this.instance);
|
|
3683
|
-
this.scroll = {
|
|
3684
|
-
animationId: this.root.animationId,
|
|
3685
|
-
phase: o,
|
|
3686
|
-
isRoot: l,
|
|
3687
|
-
offset: n(this.instance),
|
|
3688
|
-
wasRoot: this.scroll ? this.scroll.isRoot : l
|
|
3689
|
-
};
|
|
3690
|
-
}
|
|
3691
|
-
}
|
|
3692
|
-
resetTransform() {
|
|
3693
|
-
if (!i)
|
|
3694
|
-
return;
|
|
3695
|
-
const o = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout, a = this.projectionDelta && !So(this.projectionDelta), l = this.getTransformTemplate(), u = l ? l(this.latestValues, "") : void 0, c = u !== this.prevTransformTemplateValue;
|
|
3696
|
-
o && (a || st(this.latestValues) || c) && (i(this.instance, u), this.shouldResetTransform = !1, this.scheduleRender());
|
|
3697
|
-
}
|
|
3698
|
-
measure(o = !0) {
|
|
3699
|
-
const a = this.measurePageBox();
|
|
3700
|
-
let l = this.removeElementScroll(a);
|
|
3701
|
-
return o && (l = this.removeTransform(l)), Ou(l), {
|
|
3702
|
-
animationId: this.root.animationId,
|
|
3703
|
-
measuredBox: a,
|
|
3704
|
-
layoutBox: l,
|
|
3705
|
-
latestValues: {},
|
|
3706
|
-
source: this.id
|
|
3707
|
-
};
|
|
3708
|
-
}
|
|
3709
|
-
measurePageBox() {
|
|
3710
|
-
var o;
|
|
3711
|
-
const { visualElement: a } = this.options;
|
|
3712
|
-
if (!a)
|
|
3713
|
-
return E();
|
|
3714
|
-
const l = a.measureViewportBox();
|
|
3715
|
-
if (!(((o = this.scroll) === null || o === void 0 ? void 0 : o.wasRoot) || this.path.some(ju))) {
|
|
3716
|
-
const { scroll: c } = this.root;
|
|
3717
|
-
c && (mt(l.x, c.offset.x), mt(l.y, c.offset.y));
|
|
3718
|
-
}
|
|
3719
|
-
return l;
|
|
3720
|
-
}
|
|
3721
|
-
removeElementScroll(o) {
|
|
3722
|
-
var a;
|
|
3723
|
-
const l = E();
|
|
3724
|
-
if (U(l, o), !((a = this.scroll) === null || a === void 0) && a.wasRoot)
|
|
3725
|
-
return l;
|
|
3726
|
-
for (let u = 0; u < this.path.length; u++) {
|
|
3727
|
-
const c = this.path[u], { scroll: h, options: f } = c;
|
|
3728
|
-
c !== this.root && h && f.layoutScroll && (h.wasRoot && U(l, o), mt(l.x, h.offset.x), mt(l.y, h.offset.y));
|
|
3729
|
-
}
|
|
3730
|
-
return l;
|
|
3731
|
-
}
|
|
3732
|
-
applyTransform(o, a = !1) {
|
|
3733
|
-
const l = E();
|
|
3734
|
-
U(l, o);
|
|
3735
|
-
for (let u = 0; u < this.path.length; u++) {
|
|
3736
|
-
const c = this.path[u];
|
|
3737
|
-
!a && c.options.layoutScroll && c.scroll && c !== c.root && gt(l, {
|
|
3738
|
-
x: -c.scroll.offset.x,
|
|
3739
|
-
y: -c.scroll.offset.y
|
|
3740
|
-
}), st(c.latestValues) && gt(l, c.latestValues);
|
|
3741
|
-
}
|
|
3742
|
-
return st(this.latestValues) && gt(l, this.latestValues), l;
|
|
3743
|
-
}
|
|
3744
|
-
removeTransform(o) {
|
|
3745
|
-
const a = E();
|
|
3746
|
-
U(a, o);
|
|
3747
|
-
for (let l = 0; l < this.path.length; l++) {
|
|
3748
|
-
const u = this.path[l];
|
|
3749
|
-
if (!u.instance || !st(u.latestValues))
|
|
3750
|
-
continue;
|
|
3751
|
-
$e(u.latestValues) && u.updateSnapshot();
|
|
3752
|
-
const c = E(), h = u.measurePageBox();
|
|
3753
|
-
U(c, h), Es(a, u.latestValues, u.snapshot ? u.snapshot.layoutBox : void 0, c);
|
|
3754
|
-
}
|
|
3755
|
-
return st(this.latestValues) && Es(a, this.latestValues), a;
|
|
3756
|
-
}
|
|
3757
|
-
setTargetDelta(o) {
|
|
3758
|
-
this.targetDelta = o, this.root.scheduleUpdateProjection(), this.isProjectionDirty = !0;
|
|
3759
|
-
}
|
|
3760
|
-
setOptions(o) {
|
|
3761
|
-
this.options = {
|
|
3762
|
-
...this.options,
|
|
3763
|
-
...o,
|
|
3764
|
-
crossfade: o.crossfade !== void 0 ? o.crossfade : !0
|
|
3765
|
-
};
|
|
3766
|
-
}
|
|
3767
|
-
clearMeasurements() {
|
|
3768
|
-
this.scroll = void 0, this.layout = void 0, this.snapshot = void 0, this.prevTransformTemplateValue = void 0, this.targetDelta = void 0, this.target = void 0, this.isLayoutDirty = !1;
|
|
3769
|
-
}
|
|
3770
|
-
forceRelativeParentToResolveTarget() {
|
|
3771
|
-
this.relativeParent && this.relativeParent.resolvedRelativeTargetAt !== B.timestamp && this.relativeParent.resolveTargetDelta(!0);
|
|
3772
|
-
}
|
|
3773
|
-
resolveTargetDelta(o = !1) {
|
|
3774
|
-
var a;
|
|
3775
|
-
const l = this.getLead();
|
|
3776
|
-
this.isProjectionDirty || (this.isProjectionDirty = l.isProjectionDirty), this.isTransformDirty || (this.isTransformDirty = l.isTransformDirty), this.isSharedProjectionDirty || (this.isSharedProjectionDirty = l.isSharedProjectionDirty);
|
|
3777
|
-
const u = !!this.resumingFrom || this !== l;
|
|
3778
|
-
if (!(o || u && this.isSharedProjectionDirty || this.isProjectionDirty || !((a = this.parent) === null || a === void 0) && a.isProjectionDirty || this.attemptToResolveRelativeTarget || this.root.updateBlockedByResize))
|
|
3779
|
-
return;
|
|
3780
|
-
const { layout: h, layoutId: f } = this.options;
|
|
3781
|
-
if (!(!this.layout || !(h || f))) {
|
|
3782
|
-
if (this.resolvedRelativeTargetAt = B.timestamp, !this.targetDelta && !this.relativeTarget) {
|
|
3783
|
-
const d = this.getClosestProjectingParent();
|
|
3784
|
-
d && d.layout && this.animationProgress !== 1 ? (this.relativeParent = d, this.forceRelativeParentToResolveTarget(), this.relativeTarget = E(), this.relativeTargetOrigin = E(), kt(this.relativeTargetOrigin, this.layout.layoutBox, d.layout.layoutBox), U(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
3785
|
-
}
|
|
3786
|
-
if (!(!this.relativeTarget && !this.targetDelta)) {
|
|
3787
|
-
if (this.target || (this.target = E(), this.targetWithTransforms = E()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), Kl(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) : U(this.target, this.layout.layoutBox), fo(this.target, this.targetDelta)) : U(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget) {
|
|
3788
|
-
this.attemptToResolveRelativeTarget = !1;
|
|
3789
|
-
const d = this.getClosestProjectingParent();
|
|
3790
|
-
d && !!d.resumingFrom == !!this.resumingFrom && !d.options.layoutScroll && d.target && this.animationProgress !== 1 ? (this.relativeParent = d, this.forceRelativeParentToResolveTarget(), this.relativeTarget = E(), this.relativeTargetOrigin = E(), kt(this.relativeTargetOrigin, this.target, d.target), U(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
|
|
3791
|
-
}
|
|
3792
|
-
Rt && it.resolvedTargetDeltas++;
|
|
3793
|
-
}
|
|
3794
|
-
}
|
|
3795
|
-
}
|
|
3796
|
-
getClosestProjectingParent() {
|
|
3797
|
-
if (!(!this.parent || $e(this.parent.latestValues) || ho(this.parent.latestValues)))
|
|
3798
|
-
return this.parent.isProjecting() ? this.parent : this.parent.getClosestProjectingParent();
|
|
3799
|
-
}
|
|
3800
|
-
isProjecting() {
|
|
3801
|
-
return !!((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout);
|
|
3802
|
-
}
|
|
3803
|
-
calcProjection() {
|
|
3804
|
-
var o;
|
|
3805
|
-
const a = this.getLead(), l = !!this.resumingFrom || this !== a;
|
|
3806
|
-
let u = !0;
|
|
3807
|
-
if ((this.isProjectionDirty || !((o = this.parent) === null || o === void 0) && o.isProjectionDirty) && (u = !1), l && (this.isSharedProjectionDirty || this.isTransformDirty) && (u = !1), this.resolvedRelativeTargetAt === B.timestamp && (u = !1), u)
|
|
3808
|
-
return;
|
|
3809
|
-
const { layout: c, layoutId: h } = this.options;
|
|
3810
|
-
if (this.isTreeAnimating = !!(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !this.layout || !(c || h))
|
|
3811
|
-
return;
|
|
3812
|
-
U(this.layoutCorrected, this.layout.layoutBox);
|
|
3813
|
-
const f = this.treeScale.x, d = this.treeScale.y;
|
|
3814
|
-
Zl(this.layoutCorrected, this.treeScale, this.path, l), a.layout && !a.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (a.target = a.layout.layoutBox, a.targetWithTransforms = E());
|
|
3815
|
-
const { target: p } = a;
|
|
3816
|
-
if (!p) {
|
|
3817
|
-
this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
|
|
3818
|
-
return;
|
|
3819
|
-
}
|
|
3820
|
-
!this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (Cs(this.prevProjectionDelta.x, this.projectionDelta.x), Cs(this.prevProjectionDelta.y, this.projectionDelta.y)), Bt(this.projectionDelta, this.layoutCorrected, p, this.latestValues), (this.treeScale.x !== f || this.treeScale.y !== d || !Os(this.projectionDelta.x, this.prevProjectionDelta.x) || !Os(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", p)), Rt && it.recalculatedProjection++;
|
|
3821
|
-
}
|
|
3822
|
-
hide() {
|
|
3823
|
-
this.isVisible = !1;
|
|
3824
|
-
}
|
|
3825
|
-
show() {
|
|
3826
|
-
this.isVisible = !0;
|
|
3827
|
-
}
|
|
3828
|
-
scheduleRender(o = !0) {
|
|
3829
|
-
var a;
|
|
3830
|
-
if ((a = this.options.visualElement) === null || a === void 0 || a.scheduleRender(), o) {
|
|
3831
|
-
const l = this.getStack();
|
|
3832
|
-
l && l.scheduleRender();
|
|
3833
|
-
}
|
|
3834
|
-
this.resumingFrom && !this.resumingFrom.instance && (this.resumingFrom = void 0);
|
|
3835
|
-
}
|
|
3836
|
-
createProjectionDeltas() {
|
|
3837
|
-
this.prevProjectionDelta = pt(), this.projectionDelta = pt(), this.projectionDeltaWithTransform = pt();
|
|
3838
|
-
}
|
|
3839
|
-
setAnimationOrigin(o, a = !1) {
|
|
3840
|
-
const l = this.snapshot, u = l ? l.latestValues : {}, c = { ...this.latestValues }, h = pt();
|
|
3841
|
-
(!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !a;
|
|
3842
|
-
const f = E(), d = l ? l.source : void 0, p = this.layout ? this.layout.source : void 0, m = d !== p, y = this.getStack(), g = !y || y.members.length <= 1, v = !!(m && !g && this.options.crossfade === !0 && !this.path.some(Bu));
|
|
3843
|
-
this.animationProgress = 0;
|
|
3844
|
-
let T;
|
|
3845
|
-
this.mixTargetDelta = (P) => {
|
|
3846
|
-
const x = P / 1e3;
|
|
3847
|
-
Us(h.x, o.x, x), Us(h.y, o.y, x), this.setTargetDelta(h), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (kt(f, this.layout.layoutBox, this.relativeParent.layout.layoutBox), Fu(this.relativeTarget, this.relativeTargetOrigin, f, x), T && yu(this.relativeTarget, T) && (this.isProjectionDirty = !1), T || (T = E()), U(T, this.relativeTarget)), m && (this.animationValues = c, hu(c, u, this.latestValues, x, v, g)), this.root.scheduleUpdateProjection(), this.scheduleRender(), this.animationProgress = x;
|
|
3848
|
-
}, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
|
|
3849
|
-
}
|
|
3850
|
-
startAnimation(o) {
|
|
3851
|
-
this.notifyListeners("animationStart"), this.currentAnimation && this.currentAnimation.stop(), this.resumingFrom && this.resumingFrom.currentAnimation && this.resumingFrom.currentAnimation.stop(), this.pendingAnimation && (q(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = D.update(() => {
|
|
3852
|
-
ee.hasAnimatedSinceResize = !0, this.currentAnimation = yo(0, js, {
|
|
3853
|
-
...o,
|
|
3854
|
-
onUpdate: (a) => {
|
|
3855
|
-
this.mixTargetDelta(a), o.onUpdate && o.onUpdate(a);
|
|
3856
|
-
},
|
|
3857
|
-
onComplete: () => {
|
|
3858
|
-
o.onComplete && o.onComplete(), this.completeAnimation();
|
|
3859
|
-
}
|
|
3860
|
-
}), this.resumingFrom && (this.resumingFrom.currentAnimation = this.currentAnimation), this.pendingAnimation = void 0;
|
|
3861
|
-
});
|
|
3862
|
-
}
|
|
3863
|
-
completeAnimation() {
|
|
3864
|
-
this.resumingFrom && (this.resumingFrom.currentAnimation = void 0, this.resumingFrom.preserveOpacity = void 0);
|
|
3865
|
-
const o = this.getStack();
|
|
3866
|
-
o && o.exitAnimationComplete(), this.resumingFrom = this.currentAnimation = this.animationValues = void 0, this.notifyListeners("animationComplete");
|
|
3867
|
-
}
|
|
3868
|
-
finishAnimation() {
|
|
3869
|
-
this.currentAnimation && (this.mixTargetDelta && this.mixTargetDelta(js), this.currentAnimation.stop()), this.completeAnimation();
|
|
3870
|
-
}
|
|
3871
|
-
applyTransformsToTarget() {
|
|
3872
|
-
const o = this.getLead();
|
|
3873
|
-
let { targetWithTransforms: a, target: l, layout: u, latestValues: c } = o;
|
|
3874
|
-
if (!(!a || !l || !u)) {
|
|
3875
|
-
if (this !== o && this.layout && u && Vo(this.options.animationType, this.layout.layoutBox, u.layoutBox)) {
|
|
3876
|
-
l = this.target || E();
|
|
3877
|
-
const h = N(this.layout.layoutBox.x);
|
|
3878
|
-
l.x.min = o.target.x.min, l.x.max = l.x.min + h;
|
|
3879
|
-
const f = N(this.layout.layoutBox.y);
|
|
3880
|
-
l.y.min = o.target.y.min, l.y.max = l.y.min + f;
|
|
3881
|
-
}
|
|
3882
|
-
U(a, l), gt(a, c), Bt(this.projectionDeltaWithTransform, this.layoutCorrected, a, c);
|
|
3883
|
-
}
|
|
3884
|
-
}
|
|
3885
|
-
registerSharedNode(o, a) {
|
|
3886
|
-
this.sharedNodes.has(o) || this.sharedNodes.set(o, new vu()), this.sharedNodes.get(o).add(a);
|
|
3887
|
-
const u = a.options.initialPromotionConfig;
|
|
3888
|
-
a.promote({
|
|
3889
|
-
transition: u ? u.transition : void 0,
|
|
3890
|
-
preserveFollowOpacity: u && u.shouldPreserveFollowOpacity ? u.shouldPreserveFollowOpacity(a) : void 0
|
|
3891
|
-
});
|
|
3892
|
-
}
|
|
3893
|
-
isLead() {
|
|
3894
|
-
const o = this.getStack();
|
|
3895
|
-
return o ? o.lead === this : !0;
|
|
3896
|
-
}
|
|
3897
|
-
getLead() {
|
|
3898
|
-
var o;
|
|
3899
|
-
const { layoutId: a } = this.options;
|
|
3900
|
-
return a ? ((o = this.getStack()) === null || o === void 0 ? void 0 : o.lead) || this : this;
|
|
3901
|
-
}
|
|
3902
|
-
getPrevLead() {
|
|
3903
|
-
var o;
|
|
3904
|
-
const { layoutId: a } = this.options;
|
|
3905
|
-
return a ? (o = this.getStack()) === null || o === void 0 ? void 0 : o.prevLead : void 0;
|
|
3906
|
-
}
|
|
3907
|
-
getStack() {
|
|
3908
|
-
const { layoutId: o } = this.options;
|
|
3909
|
-
if (o)
|
|
3910
|
-
return this.root.sharedNodes.get(o);
|
|
3911
|
-
}
|
|
3912
|
-
promote({ needsReset: o, transition: a, preserveFollowOpacity: l } = {}) {
|
|
3913
|
-
const u = this.getStack();
|
|
3914
|
-
u && u.promote(this, l), o && (this.projectionDelta = void 0, this.needsReset = !0), a && this.setOptions({ transition: a });
|
|
3915
|
-
}
|
|
3916
|
-
relegate() {
|
|
3917
|
-
const o = this.getStack();
|
|
3918
|
-
return o ? o.relegate(this) : !1;
|
|
3919
|
-
}
|
|
3920
|
-
resetSkewAndRotation() {
|
|
3921
|
-
const { visualElement: o } = this.options;
|
|
3922
|
-
if (!o)
|
|
3923
|
-
return;
|
|
3924
|
-
let a = !1;
|
|
3925
|
-
const { latestValues: l } = o;
|
|
3926
|
-
if ((l.z || l.rotate || l.rotateX || l.rotateY || l.rotateZ || l.skewX || l.skewY) && (a = !0), !a)
|
|
3927
|
-
return;
|
|
3928
|
-
const u = {};
|
|
3929
|
-
l.z && Me("z", o, u, this.animationValues);
|
|
3930
|
-
for (let c = 0; c < Ce.length; c++)
|
|
3931
|
-
Me(`rotate${Ce[c]}`, o, u, this.animationValues), Me(`skew${Ce[c]}`, o, u, this.animationValues);
|
|
3932
|
-
o.render();
|
|
3933
|
-
for (const c in u)
|
|
3934
|
-
o.setStaticValue(c, u[c]), this.animationValues && (this.animationValues[c] = u[c]);
|
|
3935
|
-
o.scheduleRender();
|
|
3936
|
-
}
|
|
3937
|
-
getProjectionStyles(o) {
|
|
3938
|
-
var a, l;
|
|
3939
|
-
if (!this.instance || this.isSVG)
|
|
3940
|
-
return;
|
|
3941
|
-
if (!this.isVisible)
|
|
3942
|
-
return Tu;
|
|
3943
|
-
const u = {
|
|
3944
|
-
visibility: ""
|
|
3945
|
-
}, c = this.getTransformTemplate();
|
|
3946
|
-
if (this.needsReset)
|
|
3947
|
-
return this.needsReset = !1, u.opacity = "", u.pointerEvents = Qt(o?.pointerEvents) || "", u.transform = c ? c(this.latestValues, "") : "none", u;
|
|
3948
|
-
const h = this.getLead();
|
|
3949
|
-
if (!this.projectionDelta || !this.layout || !h.target) {
|
|
3950
|
-
const m = {};
|
|
3951
|
-
return this.options.layoutId && (m.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, m.pointerEvents = Qt(o?.pointerEvents) || ""), this.hasProjected && !st(this.latestValues) && (m.transform = c ? c({}, "") : "none", this.hasProjected = !1), m;
|
|
3952
|
-
}
|
|
3953
|
-
const f = h.animationValues || h.latestValues;
|
|
3954
|
-
this.applyTransformsToTarget(), u.transform = xu(this.projectionDeltaWithTransform, this.treeScale, f), c && (u.transform = c(f, u.transform));
|
|
3955
|
-
const { x: d, y: p } = this.projectionDelta;
|
|
3956
|
-
u.transformOrigin = `${d.origin * 100}% ${p.origin * 100}% 0`, h.animationValues ? u.opacity = h === this ? (l = (a = f.opacity) !== null && a !== void 0 ? a : this.latestValues.opacity) !== null && l !== void 0 ? l : 1 : this.preserveOpacity ? this.latestValues.opacity : f.opacityExit : u.opacity = h === this ? f.opacity !== void 0 ? f.opacity : "" : f.opacityExit !== void 0 ? f.opacityExit : 0;
|
|
3957
|
-
for (const m in se) {
|
|
3958
|
-
if (f[m] === void 0)
|
|
3959
|
-
continue;
|
|
3960
|
-
const { correct: y, applyTo: g } = se[m], v = u.transform === "none" ? f[m] : y(f[m], h);
|
|
3961
|
-
if (g) {
|
|
3962
|
-
const T = g.length;
|
|
3963
|
-
for (let P = 0; P < T; P++)
|
|
3964
|
-
u[g[P]] = v;
|
|
3965
|
-
} else
|
|
3966
|
-
u[m] = v;
|
|
3967
|
-
}
|
|
3968
|
-
return this.options.layoutId && (u.pointerEvents = h === this ? Qt(o?.pointerEvents) || "" : "none"), u;
|
|
3969
|
-
}
|
|
3970
|
-
clearSnapshot() {
|
|
3971
|
-
this.resumeFrom = this.snapshot = void 0;
|
|
3972
|
-
}
|
|
3973
|
-
// Only run on root
|
|
3974
|
-
resetTree() {
|
|
3975
|
-
this.root.nodes.forEach((o) => {
|
|
3976
|
-
var a;
|
|
3977
|
-
return (a = o.currentAnimation) === null || a === void 0 ? void 0 : a.stop();
|
|
3978
|
-
}), this.root.nodes.forEach(Is), this.root.sharedNodes.clear();
|
|
3979
|
-
}
|
|
3980
|
-
};
|
|
3981
|
-
}
|
|
3982
|
-
function Pu(t) {
|
|
3983
|
-
t.updateLayout();
|
|
3984
|
-
}
|
|
3985
|
-
function Au(t) {
|
|
3986
|
-
var e;
|
|
3987
|
-
const n = ((e = t.resumeFrom) === null || e === void 0 ? void 0 : e.snapshot) || t.snapshot;
|
|
3988
|
-
if (t.isLead() && t.layout && n && t.hasListeners("didUpdate")) {
|
|
3989
|
-
const { layoutBox: s, measuredBox: i } = t.layout, { animationType: r } = t.options, o = n.source !== t.layout.source;
|
|
3990
|
-
r === "size" ? _((h) => {
|
|
3991
|
-
const f = o ? n.measuredBox[h] : n.layoutBox[h], d = N(f);
|
|
3992
|
-
f.min = s[h].min, f.max = f.min + d;
|
|
3993
|
-
}) : Vo(r, n.layoutBox, s) && _((h) => {
|
|
3994
|
-
const f = o ? n.measuredBox[h] : n.layoutBox[h], d = N(s[h]);
|
|
3995
|
-
f.max = f.min + d, t.relativeTarget && !t.currentAnimation && (t.isProjectionDirty = !0, t.relativeTarget[h].max = t.relativeTarget[h].min + d);
|
|
3996
|
-
});
|
|
3997
|
-
const a = pt();
|
|
3998
|
-
Bt(a, s, n.layoutBox);
|
|
3999
|
-
const l = pt();
|
|
4000
|
-
o ? Bt(l, t.applyTransform(i, !0), n.measuredBox) : Bt(l, s, n.layoutBox);
|
|
4001
|
-
const u = !So(a);
|
|
4002
|
-
let c = !1;
|
|
4003
|
-
if (!t.resumeFrom) {
|
|
4004
|
-
const h = t.getClosestProjectingParent();
|
|
4005
|
-
if (h && !h.resumeFrom) {
|
|
4006
|
-
const { snapshot: f, layout: d } = h;
|
|
4007
|
-
if (f && d) {
|
|
4008
|
-
const p = E();
|
|
4009
|
-
kt(p, n.layoutBox, f.layoutBox);
|
|
4010
|
-
const m = E();
|
|
4011
|
-
kt(m, s, d.layoutBox), Po(p, m) || (c = !0), h.options.layoutRoot && (t.relativeTarget = m, t.relativeTargetOrigin = p, t.relativeParent = h);
|
|
4012
|
-
}
|
|
4013
|
-
}
|
|
4014
|
-
}
|
|
4015
|
-
t.notifyListeners("didUpdate", {
|
|
4016
|
-
layout: s,
|
|
4017
|
-
snapshot: n,
|
|
4018
|
-
delta: l,
|
|
4019
|
-
layoutDelta: a,
|
|
4020
|
-
hasLayoutChanged: u,
|
|
4021
|
-
hasRelativeTargetChanged: c
|
|
4022
|
-
});
|
|
4023
|
-
} else if (t.isLead()) {
|
|
4024
|
-
const { onExitComplete: s } = t.options;
|
|
4025
|
-
s && s();
|
|
4026
|
-
}
|
|
4027
|
-
t.options.transition = void 0;
|
|
4028
|
-
}
|
|
4029
|
-
function bu(t) {
|
|
4030
|
-
Rt && it.totalNodes++, t.parent && (t.isProjecting() || (t.isProjectionDirty = t.parent.isProjectionDirty), t.isSharedProjectionDirty || (t.isSharedProjectionDirty = !!(t.isProjectionDirty || t.parent.isProjectionDirty || t.parent.isSharedProjectionDirty)), t.isTransformDirty || (t.isTransformDirty = t.parent.isTransformDirty));
|
|
4031
|
-
}
|
|
4032
|
-
function Vu(t) {
|
|
4033
|
-
t.isProjectionDirty = t.isSharedProjectionDirty = t.isTransformDirty = !1;
|
|
4034
|
-
}
|
|
4035
|
-
function wu(t) {
|
|
4036
|
-
t.clearSnapshot();
|
|
4037
|
-
}
|
|
4038
|
-
function Is(t) {
|
|
4039
|
-
t.clearMeasurements();
|
|
4040
|
-
}
|
|
4041
|
-
function Du(t) {
|
|
4042
|
-
t.isLayoutDirty = !1;
|
|
4043
|
-
}
|
|
4044
|
-
function Cu(t) {
|
|
4045
|
-
const { visualElement: e } = t.options;
|
|
4046
|
-
e && e.getProps().onBeforeLayoutMeasure && e.notify("BeforeLayoutMeasure"), t.resetTransform();
|
|
4047
|
-
}
|
|
4048
|
-
function Ns(t) {
|
|
4049
|
-
t.finishAnimation(), t.targetDelta = t.relativeTarget = t.target = void 0, t.isProjectionDirty = !0;
|
|
4050
|
-
}
|
|
4051
|
-
function Mu(t) {
|
|
4052
|
-
t.resolveTargetDelta();
|
|
4053
|
-
}
|
|
4054
|
-
function Ru(t) {
|
|
4055
|
-
t.calcProjection();
|
|
4056
|
-
}
|
|
4057
|
-
function Eu(t) {
|
|
4058
|
-
t.resetSkewAndRotation();
|
|
4059
|
-
}
|
|
4060
|
-
function Lu(t) {
|
|
4061
|
-
t.removeLeadSnapshot();
|
|
4062
|
-
}
|
|
4063
|
-
function Us(t, e, n) {
|
|
4064
|
-
t.translate = M(e.translate, 0, n), t.scale = M(e.scale, 1, n), t.origin = e.origin, t.originPoint = e.originPoint;
|
|
4065
|
-
}
|
|
4066
|
-
function _s(t, e, n, s) {
|
|
4067
|
-
t.min = M(e.min, n.min, s), t.max = M(e.max, n.max, s);
|
|
4068
|
-
}
|
|
4069
|
-
function Fu(t, e, n, s) {
|
|
4070
|
-
_s(t.x, e.x, n.x, s), _s(t.y, e.y, n.y, s);
|
|
4071
|
-
}
|
|
4072
|
-
function Bu(t) {
|
|
4073
|
-
return t.animationValues && t.animationValues.opacityExit !== void 0;
|
|
4074
|
-
}
|
|
4075
|
-
const ku = {
|
|
4076
|
-
duration: 0.45,
|
|
4077
|
-
ease: [0.4, 0, 0.1, 1]
|
|
4078
|
-
}, Ks = (t) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(t), $s = Ks("applewebkit/") && !Ks("chrome/") ? Math.round : K;
|
|
4079
|
-
function Ws(t) {
|
|
4080
|
-
t.min = $s(t.min), t.max = $s(t.max);
|
|
4081
|
-
}
|
|
4082
|
-
function Ou(t) {
|
|
4083
|
-
Ws(t.x), Ws(t.y);
|
|
4084
|
-
}
|
|
4085
|
-
function Vo(t, e, n) {
|
|
4086
|
-
return t === "position" || t === "preserve-aspect" && !_l(ks(e), ks(n), 0.2);
|
|
4087
|
-
}
|
|
4088
|
-
function ju(t) {
|
|
4089
|
-
var e;
|
|
4090
|
-
return t !== t.root && ((e = t.scroll) === null || e === void 0 ? void 0 : e.wasRoot);
|
|
4091
|
-
}
|
|
4092
|
-
const Iu = bo({
|
|
4093
|
-
attachResizeListener: (t, e) => Nt(t, "resize", e),
|
|
4094
|
-
measureScroll: () => ({
|
|
4095
|
-
x: document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
4096
|
-
y: document.documentElement.scrollTop || document.body.scrollTop
|
|
4097
|
-
}),
|
|
4098
|
-
checkIsScrollRoot: () => !0
|
|
4099
|
-
}), Re = {
|
|
4100
|
-
current: void 0
|
|
4101
|
-
}, wo = bo({
|
|
4102
|
-
measureScroll: (t) => ({
|
|
4103
|
-
x: t.scrollLeft,
|
|
4104
|
-
y: t.scrollTop
|
|
4105
|
-
}),
|
|
4106
|
-
defaultParent: () => {
|
|
4107
|
-
if (!Re.current) {
|
|
4108
|
-
const t = new Iu({});
|
|
4109
|
-
t.mount(window), t.setOptions({ layoutScroll: !0 }), Re.current = t;
|
|
4110
|
-
}
|
|
4111
|
-
return Re.current;
|
|
4112
|
-
},
|
|
4113
|
-
resetTransform: (t, e) => {
|
|
4114
|
-
t.style.transform = e !== void 0 ? e : "none";
|
|
4115
|
-
},
|
|
4116
|
-
checkIsScrollRoot: (t) => window.getComputedStyle(t).position === "fixed"
|
|
4117
|
-
}), Nu = {
|
|
4118
|
-
pan: {
|
|
4119
|
-
Feature: su
|
|
4120
|
-
},
|
|
4121
|
-
drag: {
|
|
4122
|
-
Feature: nu,
|
|
4123
|
-
ProjectionNode: wo,
|
|
4124
|
-
MeasureLayout: go
|
|
4125
|
-
}
|
|
4126
|
-
};
|
|
4127
|
-
function Gs(t, e, n) {
|
|
4128
|
-
const { props: s } = t;
|
|
4129
|
-
t.animationState && s.whileHover && t.animationState.setActive("whileHover", n === "Start");
|
|
4130
|
-
const i = "onHover" + n, r = s[i];
|
|
4131
|
-
r && D.postRender(() => r(e, zt(e)));
|
|
4132
|
-
}
|
|
4133
|
-
class Uu extends tt {
|
|
4134
|
-
mount() {
|
|
4135
|
-
const { current: e } = this.node;
|
|
4136
|
-
e && (this.unmount = Go(e, (n) => (Gs(this.node, n, "Start"), (s) => Gs(this.node, s, "End"))));
|
|
4137
|
-
}
|
|
4138
|
-
unmount() {
|
|
4139
|
-
}
|
|
4140
|
-
}
|
|
4141
|
-
class _u extends tt {
|
|
4142
|
-
constructor() {
|
|
4143
|
-
super(...arguments), this.isActive = !1;
|
|
4144
|
-
}
|
|
4145
|
-
onFocus() {
|
|
4146
|
-
let e = !1;
|
|
4147
|
-
try {
|
|
4148
|
-
e = this.node.current.matches(":focus-visible");
|
|
4149
|
-
} catch {
|
|
4150
|
-
e = !0;
|
|
4151
|
-
}
|
|
4152
|
-
!e || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
|
|
4153
|
-
}
|
|
4154
|
-
onBlur() {
|
|
4155
|
-
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
4156
|
-
}
|
|
4157
|
-
mount() {
|
|
4158
|
-
this.unmount = Gt(Nt(this.node.current, "focus", () => this.onFocus()), Nt(this.node.current, "blur", () => this.onBlur()));
|
|
4159
|
-
}
|
|
4160
|
-
unmount() {
|
|
4161
|
-
}
|
|
4162
|
-
}
|
|
4163
|
-
function zs(t, e, n) {
|
|
4164
|
-
const { props: s } = t;
|
|
4165
|
-
t.animationState && s.whileTap && t.animationState.setActive("whileTap", n === "Start");
|
|
4166
|
-
const i = "onTap" + (n === "End" ? "" : n), r = s[i];
|
|
4167
|
-
r && D.postRender(() => r(e, zt(e)));
|
|
4168
|
-
}
|
|
4169
|
-
class Ku extends tt {
|
|
4170
|
-
mount() {
|
|
4171
|
-
const { current: e } = this.node;
|
|
4172
|
-
e && (this.unmount = zo(e, (n) => (zs(this.node, n, "Start"), (s, { success: i }) => zs(this.node, s, i ? "End" : "Cancel")), { useGlobalTarget: this.node.props.globalTapTarget }));
|
|
4173
|
-
}
|
|
4174
|
-
unmount() {
|
|
4175
|
-
}
|
|
4176
|
-
}
|
|
4177
|
-
const Ge = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), $u = (t) => {
|
|
4178
|
-
const e = Ge.get(t.target);
|
|
4179
|
-
e && e(t);
|
|
4180
|
-
}, Wu = (t) => {
|
|
4181
|
-
t.forEach($u);
|
|
4182
|
-
};
|
|
4183
|
-
function Gu({ root: t, ...e }) {
|
|
4184
|
-
const n = t || document;
|
|
4185
|
-
Ee.has(n) || Ee.set(n, {});
|
|
4186
|
-
const s = Ee.get(n), i = JSON.stringify(e);
|
|
4187
|
-
return s[i] || (s[i] = new IntersectionObserver(Wu, { root: t, ...e })), s[i];
|
|
4188
|
-
}
|
|
4189
|
-
function zu(t, e, n) {
|
|
4190
|
-
const s = Gu(e);
|
|
4191
|
-
return Ge.set(t, n), s.observe(t), () => {
|
|
4192
|
-
Ge.delete(t), s.unobserve(t);
|
|
4193
|
-
};
|
|
4194
|
-
}
|
|
4195
|
-
const Hu = {
|
|
4196
|
-
some: 0,
|
|
4197
|
-
all: 1
|
|
4198
|
-
};
|
|
4199
|
-
class Yu extends tt {
|
|
4200
|
-
constructor() {
|
|
4201
|
-
super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
|
|
4202
|
-
}
|
|
4203
|
-
startObserver() {
|
|
4204
|
-
this.unmount();
|
|
4205
|
-
const { viewport: e = {} } = this.node.getProps(), { root: n, margin: s, amount: i = "some", once: r } = e, o = {
|
|
4206
|
-
root: n ? n.current : void 0,
|
|
4207
|
-
rootMargin: s,
|
|
4208
|
-
threshold: typeof i == "number" ? i : Hu[i]
|
|
4209
|
-
}, a = (l) => {
|
|
4210
|
-
const { isIntersecting: u } = l;
|
|
4211
|
-
if (this.isInView === u || (this.isInView = u, r && !u && this.hasEnteredView))
|
|
4212
|
-
return;
|
|
4213
|
-
u && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", u);
|
|
4214
|
-
const { onViewportEnter: c, onViewportLeave: h } = this.node.getProps(), f = u ? c : h;
|
|
4215
|
-
f && f(l);
|
|
4216
|
-
};
|
|
4217
|
-
return zu(this.node.current, o, a);
|
|
4218
|
-
}
|
|
4219
|
-
mount() {
|
|
4220
|
-
this.startObserver();
|
|
4221
|
-
}
|
|
4222
|
-
update() {
|
|
4223
|
-
if (typeof IntersectionObserver > "u")
|
|
4224
|
-
return;
|
|
4225
|
-
const { props: e, prevProps: n } = this.node;
|
|
4226
|
-
["amount", "margin", "root"].some(Xu(e, n)) && this.startObserver();
|
|
4227
|
-
}
|
|
4228
|
-
unmount() {
|
|
4229
|
-
}
|
|
4230
|
-
}
|
|
4231
|
-
function Xu({ viewport: t = {} }, { viewport: e = {} } = {}) {
|
|
4232
|
-
return (n) => t[n] !== e[n];
|
|
4233
|
-
}
|
|
4234
|
-
const qu = {
|
|
4235
|
-
inView: {
|
|
4236
|
-
Feature: Yu
|
|
4237
|
-
},
|
|
4238
|
-
tap: {
|
|
4239
|
-
Feature: Ku
|
|
4240
|
-
},
|
|
4241
|
-
focus: {
|
|
4242
|
-
Feature: _u
|
|
4243
|
-
},
|
|
4244
|
-
hover: {
|
|
4245
|
-
Feature: Uu
|
|
4246
|
-
}
|
|
4247
|
-
}, Zu = {
|
|
4248
|
-
layout: {
|
|
4249
|
-
ProjectionNode: wo,
|
|
4250
|
-
MeasureLayout: go
|
|
4251
|
-
}
|
|
4252
|
-
}, ze = { current: null }, Do = { current: !1 };
|
|
4253
|
-
function Ju() {
|
|
4254
|
-
if (Do.current = !0, !!tn)
|
|
4255
|
-
if (window.matchMedia) {
|
|
4256
|
-
const t = window.matchMedia("(prefers-reduced-motion)"), e = () => ze.current = t.matches;
|
|
4257
|
-
t.addListener(e), e();
|
|
4258
|
-
} else
|
|
4259
|
-
ze.current = !1;
|
|
4260
|
-
}
|
|
4261
|
-
const Qu = [...zi, I, Q], tc = (t) => Qu.find(Gi(t)), St = /* @__PURE__ */ new WeakMap();
|
|
4262
|
-
function ec(t, e, n) {
|
|
4263
|
-
for (const s in e) {
|
|
4264
|
-
const i = e[s], r = n[s];
|
|
4265
|
-
if (L(i))
|
|
4266
|
-
t.addValue(s, i), process.env.NODE_ENV === "development" && he(i.version === "11.18.2", `Attempting to mix Motion versions ${i.version} with 11.18.2 may not work as expected.`);
|
|
4267
|
-
else if (L(r))
|
|
4268
|
-
t.addValue(s, xt(i, { owner: t }));
|
|
4269
|
-
else if (r !== i)
|
|
4270
|
-
if (t.hasValue(s)) {
|
|
4271
|
-
const o = t.getValue(s);
|
|
4272
|
-
o.liveStyle === !0 ? o.jump(i) : o.hasAnimated || o.set(i);
|
|
4273
|
-
} else {
|
|
4274
|
-
const o = t.getStaticValue(s);
|
|
4275
|
-
t.addValue(s, xt(o !== void 0 ? o : i, { owner: t }));
|
|
4276
|
-
}
|
|
4277
|
-
}
|
|
4278
|
-
for (const s in n)
|
|
4279
|
-
e[s] === void 0 && t.removeValue(s);
|
|
4280
|
-
return e;
|
|
4281
|
-
}
|
|
4282
|
-
const Hs = [
|
|
4283
|
-
"AnimationStart",
|
|
4284
|
-
"AnimationComplete",
|
|
4285
|
-
"Update",
|
|
4286
|
-
"BeforeLayoutMeasure",
|
|
4287
|
-
"LayoutMeasure",
|
|
4288
|
-
"LayoutAnimationStart",
|
|
4289
|
-
"LayoutAnimationComplete"
|
|
4290
|
-
];
|
|
4291
|
-
class Co {
|
|
4292
|
-
/**
|
|
4293
|
-
* This method takes React props and returns found MotionValues. For example, HTML
|
|
4294
|
-
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
|
|
4295
|
-
*
|
|
4296
|
-
* This isn't an abstract method as it needs calling in the constructor, but it is
|
|
4297
|
-
* intended to be one.
|
|
4298
|
-
*/
|
|
4299
|
-
scrapeMotionValuesFromProps(e, n, s) {
|
|
4300
|
-
return {};
|
|
4301
|
-
}
|
|
4302
|
-
constructor({ parent: e, props: n, presenceContext: s, reducedMotionConfig: i, blockInitialAnimation: r, visualState: o }, a = {}) {
|
|
4303
|
-
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = An, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
4304
|
-
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
4305
|
-
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
4306
|
-
const d = H.now();
|
|
4307
|
-
this.renderScheduledAt < d && (this.renderScheduledAt = d, D.render(this.render, !1, !0));
|
|
4308
|
-
};
|
|
4309
|
-
const { latestValues: l, renderState: u, onUpdate: c } = o;
|
|
4310
|
-
this.onUpdate = c, this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = u, this.parent = e, this.props = n, this.presenceContext = s, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = i, this.options = a, this.blockInitialAnimation = !!r, this.isControllingVariants = pe(n), this.isVariantNode = ai(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
4311
|
-
const { willChange: h, ...f } = this.scrapeMotionValuesFromProps(n, {}, this);
|
|
4312
|
-
for (const d in f) {
|
|
4313
|
-
const p = f[d];
|
|
4314
|
-
l[d] !== void 0 && L(p) && p.set(l[d], !1);
|
|
4315
|
-
}
|
|
4316
|
-
}
|
|
4317
|
-
mount(e) {
|
|
4318
|
-
this.current = e, St.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, s) => this.bindToMotionValue(s, n)), Do.current || Ju(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : ze.current, process.env.NODE_ENV !== "production" && he(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
4319
|
-
}
|
|
4320
|
-
unmount() {
|
|
4321
|
-
St.delete(this.current), this.projection && this.projection.unmount(), q(this.notifyUpdate), q(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
4322
|
-
for (const e in this.events)
|
|
4323
|
-
this.events[e].clear();
|
|
4324
|
-
for (const e in this.features) {
|
|
4325
|
-
const n = this.features[e];
|
|
4326
|
-
n && (n.unmount(), n.isMounted = !1);
|
|
4327
|
-
}
|
|
4328
|
-
this.current = null;
|
|
4329
|
-
}
|
|
4330
|
-
bindToMotionValue(e, n) {
|
|
4331
|
-
this.valueSubscriptions.has(e) && this.valueSubscriptions.get(e)();
|
|
4332
|
-
const s = lt.has(e), i = n.on("change", (a) => {
|
|
4333
|
-
this.latestValues[e] = a, this.props.onUpdate && D.preRender(this.notifyUpdate), s && this.projection && (this.projection.isTransformDirty = !0);
|
|
4334
|
-
}), r = n.on("renderRequest", this.scheduleRender);
|
|
4335
|
-
let o;
|
|
4336
|
-
window.MotionCheckAppearSync && (o = window.MotionCheckAppearSync(this, e, n)), this.valueSubscriptions.set(e, () => {
|
|
4337
|
-
i(), r(), o && o(), n.owner && n.stop();
|
|
4338
|
-
});
|
|
4339
|
-
}
|
|
4340
|
-
sortNodePosition(e) {
|
|
4341
|
-
return !this.current || !this.sortInstanceNodePosition || this.type !== e.type ? 0 : this.sortInstanceNodePosition(this.current, e.current);
|
|
4342
|
-
}
|
|
4343
|
-
updateFeatures() {
|
|
4344
|
-
let e = "animation";
|
|
4345
|
-
for (e in vt) {
|
|
4346
|
-
const n = vt[e];
|
|
4347
|
-
if (!n)
|
|
4348
|
-
continue;
|
|
4349
|
-
const { isEnabled: s, Feature: i } = n;
|
|
4350
|
-
if (!this.features[e] && i && s(this.props) && (this.features[e] = new i(this)), this.features[e]) {
|
|
4351
|
-
const r = this.features[e];
|
|
4352
|
-
r.isMounted ? r.update() : (r.mount(), r.isMounted = !0);
|
|
4353
|
-
}
|
|
4354
|
-
}
|
|
4355
|
-
}
|
|
4356
|
-
triggerBuild() {
|
|
4357
|
-
this.build(this.renderState, this.latestValues, this.props);
|
|
4358
|
-
}
|
|
4359
|
-
/**
|
|
4360
|
-
* Measure the current viewport box with or without transforms.
|
|
4361
|
-
* Only measures axis-aligned boxes, rotate and skew must be manually
|
|
4362
|
-
* removed with a re-render to work.
|
|
4363
|
-
*/
|
|
4364
|
-
measureViewportBox() {
|
|
4365
|
-
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : E();
|
|
4366
|
-
}
|
|
4367
|
-
getStaticValue(e) {
|
|
4368
|
-
return this.latestValues[e];
|
|
4369
|
-
}
|
|
4370
|
-
setStaticValue(e, n) {
|
|
4371
|
-
this.latestValues[e] = n;
|
|
4372
|
-
}
|
|
4373
|
-
/**
|
|
4374
|
-
* Update the provided props. Ensure any newly-added motion values are
|
|
4375
|
-
* added to our map, old ones removed, and listeners updated.
|
|
4376
|
-
*/
|
|
4377
|
-
update(e, n) {
|
|
4378
|
-
(e.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = e, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
|
|
4379
|
-
for (let s = 0; s < Hs.length; s++) {
|
|
4380
|
-
const i = Hs[s];
|
|
4381
|
-
this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
|
|
4382
|
-
const r = "on" + i, o = e[r];
|
|
4383
|
-
o && (this.propEventSubscriptions[i] = this.on(i, o));
|
|
4384
|
-
}
|
|
4385
|
-
this.prevMotionValues = ec(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue(), this.onUpdate && this.onUpdate(this);
|
|
4386
|
-
}
|
|
4387
|
-
getProps() {
|
|
4388
|
-
return this.props;
|
|
4389
|
-
}
|
|
4390
|
-
/**
|
|
4391
|
-
* Returns the variant definition with a given name.
|
|
4392
|
-
*/
|
|
4393
|
-
getVariant(e) {
|
|
4394
|
-
return this.props.variants ? this.props.variants[e] : void 0;
|
|
4395
|
-
}
|
|
4396
|
-
/**
|
|
4397
|
-
* Returns the defined default transition on this component.
|
|
4398
|
-
*/
|
|
4399
|
-
getDefaultTransition() {
|
|
4400
|
-
return this.props.transition;
|
|
4401
|
-
}
|
|
4402
|
-
getTransformPagePoint() {
|
|
4403
|
-
return this.props.transformPagePoint;
|
|
4404
|
-
}
|
|
4405
|
-
getClosestVariantNode() {
|
|
4406
|
-
return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
|
|
4407
|
-
}
|
|
4408
|
-
/**
|
|
4409
|
-
* Add a child visual element to our set of children.
|
|
4410
|
-
*/
|
|
4411
|
-
addVariantChild(e) {
|
|
4412
|
-
const n = this.getClosestVariantNode();
|
|
4413
|
-
if (n)
|
|
4414
|
-
return n.variantChildren && n.variantChildren.add(e), () => n.variantChildren.delete(e);
|
|
4415
|
-
}
|
|
4416
|
-
/**
|
|
4417
|
-
* Add a motion value and bind it to this visual element.
|
|
4418
|
-
*/
|
|
4419
|
-
addValue(e, n) {
|
|
4420
|
-
const s = this.values.get(e);
|
|
4421
|
-
n !== s && (s && this.removeValue(e), this.bindToMotionValue(e, n), this.values.set(e, n), this.latestValues[e] = n.get());
|
|
4422
|
-
}
|
|
4423
|
-
/**
|
|
4424
|
-
* Remove a motion value and unbind any active subscriptions.
|
|
4425
|
-
*/
|
|
4426
|
-
removeValue(e) {
|
|
4427
|
-
this.values.delete(e);
|
|
4428
|
-
const n = this.valueSubscriptions.get(e);
|
|
4429
|
-
n && (n(), this.valueSubscriptions.delete(e)), delete this.latestValues[e], this.removeValueFromRenderState(e, this.renderState);
|
|
4430
|
-
}
|
|
4431
|
-
/**
|
|
4432
|
-
* Check whether we have a motion value for this key
|
|
4433
|
-
*/
|
|
4434
|
-
hasValue(e) {
|
|
4435
|
-
return this.values.has(e);
|
|
4436
|
-
}
|
|
4437
|
-
getValue(e, n) {
|
|
4438
|
-
if (this.props.values && this.props.values[e])
|
|
4439
|
-
return this.props.values[e];
|
|
4440
|
-
let s = this.values.get(e);
|
|
4441
|
-
return s === void 0 && n !== void 0 && (s = xt(n === null ? void 0 : n, { owner: this }), this.addValue(e, s)), s;
|
|
4442
|
-
}
|
|
4443
|
-
/**
|
|
4444
|
-
* If we're trying to animate to a previously unencountered value,
|
|
4445
|
-
* we need to check for it in our state and as a last resort read it
|
|
4446
|
-
* directly from the instance (which might have performance implications).
|
|
4447
|
-
*/
|
|
4448
|
-
readValue(e, n) {
|
|
4449
|
-
var s;
|
|
4450
|
-
let i = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (s = this.getBaseTargetFromProps(this.props, e)) !== null && s !== void 0 ? s : this.readValueFromInstance(this.current, e, this.options);
|
|
4451
|
-
return i != null && (typeof i == "string" && ($i(i) || Bi(i)) ? i = parseFloat(i) : !tc(i) && Q.test(n) && (i = Ui(e, n)), this.setBaseTarget(e, L(i) ? i.get() : i)), L(i) ? i.get() : i;
|
|
4452
|
-
}
|
|
4453
|
-
/**
|
|
4454
|
-
* Set the base target to later animate back to. This is currently
|
|
4455
|
-
* only hydrated on creation and when we first read a value.
|
|
4456
|
-
*/
|
|
4457
|
-
setBaseTarget(e, n) {
|
|
4458
|
-
this.baseTarget[e] = n;
|
|
4459
|
-
}
|
|
4460
|
-
/**
|
|
4461
|
-
* Find the base target for a value thats been removed from all animation
|
|
4462
|
-
* props.
|
|
4463
|
-
*/
|
|
4464
|
-
getBaseTarget(e) {
|
|
4465
|
-
var n;
|
|
4466
|
-
const { initial: s } = this.props;
|
|
4467
|
-
let i;
|
|
4468
|
-
if (typeof s == "string" || typeof s == "object") {
|
|
4469
|
-
const o = an(this.props, s, (n = this.presenceContext) === null || n === void 0 ? void 0 : n.custom);
|
|
4470
|
-
o && (i = o[e]);
|
|
4471
|
-
}
|
|
4472
|
-
if (s && i !== void 0)
|
|
4473
|
-
return i;
|
|
4474
|
-
const r = this.getBaseTargetFromProps(this.props, e);
|
|
4475
|
-
return r !== void 0 && !L(r) ? r : this.initialValues[e] !== void 0 && i === void 0 ? void 0 : this.baseTarget[e];
|
|
4476
|
-
}
|
|
4477
|
-
on(e, n) {
|
|
4478
|
-
return this.events[e] || (this.events[e] = new gn()), this.events[e].add(n);
|
|
4479
|
-
}
|
|
4480
|
-
notify(e, ...n) {
|
|
4481
|
-
this.events[e] && this.events[e].notify(...n);
|
|
4482
|
-
}
|
|
4483
|
-
}
|
|
4484
|
-
class Mo extends Co {
|
|
4485
|
-
constructor() {
|
|
4486
|
-
super(...arguments), this.KeyframeResolver = Hi;
|
|
4487
|
-
}
|
|
4488
|
-
sortInstanceNodePosition(e, n) {
|
|
4489
|
-
return e.compareDocumentPosition(n) & 2 ? 1 : -1;
|
|
4490
|
-
}
|
|
4491
|
-
getBaseTargetFromProps(e, n) {
|
|
4492
|
-
return e.style ? e.style[n] : void 0;
|
|
4493
|
-
}
|
|
4494
|
-
removeValueFromRenderState(e, { vars: n, style: s }) {
|
|
4495
|
-
delete n[e], delete s[e];
|
|
4496
|
-
}
|
|
4497
|
-
handleChildMotionValue() {
|
|
4498
|
-
this.childSubscription && (this.childSubscription(), delete this.childSubscription);
|
|
4499
|
-
const { children: e } = this.props;
|
|
4500
|
-
L(e) && (this.childSubscription = e.on("change", (n) => {
|
|
4501
|
-
this.current && (this.current.textContent = `${n}`);
|
|
4502
|
-
}));
|
|
4503
|
-
}
|
|
4504
|
-
}
|
|
4505
|
-
function nc(t) {
|
|
4506
|
-
return window.getComputedStyle(t);
|
|
4507
|
-
}
|
|
4508
|
-
class Ro extends Mo {
|
|
4509
|
-
constructor() {
|
|
4510
|
-
super(...arguments), this.type = "html", this.renderInstance = gi;
|
|
4511
|
-
}
|
|
4512
|
-
readValueFromInstance(e, n) {
|
|
4513
|
-
if (lt.has(n)) {
|
|
4514
|
-
const s = Pn(n);
|
|
4515
|
-
return s && s.default || 0;
|
|
4516
|
-
} else {
|
|
4517
|
-
const s = nc(e), i = (di(n) ? s.getPropertyValue(n) : s[n]) || 0;
|
|
4518
|
-
return typeof i == "string" ? i.trim() : i;
|
|
4519
|
-
}
|
|
4520
|
-
}
|
|
4521
|
-
measureInstanceViewportBox(e, { transformPagePoint: n }) {
|
|
4522
|
-
return po(e, n);
|
|
4523
|
-
}
|
|
4524
|
-
build(e, n, s) {
|
|
4525
|
-
cn(e, n, s.transformTemplate);
|
|
4526
|
-
}
|
|
4527
|
-
scrapeMotionValuesFromProps(e, n, s) {
|
|
4528
|
-
return pn(e, n, s);
|
|
4529
|
-
}
|
|
4530
|
-
}
|
|
4531
|
-
class Eo extends Mo {
|
|
4532
|
-
constructor() {
|
|
4533
|
-
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = E;
|
|
4534
|
-
}
|
|
4535
|
-
getBaseTargetFromProps(e, n) {
|
|
4536
|
-
return e[n];
|
|
4537
|
-
}
|
|
4538
|
-
readValueFromInstance(e, n) {
|
|
4539
|
-
if (lt.has(n)) {
|
|
4540
|
-
const s = Pn(n);
|
|
4541
|
-
return s && s.default || 0;
|
|
4542
|
-
}
|
|
4543
|
-
return n = yi.has(n) ? n : sn(n), e.getAttribute(n);
|
|
4544
|
-
}
|
|
4545
|
-
scrapeMotionValuesFromProps(e, n, s) {
|
|
4546
|
-
return Ti(e, n, s);
|
|
4547
|
-
}
|
|
4548
|
-
build(e, n, s) {
|
|
4549
|
-
hn(e, n, this.isSVGTag, s.transformTemplate);
|
|
4550
|
-
}
|
|
4551
|
-
renderInstance(e, n, s, i) {
|
|
4552
|
-
vi(e, n, s, i);
|
|
4553
|
-
}
|
|
4554
|
-
mount(e) {
|
|
4555
|
-
this.isSVGTag = dn(e.tagName), super.mount(e);
|
|
4556
|
-
}
|
|
4557
|
-
}
|
|
4558
|
-
const sc = (t, e) => rn(t) ? new Eo(e) : new Ro(e, {
|
|
4559
|
-
allowProjection: t !== ni
|
|
4560
|
-
}), ic = /* @__PURE__ */ Zr({
|
|
4561
|
-
...Ll,
|
|
4562
|
-
...qu,
|
|
4563
|
-
...Nu,
|
|
4564
|
-
...Zu
|
|
4565
|
-
}, sc), Ic = /* @__PURE__ */ fr(ic);
|
|
4566
|
-
function Lo(t) {
|
|
4567
|
-
const e = At(() => xt(t)), { isStatic: n } = k(_t);
|
|
4568
|
-
if (n) {
|
|
4569
|
-
const [, s] = Le(t);
|
|
4570
|
-
ue(() => e.on("change", s), []);
|
|
4571
|
-
}
|
|
4572
|
-
return e;
|
|
4573
|
-
}
|
|
4574
|
-
function Cn(t, e) {
|
|
4575
|
-
const n = Lo(e()), s = () => n.set(e());
|
|
4576
|
-
return s(), Kt(() => {
|
|
4577
|
-
const i = () => D.preRender(s, !1, !0), r = t.map((o) => o.on("change", i));
|
|
4578
|
-
return () => {
|
|
4579
|
-
r.forEach((o) => o()), q(s);
|
|
4580
|
-
};
|
|
4581
|
-
}), n;
|
|
4582
|
-
}
|
|
4583
|
-
function Nc(t, ...e) {
|
|
4584
|
-
const n = t.length;
|
|
4585
|
-
function s() {
|
|
4586
|
-
let i = "";
|
|
4587
|
-
for (let r = 0; r < n; r++) {
|
|
4588
|
-
i += t[r];
|
|
4589
|
-
const o = e[r];
|
|
4590
|
-
o && (i += L(o) ? o.get() : o);
|
|
4591
|
-
}
|
|
4592
|
-
return i;
|
|
4593
|
-
}
|
|
4594
|
-
return Cn(e.filter(L), s);
|
|
4595
|
-
}
|
|
4596
|
-
function Ys(t) {
|
|
4597
|
-
return typeof t == "number" ? t : parseFloat(t);
|
|
4598
|
-
}
|
|
4599
|
-
function Uc(t, e = {}) {
|
|
4600
|
-
const { isStatic: n } = k(_t), s = W(null), i = Lo(L(t) ? Ys(t.get()) : t), r = W(i.get()), o = W(() => {
|
|
4601
|
-
}), a = () => {
|
|
4602
|
-
const u = s.current;
|
|
4603
|
-
u && u.time === 0 && u.sample(B.delta), l(), s.current = rl({
|
|
4604
|
-
keyframes: [i.get(), r.current],
|
|
4605
|
-
velocity: i.getVelocity(),
|
|
4606
|
-
type: "spring",
|
|
4607
|
-
restDelta: 1e-3,
|
|
4608
|
-
restSpeed: 0.01,
|
|
4609
|
-
...e,
|
|
4610
|
-
onUpdate: o.current
|
|
4611
|
-
});
|
|
4612
|
-
}, l = () => {
|
|
4613
|
-
s.current && s.current.stop();
|
|
4614
|
-
};
|
|
4615
|
-
return Ze(() => i.attach((u, c) => n ? c(u) : (r.current = u, o.current = c, D.update(a), i.get()), l), [JSON.stringify(e)]), Kt(() => {
|
|
4616
|
-
if (L(t))
|
|
4617
|
-
return t.on("change", (u) => i.set(Ys(u)));
|
|
4618
|
-
}, [i]), i;
|
|
4619
|
-
}
|
|
4620
|
-
const oc = (t) => t && typeof t == "object" && t.mix, rc = (t) => oc(t) ? t.mix : void 0;
|
|
4621
|
-
function ac(...t) {
|
|
4622
|
-
const e = !Array.isArray(t[0]), n = e ? 0 : -1, s = t[0 + n], i = t[1 + n], r = t[2 + n], o = t[3 + n], a = to(i, r, {
|
|
4623
|
-
mixer: rc(r[0]),
|
|
4624
|
-
...o
|
|
4625
|
-
});
|
|
4626
|
-
return e ? a(s) : a;
|
|
4627
|
-
}
|
|
4628
|
-
function lc(t) {
|
|
4629
|
-
Et.current = [], t();
|
|
4630
|
-
const e = Cn(Et.current, t);
|
|
4631
|
-
return Et.current = void 0, e;
|
|
4632
|
-
}
|
|
4633
|
-
function _c(t, e, n, s) {
|
|
4634
|
-
if (typeof t == "function")
|
|
4635
|
-
return lc(t);
|
|
4636
|
-
const i = typeof e == "function" ? e : ac(e, n, s);
|
|
4637
|
-
return Array.isArray(t) ? Xs(t, i) : Xs([t], ([r]) => i(r));
|
|
4638
|
-
}
|
|
4639
|
-
function Xs(t, e) {
|
|
4640
|
-
const n = At(() => []);
|
|
4641
|
-
return Cn(t, () => {
|
|
4642
|
-
n.length = 0;
|
|
4643
|
-
const s = t.length;
|
|
4644
|
-
for (let i = 0; i < s; i++)
|
|
4645
|
-
n[i] = t[i].get();
|
|
4646
|
-
return e(n);
|
|
4647
|
-
});
|
|
4648
|
-
}
|
|
4649
|
-
function uc(t) {
|
|
4650
|
-
t.values.forEach((e) => e.stop());
|
|
4651
|
-
}
|
|
4652
|
-
function He(t, e) {
|
|
4653
|
-
[...e].reverse().forEach((s) => {
|
|
4654
|
-
const i = t.getVariant(s);
|
|
4655
|
-
i && yn(t, i), t.variantChildren && t.variantChildren.forEach((r) => {
|
|
4656
|
-
He(r, e);
|
|
4657
|
-
});
|
|
4658
|
-
});
|
|
4659
|
-
}
|
|
4660
|
-
function cc(t, e) {
|
|
4661
|
-
if (Array.isArray(e))
|
|
4662
|
-
return He(t, e);
|
|
4663
|
-
if (typeof e == "string")
|
|
4664
|
-
return He(t, [e]);
|
|
4665
|
-
yn(t, e);
|
|
4666
|
-
}
|
|
4667
|
-
function hc() {
|
|
4668
|
-
let t = !1;
|
|
4669
|
-
const e = /* @__PURE__ */ new Set(), n = {
|
|
4670
|
-
subscribe(s) {
|
|
4671
|
-
return e.add(s), () => void e.delete(s);
|
|
4672
|
-
},
|
|
4673
|
-
start(s, i) {
|
|
4674
|
-
G(t, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");
|
|
4675
|
-
const r = [];
|
|
4676
|
-
return e.forEach((o) => {
|
|
4677
|
-
r.push(io(o, s, {
|
|
4678
|
-
transitionOverride: i
|
|
4679
|
-
}));
|
|
4680
|
-
}), Promise.all(r);
|
|
4681
|
-
},
|
|
4682
|
-
set(s) {
|
|
4683
|
-
return G(t, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."), e.forEach((i) => {
|
|
4684
|
-
cc(i, s);
|
|
4685
|
-
});
|
|
4686
|
-
},
|
|
4687
|
-
stop() {
|
|
4688
|
-
e.forEach((s) => {
|
|
4689
|
-
uc(s);
|
|
4690
|
-
});
|
|
4691
|
-
},
|
|
4692
|
-
mount() {
|
|
4693
|
-
return t = !0, () => {
|
|
4694
|
-
t = !1, n.stop();
|
|
4695
|
-
};
|
|
4696
|
-
}
|
|
4697
|
-
};
|
|
4698
|
-
return n;
|
|
4699
|
-
}
|
|
4700
|
-
const fc = (t, e, n) => {
|
|
4701
|
-
const s = e - t;
|
|
4702
|
-
return ((n - t) % s + s) % s + t;
|
|
4703
|
-
};
|
|
4704
|
-
function Fo(t, e) {
|
|
4705
|
-
return Qi(t) ? t[fc(0, t.length, e)] : t;
|
|
4706
|
-
}
|
|
4707
|
-
function Mn(t) {
|
|
4708
|
-
return typeof t == "object" && !Array.isArray(t);
|
|
4709
|
-
}
|
|
4710
|
-
function Bo(t, e, n, s) {
|
|
4711
|
-
return typeof t == "string" && Mn(e) ? Ho(t, n, s) : t instanceof NodeList ? Array.from(t) : Array.isArray(t) ? t : [t];
|
|
4712
|
-
}
|
|
4713
|
-
function dc(t, e, n) {
|
|
4714
|
-
return t * (e + 1);
|
|
4715
|
-
}
|
|
4716
|
-
function qs(t, e, n, s) {
|
|
4717
|
-
var i;
|
|
4718
|
-
return typeof e == "number" ? e : e.startsWith("-") || e.startsWith("+") ? Math.max(0, t + parseFloat(e)) : e === "<" ? n : (i = s.get(e)) !== null && i !== void 0 ? i : t;
|
|
4719
|
-
}
|
|
4720
|
-
function pc(t, e, n) {
|
|
4721
|
-
for (let s = 0; s < t.length; s++) {
|
|
4722
|
-
const i = t[s];
|
|
4723
|
-
i.at > e && i.at < n && (ge(t, i), s--);
|
|
4724
|
-
}
|
|
4725
|
-
}
|
|
4726
|
-
function mc(t, e, n, s, i, r) {
|
|
4727
|
-
pc(t, i, r);
|
|
4728
|
-
for (let o = 0; o < e.length; o++)
|
|
4729
|
-
t.push({
|
|
4730
|
-
value: e[o],
|
|
4731
|
-
at: M(i, r, s[o]),
|
|
4732
|
-
easing: Fo(n, o)
|
|
4733
|
-
});
|
|
4734
|
-
}
|
|
4735
|
-
function gc(t, e) {
|
|
4736
|
-
for (let n = 0; n < t.length; n++)
|
|
4737
|
-
t[n] = t[n] / (e + 1);
|
|
4738
|
-
}
|
|
4739
|
-
function yc(t, e) {
|
|
4740
|
-
return t.at === e.at ? t.value === null ? 1 : e.value === null ? -1 : 0 : t.at - e.at;
|
|
4741
|
-
}
|
|
4742
|
-
const vc = "easeInOut", xc = 20;
|
|
4743
|
-
function Tc(t, { defaultTransition: e = {}, ...n } = {}, s, i) {
|
|
4744
|
-
const r = e.duration || 0.3, o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = {}, u = /* @__PURE__ */ new Map();
|
|
4745
|
-
let c = 0, h = 0, f = 0;
|
|
4746
|
-
for (let d = 0; d < t.length; d++) {
|
|
4747
|
-
const p = t[d];
|
|
4748
|
-
if (typeof p == "string") {
|
|
4749
|
-
u.set(p, h);
|
|
4750
|
-
continue;
|
|
4751
|
-
} else if (!Array.isArray(p)) {
|
|
4752
|
-
u.set(p.name, qs(h, p.at, c, u));
|
|
4753
|
-
continue;
|
|
4754
|
-
}
|
|
4755
|
-
let [m, y, g = {}] = p;
|
|
4756
|
-
g.at !== void 0 && (h = qs(h, g.at, c, u));
|
|
4757
|
-
let v = 0;
|
|
4758
|
-
const T = (P, x, b, w = 0, A = 0) => {
|
|
4759
|
-
const V = Sc(P), { delay: O = 0, times: j = no(V), type: ut = "keyframes", repeat: et, repeatType: xe, repeatDelay: Oo = 0, ...Rn } = x;
|
|
4760
|
-
let { ease: C = e.ease || "easeOut", duration: F } = x;
|
|
4761
|
-
const ct = typeof O == "function" ? O(w, A) : O, ht = V.length, En = le(ut) ? ut : i?.[ut];
|
|
4762
|
-
if (ht <= 2 && En) {
|
|
4763
|
-
let wt = 100;
|
|
4764
|
-
if (ht === 2 && bc(V)) {
|
|
4765
|
-
const Dt = V[1] - V[0];
|
|
4766
|
-
wt = Math.abs(Dt);
|
|
4767
|
-
}
|
|
4768
|
-
const Ht = { ...Rn };
|
|
4769
|
-
F !== void 0 && (Ht.duration = $(F));
|
|
4770
|
-
const Yt = Yo(Ht, wt, En);
|
|
4771
|
-
C = Yt.ease, F = Yt.duration;
|
|
4772
|
-
}
|
|
4773
|
-
F ?? (F = r);
|
|
4774
|
-
const Ln = h + ct;
|
|
4775
|
-
j.length === 1 && j[0] === 0 && (j[1] = 1);
|
|
4776
|
-
const Fn = j.length - V.length;
|
|
4777
|
-
if (Fn > 0 && eo(j, Fn), V.length === 1 && V.unshift(null), et) {
|
|
4778
|
-
G(et < xc, "Repeat count too high, must be less than 20"), F = dc(F, et);
|
|
4779
|
-
const wt = [...V], Ht = [...j];
|
|
4780
|
-
C = Array.isArray(C) ? [...C] : [C];
|
|
4781
|
-
const Yt = [...C];
|
|
4782
|
-
for (let Dt = 0; Dt < et; Dt++) {
|
|
4783
|
-
V.push(...wt);
|
|
4784
|
-
for (let Ct = 0; Ct < wt.length; Ct++)
|
|
4785
|
-
j.push(Ht[Ct] + (Dt + 1)), C.push(Ct === 0 ? "linear" : Fo(Yt, Ct - 1));
|
|
4786
|
-
}
|
|
4787
|
-
gc(j, et);
|
|
4788
|
-
}
|
|
4789
|
-
const Bn = Ln + F;
|
|
4790
|
-
mc(b, V, C, j, Ln, Bn), v = Math.max(ct + F, v), f = Math.max(Bn, f);
|
|
4791
|
-
};
|
|
4792
|
-
if (L(m)) {
|
|
4793
|
-
const P = Zs(m, a);
|
|
4794
|
-
T(y, g, Js("default", P));
|
|
4795
|
-
} else {
|
|
4796
|
-
const P = Bo(m, y, s, l), x = P.length;
|
|
4797
|
-
for (let b = 0; b < x; b++) {
|
|
4798
|
-
y = y, g = g;
|
|
4799
|
-
const w = P[b], A = Zs(w, a);
|
|
4800
|
-
for (const V in y)
|
|
4801
|
-
T(y[V], Pc(g, V), Js(V, A), b, x);
|
|
4802
|
-
}
|
|
4803
|
-
}
|
|
4804
|
-
c = h, h += v;
|
|
4805
|
-
}
|
|
4806
|
-
return a.forEach((d, p) => {
|
|
4807
|
-
for (const m in d) {
|
|
4808
|
-
const y = d[m];
|
|
4809
|
-
y.sort(yc);
|
|
4810
|
-
const g = [], v = [], T = [];
|
|
4811
|
-
for (let x = 0; x < y.length; x++) {
|
|
4812
|
-
const { at: b, value: w, easing: A } = y[x];
|
|
4813
|
-
g.push(w), v.push(yt(0, f, b)), T.push(A || "easeOut");
|
|
4814
|
-
}
|
|
4815
|
-
v[0] !== 0 && (v.unshift(0), g.unshift(g[0]), T.unshift(vc)), v[v.length - 1] !== 1 && (v.push(1), g.push(null)), o.has(p) || o.set(p, {
|
|
4816
|
-
keyframes: {},
|
|
4817
|
-
transition: {}
|
|
4818
|
-
});
|
|
4819
|
-
const P = o.get(p);
|
|
4820
|
-
P.keyframes[m] = g, P.transition[m] = {
|
|
4821
|
-
...e,
|
|
4822
|
-
duration: f,
|
|
4823
|
-
ease: T,
|
|
4824
|
-
times: v,
|
|
4825
|
-
...n
|
|
4826
|
-
};
|
|
4827
|
-
}
|
|
4828
|
-
}), o;
|
|
4829
|
-
}
|
|
4830
|
-
function Zs(t, e) {
|
|
4831
|
-
return !e.has(t) && e.set(t, {}), e.get(t);
|
|
4832
|
-
}
|
|
4833
|
-
function Js(t, e) {
|
|
4834
|
-
return e[t] || (e[t] = []), e[t];
|
|
4835
|
-
}
|
|
4836
|
-
function Sc(t) {
|
|
4837
|
-
return Array.isArray(t) ? t : [t];
|
|
4838
|
-
}
|
|
4839
|
-
function Pc(t, e) {
|
|
4840
|
-
return t && t[e] ? {
|
|
4841
|
-
...t,
|
|
4842
|
-
...t[e]
|
|
4843
|
-
} : { ...t };
|
|
4844
|
-
}
|
|
4845
|
-
const Ac = (t) => typeof t == "number", bc = (t) => t.every(Ac);
|
|
4846
|
-
function Vc(t, e) {
|
|
4847
|
-
return t in e;
|
|
4848
|
-
}
|
|
4849
|
-
class wc extends Co {
|
|
4850
|
-
constructor() {
|
|
4851
|
-
super(...arguments), this.type = "object";
|
|
4852
|
-
}
|
|
4853
|
-
readValueFromInstance(e, n) {
|
|
4854
|
-
if (Vc(n, e)) {
|
|
4855
|
-
const s = e[n];
|
|
4856
|
-
if (typeof s == "string" || typeof s == "number")
|
|
4857
|
-
return s;
|
|
4858
|
-
}
|
|
4859
|
-
}
|
|
4860
|
-
getBaseTargetFromProps() {
|
|
4861
|
-
}
|
|
4862
|
-
removeValueFromRenderState(e, n) {
|
|
4863
|
-
delete n.output[e];
|
|
4864
|
-
}
|
|
4865
|
-
measureInstanceViewportBox() {
|
|
4866
|
-
return E();
|
|
4867
|
-
}
|
|
4868
|
-
build(e, n) {
|
|
4869
|
-
Object.assign(e.output, n);
|
|
4870
|
-
}
|
|
4871
|
-
renderInstance(e, { output: n }) {
|
|
4872
|
-
Object.assign(e, n);
|
|
4873
|
-
}
|
|
4874
|
-
sortInstanceNodePosition() {
|
|
4875
|
-
return 0;
|
|
4876
|
-
}
|
|
4877
|
-
}
|
|
4878
|
-
function Dc(t) {
|
|
4879
|
-
const e = {
|
|
4880
|
-
presenceContext: null,
|
|
4881
|
-
props: {},
|
|
4882
|
-
visualState: {
|
|
4883
|
-
renderState: {
|
|
4884
|
-
transform: {},
|
|
4885
|
-
transformOrigin: {},
|
|
4886
|
-
style: {},
|
|
4887
|
-
vars: {},
|
|
4888
|
-
attrs: {}
|
|
4889
|
-
},
|
|
4890
|
-
latestValues: {}
|
|
4891
|
-
}
|
|
4892
|
-
}, n = vo(t) ? new Eo(e) : new Ro(e);
|
|
4893
|
-
n.mount(t), St.set(t, n);
|
|
4894
|
-
}
|
|
4895
|
-
function Cc(t) {
|
|
4896
|
-
const e = {
|
|
4897
|
-
presenceContext: null,
|
|
4898
|
-
props: {},
|
|
4899
|
-
visualState: {
|
|
4900
|
-
renderState: {
|
|
4901
|
-
output: {}
|
|
4902
|
-
},
|
|
4903
|
-
latestValues: {}
|
|
4904
|
-
}
|
|
4905
|
-
}, n = new wc(e);
|
|
4906
|
-
n.mount(t), St.set(t, n);
|
|
4907
|
-
}
|
|
4908
|
-
function Mc(t, e) {
|
|
4909
|
-
return L(t) || typeof t == "number" || typeof t == "string" && !Mn(e);
|
|
4910
|
-
}
|
|
4911
|
-
function ko(t, e, n, s) {
|
|
4912
|
-
const i = [];
|
|
4913
|
-
if (Mc(t, e))
|
|
4914
|
-
i.push(yo(t, Mn(e) && e.default || e, n && (n.default || n)));
|
|
4915
|
-
else {
|
|
4916
|
-
const r = Bo(t, e, s), o = r.length;
|
|
4917
|
-
G(!!o, "No valid elements provided.");
|
|
4918
|
-
for (let a = 0; a < o; a++) {
|
|
4919
|
-
const l = r[a], u = l instanceof Element ? Dc : Cc;
|
|
4920
|
-
St.has(l) || u(l);
|
|
4921
|
-
const c = St.get(l), h = { ...n };
|
|
4922
|
-
"delay" in h && typeof h.delay == "function" && (h.delay = h.delay(a, o)), i.push(...Dn(c, { ...e, transition: h }, {}));
|
|
4923
|
-
}
|
|
4924
|
-
}
|
|
4925
|
-
return i;
|
|
4926
|
-
}
|
|
4927
|
-
function Rc(t, e, n) {
|
|
4928
|
-
const s = [];
|
|
4929
|
-
return Tc(t, e, n, { spring: Vn }).forEach(({ keyframes: r, transition: o }, a) => {
|
|
4930
|
-
s.push(...ko(a, r, o));
|
|
4931
|
-
}), s;
|
|
4932
|
-
}
|
|
4933
|
-
function Ec(t) {
|
|
4934
|
-
return Array.isArray(t) && t.some(Array.isArray);
|
|
4935
|
-
}
|
|
4936
|
-
function Lc(t) {
|
|
4937
|
-
function e(n, s, i) {
|
|
4938
|
-
let r = [];
|
|
4939
|
-
return Ec(n) ? r = Rc(n, s, t) : r = ko(n, s, i, t), new ti(r);
|
|
4940
|
-
}
|
|
4941
|
-
return e;
|
|
4942
|
-
}
|
|
4943
|
-
const Kc = Lc();
|
|
4944
|
-
function Fc() {
|
|
4945
|
-
const t = At(hc);
|
|
4946
|
-
return Kt(t.mount, []), t;
|
|
4947
|
-
}
|
|
4948
|
-
const $c = Fc;
|
|
4949
|
-
export {
|
|
4950
|
-
Oc as A,
|
|
4951
|
-
Kc as a,
|
|
4952
|
-
_c as b,
|
|
4953
|
-
Nc as c,
|
|
4954
|
-
Uc as d,
|
|
4955
|
-
$c as e,
|
|
4956
|
-
Fc as f,
|
|
4957
|
-
Ic as m,
|
|
4958
|
-
Lo as u
|
|
4959
|
-
};
|