text: /**
   * shopback-plugin - Overlay Shopback - Criação e funcionalidades.
   * @authors Danilo Augusto Matos <da@shopback.com.br>,Mizael Silva Lemos <ms@shopback.com.br>,Carlos Eduardo Gomes <carlitoshxcx@gmail.com>
   * @link https://github.com/ShopBackBR/ShopTemplate/shopback-plugin/
   * @version v0.1.0
   */
  function shopConvertAjax(e,o){$.ajax({type:"POST",url:"//app.shopconvert.com.br/facebook/callback.php?ref="+String(top.location.href),data:{token:o.authResponse.accessToken,user_id:e.id,user_name:e.name,user_email:e.email,user_gender:e.gender,post:!0},success:function(o){$.post("//app.shopconvert.com.br/tr/tl/"+top.spl.acc+"/"+SB.id,{email:e.email});try{top._st_app.ci(String(e.email)),top._st_app.set_name(String(e.name))}catch(t){}top.spl.set_cookie("_spl_overlay_social","disabled",720),$(".recommendations").hide(),$(".thanks").show()},error:function(t,n,i){forceShopConvertAjax||(forceShopConvertAjax=!0,shopConvertAjax(e,o))}})}function clickURL(e){e.search("utm_source=ShopBack")<=-1&&"undefined"!=typeof top.spl.link_transform&&("object"==typeof window.top.ShopBack?"undefined"!=typeof window.top.ShopBack.PreventUtmsDefault&&(e=window.top.ShopBack.PreventUtmsDefault?e:top.spl.link_transform(e)):e=top.spl.link_transform(e)),top.spl.cid=SB.id,top.spl.click_only(e),top.spl.set_cookie("_spl_tr",SB.id,720);var o=top.spl.b64(e),t=top.spl.base_url+"/tr/tc/"+top.spl.acc+"/"+SB.id+"/"+o;top.spl.ajax(t,!1),setTimeout(function(){top.location.href=e},800)}!function(){var e=document.createElement("script");e.type="text/javascript",e.async=!1,e.src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(e,o)}(),function(){var e=document.createElement("script");e.type="text/javascript",e.async=!1,e.src="https://cdn.jsdelivr.net/jquery.migrate/1.4.1/jquery-migrate.min.js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(e,o)}(),function(){var e=document.createElement("script");e.type="text/javascript",e.async=!1,e.src="https://cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js";var o=document.getElementsByTagName("script")[1];o.parentNode.insertBefore(e,o)}();var SB={},force=!1,forceShopConvertAjax=!1;SB.begin=function(){SB.isReady=!1;var e=setInterval(function(){if("undefined"!=typeof $){SB.isReady=!0,SB.ov=$("#shopback"),SB.carrossel=$(".carousel");var o=SB.ov.attr("class"),t=/(vitrine)+/,n=/(recomendacao)+/;if(SB.id=SB.ov.data("id")&&""!=SB.ov.data("id")?SB.ov.data("id"):void 0,SB.documentHeightReference=SB.ov.data("height-reference"),!SB.id||"undefined"==typeof SB.id||"null"==SB.id)return void console.log("%c►ID da campanha não definido!",'font-family: "Arial Narrow",Arial,sans-serif; font-size: 13px; color: #FEFEFE; background-color: #e74c3c;padding: 5px 10px;border-radius: 3px;line-height: 22px;');if(SB.frame=$("#f-content-"+SB.id,window.top.document),t.test(o)&&!n.test(o)){SB.template="vitrine";var i=setInterval(function(){SB.documentHeight=""!=SB.documentHeightReference&&"string"==typeof SB.documentHeightReference?$(SB.documentHeightReference,window.top.document).innerHeight():$(window.top.document).innerHeight()},500);$(function(){setTimeout(function(){i&&clearInterval(i)},3e3)})}else{if(t.test(o)||!n.test(o))return void console.log("%c►Este overlay não está usando a classe correta!",'font-family: "Arial Narrow",Arial,sans-serif; font-size: 13px; color: #FEFEFE; background-color: #e74c3c;padding: 5px 10px;border-radius: 3px;line-height: 22px;');SB.template="recomendacao"}SB.selectTemplate(),clearInterval(e)}},800)},SB.carrosselOverlay=[{breakpoint:992,settings:{infinite:!1,dots:!1,slidesToShow:3,slidesToScroll:1}},{breakpoint:768,settings:{arrows:!1,dots:!1,slidesToShow:2,slidesToScroll:2}},{breakpoint:480,settings:{arrows:!1,dots:!1,slidesToShow:1,slidesToScroll:1}},{breakpoint:320,settings:{arrows:!1,dots:!1,slidesToShow:1,slidesToScroll:1}}],SB.carrosselVitrine=[{breakpoint:992,settings:{infinite:!0,dots:!0,slidesToShow:3,slidesToScroll:1}},{breakpoint:768,settings:{infinite:!0,arrows:!1,dots:!0,slidesToShow:2,slidesToScroll:1}},{breakpoint:480,settings:{infinite:!0,arrows:!1,dots:!0,slidesToShow:1,slidesToScroll:1}},{breakpoint:320,settings:{infinite:!0,arrows:!1,dots:!1,slidesToShow:1,slidesToScroll:1}}],SB.facebook=function(e){return window.fbAsyncInit=function(){FB.init({appId:e.toString(),status:!0,cookie:!0,xfbml:!0,version:"v2.5"})},!0},SB.connect=function(e){!function(e,o,t){var n,i=e.getElementsByTagName(o)[0];e.getElementById(t)||(n=e.createElement(o),n.id=t,n.async=!0,n.src="https://connect.facebook.net/en_US/sdk.js",i.parentNode.insertBefore(n,i))}(document,"script","facebook-jssdk"),$(e).click(function(o){o.stopPropagation(),o.cancelBubble=!0;var t=top.spl.b64(String(top.location.href)+"#conectar-facebook"),n=top.spl.base_url+"/tr/tc/"+top.spl.acc+"/"+SB.id+"/"+t;top.spl.ajax(n,!1),$(e).prop("disabled",!0);var i={scope:"public_profile, email",return_scopes:!0};force&&(i.auth_type="rerequest"),FB.login(function(o){o.authResponse&&String(o.authResponse.grantedScopes).search("email")>-1?FB.api("/me?fields=name,email,gender",function(e){$("#user_img").attr("alt",e.name).attr("src","//graph.facebook.com/"+e.id+"/picture?type=large"),$(".userName").html(String(e.name).split(" ")[0]),shopConvertAjax(e,o)}):($(e).prop("disabled",!1),force||(force=!0,$(e).trigger("click")))},i)})},SB.products="",SB.getProducts=function(e){top.shopback.api.getRecommendations(e,function(e,o){SB.products=o.data})},SB.close=function(){SB.frame.css({bottom:"-"+SB.vpaddingsize+"px",opacity:"0"}),$(SB.vpadding,window.top.document).css({"padding-bottom":"0"}),setTimeout(function(){top.spl.cid=SB.id,top.spl.close()},500)},SB.impression=0,SB.scrolling=function(){var e,o="undefined"==typeof SB.ov.data("scroller")?$(top):$(SB.ov.data("scroller"),window.top.document),t=SB.documentHeight-$(window.top.window).innerHeight(),n=0;SB.scroller=o,SB.vpadding=SB.ov.data("vpadding"),SB.vpaddingsize=SB.ov.data("vpaddingsize"),o.on("scroll",function(){0==SB.impression&&$(SB.vpadding,window.top.document).css({"padding-bottom":SB.vpaddingsize}),SB.documentHeight=""!=SB.documentHeightReference&&"string"==typeof SB.documentHeightReference?$(SB.documentHeightReference,window.top.document).innerHeight():$(window.top.document).innerHeight(),e=$(this).scrollTop(),t=SB.documentHeight-$(window.top.window).innerHeight(),e>=t&&e>n?(0==SB.impression&&(SB.impression=1,top.spl.view(SB.id),$(".close").click(SB.close)),window.parent.document.getElementById("f-content-"+SB.id).style.bottom="0px",window.parent.document.getElementById("f-content-"+SB.id).style.height=SB.vpaddingsize+"px"):e<t&&e<n&&e!=t&&(window.parent.document.getElementById("f-content-"+SB.id).style.bottom="-"+SB.vpaddingsize+"px".toString()),n=e})},String.prototype.sbNumberFormat=function(){var e=this,o=!!/(\.)+/.test(this);if(o){var t=e.split(".")[0],n=e.split(".")[1];e=t}else n="00";e="string"==typeof e?e.replace(",",""):e.toString(),L=e.length%3;var i=!1,r="";if(e.toString().length>3){i=L>0?e.substring("0",L):"",r=e.substring(L,e.length).length/3;for(var s=0;s<r;s++)(L>0||s>0)&&(i+="."),i+=e.substring(L+3*s,L+3*s+3)}else i=e;return i+=2==n.length&&parseInt(n)>0?","+n:n.length>2&&parseInt(n)>0?","+n.substring("0","2"):n.length>0&&parseInt(n)>0?","+n+"0":",00"},SB.creatBox=function(e){e.images[0]=e.images[0].replace(/^(http(s)?\:\/\/)/g,"//"),e.price=e.price?e.price.toString().sbNumberFormat():"",e.installments_price=e.installments_price?e.installments_price.toString().sbNumberFormat():"",e.installments=e.installments?parseInt(e.installments):"",e.normal_price=e.normal_price?e.normal_price.toString().sbNumberFormat():"","undefined"!=typeof e.more_info?(e.more_info.brand="undefined"!=typeof e.more_info.brand?e.more_info.brand:"",e.more_info.manufacturer="undefined"!=typeof e.more_info.manufacturer?e.more_info.manufacturer:"",e.more_info.gender="undefined"!=typeof e.more_info.gender?e.more_info.gender:"",e.more_info.color="undefined"!=typeof e.more_info.color?e.more_info.color:"",e.more_info.quantity="undefined"!=typeof e.more_info.quantity?e.more_info.quantity:"",e.more_info.size="undefined"!=typeof e.more_info.size?e.more_info.size:"",e.more_info.material="undefined"!=typeof e.more_info.material?e.more_info.material:"",e.more_info.age_group="undefined"!=typeof e.more_info.age_group?e.more_info.age_group:"",e.more_info.shipping="undefined"!=typeof e.more_info.shipping?e.more_info.shipping:"",e.more_info.condition="undefined"!=typeof e.more_info.condition?e.more_info.condition:""):(e.more_info={},e.more_info.brand="",e.more_info.manufacturer="",e.more_info.gender="",e.more_info.color="",e.more_info.quantity="",e.more_info.size="",e.more_info.material="",e.more_info.age_group="",e.more_info.shipping="",e.more_info.condition="");var o=$("#item_template").clone();o.removeAttr("id"),""==e.normal_price&&o.find("* > :contains('{old_price}')").html("");var t=o.html();t=t.split("{image}").join(e.images[0]).split("{title}").join(e.title).split("{old_price}").join(e.normal_price).split("{price}").join(e.price).split("{installments}").join(e.installments).split("{installments_price}").join(e.installments_price).split("{brand}").join(e.more_info.brand).split("{manufacturer}").join(e.more_info.manufacturer).split("{gender}").join(e.more_info.gender).split("{color}").join(e.more_info.color).split("{quantity}").join(e.more_info.quantity).split("{size}").join(e.more_info.size).split("{material}").join(e.more_info.material).split("{age_group}").join(e.more_info.age_group).split("{shipping}").join(e.more_info.shipping).split("{condition}").join(e.more_info.condition),o.html(t),o.addClass("fade").on("click",function(){"object"==typeof window.top.ShopBack&&"object"==typeof window.top.ShopBack.Linkprefix&&(e.link=window.top.ShopBack.Linkprefix[0]+e.link+window.top.ShopBack.Linkprefix[1]),clickURL(e.link)}),SB.carrossel.append(o)},SB.slickCarrossel=function(e){SB.carrossel.slick({lazyLoad:"ondemand",infinite:!1,speed:300,responsive:e})},SB.jsonDefaultAttribute={},SB.vitrine=function(e){e="object"==typeof e?e:SB.jsonDefaultAttribute,SB.frame.css({width:"100%",height:"210px",position:"fixed",left:"0",right:"0",margin:"0 auto",bottom:"-210px",top:"auto",display:"block","-webkit-transition":"all linear 300ms","-moz-transition":"all linear 300ms","-o-transition":"all linear 300ms",transition:"all linear 300ms"}),SB.scrolling();var o=!1,t=setInterval(function(){1==SB.impression&&(o||(SB.getProducts(e),o=!0),"object"==typeof SB.products&&1==SB.impression&&(SB.carrossel.html(""),$.each(SB.products,function(e,o){SB.creatBox(o)}),SB.slickCarrossel(SB.carrosselVitrine),setTimeout(function(){$(".fade").css({opacity:"0",display:"block"}).animate({opacity:"1"},800)},100),clearInterval(t)))},500)},SB.recomendacao=function(e){e="object"==typeof e?e:SB.jsonDefaultAttribute;var o=setInterval(function(){top.spl.active&&(0==SB.impression&&(SB.getProducts(e),SB.impression=1),"object"==typeof SB.products&&1==SB.impression&&(SB.carrossel.html(""),$.each(SB.products,function(e,o){SB.creatBox(o)}),SB.slickCarrossel(SB.carrosselOverlay),setTimeout(function(){$(".fade").css({opacity:"0",display:"block"}).animate({opacity:"1"},800)},100),clearInterval(o)))},500)},SB.social=function(e,o){!function(e,o){o.facebook(e)}(o,this),SB.connect(e)},SB.selectTemplate=function(){switch(SB.template){case"vitrine":SB.ov.hasClass("custom")||SB.vitrine();break;case"recomendacao":SB.ov.hasClass("custom")||(SB.recomendacao(),SB.social("#facebookConnectButton",SB.ov.data("facebook")))}},function(){var e=setInterval(function(){"undefined"!=typeof $&&(SB.begin(),clearInterval(e))},300)}(),SB.ready=function(e){var o=setInterval(function(){SB.isReady&&(e(),clearInterval(o))},500)};