{"version":3,"file":"OptionalVideo.BKblMMbH.mjs","names":["__esmMin","c","init_jsx_runtime","addPropertyControls","RenderTarget","ControlType","init_framer_BWFVvmND","embedSrc","url","raw","yt","vimeo","OptionalVideo","props","media","link","isCanvas","hint","text","coverImg","cover","radius","mode","frame","init_OptionalVideo"],"sources":["https:/framerusercontent.com/modules/qC0hX54APsbjp5aluj9g/13kFoD2wbTp3fm2o05ru/OptionalVideo.js"],"sourcesContent":["// Case-study media slots. Two modes:\n//  - \"lead\" (default): renders a 16:9 customer video when a URL is present,\n//    otherwise the cover image (3:2), otherwise nothing (zero height).\n//  - \"midCover\": renders the cover image (3:2) ONLY when a video URL is set\n//    (the cover's mid-article home on video pages), otherwise nothing.\n// Supports YouTube, Vimeo, HubSpot video, and direct mp4 URLs.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";function embedSrc(raw){const url=(raw||\"\").trim();if(!url)return null;const yt=url.match(/(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/)([\\w-]{6,})/);if(yt)return{type:\"iframe\",src:`https://www.youtube.com/embed/${yt[1]}`};const vimeo=url.match(/vimeo\\.com\\/(\\d+)/);if(vimeo)return{type:\"iframe\",src:`https://player.vimeo.com/video/${vimeo[1]}`};if(/\\.(mp4|webm|mov)(\\?|$)/i.test(url))return{type:\"video\",src:url};if(/^https?:\\/\\//.test(url))return{type:\"iframe\",src:url};return null;}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function OptionalVideo(props){const{url=\"\",link=\"\",radius=12,cover,mode=\"lead\"}=props;const media=embedSrc(link||url);const isCanvas=RenderTarget.current()===RenderTarget.canvas;const hint=text=>/*#__PURE__*/_jsx(\"div\",{style:{padding:\"6px 10px\",fontSize:11,fontFamily:\"Inter, sans-serif\",color:\"#8A8A8A\",background:\"#F5F3F1\",borderRadius:6,whiteSpace:\"nowrap\"},children:text});const coverImg=cover&&cover.src?/*#__PURE__*/_jsx(\"img\",{src:cover.src,srcSet:cover.srcSet,alt:cover.alt||\"\",style:{...props.style,width:\"100%\",aspectRatio:\"3 / 2\",objectFit:\"cover\",borderRadius:`${radius}px`,display:\"block\",background:\"#F5F3F1\"}}):null;const isMidCover=mode===\"midCover\"||mode===\"Mid-article cover\";if(isMidCover){if(media&&coverImg)return coverImg;if(isCanvas)return hint(\"Mid-article cover (hidden — shows only when a video URL is set)\");return null;}if(!media){if(coverImg)return coverImg;if(isCanvas)return hint(\"Lead media (hidden — no video URL or cover image set)\");return null;}const frame={...props.style,width:\"100%\",aspectRatio:\"16 / 9\",borderRadius:`${radius}px`,overflow:\"hidden\",background:\"#262626\"};if(media.type===\"video\")return /*#__PURE__*/_jsx(\"video\",{src:media.src,controls:true,playsInline:true,style:{...frame,objectFit:\"cover\"}});return /*#__PURE__*/_jsx(\"iframe\",{src:media.src,style:{...frame,border:\"none\",display:\"block\"},allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\",allowFullScreen:true,title:\"Customer video\"});}addPropertyControls(OptionalVideo,{url:{type:ControlType.String,title:\"Video URL\",description:\"YouTube, Vimeo, embed, or mp4 URL. Empty = falls back to the cover image.\"},link:{type:ControlType.Link,title:\"Video Link\",description:\"Optional link (bindable to CMS link fields). Takes precedence over Video URL.\"},cover:{type:ControlType.ResponsiveImage,title:\"Cover Image\",description:\"Lead mode: shown (3:2) when no video URL. Mid-article mode: shown only WITH a video URL.\"},mode:{type:ControlType.Enum,title:\"Mode\",options:[\"lead\",\"midCover\"],optionTitles:[\"Lead media\",\"Mid-article cover\"],defaultValue:\"lead\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:12,min:0,max:24,step:2,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"OptionalVideo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"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