@nethesis/phone-island 1.0.15-dev.2 → 1.0.15-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/components/AudioPlayerView/index.js +1 -1
  2. package/dist/components/AudioPlayerView/index.js.map +1 -1
  3. package/dist/components/CallView/Actions.js.map +1 -1
  4. package/dist/components/CallView/index.js +1 -1
  5. package/dist/components/CallView/index.js.map +1 -1
  6. package/dist/components/RecorderView/index.js +1 -1
  7. package/dist/components/RecorderView/index.js.map +1 -1
  8. package/dist/components/SideView/SideView.js.map +1 -1
  9. package/dist/components/Socket.js +1 -1
  10. package/dist/components/Socket.js.map +1 -1
  11. package/dist/components/StreamingAnswerView/index.js.map +1 -1
  12. package/dist/components/TranscriptionView/TranscriptionView.js +1 -1
  13. package/dist/components/TranscriptionView/TranscriptionView.js.map +1 -1
  14. package/dist/components/VideoView/index.js.map +1 -1
  15. package/dist/components/WebRTC.js +1 -1
  16. package/dist/components/WebRTC.js.map +1 -1
  17. package/dist/events/RecorderEvents.js +1 -1
  18. package/dist/events/RecorderEvents.js.map +1 -1
  19. package/dist/index.css +1 -1
  20. package/dist/lib/devices/devices.js +1 -1
  21. package/dist/lib/devices/devices.js.map +1 -1
  22. package/dist/models/motions.js.map +1 -1
  23. package/dist/models/webrtc.js.map +1 -1
  24. package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js +1 -1
  25. package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js.map +1 -1
  26. package/dist/node_modules/@headlessui/react/dist/components/label/label.js +1 -1
  27. package/dist/node_modules/@headlessui/react/dist/components/label/label.js.map +1 -1
  28. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js +1 -1
  29. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js.map +1 -1
  30. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js +1 -1
  31. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js.map +1 -1
  32. package/dist/node_modules/@headlessui/react/dist/components/transition/transition.js +1 -1
  33. package/dist/node_modules/@headlessui/react/dist/components/transition/transition.js.map +1 -1
  34. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/adjust-scrollbar-padding.js +1 -1
  35. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/adjust-scrollbar-padding.js.map +1 -1
  36. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js +1 -1
  37. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js.map +1 -1
  38. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/overflow-store.js +1 -1
  39. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/overflow-store.js.map +1 -1
  40. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/prevent-scroll.js +1 -1
  41. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/prevent-scroll.js.map +1 -1
  42. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/use-document-overflow.js +1 -1
  43. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/use-document-overflow.js.map +1 -1
  44. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +1 -1
  45. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js.map +1 -1
  46. package/dist/node_modules/@headlessui/react/dist/hooks/use-element-size.js +1 -1
  47. package/dist/node_modules/@headlessui/react/dist/hooks/use-element-size.js.map +1 -1
  48. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +1 -1
  49. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js.map +1 -1
  50. package/dist/node_modules/@headlessui/react/dist/hooks/use-flags.js +1 -1
  51. package/dist/node_modules/@headlessui/react/dist/hooks/use-flags.js.map +1 -1
  52. package/dist/node_modules/@headlessui/react/dist/hooks/use-inert-others.js +1 -1
  53. package/dist/node_modules/@headlessui/react/dist/hooks/use-inert-others.js.map +1 -1
  54. package/dist/node_modules/@headlessui/react/dist/hooks/use-owner.js +1 -1
  55. package/dist/node_modules/@headlessui/react/dist/hooks/use-owner.js.map +1 -1
  56. package/dist/node_modules/@headlessui/react/dist/hooks/use-quick-release.js +1 -1
  57. package/dist/node_modules/@headlessui/react/dist/hooks/use-quick-release.js.map +1 -1
  58. package/dist/node_modules/@headlessui/react/dist/hooks/use-scroll-lock.js +1 -1
  59. package/dist/node_modules/@headlessui/react/dist/hooks/use-scroll-lock.js.map +1 -1
  60. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +1 -1
  61. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js.map +1 -1
  62. package/dist/node_modules/@headlessui/react/dist/hooks/use-transition.js +1 -1
  63. package/dist/node_modules/@headlessui/react/dist/hooks/use-transition.js.map +1 -1
  64. package/dist/node_modules/@headlessui/react/dist/hooks/use-tree-walker.js +1 -1
  65. package/dist/node_modules/@headlessui/react/dist/hooks/use-tree-walker.js.map +1 -1
  66. package/dist/node_modules/@headlessui/react/dist/internal/floating.js +1 -1
  67. package/dist/node_modules/@headlessui/react/dist/internal/floating.js.map +1 -1
  68. package/dist/node_modules/@headlessui/react/dist/internal/open-closed.js +1 -1
  69. package/dist/node_modules/@headlessui/react/dist/internal/open-closed.js.map +1 -1
  70. package/dist/node_modules/@headlessui/react/dist/machine.js +1 -1
  71. package/dist/node_modules/@headlessui/react/dist/machine.js.map +1 -1
  72. package/dist/node_modules/@headlessui/react/dist/react-glue.js +1 -1
  73. package/dist/node_modules/@headlessui/react/dist/react-glue.js.map +1 -1
  74. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +1 -1
  75. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js.map +1 -1
  76. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +1 -1
  77. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js.map +1 -1
  78. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js +1 -1
  79. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js.map +1 -1
  80. package/dist/node_modules/@headlessui/react/dist/utils/match.js +1 -1
  81. package/dist/node_modules/@headlessui/react/dist/utils/match.js.map +1 -1
  82. package/dist/node_modules/@headlessui/react/dist/utils/render.js +1 -1
  83. package/dist/node_modules/@headlessui/react/dist/utils/render.js.map +1 -1
  84. package/dist/node_modules/@headlessui/react/dist/utils/store.js +1 -1
  85. package/dist/node_modules/@headlessui/react/dist/utils/store.js.map +1 -1
  86. package/dist/node_modules/@react-aria/focus/dist/FocusScope.mjs.js +1 -1
  87. package/dist/node_modules/@react-aria/focus/dist/FocusScope.mjs.js.map +1 -1
  88. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.mjs.js +1 -1
  89. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.mjs.js.map +1 -1
  90. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.mjs.js +1 -1
  91. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.mjs.js.map +1 -1
  92. package/dist/node_modules/@react-aria/utils/dist/useEffectEvent.mjs.js +1 -1
  93. package/dist/node_modules/@react-aria/utils/dist/useEffectEvent.mjs.js.map +1 -1
  94. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.mjs.js +1 -1
  95. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.mjs.js.map +1 -1
  96. package/dist/node_modules/engine.io-client/build/esm/socket.js +1 -1
  97. package/dist/node_modules/engine.io-client/build/esm/socket.js.map +1 -1
  98. package/dist/node_modules/engine.io-client/build/esm/transport.js +1 -1
  99. package/dist/node_modules/engine.io-client/build/esm/transport.js.map +1 -1
  100. package/dist/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +1 -1
  101. package/dist/node_modules/engine.io-client/build/esm/transports/polling-xhr.js.map +1 -1
  102. package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js +1 -1
  103. package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js.map +1 -1
  104. package/dist/node_modules/engine.io-client/build/esm/util.js +1 -1
  105. package/dist/node_modules/engine.io-client/build/esm/util.js.map +1 -1
  106. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +1 -1
  107. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js.map +1 -1
  108. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js +1 -1
  109. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js.map +1 -1
  110. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js +1 -1
  111. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js.map +1 -1
  112. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js +1 -1
  113. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js.map +1 -1
  114. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.js +1 -1
  115. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.js.map +1 -1
  116. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js +1 -1
  117. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js.map +1 -1
  118. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js +1 -1
  119. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js.map +1 -1
  120. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js +1 -1
  121. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js.map +1 -1
  122. package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js +1 -1
  123. package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js.map +1 -1
  124. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.js +1 -1
  125. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.js.map +1 -1
  126. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.js +1 -1
  127. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.js.map +1 -1
  128. package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js +1 -1
  129. package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js.map +1 -1
  130. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.js +1 -1
  131. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.js.map +1 -1
  132. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js +1 -1
  133. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js.map +1 -1
  134. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.mjs.js +1 -1
  135. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.mjs.js.map +1 -1
  136. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.js +1 -1
  137. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.js.map +1 -1
  138. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.js +1 -1
  139. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.js.map +1 -1
  140. package/dist/node_modules/js-base64/base64.mjs.js +1 -1
  141. package/dist/node_modules/js-base64/base64.mjs.js.map +1 -1
  142. package/dist/node_modules/moment/moment.js +2 -2
  143. package/dist/node_modules/moment/moment.js.map +1 -1
  144. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js +1 -1
  145. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js.map +1 -1
  146. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js +1 -1
  147. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js.map +1 -1
  148. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js +1 -1
  149. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js.map +1 -1
  150. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.js +1 -1
  151. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.js.map +1 -1
  152. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js +1 -1
  153. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js.map +1 -1
  154. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js +1 -1
  155. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js.map +1 -1
  156. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.js +1 -1
  157. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.mjs.js.map +1 -1
  158. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js +1 -1
  159. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js.map +1 -1
  160. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.js +1 -1
  161. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.js.map +1 -1
  162. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.js +1 -1
  163. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.js.map +1 -1
  164. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.js +1 -1
  165. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.js.map +1 -1
  166. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.js +1 -1
  167. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.js.map +1 -1
  168. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js +1 -1
  169. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js.map +1 -1
  170. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js +1 -1
  171. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js.map +1 -1
  172. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.js +1 -1
  173. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.js.map +1 -1
  174. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js +1 -1
  175. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js.map +1 -1
  176. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.js +1 -1
  177. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.js.map +1 -1
  178. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.js +1 -1
  179. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.js.map +1 -1
  180. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.js +1 -1
  181. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.js.map +1 -1
  182. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.js +1 -1
  183. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.js.map +1 -1
  184. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.js +1 -1
  185. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.js.map +1 -1
  186. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.js +1 -1
  187. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.js.map +1 -1
  188. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.js +1 -1
  189. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.js.map +1 -1
  190. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.js +1 -1
  191. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.js.map +1 -1
  192. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js +1 -1
  193. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js.map +1 -1
  194. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js +1 -1
  195. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js.map +1 -1
  196. package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js +1 -1
  197. package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js.map +1 -1
  198. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js +1 -1
  199. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js.map +1 -1
  200. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.js +1 -1
  201. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.js.map +1 -1
  202. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.js +1 -1
  203. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.js.map +1 -1
  204. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.js +1 -1
  205. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.js.map +1 -1
  206. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.js +1 -1
  207. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.js.map +1 -1
  208. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js +1 -1
  209. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js.map +1 -1
  210. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.js +1 -1
  211. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.js.map +1 -1
  212. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.js +1 -1
  213. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.js.map +1 -1
  214. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.mjs.js +1 -1
  215. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.mjs.js.map +1 -1
  216. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.js +1 -1
  217. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.js.map +1 -1
  218. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.js +1 -1
  219. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.js.map +1 -1
  220. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.js +1 -1
  221. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.js.map +1 -1
  222. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js +1 -1
  223. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.js.map +1 -1
  224. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.js +1 -1
  225. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.js.map +1 -1
  226. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.js +1 -1
  227. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.js.map +1 -1
  228. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.js +1 -1
  229. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.js.map +1 -1
  230. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.mjs.js +1 -1
  231. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.mjs.js.map +1 -1
  232. package/dist/node_modules/motion-dom/dist/es/utils/delay.mjs.js +1 -1
  233. package/dist/node_modules/motion-dom/dist/es/utils/delay.mjs.js.map +1 -1
  234. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.mjs.js +1 -1
  235. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.mjs.js.map +1 -1
  236. package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js +1 -1
  237. package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js.map +1 -1
  238. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.js +1 -1
  239. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.js.map +1 -1
  240. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.js +1 -1
  241. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.js.map +1 -1
  242. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.js +1 -1
  243. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.js.map +1 -1
  244. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.js +1 -1
  245. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.js.map +1 -1
  246. package/dist/node_modules/motion-utils/dist/es/pipe.mjs.js +1 -1
  247. package/dist/node_modules/motion-utils/dist/es/pipe.mjs.js.map +1 -1
  248. package/dist/node_modules/react-redux/es/components/Provider.js +1 -1
  249. package/dist/node_modules/react-redux/es/components/Provider.js.map +1 -1
  250. package/dist/node_modules/react-redux/es/hooks/useDispatch.js +1 -1
  251. package/dist/node_modules/react-redux/es/hooks/useDispatch.js.map +1 -1
  252. package/dist/node_modules/react-redux/es/hooks/useReduxContext.js +1 -1
  253. package/dist/node_modules/react-redux/es/hooks/useReduxContext.js.map +1 -1
  254. package/dist/node_modules/react-redux/es/hooks/useSelector.js +1 -1
  255. package/dist/node_modules/react-redux/es/hooks/useSelector.js.map +1 -1
  256. package/dist/node_modules/react-redux/es/hooks/useStore.js +1 -1
  257. package/dist/node_modules/react-redux/es/hooks/useStore.js.map +1 -1
  258. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.mjs.js +1 -1
  259. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.mjs.js.map +1 -1
  260. package/dist/node_modules/socket.io-client/build/esm/socket.js +1 -1
  261. package/dist/node_modules/socket.io-client/build/esm/socket.js.map +1 -1
  262. package/dist/node_modules/socket.io-client/build/esm/url.js +1 -1
  263. package/dist/node_modules/socket.io-client/build/esm/url.js.map +1 -1
  264. package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js +1 -1
  265. package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js.map +1 -1
  266. package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js +1 -1
  267. package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js.map +1 -1
  268. package/dist/package.json.js +1 -1
  269. package/dist/services/astproxy.js.map +1 -1
  270. package/package.json +7 -22
