/*! zaz-ui-sva-content - v1.0.3 - 28/10/2024 -- 1:11pm */
zaz.use(function pageTruffleCourse(pkg){"use strict";zaz.use(function appCarousel(pkg){var console=pkg.console,require=pkg.require,pkg=pkg.factoryManager.get("app"),PUBLIC_STATIC=null,STATIC={};pkg.create({name:"carousel",version:"1.0.0",state:"ok",dependencies:[],templates:{},expects:{properties:{container:{type:"string",required:!0},controls:{type:"boolean"},nav:{type:"boolean"},autoWidth:{type:"boolean"},center:{type:"boolean"},items:{type:"number"},gutter:{type:"number"},loop:{type:"boolean"},mouseDrag:{type:"boolean"},swipeAngle:{type:"boolean"},navPosition:{type:"string",enum:["top","bottom"]},responsive:{type:"object"}}},setup:function(__static,__proto,__shared){var PRIVATE={};PUBLIC_STATIC=__static},init:function(data,__shared){var PUBLIC=this,PRIVATE={configUpdateOptions:["responsive"]},tooltip,tooltipTitle;if(PRIVATE.containerApp=document.querySelector(data.container),PRIVATE.containerApp)return PUBLIC.getCountItems=function getCountItems(){var listItems;return PRIVATE.containerApp.querySelectorAll(".app-carousel__main__items").length},PRIVATE.setPluginTiny=function setPluginTiny(){PRIVATE.config={container:data.container+" .app-carousel__main",items:data.items||1,controls:void 0!==data.controls&&data.controls,controlsPosition:data.controlsPosition||"top",controlsText:data.controlsText||["prev","next"],nav:void 0===data.nav||data.nav,navPosition:data.navPosition||"bottom",autoWidth:void 0!==data.autoWidth&&data.autoWidth,center:void 0!==data.center&&data.center,loop:void 0!==data.loop&&data.loop,gutter:data.gutter||0,mouseDrag:void 0!==data.mouseDrag&&data.mouseDrag,swipeAngle:void 0!==data.swipeAngle&&data.swipeAngle,responsive:void 0!==data.responsive&&data.responsive,preventScrollOnTouch:void 0!==data.preventScrollOnTouch&&data.preventScrollOnTouch}},PUBLIC.updateConfig=function updateConfig(updateValues){var keys;Object.keys(updateValues).forEach(function(config){PRIVATE.configUpdateOptions.includes(config)?(console.log("[app-carousel "+data.container+"] - update config:",config),console.log(updateValues[config]),PRIVATE.config[config]=updateValues[config]):(console.warn("[app-carousel "+data.container+"] - unsupported configuration:",config),console.warn(updateValues[config]))})},PUBLIC.init=function init(){console.log("[app-carousel "+data.container+"] - initialized"),console.log(PRIVATE.config),PUBLIC.instTiny=tns(PRIVATE.config)},(tooltip=document.querySelectorAll(".tooltip"))&&(document.querySelectorAll(".tooltip .tooltip-title").forEach(function(tooltipIco){tooltipIco.addEventListener("click",function(e){tooltip.forEach(function(element){element.classList.remove("on")}),e.target.parentNode.parentNode.classList.add("on")})}),document.querySelectorAll(".tooltip .tooltip-box .tooltip-close").forEach(function(tooltipClose){tooltipClose.addEventListener("click",function(e){e.target.parentNode.parentNode.classList.remove("on")})}),document.querySelector(".app-carousel__offers"))&&document.querySelector(".app-carousel__offers").addEventListener("click",function(e){var isClickInsideTooltip,ignore;document.querySelector(".tooltip.on")&&(isClickInsideTooltip=document.querySelector(".tooltip.on .tooltip-box").contains(e.target),ignore=document.querySelector(".tooltip.on .tooltip-title"),isClickInsideTooltip||e.target==ignore||e.target.parentNode==ignore||document.querySelector(".tooltip.on .tooltip-close").dispatchEvent(new MouseEvent("click",{bubbles:!0})))}),PRIVATE.setPluginTiny(),PUBLIC;console.warn("Container appCarousel not found")},teardown:function(why,__static,__proto,__shared){}})}),zaz.use(function appFaq(pkg){var console=pkg.console,require=pkg.require,pkg=pkg.factoryManager.get("app"),PUBLIC_STATIC=null,STATIC={};pkg.create({name:"faq",version:"1.0.0",state:"ok",dependencies:[],templates:{},expects:{properties:{}},setup:function(__static,__proto,__shared){var PRIVATE={};PUBLIC_STATIC=__static},init:function(data,__shared){var PUBLIC=this,PRIVATE={},accordionTitle,faqBtn;if(PRIVATE.containerApp=document.querySelector(".app-faq"),PRIVATE.containerApp)return document.querySelector(".app-faq__tabs").classList.add("app-faq__tabs__on"),(accordionTitle=document.querySelectorAll(".app-faq__tabs__tab__label__title")).forEach(function(value){value.addEventListener("click",function(e){accordionTitle.forEach(function(element){var indexContent=element.parentNode.nextElementSibling,indexLabel=element.parentNode;element!=event.target||indexLabel.classList.contains("is-active")?(indexLabel.classList.remove("is-active"),indexLabel.classList.add("is-no-active"),indexContent.classList.remove("is-expanded"),indexContent.classList.add("is-collapsed")):(indexLabel.classList.remove("is-no-active"),indexLabel.classList.add("is-active"),indexContent.classList.remove("is-collapsed"),indexContent.classList.add("is-expanded"))})})}),accordionTitle.forEach(function(value){value.addEventListener("click",function(e){window.scrollTo({top:document.querySelector(".app-faq__tabs__on").offsetTop+e.target.parentNode.offsetTop-document.querySelector(".navbar__content").offsetHeight,behavior:"smooth"})})}),(faqBtn=document.querySelectorAll(".app-faq-tabs__perguntas__btn__tab")).forEach(function(btn){btn.addEventListener("click",function(){for(var x=0;x<faqBtn.length;x++)faqBtn[x].classList.contains("selected")&&faqBtn[x].classList.remove("selected");btn.classList.add("selected");for(var tabId=btn.id,faqTab=document.querySelectorAll(".app-faq-tabs__perguntas__aba"),i=0;i<faqTab.length;i++)faqTab[i].classList.contains(tabId)?(faqTab[i].style.display="block",faqTab[i].querySelector(".app-faq__tabs").classList.add("app-faq__tabs__on"),window.scrollTo({top:faqTab[i].offsetTop-document.querySelector(".navbar__content").offsetHeight,behavior:"smooth"})):(faqTab[i].style.display="none",faqTab[i].querySelector(".app-faq__tabs").classList.remove("app-faq__tabs__on"))})}),this;console.warn("Container App Faq not found")},teardown:function(why,__static,__proto,__shared){}})}),zaz.use(function appDatalayer(pkg){var console=pkg.console,require=pkg.require,appFactory=pkg.factoryManager.get("app"),PUBLIC_STATIC=null,STATIC={};appFactory.create({name:"datalayer",version:"1.0.0",state:"ok",dependencies:[],templates:{},expects:{properties:{}},setup:function(__static,__proto,__shared){var PRIVATE={};PUBLIC_STATIC=__static},init:function(data,__shared){var PUBLIC=this,PRIVATE={},pageBackendData=Object.entries(JSON.parse(pkg.context.page.get("backendData").replace(/[\n\r]+/g,"\\n")));return pageBackendData.forEach(function(data,index){data.push({posicao:index}),Object.assign(data[1],{itemListName:pkg.context.page.get("pageItemListName")})}),PUBLIC.callDataLayer=function callDataLayer(evName,itemData){pkg.require(["mod.ga4"],function(Ga4){var Metrics=new Ga4,dataTemp=Object.fromEntries(itemData),dataTemp=Object.values(dataTemp);dataTemp=Object({offers:dataTemp}),Ga4.fillInDataLayer(evName,dataTemp)})},PUBLIC.findElement=function findElement(name){var arNames=name.split(","),arItemsFound=[];return arNames.forEach(function(el,index){var itemFound=Object.values(pageBackendData).find(function(item){return item[0]===arNames[index]});arItemsFound.push(itemFound)}),arItemsFound||void 0},PUBLIC.dataLayerScroll=function dataLayerScroll(){function callback(){var difLayerPos=[],arSelec=[],slicedData;Array.prototype.forEach.call(document.querySelectorAll(".jsDataLayer"),function(element,index){arDataLayerPos[index][0]=element.getBoundingClientRect().top}),arDataLayerPos.forEach(function(el,index){difLayerPos.push(arDataLayerPos[index][0])}),difLayerPos.forEach(function(el,index){0<difLayerPos[index]&&difLayerPos[index]<=1.2*parseInt(window.innerHeight)&&0!==arDataLayerPos[index][0]&&arSelec.push(document.querySelectorAll(".jsDataLayer a[rel]")[index].getAttribute("rel"))}),0<arSelec.length&&PUBLIC.findElement(arSelec.toString()).forEach(function(item){!1===arDataLayerPos[item[2].posicao][1]&&(PUBLIC.callDataLayer("view_item_list",[item]),arDataLayerPos[item[2].posicao][1]=!0)})}function intervalo(fn,wait){var time=Date.now();return function(){time+wait-Date.now()<0&&(fn(),time=Date.now())}}var arDataLayerPos=[],pageItems;Array.prototype.forEach.call(document.querySelectorAll(".jsDataLayer"),function(element){arDataLayerPos.push([element.getBoundingClientRect().top,!1])}),window.addEventListener("scroll",intervalo(callback,200)),document.querySelectorAll(".app-categories__wrap__paginacao__list a").forEach(function(page){page.addEventListener("click",function(){Array.prototype.forEach.call(document.querySelectorAll(".jsDataLayer"),function(element,index){arDataLayerPos[index][0]=element.offsetTop})})})},PUBLIC.dataLayerProdClick=function dataLayerProdClick(evName){var dataLayerButtons;document.querySelectorAll(".jsDataLayer a[rel]").forEach(function(btn){btn.addEventListener("click",function(e){PUBLIC.callDataLayer(evName,PUBLIC.findElement(e.target.rel))})})},PUBLIC},teardown:function(why,__static,__proto,__shared){}})}),zaz.use(function appCookies(pkg){var console=pkg.console,require=pkg.require,pkg=pkg.factoryManager.get("app"),PUBLIC_STATIC=null,STATIC={};pkg.create({name:"cookies",version:"1.0.0",state:"ok",dependencies:[],templates:{},expects:{properties:{}},setup:function(__static,__proto,__shared){var PRIVATE={};PUBLIC_STATIC=__static},init:function(data,__shared){function setCookie(cname,cvalue,exdays){var d=new Date,exdays=(d.setTime(d.getTime()+24*exdays*60*60*1e3),"expires="+d.toUTCString());document.cookie=cname+"="+cvalue+";"+exdays+";path=/"}function getCookie(cname){for(var name=cname+"=",decodedCookie,ca=decodeURIComponent(document.cookie).split(";"),i=0;i<ca.length;i++){for(var c=ca[i];" "==c.charAt(0);)c=c.substring(1);if(0===c.indexOf(name))return c.substring(name.length,c.length)}return""}function checkCookie(){var user=getCookie("username");"accept_cookie"==user?cookiesBox.style.visibility="hidden":(cookiesBox.style.visibility="visible",""!==user&&null!==user&&setCookie("username",user,30))}var PUBLIC=this,PRIVATE={},cookiesBox=document.querySelector(".app-cookies"),btnContinuar=document.querySelector(".app-cookies__box__cta");return checkCookie(),btnContinuar.addEventListener("click",function(e){e.preventDefault(),document.cookie="username=accept_cookie",cookiesBox.style.visibility="hidden"}),this},teardown:function(why,__static,__proto,__shared){}})}),zaz.use(function appMenu(pkg){var console=pkg.console,require=pkg.require,pkg=pkg.factoryManager.get("app"),PUBLIC_STATIC=null,STATIC={};pkg.create({name:"menu",version:"1.0.0",state:"ok",dependencies:[],templates:{},expects:{properties:{}},setup:function(__static,__proto,__shared){var PRIVATE={};PUBLIC_STATIC=__static},init:function(data,__shared){function clearMenu(){for(var i=0;i<menuLinks.length;i++)menuLinks[i].classList.remove("on"),subMenu[i].classList.remove("on");status=!1}var PUBLIC=this,PRIVATE={},menuLinks=document.querySelectorAll(".app-menu__main__item__link"),subMenu=document.querySelectorAll(".app-menu__sub"),status;return menuLinks.forEach(function(el){el.addEventListener("click",function(e){e.preventDefault(),status&&el.classList.contains("on")?clearMenu():(clearMenu(),document.querySelector(".menu-"+this.target).classList.add("on"),document.querySelector(".submenu-"+this.target).classList.add("on"),status=!0)})}),document.addEventListener("scroll",function(e){clearMenu()}),window.addEventListener("mouseup",function(e){var appMenu=document.querySelector(".app-menu");e.target==appMenu||e.target.parentNode==appMenu||e.target.classList.contains("app-menu__main__item__link")||clearMenu()}),this},teardown:function(why,__static,__proto,__shared){}})});var console=pkg.console,require=pkg.require,appFactory=pkg.factoryManager.get("app"),PUBLIC_STATIC=null,STATIC={};appFactory.create({name:"pageTruffleCourse",version:"1.0.0",state:"ok",dependencies:["app.menu","app.carousel","app.faq","app.datalayer","app.cookies"],templates:{},expects:{properties:{}},setup:function(__static,__proto,__shared){var PRIVATE={};PUBLIC_STATIC=__static},init:function(data,__shared){var PUBLIC=this,PRIVATE={},instMenu=new __shared.dependencies.app.menu({}),instCookies=new __shared.dependencies.app.cookies({});return PRIVATE.loadHome=function loadHome(){var instFaqHome=new __shared.dependencies.app.faq({}),btnsAppAulasToggle=document.querySelectorAll(".app-aulas__cont__esq__toggle"),lstAppAulasToggle=document.querySelectorAll(".app-aulas__cont__esq__lst");btnsAppAulasToggle.forEach(function(bt,i){bt.addEventListener("click",function(){"active"==bt.dataset.attr?(bt.dataset.attr="",lstAppAulasToggle[i].dataset.attr=""):(bt.dataset.attr="active",lstAppAulasToggle[i].dataset.attr="active")})});var instCarouselTutorial,that=(new __shared.dependencies.app.carousel({container:".app-aulas__cont__dir__lst",items:1,slideBy:"page",mouseDrag:!0,swipeAngle:!1,speed:400,controls:!0}).init(),this),dataLayer=[],btnsAppAulasToggle=(this.activeCollectLeads=function(container,theme){pkg.require(["app.collectLead"],function(CollectLead){var lead;new CollectLead({container:container,theme:theme,useCaptcha:!0,captchaPlaceholder:"app-collect-lead-recaptcha"}).on("submitted",function(data){console.log("Submit efetuado com sucesso!"),dataLayer.push({event:"collect-lead-success"})})})},document.getElementById("collect-lead-banner")),tema,btnsAppAulasToggle=(this.activeCollectLeads(btnsAppAulasToggle,"simple"),new __shared.dependencies.app.datalayer({}));btnsAppAulasToggle.callDataLayer("view_item",btnsAppAulasToggle.findElement("package_truffle_course")),btnsAppAulasToggle.dataLayerProdClick("select_promotion")},PRIVATE.initPage=function initPage(){var pageLoad=pkg.context.page.get("pageTruffleCourseLoad");console.log(">>>>>>> page load "+pageLoad+" <<<<<<<"),"home"==pageLoad&&PRIVATE.loadHome()},PRIVATE.initPage(),this},teardown:function(why,__static,__proto,__shared){}})});