Tutor LMS – eLearning and online course solution - Version 2.0.8

Version Description

  • July 25, 2022

Fix: Settings was not being saved in some specific cases Fix: Settings was throwing a console error regarding TinyMCE Fix: Settings was being saved in other cases, but the "Save" button was not being marked as saved

Download this release

Release Info

Developer themeum
Plugin Icon wp plugin Tutor LMS – eLearning and online course solution
Version 2.0.8
Comparing to
See all releases

Code changes from version 2.0.7 to 2.0.8

assets/js/tutor-admin.min.js CHANGED
@@ -27,4 +27,4 @@ object-assign
27
  *
28
  * This source code is licensed under the MIT license found in the
29
  * LICENSE file in the root directory of this source tree.
30
- */var s=t(7418),n="function"===typeof Symbol&&Symbol.for,f=n?Symbol.for("react.element"):60103,u=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,i=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,D=n?Symbol.for("react.memo"):60115,F=n?Symbol.for("react.lazy"):60116,p="function"===typeof Symbol&&Symbol.iterator;function m(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function y(e,t,n){this.props=e;this.context=t;this.refs=v;this.updater=n||h}y.prototype.isReactComponent={};y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error(m(85));this.updater.enqueueSetState(this,e,t,"setState")};y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function g(){}g.prototype=y.prototype;function b(e,t,n){this.props=e;this.context=t;this.refs=v;this.updater=n||h}var w=b.prototype=new g;w.constructor=b;s(w,y.prototype);w.isPureReactComponent=!0;var E={current:null},x=Object.prototype.hasOwnProperty,_={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,n){var r,o={},a=null,i=null;if(null!=t)for(r in void 0!==t.ref&&(i=t.ref),void 0!==t.key&&(a=""+t.key),t)x.call(t,r)&&!_.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)void 0===o[r]&&(o[r]=l[r]);return{$$typeof:f,type:e,key:a,ref:i,props:o,_owner:E.current}}function q(e,t){return{$$typeof:f,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function S(e){return"object"===typeof e&&null!==e&&e.$$typeof===f}function R(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}var T=/\/+/g,C=[];function L(e,t,n,r){if(C.length){var o=C.pop();o.result=e;o.keyPrefix=t;o.func=n;o.context=r;o.count=0;return o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function P(e){e.result=null;e.keyPrefix=null;e.func=null;e.context=null;e.count=0;10>C.length&&C.push(e)}function N(e,t,n,r){var o=typeof e;if("undefined"===o||"boolean"===o)e=null;var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case f:case u:a=!0}}if(a)return n(r,e,""===t?"."+j(e,0):t),1;a=0;t=""===t?".":t+":";if(Array.isArray(e))for(var i=0;i<e.length;i++){o=e[i];var l=t+j(o,i);a+=N(o,l,n,r)}else if(null===e||"object"!==typeof e?l=null:(l=p&&e[p]||e["@@iterator"],l="function"===typeof l?l:null),"function"===typeof l)for(e=l.call(e),i=0;!(o=e.next()).done;)o=o.value,l=t+j(o,i++),a+=N(o,l,n,r);else if("object"===o)throw n=""+e,Error(m(31,"[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return a}function O(e,t,n){return null==e?0:N(e,"",t,n)}function j(e,t){return"object"===typeof e&&null!==e&&null!=e.key?R(e.key):t.toString(36)}function U(e,t){e.func.call(e.context,t,e.count++)}function B(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++);Array.isArray(e)?A(e,r,n,function(e){return e}):null!=e&&(S(e)&&(e=q(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(T,"$&/")+"/")+n)),r.push(e))}function A(e,t,n,r,o){var a="";null!=n&&(a=(""+n).replace(T,"$&/")+"/");t=L(t,a,r,o);O(e,B,t);P(t)}var I={current:null};function M(){var e=I.current;if(null===e)throw Error(m(321));return e}var H={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:E,IsSomeRendererActing:{current:!1},assign:s};e.Children={map:function(e,t,n){if(null==e)return e;var r=[];A(e,r,null,t,n);return r},forEach:function(e,t,n){if(null==e)return e;t=L(null,null,t,n);O(e,U,t);P(t)},count:function(e){return O(e,function(){return null},null)},toArray:function(e){var t=[];A(e,t,null,function(e){return e});return t},only:function(e){if(!S(e))throw Error(m(143));return e}};e.Component=y;e.Fragment=r;e.Profiler=a;e.PureComponent=b;e.StrictMode=o;e.Suspense=d;e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H;e.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error(m(267,e));var r=s({},e.props),o=e.key,a=e.ref,i=e._owner;if(null!=t){void 0!==t.ref&&(a=t.ref,i=E.current);void 0!==t.key&&(o=""+t.key);if(e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)x.call(t,u)&&!_.hasOwnProperty(u)&&(r[u]=void 0===t[u]&&void 0!==l?l[u]:t[u])}var u=arguments.length-2;if(1===u)r.children=n;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:f,type:e.type,key:o,ref:a,props:r,_owner:i}};e.createContext=function(e,t){void 0===t&&(t=null);e={$$typeof:l,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null};e.Provider={$$typeof:i,_context:e};return e.Consumer=e};e.createElement=k;e.createFactory=function(e){var t=k.bind(null,e);t.type=e;return t};e.createRef=function(){return{current:null}};e.forwardRef=function(e){return{$$typeof:c,render:e}};e.isValidElement=S;e.lazy=function(e){return{$$typeof:F,_ctor:e,_status:-1,_result:null}};e.memo=function(e,t){return{$$typeof:D,type:e,compare:void 0===t?null:t}};e.useCallback=function(e,t){return M().useCallback(e,t)};e.useContext=function(e,t){return M().useContext(e,t)};e.useDebugValue=function(){};e.useEffect=function(e,t){return M().useEffect(e,t)};e.useImperativeHandle=function(e,t,n){return M().useImperativeHandle(e,t,n)};e.useLayoutEffect=function(e,t){return M().useLayoutEffect(e,t)};e.useMemo=function(e,t){return M().useMemo(e,t)};e.useReducer=function(e,t,n){return M().useReducer(e,t,n)};e.useRef=function(e){return M().useRef(e)};e.useState=function(e){return M().useState(e)};e.version="16.14.0"},7294:(e,t,n)=>{"use strict";if(true){e.exports=n(2408)}else{}}};var o={};function Fe(e){var t=o[e];if(t!==undefined){return t.exports}var n=o[e]={exports:{}};r[e](n,n.exports,Fe);return n.exports}var e={};(()=>{"use strict";var g=Fe(4367);var P=Fe(7294);var x=Fe(3935);function T(e){"@babel/helpers - typeof";return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function N(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */N=function e(){return i};var i={},e=Object.prototype,s=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function e(t,n,r){return t[n]=r}}function l(e,t,n,r){var o=t&&t.prototype instanceof u?t:u,a=Object.create(o.prototype),i=new _(r||[]);return a._invoke=function(a,i,l){var u="suspendedStart";return function(e,t){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===e)throw t;return S()}for(l.method=e,l.arg=t;;){var n=l.delegate;if(n){var r=w(n,l);if(r){if(r===c)continue;return r}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===u)throw u="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);u="executing";var o=f(a,i,l);if("normal"===o.type){if(u=l.done?"completed":"suspendedYield",o.arg===c)continue;return{value:o.arg,done:l.done}}"throw"===o.type&&(u="completed",l.method="throw",l.arg=o.arg)}}}(e,n,i),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=l;var c={};function u(){}function d(){}function p(){}var m={};a(m,o,function(){return this});var h=Object.getPrototypeOf,v=h&&h(h(k([])));v&&v!==e&&s.call(v,o)&&(m=v);var y=p.prototype=u.prototype=Object.create(m);function g(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function b(l,u){function c(e,t,n,r){var o=f(l[e],l,t);if("throw"!==o.type){var a=o.arg,i=a.value;return i&&"object"==T(i)&&s.call(i,"__await")?u.resolve(i.__await).then(function(e){c("next",e,n,r)},function(e){c("throw",e,n,r)}):u.resolve(i).then(function(e){a.value=e,n(a)},function(e){return c("throw",e,n,r)})}r(o.arg)}var t;this._invoke=function(n,r){function e(){return new u(function(e,t){c(n,r,e,t)})}return t=t?t.then(e,e):e()}}function w(e,t){var n=e.iterator[t.method];if(undefined===n){if(t.delegate=null,"throw"===t.method){if(e.iterator["return"]&&(t.method="return",t.arg=undefined,w(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=undefined),t.delegate=null,c):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function k(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,r=function e(){for(;++n<t.length;){if(s.call(t,n))return e.value=t[n],e.done=!1,e}return e.value=undefined,e.done=!0,e};return r.next=r}}return{next:S}}function S(){return{value:undefined,done:!0}}return d.prototype=p,a(y,"constructor",p),a(p,"constructor",d),d.displayName=a(p,r,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,a(e,r,"GeneratorFunction")),e.prototype=Object.create(y),e},i.awrap=function(e){return{__await:e}},g(b.prototype),a(b.prototype,n,function(){return this}),i.AsyncIterator=b,i.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var a=new b(l(e,t,n,r),o);return i.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},g(y),a(y,r,"Generator"),a(y,o,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),i.keys=function(n){var r=[];for(var e in n){r.push(e)}return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},i.values=k,_.prototype={constructor:_,reset:function e(t){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!t)for(var n in this){"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)}},stop:function e(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function t(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=undefined),!!t}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var l=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return t(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return t(a.finallyLoc)}}}},abrupt:function e(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(i)},complete:function e(t,n){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&&n&&(this.next=n),c},finish:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),c}},catch:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var a=o.arg;x(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function e(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=undefined),c}},i}function u(e,t,n,r,o,a,i){try{var l=e[a](i);var u=l.value}catch(e){n(e);return}if(l.done){t(u)}else{Promise.resolve(u).then(r,o)}}function O(l){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=l.apply(e,i);function o(e){u(r,t,n,o,a,"next",e)}function a(e){u(r,t,n,o,a,"throw",e)}o(undefined)})}}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach(function(e){A(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function A(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function I(e,t){return U(e)||S(e,t)||k(e,t)||_()}function _(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e,t){if(!e)return;if(typeof e==="string")return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}function o(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++){r[n]=e[n]}return r}function S(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var o=true;var a=false;var i,l;try{for(n=n.call(e);!(o=(i=n.next()).done);o=true){r.push(i.value);if(t&&r.length===t)break}}catch(e){a=true;l=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return r}function U(e){if(Array.isArray(e))return e}var M=(0,P.createContext)();var z=(0,P.createContext)();var s=function e(){return(0,P.useContext)(M)};var f=function e(){return(0,P.useContext)(z)};var B=function e(t){var n=(0,P.useState)(true),r=I(n,2),o=r[0],l=r[1];var a=(0,P.useState)([]),i=I(a,2),u=i[0],c=i[1];var s=(0,P.useState)("all"),f=I(s,2),d=f[0],p=f[1];var m=(0,P.useRef)(false);var h=(0,P.useRef)(null);var v=(0,P.useState)([]),y=I(v,2),g=y[0],b=y[1];var w=(0,P.useState)({}),E=I(w,2),x=E[0],_=E[1];function k(e){return e===null||e===void 0?void 0:e.reduce(function(e,t){e=j(j({},e),{},A({},t.basename,Boolean(t.is_enabled)));return e},{})}var S=function(){var t=O(N().mark(function e(){var n,r,o,a,i;return N().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n=new FormData;n.set("action","tutor_get_all_addons");n.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);t.prev=3;t.next=6;return fetch(_tutorobject.ajaxurl,{method:"POST",body:n});case 6:r=t.sent;if(!r.ok){t.next=13;break}t.next=10;return r.json();case 10:o=t.sent;a=o.data.addons;if(a&&a.length){i=k(a);c(a);h.current=a;l(false)}case 13:t.next=19;break;case 15:t.prev=15;t.t0=t["catch"](3);console.log(t.t0);l(false);case 19:case"end":return t.stop()}}},e,null,[[3,15]])}));return function e(){return t.apply(this,arguments)}}();(0,P.useEffect)(function(){S()},[]);(0,P.useEffect)(function(){if(m.current){if(d==="all"){c(h.current)}else{var e=h.current.filter(function(e){if(d==="active")return e.is_enabled;else if(d==="deactive")return!e.is_enabled;else if(d==="required")return e===null||e===void 0?void 0:e.depend_plugins});c(e)}}else if(!m.current)m.current=true},[d]);(0,P.useEffect)(function(){b(h.current)});var T=function e(t,n){var o=t.target.checked;_(function(e){return j(j({},e),{},A({},n,true))});var a=h.current.map(function(e){if(e.basename===n)return j(j({},e),{},{is_enabled:o});return e});if(d==="active"){var r=a.filter(function(e){return e.is_enabled});c(r)}else if(d==="deactive"){var i=a.filter(function(e){return!e.is_enabled});c(i)}else if(d==="required"){var l=a.filter(function(e){return e===null||e===void 0?void 0:e.depend_plugins});c(l)}else if(d==="all"){c(a)}h.current=a;var u=function(){var t=O(N().mark(function e(){var n,r;return N().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n=k(a);r=new FormData;r.set("action","addon_enable_disable");r.set("isEnable",Number(o));r.set("addonFieldName",n);r.set("addonFieldNames",JSON.stringify(n));r.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);t.prev=7;t.next=10;return fetch(_tutorobject.ajaxurl,{method:"POST",body:r});case 10:_(n);t.next=16;break;case 13:t.prev=13;t.t0=t["catch"](7);console.log(t.t0);case 16:case"end":return t.stop()}}},e,null,[[7,13]])}));return function e(){return t.apply(this,arguments)}}();u()};var C=function e(t){switch(t){case"active":p("active");break;case"deactive":p("deactive");break;case"required":p("required");break;case"all":p("all");break;default:p("all");break}};var L=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";if(t.trim()){var n=h.current.filter(function(e){return e.name.toLowerCase().includes(t.toLowerCase())});c(n)}else{c(h.current)}};return P.createElement(M.Provider,{value:{allAddons:u,addonList:g,loading:o}},P.createElement(z.Provider,{value:{activeTab:d,getTabStatus:C,setActiveTab:p,setAllAddons:c,handleOnChange:T,filterAddons:L,addonLoading:x}},t.children))};var H=wp.i18n.__;var V=function e(t){return t.charAt(0).toUpperCase()+t.slice(1)};var W=function e(){var t=["all","active","deactive","required"];var n=s(),r=n.addonList;var o=f(),a=o.activeTab,i=o.getTabStatus;var l=r===null||r===void 0?void 0:r.reduce(function(e,t){return e+Number(t.is_enabled)},0);var u=r===null||r===void 0?void 0:r.reduce(function(e,t){return e+Number(!t.is_enabled)},0);var c=r===null||r===void 0?void 0:r.reduce(function(e,t){return e+Number(t.hasOwnProperty("depend_plugins")||0)},0);return P.createElement("header",{className:"tutor-wp-dashboard-header tutor-px-24 tutor-mb-24"},P.createElement("div",{className:"tutor-row tutor-align-lg-center"},P.createElement("div",{className:"tutor-col-lg"},P.createElement("div",{className:"tutor-p-12"},P.createElement("span",{className:"tutor-fs-5 tutor-fw-medium tutor-mr-16"},H("Add-ons","tutor")))),P.createElement("div",{className:"tutor-col-lg-auto"},P.createElement("ul",{className:"tutor-nav tutor-nav-admin"},t.map(function(t,e){return P.createElement("li",{className:"tutor-nav-item",key:e},P.createElement("a",{className:"tutor-nav-link".concat(t===a?" is-active":""),href:"#",onClick:function e(){return i(t)}},V(t)," ",P.createElement("span",{className:"tutor-ml-4"},"(","active"===t?l:"deactive"===t?u:"required"===t?c:r===null||r===void 0?void 0:r.length,")")))})))))};const Q=W;function $(e,t){return X(e)||Y(e,t)||K(e,t)||G()}function G(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function K(e,t){if(!e)return;if(typeof e==="string")return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}function a(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++){r[n]=e[n]}return r}function Y(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var o=true;var a=false;var i,l;try{for(n=n.call(e);!(o=(i=n.next()).done);o=true){r.push(i.value);if(t&&r.length===t)break}}catch(e){a=true;l=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return r}function X(e){if(Array.isArray(e))return e}var Z=wp.i18n.__;var J=function e(n){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:500;var o=null;return function(){var e=this,t=arguments;clearTimeout(o);o=setTimeout(function(){n.apply(e,t)},r)}};var ee=function e(){var t=f(),n=t.filterAddons;var r=(0,P.useState)(""),o=$(r,2),a=o[0],i=o[1];var l=(0,P.useCallback)(J(function(e){n(e)}),[]);var u=function e(t){var n=t.target.value;i(n);l(n)};return P.createElement("div",{className:"tutor-addons-list-select-filter"},P.createElement("div",{className:"tutor-form-wrap"},P.createElement("span",{className:"tutor-icon-search tutor-form-icon","area-hidden":"true"}),P.createElement("input",{type:"search",className:"tutor-form-control",placeholder:Z("Search…","tutor"),value:a,onChange:u})))};const te=ee;var d=wp.i18n.__;var ne=function e(t){var n,r,o;var a=t.addon,i=t.addonId;var l=f(),u=l.handleOnChange,c=l.addonLoading;return P.createElement("div",{className:"tutor-col-lg-6 tutor-col-xl-4 tutor-col-xxl-3 tutor-mb-32"},P.createElement("div",{className:"tutor-card tutor-card-md tutor-addon-card ".concat(a.plugins_required.length>0?"not-subscribed":""," tutor-addon-card-").concat(i+1),style:{transitionDelay:"".concat(100*i,"ms")}},P.createElement("div",{className:"tutor-card-body"},P.createElement("div",{className:"tutor-addon-logo tutor-mb-32"},P.createElement("div",{className:"tutor-ratio tutor-ratio-1x1"},P.createElement("img",{src:a.thumb_url,alt:a.name}))),P.createElement("div",{className:"tutor-addon-title tutor-fs-6 tutor-fw-medium tutor-color-black tutor-mb-20"},a.name),P.createElement("div",{className:"tutor-addon-description tutor-fs-7 tutor-color-secondary"},a.description)),P.createElement("div",{className:"tutor-card-footer tutor-d-flex tutor-justify-between tutor-align-center tutor-mt-auto"},P.createElement("div",{className:"tutor-fs-7 tutor-fw-medium tutor-color-muted"},P.createElement("div",{className:"tutor-color-muted tutor-fs-7 tutor-fw-medium tutor-d-flex"},P.createElement("span",null,((n=a.plugins_required)===null||n===void 0?void 0:n.length)>0?d("Required Plugin(s)","tutor"):((r=a.ext_required)===null||r===void 0?void 0:r.length)>0?d("Required for Push Notification","tutor"):d("No extra plugin required","tutor")),a.ext_required?P.createElement("div",{className:"tooltip-wrap tooltip-icon"},P.createElement("span",{className:"tooltip-txt tooltip-top"},a.ext_required.map(function(e,t){return P.createElement("div",{key:t},P.createElement("span",{dangerouslySetInnerHTML:{__html:e}}))}))):a.depend_plugins&&a.plugins_required.length?P.createElement("div",{className:"tooltip-wrap tooltip-icon"},P.createElement("span",{className:"tooltip-txt tooltip-top"},a.plugins_required.map(function(e,t){return P.createElement("div",{key:t},P.createElement("span",null,e))}))):"")),((o=a.plugins_required)===null||o===void 0?void 0:o.length)===0&&P.createElement("div",{className:"addon-toggle"},P.createElement("label",{className:"tutor-form-toggle"},P.createElement("input",{type:"checkbox",className:"tutor-form-toggle-input",name:a.basename,checked:a.is_enabled,onChange:function e(t){return u(t,a.basename)}}),P.createElement("span",{className:"tutor-form-toggle-control","area-hidden":"true"}))))))};const re=ne;var i=wp.i18n.__;var oe="".concat(_tutorobject.tutor_url,"assets/images/addon-empty-state.svg");var ae=function e(){var t=s(),n=t.allAddons,r=t.loading;return P.createElement("div",{className:"tutor-addons-list-items tutor-row tutor-gx-xxl-4 tutor-mt-32 ".concat(n.length<3?"is-less-items":""," ").concat(n.length?"is-active":"")},n.length?n.map(function(e,t){return P.createElement(re,{addon:e,key:t,addonId:t})}):r?P.createElement("div",{className:"tutor-col-12 tutor-text-center tutor-py-60"},P.createElement("div",{className:"tutor-spinner","area-hidden":"true"})):P.createElement("div",{className:"tutor-col-12"},P.createElement("div",{className:"tutor-addons-card tutor-p-32"},P.createElement("div",{className:"tutor-d-flex tutor-flex-column tutor-justify-center tutor-text-center"},P.createElement("div",{className:"tutor-mb-32"},P.createElement("img",{src:oe,alt:i("Empty State Illustration","tutor")})),P.createElement("div",{className:"tutor-fs-6 tutor-color-secondary"},i("No Addons Found!","tutor"))))))};const ie=ae;var le=function e(){return P.createElement(B,null,P.createElement("div",{className:"tutor-backend-settings-addons-list tutor-dashboard-page"},P.createElement("div",{className:"tutor-admin-wrap"},P.createElement(Q,null),P.createElement("div",{className:"tutor-admin-body"},P.createElement("div",{className:"tutor-addons-list-body"},P.createElement(te,null),P.createElement(ie,null))))))};const ue=le;window.addEventListener("DOMContentLoaded",function(){function e(){var e=P.createElement(ue,null);var t=document.getElementById("tutor-addons-list-wrapper");if(null!==t){x.render(e,t)}}e()});var ce=Fe(248);var se=Fe(76);function C(e){"@babel/helpers - typeof";return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function L(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */L=function e(){return i};var i={},e=Object.prototype,s=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function e(t,n,r){return t[n]=r}}function l(e,t,n,r){var o=t&&t.prototype instanceof u?t:u,a=Object.create(o.prototype),i=new _(r||[]);return a._invoke=function(a,i,l){var u="suspendedStart";return function(e,t){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===e)throw t;return S()}for(l.method=e,l.arg=t;;){var n=l.delegate;if(n){var r=w(n,l);if(r){if(r===c)continue;return r}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===u)throw u="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);u="executing";var o=f(a,i,l);if("normal"===o.type){if(u=l.done?"completed":"suspendedYield",o.arg===c)continue;return{value:o.arg,done:l.done}}"throw"===o.type&&(u="completed",l.method="throw",l.arg=o.arg)}}}(e,n,i),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=l;var c={};function u(){}function d(){}function p(){}var m={};a(m,o,function(){return this});var h=Object.getPrototypeOf,v=h&&h(h(k([])));v&&v!==e&&s.call(v,o)&&(m=v);var y=p.prototype=u.prototype=Object.create(m);function g(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function b(l,u){function c(e,t,n,r){var o=f(l[e],l,t);if("throw"!==o.type){var a=o.arg,i=a.value;return i&&"object"==C(i)&&s.call(i,"__await")?u.resolve(i.__await).then(function(e){c("next",e,n,r)},function(e){c("throw",e,n,r)}):u.resolve(i).then(function(e){a.value=e,n(a)},function(e){return c("throw",e,n,r)})}r(o.arg)}var t;this._invoke=function(n,r){function e(){return new u(function(e,t){c(n,r,e,t)})}return t=t?t.then(e,e):e()}}function w(e,t){var n=e.iterator[t.method];if(undefined===n){if(t.delegate=null,"throw"===t.method){if(e.iterator["return"]&&(t.method="return",t.arg=undefined,w(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=undefined),t.delegate=null,c):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function k(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,r=function e(){for(;++n<t.length;){if(s.call(t,n))return e.value=t[n],e.done=!1,e}return e.value=undefined,e.done=!0,e};return r.next=r}}return{next:S}}function S(){return{value:undefined,done:!0}}return d.prototype=p,a(y,"constructor",p),a(p,"constructor",d),d.displayName=a(p,r,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,a(e,r,"GeneratorFunction")),e.prototype=Object.create(y),e},i.awrap=function(e){return{__await:e}},g(b.prototype),a(b.prototype,n,function(){return this}),i.AsyncIterator=b,i.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var a=new b(l(e,t,n,r),o);return i.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},g(y),a(y,r,"Generator"),a(y,o,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),i.keys=function(n){var r=[];for(var e in n){r.push(e)}return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},i.values=k,_.prototype={constructor:_,reset:function e(t){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!t)for(var n in this){"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)}},stop:function e(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function t(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=undefined),!!t}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var l=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return t(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return t(a.finallyLoc)}}}},abrupt:function e(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(i)},complete:function e(t,n){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&&n&&(this.next=n),c},finish:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),c}},catch:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var a=o.arg;x(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function e(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=undefined),c}},i}function c(e,t,n,r,o,a,i){try{var l=e[a](i);var u=l.value}catch(e){n(e);return}if(l.done){t(u)}else{Promise.resolve(u).then(r,o)}}function b(l){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=l.apply(e,i);function o(e){c(r,t,n,o,a,"next",e)}function a(e){c(r,t,n,o,a,"throw",e)}o(undefined)})}}function w(t,e){var n=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=fe(t))||e&&t&&typeof t.length==="number"){if(n)t=n;var r=0;var o=function e(){};return{s:o,n:function e(){if(r>=t.length)return{done:true};return{done:false,value:t[r++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a=true,i=false,l;return{s:function e(){n=n.call(t)},n:function e(){var t=n.next();a=t.done;return t},e:function e(t){i=true;l=t},f:function e(){try{if(!a&&n["return"]!=null)n["return"]()}finally{if(i)throw l}}}}function fe(e,t){if(!e)return;if(typeof e==="string")return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}function l(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++){r[n]=e[n]}return r}var e=wp.i18n,E=e.__,de=e._x,pe=e._n,me=e._nx;document.addEventListener("DOMContentLoaded",function(){var l=document.getElementById("tutor-common-confirmation-modal");var u=document.getElementById("tutor-common-confirmation-form");var e=document.getElementById("tutor-backend-filter-course");if(e){e.addEventListener("change",function(e){window.location=s("course-id",e.target.value)},{once:true})}var t=document.getElementById("tutor-backend-filter-category");if(t){t.addEventListener("change",function(e){window.location=s("category",e.target.value)},{once:true})}var n=document.getElementById("tutor-backend-filter-order");if(n){n.addEventListener("change",function(e){window.location=s("order",e.target.value)},{once:true})}var r=document.getElementById("tutor-admin-search-filter-form");var o=document.getElementById("tutor-backend-filter-search");if(r){o.addEventListener("search",function(e){var t=e.currentTarget||{},n=t.value;if(/\S+/.test(n)==false){window.location=s("search","")}});r.onsubmit=function(e){e.preventDefault();var t=o.value;window.location=s("search",t)}}var a=document.getElementById("tutor-admin-bulk-action-btn");var i=document.querySelector(".tutor-bulk-modal-disabled");if(a){a.onclick=function(){var e=[];var t=document.querySelectorAll(".tutor-bulk-checkbox");var n=w(t),r;try{for(n.s();!(r=n.n()).done;){var o=r.value;if(o.checked){e.push(o.value)}}}catch(e){n.e(e)}finally{n.f()}if(e.length){i.setAttribute("id","tutor-bulk-confirm-popup")}else{tutor_toast(E("Warning","tutor"),E("Nothing was selected for bulk action.","tutor"),"error");if(i.hasAttribute("id")){i.removeAttribute("id")}}}}var h=document.getElementById("tutor-admin-bulk-action-form");if(h){h.onsubmit=function(){var t=b(L().mark(function e(n){var r,o,a,i,l,u,c,s,f,d,p,m;return L().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n.preventDefault();n.stopPropagation();r=new FormData(h);o=[];a=document.querySelectorAll(".tutor-bulk-checkbox");i=w(a);try{for(i.s();!(l=i.n()).done;){u=l.value;if(u.checked){o.push(u.value)}}}catch(e){i.e(e)}finally{i.f()}if(o.length){t.next=10;break}alert(E("Select checkbox for action","tutor"));return t.abrupt("return");case 10:r.set("bulk-ids",o);r.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);t.prev=12;c=document.querySelector("#tutor-confirm-bulk-action[data-tutor-modal-submit]");c.classList.add("is-loading");t.next=17;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:r});case 17:s=t.sent;c.classList.remove("is-loading");if(!s.ok){t.next=24;break}t.next=22;return s.json();case 22:f=t.sent;if(f.success){location.reload()}else{d=f.data||{},p=d.message,m=p===void 0?E("Something went wrong, please try again ","tutor"):p;tutor_toast(E("Failed","tutor"),m,"error")}case 24:t.next=29;break;case 26:t.prev=26;t.t0=t["catch"](12);console.log(t.t0);case 29:case"end":return t.stop()}}},e,null,[[12,26]])}));return function(e){return t.apply(this,arguments)}}()}var c=document.getElementById("tutor-confirm-bulk-action");if(c){c.onclick=function(){var e=document.createElement("input");e.type="submit";h.appendChild(e);e.click();e.remove()}}function s(e,t){var n=new URL(window.location.href);var r=n.searchParams;r.set(e,t);r.set("paged",1);return n}var f=document.querySelector("#tutor-bulk-checkbox-all");if(f){f.addEventListener("click",function(){var e=document.querySelectorAll(".tutor-bulk-checkbox");e.forEach(function(e){if(f.checked){e.checked=true}else{e.checked=false}})})}var d=document.querySelectorAll(".tutor-admin-course-delete");var p=w(d),m;try{for(p.s();!(m=p.n()).done;){var v=m.value;v.onclick=function(e){var t=e.currentTarget.dataset.id;if(u){console.log(u);u.elements.action.value="tutor_course_delete";u.elements.id.value=t}}}}catch(e){p.e(e)}finally{p.f()}if(u){u.onsubmit=function(){var t=b(L().mark(function e(n){var r,o,a,i;return L().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n.preventDefault();r=new FormData(u);o=u.querySelector("[data-tutor-modal-submit]");o.classList.add("is-loading");t.next=6;return y(r);case 6:a=t.sent;if(l.classList.contains("tutor-is-active")){l.classList.remove("tutor-is-active")}if(!a.ok){t.next=14;break}t.next=11;return a.json();case 11:i=t.sent;o.classList.remove("is-loading");if(i){tutor_toast(E("Delete","tutor"),E("Course has been deleted ","tutor"),"success");location.reload()}else{tutor_toast(E("Failed","tutor"),E("Course delete failed ","tutor"),"error")}case 14:case"end":return t.stop()}}},e)}));return function(e){return t.apply(this,arguments)}}()}function y(e){return g.apply(this,arguments)}function g(){g=b(L().mark(function e(n){var r;return L().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:t.prev=0;t.next=3;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:n});case 3:r=t.sent;return t.abrupt("return",r);case 7:t.prev=7;t.t0=t["catch"](0);tutor_toast(E("Operation failed","tutor"),t.t0,"error");case 10:case"end":return t.stop()}}},e,null,[[0,7]])}));return g.apply(this,arguments)}});function h(e){return t.apply(this,arguments)}function t(){t=b(L().mark(function e(n){var r;return L().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:t.prev=0;t.next=3;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:n});case 3:r=t.sent;return t.abrupt("return",r);case 7:t.prev=7;t.t0=t["catch"](0);tutor_toast(E("Operation failed","tutor"),t.t0,"error");case 10:case"end":return t.stop()}}},e,null,[[0,7]])}));return t.apply(this,arguments)}var he=Fe(845);var ve=Fe(2988);var ye=Fe(3676);var ge=Fe(4523);var be=function e(t,n){var r=wp.i18n.__;var o=t||{},a=o.data,i=a===void 0?{}:a;var l=i.message,u=l===void 0?n||r("Something Went Wrong!","tutor"):l;return u};var n={warning:'<svg class="tutor-icon-v2 warning" width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18.0388 14.2395C18.2457 14.5683 18.3477 14.9488 18.3321 15.3333C18.3235 15.6951 18.2227 16.0493 18.0388 16.3647C17.851 16.6762 17.5885 16.9395 17.2733 17.1326C16.9301 17.3257 16.5383 17.4237 16.1412 17.4159H5.87591C5.47974 17.4234 5.08907 17.3253 4.74673 17.1326C4.42502 16.9409 4.15549 16.6776 3.96071 16.3647C3.77376 16.0506 3.67282 15.6956 3.66741 15.3333C3.6596 14.9496 3.76106 14.5713 3.96071 14.2395L9.11094 5.64829C9.29701 5.31063 9.58016 5.03215 9.9263 4.84641C10.2558 4.67355 10.6248 4.58301 10.9998 4.58301C11.3747 4.58301 11.7437 4.67355 12.0732 4.84641C12.4259 5.02952 12.7154 5.30825 12.9062 5.64829L18.0388 14.2395ZM11.7447 10.4086C11.7447 10.2131 11.7653 10.0176 11.7799 9.81924C11.7946 9.62089 11.8063 9.41971 11.818 9.21853C11.8178 9.1484 11.8129 9.07836 11.8034 9.00885C11.7916 8.94265 11.7719 8.87799 11.7447 8.81617C11.6644 8.64655 11.5255 8.50928 11.3517 8.42798C11.1805 8.3467 10.9848 8.32759 10.8003 8.37414C10.6088 8.42217 10.4413 8.53471 10.3281 8.69149C10.213 8.84985 10.1525 9.03921 10.1551 9.2327C10.1551 9.3602 10.1756 9.48771 10.1844 9.61239C10.1932 9.73706 10.202 9.86457 10.2137 9.99208C10.2401 10.4709 10.2695 10.947 10.2988 11.4088C10.3281 11.8707 10.3545 12.3552 10.3838 12.8256C10.3857 12.9019 10.4032 12.9771 10.4352 13.0468C10.4672 13.1166 10.5131 13.1796 10.5703 13.2322C10.6275 13.2849 10.6948 13.3261 10.7685 13.3536C10.8422 13.381 10.9208 13.3942 10.9998 13.3923C11.0794 13.3946 11.1587 13.3813 11.2328 13.353C11.307 13.3248 11.3744 13.2822 11.4309 13.228C11.5454 13.1171 11.6115 12.968 11.6157 12.8114V12.5281C11.6157 12.4317 11.6157 12.3382 11.6157 12.2447C11.6362 11.9415 11.6538 11.6327 11.6743 11.3238C11.6949 11.015 11.7271 10.7118 11.7447 10.4086ZM10.9998 15.5118C11.1049 15.5119 11.2091 15.4919 11.3062 15.453C11.4034 15.4141 11.4916 15.3571 11.5658 15.2851C11.6441 15.2191 11.7061 15.137 11.7472 15.0448C11.7883 14.9526 11.8075 14.8527 11.8034 14.7524C11.8053 14.6497 11.7863 14.5476 11.7474 14.452C11.7085 14.3564 11.6505 14.2692 11.5767 14.1953C11.5029 14.1213 11.4147 14.0621 11.3172 14.0211C11.2197 13.9801 11.1149 13.958 11.0086 13.9562C10.9023 13.9543 10.7966 13.9727 10.6977 14.0103C10.5987 14.0479 10.5084 14.1039 10.4319 14.1752C10.3553 14.2465 10.2941 14.3317 10.2516 14.4259C10.2092 14.52 10.1863 14.6214 10.1844 14.7241C10.1844 14.933 10.2703 15.1333 10.4232 15.2811C10.5761 15.4288 10.7835 15.5118 10.9998 15.5118Z" fill="#9CA0AC"/></svg>',magnifyingGlass:'<svg class="tutor-icon-v2 magnifying-glass" width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.3056 5.375C7.58249 5.375 5.375 7.58249 5.375 10.3056C5.375 13.0286 7.58249 15.2361 10.3056 15.2361C13.0286 15.2361 15.2361 13.0286 15.2361 10.3056C15.2361 7.58249 13.0286 5.375 10.3056 5.375ZM4.125 10.3056C4.125 6.89214 6.89214 4.125 10.3056 4.125C13.719 4.125 16.4861 6.89214 16.4861 10.3056C16.4861 13.719 13.719 16.4861 10.3056 16.4861C6.89214 16.4861 4.125 13.719 4.125 10.3056Z" fill="#9CA0AC"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.7874 13.7872C14.0314 13.5431 14.4272 13.5431 14.6712 13.7872L17.6921 16.8081C17.9362 17.0521 17.9362 17.4479 17.6921 17.6919C17.448 17.936 17.0523 17.936 16.8082 17.6919L13.7874 14.6711C13.5433 14.427 13.5433 14.0313 13.7874 13.7872Z" fill="#9CA0AC"/></svg>',angleRight:'<svg class="tutor-icon-v2 angle-right" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.842 12.633C7.80402 12.6702 7.7592 12.6998 7.71 12.72C7.65839 12.7401 7.60341 12.7503 7.548 12.75C7.49655 12.7496 7.44563 12.7395 7.398 12.72C7.34843 12.7005 7.30347 12.6709 7.266 12.633L6.88201 12.252C6.84384 12.2138 6.81284 12.1691 6.79051 12.12C6.76739 12.0694 6.75367 12.015 6.75001 11.9595C6.74971 11.9045 6.75832 11.8498 6.77551 11.7975C6.79308 11.7477 6.82181 11.7025 6.85951 11.6655L9.53249 9.00001L6.86701 6.33453C6.82576 6.29904 6.79427 6.2536 6.77551 6.20253C6.75832 6.15026 6.74971 6.09555 6.75001 6.04053C6.75367 5.98502 6.76739 5.93064 6.79051 5.88003C6.81284 5.8309 6.84384 5.78619 6.88201 5.74803L7.263 5.36704C7.30047 5.32916 7.34543 5.29953 7.395 5.28004C7.44263 5.26056 7.49355 5.25038 7.545 5.25004C7.60142 5.24931 7.65745 5.2595 7.71 5.28004C7.7592 5.30025 7.80402 5.3298 7.842 5.36704L11.181 8.70752C11.2233 8.74442 11.2579 8.78926 11.283 8.83951C11.3077 8.88941 11.3206 8.94433 11.3206 9.00001C11.3206 9.05569 11.3077 9.11062 11.283 9.16051C11.2579 9.21076 11.2233 9.25561 11.181 9.29251L7.842 12.633Z" fill="#B4B7C0"/></svg>'};var we=n.angleRight,Ee=n.magnifyingGlass,xe=n.warning;document.addEventListener("DOMContentLoaded",function(){var h=window.jQuery;var v=wp.i18n.__;var o=document.querySelectorAll(".image_upload_button");var e=function e(t){var n=o[t].closest(".image-previewer");var i=n.querySelector(".input_file");var l=n.querySelector(".upload_preview");var u=document.querySelector('[data-source="email-title-logo"]');var r=n.querySelector(".delete-btn");o[t].onclick=function(e){e.preventDefault();var a=wp.media({title:"Upload Image",library:{type:"image"},multiple:false,frame:"post",state:"insert"});a.open();a.on("insert",function(e){var t=a.state();e=e||t.get("selection");if(!e)return;var n=e.first();var r=t.display(n).toJSON();n=n.toJSON();var o=n.sizes[r.size].url;if(null!==l){l.src=i.value=o}if(null!==u){u.src=i.value=o}})};r.onclick=function(){i.value="";u.src=""}};for(var t=0;t<o.length;++t){e(t)}var a=function e(t){var n=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return n.test(String(t).toLowerCase())};h(window).on("click",function(e){h(".tutor-notification, .search_result").removeClass("show")});h(".tutor-notification-close").click(function(e){h(".tutor-notification").removeClass("show")});var i=false;var n=function e(t){t.forEach(function(t){t.onchange=function(e){if(false===a(t.value)){t.style.borderColor="red";t.focus();i=false}else{t.style.borderColor="#ddd";i=true}}})};var l=function e(t){t.forEach(function(e){var t=e.closest(".tutor-option-nav-page");var n=e&&e.parentNode.parentNode.querySelector("[tutor-option-name]").innerText;var r=t&&t.querySelector("[tutor-option-title]").innerText;var o='"'+r+" > "+n+'" email is invalid!';if(false===a(e.value)){e.style.borderColor="red";e.focus();tutor_toast("Warning",o,"error")}else{i=true}})};var u=function e(t){t.forEach(function(e){})};var c=document.querySelectorAll('[type="email"]');var s=document.querySelectorAll('[type="number"]');if(0!==c.length){n(c)}else{i=true}h("#save_tutor_option").click(function(e){e.preventDefault();h("#tutor-option-form").submit()});h("#tutor-option-form").submit(function(e){e.preventDefault();if(tinyMCE){tinyMCE.triggerSave()}var t=h("#save_tutor_option");var n=h(this);var r=n.serializeObject();if(0!==s.length){u(s)}if(0!==c.length){l(c)}if(true===i){if(!e.detail||e.detail==1){h.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:r,beforeSend:function e(){t.addClass("is-loading");t.attr("disabled",true)},success:function e(t){var n=t||{},r=n.data,o=r===void 0?{}:r,e=n.success;var a=o.message,i=a===void 0?v("Something Went Wrong!","tutor"):a;if(e){if(document.getElementById("save_tutor_option")){document.getElementById("save_tutor_option").disabled=true}tutor_toast("Success!",v("Settings Saved","tutor"),"success");return}tutor_toast("Error!",i,"error")},complete:function e(){t.removeClass("is-loading");t.removeAttr("disabled")}})}}});function y(e,t,n,r,o){var a=r?"".concat(we," ").concat(r):"";var i='\n\t\t<a data-tab="'.concat(t,'" data-key="field_').concat(o,'">\n\t\t\t<div class="search_result_title">\n\t\t\t').concat(Ee,'\n\t\t\t<span class="tutor-fs-7">').concat(e,'</span>\n\t\t\t</div>\n\t\t\t<div class="search_navigation">\n\t\t\t<div class="nav-track tutor-fs-7">\n\t\t\t\t<span>').concat(n,"</span>\n\t\t\t\t<span>").concat(a,"</span>\n\t\t\t</div>\n\t\t\t</div>\n\t\t</a>");return i}var f;h("#search_settings").on("input",function(e){var t=this;e.preventDefault();var r=h(this);if(f){window.clearTimeout(f)}f=window.setTimeout(function(){if(e.target.value){var m=t.value;h.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:{action:"tutor_option_search",keyword:m},beforeSend:function e(){r.parent().find(".tutor-form-icon").removeClass("tutor-icon-search").addClass("tutor-icon-circle-notch tutor-animation-spin")},success:function e(t){if(!t.success){tutor_toast(v("Error","tutor"),be(t),"error");return}var o="",a="",i=true,l="",u="",c="",s="",f="",d="",p="",n=t.data.fields;Object.values(n).forEach(function(e,t,n){var r;l=e.label;u=e.section_slug;c=e.section_label;s=e.block_label;p=e.event?e.key+"_"+e.event:e.key;d=new RegExp(m,"ig");f=(r=l.match(d))===null||r===void 0?void 0:r[0];if(f){a=l.replace(d,"<span style='color: #212327; font-weight:500'>".concat(f,"</span>"));o+=y(a,u,c,s,p);i=false}});if(i){o+='<div class="no_item">'.concat(xe," No Results Found</div>")}h(".search_result").html(o).addClass("show");r.parent().find(".tutor-form-icon").removeClass("tutor-icon-circle-notch tutor-animation-spin").addClass("tutor-icon-search");o=""},complete:function e(){d()}})}else{document.querySelector(".search-popup-opener").classList.remove("show")}f=undefined},500)});function d(){var e=document.querySelectorAll(".tutor-options-search .search-popup-opener a");var o=document.querySelectorAll("[tutor-option-tabs] li > a");var a=document.querySelectorAll(".tutor-option-nav-page");e.forEach(function(e){e.addEventListener("click",function(e){var t=e.target.closest("[data-tab]").dataset.tab;var n=e.target.closest("[data-key]").dataset.key;if(t){document.title=e.target.innerText+" < "+_tutorobject.site_title;o.forEach(function(e){e.classList.remove("is-active")});document.querySelector(".tutor-option-tabs [data-tab=".concat(t,"]")).classList.add("is-active");a.forEach(function(e){e.classList.remove("is-active")});document.querySelector(".tutor-option-tab-pages #".concat(t)).classList.add("is-active");var r=new URL(window.location);r.searchParams.set("tab_page",t);window.history.pushState({},"",r)}document.querySelector(".search-popup-opener").classList.remove("visible");document.querySelector('.tutor-options-search input[type="search"]').value="";p(n)})})}function p(e){var t=document.querySelector("#".concat(e));var n=t&&t.querySelector("[tutor-option-name]");var r=t&&t.parentNode.querySelector(".tutor-option-field-row");if(r){n.classList.add("isHighlighted");setTimeout(function(){n.classList.remove("isHighlighted")},6e3);r.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}else{console.warn("scrollTargetEl Not found!")}}function r(e,t,n){if(e.style===undefined)return;t===(n!==undefined?n:"on")?e.style.display="grid":e.style.display="none"}function m(n,r){MutationObserver=window.MutationObserver||window.WebKitMutationObserver;var e=new MutationObserver(function(e,t){if(e[0].attributeName=="value"){if(typeof r==="function"){r(n.value)}}});e.observe(n,{attributes:true})}var g=document.querySelector("[name='tutor_option[monetize_by]']");var b=document.getElementById("field_tutor_woocommerce_order_auto_complete");if(g){r(b,g.value,"wc");g.onchange=function(e){return r(b,e.target.value,"wc")}}var w=document.querySelector("[name='tutor_option[enable_revenue_sharing]']");var E=document.getElementById("field_sharing_percentage");if(w){r(E,w.value);m(w,function(e){return r(E,e)})}});var _e=Fe(9196);var ke=Fe(2919);var Se=Fe(0);function D(e){"@babel/helpers - typeof";return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function F(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */F=function e(){return i};var i={},e=Object.prototype,s=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function e(t,n,r){return t[n]=r}}function l(e,t,n,r){var o=t&&t.prototype instanceof u?t:u,a=Object.create(o.prototype),i=new _(r||[]);return a._invoke=function(a,i,l){var u="suspendedStart";return function(e,t){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===e)throw t;return S()}for(l.method=e,l.arg=t;;){var n=l.delegate;if(n){var r=w(n,l);if(r){if(r===c)continue;return r}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===u)throw u="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);u="executing";var o=f(a,i,l);if("normal"===o.type){if(u=l.done?"completed":"suspendedYield",o.arg===c)continue;return{value:o.arg,done:l.done}}"throw"===o.type&&(u="completed",l.method="throw",l.arg=o.arg)}}}(e,n,i),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=l;var c={};function u(){}function d(){}function p(){}var m={};a(m,o,function(){return this});var h=Object.getPrototypeOf,v=h&&h(h(k([])));v&&v!==e&&s.call(v,o)&&(m=v);var y=p.prototype=u.prototype=Object.create(m);function g(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function b(l,u){function c(e,t,n,r){var o=f(l[e],l,t);if("throw"!==o.type){var a=o.arg,i=a.value;return i&&"object"==D(i)&&s.call(i,"__await")?u.resolve(i.__await).then(function(e){c("next",e,n,r)},function(e){c("throw",e,n,r)}):u.resolve(i).then(function(e){a.value=e,n(a)},function(e){return c("throw",e,n,r)})}r(o.arg)}var t;this._invoke=function(n,r){function e(){return new u(function(e,t){c(n,r,e,t)})}return t=t?t.then(e,e):e()}}function w(e,t){var n=e.iterator[t.method];if(undefined===n){if(t.delegate=null,"throw"===t.method){if(e.iterator["return"]&&(t.method="return",t.arg=undefined,w(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=undefined),t.delegate=null,c):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function k(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,r=function e(){for(;++n<t.length;){if(s.call(t,n))return e.value=t[n],e.done=!1,e}return e.value=undefined,e.done=!0,e};return r.next=r}}return{next:S}}function S(){return{value:undefined,done:!0}}return d.prototype=p,a(y,"constructor",p),a(p,"constructor",d),d.displayName=a(p,r,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,a(e,r,"GeneratorFunction")),e.prototype=Object.create(y),e},i.awrap=function(e){return{__await:e}},g(b.prototype),a(b.prototype,n,function(){return this}),i.AsyncIterator=b,i.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var a=new b(l(e,t,n,r),o);return i.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},g(y),a(y,r,"Generator"),a(y,o,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),i.keys=function(n){var r=[];for(var e in n){r.push(e)}return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},i.values=k,_.prototype={constructor:_,reset:function e(t){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!t)for(var n in this){"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)}},stop:function e(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function t(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=undefined),!!t}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var l=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return t(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return t(a.finallyLoc)}}}},abrupt:function e(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(i)},complete:function e(t,n){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&&n&&(this.next=n),c},finish:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),c}},catch:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var a=o.arg;x(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function e(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=undefined),c}},i}function Te(e,t){return Ne(e)||Pe(e,t)||Le(e,t)||Ce()}function Ce(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Le(e,t){if(!e)return;if(typeof e==="string")return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}function p(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++){r[n]=e[n]}return r}function Pe(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var o=true;var a=false;var i,l;try{for(n=n.call(e);!(o=(i=n.next()).done);o=true){r.push(i.value);if(t&&r.length===t)break}}catch(e){a=true;l=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return r}function Ne(e){if(Array.isArray(e))return e}function m(e,t,n,r,o,a,i){try{var l=e[a](i);var u=l.value}catch(e){n(e);return}if(l.done){t(u)}else{Promise.resolve(u).then(r,o)}}function Oe(l){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=l.apply(e,i);function o(e){m(r,t,n,o,a,"next",e)}function a(e){m(r,t,n,o,a,"throw",e)}o(undefined)})}}var v=wp.i18n,je=v.__,Ae=v._x,Ie=v._n,Me=v._nx;document.addEventListener("DOMContentLoaded",Oe(F().mark(function e(){var n,r,o,a,i,l,u,c,s,f,d;return F().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n=_tutorobject.current_page;console.log(n);if(!(n==="tutor_quiz_attempts")){t.next=14;break}r=new FormData;r.set("action","tutor_quiz_attempts_count");r.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);t.next=8;return h(r);case 8:o=t.sent;if(!o.ok){t.next=14;break}t.next=12;return o.json();case 12:a=t.sent;if(a.success&&a.data){console.log(a.data);i=document.querySelectorAll(".tutor-nav-item .tutor-ml-4");l=0;for(u=0,c=Object.entries(a.data);u<c.length;u++){s=Te(c[u],2),f=s[0],d=s[1];console.log(f+",,,"+d);i[l].innerHTML="(".concat(d,")");l++}}case 14:case"end":return t.stop()}}},e)})));function q(e){"@babel/helpers - typeof";return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(e)}function R(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */R=function e(){return i};var i={},e=Object.prototype,s=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function e(t,n,r){return t[n]=r}}function l(e,t,n,r){var o=t&&t.prototype instanceof u?t:u,a=Object.create(o.prototype),i=new _(r||[]);return a._invoke=function(a,i,l){var u="suspendedStart";return function(e,t){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===e)throw t;return S()}for(l.method=e,l.arg=t;;){var n=l.delegate;if(n){var r=w(n,l);if(r){if(r===c)continue;return r}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===u)throw u="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);u="executing";var o=f(a,i,l);if("normal"===o.type){if(u=l.done?"completed":"suspendedYield",o.arg===c)continue;return{value:o.arg,done:l.done}}"throw"===o.type&&(u="completed",l.method="throw",l.arg=o.arg)}}}(e,n,i),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=l;var c={};function u(){}function d(){}function p(){}var m={};a(m,o,function(){return this});var h=Object.getPrototypeOf,v=h&&h(h(k([])));v&&v!==e&&s.call(v,o)&&(m=v);var y=p.prototype=u.prototype=Object.create(m);function g(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function b(l,u){function c(e,t,n,r){var o=f(l[e],l,t);if("throw"!==o.type){var a=o.arg,i=a.value;return i&&"object"==q(i)&&s.call(i,"__await")?u.resolve(i.__await).then(function(e){c("next",e,n,r)},function(e){c("throw",e,n,r)}):u.resolve(i).then(function(e){a.value=e,n(a)},function(e){return c("throw",e,n,r)})}r(o.arg)}var t;this._invoke=function(n,r){function e(){return new u(function(e,t){c(n,r,e,t)})}return t=t?t.then(e,e):e()}}function w(e,t){var n=e.iterator[t.method];if(undefined===n){if(t.delegate=null,"throw"===t.method){if(e.iterator["return"]&&(t.method="return",t.arg=undefined,w(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=undefined),t.delegate=null,c):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function k(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,r=function e(){for(;++n<t.length;){if(s.call(t,n))return e.value=t[n],e.done=!1,e}return e.value=undefined,e.done=!0,e};return r.next=r}}return{next:S}}function S(){return{value:undefined,done:!0}}return d.prototype=p,a(y,"constructor",p),a(p,"constructor",d),d.displayName=a(p,r,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,a(e,r,"GeneratorFunction")),e.prototype=Object.create(y),e},i.awrap=function(e){return{__await:e}},g(b.prototype),a(b.prototype,n,function(){return this}),i.AsyncIterator=b,i.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var a=new b(l(e,t,n,r),o);return i.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},g(y),a(y,r,"Generator"),a(y,o,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),i.keys=function(n){var r=[];for(var e in n){r.push(e)}return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},i.values=k,_.prototype={constructor:_,reset:function e(t){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!t)for(var n in this){"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)}},stop:function e(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function t(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=undefined),!!t}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var l=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return t(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return t(a.finallyLoc)}}}},abrupt:function e(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(i)},complete:function e(t,n){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&&n&&(this.next=n),c},finish:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),c}},catch:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var a=o.arg;x(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function e(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=undefined),c}},i}function y(e,t,n,r,o,a,i){try{var l=e[a](i);var u=l.value}catch(e){n(e);return}if(l.done){t(u)}else{Promise.resolve(u).then(r,o)}}function ze(l){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=l.apply(e,i);function o(e){y(r,t,n,o,a,"next",e)}function a(e){y(r,t,n,o,a,"throw",e)}o(undefined)})}}var De=document.querySelectorAll(".tutor-form-toggle-input");De.forEach(function(n){n.addEventListener("change",function(e){var t=n.previousElementSibling;if(t){t.value=="on"?t.value="off":t.value="on"}})});jQuery(document).ready(function(p){"use strict";var m=wp.i18n.__;if(jQuery().wpColorPicker){p(".tutor_colorpicker").wpColorPicker()}if(jQuery().select2){p(".tutor_select2").select2()}if(_tutorobject.open_tutor_admin_menu){var e=p("#adminmenu");e.find('[href="admin.php?page=tutor"]').closest("li.wp-has-submenu").addClass("wp-has-current-submenu");e.find('[href="admin.php?page=tutor"]').closest("li.wp-has-submenu").find("a.wp-has-submenu").removeClass("wp-has-current-submenu").addClass("wp-has-current-submenu")}p(document).on("click",".tutor-option-media-upload-btn",function(e){e.preventDefault();var t=p(this);var n;if(n){n.open();return}n=wp.media({title:m("Select or Upload Media Of Your Choice","tutor"),button:{text:m("Upload media","tutor")},multiple:false});n.on("select",function(){var e=n.state().get("selection").first().toJSON();t.closest(".option-media-wrap").find(".option-media-preview").html('<img src="'+e.url+'" alt="" />');t.closest(".option-media-wrap").find("input").val(e.id);t.closest(".option-media-wrap").find(".tutor-media-option-trash-btn").show()});n.open()});p(document).on("click",".tutor-media-option-trash-btn",function(e){e.preventDefault();var t=p(this);t.closest(".option-media-wrap").find("img").remove();t.closest(".option-media-wrap").find("input").val("");t.closest(".option-media-wrap").find(".tutor-media-option-trash-btn").hide()});p(document).on("submit","#tutor-new-instructor-form",function(e){e.preventDefault();var t=p(this);var n=t.serializeObject();var r=p("#tutor-new-instructor-form [data-tutor-modal-submit]");var c=p("#tutor-new-instructor-form-response");n.action="tutor_add_instructor";p.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:n,beforeSend:function e(){r.attr("disabled","disable").addClass("is-loading");c.html("")},success:function e(t){if(!t.success){var n;if(t!==null&&t!==void 0&&(n=t.data)!==null&&n!==void 0&&n.errors.errors){for(var r=0,o=Object.values(t.data.errors.errors);r<o.length;r++){var a=o[r];c.append('\n\t\t\t\t\t\t\t\t<div class=\'tutor-col\'>\n\t\t\t\t\t\t\t\t\t<div class="tutor-alert tutor-warning">\n\t\t\t\t\t\t\t\t\t<div class="tutor-alert-text">\n\t\t\t\t\t\t\t\t\t\t<span class="tutor-alert-icon tutor-icon-circle-info tutor-mr-8"></span>\n\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t'.concat(a,"\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n \t\t\t\t"))}}else{for(var i=0,l=Object.values(t.data.errors);i<l.length;i++){var u=l[i];c.append('\n\t\t\t\t\t\t\t\t<div class=\'tutor-col\'>\n\t\t\t\t\t\t\t\t\t<div class="tutor-alert tutor-warning">\n\t\t\t\t\t\t\t\t\t<div class="tutor-alert-text">\n\t\t\t\t\t\t\t\t\t\t<span class="tutor-alert-icon tutor-icon-circle-info tutor-mr-8"></span>\n\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t'.concat(u,"\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t"))}}}else{p("#tutor-new-instructor-form").trigger("reset");tutor_toast(m("Success","tutor"),m("New Instructor Added","tutor"),"success");location.reload()}},complete:function e(){r.removeAttr("disabled").removeClass("is-loading")}})});p(document).on("click","a.instructor-action",function(){var t=ze(R().mark(function e(n){var r,o,a,i,l,u,c,s,f,d;return R().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n.preventDefault();r=p(this);o=r.attr("data-action");a=r.attr("data-instructor-id");i=n.target;l=i.innerHTML;i.innerHTML="";i.classList.add("is-loading");u=new FormData;u.set("action","instructor_approval_action");u.set("action_name",o);u.set("instructor_id",a);u.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);t.prev=13;t.next=16;return h(u);case 16:c=t.sent;t.next=19;return c.json();case 19:s=t.sent;if(i.classList.contains("is-loading")){i.classList.remove("is-loading");i.innerHTML=o.charAt(0).toUpperCase()+o.slice(1)}if(c.ok&&s.success){f="";if(o=="approve"){f="Instructor approved!"}if(o=="blocked"){f="Instructor blocked!"}d=document.querySelector(".tutor-modal-ins-approval");if(d){if(d.classList.contains("tutor-is-active")){d.classList.remove("tutor-is-active")}tutor_toast(m("Success","tutor"),m(f,"tutor"),"success");location.href="".concat(window._tutorobject.home_url,"/wp-admin/admin.php?page=tutor-instructors")}else{tutor_toast(m("Success","tutor"),m(f,"tutor"),"success");location.reload()}}else{tutor_toast(m("Failed","tutor"),m("Something went wrong!","tutor"),"error")}t.next=28;break;case 24:t.prev=24;t.t0=t["catch"](13);i.innerHTML=l;tutor_toast(m("Operation failed","tutor"),t.t0,"error");case 28:case"end":return t.stop()}}},e,this,[[13,24]])}));return function(e){return t.apply(this,arguments)}}());var t=document.querySelector(".tutor-modal-ins-approval .tutor-icon-56.tutor-icon-line-cross-line");if(t){t.addEventListener("click",function(){console.log("ckk");location.href="".concat(window._tutorobject.home_url,"/wp-admin/admin.php?page=tutor-instructors")})}p(document).on("click",".tutor-password-reveal",function(e){p(this).toggleClass("tutor-icon-eye-line tutor-icon-eye-bold");p(this).next().attr("type",function(e,t){return t=="password"?"text":"password"})});p(document).on("click",".tutor_video_poster_upload_btn",function(e){e.preventDefault();var t=p(this);var n;if(n){n.open();return}n=wp.media({title:m("Select or Upload Media Of Your Choice","tutor"),button:{text:m("Upload media","tutor")},multiple:false});n.on("select",function(){var e=n.state().get("selection").first().toJSON();t.closest(".tutor-video-poster-wrap").find(".video-poster-img").html('<img src="'+e.sizes.thumbnail.url+'" alt="" />');t.closest(".tutor-video-poster-wrap").find("input").val(e.id)});n.open()});p(document).on("change","#tutor_pmpro_membership_model_select",function(e){e.preventDefault();var t=p(this);if(t.val()==="category_wise_membership"){p(".membership_course_categories").show()}else{p(".membership_course_categories").hide()}});p(document).on("change","#tutor_pmpro_membership_model_select",function(e){e.preventDefault();var t=p(this);if(t.val()==="category_wise_membership"){p(".membership_course_categories").show()}else{p(".membership_course_categories").hide()}});p(document).on("submit",".pmpro_admin form",function(e){var t=p(this);if(!t.find('input[name="tutor_action"]').length){return}if(t.find('[name="tutor_pmpro_membership_model"]').val()=="category_wise_membership"&&!t.find(".membership_course_categories input:checked").length){if(!confirm(m("Do you want to save without any category?","tutor"))){e.preventDefault()}}});var n=p('#tutor-attach-product [name="tutor_course_price_type"]');if(n.length==0){p("#_tutor_is_course_public_meta_checkbox").show()}else{n.change(function(){if(p(this).prop("checked")){var e=p(this).val()=="paid"?"hide":"show";p("#_tutor_is_course_public_meta_checkbox")[e]()}}).trigger("change")}p(document).on("click",".instructor-layout-template",function(){p(".instructor-layout-template").removeClass("selected-template");p(this).addClass("selected-template")});p("#preview-action a.preview").click(function(e){var t=p(this).attr("href");if(t){e.preventDefault();window.open(t,"_blank")}});var r=p(".tutor-table .tutor-form-check-input");if(r){r.parent().addClass("tutor-option-field-row")}var o=document.querySelectorAll("td[id^='tutor-student-course-'] .tutor-form-check");o.forEach(function(e){if(e){if(e.classList.contains("tutor-option-field-row")){e.classList.remove("tutor-option-field-row")}}});var a=document.querySelectorAll("#adminmenu li > a");if(window._tutorobject.is_tutor_course_edit&&a){a.forEach(function(e){if(e.tagName==="A"&&e.hasAttribute("href")&&e.getAttribute("href")=="admin.php?page=tutor"){e.classList.add("current");e.closest("li").classList.add("current");var t=e.closest("li#toplevel_page_tutor");var n=e.closest("#toplevel_page_tutor li.wp-not-current-submenu.menu-top.toplevel_page_tutor > a");if(t){t.className="wp-has-submenu wp-has-current-submenu wp-menu-open menu-top toplevel_page_tutor current"}if(n){n.className="wp-has-submenu wp-has-current-submenu wp-menu-open menu-top toplevel_page_tutor current"}}})}})})()})();
27
  *
