{"version":3,"file":"VTurbPlayer.CW7LYQml.mjs","names":["React.useMemo","React.useEffect","_jsxs","_jsx","React.createElement","__esmMin","H","pe","p","c","init_jsx_runtime","init_npm_react_18_3_1","ce","addPropertyControls","RenderTarget","init_framer_ChujFWHC","ControlType","VTurbPlayer","props","embedCode","style","isCanvas","playerId","scriptSrc","code","tagMatch","urlMatch","fallbackIdFromUrl","script","init_VTurbPlayer"],"sources":["https:/framerusercontent.com/modules/d5mC3NpCRTPiGwXWcdOb/j8QlUPRyfoJiJiZqrlhV/VTurbPlayer.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 1280\n * @framerIntrinsicHeight 720\n */export default function VTurbPlayer(props){const{embedCode,style}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const details=React.useMemo(()=>{const code=embedCode||\"\";const tagMatch=code.match(/<vturb-smartplayer[^>]*\\bid=[\"']((?:vid|ab)-[^\"']+)[\"']/i);const urlMatch=code.match(/https:\\/\\/scripts\\.converteai\\.net\\/([^/\"'\\s]+)\\/(?:(players)\\/([^/\"'\\s]+)\\/v\\d+\\/player\\.js|(ab-test)\\/([^/\"'\\s]+)\\/player\\.js)/i);const fallbackIdFromUrl=urlMatch?urlMatch[2]?`vid-${urlMatch[3]}`:urlMatch[4]?`ab-${urlMatch[5]}`:\"\":\"\";return{playerId:tagMatch?.[1]||fallbackIdFromUrl||\"\",scriptSrc:urlMatch?.[0]||\"\"};},[embedCode]);const{playerId,scriptSrc}=details;React.useEffect(()=>{if(isCanvas||!scriptSrc)return;const alreadyLoaded=Array.from(document.scripts).some(script=>script.src===scriptSrc);if(!alreadyLoaded){const script=document.createElement(\"script\");script.src=scriptSrc;script.async=true;document.head.appendChild(script);}},[isCanvas,scriptSrc]);if(!playerId||!scriptSrc){return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",aspectRatio:\"16 / 9\",background:\"#000\",color:\"#fff\",borderRadius:8,textAlign:\"center\",padding:20},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontSize:20,lineHeight:1,marginBottom:8},children:\"⚠️\"}),\"Paste the complete vTurb embed code\"]});}if(isCanvas){return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",aspectRatio:\"16 / 9\",background:\"#000\",color:\"#fff\",border:\"1px solid #222\",borderRadius:8,textAlign:\"center\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontSize:20,lineHeight:1,marginBottom:8},children:\"✅\"}),/*#__PURE__*/_jsx(\"strong\",{children:\"vTurb Video\"}),/*#__PURE__*/_jsx(\"span\",{style:{marginTop:6,fontSize:12,opacity:.6},children:playerId}),/*#__PURE__*/_jsx(\"span\",{style:{marginTop:4,fontSize:11,opacity:.45},children:\"Visible after publishing\"})]});}return /*#__PURE__*/React.createElement(\"vturb-smartplayer\",{id:playerId,style:{display:\"block\",margin:\"0 auto\",width:\"100%\",...style}},/*#__PURE__*/React.createElement(\"div\",{className:\"vturb-player-placeholder\",style:{position:\"relative\",width:\"100%\",padding:\"56.25% 0 0\",zIndex:0,backgroundColor:\"black\"}}));}VTurbPlayer.defaultProps={embedCode:\"\"};addPropertyControls(VTurbPlayer,{embedCode:{type:ControlType.String,title:\"Embed Code\",placeholder:\"Paste the complete vTurb embed code\",displayTextArea:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VTurbPlayer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"1280\",\"framerIntrinsicHeight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