{"version":3,"file":"VideoPlayButton.BeUd7mBK.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","c","_e","de","init_framer_Bf4_tcb2","addPropertyControls","ControlType","VideoPlayButton","props","ref","hovered","setHovered","self","target","r","hoverArea","enter","leave","size","hoverFill","restFill","iconSize","iconColor","init_VideoPlayButton"],"sources":["https:/framerusercontent.com/modules/VJdZ2MTxGnMSl8E2tLCp/BlyzwASvUn4DUZtf5gH1/VideoPlayButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function VideoPlayButton(props){const{size,iconSize,iconColor,restFill,hoverFill,hoverArea}=props;const ref=useRef(null);const[hovered,setHovered]=useState(false);useEffect(()=>{const self=ref.current;if(!self)return;// Walk up to the first ancestor big enough to be the video\n// area, and listen for hover there.\nlet target=self.parentElement;while(target&&target!==document.body){const r=target.getBoundingClientRect();if(r.width>=hoverArea&&r.height>=hoverArea)break;target=target.parentElement;}if(!target||target===document.body)target=self;const enter=()=>setHovered(true);const leave=()=>setHovered(false);target.addEventListener(\"pointerenter\",enter);target.addEventListener(\"pointerleave\",leave);target.addEventListener(\"focusin\",enter);target.addEventListener(\"focusout\",leave);return()=>{target.removeEventListener(\"pointerenter\",enter);target.removeEventListener(\"pointerleave\",leave);target.removeEventListener(\"focusin\",enter);target.removeEventListener(\"focusout\",leave);};},[hoverArea]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,\"aria-hidden\":\"true\",style:{width:size,height:size,borderRadius:9999,background:hovered?hoverFill:restFill,transition:\"background-color 0.2s ease\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",style:{marginLeft:iconSize*.08},children:/*#__PURE__*/_jsx(\"path\",{d:\"M7 5.5v13a1 1 0 0 0 1.52.85l10.4-6.5a1 1 0 0 0 0-1.7L8.52 4.65A1 1 0 0 0 7 5.5Z\",stroke:iconColor,strokeWidth:1.5,strokeLinejoin:\"round\"})})});}VideoPlayButton.defaultProps={size:72,iconSize:26,iconColor:\"#FDFDFD\",restFill:\"rgba(253, 253, 253, 0.16)\",hoverFill:\"rgba(253, 253, 253, 0.36)\",hoverArea:200};addPropertyControls(VideoPlayButton,{size:{type:ControlType.Number,title:\"Size\",min:32,max:160,unit:\"px\"},iconSize:{type:ControlType.Number,title:\"Icon\",min:12,max:64,unit:\"px\"},iconColor:{type:ControlType.Color,title:\"Icon color\"},restFill:{type:ControlType.Color,title:\"Fill\"},hoverFill:{type:ControlType.Color,title:\"Hover fill\"},hoverArea:{type:ControlType.Number,title:\"Hover area min\",min:50,max:1e3,unit:\"px\",description:\"Hover triggers on the nearest parent at least this big (the video).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoPlayButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoPlayButton.map"],"mappings":"A,wLAGG,SAAwBY,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,WAAS,YAAU,WAAS,YAAU,aAAWC,EAAYC,EAAId,EAAO,IAAI,EAAO,CAACe,EAAQC,GAAYf,EAAS,EAAK,EAE8f,OAF5fG,MAAc,CAAC,IAAMa,EAAKH,EAAI,QAAQ,GAAG,CAACG,EAAK,OAEpO,IAAIC,EAAOD,EAAK,cAAc,KAAMC,GAAQA,IAAS,SAAS,MAAK,CAAC,IAAMC,EAAED,EAAO,sBAAsB,EAAE,GAAGC,EAAE,OAAOC,GAAWD,EAAE,QAAQC,EAAU,MAAM,EAAOF,EAAO,aA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