PageSourceSearch

https://www.u-skill.com/wp-content/plugins/tutor/assets/js/tutor-dashboard.js?ver=4.1.0

js u-skill.com collected 2026-10-02 22:26:42 UTC 95,081 bytes, 198 lines download raw bytes

1(()=>{"use strict";var e={};// The module cache
2var t={};// The require function
3function r(n){// Check if module is in cache
4var i=t[n];if(i!==undefined){return i.exports}// Create a new module (and put it into the cache)
5var o=t[n]={exports:{}};// Execute the module function
6e[n](o,o.exports,r);// Return the exports of the module
7return o.exports}// expose the modules object (__webpack_modules__)
8r.m=e;// webpack/runtime/define_property_getters
9(()=>{r.d=(e,t)=>{for(var n in t){if(r.o(t,n)&&!r.o(e,n)){Object.defineProperty(e,n,{enumerable:true,get:t[n]})}}}})();// webpack/runtime/ensure_chunk
10(()=>{r.f={};// This file contains only the entry chunk.
11// The chunk loading function for additional chunks
12r.e=e=>{return Promise.all(Object.keys(r.f).reduce((t,n)=>{r.f[n](e,t);return t},[]))}})();// webpack/runtime/get javascript chunk filename
13(()=>{// This function allow to reference chunks
14r.u=e=>{// return url for filenames not based on template
15if(e==="587")return"js/lazy-chunks/tutor-chart-js.js?ver=4.1.0";if(e==="4")return"js/lazy-chunks/tutor-dnd-kit.js?ver=4.1.0";// return url for filenames based on template
16return""+e+".javascript"}})();// webpack/runtime/get mini-css chunk filename
17(()=>{// This function allow to reference chunks
18r.miniCssF=e=>{// return url for filenames not based on template
19// return url for filenames based on template
20return""+e+".css"}})();// webpack/runtime/get_full_hash
21(()=>{r.h=()=>"14f17abcb8dbd6be"})();// webpack/runtime/global
22(()=>{r.g=(()=>{if(typeof globalThis==="object")return globalThis;try{return this||new Function("return this")()}catch(e){if(typeof window==="object")return window}})()})();// webpack/runtime/has_own_property
23(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();// webpack/runtime/load_script
24(()=>{var e={};var t="tutor:";// loadScript function to load a script via script tag
25r.l=function(n,i,o,a){if(e[n]){e[n].push(i);return}var s,l;if(o!==undefined){var d=document.getElementsByTagName("script");for(var u=0;u<d.length;u++){var c=d[u];if(c.getAttribute("src")==n||c.getAttribute("data-webpack")==t+o){s=c;break}}}if(!s){l=true;s=document.createElement("script");s.timeout=120;if(r.nc){s.setAttribute("nonce",r.nc)}s.setAttribute("data-webpack",t+o);s.src=n}e[n]=[i];var v=function(t,r){s.onerror=s.onload=null;clearTimeout(h);var i=e[n];delete e[n];s.parentNode&&s.parentNode.removeChild(s);i&&i.forEach(function(e){return e(r)});if(t)return t(r)};var h=setTimeout(v.bind(null,undefined,{type:"timeout",target:s}),12e4);s.onerror=v.bind(null,s.onerror);s.onload=v.bind(null,s.onload);l&&document.head.appendChild(s)}})();// webpack/runtime/make_namespace_object
26(()=>{// define __esModule on exports
27r.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();// webpack/runtime/rspack_version
28(()=>{r.rv=()=>"1.6.5"})();// webpack/runtime/auto_public_path
29(()=>{var e;if(r.g.importScripts)e=r.g.location+"";var t=r.g.document;if(!e&&t){// Technically we could use `document.currentScript instanceof window.HTMLScriptElement`,
30// but an attacker could try to inject `<script>HTMLScriptElement = HTMLImageElement</script>`
31// and use `<img name="currentScript" src="https://attacker.controlled.server/"></img>`
32if(t.currentScript&&t.currentScript.tagName.toUpperCase()==="SCRIPT")e=t.currentScript.src;if(!e){var n=t.getElementsByTagName("script");if(n.length){var i=n.length-1;while(i>-1&&(!e||!/^http(s?):/.test(e)))e=n[i--].src}}}// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration",
33// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.',
34if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");r.p=e+"../"})();// webpack/runtime/jsonp_chunk_loading
35(()=>{// object to store loaded and loading chunks
36// undefined = chunk not loaded, null = chunk preloaded/prefetched
37// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
38var e={"775":0};r.f.j=function(t,n){// JSONP chunk loading for javascript
39var i=r.o(e,t)?e[t]:undefined;if(i!==0){// 0 means "already installed".
40// a Promise means "currently loading".
41if(i){n.push(i[2])}else{if(true){// setup Promise in chunk cache
42var o=new Promise((r,n)=>i=e[t]=[r,n]);n.push(i[2]=o);// start chunk loading
43var a=r.p+r.u(t);// create error before stack unwound to get useful stacktrace later
44var s=new Error;var l=function(n){if(r.o(e,t)){i=e[t];if(i!==0)e[t]=undefined;if(i){var o=n&&(n.type==="load"?"missing":n.type);var a=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")";s.name="ChunkLoadError";s.type=o;s.request=a;i[1](s)}}};r.l(a,l,"chunk-"+t,t)}}}};// install a JSONP callback for chunk loading
45var t=(t,n)=>{var[i,o,a]=n;// add "moreModules" to the modules object,
46// then flag all "chunkIds" as loaded and fire callback
47var s,l,d=0;if(i.some(t=>e[t]!==0)){for(s in o){if(r.o(o,s)){r.m[s]=o[s]}}if(a)var u=a(r)}if(t)t(n);for(;d<i.length;d++){l=i[d];if(r.o(e,l)&&e[l]){e[l][0]()}e[l]=0}};var n=self["webpackChunktutor"]=self["webpackChunktutor"]||[];
47n.forEach(t.bind(null,0));n.push=t.bind(null,n.push.bind(n))})();// webpack/runtime/rspack_unique_id
48(()=>{r.ruid="[email protected]"})();var n={};// UNUSED EXPORTS: initializeDashboard
49;// CONCATENATED MODULE: ./node_modules/.pnpm/@[email protected]/node_modules/@swc/helpers/esm/_async_to_generator.js
50function i(e,t,r,n,i,o,a){try{var s=e[o](a);var l=s.value}catch(e){r(e);return}if(s.done)t(l);else Promise.resolve(l).then(n,i)}function o(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function s(e){i(a,n,o,s,l,"next",e)}function l(e){i(a,n,o,s,l,"throw",e)}s(undefined)})}};// CONCATENATED MODULE: ./node_modules/.pnpm/@[email protected]/node_modules/@swc/helpers/esm/_define_property.js
51function a(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else e[t]=r;return e};// CONCATENATED MODULE: ./node_modules/.pnpm/@[email protected]/node_modules/@swc/helpers/esm/_object_spread.js
52function s(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){a(e,t,r[t])})}return e};// CONCATENATED MODULE: ./node_modules/.pnpm/@[email protected]/node_modules/@swc/helpers/esm/_object_spread_props.js
53function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function d(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors)Object.defineProperties(e,Object.getOwnPropertyDescriptors(t));else{l(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e};// CONCATENATED MODULE: external "wp.i18n"
54const u=wp.i18n;// CONCATENATED MODULE: ./assets/src/js/frontend/components/reviews.ts
55var c=()=>{var{query:e,endpoints:t,toast:r}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;return{query:e,$el:null,deleteReviewMutation:null,init(){if(!this.$el){return}this.deleteReviewMutation=this.query.useMutation(this.deleteReview,{onSuccess:e=>{window.location.reload();var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,u.__)("Review deleted successfully","tutor"))},onError:e=>{r.error(e.message||(0,u.__)("Failed to delete review","tutor"))}})},handleDeleteReview(e){return o(function*(){var t;yield(t=this.deleteReviewMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)},deleteReview(e){return o(function*(){return n(t.DELETE_REVIEW,{review_id:e})})()}}};var v=()=>{var{query:e,modal:t,toast:r,endpoints:n}=window.TutorCore;var{wpPost:i}=window.TutorCore.api;var{convertToErrorMessage:a}=window.TutorCore.error;return{query:e,saveRatingMutation:null,clear_review_popup_data:false,init(){this.saveRatingMutation=this.query.useMutation(this.saveRating,{onSuccess:(e,n)=>o(function*(){if(this.clear_review_popup_data){yield this.clearReviewPopupData(n.course_id)}t.closeModal("create-review-modal");r.success(e.message);window.location.reload()}).call(this),onError:e=>{r.error(a(e))}})},handleReviewSubmit(e){return o(function*(){var t;this.clear_review_popup_data=!!e.clear_review_popup_data;var r=this.convertFormDataToPayload(e);yield(t=this.saveRatingMutation)===null||t===void 0?void 0:t.mutate(r)}).call(this)},saveRating(e){return o(function*(){return i(n.PLACE_RATING,e)})()},clearReviewPopupData(e){return o(function*(){return i(n.CLEAR_REVIEW_POPUP_DATA,{course_id:e})})()},convertFormDataToPayload(e){return d(s({},e.comment_ID&&{comment_id:e.comment_ID}),{course_id:e.comment_post_ID,tutor_rating_gen_input:e.rating,review:e.comment_content})}}};var h=e=>{var{query:t,endpoints:r,toast:n}=window.TutorCore;var{wpPost:i}=window.TutorCore.api;var{convertToErrorMessage:a}=window.TutorCore.error;return{query:t,id:e,isEditMode:false,$el:null,$refs:{},saveRatingMutation:null,handlers:{},init(){var e,t,r;if(!this.$el){return}// Bind handlers once to maintain stable references for cleanup
56this.handlers.toggleEditMode=()=>this.toggleEditMode();(e=this.$refs.edit)===null||e===void 0?void 0:e.addEventListener("click",this.handlers.toggleEditMode);(t=this.$refs.cancel)===null||t===void 0?void 0:t.addEventListener("click",this.handlers.toggleEditMode);(r=this.$refs.delete)===null||r===void 0?void 0:r.addEventListener("click",this.handlers.onDeleteButtonClick);this.saveRatingMutation=this.query.useMutation(this.saveRating,{onSuccess:e=>{this.isEditMode=false;n.success(e.message);window.location.reload()},onError:e=>{n.error(a(e))}})},destroy(){var e,t,r;(e=this.$refs.edit)===null||e===void 0?void 0:e.removeEventListener("click",this.handlers.toggleEditMode);(t=this.$refs.cancel)===null||t===void 0?void 0:t.removeEventListener("click",this.handlers.toggleEditMode);(r=this.$refs.delete)===null||r===void 0?void 0:r.removeEventListener("click",this.handlers.onDeleteButtonClick)},handleReviewSubmit(e){return o(function*(){var t;var r=this.convertFormDataToPayload(e);yield(t=this.saveRatingMutation)===null||t===void 0?void 0:t.mutate(r)}
56).call(this)},saveRating(e){return o(function*(){return i(r.PLACE_RATING,e)})()},convertFormDataToPayload(e){return d(s({},e.comment_ID&&{comment_id:e.comment_ID}),{course_id:e.comment_post_ID,tutor_rating_gen_input:e.rating,review:e.comment_content})},toggleEditMode(){this.isEditMode=!this.isEditMode}}};var f={name:"reviewDeleteModal",component:c};var m={name:"reviewModal",component:v};var p={name:"reviewCard",component:h};var _=()=>{window.TutorComponentRegistry.registerAll({components:[p,f,m]});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/core/ts/config/config.ts
57/* eslint-disable @typescript-eslint/no-explicit-any */var g,w;var y={ID:0,ajaxurl:"",site_url:"",home_url:"",site_title:"",base_path:"",tutor_url:"",tutor_pro_url:"",dashboard_url:"",nonce_key:"",_tutor_nonce:"",loading_icon_url:"",placeholder_img_src:"",enable_lesson_classic_editor:"",tutor_frontend_dashboard_url:"",backend_course_list_url:"",backend_bundle_list_url:"",frontend_course_list_url:"",frontend_bundle_list_url:"",wp_date_format:"",wp_rest_nonce:"",is_admin:"",is_admin_bar_showing:"",is_tour_completed:"",max_upload_size:"",content_change_event:"",is_tutor_course_edit:"",assignment_max_file_allowed:"",current_page:"",quiz_answer_display_time:"",is_ssl:"",course_list_page_url:"",course_post_type:"",local:"",tutor_pn_vapid_key:"",tutor_pn_client_id:"",tutor_pn_subscription_saved:"",difficulty_levels:[],supported_video_sources:[],edd_products:[],bp_groups:[],timezones:{},addons_data:[],kids_icons_registry:[],is_kids_mode:false,user_preferences:{auto_play_next:false,contrast:"",font_scale:1,learning_mood:"modern",motion_effects:"auto",theme:"light",vision:"normal"},is_legacy_learning_mode:false,current_user:{data:{id:"",user_login:"",user_pass:"",user_nicename:"",user_email:"",user_url:"",user_registered:"",user_activation_key:"",user_status:"",display_name:""},caps:{},cap_key:"",roles:[],allcaps:{},filter:null},settings:{learning_mode:"",monetize_by:"tutor",enable_course_marketplace:"off",course_permalink_base:"",supported_video_sources:"",enrollment_expiry_enabled:"off",enable_q_and_a_on_course:"off",instructor_can_delete_course:"off",instructor_can_change_course_author:"off",instructor_can_manage_co_instructors:"off",chatgpt_enable:"off",brand_logo_light:"",chatgpt_key_exist:false,hide_admin_bar_for_users:"off",enable_redirect_on_course_publish_from_frontend:"off",instructor_can_publish_course:"off",youtube_api_key_exist:false,membership_only_mode:false,enable_tax:false,enable_individual_tax_control:false,is_tax_included_in_price:false},tutor_currency:{symbol:"",currency:"",position:"",thousand_separator:"",decimal_separator:"",no_of_decimal:""},visibility_control:{course_builder:{}}};var b=window._tutorobject||y;window.ajaxurl=b.ajaxurl;var E={TUTOR_SITE_URL:b.site_url,WP_AJAX_BASE_URL:b.ajaxurl,WP_API_BASE_URL:"".concat(((g=window.wpApiSettings)===null||g===void 0?void 0:g.root)||"").concat(((w=window.wpApiSettings)===null||w===void 0?void 0:w.versionString)||""),VIDEO_SOURCES_SETTINGS_URL:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=course#field_supported_video_sources"),MONETIZATION_SETTINGS_URL:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=monetization"),TUTOR_PRICING_PAGE:"https://tutorlms.com/pricing/",TUTOR_ADDONS_PAGE:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor-addons"),CHATGPT_PLATFORM_URL:"https://platform.openai.com/account/api-keys",TUTOR_MY_COURSES_PAGE_URL:"".concat(b.tutor_frontend_dashboard_url,"/my-courses"),TUTOR_SUPPORT_PAGE_URL:"https://tutorlms.com/support",TUTOR_SUBSCRIPTIONS_PAGE:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor-subscriptions"),TUTOR_ENROLLMENTS_PAGE:"".concat(b.site_url,"/wp-admin/admin.php?page=enrollments"),TUTOR_COUPONS_PAGE:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor_coupons"),TUTOR_IMPORT_EXPORT_PAGE:"".concat(b.site_url,"/wp-admin/admin.php?page=tutor-tools&sub_page=import_export")};/* export default */const C=/* unused pure expression or super */null&&E;// CONCATENATED MODULE: ./assets/core/ts/constant.ts
58var M={TAB_CHANGE:"tutor-tab-change",MODAL_OPEN:"tutor-modal-open",MODAL_UPDATE:"tutor-modal-update",MODAL_CLOSE:"tutor-modal-close",MODAL_CLOSED:"tutor-modal-closed",TOAST_SHOW:"tutor-toast-show",TOAST_CLEAR:"tutor-toast-clear",FORM_REGISTER:"tutor-form-register",FORM_UNREGISTER:"tutor-form-unregister",FORM_STATE_CHANGE:"tutor-form-state-change",FORM_RESET:"tutor-form-reset",WP_EDITOR_FOCUS:"wp-editor-focus",TUTOR_PLAYER_READY:"tutor-player
58-ready",COMMENT_REPLIED:"tutor:comment:replied",LESSON_PLAYER_READY:"tutorLessonPlayerReady",QUIZ_TIME_EXPIRED:"tutor-quiz-time-expired",QUIZ_ABANDON_REQUESTED:"tutor-quiz-abandon-requested",QUIZ_ATTEMPT_COMPLETED:"tutor-quiz-attempt-completed",CONTENT_CHANGED:"tutor_content_changed_event",DATE_FILTER_CHANGED:"tutor:date-filter-changed",SORT_CHANGED:"tutor:sort-changed"};// CONCATENATED MODULE: ./assets/src/js/frontend/components/tour.ts
59var T={NEXT:"next",BACK:"back"};var S=e=>{var{slidesData:t,modalId:r}=e;var{modal:n,api:i,endpoints:o}=window.TutorCore;var a=Number(b.is_tour_completed);return{currentSlide:0,slides:t||[],isOpen:false,slideDirection:T.NEXT,$nextTick:undefined,_onModalClose:undefined,init(){this._onModalClose=e=>{var t;if(((t=e.detail)===null||t===void 0?void 0:t.id)===r){this.isOpen=false}};document.addEventListener(M.MODAL_CLOSE,this._onModalClose);if(!a){var e,t;this.isOpen=true;(e=(t=this).$nextTick)===null||e===void 0?void 0:e.call(t,()=>{n.showModal(r)})}},destroy(){document.removeEventListener(M.MODAL_CLOSE,this._onModalClose)},next(){this.slideDirection=T.NEXT;if(this.currentSlide<this.slides.length-1){this.currentSlide++}else{this.skip()}},back(){this.slideDirection=T.BACK;if(this.currentSlide>0){this.currentSlide--}},skip(){// Fire-and-forget AJAX call to save user meta
60i.wpPost(o.COMPLETE_TOUR);this.isOpen=false;n.closeModal(r)}}};var R=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"tour",component:S}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/services/common.ts
61var A="tutor-utc-date-time";// existing combined format
62var P="data-utc-datetime";var O="data-utc-datetime-date";var x="data-utc-datetime-time";var I=()=>{var{query:e,toast:t,endpoints:r}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;var{convertToErrorMessage:i}=window.TutorCore.error;return{createCourseMutation:null,init(){if(this.createCourseMutation){return}this.createCourseMutation=e.useMutation(this.createCourseRequest,{onSuccess:e=>{var t;window.location.href=(t=e.data)!==null&&t!==void 0?t:""},onError:e=>{t.error(i(e))}})},createCourseRequest(){return o(function*(){return n(r.CREATE_DRAFT_COURSE,{from_dashboard:true})})()},handleCreateCourse(){return o(function*(){var e;yield(e=this.createCourseMutation)===null||e===void 0?void 0:e.mutate({})}).call(this)}}};var D=e=>
62{// Safari does not support format 0000-00-00, instead it needs 0000/00/00
63var t=e.trim().replace(/-/g,"/");var r=new Date("".concat(t," UTC"));return r.toString()!=="Invalid Date"?r:null};var k=()=>{if(!wp.date){return}var e=wp.date.getSettings();var t=e.formats.date;var r=e.formats.time;var n="".concat(t,", ").concat(r);var i=Intl.DateTimeFormat().resolvedOptions().timeZone;// Combined date + time in a single node
64document.querySelectorAll("."+A).forEach(e=>{var t;var r=D((t=e.textContent)!==null&&t!==void 0?t:"");if(r){e.textContent=wp.date.dateI18n(n,r,i)}});// Separate date / time nodes sharing a parent carrying the raw UTC value
65document.querySelectorAll("[".concat(P,"]")).forEach(e=>{var n=e.getAttribute(P);if(!n){return}var o=D(n);if(!o){return}var a=e.querySelector("[".concat(O,"]"));var s=e.querySelector("[".concat(x,"]"));if(a){a.textContent=wp.date.dateI18n(t,o,i)}if(s){s.textContent=wp.date.dateI18n(r,o,i)}})};var L=()=>{var e=I();e.init();k();window.addEventListener(M.CONTENT_CHANGED,()=>k());var t=document.querySelectorAll(".tutor-create-new-course");t.forEach(t=>{t.addEventListener("click",r=>o(function*(){r.preventDefault();t.classList.add(...["tutor-loading","tutor-btn-loading"]);t.setAttribute("disabled","true");var n=r.target;n.innerHTML="Creating...";try{yield e.handleCreateCourse()}finally{t.classList.remove(...["tutor-loading","tutor-btn-loading"]);t.removeAttribute("disabled")}})())})};// CONCATENATED MODULE: ./assets/src/js/frontend/services/site-shell.ts
66var N="--tutor-site-header-offset";var q="--tutor-site-header-overlay-offset";var F="wpadminbar";var U=250;var H="[data-tutor-learning-site-shell], [data-tutor-dashboard-site-shell]";/**
67 * Returns the lowest visible bottom edge among the site header and admin bar.
68 */var B=e=>{var t=e.reduce((e,t)=>{var r=window.getComputedStyle(t);if(r.display==="none"||r.visibility==="hidden"){return e}var n=t.getBoundingClientRect();if(n.bottom<=0||n.top>U){return e}return Math.max(e,n.bottom)},0);return Math.min(Math.round(t),U)};class W{start(){this.themeHeader=this.findThemeHeader();this.updateOffset();var e=this.isStickyHeader(this.themeHeader);var t=Boolean(document.getElementById(F));if(e&&this.themeHeader&&typeof ResizeObserver!=="undefined"){this.resizeObserver=new ResizeObserver(()=>this.scheduleOffsetUpdate());this.resizeObserver.observe(this.themeHeader)}window.addEventListener("resize",this.scheduleOffsetUpdate);if(e||t){window.addEventListener("scroll",this.scheduleOffsetUpdate,{passive:true})}}destroy(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.resizeObserver=null;window.removeEventListener("resize",this.scheduleOffsetUpdate);window.removeEventListener("scroll",this.scheduleOffsetUpdate);if(this.animationFrame!==null){window.cancelAnimationFrame(this.animationFrame);this.animationFrame=null}this.themeHeader=null}findThemeHeader(){if(!this.themeHeaderSelector){return null}try{var e=document.querySelector(this.themeHeaderSelector);return e instanceof HTMLElement&&!this.root.contains(e)?e:null}catch(e){return null}}isStickyHeader(e){if(!e){return false}var t=window.getComputedStyle(e).position;if(t==="fixed"||t==="sticky"||t==="absolute"){return true}var r=(e.className||"").toString();return/sticky|transparent/i.test(r)||e.hasAttribute("data-sticky")}getStickyHeader(e){if(!e){return null}var t=e=>{var t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"){return false}var r=e.getBoundingClientRect();// Must have realistic header bar dimensions (reject full-screen mobile drawers/modals > 250px)
69return r.height>0&&r.height<=U&&r.width>=window.innerWidth*.4};if(this.isStickyHeader(e)&&t(e)){return e}// Check if an inner row is fixed or sticky (e.g. Sydney, Astra)
70var r=e.querySelectorAll('div, nav, header, [class*="header"], [class*="sticky"], [class*="navbar"], [class*="shfb"]');for(var n=0;n<r.length;n++){var i=r[n];if(this.isStickyHeader(i)&&t(i)){return i}}return null}updateOffset(){var e=document.getElementById(F);var t=this.getStickyHeader(this.themeHeader);var r=[t,e].filter(e=>e instanceof HTMLElement);var n=B(r);this.root.style.setProperty(N,"".concat(n,"px"));// The active-quiz form is positioned below a normal-flow theme header,
71// but starts behind a fixed or stuck header. This value lets its
72// absolutely positioned question panel reserve only the part of the
73// visible boundary that overlays the Learning Area itself.
74var i=this.root.getBoundingClientRect().top;var o=Math.max(0,n-Math.max(0,i));this.root.style.setProperty(q,"".concat(o,"px"))}constructor(e,t){a(this,"root",void 0);a(this,"themeHeaderSelector",void 0);a(this,"animationFrame",void 0);a(this,"resizeObserver",void 0);a(this,"themeHeader",void 0);a(this,"scheduleOffsetUpdate",void 0);this.root=e;this.themeHeaderSelector=t;this.animationFrame=null;this.resizeObserver=null;this.themeHeader=null;this.scheduleOffsetUpdate=()=>{if(this.animationFrame!==null){return}this.animationFrame=window.requestAnimationFrame(()=>{this.animationFrame=null;this.updateOffset()})}}}/**
75 * Initializes all Tutor site-shell roots found in the current DOM.
76 *
77 * Returns a disposer that tears down every controller it created (removes
78 * listeners, disconnects observers, cancels pending rAFs). Callers are
79 * responsible for invoking it when the roots are removed or re-initialized,
80 * to avoid duplicate listeners/observers stacking up across repeated calls.
81 */var j=()=>{var e=Array.from(document.querySelectorAll(H)).map(e=>{var t=e.dataset.tutorThemeHeaderSelector||"";var r=new W(e,t);r.start();return r});return()=>
vendor: 4,970 bytes, lines 81-95
81{e.forEach(e=>e.destroy())}};// CONCATENATED MODULE: ./node_modules/.pnpm/[email protected]/node_modules/canvas-confetti/dist/confetti.module.mjs
82// canvas-confetti v1.9.4 built on 2025-10-25T05:14:56.640Z
83var z={};// source content
84/* globals Map */(function e(t,r,n,i){var o=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL);var a=typeof Path2D==="function"&&typeof DOMMatrix==="function";var s=function(){// this mostly supports ssr
85if(!t.OffscreenCanvas){return false}try{var e=new OffscreenCanvas(1,1);var r=e.getContext("2d");r.fillRect(0,0,1,1);var n=e.transferToImageBitmap();r.createPattern(n,"no-repeat")}catch(e){return false}return true}();function l(){}// create a promise if it exists, otherwise, just
86// call the function directly
87function d(e){var n=r.exports.Promise;var i=n!==void 0?n:t.Promise;if(typeof i==="function"){return new i(e)}e(l,l);return null}var u=function(e,t){// see https://github.com/catdad/canvas-confetti/issues/209
88// creating canvases is actually pretty expensive, so we should create a
89// 1:1 map for bitmap:canvas, so that we can animate the confetti in
90// a performant manner, but also not store them forever so that we don't
91// have a memory leak
92return{transform:function(r){if(e){return r}if(t.has(r)){return t.get(r)}var n=new OffscreenCanvas(r.width,r.height);var i=n.getContext("2d");i.drawImage(r,0,0);t.set(r,n);return n},clear:function(){t.clear()}}}(s,new Map);var c=function(){var e=Math.floor(1e3/60);var t,r;var n={};var i=0;if(typeof requestAnimationFrame==="function"&&typeof cancelAnimationFrame==="function"){t=function(t){var r=Math.random();n[r]=requestAnimationFrame(function o(a){if(i===a||i+e-1<a){i=a;delete n[r];t()}else{n[r]=requestAnimationFrame(o)}});return r};r=function(e){if(n[e]){cancelAnimationFrame(n[e])}}}else{t=function(t){return setTimeout(t,e)};r=function(e){return clearTimeout(e)}}return{frame:t,cancel:r}}();var v=function(){var t;var r;var i={};function a(e){function t(t,r){e.postMessage({options:t||{},callback:r})}e.init=function t(t){var r=t.transferControlToOffscreen();e.postMessage({canvas:r},[r])};e.fire=function n(n,o,a){if(r){t(n,null);return r}var s=Math.random().toString(36).slice(2);r=d(function(o){function l(t){if(t.data.callback!==s){return}delete i[s];e.removeEventListener("message",l);r=null;u.clear();a();o()}e.addEventListener("message",l);t(n,s);i[s]=l.bind(null,{data:{callback:s}})});return r};e.reset=function t(){e.postMessage({reset:true});for(var t in i){i[t]();delete i[t]}}}return function(){if(t){return t}if(!n&&o){var r=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {","  if (msg.data.options) {","    CONFETTI(msg.data.options).then(function () {","      if (msg.data.callback) {","        postMessage({ callback: msg.data.callback });","      }","    });","  } else if (msg.data.reset) {","    CONFETTI && CONFETTI.reset();","  } else if (msg.data.resize) {","    SIZE.width = msg.data.resize.width;","    SIZE.height = msg.data.resize.height;","  } else if (msg.data.canvas) {","    SIZE.width = msg.data.canvas.width;","    SIZE.height = msg.data.canvas.height;","    CONFETTI = module.exports.create(msg.data.canvas);","  }","}"].join("\n");try{t=new Worker(URL.createObjectURL(new Blob([r])))}catch(e){// eslint-disable-next-line no-console
93typeof console!=="undefined"&&typeof console.warn==="function"?console.warn("🎊 Could not load worker",e):null;return null}a(t)}return t}}();var h={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],// probably should be true, but back-compat
94disableForReducedMotion:false,scalar:1};function f(e,t){return t?t(e):e}function m(e){return!(e===null||e===undefined)}function p(e,t,r){return f(e&&m(e[t])?e[t]:h[t],r)}function _(e){return e<0?0:Math.floor(e)}function g(e,t){// [min, max)
95return Math.floor(Math.random()*(t-e))+e}function w(e){return parseInt(e,16)}function y(e){return e.map(b)}function b(e){var t=String(e).replace(/[^0-9a-f]/gi,"");if(t.length<6){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return{r:w(t.substring(0,2)),g:w(t.substring(2,4)),b:w(t.substring(4,6))}}function E(e){var t=p(e,"origin",Object);t.x=p(t,"x",Number);t.y=p(t,"y",Number);return t}function C(e){e.width=document.documentElement.clientWidth;e.height=document.documentElement.clientHeight}function M(e){var t=e.getBoundingClientRect();e.width=t.width;e.height=t.height}function T(e){var t=document.createElement("canvas");t.style.position="fixed";t.style.top="0px";t.style.left="0px";t.style.pointerEvents="none";t.style.zIndex=e;return t}function S(e,t,r,n,i,o,a,s,l){e.save();e.translate(t,r);e.rotate(o);e.scale(n,i);e.arc(0,0,1,a,s,l);
95e.restore()}function R(e){var t=e.angle*(Math.PI/180);var r=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:e.startVelocity*.5+Math.random()*e.startVelocity,angle2D:-t+(.5*r-Math.random()*r),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:e.gravity*3,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function A(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift;t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity;t.velocity*=t.decay;if(t.flat){t.wobble=0;t.wobbleX=t.x+10*t.scalar;t.wobbleY=t.y+10*t.scalar;t.tiltSin=0;t.tiltCos=0;t.random=1}else{t.wobble+=t.wobbleSpeed;t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble);t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble);t.tiltAngle+=.1;t.tiltSin=Math.sin(t.tiltAngle);t.tiltCos=Math.cos(t.tiltAngle);t.random=Math.random()+2}var r=t.tick++/t.totalTicks;var n=t.x+t.random*t.tiltCos;var i=t.y+t.random*t.tiltSin;var o=t.wobbleX+t.random*t.tiltCos;var s=t.wobbleY+t.random*t.tiltSin;e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-r)+")";e.beginPath();if(a&&t.shape.type==="path"&&typeof t.shape.path==="string"&&Array.isArray(t.shape.matrix)){e.fill(D(t.shape.path,t.shape.matrix,t.x,t.y,Math.abs(o-n)*.1,Math.abs(s-i)*.1,Math.PI/10*t.wobble))}else if(t.shape.type==="bitmap"){var l=Math.PI/10*t.wobble;var d=Math.abs(o-n)*.1;var c=Math.abs(s-i)*.1;var v=t.shape.bitmap.width*t.scalar;var h=t.shape.bitmap.height*t.scalar;var f=new DOMMatrix([Math.cos(l)*d,Math.sin(l)*d,-Math.sin(l)*c,Math.cos(l)*c,t.x,t.y]);// apply the transform matrix from the confetti shape
96f.multiplySelf(new DOMMatrix(t.shape.matrix));var m=e.createPattern(u.transform(t.shape.bitmap),"no-repeat");m.setTransform(f);e.globalAlpha=1-r;e.fillStyle=m;e.fillRect(t.x-v/2,t.y-h/2,v,h);e.globalAlpha=1}else if(t.shape==="circle"){e.ellipse?e.ellipse(t.x,t.y,Math.abs(o-n)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):S(e,t.x,t.y,Math.abs(o-n)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI)}else if(t.shape==="star"){var p=Math.PI/2*3;var _=4*t.scalar;var g=8*t.scalar;var w=t.x;var y=t.y;var b=5;var E=Math.PI/b;while(b--){w=t.x+Math.cos(p)*g;y=t.y+Math.sin(p)*g;e.lineTo(w,y);p+=E;w=t.x+Math.cos(p)*_;y=t.y+Math.sin(p)*_;e.lineTo(w,y);p+=E}}else{e.moveTo(Math.floor(t.x),Math.floor(t.y));e.lineTo(Math.floor(t.wobbleX),Math.floor(i));e.lineTo(Math.floor(o),Math.floor(s));e.lineTo(Math.floor(n),Math.floor(t.wobbleY))}e.closePath();e.fill();return t.tick<t.totalTicks}function P(e,t,r,o,a){var s=t.slice();var l=e.getContext("2d");var v;var h;var f=d(function(t){function d(){v=h=null;l.clearRect(0,0,o.width,o.height);u.clear();a();t()}function f(){if(n&&!(o.width===i.width&&o.height===i.height)){o.width=e.width=i.width;o.height=e.height=i.height}if(!o.width&&!o.height){r(e);o.width=e.width;o.height=e.height}l.clearRect(0,0,o.width,o.height);s=s.filter(function(e){return A(l,e)});if(s.length){v=c.frame(f)}else{d()}}v=c.frame(f);h=d});return{addFettis:function(e){s=s.concat(e);return f},canvas:e,promise:f,reset:function(){if(v){c.cancel(v)}if(h){h()}}}}function O(e,r){var n=!e;var i=!!p(r||{},"resize");var a=false;var s=p(r,"disableForReducedMotion",Boolean);var l=o&&!!p(r||{},"useWorker");var u=l?v():null;var c=n?C:M;var h=e&&u?!!e.__confetti_initialized:false;var f=typeof matchMedia==="function"&&matchMedia("(prefers-reduced-motion)").matches;var m;function w(t,r,n){var i=p(t,"particleCount",_);var o=p(t,"angle",Number);var a=p(t,"spread",Number);var s=p(t,"startVelocity",Number);var l=p(t,"decay",Number);var d=p(t,"gravity",Number);var u=p(t,"drift",Number);var v=p(t,"colors",y);var h=p(t,"ticks",Number);var f=p(t,"shapes");var w=p(t,"scalar");var b=!!p(t,"flat");var C=E(t);var M=i;var T=[];var S=e.width*C.x;var A=e.height*C.y;while(M--){T.push(R({x:S,y:A,angle:o,spread:a,startVelocity:s,color:v[M%v.length],shape:f[g(0,f.length)],ticks:h,decay:l,gravity:d,drift:u,scalar:w,flat:b}))}// if we have a previous canvas already animating,
97// add to it
98if(m){return m.addFettis(T)}m=P(e,T,c,r,n);return m.promise}function b(r){var o=s||p(r,"disableForReducedMotion",Boolean);var l=p(r,"zIndex",Number);if(o&&f){return d(function(e){e()})}if(n&&m){// use existing canvas from in-progress animation
99e=m.canvas}else if(n&&!e){// create and initialize a new canvas
100e=T(l);document.body.appendChild(e)}if(i&&!h){// initialize the size of a user-supplied canvas
101c(e)}var v={width:e.width,height:e.height};if(u&&!h){u.init(e)}h=true;if(u){e.__confetti_initialized=true}function _(){if(u){// TODO this really shouldn't be immediate, because it is expensive
102var t={getBoundingClientRect:function(){if(!n){return e.getBoundingClientRect()}}};c(t);u.postMessage({resize:{width:t.width,height:t.height}});return}// don't actually query the size here, since this
103// can execute frequently and rapidly
104v.width=v.height=null}function g(){m=null;if(i){a=false;t.removeEventListener("resize",_)}if(n&&e){if(document.body.contains(e)){document.body.removeChild(e)}e=null;h=false}}if(i&&!a){a=true;t.addEventListener("resize",_,false)}if(u){return u.fire(r,v,g)}return w(r,v,g)}b.reset=function(){if(u){u.reset()}if(m){m.reset()}};return b}// Make default export lazy to defer worker creation until called.
105var x;function I(){if(!x){x=O(null,{useWorker:true,resize:true})}return x}function D(e,t,r,n,i,o,a){var s=new Path2D(e);var l=new Path2D;l.addPath(s,new DOMMatrix(t));var d=new Path2D;// see https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix/DOMMatrix
106d.addPath(l,new DOMMatrix([Math.cos(a)*i,Math.sin(a)*i,-Math.sin(a)*o,Math.cos(a)*o,r,n]));return d}function k(e){if(!a){throw new Error("path confetti are not supported in this browser")}var t,r;if(typeof e==="string"){t=e}else{t=e.path;r=e.matrix}var n=new Path2D(t);var i=document.createElement("canvas");var o=i.getContext("2d");if(!r){// attempt to figure out the width of the path, up to 1000x1000
107var s=1e3;var l=s;var d=s;var u=0;var c=0;var v,h;// do some line skipping... this is faster than checking
108// every pixel and will be mostly still correct
109for(var f=0;f<s;f+=2){for(var m=0;m<s;m+=2){if(o.isPointInPath(n,f,m,"nonzero")){l=Math.min(l,f);d=Math.min(d,m);u=Math.max(u,f);c=Math.max(c,m)}}}v=u-l;h=c-d;var p=10;var _=Math.min(p/v,p/h);r=[_,0,0,_,-Math.round(v/2+l)*_,-Math.round(h/2+d)*_]}return{type:"path",path:t,matrix:r}}function L(e){var t,r=1,n="#000000",// see https://nolanlawson.com/2022/04/08/the-struggle-of-using-native-emoji-on-the-web/
110i='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';if(typeof e==="string"){t=e}else{t=e.text;r="scalar"in e?e.scalar:r;i="fontFamily"in e?e.fontFamily:i;n="color"in e?e.color:n}// all other confetti are 10 pixels,
111// so this pixel size is the de-facto 100% scale confetti
112var o=10*r;var a=""+o+"px "+i;var s=new OffscreenCanvas(o,o);var l=s.getContext("2d");l.font=a;var d=l.measureText(t);var u=Math.ceil(d.actualBoundingBoxRight+d.actualBoundingBoxLeft);var c=Math.ceil(d.actualBoundingBoxAscent+d.actualBoundingBoxDescent);var v=2;var h=d.actualBoundingBoxLeft+v;var f=d.actualBoundingBoxAscent+v;u+=v+v;c+=v+v;s=new OffscreenCanvas(u,c);l=s.getContext("2d");l.font=a;l.fillStyle=n;l.fillText(t,h,f);var m=1/r;return{type:"bitmap",// TODO these probably need to be transfered for workers
113bitmap:s.transferToImageBitmap(),matrix:[m,0,0,m,-u*m/2,-c*m/2]}}r.exports=function(){return I().apply(this,arguments)};r.exports.reset=function(){I().reset()};r.exports.create=O;r.exports.shapeFromPath=k;r.exports.shapeFromText=L})(function(){if(typeof window!=="undefined"){return window}if(typeof self!=="undefined"){return self}return this||{}}(),z,false);// end source content
114/* export default */const $=z.exports;var Q=z.exports.create;// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/confetti.ts
115var G={wrapper:"tutor-modal",content:"tutor-modal-content"};var V="tutor-time-spent-modal";var X=60;var Y=850;var Z=850;var K=500;// safety margin for slower frame rates
116var J=Z/X*1e3;var ee=Y+J+K;var et=()=>{var e=document.querySelectorAll(".".concat(G.wrapper));for(var t of e){if(window.getComputedStyle(t).display!=="none"){return t}}return null};/**
117 * Creates a full-viewport canvas inside the visible modal wrapper,
118 * positioned between the backdrop and `.tutor-modal-content` in DOM
119 * order so it layers above the backdrop but below the modal body.
120 */var er=e=>{var t=document.createElement("canvas");// Explicit buffer dimensions so confetti renders at full resolution.
121t.width=window.innerWidth;t.height=window.innerHeight;// `position: absolute` works here because `.tutor-modal` is the
122// containing block (it has `position: fixed; width/height: 100%`).
123t.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;";// Insert before `.tutor-modal-content` (i.e. after the backdrop div)
124var r=e.querySelector(".".concat(G.content));if(r){e.insertBefore(t,r)}else{e.appendChild(t)}return{canvas:t,cleanup:()=>t.remove()}};var en;var ei;var eo;var ea=()=>{var e=et();if(!e){return}var{canvas:t,cleanup:r}=er(e);eo=r;var n=$.create(t,{resize:true});var i=Date.now()+Y;var o=()=>{n({particleCount:5,spread:360,startVelocity:30,origin:{x:Math.random(),y:0}
124,shapes:["square"],ticks:Z,scalar:2});if(Date.now()<i){ei=requestAnimationFrame(o)}};o();en=setTimeout(()=>{r();eo=undefined},ee)};var es=()=>{if(ei!==undefined){cancelAnimationFrame(ei);ei=undefined}if(en!==undefined){clearTimeout(en);en=undefined}eo===null||eo===void 0?void 0:eo();eo=undefined};function el(){document.addEventListener(M.MODAL_OPEN,e=>{var t;if(((t=e.detail)===null||t===void 0?void 0:t.id)===V){setTimeout(()=>ea(),300)}});document.addEventListener(M.MODAL_CLOSE,e=>{var t;if(((t=e.detail)===null||t===void 0?void 0:t.id)===V){es()}})};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/header.ts
125var ed=()=>{var{query:e,toast:t}=window.TutorCore;var{tutorConfig:r}=window.TutorCore.config;var{wpPost:n}=window.TutorCore.api;var{convertToErrorMessage:i}=window.TutorCore.error;return{query:e,profileSwitchMutation:null,init(){this.profileSwitchMutation=this.query.useMutation(e=>n("tutor_switch_profile",{current_mode:e}),{onSuccess:e=>{t.success(e===null||e===void 0?void 0:e.message);setTimeout(()=>{window.location.href=r.tutor_frontend_dashboard_url},1e3)},onError:e=>{t.error(i(e))}})}}};var eu=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"header",component:ed}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/lazy-section.ts
126/**
127 * Type guard for checking if data conforms to SectionResponseData
128 */function ec(e){return typeof e==="object"&&e!==null&&"html"in e}var ev=e=>{var{section:t,dateDependent:r=false,sortDependent:n=false,type:i="revenue"}=e;var{wpPost:o}=window.TutorCore.api;var{toast:a}=window.TutorCore;var{convertToErrorMessage:s}=window.TutorCore.error;return{section:t,dateDependent:r,sortDependent:n,startDate:"",endDate:"",sortType:i,lastFetchedKey:"",query:null,dateChangeHandler:null,sortChangeHandler:null,get isVisible(){if(typeof this.watch==="function"){return!!this.watch(this.section)}return true},get isLoading(){if(!this.isVisible)return false;return this.query?this.query.isLoading||this.query.isFetching:true},get hasError(){var l;return!!((l=this.query)===null||l===void 0?void 0:l.error)},get hasData(){var d;var c=(d=this.query)===null||d===void 0?void 0:d.data;if(!c)return false;if("data"in c&&c.data)return c.data.has_data!==false;if(ec(c))return c.has_data!==false;return true},get content(){var v;var h=(v=this.query)===null||v===void 0?void 0:v.data;if(!h)return"";if("data"in h&&h.data)return h.data.html||"";if(ec(h))return h.html||"";return""},reinitTargetTree(){this.$nextTick(()=>{var e=this.$refs.contentContainer||this.$el;if(e&&window.Alpine){window.Alpine.initTree(e)}})},checkAndFetch(){var e;if(!this.isVisible){return}var t="".concat(this.startDate,"_").concat(this.endDate,"_").concat(this.sortType);if(this.lastFetchedKey!==t||!((e=this.query)===null||e===void 0?void 0:e.data)){this.lastFetchedKey=t;this.fetchSection()}},init(){var e=new URLSearchParams(window.location.search);this.startDate=e.get("start_date")||"";this.endDate=e.get("end_date")||"";this.sortType=e.get("top_performing_course")||e.get("type")||i;// Watch for content updates from QueryService and re-initialize Alpine child tree
129this.$watch("content",e=>{if(e){this.reinitTargetTree()}});// Watch for query errors and display toast notifications
130this.$watch("hasError",e=>{var t;if(e&&((t=this.query)===null||t===void 0?void 0:t.error)){var r=s(this.query.error);a.error(r||(0,u.__)("Failed to load section data.","tutor"))}});// Watch visibility changes (e.g. toggled in Customize View popover)
131this.$watch(()=>this.isVisible,e=>{if(e){this.checkAndFetch()}});// Only fetch on initial load if the section is currently visible
132if(this.isVisible){this.checkAndFetch()}if(this.dateDependent){this.dateChangeHandler=e=>{var t=e instanceof CustomEvent?e.detail:undefined;var r=(t===null||t===void 0?void 0:t.startDate)||"";var n=(t===null||t===void 0?void 0:t.endDate)||"";// Guard: Avoid refetch if the filter dates have not changed
133if(this.startDate===r&&this.endDate===n){return}this.startDate=r;this.endDate=n;// If currently visible, fetch immediately. If hidden, checkAndFetch() will run when made visible.
134if(this.isVisible){this.checkAndFetch()}};window.addEventListener(M.DATE_FILTER_CHANGED,this.dateChangeHandler)}if(this.sortDependent){this.sortChangeHandler=e=>
134{var t=e instanceof CustomEvent?e.detail:undefined;var r=(t===null||t===void 0?void 0:t.type)||i;// Guard: Avoid refetch if sort type has not changed
135if(this.sortType===r){return}this.sortType=r;// If currently visible, fetch immediately. If hidden, checkAndFetch() will run when made visible.
136if(this.isVisible){this.checkAndFetch()}};window.addEventListener(M.SORT_CHANGED,this.sortChangeHandler)}},destroy(){if(this.dateChangeHandler){window.removeEventListener(M.DATE_FILTER_CHANGED,this.dateChangeHandler)}if(this.sortChangeHandler){window.removeEventListener(M.SORT_CHANGED,this.sortChangeHandler)}},fetchSection(){var e=["dashboard-section",this.section,this.startDate,this.endDate,this.sortType];var t=window.TutorCore.query;if(t){this.query=t.useQuery(e,()=>o("tutor_get_dashboard_section",{section:this.section,start_date:this.startDate,end_date:this.endDate,top_performing_course:this.sortType,type:this.sortType}),{staleTime:5*60*1e3});// If data is already available from fresh cache, trigger tree init immediately
137if(this.query.data){this.reinitTargetTree()}}}}};var eh=()=>{if(window.TutorComponentRegistry){window.TutorComponentRegistry.register({type:"component",meta:{name:"lazySection",component:ev}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)}};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/announcements.ts
138var ef=e=>{var{formId:t,deleteModalId:r,createModalId:n}=e;var{query:i,modal:a,toast:l,form:c,endpoints:v}=window.TutorCore;var{wpPost:h}=window.TutorCore.api;var{convertToErrorMessage:f}=window.TutorCore.error;var m={FORM:t,DELETE:r,CREATE:n};return{query:i,deleteMutation:null,createUpdateMutation:null,formData:{id:0,course_id:"",title:"",summary:"",tutor_notify_all_students:true,action_type:"create"},get formTitle(){return this.formData.action_type==="create"?(0,u.__)("Create Announcement","tutor"):(0,u.__)("Edit Announcement","tutor")},get formActionText(){return this.formData.action_type==="create"?(0,u.__)("Publish","tutor"):(0,u.__)("Update","tutor")},init(){// Setup delete mutation
139this.deleteMutation=this.query.useMutation(this.deleteAnnouncement,{onSuccess:()=>{a.closeModal(m.DELETE);window.location.reload()},onError:e=>{l.error(f(e))}});// Setup create/update mutation
140this.createUpdateMutation=this.query.useMutation(this.createUpdateAnnouncement,{onSuccess:e=>{var t;a.closeModal(m.CREATE);l.success(((t=e.data)===null||t===void 0?void 0:t.message)||(0,u.__)("Operation successful","tutor"));window.location.reload()},onError:e=>{l.error(f(e))}})},deleteAnnouncement(e){return o(function*(){return h(v.DELETE_ANNOUNCEMENT,{announcement_id:e})})()},createUpdateAnnouncement(e){return o(function*(){return h(v.CREATE_ANNOUNCEMENT,e)})()},handleDeleteAnnouncement(e){return o(function*(){var t;yield(t=this.deleteMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)},openCreateModal(){this.formData.action_type="create";this.formData.id=0;a.showModal(m.CREATE);if(c.hasForm(t)){c.reset(t)}},openEditModal(e){this.formData.id=e.id;this.formData.course_id=e.course_id.toString();this.formData.title=e.title;this.formData.summary=e.summary;this.formData.action_type="update";a.showModal(m.CREATE);var r=document.getElementById(m.FORM);if(!r)return;// Manual registration fallback if auto-init hasn't fired yet
141if(!c.hasForm(t)){var n=window.Alpine.$data(r);c.register(t,n)}if(c.hasForm(t)){var i={tutor_announcement_course:String(e.course_id),tutor_announcement_title:e.title,tutor_announcement_summary:e.summary,tutor_notify_all_students:true,tutor_push_notify_students:true};c.setValues(t,i)}},handleFormSubmit(e){return o(function*(){var t;var r=d(s({},e.tutor_notify_all_students&&{tutor_notify_all_students:e.tutor_notify_all_students?"on":"off"},e.tutor_push_notify_students&&{tutor_push_notify_students:e.tutor_push_notify_students?"on":"off"}),{tutor_announcement_course:e.tutor_announcement_course||"",tutor_announcement_title:e.tutor_announcement_title||"",tutor_announcement_summary:e.tutor_announcement_summary||"",action_type:this.formData.action_type});if(this.formData.action_type==="update"){r.announcement_id=this.formData.id}yield(t=this.createUpdateMutation)===null||t===void 0?void 0:t.mutate(r)}
141).call(this)}}};var em=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"announcements",component:ef}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/billing.ts
142function ep(e,t){if(!e.length){return}var r=Object.keys(e[0]);var n=e.map(e=>r.map(t=>{var r;return'"'.concat(((r=e[t])!==null&&r!==void 0?r:"").replace(/"/g,'""'),'"')}).join(","));var i=[r.join(","),...n].join("\n");var o=new Blob([i],{type:"text/csv;charset=utf-8;"});var a=URL.createObjectURL(o);var s=document.createElement("a");s.href=a;s.download=t;document.body.appendChild(s);s.click();document.body.removeChild(s);URL.revokeObjectURL(a)}function e_(){document.querySelectorAll(".tutor-export-purchase-history").forEach(e=>{e.addEventListener("click",t=>{t.preventDefault();var r;var n="order-".concat((r=e.dataset.order)!==null&&r!==void 0?r:"","-purchase-history.csv");var i,o,a,s,l;var d=[{"Order ID":(i=e.dataset.order)!==null&&i!==void 0?i:"","Course Name":(o=e.dataset.courseName)!==null&&o!==void 0?o:"",Price:(a=e.dataset.price)!==null&&a!==void 0?a:"",Date:(s=e.dataset.date)!==null&&s!==void 0?s:"",Status:(l=e.dataset.status)!==null&&l!==void 0?l:""}];ep(d,n)})})}var eg=()=>{e_()};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/discussions.ts
143var ew={COMMENT_EDIT:"lesson-comment-edit-",COMMENT_REPLY:"lesson-comment-reply-form-",QNA_EDIT:"qna-edit-",QNA_REPLY:"qna-reply-form-"};var ey={COMMENT_DELETE:"tutor-comment-delete-modal",QNA_DELETE:"tutor-qna-delete-modal"};var eb={COMMENT_TEXT_PREFIX:"tutor-lesson-comment-text-",QNA_TEXT_PREFIX:"tutor-qna-text-",REPLIES_LIST_CONTAINER:"tutor-discussion-replies-list"};var eE={TAB:"tab",ID:"id",ORDER:"order"};var eC=60;/**
144 * Discussions Page Component
145 * Handles Q&A, Lesson comments related actions
146 */var eM=()=>{var{query:e,form:t,toast:r,modal:n,endpoints:i}=window.TutorCore;var{decodeHtmlEntities:a}=window.TutorCore.string;var{convertToErrorMessage:l}=window.TutorCore.error;var{wpPost:d}=window.TutorCore.api;return{query:e,deleteCommentMutation:null,replyCommentMutation:null,editCommentMutation:null,qnaSingleActionMutation:null,deleteQnAMutation:null,replyQnAMutation:null,updateQnAMutation:null,loadQnARepliesMutation:null,currentAction:null,currentQuestionId:null,isSolved:false,isImportant:false,isArchived:false,editingId:null,editingFormId:null,replyingId:null,replyingCommentId:null,loadingReplies:false,repliesOrder:"DESC",$nextTick:undefined,init(){// Set initial state from URL
147var e=new URL(window.location.href);this.repliesOrder=e.searchParams.get(eE.ORDER)||"DESC";// Lesson comment delete mutation.
148this.deleteCommentMutation=this.query.useMutation(this.deleteComment,{onSuccess:(e,t)=>{if(t.is_reply){r.success((0,u.__)("Reply deleted successfully","tutor"));n.closeModal(ey.COMMENT_DELETE);this.reloadReplies()}else{var i=new URL(window.location.href);i.searchParams.delete(eE.ID);window.location.href=i.toString()}},onError:e=>{r.error(l(e))}});// Lesson comment reply mutation
149this.replyCommentMutation=this.query.useMutation(this.replyComment,{onSuccess:(e,n)=>{r.success((0,u.__)("Reply saved successfully","tutor"));var i="".concat(ew.COMMENT_REPLY).concat(n.comment_parent);if(t.hasForm(i)){t.reset(i)}if(n.reply_context==="single"){this.reloadReplies()}else{this.setReplyingComment(null);this.updateCommentReplyCount(n.comment_parent);this.highlightCard(n.comment_parent,"comment")}},onError:e=>{r.error(l(e))}});// Lesson comment edit mutation.
150this.editCommentMutation=this.query.useMutation(this.updateComment,{onSuccess:(e,n)=>{r.success((0,u.__)("Comment updated successfully.","tutor"));var i=document.getElementById("".concat(eb.COMMENT_TEXT_PREFIX).concat(n.comment_id));if(i){i.innerHTML=n.comment}if(this.editingFormId&&t.hasForm(this.editingFormId)){t.reset(this.editingFormId);this.editingFormId=null}this.editingId=null},onError:e=>{r.error(l(e))}});// Q&A single action mutation (read, unread, solved, important, archived).
151this.qnaSingleActionMutation=this.query.useMutation(this.qnaSingleAction,{onSuccess:(e,t)=>{var r=t.qna_action;if(r==="solved"){this.isSolved=!this.isSolved}else if(r==="important"){this.isImportant=!this.isImportant}else if(r==="archived"){this.isArchived=!this.isArchived}window.dispatchEvent(new CustomEvent("tutor-qna-action-success",{detail:{questionId:t.question_id,action:r}}))},onError:e=>{r.error(l(e))}});// Q&A delete mutation.
152this.deleteQnAMutation=this.query.useMutation(this.deleteQnA,{onSuccess:(e,t)=>{if(t.context==="reply"){r.success((0,u.__)("Reply deleted successfully","tutor"));n.closeModal(ey.QNA_DELETE);// this.reloadReplies();
153window.location.reload()}else{var i=new URL(window.location.href);i.searchParams.delete(eE.ID);window.location.href=i.toString()}},onError:e=>{r.error(l(e))}});// Q&A reply mutation.
154this.replyQnAMutation=this.query.useMutation(this.replyQnA,{onSuccess:(e,n)=>{r.success((0,u.__)("Reply saved successfully","tutor"));var i="".concat(ew.QNA_REPLY).concat(n.question_id);if(t.hasForm(i)){t.reset(i)}if(n.reply_context==="single"){// this.reloadReplies();
155window.location.reload()}else{this.setReplying(null);this.updateReplyCount(n.question_id);this.highlightCard(n.question_id)}},onError:e=>{r.error(l(e))}});// Q&A update mutation.
156this.updateQnAMutation=this.query.useMutation(this.updateQnA,{onSuccess:(e,t)=>{r.success((0,u.__)("Updated successfully","tutor"));
156// Update DOM directly for immediate feedback
157var n=document.getElementById("".concat(eb.QNA_TEXT_PREFIX).concat(t.question_id));if(n){if(n.closest(".tutor-discussion-card")){var i=a(t.answer);n.innerHTML=i.length>eC?"".concat(i.substring(0,60),"..."):i}else{n.innerHTML=t.answer}// Re-trigger syntax highlighting if Prism is available.
158var o=window.Prism;if(o===null||o===void 0?void 0:o.highlightAllUnder){o.highlightAllUnder(n)}}if(this.editingId===t.question_id){this.setEditing(null)}},onError:e=>{r.error(l(e))}})},reloadReplies(e){return o(function*(){if(e){this.repliesOrder=e}var t=new URL(window.location.href);var r=parseInt(t.searchParams.get(eE.ID)||"0");var n=t.searchParams.get(eE.TAB)||"qna";if(!r)return;this.loadingReplies=true;try{var o;var a=n==="qna"?i.LOAD_QNA_REPLIES:i.LOAD_COMMENT_REPLIES;var s=yield d(a,{comment_id:r,order:this.repliesOrder});var l=document.getElementById(eb.REPLIES_LIST_CONTAINER);if(l&&typeof((o=s.data)===null||o===void 0?void 0:o.html)==="string"){l.innerHTML=s.data.html;// Re-trigger syntax highlighting if Prism is available.
159var u=window.Prism;if(u===null||u===void 0?void 0:u.highlightAllUnder){u.highlightAllUnder(l)}// Update URL without reload
160var c=new URL(window.location.href);c.searchParams.set(eE.ORDER,this.repliesOrder);window.history.pushState({},"",c.toString())}}catch(e){// eslint-disable-next-line no-console
161console.error("Failed to reload replies:",e)}finally{this.loadingReplies=false}}).call(this)},deleteComment(e){return d(i.DELETE_LESSON_COMMENT,e)},replyComment(e){return d(i.REPLY_LESSON_COMMENT,e)},updateComment(e){return d(i.UPDATE_LESSON_COMMENT,e)},qnaSingleAction(e){return d(i.QNA_SINGLE_ACTION,e)},deleteQnA(e){return d(i.DELETE_DASHBOARD_QNA,e)},replyQnA(e){return d(i.CREATE_UPDATE_QNA,e)},updateQnA(e){return d(i.UPDATE_QNA,e)},handleQnASingleAction(e,t){return o(function*(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.currentAction=t;this.currentQuestionId=e;try{var n;yield(n=this.qnaSingleActionMutation)===null||n===void 0?void 0:n.mutate(s({question_id:e,qna_action:t},r))}finally{this.currentAction=null;this.currentQuestionId=null}}).apply(this,arguments)},handleReplyComment(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"single";var i;return(i=this.replyCommentMutation)===null||i===void 0?void 0:i.mutate({comment:e.comment,comment_parent:t,comment_post_ID:r,reply_context:n})},handleEditComment(e,t){var r;return(r=this.editCommentMutation)===null||r===void 0?void 0:r.mutate({comment_id:t,comment:e.comment})},handleKeydown(e){if((e.metaKey||e.ctrlKey)&&e.key==="Enter"){var t;(t=e.target.closest("form"))===null||t===void 0?void 0:t.requestSubmit()}},setEditing(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"comment";var n=r==="qna"?ew.QNA_EDIT:ew.COMMENT_EDIT;var i=r==="qna"?"answer":"comment";this.editingId=e;var o=e?"".concat(n).concat(e):null;this.editingFormId=o;if(e&&o){var a,s;(a=(s=this).$nextTick)===null||a===void 0?void 0:a.call(s,()=>{if(t.hasForm(o)){t.setFocus(o,i)}})}},setReplying(e){this.replyingId=e;if(e){var r,n;var i="".concat(ew.QNA_REPLY).concat(e);(r=(n=this).$nextTick)===null||r===void 0?void 0:r.call(n,()=>{if(t.hasForm(i)){t.setFocus(i,"answer")}})}},toggleReply(e){if(this.replyingId===e){this.setReplying(null)}else{this.setReplying(e)}},updateReplyCount(e){// Find the reply count element and increment it
162var t=document.querySelector('[data-question-id="'.concat(e,'"]'));if(t){var r=t.querySelector(".tutor-discussion-card-reply-count");if(r){var n=parseInt(r.textContent||"0",10);r.textContent=String(n+1)}}},setReplyingComment(e){this.replyingCommentId=e;if(e){var r,n;var i="".concat(ew.COMMENT_REPLY).concat(e);(r=(n=this).$nextTick)===null||r===void 0?void 0:r.call(n,()=>{if(t.hasForm(i)){t.setFocus(i,"comment")}})}},toggleCommentReply(e){if(this.replyingCommentId===e){this.setReplyingComment(null)}else{this.setReplyingComment(e)}},updateCommentReplyCount(e){// Find the reply count element and increment it
163var t=document.querySelector('[data-comment-id="'.concat(e,'"]'));if(t){var r=t.querySelector(".tutor-discussion-card-reply-count");if(r){var n=parseInt(r.textContent||"0",10);r.textContent=String(n+1)}}},highlightCard(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"qna";var r=t==="comment"?"data-comment-id":"data-question-id";var n=document.querySelector("[".concat(r,'="').concat(e,'"]'));var i;var o=(i=n===null||n===void 0?void 0:n.closest(".tutor-discussion-card"))!==null&&i!==void 0?i:n;if(!o)return;if(window.innerWidth>576){o.style.boxShadow="0 0 0 2px var(--tutor-text-brand-secondary)";setTimeout(()=>{o.style.boxShadow=""},300)}}}};var eT=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"discussions",component:eM}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/instructor/home-charts.ts
164var eS=null;var eR=()=>
164o(function*(){eS!==null&&eS!==void 0?eS:eS=r.e(/* import() | tutor-chart-js */"587").then(r.bind(r,72011)).then(e=>{var{Chart:t}=e;return t});return eS})();var eA={canvas:{statCardHeight:"33px",width:"100%",overviewMaxHeight:179,completionMaxHeight:118},aspectRatio:{overview:3},point:{radius:4,hoverRadius:6,borderWidth:2,hoverBorderWidth:3},line:{width:1.3,tension:.4},bar:{thickness:118,borderRadius:5,borderWidth:3},completionSegment:{minWidth:16},gradient:{topOffset:-.95,opacity:.9},tooltip:{fontSize:"10px",lineHeight:"1.6",padding:"4px 7px",minWidth:"70px",borderRadius:"4px",boxShadow:"0px 2px 4px -2px #1018280F, 0px 4px 8px -2px #1018281A",caretSize:6,caretInnerSize:5,caretInnerOffset:4,barOffsetX:6,lineOffsetX:12},common:{devicePixelRatio:()=>window.devicePixelRatio||2,responsive:true,hiddenLegend:{display:false},disabledTooltip:{enabled:false},hiddenAxis:{display:false,grid:{display:false}}}};var eP=(e,t)=>{// Expand 3-digit hex (#RGB → #RRGGBB)
165var r=e.length===4?"#".concat(e[1]).concat(e[1]).concat(e[2]).concat(e[2]).concat(e[3]).concat(e[3]):e;var n=parseInt(r.slice(1,3),16)||0;var i=parseInt(r.slice(3,5),16)||0;var o=parseInt(r.slice(5,7),16)||0;return"rgba(".concat(n,", ").concat(i,", ").concat(o,", ").concat(t,")")};var eO=(e,t)=>{return e===0||e===t-1};var ex=(e,t)=>{return getComputedStyle(e).getPropertyValue(t).trim()};var eI=()=>{var e=document.querySelector("[data-tutor-theme]")||document.documentElement;var t=e.getAttribute("data-tutor-motion");return t==="reduce"||(!t||t==="auto")&&window.matchMedia("(prefers-reduced-motion: reduce)").matches};var eD=()=>{if(eI()){return{duration:0}}return undefined};var ek=()=>{if(eI()){return{duration:0}}return{base:{duration:0},x:{from:e=>{var t=e.chart;var r=e.dataIndex;var n=e.datasetIndex;var i=0;for(var o=0;o<n;o++){i+=t.data.datasets[o].data[r]||0}return t.scales.x.getPixelForValue(i)}}}};var eL=(e,t,r)=>{var n=e.reduce((e,t)=>e+t,0);var i=(r===null||r===void 0?void 0:r.clientWidth)||0;var o=t/i*n;var a=e.filter(e=>e>0).length;if(n<=0||o<=0||a*o>=n){return[...e]}var s=e.map(e=>e>0?Math.max(e,o):0);var l=s.reduce((e,t)=>e+t,0);return s.map(e=>e/l*n)};var eN=(e,t)=>{requestAnimationFrame(()=>o(function*(){var r=yield eR();new r(e,t)})())};var eq=(e,t)=>{if(e.clientWidth>0){t();return}var r=new ResizeObserver(()=>{if(e.clientWidth>0){r.disconnect();t()}});r.observe(e)};var eF=(e,t)=>{var r=t[t.length-1]>t[0];return{line:ex(e,r?"--tutor-border-success":"--tutor-border-error"),point:ex(e,r?"--tutor-actions-success-primary":"--tutor-icon-critical"),pointBorder:ex(e,"--tutor-surface-l2"),tooltip:{background:ex(e,"--tutor-surface-l1"),title:ex(e,"--tutor-text-subdued"),subtitle:ex(e,"--tutor-text-primary")}}};var eU=e=>{return{earnings:{line:ex(e,"--tutor-border-brand"),point:ex(e,"--tutor-actions-brand-primary"),pointBorder:ex(e,"--tutor-actions-brand-secondary"),linearGradient:["#5E81F4",ex(e,"--tutor-surface-l1")]},enrolled:{line:ex(e,"--tutor-border-success"),point:ex(e,"--tutor-actions-success-primary"),pointBorder:ex(e,"--tutor-actions-success-secondary"),linearGradient:["#8AF1B9",ex(e,"--tutor-surface-l1")]},tooltip:{background:ex(e,"--tutor-surface-l1-hover"),title:ex(e,"--tutor-text-subdued"),subtitle:ex(e,"--tutor-text-primary")},ticks:{color:ex(e,"--tutor-text-subdued")},border:ex(e,"--tutor-border-idle")}};var eH=e=>{return{enrolled:ex(e,"--tutor-actions-exception5"),completed:ex(e,"--tutor-actions-success-primary"),in_progress:ex(e,"--tutor-actions-caution"),inactive:ex(e,"--tutor-surface-l2-hover"),cancelled:ex(e,"--tutor-actions-critical-primary"),tooltip:{background:ex(e,"--tutor-surface-l1"),title:ex(e,"--tutor-text-subdued"),subtitle:ex(e,"--tutor-text-primary")}}};var eB=function(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ex(document.documentElement,"--tutor-surface-l1");var i=t.bottom-t.top;var o=t.top+i*eA.gradient.topOffset;var a=e.createLinearGradient(0,o,0,t.bottom);a.addColorStop(0,eP(r,eA.gradient.opacity));a.addColorStop(1,eP(n,0));return a};var eW=()=>{var e=document.createElement("div");e.setAttribute("data-chart-tooltip","");Object.assign(e.style,{background:"transparent",pointerEvents:"none",position:"absolute",transform:"translate(-50%, 0)",transition:"all .1s ease"});var t=document.createElement("table");t.style.margin="0px";e.appendChild(t);return e};var ej=e=>{var t=e.canvas.parentElement;if(!t){return eW()}if(getComputedStyle(t).position==="static"){t.style.position="relative"}var r=t.querySelector("div[data-chart-tooltip]");if(!r){r=eW();t.appendChild(r)}return r};var ez=(e,t)=>{var r;if(e.opacity===0||!((r=e.dataPoints)===null||r===void 0?void 0:r.length)){return false}if(t==="bar"){return true}var n=e.dataPoints[0];var i=n.dataset.data.length;var o=n.dataIndex===0||n.dataIndex===i-1;return!o};var e$=(e,t)=>{var r=document.createElement("thead");if(e.length===0||e[0]===""){return r}for(var n of e){var i=document.createElement("tr");i.style.borderWidth="0";var o=document.createElement("th");Object.assign(o.style,{borderWidth:"0",fontSize:eA.tooltip.fontSize,lineHeight:eA.tooltip.lineHeight,fontWeight:"normal",color:t.tooltip.title,textAlign:"start"});o.appendChild(document.createTextNode(n));i.appendChild(o);r.appendChild(i)}return r};var eQ=(e,t)=>{var r=document.createElement("tbody");for(var n of e){var i=document.createElement("tr");Object.assign(i.style,{backgroundColor:"inherit",borderWidth:"0"});var o=document.createElement("td");Object.assign(o.style,{borderWidth:"0",fontSize:eA.tooltip.fontSize,lineHeight:eA.tooltip.lineHeight,fontWeight:"bold",color:t.tooltip.subtitle,textAlign:"start"});o.appendChild(document.createTextNode(n[0]));i.appendChild(o);r.appendChild(i)}return r};var eG=(e,t)=>{Object.assign(e.style,{background:t.tooltip.background,borderRadius:eA.tooltip.borderRadius,padding:eA.tooltip.padding,minWidth:eA.tooltip.minWidth,boxShadow:eA.tooltip.boxSh
165adow,position:"relative",direction:"inherit"})};var eV=(e,t,r)=>{var n=e.querySelectorAll("[data-caret]");for(var i of n){i.remove()}var{caretSize:o,caretInnerSize:a}=eA.tooltip;var s=eA.tooltip.caretInnerOffset;var l=document.createElement("div");l.setAttribute("data-caret","outer");Object.assign(l.style,{position:"absolute",top:"50%",transform:"translateY(-50%)",width:"0",height:"0",borderTop:"".concat(o,"px solid transparent"),borderBottom:"".concat(o,"px solid transparent"),zIndex:"1"});var d=document.createElement("div");d.setAttribute("data-caret","inner");Object.assign(d.style,{position:"absolute",top:"50%",transform:"translateY(-50%)",width:"0",height:"0",borderTop:"".concat(a,"px solid transparent"),borderBottom:"".concat(a,"px solid transparent"),zIndex:"2"});if(r==="right"){Object.assign(l.style,{left:"-".concat(o,"px"),borderRight:"".concat(o,"px solid transparent")});Object.assign(d.style,{left:"-".concat(s,"px"),borderRight:"".concat(a,"px solid ").concat(t.tooltip.background)})}else{Object.assign(l.style,{right:"-".concat(o,"px"),borderLeft:"".concat(o,"px solid transparent")});Object.assign(d.style,{right:"-".concat(s,"px"),borderLeft:"".concat(a,"px solid ").concat(t.tooltip.background)})}e.appendChild(l);e.appendChild(d)};var eX=(e,t,r)=>{if(t>r){return t}return Math.min(Math.max(e,t),r)};var eY=e=>{return e==="bar"?eA.tooltip.barOffsetX:eA.tooltip.lineOffsetX};var eZ=(e,t,r)=>{var{chart:n,tooltip:i}=e;var o=ej(n);if(!ez(i,r)){o.style.opacity="0";return}var a=o.querySelector("table");if(!a){return}while(a.firstChild){a.firstChild.remove()}var s=i.title||[];var l=i.body.map(e=>e.lines);var d=e$(s,t);var u=eQ(l,t);a.appendChild(d);a.appendChild(u);eG(a,t);var c=n.canvas.parentElement;if(!c){return}var v=eY(r);var{offsetLeft:h,offsetTop:f}=n.canvas;var m=h+i.caretX;var p=f+i.caretY;var _=8;var g="right";eV(a,t,g);var w=o.offsetWidth;var y=c.clientWidth;var b=c.clientHeight;var E=m+v;if(E+w>y-_){g="left";eV(a,t,g)}var C=o.offsetWidth;var M=o.offsetHeight;var T=g==="right"?m+v:m-C-v;var S=eX(T,_,y-C-_);var R=eX(p-M/2,_,b-M-_);Object.assign(o.style,{opacity:"1",left:"".concat(S,"px"),top:"".concat(R,"px"),transform:"translate(0, 0)"})};var eK=e=>({$refs:{},init(){var t;if(!((t=this.$refs)===null||t===void 0?void 0:t.canvas))return;this.setupCanvas();eq(this.$refs.canvas,()=>{var t=eF(this.$refs.canvas,e);eN(this.$refs.canvas,this.createChartConfig(e,t))})},setupCanvas(){this.$refs.canvas.setAttribute("height",eA.canvas.statCardHeight);this.$refs.canvas.setAttribute("width",eA.canvas.width)},createChartConfig(e,t){var r=e.length;var{formatPrice:n}=window.TutorCore.currency;return{type:"line",data:{labels:Array.from({length:r},(e,t)=>t),datasets:[{type:"line",data:e,borderWidth:1,tension:eA.line.tension,pointRadius:0,pointBackgroun
165dColor:t.point,pointHoverRadius:e=>{return eO(e.dataIndex,r)?0:6},pointBorderWidth:eA.point.borderWidth,pointBorderColor:t.pointBorder,borderColor:t.line,backgroundColor:t.line,pointHoverBackgroundColor:t.point,pointHoverBorderColor:t.pointBorder,pointHoverBorderWidth:eA.point.hoverBorderWidth,pointHitRadius:30}]},options:{animation:eD(),devicePixelRatio:eA.common.devicePixelRatio(),responsive:eA.common.responsive,maintainAspectRatio:false,interaction:{mode:"nearest",intersect:true},plugins:{legend:eA.common.hiddenLegend,tooltip:{enabled:false,position:"nearest",filter:e=>!eO(e.dataIndex,e.dataset.data.length),external:e=>eZ(e,t,"line"),callbacks:{label:e=>{var t=e.parsed.y;if(t===null){return""}return e.datasetIndex===0?n(t):t.toString()},title:()=>""}}},scales:{x:eA.common.hiddenAxis,y:eA.common.hiddenAxis}}}}});var eJ=e=>({$el:null,$refs:{},colors:null,init(){var t;if(!((t=this.$refs)===null||t===void 0?void 0:t.canvas))return;this.setupCanvas();eq(this.$refs.canvas,()=>{this.colors=eU(this.$refs.canvas);eN(this.$refs.canvas,this.createChartConfig(e,this.colors))})},setupCanvas(){this.$refs.canvas.style.maxHeight="".concat(eA.canvas.overviewMaxHeight,"px");this.$refs.canvas.setAttribute("width",eA.canvas.width)},getPointRadius(e,t){return eO(e.dataIndex,t)?0:eA.point.hoverRadius},getPointHoverColor(e,t,r,n){if(eO(e.dataIndex,t)){return"transparent"}var i=e.datasetIndex===0?r.earnings:r.enrolled;return i[n]},createDatasetConfig(e,t,r,n,i){return{label:e,data:t,borderColor:r.line,backgroundColor:e=>{var t=e.chart;var{ctx:n,chartArea:i}=t;if(!i)return r.line;return eB(n,i,r.linearGradient[0],r.linearGradient[1])},borderWidth:eA.line.width,tension:eA.line.tension,fill:true,pointRadius:e=>
165this.getPointRadius(e,i),pointBackgroundColor:"transparent",pointBorderColor:"transparent",pointBorderWidth:eA.point.hoverBorderWidth,pointHoverRadius:eA.point.hoverRadius,pointHoverBackgroundColor:e=>this.getPointHoverColor(e,i,n,"point"),pointHoverBorderColor:e=>this.getPointHoverColor(e,i,n,"pointBorder"),pointHoverBorderWidth:eA.point.hoverBorderWidth}},createChartConfig(e,t){var r,n;var i=(e===null||e===void 0?void 0:(r=e.earnings)===null||r===void 0?void 0:r.length)||(e===null||e===void 0?void 0:(n=e.enrolled)===null||n===void 0?void 0:n.length);var o=e===null||e===void 0?void 0:e.currency;return{type:"line",data:{labels:e.labels,datasets:[this.createDatasetConfig("Earnings",e.earnings,t.earnings,t,i),this.createDatasetConfig("Enrolled",e.enrolled,t.enrolled,t,i)]},options:{animation:eD(),devicePixelRatio:eA.common.devicePixelRatio(),aspectRatio:eA.aspectRatio.overview,interaction:{mode:"nearest",intersect:true},plugins:{legend:eA.common.hiddenLegend,tooltip:{enabled:false,position:"nearest",filter:e=>!eO(e.dataIndex,e.dataset.data.length),external:e=>eZ(e,t,"line"),callbacks:{title:t=>{var r,n,i,o,a,s;return(e===null||e===void 0?void 0:(n=e.earning_date)===null||n===void 0?void 0:n[(r=t[0])===null||r===void 0?void 0:r.dataIndex])||(e===null||e===void 0?void 0:(o=e.enrollment_date)===null||o===void 0?void 0:o[(i=t[0])===null||i===void 0?void 0:i.dataIndex])||((s=e.labels)===null||s===void 0?void 0:s[(a=t[0])===null||a===void 0?void 0:a.dataIndex])},label:e=>{var t=e.parsed.y;if(t===null){return""}return e.datasetIndex===0?e1(o,t):t.toString()}}}},scales:{x:{display:true,grid:{display:true,tickWidth:0,color:e=>{var{index:r}=e;var n=e.chart.scales.x.ticks.length;return eO(r,n)?"transparent":t.border}},border:{color:t.border,dash:[3,3]},ticks:{color:t.ticks.color,font:{size:10}}},y:{display:false,grace:"10%",grid:{display:false},border:{display:false}}}}}}});var e0=e=>({$el:null,$refs:{},init(){var t;if(!((t=this.$refs)===null||t===void 0?void 0:t.canvas))return;this.setupCanvas();eq(this.$refs.canvas,()=>{eN(this.$refs.canvas,this.createChartConfig(e))})},setupCanvas(){this.$refs.canvas.style.maxHeight="".concat(eA.canvas.completionMaxHeight,"px");this.$refs.canvas.setAttribute("width",eA.canvas.width)},createChartConfig(e){var t=eH(this.$refs.canvas);var r=[e.enrolled.value,e.completed.value,e.in_progress.value,e.inactive.value,e.cancelled.value];var n=eL(r,eA.completionSegment.minWidth,this.$refs.canvas);var i=[t.enrolled,t.completed,t.in_progress,t.inactive,t.cancelled];var o=["enrolled","completed","in_progress","inactive","cancelled"];var a=n.reduce((e,t,r)=>t>0?r:e,-1);var l=n.findIndex(e=>e>0);return{type:"bar",data:{labels:[""],datasets:n.map((e,t)=>({data:[e],backgroundColor:i[t],barThickness:eA.bar.thickness,borderRadius:{bottomLeft:t===(l>-1?l:0)?eA.bar.borderRadius:0,topLeft:t===(l>-1?l:0)?eA.bar.borderRadius:0,bottomRight:t===(a>-1?a:n.length-1)?eA.bar.borderRadius:0,topRight:t===(a>-1?a:n.length-1)?eA.bar.borderRadius:0},borderSkipped:false,borderWidth:{right:t===(a>-1?a:n.length-1)?0:eA.bar.borderWidth},borderColor:ex(this.$refs.canvas,"--tutor-surface-l1")}))},options:{animation:ek(),indexAxis:"y",responsive:eA.common.responsive,maintainAspectRatio:false,devicePixelRatio:eA.common.devicePixelRatio(),plugins:{legend:eA.common.hiddenLegend,tooltip:{enabled:false,position:"nearest",external:e=>eZ(e,t,"bar"),callbacks:{title:t=>{var r;var n=t[0];return((r=e[o[n.datasetIndex]])===null||r===void 0?void 0:r.label)||""},label:e=>{var t;var n=(t=r[e.datasetIndex])!==null&&t!==void 0?t:0;return"".concat(n)}}}},scales:{x:s({stacked:true,max:n.reduce((e,t)=>e+t,0)},eA.common.hiddenAxis),y:s({stacked:true},eA.common.hiddenAxis)}}}}});var e1=(e,t)=>{var r,n,i,o,a;return window.TutorCore.currency.createPriceFormatter({symbol:(r=e===null||e===void 0?void 0:e.symbol)!==null&&r!==void 0?r:"$",position:(n=e===null||e===void 0?void 0:e.position)!==null&&n!==void 0?n:"left",thousandSeparator:(i=e===null||e===void 0?void 0:e.thousand_separator)!==null&&i!==void 0?i:",",decimalSeparator:(o=e===null||e===void 0?void 0:e.decimal_separator)!==null&&o!==void 0?o:".",fraction_digits:Number((a=e===null||e===void 0?void 0:e.no_of_decimal)!==null&&a!==void 0?a:2)})(t)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/instructor/sort-sections.ts
166var e2=()=>o(function*(){var[e,t,n]=yield Promise.all([r.e(/* import() | tutor-dnd-kit */"4").then(r.bind(r,8679)),r.e(/* import() | tutor-dnd-kit */"4").then(r.bind(r,92945)),r.e(/* import() | tutor-dnd-kit */"4").then(r.bind(r,99375))]);return{DragDropManager:e.DragDropManager,KeyboardSensor:e.KeyboardSensor,PointerSensor:e.PointerSensor,RestrictToElement:t.RestrictToElement,S
166ortable:n.Sortable}})();var e5=e=>{var{toast:t,endpoints:r}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;return{_sortables:[],_sortableSections:[],initialized:false,sectionsIds:e,$el:null,init(){if(!this.initialized){this.setupDrag();this.initialized=true}},setupDrag(){return o(function*(){var e=this.$el;if(!e){return}var{DragDropManager:i,KeyboardSensor:a,PointerSensor:s,RestrictToElement:l,Sortable:d}=yield e2();if(!this.initialized){return}var c=new i({sensors:[s,a]});var v=Array.from(e.querySelectorAll(".tutor-popover-menu-item"));this._sortables=[];this._sortableSections=[];for(var[h,f]of v.entries()){var m=f.querySelector("[data-grab]");var p;var _=(p=f.dataset.id)!==null&&p!==void 0?p:String(h);var g=new d({id:_,index:h,element:f,handle:m!==null&&m!==void 0?m:undefined,modifiers:[l.configure({element:this.$el})]},c);this._sortables.push(g)}c.monitor.addEventListener("dragstart",e=>{var t=e.operation;if(!t.source){return}var r=t.source.element;if(!r){return}});c.monitor.addEventListener("dragend",e=>o(function*(){var i=e.operation;if(!i.source){return}var o=i.source.element;if(!o){return}var a=this.getOrder();try{n(r.SAVE_INSTRUCTOR_HOME_SECTIONS_ORDER,{order:a}).then(e=>{if(!e.success){t.error((e===null||e===void 0?void 0:e.data)||(0,u.__)("Failed to save instructor home section order.","tutor"));return}})}catch(e){var s=e instanceof Error?e.message:(0,u.__)("Unknown error occurred.","tutor");t.error(s);return}if("startViewTransition"in document){setTimeout(()=>{document.startViewTransition(()=>this.updateDom())},260)}else{this.updateDom()}}).call(this))}).call(this)},handleCheckboxClick(){return o(function*(){var e=Array.from(document.querySelectorAll('input[type="checkbox"]')).reduce((e,t)=>{e[t.name]=t.checked;return e},{});try{n(r.SAVE_INSTRUCTOR_HOME_SECTIONS_VISIBILITY,{items:e}).then(e=>{if(!e.success){t.error((e===null||e===void 0?void 0:e.data)||(0,u.__)("Failed to save instructor home section visibility.","tutor"));return}})}catch(e){var i=e instanceof Error?e.message:(0,u.__)("Unknown error occurred.","tutor");t.error(i);return}})()},updateDom(){var e;var t=this.getOrder();var r=this.getSortableSections();var n=Object.keys(r)[0];var i=n?(e=r[n])===null||e===void 0?void 0:e.parentElement:null;if(!i){return}var o=Array.from(new Set(Array.from(i.children).filter(e=>e instanceof HTMLElement&&e.hasAttribute("data-section-id")).map(e=>e.dataset.sectionId).filter(e=>e!==undefined)));if(t.length===o.length&&t.every((e,t)=>e===o[t])){return}for(var a of t){var s=r[a];if(s){i.appendChild(s)}}},getOrder(){var e=this.$el;if(!e){return[]}var t=Array.from(e.querySelectorAll(".tutor-popover-menu-item")).map(e=>e.dataset.id).filter(e=>e!==undefined);return Array.from(new Set(t))},getSortableSections(){var e=document.querySelector("[data-section-id]");var t=e===null||e===void 0?void 0:e.parentElement;if(!t){return{}}var r=Array.from(t.children).filter(e=>e instanceof HTMLElement&&e.hasAttribute("data-section-id"));return r.reduce((e,t)=>{var r=t.dataset.sectionId;if(r){e[r]=t}return e},{})},destroy(){for(var e of this._sortables){e.destroy()}this._sortables=[];this.initialized=false}}};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/instructor/home.ts
167var e3={name:"sortableSections",component:e5};var e6={name:"statCard",component:eK};var e8={name:"overviewChart",component:eJ};var e4={name:"courseCompletionChart",component:e0};var e7=()=>{window.TutorComponentRegistry.registerAll({components:[e4,e8,e3,e6]});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/my-courses.ts
168/**
169 * My Courses Page Component
170 * Handles course deletion and creation using HTTP and Query services
171 */var e9=()=>{var{query:e,toast:t,modal:r}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;return{query:e,createMutation:null,deleteMutation:null,init(){// Setup create mutation
172this.createMutation=this.query.useMutation(this.createCourse,{onSuccess:e=>{if(e.status_code===201&&e.data){window.location.href=e.data}},onError:e=>{t.error(e.message||"Failed to create course")}});// Setup delete mutation
173this.deleteMutation=this.query.useMutation(this.deleteCourse,{onSuccess:()=>{r.closeModal("tutor-course-delete-modal");window.location.reload()},onError:e=>{t.error(e.message||"Failed to delete course")}})},createCourse(e){return n("tutor_create_new_draft_course",e)},deleteCourse(e){return n("tutor_delete_dashboard_course",{course_id:e})},handleCreateCourse(){return o(function*(){var e;yield(e=this.createMutation)===null||e===void 0?void 0:e.mutate({from_dashboard:true})}).call(this)},handleDeleteCourse(e){return o(function*(){var t;yield(t=this.deleteMutation)===null||t===void 0?void 0:t.mutate(e)}
173).call(this)}}};var te=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"myCourses",component:e9}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/components/quiz/retry-attempt.ts
174var tt=()=>{var{query:e,toast:t,endpoints:r}=window.TutorCore;var{wpPostForm:n}=window.TutorCore.api;var{convertToErrorMessage:i}=window.TutorCore.error;return{retryMutation:null,init(){this.retryMutation=e.useMutation(this.retryAttempt,{onSuccess:(e,t)=>{window.location.href=t.redirectURL},onError:e=>{t.error(i(e))}})},retryAttempt(e){return n(e.redirectURL,{tutor_action:r.START_QUIZ,quiz_id:e.quizID})}}};var tr={name:"quizRetryAttempt",component:tt};// CONCATENATED MODULE: ./assets/src/js/frontend/components/quiz/summary-sidebar.ts
175var tn="question-";var ti=".tutor-quiz-summary-header";var to='[data-question-id="%s"]';var ta='[data-question-id="'.concat(tn,'%s"]');var ts='[data-question-id="%s"]';var tl=new RegExp("^#".concat(tn,"(\\d+)$"));var td=16;var tu=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t;return{activeQuestionId:String((t=e.firstQuestionId)!==null&&t!==void 0?t:""),$el:null,init(){var e=this.getQuestionIdFromHash(window.location.hash);if(e&&this.hasQuestionItem(e)){this.activeQuestionId=e}},getQuestionIdFromHash(e){var t=e.match(tl);return t?t[1]:null},hasQuestionItem(e){if(!e||!this.$el){return false}return!!this.$el.querySelector(ts.replace("%s",e))},setActiveQuestion(e){var t=String(e||"");if(!t){return}this.activeQuestionId=t;history.replaceState(null,"","#".concat(tn).concat(t));this.scrollToQuestionAnswer(t)},scrollToQuestionAnswer(e){var t=String(e||"");if(!t){return}var r=document.getElementById("".concat(tn).concat(t))||document.querySelector(ta.replace("%s",t))||document.querySelector(to.replace("%s",t));if(r instanceof HTMLElement){var n=document.querySelector(ti);var i=n instanceof HTMLElement?n.getBoundingClientRect().top+n.offsetHeight:0;var o=r.getBoundingClientRect().top+window.scrollY-i-td;window.scrollTo({top:Math.max(0,o),behavior:"smooth"})}}}};var tc={name:"quizSummarySidebar",component:tu};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/quiz-attempt-feedback.ts
176var tv=["correct","incorrect"];var th="review_statuses";var tf="manual_marks";var tm="question_feedback";var tp=e=>{var{attemptId:t,formId:r}=e;var{query:n,toast:i,endpoints:a,form:l}=window.TutorCore;var{wpPost:d}=window.TutorCore.api;var{convertToErrorMessage:c}=window.TutorCore.error;var v=new RegExp("^".concat(th,"\\[[^\\]]+\\]$"));var h=new RegExp("^".concat(tf,"\\[[^\\]]+\\]$"));var f=new RegExp("^".concat(tm,"\\[[^\\]]+\\]$"));var m=false;var p=e=>{return Object.entries(e).reduce((e,t)=>{var[r,n]=t;if(!v.test(r)){return e}if(typeof n!=="string"||!tv.includes(n)){return e}var i=r;var o=i.slice("".concat(th,"[").length,-1);var a=n;e[o]=a;return e},{})};var _=e=>{return Object.entries(e).reduce((e,t)=>{var[r,n]=t;var i="".concat(th,"[").concat(r,"]");e[i]=n;return e},{})};var g=e=>{return Object.entries(e).reduce((e,t)=>{var[r,n]=t;if(!h.test(r))return e;if(n===""||n===null||n===undefined)return e;if(typeof n==="string"&&n.trim()==="")return e;var i=Number(n);if(Number.isNaN(i))return e;var o=r.slice("".concat(tf,"[").length,-1);e[o]=i;return e},{})};var w=e=>{return Object.entries(e).reduce((e,t)=>{var[r,n]=t;e["".concat(tf,"[").concat(r,"]")]=n;return e},{})};var y=e=>{return Object.entries(e).reduce((e,t)=>{var[r,n]=t;if(!f.test(r))return e;var i=r.slice("".concat(tm,"[").length,-1);e[i]=typeof n==="string"?n:String(n!==null&&n!==void 0?n:"");return e},{})};var b=e=>{return Object.entries(e).reduce((e,t)=>{var[r,n]=t;e["".concat(tm,"[").concat(r,"]")]=n;return e},{})};return{formId:r,attemptId:t,feedbackMutation:null,_destroy:()=>{},init(){this.feedbackMutation=n.useMutation(this.saveFeedback,{onSuccess:()=>{i.success((0,u.__)("Quiz feedback updated successfully.","tutor"));m=true;window.location.reload()},onError:e=>{i.error(c(e))}});if(this.formId){document.dispatchEvent(new CustomEvent(M.FORM_REGISTER,{detail:{id:this.formId,instance:this}}))}var e=e=>{if(m){return false}if(l.hasForm(r)&&l.getFormState(r).isDirty){e.preventDefault()}};window.addEventListener("beforeunload",e);this._destroy=()=>{m=true;window.removeEventListener("beforeunload",e)}},destroy(){var e,t;(e=(t=this)._destroy)===null||e===void 0?void 0:e.call(t)},saveFeedback(e){return o(function*(){var t=true;var n=true;var i=true;var o=true;if(l.hasForm(r)){var s=l.getFormState(r);var c=s.dirtyFields;t=!!(c===null||c===void 0?void 0:c.feedback);n=Object.keys(c!==null&&c!==void 0?c:{}).some(e=>e.startsWith("".concat(th,"["))&&c[e]);i=Object.keys(c!==null&&c!==void 0?c:{}).some(e=>e.startsWith("".concat(tf,"["))&&c[e]);o=Object.keys(c!==null&&c!==void 0?c:{}).some(e=>e.startsWith("".concat(tm,"["))&&c[e])}var v=t||n||i||o;if(!v){throw new Error((0,u.__)("No changes to update","tutor"))}var h={attempt_id:e.attempt_id};if(n){Object.assign(h,_(e.review_statuses))}if(i){Object.assign(h,w(e.manual_marks))}if(o){Object.assign(h,b(e.question_feedback))}if(t){h.feedback=e.feedback}// Single request so the graded email is sent once per Submit click.
177return d(a.REVIEW_QUIZ_ANSWERS,h)})()},handleSaveFeedback(e){return o(function*(){var t;var r=s({},e);var n=document.getElementById(this.formId);if(n){var i=new FormData(n);
177i.forEach((e,t)=>{if(!(t in r)||!r[t]){r[t]=e}})}var o;yield(t=this.feedbackMutation)===null||t===void 0?void 0:t.mutate({attempt_id:this.attemptId,feedback:String((o=e.feedback)!==null&&o!==void 0?o:""),review_statuses:p(r),manual_marks:g(r),question_feedback:y(r)})}).call(this)}}};var t_={name:"quizAttemptFeedback",component:tp};var tg=function(){var{initialFeedback:e="",fieldName:t="",formId:r="quiz-attempt-review-form"}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var{form:n}=window.TutorCore;return{expanded:false,feedback:String(e||""),fieldName:String(t||""),formId:String(r||"quiz-attempt-review-form"),toggle(){if(!this.expanded&&n.hasForm(this.formId)){n.setValue(this.formId,this.fieldName,this.feedback)}this.expanded=!this.expanded},save(){if(n.hasForm(this.formId)){var e=n.getValue(this.formId,this.fieldName);this.feedback=typeof e==="string"?e:String(e!==null&&e!==void 0?e:"");n.setValue(this.formId,this.fieldName,this.feedback,{shouldDirty:true})}this.expanded=false},cancel(){if(n.hasForm(this.formId)){n.setValue(this.formId,this.fieldName,this.feedback)}this.expanded=false},del(){this.feedback="";if(n.hasForm(this.formId)){n.setValue(this.formId,this.fieldName,"",{shouldDirty:true})}this.expanded=false}}};var tw={name:"questionFeedback",component:tg};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/quiz-attempts.ts
178// Quiz Attempts Page
179var ty=()=>{var{query:e,modal:t,toast:r}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;var{convertToErrorMessage:i}=window.TutorCore.error;return{query:e,deleteMutation:null,init(){this.deleteMutation=this.query.useMutation(this.deleteAttempt,{onSuccess:()=>{t.closeModal("tutor-quiz-attempt-delete-modal");window.location.reload()},onError:e=>{r.error(i(e))}})},deleteAttempt(e){return n("tutor_attempt_delete",{id:e})},handleDeleteAttempt(e){return o(function*(){var t;yield(t=this.deleteMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)}}};var tb=()=>{window.TutorComponentRegistry.registerAll({components:[{name:"quizAttempts",component:ty},tr,t_,tw,tc]});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/settings.ts
180var tE=()=>{var{query:e,form:t,toast:r,endpoints:n}=window.TutorCore;var{wpPost:i}=window.TutorCore.api;var{convertToErrorMessage:a}=window.TutorCore.error;return{$el:null,uploadProfilePhotoMutation:null,removeProfilePhotoMutation:null,uploadCoverPhotoMutation:null,removeCoverPhotoMutation:null,updateProfileMutation:null,saveSocialProfileMutation:null,saveBillingInfoMutation:null,saveWithdrawMethodMutation:null,resetPasswordMutation:null,handleUpdateNotification:null,savePreferencesMutation:null,resetPreferencesMutation:null,init(){if(!this.$el){return}this.handleUpdateProfile=this.handleUpdateProfile.bind(this);this.handleUploadProfilePhoto=this.handleUploadProfilePhoto.bind(this);this.handleRemoveProfilePhoto=this.handleRemoveProfilePhoto.bind(this);this.handleUploadCoverPhoto=this.handleUploadCoverPhoto.bind(this);this.handleRemoveCoverPhoto=this.handleRemoveCoverPhoto.bind(this);this.handleSaveSocialProfile=this.handleSaveSocialProfile.bind(this);this.handleSaveBillingInfo=this.handleSaveBillingInfo.bind(this);this.handleSaveWithdrawMethod=this.handleSaveWithdrawMethod.bind(this);this.handleResetPassword=this.handleResetPassword.bind(this);this.handleResetPreferences=this.handleResetPreferences.bind(this);this.handleUpdateNotification=e.useMutation(this.updateNotification,{onSuccess:(e,n)=>{t.reset(n===null||n===void 0?void 0:n.formId,n);var i;r.success((i=e===null||e===void 0?void 0:e.message)!==null&&i!==void 0?i:(0,u.__)("Notification settings updated","tutor"))},onError:e=>{r.error(a(e)||(0,u.__)("Failed to update notification settings","tutor"))}});this.uploadProfilePhotoMutation=e.useMutation(this.uploadUserPhoto,{onSuccess:()=>{r.success((0,u.__)("Successfully updated profile photo.","tutor"))},onError:e=>{r.error(a(e))}});this.removeProfilePhotoMutation=e.useMutation(this.removeUserPhoto,{onSuccess:()=>{r.success((0,u.__)("Successfully removed profile photo.","tutor"))},onError:e=>{r.error(a(e))}});this.uploadCoverPhotoMutation=e.useMutation(this.uploadUserPhoto,{onSuccess:()=>{r.success((0,u.__)("Successfully updated cover photo.","tutor"))},onError:e=>{r.error(a(e))}});this.removeCoverPhotoMutation=e.useMutation(this.removeUserPhoto,{onSuccess:()=>{r.success((0,u.__)("Successfully removed cover photo.","tutor"))},onError:e=>{r.error(a(e))}});this.updateProfileMutation=e.useMutation(this.updateProfile,{onSuccess:e=>{var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,u.__)("Successfully updated profile","tutor"))},onError:e=>{r.error(a(e))}});this.saveSocialProfileMutation=e.useMutation(this.saveSocialProfile,{onSuccess:e=>{var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,u.__)("Success successfully saved social profile","tutor"))},onError:e=>{r.error(a(e))}});this.saveBillingInfoMutation=e.useMutation(this.saveBillingInfo,{onSuccess:e=>{var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,u.__)("Success successfully saved billing info","tutor"))},onError:e=>{r.error(a(e))}});this.saveWithdrawMethodMutation=e.useMutation(this.saveWithdrawMethod,{onSuccess:e=>{var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,u.__)("Withdrawal method saved successfully","tutor"))},onError:e=>{r.error(a(e))}});this.resetPasswordMutation=e.useMutation(this.resetPassword,{onSuccess:e=>{if(e===null||e===void 0?void 0:e.success){var t;var n;r.success((n=(t=e.data)===null||t===void 0?void 0:t.message)!==null&&n!==void 0?n:(0,u.__)("Password updated successfully","tutor"))}else{var i;var o;r.error((o=(i=e.data)===null||i===void 0?void 0:i.message)!==null&&o!==void 0?o:(0,u.__)("Password update failed","tutor"))}},onError:e=>{r.error(a(e))}});this.savePreferencesMutation=e.useMutation(this.updatePreferences,{onSuccess:(e,n)=>{var i=Boolean(t.getFormState((n===null||n===void 0?void 0:n.formId)||"").dirtyFields.learning_mood);t.reset((n===null||n===void 0?void 0:n.formId)||"",n);var o;r.success((o=e===null||e===void 0?void 0:e.message)!==null&&o!==void 0?o:(0,u.__)("Preferences saved successfully","tutor"));if(i){window.location.reload()}},onError:e=>{r.error(a(e))}});this.resetPreferencesMutation=e.useMutation(this.resetPreferences,{onSuccess:e=>{var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,u.__)("Preferences reset successfully","tutor"));window.location.reload()},onError:e=>{r.error(a(e))}})},updatePreferences(e){return o(function*(){return i(n.UPDATE_USER_PREFERENCES,e)})()},resetPreferences(e){return o(function*(){return i(n.RESET_USER_PREFERENCES,e)})()},handleResetPreferences(e,t){var r;(r=this.resetPreferencesMutation)===null||r===void 0?void 0:r.mutate({formId:e,modalId:t})},updateNotification(e){return o(function*(){var t=Object.keys(e).reduce((t,r)=>{var n=e[r];if(typeof n!=="boolean"){t["".concat(r)]=n;return t}var i="";// disable_all=true means turning everything OFF
181if(r==="disable_all"){i=n?"off":"on"}else{i=n?"on":"off"}if(!r.includes("__")){t["tutor_notification_preference[".concat(r,"]")]=i;return t}var[o,a]=r.split("__");if(!o&&!a){return t}t["tutor_notification_preference[email][".concat(o,"][").concat(a,"]")]=i;return t},{});return i(n.UPDATE_PROFILE_NOTIFICATION,t)})()},uploadUserPhoto(e){return o(function*(){var t=yield i(n.UPLOAD_PROFILE_PHOTO,e);if((t===null||t===void 0?void 0:t.status)!=="success"){throw new Error((0,u.__)("Image upload failed. Please try again.","tutor"))}return t})()},handleUploadProfilePhoto(e){return o(function*(){var t;if(e.length===0){return}var r={photo_file:e[0],photo_type:"profile_photo"};yield(t=this.uploadProfilePhotoMutation)===null||t===void 0?void 0:t.mutate(r)}
181).call(this)},handleUploadCoverPhoto(e){return o(function*(){var t;if(e.length===0){return}var r={photo_file:e[0],photo_type:"cover_photo"};yield(t=this.uploadCoverPhotoMutation)===null||t===void 0?void 0:t.mutate(r)}).call(this)},removeUserPhoto(e){return o(function*(){return i(n.REMOVE_PROFILE_PHOTO,e)})()},handleRemoveProfilePhoto(){return o(function*(){var e;yield(e=this.removeProfilePhotoMutation)===null||e===void 0?void 0:e.mutate({photo_type:"profile_photo"})}).call(this)},handleRemoveCoverPhoto(){return o(function*(){var e;yield(e=this.removeCoverPhotoMutation)===null||e===void 0?void 0:e.mutate({photo_type:"cover_photo"})}).call(this)},updateProfile(e){return o(function*(){return i(n.UPDATE_PROFILE,e)})()},handleUpdateProfile(e,r){return o(function*(){var n,i;var o=d(s({},e),{tutor_pro_custom_signature_id:((n=e.tutor_pro_custom_signature_id)===null||n===void 0?void 0:n.id)||""});yield(i=this.updateProfileMutation)===null||i===void 0?void 0:i.mutate(o);t.reset(r,e)}).call(this)},saveSocialProfile(e){return o(function*(){return i(n.SAVE_SOCIAL_PROFILE,e)})()},handleSaveSocialProfile(e,r){return o(function*(){var n;yield(n=this.saveSocialProfileMutation)===null||n===void 0?void 0:n.mutate(e);t.reset(r,e)}).call(this)},saveBillingInfo(e){return o(function*(){return i(n.SAVE_BILLING_INFO,e)})()},handleSaveBillingInfo(e,r){return o(function*(){var n;yield(n=this.saveBillingInfoMutation)===null||n===void 0?void 0:n.mutate(e);if(t.hasForm(r)){t.reset(r,e)}}).call(this)},saveWithdrawMethod(e){return o(function*(){return i(n.SAVE_WITHDRAW_METHOD,e)})()},handleSaveWithdrawMethod(e,r){return o(function*(){var n;var i=e.withdraw_method;var o={tutor_selected_withdraw_method:i};Object.keys(e).forEach(t=>{if(t.startsWith(i+"_")){var r=t.replace(i+"_","");o["withdraw_method_field[".concat(i,"][").concat(r,"]")]=e[t]||""}});yield(n=this.saveWithdrawMethodMutation)===null||n===void 0?void 0:n.mutate(o);t.reset(r,e)}).call(this)},resetPassword(e){return o(function*(){return i(n.RESET_PASSWORD,e)})()},handleResetPassword(e,n){return o(function*(){var i;if(e.new_password!==e.confirm_new_password){r.error((0,u.__)("Passwords do not match","tutor"));return}yield(i=this.resetPasswordMutation)===null||i===void 0?void 0:i.mutate(e);t.reset(n,e);window.location.reload()}).call(this)}}};var tC={name:"settings",component:tE};var tM=()=>{window.TutorComponentRegistry.register({type:"component",meta:tC});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/pages/withdrawals.ts
182var tT=()=>{var{query:e,form:t,toast:r,endpoints:n}=window.TutorCore;var{wpPost:i}=window.TutorCore.api;var{convertToErrorMessage:a}=window.TutorCore.error;return{query:e,form:t,toast:r,$el:null,withdrawalRequestMutation:null,handleWithdrawalFormSubmit(e,t){return o(function*(){var r;var n={amount:e.amount};yield(r=this.withdrawalRequestMutation)===null||r===void 0?void 0:r.mutate(n);this.form.reset(t)}).call(this)},init(){if(!this.$el){return}this.handleWithdrawalFormSubmit=this.handleWithdrawalFormSubmit.bind(this);this.withdrawalRequestMutation=this.query.useMutation(e=>i(n.MAKE_AN_WITHDRAW,e),{onSuccess:e=>{var t;this.toast.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,u.__)("Withdrawal request submitted successfully","tutor"));window.location.reload()},onError:e=>{this.toast.error(a(e))}})}}};var tS={name:"withdrawals",component:tT};var tR=()=>{window.TutorComponentRegistry.register({type:"component",meta:tS});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};// CONCATENATED MODULE: ./assets/src/js/frontend/dashboard/index.ts
183// Dashboard Entry Point
184// Initializes dashboard functionality based on current page
185/**
186 * Get current dashboard page from URL
187 *
188 * @since 4.0.0
189 */var tA=()=>{var e=window.location.pathname;var t=new URLSearchParams(window.location.search);// Check for subpage parameter - if not 'dashboard', return early
190var r=t.get("page")?t.get("subpage"):"";if(r&&r!=="dashboard"){return"";// Not on dashboard, will be handled by early return in initializeDashboard
191}// Check for dashboard-page parameter (highest priority when subpage=dashboard)
192var n=t.get("dashboard-page");if(n){return n}// Check for legacy query parameters
193var i=t.get("subpage");if(i){return i}// Check URL path patterns
194if(e.includes("/my-courses")||e.includes("my-courses")){return"my-courses"}if(e.includes("/announcements")){return"announcements"}if(e.includes("/quiz-attempts")||e.includes("/my-quiz-attempts")){return"quiz-attempts"}if(e.includes("/discussions")){return"discussions"}if(e.includes("/reviews")){return"reviews"}if(e.includes("/account/withdrawals")){return"withdrawals"}if(e.includes("/account/billing")){return"billing"}if(e.includes("/settings")){return"settings"}// Default to home when subpage=dashboard
195return"home"};var tP=()=>{j();eu();L();R();eh();var e=tA();// Initialize page-specific functionality
196switch(e){case"home":case"dashboard":el();e7();break;case"my-courses":te();break;case"announcements":em();break;case"quiz-attempts":tb();break;
196case"discussions":eT();break;case"reviews":_();break;case"withdrawals":tR();break;case"billing":eg();break;case"settings":tM();break;default:// eslint-disable-next-line no-console
197console.warn("Unknown dashboard page:",e)}};// Initialize when Alpine is ready
198if(document.readyState==="loading"){document.addEventListener("alpine:init",tP)}else{tP()}})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.