{"version":3,"file":"ArticleVideo.D91K9FEF.mjs","names":["__exportAll","c","init_jsx_runtime","addPropertyControls","init_framer_DcGZRLrs","ControlType","ArticleVideo_exports","__FramerMetadata__","ArticleVideo","toEmbed","u","url","vimeo","yt","embed","props","box","init_ArticleVideo","__esmMin","\"exports\"","\"default\"","\"type\"","\"name\"","\"slots\"","\"annotations\"","\"framerSupportedLayoutHeight\"","\"framerContractVersion\"","\"framerSupportedLayoutWidth\"","\"__FramerMetadata__\""],"sources":["https:/framerusercontent.com/modules/QfSC1dwcHzKxNsXuqso7/j3YDFPxFYD0LChhRzqRo/ArticleVideo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";// Responsive video for resource articles. Accepts a Vimeo, YouTube or direct video file URL\n// (for example a HubSpot-hosted .mp4) and renders it at 16:9, full width of the article column.\nfunction toEmbed(url){const u=String(url||\"\").trim();if(!u)return null;const vimeo=u.match(/vimeo\\.com\\/(?:video\\/)?(\\d+)(?:\\?h=(\\w+))?/i);if(vimeo)return{kind:\"iframe\",src:\"https://player.vimeo.com/video/\"+vimeo[1]+\"?\"+(vimeo[2]?\"h=\"+vimeo[2]+\"&\":\"\")+\"dnt=1&title=0&byline=0&portrait=0\"};const yt=u.match(/(?:youtube\\.com\\/(?:embed\\/|watch\\?v=)|youtu\\.be\\/)([\\w-]{6,})/i);if(yt)return{kind:\"iframe\",src:\"https://www.youtube-nocookie.com/embed/\"+yt[1]+\"?rel=0\"};if(/\\.(mp4|webm|mov)(\\?|$)/i.test(u))return{kind:\"file\",src:u};return{kind:\"iframe\",src:u};}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ArticleVideo(props){const embed=toEmbed(props.url);const box={position:\"relative\",width:\"100%\",aspectRatio:\"16 / 9\",background:\"#000\",margin:\"8px 0 24px\",...props.style};if(!embed)return /*#__PURE__*/_jsx(\"div\",{style:{...box,background:\"#EFF2EA\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontFamily:\"Inter, sans-serif\",fontSize:14,color:\"#958D92\"},children:\"Add a video URL\"});return /*#__PURE__*/_jsx(\"div\",{style:box,children:embed.kind===\"file\"?/*#__PURE__*/_jsx(\"video\",{src:embed.src,controls:true,preload:\"metadata\",playsInline:true,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",background:\"#000\"}}):/*#__PURE__*/_jsx(\"iframe\",{src:embed.src,title:props.title||\"Video\",allow:\"autoplay; fullscreen; picture-in-picture; encrypted-media\",allowFullScreen:true,loading:\"lazy\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:0}})});}addPropertyControls(ArticleVideo,{url:{type:ControlType.String,title:\"Video URL\",defaultValue:\"\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Video\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ArticleVideo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ArticleVideo.map"],"mappings":"A,gOAEA,SAASS,EAAQ,EAAI,CAAC,IAAMC,EAAE,OAAOC,GAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,CAACD,EAAE,OAAO,KAAK,IAAME,EAAMF,EAAE,MAAM,8CAA8C,EAAE,GAAGE,EAAM,MAAM,CAAC,KAAK,SAAS,IAAI,kCAAkCA,EAAM,GAAG,KAAKA,EAAM,GAAG,KAAKA,EAAM,GAAG,IAAI,IAAI,mCAAmC,EAAE,IAAMC,EAAGH,EAAE,MAAM,iEAAiE,EAA0J,OAArJG,EAAS,CAAC,KAAK,SAAS,IAAI,0CAA0CA,EAAG,GAAG,QAAQ,EAAK,0BAA0B,KAAKH,CAAC,EAAQ,CAAC,KAAK,OAAO,IAAIA,CAAC,EAA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