{"version":3,"file":"VideoButton.BkQuC66l.mjs","names":["videoId"],"sources":["https:/framerusercontent.com/modules/qocbKKZPr1xgBC57i5yM/oH7a0MP4wp4i67iebOiM/VideoButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useState,useRef}from\"react\";import{Icon,useVideoStore,getVideoId}from\"https://framerusercontent.com/modules/6ffgsaDzsjdxRp9dCkQD/MorESSBKyWuMljhmD7Xu/VideoFrameShared.js\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 40\n * @framerIntrinsicHeight 40\n * @framerDisableUnlink\n */export default function VideoButton(props){var _state_videoRef,_state_playerRef;const{type,skipTime}=props;const[videoState,setVideoState]=useVideoStore();const[videoId,setVideoId]=useState(null);const state=videoState[videoId];const ref=useRef(null);const videoRef=state===null||state===void 0?void 0:(_state_videoRef=state.videoRef)===null||_state_videoRef===void 0?void 0:_state_videoRef.current;const playerRef=state===null||state===void 0?void 0:(_state_playerRef=state.playerRef)===null||_state_playerRef===void 0?void 0:_state_playerRef.current;useEffect(()=>{setVideoState({});},[]);useEffect(()=>{const videoId=getVideoId(ref.current);setVideoId(videoId);},[ref]);let icon=null;let defaultIcon=null;let onClick=null;switch(type){case\"play\":icon=(state===null||state===void 0?void 0:state.playing)?props.pauseIcon:props.playIcon;defaultIcon=(state===null||state===void 0?void 0:state.playing)?`url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='currentColor' class='icon icon-tabler icons-tabler-filled icon-tabler-player-pause'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M9 4h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h2a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2z' /%3E%3Cpath d='M17 4h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h2a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2z' /%3E%3C/svg%3E\")`:`url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='currentColor' class='icon icon-tabler icons-tabler-filled icon-tabler-player-play'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z' /%3E%3C/svg%3E\")`;onClick=()=>{if(state===null||state===void 0?void 0:state.setPlaying){state.setPlaying(!state.playing);}};break;case\"fullscreen\":icon=props.fullscreenIcon;defaultIcon=`url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-arrows-maximize'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M16 4l4 0l0 4' /%3E%3Cpath d='M14 10l6 -6' /%3E%3Cpath d='M8 20l-4 0l0 -4' /%3E%3Cpath d='M4 20l6 -6' /%3E%3Cpath d='M16 20l4 0l0 -4' /%3E%3Cpath d='M14 14l6 6' /%3E%3Cpath d='M8 4l-4 0l0 4' /%3E%3Cpath d='M4 4l6 6' /%3E%3C/svg%3E\")`;onClick=()=>{if(state===null||state===void 0?void 0:state.setFullscreen){state.setFullscreen(!state.fullscreen);}};break;case\"skipForward\":icon=props.skipIcon;defaultIcon=`url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-reload'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747' /%3E%3Cpath d='M20 4v5h-5' /%3E%3C/svg%3E\")`;onClick=()=>{if(state===null||state===void 0?void 0:state.setTime){state.setTime(state.getTime()+skipTime);}};break;case\"skipBackward\":icon=props.skipIcon;defaultIcon=`url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.06694 13.041C4.25577 14.4809 4.83302 15.8423 5.73677 16.9792C6.64053 18.116 7.83669 18.9853 9.19698 19.494C10.5573 20.0027 12.0304 20.1315 13.4583 19.8666C14.8862 19.6017 16.2151 18.953 17.3024 17.9903C18.3897 17.0275 19.1944 15.787 19.6303 14.4016C20.0661 13.0163 20.1166 11.5384 19.7764 10.1266C19.4361 8.7147 18.718 7.42208 17.699 6.38734C16.6799 5.3526 15.3984 4.61477 13.9919 4.25298C10.0929 3.25298 6.05694 5.25998 4.56694 8.99998' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M4 4V9H9' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A\")`;onClick=()=>{if(state===null||state===void 0?void 0:state.setTime){state.setTime(state.getTime()-skipTime);}};break;case\"mute\":icon=(state===null||state===void 0?void 0:state.muted)?props.unmuteIcon:props.muteIcon;defaultIcon=(state===null||state===void 0?void 0:state.muted)?`url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-volume-off'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M15 8a5 5 0 0 1 1.912 4.934m-1.377 2.602a5 5 0 0 1 -.535 .464' /%3E%3Cpath d='M17.7 5a9 9 0 0 1 2.362 11.086m-1.676 2.299a9 9 0 0 1 -.686 .615' /%3E%3Cpath d='M9.069 5.054l.431 -.554a.8 .8 0 0 1 1.5 .5v2m0 4v8a.8 .8 0 0 1 -1.5 .5l-3.5 -4.5h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l1.294 -1.664' /%3E%3Cpath d='M3 3l18 18' /%3E%3C/svg%3E\")`:`url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-volume'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M15 8a5 5 0 0 1 0 8' /%3E%3Cpath d='M17.7 5a9 9 0 0 1 0 14' /%3E%3Cpath d='M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a.8 .8 0 0 1 1.5 .5v14a.8 .8 0 0 1 -1.5 .5l-3.5 -4.5' /%3E%3C/svg%3E\")`;onClick=()=>{if(state===null||state===void 0?void 0:state.setMuted){state.setMuted(!state.muted);}};break;case\"pictureInPicture\":icon=props.pictureInPictureIcon;defaultIcon=`url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-picture-in-picture'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M11 19h-6a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4' /%3E%3Cpath d='M14 14m0 1a1 1 0 0 1 1 -1h5a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-5a1 1 0 0 1 -1 -1z' /%3E%3C/svg%3E\")`;onClick=()=>{if(state===null||state===void 0?void 0:state.setPiP){state.setPiP(!state.pip);}};break;case\"restart\":icon=props.restartIcon;defaultIcon=`url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='currentColor' class='icon icon-tabler icons-tabler-filled icon-tabler-player-track-prev'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M20.341 4.247l-8 7a1 1 0 0 0 0 1.506l8 7c.647 .565 1.659 .106 1.659 -.753v-14c0 -.86 -1.012 -1.318 -1.659 -.753z' /%3E%3Cpath d='M9.341 4.247l-8 7a1 1 0 0 0 0 1.506l8 7c.647 .565 1.659 .106 1.659 -.753v-14c0 -.86 -1.012 -1.318 -1.659 -.753z' /%3E%3C/svg%3E\")`;onClick=()=>{if(state===null||state===void 0?void 0:state.setTime){state.setTime(0);}};break;case\"toggleLoop\":icon=(state===null||state===void 0?void 0:state.loop)?props.loopOnIcon:props.loopOffIcon;defaultIcon=(state===null||state===void 0?void 0:state.loop)?`url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-repeat'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3' /%3E%3Cpath d='M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3' /%3E%3C/svg%3E\")`:`url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-repeat-off'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M4 12v-3c0 -1.336 .873 -2.468 2.08 -2.856m3.92 -.144h10m-3 -3l3 3l-3 3' /%3E%3Cpath d='M20 12v3a3 3 0 0 1 -.133 .886m-1.99 1.984a3 3 0 0 1 -.877 .13h-13m3 3l-3 -3l3 -3' /%3E%3Cpath d='M3 3l18 18' /%3E%3C/svg%3E\")`;onClick=()=>{if(state===null||state===void 0?void 0:state.setLoop){state.setLoop(!state.loop);}};break;}return /*#__PURE__*/_jsx(\"div\",{\"data-videoframe\":true,ref:ref,onMouseEnter:props.hoverEvent,onClick:()=>{var _props_clickEvent;onClick===null||onClick===void 0?void 0:onClick();(_props_clickEvent=props.clickEvent)===null||_props_clickEvent===void 0?void 0:_props_clickEvent.call(props);},style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",...props.style},children:/*#__PURE__*/_jsx(Icon,{image:icon,color:props.iconColor,size:props.iconSize,defaultImage:defaultIcon})});}VideoButton.displayName=\"Video Button\";addPropertyControls(VideoButton,{type:{type:ControlType.Enum,defaultValue:\"play\",options:[\"play\",\"fullscreen\",\"skipForward\",\"skipBackward\",\"mute\",\"pictureInPicture\",\"restart\",\"toggleLoop\"],optionTitles:[\"Play/Pause\",\"Fullscreen\",\"Skip Forward\",\"Skip Backward\",\"Mute\",\"Picture-in-Picture\",\"Restart\",\"Toggle Loop\"],title:\"Action\"},skipTime:{type:ControlType.Number,defaultValue:10,min:1,step:1,displayStepper:true,unit:\"s\",title:\"Time\",hidden:props=>props.type!==\"skipForward\"&&props.type!==\"skipBackward\"},playIcon:{type:ControlType.ResponsiveImage,hidden:props=>props.type!==\"play\"},pauseIcon:{type:ControlType.ResponsiveImage,hidden:props=>props.type!==\"play\"},fullscreenIcon:{type:ControlType.ResponsiveImage,title:\"Fullscreen\",hidden:props=>props.type!==\"fullscreen\"},minimizeIcon:{type:ControlType.ResponsiveImage,title:\"Minimize\",hidden:props=>props.type!==\"fullscreen\"},skipIcon:{type:ControlType.ResponsiveImage,title:\"Icon\",hidden:props=>props.type!==\"skipForward\"&&props.type!==\"skipBackward\"},muteIcon:{type:ControlType.ResponsiveImage,title:\"Mute\",hidden:props=>props.type!==\"mute\"},unmuteIcon:{type:ControlType.ResponsiveImage,title:\"Unmute\",hidden:props=>props.type!==\"mute\"},pictureInPictureIcon:{type:ControlType.ResponsiveImage,title:\"Icon\",hidden:props=>props.type!==\"pictureInPicture\"},restartIcon:{type:ControlType.ResponsiveImage,title:\"Icon\",hidden:props=>props.type!==\"restart\"},loopOnIcon:{type:ControlType.ResponsiveImage,title:\"Loop On\",hidden:props=>props.type!==\"toggleLoop\"},loopOffIcon:{type:ControlType.ResponsiveImage,title:\"Loop Off\",hidden:props=>props.type!==\"toggleLoop\"},iconColor:{type:ControlType.Color,defaultValue:\"#FFF\",optional:true},iconSize:{type:ControlType.Number,defaultValue:20,min:1,step:1,displayStepper:true},hoverEvent:{type:ControlType.EventHandler,title:\"Hover\"},clickEvent:{type:ControlType.EventHandler,title:\"Click\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"40\",\"framerIntrinsicHeight\":\"40\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"wYAMG,SAAwB,EAAY,EAAM,CAAC,IAAI,EAAgB,EAAiB,GAAK,CAAC,OAAK,WAAS,CAAC,EAAW,CAAC,EAAW,EAAc,CAAC,GAAe,CAAM,CAAC,EAAQ,EAAW,CAAC,EAAS,KAAK,CAAO,EAAM,EAAW,GAAe,EAAI,EAAO,KAAK,CAAO,EAAS,GAAQ,SAA0B,IAAG,EAAgB,EAAM,WAAkE,QAAc,EAAU,GAAQ,SAA0B,IAAG,EAAiB,EAAM,YAAqE,QAA+C,AAAvC,EAAU,IAAI,CAAC,EAAc,CAAE,EAA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