28
  * This source code is licensed under the MIT license found in the
29
  * LICENSE file in the root directory of this source tree.
30
+ */var s=t(7418),n="function"===typeof Symbol&&Symbol.for,f=n?Symbol.for("react.element"):60103,u=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,i=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,D=n?Symbol.for("react.memo"):60115,F=n?Symbol.for("react.lazy"):60116,p="function"===typeof Symbol&&Symbol.iterator;function m(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function y(e,t,n){this.props=e;this.context=t;this.refs=v;this.updater=n||h}y.prototype.isReactComponent={};y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error(m(85));this.updater.enqueueSetState(this,e,t,"setState")};y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function g(){}g.prototype=y.prototype;function b(e,t,n){this.props=e;this.context=t;this.refs=v;this.updater=n||h}var w=b.prototype=new g;w.constructor=b;s(w,y.prototype);w.isPureReactComponent=!0;var E={current:null},x=Object.prototype.hasOwnProperty,_={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,n){var r,o={},a=null,i=null;if(null!=t)for(r in void 0!==t.ref&&(i=t.ref),void 0!==t.key&&(a=""+t.key),t)x.call(t,r)&&!_.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)void 0===o[r]&&(o[r]=l[r]);return{$$typeof:f,type:e,key:a,ref:i,props:o,_owner:E.current}}function q(e,t){return{$$typeof:f,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function S(e){return"object"===typeof e&&null!==e&&e.$$typeof===f}function R(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}var T=/\/+/g,C=[];function L(e,t,n,r){if(C.length){var o=C.pop();o.result=e;o.keyPrefix=t;o.func=n;o.context=r;o.count=0;return o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function P(e){e.result=null;e.keyPrefix=null;e.func=null;e.context=null;e.count=0;10>C.length&&C.push(e)}function N(e,t,n,r){var o=typeof e;if("undefined"===o||"boolean"===o)e=null;var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case f:case u:a=!0}}if(a)return n(r,e,""===t?"."+j(e,0):t),1;a=0;t=""===t?".":t+":";if(Array.isArray(e))for(var i=0;i<e.length;i++){o=e[i];var l=t+j(o,i);a+=N(o,l,n,r)}else if(null===e||"object"!==typeof e?l=null:(l=p&&e[p]||e["@@iterator"],l="function"===typeof l?l:null),"function"===typeof l)for(e=l.call(e),i=0;!(o=e.next()).done;)o=o.value,l=t+j(o,i++),a+=N(o,l,n,r);else if("object"===o)throw n=""+e,Error(m(31,"[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return a}function O(e,t,n){return null==e?0:N(e,"",t,n)}function j(e,t){return"object"===typeof e&&null!==e&&null!=e.key?R(e.key):t.toString(36)}function U(e,t){e.func.call(e.context,t,e.count++)}function B(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++);Array.isArray(e)?A(e,r,n,function(e){return e}):null!=e&&(S(e)&&(e=q(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(T,"$&/")+"/")+n)),r.push(e))}function A(e,t,n,r,o){var a="";null!=n&&(a=(""+n).replace(T,"$&/")+"/");t=L(t,a,r,o);O(e,B,t);P(t)}var I={current:null};function M(){var e=I.current;if(null===e)throw Error(m(321));return e}var H={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:E,IsSomeRendererActing:{current:!1},assign:s};e.Children={map:function(e,t,n){if(null==e)return e;var r=[];A(e,r,null,t,n);return r},forEach:function(e,t,n){if(null==e)return e;t=L(null,null,t,n);O(e,U,t);P(t)},count:function(e){return O(e,function(){return null},null)},toArray:function(e){var t=[];A(e,t,null,function(e){return e});return t},only:function(e){if(!S(e))throw Error(m(143));return e}};e.Component=y;e.Fragment=r;e.Profiler=a;e.PureComponent=b;e.StrictMode=o;e.Suspense=d;e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H;e.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error(m(267,e));var r=s({},e.props),o=e.key,a=e.ref,i=e._owner;if(null!=t){void 0!==t.ref&&(a=t.ref,i=E.current);void 0!==t.key&&(o=""+t.key);if(e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)x.call(t,u)&&!_.hasOwnProperty(u)&&(r[u]=void 0===t[u]&&void 0!==l?l[u]:t[u])}var u=arguments.length-2;if(1===u)r.children=n;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:f,type:e.type,key:o,ref:a,props:r,_owner:i}};e.createContext=function(e,t){void 0===t&&(t=null);e={$$typeof:l,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null};e.Provider={$$typeof:i,_context:e};return e.Consumer=e};e.createElement=k;e.createFactory=function(e){var t=k.bind(null,e);t.type=e;return t};e.createRef=function(){return{current:null}};e.forwardRef=function(e){return{$$typeof:c,render:e}};e.isValidElement=S;e.lazy=function(e){return{$$typeof:F,_ctor:e,_status:-1,_result:null}};e.memo=function(e,t){return{$$typeof:D,type:e,compare:void 0===t?null:t}};e.useCallback=function(e,t){return M().useCallback(e,t)};e.useContext=function(e,t){return M().useContext(e,t)};e.useDebugValue=function(){};e.useEffect=function(e,t){return M().useEffect(e,t)};e.useImperativeHandle=function(e,t,n){return M().useImperativeHandle(e,t,n)};e.useLayoutEffect=function(e,t){return M().useLayoutEffect(e,t)};e.useMemo=function(e,t){return M().useMemo(e,t)};e.useReducer=function(e,t,n){return M().useReducer(e,t,n)};e.useRef=function(e){return M().useRef(e)};e.useState=function(e){return M().useState(e)};e.version="16.14.0"},7294:(e,t,n)=>{"use strict";if(true){e.exports=n(2408)}else{}}};var o={};function Fe(e){var t=o[e];if(t!==undefined){return t.exports}var n=o[e]={exports:{}};r[e](n,n.exports,Fe);return n.exports}var e={};(()=>{"use strict";var g=Fe(4367);var P=Fe(7294);var x=Fe(3935);function T(e){"@babel/helpers - typeof";return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function N(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */N=function e(){return i};var i={},e=Object.prototype,s=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function e(t,n,r){return t[n]=r}}function l(e,t,n,r){var o=t&&t.prototype instanceof u?t:u,a=Object.create(o.prototype),i=new _(r||[]);return a._invoke=function(a,i,l){var u="suspendedStart";return function(e,t){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===e)throw t;return S()}for(l.method=e,l.arg=t;;){var n=l.delegate;if(n){var r=w(n,l);if(r){if(r===c)continue;return r}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===u)throw u="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);u="executing";var o=f(a,i,l);if("normal"===o.type){if(u=l.done?"completed":"suspendedYield",o.arg===c)continue;return{value:o.arg,done:l.done}}"throw"===o.type&&(u="completed",l.method="throw",l.arg=o.arg)}}}(e,n,i),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=l;var c={};function u(){}function d(){}function p(){}var m={};a(m,o,function(){return this});var h=Object.getPrototypeOf,v=h&&h(h(k([])));v&&v!==e&&s.call(v,o)&&(m=v);var y=p.prototype=u.prototype=Object.create(m);function g(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function b(l,u){function c(e,t,n,r){var o=f(l[e],l,t);if("throw"!==o.type){var a=o.arg,i=a.value;return i&&"object"==T(i)&&s.call(i,"__await")?u.resolve(i.__await).then(function(e){c("next",e,n,r)},function(e){c("throw",e,n,r)}):u.resolve(i).then(function(e){a.value=e,n(a)},function(e){return c("throw",e,n,r)})}r(o.arg)}var t;this._invoke=function(n,r){function e(){return new u(function(e,t){c(n,r,e,t)})}return t=t?t.then(e,e):e()}}function w(e,t){var n=e.iterator[t.method];if(undefined===n){if(t.delegate=null,"throw"===t.method){if(e.iterator["return"]&&(t.method="return",t.arg=undefined,w(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=undefined),t.delegate=null,c):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function k(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,r=function e(){for(;++n<t.length;){if(s.call(t,n))return e.value=t[n],e.done=!1,e}return e.value=undefined,e.done=!0,e};return r.next=r}}return{next:S}}function S(){return{value:undefined,done:!0}}return d.prototype=p,a(y,"constructor",p),a(p,"constructor",d),d.displayName=a(p,r,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,a(e,r,"GeneratorFunction")),e.prototype=Object.create(y),e},i.awrap=function(e){return{__await:e}},g(b.prototype),a(b.prototype,n,function(){return this}),i.AsyncIterator=b,i.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var a=new b(l(e,t,n,r),o);return i.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},g(y),a(y,r,"Generator"),a(y,o,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),i.keys=function(n){var r=[];for(var e in n){r.push(e)}return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},i.values=k,_.prototype={constructor:_,reset:function e(t){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!t)for(var n in this){"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)}},stop:function e(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function t(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=undefined),!!t}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var l=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return t(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return t(a.finallyLoc)}}}},abrupt:function e(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(i)},complete:function e(t,n){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&&n&&(this.next=n),c},finish:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),c}},catch:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var a=o.arg;x(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function e(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=undefined),c}},i}function u(e,t,n,r,o,a,i){try{var l=e[a](i);var u=l.value}catch(e){n(e);return}if(l.done){t(u)}else{Promise.resolve(u).then(r,o)}}function O(l){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=l.apply(e,i);function o(e){u(r,t,n,o,a,"next",e)}function a(e){u(r,t,n,o,a,"throw",e)}o(undefined)})}}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach(function(e){A(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function A(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function I(e,t){return U(e)||S(e,t)||k(e,t)||_()}function _(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e,t){if(!e)return;if(typeof e==="string")return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}function o(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++){r[n]=e[n]}return r}function S(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var o=true;var a=false;var i,l;try{for(n=n.call(e);!(o=(i=n.next()).done);o=true){r.push(i.value);if(t&&r.length===t)break}}catch(e){a=true;l=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return r}function U(e){if(Array.isArray(e))return e}var M=(0,P.createContext)();var z=(0,P.createContext)();var s=function e(){return(0,P.useContext)(M)};var f=function e(){return(0,P.useContext)(z)};var B=function e(t){var n=(0,P.useState)(true),r=I(n,2),o=r[0],l=r[1];var a=(0,P.useState)([]),i=I(a,2),u=i[0],c=i[1];var s=(0,P.useState)("all"),f=I(s,2),d=f[0],p=f[1];var m=(0,P.useRef)(false);var h=(0,P.useRef)(null);var v=(0,P.useState)([]),y=I(v,2),g=y[0],b=y[1];var w=(0,P.useState)({}),E=I(w,2),x=E[0],_=E[1];function k(e){return e===null||e===void 0?void 0:e.reduce(function(e,t){e=j(j({},e),{},A({},t.basename,Boolean(t.is_enabled)));return e},{})}var S=function(){var t=O(N().mark(function e(){var n,r,o,a,i;return N().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n=new FormData;n.set("action","tutor_get_all_addons");n.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);t.prev=3;t.next=6;return fetch(_tutorobject.ajaxurl,{method:"POST",body:n});case 6:r=t.sent;if(!r.ok){t.next=13;break}t.next=10;return r.json();case 10:o=t.sent;a=o.data.addons;if(a&&a.length){i=k(a);c(a);h.current=a;l(false)}case 13:t.next=19;break;case 15:t.prev=15;t.t0=t["catch"](3);console.log(t.t0);l(false);case 19:case"end":return t.stop()}}},e,null,[[3,15]])}));return function e(){return t.apply(this,arguments)}}();(0,P.useEffect)(function(){S()},[]);(0,P.useEffect)(function(){if(m.current){if(d==="all"){c(h.current)}else{var e=h.current.filter(function(e){if(d==="active")return e.is_enabled;else if(d==="deactive")return!e.is_enabled;else if(d==="required")return e===null||e===void 0?void 0:e.depend_plugins});c(e)}}else if(!m.current)m.current=true},[d]);(0,P.useEffect)(function(){b(h.current)});var T=function e(t,n){var o=t.target.checked;_(function(e){return j(j({},e),{},A({},n,true))});var a=h.current.map(function(e){if(e.basename===n)return j(j({},e),{},{is_enabled:o});return e});if(d==="active"){var r=a.filter(function(e){return e.is_enabled});c(r)}else if(d==="deactive"){var i=a.filter(function(e){return!e.is_enabled});c(i)}else if(d==="required"){var l=a.filter(function(e){return e===null||e===void 0?void 0:e.depend_plugins});c(l)}else if(d==="all"){c(a)}h.current=a;var u=function(){var t=O(N().mark(function e(){var n,r;return N().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n=k(a);r=new FormData;r.set("action","addon_enable_disable");r.set("isEnable",Number(o));r.set("addonFieldName",n);r.set("addonFieldNames",JSON.stringify(n));r.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);t.prev=7;t.next=10;return fetch(_tutorobject.ajaxurl,{method:"POST",body:r});case 10:_(n);t.next=16;break;case 13:t.prev=13;t.t0=t["catch"](7);console.log(t.t0);case 16:case"end":return t.stop()}}},e,null,[[7,13]])}));return function e(){return t.apply(this,arguments)}}();u()};var C=function e(t){switch(t){case"active":p("active");break;case"deactive":p("deactive");break;case"required":p("required");break;case"all":p("all");break;default:p("all");break}};var L=function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";if(t.trim()){var n=h.current.filter(function(e){return e.name.toLowerCase().includes(t.toLowerCase())});c(n)}else{c(h.current)}};return P.createElement(M.Provider,{value:{allAddons:u,addonList:g,loading:o}},P.createElement(z.Provider,{value:{activeTab:d,getTabStatus:C,setActiveTab:p,setAllAddons:c,handleOnChange:T,filterAddons:L,addonLoading:x}},t.children))};var H=wp.i18n.__;var V=function e(t){return t.charAt(0).toUpperCase()+t.slice(1)};var W=function e(){var t=["all","active","deactive","required"];var n=s(),r=n.addonList;var o=f(),a=o.activeTab,i=o.getTabStatus;var l=r===null||r===void 0?void 0:r.reduce(function(e,t){return e+Number(t.is_enabled)},0);var u=r===null||r===void 0?void 0:r.reduce(function(e,t){return e+Number(!t.is_enabled)},0);var c=r===null||r===void 0?void 0:r.reduce(function(e,t){return e+Number(t.hasOwnProperty("depend_plugins")||0)},0);return P.createElement("header",{className:"tutor-wp-dashboard-header tutor-px-24 tutor-mb-24"},P.createElement("div",{className:"tutor-row tutor-align-lg-center"},P.createElement("div",{className:"tutor-col-lg"},P.createElement("div",{className:"tutor-p-12"},P.createElement("span",{className:"tutor-fs-5 tutor-fw-medium tutor-mr-16"},H("Add-ons","tutor")))),P.createElement("div",{className:"tutor-col-lg-auto"},P.createElement("ul",{className:"tutor-nav tutor-nav-admin"},t.map(function(t,e){return P.createElement("li",{className:"tutor-nav-item",key:e},P.createElement("a",{className:"tutor-nav-link".concat(t===a?" is-active":""),href:"#",onClick:function e(){return i(t)}},V(t)," ",P.createElement("span",{className:"tutor-ml-4"},"(","active"===t?l:"deactive"===t?u:"required"===t?c:r===null||r===void 0?void 0:r.length,")")))})))))};const Q=W;function $(e,t){return X(e)||Y(e,t)||K(e,t)||G()}function G(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function K(e,t){if(!e)return;if(typeof e==="string")return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}function a(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++){r[n]=e[n]}return r}function Y(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var o=true;var a=false;var i,l;try{for(n=n.call(e);!(o=(i=n.next()).done);o=true){r.push(i.value);if(t&&r.length===t)break}}catch(e){a=true;l=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return r}function X(e){if(Array.isArray(e))return e}var Z=wp.i18n.__;var J=function e(n){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:500;var o=null;return function(){var e=this,t=arguments;clearTimeout(o);o=setTimeout(function(){n.apply(e,t)},r)}};var ee=function e(){var t=f(),n=t.filterAddons;var r=(0,P.useState)(""),o=$(r,2),a=o[0],i=o[1];var l=(0,P.useCallback)(J(function(e){n(e)}),[]);var u=function e(t){var n=t.target.value;i(n);l(n)};return P.createElement("div",{className:"tutor-addons-list-select-filter"},P.createElement("div",{className:"tutor-form-wrap"},P.createElement("span",{className:"tutor-icon-search tutor-form-icon","area-hidden":"true"}),P.createElement("input",{type:"search",className:"tutor-form-control",placeholder:Z("Search…","tutor"),value:a,onChange:u})))};const te=ee;var d=wp.i18n.__;var ne=function e(t){var n,r,o;var a=t.addon,i=t.addonId;var l=f(),u=l.handleOnChange,c=l.addonLoading;return P.createElement("div",{className:"tutor-col-lg-6 tutor-col-xl-4 tutor-col-xxl-3 tutor-mb-32"},P.createElement("div",{className:"tutor-card tutor-card-md tutor-addon-card ".concat(a.plugins_required.length>0?"not-subscribed":""," tutor-addon-card-").concat(i+1),style:{transitionDelay:"".concat(100*i,"ms")}},P.createElement("div",{className:"tutor-card-body"},P.createElement("div",{className:"tutor-addon-logo tutor-mb-32"},P.createElement("div",{className:"tutor-ratio tutor-ratio-1x1"},P.createElement("img",{src:a.thumb_url,alt:a.name}))),P.createElement("div",{className:"tutor-addon-title tutor-fs-6 tutor-fw-medium tutor-color-black tutor-mb-20"},a.name),P.createElement("div",{className:"tutor-addon-description tutor-fs-7 tutor-color-secondary"},a.description)),P.createElement("div",{className:"tutor-card-footer tutor-d-flex tutor-justify-between tutor-align-center tutor-mt-auto"},P.createElement("div",{className:"tutor-fs-7 tutor-fw-medium tutor-color-muted"},P.createElement("div",{className:"tutor-color-muted tutor-fs-7 tutor-fw-medium tutor-d-flex"},P.createElement("span",null,((n=a.plugins_required)===null||n===void 0?void 0:n.length)>0?d("Required Plugin(s)","tutor"):((r=a.ext_required)===null||r===void 0?void 0:r.length)>0?d("Required for Push Notification","tutor"):d("No extra plugin required","tutor")),a.ext_required?P.createElement("div",{className:"tooltip-wrap tooltip-icon"},P.createElement("span",{className:"tooltip-txt tooltip-top"},a.ext_required.map(function(e,t){return P.createElement("div",{key:t},P.createElement("span",{dangerouslySetInnerHTML:{__html:e}}))}))):a.depend_plugins&&a.plugins_required.length?P.createElement("div",{className:"tooltip-wrap tooltip-icon"},P.createElement("span",{className:"tooltip-txt tooltip-top"},a.plugins_required.map(function(e,t){return P.createElement("div",{key:t},P.createElement("span",null,e))}))):"")),((o=a.plugins_required)===null||o===void 0?void 0:o.length)===0&&P.createElement("div",{className:"addon-toggle"},P.createElement("label",{className:"tutor-form-toggle"},P.createElement("input",{type:"checkbox",className:"tutor-form-toggle-input",name:a.basename,checked:a.is_enabled,onChange:function e(t){return u(t,a.basename)}}),P.createElement("span",{className:"tutor-form-toggle-control","area-hidden":"true"}))))))};const re=ne;var i=wp.i18n.__;var oe="".concat(_tutorobject.tutor_url,"assets/images/addon-empty-state.svg");var ae=function e(){var t=s(),n=t.allAddons,r=t.loading;return P.createElement("div",{className:"tutor-addons-list-items tutor-row tutor-gx-xxl-4 tutor-mt-32 ".concat(n.length<3?"is-less-items":""," ").concat(n.length?"is-active":"")},n.length?n.map(function(e,t){return P.createElement(re,{addon:e,key:t,addonId:t})}):r?P.createElement("div",{className:"tutor-col-12 tutor-text-center tutor-py-60"},P.createElement("div",{className:"tutor-spinner","area-hidden":"true"})):P.createElement("div",{className:"tutor-col-12"},P.createElement("div",{className:"tutor-addons-card tutor-p-32"},P.createElement("div",{className:"tutor-d-flex tutor-flex-column tutor-justify-center tutor-text-center"},P.createElement("div",{className:"tutor-mb-32"},P.createElement("img",{src:oe,alt:i("Empty State Illustration","tutor")})),P.createElement("div",{className:"tutor-fs-6 tutor-color-secondary"},i("No Addons Found!","tutor"))))))};const ie=ae;var le=function e(){return P.createElement(B,null,P.createElement("div",{className:"tutor-backend-settings-addons-list tutor-dashboard-page"},P.createElement("div",{className:"tutor-admin-wrap"},P.createElement(Q,null),P.createElement("div",{className:"tutor-admin-body"},P.createElement("div",{className:"tutor-addons-list-body"},P.createElement(te,null),P.createElement(ie,null))))))};const ue=le;window.addEventListener("DOMContentLoaded",function(){function e(){var e=P.createElement(ue,null);var t=document.getElementById("tutor-addons-list-wrapper");if(null!==t){x.render(e,t)}}e()});var ce=Fe(248);var se=Fe(76);function C(e){"@babel/helpers - typeof";return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function L(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */L=function e(){return i};var i={},e=Object.prototype,s=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function e(t,n,r){return t[n]=r}}function l(e,t,n,r){var o=t&&t.prototype instanceof u?t:u,a=Object.create(o.prototype),i=new _(r||[]);return a._invoke=function(a,i,l){var u="suspendedStart";return function(e,t){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===e)throw t;return S()}for(l.method=e,l.arg=t;;){var n=l.delegate;if(n){var r=w(n,l);if(r){if(r===c)continue;return r}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===u)throw u="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);u="executing";var o=f(a,i,l);if("normal"===o.type){if(u=l.done?"completed":"suspendedYield",o.arg===c)continue;return{value:o.arg,done:l.done}}"throw"===o.type&&(u="completed",l.method="throw",l.arg=o.arg)}}}(e,n,i),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=l;var c={};function u(){}function d(){}function p(){}var m={};a(m,o,function(){return this});var h=Object.getPrototypeOf,v=h&&h(h(k([])));v&&v!==e&&s.call(v,o)&&(m=v);var y=p.prototype=u.prototype=Object.create(m);function g(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function b(l,u){function c(e,t,n,r){var o=f(l[e],l,t);if("throw"!==o.type){var a=o.arg,i=a.value;return i&&"object"==C(i)&&s.call(i,"__await")?u.resolve(i.__await).then(function(e){c("next",e,n,r)},function(e){c("throw",e,n,r)}):u.resolve(i).then(function(e){a.value=e,n(a)},function(e){return c("throw",e,n,r)})}r(o.arg)}var t;this._invoke=function(n,r){function e(){return new u(function(e,t){c(n,r,e,t)})}return t=t?t.then(e,e):e()}}function w(e,t){var n=e.iterator[t.method];if(undefined===n){if(t.delegate=null,"throw"===t.method){if(e.iterator["return"]&&(t.method="return",t.arg=undefined,w(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=undefined),t.delegate=null,c):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function k(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,r=function e(){for(;++n<t.length;){if(s.call(t,n))return e.value=t[n],e.done=!1,e}return e.value=undefined,e.done=!0,e};return r.next=r}}return{next:S}}function S(){return{value:undefined,done:!0}}return d.prototype=p,a(y,"constructor",p),a(p,"constructor",d),d.displayName=a(p,r,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,a(e,r,"GeneratorFunction")),e.prototype=Object.create(y),e},i.awrap=function(e){return{__await:e}},g(b.prototype),a(b.prototype,n,function(){return this}),i.AsyncIterator=b,i.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var a=new b(l(e,t,n,r),o);return i.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},g(y),a(y,r,"Generator"),a(y,o,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),i.keys=function(n){var r=[];for(var e in n){r.push(e)}return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},i.values=k,_.prototype={constructor:_,reset:function e(t){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!t)for(var n in this){"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)}},stop:function e(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function t(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=undefined),!!t}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var l=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return t(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return t(a.finallyLoc)}}}},abrupt:function e(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(i)},complete:function e(t,n){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&&n&&(this.next=n),c},finish:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),c}},catch:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var a=o.arg;x(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function e(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=undefined),c}},i}function c(e,t,n,r,o,a,i){try{var l=e[a](i);var u=l.value}catch(e){n(e);return}if(l.done){t(u)}else{Promise.resolve(u).then(r,o)}}function b(l){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=l.apply(e,i);function o(e){c(r,t,n,o,a,"next",e)}function a(e){c(r,t,n,o,a,"throw",e)}o(undefined)})}}function w(t,e){var n=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=fe(t))||e&&t&&typeof t.length==="number"){if(n)t=n;var r=0;var o=function e(){};return{s:o,n:function e(){if(r>=t.length)return{done:true};return{done:false,value:t[r++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a=true,i=false,l;return{s:function e(){n=n.call(t)},n:function e(){var t=n.next();a=t.done;return t},e:function e(t){i=true;l=t},f:function e(){try{if(!a&&n["return"]!=null)n["return"]()}finally{if(i)throw l}}}}function fe(e,t){if(!e)return;if(typeof e==="string")return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}function l(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++){r[n]=e[n]}return r}var e=wp.i18n,E=e.__,de=e._x,pe=e._n,me=e._nx;document.addEventListener("DOMContentLoaded",function(){var l=document.getElementById("tutor-common-confirmation-modal");var u=document.getElementById("tutor-common-confirmation-form");var e=document.getElementById("tutor-backend-filter-course");if(e){e.addEventListener("change",function(e){window.location=s("course-id",e.target.value)},{once:true})}var t=document.getElementById("tutor-backend-filter-category");if(t){t.addEventListener("change",function(e){window.location=s("category",e.target.value)},{once:true})}var n=document.getElementById("tutor-backend-filter-order");if(n){n.addEventListener("change",function(e){window.location=s("order",e.target.value)},{once:true})}var r=document.getElementById("tutor-admin-search-filter-form");var o=document.getElementById("tutor-backend-filter-search");if(r){o.addEventListener("search",function(e){var t=e.currentTarget||{},n=t.value;if(/\S+/.test(n)==false){window.location=s("search","")}});r.onsubmit=function(e){e.preventDefault();var t=o.value;window.location=s("search",t)}}var a=document.getElementById("tutor-admin-bulk-action-btn");var i=document.querySelector(".tutor-bulk-modal-disabled");if(a){a.onclick=function(){var e=[];var t=document.querySelectorAll(".tutor-bulk-checkbox");var n=w(t),r;try{for(n.s();!(r=n.n()).done;){var o=r.value;if(o.checked){e.push(o.value)}}}catch(e){n.e(e)}finally{n.f()}if(e.length){i.setAttribute("id","tutor-bulk-confirm-popup")}else{tutor_toast(E("Warning","tutor"),E("Nothing was selected for bulk action.","tutor"),"error");if(i.hasAttribute("id")){i.removeAttribute("id")}}}}var h=document.getElementById("tutor-admin-bulk-action-form");if(h){h.onsubmit=function(){var t=b(L().mark(function e(n){var r,o,a,i,l,u,c,s,f,d,p,m;return L().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n.preventDefault();n.stopPropagation();r=new FormData(h);o=[];a=document.querySelectorAll(".tutor-bulk-checkbox");i=w(a);try{for(i.s();!(l=i.n()).done;){u=l.value;if(u.checked){o.push(u.value)}}}catch(e){i.e(e)}finally{i.f()}if(o.length){t.next=10;break}alert(E("Select checkbox for action","tutor"));return t.abrupt("return");case 10:r.set("bulk-ids",o);r.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);t.prev=12;c=document.querySelector("#tutor-confirm-bulk-action[data-tutor-modal-submit]");c.classList.add("is-loading");t.next=17;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:r});case 17:s=t.sent;c.classList.remove("is-loading");if(!s.ok){t.next=24;break}t.next=22;return s.json();case 22:f=t.sent;if(f.success){location.reload()}else{d=f.data||{},p=d.message,m=p===void 0?E("Something went wrong, please try again ","tutor"):p;tutor_toast(E("Failed","tutor"),m,"error")}case 24:t.next=29;break;case 26:t.prev=26;t.t0=t["catch"](12);console.log(t.t0);case 29:case"end":return t.stop()}}},e,null,[[12,26]])}));return function(e){return t.apply(this,arguments)}}()}var c=document.getElementById("tutor-confirm-bulk-action");if(c){c.onclick=function(){var e=document.createElement("input");e.type="submit";h.appendChild(e);e.click();e.remove()}}function s(e,t){var n=new URL(window.location.href);var r=n.searchParams;r.set(e,t);r.set("paged",1);return n}var f=document.querySelector("#tutor-bulk-checkbox-all");if(f){f.addEventListener("click",function(){var e=document.querySelectorAll(".tutor-bulk-checkbox");e.forEach(function(e){if(f.checked){e.checked=true}else{e.checked=false}})})}var d=document.querySelectorAll(".tutor-admin-course-delete");var p=w(d),m;try{for(p.s();!(m=p.n()).done;){var v=m.value;v.onclick=function(e){var t=e.currentTarget.dataset.id;if(u){console.log(u);u.elements.action.value="tutor_course_delete";u.elements.id.value=t}}}}catch(e){p.e(e)}finally{p.f()}if(u){u.onsubmit=function(){var t=b(L().mark(function e(n){var r,o,a,i;return L().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n.preventDefault();r=new FormData(u);o=u.querySelector("[data-tutor-modal-submit]");o.classList.add("is-loading");t.next=6;return y(r);case 6:a=t.sent;if(l.classList.contains("tutor-is-active")){l.classList.remove("tutor-is-active")}if(!a.ok){t.next=14;break}t.next=11;return a.json();case 11:i=t.sent;o.classList.remove("is-loading");if(i){tutor_toast(E("Delete","tutor"),E("Course has been deleted ","tutor"),"success");location.reload()}else{tutor_toast(E("Failed","tutor"),E("Course delete failed ","tutor"),"error")}case 14:case"end":return t.stop()}}},e)}));return function(e){return t.apply(this,arguments)}}()}function y(e){return g.apply(this,arguments)}function g(){g=b(L().mark(function e(n){var r;return L().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:t.prev=0;t.next=3;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:n});case 3:r=t.sent;return t.abrupt("return",r);case 7:t.prev=7;t.t0=t["catch"](0);tutor_toast(E("Operation failed","tutor"),t.t0,"error");case 10:case"end":return t.stop()}}},e,null,[[0,7]])}));return g.apply(this,arguments)}});function h(e){return t.apply(this,arguments)}function t(){t=b(L().mark(function e(n){var r;return L().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:t.prev=0;t.next=3;return fetch(window._tutorobject.ajaxurl,{method:"POST",body:n});case 3:r=t.sent;return t.abrupt("return",r);case 7:t.prev=7;t.t0=t["catch"](0);tutor_toast(E("Operation failed","tutor"),t.t0,"error");case 10:case"end":return t.stop()}}},e,null,[[0,7]])}));return t.apply(this,arguments)}var he=Fe(845);var ve=Fe(2988);var ye=Fe(3676);var ge=Fe(4523);var be=function e(t,n){var r=wp.i18n.__;var o=t||{},a=o.data,i=a===void 0?{}:a;var l=i.message,u=l===void 0?n||r("Something Went Wrong!","tutor"):l;return u};var n={warning:'<svg class="tutor-icon-v2 warning" width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18.0388 14.2395C18.2457 14.5683 18.3477 14.9488 18.3321 15.3333C18.3235 15.6951 18.2227 16.0493 18.0388 16.3647C17.851 16.6762 17.5885 16.9395 17.2733 17.1326C16.9301 17.3257 16.5383 17.4237 16.1412 17.4159H5.87591C5.47974 17.4234 5.08907 17.3253 4.74673 17.1326C4.42502 16.9409 4.15549 16.6776 3.96071 16.3647C3.77376 16.0506 3.67282 15.6956 3.66741 15.3333C3.6596 14.9496 3.76106 14.5713 3.96071 14.2395L9.11094 5.64829C9.29701 5.31063 9.58016 5.03215 9.9263 4.84641C10.2558 4.67355 10.6248 4.58301 10.9998 4.58301C11.3747 4.58301 11.7437 4.67355 12.0732 4.84641C12.4259 5.02952 12.7154 5.30825 12.9062 5.64829L18.0388 14.2395ZM11.7447 10.4086C11.7447 10.2131 11.7653 10.0176 11.7799 9.81924C11.7946 9.62089 11.8063 9.41971 11.818 9.21853C11.8178 9.1484 11.8129 9.07836 11.8034 9.00885C11.7916 8.94265 11.7719 8.87799 11.7447 8.81617C11.6644 8.64655 11.5255 8.50928 11.3517 8.42798C11.1805 8.3467 10.9848 8.32759 10.8003 8.37414C10.6088 8.42217 10.4413 8.53471 10.3281 8.69149C10.213 8.84985 10.1525 9.03921 10.1551 9.2327C10.1551 9.3602 10.1756 9.48771 10.1844 9.61239C10.1932 9.73706 10.202 9.86457 10.2137 9.99208C10.2401 10.4709 10.2695 10.947 10.2988 11.4088C10.3281 11.8707 10.3545 12.3552 10.3838 12.8256C10.3857 12.9019 10.4032 12.9771 10.4352 13.0468C10.4672 13.1166 10.5131 13.1796 10.5703 13.2322C10.6275 13.2849 10.6948 13.3261 10.7685 13.3536C10.8422 13.381 10.9208 13.3942 10.9998 13.3923C11.0794 13.3946 11.1587 13.3813 11.2328 13.353C11.307 13.3248 11.3744 13.2822 11.4309 13.228C11.5454 13.1171 11.6115 12.968 11.6157 12.8114V12.5281C11.6157 12.4317 11.6157 12.3382 11.6157 12.2447C11.6362 11.9415 11.6538 11.6327 11.6743 11.3238C11.6949 11.015 11.7271 10.7118 11.7447 10.4086ZM10.9998 15.5118C11.1049 15.5119 11.2091 15.4919 11.3062 15.453C11.4034 15.4141 11.4916 15.3571 11.5658 15.2851C11.6441 15.2191 11.7061 15.137 11.7472 15.0448C11.7883 14.9526 11.8075 14.8527 11.8034 14.7524C11.8053 14.6497 11.7863 14.5476 11.7474 14.452C11.7085 14.3564 11.6505 14.2692 11.5767 14.1953C11.5029 14.1213 11.4147 14.0621 11.3172 14.0211C11.2197 13.9801 11.1149 13.958 11.0086 13.9562C10.9023 13.9543 10.7966 13.9727 10.6977 14.0103C10.5987 14.0479 10.5084 14.1039 10.4319 14.1752C10.3553 14.2465 10.2941 14.3317 10.2516 14.4259C10.2092 14.52 10.1863 14.6214 10.1844 14.7241C10.1844 14.933 10.2703 15.1333 10.4232 15.2811C10.5761 15.4288 10.7835 15.5118 10.9998 15.5118Z" fill="#9CA0AC"/></svg>',magnifyingGlass:'<svg class="tutor-icon-v2 magnifying-glass" width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.3056 5.375C7.58249 5.375 5.375 7.58249 5.375 10.3056C5.375 13.0286 7.58249 15.2361 10.3056 15.2361C13.0286 15.2361 15.2361 13.0286 15.2361 10.3056C15.2361 7.58249 13.0286 5.375 10.3056 5.375ZM4.125 10.3056C4.125 6.89214 6.89214 4.125 10.3056 4.125C13.719 4.125 16.4861 6.89214 16.4861 10.3056C16.4861 13.719 13.719 16.4861 10.3056 16.4861C6.89214 16.4861 4.125 13.719 4.125 10.3056Z" fill="#9CA0AC"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.7874 13.7872C14.0314 13.5431 14.4272 13.5431 14.6712 13.7872L17.6921 16.8081C17.9362 17.0521 17.9362 17.4479 17.6921 17.6919C17.448 17.936 17.0523 17.936 16.8082 17.6919L13.7874 14.6711C13.5433 14.427 13.5433 14.0313 13.7874 13.7872Z" fill="#9CA0AC"/></svg>',angleRight:'<svg class="tutor-icon-v2 angle-right" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.842 12.633C7.80402 12.6702 7.7592 12.6998 7.71 12.72C7.65839 12.7401 7.60341 12.7503 7.548 12.75C7.49655 12.7496 7.44563 12.7395 7.398 12.72C7.34843 12.7005 7.30347 12.6709 7.266 12.633L6.88201 12.252C6.84384 12.2138 6.81284 12.1691 6.79051 12.12C6.76739 12.0694 6.75367 12.015 6.75001 11.9595C6.74971 11.9045 6.75832 11.8498 6.77551 11.7975C6.79308 11.7477 6.82181 11.7025 6.85951 11.6655L9.53249 9.00001L6.86701 6.33453C6.82576 6.29904 6.79427 6.2536 6.77551 6.20253C6.75832 6.15026 6.74971 6.09555 6.75001 6.04053C6.75367 5.98502 6.76739 5.93064 6.79051 5.88003C6.81284 5.8309 6.84384 5.78619 6.88201 5.74803L7.263 5.36704C7.30047 5.32916 7.34543 5.29953 7.395 5.28004C7.44263 5.26056 7.49355 5.25038 7.545 5.25004C7.60142 5.24931 7.65745 5.2595 7.71 5.28004C7.7592 5.30025 7.80402 5.3298 7.842 5.36704L11.181 8.70752C11.2233 8.74442 11.2579 8.78926 11.283 8.83951C11.3077 8.88941 11.3206 8.94433 11.3206 9.00001C11.3206 9.05569 11.3077 9.11062 11.283 9.16051C11.2579 9.21076 11.2233 9.25561 11.181 9.29251L7.842 12.633Z" fill="#B4B7C0"/></svg>'};var we=n.angleRight,Ee=n.magnifyingGlass,xe=n.warning;document.addEventListener("DOMContentLoaded",function(){var h=window.jQuery;var v=wp.i18n.__;var o=document.querySelectorAll(".image_upload_button");var e=function e(t){var n=o[t].closest(".image-previewer");var i=n.querySelector(".input_file");var l=n.querySelector(".upload_preview");var u=document.querySelector('[data-source="email-title-logo"]');var r=n.querySelector(".delete-btn");o[t].onclick=function(e){e.preventDefault();var a=wp.media({title:"Upload Image",library:{type:"image"},multiple:false,frame:"post",state:"insert"});a.open();a.on("insert",function(e){var t=a.state();e=e||t.get("selection");if(!e)return;var n=e.first();var r=t.display(n).toJSON();n=n.toJSON();var o=n.sizes[r.size].url;if(null!==l){l.src=i.value=o}if(null!==u){u.src=i.value=o}})};r.onclick=function(){i.value="";u.src=""}};for(var t=0;t<o.length;++t){e(t)}var a=function e(t){var n=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return n.test(String(t).toLowerCase())};h(window).on("click",function(e){h(".tutor-notification, .search_result").removeClass("show")});h(".tutor-notification-close").click(function(e){h(".tutor-notification").removeClass("show")});var i=false;var n=function e(t){t.forEach(function(t){t.onchange=function(e){if(false===a(t.value)){t.style.borderColor="red";t.focus();i=false}else{t.style.borderColor="#ddd";i=true}}})};var l=function e(t){t.forEach(function(e){var t=e.closest(".tutor-option-nav-page");var n=e&&e.parentNode.parentNode.querySelector("[tutor-option-name]").innerText;var r=t&&t.querySelector("[tutor-option-title]").innerText;var o='"'+r+" > "+n+'" email is invalid!';if(false===a(e.value)){e.style.borderColor="red";e.focus();tutor_toast("Warning",o,"error")}else{i=true}})};var u=function e(t){t.forEach(function(e){})};var c=document.querySelectorAll('[type="email"]');var s=document.querySelectorAll('[type="number"]');if(0!==c.length){n(c)}else{i=true}h("#save_tutor_option").click(function(e){e.preventDefault();h("#tutor-option-form").submit()});h("#tutor-option-form").submit(function(e){e.preventDefault();if(tinyMCE){tinyMCE.triggerSave()}var t=h("#save_tutor_option");var n=h(this);var r=n.serializeObject();if(0!==s.length){u(s)}if(0!==c.length){l(c)}if(true===i){if(!e.detail||e.detail==1){h.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:r,beforeSend:function e(){t.addClass("is-loading");t.attr("disabled",true)},success:function e(t){var n=t||{},r=n.data,o=r===void 0?{}:r,e=n.success;var a=o.message,i=a===void 0?v("Something Went Wrong!","tutor"):a;if(e){if(document.getElementById("save_tutor_option")){document.getElementById("save_tutor_option").disabled=true}tutor_toast("Success!",v("Settings Saved","tutor"),"success");return}tutor_toast("Error!",i,"error")},complete:function e(){t.removeClass("is-loading");t.attr("disabled","disabled")}})}}});function y(e,t,n,r,o){var a=r?"".concat(we," ").concat(r):"";var i='\n\t\t<a data-tab="'.concat(t,'" data-key="field_').concat(o,'">\n\t\t\t<div class="search_result_title">\n\t\t\t').concat(Ee,'\n\t\t\t<span class="tutor-fs-7">').concat(e,'</span>\n\t\t\t</div>\n\t\t\t<div class="search_navigation">\n\t\t\t<div class="nav-track tutor-fs-7">\n\t\t\t\t<span>').concat(n,"</span>\n\t\t\t\t<span>").concat(a,"</span>\n\t\t\t</div>\n\t\t\t</div>\n\t\t</a>");return i}var f;h("#search_settings").on("input",function(e){var t=this;e.preventDefault();var r=h(this);if(f){window.clearTimeout(f)}f=window.setTimeout(function(){if(e.target.value){var m=t.value;h.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:{action:"tutor_option_search",keyword:m},beforeSend:function e(){r.parent().find(".tutor-form-icon").removeClass("tutor-icon-search").addClass("tutor-icon-circle-notch tutor-animation-spin")},success:function e(t){if(!t.success){tutor_toast(v("Error","tutor"),be(t),"error");return}var o="",a="",i=true,l="",u="",c="",s="",f="",d="",p="",n=t.data.fields;Object.values(n).forEach(function(e,t,n){var r;l=e.label;u=e.section_slug;c=e.section_label;s=e.block_label;p=e.event?e.key+"_"+e.event:e.key;d=new RegExp(m,"ig");f=(r=l.match(d))===null||r===void 0?void 0:r[0];if(f){a=l.replace(d,"<span style='color: #212327; font-weight:500'>".concat(f,"</span>"));o+=y(a,u,c,s,p);i=false}});if(i){o+='<div class="no_item">'.concat(xe," No Results Found</div>")}h(".search_result").html(o).addClass("show");r.parent().find(".tutor-form-icon").removeClass("tutor-icon-circle-notch tutor-animation-spin").addClass("tutor-icon-search");o=""},complete:function e(){d()}})}else{document.querySelector(".search-popup-opener").classList.remove("show")}f=undefined},500)});function d(){var e=document.querySelectorAll(".tutor-options-search .search-popup-opener a");var o=document.querySelectorAll("[tutor-option-tabs] li > a");var a=document.querySelectorAll(".tutor-option-nav-page");e.forEach(function(e){e.addEventListener("click",function(e){var t=e.target.closest("[data-tab]").dataset.tab;var n=e.target.closest("[data-key]").dataset.key;if(t){document.title=e.target.innerText+" < "+_tutorobject.site_title;o.forEach(function(e){e.classList.remove("is-active")});document.querySelector(".tutor-option-tabs [data-tab=".concat(t,"]")).classList.add("is-active");a.forEach(function(e){e.classList.remove("is-active")});document.querySelector(".tutor-option-tab-pages #".concat(t)).classList.add("is-active");var r=new URL(window.location);r.searchParams.set("tab_page",t);window.history.pushState({},"",r)}document.querySelector(".search-popup-opener").classList.remove("visible");document.querySelector('.tutor-options-search input[type="search"]').value="";p(n)})})}function p(e){var t=document.querySelector("#".concat(e));var n=t&&t.querySelector("[tutor-option-name]");var r=t&&t.parentNode.querySelector(".tutor-option-field-row");if(r){n.classList.add("isHighlighted");setTimeout(function(){n.classList.remove("isHighlighted")},6e3);r.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}else{console.warn("scrollTargetEl Not found!")}}function r(e,t,n){if(e.style===undefined)return;t===(n!==undefined?n:"on")?e.style.display="grid":e.style.display="none"}function m(n,r){MutationObserver=window.MutationObserver||window.WebKitMutationObserver;var e=new MutationObserver(function(e,t){if(e[0].attributeName=="value"){if(typeof r==="function"){r(n.value)}}});e.observe(n,{attributes:true})}var g=document.querySelector("[name='tutor_option[monetize_by]']");var b=document.getElementById("field_tutor_woocommerce_order_auto_complete");if(g){r(b,g.value,"wc");g.onchange=function(e){return r(b,e.target.value,"wc")}}var w=document.querySelector("[name='tutor_option[enable_revenue_sharing]']");var E=document.getElementById("field_sharing_percentage");if(w){r(E,w.value);m(w,function(e){return r(E,e)})}});var _e=Fe(9196);var ke=Fe(2919);var Se=Fe(0);function D(e){"@babel/helpers - typeof";return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function F(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */F=function e(){return i};var i={},e=Object.prototype,s=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function e(t,n,r){return t[n]=r}}function l(e,t,n,r){var o=t&&t.prototype instanceof u?t:u,a=Object.create(o.prototype),i=new _(r||[]);return a._invoke=function(a,i,l){var u="suspendedStart";return function(e,t){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===e)throw t;return S()}for(l.method=e,l.arg=t;;){var n=l.delegate;if(n){var r=w(n,l);if(r){if(r===c)continue;return r}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===u)throw u="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);u="executing";var o=f(a,i,l);if("normal"===o.type){if(u=l.done?"completed":"suspendedYield",o.arg===c)continue;return{value:o.arg,done:l.done}}"throw"===o.type&&(u="completed",l.method="throw",l.arg=o.arg)}}}(e,n,i),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=l;var c={};function u(){}function d(){}function p(){}var m={};a(m,o,function(){return this});var h=Object.getPrototypeOf,v=h&&h(h(k([])));v&&v!==e&&s.call(v,o)&&(m=v);var y=p.prototype=u.prototype=Object.create(m);function g(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function b(l,u){function c(e,t,n,r){var o=f(l[e],l,t);if("throw"!==o.type){var a=o.arg,i=a.value;return i&&"object"==D(i)&&s.call(i,"__await")?u.resolve(i.__await).then(function(e){c("next",e,n,r)},function(e){c("throw",e,n,r)}):u.resolve(i).then(function(e){a.value=e,n(a)},function(e){return c("throw",e,n,r)})}r(o.arg)}var t;this._invoke=function(n,r){function e(){return new u(function(e,t){c(n,r,e,t)})}return t=t?t.then(e,e):e()}}function w(e,t){var n=e.iterator[t.method];if(undefined===n){if(t.delegate=null,"throw"===t.method){if(e.iterator["return"]&&(t.method="return",t.arg=undefined,w(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=undefined),t.delegate=null,c):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function k(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,r=function e(){for(;++n<t.length;){if(s.call(t,n))return e.value=t[n],e.done=!1,e}return e.value=undefined,e.done=!0,e};return r.next=r}}return{next:S}}function S(){return{value:undefined,done:!0}}return d.prototype=p,a(y,"constructor",p),a(p,"constructor",d),d.displayName=a(p,r,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,a(e,r,"GeneratorFunction")),e.prototype=Object.create(y),e},i.awrap=function(e){return{__await:e}},g(b.prototype),a(b.prototype,n,function(){return this}),i.AsyncIterator=b,i.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var a=new b(l(e,t,n,r),o);return i.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},g(y),a(y,r,"Generator"),a(y,o,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),i.keys=function(n){var r=[];for(var e in n){r.push(e)}return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},i.values=k,_.prototype={constructor:_,reset:function e(t){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!t)for(var n in this){"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)}},stop:function e(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function t(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=undefined),!!t}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var l=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return t(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return t(a.finallyLoc)}}}},abrupt:function e(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(i)},complete:function e(t,n){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&&n&&(this.next=n),c},finish:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),c}},catch:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var a=o.arg;x(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function e(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=undefined),c}},i}function Te(e,t){return Ne(e)||Pe(e,t)||Le(e,t)||Ce()}function Ce(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Le(e,t){if(!e)return;if(typeof e==="string")return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}function p(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++){r[n]=e[n]}return r}function Pe(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var o=true;var a=false;var i,l;try{for(n=n.call(e);!(o=(i=n.next()).done);o=true){r.push(i.value);if(t&&r.length===t)break}}catch(e){a=true;l=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw l}}return r}function Ne(e){if(Array.isArray(e))return e}function m(e,t,n,r,o,a,i){try{var l=e[a](i);var u=l.value}catch(e){n(e);return}if(l.done){t(u)}else{Promise.resolve(u).then(r,o)}}function Oe(l){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=l.apply(e,i);function o(e){m(r,t,n,o,a,"next",e)}function a(e){m(r,t,n,o,a,"throw",e)}o(undefined)})}}var v=wp.i18n,je=v.__,Ae=v._x,Ie=v._n,Me=v._nx;document.addEventListener("DOMContentLoaded",Oe(F().mark(function e(){var n,r,o,a,i,l,u,c,s,f,d;return F().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n=_tutorobject.current_page;console.log(n);if(!(n==="tutor_quiz_attempts")){t.next=14;break}r=new FormData;r.set("action","tutor_quiz_attempts_count");r.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);t.next=8;return h(r);case 8:o=t.sent;if(!o.ok){t.next=14;break}t.next=12;return o.json();case 12:a=t.sent;if(a.success&&a.data){console.log(a.data);i=document.querySelectorAll(".tutor-nav-item .tutor-ml-4");l=0;for(u=0,c=Object.entries(a.data);u<c.length;u++){s=Te(c[u],2),f=s[0],d=s[1];console.log(f+",,,"+d);i[l].innerHTML="(".concat(d,")");l++}}case 14:case"end":return t.stop()}}},e)})));function q(e){"@babel/helpers - typeof";return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(e)}function R(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */R=function e(){return i};var i={},e=Object.prototype,s=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function e(t,n,r){return t[n]=r}}function l(e,t,n,r){var o=t&&t.prototype instanceof u?t:u,a=Object.create(o.prototype),i=new _(r||[]);return a._invoke=function(a,i,l){var u="suspendedStart";return function(e,t){if("executing"===u)throw new Error("Generator is already running");if("completed"===u){if("throw"===e)throw t;return S()}for(l.method=e,l.arg=t;;){var n=l.delegate;if(n){var r=w(n,l);if(r){if(r===c)continue;return r}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===u)throw u="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);u="executing";var o=f(a,i,l);if("normal"===o.type){if(u=l.done?"completed":"suspendedYield",o.arg===c)continue;return{value:o.arg,done:l.done}}"throw"===o.type&&(u="completed",l.method="throw",l.arg=o.arg)}}}(e,n,i),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}i.wrap=l;var c={};function u(){}function d(){}function p(){}var m={};a(m,o,function(){return this});var h=Object.getPrototypeOf,v=h&&h(h(k([])));v&&v!==e&&s.call(v,o)&&(m=v);var y=p.prototype=u.prototype=Object.create(m);function g(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function b(l,u){function c(e,t,n,r){var o=f(l[e],l,t);if("throw"!==o.type){var a=o.arg,i=a.value;return i&&"object"==q(i)&&s.call(i,"__await")?u.resolve(i.__await).then(function(e){c("next",e,n,r)},function(e){c("throw",e,n,r)}):u.resolve(i).then(function(e){a.value=e,n(a)},function(e){return c("throw",e,n,r)})}r(o.arg)}var t;this._invoke=function(n,r){function e(){return new u(function(e,t){c(n,r,e,t)})}return t=t?t.then(e,e):e()}}function w(e,t){var n=e.iterator[t.method];if(undefined===n){if(t.delegate=null,"throw"===t.method){if(e.iterator["return"]&&(t.method="return",t.arg=undefined,w(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=undefined),t.delegate=null,c):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function k(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,r=function e(){for(;++n<t.length;){if(s.call(t,n))return e.value=t[n],e.done=!1,e}return e.value=undefined,e.done=!0,e};return r.next=r}}return{next:S}}function S(){return{value:undefined,done:!0}}return d.prototype=p,a(y,"constructor",p),a(p,"constructor",d),d.displayName=a(p,r,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,a(e,r,"GeneratorFunction")),e.prototype=Object.create(y),e},i.awrap=function(e){return{__await:e}},g(b.prototype),a(b.prototype,n,function(){return this}),i.AsyncIterator=b,i.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var a=new b(l(e,t,n,r),o);return i.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},g(y),a(y,r,"Generator"),a(y,o,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),i.keys=function(n){var r=[];for(var e in n){r.push(e)}return r.reverse(),function e(){for(;r.length;){var t=r.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},i.values=k,_.prototype={constructor:_,reset:function e(t){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(x),!t)for(var n in this){"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)}},stop:function e(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function t(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=undefined),!!t}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var l=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return t(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return t(a.finallyLoc)}}}},abrupt:function e(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,c):this.complete(i)},complete:function e(t,n){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&&n&&(this.next=n),c},finish:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),c}},catch:function e(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var a=o.arg;x(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function e(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=undefined),c}},i}function y(e,t,n,r,o,a,i){try{var l=e[a](i);var u=l.value}catch(e){n(e);return}if(l.done){t(u)}else{Promise.resolve(u).then(r,o)}}function ze(l){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=l.apply(e,i);function o(e){y(r,t,n,o,a,"next",e)}function a(e){y(r,t,n,o,a,"throw",e)}o(undefined)})}}var De=document.querySelectorAll(".tutor-form-toggle-input");De.forEach(function(n){n.addEventListener("change",function(e){var t=n.previousElementSibling;if(t){t.value=="on"?t.value="off":t.value="on"}})});jQuery(document).ready(function(p){"use strict";var m=wp.i18n.__;if(jQuery().wpColorPicker){p(".tutor_colorpicker").wpColorPicker()}if(jQuery().select2){p(".tutor_select2").select2()}if(_tutorobject.open_tutor_admin_menu){var e=p("#adminmenu");e.find('[href="admin.php?page=tutor"]').closest("li.wp-has-submenu").addClass("wp-has-current-submenu");e.find('[href="admin.php?page=tutor"]').closest("li.wp-has-submenu").find("a.wp-has-submenu").removeClass("wp-has-current-submenu").addClass("wp-has-current-submenu")}p(document).on("click",".tutor-option-media-upload-btn",function(e){e.preventDefault();var t=p(this);var n;if(n){n.open();return}n=wp.media({title:m("Select or Upload Media Of Your Choice","tutor"),button:{text:m("Upload media","tutor")},multiple:false});n.on("select",function(){var e=n.state().get("selection").first().toJSON();t.closest(".option-media-wrap").find(".option-media-preview").html('<img src="'+e.url+'" alt="" />');t.closest(".option-media-wrap").find("input").val(e.id);t.closest(".option-media-wrap").find(".tutor-media-option-trash-btn").show()});n.open()});p(document).on("click",".tutor-media-option-trash-btn",function(e){e.preventDefault();var t=p(this);t.closest(".option-media-wrap").find("img").remove();t.closest(".option-media-wrap").find("input").val("");t.closest(".option-media-wrap").find(".tutor-media-option-trash-btn").hide()});p(document).on("submit","#tutor-new-instructor-form",function(e){e.preventDefault();var t=p(this);var n=t.serializeObject();var r=p("#tutor-new-instructor-form [data-tutor-modal-submit]");var c=p("#tutor-new-instructor-form-response");n.action="tutor_add_instructor";p.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:n,beforeSend:function e(){r.attr("disabled","disable").addClass("is-loading");c.html("")},success:function e(t){if(!t.success){var n;if(t!==null&&t!==void 0&&(n=t.data)!==null&&n!==void 0&&n.errors.errors){for(var r=0,o=Object.values(t.data.errors.errors);r<o.length;r++){var a=o[r];c.append('\n\t\t\t\t\t\t\t\t<div class=\'tutor-col\'>\n\t\t\t\t\t\t\t\t\t<div class="tutor-alert tutor-warning">\n\t\t\t\t\t\t\t\t\t<div class="tutor-alert-text">\n\t\t\t\t\t\t\t\t\t\t<span class="tutor-alert-icon tutor-icon-circle-info tutor-mr-8"></span>\n\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t'.concat(a,"\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n \t\t\t\t"))}}else{for(var i=0,l=Object.values(t.data.errors);i<l.length;i++){var u=l[i];c.append('\n\t\t\t\t\t\t\t\t<div class=\'tutor-col\'>\n\t\t\t\t\t\t\t\t\t<div class="tutor-alert tutor-warning">\n\t\t\t\t\t\t\t\t\t<div class="tutor-alert-text">\n\t\t\t\t\t\t\t\t\t\t<span class="tutor-alert-icon tutor-icon-circle-info tutor-mr-8"></span>\n\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t'.concat(u,"\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t"))}}}else{p("#tutor-new-instructor-form").trigger("reset");tutor_toast(m("Success","tutor"),m("New Instructor Added","tutor"),"success");location.reload()}},complete:function e(){r.removeAttr("disabled").removeClass("is-loading")}})});p(document).on("click","a.instructor-action",function(){var t=ze(R().mark(function e(n){var r,o,a,i,l,u,c,s,f,d;return R().wrap(function e(t){while(1){switch(t.prev=t.next){case 0:n.preventDefault();r=p(this);o=r.attr("data-action");a=r.attr("data-instructor-id");i=n.target;l=i.innerHTML;i.innerHTML="";i.classList.add("is-loading");u=new FormData;u.set("action","instructor_approval_action");u.set("action_name",o);u.set("instructor_id",a);u.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);t.prev=13;t.next=16;return h(u);case 16:c=t.sent;t.next=19;return c.json();case 19:s=t.sent;if(i.classList.contains("is-loading")){i.classList.remove("is-loading");i.innerHTML=o.charAt(0).toUpperCase()+o.slice(1)}if(c.ok&&s.success){f="";if(o=="approve"){f="Instructor approved!"}if(o=="blocked"){f="Instructor blocked!"}d=document.querySelector(".tutor-modal-ins-approval");if(d){if(d.classList.contains("tutor-is-active")){d.classList.remove("tutor-is-active")}tutor_toast(m("Success","tutor"),m(f,"tutor"),"success");location.href="".concat(window._tutorobject.home_url,"/wp-admin/admin.php?page=tutor-instructors")}else{tutor_toast(m("Success","tutor"),m(f,"tutor"),"success");location.reload()}}else{tutor_toast(m("Failed","tutor"),m("Something went wrong!","tutor"),"error")}t.next=28;break;case 24:t.prev=24;t.t0=t["catch"](13);i.innerHTML=l;tutor_toast(m("Operation failed","tutor"),t.t0,"error");case 28:case"end":return t.stop()}}},e,this,[[13,24]])}));return function(e){return t.apply(this,arguments)}}());var t=document.querySelector(".tutor-modal-ins-approval .tutor-icon-56.tutor-icon-line-cross-line");if(t){t.addEventListener("click",function(){console.log("ckk");location.href="".concat(window._tutorobject.home_url,"/wp-admin/admin.php?page=tutor-instructors")})}p(document).on("click",".tutor-password-reveal",function(e){p(this).toggleClass("tutor-icon-eye-line tutor-icon-eye-bold");p(this).next().attr("type",function(e,t){return t=="password"?"text":"password"})});p(document).on("click",".tutor_video_poster_upload_btn",function(e){e.preventDefault();var t=p(this);var n;if(n){n.open();return}n=wp.media({title:m("Select or Upload Media Of Your Choice","tutor"),button:{text:m("Upload media","tutor")},multiple:false});n.on("select",function(){var e=n.state().get("selection").first().toJSON();t.closest(".tutor-video-poster-wrap").find(".video-poster-img").html('<img src="'+e.sizes.thumbnail.url+'" alt="" />');t.closest(".tutor-video-poster-wrap").find("input").val(e.id)});n.open()});p(document).on("change","#tutor_pmpro_membership_model_select",function(e){e.preventDefault();var t=p(this);if(t.val()==="category_wise_membership"){p(".membership_course_categories").show()}else{p(".membership_course_categories").hide()}});p(document).on("change","#tutor_pmpro_membership_model_select",function(e){e.preventDefault();var t=p(this);if(t.val()==="category_wise_membership"){p(".membership_course_categories").show()}else{p(".membership_course_categories").hide()}});p(document).on("submit",".pmpro_admin form",function(e){var t=p(this);if(!t.find('input[name="tutor_action"]').length){return}if(t.find('[name="tutor_pmpro_membership_model"]').val()=="category_wise_membership"&&!t.find(".membership_course_categories input:checked").length){if(!confirm(m("Do you want to save without any category?","tutor"))){e.preventDefault()}}});var n=p('#tutor-attach-product [name="tutor_course_price_type"]');if(n.length==0){p("#_tutor_is_course_public_meta_checkbox").show()}else{n.change(function(){if(p(this).prop("checked")){var e=p(this).val()=="paid"?"hide":"show";p("#_tutor_is_course_public_meta_checkbox")[e]()}}).trigger("change")}p(document).on("click",".instructor-layout-template",function(){p(".instructor-layout-template").removeClass("selected-template");p(this).addClass("selected-template")});p("#preview-action a.preview").click(function(e){var t=p(this).attr("href");if(t){e.preventDefault();window.open(t,"_blank")}});var r=p(".tutor-table .tutor-form-check-input");if(r){r.parent().addClass("tutor-option-field-row")}var o=document.querySelectorAll("td[id^='tutor-student-course-'] .tutor-form-check");o.forEach(function(e){if(e){if(e.classList.contains("tutor-option-field-row")){e.classList.remove("tutor-option-field-row")}}});var a=document.querySelectorAll("#adminmenu li > a");if(window._tutorobject.is_tutor_course_edit&&a){a.forEach(function(e){if(e.tagName==="A"&&e.hasAttribute("href")&&e.getAttribute("href")=="admin.php?page=tutor"){e.classList.add("current");e.closest("li").classList.add("current");var t=e.closest("li#toplevel_page_tutor");var n=e.closest("#toplevel_page_tutor li.wp-not-current-submenu.menu-top.toplevel_page_tutor > a");if(t){t.className="wp-has-submenu wp-has-current-submenu wp-menu-open menu-top toplevel_page_tutor current"}if(n){n.className="wp-has-submenu wp-has-current-submenu wp-menu-open menu-top toplevel_page_tutor current"}}})}})})()})();
classes/Assets.php CHANGED
@@ -8,21 +8,20 @@ if ( ! defined( 'ABSPATH' ) ) {
8
 
9
  class Assets {
10
 
11
- public function __construct()
12
- {
13
- /**
14
  * Common scripts loading
15
  */
16
- add_action('admin_enqueue_scripts', array($this, 'common_scripts'));
17
- add_action('wp_enqueue_scripts', array($this, 'common_scripts'));
18
  /**
19
  * Front and backend script enqueue
20
  */
21
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
22
  add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
23
 
24
- add_action('admin_enqueue_scripts', array($this, 'load_meta_data'));
25
- add_action('wp_enqueue_scripts', array($this, 'load_meta_data'));
26
 
27
  /**
28
  * Text domain loading
@@ -46,7 +45,7 @@ class Assets {
46
  *
47
  * @since 1.9.7
48
  */
49
- add_filter('mce_external_languages', array($this, 'tutor_tinymce_translate'));
50
 
51
  /**
52
  * Identifier class to body tag
@@ -64,24 +63,23 @@ class Assets {
64
  add_action( 'enqueue_block_editor_assets', __CLASS__ . '::add_frontend_editor_button' );
65
  }
66
 
67
- private function get_default_localized_data()
68
- {
69
- global $wp_version, $wp_query;
70
 
71
  $home_url = get_home_url();
72
- $parsed = parse_url($home_url);
73
 
74
- $base_path = (is_array($parsed) && isset($parsed['path'])) ? $parsed['path'] : '/';
75
- $base_path = rtrim($base_path, '/') . '/';
76
 
77
  $post_id = get_the_ID();
78
  $post_type = get_post_type( $post_id );
79
 
80
- $query_vars = $wp_query->query_vars;
81
  if ( is_admin() && isset( $_GET['page'] ) ) {
82
  $current_page = $_GET['page'];
83
  } else {
84
- $current_page = isset( $query_vars['tutor_dashboard_page'] ) ? $query_vars['tutor_dashboard_page'] : '';
85
  }
86
  return array(
87
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
@@ -100,38 +98,36 @@ class Assets {
100
  'is_admin' => is_admin(),
101
  'is_admin_bar_showing' => is_admin_bar_showing(),
102
  'addons_data' => tutor_utils()->prepare_free_addons_data(),
103
- 'current_user' => wp_get_current_user(),
104
  'content_change_event' => 'tutor_content_changed_event',
105
- 'is_tutor_course_edit' => isset( $_GET[ 'action'] ) && 'edit' === $_GET['action'] && tutor()->course_post_type === get_post_type( get_the_ID() ) ? true : false,
106
  'assignment_max_file_allowed' => 'tutor_assignments' === $post_type ? (int) tutor_utils()->get_assignment_option( $post_id, 'upload_files_limit' ) : 0,
107
- 'current_page' => $current_page,
108
  );
109
  }
110
 
111
- public function admin_scripts()
112
- {
113
- wp_enqueue_style('tutor-select2', tutor()->url . 'assets/packages/select2/select2.min.css', array(), TUTOR_VERSION);
114
- wp_enqueue_style('tutor-admin', tutor()->url . 'assets/css/tutor-admin.min.css', array(), TUTOR_VERSION);
115
  /**
116
  * Scripts
117
  */
118
  wp_enqueue_media();
119
 
120
- wp_enqueue_script('wp-color-picker');
121
- wp_enqueue_style('wp-color-picker');
122
 
123
  wp_enqueue_script( 'jquery-ui-slider' );
124
  wp_enqueue_script( 'jquery-ui-datepicker' );
125
 
126
- wp_enqueue_script('tutor-select2', tutor()->url . 'assets/packages/select2/select2.full.min.js', array('jquery'), TUTOR_VERSION, true);
127
- wp_enqueue_script('tutor-admin', tutor()->url . 'assets/js/tutor-admin.min.js', array('jquery', 'wp-color-picker', 'wp-i18n'), TUTOR_VERSION, true);
128
  }
129
 
130
  /**
131
  * Load frontend scripts
132
  */
133
- public function frontend_scripts()
134
- {
135
  global $post, $wp_query;
136
 
137
  /**
@@ -164,29 +160,29 @@ class Assets {
164
  * Enabling Sorting, draggable, droppable...
165
  */
166
  wp_enqueue_script( 'jquery-ui-sortable' );
167
- wp_enqueue_script( 'jquery-touch-punch', array('jquery-ui-sortable') );
168
-
169
  // Plyr
170
- if(is_single_course(true)) {
171
- wp_enqueue_style('tutor-plyr', tutor()->url . 'assets/packages/plyr/plyr.css', array(), TUTOR_VERSION);
172
- wp_enqueue_script('tutor-plyr', tutor()->url . 'assets/packages/plyr/plyr.polyfilled.min.js', array('jquery'), TUTOR_VERSION, true);
173
  }
174
-
175
  // Social Share
176
- wp_enqueue_script('tutor-social-share', tutor()->url . 'assets/packages/SocialShare/SocialShare.min.js', array('jquery'), TUTOR_VERSION, true);
177
 
178
  /**
179
  * Chart Data
180
  */
181
- if (!empty($wp_query->query_vars['tutor_dashboard_page'])) {
182
- wp_enqueue_script('jquery-ui-slider');
183
 
184
- wp_enqueue_style('tutor-select2', tutor()->url . 'assets/packages/select2/select2.min.css', array(), TUTOR_VERSION);
185
- wp_enqueue_script('tutor-select2', tutor()->url . 'assets/packages/select2/select2.full.min.js', array('jquery'), TUTOR_VERSION, true);
186
 
187
- if ($wp_query->query_vars['tutor_dashboard_page'] === 'earning') {
188
- wp_enqueue_script('tutor-front-chart-js', tutor()->url . 'assets/js/lib/Chart.bundle.min.js', array(), TUTOR_VERSION);
189
- wp_enqueue_script('jquery-ui-datepicker');
190
  }
191
  }
192
  /**
@@ -195,24 +191,23 @@ class Assets {
195
  *
196
  * @since 1.9.0
197
  */
198
- wp_enqueue_style('tutor-frontend', tutor()->url . 'assets/css/tutor-front.min.css', array(), TUTOR_VERSION);
199
- wp_enqueue_script('tutor-frontend', tutor()->url . 'assets/js/tutor-front.min.js', array('jquery', 'wp-i18n'), TUTOR_VERSION, true );
200
 
201
  /**
202
  * Load frontend dashboard style
203
  *
204
  * @since v1.9.8
205
  */
206
- if (tutor_utils()->is_tutor_frontend_dashboard()) {
207
- wp_enqueue_style('tutor-frontend-dashboard-css', tutor()->url . 'assets/css/tutor-frontend-dashboard.min.css', TUTOR_VERSION);
208
  }
209
 
210
  // Load date picker for announcement at frontend
211
  wp_enqueue_script( 'jquery-ui-datepicker' );
212
  }
213
 
214
- public function modify_localize_data($localize_data)
215
- {
216
  global $post;
217
 
218
  if ( is_admin() ) {
@@ -222,17 +217,17 @@ class Assets {
222
  } else {
223
 
224
  // Assign quiz option
225
- if (!empty($post->post_type) && $post->post_type === 'tutor_quiz') {
226
- $single_quiz_options = (array) tutor_utils()->get_quiz_option($post->ID);
227
  $saved_quiz_options = array(
228
- 'quiz_when_time_expires' => tutor_utils()->get_option('quiz_when_time_expires'),
229
  );
230
 
231
- $quiz_options = array_merge($single_quiz_options, $saved_quiz_options);
232
 
233
  $previous_attempts = tutor_utils()->quiz_attempts();
234
 
235
- if ($previous_attempts && count($previous_attempts)) {
236
  $quiz_options['quiz_auto_start'] = 0;
237
  }
238
 
@@ -254,160 +249,173 @@ class Assets {
254
  return $localize_data;
255
  }
256
 
 
 
 
 
 
257
  public function common_scripts() {
258
 
259
- // Fonts
260
- wp_enqueue_style('tutor-icon', tutor()->url . 'assets/css/tutor-icon.min.css', array(), TUTOR_VERSION);
 
 
 
 
 
 
261
 
262
- // Common css library
 
 
 
 
 
 
 
263
  if ( is_rtl() ) {
264
- wp_enqueue_style('tutor', tutor()->url . 'assets/css/tutor.rtl.min.css', array(), TUTOR_VERSION);
265
  } else {
266
- wp_enqueue_style('tutor', tutor()->url . 'assets/css/tutor.min.css', array(), TUTOR_VERSION);
267
  }
268
 
269
  // Load course builder resources
270
- if (tutor_utils()->get_course_builder_screen()) {
271
- wp_enqueue_script('tutor-course-builder', tutor()->url . 'assets/js/tutor-course-builder.min.js', array('jquery', 'wp-i18n'), TUTOR_VERSION, true);
272
- wp_enqueue_style('tutor-course-builder-css', tutor()->url . 'assets/css/tutor-course-builder.min.css', array(), TUTOR_VERSION);
273
  }
274
  /**
275
  * Load tutor common scripts both backend and frontend
276
  *
277
  * @since v2.0.0
278
  */
279
- wp_enqueue_script('tutor-script', tutor()->url . 'assets/js/tutor.min.js', array('jquery', 'wp-i18n'), TUTOR_VERSION, true);
280
  }
281
 
282
- public function load_meta_data()
283
- {
284
  // Localize scripts
285
- $localize_data = apply_filters('tutor_localize_data', $this->get_default_localized_data());
286
- wp_localize_script('tutor-frontend', '_tutorobject', $localize_data);
287
- wp_localize_script('tutor-admin', '_tutorobject', $localize_data);
288
- wp_localize_script('tutor-course-builder', '_tutorobject', $localize_data);
289
- wp_localize_script('tutor-script', '_tutorobject', $localize_data);
290
 
291
  // Inline styles
292
- wp_add_inline_style('tutor-frontend', $this->load_color_palette());
293
- wp_add_inline_style('tutor-admin', $this->load_color_palette());
294
  }
295
 
296
- private function load_color_palette()
297
- {
298
- $colors = array(
299
- 'tutor_primary_color' => '--tutor-color-primary',
300
- 'tutor_primary_hover_color' => '--tutor-color-primary-hover',
301
- 'tutor_text_color' => '--tutor-body-color',
302
- 'tutor_border_color' => '--tutor-border-color',
303
- 'tutor_gray_color' => '--tutor-color-gray',
304
- );
305
-
306
- // admin colors
307
- $admin_colors = [];
308
- if (is_admin()) {
309
- $admin_color = get_user_option( 'admin_color' );
310
-
311
- switch ($admin_color) {
312
- case 'light':
313
- $admin_color_codes = ['#04a4cc', '#04b0db'];
314
- break;
315
-
316
- case 'modern':
317
- $admin_color_codes = ['#3858e9', '#4664eb'];
318
- break;
319
-
320
- case 'blue':
321
- $admin_color_codes = ['#e1a948', '#e3af55'];
322
- break;
323
-
324
- case 'coffee':
325
- $admin_color_codes = ['#c7a589', '#ccad93'];
326
- break;
327
-
328
- case 'ectoplasm':
329
- $admin_color_codes = ['#a3b745', '#a9bd4f'];
330
- break;
331
-
332
- case 'midnight':
333
- $admin_color_codes = ['#e14d43', '#e35950'];
334
- break;
335
-
336
- case 'ocean':
337
- $admin_color_codes = ['#9ebaa0', '#a7c0a9'];
338
- break;
339
-
340
- case 'sunrise':
341
- $admin_color_codes = ['#dd823b', '#df8a48'];
342
- break;
343
-
344
- default:
345
- $admin_color_codes = ['#007cba', '#006ba1'];
346
- break;
347
- }
348
-
349
- $admin_colors = [
350
- '--tutor-color-primary' => $admin_color_codes[0],
351
- '--tutor-color-primary-hover' => $admin_color_codes[1],
352
- ];
353
- }
354
-
355
- $fallback_colors = [
356
- 'tutor_primary_color' => '#3E64DE',
357
- 'tutor_primary_hover_color' => '#395BCA',
358
- 'tutor_text_color' => '#212327',
359
- 'tutor_border_color' => '#E3E5EB',
360
- 'tutor_gray_color' => '#CDCFD5'
361
- ];
362
-
363
- $color_string = '';
364
- foreach ($colors as $key => $property) {
365
- $fallback_color = isset( $fallback_colors[$key] ) ? $fallback_colors[$key] : '#212327';
366
- $color = tutor_utils()->get_option( $key, $fallback_color );
367
- $color_rgb = tutor_utils()->hex2rgb( $color );
368
-
369
- if (is_admin() && isset($admin_colors[$property])) {
370
- $color = $admin_colors[$property];
371
- $color_rgb = tutor_utils()->hex2rgb( $admin_colors[$property] );
372
- }
373
-
374
- if ($color) {
375
- $color_string .= $property . ':' . $color . ';';
376
- }
377
-
378
- if ($color_rgb) {
379
- $color_string .= $property . '-rgb:' . $color_rgb . ';';
380
- }
381
- }
382
-
383
- return ':root{' . $color_string . '}';
384
  }
385
 
386
  /**
387
  * Add Tinymce button for placing shortcode
388
  */
389
- function tutor_add_mce_button()
390
- {
391
  // check user permissions
392
- if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) {
393
  return;
394
  }
395
  // check if WYSIWYG is enabled
396
- if ('true' == get_user_option('rich_editing')) {
397
- add_filter('mce_external_plugins', array($this, 'tutor_add_tinymce_js'));
398
- add_filter('mce_buttons', array($this, 'tutor_register_mce_button'));
399
  }
400
  }
401
  // Declare script for new button
402
- function tutor_add_tinymce_js($plugin_array)
403
- {
404
  $plugin_array['tutor_button'] = tutor()->url . 'assets/js/lib/mce-button.js';
405
  return $plugin_array;
406
  }
407
  // Register new button in the editor
408
- function tutor_register_mce_button($buttons)
409
- {
410
- array_push($buttons, 'tutor_button');
411
  return $buttons;
412
  }
413
 
@@ -418,9 +426,8 @@ class Assets {
418
  * @param string $type Type.
419
  * @return string
420
  */
421
- function tutor_generator_tag($gen, $type)
422
- {
423
- switch ($type) {
424
  case 'html':
425
  $gen .= "\n" . '<meta name="generator" content="TutorLMS ' . TUTOR_VERSION . '">';
426
  break;
@@ -453,46 +460,45 @@ class Assets {
453
  return $locales;
454
  }
455
 
456
- public function add_identifier_class_to_body($classes)
457
- {
458
  $course_builder_screen = tutor_utils()->get_course_builder_screen();
459
- $to_add = array('tutor-lms');
460
 
461
  // Add backend course editor identifier class to body
462
- if ($course_builder_screen) {
463
  $to_add[] = is_admin() ? 'tutor-backend' : '';
464
  $to_add[] = ' tutor-screen-course-builder tutor-screen-course-builder-' . $course_builder_screen . ' ';
465
  }
466
 
467
  // Add frontend course builder identifier class
468
- if (!$course_builder_screen && tutor_utils()->is_tutor_frontend_dashboard()) {
469
  $to_add[] = 'tutor-screen-frontend-dashboard';
470
  }
471
 
472
- if (is_admin()) {
473
- $screen = function_exists('get_current_screen') ? get_current_screen() : null;
474
- $base = ($screen && is_object($screen) && property_exists($screen, 'base')) ? $screen->base : '';
475
- $index = strpos($base, 'tutor');
476
 
477
- if($index===0 || $index>0) {
478
  $to_add[] = 'tutor-backend';
479
 
480
- if (isset($_GET['page']) && $_GET['page'] == 'tutor_settings') {
481
  $to_add[] = 'tutor-screen-backend-settings ';
482
  }
483
- if (isset($_GET['page'])) {
484
  $to_add[] = 'tutor-backend-' . $_GET['page'];
485
  }
486
  }
487
  }
488
 
489
  // Remove duplicate classes if any
490
- $to_add = array_unique($to_add);
491
 
492
- if(is_array($classes)) {
493
- $classes = array_merge($classes, $to_add);
494
  } else {
495
- $classes .= implode(' ', $to_add);
496
  }
497
 
498
  return $classes;
@@ -514,7 +520,7 @@ class Assets {
514
  $data = array(
515
  'frontend_dashboard_url' => esc_url( trailingslashit( tutor_utils()->tutor_dashboard_url( 'create-course' ) ) ) . '?course_ID=' . get_the_ID(),
516
  );
517
-
518
  wp_add_inline_script(
519
  'tutor-gutenberg',
520
  'const tutorInlineData =' . json_encode( $data ),
8
 
9
  class Assets {
10
 
11
+ public function __construct() {
12
+ /**
 
13
  * Common scripts loading
14
  */
15
+ add_action( 'admin_enqueue_scripts', array( $this, 'common_scripts' ) );
16
+ add_action( 'wp_enqueue_scripts', array( $this, 'common_scripts' ) );
17
  /**
18
  * Front and backend script enqueue
19
  */
20
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
21
  add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
22
 
23
+ add_action( 'admin_enqueue_scripts', array( $this, 'load_meta_data' ) );
24
+ add_action( 'wp_enqueue_scripts', array( $this, 'load_meta_data' ) );
25
 
26
  /**
27
  * Text domain loading
45
  *
46
  * @since 1.9.7
47
  */
48
+ add_filter( 'mce_external_languages', array( $this, 'tutor_tinymce_translate' ) );
49
 
50
  /**
51
  * Identifier class to body tag
63
  add_action( 'enqueue_block_editor_assets', __CLASS__ . '::add_frontend_editor_button' );
64
  }
65
 
66
+ private function get_default_localized_data() {
67
+ global $wp_version, $wp_query;
 
68
 
69
  $home_url = get_home_url();
70
+ $parsed = parse_url( $home_url );
71
 
72
+ $base_path = ( is_array( $parsed ) && isset( $parsed['path'] ) ) ? $parsed['path'] : '/';
73
+ $base_path = rtrim( $base_path, '/' ) . '/';
74
 
75
  $post_id = get_the_ID();
76
  $post_type = get_post_type( $post_id );
77
 
78
+ $query_vars = $wp_query->query_vars;
79
  if ( is_admin() && isset( $_GET['page'] ) ) {
80
  $current_page = $_GET['page'];
81
  } else {
82
+ $current_page = isset( $query_vars['tutor_dashboard_page'] ) ? $query_vars['tutor_dashboard_page'] : '';
83
  }
84
  return array(
85
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
98
  'is_admin' => is_admin(),
99
  'is_admin_bar_showing' => is_admin_bar_showing(),
100
  'addons_data' => tutor_utils()->prepare_free_addons_data(),
101
+ 'current_user' => wp_get_current_user(),
102
  'content_change_event' => 'tutor_content_changed_event',
103
+ 'is_tutor_course_edit' => isset( $_GET['action'] ) && 'edit' === $_GET['action'] && tutor()->course_post_type === get_post_type( get_the_ID() ) ? true : false,
104
  'assignment_max_file_allowed' => 'tutor_assignments' === $post_type ? (int) tutor_utils()->get_assignment_option( $post_id, 'upload_files_limit' ) : 0,
105
+ 'current_page' => $current_page,
106
  );
107
  }
108
 
109
+ public function admin_scripts() {
110
+ wp_enqueue_style( 'tutor-select2', tutor()->url . 'assets/packages/select2/select2.min.css', array(), TUTOR_VERSION );
111
+ wp_enqueue_style( 'tutor-admin', tutor()->url . 'assets/css/tutor-admin.min.css', array(), TUTOR_VERSION );
 
112
  /**
113
  * Scripts
114
  */
115
  wp_enqueue_media();
116
 
117
+ wp_enqueue_script( 'wp-color-picker' );
118
+ wp_enqueue_style( 'wp-color-picker' );
119
 
120
  wp_enqueue_script( 'jquery-ui-slider' );
121
  wp_enqueue_script( 'jquery-ui-datepicker' );
122
 
123
+ wp_enqueue_script( 'tutor-select2', tutor()->url . 'assets/packages/select2/select2.full.min.js', array( 'jquery' ), TUTOR_VERSION, true );
124
+ wp_enqueue_script( 'tutor-admin', tutor()->url . 'assets/js/tutor-admin.min.js', array( 'jquery', 'wp-color-picker', 'wp-i18n' ), TUTOR_VERSION, true );
125
  }
126
 
127
  /**
128
  * Load frontend scripts
129
  */
130
+ public function frontend_scripts() {
 
131
  global $post, $wp_query;
132
 
133
  /**
160
  * Enabling Sorting, draggable, droppable...
161
  */
162
  wp_enqueue_script( 'jquery-ui-sortable' );
163
+ wp_enqueue_script( 'jquery-touch-punch', array( 'jquery-ui-sortable' ) );
164
+
165
  // Plyr
166
+ if ( is_single_course( true ) ) {
167
+ wp_enqueue_style( 'tutor-plyr', tutor()->url . 'assets/packages/plyr/plyr.css', array(), TUTOR_VERSION );
168
+ wp_enqueue_script( 'tutor-plyr', tutor()->url . 'assets/packages/plyr/plyr.polyfilled.min.js', array( 'jquery' ), TUTOR_VERSION, true );
169
  }
170
+
171
  // Social Share
172
+ wp_enqueue_script( 'tutor-social-share', tutor()->url . 'assets/packages/SocialShare/SocialShare.min.js', array( 'jquery' ), TUTOR_VERSION, true );
173
 
174
  /**
175
  * Chart Data
176
  */
177
+ if ( ! empty( $wp_query->query_vars['tutor_dashboard_page'] ) ) {
178
+ wp_enqueue_script( 'jquery-ui-slider' );
179
 
180
+ wp_enqueue_style( 'tutor-select2', tutor()->url . 'assets/packages/select2/select2.min.css', array(), TUTOR_VERSION );
181
+ wp_enqueue_script( 'tutor-select2', tutor()->url . 'assets/packages/select2/select2.full.min.js', array( 'jquery' ), TUTOR_VERSION, true );
182
 
183
+ if ( $wp_query->query_vars['tutor_dashboard_page'] === 'earning' ) {
184
+ wp_enqueue_script( 'tutor-front-chart-js', tutor()->url . 'assets/js/lib/Chart.bundle.min.js', array(), TUTOR_VERSION );
185
+ wp_enqueue_script( 'jquery-ui-datepicker' );
186
  }
187
  }
188
  /**
191
  *
192
  * @since 1.9.0
193
  */
194
+ wp_enqueue_style( 'tutor-frontend', tutor()->url . 'assets/css/tutor-front.min.css', array(), TUTOR_VERSION );
195
+ wp_enqueue_script( 'tutor-frontend', tutor()->url . 'assets/js/tutor-front.min.js', array( 'jquery', 'wp-i18n' ), TUTOR_VERSION, true );
196
 
197
  /**
198
  * Load frontend dashboard style
199
  *
200
  * @since v1.9.8
201
  */
202
+ if ( tutor_utils()->is_tutor_frontend_dashboard() ) {
203
+ wp_enqueue_style( 'tutor-frontend-dashboard-css', tutor()->url . 'assets/css/tutor-frontend-dashboard.min.css', TUTOR_VERSION );
204
  }
205
 
206
  // Load date picker for announcement at frontend
207
  wp_enqueue_script( 'jquery-ui-datepicker' );
208
  }
209
 
210
+ public function modify_localize_data( $localize_data ) {
 
211
  global $post;
212
 
213
  if ( is_admin() ) {
217
  } else {
218
 
219
  // Assign quiz option
220
+ if ( ! empty( $post->post_type ) && $post->post_type === 'tutor_quiz' ) {
221
+ $single_quiz_options = (array) tutor_utils()->get_quiz_option( $post->ID );
222
  $saved_quiz_options = array(
223
+ 'quiz_when_time_expires' => tutor_utils()->get_option( 'quiz_when_time_expires' ),
224
  );
225
 
226
+ $quiz_options = array_merge( $single_quiz_options, $saved_quiz_options );
227
 
228
  $previous_attempts = tutor_utils()->quiz_attempts();
229
 
230
+ if ( $previous_attempts && count( $previous_attempts ) ) {
231
  $quiz_options['quiz_auto_start'] = 0;
232
  }
233
 
249
  return $localize_data;
250
  }
251
 
252
+ /**
253
+ * Load common scripts
254
+ *
255
+ * @return void
256
+ */
257
  public function common_scripts() {
258
 
259
+ /**
260
+ * Load TinyMCE for tutor settings page if
261
+ * tutor pro is not available.
262
+ *
263
+ * @since v2.0.8
264
+ */
265
+ $baseurl = includes_url( 'js/tinymce' );
266
+ $current_page = Input::get( 'page' );
267
 
268
+ // If it is settings page & tutor pro not activated.
269
+ if ( 'tutor_settings' === $current_page && ! wp_script_is( 'wp-tinymce-root' ) ) {
270
+ wp_enqueue_script( 'tutor-tiny', $baseurl . '/tinymce.min.js', array( 'jquery' ), TUTOR_VERSION, true );
271
+ }
272
+
273
+ wp_enqueue_style( 'tutor-icon', tutor()->url . 'assets/css/tutor-icon.min.css', array(), TUTOR_VERSION );
274
+
275
+ // Common css library.
276
  if ( is_rtl() ) {
277
+ wp_enqueue_style( 'tutor', tutor()->url . 'assets/css/tutor.rtl.min.css', array(), TUTOR_VERSION );
278
  } else {
279
+ wp_enqueue_style( 'tutor', tutor()->url . 'assets/css/tutor.min.css', array(), TUTOR_VERSION );
280
  }
281
 
282
  // Load course builder resources
283
+ if ( tutor_utils()->get_course_builder_screen() ) {
284
+ wp_enqueue_script( 'tutor-course-builder', tutor()->url . 'assets/js/tutor-course-builder.min.js', array( 'jquery', 'wp-i18n' ), TUTOR_VERSION, true );
285
+ wp_enqueue_style( 'tutor-course-builder-css', tutor()->url . 'assets/css/tutor-course-builder.min.css', array(), TUTOR_VERSION );
286
  }
287
  /**
288
  * Load tutor common scripts both backend and frontend
289
  *
290
  * @since v2.0.0
291
  */
292
+ wp_enqueue_script( 'tutor-script', tutor()->url . 'assets/js/tutor.min.js', array( 'jquery', 'wp-i18n' ), TUTOR_VERSION, true );
293
  }
294
 
295
+ public function load_meta_data() {
 
296
  // Localize scripts
297
+ $localize_data = apply_filters( 'tutor_localize_data', $this->get_default_localized_data() );
298
+ wp_localize_script( 'tutor-frontend', '_tutorobject', $localize_data );
299
+ wp_localize_script( 'tutor-admin', '_tutorobject', $localize_data );
300
+ wp_localize_script( 'tutor-course-builder', '_tutorobject', $localize_data );
301
+ wp_localize_script( 'tutor-script', '_tutorobject', $localize_data );
302
 
303
  // Inline styles
304
+ wp_add_inline_style( 'tutor-frontend', $this->load_color_palette() );
305
+ wp_add_inline_style( 'tutor-admin', $this->load_color_palette() );
306
  }
307
 
308
+ private function load_color_palette() {
309
+ $colors = array(
310
+ 'tutor_primary_color' => '--tutor-color-primary',
311
+ 'tutor_primary_hover_color' => '--tutor-color-primary-hover',
312
+ 'tutor_text_color' => '--tutor-body-color',
313
+ 'tutor_border_color' => '--tutor-border-color',
314
+ 'tutor_gray_color' => '--tutor-color-gray',
315
+ );
316
+
317
+ // admin colors
318
+ $admin_colors = array();
319
+ if ( is_admin() ) {
320
+ $admin_color = get_user_option( 'admin_color' );
321
+
322
+ switch ( $admin_color ) {
323
+ case 'light':
324
+ $admin_color_codes = array( '#04a4cc', '#04b0db' );
325
+ break;
326
+
327
+ case 'modern':
328
+ $admin_color_codes = array( '#3858e9', '#4664eb' );
329
+ break;
330
+
331
+ case 'blue':
332
+ $admin_color_codes = array( '#e1a948', '#e3af55' );
333
+ break;
334
+
335
+ case 'coffee':
336
+ $admin_color_codes = array( '#c7a589', '#ccad93' );
337
+ break;
338
+
339
+ case 'ectoplasm':
340
+ $admin_color_codes = array( '#a3b745', '#a9bd4f' );
341
+ break;
342
+
343
+ case 'midnight':
344
+ $admin_color_codes = array( '#e14d43', '#e35950' );
345
+ break;
346
+
347
+ case 'ocean':
348
+ $admin_color_codes = array( '#9ebaa0', '#a7c0a9' );
349
+ break;
350
+
351
+ case 'sunrise':
352
+ $admin_color_codes = array( '#dd823b', '#df8a48' );
353
+ break;
354
+
355
+ default:
356
+ $admin_color_codes = array( '#007cba', '#006ba1' );
357
+ break;
358
+ }
359
+
360
+ $admin_colors = array(
361
+ '--tutor-color-primary' => $admin_color_codes[0],
362
+ '--tutor-color-primary-hover' => $admin_color_codes[1],
363
+ );
364
+ }
365
+
366
+ $fallback_colors = array(
367
+ 'tutor_primary_color' => '#3E64DE',
368
+ 'tutor_primary_hover_color' => '#395BCA',
369
+ 'tutor_text_color' => '#212327',
370
+ 'tutor_border_color' => '#E3E5EB',
371
+ 'tutor_gray_color' => '#CDCFD5',
372
+ );
373
+
374
+ $color_string = '';
375
+ foreach ( $colors as $key => $property ) {
376
+ $fallback_color = isset( $fallback_colors[ $key ] ) ? $fallback_colors[ $key ] : '#212327';
377
+ $color = tutor_utils()->get_option( $key, $fallback_color );
378
+ $color_rgb = tutor_utils()->hex2rgb( $color );
379
+
380
+ if ( is_admin() && isset( $admin_colors[ $property ] ) ) {
381
+ $color = $admin_colors[ $property ];
382
+ $color_rgb = tutor_utils()->hex2rgb( $admin_colors[ $property ] );
383
+ }
384
+
385
+ if ( $color ) {
386
+ $color_string .= $property . ':' . $color . ';';
387
+ }
388
+
389
+ if ( $color_rgb ) {
390
+ $color_string .= $property . '-rgb:' . $color_rgb . ';';
391
+ }
392
+ }
393
+
394
+ return ':root{' . $color_string . '}';
 
395
  }
396
 
397
  /**
398
  * Add Tinymce button for placing shortcode
399
  */
400
+ function tutor_add_mce_button() {
 
401
  // check user permissions
402
+ if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {
403
  return;
404
  }
405
  // check if WYSIWYG is enabled
406
+ if ( 'true' == get_user_option( 'rich_editing' ) ) {
407
+ add_filter( 'mce_external_plugins', array( $this, 'tutor_add_tinymce_js' ) );
408
+ add_filter( 'mce_buttons', array( $this, 'tutor_register_mce_button' ) );
409
  }
410
  }
411
  // Declare script for new button
412
+ function tutor_add_tinymce_js( $plugin_array ) {
 
413
  $plugin_array['tutor_button'] = tutor()->url . 'assets/js/lib/mce-button.js';
414
  return $plugin_array;
415
  }
416
  // Register new button in the editor
417
+ function tutor_register_mce_button( $buttons ) {
418
+ array_push( $buttons, 'tutor_button' );
 
419
  return $buttons;
420
  }
421
 
426
  * @param string $type Type.
427
  * @return string
428
  */
429
+ function tutor_generator_tag( $gen, $type ) {
430
+ switch ( $type ) {
 
431
  case 'html':
432
  $gen .= "\n" . '<meta name="generator" content="TutorLMS ' . TUTOR_VERSION . '">';
433
  break;
460
  return $locales;
461
  }
462
 
463
+ public function add_identifier_class_to_body( $classes ) {
 
464
  $course_builder_screen = tutor_utils()->get_course_builder_screen();
465
+ $to_add = array( 'tutor-lms' );
466
 
467
  // Add backend course editor identifier class to body
468
+ if ( $course_builder_screen ) {
469
  $to_add[] = is_admin() ? 'tutor-backend' : '';
470
  $to_add[] = ' tutor-screen-course-builder tutor-screen-course-builder-' . $course_builder_screen . ' ';
471
  }
472
 
473
  // Add frontend course builder identifier class
474
+ if ( ! $course_builder_screen && tutor_utils()->is_tutor_frontend_dashboard() ) {
475
  $to_add[] = 'tutor-screen-frontend-dashboard';
476
  }
477
 
478
+ if ( is_admin() ) {
479
+ $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
480
+ $base = ( $screen && is_object( $screen ) && property_exists( $screen, 'base' ) ) ? $screen->base : '';
481
+ $index = strpos( $base, 'tutor' );
482
 
483
+ if ( $index === 0 || $index > 0 ) {
484
  $to_add[] = 'tutor-backend';
485
 
486
+ if ( isset( $_GET['page'] ) && $_GET['page'] == 'tutor_settings' ) {
487
  $to_add[] = 'tutor-screen-backend-settings ';
488
  }
489
+ if ( isset( $_GET['page'] ) ) {
490
  $to_add[] = 'tutor-backend-' . $_GET['page'];
491
  }
492
  }
493
  }
494
 
495
  // Remove duplicate classes if any
496
+ $to_add = array_unique( $to_add );
497
 
498
+ if ( is_array( $classes ) ) {
499
+ $classes = array_merge( $classes, $to_add );
500
  } else {
501
+ $classes .= implode( ' ', $to_add );
502
  }
503
 
504
  return $classes;
520
  $data = array(
521
  'frontend_dashboard_url' => esc_url( trailingslashit( tutor_utils()->tutor_dashboard_url( 'create-course' ) ) ) . '?course_ID=' . get_the_ID(),
522
  );
523
+
524
  wp_add_inline_script(
525
  'tutor-gutenberg',
526
  'const tutorInlineData =' . json_encode( $data ),
languages/tutor.pot CHANGED
@@ -6,7 +6,7 @@ msgstr ""
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
9
- "POT-Creation-Date: 2022-07-21 10:28+0000\n"
10
  "X-Poedit-Basepath: ..\n"
11
  "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
12
  "X-Poedit-SearchPath-0: .\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
9
+ "POT-Creation-Date: 2022-07-25 07:23+0000\n"
10
  "X-Poedit-Basepath: ..\n"
11
  "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
12
  "X-Poedit-SearchPath-0: .\n"
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: lms, course, elearning, education, learning management system
5
  Requires at least: 5.3
6
  Tested up to: 6.0.1
7
  Requires PHP: 7.0
8
- Stable tag: 2.0.7
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -225,6 +225,12 @@ Looking for the best LMS for WordPress? Get Tutor and start your e-learning webs
225
 
226
  == Changelog ==
227
 
 
 
 
 
 
 
228
  = 2.0.7 - July 21, 2022
229
 
230
  New: Admin will be able to change the Main Instructor for a Course
5
  Requires at least: 5.3
6
  Tested up to: 6.0.1
7
  Requires PHP: 7.0
8
+ Stable tag: 2.0.8
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
225
 
226
  == Changelog ==
227
 
228
+ = 2.0.8 - July 25, 2022
229
+
230
+ Fix: Settings was not being saved in some specific cases
231
+ Fix: Settings was throwing a console error regarding TinyMCE
232
+ Fix: Settings was being saved in other cases, but the "Save" button was not being marked as saved
233
+
234
  = 2.0.7 - July 21, 2022
235
 
236
  New: Admin will be able to change the Main Instructor for a Course
tutor.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://www.themeum.com/product/tutor-lms/
5
  * Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create small to large scale online education site very conveniently. Power features like report, certificate, course preview, private file sharing make Tutor a robust plugin for any educational institutes.
6
  * Author: Themeum
7
- * Version: 2.0.7
8
  * Author URI: https://themeum.com
9
  * Requires at least: 5.3
10
  * Tested up to: 6.0.1
@@ -21,7 +21,7 @@ require_once "vendor/autoload.php";
21
  /**
22
  * Defined the tutor main file
23
  */
24
- define( 'TUTOR_VERSION', '2.0.7' );
25
  define( 'TUTOR_FILE', __FILE__ );
26
 
27
  /**
4
  * Plugin URI: https://www.themeum.com/product/tutor-lms/
5
  * Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create small to large scale online education site very conveniently. Power features like report, certificate, course preview, private file sharing make Tutor a robust plugin for any educational institutes.
6
  * Author: Themeum
7
+ * Version: 2.0.8
8
  * Author URI: https://themeum.com
9
  * Requires at least: 5.3
10
  * Tested up to: 6.0.1
21
  /**
22
  * Defined the tutor main file
23
  */
24
+ define( 'TUTOR_VERSION', '2.0.8' );
25
  define( 'TUTOR_FILE', __FILE__ );
26
 
27
  /**