{"version":3,"file":"VimeoVideoSimple.DkQJbDu2.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/l3j95ictUi9Jb8X4HhVo/NEl5UATdz67pSpSlWXfy/VimeoVideoSimple.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function VimeoVideoAdvanced(props){const{videoId,defaultVolume=.3,showVolumeSlider=true}=props;const iframeRef=useRef(null);const[isMuted,setIsMuted]=useState(true);const[volume,setVolume]=useState(defaultVolume);const[player,setPlayer]=useState(null);const[isPlayerReady,setIsPlayerReady]=useState(false);const[showSlider,setShowSlider]=useState(false);useEffect(()=>{// Sprawdź czy Vimeo Player API już istnieje\nif(window.Vimeo){initPlayer();return;}// Jeśli nie ma, załaduj skrypt\nconst existingScript=document.querySelector('script[src=\"https://player.vimeo.com/api/player.js\"]');if(existingScript){existingScript.addEventListener(\"load\",initPlayer);return;}const script=document.createElement(\"script\");script.src=\"https://player.vimeo.com/api/player.js\";script.async=true;document.body.appendChild(script);script.onload=initPlayer;return()=>{if(script&&script.parentNode){script.removeEventListener(\"load\",initPlayer);}};},[videoId]);const initPlayer=()=>{if(iframeRef.current&&window.Vimeo){const vimeoPlayer=new window.Vimeo.Player(iframeRef.current);setPlayer(vimeoPlayer);vimeoPlayer.ready().then(()=>{setIsPlayerReady(true);vimeoPlayer.setVolume(0);vimeoPlayer.play().catch(error=>{console.log(\"Autoplay error:\",error);});});}};const toggleMute=()=>{if(player&&isPlayerReady){if(isMuted){player.setVolume(volume);setIsMuted(false);}else{player.setVolume(0);setIsMuted(true);}}};const handleVolumeChange=e=>{const newVolume=parseFloat(e.target.value);setVolume(newVolume);if(player&&isPlayerReady&&!isMuted){player.setVolume(newVolume);}// Jeśli volume > 0 i jest muted, auto-unmute\nif(newVolume>0&&isMuted){setIsMuted(false);if(player&&isPlayerReady){player.setVolume(newVolume);}}};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",backgroundColor:\"#000\"},children:[/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,src:`https://player.vimeo.com/video/${videoId}?autoplay=1&loop=1&autopause=0&muted=1&controls=0&title=0&byline=0&portrait=0`,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",border:\"none\"},allow:\"autoplay; fullscreen; picture-in-picture\",allowFullScreen:true}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",bottom:\"20px\",right:\"20px\",display:\"flex\",alignItems:\"center\",gap:\"12px\",zIndex:10},onMouseEnter:()=>showVolumeSlider&&setShowSlider(true),onMouseLeave:()=>showVolumeSlider&&setShowSlider(false),children:[showVolumeSlider&&showSlider&&/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:\"8px\",padding:\"8px 16px\",borderRadius:\"24px\",backgroundColor:\"rgba(0, 0, 0, 0.7)\",backdropFilter:\"blur(8px)\",transition:\"all 0.3s ease\"},children:[/*#__PURE__*/_jsxs(\"span\",{style:{color:\"white\",fontSize:\"12px\",fontWeight:\"500\",minWidth:\"35px\"},children:[Math.round(volume*100),\"%\"]}),/*#__PURE__*/_jsx(\"input\",{type:\"range\",min:\"0\",max:\"1\",step:\"0.01\",value:volume,onChange:handleVolumeChange,style:{width:\"100px\",height:\"4px\",borderRadius:\"2px\",outline:\"none\",background:`linear-gradient(to right, #fff 0%, #fff ${volume*100}%, rgba(255,255,255,0.3) ${volume*100}%, rgba(255,255,255,0.3) 100%)`,WebkitAppearance:\"none\",cursor:\"pointer\"}})]}),/*#__PURE__*/_jsx(\"button\",{onClick:toggleMute,\"aria-label\":isMuted?\"Włącz dźwięk\":\"Wyłącz dźwięk\",style:{width:\"48px\",height:\"48px\",borderRadius:\"50%\",backgroundColor:\"rgba(0, 0, 0, 0.6)\",border:\"2px solid rgba(255, 255, 255, 0.8)\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"all 0.2s ease\",backdropFilter:\"blur(4px)\",outline:\"none\"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=\"rgba(0, 0, 0, 0.8)\";e.currentTarget.style.transform=\"scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=\"rgba(0, 0, 0, 0.6)\";e.currentTarget.style.transform=\"scale(1)\";},children:isMuted||volume===0?// Ikona muted\n/*#__PURE__*/_jsxs(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"white\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M11 5L6 9H2v6h4l5 4V5z\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"23\",y1:\"9\",x2:\"17\",y2:\"15\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"17\",y1:\"9\",x2:\"23\",y2:\"15\"})]}):volume<.5?// Ikona low volume\n/*#__PURE__*/_jsxs(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"white\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M11 5L6 9H2v6h4l5 4V5z\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M15.54 8.46a5 5 0 0 1 0 7.07\"})]}):// Ikona high volume\n/*#__PURE__*/_jsxs(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"white\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M11 5L6 9H2v6h4l5 4V5z\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M15.54 8.46a5 5 0 0 1 0 7.07\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M19.07 4.93a10 10 0 0 1 0 14.14\"})]})})]}),/*#__PURE__*/_jsx(\"style\",{children:`\n                input[type=\"range\"]::-webkit-slider-thumb {\n                    -webkit-appearance: none;\n                    appearance: none;\n                    width: 14px;\n                    height: 14px;\n                    border-radius: 50%;\n                    background: white;\n                    cursor: pointer;\n                    border: 2px solid rgba(0, 0, 0, 0.2);\n                }\n                \n                input[type=\"range\"]::-moz-range-thumb {\n                    width: 14px;\n                    height: 14px;\n                    border-radius: 50%;\n                    background: white;\n                    cursor: pointer;\n                    border: 2px solid rgba(0, 0, 0, 0.2);\n                }\n            `})]});}// Property controls dla Framer\naddPropertyControls(VimeoVideoAdvanced,{videoId:{type:ControlType.String,title:\"Video ID\",defaultValue:\"1165296715\",placeholder:\"np. 1165296715\",description:\"ID video z Vimeo\"},defaultVolume:{type:ControlType.Number,title:\"Default Volume\",defaultValue:.3,min:0,max:1,step:.1,displayStepper:true,description:\"Początkowa głośność po unmute (0.0 - 1.0)\"},showVolumeSlider:{type:ControlType.Boolean,title:\"Show Volume Slider\",defaultValue:true,description:\"Pokaż suwak głośności przy hover\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VimeoVideoAdvanced\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VimeoVideoSimple.map"],"mappings":"6MAA0J,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,UAAQ,gBAAc,GAAG,mBAAiB,IAAM,EAAY,EAAUA,EAAO,KAAK,CAAM,CAAC,EAAQ,GAAYC,EAAS,GAAK,CAAM,CAAC,EAAO,GAAWA,EAAS,EAAc,CAAM,CAAC,EAAO,GAAWA,EAAS,KAAK,CAAM,CAAC,EAAc,GAAkBA,EAAS,GAAM,CAAM,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAC,MAAc,CACzhB,GAAG,EAAO,MAAM,CAAC,GAAY,CAAC,OAC9B,IAAM,EAAe,SAAS,cAAc,uDAAu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