{"version":3,"file":"VidalyticsEmbed.DxgVXKGF.mjs","names":[],"sources":["https:/framerusercontent.com/modules/BFQUt8BmSXLgVXZXCunL/doL3ag1IHLlL1ITDWXZM/VidalyticsEmbed.js"],"sourcesContent":["/**\n * User request: Make this file a valid, indexable Framer code component with a\n * default export, valid layout annotations, working addPropertyControls, SSR-safe\n * window/document usage, and keep existing Vidalytics embed behavior and controls.\n */// Get Started: https://www.framer.com/developers\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * VIDALYTICS VIDEO EMBED\n *\n * Wraps the Vidalytics loader/player snippet in a Framer code component.\n * The vendor snippet is a self-running <script> that injects loader.min.js\n * and player.min.js, so it can't live in JSX. Instead we render the target\n * div and run the loader inside useEffect (client-side only).\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function VidalyticsEmbed(props){const{accountId=\"yOQxoxlm\",videoId=\"S0wls8cgB_Qvm2ku\",aspect=\"56.25%\",radius=0}=props;const divId=`vidalytics_embed_${videoId}`;const base=`https://fast.vidalytics.com/embeds/${accountId}/${videoId}/`;// On the Framer canvas we show a placeholder instead of loading the player.\nconst onCanvas=RenderTarget.current()===RenderTarget.canvas;useEffect(()=>{// No window during server render; skip the canvas; need both IDs.\nif(typeof window===\"undefined\"||onCanvas)return;if(!accountId||!videoId)return;// Initialize each embed only once per page load.\nconst reg=window.__vidalyticsEmbeds||(window.__vidalyticsEmbeds={});if(reg[divId])return;reg[divId]=true;// Vidalytics' own loader IIFE, parameterized for this video and\n// injected as a real <script> element so the browser executes it.\nconst script=document.createElement(\"script\");script.type=\"text/javascript\";script.text=`\n(function (v, i, d, a, l, y, t, c, s) {\n    y='_'+d.toLowerCase();c=d+'L';if(!v[d]){v[d]={};}if(!v[c]){v[c]={};}if(!v[y]){v[y]={};}var vl='Loader',vli=v[y][vl],vsl=v[c][vl + 'Script'],vlf=v[c][vl + 'Loaded'],ve='Embed';\n    if (!vsl){vsl=function(u,cb){\n        if(t){cb();return;}s=i.createElement(\"script\");s.type=\"text/javascript\";s.async=1;s.src=u;\n        if(s.readyState){s.onreadystatechange=function(){if(s.readyState===\"loaded\"||s.readyState==\"complete\"){s.onreadystatechange=null;vlf=1;cb();}};}else{s.onload=function(){vlf=1;cb();};}\n        i.getElementsByTagName(\"head\")[0].appendChild(s);\n    };}\n    vsl(l+'loader.min.js',function(){if(!vli){var vlc=v[c][vl];vli=new vlc();}vli.loadScript(l+'player.min.js',function(){var vec=v[d][ve];t=new vec();t.run(a);});});\n})(window, document, 'Vidalytics', '${divId}', '${base}');\n`;document.body.appendChild(script);},[accountId,videoId,divId,base,onCanvas]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\"},children:/*#__PURE__*/_jsx(\"div\",{id:divId,style:{width:\"100%\",position:\"relative\",paddingTop:aspect,borderRadius:radius,overflow:\"hidden\",backgroundColor:onCanvas?\"rgba(0,0,0,0.06)\":undefined},children:onCanvas&&/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",inset:0,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:4,font:\"500 13px/1.4 -apple-system, BlinkMacSystemFont, sans-serif\",color:\"rgba(0,0,0,0.5)\",textAlign:\"center\",padding:12},children:[/*#__PURE__*/_jsx(\"span\",{children:\"▶ Vidalytics video\"}),/*#__PURE__*/_jsx(\"span\",{style:{opacity:.7},children:\"plays in Preview & published\"})]})})});}addPropertyControls(VidalyticsEmbed,{accountId:{type:ControlType.String,title:\"Account ID\",defaultValue:\"yOQxoxlm\"},videoId:{type:ControlType.String,title:\"Video ID\",defaultValue:\"S0wls8cgB_Qvm2ku\"},aspect:{type:ControlType.Enum,title:\"Aspect\",options:[\"56.25%\",\"75%\",\"100%\",\"177.78%\"],optionTitles:[\"16:9\",\"4:3\",\"1:1\",\"9:16\"],defaultValue:\"56.25%\"},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:64,unit:\"px\",defaultValue:0}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VidalyticsEmbed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VidalyticsEmbed.map"],"mappings":"sMAeG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,YAAU,WAAW,UAAQ,mBAAmB,SAAO,SAAS,SAAO,GAAG,EAAY,EAAM,oBAAoB,IAAgB,EAAK,sCAAsC,EAAU,GAAG,EAAQ,GAClP,EAAS,EAAa,QAAQ,IAAI,EAAa,OAc0B,OAdnB,MAAc,CAC1B,GAAtC,IAAS,QAAa,GAAmB,CAAC,GAAW,CAAC,EAAQ,OACxE,IAAM,EAAI,AAA4B,EAAO,qBAAmB,CAAC,EAAG,GAAG,EAAI,GAAO,OAAO,EAAI,GAAO,GAEpG,IAAM,EAAO,SAAS,cAAc,QAAQ,EAAE,EAAO,KAAK,kBAAkB,EAAO,KAAK;;;;;;;;;sCASlD,EAAM,MAAM,EAAK;EACrD,SAAS,KAAK,YAAY,CAAM,CAAE,EAAE,CAAC,EAAU,EAAQ,EAAM,EAAK,CAAQ,CAAC,EAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,SAAS,UAAU,EAAE,SAAsB,EAAK,MAAM,CAAC,GAAG,EAAM,MAAM,CAAC,MAAM,OAAO,SAAS,WAAW,WAAW,EAAO,aAAa,EAAO,SAAS,SAAS,gBAAgB,EAAS,mBAAmB,IAAA,EAAS,EAAE,SAAS,GAAuB,EAAM,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM,EAAE,QAAQ,OAAO,cAAc,SAAS,WAAW,SAAS,eAAe,SAAS,IAAI,EAAE,KAAK,6DAA6D,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