{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/I9lXkW66zoM9puY31w6w/ZeUWygJM8co15iZoqtPP/PlaySound.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useEffect}from\"react\";const soundUrls={click:\"https://cdn.obsgroup.tech/click.wav\",error:\"https://cdn.obsgroup.tech/error.wav\",open:\"https://cdn.obsgroup.tech/open.wav\",close:\"https://cdn.obsgroup.tech/close.wav\",forward:\"https://cdn.obsgroup.tech/forward.wav\",back:\"https://cdn.obsgroup.tech/back.wav\"};function useSound(url){const audioRef=useRef(null);useEffect(()=>{if(typeof window!==\"undefined\"){// Only initialize the audio element on the client-side\naudioRef.current=new Audio(url);}},[url]);return audioRef.current;}function isTouchDevice(){if(typeof window===\"undefined\"){return false// Return false during SSR as no touch events can be detected on the server\n;}return\"ontouchstart\"in window;}export function withError(Component){return props=>{const clickSound=useSound(soundUrls.click);const errorSound=useSound(soundUrls.error);const handleStart=()=>clickSound===null||clickSound===void 0?void 0:clickSound.play();const handleEnd=()=>errorSound===null||errorSound===void 0?void 0:errorSound.play();const events=isTouchDevice()?{onTouchStart:handleStart,onTouchEnd:handleEnd}:{onMouseDown:handleStart,onMouseUp:handleEnd};return /*#__PURE__*/_jsx(Component,{...props,...events});};}export function withFigure(Component){return props=>{const clickSound=useSound(soundUrls.click);const openSound=useSound(soundUrls.open);const handleStart=()=>clickSound===null||clickSound===void 0?void 0:clickSound.play();const handleEnd=()=>openSound===null||openSound===void 0?void 0:openSound.play();const events=isTouchDevice()?{onTouchStart:handleStart,onTouchEnd:handleEnd}:{onMouseDown:handleStart,onMouseUp:handleEnd};return /*#__PURE__*/_jsx(Component,{...props,...events});};}export function withLeave(Component){return props=>{const closeSound=useSound(soundUrls.close);const handleEnd=()=>closeSound===null||closeSound===void 0?void 0:closeSound.play();const events=isTouchDevice()?{onTouchEnd:handleEnd}:{onMouseUp:handleEnd};return /*#__PURE__*/_jsx(Component,{...props,...events});};}export function withForward(Component){return props=>{const forwardSound=useSound(soundUrls.forward);const handleEnd=()=>forwardSound===null||forwardSound===void 0?void 0:forwardSound.play();const events=isTouchDevice()?{onTouchEnd:handleEnd}:{onMouseUp:handleEnd};return /*#__PURE__*/_jsx(Component,{...props,...events});};}export function withBack(Component){return props=>{const backSound=useSound(soundUrls.back);const handleEnd=()=>backSound===null||backSound===void 0?void 0:backSound.play();const events=isTouchDevice()?{onTouchEnd:handleEnd}:{onMouseUp:handleEnd};return /*#__PURE__*/_jsx(Component,{...props,...events});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withLeave\":{\"type\":\"reactHoc\",\"name\":\"withLeave\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFigure\":{\"type\":\"reactHoc\",\"name\":\"withFigure\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withError\":{\"type\":\"reactHoc\",\"name\":\"withError\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBack\":{\"type\":\"reactHoc\",\"name\":\"withBack\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withForward\":{\"type\":\"reactHoc\",\"name\":\"withForward\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PlaySound.map"],
  "mappings": "8IAAAA,IAA+E,IAAMC,EAAU,CAAC,MAAM,sCAAsC,MAAM,sCAAsC,KAAK,qCAAqC,MAAM,sCAAsC,QAAQ,wCAAwC,KAAK,oCAAoC,EAAE,SAASC,EAASC,EAAI,CAAC,IAAMC,EAASC,EAAO,IAAI,EAAE,OAAAC,EAAU,IAAI,CAAI,OAAO,OAAS,MAC9bF,EAAS,QAAQ,IAAI,MAAMD,CAAG,EAAG,EAAE,CAACA,CAAG,CAAC,EAASC,EAAS,OAAQ,CAAC,SAASG,GAAe,CAAC,OAAG,OAAO,OAAS,IAAoB,GAC3H,iBAAiB,MAAO,CAAmf,SAASC,EAAWC,EAAU,CAAC,OAAOC,GAAO,CAAC,IAAMC,EAAWC,EAASC,EAAU,KAAK,EAAQC,EAAUF,EAASC,EAAU,IAAI,EAAQE,EAAY,IAAkDJ,GAAW,KAAK,EAAQK,EAAU,IAAgDF,GAAU,KAAK,EAAQG,EAAOC,EAAc,EAAE,CAAC,aAAaH,EAAY,WAAWC,CAAS,EAAE,CAAC,YAAYD,EAAY,UAAUC,CAAS,EAAE,OAAoBG,EAAKV,EAAU,CAAC,GAAGC,EAAM,GAAGO,CAAM,CAAC,CAAE,CAAE,CAAQ,SAASG,EAAUX,EAAU,CAAC,OAAOC,GAAO,CAAC,IAAMW,EAAWT,EAASC,EAAU,KAAK,EAAQG,EAAU,IAAkDK,GAAW,KAAK,EAAQJ,EAAOC,EAAc,EAAE,CAAC,WAAWF,CAAS,EAAE,CAAC,UAAUA,CAAS,EAAE,OAAoBG,EAAKV,EAAU,CAAC,GAAGC,EAAM,GAAGO,CAAM,CAAC,CAAE,CAAE,CAAQ,SAASK,EAAYb,EAAU,CAAC,OAAOC,GAAO,CAAC,IAAMa,EAAaX,EAASC,EAAU,OAAO,EAAQG,EAAU,IAAsDO,GAAa,KAAK,EAAQN,EAAOC,EAAc,EAAE,CAAC,WAAWF,CAAS,EAAE,CAAC,UAAUA,CAAS,EAAE,OAAoBG,EAAKV,EAAU,CAAC,GAAGC,EAAM,GAAGO,CAAM,CAAC,CAAE,CAAE,CAAQ,SAASO,EAASf,EAAU,CAAC,OAAOC,GAAO,CAAC,IAAMe,EAAUb,EAASC,EAAU,IAAI,EAAQG,EAAU,IAAgDS,GAAU,KAAK,EAAQR,EAAOC,EAAc,EAAE,CAAC,WAAWF,CAAS,EAAE,CAAC,UAAUA,CAAS,EAAE,OAAoBG,EAAKV,EAAU,CAAC,GAAGC,EAAM,GAAGO,CAAM,CAAC,CAAE,CAAE",
  "names": ["init_ssg_sandbox_shims", "soundUrls", "useSound", "url", "audioRef", "pe", "ue", "isTouchDevice", "withFigure", "Component", "props", "clickSound", "useSound", "soundUrls", "openSound", "handleStart", "handleEnd", "events", "isTouchDevice", "p", "withLeave", "closeSound", "withForward", "forwardSound", "withBack", "backSound"]
}