@@ -1 +1 @@
1
- {"version":3,"file":"VisualElementDragControls.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs"],"sourcesContent":["import { createBox, frame, eachAxis, measurePageBox, convertBoxToBoundingBox, convertBoundingBoxToBox, addValueToWillChange, animateMotionValue, mixNumber, addDomEvent, setDragLock, percent, calcLength, resize, isElementTextInput } from 'motion-dom';\nimport { invariant } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { PanSession } from '../pan/PanSession.mjs';\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';\n\nconst elementDragControls = new WeakMap();\nclass VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPointerEvent = null;\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPanInfo = null;\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false, distanceThreshold } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point);\n }\n this.stopAnimation();\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true);\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true);\n }\n };\n const onSessionEnd = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.stop(event, info);\n this.latestPointerEvent = null;\n this.latestPanInfo = null;\n };\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps();\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 });\n }\n };\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n });\n }\n /**\n * @internal\n */\n stop(event, panInfo) {\n const finalEvent = event || this.latestPointerEvent;\n const finalPanInfo = panInfo || this.latestPanInfo;\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging || !finalPanInfo || !finalEvent)\n return;\n const { velocity } = finalPanInfo;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo));\n }\n }\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.endPanSession();\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\", \"drag-constraints-ref\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n /**\n * Refresh the root scroll offset so the constraint's viewport box\n * translates to correct page coordinates. The scroll captured at\n * drag mount can be stale if the document was scrolled afterwards —\n * e.g. via the browser restoring scroll on refresh, or an ancestor\n * layout effect running after this element's mount (#2829).\n *\n * Clear the cached scroll first so `updateScroll` bypasses its\n * per-animationId cache and re-reads the live value.\n */\n if (projection.root) {\n projection.root.scroll = undefined;\n projection.root.updateScroll();\n }\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin === true ||\n dragSnapToOrigin === axis)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0;\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current);\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false;\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render();\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n const target = event.target;\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild = target !== element && isElementTextInput(target);\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event);\n }\n });\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers;\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints());\n }\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n stopResizeObservers && stopResizeObservers();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction skipFirstCall(callback) {\n let isFirst = true;\n return () => {\n if (isFirst) {\n isFirst = false;\n return;\n }\n callback();\n };\n}\nfunction startResizeObservers(element, constraintsElement, onResize) {\n const stopElement = resize(element, skipFirstCall(onResize));\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize));\n return () => {\n stopElement();\n stopContainer();\n };\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\n\nexport { VisualElementDragControls, elementDragControls };\n//# sourceMappingURL=VisualElementDragControls.mjs.map\n"],"names":["elementDragControls","WeakMap","skipFirstCall","callback","isFirst","shouldDrag","direction","drag","currentDirection","constructor","visualElement","this","openDragLock","isDragging","originPoint","x","y","constraints","hasMutatedConstraints","elastic","createBox","latestPointerEvent","latestPanInfo","start","originEvent","snapToCursor","distanceThreshold","arguments","length","undefined","presenceContext","isPresent","dragSnapToOrigin","getProps","panSession","PanSession","onSessionStart","event","extractEventInfo","point","stopAnimation","onStart","info","dragPropagation","onDragStart","setDragLock","resolveConstraints","projection","isAnimationBlocked","target","eachAxis","axis","current","getAxisMotionValue","get","percent","test","layout","measuredAxis","layoutBox","calcLength","parseFloat","frame","update","addValueToWillChange","animationState","setActive","onMove","dragDirectionLock","onDirectionLock","onDrag","offset","lockThreshold","Math","abs","getCurrentDirection","updateAxis","render","onSessionEnd","stop","resumeAnimation","snap","startAnimation","transformPagePoint","getTransformPagePoint","contextWindow","getContextWindow","element","panInfo","finalEvent","finalPanInfo","cancel","velocity","onDragEnd","postRender","endPanSession","end","_point","axisValue","next","applyConstraints","set","dragConstraints","dragElastic","measure","prevConstraints","isRefObject","resolveRefConstraints","calcRelativeConstraints","resolveDragElastic","rebaseAxisConstraints","onMeasureDragConstraints","constraintsElement","invariant","root","scroll","updateScroll","constraintsBox","measurePageBox","measuredConstraints","calcViewportConstraints","userConstraints","convertBoxToBoundingBox","convertBoundingBoxToBox","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","transition","min","max","bounceStiffness","bounceDamping","inertia","type","timeConstant","restDelta","restSpeed","startAxisValueAnimation","Promise","all","then","animateMotionValue","dragKey","toUpperCase","externalMotionValue","getValue","latestValues","mixNumber","scalePositionWithinConstraints","boxProgress","latest","calcOrigin","transformTemplate","style","transform","updateLayout","addListeners","stopPointerListener","addPointerEvent","dragListener","isClickingTextInputChild","isElementTextInput","stopResizeObservers","measureDragConstraints","onResize","stopElement","resize","stopContainer","startResizeObservers","stopMeasureLayoutListener","addEventListener","read","stopResizeListener","addDomEvent","window","stopLayoutUpdateListener","_ref","delta","hasLayoutChanged","motionValue","translate","props","defaultElastic"],"mappings":"kgDAsCaA,MAAAA,EAAsB,IAAIC,QAivBvC,SAASC,EAAcC,GACnB,IAAIC,GAAU,EACd,MAAO,KACCA,EACAA,GAAU,EAGdD,IAER,CAeA,SAASE,EACLC,EACAC,EACAC,GAEA,SACc,IAATD,GAAiBA,IAASD,GACL,OAArBE,GAA6BA,IAAqBF,EAE3D,yCAztBIG,WAAAA,CAAYC,GA7BJC,KAAAC,aAAoC,KAE5CD,KAAAE,YAAa,EACLF,KAAAH,iBAAyC,KAEzCG,KAAAG,YAAqB,CAAEC,EAAG,EAAGC,EAAG,GAKhC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EAAAA,YAAYC,OAAQ,SAAU,IACrDpK,KAAK0I,kCAOH2B,EAA2BjI,EAAY4H,iBACzC,YACCM,IAAkD,IAAjDC,MAAEA,EAAKC,iBAAEA,GAAoCF,EACvCtK,KAAKE,YAAcsK,IACnBjI,EAAAA,SAAUC,IACN,MAAMiI,EAAczK,KAAK0C,mBAAmBF,GACvCiI,IAELzK,KAAKG,YAAYqC,IAAS+H,EAAM/H,GAAMkI,UACtCD,EAAY/E,IACR+E,EAAY9H,MAAQ4H,EAAM/H,GAAMkI,cAIxC1K,KAAKD,cAAcmE,YAK/B,MAAO,KACHgG,IACAf,IACAY,IACAM,GAA4BA,IAC5Bb,GAAuBA,IAE/B,CAEAlI,QAAAA,GACI,MAAMqJ,EAAQ3K,KAAKD,cAAcuB,YAC3B1B,KACFA,GAAO,EAAK6D,kBACZA,GAAoB,EAAKzB,gBACzBA,GAAkB,EAAK2D,gBACvBA,GAAkB,EAAKC,YACvBA,EAAcgF,EAAcA,eAAA3D,aAC5BA,GAAe,GACf0D,EACJ,MAAO,IACAA,EACH/K,OACA6D,oBACAzB,kBACA2D,kBACAC,cACAqB,eAER"}
1
+ {"version":3,"file":"VisualElementDragControls.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs"],"sourcesContent":["import { createBox, frame, eachAxis, measurePageBox, convertBoxToBoundingBox, convertBoundingBoxToBox, addValueToWillChange, animateMotionValue, mixNumber, addDomEvent, setDragLock, percent, calcLength, resize, isElementTextInput } from 'motion-dom';\nimport { invariant } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { PanSession } from '../pan/PanSession.mjs';\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';\n\nconst elementDragControls = new WeakMap();\nclass VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPointerEvent = null;\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPanInfo = null;\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false, distanceThreshold } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point);\n }\n this.stopAnimation();\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true);\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true);\n }\n };\n const onSessionEnd = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.stop(event, info);\n this.latestPointerEvent = null;\n this.latestPanInfo = null;\n };\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps();\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 });\n }\n };\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n });\n }\n /**\n * @internal\n */\n stop(event, panInfo) {\n const finalEvent = event || this.latestPointerEvent;\n const finalPanInfo = panInfo || this.latestPanInfo;\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging || !finalPanInfo || !finalEvent)\n return;\n const { velocity } = finalPanInfo;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo));\n }\n }\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.endPanSession();\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\", \"drag-constraints-ref\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n /**\n * Refresh the root scroll offset so the constraint's viewport box\n * translates to correct page coordinates. The scroll captured at\n * drag mount can be stale if the document was scrolled afterwards —\n * e.g. via the browser restoring scroll on refresh, or an ancestor\n * layout effect running after this element's mount (#2829).\n *\n * Clear the cached scroll first so `updateScroll` bypasses its\n * per-animationId cache and re-reads the live value.\n */\n if (projection.root) {\n projection.root.scroll = undefined;\n projection.root.updateScroll();\n }\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin === true ||\n dragSnapToOrigin === axis)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, this.visualElement.latestValues[axis] ?? 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0;\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current);\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false;\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render();\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n const target = event.target;\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild = target !== element && isElementTextInput(target);\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event);\n }\n });\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers;\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints());\n }\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n stopResizeObservers && stopResizeObservers();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction skipFirstCall(callback) {\n let isFirst = true;\n return () => {\n if (isFirst) {\n isFirst = false;\n return;\n }\n callback();\n };\n}\nfunction startResizeObservers(element, constraintsElement, onResize) {\n const stopElement = resize(element, skipFirstCall(onResize));\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize));\n return () => {\n stopElement();\n stopContainer();\n };\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\n\nexport { VisualElementDragControls, elementDragControls };\n//# sourceMappingURL=VisualElementDragControls.mjs.map\n"],"names":["elementDragControls","WeakMap","skipFirstCall","callback","isFirst","shouldDrag","direction","drag","currentDirection","constructor","visualElement","this","openDragLock","isDragging","originPoint","x","y","constraints","hasMutatedConstraints","elastic","createBox","latestPointerEvent","latestPanInfo","start","originEvent","snapToCursor","distanceThreshold","presenceContext","isPresent","dragSnapToOrigin","getProps","panSession","PanSession","onSessionStart","event","extractEventInfo","point","stopAnimation","onStart","info","dragPropagation","onDragStart","setDragLock","resolveConstraints","projection","isAnimationBlocked","target","undefined","eachAxis","axis","current","getAxisMotionValue","get","percent","test","layout","measuredAxis","layoutBox","calcLength","parseFloat","frame","update","addValueToWillChange","animationState","setActive","onMove","dragDirectionLock","onDirectionLock","onDrag","offset","lockThreshold","Math","abs","getCurrentDirection","updateAxis","render","onSessionEnd","stop","resumeAnimation","snap","startAnimation","transformPagePoint","getTransformPagePoint","contextWindow","getContextWindow","element","panInfo","finalEvent","finalPanInfo","cancel","velocity","onDragEnd","postRender","endPanSession","end","_point","axisValue","next","applyConstraints","set","dragConstraints","dragElastic","measure","prevConstraints","isRefObject","resolveRefConstraints","calcRelativeConstraints","resolveDragElastic","rebaseAxisConstraints","onMeasureDragConstraints","constraintsElement","invariant","root","scroll","updateScroll","constraintsBox","measurePageBox","measuredConstraints","calcViewportConstraints","userConstraints","convertBoxToBoundingBox","convertBoundingBoxToBox","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","transition","min","max","bounceStiffness","bounceDamping","inertia","type","timeConstant","restDelta","restSpeed","startAxisValueAnimation","Promise","all","then","animateMotionValue","dragKey","toUpperCase","externalMotionValue","getValue","latestValues","mixNumber","scalePositionWithinConstraints","boxProgress","latest","calcOrigin","transformTemplate","style","transform","updateLayout","addListeners","stopPointerListener","addPointerEvent","dragListener","isClickingTextInputChild","isElementTextInput","stopResizeObservers","measureDragConstraints","onResize","stopElement","resize","stopContainer","startResizeObservers","stopMeasureLayoutListener","addEventListener","read","stopResizeListener","addDomEvent","window","stopLayoutUpdateListener","delta","hasLayoutChanged","motionValue","translate","props","defaultElastic"],"mappings":"kgDAsCaA,MAAAA,EAAsB,IAAIC,QAivBvC,SAASC,EAAcC,GACnB,IAAIC,GAAU,EACd,MAAO,KACCA,EACAA,GAAU,EAGdD,IAER,CAeA,SAASE,EACLC,EACAC,EACAC,GAEA,SACc,IAATD,GAAiBA,IAASD,GACL,OAArBE,GAA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G,KAAKR,GAMX,MAAMS,EAAqBC,EAAAA,YAAYC,OAAQ,SAAU,IACrDlK,KAAKwI,kCAOH2B,EAA2BlI,EAAY6H,iBACzC,YACC,EAAGM,QAAOC,uBACHrK,KAAKE,YAAcmK,IACnBhI,EAAAA,SAAUC,IACN,MAAMgI,EAActK,KAAKwC,mBAAmBF,GACvCgI,IAELtK,KAAKG,YAAYmC,IAAS8H,EAAM9H,GAAMiI,UACtCD,EAAY9E,IACR8E,EAAY7H,MAAQ2H,EAAM9H,GAAMiI,cAIxCvK,KAAKD,cAAciE,YAK/B,MAAO,KACHgG,IACAf,IACAY,IACAM,GAA4BA,IAC5Bb,GAAuBA,IAE/B,CAEAnI,QAAAA,GACI,MAAMqJ,EAAQxK,KAAKD,cAAcoB,YAC3BvB,KACFA,GAAO,EAAK2D,kBACZA,GAAoB,EAAK1B,gBACzBA,GAAkB,EAAK4D,gBACvBA,GAAkB,EAAKC,YACvBA,EAAc+E,EAAcA,eAAA1D,aAC5BA,GAAe,GACfyD,EACJ,MAAO,IACAA,EACH5K,OACA2D,oBACA1B,kBACA4D,kBACAC,cACAqB,eAER"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../../../../../motion-dom/dist/es/utils/mix/number.mjs.js"),i=require("../../../../../../motion-dom/dist/es/projection/geometry/delta-calc.mjs.js"),e=require("../../../../../../motion-utils/dist/es/progress.mjs.js"),n=require("../../../../../../motion-utils/dist/es/clamp.mjs.js");function r(t,i,e){return{min:void 0!==i?t.min+i:void 0,max:void 0!==e?t.max+e-(t.max-t.min):void 0}}function o(t,i){let e=i.min-t.min,n=i.max-t.max;return i.max-i.min<t.max-t.min&&([e,n]=[n,e]),{min:e,max:n}}const s=.35;function m(t,i,e){return{min:a(t,i),max:a(t,e)}}function a(t,i){return"number"==typeof t?t:t[i]||0}exports.applyConstraints=function(i,e,n){let{min:r,max:o}=e;return void 0!==r&&i<r?i=n?t.mixNumber(r,i,n.min):Math.max(i,r):void 0!==o&&i>o&&(i=n?t.mixNumber(o,i,n.max):Math.min(i,o)),i},exports.calcOrigin=function(t,r){let o=.5;const s=i.calcLength(t),m=i.calcLength(r);return m>s?o=e.progress(r.min,r.max-s,t.min):s>m&&(o=e.progress(t.min,t.max-m,r.min)),n.clamp(0,1,o)},exports.calcRelativeAxisConstraints=r,exports.calcRelativeConstraints=function(t,i){let{top:e,left:n,bottom:o,right:s}=i;return{x:r(t.x,n,s),y:r(t.y,e,o)}},exports.calcViewportAxisConstraints=o,exports.calcViewportConstraints=function(t,i){return{x:o(t.x,i.x),y:o(t.y,i.y)}},exports.defaultElastic=s,exports.rebaseAxisConstraints=function(t,i){const e={};return void 0!==i.min&&(e.min=i.min-t.min),void 0!==i.max&&(e.max=i.max-t.min),e},exports.resolveAxisElastic=m,exports.resolveDragElastic=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return!1===t?t=0:!0===t&&(t=s),{x:m(t,"left","right"),y:m(t,"top","bottom")}},exports.resolvePointElastic=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../../../../../motion-dom/dist/es/utils/mix/number.mjs.js"),i=require("../../../../../../motion-dom/dist/es/projection/geometry/delta-calc.mjs.js"),n=require("../../../../../../motion-utils/dist/es/progress.mjs.js"),e=require("../../../../../../motion-utils/dist/es/clamp.mjs.js");function r(t,i,n){return{min:void 0!==i?t.min+i:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function o(t,i){let n=i.min-t.min,e=i.max-t.max;return i.max-i.min<t.max-t.min&&([n,e]=[e,n]),{min:n,max:e}}const s=.35;function m(t,i,n){return{min:a(t,i),max:a(t,n)}}function a(t,i){return"number"==typeof t?t:t[i]||0}exports.applyConstraints=function(i,{min:n,max:e},r){return void 0!==n&&i<n?i=r?t.mixNumber(n,i,r.min):Math.max(i,n):void 0!==e&&i>e&&(i=r?t.mixNumber(e,i,r.max):Math.min(i,e)),i},exports.calcOrigin=function(t,r){let o=.5;const s=i.calcLength(t),m=i.calcLength(r);return m>s?o=n.progress(r.min,r.max-s,t.min):s>m&&(o=n.progress(t.min,t.max-m,r.min)),e.clamp(0,1,o)},exports.calcRelativeAxisConstraints=r,exports.calcRelativeConstraints=function(t,{top:i,left:n,bottom:e,right:o}){return{x:r(t.x,n,o),y:r(t.y,i,e)}},exports.calcViewportAxisConstraints=o,exports.calcViewportConstraints=function(t,i){return{x:o(t.x,i.x),y:o(t.y,i.y)}},exports.defaultElastic=s,exports.rebaseAxisConstraints=function(t,i){const n={};return void 0!==i.min&&(n.min=i.min-t.min),void 0!==i.max&&(n.max=i.max-t.min),n},exports.resolveAxisElastic=m,exports.resolveDragElastic=function(t=.35){return!1===t?t=0:!0===t&&(t=s),{x:m(t,"left","right"),y:m(t,"top","bottom")}},exports.resolvePointElastic=a;
2
2
  //# sourceMappingURL=constraints.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constraints.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs"],"sourcesContent":["import { mixNumber, calcLength } from 'motion-dom';\nimport { progress, clamp } from 'motion-utils';\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nfunction applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nfunction calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nfunction calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = progress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = progress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nfunction rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nconst defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nfunction resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nfunction resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\n//# sourceMappingURL=constraints.mjs.map\n"],"names":["calcRelativeAxisConstraints","axis","min","max","undefined","calcViewportAxisConstraints","layoutAxis","constraintsAxis","defaultElastic","resolveAxisElastic","dragElastic","minLabel","maxLabel","resolvePointElastic","label","point","_ref","elastic","mixNumber","Math","source","target","origin","sourceLength","calcLength","targetLength","calcProgress","clamp","layoutBox","_ref2","top","left","bottom","right","x","y","constraintsBox","layout","constraints","relativeConstraints","arguments","length"],"mappings":"+WA6DgBA,SAAAA,EACZC,EACAC,EACAC,GAEA,MAAO,CACHD,SAAaE,IAARF,EAAoBD,EAAKC,IAAMA,OAAME,EAC1CD,SACYC,IAARD,EACMF,EAAKE,IAAMA,GAAOF,EAAKE,IAAMF,EAAKC,UAClCE,EAElB,CAmBM,SAAUC,EACZC,EACAC,GAEA,IAAIL,EAAMK,EAAgBL,IAAMI,EAAWJ,IACvCC,EAAMI,EAAgBJ,IAAMG,EAAWH,IAW3C,OANII,EAAgBJ,IAAMI,EAAgBL,IACtCI,EAAWH,IAAMG,EAAWJ,OAE1BA,EAAKC,GAAO,CAACA,EAAKD,IAGjB,CAAEA,MAAKC,MAClB,CAqFO,MAAMK,EAAiB,IAmBdC,SAAAA,EAC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C,EAAYpC,MACZqC,EAAoBrC,IAAMoC,EAAYpC,IAAMmC,EAAOnC,UAG/BE,IAApBkC,EAAYnC,MACZoC,EAAoBpC,IAAMmC,EAAYnC,IAAMkC,EAAOnC,KAGhDqC,CACX,0DAMM,WACuC,IAAzC7B,EAAA8B,UAAAC,OAAA,QAAArC,IAAAoC,UAAA,GAAAA,UAAA,GAA2BhC,EAQ3B,OANoB,IAAhBE,EACAA,EAAc,GACS,IAAhBA,IACPA,EAAcF,GAGX,CACH0B,EAAGzB,EAAmBC,EAAa,OAAQ,SAC3CyB,EAAG1B,EAAmBC,EAAa,MAAO,UAElD"}
1
+ {"version":3,"file":"constraints.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs"],"sourcesContent":["import { mixNumber, calcLength } from 'motion-dom';\nimport { progress, clamp } from 'motion-utils';\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nfunction applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nfunction calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nfunction calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = progress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = progress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nfunction rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nconst defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nfunction resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nfunction resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\n//# sourceMappingURL=constraints.mjs.map\n"],"names":["calcRelativeAxisConstraints","axis","min","max","undefined","calcViewportAxisConstraints","layoutAxis","constraintsAxis","defaultElastic","resolveAxisElastic","dragElastic","minLabel","maxLabel","resolvePointElastic","label","point","elastic","mixNumber","Math","source","target","origin","sourceLength","calcLength","targetLength","calcProgress","clamp","layoutBox","top","left","bottom","right","x","y","constraintsBox","layout","constraints","relativeConstraints"],"mappings":"+WA6DgBA,SAAAA,EACZC,EACAC,EACAC,GAEA,MAAO,CACHD,SAAaE,IAARF,EAAoBD,EAAKC,IAAMA,OAAME,EAC1CD,SACYC,IAARD,EACMF,EAAKE,IAAMA,GAAOF,EAAKE,IAAMF,EAAKC,UAClCE,EAElB,CAmBM,SAAUC,EACZC,EACAC,GAEA,IAAIL,EAAMK,EAAgBL,IAAMI,EAAWJ,IACvCC,EAAMI,EAAgBJ,IAAMG,EAAWH,IAW3C,OANII,EAAgBJ,IAAMI,EAAgBL,IACtCI,EAAWH,IAAMG,EAAWJ,OAE1BA,EAAKC,GAAO,CAACA,EAAKD,IAGjB,CAAEA,MAAKC,MAClB,CAqFO,MAAMK,EAAiB,IAmBdC,SAAAA,EACZC,EACAC,EACAC,GAEA,MAAO,CACHV,IAAKW,EAAoBH,EAAaC,GACtCR,IAAKU,EAAoBH,EAAaE,GAE9C,CAEM,SAAUC,EACZH,EACAI,GAEA,MAA8B,iBAAhBJ,EACRA,EACAA,EAAYI,IAAsC,CAC5D,0BAxNM,SACFC,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B,EAAGvB,EAAmBC,EAAa,OAAQ,SAC3CuB,EAAGxB,EAAmBC,EAAa,MAAO,UAElD"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../events/add-pointer-event.mjs.js"),e=require("../../events/event-info.mjs.js"),s=require("../../utils/distance.mjs.js"),n=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),o=require("../../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.js"),i=require("../../../../../motion-utils/dist/es/pipe.mjs.js"),r=require("../../../../../motion-utils/dist/es/time-conversion.mjs.js");const l=new Set(["auto","scroll"]);function a(t,e){return e?{point:e(t.point)}:t}function h(t,e){return{x:t.x-e.x,y:t.y-e.y}}function c(t,e){let{point:s}=t;return{point:s,delta:h(s,v(e)),offset:h(s,d(e)),velocity:m(e,.1)}}function d(t){return t[0]}function v(t){return t[t.length-1]}function m(t,e){if(t.length<2)return{x:0,y:0};let s=t.length-1,n=null;const o=v(t);for(;s>=0&&(n=t[s],!(o.timestamp-n.timestamp>r.secondsToMilliseconds(e)));)s--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&o.timestamp-n.timestamp>2*r.secondsToMilliseconds(e)&&(n=t[1]);const i=r.millisecondsToSeconds(o.timestamp-n.timestamp);if(0===i)return{x:0,y:0};const l={x:(o.x-n.x)/i,y:(o.y-n.y)/i};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}exports.PanSession=class{constructor(r,l){let{transformPagePoint:h,contextWindow:d=window,dragSnapToOrigin:v=!1,distanceThreshold:m=3,element:p}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=a(this.lastRawMoveEventInfo,this.transformPagePoint));const t=c(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,o=s.distance2D(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!o)return;const{point:i}=t,{timestamp:r}=n.frameData;this.history.push({...i,timestamp:r});const{onStart:l,onMove:h}=this.handlers;e||(l&&l(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=a(e,this.transformPagePoint),n.frame.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:s,onSessionEnd:n,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=c("pointercancel"===t.type?this.lastMoveEventInfo:a(e,this.transformPagePoint),this.history);this.startEvent&&s&&s(t,i),n&&n(t,i)},!o.isPrimaryPointer(r))return;this.dragSnapToOrigin=v,this.handlers=l,this.transformPagePoint=h,this.distanceThreshold=m,this.contextWindow=d||window;const u=a(e.extractEventInfo(r),this.transformPagePoint),{point:f}=u,{timestamp:w}=n.frameData;this.history=[{...f,timestamp:w}];const{onSessionStart:E}=l;E&&E(r,c(u,this.history));const y={passive:!0,capture:!0};this.removeListeners=i.pipe(t.addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove,y),t.addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp,y),t.addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp,y)),p&&this.startScrollTracking(p)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(l.has(t.overflowX)||l.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const s=t===window,o=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i=o.x-e.x,r=o.y-e.y;0===i&&0===r||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i,this.lastMoveEventInfo.point.y+=r):this.history.length>0&&(this.history[0].x-=i,this.history[0].y-=r),this.scrollPositions.set(t,o),n.frame.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),n.cancelFrame(this.updatePoint)}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../events/add-pointer-event.mjs.js"),e=require("../../events/event-info.mjs.js"),s=require("../../utils/distance.mjs.js"),n=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),o=require("../../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.js"),i=require("../../../../../motion-utils/dist/es/pipe.mjs.js"),r=require("../../../../../motion-utils/dist/es/time-conversion.mjs.js");const l=new Set(["auto","scroll"]);function a(t,e){return e?{point:e(t.point)}:t}function h(t,e){return{x:t.x-e.x,y:t.y-e.y}}function c({point:t},e){return{point:t,delta:h(t,v(e)),offset:h(t,d(e)),velocity:m(e,.1)}}function d(t){return t[0]}function v(t){return t[t.length-1]}function m(t,e){if(t.length<2)return{x:0,y:0};let s=t.length-1,n=null;const o=v(t);for(;s>=0&&(n=t[s],!(o.timestamp-n.timestamp>r.secondsToMilliseconds(e)));)s--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&o.timestamp-n.timestamp>2*r.secondsToMilliseconds(e)&&(n=t[1]);const i=r.millisecondsToSeconds(o.timestamp-n.timestamp);if(0===i)return{x:0,y:0};const l={x:(o.x-n.x)/i,y:(o.y-n.y)/i};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}exports.PanSession=class{constructor(r,l,{transformPagePoint:h,contextWindow:d=window,dragSnapToOrigin:v=!1,distanceThreshold:m=3,element:p}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=a(this.lastRawMoveEventInfo,this.transformPagePoint));const t=c(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,o=s.distance2D(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!o)return;const{point:i}=t,{timestamp:r}=n.frameData;this.history.push({...i,timestamp:r});const{onStart:l,onMove:h}=this.handlers;e||(l&&l(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=a(e,this.transformPagePoint),n.frame.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:s,onSessionEnd:n,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=c("pointercancel"===t.type?this.lastMoveEventInfo:a(e,this.transformPagePoint),this.history);this.startEvent&&s&&s(t,i),n&&n(t,i)},!o.isPrimaryPointer(r))return;this.dragSnapToOrigin=v,this.handlers=l,this.transformPagePoint=h,this.distanceThreshold=m,this.contextWindow=d||window;const u=a(e.extractEventInfo(r),this.transformPagePoint),{point:f}=u,{timestamp:w}=n.frameData;this.history=[{...f,timestamp:w}];const{onSessionStart:E}=l;E&&E(r,c(u,this.history));const y={passive:!0,capture:!0};this.removeListeners=i.pipe(t.addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove,y),t.addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp,y),t.addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp,y)),p&&this.startScrollTracking(p)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(l.has(t.overflowX)||l.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const s=t===window,o=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i=o.x-e.x,r=o.y-e.y;0===i&&0===r||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i,this.lastMoveEventInfo.point.y+=r):this.history.length>0&&(this.history[0].x-=i,this.history[0].y-=r),this.scrollPositions.set(t,o),n.frame.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),n.cancelFrame(this.updatePoint)}};
2
2
  //# sourceMappingURL=PanSession.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PanSession.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs"],"sourcesContent":["import { frameData, frame, isPrimaryPointer, cancelFrame } from 'motion-dom';\nimport { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { distance2D } from '../../utils/distance.mjs';\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"]);\n/**\n * @internal\n */\nclass PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n this.lastRawMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n this.scrollPositions = new Map();\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n this.removeScrollListeners = null;\n this.onElementScroll = (event) => {\n this.handleScroll(event.target);\n };\n this.onWindowScroll = () => {\n this.handleScroll(window);\n };\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint);\n }\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastRawMoveEventInfo = info;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation();\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.distanceThreshold = distanceThreshold;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n // Listen in the capture phase so a descendant calling\n // stopPropagation() (e.g. in its own pointerup handler) can't\n // prevent the gesture from ending. See #2794.\n const eventOptions = { passive: true, capture: true };\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp, eventOptions));\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element);\n }\n }\n /**\n * Start tracking scroll on ancestors and window.\n */\n startScrollTracking(element) {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement;\n while (current) {\n const style = getComputedStyle(current);\n if (overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n });\n }\n current = current.parentElement;\n }\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n });\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll);\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n window.removeEventListener(\"scroll\", this.onWindowScroll);\n };\n }\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n handleScroll(target) {\n const initial = this.scrollPositions.get(target);\n if (!initial)\n return;\n const isWindow = target === window;\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: target.scrollLeft,\n y: target.scrollTop,\n };\n const delta = { x: current.x - initial.x, y: current.y - initial.y };\n if (delta.x === 0 && delta.y === 0)\n return;\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x;\n this.lastMoveEventInfo.point.y += delta.y;\n }\n }\n else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x;\n this.history[0].y -= delta.y;\n }\n }\n this.scrollPositions.set(target, current);\n frame.update(this.updatePoint, true);\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n this.removeScrollListeners && this.removeScrollListeners();\n this.scrollPositions.clear();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2) {\n timestampedPoint = history[1];\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n\nexport { PanSession };\n//# sourceMappingURL=PanSession.mjs.map\n"],"names":["overflowStyles","Set","transformPoint","info","transformPagePoint","point","subtractPoint","a","b","x","y","getPanInfo","_ref","history","delta","lastDevicePoint","offset","startDevicePoint","velocity","getVelocity","length","timeDelta","i","timestampedPoint","lastPoint","timestamp","secondsToMilliseconds","time","millisecondsToSeconds","currentVelocity","Infinity","constructor","event","handlers","contextWindow","window","dragSnapToOrigin","distanceThreshold","element","arguments","undefined","this","startEvent","lastMoveEvent","lastMoveEventInfo","lastRawMoveEventInfo","scrollPositions","Map","removeScrollListeners","onElementScroll","handleScroll","target","onWindowScroll","updatePoint","isPanStarted","isDistancePastThreshold","distance2D","frameData","push","onStart","onMove","handlePointerMove","frame","update","handlePointerUp","end","onEnd","onSessionEnd","resumeAnimation","panInfo","type","isPrimaryPointer","initialInfo","extractEventInfo","onSessionStart","eventOptions","passive","capture","removeListeners","pipe","addPointerEvent","startScrollTracking","current","parentElement","style","getComputedStyle","has","overflowX","overflowY","set","scrollLeft","scrollTop","scrollX","scrollY","addEventListener","removeEventListener","initial","get","isWindow","updateHandlers","clear","cancelFrame"],"mappings":"mfAuCA,MAAMA,EAA+B,IAAIC,IAAI,CAAC,OAAQ,WA2TtD,SAASC,EACLC,EACAC,GAEA,OAAOA,EAAqB,CAAEC,MAAOD,EAAmBD,EAAKE,QAAWF,CAC5E,CAEA,SAASG,EAAcC,EAAUC,GAC7B,MAAO,CAAEC,EAAGF,EAAEE,EAAID,EAAEC,EAAGC,EAAGH,EAAEG,EAAIF,EAAEE,EACtC,CAEA,SAASC,EAAUC,EAAuBC,GAA2B,IAAjDR,MAAEA,GAAkBO,EACpC,MAAO,CACHP,QACAS,MAAOR,EAAcD,EAAOU,EAAgBF,IAC5CG,OAAQV,EAAcD,EAAOY,EAAiBJ,IAC9CK,SAAUC,EAAYN,EAAS,IAEvC,CAEA,SAASI,EAAiBJ,GACtB,OAAOA,EAAQ,EACnB,CAEA,SAASE,EAAgBF,GACrB,OAAOA,EAAQA,EAAQO,OAAS,EACpC,CAEA,SAASD,EAAYN,EAA6BQ,GAC9C,GAAIR,EAAQO,OAAS,EACjB,MAAO,CAAEX,EAAG,EAAG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UtD,KAAKQ,gBAAiB,CACvD4B,SAAS,IAEb1C,OAAO4D,oBAAoB,SAAUtD,KAAKW,gBAElD,CAgBQF,YAAAA,CAAaC,GACjB,MAAM6C,EAAUvD,KAAKK,gBAAgBmD,IAAI9C,GACzC,IAAK6C,EAAS,OAEd,MAAME,EAAW/C,IAAWhB,OACtB+C,EAAUgB,EACV,CAAEzF,EAAG0B,OAAOyD,QAASlF,EAAGyB,OAAO0D,SAC/B,CACIpF,EAAI0C,EAAmBuC,WACvBhF,EAAIyC,EAAmBwC,WAG3B7E,EAAaoE,EAAQzE,EAAIuF,EAAQvF,EAAjCK,EAAuCoE,EAAQxE,EAAIsF,EAAQtF,EACjD,IAAZI,GAA6B,IAAZA,IAEjBoF,EAEIzD,KAAKG,oBACLH,KAAKG,kBAAkBvC,MAAMI,GAAKK,EAClC2B,KAAKG,kBAAkBvC,MAAMK,GAAKI,GAIlC2B,KAAK5B,QAAQO,OAAS,IACtBqB,KAAK5B,QAAQ,GAAGJ,GAAKK,EACrB2B,KAAK5B,QAAQ,GAAGH,GAAKI,GAI7B2B,KAAKK,gBAAgB2C,IAAItC,EAAQ+B,GACjCpB,EAAAA,MAAMC,OAAOtB,KAAKY,aAAa,GACnC,CA0EA8C,cAAAA,CAAelE,GACXQ,KAAKR,SAAWA,CACpB,CAEAgC,GAAAA,GACIxB,KAAKqC,iBAAmBrC,KAAKqC,kBAC7BrC,KAAKO,uBAAyBP,KAAKO,wBACnCP,KAAKK,gBAAgBsD,QACrBC,cAAY5D,KAAKY,YACrB"}
