/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@zoom-image/preact@0.3.32/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var core=require("@zoom-image/core"),hooks=require("preact/hooks");function noop(){}function useZoomImageWheel(){const e=hooks.useRef(),[o,t]=hooks.useState({currentZoom:1,enable:!1,currentPositionX:-1,currentPositionY:-1,currentRotation:0}),r=hooks.useCallback(((...o)=>{e.current?.cleanup(),e.current=core.createZoomImageWheel(...o),t(e.current.getState()),e.current.subscribe((({state:e})=>{t(e)}))}),[]);return hooks.useEffect((()=>()=>{e.current?.cleanup()}),[]),{createZoomImage:r,zoomImageState:o,setZoomImageState:e.current?.setState??noop}}function useZoomImageHover(){const e=hooks.useRef(),[o,t]=hooks.useState({enabled:!1,zoomedImgStatus:"idle"}),r=hooks.useCallback(((...o)=>{e.current?.cleanup(),e.current=core.createZoomImageHover(...o),t(e.current.getState()),e.current.subscribe((({state:e})=>{t(e)}))}),[]);return hooks.useEffect((()=>()=>{e.current?.cleanup()}),[]),{createZoomImage:r,zoomImageState:o,setZoomImageState:e.current?.setState??noop}}function useZoomImageMove(){const e=hooks.useRef(),[o,t]=hooks.useState({zoomedImgStatus:"idle"}),r=hooks.useCallback(((...o)=>{e.current?.cleanup(),e.current=core.createZoomImageMove(...o),t(e.current.getState()),e.current.subscribe((({state:e})=>{t(e)}))}),[]);return hooks.useEffect((()=>()=>{e.current?.cleanup()}),[]),{createZoomImage:r,zoomImageState:o}}function useZoomImageClick(){const e=hooks.useRef(),[o,t]=hooks.useState({zoomedImgStatus:"idle"}),r=hooks.useCallback(((...o)=>{e.current?.cleanup(),e.current=core.createZoomImageClick(...o),t(e.current.getState()),e.current.subscribe((({state:e})=>{t(e)}))}),[]);return hooks.useEffect((()=>()=>{e.current?.cleanup()}),[]),{createZoomImage:r,zoomImageState:o}}exports.useZoomImageClick=useZoomImageClick,exports.useZoomImageHover=useZoomImageHover,exports.useZoomImageMove=useZoomImageMove,exports.useZoomImageWheel=useZoomImageWheel;
//# sourceMappingURL=/sm/877068f429eb5cb928e66acdc8ccd0c58c8925f773efb0484e7e41d9ab6e241d.map