{"version":3,"file":"VideoSchema.BHv4XN_z.mjs","names":["useMemo","__esmMin","pe","c","init_jsx_runtime","init_npm_react_18_3_1","addPropertyControls","init_framer_D1IzEvwH","ControlType","VideoSchema","toSafeString","value","candidate","rawName","rawDescription","rawThumbnailUrl","rawUploadDate","rawContentUrl","rawEmbedUrl","rawDuration","props","name","description","thumbnailUrl","uploadDate","contentUrl","embedUrl","duration","normalizedUploadDate","trimmed","schemaJson","videoObject","init_VideoSchema"],"sources":["https:/framerusercontent.com/modules/QrstHRZnqgoxsgH7Mxwe/rR5bDsN4xbbhC1bGkbSQ/VideoSchema.js"],"sourcesContent":["/**\n * User request:\n * Create a new Framer code component named \"VideoSchema\".\n * Purpose: output SEO structured data (JSON-LD) for a single video on CMS detail pages.\n * Render only an invisible/zero-footprint <script type=\"application/ld+json\"> tag with a schema.org VideoObject.\n * Render on static export (SSR) by outputting the script directly in JSX.\n * Omit fields whose values are empty.\n * Expose string property controls for:\n * name, description, thumbnailUrl, uploadDate, contentUrl, embedUrl, duration.\n * Normalize uploadDate when it is only a year (e.g. \"2025\" -> \"2025-01-01\").\n * Keep minimal and dependency-free.\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function VideoSchema(props){const toSafeString=value=>{if(value===null||value===undefined)return\"\";if(typeof value===\"string\")return value;if(typeof value===\"number\"||typeof value===\"boolean\"){return String(value);}if(typeof value===\"object\"){const candidate=value;if(typeof candidate.src===\"string\")return candidate.src;if(typeof candidate.url===\"string\")return candidate.url;if(typeof candidate.href===\"string\")return candidate.href;}return\"\";};const{name:rawName=\"\",description:rawDescription=\"\",thumbnailUrl:rawThumbnailUrl=\"\",uploadDate:rawUploadDate=\"\",contentUrl:rawContentUrl=\"\",embedUrl:rawEmbedUrl=\"\",duration:rawDuration=\"\"}=props;const name=toSafeString(rawName);const description=toSafeString(rawDescription);const thumbnailUrl=toSafeString(rawThumbnailUrl);const uploadDate=toSafeString(rawUploadDate);const contentUrl=toSafeString(rawContentUrl);const embedUrl=toSafeString(rawEmbedUrl);const duration=toSafeString(rawDuration);const normalizedUploadDate=useMemo(()=>{const trimmed=uploadDate.trim();if(/^\\d{4}$/.test(trimmed))return`${trimmed}-01-01`;return trimmed;},[uploadDate]);const schemaJson=useMemo(()=>{const videoObject={\"@context\":\"https://schema.org\",\"@type\":\"VideoObject\"};if(name.trim())videoObject.name=name.trim();if(description.trim())videoObject.description=description.trim();if(thumbnailUrl.trim())videoObject.thumbnailUrl=thumbnailUrl.trim();if(normalizedUploadDate)videoObject.uploadDate=normalizedUploadDate;if(contentUrl.trim())videoObject.contentUrl=contentUrl.trim();if(embedUrl.trim())videoObject.embedUrl=embedUrl.trim();if(duration.trim())videoObject.duration=duration.trim();return JSON.stringify(videoObject);},[name,description,thumbnailUrl,normalizedUploadDate,contentUrl,embedUrl,duration]);return /*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:schemaJson}});}addPropertyControls(VideoSchema,{name:{type:ControlType.String,title:\"Name\",defaultValue:\"\"},description:{type:ControlType.String,title:\"Description\",defaultValue:\"\",displayTextArea:true},thumbnailUrl:{type:ControlType.String,title:\"Thumbnail URL\",defaultValue:\"\"},uploadDate:{type:ControlType.String,title:\"Upload Date\",defaultValue:\"\"},contentUrl:{type:ControlType.String,title:\"Content URL\",defaultValue:\"\"},embedUrl:{type:ControlType.String,title:\"Embed URL\",defaultValue:\"\"},duration:{type:ControlType.String,title:\"Duration\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoSchema\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoSchema.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