{"version":3,"file":"MuteToggle.DtimppHa.mjs","names":["useState","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/CSCh4osGekOQTDV1gcI7/plWxQp2QmACYjiJG4eyg/MuteToggle.js"],"sourcesContent":["// Mute/unmute speaker icon that toggles mute state of videos in the same container\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function MuteToggle(props){const{size=40,mutedColor=\"#FF5588\",unmutedColor=\"#000000\",backgroundColor=\"#FFFFFF\",showBackground=true,borderRadius=8}=props;const[isMuted,setIsMuted]=useState(false);const containerRef=useRef(null);const toggleMute=()=>{if(typeof window===\"undefined\")return;// Find the parent container\nconst container=containerRef.current?.closest(\"[data-framer-name]\")||containerRef.current?.parentElement;if(container){// Find all video elements in the same container\nconst videos=container.querySelectorAll(\"video\");videos.forEach(video=>{video.muted=!isMuted;});startTransition(()=>setIsMuted(!isMuted));}};// Check initial mute state of videos in container\nuseEffect(()=>{if(typeof window===\"undefined\")return;const container=containerRef.current?.closest(\"[data-framer-name]\")||containerRef.current?.parentElement;if(container){const videos=container.querySelectorAll(\"video\");if(videos.length>0){const firstVideo=videos[0];startTransition(()=>setIsMuted(firstVideo.muted));}}},[]);const iconColor=isMuted?mutedColor:unmutedColor;return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:size,height:size,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",backgroundColor:showBackground?backgroundColor:\"transparent\",borderRadius:borderRadius,transition:\"all 0.2s ease\",userSelect:\"none\"},onClick:toggleMute,role:\"button\",\"aria-label\":isMuted?\"Unmute\":\"Mute\",tabIndex:0,onKeyDown:e=>{if(e.key===\"Enter\"||e.key===\" \"){e.preventDefault();toggleMute();}},children:/*#__PURE__*/_jsx(\"svg\",{width:size*.6,height:size*.6,viewBox:\"0 0 24 24\",fill:\"none\",stroke:iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:isMuted?// Muted speaker icon with X\n/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"polygon\",{points:\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\",fill:iconColor}),/*#__PURE__*/_jsx(\"line\",{x1:\"23\",y1:\"9\",x2:\"17\",y2:\"15\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"17\",y1:\"9\",x2:\"23\",y2:\"15\"})]}):// Unmuted speaker icon with sound waves\n/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"polygon\",{points:\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\",fill:iconColor}),/*#__PURE__*/_jsx(\"path\",{d:\"M19.07 4.93a10 10 0 0 1 0 14.14\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M15.54 8.46a5 5 0 0 1 0 7.07\"})]})})});}addPropertyControls(MuteToggle,{size:{type:ControlType.Number,title:\"Size\",defaultValue:40,min:20,max:80,step:1,unit:\"px\"},mutedColor:{type:ControlType.Color,title:\"Muted Color\",defaultValue:\"#FF5588\"},unmutedColor:{type:ControlType.Color,title:\"Unmuted Color\",defaultValue:\"#000000\"},showBackground:{type:ControlType.Boolean,title:\"Background\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#FFFFFF\",hidden:({showBackground})=>!showBackground},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:20,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MuteToggle\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\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