1
+ {"version":3,"file":"PanSession.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs"],"sourcesContent":["import { frameData, frame, isPrimaryPointer, cancelFrame } from 'motion-dom';\nimport { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { distance2D } from '../../utils/distance.mjs';\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"]);\n/**\n * @internal\n */\nclass PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n this.lastRawMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n this.scrollPositions = new Map();\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n this.removeScrollListeners = null;\n this.onElementScroll = (event) => {\n this.handleScroll(event.target);\n };\n this.onWindowScroll = () => {\n this.handleScroll(window);\n };\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint);\n }\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastRawMoveEventInfo = info;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation();\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.distanceThreshold = distanceThreshold;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n // Listen in the capture phase so a descendant calling\n // stopPropagation() (e.g. in its own pointerup handler) can't\n // prevent the gesture from ending. See #2794.\n const eventOptions = { passive: true, capture: true };\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp, eventOptions));\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element);\n }\n }\n /**\n * Start tracking scroll on ancestors and window.\n */\n startScrollTracking(element) {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement;\n while (current) {\n const style = getComputedStyle(current);\n if (overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n });\n }\n current = current.parentElement;\n }\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n });\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll);\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n window.removeEventListener(\"scroll\", this.onWindowScroll);\n };\n }\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n handleScroll(target) {\n const initial = this.scrollPositions.get(target);\n if (!initial)\n return;\n const isWindow = target === window;\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: target.scrollLeft,\n y: target.scrollTop,\n };\n const delta = { x: current.x - initial.x, y: current.y - initial.y };\n if (delta.x === 0 && delta.y === 0)\n return;\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x;\n this.lastMoveEventInfo.point.y += delta.y;\n }\n }\n else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x;\n this.history[0].y -= delta.y;\n }\n }\n this.scrollPositions.set(target, current);\n frame.update(this.updatePoint, true);\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n this.removeScrollListeners && this.removeScrollListeners();\n this.scrollPositions.clear();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2) {\n timestampedPoint = history[1];\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n\nexport { PanSession };\n//# sourceMappingURL=PanSession.mjs.map\n"],"names":["overflowStyles","Set","transformPoint","info","transformPagePoint","point","subtractPoint","a","b","x","y","getPanInfo","history","delta","lastDevicePoint","offset","startDevicePoint","velocity","getVelocity","length","timeDelta","i","timestampedPoint","lastPoint","timestamp","secondsToMilliseconds","time","millisecondsToSeconds","currentVelocity","Infinity","constructor","event","handlers","contextWindow","window","dragSnapToOrigin","distanceThreshold","element","this","startEvent","lastMoveEvent","lastMoveEventInfo","lastRawMoveEventInfo","scrollPositions","Map","removeScrollListeners","onElementScroll","handleScroll","target","onWindowScroll","updatePoint","isPanStarted","isDistancePastThreshold","distance2D","frameData","push","onStart","onMove","handlePointerMove","frame","update","handlePointerUp","end","onEnd","onSessionEnd","resumeAnimation","panInfo","type","isPrimaryPointer","initialInfo","extractEventInfo","onSessionStart","eventOptions","passive","capture","removeListeners","pipe","addPointerEvent","startScrollTracking","current","parentElement","style","getComputedStyle","has","overflowX","overflowY","set","scrollLeft","scrollTop","scrollX","scrollY","addEventListener","removeEventListener","initial","get","isWindow","updateHandlers","clear","cancelFrame"],"mappings":"mfAuCA,MAAMA,EAA+B,IAAIC,IAAI,CAAC,OAAQ,WA2TtD,SAASC,EACLC,EACAC,GAEA,OAAOA,EAAqB,CAAEC,MAAOD,EAAmBD,EAAKE,QAAWF,CAC5E,CAEA,SAASG,EAAcC,EAAUC,GAC7B,MAAO,CAAEC,EAAGF,EAAEE,EAAID,EAAEC,EAAGC,EAAGH,EAAEG,EAAIF,EAAEE,EACtC,CAEA,SAASC,GAAWN,MAAEA,GAAoBO,GACtC,MAAO,CACHP,QACAQ,MAAOP,EAAcD,EAAOS,EAAgBF,IAC5CG,OAAQT,EAAcD,EAAOW,EAAiBJ,IAC9CK,SAAUC,EAAYN,EAAS,IAEvC,CAEA,SAASI,EAAiBJ,GACtB,OAAOA,EAAQ,EACnB,CAEA,SAASE,EAAgBF,GACrB,OAAOA,EAAQA,EAAQO,OAAS,EACpC,CAEA,SAASD,EAAYN,EAA6BQ,GAC9C,GAAIR,EAAQO,OAAS,EACjB,MAAO,CAAEV,EAAG,EAAGC,EAAG,GAGtB,IAAIW,EAAIT,EAAQO,OAAS,EACrBG,EAA4C,KAChD,MAAMC,EAAYT,EAAgBF,GAClC,KAAOS,G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AK6C,EAAS,OAEd,MAAME,EAAW/C,IAAWd,OACtB6C,EAAUgB,EACV,CAAEtF,EAAGyB,OAAOuD,QAAS/E,EAAGwB,OAAOwD,SAC/B,CACIjF,EAAIuC,EAAmBuC,WACvB7E,EAAIsC,EAAmBwC,WAG3B3E,EAAakE,EAAQtE,EAAIoF,EAAQpF,EAAjCI,EAAuCkE,EAAQrE,EAAImF,EAAQnF,EACjD,IAAZG,GAA6B,IAAZA,IAEjBkF,EAEIzD,KAAKG,oBACLH,KAAKG,kBAAkBpC,MAAMI,GAAKI,EAClCyB,KAAKG,kBAAkBpC,MAAMK,GAAKG,GAIlCyB,KAAK1B,QAAQO,OAAS,IACtBmB,KAAK1B,QAAQ,GAAGH,GAAKI,EACrByB,KAAK1B,QAAQ,GAAGF,GAAKG,GAI7ByB,KAAKK,gBAAgB2C,IAAItC,EAAQ+B,GACjCpB,EAAAA,MAAMC,OAAOtB,KAAKY,aAAa,GACnC,CA0EA8C,cAAAA,CAAehE,GACXM,KAAKN,SAAWA,CACpB,CAEA8B,GAAAA,GACIxB,KAAKqC,iBAAmBrC,KAAKqC,kBAC7BrC,KAAKO,uBAAyBP,KAAKO,wBACnCP,KAAKK,gBAAgBsD,QACrBC,cAAY5D,KAAKY,YACrB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../events/event-info.mjs.js"),t=require("../../../../motion-dom/dist/es/render/Feature.mjs.js"),s=require("../../../../motion-dom/dist/es/gestures/press/index.mjs.js"),r=require("../../../../motion-dom/dist/es/frameloop/frame.mjs.js");function n(t,s,n){const{props:o}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap","Start"===n);const a=o["onTap"+("End"===n?"":n)];a&&r.frame.postRender(()=>a(s,e.extractEventInfo(s)))}class o extends t.Feature{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:r}=this.node.props;this.unmount=s.press(e,(e,t)=>(n(this.node,t,"Start"),(e,t)=>{let{success:s}=t;return n(this.node,e,s?"End":"Cancel")}),{useGlobalTarget:t,stopPropagation:!1===r?.tap})}unmount(){}}exports.PressGesture=o;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../events/event-info.mjs.js"),t=require("../../../../motion-dom/dist/es/render/Feature.mjs.js"),s=require("../../../../motion-dom/dist/es/gestures/press/index.mjs.js"),n=require("../../../../motion-dom/dist/es/frameloop/frame.mjs.js");function r(t,s,r){const{props:o}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap","Start"===r);const a=o["onTap"+("End"===r?"":r)];a&&n.frame.postRender(()=>a(s,e.extractEventInfo(s)))}class o extends t.Feature{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=s.press(e,(e,t)=>(r(this.node,t,"Start"),(e,{success:t})=>r(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===n?.tap})}unmount(){}}exports.PressGesture=o;
2
2
  //# sourceMappingURL=press.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"press.mjs.js","sources":["../../../../../../node_modules/framer-motion/dist/es/gestures/press.mjs"],"sourcesContent":["import { Feature, press, frame } from 'motion-dom';\nimport { extractEventInfo } from '../events/event-info.mjs';\n\nfunction handlePressEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return;\n }\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\");\n }\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle));\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nclass PressGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n const { globalTapTarget, propagate } = this.node.props;\n this.unmount = press(current, (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\");\n return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? \"End\" : \"Cancel\");\n }, {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n });\n }\n unmount() { }\n}\n\nexport { PressGesture };\n//# sourceMappingURL=press.mjs.map\n"],"names":["handlePressEvent","node","event","lifecycle","props","current","HTMLButtonElement","disabled","animationState","whileTap","setActive","callback","frame","postRender","extractEventInfo","PressGesture","Feature","mount","this","globalTapTarget","propagate","unmount","press","_element","startEvent","endEvent","_ref","success","useGlobalTarget","stopPropagation","tap"],"mappings":"8TAGA,SAASA,EACLC,EACAC,EACAC,GAEA,MAAMC,MAAEA,GAAUH,EAElB,GAAIA,EAAKI,mBAAmBC,mBAAqBL,EAAKI,QAAQE,SAC1D,OAGAN,EAAKO,gBAAkBJ,EAAMK,UAC7BR,EAAKO,eAAeE,UAAU,WAA0B,UAAdP,GAG9C,MAKMQ,EAAWP,EALE,SAAyB,QAAdD,EAAsB,GAAKA,IAMrDQ,GACAC,EAAKA,MAACC,WAAW,IAAMF,EAAST,EAAOY,mBAAiBZ,IAEhE,CAEM,MAAOa,UAAqBC,EAAAA,QAC9BC,KAAAA,GACI,MAAMZ,QAAEA,GAAYa,KAAKjB,KACzB,IAAKI,EAAS,OAEd,MAAMc,gBAAEA,EAAeC,UAAEA,GAAcF,KAAKjB,KAAKG,MAEjDc,KAAKG,QAAUC,EAAKA,MAChBjB,EACA,CAACkB,EAAUC,KACPxB,EAAiBkB,KAAKjB,KAAMuB,EAAY,SAEjC,CAACC,EAAQC,KAAA,IAAEC,QAAEA,GAASD,EAAA,OACzB1B,EACIkB,KAAKjB,KACLwB,EACAE,EAAU,MAAQ,YAG9B,CACIC,gBAAiBT,EACjBU,iBAAoC,IAAnBT,GAAWU,KAGxC,CAEAT,OAAAA,GAAW"}
