jQuery(document).ready(function($){class TrainingGuide{constructor(){this.container=$('#nhrx-training-app');this.sections=[];this.currentSection=0;this.userProgress={};this.init()}async init(){await this.loadUserProgress();this.renderApp();this.bindEvents()}async loadUserProgress(){try{const response=await $.ajax({url:nhrxTraining.restUrl+'/progress',method:'GET',beforeSend:function(xhr){xhr.setRequestHeader('X-WP-Nonce',nhrxTraining.nonce)}});this.userProgress=response.reduce((acc,item)=>{acc[item.section_id]={completed:item.completed===1,quizScore:item.quiz_score};return acc},{})}catch(error){console.error('Error loading progress:',error)}}async updateProgress(sectionId,quizScore){try{await $.ajax({url:nhrxTraining.restUrl+'/progress',method:'POST',beforeSend:function(xhr){xhr.setRequestHeader('X-WP-Nonce',nhrxTraining.nonce)},data:{section_id:sectionId,quiz_score:quizScore}});this.userProgress[sectionId]={completed:true,quizScore:quizScore};this.renderApp()}catch(error){console.error('Error updating progress:',error)}}renderApp(){}bindEvents(){}}new TrainingGuide()});