"use strict";const prestoPlayer_entry=require("./presto-player-dfd75b76.js");require("./index-1d07a497.js"),require("./util-efe303f1.js"),require("./cache-cues-c3bfad40.js");const learndash=e=>{if("undefined"!=typeof learndash_video_data&&"presto"===learndash_video_data?.videos_found_provider){if(prestoPlayer_entry.resumeProgress(e,!0),window.learndash_video_data.videos_auto_complete="on"===prestoPlayer?.learndash?.lesson_video_auto_complete,window.learndash_video_data.videos_hide_complete_button="AFTER"===learndash_video_data?.videos_shown&&"on"===prestoPlayer?.learndash?.lesson_video_hide_complete_button,window.learndash_video_data.videos_auto_complete_delay=prestoPlayer?.learndash?.lesson_video_auto_complete_delay,window.learndash_video_data.videos_auto_complete_delay_message=prestoPlayer?.learndash?.videos_auto_complete_delay_message,window.learndash_video_data.video_track_path="/","BEFORE"===learndash_video_data?.videos_shown)return learndash_video_data.videos_auto_complete=!1,jQuery(document).trigger("learndash_video_disable_assets",[!0]),void jQuery((function(){"1"===learndash_video_data.video_debug&&console.log("PRESTO: init"),document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="'+learndash_video_data.videos_found_provider+'"]').length&&("1"===learndash_video_data.video_debug&&console.log("PRESTO: calling LearnDash_disable_assets(true)"),LearnDash_disable_assets(!0),LearnDash_watchPlayers(),document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="'+learndash_video_data.videos_found_provider+'"]').forEach((function(e,a){var d="presto-player__wrapper-player-"+a,o=e.getAttribute("id");void 0!==o&&""!=o||(o=d,e.setAttribute("id",o)),ld_video_players[d]={},ld_video_players[d].player_key=d,ld_video_players[d].player_type=learndash_video_data.videos_found_provider,ld_video_players[d].player_id=o,ld_video_players[d].player_wrapper=e.closest("presto-player"),void 0!==ld_video_players[d].player_wrapper?ld_video_players[d].player_cookie_key=ld_video_players[d].player_wrapper.getAttribute("data-video-cookie-key"):ld_video_players[d].player_cookie_key="",ld_video_players[d].player_cookie_values=LearnDash_Video_Progress_initSettings(ld_video_players[d]),"complete"===LearnDash_Video_Progress_getSetting(ld_video_players[d],"video_state")?(LearnDash_disable_assets(!1),LearnDash_watchPlayersEnd()):(wp.hooks.addAction("presto.playerTimeUpdate","presto-player",(e=>{"1"===learndash_video_data.video_debug&&console.log("PRESTO: Video is playing"),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_duration",e.duration),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_time",e.currentTime),e.duration&&e.duration===e.currentTime&&(LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_state","complete"),"1"===learndash_video_data.video_debug&&console.log("PRESTO: calling LearnDash_disable_assets(false)"),LearnDash_disable_assets(!1),LearnDash_watchPlayersEnd())})),wp.hooks.addAction("presto.playerPlaying","presto-player",(e=>{"1"===learndash_video_data.video_debug&&console.log("PRESTO: Video is playing"),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_duration",e.duration),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_time",e.currentTime),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_state","play")})),wp.hooks.addAction("presto.playerPause","presto-player",(e=>{"1"===learndash_video_data.video_debug&&console.log("PRESTO: Video is paused"),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_time",e.currentTime),console.log(e.duration),console.log(e.currentTime),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_state","pause")})),wp.hooks.addAction("presto.playerEnded","presto-player",(e=>{"1"===learndash_video_data.video_debug&&console.log("PRESTO: video ended"),"1"===learndash_video_data.video_debug&&console.log("PRESTO: setting 'video_state' to 'complete'"),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_time",e.currentTime),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_state","complete"),"1"===learndash_video_data.video_debug&&console.log("PRESTO: calling LearnDash_disable_assets(false)"),LearnDash_disable_assets(!1),LearnDash_watchPlayersEnd()})))})))}));window.LearnDash_disable_assets(!0),wp.hooks.addAction("presto.playerEnded","presto-player",(()=>{window.LearnDash_disable_assets(!1)}))}};exports.default=learndash;