(()=>{function t(o){"@babel/helpers - typeof";return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(o)}window.jQuery(document).ready(function(o){var e=function t(o,e){o.prop("disabled",!e);!e?o.addClass("is-loading"):o.removeClass("is-loading")};o("#tutor-gc-student-password-set button").click(function(){var t=o(this);var a=t.parent().parent();var r=a.find('[name="password-1"]').val();var n=a.find('[name="password-2"]').val();var s=a.find('[name="token"]').val();if(!r||!n||r!==n){alert("Invalid Password");return}e(t,false);o.ajax({url:window._tutorobject.ajaxurl,data:{action:"tutor_gc_student_set_password",token:s,password:r},type:"POST",success:function t(o){window.location.replace(window._tutorobject.tutor_frontend_dashboard_url)},error:function o(){e(t,true);alert("Request Failed.")}})});o("[tutor-gc-stream-loader]").click(function(e){e.preventDefault();var a=o(this);var r=a.data("next_token");var n=a.data("course_id");o.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:{next_token:r,action:"tutor_gc_load_more_stream",course_id:n},beforeSend:function t(){a.addClass("is-loading")},success:function e(r){try{r=JSON.parse(r)}catch(t){}a.removeClass("is-loading");if(t(r)=="object"){if(!r.html||/\S+/.test(r.html)==false){a.remove();return}a.data("next_token",r.next_token);o("[tutor-gc-streams]").append(r.html);!r.next_token?a.remove():0}},error:function t(){a.removeClass("is-loading")}})})})})();