1
+ {"version":3,"file":"press.mjs.js","sources":["../../../../../../node_modules/framer-motion/dist/es/gestures/press.mjs"],"sourcesContent":["import { Feature, press, frame } from 'motion-dom';\nimport { extractEventInfo } from '../events/event-info.mjs';\n\nfunction handlePressEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return;\n }\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\");\n }\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle));\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nclass PressGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n const { globalTapTarget, propagate } = this.node.props;\n this.unmount = press(current, (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\");\n return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? \"End\" : \"Cancel\");\n }, {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n });\n }\n unmount() { }\n}\n\nexport { PressGesture };\n//# sourceMappingURL=press.mjs.map\n"],"names":["handlePressEvent","node","event","lifecycle","props","current","HTMLButtonElement","disabled","animationState","whileTap","setActive","callback","frame","postRender","extractEventInfo","PressGesture","Feature","mount","this","globalTapTarget","propagate","unmount","press","_element","startEvent","endEvent","success","useGlobalTarget","stopPropagation","tap"],"mappings":"8TAGA,SAASA,EACLC,EACAC,EACAC,GAEA,MAAMC,MAAEA,GAAUH,EAElB,GAAIA,EAAKI,mBAAmBC,mBAAqBL,EAAKI,QAAQE,SAC1D,OAGAN,EAAKO,gBAAkBJ,EAAMK,UAC7BR,EAAKO,eAAeE,UAAU,WAA0B,UAAdP,GAG9C,MAKMQ,EAAWP,EALE,SAAyB,QAAdD,EAAsB,GAAKA,IAMrDQ,GACAC,EAAKA,MAACC,WAAW,IAAMF,EAAST,EAAOY,mBAAiBZ,IAEhE,CAEM,MAAOa,UAAqBC,EAAAA,QAC9BC,KAAAA,GACI,MAAMZ,QAAEA,GAAYa,KAAKjB,KACzB,IAAKI,EAAS,OAEd,MAAMc,gBAAEA,EAAeC,UAAEA,GAAcF,KAAKjB,KAAKG,MAEjDc,KAAKG,QAAUC,EAAKA,MAChBjB,EACA,CAACkB,EAAUC,KACPxB,EAAiBkB,KAAKjB,KAAMuB,EAAY,SAEjC,CAACC,GAAYC,aAChB1B,EACIkB,KAAKjB,KACLwB,EACAC,EAAU,MAAQ,WAG9B,CACIC,gBAAiBR,EACjBS,iBAAoC,IAAnBR,GAAWS,KAGxC,CAEAR,OAAAA,GAAW"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./observers.mjs.js"),t=require("../../../../../../motion-dom/dist/es/render/Feature.mjs.js");const r={some:0,all:1};class s extends t.Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:s,margin:i,amount:o="some",once:n}=t,a={root:s?s.current:void 0,rootMargin:i,threshold:"number"==typeof o?o:r[o]};this.stopObserver=e.observeIntersection(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,n&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:s}=this.node.getProps(),i=t?r:s;i&&i(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node,r=["amount","margin","root"].some(function(e){let{viewport:t={}}=e,{viewport:r={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=>t[e]!==r[e]}(e,t));r&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}exports.InViewFeature=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./observers.mjs.js"),t=require("../../../../../../motion-dom/dist/es/render/Feature.mjs.js");const r={some:0,all:1};class s extends t.Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:s,margin:i,amount:o="some",once:n}=t,a={root:s?s.current:void 0,rootMargin:i,threshold:"number"==typeof o?o:r[o]};this.stopObserver=e.observeIntersection(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,n&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:s}=this.node.getProps(),i=t?r:s;i&&i(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}exports.InViewFeature=s;
2
2
  //# sourceMappingURL=index.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs"],"sourcesContent":["import { Feature } from 'motion-dom';\nimport { observeIntersection } from './observers.mjs';\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nclass InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.stopObserver?.();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() {\n this.stopObserver?.();\n this.hasEnteredView = false;\n this.isInView = false;\n }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n\nexport { InViewFeature };\n//# sourceMappingURL=index.mjs.map\n"],"names":["thresholdNames","some","all","InViewFeature","Feature","constructor","this","hasEnteredView","isInView","startObserver","stopObserver","viewport","node","getProps","root","margin","rootMargin","amount","once","options","current","undefined","threshold","observeIntersection","entry","isIntersecting","animationState","setActive","onViewportEnter","onViewportLeave","callback","mount","update","IntersectionObserver","props","prevProps","hasOptionsChanged","_ref","prevViewport","arguments","length","name","hasViewportOptionChanged","unmount"],"mappings":"gLAIA,MAAMA,EAAiB,CACnBC,KAAM,EACNC,IAAK,GAGH,MAAOC,UAAsBC,EAAAA,QAAnCC,WAAAA,uBACYC,KAAAC,gBAAiB,EAEjBD,KAAAE,UAAW,CAkFvB,CA9EYC,aAAAA,GACJH,KAAKI,iBAEL,MAAMC,SAAEA,EAAW,CAAA,GAAOL,KAAKM,KAAKC,YAC9BC,KAAEA,EAAMC,OAAQC,EAAUC,OAAEA,EAAS,OAAMC,KAAEA,GAASP,EAEtDQ,EAAU,CACZL,KAAMA,EAAOA,EAAKM,aAAUC,EAC5BL,aACAM,UACsB,iBAAXL,EAAsBA,EAASjB,EAAeiB,IAuC7DX,KAAKI,aAAea,EAAAA,oBAChBjB,KAAKM,KAAKQ,QACVD,EAtC0BK,IAC1B,MAAMC,eAAEA,GAAmBD,EAK3B,GAAIlB,KAAKE,WAAaiB,EAAgB,OAQtC,GANAnB,KAAKE,SAAWiB,EAMZP,IAASO,GAAkBnB,KAAKC,eAChC,OACOkB,IACPnB,KAAKC,gBAAiB,GAGtBD,KAAKM,KAAKc,gBACVpB,KAAKM,KAAKc,eAAeC,UACrB,cACAF,GAQR,MAAMG,gBAAEA,EAAeC,gBAAEA,GAAoBvB,KAAKM,KAAKC,WACjDiB,EAAWL,EAAiBG,EAAkBC,EACpDC,GAAYA,EAASN,IAQ7B,CAEAO,KAAAA,GACIzB,KAAKG,eACT,CAEAuB,MAAAA,GACI,GAAoC,oBAAzBC,qBAAsC,OAEjD,MAAMC,MAAEA,EAAKC,UAAEA,GAAc7B,KAAKM,KAC5BwB,EAAoB,CAAC,SAAU,SAAU,QAAQnC,KAgB/D,SAAiCoC,GAEoB,IADjD1B,SAAEA,EAAW,CAAA,GAAiB0B,GAC5B1B,SAAU2B,EAAe,CAAA,GAAEC,UAAAC,OAAAD,QAAAlB,IAAAkB,aAAAA,UAAA,GAAkB,GAE/C,OAAQE,GACJ9B,EAAS8B,KAAUH,EAAaG,EACxC,CArBYC,CAAyBR,EAAOC,IAGhCC,GACA9B,KAAKG,eAEb,CAEAkC,OAAAA,GACIrC,KAAKI,iBACLJ,KAAKC,gBAAiB,EACtBD,KAAKE,UAAW,CACpB"}
