!function(t){var e={};function n(s){if(e[s])return e[s].exports;var r=e[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,s){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(s,r,function(e){return t[e]}.bind(null,r));return s},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e){const{createElement:n,render:s,useState:r,useEffect:a,Fragment:o}=wp.element,{select:l,dispatch:i}=wp.data,u=t=>{const[e,s]=r(!0),[u,d]=r({}),[c,p]=r(0);a(()=>{fetch(`${window.instructorsimplestats.api}/instructor_simple_stats?type=${t.type}`,{method:"post",body:JSON.stringify({type:t.type,token:l("vibebp").getToken(),user_id:window.instructorsimplestats.user_id})}).then(t=>t.ok?t.json():{status:0,message:window.wplms_course_data.translations.error_loading_data}).then(e=>{e.status&&d(e.data),s(!1),document.dispatchEvent(new CustomEvent("vibebp_widget_loaded",{detail:{props:t}}))}).catch(t=>{s(!1),console.error("Uh oh, an error!",t),i("vibebp").addNotification({text:window.wplms_course_data.translations.error_loading_data})})},[]);return n("div",{className:"instructor_simple_stat"},e?n("div",{class:"widget_loader"},n("div",null),n("div",null),n("div",null),n("div",null)):n(o,null,u.hasOwnProperty("value")&&Array.isArray(u.value)&&"woo_commission"==t.type?n(o,null,n("div",{class:"dash-stats woo_commission"},n("div",{className:"tabs"},u.value.map((t,e)=>n("div",{dangerouslySetInnerHTML:{__html:t.symbol},onClick:()=>{p(e)}}))),n("div",{className:"tab_value"},(()=>{if(console.log(c),u.value.length&&u.value[c])return n("h3",{dangerouslySetInnerHTML:{__html:u.value[c].symbol+" "+u.value[c].value}})})()),n("span",null,u.label))):n(o,null,n("div",{class:"dash-stats"},n("h3",{dangerouslySetInnerHTML:{__html:u.value}}),n("span",null,u.label)))))};document.addEventListener("wplms_instructor_dash_stats",t=>{document.querySelector('.instructor_simple_stats[data-type="'+t.detail.widget.options.stats+'"]')&&s(n(u,{type:t.detail.widget.options.stats}),document.querySelector('.instructor_simple_stats[data-type="'+t.detail.widget.options.stats+'"]'))})}]);