!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=68)}({0:function(t,e,r){t.exports=r(5)},3:function(t,e,r){"use strict";r.d(e,"a",(function(){return d}));var n=r(0),o=r.n(n),a=["body"];function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function l(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function f(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){l(a,n,o,i,c,"next",t)}function c(t){l(a,n,o,i,c,"throw",t)}i(void 0)}))}}function d(t){return p.apply(this,arguments)}function p(){return(p=f(o.a.mark((function t(e){var r,n,i,u,l,f,d,p=arguments;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=p.length>1&&void 0!==p[1]?p[1]:{},n=r.body,i=s(r,a),u={"Content-Type":"application/json"},l=c(c({method:n?"POST":"GET"},i),{},{headers:c(c({},u),i.headers)}),n&&(l.body=JSON.stringify(n)),t.prev=5,t.next=8,window.fetch(e,l);case 8:return d=t.sent,t.next=11,d.json();case 11:if(f=t.sent,!d.ok){t.next=14;break}return t.abrupt("return",{status:d.status,data:f,headers:d.headers,url:d.url});case 14:throw new Error(d.statusText);case 17:return t.prev=17,t.t0=t.catch(5),t.abrupt("return",Promise.reject(t.t0.message?t.t0.message:f));case 20:case"end":return t.stop()}}),t,null,[[5,17]])})))).apply(this,arguments)}d.get=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return d(t,c(c({},e),{},{method:"GET"}))},d.post=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return d(t,c(c({},r),{},{body:e}))}},5:function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new L(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return j()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=w(i,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function f(){}function d(){}function p(){}var h={};c(h,o,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(O([])));m&&m!==e&&r.call(m,o)&&(h=m);var y=p.prototype=f.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(o,a){function i(){return new e((function(n,i){!function n(o,a,i,c){var u=s(t[o],t,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,c)}))}c(u.arg)}(o,a,n,i)}))}return n=n?n.then(i,i):i()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:j}}function j(){return{value:void 0,done:!0}}return d.prototype=p,c(y,"constructor",p),c(p,"constructor",d),d.displayName=c(p,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new b(u(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),c(y,i,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},68:function(t,e,r){t.exports=r(69)},69:function(t,e,r){"use strict";r.r(e);var n,o=r(0),a=r.n(o),i=r(3);function c(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){c(a,n,o,i,u,"next",t)}function u(t){c(a,n,o,i,u,"throw",t)}i(void 0)}))}}var s=document.querySelectorAll("input[type='tel']");document.getElementById("bank-account-number").addEventListener("input",(function(t){if(-1===n.toLowerCase().indexOf("crypto")){var e,r=(null===(e=t.target.value.replace(/-/g,"").match(/.{1,3}/g))||void 0===e?void 0:e.join("-"))||"";t.target.value=r}})),document.getElementById("bank-name").addEventListener("change",(function(t){n=t.target.value}));var l=document.querySelector(".btn-captcha-refresh"),f=l.querySelector("i");l.addEventListener("click",(function(){f.classList.add("fa-spin"),d()}));var d=function(){var t=u(a.a.mark((function t(){var e,r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return document.getElementById("captcha").value="",t.prev=1,t.next=4,i.a.get("/api/captcha/new");case 4:e=t.sent,r=e.data,document.querySelector(".refreshrecaptcha img").src=r.captcha_img,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),console.log(t.t0);case 13:f.classList.remove("fa-spin");case 14:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(){return t.apply(this,arguments)}}(),p=function(){var t=u(a.a.mark((function t(e){var r,n,o,c,u,s;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r={},e.forEach((function(t,e){r[e]=t})),t.next=5,i.a.post("/api/register/post",r,{headers:{"X-CSRF-TOKEN":document.querySelector("meta[name='csrf-token']").getAttribute("content"),"X-Requested-With":"XMLHttpRequest"}});case 5:if(n=t.sent,o=n.data.status,c=n.data.message,o){if(y(),void 0!==(u=n.data.message.errors)){for(s in u)u.hasOwnProperty(s)&&m(s,u[s]);d()}else document.getElementById("success-reg").classList.remove("d-none"),document.getElementById("success-reg").innerText=n.data.message.message,setTimeout((function(){document.getElementById("success-reg").innerText="Redirecting...",document.location.href="/rules"}),1e3);v("inactive",c)}else v("active",c),d();t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),console.log(t.t0);case 14:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}(),h=document.getElementById("error-reg"),v=function(t,e){"active"==t?(h.classList.remove("d-none"),h.innerText=e):(h.classList.add("d-none"),h.innerText="")},m=function(t,e){var r=t.replace(/_/g,"-");document.querySelector(".form-group.".concat(r," .formInput")).insertAdjacentHTML("beforeend",'<small class="notice margin-t-10">'.concat(e,"</small>")),document.querySelector(".form-group.".concat(r," input")).classList.add("invalid-input")},y=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(t){var e=document.querySelector(".form-group.".concat(t," .formInput .invalid-input")),r=document.querySelector(".form-group.".concat(t," .formInput small.notice"));e&&r&&(e.classList.remove("invalid-input"),r.remove())}else{var n=document.querySelectorAll(".form-group .formInput .invalid-input"),o=document.querySelectorAll(".form-group .formInput small.notice");n.forEach((function(t){t&&t.classList.remove("invalid-input")})),o.forEach((function(t){t.remove()}))}},g=function(t,e){var r=document.querySelector(".form-group.".concat(t," .formInput")),n=document.querySelector(".form-group.".concat(t," .formInput .form-assign"));n&&n.remove();r.insertAdjacentHTML("beforeend",'<div class="form-assign"><i class="fa '.concat({success:"fa-check",error:"fa-times"}[e],'" aria-hidden="true"></i></div>'))},b=document.getElementById("register-form");b.addEventListener("submit",(function(t){if(t.preventDefault(),L>100)if(r=document.querySelector('input[name="agree1"]'),n=document.querySelector('input[name="agree2"]'),r.checked&&n.checked){var e=new FormData(b);p(e)}else v("active","Anda harus menyetujui peraturan yang berlaku.");var r,n}));var w=document.getElementById("phone-number");w.addEventListener("input",(function(){w.value.startsWith("0")&&(w.value=w.value.substring(1))}));var E,x=document.querySelectorAll('input[data-checking="true"]'),L=0;x.forEach((function(t){t.addEventListener("input",(function(t){clearTimeout(E),E=setTimeout((function(){O(t.target.name,t.target.value)}),500)}));var e=0;t.addEventListener("keyup",(function(t){var r=(new Date).getTime();0!=e&&(L+=r-e)})),t.addEventListener("keydown",(function(t){var r=(new Date).getTime();e=r}))}));var O=function(){var t=u(a.a.mark((function t(e,r){var n,o,c,u,s,l;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={},o=e.replace(/-/g,"_"),n.input=o,n[o]=r,"confirm-password"==e&&(n.password=document.getElementById("password").value),"bank-account-name"!=e&&"bank-account-number"!=e||(n.bank_name=document.getElementById("bank-name").value,"bank-account-number"==e&&(n.bank_account_number=r.replace(/-/g,""))),t.next=8,i.a.post("/api/register/validation",n,{headers:{"X-CSRF-TOKEN":document.querySelector("meta[name='csrf-token']").getAttribute("content"),"X-Requested-With":"XMLHttpRequest"}});case 8:c=t.sent,u=c.data.status,s=c.data.message,y(e),u&&((l=s.errors)?(m(e,l[o][0]),g(e,"error")):g(e,"success"));case 13:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}();document.addEventListener("DOMContentLoaded",(function(){s.forEach((function(t){t.addEventListener("input",(function(e){"bank-account-number"!=t.getAttribute("name")&&(this.value=this.value.replace(/\D/g,""))}))})),n=document.getElementById("bank-name").value,setTimeout((function(){d()}),1e3)}))}});