{"version":3,"file":"shared.CeORMS2M.mjs","names":["useRef","useState","useCallback"],"sources":["https:/framerusercontent.com/modules/ik1HZzJjzMqKkXA5Xt9a/Z98Omz99S7eHPmcyvDaY/VturbPlayer_sem_bug_.js","https:/framerusercontent.com/modules/yP82YBIHPrazdypW6cXU/SlCdZPH2FeVjuFST7IXk/esconder.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useEffect,useState,useCallback}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function VturbPlayer({vturbCode,secondsToDisplay,classToDisplay}){const containerRef=useRef(null);const[elementsShown,setElementsShown]=useState(false);// Função para obter a URL base sem parâmetros\nconst getBaseUrl=useCallback(()=>{const url1=new URL(window.location.href);return`${url1.origin}${url1.pathname}`;},[]);const initializePlayer=useCallback(()=>{const container=containerRef.current;// Limpa o contêiner antes de adicionar um novo player\nwhile(container.firstChild){container.removeChild(container.firstChild);}// Cria um novo elemento div para conter o código do player\nconst playerContainer=document.createElement(\"div\");playerContainer.innerHTML=vturbCode;// Adiciona o código do player ao contêiner\ncontainer.appendChild(playerContainer);// Obtém a tag script do código do player\nconst scriptTag=playerContainer.querySelector(\"script\");// Executa o código dentro da tag script\ntry{eval(scriptTag.innerHTML);}catch(error){console.error(\"Erro ao inicializar o player:\",error);}},[vturbCode]);const showEls=useCallback(()=>{const baseUrl1=getBaseUrl();const storageKey1=`alreadyElsDisplayed_${baseUrl1}`;const elements1=document.querySelectorAll(classToDisplay);elements1.forEach(element1=>{element1.classList.remove(\"esconder\");element1.style.removeProperty(\"display\");});localStorage.setItem(storageKey1,\"true\");},[classToDisplay,getBaseUrl]);const startWatchVideoProgress=useCallback(()=>{let attempts1=0;const checkPlayer1=()=>{if(typeof smartplayer===\"undefined\"||!(smartplayer.instances&&smartplayer.instances.length)){attempts1+=1;if(attempts1>=10)return;return setTimeout(checkPlayer1,1e3);}smartplayer.instances[0].on(\"timeupdate\",()=>{if(smartplayer.instances[0].video.currentTime>=secondsToDisplay){setElementsShown(true);}});};checkPlayer1();},[secondsToDisplay]);useEffect(()=>{const baseUrl1=getBaseUrl();const storageKey1=`alreadyElsDisplayed_${baseUrl1}`;initializePlayer();// Verifica se os elementos já foram exibidos anteriormente\nconst alreadyElsDisplayed1=localStorage.getItem(storageKey1);if(alreadyElsDisplayed1===\"true\"){setElementsShown(true);}else{startWatchVideoProgress();}const handleResize1=()=>{if(typeof smartplayer!==\"undefined\"&&smartplayer.instances&&smartplayer.instances.length){const currentTime1=smartplayer.instances[0].video.currentTime;if(currentTime1>=secondsToDisplay){setElementsShown(true);}}};window.addEventListener(\"resize\",handleResize1);window.addEventListener(\"orientationchange\",handleResize1);return()=>{window.removeEventListener(\"resize\",handleResize1);window.removeEventListener(\"orientationchange\",handleResize1);};},[vturbCode,secondsToDisplay,classToDisplay,getBaseUrl,initializePlayer,startWatchVideoProgress]);useEffect(()=>{if(elementsShown){showEls();}},[elementsShown,showEls]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef});}// ... (o resto do código permanece o mesmo)\nVturbPlayer.defaultProps={vturbCode:`\n    <div id=\"vid_66577d0d150fc9000b75519d\" style=\"position:relative;width:100%;padding: 177.77777777777777% 0 0;\">\n      <img id=\"thumb_66577d0d150fc9000b75519d\" src=\"https://images.converteai.net/693742f3-b2a9-47a8-90be-b9911b88f4b5/players/66577d0d150fc9000b75519d/thumbnail.jpg\" style=\"position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;display:block;\">\n      <div id=\"backdrop_66577d0d150fc9000b75519d\" style=\"position:absolute;top:0;width:100%;height:100%;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);\"></div>\n    </div>\n    <script type=\"text/javascript\" id=\"scr_66577d0d150fc9000b75519d\">\n      var s=document.createElement(\"script\");\n      s.src=\"https://scripts.converteai.net/693742f3-b2a9-47a8-90be-b9911b88f4b5/players/66577d0d150fc9000b75519d/player.js\",\n      s.async=!0,document.head.appendChild(s);\n    </script>\n  `,secondsToDisplay:5,classToDisplay:\".esconder\"};addPropertyControls(VturbPlayer,{vturbCode:{type:ControlType.String,title:\"C\\xf3digo do Player do Vturb\",defaultValue:VturbPlayer.defaultProps.vturbCode,displayTextArea:true},secondsToDisplay:{type:ControlType.Number,title:\"Segundos para Exibir\",defaultValue:VturbPlayer.defaultProps.secondsToDisplay,min:0,step:1},classToDisplay:{type:ControlType.String,title:\"Classe dos Elementos a Exibir\",defaultValue:VturbPlayer.defaultProps.classToDisplay}});\nexport const __FramerMetadata__ = {\"exports\":{\"VturbPlayer\":{\"type\":\"reactComponent\",\"name\":\"VturbPlayer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VturbPlayer_sem_bug_.map","import{jsx as _jsx}from\"react/jsx-runtime\";export function withClass(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,className:`${props.className||\"\"} esconder`.trim(),style:{...props.style,display:props.style?.display||\"none\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withClass\":{\"type\":\"reactHoc\",\"name\":\"withClass\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./esconder.map"],"mappings":"iQAAwJ,SAAgB,YAAY,CAAC,UAAU,iBAAiB,eAAe,CAAC,CAAC,IAAM,aAAaA,GAAO,MAAW,CAAC,cAAc,iBAAiB,CAACC,GAAS,IAC1S,WAAWC,OAAgB,CAAC,IAAM,KAAK,IAAI,IAAI,OAAO,SAAS,MAAM,MAAM,GAAG,KAAK,SAAS,KAAK,UAAY,EAAC,EAAE,EAAQ,iBAAiBA,OAAgB,CAAC,IAAM,UAAU,aAAa,QAC7L,KAAM,UAAU,YAAY,UAAU,YAAY,UAAU,YAC5D,IAAM,gBAAgB,SAAS,cAAc,OAAO,gBAAgB,UAAU,UAC9E,UAAU,YAAY,iBACtB,IAAM,UAAU,gBAAgB,cAAc,UAC9C,GAAG,CA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