const target=[{type:1,data:[{name:"#scumloph19bank21_",func:"DesktopAfterLogin"},{name:"#payment-gateway-section",func:"DesktopAfterLogin1"}]},{type:2,data:[{name:".note.center",func:"MobileBeforeLogin"}]},{type:3,data:[{name:"#detailb",func:"MobileAfterLogin"},{name:"#bank",func:"MobileAfterLogin1"}]}],baseUrl={qris:"https://qris.trxpg.com",toppay:"https://toppay.trxpg.com"},baseCode="Ug5UwtwxIjkdNFxTYx3kTyjOuSuBJX",urlManifest={qris:{url:baseUrl.qris+"/qris/manifest/"+baseCode,status:"true"},toppay:{url:baseUrl.toppay+"/toppay/manifest/"+baseCode,status:"false"}},eventSelect={MobileAfterLogin:e=>{var{val:e,templateQris:t,templateToppay:a,parentIframeQris:i,parentIframeToppay:n,infoRek:s,containerJumlah:o,containerBtn:r,dataBank:l,iframeToppay:p,h:d}=e,c=$(".parent-jumlah").parent(".depo-top"),h=$(".btn-add-jumlah-container");""==e?(null!=t&&t.hide(),null!=i&&i.css({opacity:0,height:"0"}),null!=a&&a.hide(),null!=n&&n.css({opacity:0,height:"0"}),s.hide(),o.show(),r.show(),c.hide(),h.hide()):l.qris.includes(e)&&urlManifest.qris.status?(c.hide(),h.hide(),s.hide(),o.hide(),r.hide(),null!=t&&t.show(),null!=a&&a.hide(),null!=i&&i.animate({opacity:1,height:d.qris},1e3),null!=n&&n.css({opacity:0,height:"0"})):l.toppay.includes(e)&&urlManifest.toppay.status?(c.hide(),h.hide(),s.hide(),o.hide(),r.hide(),null!=t&&t.hide(),null!=a&&a.show(),null!=i&&i.css({opacity:0,height:"0"}),null!=n&&n.animate({opacity:1,height:d.toppay},1e3),null!=p&&p[0].contentWindow.postMessage(JSON.stringify({bank:e}),"*")):(null!=t&&t.hide(),null!=a&&a.hide(),null!=i&&i.css({opacity:0,height:"0"}),null!=n&&n.css({opacity:0,height:"0"}),s.show(),o.show(),r.show(),c.show(),h.show(),s.addClass("depo-top bottom"))},MobileAfterLogin1:e=>{var{val:e,templateQris:t,templateToppay:a,parentIframeQris:i,parentIframeToppay:n,child:s,dataBank:o,iframeToppay:r,h:l}=e;if(""==e){null!=t&&t.hide(),null!=a&&a.hide(),null!=i&&i.css({opacity:0,height:"0"}),null!=n&&n.css({opacity:0,height:"0"});for(let e=0;e<s.length;e++)5<e&&e<15&&$(s[e]).show()}else if(o.qris.includes(e)&&urlManifest.qris.status){null!=t&&t.show(),null!=a&&a.hide(),null!=i&&i.animate({opacity:1,height:l.qris},1e3),null!=n&&n.css({opacity:0,height:"0"});for(let e=0;e<s.length;e++)5<e&&e<15&&$(s[e]).hide()}else if(o.toppay.includes(e)&&urlManifest.toppay.status){null!=t&&t.hide(),null!=a&&a.show(),null!=i&&i.css({opacity:0,height:"0"}),null!=n&&n.animate({opacity:1,height:l.toppay},1e3),null!=r&&r[0].contentWindow.postMessage(JSON.stringify({bank:e}),"*");for(let e=0;e<s.length;e++)5<e&&e<15&&$(s[e]).hide()}else{null!=t&&t.hide(),null!=a&&a.hide(),null!=i&&i.css({opacity:0,height:"0"}),null!=n&&n.css({opacity:0,height:"0"});for(let e=0;e<s.length;e++)5<e&&e<15&&$(s[e]).show()}},DesktopAfterLogin:e=>{var{val:e,infoRek:t,jmlDepo:a,infoMin:i,btnKirim:n,btnHapus:s,templateQris:o,templateToppay:r,parentIframeQris:l,parentIframeToppay:p,iframeToppay:d,h:c,dataBank:h,targetInputRekening:u}=e;h.qris.includes(e)&&urlManifest.qris.status?(t.hide(),a.hide(),i.hide(),n.hide(),s.hide(),u.hide(),null!=o&&o.show(),null!=r&&r.hide(),null!=l&&l.animate({opacity:1,height:c.qris},1e3),null!=p&&p.css({opacity:0,height:"0"})):h.toppay.includes(e)&&urlManifest.toppay.status?(t.hide(),a.hide(),i.hide(),n.hide(),s.hide(),u.hide(),null!=o&&o.hide(),null!=r&&r.show(),null!=l&&l.css({opacity:0,height:"0"}),null!=p&&p.animate({opacity:1,height:c.toppay},1e3),null!=d&&d[0].contentWindow.postMessage(JSON.stringify({bank:e}),"*")):(t.show(),a.show(),i.show(),n.show(),s.show(),u.show(),null!=o&&o.hide(),null!=r&&r.hide(),null!=l&&l.css({opacity:0,height:"0"}),null!=p&&p.css({opacity:0,height:"0"}))},DesktopAfterLogin1:e=>{var{dataBank:e,val:t,targetIframe:a,templateQris:i,templateToppay:n,parentIframeQris:s,parentIframeToppay:o,iframeToppay:r,h:l}=e;e.qris.includes(t)&&urlManifest.qris.status?(a.find(".flex").hide(),null!=i&&i.show(),null!=n&&n.hide(),null!=s&&s.animate({opacity:1,height:l.qris},1e3),null!=o&&o.css({opacity:0,height:"0"})):e.toppay.includes(t)&&urlManifest.toppay.status?(a.find(".flex").hide(),null!=i&&i.hide(),null!=n&&n.show(),null!=s&&s.css({opacity:0,height:"0"}),null!=o&&o.animate({opacity:1,height:l.toppay},1e3),null!=r&&r[0].contentWindow.postMessage(JSON.stringify({bank:t}),"*")):(a.find(".flex").show(),null!=i&&i.hide(),null!=n&&n.hide(),null!=s&&s.css({opacity:0,height:"0"}),null!=o&&o.css({opacity:0,height:"0"}))}};class PgPromises{constructor(e){return this.settingView={qris:[],toppay:[]},this.dataBank={qris:["QRIS"],toppay:["VIRTUAL ACCOUNT","VIRTUALACCOUNT"]},this.template={qris:{mobile:{depan:`
						<div style="width: 100%; text-align: center;">
							<button id="buttonQrisOpen" class="buttons button-blue">BARCODE QRIS OTOMATIS</button>
							<div id="qris" style="justify-content: center; opacity:0%; height: 0">
								<iframe style="height: 100%; width: 100%" src="${baseUrl.qris}/qris/${baseCode}" title="Qris"></iframe>
							</div>
						<div>
					`,dalam:`
						<div class="form-group">
							<div id="qriscontainer" class="col-sm-12" style="opacity:0;">
								<h1 class="pesan-rahasia"> Setelah Generate QR dan Transfer QR Selesai,<br> Credit Langsung Masuk ke User ID. <br>Silahkan Refresh Akun Anda</h1>
								<h1 class="pesan-rahasia2" style="bottom: -475px;">CATATAN : <br>Barcode QRIS Diatas Hanya Dapat Digunakan 1 Kali.<br> Selalu Generate QR Ketika Melakukan Deposit.<br></h1>
								<iframe id="iframeqris" scrolling="no" style="height: 100%; width: 100%; overflow: ; margin-top: -75px;" src="${baseUrl.qris}/qris/${baseCode}"></iframe>
							</div>
						</div>
					`},desktop:`
					<div class="form-group">
						<div class="col-sm-4"></div>
						<div id="qriscontainer" class="col-sm-8" style="opacity: 0">
							<iframe id="iframeqris" scrolling="no" style="height: 100%; width: 100%; overflow: hidden; border:none" src="${baseUrl.qris}/qris/${baseCode}">
							</iframe>
						</div>
					</div>
				`},toppay:{mobile:`
				<div class="form-group">
					<div id="toppaycontainer" class="col-sm-8" style="opacity:0;">
						<h1 class="pesan-rahasia"> Setelah pembayaran kami terima<br> Credit Langsung Masuk ke User ID. <br>Silahkan Refresh Akun Anda</h1>
						<h1 class="pesan-rahasia2" style="bottom: -510px;">CATATAN : <br>Virtual Account Diatas Hanya Dapat Digunakan 1 Kali.<br> Selalu Generate Virtual Account Ketika Melakukan Deposit.<br></h1>
						<iframe id="iframetoppay" scrolling="no" style="height: 100%; width: 100%; overflow: ; margin-top: -75px;" src="${baseUrl.toppay}/toppay/${baseCode}"></iframe>
					</div>
				</div>
			`,desktop:`
				<div class="form-group">
					<div class="col-sm-4"></div>
					<div id="toppaycontainer" class="col-sm-8" style="opacity: 0;">
						<iframe id="iframetoppay" scrolling="no" style="height: 100%; width: 100%; overflow: hidden; border:none" src="${baseUrl.toppay}/toppay/${baseCode}"></iframe>
					</div>
				</div>
			`}},this}async refAsyn(){return new Promise(e=>requestAnimationFrame(e))}async finder(e){return null===document.querySelector(e)?this.refAsyn().then(()=>this.finder(e)):Promise.resolve(e)}DesktopAfterLogin(e){const{settingView:t,template:a,dataBank:i}=this,n=$(e);let s=n.parent().next().next().next(),o=n.parent().parent().next(),r=n.parent().parent().next().next(),l=$("#kirimkan"),p=$("#hapuskan"),d=$("#current-user").text().trim().split(" ").at(),c=$("#copyid").parent(),h=null,u=null,f=null,m=null,y=null,g=null,v={qris:"350px",toppay:"400px"};t.qris.includes(1)&&(h=$(a.qris.desktop),u=h.find("#qriscontainer"),f=u.find("iframe"),h.hide(),h.insertAfter(o),f.load(function(){this.contentWindow.postMessage(JSON.stringify({username:d}),"*")})),t.toppay.includes(1)&&(m=$(a.toppay.desktop),y=m.find("#toppaycontainer"),g=y.find("iframe"),m.hide(),m.insertAfter(o),g.load(function(){this.contentWindow.postMessage(JSON.stringify({username:d}),"*")}));e=window.addEventListener?"addEventListener":"attachEvent";(0,window[e])("attachEvent"==e?"onmessage":"message",function(t){if("string"==typeof t.data)if("myevent"===t.data)v.qris="450px",u.animate({height:v.qris},1e3);else if(t.data.includes("databtoa")){var a=JSON.parse(atob(t.data.replaceAll("databtoa:","")));i.qris=a.bank,n.trigger("change")}else if("toppayEvent"==t.data)v.toppay="480px",y.animate({height:v.toppay},1e3);else if(t.data.includes("toppay")){JSON.parse(atob(t.data.replaceAll("toppay:","")));let e=n.find("option:selected").text();a={val:e=e.toLowerCase().includes("virtual account")?"VIRTUAL ACCOUNT":e.split(",").at(),infoRek:s,jmlDepo:o,infoMin:r,btnKirim:l,btnHapus:p,templateQris:h,templateToppay:m,parentIframeQris:u,parentIframeToppay:y,iframeToppay:g,h:v,dataBank:i};eventSelect.DesktopAfterLogin(a)}}),n.change(function(){let e=$(this).find("option:selected").text();var t={val:e=(e=e.toLowerCase().includes("virtual account")?"VIRTUAL ACCOUNT":e.split(",").at()).trim(),infoRek:s,jmlDepo:o,infoMin:r,btnKirim:l,btnHapus:p,templateQris:h,templateToppay:m,parentIframeQris:u,parentIframeToppay:y,iframeToppay:g,h:v,dataBank:i,targetInputRekening:c};eventSelect.DesktopAfterLogin(t)}),n.trigger("change")}DesktopAfterLogin1(i){const{settingView:e,template:t,dataBank:n}=this;let a=$("#current-user").text().match(/.*(IDR|idr)/gm).at().trim().split(" ").at(),s=null,o=null,r=null,l=null,p=null,d=null,c={qris:"350px",toppay:"400px"},h=$(i).find("#hide_for_accountname");e.qris.includes(1)&&(s=$(t.qris.desktop),o=s.find("#qriscontainer"),r=o.find("iframe"),s.hide(),s.find(".col-sm-4").remove(),s.find(".col-sm-8").removeClass("col-sm-8").addClass("col-sm-12"),h.append(s),r.load(function(){this.contentWindow.postMessage(JSON.stringify({username:a}),"*")})),e.toppay.includes(1)&&(l=$(t.toppay.desktop),p=l.find("#toppaycontainer"),d=p.find("iframe"),l.hide(),l.find(".col-sm-4").remove(),l.find(".col-sm-8").removeClass("col-sm-8").addClass("col-sm-12"),h.append(l),d.load(function(){this.contentWindow.postMessage(JSON.stringify({username:a,infoStyle:{color:"currentColor"}}),"*")}));var u=window.addEventListener?"addEventListener":"attachEvent";(0,window[u])("attachEvent"==u?"onmessage":"message",function(e){var t;"string"==typeof e.data&&("myevent"===e.data?(c.qris="450px",o.animate({height:c.qris},1e3)):e.data.includes("databtoa")?(t=JSON.parse(atob(e.data.replaceAll("databtoa:",""))),n.qris=t.bank,f()):"toppayEvent"==e.data?(c.toppay="450px",p.animate({height:c.toppay},1e3)):e.data.includes("toppay")&&JSON.parse(atob(e.data.replaceAll("toppay:",""))))});const f=()=>{var e=$(i).find('input[name="selected-bank"]'),t=$(i).find('input[name="selected-bank"]:checked').parent().find("img").attr("alt");const a=t=>{var e,a=window.currentChildrenList;a&&({nama_rek:a,no_rek:e}=a.find(e=>e.name==t),a.toLowerCase().includes("virtual account")||e.toLowerCase().includes("virtual account"))&&(t="VIRTUAL ACCOUNT"),eventSelect.DesktopAfterLogin1({dataBank:n,val:t,targetIframe:h,templateQris:s,templateToppay:l,parentIframeQris:o,parentIframeToppay:p,iframeToppay:d,h:c})};""!=t&&a(t),e.change(function(e){e=$(e.target).parent().find("img").attr("alt");a(e)})};f();u=document.querySelector("#other-mop");new MutationObserver(function(e){f()}).observe(u,{attributes:!0,childList:!0,characterData:!0})}MobileBeforeLogin(e){var e=$(e),{template:a,settingView:i}=this;if(i.qris.includes(2)){i=$(a.qris.mobile.depan);const n=i.find("#buttonQrisOpen"),s=i.find("#qris");i.insertBefore(e);let t="355px";n.click(()=>{n.hasClass("frame-active")?(n.removeClass("frame-active"),s.animate({opacity:0,height:"0"},1e3)):(n.addClass("frame-active"),s.animate({opacity:1,height:t},1e3))});a=window.addEventListener?"addEventListener":"attachEvent";(0,window[a])("attachEvent"==a?"onmessage":"message",function(e){"myevent"===e.data&&(t="450px",s.animate({height:t},1e3))})}}MobileAfterLogin(e){const{settingView:t,template:a,dataBank:i}=this,n=$(e);e=$(e).closest("form");const s=e.find("select"),o=e.find('input[name="jumlah"]').closest(".form-group"),r=e.find('input[type="submit"]').closest(".formSubmitButtonErrorsWrap");let l=$(".user-login").text().toLowerCase().trim(),p=(""==l&&(l=$(".mb-lobby-username").text().toLowerCase().trim()),null),d=null,c=null,h=null,u=null,f=null;const m={qris:"430px",toppay:"500px"};t.qris.includes(3)&&urlManifest.qris.status&&(p=$(a.qris.mobile.dalam),d=p.find("#qriscontainer"),c=d.find("iframe"),p.hide(),p.insertAfter(n),c.load(function(){this.contentWindow.postMessage(JSON.stringify({username:l}),"*")})),t.toppay.includes(3)&&urlManifest.toppay.status&&(h=$(a.toppay.mobile),u=h.find("#toppaycontainer"),f=u.find("iframe"),h.hide(),h.insertAfter(n),f.load(function(){this.contentWindow.postMessage(JSON.stringify({username:l}),"*")}));e=window.addEventListener?"addEventListener":"attachEvent";(0,window[e])("attachEvent"==e?"onmessage":"message",function(t){if("myevent"===t.data)m.qris="633px",d.animate({height:m.qris},1e3);else if(t.data.includes("databtoa")){var a=JSON.parse(atob(t.data.replaceAll("databtoa:","")));i.qris=a.bank,s.trigger("change")}else if("toppayEvent"==t.data)m.toppay="670px",u.animate({height:m.toppay},1e3);else if(t.data.includes("toppay")){JSON.parse(atob(t.data.replaceAll("toppay:","")));let e=s.val();a={val:e=e.toLowerCase().includes("virtual account")?"VIRTUAL ACCOUNT":e.split(",").at(),templateQris:p,templateToppay:h,parentIframeQris:d,parentIframeToppay:u,infoRek:n,containerJumlah:o,containerBtn:r,dataBank:i,iframeToppay:f,h:m};eventSelect.MobileAfterLogin(a)}}),s.change(function(){let e=$(this).val();var t={val:e=(e=e.toLowerCase().includes("virtual account")?"VIRTUAL ACCOUNT":e.split(",").at()).trim(),templateQris:p,templateToppay:h,parentIframeQris:d,parentIframeToppay:u,infoRek:n,containerJumlah:o,containerBtn:r,dataBank:i,iframeToppay:f,h:m};eventSelect.MobileAfterLogin(t)}),s.trigger("change")}MobileAfterLogin1(u){const{settingView:f,template:m,dataBank:y}=this;this.finder("#bankDropDown.dd-container").then(e=>{const a=$(u).find("#bankDropDown");let i=$(u).children();var t=$(i[5]);const n=$(".mb-lobby-username").text().toLowerCase().trim();let s=null,o=null,r=null,l=null,p=null,d=null;const c={qris:"430px",toppay:"480px"};f.qris.includes(3)&&(s=$(m.qris.mobile.dalam),o=s.find("#qriscontainer"),r=o.find("iframe"),s.hide(),s.insertAfter(t),r.load(function(){this.contentWindow.postMessage(JSON.stringify({username:n}),"*")})),f.toppay.includes(3)&&(l=$(m.toppay.mobile),p=l.find("#toppaycontainer"),d=p.find("iframe"),l.hide(),l.insertAfter(t),d.load(function(){this.contentWindow.postMessage(JSON.stringify({username:n}),"*")}));t=window.addEventListener?"addEventListener":"attachEvent";(0,window[t])("attachEvent"==t?"onmessage":"message",function(e){var t;"myevent"===e.data?(c.qris="633px",o.animate({height:c.qris},1e3)):e.data.includes("databtoa")?(t=JSON.parse(atob(e.data.replaceAll("databtoa:",""))),y.qris=t.bank,t=a.find("ul.dd-options li a.dd-option.dd-option-selected .dd-option-text").text(),h(t)):"toppayEvent"==e.data?(c.toppay="660px",p.animate({height:c.toppay},1e3)):e.data.includes("toppay")&&JSON.parse(atob(e.data.replaceAll("toppay:","")))});const h=t=>{var e,a=window.currentChildrenList;a&&({nama_rek:a,no_rek:e}=a.find(e=>e.name==t),a.toLowerCase().includes("virtual account")||e.toLowerCase().includes("virtual account"))&&(t="VIRTUAL ACCOUNT"),eventSelect.MobileAfterLogin1({val:t,templateQris:s,templateToppay:l,parentIframeQris:o,parentIframeToppay:p,child:i,dataBank:y,iframeToppay:d,h:c})};t=a.find("ul.dd-options li a.dd-option.dd-option-selected .dd-option-text").text();h(t),a.find("ul.dd-options li a.dd-option").click(function(e){e=$(e.target).closest("ul").find("li a.dd-option.dd-option-selected .dd-option-text").text();h(e)})})}}const init=e=>{const s=new PgPromises(e);let o=0;Object.keys(urlManifest).forEach((t,e,a)=>{let{status:i,url:n}=urlManifest[t];(i="string"==typeof i?"true"===i.toLowerCase():i)?fetch(n).then(e=>e.json()).then(e=>{o++,e.status&&(s.settingView[t]=e.data.split(",").map(e=>Number(e)),o==a.length)&&target.filter(e=>s.settingView.qris.includes(e.type)||s.settingView.toppay.includes(e.type)).forEach(e=>{e.data.forEach(t=>s.finder(t.name).then(e=>setTimeout(()=>s[t.func](e),500)))})})["catch"](e=>{console.log(e),o++}):o++})},defer=e=>{window.jQuery?e(window.jQuery):setTimeout(()=>defer(e),10)};defer(init);