/g,">")},r=function(e,t){document.documentElement.style.setProperty(e,t)},a=function(e=""){return(t.get("sbx_api_url")||"https://api.trakteer.id")+`/v2/${e}`},i=function(e){return`\n ( ${e.no} ) \n ${e.name} \n ${e.sum} ${e.unit}\n `},s=function(e){var n="";if("false"!==t.get("rt_showsuppmsg"))n=e.message;return`\n ${e.name} \n mentraktir\n ${e.sum} ${e.unit}\n ${n&&`${n}`}\n `},o=t.get("rt_theme")||"transitional";if("transitional"!==o)return window.location.href=function(e=""){return"stream.trakteer.id"===window.location.host?`${window.location.origin}/${e}`:`${window.location.origin}/stream-overlay/build/${e}`}(`running-text-${o}.html`+e),!1;if(r("--marqueeBgColor",t.get("rt_3_clr1")||"#444444"),r("--marqueeColor",t.get("rt_3_clr2")||"#fff"),r("--highlightColor",t.get("rt_3_clr3")||"#FBD758"),"true"==t.get("preview"))r("--marqueAlign","8px");else r("--marqueAlign","20px");if(r("--fontFamily","Quicksand"),null!=t.get("rt_font")){var u=t.get("rt_font");if(u&&"default"!==u)r("--fontFamily","'"+u+"'"),WebFont.load({google:{families:[u.split(" ").join("+")]}})}if(!t.get("rt_speed")||"normal"==t.get("rt_speed"))var l=-75;else if("slow"==t.get("rt_speed"))l=-50;else if("fast"==t.get("rt_speed"))l=-100;else if("faster"==t.get("rt_speed"))l=-125;var p=document.getElementById("marquee"),g=window.m=new dynamicMarquee.Marquee(p,{rate:l}),c=t.get("rt_count")?parseInt(t.get("rt_count")):3;c=(c=c>10?10:c)<1?1:c;var m=t.get("rt_interval")?parseInt(t.get("rt_interval")):7;m=m<1?1:m;var f=t.get("rt_type")||"latest-tips";p.classList.add(f);var d,h,v,_="true"===t.get("use_placeholder"),y=t.get("key"),w=t.get("hash"),$=[],E=(h=t.get("rt_messages"),(v=document.createElement("div")).innerText=h,v.innerHTML||"Ayo traktir {username} di {trlink} dukung menggunakan Gopay, OVO, Dana, LinkAja, Shopeepay, QRIS, dan Transfer Bank"),b=function(){var e=document.createElement("div");return E=(E=E.replace("{username}",t.get("creator_name"))).replace("{trlink}",''+t.get("page_url")+""),e.innerHTML=E,e.style.fontWeight="700",e};if("top-supporters"===f){var k=function(){var e=document.createElement("div");return e.innerHTML=1==m?"Top Supporter Hari Ini":"Top Supporter "+m+" Hari Terakhir",e.style.fontWeight="700",e};if(_)$.push(k)}if(_){for(var T=[],q=0;q0)r.forEach((function(e,r){var i=e.display_name.split("_!!!_"),o=i[i.length-1]||"Seseorang";$[r]=function(){if((a=document.createElement("div")).innerHTML=s({name:n(o.replace("`","`")),sum:e.quantity,unit:n(t.body.unitName.replace("`","`")),message:null!==e.support_message?', "'+e.support_message+'"':""}),0===r)a.style.marginRight="10px";return a}}));if(r.length>0||0==r.length&&$.length<=0)$.push(b),x($)}catch(e){}}))}(y,c);if("true"!==t.get("preview"))if("top-supporters"===f)window.setInterval((function(){H(y,m,c,{isUpdate:!0})}),12e4);else{var L=[];if(window.Echo.channel("creator-stream."+w+"."+y).notification((function(e){if("new-tip-success"===e.type||"new-tip-success-approved"===e.type)L.push(e)})),!t.get("rt_speed")||"normal"==t.get("rt_speed"))var M=45e3;else if("slow"==t.get("rt_speed"))M=6e4;else if("fast"==t.get("rt_speed"))M=3e4;window.setInterval((function(){if(!(L.length<=0)){var e=$.length;if(e>=c+1)$.splice(e-2,1);var t=L[0];$.unshift((function(){var e=document.createElement("div");return e.innerHTML=s({name:n(t.supporter_name),sum:t.quantity,unit:n(t.unit),message:t.supporter_message?', "'+t.supporter_message+'"':""}),e})),L.splice(0,1),d.update($)}}),M)}function H(e,t,r,s={}){superagent.get(a(`stream/${e}/top-supporters`)).query({interval:t}).query({count:r}).accept("application/json").end((function(e,t){try{var r=t.body.supporter,a=document.createElement("div");if(r.length>0){if(s.isUpdate)$=[];$.push(k),r.forEach((function(e,r){var s=(e.supporter_name||"").split("_!!!_"),o=s[s.length-1]||"Seseorang";$.push((function(){return(a=document.createElement("div")).innerHTML=i({no:r+1,name:n(o.replace("`","`")),sum:e.sum,unit:n(t.body.unitName.replace("`","`"))}),a}))}))}if(r.length>0||0==r.length&&$.length<=0)if($.push(b),s.isUpdate)d.update($);else x($)}catch(e){}}))}function x(e){d=dynamicMarquee.loop(g,e,(function(){var e=document.createElement("div");return e.innerHTML="•
",e}))}}()