@nethesis/phone-island 1.1.4 → 1.1.5-dev.1
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/App.js.map +1 -1
- package/dist/components/AlertView/index.js.map +1 -1
- package/dist/components/AudioBars.js.map +1 -1
- package/dist/components/AudioPlayerView/PlayerFooterActions.js +1 -1
- package/dist/components/AudioPlayerView/PlayerFooterActions.js.map +1 -1
- package/dist/components/AudioPlayerView/Progress.js.map +1 -1
- package/dist/components/AudioPlayerView/index.js +1 -1
- package/dist/components/AudioPlayerView/index.js.map +1 -1
- package/dist/components/CallView/Actions.js +1 -1
- package/dist/components/CallView/Actions.js.map +1 -1
- package/dist/components/CallView/BackCall.js +1 -1
- package/dist/components/CallView/BackCall.js.map +1 -1
- package/dist/components/CallView/DeviceIcon.js +1 -1
- package/dist/components/CallView/DeviceIcon.js.map +1 -1
- package/dist/components/CallView/DisplayName.js +1 -1
- package/dist/components/CallView/DisplayName.js.map +1 -1
- package/dist/components/CallView/DisplayNameUtils.js.map +1 -1
- package/dist/components/CallView/Number.js +1 -1
- package/dist/components/CallView/Number.js.map +1 -1
- package/dist/components/CallView/NumberPopover.js +1 -1
- package/dist/components/CallView/NumberPopover.js.map +1 -1
- package/dist/components/CallView/index.js +1 -1
- package/dist/components/CallView/index.js.map +1 -1
- package/dist/components/ConferenceView/ConferenceUsersList.js +1 -1
- package/dist/components/ConferenceView/ConferenceUsersList.js.map +1 -1
- package/dist/components/ConferenceView/index.js +1 -1
- package/dist/components/ConferenceView/index.js.map +1 -1
- package/dist/components/ContactView/ContactListView.js +1 -1
- package/dist/components/ContactView/ContactListView.js.map +1 -1
- package/dist/components/ContactView/SelectContactNumberView.js +1 -1
- package/dist/components/ContactView/SelectContactNumberView.js.map +1 -1
- package/dist/components/ContactView/TransferActions.js +1 -1
- package/dist/components/ContactView/TransferActions.js.map +1 -1
- package/dist/components/Hangup.js +1 -1
- package/dist/components/Hangup.js.map +1 -1
- package/dist/components/KeypadView/index.js +1 -1
- package/dist/components/KeypadView/index.js.map +1 -1
- package/dist/components/OperatorBusyView/index.js +1 -1
- package/dist/components/OperatorBusyView/index.js.map +1 -1
- package/dist/components/PhysicalRecorderView/index.js +1 -1
- package/dist/components/PhysicalRecorderView/index.js.map +1 -1
- package/dist/components/RecorderView/Actions.js +1 -1
- package/dist/components/RecorderView/Actions.js.map +1 -1
- package/dist/components/RecorderView/BarsGroup.js.map +1 -1
- package/dist/components/RecorderView/index.js +1 -1
- package/dist/components/RecorderView/index.js.map +1 -1
- package/dist/components/SettingsView/AudioView.js +1 -1
- package/dist/components/SettingsView/AudioView.js.map +1 -1
- package/dist/components/SettingsView/MicrophoneView.js +1 -1
- package/dist/components/SettingsView/MicrophoneView.js.map +1 -1
- package/dist/components/SettingsView/SettingsHeader.js +1 -1
- package/dist/components/SettingsView/SettingsHeader.js.map +1 -1
- package/dist/components/SettingsView/ThemeView.js +1 -1
- package/dist/components/SettingsView/ThemeView.js.map +1 -1
- package/dist/components/SettingsView/index.js +1 -1
- package/dist/components/SettingsView/index.js.map +1 -1
- package/dist/components/SideView/SideView.js +1 -1
- package/dist/components/SideView/SideView.js.map +1 -1
- package/dist/components/SideView/hooks/useSideViewLogic.js.map +1 -1
- package/dist/components/Socket.js.map +1 -1
- package/dist/components/SwitchDeviceView/index.js +1 -1
- package/dist/components/SwitchDeviceView/index.js.map +1 -1
- package/dist/components/SwitchInputView/DropdownContent.js +1 -1
- package/dist/components/SwitchInputView/DropdownContent.js.map +1 -1
- package/dist/components/SwitchInputView/Index.js +1 -1
- package/dist/components/TextScroll.js +1 -1
- package/dist/components/TextScroll.js.map +1 -1
- package/dist/components/TranscriptionView/TranscriptionView.js +1 -1
- package/dist/components/TranscriptionView/TranscriptionView.js.map +1 -1
- package/dist/components/VideoStreamingEmptyState/index.js +1 -1
- package/dist/components/VideoStreamingEmptyState/index.js.map +1 -1
- package/dist/components/VideoStreamingSkeleton/index.js +1 -1
- package/dist/components/VideoStreamingSkeleton/index.js.map +1 -1
- package/dist/components/VideoView/index.js.map +1 -1
- package/dist/components/WebRTC.js.map +1 -1
- package/dist/events/SocketEvents.js.map +1 -1
- package/dist/lib/i18n.js +1 -1
- package/dist/lib/i18n.js.map +1 -1
- package/dist/lib/phone/call.js +1 -1
- package/dist/lib/phone/call.js.map +1 -1
- package/dist/lib/phone/counterpartDevice.js.map +1 -1
- package/dist/lib/phone/video.js.map +1 -1
- package/dist/lib/player/audio.js.map +1 -1
- package/dist/lib/user/default_device.js.map +1 -1
- package/dist/lib/user/extensions.js.map +1 -1
- package/dist/models/currentCall.js.map +1 -1
- package/dist/models/island.js.map +1 -1
- package/dist/models/player.js +1 -1
- package/dist/models/player.js.map +1 -1
- package/dist/node_modules/classnames/index.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/context/LazyContext.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.js +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.js.map +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.js +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.js.map +1 -1
- package/dist/node_modules/js-base64/base64.mjs.js +1 -1
- package/dist/node_modules/js-base64/base64.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/utils/notify-inspector.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/notify-inspector.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-start-time.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-start-time.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/TransformAnimation.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/TransformAnimation.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/groups.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/transforms/groups.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/needs-mixer.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/needs-mixer.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/events/add-pointer-event.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/events/add-pointer-event.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/events/event-info.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/events/event-info.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame-data.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame-data.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/VisualElementDragControls.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/VisualElementDragControls.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/utils/constraints.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/utils/constraints.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/pan/PanSession.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/pan/PanSession.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/round.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/round.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/node/root.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/root.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/default-scale-correctors.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/default-scale-correctors.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/VisualElement.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/VisualElement.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/resize/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/resize/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/scope/active.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/scope/active.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/stats/buffer.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/stats/buffer.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/utils/delay.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/delay.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/distance.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/is-ref-object.mjs.js.map +1 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/value/utils/as-number.mjs.js +2 -0
- package/dist/node_modules/motion-dom/dist/es/value/utils/as-number.mjs.js.map +1 -0
- package/dist/node_modules/motion-utils/dist/es/easing/circ.mjs.js.map +1 -1
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.js +1 -1
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.js.map +1 -1
- package/dist/node_modules/motion-utils/dist/es/easing/utils/map.mjs.js +1 -1
- package/dist/node_modules/motion-utils/dist/es/easing/utils/map.mjs.js.map +1 -1
- package/dist/node_modules/motion-utils/dist/es/errors.mjs.js +1 -1
- package/dist/node_modules/motion-utils/dist/es/errors.mjs.js.map +1 -1
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.mjs.js +1 -1
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.mjs.js.map +1 -1
- package/dist/node_modules/react-i18next/dist/es/context.js +1 -1
- package/dist/node_modules/react-i18next/dist/es/context.js.map +1 -1
- package/dist/node_modules/react-i18next/dist/es/defaults.js +1 -1
- package/dist/node_modules/react-i18next/dist/es/defaults.js.map +1 -1
- package/dist/node_modules/react-i18next/dist/es/i18nInstance.js +1 -1
- package/dist/node_modules/react-i18next/dist/es/i18nInstance.js.map +1 -1
- package/dist/node_modules/react-i18next/dist/es/initReactI18next.js +1 -1
- package/dist/node_modules/react-i18next/dist/es/initReactI18next.js.map +1 -1
- package/dist/node_modules/react-i18next/dist/es/unescape.js +1 -1
- package/dist/node_modules/react-i18next/dist/es/unescape.js.map +1 -1
- package/dist/node_modules/react-i18next/dist/es/useTranslation.js +1 -1
- package/dist/node_modules/react-i18next/dist/es/useTranslation.js.map +1 -1
- package/dist/node_modules/react-i18next/dist/es/utils.js +1 -1
- package/dist/node_modules/react-i18next/dist/es/utils.js.map +1 -1
- package/dist/node_modules/react-redux/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/services/astproxy.js +1 -1
- package/dist/services/astproxy.js.map +1 -1
- package/dist/services/phonebook.js +1 -1
- package/dist/services/phonebook.js.map +1 -1
- package/dist/utils/customHooks/useLocalStorage.js.map +1 -1
- package/dist/utils/deviceUtils.js.map +1 -1
- package/package.json +6 -6
- package/dist/_virtual/arrayLikeToArray.js +0 -2
- package/dist/_virtual/arrayLikeToArray.js.map +0 -1
- package/dist/_virtual/arrayWithHoles.js +0 -2
- package/dist/_virtual/arrayWithHoles.js.map +0 -1
- package/dist/_virtual/classCallCheck.js +0 -2
- package/dist/_virtual/classCallCheck.js.map +0 -1
- package/dist/_virtual/createClass.js +0 -2
- package/dist/_virtual/createClass.js.map +0 -1
- package/dist/_virtual/defineProperty.js +0 -2
- package/dist/_virtual/defineProperty.js.map +0 -1
- package/dist/_virtual/iterableToArrayLimit.js +0 -2
- package/dist/_virtual/iterableToArrayLimit.js.map +0 -1
- package/dist/_virtual/nonIterableRest.js +0 -2
- package/dist/_virtual/nonIterableRest.js.map +0 -1
- package/dist/_virtual/objectWithoutProperties.js +0 -2
- package/dist/_virtual/objectWithoutProperties.js.map +0 -1
- package/dist/_virtual/objectWithoutPropertiesLoose.js +0 -2
- package/dist/_virtual/objectWithoutPropertiesLoose.js.map +0 -1
- package/dist/_virtual/slicedToArray.js +0 -2
- package/dist/_virtual/slicedToArray.js.map +0 -1
- package/dist/_virtual/toPrimitive.js +0 -2
- package/dist/_virtual/toPrimitive.js.map +0 -1
- package/dist/_virtual/toPropertyKey.js +0 -2
- package/dist/_virtual/toPropertyKey.js.map +0 -1
- package/dist/_virtual/typeof.js +0 -2
- package/dist/_virtual/typeof.js.map +0 -1
- package/dist/_virtual/unsupportedIterableToArray.js +0 -2
- package/dist/_virtual/unsupportedIterableToArray.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/arrayLikeToArray.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/arrayWithHoles.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/arrayWithHoles.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/classCallCheck.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/classCallCheck.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/createClass.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/createClass.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/defineProperty.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/defineProperty.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/inherits.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/inherits.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/toArray.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/toArray.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/nonIterableRest.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/nonIterableRest.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/objectWithoutProperties.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/slicedToArray.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/slicedToArray.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/toPrimitive.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/toPrimitive.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/toPropertyKey.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/toPropertyKey.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/typeof.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/typeof.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +0 -2
- package/dist/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/events/event-info.mjs.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/events/event-info.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/utils/distance.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.js.map +0 -1
- package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.js.map +0 -1
- package/dist/node_modules/html-parse-stringify/dist/html-parse-stringify.js +0 -2
- package/dist/node_modules/html-parse-stringify/dist/html-parse-stringify.js.map +0 -1
- package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.js.map +0 -1
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.js.map +0 -1
- package/dist/node_modules/void-elements/index.js +0 -2
- package/dist/node_modules/void-elements/index.js.map +0 -1
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/utils/distance.mjs.js +0 -0
- /package/dist/node_modules/{framer-motion → motion-dom}/dist/es/utils/is-ref-object.mjs.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t="3.9.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t="3.9.6",e=t,r="function"==typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,o="function"==typeof TextEncoder?new TextEncoder:void 0,n=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),a=(()=>{let t={};return n.forEach((e,r)=>t[e]=r),t})(),i=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),s="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),p=t=>t.replace(/=/g,"").replace(/[+\/]/g,t=>"+"==t?"-":"_"),l=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),u=t=>{let e,r,o,a,i="";const c=t.length%3;for(let c=0;c<t.length;){if((r=t.charCodeAt(c++))>255||(o=t.charCodeAt(c++))>255||(a=t.charCodeAt(c++))>255)throw new TypeError("invalid character found");e=r<<16|o<<8|a,i+=n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}return c?i.slice(0,c-3)+"===".substring(c):i},d="function"==typeof btoa?t=>btoa(t):u,f="function"==typeof Uint8Array.prototype.toBase64?Function.prototype.call.bind(Uint8Array.prototype.toBase64):t=>{let e=[];for(let r=0,o=t.length;r<o;r+=4096)e.push(c.apply(null,t.subarray(r,r+4096)));return d(e.join(""))},h=(t,e=!1)=>e?p(f(t)):f(t),x=t=>{if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?c(192|e>>>6)+c(128|63&e):c(224|e>>>12&15)+c(128|e>>>6&63)+c(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return c(240|e>>>18&7)+c(128|e>>>12&63)+c(128|e>>>6&63)+c(128|63&e)},y=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g,A=t=>t.replace(y,x),b=o?t=>f(o.encode(t)):t=>d(A(t)),g=(t,e=!1)=>e?p(b(t)):b(t),U=t=>g(t,!0),B=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,C=t=>{switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return c((e>>>10)+55296)+c(56320+(1023&e));case 3:return c((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return c((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},m=t=>t.replace(B,C),F=t=>{if(t=t.replace(/\s+/g,""),!i.test(t))throw new TypeError("malformed base64.");let e,r,o;t+="==".slice(2-(3&t.length));let n=[];for(let i=0;i<t.length;)e=a[t.charAt(i++)]<<18|a[t.charAt(i++)]<<12|(r=a[t.charAt(i++)])<<6|(o=a[t.charAt(i++)]),64===r?n.push(c(e>>16&255)):64===o?n.push(c(e>>16&255,e>>8&255)):n.push(c(e>>16&255,e>>8&255,255&e));return n.join("")},R="function"==typeof atob?t=>atob(l(t)):F,v="function"==typeof Uint8Array.fromBase64?t=>Uint8Array.fromBase64(t):t=>s(R(t).split("").map(t=>t.charCodeAt(0))),w=t=>v(D(t)),E=r?t=>r.decode(v(t)):t=>m(R(t)),D=t=>l(t.replace(/[-_]/g,t=>"-"==t?"+":"/")),P=t=>E(D(t)),S=t=>{if("string"!=typeof t)return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return e.length%4!=1&&(!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e))},z=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),I=function(){const t=(t,e)=>Object.defineProperty(String.prototype,t,z(e));t("fromBase64",function(){return P(this)}),t("toBase64",function(t){return g(this,t)}),t("toBase64URI",function(){return g(this,!0)}),t("toBase64URL",function(){return g(this,!0)}),t("toUint8Array",function(){return w(this)})},O=function(){const t=(t,e)=>Object.defineProperty(Uint8Array.prototype,t,z(e));t("toBase64",function(t){return h(this,t)}),t("toBase64URI",function(){return h(this,!0)}),t("toBase64URL",function(){return h(this,!0)})},T=()=>{I(),O()},Z={version:t,VERSION:e,atob:R,atobPolyfill:F,btoa:d,btoaPolyfill:u,fromBase64:P,toBase64:g,encode:g,encodeURI:U,encodeURL:U,utob:A,btou:m,decode:P,isValid:S,fromUint8Array:h,toUint8Array:w,extendString:I,extendUint8Array:O,extendBuiltins:T};exports.Base64=Z,exports.VERSION=e,exports.atob=R,exports.atobPolyfill=F,exports.btoa=d,exports.btoaPolyfill=u,exports.btou=m,exports.decode=P,exports.encode=g,exports.encodeURI=U,exports.encodeURL=U,exports.extendBuiltins=T,exports.extendString=I,exports.extendUint8Array=O,exports.fromBase64=P,exports.fromUint8Array=h,exports.isValid=S,exports.toBase64=g,exports.toUint8Array=w,exports.utob=A,exports.version=t;
|
|
2
2
|
//# sourceMappingURL=base64.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base64.mjs.js","sources":["../../../node_modules/js-base64/base64.mjs"],"sourcesContent":["/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.9.4';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder('utf-8', { ignoreBOM: true }) : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)\n : btoaPolyfill;\nconst _fromUint8Array = typeof Uint8Array.prototype.toBase64 === 'function' ? (u8a) => u8a.toBase64()\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, r1, r2;\n let binArray = []; // use array to avoid minor gc in loop\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n if (r1 === 64) {\n binArray.push(_fromCC(u24 >> 16 & 255));\n }\n else if (r2 === 64) {\n binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255));\n }\n else {\n binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255));\n }\n }\n return binArray.join('');\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))\n : atobPolyfill;\n//\nconst _toUint8Array = typeof Uint8Array.fromBase64 === 'function'\n ? (a) => Uint8Array.fromBase64(a) : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n};\n\nexport { gBase64 as Base64, VERSION, _atob as atob, atobPolyfill, _btoa as btoa, btoaPolyfill, btou, decode, encode, encodeURI, encodeURI as encodeURL, extendBuiltins, extendString, extendUint8Array, decode as fromBase64, fromUint8Array, isValid, encode as toBase64, toUint8Array, utob, version };\n"],"names":["version","VERSION","_TD","TextDecoder","ignoreBOM","undefined","_TE","TextEncoder","b64chs","Array","prototype","slice","call","b64tab","tab","forEach","c","i","b64re","_fromCC","String","fromCharCode","bind","_U8Afrom","Uint8Array","from","it","_mkUriSafe","src","replace","m0","_tidyB64","s","btoaPolyfill","bin","u32","c0","c1","c2","asc","pad","length","charCodeAt","TypeError","substring","_btoa","btoa","_fromUint8Array","toBase64","u8a","strs","l","push","apply","subarray","join","fromUint8Array","urlsafe","cb_utob","cc","re_utob","utob","u","_encode","encode","encodeURI","re_btou","cb_btou","cccc","offset","btou","b","atobPolyfill","test","u24","r1","r2","binArray","charAt","_atob","atob","_toUint8Array","fromBase64","a","split","map","toUint8Array","_unURI","_decode","decode","isValid","_noEnum","v","value","enumerable","writable","configurable","extendString","_add","name","body","Object","defineProperty","this","extendUint8Array","extendBuiltins","gBase64","encodeURL"],"mappings":"oEAWMA,MAAAA,EAAU,QAIVC,EAAUD,EACVE,EAA6B,mBAAhBC,YAA6B,IAAIA,YAAY,QAAS,CAAEC,WAAW,SAAUC,EAC1FC,EAA6B,mBAAhBC,YAA6B,IAAIA,iBAAgBF,EAE9DG,EAASC,MAAMC,UAAUC,MAAMC,KADvB,qEAERC,EAAS,MACX,IAAIC,EAAM,CAAA,EAEV,OACDN,EAFGO,QAAQ,CAACC,EAAGC,IAAMH,EAAIE,GAAKC,GACtBH,CACV,EAJc,GAKTI,EAAQ,0EACRC,EAAUC,OAAOC,aAAaC,KAAKF,QACnCG,EAAsC,mBAApBC,WAAWC,KAC7BD,WAAWC,KAAKH,KAAKE,YACpBE,GAAO,IAAIF,WAAWf,MAAMC,UAAUC,MAAMC,KAAKc,EAAI,IACtDC,EAAcC,GAAQA,EACvBC,QAAQ,KAAM,IAAIA,QAAQ,SAAWC,GAAa,KAANA,EAAY,IAAM,KAC7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Ac,IAM7DC,EAAe,WACjB,MAAMC,EAAOA,CAACC,EAAMC,IAASC,OAAOC,eAAelF,OAAOV,UAAWyF,EAAMR,EAAQS,IACnFF,EAAK,aAAc,WAAc,OAAOT,EAAOc,KAAO,GACtDL,EAAK,WAAY,SAAUzC,GAAW,OAAOO,EAAOuC,KAAM9C,EAAU,GACpEyC,EAAK,cAAe,WAAc,OAAOlC,EAAOuC,MAAM,EAAO,GAC7DL,EAAK,cAAe,WAAc,OAAOlC,EAAOuC,MAAM,EAAO,GAC7DL,EAAK,eAAgB,WAAc,OAAOZ,EAAaiB,KAAO,EAClE,EAIMC,EAAmB,WACrB,MAAMN,EAAOA,CAACC,EAAMC,IAASC,OAAOC,eAAe9E,WAAWd,UAAWyF,EAAMR,EAAQS,IACvFF,EAAK,WAAY,SAAUzC,GAAW,OAAOD,EAAe+C,KAAM9C,EAAU,GAC5EyC,EAAK,cAAe,WAAc,OAAO1C,EAAe+C,MAAM,EAAO,GACrEL,EAAK,cAAe,WAAc,OAAO1C,EAAe+C,MAAM,EAAO,EACzE,EAIME,EAAiBA,KACnBR,IACAO,KAEEE,EAAU,CACZ1G,QAASA,EACTC,QAASA,EACT+E,KAAMD,EACNP,aAAcA,EACd1B,KAAMD,EACNZ,aAAcA,EACdiD,WAAYO,EACZzC,SAAUgB,EACVA,OAAQA,EACRC,UAAWA,EACX0C,UAAW1C,EACXJ,KAAMA,EACNS,KAAMA,EACNmB,OAAQA,EACRC,QAASA,EACTlC,eAAgBA,EAChB8B,aAAcA,EACdW,aAAcA,EACdO,iBAAkBA,EAClBC,eAAgBA"}
|
|
1
|
+
{"version":3,"file":"base64.mjs.js","sources":["../../../node_modules/js-base64/base64.mjs"],"sourcesContent":["/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.9.6';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder('utf-8', { ignoreBOM: true }) : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)\n : btoaPolyfill;\nconst _fromUint8Array = typeof Uint8Array.prototype.toBase64 === 'function' ? Function.prototype.call.bind(Uint8Array.prototype.toBase64)\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, r1, r2;\n let binArray = []; // use array to avoid minor gc in loop\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n if (r1 === 64) {\n binArray.push(_fromCC(u24 >> 16 & 255));\n }\n else if (r2 === 64) {\n binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255));\n }\n else {\n binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255));\n }\n }\n return binArray.join('');\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))\n : atobPolyfill;\n//\nconst _toUint8Array = typeof Uint8Array.fromBase64 === 'function'\n ? (a) => Uint8Array.fromBase64(a) : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n // a data length of 4n+1 cannot encode a whole number of bytes (#197)\n if (s.length % 4 === 1)\n return false;\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n};\n\nexport { gBase64 as Base64, VERSION, _atob as atob, atobPolyfill, _btoa as btoa, btoaPolyfill, btou, decode, encode, encodeURI, encodeURI as encodeURL, extendBuiltins, extendString, extendUint8Array, decode as fromBase64, fromUint8Array, isValid, encode as toBase64, toUint8Array, utob, version };\n"],"names":["version","VERSION","_TD","TextDecoder","ignoreBOM","undefined","_TE","TextEncoder","b64chs","Array","prototype","slice","call","b64tab","tab","forEach","c","i","b64re","_fromCC","String","fromCharCode","bind","_U8Afrom","Uint8Array","from","it","_mkUriSafe","src","replace","m0","_tidyB64","s","btoaPolyfill","bin","u32","c0","c1","c2","asc","pad","length","charCodeAt","TypeError","substring","_btoa","btoa","_fromUint8Array","toBase64","Function","u8a","strs","l","push","apply","subarray","join","fromUint8Array","urlsafe","cb_utob","cc","re_utob","utob","u","_encode","encode","encodeURI","re_btou","cb_btou","cccc","offset","btou","b","atobPolyfill","test","u24","r1","r2","binArray","charAt","_atob","atob","_toUint8Array","fromBase64","a","split","map","toUint8Array","_unURI","_decode","decode","isValid","_noEnum","v","value","enumerable","writable","configurable","extendString","_add","name","body","Object","defineProperty","this","extendUint8Array","extendBuiltins","gBase64","encodeURL"],"mappings":"oEAWMA,MAAAA,EAAU,QAIVC,EAAUD,EACVE,EAA6B,mBAAhBC,YAA6B,IAAIA,YAAY,QAAS,CAAEC,WAAW,SAAUC,EAC1FC,EAA6B,mBAAhBC,YAA6B,IAAIA,iBAAgBF,EAE9DG,EAASC,MAAMC,UAAUC,MAAMC,KADvB,qEAERC,EAAS,MACX,IAAIC,EAAM,CAAA,EAEV,OACDN,EAFGO,QAAQ,CAACC,EAAGC,IAAMH,EAAIE,GAAKC,GACtBH,CACV,EAJc,GAKTI,EAAQ,0EACRC,EAAUC,OAAOC,aAAaC,KAAKF,QACnCG,EAAsC,mBAApBC,WAAWC,KAC7BD,WAAWC,KAAKH,KAAKE,YACpBE,GAAO,IAAIF,WAAWf,MAAMC,UAAUC,MAAMC,KAAKc,EAAI,IACtDC,EAAcC,GAAQA,EACvBC,QAAQ,KAAM,IAAIA,QAAQ,SAAWC,GAAa,KAANA,EAAY,IAAM,KAC7DC,EAAYC,GAAMA,EAAEH,QAAQ,oBAAqB,IAIjDI,EAAgBC,IAElB,IAAIC,EAAKC,EAAIC,EAAIC,EAAIC,EAAM,GAC3B,MAAMC,EAAMN,EAAIO,OAAS,EACzB,IAAK,IAAIxB,EAAI,EAAGA,EAAIiB,EAAIO,QAAS,CAC7B,IAAKL,EAAKF,EAAIQ,WAAWzB,MAAQ,MAC5BoB,EAAKH,EAAIQ,WAAWzB,MAAQ,MAC5BqB,EAAKJ,EAAIQ,WAAWzB,MAAQ,IAC7B,MAAM,IAAI0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,OAAOlC,EAAOuC,MAAM,EAAO,GAC7DL,EAAK,eAAgB,WAAc,OAAOZ,EAAaiB,KAAO,EAClE,EAIMC,EAAmB,WACrB,MAAMN,EAAOA,CAACC,EAAMC,IAASC,OAAOC,eAAe/E,WAAWd,UAAW0F,EAAMR,EAAQS,IACvFF,EAAK,WAAY,SAAUzC,GAAW,OAAOD,EAAe+C,KAAM9C,EAAU,GAC5EyC,EAAK,cAAe,WAAc,OAAO1C,EAAe+C,MAAM,EAAO,GACrEL,EAAK,cAAe,WAAc,OAAO1C,EAAe+C,MAAM,EAAO,EACzE,EAIME,EAAiBA,KACnBR,IACAO,KAEEE,EAAU,CACZ3G,QAASA,EACTC,QAASA,EACTgF,KAAMD,EACNP,aAAcA,EACd3B,KAAMD,EACNZ,aAAcA,EACdkD,WAAYO,EACZ1C,SAAUiB,EACVA,OAAQA,EACRC,UAAWA,EACX0C,UAAW1C,EACXJ,KAAMA,EACNS,KAAMA,EACNmB,OAAQA,EACRC,QAASA,EACTlC,eAAgBA,EAChB8B,aAAcA,EACdW,aAAcA,EACdO,iBAAkBA,EAClBC,eAAgBA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../frameloop/sync-time.mjs.js"),t=require("./JSAnimation.mjs.js"),i=require("./keyframes/get-final.mjs.js"),n=require("./keyframes/KeyframesResolver.mjs.js"),s=require("./NativeAnimationExtended.mjs.js"),a=require("./utils/can-animate.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../frameloop/sync-time.mjs.js"),t=require("./JSAnimation.mjs.js"),i=require("./keyframes/get-final.mjs.js"),n=require("./keyframes/KeyframesResolver.mjs.js"),s=require("./NativeAnimationExtended.mjs.js"),a=require("./utils/can-animate.mjs.js"),r=require("./utils/make-animation-instant.mjs.js"),o=require("./utils/resolve-start-time.mjs.js"),m=require("./utils/WithPromise.mjs.js"),l=require("./waapi/supports/waapi.mjs.js"),h=require("./waapi/transforms/TransformAnimation.mjs.js"),u=require("../../../../motion-utils/dist/es/global-config.mjs.js");class p extends m.WithPromise{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=e.time.now();const{keyframes:i,name:s,motionValue:a,element:r}=t,o=t;o.autoplay??(o.autoplay=!0),o.delay??(o.delay=0),o.type??(o.type="keyframes"),o.repeat??(o.repeat=0),o.repeatDelay??(o.repeatDelay=0),o.repeatType??(o.repeatType="loop");const m=r?.KeyframeResolver||n.KeyframeResolver;this.keyframeResolver=new m(i,(e,t,i)=>this.onKeyframesResolved(e,t,o,!i),s,a,r),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(n,m,p,y){this.keyframeResolver=void 0;const{name:d,type:f,velocity:c,delay:v,isHandoff:j,onUpdate:T}=p;this.resolvedAt=e.time.now();const A=a.canAnimate(n,d,f,c);A||(!u.MotionGlobalConfig.instantAnimations&&v||T?.(i.getFinalKeyframe(n,p,m)),n[0]=n[n.length-1],r.makeAnimationInstant(p),p.repeat=0);const{onComplete:g}=p;p.finalKeyframe=m,p.keyframes=n,p.onComplete=()=>{g?.(),this.notifyFinished()};const k=A&&!j&&l.supportsBrowserAnimation(p),R=!k&&h.canGroupTransform(p);let q;if(y&&(k||R||this.resolvedAt!==this.createdAt)&&(p.startTime??(p.startTime=o.resolveStartTime(this.createdAt,this.resolvedAt))),k){p.element=p.motionValue?.owner?.current;try{q=new s.NativeAnimationExtended(p)}catch{q=new t.JSAnimation(p)}}else q=R?new h.TransformAnimation(p):new t.JSAnimation(p);this.pendingTimeline&&(this.stopTimeline=q.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=q}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),n.flushKeyframeResolvers()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}}exports.AsyncMotionValueAnimation=p;
|
|
2
2
|
//# sourceMappingURL=AsyncMotionValueAnimation.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncMotionValueAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs"],"sourcesContent":["import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true;\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false;\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi = canAnimateValue &&\n !isHandoff &&\n supportsBrowserAnimation(resolvedOptions);\n const element = resolvedOptions.motionValue?.owner?.current;\n let animation;\n if (useWaapi) {\n try {\n animation = new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n });\n }\n catch {\n animation = new JSAnimation(resolvedOptions);\n }\n }\n else {\n animation = new JSAnimation(resolvedOptions);\n }\n animation.finished.then(() => {\n this.notifyFinished();\n }).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map\n"],"names":["AsyncMotionValueAnimation","WithPromise","constructor","autoplay","delay","type","repeat","repeatDelay","repeatType","keyframes","name","motionValue","element","options","super","this","stop","_animation","stopTimeline","keyframeResolver","cancel","createdAt","time","now","optionsWithDefaults","KeyframeResolver","resolvedKeyframes","finalKeyframe","forced","onKeyframesResolved","scheduleResolve","sync","undefined","velocity","isHandoff","onUpdate","resolvedAt","canAnimateValue","canAnimate","MotionGlobalConfig","instantAnimations","getFinalKeyframe","length","makeAnimationInstant","resolvedOptions","startTime","useWaapi","supportsBrowserAnimation","owner","current","animation","NativeAnimationExtended","JSAnimation","finished","then","notifyFinished","catch","noop","pendingTimeline","attachTimeline","_finished","onResolve","_onReject","finally","resume","flushKeyframeResolvers","duration","iterationDuration","newTime","speed","state","newSpeed","timeline","play","pause","complete"],"mappings":"0kBAoCM,MAAOA,UACDC,EAAAA,YAeRC,WAAAA,EAAYC,SACRA,GAAW,EAAIC,MACfA,EAAQ,EAACC,KACTA,EAAO,YAAWC,OAClBA,EAAS,EAACC,YACVA,EAAc,EAACC,WACfA,EAAa,OAAMC,UACnBA,EAASC,KACTA,EAAIC,YACJA,EAAWC,QACXA,KACGC,IAEHC,QA8NJC,KAAAC,KAAO,KACCD,KAAKE,aACLF,KAAKE,WAAWD,OAChBD,KAAKG,kBAGTH,KAAKI,kBAAkBC,UAlOvBL,KAAKM,UAAYC,OAAKC,MAEtB,MAAMC,EAAkD,CACpDrB,WACAC,QACAC,OACAC,SACAC,cACAC,aACAE,OACAC,cACAC,aACGC,GAGDY,EACFb,GAASa,kBAAoBA,mBAEjCV,KAAKI,iBAAmB,IAAIM,EACxBhB,EACA,CACIiB,EACAC,EACAC,IAEAb,KAAKc,oBACDH,EACAC,EACAH,GACCI,GAETlB,EACAC,EACAC,GAEJG,KAAKI,kBAAkBW,iBAC3B,CAEAD,mBAAAA,CACIpB,EACAkB,EACAd,EACAkB,GAEAhB,KAAKI,sBAAmBa,EAExB,MAAMtB,KAAEA,EAAIL,KAAEA,EAAI4B,SAAEA,EAAQ7B,MAAEA,EAAK8B,UAAEA,EAASC,SAAEA,GAAatB,EAC7DE,KAAKqB,WAAad,OAAKC,MAMvB,IAAIc,GAAkB,EAC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AIA,CAAK8C,GACLrD,KAAKmC,UAAU5B,KAAO8C,CAC1B,CAEA,SAAIC,GACA,OAAOtD,KAAKmC,UAAUmB,KAC1B,CAEA,SAAIC,GACA,OAAOvD,KAAKmC,UAAUoB,KAC1B,CAEA,SAAID,CAAME,GACNxD,KAAKmC,UAAUmB,MAAQE,CAC3B,CAEA,aAAI1B,GACA,OAAO9B,KAAKmC,UAAUL,SAC1B,CAEAc,cAAAA,CAAea,GAOX,OANIzD,KAAKE,WACLF,KAAKG,aAAeH,KAAKmC,UAAUS,eAAea,GAElDzD,KAAK2C,gBAAkBc,EAGpB,IAAMzD,KAAKC,MACtB,CAEAyD,IAAAA,GACI1D,KAAKmC,UAAUuB,MACnB,CAEAC,KAAAA,GACI3D,KAAKmC,UAAUwB,OACnB,CAEAC,QAAAA,GACI5D,KAAKmC,UAAUyB,UACnB,CAEAvD,MAAAA,GACQL,KAAKE,YACLF,KAAKmC,UAAU9B,SAGnBL,KAAKI,kBAAkBC,QAC3B"}
|
|
1
|
+
{"version":3,"file":"AsyncMotionValueAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs"],"sourcesContent":["import { MotionGlobalConfig } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { resolveStartTime } from './utils/resolve-start-time.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\nimport { canGroupTransform, TransformAnimation } from './waapi/transforms/TransformAnimation.mjs';\n\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor(options) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const { keyframes, name, motionValue, element } = options;\n /**\n * animateMotionValue builds a fresh options object per value, so\n * it's completed in place as keyframes resolve rather than copied.\n */\n const optionsWithDefaults = options;\n optionsWithDefaults.autoplay ?? (optionsWithDefaults.autoplay = true);\n optionsWithDefaults.delay ?? (optionsWithDefaults.delay = 0);\n optionsWithDefaults.type ?? (optionsWithDefaults.type = \"keyframes\");\n optionsWithDefaults.repeat ?? (optionsWithDefaults.repeat = 0);\n optionsWithDefaults.repeatDelay ?? (optionsWithDefaults.repeatDelay = 0);\n optionsWithDefaults.repeatType ?? (optionsWithDefaults.repeatType = \"loop\");\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n const canAnimateValue = canAnimate(keyframes, name, type, velocity);\n if (!canAnimateValue) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n const { onComplete } = options;\n options.finalKeyframe = finalKeyframe;\n options.keyframes = keyframes;\n /**\n * JSAnimation and NativeAnimation call onComplete exactly when\n * their own `finished` resolves, so this replaces a promise chain\n * per value with a callback.\n */\n options.onComplete = () => {\n onComplete?.();\n this.notifyFinished();\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n *\n * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi = canAnimateValue && !isHandoff && supportsBrowserAnimation(options);\n /**\n * Independent transforms (x, scale etc) on an HTML element are\n * composed into one WAAPI transform animation per element.\n */\n const isGroupedTransform = !useWaapi && canGroupTransform(options);\n /**\n * Resolve startTime for the animation. A startTime passed in options\n * (an optimised appear handoff syncing to its WAAPI animation) takes\n * precedence.\n *\n * *Ideally*, we would use the createdAt time as t=0 as the following\n * frame would then be the first frame of the animation in progress,\n * which would feel snappier. If keyframes resolved on a later frame,\n * and long after creation, we start from then instead.\n *\n * If they resolved immediately, a JSAnimation picks its own start\n * time and resolves it the same way on its first frame, so every\n * animation started in that moment stays in sync. WAAPI has no frame\n * of ours to do that on.\n */\n if (sync &&\n (useWaapi ||\n isGroupedTransform ||\n this.resolvedAt !== this.createdAt)) {\n options.startTime ?? (options.startTime = resolveStartTime(this.createdAt, this.resolvedAt));\n }\n let animation;\n if (useWaapi) {\n /**\n * The resolver needed the VisualElement, WAAPI needs the DOM\n * element. JSAnimation reads neither, so this is safe to\n * leave in place if we fall back to it.\n */\n options.element = options.motionValue?.owner?.current;\n try {\n animation = new NativeAnimationExtended(options);\n }\n catch {\n animation = new JSAnimation(options);\n }\n }\n else if (isGroupedTransform) {\n animation = new TransformAnimation(options);\n }\n else {\n animation = new JSAnimation(options);\n }\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n return this._animation ? this._animation.finished : super.finished;\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n /**\n * The value now, if the animation runs on the compositor.\n */\n liveValue() {\n return this._animation?.liveValue?.();\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n this._animation?.cancel();\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map\n"],"names":["AsyncMotionValueAnimation","WithPromise","constructor","options","super","this","stop","_animation","stopTimeline","keyframeResolver","cancel","createdAt","time","now","keyframes","name","motionValue","element","optionsWithDefaults","autoplay","delay","type","repeat","repeatDelay","repeatType","KeyframeResolver","resolvedKeyframes","finalKeyframe","forced","onKeyframesResolved","scheduleResolve","sync","undefined","velocity","isHandoff","onUpdate","resolvedAt","canAnimateValue","canAnimate","MotionGlobalConfig","instantAnimations","getFinalKeyframe","length","makeAnimationInstant","onComplete","notifyFinished","useWaapi","supportsBrowserAnimation","isGroupedTransform","canGroupTransform","animation","startTime","resolveStartTime","owner","current","NativeAnimationExtended","JSAnimation","TransformAnimation","pendingTimeline","attachTimeline","finished","then","onResolve","_onReject","finally","liveValue","resume","flushKeyframeResolvers","duration","iterationDuration","newTime","speed","state","newSpeed","timeline","play","pause","complete"],"mappings":"ynBAgCM,MAAOA,UACDC,EAAAA,YAeRC,WAAAA,CAAYC,GACRC,QAgPJC,KAAAC,KAAO,KACCD,KAAKE,aACLF,KAAKE,WAAWD,OAChBD,K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cAAAA,CAAee,GAOX,OANIrE,KAAKE,WACLF,KAAKG,aAAeH,KAAK6C,UAAUS,eAAee,GAElDrE,KAAKqD,gBAAkBgB,EAGpB,IAAMrE,KAAKC,MACtB,CAEAqE,IAAAA,GACItE,KAAK6C,UAAUyB,MACnB,CAEAC,KAAAA,GACIvE,KAAK6C,UAAU0B,OACnB,CAEAC,QAAAA,GACIxE,KAAK6C,UAAU2B,UACnB,CAEAnE,MAAAA,GACIL,KAAKE,YAAYG,SACjBL,KAAKI,kBAAkBC,QAC3B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../frameloop/sync-time.mjs.js"),e=require("../utils/mix/index.mjs.js"),i=require("./drivers/frame.mjs.js"),s=require("./generators/inertia.mjs.js"),r=require("./generators/keyframes.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../frameloop/sync-time.mjs.js"),e=require("../utils/mix/index.mjs.js"),i=require("./drivers/frame.mjs.js"),s=require("./generators/inertia.mjs.js"),r=require("./generators/keyframes.mjs.js"),a=require("./generators/utils/calc-duration.mjs.js"),n=require("./generators/utils/velocity.mjs.js"),o=require("./keyframes/get-final.mjs.js"),h=require("./utils/replace-transition-type.mjs.js"),l=require("./utils/resolve-start-time.mjs.js"),m=require("./utils/notify-inspector.mjs.js"),d=require("./utils/WithPromise.mjs.js"),u=require("../../../../motion-utils/dist/es/errors.mjs.js"),p=require("../../../../motion-utils/dist/es/pipe.mjs.js"),c=require("../../../../motion-utils/dist/es/time-conversion.mjs.js"),T=require("../../../../motion-utils/dist/es/clamp.mjs.js");const y=t=>t/100,f=t=>Math.round(1e4*t)/1e4;class v extends d.WithPromise{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==t.time.now()&&this.tick(t.time.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause(),m.notifyAnimationStart(this,this.options)}initAnimation(){const{options:t}=this;h.replaceTransitionType(t);const{type:i=r.keyframes,repeat:s=0,repeatDelay:n=0,repeatType:o,velocity:l=0}=t;let{keyframes:m}=t;const d=i||r.keyframes;"production"!==process.env.NODE_ENV&&d!==r.keyframes&&u.invariant(m.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${m}`,"spring-two-frames"),this.mixKeyframes=void 0,d!==r.keyframes&&"number"!=typeof m[0]&&(this.mixKeyframes=p.pipe(y,t.mixer?.(m[0],m[1])||e.mix(m[0],m[1])),m=[0,100]);const c=d(m===t.keyframes?t:{...t,keyframes:m});"mirror"===o&&(this.mirroredGenerator=d({...t,keyframes:[...m].reverse(),velocity:-l})),null===c.calculatedDuration&&(c.calculatedDuration=a.calcGeneratorDuration(c));const{calculatedDuration:T}=c;this.calculatedDuration=T,this.resolvedDuration=T+n,this.totalDuration=this.resolvedDuration*(s+1)-n,this.generator=c}updateTime(t){this.currentTime=this.holdTime??Math.round(t-this.startTime)*this.playbackSpeed}tick(t,e=!1){const{generator:i,totalDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return i.next(0);const{delay:n=0,keyframes:h,type:m,onUpdate:d,finalKeyframe:u}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=l.resolveStartTime(this.startTime,t)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const p=this.currentTime-n*(this.playbackSpeed>=0?1:-1),c=this.playbackSpeed>=0?p<0:p>r;this.currentTime=Math.max(p,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);const T=this.generate(this.currentTime,c);let{done:y}=T;c||(y=this.playbackSpeed>=0?a<1/0?this.currentTime>=r:y:this.currentTime<=0);const f=null===this.holdTime&&("finished"===this.state||"running"===this.state&&y);return f&&m!==s.inertia&&(T.value=o.getFinalKeyframe(h,this.options,u,this.speed)),d&&d(T.value),f&&this.finish(),T}at(t){return this.holdTime??f((t-this.startTime)*this.playbackSpeed)}sampleAt(t,e){const{options:i,totalDuration:r}=this,a=this.at(t)-(i.delay||0);return a>=r&&i.type!==s.inertia?o.getFinalKeyframe(i.keyframes,i,e?void 0:i.finalKeyframe):this.generate(Math.max(a,0),a<0).value}generate(t,e){const{generator:i,totalDuration:s,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:n}=this,{keyframes:o,repeat:h,repeatType:l,repeatDelay:m}=this.options;let d,u=t,p=i;if(h){const e=Math.min(t,s)/n;let i=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&i--,i=Math.min(i,h+1);Boolean(i%2)&&("reverse"===l?(r=1-r,m&&(r-=m/n)):"mirror"===l&&(p=a)),u=T.clamp(0,1,r)*n}return e?(this.delayState.value=o[0],d=this.delayState):d=p.next(u),r&&!e&&(d.value=r(d.value)),d}get duration(){return c.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){return this.duration+c.millisecondsToSeconds(this.options.delay??0)}get time(){return c.millisecondsToSeconds(this.currentTime)}set time(t){"finished"===this.state&&this.updateFinished(),t=c.secondsToMilliseconds(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return n.calcGeneratorVelocity(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){const i=this.playbackSpeed!==e;i&&this.driver&&this.updateTime(t.time.now()),this.playbackSpeed=e,i&&this.driver&&(this.time=c.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=i.frameloopDriver,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const s=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=s):null!==this.holdTime?this.startTime=s-this.holdTime/(this.playbackSpeed||1):this.startTime||(this.startTime=e??(this.pendingStartTime=s)),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(t.time.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}exports.JSAnimation=v,exports.round=f;
|
|
2
2
|
//# sourceMappingURL=JSAnimation.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JSAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/JSAnimation.mjs"],"sourcesContent":["import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n this.delayState = {\n done: false,\n value: undefined,\n };\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state;\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0];\n state = this.delayState;\n }\n else {\n state = frameGenerator.next(elapsed);\n }\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n if (this.driver) {\n this.driver.start(false);\n }\n else {\n this.startTime = 0;\n this.state = \"paused\";\n this.holdTime = newTime;\n this.tick(newTime);\n }\n }\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity() {\n const t = this.currentTime;\n if (t <= 0)\n return this.options.velocity || 0;\n if (this.generator.velocity) {\n return this.generator.velocity(t);\n }\n // Fallback: finite difference\n const current = this.generator.next(t).value;\n return getGeneratorVelocity((s) => this.generator.next(s).value, t, current);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n if (hasChanged && this.driver) {\n this.updateTime(time.now());\n }\n this.playbackSpeed = newSpeed;\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n//# sourceMappingURL=JSAnimation.mjs.map\n"],"names":["percentToProgress","percent","JSAnimation","WithPromise","constructor","options","super","this","state","startTime","isStopped","currentTime","holdTime","playbackSpeed","delayState","done","value","undefined","stop","motionValue","updatedAt","time","now","tick","teardown","onStop","initAnimation","play","autoplay","pause","replaceTransitionType","type","keyframes","repeat","repeatDelay","repeatType","velocity","keyframes$1","generatorFactory","process","env","NODE_ENV","keyframesGenerator","invariant","length","mixKeyframes","pipe","mix","generator","mirroredGenerator","reverse","calculatedDuration","calcGeneratorDuration","resolvedDuration","totalDuration","updateTime","timestamp","animationTime","Math","round","sample","next","delay","onUpdate","finalKeyframe","speed","min","timeWithoutDelay","isInDelayPhase","max","elapsed","frameGenerator","progress","currentIteration","floor","iterationProgress","Boolean","clamp","isAnimationFinished","inertia","getFinalKeyframe","finish","then","resolve","reject","finished","duration","millisecondsToSeconds","iterationDuration","newTime","secondsToMilliseconds","driver","start","getGeneratorVelocity","t","current","s","newSpeed","hasChanged","frameloopDriver","onPlay","updateFinished","complete","notifyFinished","onComplete","cancel","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","ease","observe"],"mappings":"mvBA4BA,MAAMA,EAAqBC,GAAoBA,EAAU,IAEnD,MAAOC,UACDC,EAAAA,YA2DRC,WAAAA,CAAYC,GACRC,QAzDJC,KAAAC,MAA4B,OAE5BD,KAAAE,UAA2B,KAQnBF,KAAAG,WAAY,EAeZH,KAAAI,YAAsB,EAKtBJ,KAAAK,SAA0B,KAK1BL,KAAAM,cAAgB,EAgBhBN,KAAAO,WAAgC,CACpCC,MAAM,EACNC,WAAOC,GA8YXV,KAAAW,KAAO,KACH,MAAMC,YAAEA,GAAgBZ,KAAKF,QACzBc,GAAeA,EAAYC,YAAcC,EAAIA,KAACC,OAC9Cf,KAAKgB,KAAKF,OAAKC,OAGnBf,KAAKG,WAAY,EACE,SAAfH,KAAKC,QACTD,KAAKiB,WACLjB,KAAKF,QAAQoB,aAjZblB,KAAKF,QAAUA,EACfE,KAAKmB,gBACLnB,KAAKoB,QAEoB,IAArBtB,EAAQuB,UAAoBrB,KAAKsB,OACzC,CAEAH,aAAAA,GACI,MAAMrB,QAAEA,GAAYE,KAEpBuB,EAAqBA,sBAACzB,GAEtB,MAAM0B,KACFA,EAAOC,EAAkBA,UAAAC,OACzBA,EAAS,EAACC,YACVA,EAAc,EAACC,WACfA,EAAUC,SACVA,EAAW,GACX/B,EACJ,IAAI2B,UAAEK,GAAchC,EAEpB,MAAMiC,EACDP,GAA6BC,YAGL,eAAzBO,QAAQC,IAAIC,UACZH,IAAqBI,EAAAA,WAErBC,YACIN,EAAUO,QAAU,EACpB,gGAAgGP,IAChG,qBAKJC,IAAqBI,EAAAA,WACG,iBAAjBV,EAAU,KAEjBzB,KAAKsC,aAAeC,OAChB9C,EACA+C,EAAGA,IAACV,E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,OADArG,KAAKE,UAAY,EACVF,KAAKgB,KAAKqF,GAAY,EACjC,CAEAC,cAAAA,CAAeC,GAQX,OAPIvG,KAAKF,QAAQ0G,eACbxG,KAAKF,QAAQ0B,KAAO,YACpBxB,KAAKF,QAAQ2G,KAAO,SACpBzG,KAAKmB,iBAGTnB,KAAKoF,QAAQzE,OACN4F,EAASG,QAAQ1G,KAC5B"}
|
|
1
|
+
{"version":3,"file":"JSAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/JSAnimation.mjs"],"sourcesContent":["import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { calcGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { resolveStartTime } from './utils/resolve-start-time.mjs';\nimport { notifyAnimationStart } from './utils/notify-inspector.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nconst round = (value) => Math.round(value * 10000) / 10000;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n this.delayState = {\n done: false,\n value: undefined,\n };\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n notifyAnimationStart(this, this.options);\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n /**\n * This runs again when a spring is flattened to attach it to a\n * timeline, and the keyframes generator blends values itself.\n */\n this.mixKeyframes = undefined;\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, options.mixer?.(keyframes$1[0], keyframes$1[1]) ||\n mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory(keyframes$1 === options.keyframes\n ? options\n : { ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime =\n this.holdTime ??\n Math.round(timestamp - this.startTime) * this.playbackSpeed;\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, calculatedDuration } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, type, onUpdate, finalKeyframe, } = this.options;\n if (this.startTime === this.pendingStartTime) {\n this.startTime = resolveStartTime(this.startTime, timestamp);\n }\n this.pendingStartTime = undefined;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n const state = this.generate(this.currentTime, isInDelayPhase);\n let { done } = state;\n /**\n * A generator that takes longer than maxGeneratorDuration to finish\n * has an Infinity duration, so played forwards it finishes when it\n * says it's done.\n */\n if (!isInDelayPhase) {\n done =\n this.playbackSpeed >= 0\n ? calculatedDuration < Infinity\n ? this.currentTime >= totalDuration\n : done\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * This animation's time, including delay, at a timestamp.\n */\n at(timestamp) {\n return (this.holdTime ??\n round((timestamp - this.startTime) * this.playbackSpeed));\n }\n /**\n * The value at a timestamp, without changing this animation's state.\n * If resolved, it ends at the last resolved keyframe, which is in the\n * same unit as the others, rather than at finalKeyframe.\n */\n sampleAt(timestamp, resolved) {\n const { options, totalDuration } = this;\n const t = this.at(timestamp) - (options.delay || 0);\n return t >= totalDuration && options.type !== inertia\n ? getFinalKeyframe(options.keyframes, options, resolved ? undefined : options.finalKeyframe)\n : this.generate(Math.max(t, 0), t < 0).value;\n }\n /**\n * The generator's state `currentTime` ms after the delay, without\n * changing the animation's own state.\n */\n generate(currentTime, isInDelayPhase) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, } = this;\n const { keyframes, repeat, repeatType, repeatDelay } = this.options;\n let elapsed = currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state;\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0];\n state = this.delayState;\n }\n else {\n state = frameGenerator.next(elapsed);\n }\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value);\n }\n return state;\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n return this.duration + millisecondsToSeconds(this.options.delay ?? 0);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n /**\n * Seeking out of \"finished\" leaves the animation paused, so play()\n * won't renew finished. Renew it here.\n */\n if (this.state === \"finished\")\n this.updateFinished();\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n if (this.driver) {\n this.driver.start(false);\n }\n else {\n this.startTime = 0;\n this.state = \"paused\";\n this.holdTime = newTime;\n this.tick(newTime);\n }\n }\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity() {\n return calcGeneratorVelocity(this.generator, this.currentTime, this.options.velocity);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n if (hasChanged && this.driver) {\n this.updateTime(time.now());\n }\n this.playbackSpeed = newSpeed;\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime / (this.playbackSpeed || 1);\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? (this.pendingStartTime = now);\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.driver?.stop();\n this.driver = undefined;\n this.startTime = this.holdTime = null;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue, round };\n//# sourceMappingURL=JSAnimation.mjs.map\n"],"names":["percentToProgress","percent","round","value","Math","JSAnimation","WithPromise","constructor","options","super","this","state","startTime","isStopped","currentTime","holdTime","playbackSpeed","delayState","done","undefined","stop","motionValue","updatedAt","time","now","tick","teardown","onStop","initAnimation","play","autoplay","pause","notifyAnimationStart","replaceTransitionType","type","keyframes","repeat","repeatDelay","repeatType","velocity","keyframes$1","generatorFactory","process","env","NODE_ENV","keyframesGenerator","invariant","length","mixKeyframes","pipe","mixer","mix","generator","mirroredGenerator","reverse","calculatedDuration","calcGeneratorDuration","resolvedDuration","totalDuration","updateTime","timestamp","sample","next","delay","onUpdate","finalKeyframe","pendingStartTime","resolveStartTime","speed","min","timeWithoutDelay","isInDelayPhase","max","generate","Infinity","isAnimationFinished","inertia","getFinalKeyframe","finish","at","sampleAt","resolved","t","elapsed","frameGenerator","progress","currentIteration","floor","iterationProgress","Boolean","clamp","duration","millisecondsToSeconds","iterationDuration","newTime","updateFinished","secondsToMilliseconds","driver","start","getGeneratorVelocity","calcGeneratorVelocity","newSpeed","hasChanged","frameloopDriver","onPlay","complete","notifyFinished","onComplete","cancel","onCancel","sampleTime","attachTimeline","timeline","allowFlatten","ease","observe"],"mappings":"+0BA8BA,MAAMA,EAAqBC,GAAoBA,EAAU,IAE5CC,EAASC,GAAkBC,KAAKF,MAAc,IAARC,GAAiB,IAE9D,MAAOE,UACDC,EAAAA,YAgERC,WAAAA,CAAYC,GACRC,QA9DJC,KAAAC,MAA4B,OAE5BD,KAAAE,UAA2B,KAQjBF,KAAAG,WAAY,EAoBdH,KAAAI,YAAsB,EAKpBJ,KAAAK,SAA0B,KAK5BL,KAAAM,cAAgB,EAgBhBN,KAAAO,WAAgC,CACpCC,MAAM,EACNf,WAAOgB,GA4bXT,KAAAU,KAAO,KACH,MAAMC,YAAEA,GAAgBX,KAAKF,QACzBa,GAAeA,EAAYC,YAAcC,EAAIA,KAACC,OAC9Cd,KAAKe,KAAKF,OAAKC,OAGnBd,KAAKG,WAAY,EACE,SAAfH,KAAKC,QACTD,KAAKgB,WACLhB,KAAKF,QAAQmB,aA/bbjB,KAAKF,QAAUA,EACfE,KAAKkB,gBACLlB,KAAKmB,QAEoB,IAArBrB,EAAQsB,UAAoBpB,KAAKqB,QAErCC,EAAAA,qBAAqBtB,KAAMA,KAAKF,QACpC,CAEAoB,aAAAA,GACI,MAAMpB,QAAEA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set.mjs.js"),t=require("../utils/supports/scroll-timeline.mjs.js"),e=require("./keyframes/get-final.mjs.js"),s=require("./utils/WithPromise.mjs.js"),n=require("./waapi/start-waapi-animation.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../render/dom/style-set.mjs.js"),t=require("../utils/supports/scroll-timeline.mjs.js"),e=require("./keyframes/get-final.mjs.js"),s=require("./utils/WithPromise.mjs.js"),n=require("./utils/notify-inspector.mjs.js"),a=require("./waapi/start-waapi-animation.mjs.js"),o=require("./waapi/utils/apply-generator.mjs.js"),m=require("../../../../motion-utils/dist/es/errors.mjs.js"),r=require("../../../../motion-utils/dist/es/time-conversion.mjs.js"),l=require("../../../../motion-utils/dist/es/noop.mjs.js");class h extends s.WithPromise{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:r,keyframes:l,pseudoElement:h,allowFlatten:u=!1,finalKeyframe:p,onComplete:d}=t;this.isPseudoElement=Boolean(h),this.allowFlatten=u,this.options=t,"undefined"!=typeof process&&"production"!==process.env.NODE_ENV&&m.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=o.applyGeneratorOptions(t);this.animation=a.startWaapiAnimation(s,r,l,c,h),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=this.onFinish=()=>{if(this.animation.onfinish=null,this.finishedTime=this.time,!h){const t=e.getFinalKeyframe(l,this.options,p,this.speed);this.updateMotionValue?.(t),i.setStyle(s,r,t),this.animation.cancel()}d?.(),this.notifyFinished()},n.notifyAnimationStart(this,t,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.onfinish=this.onFinish,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.isStopped||(this.animation.onfinish=this.onFinish),this.animation.finish?.()}cancel(){this.animation.onfinish=null;try{this.animation.cancel()}catch(i){}}stop(){this.isStopped||(this.isStopped=!0,"idle"!==this.state&&null===this.finishedTime&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel()))}commitStyles(){const i=this.options?.element;!this.isPseudoElement&&i?.isConnected&&this.animation.commitStyles?.()}get duration(){const i=this.animation.effect?.getComputedTiming?.().duration||0;return r.millisecondsToSeconds(Number(i))}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+r.millisecondsToSeconds(i)}get time(){return r.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(i){const t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=r.secondsToMilliseconds(i),t&&(this.animation.pause(),this.updateFinished())}get speed(){return this.animation.playbackRate}set speed(i){i<0&&(this.finishedTime=null),this.animation.playbackRate=i}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(i){this.manualStartTime=this.animation.startTime=i}attachTimeline({timeline:i,onAttach:e,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=this.onFinish=null,i&&t.supportsScrollTimeline()?(this.animation.timeline=i,e?.(this.animation),l.noop):s(this)}}exports.NativeAnimation=h;
|
|
2
2
|
//# sourceMappingURL=NativeAnimation.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs"],"sourcesContent":["import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, rangeStart, rangeEnd, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n if (rangeStart)\n this.animation.rangeStart = rangeStart;\n if (rangeEnd)\n this.animation.rangeEnd = rangeEnd;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n"],"names":["NativeAnimation","WithPromise","constructor","options","super","this","finishedTime","isStopped","manualStartTime","element","name","keyframes","pseudoElement","allowFlatten","finalKeyframe","onComplete","isPseudoElement","Boolean","invariant","type","transition","applyGeneratorOptions","animation","startWaapiAnimation","autoplay","pause","onfinish","time","keyframe","getFinalKeyframe","speed","updateMotionValue","setStyle","cancel","notifyFinished","play","state","updateFinished","complete","finish","e","stop","commitStyles","isConnected","duration","effect","getComputedTiming","millisecondsToSeconds","Number","iterationDuration","delay","currentTime","newTime","wasFinished","secondsToMilliseconds","playbackRate","newSpeed","playState","startTime","newStartTime","attachTimeline","timeline","rangeStart","rangeEnd","observe","updateTiming","easing","supportsScrollTimeline","noop"],"mappings":"2hBA4BM,MAAOA,UACDC,EAAAA,YAyBRC,WAAAA,CAAYC,GAGR,GAFAC,QAlBMC,KAAAC,aAA8B,KAMhCD,KAAAE,WAAY,EASVF,KAAAG,gBAAiC,MAKlCL,EAAS,OAEd,MAAMM,QACFA,EAAOC,KACPA,EAAIC,UACJA,EAASC,cACTA,EAAaC,aACbA,GAAe,EAAKC,cACpBA,EAAaC,WACbA,GACAZ,EAEJE,KAAKW,gBAAkBC,QAAQL,GAE/BP,KAAKQ,aAAeA,EACpBR,KAAKF,QAAUA,EAEfe,EAASA,UACmB,iBAAjBf,EAAQgB,KACf,sDACA,eAGJ,MAAMC,EAAaC,wBAAsBlB,GAEzCE,KAAKiB,UAAYC,EAAAA,oBACbd,EACAC,EACAC,EACAS,EACAR,IAGwB,IAAxBQ,EAAWI,UACXnB,KAAKiB,UAAUG,QAGnBpB,KAAKiB,UAAUI,SAAW,KAGtB,GAFArB,KAAKC,aAAeD,KAAKsB,MAEpBf,EAAe,CAChB,MAAMgB,EAAWC,EAAgBA,iBAC7BlB,EACAN,KAAKF,QACLW,EACAT,KAAKyB,OAELzB,KAAK0B,mBACL1B,KAAK0B,kBAAkBH,GAU3BI,EAAAA,SAASvB,EAASC,EAAMkB,GAExBvB,KAAKiB,UAAUW,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KAAKC,aAAe,MAEtCD,KAAKiB,UAAUiC,aAAeC,CAClC,CAEA,SAAIpB,GACA,OAA6B,OAAtB/B,KAAKC,aACN,WACAD,KAAKiB,UAAUmC,SACzB,CAEA,aAAIC,GACA,OAAOrD,KAAKG,iBAAmBwC,OAAO3C,KAAKiB,UAAUoC,UACzD,CAEA,aAAIA,CAAUC,GACVtD,KAAKG,gBAAkBH,KAAKiB,UAAUoC,UAAYC,CACtD,CAKAC,cAAAA,EAAeC,SACXA,EAAQC,WACRA,EAAUC,SACVA,EAAQC,QACRA,IAQA,OANI3D,KAAKQ,cACLR,KAAKiB,UAAUuB,QAAQoB,aAAa,CAAEC,OAAQ,WAGlD7D,KAAKiB,UAAUI,SAAW,KAEtBmC,GAAYM,EAAAA,0BACZ9D,KAAKiB,UAAUuC,SAAWA,EAEtBC,IAAazD,KAAKiB,UAAkBwC,WAAaA,GACjDC,IAAW1D,KAAKiB,UAAkByC,SAAWA,GAE1CK,QAEAJ,EAAQ3D,KAEvB"}
|
|
1
|
+
{"version":3,"file":"NativeAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs"],"sourcesContent":["import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { notifyAnimationStart } from './utils/notify-inspector.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n typeof process !== \"undefined\" &&\n process.env.NODE_ENV !== \"production\" &&\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = this.onFinish = () => {\n this.animation.onfinish = null;\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n this.updateMotionValue?.(keyframe);\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n notifyAnimationStart(this, options, transition);\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.onfinish = this.onFinish;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n if (!this.isStopped)\n this.animation.onfinish = this.onFinish;\n this.animation.finish?.();\n }\n cancel() {\n this.animation.onfinish = null;\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n /**\n * Before its finish event, a finished animation (an instant one is\n * as soon as it starts) is still showing its end, so it's stopped\n * like a running one. Otherwise that event would apply its end\n * over whatever animates the value next.\n */\n if (this.state === \"idle\" || this.finishedTime !== null)\n return;\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n /**\n * Seeking out of \"finished\" leaves the animation paused, so play()\n * won't renew finished. Renew it here.\n */\n if (wasFinished) {\n this.animation.pause();\n this.updateFinished();\n }\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, onAttach, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = this.onFinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n onAttach?.(this.animation);\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n"],"names":["NativeAnimation","WithPromise","constructor","options","super","this","finishedTime","isStopped","manualStartTime","element","name","keyframes","pseudoElement","allowFlatten","finalKeyframe","onComplete","isPseudoElement","Boolean","process","env","NODE_ENV","invariant","type","transition","applyGeneratorOptions","animation","startWaapiAnimation","autoplay","pause","onfinish","onFinish","time","keyframe","getFinalKeyframe","speed","updateMotionValue","setStyle","cancel","notifyFinished","notifyAnimationStart","play","state","updateFinished","complete","finish","e","stop","commitStyles","isConnected","duration","effect","getComputedTiming","millisecondsToSeconds","Number","iterationDuration","delay","currentTime","newTime","wasFinished","secondsToMilliseconds","playbackRate","newSpeed","playState","startTime","newStartTime","attachTimeline","timeline","onAttach","observe","updateTiming","easing","supportsScrollTimeline","noop"],"mappings":"wkBA6BM,MAAOA,UACDC,EAAAA,YAgCRC,WAAAA,CAAYC,GAGR,GAFAC,QAzBMC,KAAAC,aAA8B,KAahCD,KAAAE,WAAY,EASVF,KAAAG,gBAAiC,MAKlCL,EAAS,OAEd,MAAMM,QACFA,EAAOC,KACPA,EAAIC,UACJA,EAASC,cACTA,EAAaC,aACbA,GAAe,EAAKC,cACpBA,EAAaC,WACbA,GACAZ,EAEJE,KAAKW,gBAAkBC,QAAQL,GAE/BP,KAAKQ,aAAeA,EACpBR,KAAKF,QAAUA,EAEI,oBAAZe,SACsB,eAAzBA,QAAQC,IAAIC,UACZC,EAAAA,UAC4B,iBAAjBlB,EAAQmB,KACf,sDACA,eAGR,MAAMC,EAAaC,wBAAsBrB,GAEzCE,KAAKoB,UAAYC,EAAAA,oBACbjB,EACAC,EACAC,EACAY,EACAX,IAGwB,IAAxBW,EAAWI,UACXtB,KAAKoB,UAAUG,QAGnBvB,KAAKoB,UAAUI,SAAWxB,KAAKyB,SAAW,KAItC,GAHAzB,KAAKoB,U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,QAAIxB,GACA,OAAOqB,EAAAA,sBAAsBC,OAAOhD,KAAKoB,UAAU+B,cAAgB,EACvE,CAEA,QAAIzB,CAAK0B,GACL,MAAMC,EAAoC,OAAtBrD,KAAKC,aACzBD,KAAKG,gBAAkB,KACvBH,KAAKC,aAAe,KACpBD,KAAKoB,UAAU+B,YAAcG,EAAqBA,sBAACF,GAM/CC,IACArD,KAAKoB,UAAUG,QACfvB,KAAKqC,iBAEb,CAMA,SAAIR,GACA,OAAO7B,KAAKoB,UAAUmC,YAC1B,CAEA,SAAI1B,CAAM2B,GAEFA,EAAW,IAAGxD,KAAKC,aAAe,MAEtCD,KAAKoB,UAAUmC,aAAeC,CAClC,CAEA,SAAIpB,GACA,OAA6B,OAAtBpC,KAAKC,aACN,WACAD,KAAKoB,UAAUqC,SACzB,CAEA,aAAIC,GACA,OAAO1D,KAAKG,iBAAmB6C,OAAOhD,KAAKoB,UAAUsC,UACzD,CAEA,aAAIA,CAAUC,GACV3D,KAAKG,gBAAkBH,KAAKoB,UAAUsC,UAAYC,CACtD,CAKAC,cAAAA,EAAeC,SACXA,EAAQC,SACRA,EAAQC,QACRA,IAQA,OANI/D,KAAKQ,cACLR,KAAKoB,UAAUyB,QAAQmB,aAAa,CAAEC,OAAQ,WAGlDjE,KAAKoB,UAAUI,SAAWxB,KAAKyB,SAAW,KAEtCoC,GAAYK,EAAAA,0BACZlE,KAAKoB,UAAUyC,SAAWA,EAC1BC,IAAW9D,KAAKoB,WAET+C,QAEAJ,EAAQ/D,KAEvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../frameloop/sync-time.mjs.js"),t=require("../render/dom/style-set.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../frameloop/sync-time.mjs.js"),t=require("../render/dom/style-set.mjs.js"),s=require("./JSAnimation.mjs.js"),i=require("./NativeAnimation.mjs.js"),a=require("./utils/replace-transition-type.mjs.js"),n=require("./waapi/utils/unsupported-easing.mjs.js"),r=require("../../../../motion-utils/dist/es/clamp.mjs.js");class o extends i.NativeAnimation{constructor(e){n.replaceStringEasing(e),a.replaceTransitionType(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}elapsed(){return"running"===this.state?(e.time.now()-this.startTime)*this.speed:1e3*this.time}sample(e){if(!this.sampler){const{motionValue:e,onUpdate:t,onComplete:i,onPlay:a,onStop:n,element:r,...o}=this.options;this.sampler=new s.JSAnimation({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){const{state:e}=this;if("running"===e||"paused"===e)return this.sample(this.elapsed())}updateMotionValue(e){const{motionValue:s,element:i,name:a}=this.options;if(!s)return;if(void 0!==e)return void s.set(e);const{speed:n}=this,o=this.elapsed(),p="running"===this.state&&n?r.clamp(0,10,o):0,l=this.sample(o);i&&a&&t.setStyle(i,a,l),s.setWithVelocity(this.sample(o-p*Math.sign(n)),l,p/Math.abs(n||1))}}exports.NativeAnimationExtended=o,exports.sampleDelta=10;
|
|
2
2
|
//# sourceMappingURL=NativeAnimationExtended.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAnimationExtended.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs"],"sourcesContent":["import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n *
|
|
1
|
+
{"version":3,"file":"NativeAnimationExtended.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs"],"sourcesContent":["import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * The animation's time now, in ms. Wall-clock rather than WAAPI's\n * currentTime while running, as under CPU load currentTime may not\n * reflect the actual elapsed time, causing incorrect sampling and\n * visual jumps.\n */\n elapsed() {\n return this.state === \"running\"\n ? (time.now() - this.startTime) * this.speed\n : this.time * 1000;\n }\n /**\n * The value at a time, from a renderless JS animation.\n */\n sample(sampleTime) {\n if (!this.sampler) {\n const { motionValue, onUpdate, onComplete, onPlay, onStop, element, ...options } = this.options;\n /**\n * Stop it straight away so its driver doesn't run every frame.\n * It can still be sampled.\n */\n this.sampler = new JSAnimation({ ...options, autoplay: false });\n this.sampler.stop();\n }\n return this.sampler.sample(Math.max(0, sampleTime)).value;\n }\n /**\n * The value now, as WAAPI doesn't set the motion value while it runs.\n */\n liveValue() {\n const { state } = this;\n if (state === \"running\" || state === \"paused\") {\n return this.sample(this.elapsed());\n }\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * sample a renderless JS animation twice to calculate its current\n * value, \"previous\" value, and therefore allow Motion to calculate\n * velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, element, name } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const { speed } = this;\n const sampleTime = this.elapsed();\n const delta = this.state === \"running\" && speed\n ? clamp(0, sampleDelta, sampleTime)\n : 0;\n const current = this.sample(sampleTime);\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n if (element && name)\n setStyle(element, name, current);\n motionValue.setWithVelocity(this.sample(sampleTime - delta * Math.sign(speed)), current, delta / Math.abs(speed || 1));\n }\n}\n\nexport { NativeAnimationExtended, sampleDelta };\n//# sourceMappingURL=NativeAnimationExtended.mjs.map\n"],"names":["NativeAnimationExtended","NativeAnimation","constructor","options","replaceStringEasing","replaceTransitionType","super","undefined","startTime","autoplay","this","elapsed","state","time","now","speed","sample","sampleTime","sampler","motionValue","onUpdate","onComplete","onPlay","onStop","element","JSAnimation","stop","Math","max","value","liveValue","updateMotionValue","name","set","delta","clamp","current","setStyle","setWithVelocity","sign","abs"],"mappings":"2YAmBM,MAAOA,UAEHC,EAAAA,gBAGNC,WAAAA,CAAYC,GAURC,EAAmBA,oBAACD,GASpBE,EAAqBA,sBAACF,GAEtBG,MAAMH,QAOoBI,IAAtBJ,EAAQK,YAAgD,IAArBL,EAAQM,WAC3CC,KAAKF,UAAYL,EAAQK,WAG7BE,KAAKP,QAAUA,CACnB,CAUQQ,OAAAA,GACJ,MAAsB,YAAfD,KAAKE,OACLC,EAAAA,KAAKC,MAAQJ,KAAKF,WAAaE,KAAKK,MACzB,IAAZL,KAAKG,IACf,CAKQG,MAAAA,CAAOC,GACX,IAAKP,KAAKQ,QAAS,CACf,MAAMC,YACFA,EAAWC,SACXA,EAAQC,WACRA,EAAUC,OACVA,EAAMC,OACNA,EAAMC,QACNA,KACGrB,GACHO,KAAKP,QAMTO,KAAKQ,QAAU,IAAIO,cAAY,IAAKtB,EAASM,UAAU,IACvDC,KAAKQ,QAAQQ,MACjB,CAEA,OAAOhB,KAAKQ,QAAQF,OAAOW,KAAKC,IAAI,EAAGX,IAAaY,KACxD,CAKAC,SAAAA,GACI,MAAMlB,MAAEA,GAAUF,KAElB,GAAc,YAAVE,GAAiC,WAAVA,EACvB,OAAOF,KAAKM,OAAON,KAAKC,UAEhC,CAUAoB,iBAAAA,CAAkBF,GACd,MAAMV,YAAEA,EAAWK,QAAEA,EAAOQ,KAAEA,GAAStB,KAAKP,QAE5C,IAAKgB,EAAa,OAElB,QAAcZ,IAAVsB,EAEA,YADAV,EAAYc,IAAIJ,GAIpB,MAAMd,MAAEA,GAAUL,KACZO,EAAaP,KAAKC,UAClBuB,EACa,YAAfxB,KAAKE,OAAuBG,EACtBoB,EAAKA,MAAC,EAnHG,GAmHalB,GACtB,EACJmB,EAAU1B,KAAKM,OAAOC,GAOxBO,GAAWQ,GAAMK,EAAAA,SAASb,EAASQ,EAAMI,GAE7CjB,EAAYmB,gBACR5B,KAAKM,OAAOC,EAAaiB,EAAQP,KAAKY,KAAKxB,IAC3CqB,EACAF,EAAQP,KAAKa,IAAIzB,GAAS,GAElC,wDAnIuB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../interfaces/motion-value.mjs.js"),i=require("../../value/index.mjs.js"),t=require("../../value/utils/is-motion-value.mjs.js");exports.animateSingleValue=function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../interfaces/motion-value.mjs.js"),i=require("../../value/index.mjs.js"),t=require("../../value/utils/is-motion-value.mjs.js");exports.animateSingleValue=function(n,u,a){const o=t.isMotionValue(n)?n:i.motionValue(n);return o.run(e.animateMotionValue("",o,u,a)),o.animation};
|
|
2
2
|
//# sourceMappingURL=single-value.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-value.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/animate/single-value.mjs"],"sourcesContent":["import { animateMotionValue } from '../interfaces/motion-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.
|
|
1
|
+
{"version":3,"file":"single-value.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/animate/single-value.mjs"],"sourcesContent":["import { animateMotionValue } from '../interfaces/motion-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.run(animateMotionValue(\"\", motionValue$1, keyframes, options));\n return motionValue$1.animation;\n}\n\nexport { animateSingleValue };\n//# sourceMappingURL=single-value.mjs.map\n"],"names":["animateSingleValue","value","keyframes","options","motionValue","isMotionValue","run","animateMotionValue","motionValue$1","animation"],"mappings":"8OAagBA,SACZC,EACAC,EACAC,GAEA,MAAMC,EAAcC,EAAAA,cAAcJ,GAASA,EAAQG,EAAAA,YAAkBH,GAIrE,OAFAG,EAAYE,IAAIC,qBAAmB,GAAIC,EAAaN,EAAWC,IAExDC,EAAYK,SACvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../frameloop/sync-time.mjs.js"),r=require("../../frameloop/frame.mjs.js");exports.frameloopDriver=t=>{const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../frameloop/sync-time.mjs.js"),r=require("../../frameloop/frame-data.mjs.js"),a=require("../../frameloop/frame.mjs.js");exports.frameloopDriver=t=>{const s=({timestamp:e})=>t(e);return{start:(e=!0)=>a.frame.update(s,e),stop:()=>a.cancelFrame(s),now:()=>r.frameData.isProcessing?r.frameData.timestamp:e.time.now()}};
|
|
2
2
|
//# sourceMappingURL=frame.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/drivers/frame.mjs"],"sourcesContent":["import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData
|
|
1
|
+
{"version":3,"file":"frame.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/drivers/frame.mjs"],"sourcesContent":["import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData } from '../../frameloop/frame-data.mjs';\nimport { cancelFrame, frame } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n//# sourceMappingURL=frame.mjs.map\n"],"names":["update","passTimestamp","timestamp","start","keepAlive","frame","stop","cancelFrame","now","frameData","isProcessing","time"],"mappings":"uOAKwCA,IACpC,MAAMC,EAAgBA,EAAGC,eAA2BF,EAAOE,GAE3D,MAAO,CACHC,MAAOA,CAACC,GAAY,IAASC,EAAKA,MAACL,OAAOC,EAAeG,GACzDE,KAAMA,IAAMC,EAAWA,YAACN,GAKxBO,IAAKA,IAAOC,EAAAA,UAAUC,aAAeD,EAASA,UAACP,UAAYS,EAAIA,KAACH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./spring.mjs.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./spring.mjs.js");exports.inertia=function({keyframes:t,velocity:n=0,power:s=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:r=500,modifyTarget:i,min:l,max:u,restDelta:c=.5,restSpeed:d}){const v=t[0],p={done:!1,value:v},f=e=>void 0===l?u:void 0===u||Math.abs(l-e)<Math.abs(u-e)?l:u;let m=s*n;const b=v+m,x=i?i(b):b;x!==b&&(m=x-v);const y=e=>-m*Math.exp(-e/a),g=e=>{const t=y(e);p.done=Math.abs(t)<=c,p.value=p.done?x:e?x+t:v};let M,h;const D=t=>{var n;((n=p.value)<l||n>u)&&(M=t,h=e.spring({keyframes:[p.value,f(p.value)],velocity:-y(t)/a*1e3,damping:o,stiffness:r,restDelta:c,restSpeed:d}))};return D(0),{calculatedDuration:null,next:e=>{let t=!1;return h||void 0!==M||(t=!0,g(e),D(e)),void 0!==M&&e>=M?h.next(e-M):(!t&&g(e),p)}}};
|
|
2
2
|
//# sourceMappingURL=inertia.mjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inertia.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/generators/inertia.mjs"],"sourcesContent":["import { spring } from './spring.mjs';\
|
|
1
|
+
{"version":3,"file":"inertia.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/generators/inertia.mjs"],"sourcesContent":["import { spring } from './spring.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => v < min || v > max;\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget ? modifyTarget(ideal) : ideal;\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n state.done = Math.abs(delta) <= restDelta;\n // target + delta can be off from origin by a float error at t = 0\n state.value = state.done ? target : t ? target + delta : origin;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n /**\n * The friction curve is target + calcDelta(t), so its exact\n * derivative is -calcDelta(t) / timeConstant in units/ms,\n * converted here to the units/second expected by spring.\n */\n velocity: (-calcDelta(t) / timeConstant) * 1000,\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n//# sourceMappingURL=inertia.mjs.map\n"],"names":["inertia","keyframes","velocity","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","min","max","restDelta","restSpeed","origin","state","done","value","nearestBoundary","v","undefined","Math","abs","amplitude","ideal","target","calcDelta","t","exp","applyFriction","delta","timeReachedBoundary","spring","checkCatchBoundary","damping","stiffness","calculatedDuration","next","hasUpdatedFrame"],"mappings":"qHAOgBA,UAAQC,UACpBA,EAASC,SACTA,EAAW,EAAGC,MACdA,EAAQ,GAAGC,aACXA,EAAe,IAAGC,cAClBA,EAAgB,GAAEC,gBAClBA,EAAkB,IAAGC,aACrBA,EAAYC,IACZA,EAAGC,IACHA,EAAGC,UACHA,EAAY,GAAGC,UACfA,IAEA,MAAMC,EAASX,EAAU,GAEnBY,EAAgC,CAClCC,MAAM,EACNC,MAAOH,GAKLI,EAAmBC,QACTC,IAARV,EAA0BC,OAClBS,IAART,GAEGU,KAAKC,IAAIZ,EAAMS,GAAKE,KAAKC,IAAIX,EAAMQ,GAFZT,EAEuBC,EAGzD,IAAIY,EAAYlB,EAAQD,EACxB,MAAMoB,EAAQV,EAASS,EACjBE,EAAShB,EA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