{"version":3,"file":"PandaVideo.DKA3uACy.mjs","names":["useState","useRef","useMemo"],"sources":["https:/framerusercontent.com/modules/cOEf89z1BqRrLTCQBrdG/Vu8ORJdSIIs5u9FAGssy/PandaVideo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo,useState,useEffect,useRef}from\"react\";// Global tracking for currently playing video\nlet currentPlayingId=null;const PLAYING_EVENT=\"pandavideo-playing\";/**\n * Panda Video Player\n *\n * Embed videos from Panda Video platform.\n *\n * @framerIntrinsicWidth 720\n * @framerIntrinsicHeight 360\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function PandaVideo(props){const{videoId=\"e842a6dd-ee72-43d2-9e79-6849cc05fb35\",autoplay=false,muted=false,loop=false,showControls=true,borderRadius=0,thumbnail={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Video thumbnail\"}}=props;const[isPlaying,setIsPlaying]=useState(false);const instanceId=useRef(Math.random().toString(36).substr(2,9));// Listen for other videos starting to play\nuseEffect(()=>{const handleOtherVideoPlaying=e=>{if(e.detail!==instanceId.current&&isPlaying){setIsPlaying(false);}};window.addEventListener(PLAYING_EVENT,handleOtherVideoPlaying);return()=>{window.removeEventListener(PLAYING_EVENT,handleOtherVideoPlaying);};},[isPlaying]);// Cleanup when unmounting\nuseEffect(()=>{return()=>{if(currentPlayingId===instanceId.current){currentPlayingId=null;}};},[]);const src=useMemo(()=>{const params=new URLSearchParams;params.append(\"v\",videoId);if(autoplay||isPlaying)params.append(\"autoplay\",\"1\");if(muted)params.append(\"muted\",\"1\");if(loop)params.append(\"loop\",\"1\");if(!showControls)params.append(\"controls\",\"0\");return`https://player-vz-879ba9af-649.tv.pandavideo.com/embed/?${params.toString()}`;},[videoId,autoplay,muted,loop,showControls,isPlaying]);const isFixedWidth=props?.style?.width===\"100%\";const isFixedHeight=props?.style?.height===\"100%\";const handlePlay=()=>{// Stop any other playing video\nif(currentPlayingId&&currentPlayingId!==instanceId.current){window.dispatchEvent(new CustomEvent(PLAYING_EVENT,{detail:instanceId.current}));}currentPlayingId=instanceId.current;setIsPlaying(true);};return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:isFixedHeight?\"100%\":\"100%\",borderRadius,overflow:\"hidden\",...props.style},children:!isPlaying?/*#__PURE__*/_jsx(\"div\",{onClick:handlePlay,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",cursor:\"pointer\",backgroundImage:`url(${thumbnail.src})`,backgroundSize:\"cover\",backgroundPosition:\"center\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"div\",{style:{width:80,height:80,borderRadius:\"50%\",backgroundColor:\"rgba(0, 0, 0, 0.7)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"transform 0.2s ease, background-color 0.2s ease\"},onMouseEnter:e=>{e.currentTarget.style.transform=\"scale(1.1)\";e.currentTarget.style.backgroundColor=\"rgba(0, 0, 0, 0.9)\";},onMouseLeave:e=>{e.currentTarget.style.transform=\"scale(1)\";e.currentTarget.style.backgroundColor=\"rgba(0, 0, 0, 0.7)\";},children:/*#__PURE__*/_jsx(\"svg\",{width:\"32\",height:\"32\",viewBox:\"0 0 24 24\",fill:\"white\",style:{marginLeft:4},children:/*#__PURE__*/_jsx(\"polygon\",{points:\"5,3 19,12 5,21\"})})})}):/*#__PURE__*/_jsx(\"iframe\",{src:src,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",border:\"none\"},allow:\"accelerometer;gyroscope;autoplay;encrypted-media;picture-in-picture\",allowFullScreen:true,title:\"Panda Video Player\"})});}addPropertyControls(PandaVideo,{videoId:{type:ControlType.String,title:\"Video ID\",defaultValue:\"e842a6dd-ee72-43d2-9e79-6849cc05fb35\",placeholder:\"e842a6dd-ee72-43d2-9e79-6849cc05fb35\",description:\"The Panda Video ID from your embed code\"},thumbnail:{type:ControlType.ResponsiveImage,title:\"Thumbnail\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:0,min:0,max:100,step:1,unit:\"px\"},autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},muted:{type:ControlType.Boolean,title:\"Muted\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},showControls:{type:ControlType.Boolean,title:\"Show Controls\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"}});PandaVideo.displayName=\"Panda Video\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PandaVideo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"360\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"720\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PandaVideo.map"],"mappings":"6MAWG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,UAAQ,uCAAuC,WAAS,GAAM,QAAM,GAAM,OAAK,GAAM,eAAa,GAAK,eAAa,EAAE,YAAU,CAAC,IAAI,sEAAsE,IAAI,kBAAkB,EAAE,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAWC,EAAO,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CACzY,MAAc,CAAC,IAAM,EAAwB,GAAG,CAAI,EAAE,SAAS,EAAW,SAAS,GAAW,EAAa,GAAM,EAAmE,OAA/D,EAAO,iBAAiB,EAAc,EAAwB,KAAW,CAAC,EAAO,oBAAoB,EAAc,EAAwB,GAAK,CAAC,EAAU,CAA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