{"version":3,"file":"YoutubeEmbed.CeDb1sag.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/H5zz2d6dufOoIzeD21CR/BfL4cUGu7gJgXCp4KbAE/YoutubeEmbed.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function YouTubeEmbed(props){const{videoId,bannerUrl,autoplay,mute,controls,loop,variantTrigger,pointer,object}=props;const hasPoster=Boolean(bannerUrl);const[showVideo,setShowVideo]=React.useState(!hasPoster);const[internalKey,setInternalKey]=React.useState(0);React.useEffect(()=>{setShowVideo(!hasPoster);setInternalKey(prev=>prev+1);},[variantTrigger,hasPoster]);const params=new URLSearchParams({autoplay:autoplay?\"1\":\"0\",mute:mute?\"1\":\"0\",controls:controls?\"1\":\"0\",loop:loop?\"1\":\"0\",playlist:loop?videoId:\"\"}).toString();return /*#__PURE__*/_jsxs(\"div\",{children:[!showVideo&&hasPoster&&/*#__PURE__*/_jsx(\"img\",{src:bannerUrl,alt:\"Banner V\\xeddeo\",onClick:()=>setShowVideo(true),style:{width:\"100%\",height:\"100%\",aspectRatio:\"2 / 1\",objectFit:`${object}`,cursor:\"pointer\"}}),showVideo&&/*#__PURE__*/_jsx(\"iframe\",{style:{width:\"100%\",height:\"100%\",border:\"none\",aspectRatio:\"2 / 1\",pointerEvents:pointer?\"auto\":\"none\"},src:`https://www.youtube.com/embed/${videoId}?rel=0&${params}`,allow:\"autoplay; encrypted-media; picture-in-picture\",allowFullScreen:true},internalKey)]});}addPropertyControls(YouTubeEmbed,{variantTrigger:{title:\"Variant Trigger\",type:ControlType.String,defaultValue:\"A\"},videoId:{title:\"Video ID\",type:ControlType.String,defaultValue:\"8AHPXm9Y6mI\"},bannerUrl:{title:\"Banner Image ID\",type:ControlType.String,defaultValue:\"\"},autoplay:{title:\"Autoplay\",type:ControlType.Boolean,defaultValue:true},mute:{title:\"Mute\",type:ControlType.Boolean,defaultValue:true},controls:{title:\"Controls\",type:ControlType.Boolean,defaultValue:false},loop:{title:\"Loop\",type:ControlType.Boolean,defaultValue:true},pointer:{title:\"Pointer Events\",type:ControlType.Boolean,defaultValue:false},object:{title:\"Object Fit\",type:ControlType.String,defaultValue:\"cover\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"YouTubeEmbed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./YoutubeEmbed.map"],"mappings":"wLAAyI,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,UAAQ,YAAU,WAAS,OAAK,WAAS,OAAK,iBAAe,UAAQ,UAAQ,EAAY,EAAU,EAAQ,EAAgB,CAAC,EAAU,GAAcA,EAAe,CAAC,EAAU,CAAM,CAAC,EAAY,GAAgBA,EAAe,EAAE,CAAC,MAAoB,CAAC,EAAa,CAAC,EAAU,CAAC,EAAe,GAAM,EAAK,EAAE,EAAG,CAAC,EAAe,EAAU,CAAC,CAAC,IAAM,EAAO,IAAI,gBAAgB,CAAC,SAAS,EAAS,IAAI,IAAI,KAAK,EAAK,IAAI,IAAI,SAAS,EAAS,IAAI,IAAI,KAAK,EAAK,IAAI,IAAI,SAAS,EAAK,EAAQ,GAAG,CAAC,CAAC,UAAU,CAAC,OAAoB,EAAM,MAAM,CAAC,SAAS,CAAC,CAAC,GAAW,GAAwB,EAAK,MAAM,CAAC,IAAI,EAAU,IAAI,eAAkB,YAAY,EAAa,GAAK,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,YAAY,QAAQ,UAAU,GAAG,IAAS,OAAO,UAAU,CAAC,CAAC,CAAC,GAAwB,EAAK,SAAS,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,OAAO,OAAO,YAAY,QAAQ,cAAc,EAAQ,OAAO,OAAO,CAAC,IAAI,iCAAiC,EAAQ,SAAS,IAAS,MAAM,gDA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