"use strict";function tutor(t){const o=(t,o)=>{const n=e().post_id;let r={action:"sync_video_playback",currentTime:t.currentTime,duration:t.duration,post_id:n};r[_tutorobject.nonce_key]=_tutorobject[_tutorobject.nonce_key];let c=r;o&&(c=Object.assign(r,o)),jQuery.post(_tutorobject?.ajaxurl,c)},e=()=>{const t=jQuery("#tutor_video_tracking_information").val();return t?JSON.parse(t):{}};let n=0;t.on("timeupdate",t=>{const e=t.detail.plyr;n/4>=30&&(o(e),n=0),n++}),t.on("ended",t=>{const n=e(),r=t.detail.plyr;o(r,{is_ended:!0}),n.autoload_next_course_content&&(()=>{if(!_tutorobject.nonce_key||!_tutorobject?.ajaxurl)return;let t={action:"autoload_next_course_content",post_id:e().post_id};t[_tutorobject.nonce_key]=_tutorobject[_tutorobject.nonce_key],jQuery.post(_tutorobject?.ajaxurl,t).done(function(t){t?.success&&t?.data?.next_url&&(location.href=t.data.next_url)})})()})}exports.default=tutor;