var LLMS=window.LLMS||{};!function(l){"use strict";var t,e,n;LLMS.Achievements={init:function(){var t;l(".llms-achievement").length&&(t=this,l(function(){t.bind(),t.maybe_open()}))},bind:function(){var n=this;l(".llms-achievement").each(function(){n.create_modal(l(this))}),l(".llms-achievement").on("click",function(){var t=l(this),e="achievement-"+t.attr("data-id"),e=l("#"+e);e.length||n.create_modal(t),e.iziModal("open")})},create_modal:function(e){var t="achievement-"+e.attr("data-id"),n=l("#"+t);n.length||(n=l('
'),l("body").append(n)),n.iziModal({headerColor:"#3a3a3a",group:"achievements",history:!0,loop:!0,overlayColor:"rgba( 0, 0, 0, 0.6 )",transitionIn:"fadeInDown",transitionOut:"fadeOutDown",width:340,onOpening:function(t){t.setTitle(e.find(".llms-achievement-title").html()),t.setSubtitle(e.find(".llms-achievement-date").html()),t.setContent('
'+e.html()+"
")},onClosing:function(){window.history.pushState("",document.title,window.location.pathname+window.location.search)}})},maybe_open:function(){var t=window.location.hash.split("-");2===t.length&&(t[1]=parseInt(t[1]),"#achievement-"===t[0]&&Number.isInteger(t[1])&&(t=document.querySelector(`a[href="${t.join("-")}"]`))&&t.click())}},LLMS.Ajax={url:window.ajaxurl||window.llms.ajaxurl,type:"post",data:[],cache:!1,dataType:"json",async:!0,response:[],init:function(t){if(null===t||"object"!=typeof t)return!1;t.url=("url"in t?t:this).url,t.type=("type"in t?t:this).type,t.data=("data"in t?t:this).data,t.cache=("cache"in t?t:this).cache,t.dataType=("dataType"in t?t:this).dataType,t.async=("async"in t?t:this).async,t.data._ajax_nonce=window.llms.ajax_nonce||wp_ajax_data.nonce;var e=LLMS.Rest.get_query_vars();return t.data.post_id="post"in e?e.post:null,!t.data.post_id&&l("input#post_ID").length&&(t.data.post_id=l("input#post_ID").val()),t},call:function(t){t=this.init(t);return!!t&&(this.request(t),this)},request:function(t){return l.ajax(t),this}},LLMS.Donut=function(t){function e(t){this.settings=l.extend({element:t.element,percent:100},t),this.circle=this.settings.element.find("path"),this.settings.stroke_width=parseInt(this.circle.css("stroke-width")),this.radius=(parseInt(this.settings.element.css("width"))-this.settings.stroke_width)/2,this.angle=l("body").hasClass("rtl")?82.5:97.5,this.i=Math.round(.75*this.settings.percent),this.first=!0,this.increment=l("body").hasClass("rtl")?-5:5,this.animate=function(){this.timer=setInterval(this.loop.bind(this),10)},this.loop=function(){this.angle+=this.increment,this.angle%=360;var t,e=this.angle/180*Math.PI,n=this.radius+this.settings.stroke_width/2+Math.cos(e)*this.radius,e=this.radius+this.settings.stroke_width/2+Math.sin(e)*this.radius;!0===this.first?(t=this.circle.attr("d")+" M "+n+" "+e,this.first=!1):t=this.circle.attr("d")+" L "+n+" "+e,this.circle.attr("d",t),this.i--,this.i<=0&&clearInterval(this.timer)}}(t=t).append(''),new e({element:t,percent:t.attr("data-perc")}).animate()},LLMS.Forms={address_info:{},$cities:null,$countries:null,$states:null,$states_holder:null,init:function(){var t;l("body").hasClass("wp-admin")&&!l("body").hasClass("profile-php")&&!l("body").hasClass("user-edit-php")||((t=this).bind_matching_fields(),t.bind_voucher_field(),t.bind_edit_account(),t.bind_l10n_selects())},bind_edit_account:function(){l("form.llms-person-form.edit-account").length&&l(".llms-toggle-fields").on("click",this.handle_toggle_click)},bind_l10n_selects:function(){var e=this;e.$cities=l("#llms_billing_city"),e.$countries=l(".llms-l10n-country-select select"),e.$states=l(".llms-l10n-state-select select"),e.$zips=l("#llms_billing_zip"),e.$countries.length&&LLMS.wait_for(function(){return void 0!==l.fn.llmsSelect2},function(){e.$states.length&&e.prep_state_field(),e.$countries.add(e.$states).llmsSelect2({width:"100%"}),window.llms.address_info&&(e.address_info=JSON.parse(window.llms.address_info)),e.$countries.on("change",function(){var t=l(this).val();e.update_locale_info(t)}).trigger("change")},"llmsSelect2")},bind_matching_fields:function(){l("input[data-match]").not('[type="password"]').each(function(){var n,i=l(this),s=l("#"+i.attr("data-match"));s.length&&(n=i.closest(".llms-form-field").add(s.closest(".llms-form-field")),i.on("input change",function(){var t=i.val(),e=s.val();t&&e&&t!==e?n.addClass("invalid"):n.removeClass("invalid")}))})},bind_voucher_field:function(){l("#llms-voucher-toggle").on("click",function(t){t.preventDefault(),l("#llms_voucher").toggle()})},get_field_parent:function(t){return t.closest(".llms-form-field")},get_label_text:function(t){t=t.clone();return t.find("*").remove(),t.text().trim()},handle_toggle_click:function(t){t.preventDefault();var t=l(this),e=l(l(this).attr("data-fields")),n=t.attr("data-is-showing")||"no",i="yes"===n?"hide":"show",s="yes"===n?"disabled":null,o="yes"===n?"data-change-text":"data-cancel-text";e.each(function(){l(this).closest(".llms-form-field")[i](),l(this).attr("disabled",s)}),t.text(t.attr(o)),t.attr("data-is-showing","yes"===n?"no":"yes")},prep_state_field:function(){var t=this.$states.closest(".llms-form-field");this.$holder=l('",{name:t.attr("name"),class:t.attr("class")+" hidden",type:"hidden"}).insertAfter(t),t.attr("disabled","disabled"),this.get_field_parent(t).hide()},enable_field:function(t){t.removeAttr("disabled"),t.next(".hidden[name="+t.attr("name")+"]").detach(),this.get_field_parent(t).show()}},LLMS.Instructors={init:function(){var t=this;l("body").hasClass("wp-admin")||l(".llms-instructors").length&&LLMS.wait_for_matchHeight(function(){t.bind()})},bind:function(){l(".llms-instructors .llms-author").matchHeight()}},LLMS.l10n=LLMS.l10n||{},LLMS.l10n.translate=function(t){return this.strings[t]||t},LLMS.l10n.replace=function(t,e){var n=this.translate(t);return l.each(e,function(t,e){-1!==t.indexOf("s")?e=e.toString():-1!==t.indexOf("d")&&(e=+e),n=n.replace(t,e)}),n},LLMS.LessonPreview={$els:null,init:function(){var t=this;this.$locked=l('a[href="#llms-lesson-locked"]'),this.$locked.length&&t.bind(),l(".llms-course-navigation").length&&LLMS.wait_for_matchHeight(function(){t.match_height()})},bind:function(){var n=this;this.$locked.on("click",function(){return!1}),this.$locked.on("mouseenter",function(){var t,e=l(this).find(".llms-tooltip");e.length||(t=(t=l(this).attr("data-tooltip-msg"))||LLMS.l10n.translate("You do not have permission to access this content"),e=n.get_tooltip(t),l(this).append(e)),setTimeout(function(){e.addClass("show")},10)}),this.$locked.on("mouseleave",function(){l(this).find(".llms-tooltip").removeClass("show")})},match_height:function(){l(".llms-course-navigation .llms-lesson-link").matchHeight()},get_tooltip:function(t){var e=l('
');return e.append('
'+t+"
"),e}},LLMS.Loops={init:function(){var t=this;l(".llms-loop").length&&LLMS.wait_for_matchHeight(function(){t.match_height()})},match_height:function(){l(".llms-loop-item .llms-loop-item-content").matchHeight(),l(".llms-achievement-loop-item .llms-achievement").matchHeight(),l(".llms-certificate-loop-item .llms-certificate").matchHeight()}},LLMS.OutlineCollapse={$outlines:null,init:function(){this.$outlines=l(".llms-widget-syllabus--collapsible"),this.$outlines.length&&this.bind()},bind:function(){var i=this;this.$outlines.each(function(){var t=l(this),e=t.find(".llms-section .section-header");e.on("click",function(t){t.preventDefault();var e=l(this).closest(".llms-section");switch(i.get_section_state(e)){case"closed":i.open_section(e);break;case"opened":i.close_section(e)}}),t.find(".llms-collapse-toggle").on("click",function(t){t.preventDefault();var n="close"===l(this).attr("data-action")?"opened":"closed";e.each(function(){var t=l(this).closest(".llms-section"),e=i.get_section_state(t);if(n!==e)return!0;switch(e){case"closed":i.close_section(t);break;case"opened":i.open_section(t)}l(this).trigger("click")})})})},close_section:function(t){t.removeClass("llms-section--opened").addClass("llms-section--closed")},open_section:function(t){t.removeClass("llms-section--closed").addClass("llms-section--opened")},get_section_state:function(t){return t.hasClass("llms-section--opened")?"opened":"closed"}},l.extend(LLMS.PasswordStrength,{$meter:l(".llms-password-strength-meter"),$pass:null,$conf:null,$form:null,init:function(){var t;l("body").hasClass("wp-admin")||this.setup_references()&&(t=this,LLMS.wait_for(function(){return"undefined"!=typeof wp&&void 0!==wp.passwordStrength},function(){t.bind(),t.$form.trigger("llms-password-strength-ready")}))},bind:function(){var t=this;this.$form.hasClass("llms-checkout")||t.$form.on("submit",t,t.submit),t.$pass.add(t.$conf).on("keyup",function(){t.check_strength()})},check_strength:function(){var t=this.$pass.closest(".llms-form-field"),e=this.$conf&&this.$conf.length?this.$conf.closest(".llms-form-field"):null,n=this.$pass.val().length,i=this.$conf&&this.$conf.length?this.$conf.val().length:0;n||i?(this.get_current_strength_status()?(t.removeClass("invalid").addClass("valid"),i&&e.removeClass("invalid").addClass("valid")):(t.removeClass("valid").addClass("invalid"),i&&e.removeClass("valid").addClass("invalid")),this.$meter.removeClass("too-short very-weak weak medium strong mismatch"),this.$meter.show().addClass(this.get_current_strength("slug")),this.$meter.html(this.get_current_strength("text"))):(t.removeClass("valid invalid"),e&&e.removeClass("valid invalid"),this.$meter.hide())},checkout:function(t,e){t.get_current_strength_status()?e(!0):e(LLMS.l10n.translate("There is an issue with your chosen password."))},get_blocklist:function(){var e=wp.passwordStrength.userInputDisallowedList().concat(this.get_setting("blocklist",[]));return this.$form.find('input[type="text"], input[type="email"], input[type="tel"], input[type="number"]').each(function(){var t=l(this).val();t&&e.push(t)}),e},get_current_strength:function(t){t=t||"int";var e,n=this.$pass.val(),i=this.$conf&&this.$conf.length?this.$conf.val():"";return n.length');return e.append(t.$element.closest(".llms-access-plan").find(".llms-access-plan-restrictions ul").clone()),e},placement:"top",style:"inverse",title:LLMS.l10n.translate("Members Only Pricing"),width:"280px"})})}},LLMS.Quiz_Attempt={init:function(){l(".llms-quiz-attempt-question-header a.toggle-answer").on("click",function(t){t.preventDefault();t=l(this).closest("header").next(".llms-quiz-attempt-question-main");l(this).closest("li").siblings().find(".llms-quiz-attempt-question-main").slideUp(200),t.is(":visible")?t.slideUp(200):t.slideDown(200)})}},LLMS.Review={init:function(){this.bind()},bind:function(){l("#llms_review_submit_button").click(function(){""!==l("#review_title").val()&&""!==l("#review_text").val()?jQuery.ajax({type:"post",dataType:"json",url:window.llms.ajaxurl,data:{action:"LLMSSubmitReview",review_title:l("#review_title").val(),review_text:l("#review_text").val(),pageID:l("#post_ID").val(),llms_review_nonce:l("#llms_review_nonce").val()},success:function(){console.log("Review success"),l("#review_box").hide("swing"),l("#thank_you_box").show("swing")},error:function(t,e,n){console.log(t),console.log(e),console.log(n)}}):(""===l("#review_title").val()?l("#review_title_error").show("swing"):l("#review_title_error").hide("swing"),""===l("#review_text").val()?l("#review_text_error").show("swing"):l("#review_text_error").hide("swing"))}),l("#_llms_display_reviews").attr("checked")?(l(".llms-num-reviews-top").addClass("top"),l(".llms-num-reviews-bottom").show()):l(".llms-num-reviews-bottom").hide(),l("#_llms_display_reviews").change(function(){l("#_llms_display_reviews").attr("checked")?(l(".llms-num-reviews-top").addClass("top"),l(".llms-num-reviews-bottom").show()):(l(".llms-num-reviews-top").removeClass("top"),l(".llms-num-reviews-bottom").hide())})}},t=function(){function a(){for(var t=0,e={};ts.get("events",[]).length&&(e=s.getAll(),s.clear("events"),e.events.push(t),LLMS.Ajax.call({data:{action:"persist_tracking_events","llms-tracking":JSON.stringify(e)},error:function(t,e,n){console.log(t,e,n)},success:function(t){"error"===t.code&&console.log(t.code,t.message)}})))},this.getSettings=function(){return n},this.makeEventObj=function(t){return l.extend(t,{url:window.location.href,time:Math.round((new Date).getTime()/1e3)})},l("body").hasClass("wp-admin")||(i.addEvent("page.load"),window.addEventListener("beforeunload",t),window.addEventListener("unload",e),document.addEventListener("visibilitychange",o))},llms.tracking=new LLMS.Tracking(llms.tracking),LLMS.Rest={init:function(){this.bind()},bind:function(){},is_path:function(t){for(var e=!1,n=window.location.href,i=0;i{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},s={};i.r(s),i.d(s,{get:()=>o,start:()=>function(t){let e=1{t=o(t,e,!1);t&&(t.style.display="block")})},stop:()=>function(t){a(t).forEach(t=>{t=o(t,c,!1);t&&(t.style.display="none")})}});const r="llms-spinning",c="default",d=window.wp.i18n;function a(t){if((t="string"==typeof t?document.querySelectorAll(t):t)instanceof NodeList)return Array.from(t);const e=[];return t instanceof Element?e.push(t):"undefined"!=typeof jQuery&&t instanceof jQuery&&t.toArray().forEach(t=>e.push(t)),e}function o(t){var e,n,i=1n===t.parentNode):null)||function(t,e){var e=1${i}`,n.classList.add(r),t.appendChild(n),n}(e,i),s&&"undefined"!=typeof jQuery?jQuery(o):o):null}window.LLMS=window.LLMS||{},window.LLMS.Spinner=s}LLMS.init=function(){for(var t in LLMS)"object"==typeof LLMS[t]&&null!==LLMS[t]&&void 0!==LLMS[t].init&&"function"==typeof LLMS[t].init&&LLMS[t].init()},LLMS.is_touch_device=function(){var t=" -webkit- -moz- -o- -ms- ".split(" ");return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)||(t=["(",t.join("touch-enabled),("),"heartz",")"].join(""),window.matchMedia(t).matches)},LLMS.wait_for_matchHeight=function(t){this.wait_for(function(){return void 0!==l.fn.matchHeight},t,"matchHeight")},LLMS.wait_for_popover=function(t){this.wait_for(function(){return void 0!==l.fn.webuiPopover},t,"webuiPopover")},LLMS.wait_for=function(t,e,n){var i,s=0;n=n||"unnamed",i=setInterval(function(){if(300<=s)console.log("Unable to load dependency: "+n);else{if(!t())return void s++;e()}clearInterval(i)},100)},LLMS.init(l)}(jQuery); //# sourceMappingURL=../maps/js/llms.min.js.map