1
+ {"version":3,"file":"index.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs"],"sourcesContent":["import { Feature } from 'motion-dom';\nimport { observeIntersection } from './observers.mjs';\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nclass InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.stopObserver?.();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() {\n this.stopObserver?.();\n this.hasEnteredView = false;\n this.isInView = false;\n }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n\nexport { InViewFeature };\n//# sourceMappingURL=index.mjs.map\n"],"names":["thresholdNames","some","all","InViewFeature","Feature","constructor","this","hasEnteredView","isInView","startObserver","stopObserver","viewport","node","getProps","root","margin","rootMargin","amount","once","options","current","undefined","threshold","observeIntersection","entry","isIntersecting","animationState","setActive","onViewportEnter","onViewportLeave","callback","mount","update","IntersectionObserver","props","prevProps","prevView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gBAAiB,EACtBD,KAAKE,UAAW,CACpB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=new WeakMap,t=new WeakMap,n=t=>{const n=e.get(t.target);n&&n(t)},o=e=>{e.forEach(n)};exports.observeIntersection=function(n,r,s){const c=function(e){let{root:n,...r}=e;const s=n||document;t.has(s)||t.set(s,{});const c=t.get(s),u=JSON.stringify(r);return c[u]||(c[u]=new IntersectionObserver(o,{root:n,...r})),c[u]}(r);return e.set(n,s),c.observe(n),()=>{e.delete(n),c.unobserve(n)}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=new WeakMap,t=new WeakMap,n=t=>{const n=e.get(t.target);n&&n(t)},o=e=>{e.forEach(n)};exports.observeIntersection=function(n,r,s){const c=function({root:e,...n}){const r=e||document;t.has(r)||t.set(r,{});const s=t.get(r),c=JSON.stringify(n);return s[c]||(s[c]=new IntersectionObserver(o,{root:e,...n})),s[c]}(r);return e.set(n,s),c.observe(n),()=>{e.delete(n),c.unobserve(n)}};
2
2
  //# sourceMappingURL=observers.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"observers.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs"],"sourcesContent":["/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap();\nconst fireObserverCallback = (entry) => {\n const callback = observerCallbacks.get(entry.target);\n callback && callback(entry);\n};\nconst fireAllObserverCallbacks = (entries) => {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver({ root, ...options }) {\n const lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n const rootObservers = observers.get(lookupRoot);\n const key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\n }\n return rootObservers[key];\n}\nfunction observeIntersection(element, options, callback) {\n const rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return () => {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n\nexport { observeIntersection };\n//# sourceMappingURL=observers.mjs.map\n"],"names":["observerCallbacks","WeakMap","observers","fireObserverCallback","entry","callback","get","target","fireAllObserverCallbacks","entries","forEach","observeIntersection","element","options","rootInteresectionObserver","_ref","root","lookupRoot","document","has","set","rootObservers","key","JSON","stringify","IntersectionObserver","initIntersectionObserver","observe","delete","unobserve"],"mappings":"oEAWA,MAAMA,EAAoB,IAAIC,QAOxBC,EAAY,IAAID,QAKhBE,EAAwBC,IAC1B,MAAMC,EAAWL,EAAkBM,IAAIF,EAAMG,QAC7CF,GAAYA,EAASD,IAGnBI,EAA0DC,IAC5DA,EAAQC,QAAQP,gCAiCJQ,SACZC,EACAC,EACAR,GAEA,MAAMS,EAnCV,SAAiCC,GAGN,IAHOC,KAC9BA,KACGH,GACoBE,EACvB,MAAME,EAAaD,GAAQE,SAKtBhB,EAAUiB,IAAIF,IACff,EAAUkB,IAAIH,EAAY,CAAA,GAE9B,MAAMI,EAAgBnB,EAAUI,IAAIW,GAE9BK,EAAMC,KAAKC,UAAUX,GAa3B,OAPKQ,EAAcC,KACfD,EAAcC,GAAO,IAAIG,qBACrBjB,EACA,CAAEQ,UAASH,KAIZQ,EAAcC,EACzB,CAOsCI,CAAyBb,GAK3D,OAHAb,EAAkBoB,IAAIR,EAASP,GAC/BS,EAA0Ba,QAAQf,GAE3B,KACHZ,EAAkB4B,OAAOhB,GACzBE,EAA0Be,UAAUjB,GAE5C"}
1
+ {"version":3,"file":"observers.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs"],"sourcesContent":["/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap();\nconst fireObserverCallback = (entry) => {\n const callback = observerCallbacks.get(entry.target);\n callback && callback(entry);\n};\nconst fireAllObserverCallbacks = (entries) => {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver({ root, ...options }) {\n const lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n const rootObservers = observers.get(lookupRoot);\n const key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\n }\n return rootObservers[key];\n}\nfunction observeIntersection(element, options, callback) {\n const rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return () => {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n\nexport { observeIntersection };\n//# sourceMappingURL=observers.mjs.map\n"],"names":["observerCallbacks","WeakMap","observers","fireObserverCallback","entry","callback","get","target","fireAllObserverCallbacks","entries","forEach","observeIntersection","element","options","rootInteresectionObserver","root","lookupRoot","document","has","set","rootObservers","key","JSON","stringify","IntersectionObserver","initIntersectionObserver","observe","delete","unobserve"],"mappings":"oEAWA,MAAMA,EAAoB,IAAIC,QAOxBC,EAAY,IAAID,QAKhBE,EAAwBC,IAC1B,MAAMC,EAAWL,EAAkBM,IAAIF,EAAMG,QAC7CF,GAAYA,EAASD,IAGnBI,EAA0DC,IAC5DA,EAAQC,QAAQP,gCAiCJQ,SACZC,EACAC,EACAR,GAEA,MAAMS,EAnCV,UAAkCC,KAC9BA,KACGF,IAEH,MAAMG,EAAaD,GAAQE,SAKtBf,EAAUgB,IAAIF,IACfd,EAAUiB,IAAIH,EAAY,CAAA,GAE9B,MAAMI,EAAgBlB,EAAUI,IAAIU,GAE9BK,EAAMC,KAAKC,UAAUV,GAa3B,OAPKO,EAAcC,KACfD,EAAcC,GAAO,IAAIG,qBACrBhB,EACA,CAAEO,UAASF,KAIZO,EAAcC,EACzB,CAOsCI,CAAyBZ,GAK3D,OAHAb,EAAkBmB,IAAIP,EAASP,GAC/BS,EAA0BY,QAAQd,GAE3B,KACHZ,EAAkB2B,OAAOf,GACzBE,EAA0Bc,UAAUhB,GAE5C"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../react/jsx-runtime.js");var e=require("react"),t=require("../context/LayoutGroupContext.mjs.js"),o=require("../context/LazyContext.mjs.js"),n=require("../context/MotionConfigContext.mjs.js"),s=require("../context/MotionContext/index.mjs.js"),r=require("../context/MotionContext/create.mjs.js"),i=require("../render/dom/use-render.mjs.js"),u=require("../render/dom/utils/is-svg-component.mjs.js"),a=require("../render/html/use-html-visual-state.mjs.js"),l=require("../render/svg/use-svg-visual-state.mjs.js"),m=require("./features/definitions.mjs.js"),d=require("./features/load-features.mjs.js"),c=require("./utils/symbol.mjs.js"),j=require("./utils/use-motion-ref.mjs.js"),x=require("./utils/use-visual-element.mjs.js"),v=require("../../../../../_virtual/jsx-runtime.js"),f=require("../../../../motion-utils/dist/es/errors.mjs.js");function p(o){let{layoutId:n}=o;const s=e.useContext(t.LayoutGroupContext).id;return s&&void 0!==n?s+"-"+n:n}exports.createMotionComponent=function(t){let{forwardMotionProps:y=!1,type:C}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},q=arguments.length>2?arguments[2]:void 0,g=arguments.length>3?arguments[3]:void 0;q&&d.loadFeatures(q);const M=C?"svg"===C:u.isSVGComponent(t),h=M?l.useSVGVisualState:a.useHTMLVisualState;function E(u,a){let l;const d={...e.useContext(n.MotionConfigContext),...u,layoutId:p(u)},{isStatic:c}=d,C=r.useCreateMotionContext(u),E=h(u,c);if(!c&&"undefined"!=typeof window){!function(t,n){const s=e.useContext(o.LazyContext).strict;if("production"!==process.env.NODE_ENV&&n&&s){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?f.warning(!1,e,"lazy-strict-mode"):f.invariant(!1,e,"lazy-strict-mode")}}(d,q);const n=function(e){const t=m.getInitializedFeatureDefinitions(),{drag:o,layout:n}=t;if(!o&&!n)return{};const s={...o,...n};return{MeasureLayout:o?.isEnabled(e)||n?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(d);l=n.MeasureLayout,C.visualElement=x.useVisualElement(t,E,d,g,n.ProjectionNode,M)}return v.exports.jsxs(s.MotionContext.Provider,{value:C,children:[l&&C.visualElement?v.exports.jsx(l,{visualElement:C.visualElement,...d}):null,i.useRender(t,u,j.useMotionRef(E,C.visualElement,a),E,c,y,M)]})}E.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;const L=e.forwardRef(E);return L[c.motionComponentSymbol]=t,L};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../react/jsx-runtime.js");var e=require("react"),t=require("../context/LayoutGroupContext.mjs.js"),o=require("../context/LazyContext.mjs.js"),n=require("../context/MotionConfigContext.mjs.js"),s=require("../context/MotionContext/index.mjs.js"),r=require("../context/MotionContext/create.mjs.js"),i=require("../render/dom/use-render.mjs.js"),u=require("../render/dom/utils/is-svg-component.mjs.js"),a=require("../render/html/use-html-visual-state.mjs.js"),l=require("../render/svg/use-svg-visual-state.mjs.js"),m=require("./features/definitions.mjs.js"),d=require("./features/load-features.mjs.js"),c=require("./utils/symbol.mjs.js"),j=require("./utils/use-motion-ref.mjs.js"),x=require("./utils/use-visual-element.mjs.js"),f=require("../../../../../_virtual/jsx-runtime.js"),p=require("../../../../motion-utils/dist/es/errors.mjs.js");function v({layoutId:o}){const n=e.useContext(t.LayoutGroupContext).id;return n&&void 0!==o?n+"-"+o:o}exports.createMotionComponent=function(t,{forwardMotionProps:y=!1,type:C}={},q,M){q&&d.loadFeatures(q);const g=C?"svg"===C:u.isSVGComponent(t),E=g?l.useSVGVisualState:a.useHTMLVisualState;function L(u,a){let l;const d={...e.useContext(n.MotionConfigContext),...u,layoutId:v(u)},{isStatic:c}=d,C=r.useCreateMotionContext(u),L=E(u,c);if(!c&&"undefined"!=typeof window){!function(t,n){const s=e.useContext(o.LazyContext).strict;if("production"!==process.env.NODE_ENV&&n&&s){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?p.warning(!1,e,"lazy-strict-mode"):p.invariant(!1,e,"lazy-strict-mode")}}(d,q);const n=function(e){const t=m.getInitializedFeatureDefinitions(),{drag:o,layout:n}=t;if(!o&&!n)return{};const s={...o,...n};return{MeasureLayout:o?.isEnabled(e)||n?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(d);l=n.MeasureLayout,C.visualElement=x.useVisualElement(t,L,d,M,n.ProjectionNode,g)}return f.exports.jsxs(s.MotionContext.Provider,{value:C,children:[l&&C.visualElement?f.exports.jsx(l,{visualElement:C.visualElement,...d}):null,i.useRender(t,u,j.useMotionRef(L,C.visualElement,a),L,c,y,g)]})}L.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;const h=e.forwardRef(L);return h[c.motionComponentSymbol]=t,h};
2
2
  //# sourceMappingURL=index.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs.js","sources":["../../../../../../node_modules/framer-motion/dist/es/motion/index.mjs"],"sourcesContent":["\"use client\";\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { warning, invariant } from 'motion-utils';\nimport { forwardRef, useContext } from 'react';\nimport { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';\nimport { LazyContext } from '../context/LazyContext.mjs';\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\nimport { MotionContext } from '../context/MotionContext/index.mjs';\nimport { useCreateMotionContext } from '../context/MotionContext/create.mjs';\nimport { useRender } from '../render/dom/use-render.mjs';\nimport { isSVGComponent } from '../render/dom/utils/is-svg-component.mjs';\nimport { useHTMLVisualState } from '../render/html/use-html-visual-state.mjs';\nimport { useSVGVisualState } from '../render/svg/use-svg-visual-state.mjs';\nimport { getInitializedFeatureDefinitions } from './features/definitions.mjs';\nimport { loadFeatures } from './features/load-features.mjs';\nimport { motionComponentSymbol } from './utils/symbol.mjs';\nimport { useMotionRef } from './utils/use-motion-ref.mjs';\nimport { useVisualElement } from './utils/use-visual-element.mjs';\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nfunction createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component);\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;\n function MotionDOMComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] }));\n }\n MotionDOMComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\");\n }\n}\nfunction getProjectionFunctionality(props) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n\nexport { createMotionComponent };\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutId","_ref","layoutId","layoutGroupId","undefined","preloadedFeatures","loadFeatures","isSVG","type","isSVGComponent","Component","MotionDOMComponent","props","externalRef","MeasureLayout","configAndProps","isStatic","context","useCreateMotionContext","process","env","NODE_ENV","isStrict","ignoreStrict","useStrictMode","layoutProjection","featureDefinitions","getInitializedFeatureDefinitions","drag","layout","isEnabled","getProjectionFunctionality","visualElement","useVisualElement","visualState","createVisualElement","ProjectionNode","jsxs","exports","MotionContext","Provider","value","children","jsx","useRender","useMotionRef","forwardMotionProps","displayName","name","ForwardRefMotionComponent","forwardRef","motionComponentSymbol"],"mappings":"y5BA6KA,SAAAA,EAAAC,GAAA,IAAAC,SAAAA,GAAAD,gDAEI,OAAAE,QAAAC,IAAAF,EACIC,EAAAD,IAAAA,GAER,2NAnGIG,GAAAC,EAAAA,aAAAD,GAOA,MAAAE,EAAAC,EAAAC,QAAAD,EAAAC,EAAAA,eAAAC,gDAGA,SAAAC,EAAAC,EAAAC,GAQI,IAAAC,EAEA,MAAAC,EAAA,2CAEIH,EACAV,SAAAF,EAAAY,KAGJI,SAAAA,GAAAD,EAEAE,EAAAC,yBAAAN,gDAyER,SAAAG,EAAAV,8CAUI,GAAA,eAAAc,QAAAC,IAAAC,aAGIC,EAAA,4JAIAP,EAAAQ,qFAIR,CAzFYC,CAAAT,EAAAV,GAEA,MAAAoB,EAyFZ,SAAAb,GACI,MAAAc,EAAAC,EAAAA,oCACAC,KAAAA,EAAAC,OAAAA,GAAAH,EAEA,IAAAE,IAAAC,EAAsB,MAAA,CAAA,6BAKlBf,cAAAc,GAAAE,UAAAlB,IAAAiB,GAAAC,UAAAlB,wBAGQR,kCAGhB,CAxGY2B,CAAAhB,GACAD,EAAAW,EAAAX,cAQAG,EAAAe,cAAAC,mBAAAvB,EAAAwB,EAAAnB,EAAAoB,EAAAV,EAAAW,eAAA7B,GAcJ,OAAA8B,EAAAC,QAAAD,KAAAE,EAAAA,cAAAC,SAAA,CAAAC,MAAAxB,EAAAyB,SAAA,CAAA5B,GAAAG,EAAAe,cAAAW,EAAAA,QAAAA,IAAA7B,EAAA,CAAAkB,cAAAf,EAAAe,iBAAAjB,IAAA6B,KAAAA,EAAAA,UAAAlC,EAAAE,EAAAiC,EAAAA,aAAAX,EAAAjB,EAAAe,cAAAnB,GAAAqB,EAAAlB,EAAA8B,EAAAvC,MAwBJI,EAAAoC,YAAArC,2BAAAA,EAEQA,EACA,UAAAA,EAAAqC,aAAArC,EAAAsC,MAAA,QAGR,MAAAC,EAAAC,aAAAvC,GAGA,OAFEsC,EAAAE,EAAAA,uBAAAzC,EAEFuC,CACJ"}
1
+ {"version":3,"file":"index.mjs.js","sources":["../../../../../../node_modules/framer-motion/dist/es/motion/index.mjs"],"sourcesContent":["\"use client\";\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { warning, invariant } from 'motion-utils';\nimport { forwardRef, useContext } from 'react';\nimport { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';\nimport { LazyContext } from '../context/LazyContext.mjs';\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\nimport { MotionContext } from '../context/MotionContext/index.mjs';\nimport { useCreateMotionContext } from '../context/MotionContext/create.mjs';\nimport { useRender } from '../render/dom/use-render.mjs';\nimport { isSVGComponent } from '../render/dom/utils/is-svg-component.mjs';\nimport { useHTMLVisualState } from '../render/html/use-html-visual-state.mjs';\nimport { useSVGVisualState } from '../render/svg/use-svg-visual-state.mjs';\nimport { getInitializedFeatureDefinitions } from './features/definitions.mjs';\nimport { loadFeatures } from './features/load-features.mjs';\nimport { motionComponentSymbol } from './utils/symbol.mjs';\nimport { useMotionRef } from './utils/use-motion-ref.mjs';\nimport { useVisualElement } from './utils/use-visual-element.mjs';\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nfunction createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component);\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;\n function MotionDOMComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] }));\n }\n MotionDOMComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\");\n }\n}\nfunction getProjectionFunctionality(props) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n\nexport { createMotionComponent };\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutId","layoutId","layoutGroupId","undefined","preloadedFeatures","loadFeatures","isSVG","type","isSVGComponent","Component","MotionDOMComponent","props","externalRef","MeasureLayout","configAndProps","isStatic","context","useCreateMotionContext","process","env","NODE_ENV","isStrict","ignoreStrict","useStrictMode","layoutProjection","featureDefinitions","getInitializedFeatureDefinitions","drag","layout","isEnabled","getProjectionFunctionality","visualElement","useVisualElement","visualState","createVisualElement","ProjectionNode","jsxs","exports","MotionContext","Provider","value","children","jsx","useRender","useMotionRef","forwardMotionProps","displayName","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uBAAAzC,EAEFuC,CACJ"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../context/MotionContext/index.mjs.js"),n=require("../../context/PresenceContext.mjs.js"),o=require("../../utils/use-constant.mjs.js"),s=require("../../../../../motion-dom/dist/es/value/utils/resolve-motion-value.mjs.js"),i=require("../../../../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs.js"),r=require("../../../../../motion-dom/dist/es/render/utils/is-animation-controls.mjs.js"),a=require("../../../../../motion-dom/dist/es/render/utils/resolve-variants.mjs.js");function l(e,t,n,o){const l={},u=o(e,{});for(const e in u)l[e]=s.resolveMotionValue(u[e]);let{initial:c,animate:m}=e;const d=i.isControllingVariants(e),j=i.isVariantNode(e);t&&j&&!d&&!1!==e.inherit&&(void 0===c&&(c=t.initial),void 0===m&&(m=t.animate));let v=!!n&&!1===n.initial;v=v||!1===c;const f=v?m:c;if(f&&"boolean"!=typeof f&&!r.isAnimationControls(f)){const t=Array.isArray(f)?f:[f];for(let n=0;n<t.length;n++){const o=a.resolveVariantFromProps(e,t[n]);if(o){const{transitionEnd:e,transition:t,...n}=o;for(const e in n){let t=n[e];if(Array.isArray(t)){t=t[v?t.length-1:0]}null!==t&&(l[e]=t)}for(const t in e)l[t]=e[t]}}}return l}exports.makeUseVisualState=s=>(i,r)=>{const a=e.useContext(t.MotionContext),u=e.useContext(n.PresenceContext),c=()=>function(e,t,n,o){let{scrapeMotionValuesFromProps:s,createRenderState:i}=e;return{latestValues:l(t,n,o,s),renderState:i()}}(s,i,a,u);return r?c():o.useConstant(c)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../context/MotionContext/index.mjs.js"),n=require("../../context/PresenceContext.mjs.js"),o=require("../../utils/use-constant.mjs.js"),s=require("../../../../../motion-dom/dist/es/value/utils/resolve-motion-value.mjs.js"),i=require("../../../../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs.js"),r=require("../../../../../motion-dom/dist/es/render/utils/is-animation-controls.mjs.js"),a=require("../../../../../motion-dom/dist/es/render/utils/resolve-variants.mjs.js");function l(e,t,n,o){const l={},u=o(e,{});for(const e in u)l[e]=s.resolveMotionValue(u[e]);let{initial:c,animate:m}=e;const d=i.isControllingVariants(e),j=i.isVariantNode(e);t&&j&&!d&&!1!==e.inherit&&(void 0===c&&(c=t.initial),void 0===m&&(m=t.animate));let v=!!n&&!1===n.initial;v=v||!1===c;const f=v?m:c;if(f&&"boolean"!=typeof f&&!r.isAnimationControls(f)){const t=Array.isArray(f)?f:[f];for(let n=0;n<t.length;n++){const o=a.resolveVariantFromProps(e,t[n]);if(o){const{transitionEnd:e,transition:t,...n}=o;for(const e in n){let t=n[e];if(Array.isArray(t)){t=t[v?t.length-1:0]}null!==t&&(l[e]=t)}for(const t in e)l[t]=e[t]}}}return l}exports.makeUseVisualState=s=>(i,r)=>{const a=e.useContext(t.MotionContext),u=e.useContext(n.PresenceContext),c=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,o,s){return{latestValues:l(n,o,s,e),renderState:t()}}(s,i,a,u);return r?c():o.useConstant(c)};
2
2
  //# sourceMappingURL=use-visual-state.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-visual-state.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs"],"sourcesContent":["\"use client\";\nimport { resolveMotionValue, isControllingVariants, isVariantNode, isAnimationControls, resolveVariantFromProps } from 'motion-dom';\nimport { useContext } from 'react';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\n\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n return state;\n}\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants$1 = isControllingVariants(props);\n const isVariantNode$1 = isVariantNode(props);\n if (context &&\n isVariantNode$1 &&\n !isControllingVariants$1 &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\nconst makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\n\nexport { makeUseVisualState };\n//# sourceMappingURL=use-visual-state.mjs.map\n"],"names":["makeLatestValues","props","context","presenceContext","scrapeMotionValues","key","motionValues","initial","animate","isControllingVariants$1","isControllingVariants","isVariantNode$1","isVariantNode","inherit","isInitialAnimationBlocked","variantToSet","isAnimationControls","list","Array","isArray","i","length","target","valueTarget","values","transitionEnd","config","isStatic","useContext","MotionContext","PresenceContext","make","_ref","scrapeMotionValuesFromProps","createRenderState","makeState","useConstant"],"mappings":"+kBA2DA,SAAAA,EAAAC,EAAAC,EAAAC,EAAAC,wBASI,IAAAC,MAAAA,KAAAC,kCAIA,IAAAC,QAAAA,EAAAC,QAAAA,GAAAP,EACA,MAAAQ,EAAAC,wBAAAT,GACAU,EAAAC,gBAAAX,GAEAC,OAGIO,IACA,IAAAR,EAAAY,uBAE2BN,EAAAL,EAAAK,sBACAC,EAAAN,EAAAM,0BAI3BL,EAAAI,QAEJO,EAAAA,IAAA,IAAAP,gBAIA,GAAAQ,yBAGIC,EAAAA,oBAAAD,GAAA,CAEA,MAAAE,EAAAC,MAAAC,QAAAJ,GAAAA,EAAA,CAAAA,GACA,IAAAK,IAAAA,IAAAA,EAAAH,EAAAI,OAAAD,IAAA,4FAIQ,IAAAf,MAAAA,KAAAiB,EAAA,CACI,IAAAC,EAAAD,EAAAjB,GAEA,GAAAa,MAAAC,QAAAI,GAAA,CAQIA,EAAAA,IAFIA,EAAAF,YAKR,OAAAE,IACIC,EAAAnB,GAAAkB,GAGR,IAAAlB,MAAAA,KAAAoB,cASZ,OAAAD,CACJ,4BAEOE,GAAAzB,CAAAA,EAAA0B,KAGC,MAAAzB,EAAA0B,aAAAC,EAAAA,eACA1B,EAAAyB,aAAAE,EAAAA,iBACAC,EAAAA,IArGR,SAAAC,EAAA/B,EAAAC,EAAAC,GAAA,IAAA8B,4BAAAA,EAAAC,kBAAAA,GAAAF,EAmBI,MAVA,yCAWJ,CAiFQG,CAAAT,EAAAzB,EAAAC,EAAAC,GAEA,OAAAwB,EAAAI,IAAAK,EAAAA,YAAAL"}
1
+ {"version":3,"file":"use-visual-state.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs"],"sourcesContent":["\"use client\";\nimport { resolveMotionValue, isControllingVariants, isVariantNode, isAnimationControls, resolveVariantFromProps } from 'motion-dom';\nimport { useContext } from 'react';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\n\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n return state;\n}\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants$1 = isControllingVariants(props);\n const isVariantNode$1 = isVariantNode(props);\n if (context &&\n isVariantNode$1 &&\n !isControllingVariants$1 &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\nconst makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\n\nexport { makeUseVisualState };\n//# sourceMappingURL=use-visual-state.mjs.map\n"],"names":["makeLatestValues","props","context","presenceContext","scrapeMotionValues","key","motionValues","initial","animate","isControllingVariants$1","isControllingVariants","isVariantNode$1","isVariantNode","inherit","isInitialAnimationBlocked","variantToSet","isAnimationControls","list","Array","isArray","i","length","target","valueTarget","values","transitionEnd","config","isStatic","useContext","MotionContext","PresenceContext","make","scrapeMotionValuesFromProps","createRenderState","makeState","useConstant"],"mappings":"+kBA2DA,SAAAA,EAAAC,EAAAC,EAAAC,EAAAC,wBASI,IAAAC,MAAAA,KAAAC,kCAIA,IAAAC,QAAAA,EAAAC,QAAAA,GAAAP,EACA,MAAAQ,EAAAC,wBAAAT,GACAU,EAAAC,gBAAAX,GAEAC,OAGIO,IACA,IAAAR,EAAAY,uBAE2BN,EAAAL,EAAAK,sBACAC,EAAAN,EAAAM,0BAI3BL,EAAAI,QAEJO,EAAAA,IAAA,IAAAP,gBAIA,GAAAQ,yBAGIC,EAAAA,oBAAAD,GAAA,CAEA,MAAAE,EAAAC,MAAAC,QAAAJ,GAAAA,EAAA,CAAAA,GACA,IAAAK,IAAAA,IAAAA,EAAAH,EAAAI,OAAAD,IAAA,4FAIQ,IAAAf,MAAAA,KAAAiB,EAAA,CACI,IAAAC,EAAAD,EAAAjB,GAEA,GAAAa,MAAAC,QAAAI,GAAA,CAQIA,EAAAA,IAFIA,EAAAF,YAKR,OAAAE,IACIC,EAAAnB,GAAAkB,GAGR,IAAAlB,MAAAA,KAAAoB,cASZ,OAAAD,CACJ,4BAEOE,GAAAzB,CAAAA,EAAA0B,KAGC,MAAAzB,EAAA0B,aAAAC,EAAAA,eACA1B,EAAAyB,aAAAE,EAAAA,iBACAC,EAAAA,IArGR,UAAAC,4BAAAA,EAAAC,kBAAAA,GAAAhC,EAAAC,EAAAC,GAmBI,MAVA,yCAWJ,CAiFQ+B,CAAAR,EAAAzB,EAAAC,EAAAC,GAEA,OAAAwB,EAAAI,IAAAI,EAAAA,YAAAJ"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),s=require("../html/use-props.mjs.js"),r=require("../svg/use-props.mjs.js"),t=require("./utils/filter-props.mjs.js"),i=require("./utils/is-svg-component.mjs.js"),o=require("../../../../../motion-dom/dist/es/value/utils/is-motion-value.mjs.js");exports.useRender=function(u,n,l,p,m){let{latestValues:j}=p,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const c=((arguments.length>6?arguments[6]:void 0)??i.isSVGComponent(u)?r.useSVGProps:s.useHTMLProps)(n,j,m,u),d=t.filterProps(n,"string"==typeof u,a),v=u!==e.Fragment?{...d,...c,ref:l}:{},{children:g}=n,f=e.useMemo(()=>o.isMotionValue(g)?g.get():g,[g]);return e.createElement(u,{...v,children:f})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),s=require("../html/use-props.mjs.js"),r=require("../svg/use-props.mjs.js"),t=require("./utils/filter-props.mjs.js"),i=require("./utils/is-svg-component.mjs.js"),o=require("../../../../../motion-dom/dist/es/value/utils/is-motion-value.mjs.js");exports.useRender=function(u,n,l,{latestValues:p},m,j=!1,a){const c=(a??i.isSVGComponent(u)?r.useSVGProps:s.useHTMLProps)(n,p,m,u),d=t.filterProps(n,"string"==typeof u,j),f=u!==e.Fragment?{...d,...c,ref:l}:{},{children:q}=n,v=e.useMemo(()=>o.isMotionValue(q)?q.get():q,[q]);return e.createElement(u,{...f,children:v})};
2
2
  //# sourceMappingURL=use-render.mjs.js.map