diff --git a/notemyprogress/ajax.php b/notemyprogress/ajax.php index 6f2be358bfa312a5962bd5cfafa12c112f7313af..4b96853cd9c800460ed84264fe0b2815334216c6 100644 --- a/notemyprogress/ajax.php +++ b/notemyprogress/ajax.php @@ -30,8 +30,9 @@ require_once(dirname(__FILE__) . '/locallib.php'); global $USER, $COURSE, $DB; -$userid = required_param('userid', PARAM_INT); + $courseid = required_param('courseid', PARAM_INT); +$userid = required_param('userid', PARAM_INT); $COURSE = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST); $USER = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST); @@ -39,8 +40,8 @@ $USER = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST); require_login($COURSE, false); $context = context_course::instance($courseid); require_capability('local/notemyprogress:ajax', $context); - -$beginDate = optional_param('beginDate', false, PARAM_TEXT); +/* Start the déclaration of all the optional parrameters */ +$beginDate = optional_param('beginDate', false, PARAM_TEXT); //optional_param('keyValue','DefaultValue','Type value'); $lastDate = optional_param('lastDate', false, PARAM_TEXT); $sectionname = optional_param('sectionname', false, PARAM_TEXT); @@ -83,20 +84,29 @@ $modulename = optional_param('modulename', false, PARAM_TEXT); $newinstance = optional_param('newinstance', false, PARAM_BOOL); +//gamification parameters +$rules = optional_param('rules', false ,PARAM_TEXT); +$levels = optional_param('levels', false ,PARAM_TEXT); +$settings= optional_param('settings', false ,PARAM_TEXT); +$url= optional_param('url', false ,PARAM_TEXT); +//$courseid = optional_param('modulename', false ,PARAM_TEXT); +$enable = optional_param('enable', false ,PARAM_BOOL); +$section = optional_param('section',false,PARAM_TEXT); -$params = array(); -$func = null; +/* */ -//debug_text::print("Enter ajax file"); +$params = array(); // Array containing the data +$func = null; // fuction which will be call at line 193 -if ($action == 'saveconfigweek') { +if($action == 'saveconfigweek') {//Exemple: if the action passed is saveconfigweek then my array contain (weeks,courseid,userid,newinstance) array_push($params, $weeks); array_push($params, $courseid); array_push($params, $userid); array_push($params, $newinstance); - if ($weeks && $courseid && $userid) { - $func = "local_notemyprogress_save_weeks_config"; + if($weeks && $courseid && $userid){ + + $func = "local_notemyprogress_save_weeks_config"; //this function must be contained in localib.php } } elseif ($action == 'changegroup') { array_push($params, $courseid); @@ -170,6 +180,7 @@ if ($action == 'saveconfigweek') { array_push($params, $goalscommitted); array_push($params, $hourscommitted); array_push($params, $courseid); + array_push($params, $url); if (isset($userid , $weekcode , $dayscommitted , $goalscommitted , $hourscommitted , $courseid)) { $func = "local_sr_save_metareflexion"; } @@ -181,11 +192,11 @@ if ($action == 'saveconfigweek') { array_push($params, $goalscommitted); array_push($params, $hourscommitted); array_push($params, $courseid); + array_push($params, $url); if (isset($userid, $weekcode, $idmetareflexion, $dayscommitted, $goalscommitted, $hourscommitted, $courseid)) { $func = "local_sr_update_metareflexion"; } } elseif ($action == 'savelastweek') { - //debug_text::print("savelastweek"); array_push($params, $courseid); array_push($params, $userid); array_push($params, $weekcode); @@ -199,7 +210,6 @@ if ($action == 'saveconfigweek') { $func = "local_sr_save_lastweek"; } } elseif ($action == 'updatelastweek') { - //debug_text::print("updatelastweek"); array_push($params, $courseid); array_push($params, $userid); array_push($params, $lastweekid); @@ -214,7 +224,6 @@ if ($action == 'saveconfigweek') { $func = "local_sr_update_lastweek"; } } elseif ($action == 'metareflexionrepotgetweek') { - //debug_text::print("Enter metareflexionrepotgetweek"); array_push($params, $weekcode); array_push($params, $courseid); array_push($params, $userid); @@ -256,13 +265,47 @@ if ($action == 'saveconfigweek') { if ($courseid && $userid && $sectionname && $actiontype && $objectType && $objectName && $objectDescription && $currentUrl) { $func = "local_notemyprogress_addLogs"; } -} +}elseif($action =='savegamification'){ + array_push($params, $courseid); + array_push($params, $userid); + array_push($params, $rules); + array_push($params, $levels); + array_push($params, $settings); + array_push($params, $url); + array_push($params, $section); + if($courseid && $userid && $rules && $levels && $settings && $url) { + $func = "local_notemyprogress_save_gamification_config"; + } +}elseif($action =='rankable'){ + array_push($params, $courseid); + array_push($params, $userid); + array_push($params, $url); + if($courseid && $userid) { + $func = "local_notemyprogress_set_rankable_player"; + } +}elseif($action =='saveEnable'){ + array_push($params, $courseid); + array_push($params, $userid); + array_push($params,$enable); + array_push($params,$url); + if($courseid && $userid) { + $func = "local_notemyprogress_save_enable"; + } +}elseif($action =='studentGamificationViewed'){ + array_push($params, $courseid); + array_push($params, $userid); + array_push($params,$url); + if($courseid && $userid) { + $func = "local_notemyprogress_viewed_student_lvl"; + } +} if (isset($params) && isset($func)) { call_user_func_array($func, $params); -} else { + +}else{ $message = get_string('api_invalid_data', 'local_notemyprogress'); - local_notemyprogress_ajax_response(array($message), 400); + local_notemyprogress_ajax_response(array($message));//,$action,$courseid, $userid ,$rules , $levels, $settings, $url,$func), 442); } function local_sr_metareflexion_get_week($weekcode, $courseid, $userid, $profile) @@ -278,14 +321,11 @@ function local_sr_metareflexion_get_week($weekcode, $courseid, $userid, $profile $interactions_days = $reports->days_report_metereflexion($weekcode); $interactions_hours = $reports->hours_report_metereflexion($weekcode); $interactions_questions = $reports->questions_report_metereflexion($weekcode); - //debug_text::print("interactions_hours", $interactions_hours); $status_planning = $reports->status_planning($weekcode); - // //debug_text::print("status_planning", $status_planning); //$response = array("interactions_days" => $interactions_days, "interactions_hours" => $interactions_hours, "status_planning" => $status_planning); $response = array("interactions_hours" => $interactions_hours,"interactions_days" => $interactions_days,"interactions_goals" => $interactions_goals,"interactions_questions" => $interactions_questions, "status_planning" => $status_planning); //if($profile == 'student'){ $course_interaction = $teacher->hours_report_metereflexion($weekcode); - //debug_text::print("course_interaction", $course_interaction); $response['course_report_hours'] = $course_interaction; //} $response['students_planification'] = $reports->students_planification_summary($weekcode); @@ -293,23 +333,25 @@ function local_sr_metareflexion_get_week($weekcode, $courseid, $userid, $profile } -function local_sr_save_metareflexion($userid, $weekcode, $dayscommitted, $goalscommitted, $hourscommitted, $courseid) +function local_sr_save_metareflexion($userid, $weekcode, $dayscommitted, $goalscommitted, $hourscommitted, $courseid,$url) { + $logs = new \local_notemyprogress\logs($courseid, $userid); + $logs->addLogsNMP("Saved", "Meta_Reflection", "LOGFILES", "nmp", $currentUrl, "MetaReflectionSaved"); $metareflexion = new \local_notemyprogress\metareflexion($courseid, $userid); $metareflexion->weekcode = $weekcode; $metareflexion->days = $dayscommitted; $metareflexion->goals_committed = $goalscommitted; - //debug_text::print("goalscommitted in ajax",$goalscommitted); $metareflexion->hours = $hourscommitted; $metareflexionid = $metareflexion->save_metareflexion(); local_notemyprogress_ajax_response(array('responsemetareflexion' => $metareflexionid)); } -function local_sr_update_metareflexion($userid, $weekcode, $idmetareflexion, $dayscommitted, $goalscommitted, $hourscommitted, $courseid) +function local_sr_update_metareflexion($userid, $weekcode, $idmetareflexion, $dayscommitted, $goalscommitted, $hourscommitted, $courseid,$url) { - //debug_text::print("local_sr_update_metareflexion"); + $logs = new \local_notemyprogress\logs($courseid, $userid); + $logs->addLogsNMP("Updated", "section", "Meta_Reflection", "student_gamification", $url, "MetaReflectionUpdated"); $metareflexion = new \local_notemyprogress\metareflexion($courseid, $userid, $idmetareflexion); $metareflexion->id = $idmetareflexion; $metareflexion->weekcode = $weekcode; @@ -323,7 +365,8 @@ function local_sr_update_metareflexion($userid, $weekcode, $idmetareflexion, $da function local_sr_save_lastweek($courseid, $userid,$weekcode ,$classroom_hours, $hours_off, $objectives_reached, $previous_class, $benefit, $feeling) { - //debug_text::print("local_sr_save_lastweek"); + $logs = new \local_notemyprogress\logs($courseid, $userid); + $logs->addLogsNMP("Saved", "Meta_Reflection", "LOGFILES", "nmp", $currentUrl, "MetaReflectionSaved"); $lastweek = new \local_notemyprogress\metareflexion($courseid, $userid); $lastweek->classroom_hours = $classroom_hours; $lastweek->hours_off_course = $hours_off; @@ -332,8 +375,6 @@ function local_sr_save_lastweek($courseid, $userid,$weekcode ,$classroom_hours, $lastweek->previous_class_learning = $previous_class; $lastweek->benefit_going_class = $benefit; $lastweek->feeling = $feeling; - //debug_text::print("weekcode",$weekcode); - //debug_text::print("lastweek ajax",$lastweek->weekcode); $lastweekresponse = $lastweek->save_lastweek(); local_notemyprogress_ajax_response(array('response_save_last_week' => $lastweekresponse)); @@ -341,7 +382,8 @@ function local_sr_save_lastweek($courseid, $userid,$weekcode ,$classroom_hours, function local_sr_update_lastweek($courseid, $userid, $lastweekid, $classroom_hours, $hours_off, $objectives_reached, $previous_class, $benefit, $feeling) { -//debug_text::print("local_sr_update_lastweek"); + $logs = new \local_notemyprogress\logs($courseid, $userid); + $logs->addLogsNMP("Updated", "section", "Meta_Reflection", "student_gamification", $url, "MetaReflectionUpdated"); $lastweek = new \local_notemyprogress\metareflexion($courseid, $userid); $lastweek->lastweekid = $lastweekid; $lastweek->classroom_hours = $classroom_hours; @@ -355,8 +397,7 @@ function local_sr_update_lastweek($courseid, $userid, $lastweekid, $classroom_ho local_notemyprogress_ajax_response(array('response_update_last_week' => $lastweekresponse)); } -function local_notemyprogress_logsNMP($beginDate, $lastDate, $courseid, $userid, $currentUrl) -{ +function local_notemyprogress_logsNMP($beginDate, $lastDate, $courseid, $userid, $currentUrl) { $logs = new \local_notemyprogress\logs($courseid, $userid); $logs->addLogsNMP("downloaded", "logfile", "LOGFILES", "nmp", $currentUrl, "File that contains all the activities performed on the moodle course in a time interval"); $jsonData = $logs->searchLogsNMP($beginDate, $lastDate); @@ -490,7 +531,6 @@ function local_notemyprogress_get_student_sessions($weekcode, $courseid, $userid function local_notemyprogress_downloadMoodleLogs($beginDate, $lastDate, $courseid, $userid, $currentUrl) { $logs = new \local_notemyprogress\logs($courseid, $userid); - $logs->addLogsNMP("downloaded", "logfile", "LOGFILES", "moodle", $currentUrl, "File that contains all the activities performed on the Note My Progress plugin in a time interval"); $jsonData = $logs->searchLogsMoodle($beginDate, $lastDate); local_notemyprogress_ajax_response(array("jsonData" => $jsonData)); @@ -500,5 +540,44 @@ function local_notemyprogress_addLogs($sectionname, $actiontype, $courseid, $use { $logs = new \local_notemyprogress\logs($courseid, $userid); $logs->addLogsNMP($actiontype, $objectType, $sectionname, $objectName, $currentUrl, $objectDescription); - local_notemyprogress_ajax_response(array("ok" => "ok")); + local_notemyprogress_ajax_response(array("ok"=>"ok")); } +function local_notemyprogress_save_gamification_config($courseid, $userid, $rules, $levels, $settings, $url,$section){ + $logs = new \local_notemyprogress\logs($courseid, $userid); + $logs->addLogsNMP("Saved", $section, "CONFIGURATION_GAMIFICATION", "configuration_gamification", $url, "GamificationSaved"); + + $configLevels = new \local_notemyprogress\configgamification($courseid, $userid); + $configLevels->save_levels($levels, $settings, $rules); + //$configLevels->save_enable($enable); + $message = get_string('nmp_api_save_successful', 'local_notemyprogress'); + local_notemyprogress_ajax_response($message); + } + +function local_notemyprogress_set_rankable_player($courseid, $userid,$url){ + $logs = new \local_notemyprogress\logs($courseid, $userid); + $logs->addLogsNMP("Saved", "section", "STUDENT_GAMIFICATION", "student_gamification", $url, "GamificationSaved"); + GLobal $DB; + $sql = "update {notemyprogress_xp} set rankable = ? where courseid = ? and userid = ?"; + $DB->execute($sql, array(1,$courseid, $userid)); + // $sql = "UPDATE {notemyprogress_xp} SET rankable = 1 WHERE courseid = 2 AND userid = 3"; + // $DB->execute($sql); + $message = get_string('nmp_api_save_successful', 'local_notemyprogress'); + local_notemyprogress_ajax_response($message); +} + +function local_notemyprogress_save_enable($courseid, $userid, $enable,$url){ + $logs = new \local_notemyprogress\logs($courseid, $userid); + $logs->addLogsNMP("Saved", "section", "CONFIGURATION_GAMIFICATION", "configuration_gamification", $url, "GamificationSaved"); + $configLevels = new \local_notemyprogress\configgamification($courseid, $userid); + $configLevels->save_enable($enable); + $message = get_string('nmp_api_save_successful', 'local_notemyprogress'); + local_notemyprogress_ajax_response($message); + } + function local_notemyprogress_viewed_student_lvl($courseid, $userid,$url){ + $logs = new \local_notemyprogress\logs($courseid, $userid); + $logs->addLogsNMP("Viewed", "section", "STUDENT_GAMIFICATION", "student_gamification", $url, "GamificationSaved"); + // $configLevels = new \local_notemyprogress\configgamification($courseid, $userid); + // $configLevels->save_enable($enable); + // $message = get_string('nmp_api_save_successful', 'local_notemyprogress'); + // local_notemyprogress_ajax_response($message); + } \ No newline at end of file diff --git a/notemyprogress/amd/build/assignments.min.js b/notemyprogress/amd/build/assignments.min.js index 367c4202f79dc0c286675268acc2304b0acce2a3..53681eb16cc77ddf61eeab8ee0d6425d53429577 100644 --- a/notemyprogress/amd/build/assignments.min.js +++ b/notemyprogress/amd/build/assignments.min.js @@ -1,412 +1,2 @@ -define([ - "local_notemyprogress/vue", - "local_notemyprogress/vuetify", - "local_notemyprogress/axios", - "local_notemyprogress/moment", - "local_notemyprogress/pagination", - "local_notemyprogress/chartdynamic", - "local_notemyprogress/pageheader", - "local_notemyprogress/emailform", - "local_notemyprogress/helpdialog", -], function (s, e, t, i, n, o, a, r, c) { - "use strict"; - return { - init: function (i) { - s.use(e), - s.component("pagination", n), - s.component("chart", o), - s.component("pageheader", a), - s.component("emailform", r), - s.component("helpdialog", c); - let l = new s({ - delimiters: ["[[", "]]"], - el: "#submissions", - vuetify: new e(), - data: () => ({ - dialog: !1, - selected_users: [], - modulename: "", - moduleid: !1, - strings: i.strings, - groups: i.groups, - userid: i.userid, - courseid: i.courseid, - timezone: i.timezone, - render_has: i.profile_render, - scriptname: i.scriptname, - loading: !1, - errors: [], - pages: i.pages, - submissions: i.submissions, - email_strings: i.strings.email_strings, - access: i.access, - assigns_submissions_colors: i.assigns_submissions_colors, - access_content_colors: i.access_content_colors, - access_chart_categories: [], - access_chart_series: [], - access_chart_users: [], - help_dialog: !1, - help_contents: [], - email_object_name: "", - }), - beforeMount() { - this.generate_access_content_data(); - }, - mounted() { - (document.querySelector("#sessions-loader").style.display = "none"), - (document.querySelector("#submissions").style.display = "block"), - setTimeout(function () { - l.setGraphicsEventListeners(); - }, 1e3); - }, - methods: { - get_help_content() { - let s = []; - return ( - s.push({ - title: this.strings.section_help_title, - description: this.strings.section_help_description, - }), - s - ); - }, - update_interactions(s) { - (this.loading = !0), (this.errors = []); - let e = { - action: "assignments", - userid: this.userid, - courseid: this.courseid, - weekcode: s.weekcode, - profile: this.render_has, - }; - return ( - t({ - method: "get", - url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", - params: e, - }) - .then((s) => { - 200 == s.status && s.data.ok - ? ((this.submissions = s.data.data.submissions), - (this.access = s.data.data.access), - this.generate_access_content_data()) - : this.error_messages.push(this.strings.error_network); - }) - .catch((s) => { - this.errors.push(this.strings.api_error_network); - }) - .finally(() => { - (this.loading = !1), - l.addLogsIntoDB( - "viewed", - "week_" + s.weekcode, - "week_section", - "Week section that allows you to obtain information on a specific week" - ), - l.setGraphicsEventListeners(); - }), - this.data - ); - }, - build_assigns_submissions_chart() { - let s = new Object(); - return ( - (s.chart = { - type: "column", - backgroundColor: null, - style: { fontFamily: "poppins" }, - }), - (s.title = { text: null }), - (s.colors = this.assigns_submissions_colors), - (s.xAxis = { - categories: this.submissions.categories, - crosshair: !0, - }), - (s.yAxis = { - min: 0, - title: { text: this.strings.assignsubs_chart_yaxis }, - allowDecimals: !1, - }), - (s.tooltip = { - formatter: function () { - let s = this.x.split("</b>"); - s = (s = (s = s[0] || "").split("<b>"))[1] || ""; - let e = this.series.name, - t = this.y, - i = l.strings.students_text, - n = l.strings.send_mail; - return ( - 1 == t && (i = l.strings.student_text), - "<b>" + - s + - "</b><br/><b>" + - e + - ": </b>" + - t + - " " + - i + - "<br/>" + - n - ); - }, - }), - (s.plotOptions = { - series: { - cursor: "pointer", - point: { - events: { - click: function () { - l.email_object_name = "assigns_submissions"; - let s = this.category.split("</b>"); - (s = (s = (s = s[0] || "").split("<b>"))[1] || ""), - (l.email_strings.subject = - l.email_strings.subject_prefix + " - " + s); - let e = this.x, - t = this.series.colorIndex; - (l.dialog = !0), - (l.selected_users = l.submissions.users[e][t]), - (l.moduleid = l.submissions.modules[e]), - (l.modulename = "assign"), - (l.scriptname = "test"); - }, - }, - }, - }, - }), - (s.series = this.submissions.data), - s - ); - }, - build_access_content_chart() { - let s = new Object(); - return ( - (s.chart = { - type: "bar", - backgroundColor: null, - style: { fontFamily: "poppins" }, - }), - (s.title = { text: null }), - (s.colors = this.access_content_colors), - (s.xAxis = { - categories: this.access_chart_categories, - title: { text: null }, - crosshair: !0, - }), - (s.yAxis = { - min: 0, - title: { text: this.strings.access_chart_yaxis_label }, - labels: { overflow: "justify" }, - allowDecimals: !1, - }), - (s.tooltip = { - formatter: function () { - let s = this.x, - e = this.series.name, - t = this.y, - i = l.strings.students_text, - n = l.strings.send_mail; - return ( - 1 == t && (i = l.strings.student_text), - "<b>" + - s + - "</b><br/><b>" + - e + - ": </b>" + - t + - " " + - i + - "<br/>" + - n - ); - }, - }), - (s.plotOptions = { - bar: { dataLabels: { enabled: !1 } }, - series: { - cursor: "pointer", - point: { - events: { - click: function () { - l.email_object_name = "access_content"; - let s = this.category; - l.email_strings.subject = - l.email_strings.subject_prefix + " - " + s; - let e = this.x, - t = this.series.colorIndex, - i = l.get_users(l.access_chart_users[e][t]); - l.selected_users = i; - let n = l.get_moduletype(this.category); - (l.modulename = n.type), - (l.moduleid = n.id), - (l.dialog = !0), - (l.scriptname = "test"); - }, - }, - }, - }, - }), - (s.series = this.access_chart_series), - s - ); - }, - update_dialog(s) { - this.dialog = s; - }, - generate_access_content_data() { - let s = []; - this.access.users.forEach((e) => { - s.push(Number(e.id)); - }); - let e = []; - this.access.types.forEach((s) => { - s.show && e.push(s.type); - }); - let t = []; - this.access.modules.forEach((s) => { - e.includes(s.type) && t.push(s); - }); - let i = [], - n = [], - o = [], - a = []; - t.forEach((e) => { - i.push(e.name); - let t = e.users, - r = s.filter((s) => !t.includes(s)); - o.push(t.length), a.push(r.length), n.push([t, r]); - }); - let r = [ - { name: this.strings.access, data: o }, - { name: this.strings.no_access, data: a }, - ]; - (this.access_chart_categories = i), - (this.access_chart_series = r), - (this.access_chart_users = n); - }, - get_users(s) { - let e = []; - return ( - this.access.users.forEach((t) => { - let i = Number(t.id); - s.includes(i) && e.push(t); - }), - e - ); - }, - get_moduletype(s) { - let e; - return ( - this.access.modules.forEach((t) => { - t.name === s && (e = t); - }), - e - ); - }, - open_chart_help(s) { - let e = []; - var t = "", - i = "", - n = "", - o = ""; - "assigns_submissions" == s - ? (e.push({ - title: this.strings.assigns_submissions_help_title, - description: - this.strings.assigns_submissions_help_description_p1, - }), - e.push({ - description: - this.strings.assigns_submissions_help_description_p2, - }), - (t = "viewed"), - (n = "help"), - (i = "assigns_submissions"), - (o = - "Help section that provides information about the invested time chart"), - l.addLogsIntoDB(t, i, n, o)) - : "access_content" == s && - (e.push({ - title: this.strings.access_content_help_title, - description: this.strings.access_content_help_description_p1, - }), - e.push({ - description: this.strings.access_content_help_description_p2, - }), - (t = "viewed"), - (n = "help"), - (i = "access_content"), - (o = - "Help section that provides information about the sessions per hour chart"), - l.addLogsIntoDB(t, i, n, o)), - (this.help_contents = e), - this.help_contents.length && (this.help_dialog = !0); - }, - update_help_dialog(s) { - this.help_dialog = s; - }, - get_timezone() { - return `${this.strings.ss_change_timezone} ${this.timezone}`; - }, - setGraphicsEventListeners() { - let s = document.querySelectorAll(".highcharts-container"); - s.length < 1 - ? setTimeout(l.setGraphicsEventListeners, 500) - : ((s[0].id = "submissions"), - (s[1].id = "accessContent"), - s.forEach((s) => { - s.addEventListener("mouseenter", l.addLogsViewGraphic); - })); - }, - addLogsViewGraphic(s) { - event.stopPropagation(); - var e = "", - t = "", - i = "", - n = ""; - switch (s.target.id) { - case "submissions": - (e = "viewed"), - (t = "assigns_submissions"), - (i = "chart"), - (n = "Chart showing the work submited by the students"); - break; - case "accessContent": - (e = "viewed"), - (t = "access_content"), - (i = "chart"), - (n = - "Chart showing the course content accessed by the students"); - break; - default: - (e = "viewed"), (t = ""), (i = "chart"), (n = "A chart"); - } - l.addLogsIntoDB(e, t, i, n); - }, - addLogsIntoDB(s, e, n, o) { - let a = { - courseid: i.courseid, - userid: i.userid, - action: "addLogs", - sectionname: "TASKS_MONITORING", - actiontype: s, - objectType: n, - objectName: e, - currentUrl: document.location.href, - objectDescription: o, - }; - t({ - method: "get", - url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", - params: a, - }) - .then((s) => { - 200 == s.status && s.data.ok; - }) - .catch((s) => {}); - }, - }, - }); - }, - }; -}); +define(["local_notemyprogress/vue","local_notemyprogress/vuetify","local_notemyprogress/axios","local_notemyprogress/moment","local_notemyprogress/pagination","local_notemyprogress/chartdynamic","local_notemyprogress/pageheader","local_notemyprogress/emailform","local_notemyprogress/helpdialog"],function(s,e,t,i,n,o,a,r,c){"use strict";return{init:function(i){s.use(e),s.component("pagination",n),s.component("chart",o),s.component("pageheader",a),s.component("emailform",r),s.component("helpdialog",c);let l=new s({delimiters:["[[","]]"],el:"#submissions",vuetify:new e,data:()=>({dialog:!1,selected_users:[],modulename:"",moduleid:!1,strings:i.strings,groups:i.groups,userid:i.userid,courseid:i.courseid,timezone:i.timezone,render_has:i.profile_render,scriptname:i.scriptname,loading:!1,errors:[],pages:i.pages,submissions:i.submissions,email_strings:i.strings.email_strings,access:i.access,assigns_submissions_colors:i.assigns_submissions_colors,access_content_colors:i.access_content_colors,access_chart_categories:[],access_chart_series:[],access_chart_users:[],help_dialog:!1,help_contents:[],email_object_name:""}),beforeMount(){this.generate_access_content_data()},mounted(){document.querySelector("#sessions-loader").style.display="none",document.querySelector("#submissions").style.display="block",setTimeout(function(){l.setGraphicsEventListeners()},1e3)},methods:{get_help_content(){let s=[];return s.push({title:this.strings.section_help_title,description:this.strings.section_help_description}),s},update_interactions(s){this.loading=!0,this.errors=[];let e={action:"assignments",userid:this.userid,courseid:this.courseid,weekcode:s.weekcode,profile:this.render_has};return t({method:"get",url:M.cfg.wwwroot+"/local/notemyprogress/ajax.php",params:e}).then(s=>{200==s.status&&s.data.ok?(this.submissions=s.data.data.submissions,this.access=s.data.data.access,this.generate_access_content_data()):this.error_messages.push(this.strings.error_network)}).catch(s=>{this.errors.push(this.strings.api_error_network)}).finally(()=>{this.loading=!1,l.addLogsIntoDB("viewed","week_"+s.weekcode,"week_section","Week section that allows you to obtain information on a specific week"),l.setGraphicsEventListeners()}),this.data},build_assigns_submissions_chart(){let s=new Object;return s.chart={type:"column",backgroundColor:null,style:{fontFamily:"poppins"}},s.title={text:null},s.colors=this.assigns_submissions_colors,s.xAxis={categories:this.submissions.categories,crosshair:!0},s.yAxis={min:0,title:{text:this.strings.assignsubs_chart_yaxis},allowDecimals:!1},s.tooltip={formatter:function(){let s=this.x.split("</b>");s=(s=(s=s[0]||"").split("<b>"))[1]||"";let e=this.series.name,t=this.y,i=l.strings.students_text,n=l.strings.send_mail;return 1==t&&(i=l.strings.student_text),"<b>"+s+"</b><br/><b>"+e+": </b>"+t+" "+i+"<br/>"+n}},s.plotOptions={series:{cursor:"pointer",point:{events:{click:function(){l.email_object_name="assigns_submissions";let s=this.category.split("</b>");s=(s=(s=s[0]||"").split("<b>"))[1]||"",l.email_strings.subject=l.email_strings.subject_prefix+" - "+s;let e=this.x,t=this.series.colorIndex;l.dialog=!0,l.selected_users=l.submissions.users[e][t],l.moduleid=l.submissions.modules[e],l.modulename="assign",l.scriptname="test"}}}}},s.series=this.submissions.data,s},build_access_content_chart(){let s=new Object;return s.chart={type:"bar",backgroundColor:null,style:{fontFamily:"poppins"}},s.title={text:null},s.colors=this.access_content_colors,s.xAxis={categories:this.access_chart_categories,title:{text:null},crosshair:!0},s.yAxis={min:0,title:{text:this.strings.access_chart_yaxis_label},labels:{overflow:"justify"},allowDecimals:!1},s.tooltip={formatter:function(){let s=this.x,e=this.series.name,t=this.y,i=l.strings.students_text,n=l.strings.send_mail;return 1==t&&(i=l.strings.student_text),"<b>"+s+"</b><br/><b>"+e+": </b>"+t+" "+i+"<br/>"+n}},s.plotOptions={bar:{dataLabels:{enabled:!1}},series:{cursor:"pointer",point:{events:{click:function(){l.email_object_name="access_content";let s=this.category;l.email_strings.subject=l.email_strings.subject_prefix+" - "+s;let e=this.x,t=this.series.colorIndex,i=l.get_users(l.access_chart_users[e][t]);l.selected_users=i;let n=l.get_moduletype(this.category);l.modulename=n.type,l.moduleid=n.id,l.dialog=!0,l.scriptname="test"}}}}},s.series=this.access_chart_series,s},update_dialog(s){this.dialog=s},generate_access_content_data(){let s=[];this.access.users.forEach(e=>{s.push(Number(e.id))});let e=[];this.access.types.forEach(s=>{s.show&&e.push(s.type)});let t=[];this.access.modules.forEach(s=>{e.includes(s.type)&&t.push(s)});let i=[],n=[],o=[],a=[];t.forEach(e=>{i.push(e.name);let t=e.users,r=s.filter(s=>!t.includes(s));o.push(t.length),a.push(r.length),n.push([t,r])});let r=[{name:this.strings.access,data:o},{name:this.strings.no_access,data:a}];this.access_chart_categories=i,this.access_chart_series=r,this.access_chart_users=n},get_users(s){let e=[];return this.access.users.forEach(t=>{let i=Number(t.id);s.includes(i)&&e.push(t)}),e},get_moduletype(s){let e;return this.access.modules.forEach(t=>{t.name===s&&(e=t)}),e},open_chart_help(s){let e=[];var t="",i="",n="",o="";"assigns_submissions"==s?(e.push({title:this.strings.assigns_submissions_help_title,description:this.strings.assigns_submissions_help_description_p1}),e.push({description:this.strings.assigns_submissions_help_description_p2}),t="viewed",n="help",i="assigns_submissions",o="Help section that provides information about the invested time chart",l.addLogsIntoDB(t,i,n,o)):"access_content"==s&&(e.push({title:this.strings.access_content_help_title,description:this.strings.access_content_help_description_p1}),e.push({description:this.strings.access_content_help_description_p2}),t="viewed",n="help",i="access_content",o="Help section that provides information about the sessions per hour chart",l.addLogsIntoDB(t,i,n,o)),this.help_contents=e,this.help_contents.length&&(this.help_dialog=!0)},update_help_dialog(s){this.help_dialog=s},get_timezone(){return`${this.strings.ss_change_timezone} ${this.timezone}`},setGraphicsEventListeners(){let s=document.querySelectorAll(".highcharts-container");s.length<1?setTimeout(l.setGraphicsEventListeners,500):(s[0].id="submissions",s[1].id="accessContent",s.forEach(s=>{s.addEventListener("mouseenter",l.addLogsViewGraphic)}))},addLogsViewGraphic(s){event.stopPropagation();var e="",t="",i="",n="";switch(s.target.id){case"submissions":e="viewed",t="assigns_submissions",i="chart",n="Chart showing the work submited by the students";break;case"accessContent":e="viewed",t="access_content",i="chart",n="Chart showing the course content accessed by the students";break;default:e="viewed",t="",i="chart",n="A chart"}l.addLogsIntoDB(e,t,i,n)},addLogsIntoDB(s,e,n,o){let a={courseid:i.courseid,userid:i.userid,action:"addLogs",sectionname:"TASKS_MONITORING",actiontype:s,objectType:n,objectName:e,currentUrl:document.location.href,objectDescription:o};t({method:"get",url:M.cfg.wwwroot+"/local/notemyprogress/ajax.php",params:a}).then(s=>{200==s.status&&s.data.ok}).catch(s=>{})}}})}}}); //# sourceMappingURL=assignments.min.js.map diff --git a/notemyprogress/amd/build/gamification.js b/notemyprogress/amd/build/gamification.js new file mode 100644 index 0000000000000000000000000000000000000000..e6643fb4eb924165f8bb6cc97fe99b7f56b5d3db --- /dev/null +++ b/notemyprogress/amd/build/gamification.js @@ -0,0 +1,377 @@ +define([ + "local_notemyprogress/vue", + "local_notemyprogress/vuetify", + "local_notemyprogress/axios", + "local_notemyprogress/alertify", + "local_notemyprogress/pageheader", + "local_notemyprogress/chartdynamic", +], function (Vue, Vuetify, Axios, Alertify, PageHeader, ChartDynamic) { + "use strict"; + + function init(content) { + console.log(content); + Vue.use(Vuetify); + Vue.component("pageheader", PageHeader); + Vue.component("chart", ChartDynamic); + const app = new Vue({ + delimiters: ["[[", "]]"], + el: "#gamification", + vuetify: new Vuetify(), + data: { + strings: content.strings, + token: content.token, + render_has: content.profile_render, + ranking: content.ranking, + notifications: [], + loading: false, + tab: null, + levelsData: content.levels_data.levelsdata, + settings: content.levels_data.settings, + rulesData: content.levels_data.rules, + courseid: content.levels_data.courseid, + userid: content.levels_data.created_by, + enable: false, + events: content.events, + setPointsOption: "calculated", + pointsBase: 0, + pointsBaseOri: 0, + swDisableEnable: content.strings.swValue, + spreadData: [], + week_resources_categories: [], + week_resources_data: [], + week_resources_colors: "#FA4641", + indicators: content.indicators, + chartdata: content.chart_data, + }, + + beforeMount() {}, + mounted() { + this.pointsBase = +this.settings.pointsbase; + this.pointsBaseOri = +this.settings.pointsbase; + setTimeout(function () { + app.setGraphicsEventListeners(); + }, 500); + app.setGraphicsEventListeners(); + }, + computed: {}, + methods: { + get_help_content() { + let help_contents = []; + let help = new Object(); + help.title = this.strings.help_title; + help.description = this.strings.help_description; + help_contents.push(help); + return help_contents; + }, + update_dialog(value) { + this.dialog = value; + }, + update_help_dialog(value) { + this.help_dialog = value; + }, + openHelpSectionModalEvent() { + this.saveInteraction( + this.pluginSectionName, + "viewed", + "section_help_dialog", + 3 + ); + }, + get_timezone() { + let information = `${this.strings.change_timezone} ${this.timezone}`; + return information; + }, + saveInteraction(component, interaction, target, interactiontype) { + let data = { + action: "saveinteraction", + pluginsection: this.pluginSectionName, + component, + interaction, + target, + url: window.location.href, + interactiontype, + token: this.token, + }; + Axios({ + method: "post", + url: `${M.cfg.wwwroot}/local/notemyprogress/ajax.php`, + data: data, + }) + .then((r) => {}) + .catch((e) => {}); + }, + addLevel() { + let newLevel = this.levelsData.length + 1; + this.levelsData.push({ + lvl: newLevel, + nam: `${this.strings.level} ${newLevel}`, + des: ``, + points: this.pointsBase * (newLevel - 1), + }); + }, + removeLevel() { + if (this.levelsData.length > 2) { + this.levelsData.pop(); + } + }, + calculatePoints(index) { + let points = this.isNumber(this.pointsBase) * index; + this.levelsData[index].points = points; + return points; + }, + isNumber(x) { + if (x === "" || isNaN(x) || x == 0) { + return this.pointsBaseOri; + } + return parseInt(x); + }, + save_changes(logParam) { + this.notifications = ["Do you want to save the changes"]; + Alertify.confirm(this.strings.save_warning_content, () => { + this.saveGamificationConfig(logParam); + console.log(logParam); + }) // ON CONFIRM + .set({ title: this.strings.save_warning_title }) + .set({ + labels: { + cancel: this.strings.confirm_cancel, + ok: this.strings.confirm_ok, + }, + }); + }, + saveGamificationConfig(logParam) { + this.loading = true; + let settings = { + tit: this.settings.tit, + des: this.settings.des, + pointsbase: this.pointsBase, + }; + let data = { + courseid: this.courseid, + userid: this.userid, + action: "savegamification", + levels: JSON.stringify(this.levelsData), + settings: JSON.stringify(settings), + rules: JSON.stringify(this.rulesData), + token: this.token, + enable: this.enable, + section: logParam, + }; + let url = { url: window.location.href }; + Axios({ + method: "post", + url: + M.cfg.wwwroot + + "/local/notemyprogress/ajax.php?courseid=" + + this.courseid + + "&userid=" + + this.userid + + "&action=savegamification&levels=" + + data.levels + + "&settings=" + + data.settings + + "&rules=" + + data.rules + + "&url=" + + url.url + + "&enable=" + + data.enable + + "§ion=" + + data.section, + params: data, + }) + .then((response) => { + // console.log(response); + // console.log(response.status); + // console.log(url.url); + if (response.status == 200 && response.data.ok) { + this.showNotifications(response.data.data, "success"); + } else { + let message = + response.data.error || this.strings.api_error_network; + this.showNotifications(message, "error"); //in this line "error" define the kind of message send + } + }) + .catch((e) => { + let message = e.response.data || this.strings.api_error_network; + this.showNotifications(message, "error"); + }) + .finally(() => { + this.loading = false; + }); + }, + showNotifications(message, type, alert = true, notify = true) { + if (alert) this.notifications.push({ message, type }); + if (notify) Alertify.notify(message, type); + }, + table_headers() { + let headers = [ + { text: this.strings.ranking_text, value: "ranking" }, + { text: this.strings.level, value: "level" }, + { text: this.strings.student, value: "student" }, + { text: this.strings.total, value: "total" }, + { text: this.strings.progress, value: "progress_percentage" }, + ]; + return headers; + }, + addRule() { + this.rulesData.push({ + rule: "", + points: 0, + }); + }, + removeRule(index) { + if (this.rulesData.length > 2) { + this.rulesData.splice(index, 1); + } + }, + disableEnable(swDisableEnable) { + //traitement + this.enable = swDisableEnable; + let data = { + courseid: this.courseid, + userid: this.userid, + action: "saveEnable", + enable: this.enable, + }; + Axios({ + method: "get", + url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", + params: data, + }) + .then((response) => { + if (response.status == 200 && response.data.ok) { + this.showNotifications(response.data.data, "success"); + } else { + let message = + response.data.error || this.strings.api_error_network; + this.showNotifications(message, "error"); //in this line "error" define the kind of message send + } + }) + .catch((e) => { + let message = e.response.data || this.strings.api_error_network; + this.showNotifications(message, "error"); + }) + .finally(() => { + this.loading = false; + }); + }, + //? ////////////////////////////////////////////////////////////////////// ?// + //? //////////////////////////// ChartPart /////////////////////////////// ?// + //? ////////////////////////////////////////////////////////////////////// ?// + chart_spread() { + let chart = new Object(); + chart.chart = { + type: "column", + backgroundColor: null, + }; + chart.title = { + text: this.strings.chartTitle, + }; + chart.colors = ["#118AB2"]; + (chart.xAxis = { + type: "category", + labels: { + rotation: -45, + style: { + fontSize: "13px", + fontFamily: "Verdana, sans-serif", + }, + }, + }), + (chart.yAxis = { + min: 0, + title: { + text: this.strings.chartYaxis, + }, + }); + chart.legend = { + enabled: false, + }; + (chart.series = [ + { + name: null, + data: this.chartdata, //[["level : 1", 1]], + dataLabels: { + enabled: true, + rotation: -90, + color: "#FFFFFF", + align: "right", + format: "{point.y:.1f}", // one decimal + y: 10, // 10 pixels down from the top + style: { + fontSize: "13px", + fontFamily: "Verdana, sans-serif", + }, + }, + }, + ]), + console.log("series: "); + console.log(chart.series); + return chart; + }, + setGraphicsEventListeners() { + console.log("Listeners set"); + let graphics = document.querySelectorAll(".highcharts-container"); + if (graphics.length < 1) { + setTimeout(app.setGraphicsEventListeners, 500); + } else { + graphics[0].id = "SpreadChart"; + graphics.forEach((graph) => { + graph.addEventListener("mouseenter", app.addLogsViewGraphic); + }); + } + }, + addLogsViewGraphic(e) { + event.stopPropagation(); + var action = ""; + var objectName = ""; + var objectType = ""; + var objectDescription = ""; + switch (e.target.id) { + case "SpreadChart": + action = "viewed"; + objectName = "spreading_chart"; + objectType = "chart"; + objectDescription = + "Bar chart that shows the level repartition in gamification"; + break; + default: + action = "viewed"; + objectName = ""; + objectType = "chart"; + objectDescription = "A chart"; + break; + } + app.addLogsIntoDB(action, objectName, objectType, objectDescription); + }, + addLogsIntoDB(action, objectName, objectType, objectDescription) { + let data = { + courseid: content.courseid, + userid: content.userid, + action: "addLogs", + sectionname: "TEACHER_GAMIFICATION", + actiontype: action, + objectType: objectType, + objectName: objectName, + currentUrl: document.location.href, + objectDescription: objectDescription, + }; + Axios({ + method: "get", + url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", + params: data, + }) + .then((response) => { + if (response.status == 200 && response.data.ok) { + } + }) + .catch((e) => {}); + }, + }, + }); + } + return { + init: init, + }; +}); diff --git a/notemyprogress/amd/build/helpdialog.min.js b/notemyprogress/amd/build/helpdialog.min.js index 00e305e106aef05b90b63981ffd70c79e7df289c..381a453400237b824f3dd960437742ca89dc5bde 100644 --- a/notemyprogress/amd/build/helpdialog.min.js +++ b/notemyprogress/amd/build/helpdialog.min.js @@ -1,2 +1,2 @@ -define([],function(){return{template:'\n <v-main mt-10>\n <v-row>\n <v-dialog\n v-model="dialog"\n max-width="700px"\n @click:outside="closeDialog()"\n @keydown.esc="closeDialog()"\n > \n <v-card>\n <v-card-title class="headline lighten-2 d-flex justify-center help-dialog-title">\n <span v-text="title" class="help-modal-title mr-2"></span><v-icon color="white">help_outline</v-icon>\n </v-card-title>\n <v-card-text class="pt-4 pb-4 pr-8 pl-8 help-dialog-content">\n <template v-for="(help, index, key) in contents">\n <v-layout class="mb-2" :key="key" column>\n <v-flex class="d-flex justify-center">\n <span class="notemyprogress-sub-title mb-2" v-html="help.title"></span>\n </v-flex>\n <p v-html="help.description" class="text-justify"></p>\n </v-layout>\n </template>\n </v-card-text>\n <v-divider class="ma-0"></v-divider>\n <v-card-actions class="d-flex justify-center help-dialog-footer">\n <v-btn text @click="closeDialog" v-text="exit" class="ma-0 fml-btn-secondary"></v-btn>\n </v-card-actions>\n </v-card>\n </v-dialog>\n </v-row>\n </v-main>\n ',props:["dialog","title","contents","exit"],methods:{closeDialog(){this.$emit("update_dialog",!1)}}}}); +define([],function(){return{template:'\n <v-main mt-10>\n <v-row>\n <v-dialog\n v-model="dialog"\n max-width="700px"\n @click:outside="closeDialog()"\n @keydown.esc="closeDialog()"\n > \n <v-card>\n <v-card-title class="headline lighten-2 d-flex justify-center help-dialog-title">\n <span v-text="title" class="help-modal-title mr-2"></span><v-icon color="white">help_outline</v-icon>\n </v-card-title>\n <v-card-text class="pt-4 pb-4 pr-8 pl-8 help-dialog-content">\n <template v-for="(help, index, key) in contents">\n <v-layout class="mb-2" :key="key" column>\n <v-flex class="d-flex justify-center">\n <span class="notemyprogress-sub-title mb-2" v-html="help.title"></span>\n </v-flex>\n <p v-html="help.description" class="text-justify"></p>\n </v-layout>\n </template>\n </v-card-text>\n <v-divider class="ma-0"></v-divider>\n <v-card-actions class="d-flex justify-center help-dialog-footer">\n <v-btn text @click="closeDialog" v-text="exit" class="ma-0 nmp-btn-secondary"></v-btn>\n </v-card-actions>\n </v-card>\n </v-dialog>\n </v-row>\n </v-main>\n ',props:["dialog","title","contents","exit"],methods:{closeDialog(){this.$emit("update_dialog",!1)}}}}); //# sourceMappingURL=helpdialog.min.js.map diff --git a/notemyprogress/amd/build/helpdialog.min.js.map b/notemyprogress/amd/build/helpdialog.min.js.map index ed2af10213008ee9a7c5df5e703d9d6b5d180bc1..edfd79a31f055586393aec5dd2fe8554a72d8ef6 100644 --- a/notemyprogress/amd/build/helpdialog.min.js.map +++ b/notemyprogress/amd/build/helpdialog.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/helpdialog.js"],"names":["define","template","props","methods","closeDialog","$emit"],"mappings":"AAAAA,OAAM,iCAAC,EAAD,CACF,UAAW,CAyCP,MAxCmB,CACfC,QAAQ,y8DADO,CAiCfC,KAAK,CAAC,CAAC,QAAD,CAAW,OAAX,CAAoB,UAApB,CAAgC,MAAhC,CAjCS,CAkCfC,OAAO,CAAG,CACNC,WADM,uBACQ,CACV,KAAKC,KAAL,CAAW,eAAX,IACH,CAHK,CAlCK,CAyCtB,CA3CC,CAAN","sourcesContent":["define([],\r\n function (){\r\n const helpdialog = {\r\n template:`\r\n <v-main mt-10>\r\n <v-row>\r\n <v-dialog\r\n v-model=\"dialog\"\r\n max-width=\"700px\"\r\n @click:outside=\"closeDialog()\"\r\n @keydown.esc=\"closeDialog()\"\r\n > \r\n <v-card>\r\n <v-card-title class=\"headline lighten-2 d-flex justify-center help-dialog-title\">\r\n <span v-text=\"title\" class=\"help-modal-title mr-2\"></span><v-icon color=\"white\">help_outline</v-icon>\r\n </v-card-title>\r\n <v-card-text class=\"pt-4 pb-4 pr-8 pl-8 help-dialog-content\">\r\n <template v-for=\"(help, index, key) in contents\">\r\n <v-layout class=\"mb-2\" :key=\"key\" column>\r\n <v-flex class=\"d-flex justify-center\">\r\n <span class=\"notemyprogress-sub-title mb-2\" v-html=\"help.title\"></span>\r\n </v-flex>\r\n <p v-html=\"help.description\" class=\"text-justify\"></p>\r\n </v-layout>\r\n </template>\r\n </v-card-text>\r\n <v-divider class=\"ma-0\"></v-divider>\r\n <v-card-actions class=\"d-flex justify-center help-dialog-footer\">\r\n <v-btn text @click=\"closeDialog\" v-text=\"exit\" class=\"ma-0 fml-btn-secondary\"></v-btn>\r\n </v-card-actions>\r\n </v-card>\r\n </v-dialog>\r\n </v-row>\r\n </v-main>\r\n `,\r\n props:['dialog', 'title', 'contents', 'exit'],\r\n methods : {\r\n closeDialog() {\r\n this.$emit('update_dialog', false);\r\n },\r\n },\r\n }\r\n return helpdialog;\r\n })"],"file":"helpdialog.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/helpdialog.js"],"names":["define","template","props","methods","closeDialog","$emit"],"mappings":"AAAAA,OAAM,iCAAC,EAAD,CACF,UAAW,CAyCP,MAxCmB,CACfC,QAAQ,y8DADO,CAiCfC,KAAK,CAAC,CAAC,QAAD,CAAW,OAAX,CAAoB,UAApB,CAAgC,MAAhC,CAjCS,CAkCfC,OAAO,CAAG,CACNC,WADM,uBACQ,CACV,KAAKC,KAAL,CAAW,eAAX,IACH,CAHK,CAlCK,CAyCtB,CA3CC,CAAN","sourcesContent":["define([],\r\n function (){\r\n const helpdialog = {\r\n template:`\r\n <v-main mt-10>\r\n <v-row>\r\n <v-dialog\r\n v-model=\"dialog\"\r\n max-width=\"700px\"\r\n @click:outside=\"closeDialog()\"\r\n @keydown.esc=\"closeDialog()\"\r\n > \r\n <v-card>\r\n <v-card-title class=\"headline lighten-2 d-flex justify-center help-dialog-title\">\r\n <span v-text=\"title\" class=\"help-modal-title mr-2\"></span><v-icon color=\"white\">help_outline</v-icon>\r\n </v-card-title>\r\n <v-card-text class=\"pt-4 pb-4 pr-8 pl-8 help-dialog-content\">\r\n <template v-for=\"(help, index, key) in contents\">\r\n <v-layout class=\"mb-2\" :key=\"key\" column>\r\n <v-flex class=\"d-flex justify-center\">\r\n <span class=\"notemyprogress-sub-title mb-2\" v-html=\"help.title\"></span>\r\n </v-flex>\r\n <p v-html=\"help.description\" class=\"text-justify\"></p>\r\n </v-layout>\r\n </template>\r\n </v-card-text>\r\n <v-divider class=\"ma-0\"></v-divider>\r\n <v-card-actions class=\"d-flex justify-center help-dialog-footer\">\r\n <v-btn text @click=\"closeDialog\" v-text=\"exit\" class=\"ma-0 nmp-btn-secondary\"></v-btn>\r\n </v-card-actions>\r\n </v-card>\r\n </v-dialog>\r\n </v-row>\r\n </v-main>\r\n `,\r\n props:['dialog', 'title', 'contents', 'exit'],\r\n methods : {\r\n closeDialog() {\r\n this.$emit('update_dialog', false);\r\n },\r\n },\r\n }\r\n return helpdialog;\r\n })"],"file":"helpdialog.min.js"} \ No newline at end of file diff --git a/notemyprogress/amd/build/metareflexion.js b/notemyprogress/amd/build/metareflexion.js index 163a3ea8e430b502caf95bb079c2c83e58cbed73..e5bbeb5e395b966f0baafd890a3acd27309a6369 100644 --- a/notemyprogress/amd/build/metareflexion.js +++ b/notemyprogress/amd/build/metareflexion.js @@ -64,18 +64,18 @@ define([ loading: false, compare_with_course: false, current_week: content.cmcurrentweeknew, - week_schedule : content.week_schedule, - + week_schedule: content.week_schedule, + data_report_meta_days: content.data_report_days, data_report_meta_hours: content.data_report_hours, data_report_meta_goals: content.data_report_goals, data_report_meta_questions: content.data_report_hours_questions, - - data_report_meta_classroom:content.data_report_classroom.average_classroom, - data_report_meta_of_classroom:content.data_report_classroom.average_of_classroom, - data_report_meta_last_week:content.report_last_week, - + + // data_report_meta_classroom: content.data_report_classroom.average_classroom, + //data_report_meta_of_classroom: content.data_report_classroom.average_of_classroom, + data_report_meta_last_week: content.report_last_week, + status_planning: content.status_planning, course_report_hours: content.course_report_hours, past_week: content.lastweek, @@ -135,105 +135,10 @@ define([ }, }, - chart_hours_options: { - maintainAspectRatio: false, - legend: { display: false }, - tooltips: { - callbacks: { - title: (tooltipItem, data) => { - var title_label = null; - if (content.profile_render == "teacher") { - title_label = content.strings.hover_title_teacher; - } else { - title_label = content.strings.hover_title_student; - } - return title_label; - }, - label: (tooltipItem, data) => { - var label = null; - var labels_summaries = []; - let inverted = - vue.render_has == "teacher" - ? vue.strings.inverted_time - : `${vue.strings.myself} ${vue.strings.inverted_time}`; - label = `${inverted} : ${vue.data_report_meta_hours.label_horas_trabajadas}`; - labels_summaries.push(label); - if (vue.render_has == "student" && vue.compare_with_course) { - label = `${vue.strings.inverted_time_course} : ${vue.course_report_hours.label_horas_trabajadas}`; - labels_summaries.push(label); - } - let planified = - vue.render_has == "teacher" - ? vue.strings.planified_time - : `${vue.strings.myself} ${vue.strings.planified_time}`; - label = `${planified} : ${vue.data_report_meta_hours.label_horas_planificadas}`; - labels_summaries.push(label); - if (vue.render_has == "student" && vue.compare_with_course) { - label = `${vue.strings.planified_time_course} ${vue.course_report_hours.label_horas_planificadas}`; - labels_summaries.push(label); - } - if (content.profile_render == "teacher") { - label = `${vue.strings.interaction_user} : ${vue.data_report_meta_hours.interacted_users}`; - labels_summaries.push(label); - } - return labels_summaries; - }, - }, - backgroundColor: "rgba(0, 0, 0, .8)", - titleFontSize: 12, - titleFontColor: "rgba(255, 255, 255, 1)", - bodyFontColor: "rgba(255, 255, 255, .8)", - bodyFontSize: 12, - displayColors: false, - }, - scales: { - xAxes: [ - { - display: true, - scaleLabel: { - display: true, - labelString: content.strings.hours_unit_time_label, - fontSize: 15, - }, - ticks: { - autoSkip: true, - stepSize: 1, - suggestedMin: 0, - }, - }, - ], - }, - }, - - chart_options_2: { - legend: { - display: true, - position: "bottom", - }, - }, img_no_data: content.image_no_data, }; }, - updated() { - //console.log("this.data_report_meta_questions.questions = "); - //console.log(this.data_report_meta_questions.questions); - //console.log("this.paginator_week = "); - //console.log(this.paginator_week); - //console.log("this.data_report_meta_questions = "); - //console.log(this.data_report_meta_questions); - // //console.log("current_week = "); - // //console.log(this.current_week); - // //console.log("this.pages = "); - // //console.log(this.pages); - //console.log("this.data_report_meta_hours = "); - //console.log(this.data_report_meta_hours); - //console.log("data_report_meta_goals = "); - //console.log(this.data_report_meta_goals); - // //console.log("data_report_meta_days = "); - // //console.log(this.data_report_meta_days); - }, - mounted() { document.querySelector("#sr-loader").style.display = "none"; document.querySelector("#metareflexion").style.display = "block"; @@ -270,12 +175,14 @@ define([ isDisabledBtnLastWeek() { return ( - //this.past_week.classroom_hours >= 0 && - //this.past_week.hours_off_course >= 0 && - this.data_report_meta_questions.questions[1].answer_selected === null || - this.data_report_meta_questions.questions[2].answer_selected === null || - this.data_report_meta_questions.questions[3].answer_selected === null || - this.data_report_meta_questions.questions[4].answer_selected === null + this.data_report_meta_questions.questions[1].answer_selected === + null || + this.data_report_meta_questions.questions[2].answer_selected === + null || + this.data_report_meta_questions.questions[3].answer_selected === + null || + this.data_report_meta_questions.questions[4].answer_selected === + null ); }, @@ -291,7 +198,12 @@ define([ isDisabledQuestions() { //if today <= date_end (weekstart + 7) OR no shedule return true else return false - return this.paginator_week != null ? !(this.week_schedule[this.paginator_week.weekcode] && !(this.paginator_week.is_current_week)) : true ; + return this.paginator_week != null + ? !( + this.week_schedule[this.paginator_week.weekcode] && + !this.paginator_week.is_current_week + ) + : true; }, // isDisabledBtnCurrentWeek() { @@ -306,43 +218,16 @@ define([ // this.current_week[0].weekly_schedules_days.dom == true) // ); // }, - - benefits_attending_has_data() { - var attending_has_data = false; - - this.chartdata_benefits_attending_classes().datasets[0].data.forEach( - (element) => { - if (element > 0) { - attending_has_data = true; - } - } - ); - - return attending_has_data; - }, - - learning_objectives_has_data() { - var objectives_has_data = false; - - this.chartdata_learning_objectives().datasets[0].data.forEach( - (element) => { - if (element > 0) { - objectives_has_data = true; - } - } - ); - - return objectives_has_data; - }, }, methods: { get_modules(day, cmid) { - return this.current_week[0].weekly_schedules_days.dias_planificados[day].includes(cmid); + return this.current_week[0].weekly_schedules_days.dias_planificados[ + day + ].includes(cmid); }, update_interactions(week) { - //console.log("update_interactions called"); this.loading = true; this.errors = []; let data = { @@ -500,13 +385,14 @@ define([ get_goal(goal_id) { return this.current_week[0].weekly_schedules_goals.includes(goal_id); }, - + update_goal(goal_id, event) { //console.log(this.data_report_meta_goals); if (event) { this.current_week[0].weekly_schedules_goals.push(goal_id); } else { - const i = this.current_week[0].weekly_schedules_goals.indexOf(goal_id); + const i = + this.current_week[0].weekly_schedules_goals.indexOf(goal_id); //console.log(i); this.current_week[0].weekly_schedules_goals.splice(i, 1); } @@ -515,12 +401,18 @@ define([ update_module(day, module_id, event) { if (event) { - this.current_week[0].weekly_schedules_days.dias_planificados[day].push(module_id); + this.current_week[0].weekly_schedules_days.dias_planificados[ + day + ].push(module_id); } else { const i = - this.current_week[0].weekly_schedules_days.dias_planificados[day].indexOf(module_id); + this.current_week[0].weekly_schedules_days.dias_planificados[ + day + ].indexOf(module_id); //console.log(i); - this.current_week[0].weekly_schedules_days.dias_planificados[day].splice(i, 1); + this.current_week[0].weekly_schedules_days.dias_planificados[ + day + ].splice(i, 1); } //console.log(this.current_week[0].days_committed[day]); }, @@ -554,19 +446,6 @@ define([ }, get_interactions(week) { - //console.log("current_week = "); - //console.log(this.current_week); - //console.log("enter get_interactions"); - //console.log("week = "); - //console.log(week); - //console.log("current_week = "); - //console.log(this.current_week); - //console.log("this.data_report_meta_hours = "); - //console.log(this.data_report_meta_hours); - //console.log("data_report_meta_goals = "); - //console.log(this.data_report_meta_goals); - //console.log("data_report_meta_days = "); - //console.log(this.data_report_meta_days); this.loading = true; var validresponse = false; this.errors = []; @@ -583,19 +462,22 @@ define([ params: data, }) .then((response) => { - //if (response.status == 200 && response.data.ok) { if (response.status == 200 && response.data.ok) { //console.log("if"); this.paginator_week = week; validresponse = true; - this.data_report_meta_goals = response.data.data.interactions_goals; - this.data_report_meta_days = response.data.data.interactions_days; - this.data_report_meta_hours = response.data.data.interactions_hours; - this.data_report_meta_questions = response.data.data.interactions_questions; - this.course_report_hours = response.data.data.course_report_hours; - //console.log(this.data_report_meta_days); - + this.data_report_meta_goals = + response.data.data.interactions_goals; + this.data_report_meta_days = + response.data.data.interactions_days; + this.data_report_meta_hours = + response.data.data.interactions_hours; + this.data_report_meta_questions = + response.data.data.interactions_questions; + this.course_report_hours = + response.data.data.course_report_hours; + //this.students_planification = response.data.data.students_planification; this.status_planning = response.data.data.status_planning; } else { @@ -639,9 +521,12 @@ define([ if (response.status == 200 && response.data.ok) { this.paginator_week = week; validresponse = true; - this.data_report_meta_classroom = response.data.data.average_hours_clases.average_classroom; - this.data_report_meta_of_classroom = response.data.data.average_hours_clases.average_of_classroom; - this.data_report_meta_last_week = response.data.data.report_last_week; + this.data_report_meta_classroom = + response.data.data.average_hours_clases.average_classroom; + this.data_report_meta_of_classroom = + response.data.data.average_hours_clases.average_of_classroom; + this.data_report_meta_last_week = + response.data.data.report_last_week; } else { this.errors.push(this.strings.api_error_network); } @@ -659,70 +544,20 @@ define([ return `${week.weekstart} ${this.strings.tv_to} ${week.weekend}`; }, - chartdata_day_dedication() { - var data = new Object(); - data.datasets = []; - data.labels = [ - this.strings.currentweek_day_lun, - this.strings.currentweek_day_mar, - this.strings.currentweek_day_mie, - this.strings.currentweek_day_jue, - this.strings.currentweek_day_vie, - this.strings.currentweek_day_sab, - this.strings.currentweek_day_dom, - ]; - - let dataset = new Object(); - - dataset.label = "Dias Comprometidos"; - dataset.data = this.data_report_meta_days.dias_planificados; - dataset.backgroundColor = [ - "#a0c2fa", - "#a0c2fa", - "#a0c2fa", - "#a0c2fa", - "#a0c2fa", - "#a0c2fa", - "#a0c2fa", - ]; - dataset.borderWidth = 0; - data.datasets.push(dataset); - - dataset = new Object(); - dataset.label = "Dias trabajados"; - dataset.data = this.data_report_meta_days.dias_trabajados; - dataset.backgroundColor = [ - "#bfd8fc", - "#bfd8fc", - "#bfd8fc", - "#bfd8fc", - "#bfd8fc", - "#bfd8fc", - "#bfd8fc", - ]; - dataset.borderWidth = 0; - data.datasets.push(dataset); - - return data; - }, - chartdata_hours_week_dedication() { var data = new Object(); data.datasets = []; - //let inverted = this.render_has == "teacher" ? this.strings.inverted_time : `${this.strings.myself} ${this.strings.inverted_time}`; - //let planified = this.render_has == "teacher" ? this.strings.planified_time : `${this.strings.myself} ${this.strings.planified_time}`; let inverted = `${this.strings.myself} ${this.strings.inverted_time}`; let planified = `${this.strings.myself} ${this.strings.planified_time}`; data.labels = [inverted, planified]; var dataset = new Object(); dataset.label = "Horas"; - //console.log("data_report_meta_hours in chartdata_hours_week_dedication = "); - //console.log(this.data_report_meta_hours); + dataset.data = [ - parseFloat(this.data_report_meta_hours.horas_trabajadas), - parseInt(this.data_report_meta_hours.horas_planificadas), + parseFloat(this.data_report_meta_hours.hours_worked), + parseInt(this.data_report_meta_hours.hours_planned), ]; dataset.backgroundColor = ["#ffa700", "#a0c2fa"]; dataset.borderWidth = 0; @@ -734,83 +569,23 @@ define([ dataset.data.splice( 1, 0, - parseFloat(this.course_report_hours.horas_trabajadas) + parseFloat(this.course_report_hours.hours_worked) ); // dataset.data.splice( // 3, // 0, - // parseFloat(this.course_report_hours.horas_planificadas) + // parseFloat(this.course_report_hours.hours_planned) // ); dataset.backgroundColor.splice(1, 0, "#ffa700"); //dataset.backgroundColor.splice(3, 0, "#a0c2fa"); //} - //console.log("data_report_meta_hours = "); - //console.log(this.data_report_meta_hours); - - //console.log("data = "); - //console.log(data); - return data; - }, - - chartdata_learning_objectives() { - var data = new Object(); - data.datasets = []; - var grafico1 = new Object(); - grafico1.label = []; - grafico1.data = []; - - this.data_report_meta_last_week[0].alternatives.forEach((element) => { - grafico1.label.push(element.enunciated); - grafico1.data.push(element.count_selections); - }); - - data.labels = grafico1.label; - var dataset = new Object(); - dataset.data = grafico1.data; - dataset.backgroundColor = ["#2784cc", "#7580d8", "#b278d4"]; - dataset.borderWidth = 0; - data.datasets.push(dataset); - - return data; - }, - - chartdata_benefits_attending_classes() { - var data = new Object(); - data.datasets = []; - var grafico2 = new Object(); - grafico2.label = []; - grafico2.data = []; - - this.data_report_meta_last_week[1].alternatives.forEach((element) => { - grafico2.label.push(element.enunciated); - grafico2.data.push(element.count_selections); - }); - - data.labels = grafico2.label; - var dataset = new Object(); - dataset.data = grafico2.data; - dataset.backgroundColor = [ - "#e56cbf", - "#ff659d", - "#ff6e73", - "#ff8745", - "#ffa600", - "#d0b800", - ]; - dataset.borderWidth = 0; - data.datasets.push(dataset); - return data; }, action_save_metareflexion(course_module) { - //console.log("this.current_week[0].weekly_schedules_goals = "); - //console.log(this.current_week[0].weekly_schedules_goals); if (course_module.weekly_schedules_id) { - //console.log("update_metareflexion called"); this.update_metareflexion(course_module); } else { - //console.log("save_metareflexion called"); this.save_metareflexion_new(course_module); } this.get_interaction_group(this.paginator_week); @@ -838,35 +613,30 @@ define([ }, update_metareflexion(course_module) { - // var days_committed = this.get_selected_days( - // course_module.weekly_schedules_days - // ); var data = { action: "updatemetareflexion", metareflexionid: course_module.weekly_schedules_id, // days: days_committed, - hours: this.current_week[0].weekly_schedules_hours.horas_planificadas, + hours: + this.current_week[0].weekly_schedules_hours.hours_planned, goals: this.current_week[0].weekly_schedules_goals, - days: JSON.stringify(this.current_week[0].weekly_schedules_days.dias_planificados), + days: JSON.stringify( + this.current_week[0].weekly_schedules_days.dias_planificados + ), courseid: this.courseid, weekcode: course_module.weekcode, userid: this.userid, }; - //console.log("data = "); - //console.log(data); Axios({ method: "get", url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", params: data, }) .then((response) => { - //console.log("then"); if (response.status == 200 && response.data.ok) { - //console.log("if"); Alertify.success(this.strings.update_planification_success); course_module.modalopened = false; } else { - //console.log("error if axios"); } }) .catch((e) => { @@ -877,21 +647,18 @@ define([ }, save_metareflexion_new(course_module) { - //console.log("this.data_report_meta_hours = "); - //console.log(this.data_report_meta_hours); - //console.log("data_report_meta_goals = "); - //console.log(this.data_report_meta_goals); - //console.log("data_report_meta_days = "); - //console.log(this.data_report_meta_days); var data = { action: "savemetareflexion", userid: this.userid, courseid: this.courseid, weekcode: course_module.weekcode, - hours: this.current_week[0].weekly_schedules_hours.horas_planificadas, + hours: + this.current_week[0].weekly_schedules_hours.hours_planned, goals: this.current_week[0].weekly_schedules_goals, - days: JSON.stringify(this.current_week[0].weekly_schedules_days.dias_planificados), + days: JSON.stringify( + this.current_week[0].weekly_schedules_days.dias_planificados + ), }; Axios({ @@ -924,43 +691,6 @@ define([ }); }, - days_select(days) { - var days_committed = ""; - Object.values(days).forEach(function (elemento, indice) { - if (elemento) { - if (indice > 0 && days_committed) { - days_committed += ", "; - } - - switch (Object.keys(days)[indice]) { - case "lun": - days_committed += content.strings.currentweek_day_lun; - break; - case "mar": - days_committed += content.strings.currentweek_day_mar; - break; - case "mie": - days_committed += content.strings.currentweek_day_mie; - break; - case "jue": - days_committed += content.strings.currentweek_day_jue; - break; - case "vie": - days_committed += content.strings.currentweek_day_vie; - break; - case "sab": - days_committed += content.strings.currentweek_day_sab; - break; - case "dom": - days_committed += content.strings.currentweek_day_dom; - break; - } - } - }); - - return days_committed; - }, - actions_last_week() { if (this.data_report_meta_questions.id) { //console.log("update"); @@ -979,10 +709,14 @@ define([ weekcode: this.paginator_week.weekcode, classroom_hours: this.data_report_meta_questions.classroom_hours, hours_off: this.data_report_meta_questions.hours_off_course, - objectives_reached: this.data_report_meta_questions.questions[1].answer_selected, - previous_class: this.data_report_meta_questions.questions[2].answer_selected, - benefit: this.data_report_meta_questions.questions[3].answer_selected, - feeling: this.data_report_meta_questions.questions[4].answer_selected, + objectives_reached: + this.data_report_meta_questions.questions[1].answer_selected, + previous_class: + this.data_report_meta_questions.questions[2].answer_selected, + benefit: + this.data_report_meta_questions.questions[3].answer_selected, + feeling: + this.data_report_meta_questions.questions[4].answer_selected, }; //console.log("data = "); //console.log(data_params); @@ -996,7 +730,8 @@ define([ //console.log("then"); if (response.status == 200 && response.data.ok) { //console.log("if"); - this.data_report_meta_questions.id = response.data.data.response_save_last_week.id; + this.data_report_meta_questions.id = + response.data.data.response_save_last_week.id; Alertify.success(this.strings.last_week_created); //this.disabled_form = true; } else { @@ -1017,10 +752,14 @@ define([ lastweekid: this.data_report_meta_questions.id, classroom_hours: this.data_report_meta_questions.classroom_hours, hours_off: this.data_report_meta_questions.hours_off_course, - objectives_reached: this.data_report_meta_questions.questions[1].answer_selected, - previous_class: this.data_report_meta_questions.questions[2].answer_selected, - benefit: this.data_report_meta_questions.questions[3].answer_selected, - feeling: this.data_report_meta_questions.questions[4].answer_selected, + objectives_reached: + this.data_report_meta_questions.questions[1].answer_selected, + previous_class: + this.data_report_meta_questions.questions[2].answer_selected, + benefit: + this.data_report_meta_questions.questions[3].answer_selected, + feeling: + this.data_report_meta_questions.questions[4].answer_selected, }; Axios({ @@ -1052,12 +791,6 @@ define([ return icon_name; }, - full_day_name(day) { - return this.strings["currentweek_day_" + day]; - }, - - - // open_chart_help(chart) { // let contents = []; // let action = ""; @@ -1154,22 +887,8 @@ define([ }, get_interaction_group(week) { - // //console.log("this.past_week = "); - // //console.log(this.past_week); - // //console.log("this.data_report_meta_questions = "); - // //console.log(this.data_report_meta_questions); - this.get_interactions(week); - this.get_interacions_last_week(week); - // //console.log("this.data_report_meta_classroom = "); - // //console.log(this.data_report_meta_classroom); - // //console.log("this.data_report_meta_of_classroom = "); - // //console.log(this.data_report_meta_of_classroom); - // //console.log("this.data_report_meta_last_week = "); - // //console.log(this.data_report_meta_last_week); - //console.log("this.current_week = "); - //console.log(this.current_week); - // //console.log("this.past_week = "); - // //console.log(this.past_week); + this.get_interactions(week); + this.get_interacions_last_week(week); }, }, }); diff --git a/notemyprogress/amd/build/pageheader.min.js b/notemyprogress/amd/build/pageheader.min.js index 95322dd02b4f47548a88331addcba77ea9697572..cc97edbde494755a2e36216c5da71564c01c813c 100644 --- a/notemyprogress/amd/build/pageheader.min.js +++ b/notemyprogress/amd/build/pageheader.min.js @@ -1,2 +1,2 @@ -define ("local_notemyprogress/pageheader",["local_notemyprogress/axios"],function(a){return{template:"\n <v-layout class=\"font-weight-bold notemyprogress-page-title justify-space-between align-center\" id=\"page-header\">\n <v-flex class=\"d-flex pa-4\">\n <span v-text=\"pagetitle\"></span>\n </v-flex>\n \n <v-flex id=\"fml-group-selector\">\n <v-select\n attach \n v-model=\"selectedgroup\" \n v-if=\"usegroupselector()\" \n prepend-icon=\"group\" \n @change=\"update_group()\"\n :items=\"groups\" \n item-text=\"name\" \n item-value=\"id\">\n </v-select>\n </v-flex>\n \n <v-flex \n class=\"d-flex justify-end align-center flex-grow-0 notemyprogress-help-button pa-4 ml-8\" \n @click=\"dialog = !dialog\">\n <span class=\"mr-2 caption\" v-text=\"helptitle\"></span>\n <v-icon :color=\"'#ffffff'\">help_outline</v-icon>\n </v-flex>\n \n <v-dialog v-model=\"dialog\" width=\"500\" class=\"help-dialog\">\n <v-card>\n <v-card-title class=\"headline lighten-2 d-flex justify-center help-dialog-title\">\n <span v-text=\"helptitle\" class=\"help-modal-title mr-2\"></span><v-icon color=\"white\">help_outline</v-icon>\n </v-card-title>\n <v-card-text class=\"pt-4 pb-4 pr-8 pl-8 help-dialog-content\">\n <template v-for=\"(help, index, key) in helpcontents\">\n <v-layout class=\"mb-2\" :key=\"key\" column>\n <v-flex class=\"d-flex justify-center\">\n <span class=\"notemyprogress-sub-title mb-2\" v-html=\"help.title\"></span>\n </v-flex>\n <p v-html=\"help.description\" class=\"text-justify\"></p>\n </v-layout>\n </template>\n </v-card-text>\n <v-divider class=\"ma-0\"></v-divider>\n <v-card-actions class=\"d-flex justify-center help-dialog-footer\">\n <v-btn text @click=\"dialog = false\" v-text=\"exitbutton\" class=\"ma-0 fml-btn-secondary\"></v-btn>\n </v-card-actions>\n </v-card>\n </v-dialog>\n </v-layout>",props:["pagetitle","helptitle","helpcontents","exitbutton","groups","courseid","userid"],data:function data(){return{dialog:!1,selectedgroup:null}},mounted:function mounted(){this.set_selected_group()},methods:{update_group:function update_group(){var b={action:"changegroup",courseid:this.courseid,userid:this.userid,groupid:this.selectedgroup};a({method:"get",url:M.cfg.wwwroot+"/local/notemyprogress/ajax.php",params:b}).then(function(){location.reload()}).catch(function(){if(confirm("Error al cambiar de grupo. Necesitamos actualizar para evitar errores.")){location.reload()}else{location.reload()}})},usegroupselector:function usegroupselector(){var a=this.groups&&0<this.groups.length;return a},set_selected_group:function set_selected_group(){var a=this;if(!this.usegroupselector()){return null}this.groups.forEach(function(b){if(b.selected){a.selectedgroup=b}});if(!this.selectedgroup&&"undefined"!=typeof this.groups[0]){this.groups[0].selected=!0;this.selectedgroup=this.groups[0]}}}}}); +define ("local_notemyprogress/pageheader",["local_notemyprogress/axios"],function(a){return{template:"\n <v-layout class=\"font-weight-bold notemyprogress-page-title justify-space-between align-center\" id=\"page-header\">\n <v-flex class=\"d-flex pa-4\">\n <span v-text=\"pagetitle\"></span>\n </v-flex>\n \n <v-flex id=\"nmp-group-selector\">\n <v-select\n attach \n v-model=\"selectedgroup\" \n v-if=\"usegroupselector()\" \n prepend-icon=\"group\" \n @change=\"update_group()\"\n :items=\"groups\" \n item-text=\"name\" \n item-value=\"id\">\n </v-select>\n </v-flex>\n \n <v-flex \n class=\"d-flex justify-end align-center flex-grow-0 notemyprogress-help-button pa-4 ml-8\" \n @click=\"dialog = !dialog\">\n <span class=\"mr-2 caption\" v-text=\"helptitle\"></span>\n <v-icon :color=\"'#ffffff'\">help_outline</v-icon>\n </v-flex>\n \n <v-dialog v-model=\"dialog\" width=\"500\" class=\"help-dialog\">\n <v-card>\n <v-card-title class=\"headline lighten-2 d-flex justify-center help-dialog-title\">\n <span v-text=\"helptitle\" class=\"help-modal-title mr-2\"></span><v-icon color=\"white\">help_outline</v-icon>\n </v-card-title>\n <v-card-text class=\"pt-4 pb-4 pr-8 pl-8 help-dialog-content\">\n <template v-for=\"(help, index, key) in helpcontents\">\n <v-layout class=\"mb-2\" :key=\"key\" column>\n <v-flex class=\"d-flex justify-center\">\n <span class=\"notemyprogress-sub-title mb-2\" v-html=\"help.title\"></span>\n </v-flex>\n <p v-html=\"help.description\" class=\"text-justify\"></p>\n </v-layout>\n </template>\n </v-card-text>\n <v-divider class=\"ma-0\"></v-divider>\n <v-card-actions class=\"d-flex justify-center help-dialog-footer\">\n <v-btn text @click=\"dialog = false\" v-text=\"exitbutton\" class=\"ma-0 nmp-btn-secondary\"></v-btn>\n </v-card-actions>\n </v-card>\n </v-dialog>\n </v-layout>",props:["pagetitle","helptitle","helpcontents","exitbutton","groups","courseid","userid"],data:function data(){return{dialog:!1,selectedgroup:null}},mounted:function mounted(){this.set_selected_group()},methods:{update_group:function update_group(){var b={action:"changegroup",courseid:this.courseid,userid:this.userid,groupid:this.selectedgroup};a({method:"get",url:M.cfg.wwwroot+"/local/notemyprogress/ajax.php",params:b}).then(function(){location.reload()}).catch(function(){if(confirm("Error al cambiar de grupo. Necesitamos actualizar para evitar errores.")){location.reload()}else{location.reload()}})},usegroupselector:function usegroupselector(){var a=this.groups&&0<this.groups.length;return a},set_selected_group:function set_selected_group(){var a=this;if(!this.usegroupselector()){return null}this.groups.forEach(function(b){if(b.selected){a.selectedgroup=b}});if(!this.selectedgroup&&"undefined"!=typeof this.groups[0]){this.groups[0].selected=!0;this.selectedgroup=this.groups[0]}}}}}); //# sourceMappingURL=pageheader.min.js.map diff --git a/notemyprogress/amd/build/pageheader.min.js.map b/notemyprogress/amd/build/pageheader.min.js.map index faed09ab3e337a111f9594195009722c69385995..77baaacc1d062ae992f63f6b84a8154c3ced53b7 100644 --- a/notemyprogress/amd/build/pageheader.min.js.map +++ b/notemyprogress/amd/build/pageheader.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/pageheader.js"],"names":["define","Axios","template","props","data","dialog","selectedgroup","mounted","set_selected_group","methods","update_group","action","courseid","userid","groupid","method","url","M","cfg","wwwroot","params","then","location","reload","catch","confirm","usegroupselector","use","groups","length","forEach","group","selected"],"mappings":"AAAAA,OAAM,iCAAC,CAAC,0BAAD,CAAD,CAA+B,SAAUC,CAAV,CAAgB,CAwGjD,MAvGmB,CACfC,QAAQ,itFADO,CAiDfC,KAAK,CAAC,CAAC,WAAD,CAAa,WAAb,CAAyB,cAAzB,CAAwC,YAAxC,CAAqD,QAArD,CAA+D,UAA/D,CAA0E,QAA1E,CAjDS,CAkDfC,IAlDe,gBAkDT,CACF,MAAM,CACFC,MAAM,GADJ,CAEFC,aAAa,CAAG,IAFd,CAIT,CAvDc,CAwDfC,OAxDe,mBAwDN,CACL,KAAKC,kBAAL,EACH,CA1Dc,CA2DfC,OAAO,CAAG,CACNC,YADM,wBACQ,CACV,GAAIN,CAAAA,CAAI,CAAG,CACPO,MAAM,CAAG,aADF,CAEPC,QAAQ,CAAG,KAAKA,QAFT,CAGPC,MAAM,CAAG,KAAKA,MAHP,CAIPC,OAAO,CAAG,KAAKR,aAJR,CAAX,CAMAL,CAAK,CAAC,CACFc,MAAM,CAAC,KADL,CAEFC,GAAG,CAAEC,CAAC,CAACC,GAAF,CAAMC,OAAN,CAAgB,8BAFnB,CAGFC,MAAM,CAAGhB,CAHP,CAAD,CAAL,CAIGiB,IAJH,CAIQ,UAAc,CAClBC,QAAQ,CAACC,MAAT,EACH,CAND,EAMGC,KANH,CAMS,UAAO,CACZ,GAAGC,OAAO,CAAC,wEAAD,CAAV,CAAqF,CACjFH,QAAQ,CAACC,MAAT,EACH,CAFD,IAEK,CACDD,QAAQ,CAACC,MAAT,EACH,CACJ,CAZD,CAaH,CArBK,CAuBNG,gBAvBM,4BAuBY,CACd,GAAIC,CAAAA,CAAG,CAAG,KAAKC,MAAL,EAAoC,CAArB,MAAKA,MAAL,CAAYC,MAArC,CACA,MAAOF,CAAAA,CACV,CA1BK,CA4BNnB,kBA5BM,8BA4Bc,YAChB,GAAG,CAAC,KAAKkB,gBAAL,EAAJ,CAA6B,CACzB,MAAO,KACV,CACD,KAAKE,MAAL,CAAYE,OAAZ,CAAoB,SAAAC,CAAK,CAAI,CACzB,GAAGA,CAAK,CAACC,QAAT,CAAkB,CACd,CAAI,CAAC1B,aAAL,CAAqByB,CACxB,CACJ,CAJD,EAKA,GAAG,CAAC,KAAKzB,aAAN,EAAiD,WAA1B,QAAO,MAAKsB,MAAL,CAAY,CAAZ,CAAjC,CAAgE,CAC5D,KAAKA,MAAL,CAAY,CAAZ,EAAeI,QAAf,IACA,KAAK1B,aAAL,CAAqB,KAAKsB,MAAL,CAAY,CAAZ,CACxB,CACJ,CAzCK,CA3DK,CAwGtB,CAzGK,CAAN","sourcesContent":["define(['local_notemyprogress/axios'], function (Axios){\r\n const pageheader = {\r\n template:`\r\n <v-layout class=\"font-weight-bold notemyprogress-page-title justify-space-between align-center\" id=\"page-header\">\r\n <v-flex class=\"d-flex pa-4\">\r\n <span v-text=\"pagetitle\"></span>\r\n </v-flex>\r\n \r\n <v-flex id=\"fml-group-selector\">\r\n <v-select\r\n attach \r\n v-model=\"selectedgroup\" \r\n v-if=\"usegroupselector()\" \r\n prepend-icon=\"group\" \r\n @change=\"update_group()\"\r\n :items=\"groups\" \r\n item-text=\"name\" \r\n item-value=\"id\">\r\n </v-select>\r\n </v-flex>\r\n \r\n <v-flex \r\n class=\"d-flex justify-end align-center flex-grow-0 notemyprogress-help-button pa-4 ml-8\" \r\n @click=\"dialog = !dialog\">\r\n <span class=\"mr-2 caption\" v-text=\"helptitle\"></span>\r\n <v-icon :color=\"'#ffffff'\">help_outline</v-icon>\r\n </v-flex>\r\n \r\n <v-dialog v-model=\"dialog\" width=\"500\" class=\"help-dialog\">\r\n <v-card>\r\n <v-card-title class=\"headline lighten-2 d-flex justify-center help-dialog-title\">\r\n <span v-text=\"helptitle\" class=\"help-modal-title mr-2\"></span><v-icon color=\"white\">help_outline</v-icon>\r\n </v-card-title>\r\n <v-card-text class=\"pt-4 pb-4 pr-8 pl-8 help-dialog-content\">\r\n <template v-for=\"(help, index, key) in helpcontents\">\r\n <v-layout class=\"mb-2\" :key=\"key\" column>\r\n <v-flex class=\"d-flex justify-center\">\r\n <span class=\"notemyprogress-sub-title mb-2\" v-html=\"help.title\"></span>\r\n </v-flex>\r\n <p v-html=\"help.description\" class=\"text-justify\"></p>\r\n </v-layout>\r\n </template>\r\n </v-card-text>\r\n <v-divider class=\"ma-0\"></v-divider>\r\n <v-card-actions class=\"d-flex justify-center help-dialog-footer\">\r\n <v-btn text @click=\"dialog = false\" v-text=\"exitbutton\" class=\"ma-0 fml-btn-secondary\"></v-btn>\r\n </v-card-actions>\r\n </v-card>\r\n </v-dialog>\r\n </v-layout>`,\r\n props:['pagetitle','helptitle','helpcontents','exitbutton','groups', 'courseid','userid'],\r\n data(){\r\n return{\r\n dialog : false,\r\n selectedgroup : null,\r\n }\r\n },\r\n mounted(){\r\n this.set_selected_group();\r\n },\r\n methods : {\r\n update_group(){\r\n let data = {\r\n action : \"changegroup\",\r\n courseid : this.courseid,\r\n userid : this.userid,\r\n groupid : this.selectedgroup,\r\n }\r\n Axios({\r\n method:'get',\r\n url: M.cfg.wwwroot + \"/local/notemyprogress/ajax.php\",\r\n params : data,\r\n }).then((response) => {\r\n location.reload();\r\n }).catch((e) => {\r\n if(confirm(\"Error al cambiar de grupo. Necesitamos actualizar para evitar errores.\")){\r\n location.reload()\r\n }else{\r\n location.reload()\r\n }\r\n });\r\n },\r\n\r\n usegroupselector(){\r\n let use = this.groups && this.groups.length > 0;\r\n return use;\r\n },\r\n\r\n set_selected_group(){\r\n if(!this.usegroupselector()) {\r\n return null;\r\n }\r\n this.groups.forEach(group => {\r\n if(group.selected){\r\n this.selectedgroup = group;\r\n }\r\n })\r\n if(!this.selectedgroup && typeof(this.groups[0]) != 'undefined'){\r\n this.groups[0].selected = true;\r\n this.selectedgroup = this.groups[0];\r\n }\r\n }\r\n }\r\n }\r\n return pageheader;\r\n})"],"file":"pageheader.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/pageheader.js"],"names":["define","Axios","template","props","data","dialog","selectedgroup","mounted","set_selected_group","methods","update_group","action","courseid","userid","groupid","method","url","M","cfg","wwwroot","params","then","location","reload","catch","confirm","usegroupselector","use","groups","length","forEach","group","selected"],"mappings":"AAAAA,OAAM,iCAAC,CAAC,0BAAD,CAAD,CAA+B,SAAUC,CAAV,CAAgB,CAwGjD,MAvGmB,CACfC,QAAQ,itFADO,CAiDfC,KAAK,CAAC,CAAC,WAAD,CAAa,WAAb,CAAyB,cAAzB,CAAwC,YAAxC,CAAqD,QAArD,CAA+D,UAA/D,CAA0E,QAA1E,CAjDS,CAkDfC,IAlDe,gBAkDT,CACF,MAAM,CACFC,MAAM,GADJ,CAEFC,aAAa,CAAG,IAFd,CAIT,CAvDc,CAwDfC,OAxDe,mBAwDN,CACL,KAAKC,kBAAL,EACH,CA1Dc,CA2DfC,OAAO,CAAG,CACNC,YADM,wBACQ,CACV,GAAIN,CAAAA,CAAI,CAAG,CACPO,MAAM,CAAG,aADF,CAEPC,QAAQ,CAAG,KAAKA,QAFT,CAGPC,MAAM,CAAG,KAAKA,MAHP,CAIPC,OAAO,CAAG,KAAKR,aAJR,CAAX,CAMAL,CAAK,CAAC,CACFc,MAAM,CAAC,KADL,CAEFC,GAAG,CAAEC,CAAC,CAACC,GAAF,CAAMC,OAAN,CAAgB,8BAFnB,CAGFC,MAAM,CAAGhB,CAHP,CAAD,CAAL,CAIGiB,IAJH,CAIQ,UAAc,CAClBC,QAAQ,CAACC,MAAT,EACH,CAND,EAMGC,KANH,CAMS,UAAO,CACZ,GAAGC,OAAO,CAAC,wEAAD,CAAV,CAAqF,CACjFH,QAAQ,CAACC,MAAT,EACH,CAFD,IAEK,CACDD,QAAQ,CAACC,MAAT,EACH,CACJ,CAZD,CAaH,CArBK,CAuBNG,gBAvBM,4BAuBY,CACd,GAAIC,CAAAA,CAAG,CAAG,KAAKC,MAAL,EAAoC,CAArB,MAAKA,MAAL,CAAYC,MAArC,CACA,MAAOF,CAAAA,CACV,CA1BK,CA4BNnB,kBA5BM,8BA4Bc,YAChB,GAAG,CAAC,KAAKkB,gBAAL,EAAJ,CAA6B,CACzB,MAAO,KACV,CACD,KAAKE,MAAL,CAAYE,OAAZ,CAAoB,SAAAC,CAAK,CAAI,CACzB,GAAGA,CAAK,CAACC,QAAT,CAAkB,CACd,CAAI,CAAC1B,aAAL,CAAqByB,CACxB,CACJ,CAJD,EAKA,GAAG,CAAC,KAAKzB,aAAN,EAAiD,WAA1B,QAAO,MAAKsB,MAAL,CAAY,CAAZ,CAAjC,CAAgE,CAC5D,KAAKA,MAAL,CAAY,CAAZ,EAAeI,QAAf,IACA,KAAK1B,aAAL,CAAqB,KAAKsB,MAAL,CAAY,CAAZ,CACxB,CACJ,CAzCK,CA3DK,CAwGtB,CAzGK,CAAN","sourcesContent":["define(['local_notemyprogress/axios'], function (Axios){\r\n const pageheader = {\r\n template:`\r\n <v-layout class=\"font-weight-bold notemyprogress-page-title justify-space-between align-center\" id=\"page-header\">\r\n <v-flex class=\"d-flex pa-4\">\r\n <span v-text=\"pagetitle\"></span>\r\n </v-flex>\r\n \r\n <v-flex id=\"nmp-group-selector\">\r\n <v-select\r\n attach \r\n v-model=\"selectedgroup\" \r\n v-if=\"usegroupselector()\" \r\n prepend-icon=\"group\" \r\n @change=\"update_group()\"\r\n :items=\"groups\" \r\n item-text=\"name\" \r\n item-value=\"id\">\r\n </v-select>\r\n </v-flex>\r\n \r\n <v-flex \r\n class=\"d-flex justify-end align-center flex-grow-0 notemyprogress-help-button pa-4 ml-8\" \r\n @click=\"dialog = !dialog\">\r\n <span class=\"mr-2 caption\" v-text=\"helptitle\"></span>\r\n <v-icon :color=\"'#ffffff'\">help_outline</v-icon>\r\n </v-flex>\r\n \r\n <v-dialog v-model=\"dialog\" width=\"500\" class=\"help-dialog\">\r\n <v-card>\r\n <v-card-title class=\"headline lighten-2 d-flex justify-center help-dialog-title\">\r\n <span v-text=\"helptitle\" class=\"help-modal-title mr-2\"></span><v-icon color=\"white\">help_outline</v-icon>\r\n </v-card-title>\r\n <v-card-text class=\"pt-4 pb-4 pr-8 pl-8 help-dialog-content\">\r\n <template v-for=\"(help, index, key) in helpcontents\">\r\n <v-layout class=\"mb-2\" :key=\"key\" column>\r\n <v-flex class=\"d-flex justify-center\">\r\n <span class=\"notemyprogress-sub-title mb-2\" v-html=\"help.title\"></span>\r\n </v-flex>\r\n <p v-html=\"help.description\" class=\"text-justify\"></p>\r\n </v-layout>\r\n </template>\r\n </v-card-text>\r\n <v-divider class=\"ma-0\"></v-divider>\r\n <v-card-actions class=\"d-flex justify-center help-dialog-footer\">\r\n <v-btn text @click=\"dialog = false\" v-text=\"exitbutton\" class=\"ma-0 nmp-btn-secondary\"></v-btn>\r\n </v-card-actions>\r\n </v-card>\r\n </v-dialog>\r\n </v-layout>`,\r\n props:['pagetitle','helptitle','helpcontents','exitbutton','groups', 'courseid','userid'],\r\n data(){\r\n return{\r\n dialog : false,\r\n selectedgroup : null,\r\n }\r\n },\r\n mounted(){\r\n this.set_selected_group();\r\n },\r\n methods : {\r\n update_group(){\r\n let data = {\r\n action : \"changegroup\",\r\n courseid : this.courseid,\r\n userid : this.userid,\r\n groupid : this.selectedgroup,\r\n }\r\n Axios({\r\n method:'get',\r\n url: M.cfg.wwwroot + \"/local/notemyprogress/ajax.php\",\r\n params : data,\r\n }).then((response) => {\r\n location.reload();\r\n }).catch((e) => {\r\n if(confirm(\"Error al cambiar de grupo. Necesitamos actualizar para evitar errores.\")){\r\n location.reload()\r\n }else{\r\n location.reload()\r\n }\r\n });\r\n },\r\n\r\n usegroupselector(){\r\n let use = this.groups && this.groups.length > 0;\r\n return use;\r\n },\r\n\r\n set_selected_group(){\r\n if(!this.usegroupselector()) {\r\n return null;\r\n }\r\n this.groups.forEach(group => {\r\n if(group.selected){\r\n this.selectedgroup = group;\r\n }\r\n })\r\n if(!this.selectedgroup && typeof(this.groups[0]) != 'undefined'){\r\n this.groups[0].selected = true;\r\n this.selectedgroup = this.groups[0];\r\n }\r\n }\r\n }\r\n }\r\n return pageheader;\r\n})"],"file":"pageheader.min.js"} \ No newline at end of file diff --git a/notemyprogress/amd/build/setweeks.js b/notemyprogress/amd/build/setweeks.js new file mode 100644 index 0000000000000000000000000000000000000000..97747ff54aaaec5c2f70c023b3278d342eb12f20 --- /dev/null +++ b/notemyprogress/amd/build/setweeks.js @@ -0,0 +1,405 @@ +define([ + "local_notemyprogress/vue", + "local_notemyprogress/vuetify", + "local_notemyprogress/axios", + "local_notemyprogress/sortablejs", + "local_notemyprogress/draggable", + "local_notemyprogress/datepicker", + "local_notemyprogress/moment", + "local_notemyprogress/alertify", + "local_notemyprogress/pageheader", +], function ( + Vue, + Vuetify, + Axios, + Sortable, + Draggable, + Datepicker, + Moment, + Alertify, + Pageheader +) { + "use strict"; + + function init(content) { + content = add_collapsabled_property_to_weeks(content); + Vue.use(Vuetify); + Vue.component("draggable", Draggable); + Vue.component("datepicker", Datepicker); + Vue.component("pageheader", Pageheader); + const app = new Vue({ + delimiters: ["[[", "]]"], + el: "#setweeks", + vuetify: new Vuetify(), + data: { + display_settings: false, + settings: content.settings, + new_group: false, + scroll_mode: false, + weeks_started_at: new Date( + Moment(Number(content.weeks[0].weekstart) * 1000) + ), + strings: content.strings, + sections: content.sections, + courseid: content.courseid, + userid: content.userid, + raw_weeks: content.weeks, + disabled_dates: { + days: [0, 2, 3, 4, 5, 6], + }, + saving_loader: false, + error_messages: [], + save_successful: false, + }, + mounted() { + document.querySelector("#setweeks-loader").style.display = "none"; + document.querySelector("#setweeks").style.display = "block"; + }, + computed: { + weeks() { + for (let i = 0; i < this.raw_weeks.length; i++) { + let week = this.raw_weeks[i]; + if (i == 0) { + let start_weeks = this.weeks_started_at; + week.weekstart = start_weeks; + week.weekend = this.get_end_week(this.weeks_started_at); + } else { + week.weekstart = this.get_start_week( + this.raw_weeks[i - 1].weekend + ); + week.weekend = this.get_end_week(week.weekstart); + } + } + return this.raw_weeks; + }, + }, + methods: { + section_name(section) { + let name = null; + if ( + typeof section.section_name != "undefined" && + section.section_name.length > 0 + ) { + name = section.section_name; + } else { + name = section.name; + } + return name; + }, + + section_exist(section) { + let exist = true; + if ( + typeof section != "undefined" && + typeof section.exists != "undefined" && + section.exists == false + ) { + exist = false; + } + return exist; + }, + + format_name(name, position) { + return name + " " + (position + 1); + }, + + customFormatter(date) { + let weeks_start_at = Moment(date).format("YYYY-MM-DD"); + return weeks_start_at; + }, + + add_week() { + this.raw_weeks.push({ + name: this.strings.week, + position: this.weeks.length + 1, + weekstart: null, + weekend: null, + collapsabled: false, + hours_dedications: 0, + removable: true, + sections: [], + }); + }, + + has_items(array) { + return array.length > 0; + }, + + remove_week(week, index) { + if (index == 0) { + return null; + } + this.close_delete_confirm(); + for (let i = 0; i < week.sections.length; i++) { + this.sections.push(week.sections[i]); + } + let element_index = this.raw_weeks.indexOf(week); + this.raw_weeks.splice(element_index, 1); + }, + + ask_delete_confirm() { + this.delete_confirm = true; + }, + + close_delete_confirm() { + this.delete_confirm = false; + }, + + get_start_week(pass_week) { + let start_date = Moment(Moment(pass_week).add(1, "days")).format( + "YYYY-MM-DD" + ); + return start_date; + }, + + get_end_week(start_week) { + let end_date = Moment(Moment(start_week).add(6, "days")).format( + "YYYY-MM-DD" + ); + return end_date; + }, + + get_date_next_day(requested_day, date, output_format = null) { + requested_day = requested_day.toLowerCase(); + let current_day = Moment(date).format("dddd").toLowerCase(); + while (current_day != requested_day) { + date = Moment(date).add(1, "days"); + current_day = Moment(date).format("dddd").toLowerCase(); + } + if (output_format) { + date = date.format(output_format); + } else { + if (typeof date != "number") { + date = parseInt(date.format("x")); + } + } + return date; + }, + + position(index) { + index++; + return `${index} - `; + }, + + save_changes() { + this.save_successful = false; + this.error_messages = []; + if (this.empty_weeks()) { + this.saving_loader = false; + Alertify.error(this.strings.error_empty_week); + this.error_messages.push(this.strings.error_empty_week); + return false; + } + if (this.weeks_deleted_from_course()) { + this.saving_loader = false; + this.error_messages.push(this.strings.error_section_removed); + return false; + } + + Alertify.confirm( + this.strings.save_warning_content, + () => { + this.saving_loader = true; + var weeks = this.weeks; + weeks[0].weekstart = Moment(weeks[0].weekstart).format( + "YYYY-MM-DD" + ); + var data = { + action: "saveconfigweek", + userid: this.userid, + courseid: this.courseid, + newinstance: this.new_group, + weeks: this.minify_query(weeks), // Stringify is a hack to clone object :D + }; + + Axios({ + method: "get", + url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", + params: data, + }) + .then((response) => { + console.log("then1"); + if (response.status == 200 && response.data.ok) { + console.log("then1.2"); + this.settings = response.data.data.settings; + console.log("then1.3"); + Alertify.success(this.strings.save_successful); + console.log("then1.4"); + this.save_successful = true; + console.log("then1.5"); + } else { + console.log("then1.6"); + Alertify.error(this.strings.error_network); + console.log("then1.7"); + this.error_messages.push(this.strings.error_network); + console.log("then1.8"); + } + }) + .catch((e) => { + console.log("catch1"); + Alertify.error(this.strings.error_network); + console.log("catch2"); + this.error_messages.push(this.strings.error_network); + console.log("catch3"); + }) + .finally(() => { + console.log("finally1"); + this.saving_loader = false; + console.log("finally2"); + //this.addLogsIntoDB("saved", "configuration", "weeks", "Saved a new configuration for the weeks !"); + }); + }, + () => { + // ON CANCEL + this.saving_loader = false; + Alertify.warning(this.strings.cancel_action); + } + ) + .set({ title: this.strings.save_warning_title }) + .set({ + labels: { + cancel: this.strings.confirm_cancel, + ok: this.strings.confirm_ok, + }, + }); + }, + + minify_query(weeks) { + var minify = []; + weeks.forEach((week) => { + var wk = new Object(); + wk.h = week.hours_dedications; + wk.s = week.weekstart; + wk.e = week.weekend; + wk.sections = []; + week.sections.forEach((section) => { + var s = new Object(); + s.sid = section.sectionid; + wk.sections.push(s); + }); + minify.push(wk); + }); + return JSON.stringify(minify); + }, + + empty_weeks() { + if (this.weeks.length >= 2 && this.weeks[0].sections.length < 1) { + return true; + } + for (let i = 0; i < this.weeks.length; i++) { + if (i > 0 && this.weeks[i].sections.length <= 0) { + return true; + } + } + return false; + }, + + weeks_deleted_from_course() { + for ( + var week_position = 0; + week_position < this.weeks.length; + week_position++ + ) { + for ( + var section_position = 0; + section_position < this.weeks[week_position].sections.length; + section_position++ + ) { + if ( + !this.section_exist( + this.weeks[week_position].sections[section_position] + ) + ) { + return true; + } + } + } + return false; + }, + + exists_mistakes() { + let exists_mistakes = this.error_messages.length > 0; + return exists_mistakes; + }, + + change_collapsabled(index) { + this.raw_weeks[index].collapsabled = + !this.raw_weeks[index].collapsabled; + }, + + course_finished() { + let finished = false; + let last = this.weeks.length - 1; + let end = Moment(this.weeks[last].weekend).format("X"); + let now = Moment().format("X"); + if (now > end) { + finished = true; + } else { + finished = false; + } + return finished; + }, + + get_settings_status() { + let visible = true; + Object.keys(this.settings).map((key) => { + if (!this.settings[key]) { + visible = false; + } + }); + let status = visible + ? this.strings.plugin_visible + : this.strings.plugin_hidden; + return status; + }, + + get_help_content() { + var help_contents = []; + var help = new Object(); + help.title = this.strings.title; + help.description = this.strings.description; + help_contents.push(help); + return help_contents; + }, + + addLogsIntoDB(action, objectName, objectType, objectDescription) { + let data = { + courseid: content.courseid, + userid: content.userid, + action: "addLogs", + sectionname: "CONFIGURATION_COURSE_WEEK", + actiontype: action, + objectType: objectType, + objectName: objectName, + currentUrl: document.location.href, + objectDescription: objectDescription, + }; + Axios({ + method: "get", + url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", + params: data, + }) + .then((response) => { + if (response.status == 200 && response.data.ok) { + } + }) + .catch((e) => {}); + }, + }, + }); + } + + function add_collapsabled_property_to_weeks(content) { + for (let i = 0; i < content.weeks.length; i++) { + let week = content.weeks[i]; + if (typeof week.collapsabled == "undefined") { + week.collapsabled = false; + } + } + return content; + } + + return { + init: init, + }; +}); diff --git a/notemyprogress/amd/build/setweeks.min.js b/notemyprogress/amd/build/setweeks.min.js deleted file mode 100644 index 1778d291787f6ab4ed573792ba4f124a58fde741..0000000000000000000000000000000000000000 --- a/notemyprogress/amd/build/setweeks.min.js +++ /dev/null @@ -1,303 +0,0 @@ -define([ - "local_notemyprogress/vue", - "local_notemyprogress/vuetify", - "local_notemyprogress/axios", - "local_notemyprogress/sortablejs", - "local_notemyprogress/draggable", - "local_notemyprogress/datepicker", - "local_notemyprogress/moment", - "local_notemyprogress/alertify", - "local_notemyprogress/pageheader", -], function (e, s, t, r, i, n, o, a, l) { - "use strict"; - return { - init: function (r) { - (r = (function (e) { - for (let s = 0; s < e.weeks.length; s++) { - let t = e.weeks[s]; - void 0 === t.collapsabled && (t.collapsabled = !1); - } - return e; - })(r)), - e.use(s), - e.component("draggable", i), - e.component("datepicker", n), - e.component("pageheader", l), - new e({ - delimiters: ["[[", "]]"], - el: "#setweeks", - vuetify: new s(), - data: { - display_settings: !1, - settings: r.settings, - new_group: !1, - scroll_mode: !1, - weeks_started_at: new Date(o(1e3 * Number(r.weeks[0].weekstart))), - strings: r.strings, - sections: r.sections, - courseid: r.courseid, - userid: r.userid, - raw_weeks: r.weeks, - disabled_dates: { days: [0, 2, 3, 4, 5, 6] }, - saving_loader: !1, - error_messages: [], - save_successful: !1, - }, - mounted() { - (document.querySelector("#setweeks-loader").style.display = "none"), - (document.querySelector("#setweeks").style.display = "block"); - }, - computed: { - weeks() { - for (let e = 0; e < this.raw_weeks.length; e++) { - let s = this.raw_weeks[e]; - if (0 == e) { - let e = this.weeks_started_at; - (s.weekstart = e), - (s.weekend = this.get_end_week(this.weeks_started_at)); - } else - (s.weekstart = this.get_start_week( - this.raw_weeks[e - 1].weekend - )), - (s.weekend = this.get_end_week(s.weekstart)); - } - return this.raw_weeks; - }, - }, - methods: { - section_name(e) { - let s = null; - return (s = - void 0 !== e.section_name && e.section_name.length > 0 - ? e.section_name - : e.name); - }, - section_exist(e) { - let s = !0; - return ( - void 0 !== e && - void 0 !== e.exists && - 0 == e.exists && - (s = !1), - s - ); - }, - format_name: (e, s) => e + " " + (s + 1), - customFormatter: (e) => o(e).format("YYYY-MM-DD"), - add_week() { - this.raw_weeks.push({ - name: this.strings.week, - position: this.weeks.length + 1, - weekstart: null, - weekend: null, - collapsabled: !1, - hours_dedications: 0, - removable: !0, - sections: [], - }); - }, - has_items: (e) => e.length > 0, - remove_week(e, s) { - if (0 == s) return null; - this.close_delete_confirm(); - for (let s = 0; s < e.sections.length; s++) - this.sections.push(e.sections[s]); - let t = this.raw_weeks.indexOf(e); - this.raw_weeks.splice(t, 1); - }, - ask_delete_confirm() { - this.delete_confirm = !0; - }, - close_delete_confirm() { - this.delete_confirm = !1; - }, - get_start_week: (e) => o(o(e).add(1, "days")).format("YYYY-MM-DD"), - get_end_week: (e) => o(o(e).add(6, "days")).format("YYYY-MM-DD"), - get_date_next_day(e, s, t = null) { - e = e.toLowerCase(); - let r = o(s).format("dddd").toLowerCase(); - for (; r != e; ) - (s = o(s).add(1, "days")), - (r = o(s).format("dddd").toLowerCase()); - return ( - t - ? (s = s.format(t)) - : "number" != typeof s && (s = parseInt(s.format("x"))), - s - ); - }, - position: (e) => `${++e} - `, - save_changes() { - return ( - (this.save_successful = !1), - (this.error_messages = []), - this.empty_weeks() - ? ((this.saving_loader = !1), - a.error(this.strings.error_empty_week), - this.error_messages.push(this.strings.error_empty_week), - !1) - : this.weeks_deleted_from_course() - ? ((this.saving_loader = !1), - this.error_messages.push( - this.strings.error_section_removed - ), - !1) - : void a - .confirm( - this.strings.save_warning_content, - () => { - this.saving_loader = !0; - var e = this.weeks; - e[0].weekstart = o(e[0].weekstart).format( - "YYYY-MM-DD" - ); - var s = { - action: "saveconfigweek", - userid: this.userid, - courseid: this.courseid, - newinstance: this.new_group, - weeks: this.minify_query(e), - }; - t({ - method: "get", - url: - M.cfg.wwwroot + "/local/notemyprogress/ajax.php", - params: s, - }) - .then((e) => { - console.log("then1"), - 200 == e.status && e.data.ok - ? (console.log("then1.2"), - (this.settings = e.data.data.settings), - console.log("then1.3"), - a.success(this.strings.save_successful), - console.log("then1.4"), - (this.save_successful = !0), - console.log("then1.5")) - : (console.log("then1.6"), - a.error(this.strings.error_network), - console.log("then1.7"), - this.error_messages.push( - this.strings.error_network - ), - console.log("then1.8")); - }) - .catch((e) => { - console.log("catch1"), - a.error(this.strings.error_network), - console.log("catch2"), - this.error_messages.push( - this.strings.error_network - ), - console.log("catch3"); - }) - .finally(() => { - console.log("finally1"), - (this.saving_loader = !1), - console.log("finally2"); - }); - }, - () => { - (this.saving_loader = !1), - a.warning(this.strings.cancel_action); - } - ) - .set({ title: this.strings.save_warning_title }) - .set({ - labels: { - cancel: this.strings.confirm_cancel, - ok: this.strings.confirm_ok, - }, - }) - ); - }, - minify_query(e) { - var s = []; - return ( - e.forEach((e) => { - var t = new Object(); - (t.h = e.hours_dedications), - (t.s = e.weekstart), - (t.e = e.weekend), - (t.sections = []), - e.sections.forEach((e) => { - var s = new Object(); - (s.sid = e.sectionid), t.sections.push(s); - }), - s.push(t); - }), - JSON.stringify(s) - ); - }, - empty_weeks() { - if (this.weeks.length >= 2 && this.weeks[0].sections.length < 1) - return !0; - for (let e = 0; e < this.weeks.length; e++) - if (e > 0 && this.weeks[e].sections.length <= 0) return !0; - return !1; - }, - weeks_deleted_from_course() { - for (var e = 0; e < this.weeks.length; e++) - for (var s = 0; s < this.weeks[e].sections.length; s++) - if (!this.section_exist(this.weeks[e].sections[s])) return !0; - return !1; - }, - exists_mistakes() { - return this.error_messages.length > 0; - }, - change_collapsabled(e) { - this.raw_weeks[e].collapsabled = !this.raw_weeks[e].collapsabled; - }, - course_finished() { - let e = !1, - s = this.weeks.length - 1, - t = o(this.weeks[s].weekend).format("X"); - return (e = o().format("X") > t); - }, - get_settings_status() { - let e = !0; - return ( - Object.keys(this.settings).map((s) => { - this.settings[s] || (e = !1); - }), - e ? this.strings.plugin_visible : this.strings.plugin_hidden - ); - }, - get_help_content() { - var e = [], - s = new Object(); - return ( - (s.title = this.strings.title), - (s.description = this.strings.description), - e.push(s), - e - ); - }, - addLogsIntoDB(e, s, i, n) { - let o = { - courseid: r.courseid, - userid: r.userid, - action: "addLogs", - sectionname: "CONFIGURATION_COURSE_WEEK", - actiontype: e, - objectType: i, - objectName: s, - currentUrl: document.location.href, - objectDescription: n, - }; - t({ - method: "get", - url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", - params: o, - }) - .then((e) => { - 200 == e.status && e.data.ok; - }) - .catch((e) => {}); - }, - }, - }); - }, - }; -}); -//# sourceMappingURL=setweeks.min.js.map diff --git a/notemyprogress/amd/build/setweeks.min.js.map b/notemyprogress/amd/build/setweeks.min.js.map deleted file mode 100644 index 33a2678b6cb9c5358b585fef20cf046a7e9a9a29..0000000000000000000000000000000000000000 --- a/notemyprogress/amd/build/setweeks.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/setweeks.js"],"names":["define","Vue","Vuetify","Axios","Sortable","Draggable","Datepicker","Moment","Alertify","Pageheader","add_collapsabled_property_to_weeks","content","i","week","weeks","length","collapsabled","init","use","component","delimiters","el","vuetify","data","display_settings","settings","new_group","scroll_mode","weeks_started_at","Date","weekstart","strings","sections","courseid","userid","raw_weeks","disabled_dates","days","saving_loader","error_messages","save_successful","mounted","document","querySelector","style","display","computed","start_weeks","weekend","get_end_week","get_start_week","methods","section_name","section","name","section_exist","exist","exists","format_name","position","customFormatter","date","weeks_start_at","format","add_week","push","hours_dedications","removable","has_items","array","remove_week","index","close_delete_confirm","element_index","indexOf","splice","ask_delete_confirm","delete_confirm","pass_week","start_date","add","start_week","end_date","get_date_next_day","requested_day","output_format","toLowerCase","current_day","parseInt","save_changes","empty_weeks","error","error_empty_week","weeks_deleted_from_course","error_section_removed","confirm","save_warning_content","action","newinstance","minify_query","method","url","M","cfg","wwwroot","params","then","response","status","ok","success","error_network","catch","finally","warning","cancel_action","set","title","save_warning_title","labels","cancel","confirm_cancel","confirm_ok","minify","forEach","wk","h","s","e","sid","sectionid","JSON","stringify","week_position","section_position","exists_mistakes","change_collapsabled","course_finished","finished","last","end","now","get_settings_status","visible","Object","keys","map","key","plugin_visible","plugin_hidden","get_help_content","help_contents","help","description"],"mappings":"AAAAA,OAAM,+BAAC,CAAC,wBAAD,CACC,4BADD,CAEC,0BAFD,CAGC,+BAHD,CAIC,8BAJD,CAKC,+BALD,CAMC,2BAND,CAOC,6BAPD,CAQC,+BARD,CAAD,CAUF,SAASC,CAAT,CAAcC,CAAd,CAAuBC,CAAvB,CAA8BC,CAA9B,CAAwCC,CAAxC,CAAmDC,CAAnD,CAA+DC,CAA/D,CAAuEC,CAAvE,CAAiFC,CAAjF,CAA6F,CACzF,aAgSA,QAASC,CAAAA,CAAT,CAA4CC,CAA5C,CAAqD,CACjD,IAAK,GAAIC,CAAAA,CAAC,CAAG,CAAR,CACGC,CADR,CAAgBD,CAAC,CAAGD,CAAO,CAACG,KAAR,CAAcC,MAAlC,CAA0CH,CAAC,EAA3C,CAA+C,CACvCC,CADuC,CAChCF,CAAO,CAACG,KAAR,CAAcF,CAAd,CADgC,CAE3C,GAAkC,WAA9B,QAAQC,CAAAA,CAAI,CAACG,YAAjB,CAA+C,CAC3CH,CAAI,CAACG,YAAL,GACH,CACJ,CACD,MAAOL,CAAAA,CACV,CAED,MAAO,CACHM,IAAI,CAzSR,SAAcN,CAAd,CAAuB,CACnBA,CAAO,CAAGD,CAAkC,CAACC,CAAD,CAA5C,CACAV,CAAG,CAACiB,GAAJ,CAAQhB,CAAR,EACAD,CAAG,CAACkB,SAAJ,CAAc,WAAd,CAA2Bd,CAA3B,EACAJ,CAAG,CAACkB,SAAJ,CAAc,YAAd,CAA4Bb,CAA5B,EACAL,CAAG,CAACkB,SAAJ,CAAc,YAAd,CAA4BV,CAA5B,EACY,GAAIR,CAAAA,CAAJ,CAAQ,CAChBmB,UAAU,CAAE,CAAC,IAAD,CAAO,IAAP,CADI,CAEhBC,EAAE,CAAE,WAFY,CAGhBC,OAAO,CAAE,GAAIpB,CAAAA,CAHG,CAIhBqB,IAAI,CAAE,CACFC,gBAAgB,GADd,CAEFC,QAAQ,CAAEd,CAAO,CAACc,QAFhB,CAGFC,SAAS,GAHP,CAIFC,WAAW,GAJT,CAKFC,gBAAgB,CAAE,GAAIC,CAAAA,IAAJ,CAAStB,CAAM,CAAoC,GAAnC,EAAOI,CAAO,CAACG,KAAR,CAAc,CAAd,EAAiBgB,SAAzB,CAAf,CALhB,CAMFC,OAAO,CAAEpB,CAAO,CAACoB,OANf,CAOFC,QAAQ,CAAErB,CAAO,CAACqB,QAPhB,CAQFC,QAAQ,CAAEtB,CAAO,CAACsB,QARhB,CASFC,MAAM,CAAEvB,CAAO,CAACuB,MATd,CAUFC,SAAS,CAAExB,CAAO,CAACG,KAVjB,CAWFsB,cAAc,CAAE,CACZC,IAAI,CAAE,CAAC,CAAD,CAAI,CAAJ,CAAO,CAAP,CAAU,CAAV,CAAa,CAAb,CAAgB,CAAhB,CADM,CAXd,CAcFC,aAAa,GAdX,CAeFC,cAAc,CAAE,EAfd,CAgBFC,eAAe,GAhBb,CAJU,CAsBhBC,OAtBgB,mBAsBN,CACNC,QAAQ,CAACC,aAAT,CAAuB,kBAAvB,EAA2CC,KAA3C,CAAiDC,OAAjD,CAA2D,MAA3D,CACAH,QAAQ,CAACC,aAAT,CAAuB,WAAvB,EAAoCC,KAApC,CAA0CC,OAA1C,CAAoD,OACvD,CAzBe,CA0BhBC,QAAQ,CAAE,CACNhC,KADM,iBACE,CACJ,IAAK,GAAIF,CAAAA,CAAC,CAAG,CAAR,CACGC,CADR,CAAgBD,CAAC,CAAG,KAAKuB,SAAL,CAAepB,MAAnC,CAA2CH,CAAC,EAA5C,CAAgD,CACxCC,CADwC,CACjC,KAAKsB,SAAL,CAAevB,CAAf,CADiC,CAE5C,GAAS,CAAL,EAAAA,CAAJ,CAAY,CACR,GAAImC,CAAAA,CAAW,CAAG,KAAKnB,gBAAvB,CACAf,CAAI,CAACiB,SAAL,CAAiBiB,CAAjB,CACAlC,CAAI,CAACmC,OAAL,CAAe,KAAKC,YAAL,CAAkB,KAAKrB,gBAAvB,CAClB,CAJD,IAIO,CACHf,CAAI,CAACiB,SAAL,CAAiB,KAAKoB,cAAL,CAAoB,KAAKf,SAAL,CAAevB,CAAC,CAAG,CAAnB,EAAsBoC,OAA1C,CAAjB,CACAnC,CAAI,CAACmC,OAAL,CAAe,KAAKC,YAAL,CAAkBpC,CAAI,CAACiB,SAAvB,CAClB,CACJ,CACD,MAAO,MAAKK,SACf,CAdK,CA1BM,CA0ChBgB,OAAO,CAAE,CACLC,YADK,uBACQC,CADR,CACiB,CAClB,GAAIC,CAAAA,CAAI,CAAG,IAAX,CACA,GAAqC,WAAjC,QAAQD,CAAAA,CAAO,CAACD,YAAhB,EAA8E,CAA9B,CAAAC,CAAO,CAACD,YAAR,CAAqBrC,MAAzE,CAAqF,CACjFuC,CAAI,CAAGD,CAAO,CAACD,YAClB,CAFD,IAEO,CACHE,CAAI,CAAGD,CAAO,CAACC,IAClB,CACD,MAAOA,CAAAA,CACV,CATI,CAWLC,aAXK,wBAWSF,CAXT,CAWkB,CACnB,GAAIG,CAAAA,CAAK,GAAT,CACA,GAAwB,WAApB,QAAQH,CAAAA,CAAR,EAA8D,WAA3B,QAAQA,CAAAA,CAAO,CAACI,MAAnD,EAA6E,IAAAJ,CAAO,CAACI,MAAzF,CAA0G,CACtGD,CAAK,GACR,CACD,MAAOA,CAAAA,CACV,CAjBI,CAmBLE,WAnBK,sBAmBOJ,CAnBP,CAmBaK,CAnBb,CAmBuB,CACxB,MAAOL,CAAAA,CAAI,CAAG,GAAP,EAAcK,CAAQ,CAAG,CAAzB,CACV,CArBI,CAuBLC,eAvBK,0BAuBWC,CAvBX,CAuBiB,CAClB,GAAIC,CAAAA,CAAc,CAAGvD,CAAM,CAACsD,CAAD,CAAN,CAAaE,MAAb,CAAoB,YAApB,CAArB,CACA,MAAOD,CAAAA,CACV,CA1BI,CA4BLE,QA5BK,oBA4BM,CACP,KAAK7B,SAAL,CAAe8B,IAAf,CAAoB,CAChBX,IAAI,CAAE,KAAKvB,OAAL,CAAalB,IADH,CAEhB8C,QAAQ,CAAG,KAAK7C,KAAL,CAAWC,MAAX,CAAoB,CAFf,CAGhBe,SAAS,CAAE,IAHK,CAIhBkB,OAAO,CAAE,IAJO,CAKhBhC,YAAY,GALI,CAMhBkD,iBAAiB,CAAE,CANH,CAOhBC,SAAS,GAPO,CAQhBnC,QAAQ,CAAE,EARM,CAApB,CAUH,CAvCI,CAyCLoC,SAzCK,oBAyCKC,CAzCL,CAyCY,CACb,MAAsB,EAAf,CAAAA,CAAK,CAACtD,MAChB,CA3CI,CA6CLuD,WA7CK,sBA6COzD,CA7CP,CA6Ca0D,CA7Cb,CA6CoB,CACrB,GAAa,CAAT,EAAAA,CAAJ,CAAgB,CACZ,MAAO,KACV,CACD,KAAKC,oBAAL,GACA,IAAK,GAAI5D,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGC,CAAI,CAACmB,QAAL,CAAcjB,MAAlC,CAA0CH,CAAC,EAA3C,CAA+C,CAC3C,KAAKoB,QAAL,CAAciC,IAAd,CAAmBpD,CAAI,CAACmB,QAAL,CAAcpB,CAAd,CAAnB,CACH,CACD,GAAI6D,CAAAA,CAAa,CAAG,KAAKtC,SAAL,CAAeuC,OAAf,CAAuB7D,CAAvB,CAApB,CACA,KAAKsB,SAAL,CAAewC,MAAf,CAAsBF,CAAtB,CAAqC,CAArC,CACH,CAvDI,CAyDLG,kBAzDK,8BAyDgB,CACjB,KAAKC,cAAL,GACH,CA3DI,CA6DLL,oBA7DK,gCA6DkB,CACnB,KAAKK,cAAL,GACH,CA/DI,CAiEL3B,cAjEK,yBAiEU4B,CAjEV,CAiEqB,CACtB,GAAIC,CAAAA,CAAU,CAAGxE,CAAM,CAACA,CAAM,CAACuE,CAAD,CAAN,CAAkBE,GAAlB,CAAsB,CAAtB,CAAyB,MAAzB,CAAD,CAAN,CAAyCjB,MAAzC,CAAgD,YAAhD,CAAjB,CACA,MAAOgB,CAAAA,CACV,CApEI,CAsEL9B,YAtEK,uBAsEQgC,CAtER,CAsEoB,CACrB,GAAIC,CAAAA,CAAQ,CAAG3E,CAAM,CAACA,CAAM,CAAC0E,CAAD,CAAN,CAAmBD,GAAnB,CAAuB,CAAvB,CAA0B,MAA1B,CAAD,CAAN,CAA0CjB,MAA1C,CAAiD,YAAjD,CAAf,CACA,MAAOmB,CAAAA,CACV,CAzEI,CA2ELC,iBA3EK,4BA2EaC,CA3Eb,CA2E4BvB,CA3E5B,CA2EwD,IAAtBwB,CAAAA,CAAsB,wDAAN,IAAM,CACzDD,CAAa,CAAGA,CAAa,CAACE,WAAd,EAAhB,CACA,GAAIC,CAAAA,CAAW,CAAGhF,CAAM,CAACsD,CAAD,CAAN,CAAaE,MAAb,CAAoB,MAApB,EAA4BuB,WAA5B,EAAlB,CACA,MAAOC,CAAW,EAAIH,CAAtB,CAAqC,CACjCvB,CAAI,CAAGtD,CAAM,CAACsD,CAAD,CAAN,CAAamB,GAAb,CAAiB,CAAjB,CAAoB,MAApB,CAAP,CACAO,CAAW,CAAGhF,CAAM,CAACsD,CAAD,CAAN,CAAaE,MAAb,CAAoB,MAApB,EAA4BuB,WAA5B,EACjB,CACD,GAAID,CAAJ,CAAmB,CACfxB,CAAI,CAAGA,CAAI,CAACE,MAAL,CAAYsB,CAAZ,CACV,CAFD,IAEO,CACH,GAAqB,QAAjB,QAAQxB,CAAAA,CAAZ,CAA+B,CAC3BA,CAAI,CAAG2B,QAAQ,CAAC3B,CAAI,CAACE,MAAL,CAAY,GAAZ,CAAD,CAClB,CACJ,CACD,MAAOF,CAAAA,CACV,CA1FI,CA4FLF,QA5FK,mBA4FIY,CA5FJ,CA4FW,CACZA,CAAK,GACL,gBAAUA,CAAV,OACH,CA/FI,CAiGLkB,YAjGK,wBAiGU,YACX,KAAKjD,eAAL,IACA,KAAKD,cAAL,CAAsB,EAAtB,CACA,GAAI,KAAKmD,WAAL,EAAJ,CAAwB,CACpB,KAAKpD,aAAL,IACA9B,CAAQ,CAACmF,KAAT,CAAe,KAAK5D,OAAL,CAAa6D,gBAA5B,EACA,KAAKrD,cAAL,CAAoB0B,IAApB,CAAyB,KAAKlC,OAAL,CAAa6D,gBAAtC,EACA,QACH,CACD,GAAI,KAAKC,yBAAL,EAAJ,CAAsC,CAClC,KAAKvD,aAAL,IACA,KAAKC,cAAL,CAAoB0B,IAApB,CAAyB,KAAKlC,OAAL,CAAa+D,qBAAtC,EACA,QACH,CAEDtF,CAAQ,CAACuF,OAAT,CAAiB,KAAKhE,OAAL,CAAaiE,oBAA9B,CACI,UAAI,CACA,CAAI,CAAC1D,aAAL,IACA,GAAIxB,CAAAA,CAAK,CAAG,CAAI,CAACA,KAAjB,CACAA,CAAK,CAAC,CAAD,CAAL,CAASgB,SAAT,CAAqBvB,CAAM,CAACO,CAAK,CAAC,CAAD,CAAL,CAASgB,SAAV,CAAN,CAA2BiC,MAA3B,CAAkC,YAAlC,CAArB,CACA,GAAIxC,CAAAA,CAAI,CAAG,CACP0E,MAAM,CAAE,gBADD,CAEP/D,MAAM,CAAE,CAAI,CAACA,MAFN,CAGPD,QAAQ,CAAE,CAAI,CAACA,QAHR,CAIPiE,WAAW,CAAE,CAAI,CAACxE,SAJX,CAKPZ,KAAK,CAAE,CAAI,CAACqF,YAAL,CAAkBrF,CAAlB,CALA,CAAX,CAQAX,CAAK,CAAC,CACFiG,MAAM,CAAE,KADN,CAEFC,GAAG,CAAEC,CAAC,CAACC,GAAF,CAAMC,OAAN,CAAgB,8BAFnB,CAGFC,MAAM,CAAElF,CAHN,CAAD,CAAL,CAIGmF,IAJH,CAIQ,SAACC,CAAD,CAAc,CAClB,GAAuB,GAAnB,EAAAA,CAAQ,CAACC,MAAT,EAA0BD,CAAQ,CAACpF,IAAT,CAAcsF,EAA5C,CAAgD,CAC5C,CAAI,CAACpF,QAAL,CAAgBkF,CAAQ,CAACpF,IAAT,CAAcA,IAAd,CAAmBE,QAAnC,CACAjB,CAAQ,CAACsG,OAAT,CAAiB,CAAI,CAAC/E,OAAL,CAAaS,eAA9B,EACA,CAAI,CAACA,eAAL,GACH,CAJD,IAIO,CACHhC,CAAQ,CAACmF,KAAT,CAAe,CAAI,CAAC5D,OAAL,CAAagF,aAA5B,EACA,CAAI,CAACxE,cAAL,CAAoB0B,IAApB,CAAyB,CAAI,CAAClC,OAAL,CAAagF,aAAtC,CACH,CACJ,CAbD,EAaGC,KAbH,CAaS,UAAO,CACZxG,CAAQ,CAACmF,KAAT,CAAe,CAAI,CAAC5D,OAAL,CAAagF,aAA5B,EACA,CAAI,CAACxE,cAAL,CAAoB0B,IAApB,CAAyB,CAAI,CAAClC,OAAL,CAAagF,aAAtC,CACH,CAhBD,EAgBGE,OAhBH,CAgBW,UAAM,CACb,CAAI,CAAC3E,aAAL,GACH,CAlBD,CAmBH,CAhCL,CAiCI,UAAI,CACA,CAAI,CAACA,aAAL,IACA9B,CAAQ,CAAC0G,OAAT,CAAiB,CAAI,CAACnF,OAAL,CAAaoF,aAA9B,CACH,CApCL,EAoCOC,GApCP,CAoCW,CAACC,KAAK,CAAE,KAAKtF,OAAL,CAAauF,kBAArB,CApCX,EAqCKF,GArCL,CAqCS,CAACG,MAAM,CAAE,CAACC,MAAM,CAAE,KAAKzF,OAAL,CAAa0F,cAAtB,CAAsCZ,EAAE,CAAE,KAAK9E,OAAL,CAAa2F,UAAvD,CAAT,CArCT,CAsCH,CAtJI,CAwJLvB,YAxJK,uBAwJQrF,CAxJR,CAwJe,CAChB,GAAI6G,CAAAA,CAAM,CAAG,EAAb,CACA7G,CAAK,CAAC8G,OAAN,CAAc,SAAA/G,CAAI,CAAI,CAClB,GAAIgH,CAAAA,CAAE,GAAN,CACAA,CAAE,CAACC,CAAH,CAAOjH,CAAI,CAACqD,iBAAZ,CACA2D,CAAE,CAACE,CAAH,CAAOlH,CAAI,CAACiB,SAAZ,CACA+F,CAAE,CAACG,CAAH,CAAOnH,CAAI,CAACmC,OAAZ,CACA6E,CAAE,CAAC7F,QAAH,CAAc,EAAd,CACAnB,CAAI,CAACmB,QAAL,CAAc4F,OAAd,CAAsB,SAAAvE,CAAO,CAAI,CAC7B,GAAI0E,CAAAA,CAAC,GAAL,CACAA,CAAC,CAACE,GAAF,CAAQ5E,CAAO,CAAC6E,SAAhB,CACAL,CAAE,CAAC7F,QAAH,CAAYiC,IAAZ,CAAiB8D,CAAjB,CACH,CAJD,EAKAJ,CAAM,CAAC1D,IAAP,CAAY4D,CAAZ,CACH,CAZD,EAaA,MAAOM,CAAAA,IAAI,CAACC,SAAL,CAAeT,CAAf,CACV,CAxKI,CA0KLjC,WA1KK,uBA0KS,CACV,GAAyB,CAArB,OAAK5E,KAAL,CAAWC,MAAX,EAA0D,CAAhC,MAAKD,KAAL,CAAW,CAAX,EAAckB,QAAd,CAAuBjB,MAArD,CAAiE,CAC7D,QACH,CACD,IAAK,GAAIH,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAG,KAAKE,KAAL,CAAWC,MAA/B,CAAuCH,CAAC,EAAxC,CAA4C,CACxC,GAAQ,CAAJ,CAAAA,CAAC,EAAyC,CAAjC,OAAKE,KAAL,CAAWF,CAAX,EAAcoB,QAAd,CAAuBjB,MAApC,CAAiD,CAC7C,QACH,CACJ,CACD,QACH,CApLI,CAsLL8E,yBAtLK,qCAsLuB,CACxB,IAAK,GAAIwC,CAAAA,CAAa,CAAG,CAAzB,CAA4BA,CAAa,CAAG,KAAKvH,KAAL,CAAWC,MAAvD,CAA+DsH,CAAa,EAA5E,CAAgF,CAC5E,IAAK,GAAIC,CAAAA,CAAgB,CAAG,CAA5B,CAA+BA,CAAgB,CAAG,KAAKxH,KAAL,CAAWuH,CAAX,EAA0BrG,QAA1B,CAAmCjB,MAArF,CAA6FuH,CAAgB,EAA7G,CAAiH,CAC7G,GAAI,CAAC,KAAK/E,aAAL,CAAmB,KAAKzC,KAAL,CAAWuH,CAAX,EAA0BrG,QAA1B,CAAmCsG,CAAnC,CAAnB,CAAL,CAA+E,CAC3E,QACH,CACJ,CACJ,CACD,QACH,CA/LI,CAiMLC,eAjMK,WAiMa,CACd,GAAIA,CAAAA,CAAe,CAAgC,CAA7B,MAAKhG,cAAL,CAAoBxB,MAA1C,CACA,MAAOwH,CAAAA,CACV,CApMI,CAsMLC,mBAtMK,8BAsMejE,CAtMf,CAsMsB,CACvB,KAAKpC,SAAL,CAAeoC,CAAf,EAAsBvD,YAAtB,CAAqC,CAAC,KAAKmB,SAAL,CAAeoC,CAAf,EAAsBvD,YAC/D,CAxMI,CA0MLyH,eA1MK,2BA0Ma,IACVC,CAAAA,CAAQ,GADE,CAEVC,CAAI,CAAG,KAAK7H,KAAL,CAAWC,MAAX,CAAoB,CAFjB,CAGV6H,CAAG,CAAGrI,CAAM,CAAC,KAAKO,KAAL,CAAW6H,CAAX,EAAiB3F,OAAlB,CAAN,CAAiCe,MAAjC,CAAwC,GAAxC,CAHI,CAIV8E,CAAG,CAAGtI,CAAM,GAAGwD,MAAT,CAAgB,GAAhB,CAJI,CAKd,GAAI8E,CAAG,CAAGD,CAAV,CAAe,CACXF,CAAQ,GACX,CAFD,IAEO,CACHA,CAAQ,GACX,CACD,MAAOA,CAAAA,CACV,CArNI,CAuNLI,mBAvNK,+BAuNiB,YACdC,CAAO,GADO,CAElBC,MAAM,CAACC,IAAP,CAAY,KAAKxH,QAAjB,EAA2ByH,GAA3B,CAA+B,SAAAC,CAAG,CAAI,CAClC,GAAI,CAAC,CAAI,CAAC1H,QAAL,CAAc0H,CAAd,CAAL,CAAyB,CACrBJ,CAAO,GACV,CACJ,CAJD,EAKA,GAAInC,CAAAA,CAAM,CAAGmC,CAAO,CAAG,KAAKhH,OAAL,CAAaqH,cAAhB,CAAiC,KAAKrH,OAAL,CAAasH,aAAlE,CACA,MAAOzC,CAAAA,CACV,CAhOI,CAkOL0C,gBAlOK,4BAkOc,IACXC,CAAAA,CAAa,CAAG,EADL,CAEXC,CAAI,GAFO,CAGfA,CAAI,CAACnC,KAAL,CAAa,KAAKtF,OAAL,CAAasF,KAA1B,CACAmC,CAAI,CAACC,WAAL,CAAmB,KAAK1H,OAAL,CAAa0H,WAAhC,CACAF,CAAa,CAACtF,IAAd,CAAmBuF,CAAnB,EACA,MAAOD,CAAAA,CACV,CAzOI,CA1CO,CAAR,CAsRf,CAYM,CAGV,CAxTC,CAAN","sourcesContent":["define([\"local_notemyprogress/vue\",\r\n \"local_notemyprogress/vuetify\",\r\n \"local_notemyprogress/axios\",\r\n \"local_notemyprogress/sortablejs\",\r\n \"local_notemyprogress/draggable\",\r\n \"local_notemyprogress/datepicker\",\r\n \"local_notemyprogress/moment\",\r\n \"local_notemyprogress/alertify\",\r\n \"local_notemyprogress/pageheader\",\r\n ],\r\n function(Vue, Vuetify, Axios, Sortable, Draggable, Datepicker, Moment, Alertify, Pageheader) {\r\n \"use strict\";\r\n\r\n function init(content) {\r\n content = add_collapsabled_property_to_weeks(content);\r\n Vue.use(Vuetify);\r\n Vue.component('draggable', Draggable);\r\n Vue.component('datepicker', Datepicker);\r\n Vue.component('pageheader', Pageheader);\r\n const app = new Vue({\r\n delimiters: [\"[[\", \"]]\"],\r\n el: \"#setweeks\",\r\n vuetify: new Vuetify(),\r\n data: {\r\n display_settings: false,\r\n settings: content.settings,\r\n new_group: false,\r\n scroll_mode: false,\r\n weeks_started_at: new Date(Moment(Number(content.weeks[0].weekstart)*1000)),\r\n strings: content.strings,\r\n sections: content.sections,\r\n courseid: content.courseid,\r\n userid: content.userid,\r\n raw_weeks: content.weeks,\r\n disabled_dates: {\r\n days: [0, 2, 3, 4, 5, 6]\r\n },\r\n saving_loader: false,\r\n error_messages: [],\r\n save_successful: false\r\n },\r\n mounted() {\r\n document.querySelector(\"#setweeks-loader\").style.display = \"none\";\r\n document.querySelector(\"#setweeks\").style.display = \"block\";\r\n },\r\n computed: {\r\n weeks() {\r\n for (let i = 0; i < this.raw_weeks.length; i++) {\r\n let week = this.raw_weeks[i];\r\n if (i == 0) {\r\n let start_weeks = this.weeks_started_at;\r\n week.weekstart = start_weeks;\r\n week.weekend = this.get_end_week(this.weeks_started_at);\r\n } else {\r\n week.weekstart = this.get_start_week(this.raw_weeks[i - 1].weekend);\r\n week.weekend = this.get_end_week(week.weekstart);\r\n }\r\n }\r\n return this.raw_weeks;\r\n }\r\n },\r\n methods: {\r\n section_name(section) {\r\n let name = null;\r\n if (typeof (section.section_name) != 'undefined' && section.section_name.length > 0) {\r\n name = section.section_name;\r\n } else {\r\n name = section.name;\r\n }\r\n return name;\r\n },\r\n\r\n section_exist(section) {\r\n let exist = true;\r\n if (typeof (section) != 'undefined' && typeof (section.exists) != 'undefined' && section.exists == false) {\r\n exist = false;\r\n }\r\n return exist;\r\n },\r\n\r\n format_name(name, position) {\r\n return name + \" \" + (position + 1);\r\n },\r\n\r\n customFormatter(date) {\r\n let weeks_start_at = Moment(date).format('YYYY-MM-DD');\r\n return weeks_start_at;\r\n },\r\n\r\n add_week() {\r\n this.raw_weeks.push({\r\n name: this.strings.week,\r\n position: (this.weeks.length + 1),\r\n weekstart: null,\r\n weekend: null,\r\n collapsabled: false,\r\n hours_dedications: 0,\r\n removable: true,\r\n sections: []\r\n });\r\n },\r\n\r\n has_items(array) {\r\n return array.length > 0;\r\n },\r\n\r\n remove_week(week, index) {\r\n if (index == 0) {\r\n return null;\r\n }\r\n this.close_delete_confirm();\r\n for (let i = 0; i < week.sections.length; i++) {\r\n this.sections.push(week.sections[i]);\r\n }\r\n let element_index = this.raw_weeks.indexOf(week);\r\n this.raw_weeks.splice(element_index, 1);\r\n },\r\n\r\n ask_delete_confirm() {\r\n this.delete_confirm = true;\r\n },\r\n\r\n close_delete_confirm() {\r\n this.delete_confirm = false;\r\n },\r\n\r\n get_start_week(pass_week) {\r\n let start_date = Moment(Moment(pass_week).add(1, 'days')).format('YYYY-MM-DD');\r\n return start_date;\r\n },\r\n\r\n get_end_week(start_week) {\r\n let end_date = Moment(Moment(start_week).add(6, 'days')).format('YYYY-MM-DD');\r\n return end_date;\r\n },\r\n\r\n get_date_next_day(requested_day, date, output_format = null) {\r\n requested_day = requested_day.toLowerCase();\r\n let current_day = Moment(date).format('dddd').toLowerCase();\r\n while (current_day != requested_day) {\r\n date = Moment(date).add(1, 'days');\r\n current_day = Moment(date).format('dddd').toLowerCase();\r\n }\r\n if (output_format) {\r\n date = date.format(output_format);\r\n } else {\r\n if (typeof (date) != 'number') {\r\n date = parseInt(date.format(\"x\"));\r\n }\r\n }\r\n return date;\r\n },\r\n\r\n position(index) {\r\n index++;\r\n return `${index} - `;\r\n },\r\n\r\n save_changes() {\r\n this.save_successful = false;\r\n this.error_messages = [];\r\n if (this.empty_weeks()) {\r\n this.saving_loader = false;\r\n Alertify.error(this.strings.error_empty_week);\r\n this.error_messages.push(this.strings.error_empty_week);\r\n return false;\r\n }\r\n if (this.weeks_deleted_from_course()) {\r\n this.saving_loader = false;\r\n this.error_messages.push(this.strings.error_section_removed);\r\n return false;\r\n }\r\n\r\n Alertify.confirm(this.strings.save_warning_content,\r\n ()=>{\r\n this.saving_loader = true;\r\n var weeks = this.weeks;\r\n weeks[0].weekstart = Moment(weeks[0].weekstart).format(\"YYYY-MM-DD\");\r\n var data = {\r\n action: \"saveconfigweek\",\r\n userid: this.userid,\r\n courseid: this.courseid,\r\n newinstance: this.new_group,\r\n weeks: this.minify_query(weeks) // Stringify is a hack to clone object :D\r\n };\r\n\r\n Axios({\r\n method: 'get',\r\n url: M.cfg.wwwroot + \"/local/notemyprogress/ajax.php\",\r\n params: data,\r\n }).then((response) => {\r\n if (response.status == 200 && response.data.ok) {\r\n this.settings = response.data.data.settings;\r\n Alertify.success(this.strings.save_successful);\r\n this.save_successful = true;\r\n } else {\r\n Alertify.error(this.strings.error_network);\r\n this.error_messages.push(this.strings.error_network);\r\n }\r\n }).catch((e) => {\r\n Alertify.error(this.strings.error_network);\r\n this.error_messages.push(this.strings.error_network);\r\n }).finally(() => {\r\n this.saving_loader = false;\r\n });\r\n },\r\n ()=>{ // ON CANCEL\r\n this.saving_loader = false;\r\n Alertify.warning(this.strings.cancel_action);\r\n }).set({title: this.strings.save_warning_title})\r\n .set({labels: {cancel: this.strings.confirm_cancel, ok: this.strings.confirm_ok}});\r\n },\r\n\r\n minify_query(weeks) {\r\n var minify = [];\r\n weeks.forEach(week => {\r\n var wk = new Object();\r\n wk.h = week.hours_dedications;\r\n wk.s = week.weekstart;\r\n wk.e = week.weekend;\r\n wk.sections = [];\r\n week.sections.forEach(section => {\r\n var s = new Object();\r\n s.sid = section.sectionid;\r\n wk.sections.push(s);\r\n });\r\n minify.push(wk);\r\n });\r\n return JSON.stringify(minify);\r\n },\r\n\r\n empty_weeks() {\r\n if (this.weeks.length >= 2 && this.weeks[0].sections.length < 1) {\r\n return true;\r\n }\r\n for (let i = 0; i < this.weeks.length; i++) {\r\n if (i > 0 && this.weeks[i].sections.length <= 0) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n\r\n weeks_deleted_from_course() {\r\n for (var week_position = 0; week_position < this.weeks.length; week_position++) {\r\n for (var section_position = 0; section_position < this.weeks[week_position].sections.length; section_position++) {\r\n if (!this.section_exist(this.weeks[week_position].sections[section_position])) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n },\r\n\r\n exists_mistakes() {\r\n let exists_mistakes = this.error_messages.length > 0;\r\n return exists_mistakes;\r\n },\r\n\r\n change_collapsabled(index) {\r\n this.raw_weeks[index].collapsabled = !this.raw_weeks[index].collapsabled;\r\n },\r\n\r\n course_finished() {\r\n let finished = false;\r\n let last = this.weeks.length - 1;\r\n let end = Moment(this.weeks[last].weekend).format(\"X\");\r\n let now = Moment().format(\"X\");\r\n if (now > end) {\r\n finished = true;\r\n } else {\r\n finished = false;\r\n }\r\n return finished;\r\n },\r\n\r\n get_settings_status() {\r\n let visible = true;\r\n Object.keys(this.settings).map(key => {\r\n if (!this.settings[key]) {\r\n visible = false;\r\n }\r\n });\r\n let status = visible ? this.strings.plugin_visible : this.strings.plugin_hidden;\r\n return status;\r\n },\r\n\r\n get_help_content() {\r\n var help_contents = [];\r\n var help = new Object();\r\n help.title = this.strings.title;\r\n help.description = this.strings.description;\r\n help_contents.push(help);\r\n return help_contents;\r\n }\r\n }\r\n });\r\n }\r\n\r\n function add_collapsabled_property_to_weeks(content) {\r\n for (let i = 0; i < content.weeks.length; i++) {\r\n let week = content.weeks[i];\r\n if (typeof (week.collapsabled) == \"undefined\") {\r\n week.collapsabled = false;\r\n }\r\n }\r\n return content;\r\n }\r\n\r\n return {\r\n init: init\r\n };\r\n });"],"file":"setweeks.min.js"} \ No newline at end of file diff --git a/notemyprogress/amd/build/student_gamification.js b/notemyprogress/amd/build/student_gamification.js new file mode 100644 index 0000000000000000000000000000000000000000..d7fb47847300386cc9b36ae99c5382f37b04e6d9 --- /dev/null +++ b/notemyprogress/amd/build/student_gamification.js @@ -0,0 +1,135 @@ +define([ + "local_notemyprogress/vue", + "local_notemyprogress/vuetify", + "local_notemyprogress/axios", + "local_notemyprogress/alertify", + "local_notemyprogress/pageheader", +], function (Vue, Vuetify, Axios, Alertify, PageHeader) { + "use strict"; + + function init(content) { + // console.log(content); + Vue.use(Vuetify); + Vue.component("pageheader", PageHeader); + const app = new Vue({ + delimiters: ["[[", "]]"], + el: "#student_gamification", + vuetify: new Vuetify(), + data: { + strings: content.strings, + token: content.token, + render_has: content.profile_render, + indicators: content.indicators, + levelInfo: content.indicators.levelInfo, + activity: content.indicators.activity, + courseid: content.indicators.cid, + userid: content.indicators.uid, + ranking: content.ranking, + tab: null, + levelsData: content.levels_data.levelsdata, + settings: content.levels_data.settings, + error_messages: [], + save_successful: false, + }, + beforeMount() { + let data = { + courseid: this.courseid, + userid: this.userid, + action: "studentGamificationViewed", + }; + Axios({ + method: "get", + url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", + params: data, + }); + }, + computed: {}, + methods: { + get_help_content() { + let help_contents = []; + let help = new Object(); + help.title = this.strings.help_title; + help.description = this.strings.help_description; + help_contents.push(help); + return help_contents; + }, + update_dialog(value) { + this.dialog = value; + }, + update_help_dialog(value) { + this.help_dialog = value; + }, + openHelpSectionModalEvent() { + this.saveInteraction( + this.pluginSectionName, + "viewed", + "section_help_dialog", + 3 + ); + }, + get_timezone() { + let information = `${this.strings.change_timezone} ${this.timezone}`; + return information; + }, + saveInteraction(component, interaction, target, interactiontype) { + let data = { + action: "saveinteraction", + pluginsection: this.pluginSectionName, + component, + interaction, + target, + url: window.location.href, + interactiontype, + token: content.token, + }; + Axios({ + method: "post", + url: `${M.cfg.wwwroot}/local/notemyprogress/ajax.php`, + data: data, + }) + .then((r) => {}) + .catch((e) => {}); + }, + table_headers() { + let headers = [ + { text: this.strings.ranking_text, value: "ranking" }, + { text: this.strings.level, value: "level" }, + { text: this.strings.student, value: "student" }, + { text: this.strings.total, value: "total" }, + { text: this.strings.progress, value: "progress_percentage" }, + ]; + return headers; + }, + + activateRanking() { + location.reload(); + //console.log(" cid : " + this.courseid + " UID : " + this.userid); + let data = { + action: "rankable", + pluginsection: this.pluginSectionName, + url: window.location.href, + token: content.token, + courseid: this.courseid, + userid: this.userid, + }; + Axios({ + method: "post", + url: + `${M.cfg.wwwroot}/local/notemyprogress/ajax.php?courseid=` + + this.courseid + + "&userid=" + + this.userid, + params: data, + }) + .then((r) => { + // console.log(r); + }) + .catch((e) => {}); + }, + }, + }); + } + return { + init: init, + }; +}); diff --git a/notemyprogress/amd/build/student_planning.js b/notemyprogress/amd/build/student_planning.js deleted file mode 100644 index 0f25bda7ae32a99a6f2a177191d437a90cca2f02..0000000000000000000000000000000000000000 --- a/notemyprogress/amd/build/student_planning.js +++ /dev/null @@ -1,602 +0,0 @@ -define([ - "local_notemyprogress/vue", - "local_notemyprogress/vuetify", - "local_notemyprogress/axios", - "local_notemyprogress/moment", - "local_notemyprogress/pagination", - "local_notemyprogress/chartstatic", - "local_notemyprogress/pageheader", - "local_notemyprogress/modulesform", - "local_notemyprogress/helpdialog", -], function ( - Vue, - Vuetify, - Axios, - Moment, - Pagination, - ChartStatic, - PageHeader, - ModulesForm, - HelpDialog -) { - "use strict"; - - function init(content) { - // //console.log(content); - Vue.use(Vuetify); - Vue.component("pagination", Pagination); - Vue.component("chart", ChartStatic); - Vue.component("pageheader", PageHeader); - Vue.component("modulesform", ModulesForm); - Vue.component("helpdialog", HelpDialog); - let vue = new Vue({ - delimiters: ["[[", "]]"], - el: "#work_sessions", - vuetify: new Vuetify(), - data() { - return { - strings: content.strings, - groups: content.groups, - userid: content.userid, - courseid: content.courseid, - timezone: content.timezone, - render_has: content.profile_render, - loading: false, - errors: [], - pages: content.pages, - - indicators: content.indicators, - resources_access_colors: content.resources_access_colors, - inverted_time_colors: content.inverted_time_colors, - inverted_time: content.indicators.inverted_time, - hours_sessions: content.indicators.hours_sessions, - sections: content.indicators.sections, - sections_map: null, - week_progress: 0, - resource_access_categories: [], - resource_access_data: [], - modules_dialog: false, - - help_dialog: false, - help_contents: [], - }; - }, - beforeMount() { - this.create_section_map(); - this.set_modules_in_sections(); - this.calculate_resources_access(); - }, - mounted() { - document.querySelector("#sessions-loader").style.display = "none"; - document.querySelector("#work_sessions").style.display = "block"; - setTimeout(function () { - vue.setGraphicsEventListeners(); - }); - }, - methods: { - get_help_content() { - let contents = []; - contents.push({ - title: this.strings.section_help_title, - description: this.strings.section_help_description, - }); - return contents; - }, - - build_feedback_form() { - let chart = new Object(); - chart.chart = { - type: "bar", - backgroundColor: null, - style: { fontFamily: "poppins" }, - }; - chart.title = { text: null }; - chart.colors = this.inverted_time_colors; - chart.xAxis = { - type: "category", - crosshair: true, - }; - chart.yAxis = { - title: { - text: this.strings.inverted_time_chart_x_axis, - }, - }; - chart.tooltip = { - shared: true, - useHTML: true, - formatter: function () { - let category_name = this.points[0].key; - let time = vue.convert_time(this.y); - return `<b>${category_name}: </b>${time}`; - }, - }; - chart.legend = { - enabled: false, - }; - chart.series = [ - { - colorByPoint: true, - data: this.inverted_time.data, - }, - ]; - return chart; - }, - - build_inverted_time_chart() { - let chart = new Object(); - chart.chart = { - type: "bar", - backgroundColor: null, - style: { fontFamily: "poppins" }, - }; - chart.title = { text: null }; - chart.colors = this.inverted_time_colors; - chart.xAxis = { - type: "category", - crosshair: true, - }; - chart.yAxis = { - title: { - text: this.strings.inverted_time_chart_x_axis, - }, - }; - chart.tooltip = { - shared: true, - useHTML: true, - formatter: function () { - let category_name = this.points[0].key; - let time = vue.convert_time(this.y); - return `<b>${category_name}: </b>${time}`; - }, - }; - chart.legend = { - enabled: false, - }; - chart.series = [ - { - colorByPoint: true, - data: this.inverted_time.data, - }, - ]; - return chart; - }, - - build_hours_session_chart() { - let chart = new Object(); - chart.title = { text: null }; - chart.chart = { - type: "heatmap", - backgroundColor: null, - style: { fontFamily: "poppins" }, - }; - chart.xAxis = { - categories: this.strings.days, - }; - chart.yAxis = { - categories: this.strings.hours, - title: null, - reversed: true, - }; - chart.colorAxis = { - min: 0, - minColor: "#E0E0E0", - maxColor: "#118AB2", - }; - chart.legend = { - layout: "horizontal", - verticalAlign: "bottom", - }; - chart.tooltip = { - formatter: function () { - let xCategoryName = vue.get_point_category_name(this.point, "x"); - let yCategoryName = vue.get_point_category_name(this.point, "y"); - let label = vue.strings.sessions_text; - if (this.point.value == 1) { - label = vue.strings.session_text; - } - return ( - "<b>" + - xCategoryName + - " " + - yCategoryName + - "</b>: " + - this.point.value + - " " + - label - ); - }, - }; - chart.series = [ - { - borderWidth: 2, - borderColor: "#FAFAFA", - data: this.hours_sessions, - }, - ]; - return chart; - }, - - build_resources_access_chart() { - let chart = new Object(); - chart.chart = { - type: "column", - backgroundColor: null, - style: { fontFamily: "poppins" }, - }; - chart.title = { text: null }; - chart.colors = this.resources_access_colors; - chart.xAxis = { - categories: this.resource_access_categories, - crosshair: true, - title: { - text: this.strings.resource_access_x_axis, - }, - }; - chart.yAxis = { - min: 0, - title: { - text: this.strings.resource_access_y_axis, - }, - }; - chart.plotOptions = { - column: { - stacking: "normal", - }, - series: { - cursor: "pointer", - point: { - events: { - click: function () { - vue.addLogsIntoDB( - "viewed", - "resources_access", - "chart_details", - "Provide details informations about the consulted resources" - ); - vue.modules_dialog = true; - }, - }, - }, - }, - }; - chart.tooltip = { - shared: true, - useHTML: true, - footerFormat: `<i>${this.strings.modules_details}</i>`, - }; - chart.series = this.resource_access_data; - return chart; - }, - - update_interactions(week) { - this.loading = true; - this.errors = []; - let data = { - action: "studentsessions", - userid: this.userid, - courseid: this.courseid, - weekcode: week.weekcode, - profile: this.render_has, - }; - Axios({ - method: "get", - url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", - params: data, - }) - .then((response) => { - if (response.status == 200 && response.data.ok) { - this.inverted_time = - response.data.data.indicators.inverted_time; - this.hours_sessions = - response.data.data.indicators.hours_sessions; - this.sections = response.data.data.indicators.sections; - this.set_modules_in_sections(); - this.calculate_resources_access(); - } else { - this.error_messages.push(this.strings.error_network); - } - }) - .catch((e) => { - this.errors.push(this.strings.api_error_network); - }) - .finally(() => { - this.loading = false; - vue.addLogsIntoDB( - "viewed", - "week_" + week.weekcode, - "week_section", - "Week section that allows you to obtain information on a specific week" - ); - vue.setGraphicsEventListeners(); - }); - return this.data; - }, - - create_section_map() { - let sectionsMap = new Map(); - let sectionid = 0; - this.indicators.course_cms.forEach((cm) => { - sectionid = Number(cm.section); - if (!sectionsMap.has(sectionid)) { - sectionsMap.set(sectionid, [cm]); - } else { - sectionsMap.get(sectionid).push(cm); - } - }); - this.sections_map = sectionsMap; - }, - - set_modules_in_sections() { - let sectionid; - this.sections.forEach((section) => { - sectionid = Number(section.sectionid); - section.sectionid = sectionid; - section.modules = this.sections_map.has(sectionid) - ? this.sections_map.get(sectionid) - : []; - }); - }, - - calculate_resources_access() { - let modulesMap = new Map(); - let moduleid, - user_cm, - mod, - total_modules = 0, - access_modules = 0; - let modules_names = this.strings.modules_names; - this.sections.forEach((section) => { - section.modules.forEach((module) => { - !modulesMap.has(module.modname) && - modulesMap.set(module.modname, { complete: 0, pending: 0 }); - mod = modulesMap.get(module.modname); - moduleid = Number(module.id); - module.id = moduleid; - module.complete = false; - module.viewed = false; - module.interactions = 0; - - user_cm = this.indicators.user_cms[`cm${module.id}`]; - if (user_cm) { - module.complete = user_cm.complete; - module.viewed = user_cm.viewed; - module.interactions = user_cm.interactions; - user_cm.complete ? mod.complete++ : mod.pending++; - user_cm.complete && access_modules++; - } else { - mod.pending++; - } - total_modules++; - }); - }); - let categories = [], - complete_data = [], - pending_data = []; - modulesMap.forEach(function (value, key) { - categories.push(modules_names[key] || key); - complete_data.push(value.complete); - pending_data.push(value.pending); - }); - this.resource_access_categories = categories; - this.resource_access_data = [ - { name: this.strings.resource_access_legend1, data: complete_data }, - { name: this.strings.resource_access_legend2, data: pending_data }, - ]; - this.week_progress = - Math.floor((access_modules * 100) / total_modules) || 0; - }, - - get_progress_percentage() { - return `${this.week_progress} %`; - }, - - get_point_category_name(point, dimension) { - let series = point.series, - isY = dimension === "y", - axis = series[isY ? "yAxis" : "xAxis"]; - return axis.categories[point[isY ? "y" : "x"]]; - }, - - get_module_icon(modname) { - return `${M.cfg.wwwroot}/theme/image.php/boost/${modname}/1/icon`; - }, - - get_module_url(module) { - return `${M.cfg.wwwroot}/mod/${module.modname}/view.php?id=${module.id}`; - }, - - get_interactions_number(interactions) { - let interactions_text = - interactions == 1 - ? this.strings.modules_interaction - : this.strings.modules_interactions; - return `(${interactions} ${interactions_text})`; - }, - - convert_time(time) { - time *= 3600; // pasar las horas a segundos - let h = this.strings.hours_short; - let m = this.strings.minutes_short; - let s = this.strings.seconds_short; - let hours = Math.floor(time / 3600); - let minutes = Math.floor((time % 3600) / 60); - let seconds = Math.floor(time % 60); - let text; - if (hours >= 1) { - if (minutes >= 1) { - text = `${hours}${h} ${minutes}${m}`; - } else { - text = `${hours}${h}`; - } - } else if (minutes >= 1) { - if (seconds >= 1) { - text = `${minutes}${m} ${seconds}${s}`; - } else { - text = `${minutes}${m}`; - } - } else { - text = `${seconds}${s}`; - } - return text; - }, - - update_modules_dialog(value) { - this.modules_dialog = value; - }, - - open_chart_help(chart) { - let contents = []; - let action = ""; - let objectType = ""; - let objectName = ""; - let objectDescription = ""; - if (chart == "inverted_time") { - contents.push({ - title: this.strings.inverted_time_help_title, - description: this.strings.inverted_time_help_description_p1, - }); - contents.push({ - description: this.strings.inverted_time_help_description_p2, - }); - action = "viewed"; - objectType = "help"; - objectName = "invested_time"; - objectDescription = - "Help section that provides information about the invested time chart"; - this.addLogsIntoDB( - action, - objectName, - objectType, - objectDescription - ); - } else if (chart == "hours_session") { - contents.push({ - title: this.strings.hours_session_help_title, - description: this.strings.hours_session_help_description_p1, - }); - contents.push({ - description: this.strings.hours_session_help_description_p2, - }); - action = "viewed"; - objectType = "help"; - objectName = "hours_session"; - objectDescription = - "Help section that provides information about the hours session chart"; - this.addLogsIntoDB( - action, - objectName, - objectType, - objectDescription - ); - } else if (chart == "resources_access") { - contents.push({ - title: this.strings.resources_access_help_title, - description: this.strings.resources_access_help_description_p1, - }); - contents.push({ - description: this.strings.resources_access_help_description_p2, - }); - contents.push({ - description: this.strings.resources_access_help_description_p3, - }); - action = "viewed"; - objectType = "help"; - objectName = "resources_access"; - objectDescription = - "Help section that provides information about the resources access chart"; - this.addLogsIntoDB( - action, - objectName, - objectType, - objectDescription - ); - } - this.help_contents = contents; - if (this.help_contents.length) { - this.help_dialog = true; - } - }, - - update_help_dialog(value) { - this.help_dialog = value; - }, - - get_timezone() { - let information = `${this.strings.ss_change_timezone} ${this.timezone}`; - return information; - }, - - setGraphicsEventListeners() { - let graphics = document.querySelectorAll(".highcharts-container"); - if (graphics.length < 1) { - setTimeout(vue.setGraphicsEventListeners, 500); - } else { - graphics[0].id = "inverted_time"; - graphics[1].id = "hours_session"; - graphics[2].id = "resources_access"; - graphics.forEach((graph) => { - graph.addEventListener("mouseenter", vue.addLogsViewGraphic); - }); - } - }, - - addLogsViewGraphic(e) { - event.stopPropagation(); - var action = ""; - var objectName = ""; - var objectType = ""; - var objectDescription = ""; - switch (e.target.id) { - case "inverted_time": - action = "viewed"; - objectName = "invested_time"; - objectType = "chart"; - objectDescription = "Bar chart that shows"; - break; - case "hours_session": - action = "viewed"; - objectName = "hours_session"; - objectType = "chart"; - objectDescription = "Chart showing"; - break; - case "resources_access": - action = "viewed"; - objectName = "resources_access"; - objectType = "chart"; - objectDescription = "Chart showing "; - break; - } - vue.addLogsIntoDB(action, objectName, objectType, objectDescription); - }, - - addLogsIntoDB(action, objectName, objectType, objectDescription) { - let data = { - courseid: content.courseid, - userid: content.userid, - action: "addLogs", - sectionname: "STUDENT_STUDY_SESSIONS", - actiontype: action, - objectType: objectType, - objectName: objectName, - currentUrl: document.location.href, - objectDescription: objectDescription, - }; - Axios({ - method: "get", - url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", - params: data, - }) - .then((response) => { - if (response.status == 200 && response.data.ok) { - } - }) - .catch((e) => {}); - }, - }, - }); - } - - return { - init: init, - }; -}); diff --git a/notemyprogress/amd/build/teacher.js b/notemyprogress/amd/build/teacher.js new file mode 100644 index 0000000000000000000000000000000000000000..3b811743617fd36bc6a18e23c33c159cc6429d41 --- /dev/null +++ b/notemyprogress/amd/build/teacher.js @@ -0,0 +1,305 @@ +define([ + "local_notemyprogress/vue", + "local_notemyprogress/vuetify", + "local_notemyprogress/axios", + "local_notemyprogress/pagination", + "local_notemyprogress/chartstatic", + "local_notemyprogress/pageheader", + "local_notemyprogress/helpdialog", +], function ( + Vue, + Vuetify, + Axios, + Pagination, + ChartStatic, + PageHeader, + HelpDialog +) { + "use strict"; + + function init(content) { + // console.log(content); + Vue.use(Vuetify); + Vue.component("pagination", Pagination); + Vue.component("chart", ChartStatic); + Vue.component("pageheader", PageHeader); + Vue.component("helpdialog", HelpDialog); + let vue = new Vue({ + delimiters: ["[[", "]]"], + el: "#teacher", + vuetify: new Vuetify(), + data() { + return { + strings: content.strings, + groups: content.groups, + userid: content.userid, + courseid: content.courseid, + timezone: content.timezone, + render_has: content.profile_render, + + indicators: content.indicators, + week_resources_colors: content.week_resources_colors, + search: null, + week_resources_categories: [], + week_resources_data: [], + + help_dialog: false, + help_contents: [], + }; + }, + beforeMount() { + this.calculate_week_resources(); + }, + mounted() { + document.querySelector("#sessions-loader").style.display = "none"; + document.querySelector("#teacher").style.display = "block"; + }, + methods: { + get_help_content() { + let contents = []; + contents.push({ + title: this.strings.section_help_title, + description: this.strings.section_help_description, + }); + return contents; + }, + + get_course_grade() { + let grade = Number(this.indicators.course.grademax); + return this.isInt(grade) ? grade : grade.toFixed(2); + }, + + calculate_week_resources() { + let categories = [], + data = []; + let week_name; + this.indicators.weeks.forEach((week) => { + week_name = `${week.name} ${week.position + 1}`; + categories.push(week_name); + data.push(week.cms); + }); + let name = this.capitalizeFirstLetter( + this.strings.teacher_indicators_modules + ); + this.week_resources_categories = categories; + this.week_resources_data = [{ name, data }]; + }, + + build_week_resources_chart() { + let chart = new Object(); + chart.chart = { + type: "bar", + backgroundColor: null, + style: { fontFamily: "poppins" }, + }; + chart.title = { + text: null, + }; + chart.colors = this.week_resources_colors; + chart.xAxis = { + categories: this.week_resources_categories, + }; + chart.yAxis = { + min: 0, + title: { + text: this.strings.teacher_indicators_week_resources_yaxis_title, + }, + }; + chart.legend = { + enabled: false, + }; + chart.series = this.week_resources_data; + // console.log(chart.series); + return chart; + }, + + build_weeks_sessions_chart() { + let chart = new Object(); + chart.chart = { + type: "heatmap", + backgroundColor: null, + style: { fontFamily: "poppins" }, + }; + chart.title = { + text: null, + }; + chart.xAxis = { + categories: this.strings.weeks, + }; + chart.yAxis = { + categories: this.indicators.sessions.categories, + title: null, + reversed: true, + }; + chart.colorAxis = { + min: 0, + minColor: "#E0E0E0", + maxColor: "#118AB2", + }; + chart.legend = { + layout: "horizontal", + verticalAlign: "bottom", + }; + chart.tooltip = { + formatter: function () { + let days = + vue.indicators.sessions.weeks[this.point.y][this.point.x] || ""; + let xCategoryName = vue.get_point_category_name(this.point, "x"); + let yCategoryName = vue.get_point_category_name(this.point, "y"); + let label = vue.strings.teacher_indicators_sessions; + if (this.point.value == 1) { + label = vue.strings.teacher_indicators_session; + } + return ( + "<b>" + + yCategoryName + + " " + + xCategoryName + + "</b>: " + + this.point.value + + " " + + label + + "<br/>" + + days + ); + }, + }; + chart.series = [ + { + borderWidth: 2, + borderColor: "#FAFAFA", + data: this.indicators.sessions.data, + }, + ]; + return chart; + }, + + table_headers() { + let headers = [ + { text: "", value: "id", align: "center", sortable: false }, + { text: this.strings.thead_name, value: "firstname" }, + { text: this.strings.thead_lastname, value: "lastname" }, + { text: this.strings.thead_email, value: "email" }, + { + text: this.strings.thead_progress, + value: "progress_percentage", + align: "center", + }, + { + text: this.strings.thead_sessions, + value: "sessions_number", + align: "center", + }, + { + text: this.strings.thead_time, + value: "inverted_time", + align: "center", + }, + ]; + return headers; + }, + + get_picture_url(userid) { + let url = `${M.cfg.wwwroot}/user/pix.php?file=/${userid}/f1.jpg`; + return url; + }, + + get_percentage_progress(value) { + return `${value} %`; + }, + + get_progress_tooltip(item) { + let module_label = this.strings.teacher_indicators_modules; + let finished_label = this.strings.teacher_indicators_finished; + if (item.cms.complete == 1) { + module_label = this.strings.teacher_indicators_module; + finished_label = this.strings.teacher_indicators_finalized; + } + return `${item.cms.complete} ${module_label} ${finished_label} ${this.strings.of_conector} ${item.cms.total}`; + }, + + get_point_category_name(point, dimension) { + let series = point.series, + isY = dimension === "y", + axis = series[isY ? "yAxis" : "xAxis"]; + return axis.categories[point[isY ? "y" : "x"]]; + }, + + capitalizeFirstLetter(string) { + return string.charAt(0).toUpperCase() + string.slice(1); + }, + + isInt(n) { + return n % 1 === 0; + }, + + open_chart_help(chart) { + let contents = []; + if (chart == "week_resources") { + contents.push({ + title: this.strings.week_resources_help_title, + description: this.strings.week_resources_help_description_p1, + }); + contents.push({ + description: this.strings.week_resources_help_description_p2, + }); + } else if (chart == "weeks_sessions") { + contents.push({ + title: this.strings.weeks_sessions_help_title, + description: this.strings.week_sessions_help_description_p1, + }); + contents.push({ + description: this.strings.week_sessions_help_description_p2, + }); + } else if (chart == "progress_table") { + contents.push({ + title: this.strings.progress_table_help_title, + description: this.strings.progress_table_help_description, + }); + } + this.help_contents = contents; + if (this.help_contents.length) { + this.help_dialog = true; + } + }, + + update_help_dialog(value) { + this.help_dialog = value; + }, + + get_timezone() { + let information = `${this.strings.ss_change_timezone} ${this.timezone}`; + return information; + }, + + addLogsIntoDB(action, objectName, objectType, objectDescription) { + let data = { + courseid: content.courseid, + userid: content.userid, + action: "addLogs", + sectionname: "TEACHER_GENERAL_INDICATORS", + actiontype: action, + objectType: objectType, + objectName: objectName, + currentUrl: document.location.href, + objectDescription: objectDescription, + }; + Axios({ + method: "get", + url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", + params: data, + }) + .then((response) => { + if (response.status == 200 && response.data.ok) { + } + }) + .catch((e) => {}); + }, + }, + }); + } + + return { + init: init, + }; +}); diff --git a/notemyprogress/amd/build/teacher.min.js b/notemyprogress/amd/build/teacher.min.js deleted file mode 100644 index 7b49e25001efbe51976e1ee2eb2274b2f88de329..0000000000000000000000000000000000000000 --- a/notemyprogress/amd/build/teacher.min.js +++ /dev/null @@ -1,2 +0,0 @@ -define(["local_notemyprogress/vue","local_notemyprogress/vuetify","local_notemyprogress/axios","local_notemyprogress/pagination","local_notemyprogress/chartstatic","local_notemyprogress/pageheader","local_notemyprogress/helpdialog"],function(e,t,s,i,r,o,n){"use strict";return{init:function(a){e.use(t),e.component("pagination",i),e.component("chart",r),e.component("pageheader",o),e.component("helpdialog",n);let l=new e({delimiters:["[[","]]"],el:"#teacher",vuetify:new t,data:()=>({strings:a.strings,groups:a.groups,userid:a.userid,courseid:a.courseid,timezone:a.timezone,render_has:a.profile_render,indicators:a.indicators,week_resources_colors:a.week_resources_colors,search:null,week_resources_categories:[],week_resources_data:[],help_dialog:!1,help_contents:[]}),beforeMount(){this.calculate_week_resources()},mounted(){document.querySelector("#sessions-loader").style.display="none",document.querySelector("#teacher").style.display="block"},methods:{get_help_content(){let e=[];return e.push({title:this.strings.section_help_title,description:this.strings.section_help_description}),e},get_course_grade(){let e=Number(this.indicators.course.grademax);return this.isInt(e)?e:e.toFixed(2)},calculate_week_resources(){let e,t=[],s=[];this.indicators.weeks.forEach(i=>{e=`${i.name} ${i.position+1}`,t.push(e),s.push(i.cms)});let i=this.capitalizeFirstLetter(this.strings.teacher_indicators_modules);this.week_resources_categories=t,this.week_resources_data=[{name:i,data:s}]},build_week_resources_chart(){let e=new Object;return e.chart={type:"bar",backgroundColor:null,style:{fontFamily:"poppins"}},e.title={text:null},e.colors=this.week_resources_colors,e.xAxis={categories:this.week_resources_categories},e.yAxis={min:0,title:{text:this.strings.teacher_indicators_week_resources_yaxis_title}},e.legend={enabled:!1},e.series=this.week_resources_data,e},build_weeks_sessions_chart(){let e=new Object;return e.chart={type:"heatmap",backgroundColor:null,style:{fontFamily:"poppins"}},e.title={text:null},e.xAxis={categories:this.strings.weeks},e.yAxis={categories:this.indicators.sessions.categories,title:null,reversed:!0},e.colorAxis={min:0,minColor:"#E0E0E0",maxColor:"#118AB2"},e.legend={layout:"horizontal",verticalAlign:"bottom"},e.tooltip={formatter:function(){let e=l.indicators.sessions.weeks[this.point.y][this.point.x]||"",t=l.get_point_category_name(this.point,"x"),s=l.get_point_category_name(this.point,"y"),i=l.strings.teacher_indicators_sessions;return 1==this.point.value&&(i=l.strings.teacher_indicators_session),"<b>"+s+" "+t+"</b>: "+this.point.value+" "+i+"<br/>"+e}},e.series=[{borderWidth:2,borderColor:"#FAFAFA",data:this.indicators.sessions.data}],e},table_headers(){return[{text:"",value:"id",align:"center",sortable:!1},{text:this.strings.thead_name,value:"firstname"},{text:this.strings.thead_lastname,value:"lastname"},{text:this.strings.thead_email,value:"email"},{text:this.strings.thead_progress,value:"progress_percentage",align:"center"},{text:this.strings.thead_sessions,value:"sessions_number",align:"center"},{text:this.strings.thead_time,value:"inverted_time",align:"center"}]},get_picture_url:e=>`${M.cfg.wwwroot}/user/pix.php?file=/${e}/f1.jpg`,get_percentage_progress:e=>`${e} %`,get_progress_tooltip(e){let t=this.strings.teacher_indicators_modules,s=this.strings.teacher_indicators_finished;return 1==e.cms.complete&&(t=this.strings.teacher_indicators_module,s=this.strings.teacher_indicators_finalized),`${e.cms.complete} ${t} ${s} ${this.strings.of_conector} ${e.cms.total}`},get_point_category_name(e,t){let s="y"===t;return e.series[s?"yAxis":"xAxis"].categories[e[s?"y":"x"]]},capitalizeFirstLetter:e=>e.charAt(0).toUpperCase()+e.slice(1),isInt:e=>e%1==0,open_chart_help(e){let t=[];"week_resources"==e?(t.push({title:this.strings.week_resources_help_title,description:this.strings.week_resources_help_description_p1}),t.push({description:this.strings.week_resources_help_description_p2})):"weeks_sessions"==e?(t.push({title:this.strings.weeks_sessions_help_title,description:this.strings.week_sessions_help_description_p1}),t.push({description:this.strings.week_sessions_help_description_p2})):"progress_table"==e&&t.push({title:this.strings.progress_table_help_title,description:this.strings.progress_table_help_description}),this.help_contents=t,this.help_contents.length&&(this.help_dialog=!0)},update_help_dialog(e){this.help_dialog=e},get_timezone(){return`${this.strings.ss_change_timezone} ${this.timezone}`},addLogsIntoDB(e,t,i,r){let o={courseid:a.courseid,userid:a.userid,action:"addLogs",sectionname:"TEACHER_GENERAL_INDICATORS",actiontype:e,objectType:i,objectName:t,currentUrl:document.location.href,objectDescription:r};s({method:"get",url:M.cfg.wwwroot+"/local/notemyprogress/ajax.php",params:o}).then(e=>{200==e.status&&e.data.ok}).catch(e=>{})}}})}}}); -//# sourceMappingURL=teacher.min.js.map diff --git a/notemyprogress/amd/src/helpdialog.js b/notemyprogress/amd/src/helpdialog.js index 389244b23f75b2c9ea44932fec38b5316ac4b5e8..6d5689fa563243e30dc4ab0fcfc91dcf5dfe6919 100644 --- a/notemyprogress/amd/src/helpdialog.js +++ b/notemyprogress/amd/src/helpdialog.js @@ -26,7 +26,7 @@ define([], </v-card-text> <v-divider class="ma-0"></v-divider> <v-card-actions class="d-flex justify-center help-dialog-footer"> - <v-btn text @click="closeDialog" v-text="exit" class="ma-0 fml-btn-secondary"></v-btn> + <v-btn text @click="closeDialog" v-text="exit" class="ma-0 nmp-btn-secondary"></v-btn> </v-card-actions> </v-card> </v-dialog> diff --git a/notemyprogress/amd/src/logs.js b/notemyprogress/amd/src/logs.js index 11f3883b60293bf7ae8fb7f7e14bb168c131588f..edc81115e83e526f5c3d83be4a402cbbe5afa8ca 100644 --- a/notemyprogress/amd/src/logs.js +++ b/notemyprogress/amd/src/logs.js @@ -2,305 +2,379 @@ @author 2021 Éric Bart <bart.eric@hotmail.com> */ -define(["local_notemyprogress/vue", - "local_notemyprogress/vuetify", - "local_notemyprogress/axios", - "local_notemyprogress/moment", - "local_notemyprogress/pagination", - "local_notemyprogress/pageheader", - "local_notemyprogress/helpdialog", - "local_notemyprogress/alertify", - -], - function (Vue, Vuetify, Axios, Moment, Pagination, Pageheader, HelpDialog, Alertify) { - "use strict"; - - function init(content) { - const timeout = 60 * 120 * 1000 - Axios.defaults.timeout = timeout - Vue.use(Vuetify); - Vue.component('pagination', Pagination); - Vue.component('pageheader', Pageheader); - Vue.component('helpdialog', HelpDialog); - let vue = new Vue({ - delimiters: ["[[", "]]"], - el: "#logs", - vuetify: new Vuetify(), - data() { - return { - calendarData: {}, - strings: content.strings, - groups: content.groups, - userid: content.userid, - courseid: content.courseid, - timezone: content.timezone, - render_has: content.profile_render, - courseRole: content.courseRole, - loading: false, - errors: [], - pages: content.pages, - help_dialog: false, - help_contents: [], - dateRules: [ - v => !!v || this.strings.logs_invalid_date - ] +define([ + "local_notemyprogress/vue", + "local_notemyprogress/vuetify", + "local_notemyprogress/axios", + "local_notemyprogress/moment", + "local_notemyprogress/pagination", + "local_notemyprogress/pageheader", + "local_notemyprogress/helpdialog", + "local_notemyprogress/alertify", +], function ( + Vue, + Vuetify, + Axios, + Moment, + Pagination, + Pageheader, + HelpDialog, + Alertify +) { + "use strict"; + function init(content) { + const timeout = 60 * 120 * 1000; + Axios.defaults.timeout = timeout; + Vue.use(Vuetify); + Vue.component("pagination", Pagination); + Vue.component("pageheader", Pageheader); + Vue.component("helpdialog", HelpDialog); + let vue = new Vue({ + delimiters: ["[[", "]]"], + el: "#logs", + vuetify: new Vuetify(), + data() { + return { + calendarData: {}, + strings: content.strings, + groups: content.groups, + userid: content.userid, + courseid: content.courseid, + timezone: content.timezone, + render_has: content.profile_render, + courseRole: content.courseRole, + loading: false, + errors: [], + pages: content.pages, + help_dialog: false, + help_contents: [], + dateRules: [(v) => !!v || this.strings.logs_invalid_date], + }; + }, + beforeMount() { + document.querySelector("#downloadButtonMoodle").style.display = "none"; + document.querySelector("#downloadButtonNMP").style.display = "none"; + }, + mounted() { + document.querySelector(".v-application--wrap").style.minHeight = "60vh"; + document.querySelector("#sessions-loader").style.display = "none"; + document.querySelector("#helpMoodle").style.display = "block"; + document.querySelector("#helpNMP").style.display = "block"; + document.querySelector("#downloadButtonMoodle").style.display = "block"; + document.querySelector("#downloadButtonNMP").style.display = "block"; + }, + methods: { + get_Moodlefile() { + let lastDate = document.querySelector("#lastDateMoodle"); + let beginDate = document.querySelector("#beginDateMoodle"); + let timestampBeginDate = 0; + let timestampLastDate = 0; + let parsedBeginDate = []; + let parsedLastDate = []; + this.url = false; + this.loading = true; + var data = { + action: "downloadMOODLElogs", + courseid: this.courseid, + userid: this.userid, + beginDate: beginDate.value, + lastDate: lastDate.value, + currentUrl: window.location.href, + }; + if (beginDate.value != "" && lastDate.value != "") { + parsedBeginDate = beginDate.value.split("-"); + timestampBeginDate = new Date( + parsedBeginDate[0], + parsedBeginDate[1] - 1, + parsedBeginDate[2] + ); + parsedLastDate = lastDate.value.split("-"); + timestampLastDate = new Date( + parsedLastDate[0], + parsedLastDate[1] - 1, + parsedLastDate[2] + ); + if (timestampBeginDate.getTime() <= timestampLastDate.getTime()) { + if (timestampBeginDate.getTime() <= Date.now()) { + document.querySelector("#downloadButtonMoodle").innerHTML = + this.strings.logs_download_btn; + document.getElementById("downloadButtonMoodle").disabled = true; + Axios({ + method: "get", + url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", + timeout: timeout, + params: data, + }) + .then((response) => { + this.loading = false; + if (response.status == 200 && response.data.ok) { + let jsonData = response.data.data.jsonData; + jsonData = jsonData.map((row) => ({ + Role: row.user.role, + Email: row.user.email, + Fullname: row.user.firstname + " " + row.user.lastname, + Date: row.time.date, + Hour: row.time.hour, + ACTION_VERB: row.action.actionverb, + CourseID: row.course.courseid, + CourseName: row.course.coursename, + OBJECT_ID: row.action.objectid, + OBJECT_NAME: row.action.objectname, + OBJECT_TYPE: row.action.objecttype, + })); + let csvData = vue.objectToCSV(jsonData); + vue.downloadCSV(csvData, "Activity_Moodle"); + document.querySelector( + "#downloadButtonMoodle" + ).innerHTML = this.strings.logs_valid_Moodlebtn; + document.getElementById( + "downloadButtonMoodle" + ).disabled = false; + Alertify.success( + this.strings.logs_success_file_downloaded + ); + } else { + Alertify.error( + this.strings.logs_error_problem_encountered + ); + document.querySelector( + "#downloadButtonMoodle" + ).innerHTML = this.strings.logs_valid_Moodlebtn; + document.getElementById( + "downloadButtonMoodle" + ).disabled = false; } - }, - beforeMount() { - document.querySelector("#downloadButtonMoodle").style.display = "none"; - document.querySelector("#downloadButtonNMP").style.display = "none"; - }, - mounted() { - document.querySelector(".v-application--wrap").style.minHeight = "60vh"; - document.querySelector("#sessions-loader").style.display = "none"; - document.querySelector("#helpMoodle").style.display = "block"; - document.querySelector("#helpNMP").style.display = "block"; - document.querySelector("#downloadButtonMoodle").style.display = "block"; - document.querySelector("#downloadButtonNMP").style.display = "block"; - }, - methods: { - get_Moodlefile() { - let lastDate = document.querySelector("#lastDateMoodle"); - let beginDate = document.querySelector("#beginDateMoodle"); - let timestampBeginDate = 0; - let timestampLastDate = 0; - let parsedBeginDate = []; - let parsedLastDate = []; - this.url = false; - this.loading = true; - var data = { - action: "downloadMOODLElogs", - courseid: this.courseid, - userid: this.userid, - beginDate: beginDate.value, - lastDate: lastDate.value, - currentUrl: window.location.href, - } - if (beginDate.value != "" && lastDate.value != "") { - parsedBeginDate = beginDate.value.split("-"); - timestampBeginDate = new Date(parsedBeginDate[0], parsedBeginDate[1] - 1, parsedBeginDate[2]); - parsedLastDate = lastDate.value.split("-"); - timestampLastDate = new Date(parsedLastDate[0], parsedLastDate[1] - 1, parsedLastDate[2]); - if (timestampBeginDate.getTime() <= timestampLastDate.getTime()) { - if (timestampBeginDate.getTime() <= Date.now()) { - document.querySelector('#downloadButtonMoodle').innerHTML = this.strings.logs_download_btn; - document.getElementById('downloadButtonMoodle').disabled = true; - Axios({ - method: 'get', - url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", - timeout: timeout, - params: data, - }).then((response) => { - this.loading = false - if (response.status == 200 && response.data.ok) { - let jsonData = response.data.data.jsonData; - jsonData = jsonData.map(row => ({ - Role: row.user.role, - Email: row.user.email, - Fullname: row.user.firstname + ' ' + row.user.lastname, - Date: row.time.date, - Hour: row.time.hour, - ACTION_VERB: row.action.actionverb, - CourseID: row.course.courseid, - CourseName: row.course.coursename, - OBJECT_ID: row.action.objectid, - OBJECT_NAME: row.action.objectname, - OBJECT_TYPE: row.action.objecttype - })); - let csvData = vue.objectToCSV(jsonData); - vue.downloadCSV(csvData, "Activity_Moodle"); - document.querySelector('#downloadButtonMoodle').innerHTML = this.strings.logs_valid_Moodlebtn; - document.getElementById('downloadButtonMoodle').disabled = false; - Alertify.success(this.strings.logs_success_file_downloaded); - } else { - Alertify.error(this.strings.logs_error_problem_encountered); - document.querySelector('#downloadButtonMoodle').innerHTML = this.strings.logs_valid_Moodlebtn; - document.getElementById('downloadButtonMoodle').disabled = false; - } - }).catch((e) => { - Alertify.error(this.strings.logs_error_problem_encountered); - this.loading = false; - document.querySelector('#downloadButtonMoodle').innerHTML = this.strings.logs_valid_Moodlebtn; - document.getElementById('downloadButtonMoodle').disabled = false; - }).finally(() => { - this.loading = false; - document.querySelector('#downloadButtonMoodle').innerHTML = this.strings.logs_valid_Moodlebtn; - document.getElementById('downloadButtonMoodle').disabled = false; - }); - } else { - Alertify.error(this.strings.logs_error_begin_date_superior); - } - } else { - Alertify.error(this.strings.logs_error_begin_date_inferior); - } - } else { - Alertify.error(this.strings.logs_error_empty_dates); - } - }, - - objectToCSV(jsonData) { - let csvRows = []; + }) + .catch((e) => { + Alertify.error(this.strings.logs_error_problem_encountered); + this.loading = false; + document.querySelector("#downloadButtonMoodle").innerHTML = + this.strings.logs_valid_Moodlebtn; + document.getElementById( + "downloadButtonMoodle" + ).disabled = false; + }) + .finally(() => { + this.loading = false; + document.querySelector("#downloadButtonMoodle").innerHTML = + this.strings.logs_valid_Moodlebtn; + document.getElementById( + "downloadButtonMoodle" + ).disabled = false; + }); + } else { + Alertify.error(this.strings.logs_error_begin_date_superior); + } + } else { + Alertify.error(this.strings.logs_error_begin_date_inferior); + } + } else { + Alertify.error(this.strings.logs_error_empty_dates); + } + }, - let headers = Object.keys(jsonData[0]); - csvRows.push(headers.join(';')); + objectToCSV(jsonData) { + let csvRows = []; - for (const row of jsonData) { - const values = headers.map(header => { - const escaped = ('' + row[header]).replace(/"/g, '\\"'); - return `"${escaped}"`; - }) - csvRows.push(values.join(';')); - } + let headers = Object.keys(jsonData[0]); + csvRows.push(headers.join(";")); - return csvRows.join('\n'); - }, + for (const row of jsonData) { + const values = headers.map((header) => { + const escaped = ("" + row[header]).replace(/"/g, '\\"'); + return `"${escaped}"`; + }); + csvRows.push(values.join(";")); + } - downloadCSV(data, documentName) { - let blob = new Blob([data], { type: 'text/csv' }); - let url = window.URL.createObjectURL(blob); - const a = document.createElement('a'); - a.setAttribute('hidden', ''); - a.setAttribute('href', url); - a.setAttribute('download', documentName + '.csv'); - document.body.appendChild(a); - a.click(); - document.body.removeChild(a); - }, + return csvRows.join("\n"); + }, - getRapport() { - Alertify.confirm(this.strings.logs_download_details_description, - () => { - let path = M.cfg.wwwroot + "/local/notemyprogress/downloads/Details_Informations_LogsNMP.pdf"; - var link = document.createElement('a'); - link.href = path; - link.download = "Details_Informations_LogsNMP.pdf"; - link.click(); - Alertify.success(this.strings.logs_download_details_validation); - }).set({ title: this.strings.logs_download_details_title }) - .set({ labels: { cancel: this.strings.logs_download_details_cancel, ok: this.strings.logs_download_details_ok } }); - }, + downloadCSV(data, documentName) { + let blob = new Blob([data], { type: "text/csv" }); + let url = window.URL.createObjectURL(blob); + const a = document.createElement("a"); + a.setAttribute("hidden", ""); + a.setAttribute("href", url); + a.setAttribute("download", documentName + ".csv"); + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + }, - get_NMPfile() { - let lastDate = document.querySelector("#lastDateNMP"); - let beginDate = document.querySelector("#beginDateNMP"); - let timestampBeginDate = 0; - let timestampLastDate = 0; - let parsedBeginDate = []; - let parsedLastDate = []; - this.url = false; - this.loading = true; - var data = { - action: "downloadNMPlogs", - courseid: this.courseid, - userid: this.userid, - beginDate: beginDate.value, - lastDate: lastDate.value, - currentUrl: window.location.href, - } - if (beginDate.value != "" && lastDate.value != "") { - parsedBeginDate = beginDate.value.split("-"); - timestampBeginDate = new Date(parsedBeginDate[0], parsedBeginDate[1] - 1, parsedBeginDate[2]); - parsedLastDate = lastDate.value.split("-"); - timestampLastDate = new Date(parsedLastDate[0], parsedLastDate[1] - 1, parsedLastDate[2]); - if (timestampBeginDate.getTime() <= timestampLastDate.getTime()) { - if (timestampBeginDate.getTime() <= Date.now()) { - document.querySelector('#downloadButtonNMP').innerHTML = this.strings.logs_download_btn; - document.getElementById('downloadButtonNMP').disabled = true; - Axios({ - method: 'get', - url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", - timeout: timeout, - params: data, - }).then((response) => { - this.loading = false - if (response.status == 200 && response.data.ok) { - if (beginDate.value != "" || lastDate.value != "") { - let jsonData = response.data.data.jsonData; - jsonData = jsonData.map(row => ({ - Role: row.user.role, - Email: row.user.email, - Username: row.user.username, - Fullname: row.user.fullname, - Date: row.time.date, - Hour: row.time.hour, - CourseID: row.course.courseid, - SECTION_NAME: row.action.sectionname, - ACTION_TYPE: row.action.actiontype - })); - let csvData = vue.objectToCSV(jsonData); - vue.downloadCSV(csvData, "Activity_NoteMyProgress"); - document.querySelector('#downloadButtonNMP').innerHTML = this.strings.logs_valid_NMPbtn; - document.getElementById('downloadButtonNMP').disabled = false; - Alertify.success(this.strings.logs_success_file_downloaded); - } - } else { - Alertify.error(this.strings.logs_error_problem_encountered); - document.querySelector('#downloadButtonNMP').innerHTML = this.strings.logs_valid_NMPbtn; - document.getElementById('downloadButtonNMP').disabled = false; - } - }).catch((e) => { - Alertify.error(this.strings.logs_error_problem_encountered); - this.loading = false; - document.querySelector('#downloadButtonNMP').innerHTML = this.strings.logs_valid_NMPbtn; - document.getElementById('downloadButtonNMP').disabled = false; - }).finally(() => { - this.loading = false; - document.querySelector('#downloadButtonNMP').innerHTML = this.strings.logs_valid_NMPbtn; - document.getElementById('downloadButtonNMP').disabled = false; - }); - } else { //Si la date de début est supérieure à la date de fin - Alertify.error(this.strings.logs_error_begin_date_superior); - } - } else { //Si la date de début est inférieure à la date du jour - Alertify.error(this.strings.logs_error_begin_date_inferior); - } - } else { //Si les dates ne sont pas remplies - Alertify.error(this.strings.logs_error_empty_dates); - } - }, + getRapport() { + Alertify.confirm( + this.strings.logs_download_details_description, + () => { + let path = + M.cfg.wwwroot + + "/local/notemyprogress/downloads/Details_Informations_LogsNMP.pdf"; + var link = document.createElement("a"); + link.href = path; + link.download = "Details_Informations_LogsNMP.pdf"; + link.click(); + Alertify.success(this.strings.logs_download_details_validation); + } + ) + .set({ title: this.strings.logs_download_details_title }) + .set({ + labels: { + cancel: this.strings.logs_download_details_cancel, + ok: this.strings.logs_download_details_ok, + }, + }); + }, - get_help_content() { - var help_contents = []; - var help = new Object(); - help.title = this.strings.title; - help.description = this.strings.description; - help_contents.push(help); - return help_contents; - }, - - open_chart_help(chart) { - let contents = []; - if (chart == 'download_moodle') { - contents.push({ - title: this.strings.logs_download_moodle_help_title, - description: this.strings.logs_download_moodle_help_description, - }); - } else if (chart == "download_nmp") { - contents.push({ - title: this.strings.logs_download_nmp_help_title, - description: this.strings.logs_download_nmp_help_description, - }); - } - this.help_contents = contents; - if (this.help_contents.length) { - this.help_dialog = true; - } - }, + get_NMPfile() { + let lastDate = document.querySelector("#lastDateNMP"); + let beginDate = document.querySelector("#beginDateNMP"); + let timestampBeginDate = 0; + let timestampLastDate = 0; + let parsedBeginDate = []; + let parsedLastDate = []; + this.url = false; + this.loading = true; + var data = { + action: "downloadNMPlogs", + courseid: this.courseid, + userid: this.userid, + beginDate: beginDate.value, + lastDate: lastDate.value, + currentUrl: window.location.href, + }; + if (beginDate.value != "" && lastDate.value != "") { + parsedBeginDate = beginDate.value.split("-"); + timestampBeginDate = new Date( + parsedBeginDate[0], + parsedBeginDate[1] - 1, + parsedBeginDate[2] + ); + parsedLastDate = lastDate.value.split("-"); + timestampLastDate = new Date( + parsedLastDate[0], + parsedLastDate[1] - 1, + parsedLastDate[2] + ); + if (timestampBeginDate.getTime() <= timestampLastDate.getTime()) { + if (timestampBeginDate.getTime() <= Date.now()) { + document.querySelector("#downloadButtonNMP").innerHTML = + this.strings.logs_download_btn; + document.getElementById("downloadButtonNMP").disabled = true; + Axios({ + method: "get", + url: M.cfg.wwwroot + "/local/notemyprogress/ajax.php", + timeout: timeout, + params: data, + }) + .then((response) => { + this.loading = false; + if (response.status == 200 && response.data.ok) { + if (beginDate.value != "" || lastDate.value != "") { + let jsonData = response.data.data.jsonData; + jsonData = jsonData.map((row) => ({ + Role: row.user.role, + Email: row.user.email, + Username: row.user.username, + Fullname: row.user.fullname, + Date: row.time.date, + Hour: row.time.hour, + CourseID: row.course.courseid, + SECTION_NAME: row.action.sectionname, + ACTION_TYPE: row.action.actiontype, + })); + let csvData = vue.objectToCSV(jsonData); + vue.downloadCSV(csvData, "Activity_NoteMyProgress"); + document.querySelector("#downloadButtonNMP").innerHTML = + this.strings.logs_valid_NMPbtn; + document.getElementById( + "downloadButtonNMP" + ).disabled = false; + Alertify.success( + this.strings.logs_success_file_downloaded + ); + } + } else { + Alertify.error( + this.strings.logs_error_problem_encountered + ); + document.querySelector("#downloadButtonNMP").innerHTML = + this.strings.logs_valid_NMPbtn; + document.getElementById( + "downloadButtonNMP" + ).disabled = false; + } + }) + .catch((e) => { + Alertify.error(this.strings.logs_error_problem_encountered); + this.loading = false; + document.querySelector("#downloadButtonNMP").innerHTML = + this.strings.logs_valid_NMPbtn; + document.getElementById( + "downloadButtonNMP" + ).disabled = false; + }) + .finally(() => { + this.loading = false; + document.querySelector("#downloadButtonNMP").innerHTML = + this.strings.logs_valid_NMPbtn; + document.getElementById( + "downloadButtonNMP" + ).disabled = false; + }); + } else { + //Si la date de début est supérieure à la date de fin + Alertify.error(this.strings.logs_error_begin_date_superior); + } + } else { + //Si la date de début est inférieure à la date du jour + Alertify.error(this.strings.logs_error_begin_date_inferior); + } + } else { + //Si les dates ne sont pas remplies + Alertify.error(this.strings.logs_error_empty_dates); + } + }, - update_help_dialog(value) { - this.help_dialog = value; - }, + get_help_content() { + var help_contents = []; + var help = new Object(); + help.title = this.strings.title; + help.description = this.strings.description; + help_contents.push(help); + return help_contents; + }, - get_timezone() { - let information = `${this.strings.ss_change_timezone} ${this.timezone}` - return information; - }, - } - }) - } + open_chart_help(chart) { + let contents = []; + if (chart == "download_moodle") { + contents.push({ + title: this.strings.logs_download_moodle_help_title, + description: this.strings.logs_download_moodle_help_description, + }); + } else if (chart == "download_nmp") { + contents.push({ + title: this.strings.logs_download_nmp_help_title, + description: this.strings.logs_download_nmp_help_description, + }); + } + this.help_contents = contents; + if (this.help_contents.length) { + this.help_dialog = true; + } + }, - return { - init: init - }; - }); \ No newline at end of file + update_help_dialog(value) { + this.help_dialog = value; + }, + get_timezone() { + let information = `${this.strings.ss_change_timezone} ${this.timezone}`; + return information; + }, + }, + }); + } + return { + init: init, + }; +}); diff --git a/notemyprogress/amd/src/pageheader.js b/notemyprogress/amd/src/pageheader.js index 9a41b749175705cc14d42abbfb843d77c853f076..dd42f38dd9e519e1d6ee87d729f35faa1545bfd6 100644 --- a/notemyprogress/amd/src/pageheader.js +++ b/notemyprogress/amd/src/pageheader.js @@ -6,7 +6,7 @@ define(['local_notemyprogress/axios'], function (Axios){ <span v-text="pagetitle"></span> </v-flex> - <v-flex id="fml-group-selector"> + <v-flex id="nmp-group-selector"> <v-select attach v-model="selectedgroup" @@ -43,7 +43,7 @@ define(['local_notemyprogress/axios'], function (Axios){ </v-card-text> <v-divider class="ma-0"></v-divider> <v-card-actions class="d-flex justify-center help-dialog-footer"> - <v-btn text @click="dialog = false" v-text="exitbutton" class="ma-0 fml-btn-secondary"></v-btn> + <v-btn text @click="dialog = false" v-text="exitbutton" class="ma-0 nmp-btn-secondary"></v-btn> </v-card-actions> </v-card> </v-dialog> diff --git a/notemyprogress/amd/src/quiz.js b/notemyprogress/amd/src/quiz.js index 48a2e3a4c3d51862f5f53fc9d12955d2ebf639d2..5bc364b6bdf80be62e3f6a3dcfef79449883c6ce 100644 --- a/notemyprogress/amd/src/quiz.js +++ b/notemyprogress/amd/src/quiz.js @@ -20,7 +20,7 @@ define([ "use strict"; function init(content) { - // //console.log(content); + // console.log(content); Vue.use(Vuetify); Vue.component("pagination", Pagination); Vue.component("chart", ChartDynamic); diff --git a/notemyprogress/amd/src/sessions.js b/notemyprogress/amd/src/sessions.js index 25ddde416e4391e2e78ec1295f5bff694cdc97b1..b7e38ad6367c94adbb9180016693b869aadbcd06 100644 --- a/notemyprogress/amd/src/sessions.js +++ b/notemyprogress/amd/src/sessions.js @@ -20,7 +20,7 @@ define([ "use strict"; function init(content) { - // //console.log(content); + // console.log(content); Vue.use(Vuetify); Vue.component("pagination", Pagination); Vue.component("chart", ChartStatic); @@ -60,6 +60,7 @@ define([ setTimeout(function () { vue.setGraphicsEventListeners(); }, 500); + vue.setGraphicsEventListeners(); }, methods: { get_help_content() { diff --git a/notemyprogress/assignments.php b/notemyprogress/assignments.php index 98e9b55a2c1cf4cf104855c9728214715a1946f1..15de9238ff138042be349b389e7a6c044cb3b782 100644 --- a/notemyprogress/assignments.php +++ b/notemyprogress/assignments.php @@ -76,37 +76,37 @@ $content = [ "pagination_title" => get_string("pagination_title","local_notemyprogress"), "helplabel" => get_string("helplabel","local_notemyprogress"), "exitbutton" => get_string("exitbutton","local_notemyprogress"), - "about" => get_string("fml_about", "local_notemyprogress"), + "about" => get_string("nmp_about", "local_notemyprogress"), "email_strings" => array( - "validation_subject_text" => get_string("fml_validation_subject_text","local_notemyprogress"), - "validation_message_text" => get_string("fml_validation_message_text","local_notemyprogress"), + "validation_subject_text" => get_string("nmp_validation_subject_text","local_notemyprogress"), + "validation_message_text" => get_string("nmp_validation_message_text","local_notemyprogress"), "subject" => "", "subject_prefix" => $COURSE->fullname, - "subject_label" => get_string("fml_subject_label","local_notemyprogress"), - "message_label" => get_string("fml_message_label","local_notemyprogress"), - - "submit_button" => get_string("fml_submit_button","local_notemyprogress"), - "cancel_button" => get_string("fml_cancel_button","local_notemyprogress"), - "emailform_title" => get_string("fml_emailform_title","local_notemyprogress"), - "sending_text" => get_string("fml_sending_text","local_notemyprogress"), - "recipients_label" => get_string("fml_recipients_label","local_notemyprogress"), - "mailsended_text" => get_string("fml_mailsended_text","local_notemyprogress"), + "subject_label" => get_string("nmp_subject_label","local_notemyprogress"), + "message_label" => get_string("nmp_message_label","local_notemyprogress"), + + "submit_button" => get_string("nmp_submit_button","local_notemyprogress"), + "cancel_button" => get_string("nmp_cancel_button","local_notemyprogress"), + "emailform_title" => get_string("nmp_emailform_title","local_notemyprogress"), + "sending_text" => get_string("nmp_sending_text","local_notemyprogress"), + "recipients_label" => get_string("nmp_recipients_label","local_notemyprogress"), + "mailsended_text" => get_string("nmp_mailsended_text","local_notemyprogress"), "api_error_network" => get_string("api_error_network", "local_notemyprogress"), "scriptname" => $scriptname, ), - "access" => get_string("fml_access", "local_notemyprogress"), - "no_access" => get_string("fml_no_access", "local_notemyprogress"), - "access_chart_title" => get_string("fml_access_chart_title", "local_notemyprogress"), - "access_chart_yaxis_label" => get_string("fml_access_chart_yaxis_label", "local_notemyprogress"), - "access_chart_suffix" => get_string("fml_access_chart_suffix", "local_notemyprogress"), - "send_mail" => get_string("fml_send_mail", "local_notemyprogress"), - "student_text" => get_string("fml_student_text", "local_notemyprogress"), - "students_text" => get_string("fml_students_text", "local_notemyprogress"), + "access" => get_string("nmp_access", "local_notemyprogress"), + "no_access" => get_string("nmp_no_access", "local_notemyprogress"), + "access_chart_title" => get_string("nmp_access_chart_title", "local_notemyprogress"), + "access_chart_yaxis_label" => get_string("nmp_access_chart_yaxis_label", "local_notemyprogress"), + "access_chart_suffix" => get_string("nmp_access_chart_suffix", "local_notemyprogress"), + "send_mail" => get_string("nmp_send_mail", "local_notemyprogress"), + "student_text" => get_string("nmp_student_text", "local_notemyprogress"), + "students_text" => get_string("nmp_students_text", "local_notemyprogress"), "no_data" => get_string("no_data", "local_notemyprogress"), - "assignsubs_chart_title" => get_string("fml_assignsubs_title", "local_notemyprogress"), - "assignsubs_chart_yaxis" => get_string("fml_assignsubs_yaxis", "local_notemyprogress"), + "assignsubs_chart_title" => get_string("nmp_assignsubs_title", "local_notemyprogress"), + "assignsubs_chart_yaxis" => get_string("nmp_assignsubs_yaxis", "local_notemyprogress"), ], 'assigns_submissions_colors' => array('#06D6A0', '#FFD166', '#EF476F'), 'access_content_colors' => array('#06D6A0', '#EF476F'), diff --git a/notemyprogress/classes/configgamification.php b/notemyprogress/classes/configgamification.php new file mode 100644 index 0000000000000000000000000000000000000000..3fb9d502f2dcd001c6e220e6eddce06380f743c5 --- /dev/null +++ b/notemyprogress/classes/configgamification.php @@ -0,0 +1,409 @@ +<?php + +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see <http://www.gnu.org/licenses/>. + +/** + * Config Gamification + * + * @package local_notemyprogress + * @autor Edisson Sigua, Bryan Aguilar + * @copyright 2020 Edisson Sigua <edissonf.sigua@gmail.com>, Bryan Aguilar <bryan.aguilar6174@gmail.com> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace local_notemyprogress; + +require_once("lib_trait.php"); + +use stdClass; +use DirectoryIterator; +use core_collator; +use core_component; +use core_plugin_manager; + +class configgamification { + + use \lib_trait; + + public $course; + public $user; + public $levelsData; + + function __construct($course, $userid){ + $this->course = self::get_course($course); + $this->user = self::get_user($userid); + $this->levelsData = self::get_levels_data(); + $this->levelsData = self::get_first_levels(); + } + + /** + *verify That There Are Levels,If There Are No Creation ByDefault + * + * @return array A list with gaming levels of the course + * @throws coding_exception | dml_exception + */ + public function get_first_levels(){ + $levelsData = $this->levelsData; + + if(!$levelsData){ + $levelsData = self::create_first_levels(); + $this->levelsData = $levelsData; + } + return $levelsData; + } + + /** + * Create the first two levels (default levels) of NoteMyProgress in a course.This function is executed + * automatically for each course. + * + * @return stdClass An object with the levels created + * @throws dml_exception + */ + private function create_first_levels(){ + global $DB; + + $levelsInfo[] = array('lvl' => 1, 'name' => 'Level 1', 'des' => '', 'points' => 0); + $levelsInfo[] = array('lvl' => 2, 'name' => 'Level 2', 'des' => '', 'points' => 120); + + $settings = array( + 'pointsbase' => 120, + 'tit' => 'Raise your level while learning', + 'des' => 'Interact with your course make you stronger' + ); + + $levelsData = new stdClass(); + $levelsData->levelsdata = json_encode($levelsInfo); + $levelsData->settings = json_encode($settings); + $levelsData->rules = json_encode(self::default_rules()); + $levelsData->courseid = $this->course->id; + $levelsData->created_by = $this->user->id; + $levelsData->modified_by = $this->user->id; + $levelsData->timecreated = self::now_timestamp(); + $levelsData->timemodified = self::now_timestamp(); + + $id = $DB->insert_record("notemyprogress_levels_data", $levelsData, true); + $levelsData->id = $id; + return $levelsData; + } + + /** + * Gets information about the level configuration + * + * @return array a list with the weeks configured in a course + */ + public function get_levels_data(){ + global $DB; + $levelsData = $DB->get_record_select( + "notemyprogress_levels_data", + 'courseid = ? AND timedeleted IS NULL', + array($this->course->id)); + + if($levelsData){ + $levelsData->levelsdata = json_decode($levelsData->levelsdata); + $levelsData->settings = json_decode($levelsData->settings); + $levelsData->rules = json_decode($levelsData->rules); + + + + } + $sql = "SELECT enablegamification from {notemyprogress_gamification} where courseid=? AND timecreated=? "; + $value = $DB->get_record_sql($sql, array("courseid="=>($courseid),"timecreated="=>$timecrated->maximum)); + + return $levelsData; + } + + /** + * Save the Gaming Levels of NotemyProgress configured in a course + * + * @param array $ Levels Levels to Save + * + * @return void + * @throws Exception + */ + public function save_levels($levelsInfo, $settings, $rules){ + global $DB; + self::delete_levels(); + $levelsData = new stdClass(); + $levelsData->levelsdata = ($levelsInfo); + $levelsData->settings = ($settings); + $levelsData->rules = ($rules); + $levelsData->courseid = $this->course->id; + $levelsData->created_by = $this->user->id; + $levelsData->modified_by = $this->user->id; + $levelsData->timecreated = self::now_timestamp(); + $levelsData->timemodified = self::now_timestamp(); + $id = $DB->insert_record("notemyprogress_levels_data", $levelsData, true); + $levelsData->id = $id; + return $levelsData; + } + + public function save_enable($enable){ + global $DB; + $param = new stdClass(); + $param->courseid = $this->course->id; + $param->userid = $this->user->id; + if ($enable){ $param->enablegamification =1;}else{ $param->enablegamification =0;} + $param->timecreated = self::now_timestamp(); + //if ($timecreated == null){$result = 1;} + //if ($timecreated === null){$result = 2;} + //if ($timecreated == 'null'){$result = 3;} + //if ($timecreated->maximum == null){$result = 9;} + //if ($timecreated->maximum === null){$result = 10;} + $DB->insert_record("notemyprogress_gamification", $param,true); + } + /** + * Eliminates the Gaming Levels of NoteMyProgress configured in a course + * + * @return void + * @throws dml_exception + */ + public function delete_levels(){ + global $DB; + $levelsData = $this->levelsData; + $id = $levelsData->id; + $sql = "update {notemyprogress_levels_data} set timedeleted = ? where id = ?"; + $DB->execute($sql, array(self::now_timestamp() , $id)); + } + + /** + * Get the default gamification rules + * + * @return array a list of rules configured in a course + */ + public function default_rules() { + $ruleset[] = array('rule' => '\mod_book\event\course_module_viewed', 'points' => 5); + $ruleset[] = array('rule' => '\mod_page\event\course_module_viewed', 'points' => 10); + $ruleset[] = array('rule' => '\mod_forum\event\discussion_subscription_created', 'points' => 20); + $ruleset[] = array('rule' => '\core\event\course_viewed', 'points' => 2); + return $ruleset; + } + + /** + * Get a list of events. + */ + public final function events_list() { + $list = []; + + $coreevents = $this->get_core_events(); + $coreevents = [get_string('coresystem') => array_reduce(array_keys($coreevents), function($carry, $prefix) use ($coreevents) { + return array_merge($carry, array_reduce($coreevents[$prefix], function($carry, $eventclass) use ($prefix) { + $infos = self::get_event_infos($eventclass); + if ($infos) { + $name = get_string('tg_colon', 'local_notemyprogress', [ + 'a' => $prefix, + 'b' => $infos['name'] + ]); + $carry = array('name' => $name, 'event' => $infos['eventname']); + } + return $carry; + }, [])); + }, [])]; + + foreach ($coreevents as $event) { + $list[] = $event; + } + + // Get module events. + $list = array_merge($list, self::get_events_list_from_plugintype('mod')); + + return $list; + } + + /** + * Get the core events. + * + * @return array The keys are translated subsystem names, the values are the classes. + */ + protected function get_core_events() { + // Add some system events. + return [get_string('course') => [ + '\\core\\event\\course_viewed', + ]]; + } + + + /** + * Return the info about an event. + * + * The key 'name' is added to contain the readable name of the event. + * It is done here because debugging is turned off and some events use + * deprecated strings. + * + * We also add the key 'isdeprecated' which indicates whether the event + * is obsolete or not. + * + * @param string $class The name of the event class. + * @return array|false + */ + public static function get_event_infos($class) { + global $CFG; + $infos = false; + + // We need to disable debugging as some events can be deprecated. + $debuglevel = $CFG->debug; + $debugdisplay = $CFG->debugdisplay; + set_debugging(0, false); + + // Check that the event exists, and is not an abstract event. + if (method_exists($class, 'get_static_info')) { + $ref = new \ReflectionClass($class); + if (!$ref->isAbstract()) { + $infos = $class::get_static_info(); + $infos['name'] = method_exists($class, 'get_name_with_info') ? $class::get_name_with_info() : $class::get_name(); + $infos['isdeprecated'] = method_exists($class, 'is_deprecated') ? $class::is_deprecated() : false; + } + } + + // Restore debugging. + set_debugging($debuglevel, $debugdisplay); + + return $infos; + } + + /** + * Get events from plugin type. + * + * @param string $plugintype Plugin type. + * @return array + */ + protected static function get_events_list_from_plugintype($plugintype) { + $list = []; + + // Loop over each plugin of the type. + $pluginlist = core_component::get_plugin_list($plugintype); + foreach ($pluginlist as $plugin => $directory) { + $component = $plugintype . '_' . $plugin; + $events = self::get_events_list_from_plugin($component); + + // If we found events for this plugin, we add them to the list. + if (!empty($events)) { + //$pluginmanager = core_plugin_manager::instance(); + //$plugininfo = $pluginmanager->get_plugin_info($component); + foreach ($events as $event) { + $list[] = $event; + } + } + } + + return $list; + } + + /** + * Get the events list from a plugin. + * + * From 3.1 we could be using core_component::get_component_classes_in_namespace(). + * + * @param string $component The plugin's component name. + * @return array + */ + protected static function get_events_list_from_plugin($component) { + $directory = core_component::get_component_directory($component); + $plugindirectory = $directory . '/classes/event'; + if (!is_dir($plugindirectory)) { + return []; + } + + // Get the plugin's events. + $eventclasses = static::get_event_classes_from_component($component); + + $pluginmanager = core_plugin_manager::instance(); + $plugininfo = $pluginmanager->get_plugin_info($component); + + // Reduce to the participating, non-deprecated event. + $events = array_reduce($eventclasses, function($carry, $class) use ($plugininfo) { + $infos = self::get_event_infos($class); + if (empty($infos)) { + // Skip rare case where infos aren't found. + return $carry; + } else if ($infos['edulevel'] != \core\event\base::LEVEL_PARTICIPATING) { + // Skip events that are not of level 'participating'. + return $carry; + } + +// $carry[$infos['eventname']] = get_string('tg_colon', 'local_notemyprogress', [ +// 'a' => $plugininfo->displayname, +// 'b' => $infos['name'] +// ]); + + $name = get_string('tg_colon', 'local_notemyprogress', [ + 'a' => $plugininfo->displayname, + 'b' => $infos['name'] + ]); + + $carry[] = array('name' => $name, 'event' => $infos['eventname']); + + return $carry; + }, []); + + // Order alphabetically. + //core_collator::asort($events, core_collator::SORT_NATURAL); + + return $events; + } + + /** + * Get the events classes from a component. + * + * @param string $component The component. + * @return Array of classes. Those may not be relevant (abstract, invalid, ...) + */ + public static function get_event_classes_from_component($component) { + $directory = core_component::get_component_directory($component); + $plugindirectory = $directory . '/classes/event'; + if (!is_dir($plugindirectory)) { + return []; + } + + $eventclasses = []; + $diriter = new DirectoryIterator($plugindirectory); + foreach ($diriter as $file) { + if ($file->isDot() || $file->isDir()) { + continue; + } + + // It's a good idea to use the leading slashes because the event's property + // 'eventname' includes them as well, so for consistency sake... Also we do + // not check if the class exists because that would cause the class to be + // autoloaded which would potentially trigger debugging messages when + // it is deprecated. + $name = substr($file->getFileName(), 0, -4); + $classname = '\\' . $component . '\\event\\' . $name; + $eventclasses[] = $classname; + } + return $eventclasses; + } + /** + * Get the data needed to complete the graph. + * + * @param int $courseid the course id. + * @return array an array containing the apropriate data well formated + */ + public static function get_spread_chart($courseid){ + Global $DB; + $resultat = []; + $levelsData = "SELECT MAX(level) as lvl from {notemyprogress_xp} where courseid=?"; + $lvl = $DB->get_record_sql($levelsData, array("courseid="=>($courseid))); + $i = 1; + while($i<=$lvl->lvl){ + $levelCount = "SELECT COUNT(*) as cpt from {notemyprogress_xp} where courseid=? and level=?"; + $cpt = $DB->get_record_sql($levelCount, array("courseid="=>($courseid),"level="=>($i))); + $string = "level {$i} :"; + array_push( $resultat,[$string,intval($cpt->cpt)]); + $i = $i+1; + } + return $resultat; + } +} \ No newline at end of file diff --git a/notemyprogress/classes/configweeks.php b/notemyprogress/classes/configweeks.php index a5dbb940edb9b0055e9a23676e0f19b6fc76917f..d81353dec877418f2b7aaaa70be8e2c19a681e61 100644 --- a/notemyprogress/classes/configweeks.php +++ b/notemyprogress/classes/configweeks.php @@ -53,7 +53,7 @@ class configweeks } /** - * Gets the last instance configured for Fliplearning weeks. If no weeks have been + * Gets the last instance configured for NoteMyProgress weeks. If no weeks have been * configured in a course yet, the last instance is the one created by default by the plugin. * * @return mixed a fieldset object that contains the first record that matches the query. @@ -70,10 +70,10 @@ class configweeks } /** - * Crea una nueva instancia para la configuración de semanas de Fliplearning. Esta es la instancia - * que se crea por defecto. + * Create a new instance for the setting of weeks of Note My Progress.This is the instance + * That is created by default. * - * @return mixed un objeto fieldset que contiene el registro creado + * @return mixed A FieldSet object that contains the created record */ public function create_instance() { @@ -88,10 +88,10 @@ class configweeks } /** - * Gets the weeks configured in Fliplearning based on the ids of the class attributes - * $course e $intance. You can specify. + * Obtain the weeks configured in Note My progress based on the IDs of class attributes + * $ Course and $ INTANCE.It can be specified * - * @return array una lista con las semanas configuradas en un curso + * @return Array a list with the weeks configured in a course */ public function get_weeks() { @@ -104,10 +104,10 @@ class configweeks } /** - * Adds the sections field to the weeks class variable to store the sections assigned to each week. + * Add the Sections field to the class variable weeks to store the sections assigned to each week. * - * @return array a list with the weeks of the course and the sections assigned to each one. - * @throws coding_exception | dml_exception + * @return Array a list with the weeks of the course and sections assigned to each + * @throws Coding_Exception |DML_EXCEPTION. */ public function get_weeks_with_sections() { @@ -145,10 +145,10 @@ class configweeks } /** - * Crea la primera semana (semana por defecto) de Fliplearning en un curso. Esta funcion se ejecuta - * de manera automática para cada curso. + * Create the first week (default week) of Note My progress in a course.This function is executed + * automatically for each course. * - * @return stdClass un objeto con la semana creada + * @return stdClass An object with the week created * @throws dml_exception */ private function create_first_week() @@ -174,10 +174,10 @@ class configweeks } /** - * Genera un código de identificación para una semana de Fliplearning. El código se forma - * en base al año actual, id de la instancia de Fliplearning en el curso y posición de la semana + * Generates an identification code for one week of NoteMyProgress. The code is formed + * based on the current year, id of the NoteMyProgress instance in the course and position in the week. * - * @return int entero que representa el identificador de la semana + * @return int integer representing the week identifier. */ private function generate_week_code($weekposition) { @@ -187,11 +187,11 @@ class configweeks } /** - * Obtiene las secciones de una la semana identificada por el parámetro $weekcode + * Gets the sections of a week identified by the parameter $weekcode * - * @param string $weekcode identificador de la semana de la que se debe obtener las semanas + * @param string $weekcode identifier of the week from which the weeks are to be obtained * - * @return array lista con las secciones asignadas a la semana + * @return array list with the sections assigned to the week */ public function get_week_sections($weekcode) { @@ -202,12 +202,12 @@ class configweeks } /** - * Devuelve un valor booleano que representa si la semana es visible o no + * Returns a Boolean value representing whether the week is visible or not. * - * @param int $sectionid id de la sección + * @param int $sectionid id of the section * - * @return boolean valor booleano que representa si la sección es visible o no. Retorna null en caso de - * no encontrar la sección + * @return boolean boolean value representing whether the section is visible or not. Return null in case of + * the section is not found */ private function get_current_visibility($sectionid) { @@ -220,14 +220,15 @@ class configweeks } /** - * Actualiza el nombre de una sección (parámetro $section) si existe en la lista de secciones del - * parámetro $course_sections. En caso de que la sección ya tenga un nombre, no se actualiza su nombre. + * Updates the name of a section ($section parameter) if it exists in the list of sections in the $course_sections parameter. + * parameter $course_sections. In case the section already has a name, its name is not updated. * - * @param object $section objeto para verificar existencia - * @param object $course_sections lista de secciones para validar + * @param object $section object to check for existence + * @param object $course_sections list of sections to validate * - * @return object objeto con la sección actualizada + * @return object object with the section updated */ + private function validate_section($section, $course_sections) { $exist = false; @@ -246,10 +247,10 @@ class configweeks } /** - * Actualiza el nombre de una sección de Fliplearning + * Update the name of a NoteMyProgress section. * - * @param object $sectionid id de la seccion para actualizar - * @param object $name nuevo nombre para la sección + * @param object $sectionid id of the section to be updated + * @param object $name new section name * * @return void */ @@ -261,9 +262,9 @@ class configweeks } /** - * Verifica si un curso tiene configurada las semanas de Fliplearning + * Verify if a course has NoteMyProgress weeks configured. * - * @return boolean valor booleano que representa si las semanas han sido configuradas + * @return boolean boolean value representing if the weeks have been configured */ public function is_set() { @@ -279,9 +280,9 @@ class configweeks } /** - * Obtiene las configuraciones de Fliplearning en un curso + * Gets the NoteMyProgress configurations in a course * - * @return array lista de valores booleanos con las configuraciones del curso + * @return array list of boolean values with course settings */ public function get_settings() { @@ -311,10 +312,9 @@ class configweeks } /** - * Obtiene una lista de las secciones de un curso (sin la configuración de - * las semanas de Fliplearning) + * Gets a list of the sections of a course (without the NoteMyProgress week configuration) * - * @return array lista de secciones del curso + * @return array list of course sections */ public function get_sections_without_week() { @@ -334,9 +334,9 @@ class configweeks } /** - * Guarda las semanas de Fliplearning configuradas en un curso + * Saves NoteMyProgress weeks configured in a course * - * @param array $weeks semanas a guardar + * @param array $weeks weeks to save * * @return void * @throws Exception @@ -352,7 +352,7 @@ class configweeks } /** - * Elimina las semanas de Fliplearning configuradas en un curso + * Eliminates the weeks configured in a course * * @return void * @throws dml_exception @@ -369,9 +369,9 @@ class configweeks } /** - * Elimina las secciones asignadas a una semana de Fliplearning + * Eliminates sections assigned to a week * - * @param string $weekcode id de la semana a eliminar + * @param string $weekcode ID of the week to eliminate * * @return void * @throws dml_exception @@ -384,10 +384,10 @@ class configweeks } /** - * Guarda una semana de Fliplearning configurada en un curso + * Save a week of Note My Progress configured in a course * - * @param object $week semana a guardar - * @param int $position posicion de la semana + * @param Object $Week week to save + * @param int $Position position of the week * * @return void * @throws Exception @@ -412,10 +412,10 @@ class configweeks } /** - * Guarda las secciones asignadas a una semana de Fliplearning + * Save the sections assigned to a week * - * @param string $weekcode id de la semana a la que pertenece las secciones - * @param array $sections lista de secciones a guardar + * @param string $Weekcode ID of the week to which the sections belong + * @param array $sections List of Sections to Save * * @return void * @throws dml_exception @@ -429,11 +429,11 @@ class configweeks } /** - * Guarda una seccion asignada a una semana de Fliplearning + * Save a section assigned to a week * - * @param object $section sección a guardar - * @param int $weekcode id de la semana a la que pertenece la sección - * @param int $position posición de la sección + * @param object $section section saved + * @param int $weekcode ID of the week to which the section belongs + * @param int $position Position of the section * * @return void */ @@ -452,10 +452,10 @@ class configweeks } /** - * Obtiene el nombre de una sección dado su id + * Gets the name of a given section your ID * - * @param int $sectionid id de sección - * @param int $position posición de la sección + * @param int $sectionid Section ID. + * @param int $position Position of the section * * @return void */ @@ -468,13 +468,13 @@ class configweeks } /** - * Returns the current week of the configured Fliplearning weeks. In case the query - * is made after the course has ended, the last configured week is returned. + * Returns the current week of the scheduled weeks of Note My progress.In case the consultation + * is done after the course is over, the last week is returned * - * @param int $last_if_course_finished parámetro entero opcional para devolver la última semana configurada - * en caso de que el curso haya terminado + * @param int $last_if_course_finished Optional parameter wich makes the function return the last week configured + * in case the course is finished * - * @return object objeto con la semana actual a la última semana + * @return Object object with the current week at the last week */ public function get_current_week($last_if_course_finished = true) { @@ -495,12 +495,9 @@ class configweeks } /** - * Toma la fecha actual al momento de hacer la llamada a la funcion y le resta 7 días para obtener - * el día de la peticion de la semana pasada. Si el día obtenido esta dentro de alguna de las semanas - * configuradas de Fliplearning entonces se retorna esa semana, de lo contratio se retorna null + * Returns the week before the week wich indludes the current date. * - * @return object objeto con la semana a la que corresponde la fecha actual menos 7 días. En caso de - * no encontrarlo se retorna null + * @return object Object with the week wich indludes the current date. If the week is not found, Null is returned. */ public function get_past_week() { @@ -514,7 +511,12 @@ class configweeks } return $past; } - + + /** + * Creates a paginator composed of pages. Each page is an object corresponding to a week. + * + * @return object paginator composed of pages for each week. + */ public function get_weeks_paginator() { $pages = array(); @@ -530,8 +532,6 @@ class configweeks $page->is_current_week = $week->weekcode == $current_week->weekcode ? true : false; array_push($pages, $page); } - //file_put_contents('D:\Alexis\Stage_IRIT\NMP\debug\log.txt', print_r("pages = ", TRUE), FILE_APPEND); - //file_put_contents('D:\Alexis\Stage_IRIT\NMP\debug\log.txt', print_r($pages, TRUE), FILE_APPEND); return $pages; } } diff --git a/notemyprogress/classes/email.php b/notemyprogress/classes/email.php index 9252162788c3526e59e35a5671a846e4d7d20d7f..89bf542dcd902c14ab88635694ed14bf16cb5c9f 100644 --- a/notemyprogress/classes/email.php +++ b/notemyprogress/classes/email.php @@ -60,12 +60,12 @@ class email { $sender->lastname = $this->user->lastname; $sender->email = $this->user->email; - $footer_prefix = get_string("fml_email_footer_prefix","local_notemyprogress"); - $footer_suffix = get_string("fml_email_footer_suffix","local_notemyprogress"); - $footer_text = get_string("fml_email_footer_text","local_notemyprogress"); + $footer_prefix = get_string("nmp_email_footer_prefix","local_notemyprogress"); + $footer_suffix = get_string("nmp_email_footer_suffix","local_notemyprogress"); + $footer_text = get_string("nmp_email_footer_text","local_notemyprogress"); $url=""; if (isset($modulename) && strlen(trim($modulename))>0) { - $identifier = "fml_{$modulename}_url"; + $identifier = "nmp_{$modulename}_url"; if (get_string_manager()->string_exists($identifier, "local_notemyprogress")) { $module_url = get_string($identifier, "local_notemyprogress"); $url = "{$CFG->wwwroot}{$module_url}{$moduleid}"; diff --git a/notemyprogress/classes/event_strategy.php b/notemyprogress/classes/event_strategy.php new file mode 100644 index 0000000000000000000000000000000000000000..134b9aee5171eefbb2ab689e68ed484daf01eec2 --- /dev/null +++ b/notemyprogress/classes/event_strategy.php @@ -0,0 +1,494 @@ +<?php +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see <http://www.gnu.org/licenses/>. + +/** + * Event Collector Observer + * + * @package local_notemyprogress + * @autor Edisson Sigua, Bryan Aguilar + * @copyright 2020 Edisson Sigua <edissonf.sigua@gmail.com>, Bryan Aguilar <bryan.aguilar6174@gmail.com> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace local_notemyprogress; + +defined('MOODLE_INTERNAL') || die(); + +require_once("lib_trait.php"); + +use stdClass; +use DateTime; +use dml_exception; +use lang_string; + +class event_strategy { + + use \lib_trait; + + protected $table_xp = 'notemyprogress_xp'; + protected $table_log = 'notemyprogress_xp_log'; + public $course; + public $user; + public $configgamification; + + public function __construct($course, $userid) { + $this->course = self::get_course($course); + $this->user = self::get_user($userid); + $this->configgamification = new \local_notemyprogress\configgamification($course, $userid); + } + + /** + * Manejador de eventos. + * + * @param \core\event\base $event The event. + * @return void + */ + public function collect_event(\core\event\base $event) { + + if (!self::can_capture_event($event)) { + return; + } + + $points = self::get_points_for_event($event); + if ($points === null) { + return; + } + + if ($points > 0) { + self::increase($this->user->id, $this->course->id, $points); + self::save_log($this->user->id, $this->course->id, $points, $event->eventname); + } + } + + /** + * Compruebe si el usuario puede capturar este evento. + * + * @param \core\event\base $event El evento. + * @return bool True cuando el evento es permitido. + */ + protected function can_capture_event(\core\event\base $event) { + global $SESSION; + + $now = time(); + $maxcount = 64; + + /* + * El número máximo de acciones que contarán como puntos durante el período de tiempo dado. + * Cualquier acción posterior será ignorada. Cuando este valor está vacío o es igual a cero, no se aplica.*/ + $maxactions = 10; + + /* El período de tiempo (segundos) durante el cual el usuario no debe exceder un número máximo de acciones.*/ + $maxtime = 60; + + /* + * Se acepta nuevamente el tiempo mínimo requerido antes de que una acción que ya sucedió anteriormente. + * Una acción se considera idéntica si se colocó en el mismo contexto y objeto. + * Cuando este valor está vacío o es igual a cero, no se aplica.*/ + $actiontime = 180; + + $actionkey = $event->eventname . ':' . $event->contextid . ':' . $event->objectid . ':' . $event->relateduserid; + + if (!isset($SESSION->local_notemyprogress_cheatguard)) { + // Init the session variable. + $SESSION->local_notemyprogress_cheatguard = []; + } else { + // Ensure that all entries are arrays, they may not be when we just upgraded the plugin. + $SESSION->local_notemyprogress_cheatguard = array_map(function($entry) { + return is_array($entry) ? $entry : [$entry]; + }, $SESSION->local_notemyprogress_cheatguard); + } + + // Perform the check. + if (!static::is_action_accepted($actionkey, $now, $SESSION->local_notemyprogress_cheatguard, $maxactions, $maxtime, $actiontime)) { + return false; + } + + // Move the action at the end of the array. + $times = isset($SESSION->local_notemyprogress_cheatguard[$actionkey]) ? $SESSION->local_notemyprogress_cheatguard[$actionkey] : []; + unset($SESSION->local_notemyprogress_cheatguard[$actionkey]); + $SESSION->local_notemyprogress_cheatguard[$actionkey] = $times; + + // Log the time at which this event happened. + $SESSION->local_notemyprogress_cheatguard[$actionkey][] = time(); + + // Limit the timestamps of each action to a maximum of $maxcount within the timeframe desired or + // the last 15min. We want to keep at least 15 min so that when teachers are testing changes, + // they do not get confused because actions they had just performed no longer gets blocked. + $timethreshold = $now - max([$maxtime, $actiontime, 900]); + $SESSION->local_notemyprogress_cheatguard = array_filter(array_map(function($times) use ($maxcount, $timethreshold) { + return array_slice(array_filter($times, function($time) use ($timethreshold) { + return $time > $timethreshold; + }), -$maxcount); + }, $SESSION->local_notemyprogress_cheatguard)); + + // Limit the array of events to $maxcount, we do not want to flood the session for no reason. + $SESSION->local_notemyprogress_cheatguard = array_slice($SESSION->local_notemyprogress_cheatguard, -$maxcount, null, true); + + return true; + } + + /** + * Comprueba si la acción es aceptada. + * + * @param string $action Clave de la acción. + * @param int $now Timestamp. + * @param array $log Array where keys are actions, and values are timestamp arrays. + * @param int $maxactions El máximo número de acciones. + * @param int $maxintime Tiempo durante el cual el máximo número de acciones es permitido. + * @param int $timebetweenrepeats Tiempo entre acciones repetidas. + * @return bool + */ + public static function is_action_accepted($action, $now, array $log, $maxactions, $maxintime, $timebetweenrepeats) { + + if ($maxactions > 0 && $maxintime > 0) { + $timethreshold = $now - $maxintime; + $actionsintimeframe = array_reduce($log, function($carry, $times) use ($timethreshold) { + return $carry + array_reduce($times, function($carry, $time) use ($timethreshold) { + return $carry + ($time > $timethreshold ? 1 : 0); + }); + }, 0); + if ($actionsintimeframe >= $maxactions) { + return false; + } + } + + if ($timebetweenrepeats > 0) { + $timethreshold = $now - $timebetweenrepeats; + $times = isset($log[$action]) ? $log[$action] : []; + if (!empty($times) && max($times) > $timethreshold) { + return false; + } + } + + return true; + } + + /** + * Obtiene los puntos para un evento. + * + * @param \core\event\base $event event. + * @return int Points, or null. + */ + public function get_points_for_event(\core\event\base $event) { + $ruleset = $this->configgamification->get_levels_data()->rules; + foreach ($ruleset as $rule) { + if ($rule->rule == $event->eventname) { + return $rule->points; + } + } + return null; + } + + /** + * Agregar puntos de experiencia. + * + * @param int $id The receiver. + * @param int $amount The amount. + */ + public function increase($userid, $courseid, $amount) { + global $DB; + $prexp = 0; + $postxp = $amount; + + if ($record = self::get_user_data($userid, $courseid)) { + $prexp = (int)$record->points; + $postxp = $prexp + $amount; + + $sql = "UPDATE {{$this->table_xp}} + SET points = points + :points + WHERE courseid = :courseid + AND userid = :userid"; + $params = [ + 'points' => $amount, + 'courseid' => $courseid, + 'userid' => $userid + ]; + $DB->execute($sql, $params); + + $newxp = (int)$record->points + $amount; + $newlevel = self::get_level_from_xp($newxp)->lvl; + if ($record->level != $newlevel) { + $DB->set_field($this->table_xp, 'level', $newlevel, ['courseid' => $courseid, 'userid' => $userid]); + } + } else { + self::insert($userid, $courseid, $amount); + } + } + + /** + * Log a thing. + * + * @param int $userid The target. + * @param int $courseid The target. + * @param int $points The points. + * @param reason $reason The reason. + * @param DateTime|null $time When that happened. + * @return void + */ + public function save_log($userid, $courseid, $points, $eventName) { + global $DB; + $time = new DateTime(); + $record = new stdClass(); + $record->courseid = $courseid; + $record->userid = $userid; + $record->event = $eventName; + $record->points = $points; + $record->timecreated = $time->getTimestamp(); + try { + $DB->insert_record($this->table_log, $record); + } catch (dml_exception $e) {} + + } + + /** + * Agregar puntos de experiencia a un usuario en la tabla notemyprogress_xp. + * + * @param int $id The receiver. + * @param int $amount The amount. + */ + public function insert($userid, $courseid, $amount) { + global $DB; + $record = new stdClass(); + $record->courseid = $courseid; + $record->userid = $userid; + $record->points = $amount; + $record->level = self::get_level_from_xp($amount)->lvl; + try { + $DB->insert_record($this->table_xp, $record); //* + } catch (dml_exception $e) {} + } + + /** + * Give the level from the xp points. + * + * @param int $xp The xp points. + * @return level + */ + public function get_level_from_xp($points) { + $levels = $this->configgamification->get_levels_data()->levelsdata; + for ($i = count($levels)-1; $i >= 0; $i--) { + $level = $levels[$i]; + if ($level->points <= $points) { + return $level; + } + } + return $level; + } + + /** + * Obtiene el próximo nivel de un usuario + * + * @return null|level + */ + public function get_next_level($userid) { + $configgamification = $this->configgamification->get_levels_data(); + $levels = $configgamification->levelsdata; + $userData = self::get_user_data($userid, $this->course->id); + $levelnum = $userData->level; + + if ($levelnum > count($levels)-1) { + $nextlevel = false; + } else { + $nextlevel = $levels[$levelnum]; + } + + // TODO: validar que pasa cuando supera el ultimo nivel + if ($nextlevel === false) { + return null; + } + + return $nextlevel; + } + + /** + * Obtiene la información de puntos de experiencia de un usuario + * + * @return null|response + */ + public function get_user_info() { + + $response = new stdClass(); + $recentCount = 3; + if (self::get_user_data($this->user->id, $this->course->id)) { + + $userData = self::get_user_data($this->user->id, $this->course->id); + $nextlevel = self::get_next_level($this->user->id); + $activity = self::get_user_recent_activity($this->user->id, $this->course->id, $recentCount); + $levelInfo = self::get_level_from_xp($userData->points); + + $response->points = $userData->points; + $response->level = $userData->level; + $response->activity = $activity; + $response->levelInfo = $levelInfo; + $response->uid=$this->user->id; + $response->cid=$this->course->id; + + // $response->points = 1; + // $response->level = 2; + // $response->activity = 3; + // $response->levelInfo = $userData->points; + + if(is_null($nextlevel)) { + // Si no existe un siguiente nivel + $response->pointsToNext = 0; + $response->progress = 100; + }else{ + $response->pointsToNext = $nextlevel->points - $userData->points; + $response->progress = ($userData->points*100)/$nextlevel->points; + } + }else{return self::get_user_data($this->user->id, $this->course->id);} + return $response; + } + + /** + * Obtiene un ranking con los puntos de experiencia de los usuarios + * + * @return users + */ + public function get_ranking($int) { + global $DB; + + $users = array(); + if ($int==1){ + $sql = "SELECT * FROM {{$this->table_xp}} WHERE courseid = {$this->course->id} and rankable = 1 ORDER BY points DESC"; + }else{ + $sql = "SELECT * FROM {{$this->table_xp}} WHERE courseid = {$this->course->id} ORDER BY points DESC"; + } + + $rank = $DB->get_recordset_sql($sql); + $index = 1; + + foreach($rank as $user){ + + $completeUser = self::get_user_from_id($user->userid); + $nextlevel = self::get_next_level($user->userid); + + $aux = new stdClass(); + $aux->ranking = $index; + $aux->level = $user->level; + $aux->student = $completeUser->firstname.' '.$completeUser->lastname; + $aux->total = $user->points; + + if(is_null($nextlevel)) { + // Si no existe un siguiente nivel + $aux->progress_percentage = 100; + }else{ + $aux->progress_percentage = ($user->points*100)/$nextlevel->points; + } + + $users[] = $aux; + + $index++; + } + $rank->close(); + return $users; + } + + /** + * Verifica si el usuario existe en la tabla de puntos de experiencia. + * + * @param int $id The receiver. + * @return stdClass|false + */ + public function get_user_data($userid, $courseid) { + global $DB; + $params = []; + $params['userid'] = $userid; + $params['courseid'] = $courseid; + return $DB->get_record($this->table_xp, array("userid"=>$userid,"courseid"=>$courseid)); + } + + /** + * Obtener la actividad reciente del usuario de la tabla notemyprogress_xp_log. + * + * @param int $userid El identificador del usuario. + * @param int $courseid El identificador del curso. + * @param int $count El número de registros a recuperar. + * @return activity + */ + public function get_user_recent_activity($userid, $courseid, $count = 0) { + global $DB; + $results = $DB->get_records_select($this->table_log, 'courseid = :courseid AND userid = :userid AND points > 0', [ + 'courseid' => $courseid, + 'userid' => $userid, + ], 'timecreated DESC, id DESC', '*', 0, $count); + + $activities = array(); + foreach($results as $row){ + $desc = ''; + $class = $row->event; + if (class_exists($class) && is_subclass_of($class, 'core\event\base')) { + $desc = $class::get_name(); + } else { + $desc = new lang_string('somethinghappened', 'local_notemyprogress'); + } + $activity = new stdClass(); + $activity->timeago = self::time_ago(new DateTime('@' . $row->timecreated)); + $activity->description = $desc; + $activity->points = $row->points; + $activities[] = $activity; + } + +// return array_map(function($row) { +// $desc = ''; +// $class = $row->event; +// if (class_exists($class) && is_subclass_of($class, 'core\event\base')) { +// $desc = $class::get_name(); +// } else { +// $desc = new lang_string('somethinghappened', 'local_notemyprogress'); +// } +// $activity = new stdClass(); +// $activity->timeago = self::time_ago(new DateTime('@' . $row->timecreated)); +// $activity->description = $desc; +// $activity->points = $row->points; +// return $activity; +// }, $results); + + return $activities; + } + + /** + * Obtener un timestamp de la forma hace 5 min. + * + * @param DateTime $dt Objeto de tipo DateTime. + * @return string + */ + public function time_ago(DateTime $dt) { + $now = new \DateTime(); + $diff = $now->getTimestamp() - $dt->getTimestamp(); + $ago = '?'; + + if ($diff < 15) { + $ago = get_string('tg_timenow', 'local_notemyprogress'); + } else if ($diff < 45) { + $ago = get_string('tg_timeseconds', 'local_notemyprogress', $diff); + } else if ($diff < HOURSECS * 0.7) { + $ago = get_string('tg_timeminutes', 'local_notemyprogress', round($diff / 60)); + } else if ($diff < DAYSECS * 0.7) { + $ago = get_string('tg_timehours', 'local_notemyprogress', round($diff / HOURSECS)); + } else if ($diff < DAYSECS * 7 * 0.7) { + $ago = get_string('tg_timedays', 'local_notemyprogress', round($diff / DAYSECS)); + } else if ($diff < DAYSECS * 30 * 0.7) { + $ago = get_string('tg_timeweeks', 'local_notemyprogress', round($diff / (DAYSECS * 7))); + } else if ($diff < DAYSECS * 365) { + $ago = userdate($dt->getTimestamp(), get_string('tg_timewithinayearformat', 'local_notemyprogress')); + } else { + $ago = userdate($dt->getTimestamp(), get_string('tg_timeolderyearformat', 'local_notemyprogress')); + } + + return $ago; + } +} \ No newline at end of file diff --git a/notemyprogress/classes/external/external.php b/notemyprogress/classes/external/external.php new file mode 100644 index 0000000000000000000000000000000000000000..009182f43543c082660691198c8aee37b05bfd51 --- /dev/null +++ b/notemyprogress/classes/external/external.php @@ -0,0 +1,93 @@ +<?php +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see <http://www.gnu.org/licenses/>. + +namespace local_notemyprogress\external; + +use coding_exception; +use dml_exception; +use function end; +use external_api; +use external_function_parameters; +use external_multiple_structure; +use external_single_structure; +use external_value; +use invalid_parameter_exception; +use moodle_exception; +use restricted_context_exception; +use stdClass; + +defined('MOODLE_INTERNAL') || die(); + +/** + * Class levels + * + * @package mod_millionaire\external + * @copyright 2019 Benedikt Kulmann <b@kulmann.biz> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class external extends external_api { + + /** + * Definition of parameters for {@see get_levels}. + * + * @return external_function_parameters + */ + public static function get_levels_parameters() { + return new external_function_parameters([ + 'courseid' => new external_value(PARAM_INT, 'course id'), + ]); + } + + /** + * Definition of return type for {@see get_levels}. + * + * @return external_multiple_structure + */ + public static function get_levels_returns() { + return new external_multiple_structure( + level_dto::get_read_structure() + ); + } + + /** + * Get all levels. + * + * @param int $courseid + * + * @return array + * @throws coding_exception + * @throws dml_exception + * @throws invalid_parameter_exception + * @throws moodle_exception + * @throws restricted_context_exception + */ + public static function get_levels($courseid) { + $params = ['courseid' => $courseid]; + self::validate_parameters(self::get_levels_parameters(), $params); + global $DB; + $levelsData = $DB->get_record_select( + "notemyprogress_levels_data", + 'courseid = ? AND timedeleted IS NULL', $params); + + if($levelsData){ + $levelsData->levelsdata = json_decode($levelsData->levelsdata); + $levelsData->settings = json_decode($levelsData->settings); + $levelsData->rules = json_decode($levelsData->rules); + } + + return $levelsData; + } +} \ No newline at end of file diff --git a/notemyprogress/classes/jwt/BeforeValidException.php b/notemyprogress/classes/jwt/BeforeValidException.php new file mode 100644 index 0000000000000000000000000000000000000000..e71d2bfc09e2cc0e6315cc59ebb81669bf69cabd --- /dev/null +++ b/notemyprogress/classes/jwt/BeforeValidException.php @@ -0,0 +1,7 @@ +<?php + +namespace local_notemyprogress\jwt; + +class BeforeValidException extends \UnexpectedValueException +{ +} diff --git a/notemyprogress/classes/jwt/ExpiredException.php b/notemyprogress/classes/jwt/ExpiredException.php new file mode 100644 index 0000000000000000000000000000000000000000..90347ca97d421883a37536c0463e622433f8183c --- /dev/null +++ b/notemyprogress/classes/jwt/ExpiredException.php @@ -0,0 +1,7 @@ +<?php + +namespace local_notemyprogress\jwt; + +class ExpiredException extends \UnexpectedValueException +{ +} diff --git a/notemyprogress/classes/jwt/JWK.php b/notemyprogress/classes/jwt/JWK.php new file mode 100644 index 0000000000000000000000000000000000000000..831e6b70d42d74e4608aefeca650192e691150c9 --- /dev/null +++ b/notemyprogress/classes/jwt/JWK.php @@ -0,0 +1,172 @@ +<?php + +namespace local_notemyprogress\jwt; + +use DomainException; +use InvalidArgumentException; +use UnexpectedValueException; + +/** + * JSON Web Key implementation, based on this spec: + * https://tools.ietf.org/html/draft-ietf-jose-json-web-key-41 + * + * PHP version 5 + * + * @category Authentication + * @package Authentication_JWT + * @author Bui Sy Nguyen <nguyenbs@gmail.com> + * @license http://opensource.org/licenses/BSD-3-Clause 3-clause BSD + * @link https://github.com/firebase/php-jwt + */ +class JWK +{ + /** + * Parse a set of JWK keys + * + * @param array $jwks The JSON Web Key Set as an associative array + * + * @return array An associative array that represents the set of keys + * + * @throws InvalidArgumentException Provided JWK Set is empty + * @throws UnexpectedValueException Provided JWK Set was invalid + * @throws DomainException OpenSSL failure + * + * @uses parseKey + */ + public static function parseKeySet(array $jwks) + { + $keys = array(); + + if (!isset($jwks['keys'])) { + throw new UnexpectedValueException('"keys" member must exist in the JWK Set'); + } + if (empty($jwks['keys'])) { + throw new InvalidArgumentException('JWK Set did not contain any keys'); + } + + foreach ($jwks['keys'] as $k => $v) { + $kid = isset($v['kid']) ? $v['kid'] : $k; + if ($key = self::parseKey($v)) { + $keys[$kid] = $key; + } + } + + if (0 === \count($keys)) { + throw new UnexpectedValueException('No supported algorithms found in JWK Set'); + } + + return $keys; + } + + /** + * Parse a JWK key + * + * @param array $jwk An individual JWK + * + * @return resource|array An associative array that represents the key + * + * @throws InvalidArgumentException Provided JWK is empty + * @throws UnexpectedValueException Provided JWK was invalid + * @throws DomainException OpenSSL failure + * + * @uses createPemFromModulusAndExponent + */ + public static function parseKey(array $jwk) + { + if (empty($jwk)) { + throw new InvalidArgumentException('JWK must not be empty'); + } + if (!isset($jwk['kty'])) { + throw new UnexpectedValueException('JWK must contain a "kty" parameter'); + } + + switch ($jwk['kty']) { + case 'RSA': + if (!empty($jwk['d'])) { + throw new UnexpectedValueException('RSA private keys are not supported'); + } + if (!isset($jwk['n']) || !isset($jwk['e'])) { + throw new UnexpectedValueException('RSA keys must contain values for both "n" and "e"'); + } + + $pem = self::createPemFromModulusAndExponent($jwk['n'], $jwk['e']); + $publicKey = \openssl_pkey_get_public($pem); + if (false === $publicKey) { + throw new DomainException( + 'OpenSSL error: ' . \openssl_error_string() + ); + } + return $publicKey; + default: + // Currently only RSA is supported + break; + } + } + + /** + * Create a public key represented in PEM format from RSA modulus and exponent information + * + * @param string $n The RSA modulus encoded in Base64 + * @param string $e The RSA exponent encoded in Base64 + * + * @return string The RSA public key represented in PEM format + * + * @uses encodeLength + */ + private static function createPemFromModulusAndExponent($n, $e) + { + $modulus = JWT::urlsafeB64Decode($n); + $publicExponent = JWT::urlsafeB64Decode($e); + + $components = array( + 'modulus' => \pack('Ca*a*', 2, self::encodeLength(\strlen($modulus)), $modulus), + 'publicExponent' => \pack('Ca*a*', 2, self::encodeLength(\strlen($publicExponent)), $publicExponent) + ); + + $rsaPublicKey = \pack( + 'Ca*a*a*', + 48, + self::encodeLength(\strlen($components['modulus']) + \strlen($components['publicExponent'])), + $components['modulus'], + $components['publicExponent'] + ); + + // sequence(oid(1.2.840.113549.1.1.1), null)) = rsaEncryption. + $rsaOID = \pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA + $rsaPublicKey = \chr(0) . $rsaPublicKey; + $rsaPublicKey = \chr(3) . self::encodeLength(\strlen($rsaPublicKey)) . $rsaPublicKey; + + $rsaPublicKey = \pack( + 'Ca*a*', + 48, + self::encodeLength(\strlen($rsaOID . $rsaPublicKey)), + $rsaOID . $rsaPublicKey + ); + + $rsaPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" . + \chunk_split(\base64_encode($rsaPublicKey), 64) . + '-----END PUBLIC KEY-----'; + + return $rsaPublicKey; + } + + /** + * DER-encode the length + * + * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See + * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information. + * + * @param int $length + * @return string + */ + private static function encodeLength($length) + { + if ($length <= 0x7F) { + return \chr($length); + } + + $temp = \ltrim(\pack('N', $length), \chr(0)); + + return \pack('Ca*', 0x80 | \strlen($temp), $temp); + } +} diff --git a/notemyprogress/classes/jwt/JWT.php b/notemyprogress/classes/jwt/JWT.php new file mode 100644 index 0000000000000000000000000000000000000000..41b06de07c179aad27e84560b9f3b0db4b60f5a8 --- /dev/null +++ b/notemyprogress/classes/jwt/JWT.php @@ -0,0 +1,547 @@ +<?php + +namespace local_notemyprogress\jwt; + + + +use DomainException; +use Exception; +use InvalidArgumentException; +use UnexpectedValueException; +use DateTime; + + +/** + * JSON Web Token implementation, based on this spec: + * https://tools.ietf.org/html/rfc7519 + * + * PHP version 5 + * + * @category Authentication + * @package Authentication_JWT + * @author Neuman Vong <neuman@twilio.com> + * @author Anant Narayanan <anant@php.net> + * @license http://opensource.org/licenses/BSD-3-Clause 3-clause BSD + * @link https://github.com/firebase/php-jwt + */ +class JWT +{ + const ASN1_INTEGER = 0x02; + const ASN1_SEQUENCE = 0x10; + const ASN1_BIT_STRING = 0x03; + + /** + * When checking nbf, iat or expiration times, + * we want to provide some extra leeway time to + * account for clock skew. + */ + public static $leeway = 0; + + /** + * Allow the current timestamp to be specified. + * Useful for fixing a value within unit testing. + * + * Will default to PHP time() value if null. + */ + public static $timestamp = null; + + public static $supported_algs = array( + 'ES384' => array('openssl', 'SHA384'), + 'ES256' => array('openssl', 'SHA256'), + 'HS256' => array('hash_hmac', 'SHA256'), + 'HS384' => array('hash_hmac', 'SHA384'), + 'HS512' => array('hash_hmac', 'SHA512'), + 'RS256' => array('openssl', 'SHA256'), + 'RS384' => array('openssl', 'SHA384'), + 'RS512' => array('openssl', 'SHA512'), + 'EdDSA' => array('sodium_crypto', 'EdDSA'), + ); + + /** + * Decodes a JWT string into a PHP object. + * + * @param string $jwt The JWT + * @param string|array|resource $key The key, or map of keys. + * If the algorithm used is asymmetric, this is the public key + * @param array $allowed_algs List of supported verification algorithms + * Supported algorithms are 'ES384','ES256', 'HS256', 'HS384', + * 'HS512', 'RS256', 'RS384', and 'RS512' + * + * @return object The JWT's payload as a PHP object + * + * @throws InvalidArgumentException Provided JWT was empty + * @throws UnexpectedValueException Provided JWT was invalid + * @throws SignatureInvalidException Provided JWT was invalid because the signature verification failed + * @throws BeforeValidException Provided JWT is trying to be used before it's eligible as defined by 'nbf' + * @throws BeforeValidException Provided JWT is trying to be used before it's been created as defined by 'iat' + * @throws ExpiredException Provided JWT has since expired, as defined by the 'exp' claim + * + * @uses jsonDecode + * @uses urlsafeB64Decode + */ + public static function decode($jwt, $key, array $allowed_algs = array()) + { + $timestamp = \is_null(static::$timestamp) ? \time() : static::$timestamp; + + if (empty($key)) { + throw new InvalidArgumentException('Key may not be empty'); + } + $tks = \explode('.', $jwt); + if (\count($tks) != 3) { + throw new UnexpectedValueException('Wrong number of segments'); + } + list($headb64, $bodyb64, $cryptob64) = $tks; + if (null === ($header = static::jsonDecode(static::urlsafeB64Decode($headb64)))) { + throw new UnexpectedValueException('Invalid header encoding'); + } + if (null === $payload = static::jsonDecode(static::urlsafeB64Decode($bodyb64))) { + throw new UnexpectedValueException('Invalid claims encoding'); + } + if (false === ($sig = static::urlsafeB64Decode($cryptob64))) { + throw new UnexpectedValueException('Invalid signature encoding'); + } + if (empty($header->alg)) { + throw new UnexpectedValueException('Empty algorithm'); + } + if (empty(static::$supported_algs[$header->alg])) { + throw new UnexpectedValueException('Algorithm not supported'); + } + if (!\in_array($header->alg, $allowed_algs)) { + throw new UnexpectedValueException('Algorithm not allowed'); + } + if ($header->alg === 'ES256' || $header->alg === 'ES384') { + // OpenSSL expects an ASN.1 DER sequence for ES256/ES384 signatures + $sig = self::signatureToDER($sig); + } + + if (\is_array($key) || $key instanceof \ArrayAccess) { + if (isset($header->kid)) { + if (!isset($key[$header->kid])) { + throw new UnexpectedValueException('"kid" invalid, unable to lookup correct key'); + } + $key = $key[$header->kid]; + } else { + throw new UnexpectedValueException('"kid" empty, unable to lookup correct key'); + } + } + + // Check the signature + if (!static::verify("$headb64.$bodyb64", $sig, $key, $header->alg)) { + throw new SignatureInvalidException('Signature verification failed'); + } + + // Check the nbf if it is defined. This is the time that the + // token can actually be used. If it's not yet that time, abort. + if (isset($payload->nbf) && $payload->nbf > ($timestamp + static::$leeway)) { + throw new BeforeValidException( + 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->nbf) + ); + } + + // Check that this token has been created before 'now'. This prevents + // using tokens that have been created for later use (and haven't + // correctly used the nbf claim). + if (isset($payload->iat) && $payload->iat > ($timestamp + static::$leeway)) { + throw new BeforeValidException( + 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->iat) + ); + } + + // Check if this token has expired. + if (isset($payload->exp) && ($timestamp - static::$leeway) >= $payload->exp) { + throw new ExpiredException('Expired token'); + } + + return $payload; + } + + /** + * Converts and signs a PHP object or array into a JWT string. + * + * @param object|array $payload PHP object or array + * @param string|resource $key The secret key. + * If the algorithm used is asymmetric, this is the private key + * @param string $alg The signing algorithm. + * Supported algorithms are 'ES384','ES256', 'HS256', 'HS384', + * 'HS512', 'RS256', 'RS384', and 'RS512' + * @param mixed $keyId + * @param array $head An array with header elements to attach + * + * @return string A signed JWT + * + * @uses jsonEncode + * @uses urlsafeB64Encode + */ + public static function encode($payload, $key, $alg = 'HS256', $keyId = null, $head = null) + { + $header = array('typ' => 'JWT', 'alg' => $alg); + if ($keyId !== null) { + $header['kid'] = $keyId; + } + if (isset($head) && \is_array($head)) { + $header = \array_merge($head, $header); + } + $segments = array(); + $segments[] = static::urlsafeB64Encode(static::jsonEncode($header)); + $segments[] = static::urlsafeB64Encode(static::jsonEncode($payload)); + $signing_input = \implode('.', $segments); + + $signature = static::sign($signing_input, $key, $alg); + $segments[] = static::urlsafeB64Encode($signature); + + return \implode('.', $segments); + } + + /** + * Sign a string with a given key and algorithm. + * + * @param string $msg The message to sign + * @param string|resource $key The secret key + * @param string $alg The signing algorithm. + * Supported algorithms are 'ES384','ES256', 'HS256', 'HS384', + * 'HS512', 'RS256', 'RS384', and 'RS512' + * + * @return string An encrypted message + * + * @throws DomainException Unsupported algorithm or bad key was specified + */ + public static function sign($msg, $key, $alg = 'HS256') + { + if (empty(static::$supported_algs[$alg])) { + throw new DomainException('Algorithm not supported'); + } + list($function, $algorithm) = static::$supported_algs[$alg]; + switch ($function) { + case 'hash_hmac': + return \hash_hmac($algorithm, $msg, $key, true); + case 'openssl': + $signature = ''; + $success = \openssl_sign($msg, $signature, $key, $algorithm); + if (!$success) { + throw new DomainException("OpenSSL unable to sign data"); + } + if ($alg === 'ES256') { + $signature = self::signatureFromDER($signature, 256); + } elseif ($alg === 'ES384') { + $signature = self::signatureFromDER($signature, 384); + } + return $signature; + case 'sodium_crypto': + if (!function_exists('sodium_crypto_sign_detached')) { + throw new DomainException('libsodium is not available'); + } + try { + // The last non-empty line is used as the key. + $lines = array_filter(explode("\n", $key)); + $key = base64_decode(end($lines)); + return sodium_crypto_sign_detached($msg, $key); + } catch (Exception $e) { + throw new DomainException($e->getMessage(), 0, $e); + } + } + } + + /** + * Verify a signature with the message, key and method. Not all methods + * are symmetric, so we must have a separate verify and sign method. + * + * @param string $msg The original message (header and body) + * @param string $signature The original signature + * @param string|resource $key For HS*, a string key works. for RS*, must be a resource of an openssl public key + * @param string $alg The algorithm + * + * @return bool + * + * @throws DomainException Invalid Algorithm, bad key, or OpenSSL failure + */ + private static function verify($msg, $signature, $key, $alg) + { + if (empty(static::$supported_algs[$alg])) { + throw new DomainException('Algorithm not supported'); + } + + list($function, $algorithm) = static::$supported_algs[$alg]; + switch ($function) { + case 'openssl': + $success = \openssl_verify($msg, $signature, $key, $algorithm); + if ($success === 1) { + return true; + } elseif ($success === 0) { + return false; + } + // returns 1 on success, 0 on failure, -1 on error. + throw new DomainException( + 'OpenSSL error: ' . \openssl_error_string() + ); + case 'sodium_crypto': + if (!function_exists('sodium_crypto_sign_verify_detached')) { + throw new DomainException('libsodium is not available'); + } + try { + // The last non-empty line is used as the key. + $lines = array_filter(explode("\n", $key)); + $key = base64_decode(end($lines)); + return sodium_crypto_sign_verify_detached($signature, $msg, $key); + } catch (Exception $e) { + throw new DomainException($e->getMessage(), 0, $e); + } + case 'hash_hmac': + default: + $hash = \hash_hmac($algorithm, $msg, $key, true); + if (\function_exists('hash_equals')) { + return \hash_equals($signature, $hash); + } + $len = \min(static::safeStrlen($signature), static::safeStrlen($hash)); + + $status = 0; + for ($i = 0; $i < $len; $i++) { + $status |= (\ord($signature[$i]) ^ \ord($hash[$i])); + } + $status |= (static::safeStrlen($signature) ^ static::safeStrlen($hash)); + + return ($status === 0); + } + } + + /** + * Decode a JSON string into a PHP object. + * + * @param string $input JSON string + * + * @return object Object representation of JSON string + * + * @throws DomainException Provided string was invalid JSON + */ + public static function jsonDecode($input) + { + if (\version_compare(PHP_VERSION, '5.4.0', '>=') && !(\defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) { + /** In PHP >=5.4.0, json_decode() accepts an options parameter, that allows you + * to specify that large ints (like Steam Transaction IDs) should be treated as + * strings, rather than the PHP default behaviour of converting them to floats. + */ + $obj = \json_decode($input, false, 512, JSON_BIGINT_AS_STRING); + } else { + /** Not all servers will support that, however, so for older versions we must + * manually detect large ints in the JSON string and quote them (thus converting + *them to strings) before decoding, hence the preg_replace() call. + */ + $max_int_length = \strlen((string) PHP_INT_MAX) - 1; + $json_without_bigints = \preg_replace('/:\s*(-?\d{'.$max_int_length.',})/', ': "$1"', $input); + $obj = \json_decode($json_without_bigints); + } + + if ($errno = \json_last_error()) { + static::handleJsonError($errno); + } elseif ($obj === null && $input !== 'null') { + throw new DomainException('Null result with non-null input'); + } + return $obj; + } + + /** + * Encode a PHP object into a JSON string. + * + * @param object|array $input A PHP object or array + * + * @return string JSON representation of the PHP object or array + * + * @throws DomainException Provided object could not be encoded to valid JSON + */ + public static function jsonEncode($input) + { + $json = \json_encode($input); + if ($errno = \json_last_error()) { + static::handleJsonError($errno); + } elseif ($json === 'null' && $input !== null) { + throw new DomainException('Null result with non-null input'); + } + return $json; + } + + /** + * Decode a string with URL-safe Base64. + * + * @param string $input A Base64 encoded string + * + * @return string A decoded string + */ + public static function urlsafeB64Decode($input) + { + $remainder = \strlen($input) % 4; + if ($remainder) { + $padlen = 4 - $remainder; + $input .= \str_repeat('=', $padlen); + } + return \base64_decode(\strtr($input, '-_', '+/')); + } + + /** + * Encode a string with URL-safe Base64. + * + * @param string $input The string you want encoded + * + * @return string The base64 encode of what you passed in + */ + public static function urlsafeB64Encode($input) + { + return \str_replace('=', '', \strtr(\base64_encode($input), '+/', '-_')); + } + + /** + * Helper method to create a JSON error. + * + * @param int $errno An error number from json_last_error() + * + * @return void + */ + private static function handleJsonError($errno) + { + $messages = array( + JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', + JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON', + JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', + JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', + JSON_ERROR_UTF8 => 'Malformed UTF-8 characters' //PHP >= 5.3.3 + ); + throw new DomainException( + isset($messages[$errno]) + ? $messages[$errno] + : 'Unknown JSON error: ' . $errno + ); + } + + /** + * Get the number of bytes in cryptographic strings. + * + * @param string $str + * + * @return int + */ + private static function safeStrlen($str) + { + if (\function_exists('mb_strlen')) { + return \mb_strlen($str, '8bit'); + } + return \strlen($str); + } + + /** + * Convert an ECDSA signature to an ASN.1 DER sequence + * + * @param string $sig The ECDSA signature to convert + * @return string The encoded DER object + */ + private static function signatureToDER($sig) + { + // Separate the signature into r-value and s-value + list($r, $s) = \str_split($sig, (int) (\strlen($sig) / 2)); + + // Trim leading zeros + $r = \ltrim($r, "\x00"); + $s = \ltrim($s, "\x00"); + + // Convert r-value and s-value from unsigned big-endian integers to + // signed two's complement + if (\ord($r[0]) > 0x7f) { + $r = "\x00" . $r; + } + if (\ord($s[0]) > 0x7f) { + $s = "\x00" . $s; + } + + return self::encodeDER( + self::ASN1_SEQUENCE, + self::encodeDER(self::ASN1_INTEGER, $r) . + self::encodeDER(self::ASN1_INTEGER, $s) + ); + } + + /** + * Encodes a value into a DER object. + * + * @param int $type DER tag + * @param string $value the value to encode + * @return string the encoded object + */ + private static function encodeDER($type, $value) + { + $tag_header = 0; + if ($type === self::ASN1_SEQUENCE) { + $tag_header |= 0x20; + } + + // Type + $der = \chr($tag_header | $type); + + // Length + $der .= \chr(\strlen($value)); + + return $der . $value; + } + + /** + * Encodes signature from a DER object. + * + * @param string $der binary signature in DER format + * @param int $keySize the number of bits in the key + * @return string the signature + */ + private static function signatureFromDER($der, $keySize) + { + // OpenSSL returns the ECDSA signatures as a binary ASN.1 DER SEQUENCE + list($offset, $_) = self::readDER($der); + list($offset, $r) = self::readDER($der, $offset); + list($offset, $s) = self::readDER($der, $offset); + + // Convert r-value and s-value from signed two's compliment to unsigned + // big-endian integers + $r = \ltrim($r, "\x00"); + $s = \ltrim($s, "\x00"); + + // Pad out r and s so that they are $keySize bits long + $r = \str_pad($r, $keySize / 8, "\x00", STR_PAD_LEFT); + $s = \str_pad($s, $keySize / 8, "\x00", STR_PAD_LEFT); + + return $r . $s; + } + + /** + * Reads binary DER-encoded data and decodes into a single object + * + * @param string $der the binary data in DER format + * @param int $offset the offset of the data stream containing the object + * to decode + * @return array [$offset, $data] the new offset and the decoded object + */ + private static function readDER($der, $offset = 0) + { + $pos = $offset; + $size = \strlen($der); + $constructed = (\ord($der[$pos]) >> 5) & 0x01; + $type = \ord($der[$pos++]) & 0x1f; + + // Length + $len = \ord($der[$pos++]); + if ($len & 0x80) { + $n = $len & 0x1f; + $len = 0; + while ($n-- && $pos < $size) { + $len = ($len << 8) | \ord($der[$pos++]); + } + } + + // Value + if ($type == self::ASN1_BIT_STRING) { + $pos++; // Skip the first contents octet (padding indicator) + $data = \substr($der, $pos, $len - 1); + $pos += $len - 1; + } elseif (!$constructed) { + $data = \substr($der, $pos, $len); + $pos += $len; + } else { + $data = null; + } + + return array($pos, $data); + } +} diff --git a/notemyprogress/classes/jwt/SignatureInvalidException.php b/notemyprogress/classes/jwt/SignatureInvalidException.php new file mode 100644 index 0000000000000000000000000000000000000000..bbf4bdb9b12eab65cfc55a27e18c45fb626a6ff9 --- /dev/null +++ b/notemyprogress/classes/jwt/SignatureInvalidException.php @@ -0,0 +1,7 @@ +<?php + +namespace local_notemyprogress\jwt; + +class SignatureInvalidException extends \UnexpectedValueException +{ +} diff --git a/notemyprogress/classes/lib_trait.php b/notemyprogress/classes/lib_trait.php index 7ee3262c10e479da086e20d9a6c54b21637da34e..11ca18efcefc25d27f407117958ab3179950300a 100644 --- a/notemyprogress/classes/lib_trait.php +++ b/notemyprogress/classes/lib_trait.php @@ -68,14 +68,14 @@ trait lib_trait } /** - * Obtiene el registro de un usuario en base al parámetro $user. + * Obtain the registration of a user based on the $ User parameter. * - * Si el parámetro $user no es string ni entero, se retorma el mismo valor del - * parámetro recibido + * If the $ User parameter is not string or whole, the same value of the + * Parameter received * - * @param string $user id del curso que se desea buscar en formato string, entero u objeto + * @Param String $ User Id of the course you want to search in String format, whole or object * - * @return mixed un objeto fieldset que contiene el primer registro que hace match a la consulta + * @RETURN MIXED An Fieldset object containing the first record that matches the consultation */ public function get_user($user) { @@ -257,17 +257,14 @@ trait lib_trait { global $DB; $sql = "select sequence from {course_sections} where id = ?"; - $sequence = $DB->get_record_sql($sql, array($sectionid)); - //debug_text::print("sequence", $sequence); + $sequence = $DB->get_record_sql($sql, array($sectionid)); $course_modules = self::get_course_module_section($sequence->sequence); - //debug_text::print("course_modules", $course_modules); + return $course_modules; } public function get_course_module_section($sequence) { - // //file_put_contents('D:\Alexis\Stage_IRIT\NMP\debug\log.txt', print_r("sequence = \r\n", TRUE), FILE_APPEND); - // //file_put_contents('D:\Alexis\Stage_IRIT\NMP\debug\log.txt', print_r($sequence, TRUE), FILE_APPEND); $sequence = explode(',', $sequence); $course_modules = array(); foreach ($sequence as $key => $course_module_id) { @@ -278,13 +275,13 @@ trait lib_trait } /** - * Retorna un string que representa la fecha ($timestamp) Unix formateada usando el parámetro $format - * y tomando como referencia la zona horaria obtenida con la función 'get_timezone' + * Returns a string that represents the date ($ Timestamp) formatted using the $ format parameter + * And taking as reference the time zone obtained with the 'Get_timezone' function * - * @param $format string objeto que representa una sección de un curso - * @param $timestamp int entero que representa una marca temporal de Unix + * @param $ format string object represents a section of a course + * @param $ Timestamp INTRO that represents a temporary brand of UNIX * - * @return string cadena de texto con la fecha formateada + * @return string text chain with the formatted date */ public function to_format($format, $timestamp) { @@ -298,9 +295,9 @@ trait lib_trait } /** - * Retorna un entero que representa la cantidad de segundos desde la Época Unix (January 1 1970 00:00:00 GMT) - * hasta la fecha actual. La fecha actual se calcula en base a la zona horaria obtenida con la función - * 'get_timezone'. + * A integer returns that represents the amount of seconds since the UNIX era (January 1 1970 00:00:00 GMT) + * Until now.The current date is calculated based on the time zone obtained with the function + * 'Get_timezone'. * * @return int entero que representa la cantidad de segundos desde la Época Unix hasta la fecha actual */ @@ -540,12 +537,12 @@ trait lib_trait protected function convert_time_as_string($hours, $minutes, $seconds = null) { $text = [ - 'minute' => get_string("fml_minute", "local_notemyprogress"), - 'minutes' => get_string("fml_minutes", "local_notemyprogress"), - 'hour' => get_string("fml_hour", "local_notemyprogress"), - 'hours' => get_string("fml_hours", "local_notemyprogress"), - 'second' => get_string("fml_second", "local_notemyprogress"), - 'seconds' => get_string("fml_seconds", "local_notemyprogress") + 'minute' => get_string("nmp_minute", "local_notemyprogress"), + 'minutes' => get_string("nmp_minutes", "local_notemyprogress"), + 'hour' => get_string("nmp_hour", "local_notemyprogress"), + 'hours' => get_string("nmp_hours", "local_notemyprogress"), + 'second' => get_string("nmp_second", "local_notemyprogress"), + 'seconds' => get_string("nmp_seconds", "local_notemyprogress") ]; $hour = new stdClass(); $hour->text = $hours == 1 ? $text['hour'] : $text['hours']; @@ -602,9 +599,9 @@ trait lib_trait date_default_timezone_set($tz); $day_number = date('d', $date); $day_code = strtolower(date('D', $date)); - $day_name = get_string("fml_{$day_code}_short", 'local_notemyprogress'); + $day_name = get_string("nmp_{$day_code}_short", 'local_notemyprogress'); $month_code = strtolower(date('M', $date)); - $month_name = get_string("fml_{$month_code}_short", 'local_notemyprogress'); + $month_name = get_string("nmp_{$month_code}_short", 'local_notemyprogress'); $year = date('Y', $date); $hour = date('g', $date); $min = date('i', $date); diff --git a/notemyprogress/classes/metareflexion.php b/notemyprogress/classes/metareflexion.php index f66991f3037309dd1969c2fee89d01e6368b0463..e7ee98d542433927fbc385c09e93ac330ea65603 100644 --- a/notemyprogress/classes/metareflexion.php +++ b/notemyprogress/classes/metareflexion.php @@ -37,7 +37,6 @@ class metareflexion $configweeks = new \local_notemyprogress\configweeks($this->course->id, $this->user->id); $this->weeks = $configweeks->get_weeks_with_sections(); - //debug_text::print("this->weeks",$this->weeks); $this->current_week = $configweeks->get_current_week(); $this->past_week = $configweeks->get_past_week(); @@ -48,7 +47,12 @@ class metareflexion $this->metareflexionid = $idmetareflexion; } - + /** + * Get the days committed for a specific module + * + * @param string $id_module id of the module + * @return object object with days committed + */ public function get_days_committed($id_module) { global $DB; @@ -56,19 +60,12 @@ class metareflexion $days = $DB->get_records_sql($sql, array($id_module)); return $days; } - - - // public function get_previous_weeks(){ - // global $DB; - // $weeks = $this->weeks; - // foreach ($weeks as $key => $week) { - // $sql = "select * from {mdl_notemyprogress_questions} where weekcode = ? and userid = ? order by id desc limit 1"; - // $questions = $DB->get_records_sql($sql, array($week->weekcode, $this->user->id)); - // foreach ($weeks as $key => $week) { - // } - // } - // } - + + /** + * Get the week before the current week with its questions and answers assigned to their text + * + * @return object the last week + */ public function find_last_week() { $set_last_week = self::set_last_week(); @@ -79,7 +76,12 @@ class metareflexion $set_last_week->questions = $fq; return $set_last_week; } - + + /** + * Get the last week with the answers + * + * @return object the last week with the answers + */ public function set_last_week() { global $DB; @@ -105,6 +107,11 @@ class metareflexion return $last_week; } + /** + * Get the the answers of + * + * @return object the last week with the answers + */ private function find_questions($last_week) { global $DB; @@ -129,7 +136,6 @@ class metareflexion $question->answers = $answers; } $questions = self::update_texts_from_strings($questions); - //debug_text::print("questions",$questions); return $questions; } @@ -159,29 +165,25 @@ class metareflexion $array_current_week = array(); $current_wk_schedule = self::get_schedules($this->current_week->weekcode); - //debug_text::print("current_wk_schedule",$current_wk_schedule); - //debug_text::print("this->current_week", $this->current_week); foreach ($this->current_week->sections as $key => $section) { - //debug_text::print("sectionid", $section->sectionid); $course_modules = self::get_sequence_section($section->sectionid); - //debug_text::print("course_modules", $course_modules); - foreach ($course_modules as $key => $cm) { - //debug_text::print("cm", $cm); - //if ($cm->modname == "resource") { - //debug_text::print("resource"); - $cm->modname = self::get_resource_type($cm->id); - // if ($current_wk_schedule) { - // //debug_text::print("current_wk_schedule exists"); - // $days_committed_for_module = $this->get_days_committed($cm->id); - // foreach ($days_committed_for_module as $key => $day) { - // array_push($days_committed[$day->description], $cm->id); - // } - // } + if ($course_modules["0"] === false){ + } + else{ + foreach ($course_modules as $key => $cm) { + //if ($cm->modname == "resource") { + $cm->modname = self::get_resource_type($cm->id); + // if ($current_wk_schedule) { + // $days_committed_for_module = $this->get_days_committed($cm->id); + // foreach ($days_committed_for_module as $key => $day) { + // array_push($days_committed[$day->description], $cm->id); + // } + // } + } } } - //debug_text::print("days_committed", $days_committed); $current_week = new stdClass(); $current_week->weekly_schedules_id = null; @@ -211,7 +213,7 @@ class metareflexion $weekly_schedules_days->dias_trabajados = $dias_trabajados; $current_week->weekly_schedules_days = $weekly_schedules_days; - $current_week->weekly_schedules_hours = 1; + $current_week->weekly_schedules_hours = 0; $current_week->weekly_cm = $course_modules; $goals_cat = $this->get_goals_cat(); @@ -244,7 +246,6 @@ class metareflexion if (!isset($this->weekcode) || !isset($this->days) || !isset($this->goals_committed) || !isset($this->hours)) { return false; } - //debug_text::print("this->goals_committed in metareflexion", $this->goals_committed); global $DB; //Add the weekly schedule to the st_rpt_weekly_schedules table @@ -264,11 +265,9 @@ class metareflexion $goal->id_goals_categories = $id_goal_cat; $goal->id_weekly_schedules = (self::get_schedules($this->weekcode))->id; //$goal->completed = 0; - //debug_text::print("goal",$goal); $DB->insert_record("notemyprogress_goals", $goal, true); } - //debug_text::print("finished"); //Create days in notemyprogress_days table $day_descriptions = array("monday", "tuesday", "wednesday", "thursday", "friday", 'saturday', 'sunday'); $d_array = json_decode($this->days, true); @@ -303,7 +302,6 @@ class metareflexion $metareflexion->id = $this->metareflexionid; $metareflexion->hours = $this->hours; $metareflexion->timemodified = self::now_timestamp(); - //debug_text::print("metareflexion",$metareflexion); $sql = "update {st_rpt_weekly_schedules} set hours = ?, timemodified = ? where id = ?"; $result = $DB->execute($sql, array($this->hours, self::now_timestamp(), $this->metareflexionid)); @@ -331,13 +329,10 @@ class metareflexion // $result = $DB->execute($sql, array($id_goal)); // } - //debug_text::print("metareflexion->id",$metareflexion->id); //Delete previous notemyprogress_goals entries $sql = "delete from {notemyprogress_goals} where id_weekly_schedules = ? "; $result = $DB->execute($sql,array($metareflexion->id)); - //debug_text::print("after delete"); //Add entries - //debug_text::print("this->goals_committed",$this->goals_committed); foreach ($this->goals_committed as $key => $id_goal) { $goal = new stdClass(); //$goal->userid = $this->user->id; @@ -346,27 +341,20 @@ class metareflexion //$goal->completed = 0; $DB->insert_record("notemyprogress_goals", $goal, true); } - //debug_text::print("hello123423"); //Delete previous notemyprogress_days_modules entries $sql = "delete from {notemyprogress_days_modules} where id_days in (Select id from {notemyprogress_days} where id_weekly_schedules = ?) "; $result = $DB->execute($sql,array($metareflexion->id)); - //debug_text::print("after delete2"); //Add entries $d_array = json_decode($this->days, true); foreach ($d_array as $key => $day) { - //debug_text::print("this->metareflexionid",$this->metareflexionid); - //debug_text::print("key",$key); $sql = "select id from {notemyprogress_days} where id_weekly_schedules = ? and description = ? "; $id_day = $DB->get_record_sql($sql, array($this->metareflexionid, $key)); - //debug_text::print("id_day",$id_day); //Create an entry in notemyprogress_days_modules table for each day and module associated foreach ($day as $key => $id_module) { - //debug_text::print("module"); $days_modules = new stdClass(); $days_modules->id_course_modules = $id_module; $days_modules->id_days = $id_day->id; - //debug_text::print("days_modules",$days_modules); $DB->insert_record("notemyprogress_days_modules", $days_modules, true); } } @@ -375,7 +363,6 @@ class metareflexion public function save_lastweek() { - //debug_text::print("enter save_lastweek "); global $DB; $lastweek = new stdClass(); $lastweek->userid = $this->user->id; @@ -386,7 +373,6 @@ class metareflexion $lastweek->previous_class_learning = $this->previous_class_learning; $lastweek->benefit_going_class = $this->benefit_going_class; $lastweek->feeling = $this->feeling; - //debug_text::print("lastweek",$lastweek); $id = $DB->insert_record("st_rpt_work_last_weeks", $lastweek, true); $lastweek->id = $id; return $lastweek; @@ -406,7 +392,6 @@ class metareflexion $lastweek->previous_class_learning = $this->previous_class_learning; $lastweek->benefit_going_class = $this->benefit_going_class; $lastweek->feeling = $this->feeling; - //debug_text::print("lastweek",$lastweek); $sql = "update {st_rpt_work_last_weeks} set classroom_hours = ?, hours_off_course = ?,objectives_reached = ?, previous_class_learning = ?, benefit_going_class = ? ,feeling = ? where id = ?"; $result = $DB->execute($sql, array($lastweek->classroom_hours, $lastweek->hours_off_course,$lastweek->objectives_reached ,$lastweek->previous_class_learning, $lastweek->benefit_going_class,$lastweek->feeling, $lastweek->id)); return $lastweek; diff --git a/notemyprogress/classes/observer/observer.php b/notemyprogress/classes/observer/observer.php new file mode 100644 index 0000000000000000000000000000000000000000..e4caea72c4787a8df619230e20419b4620508335 --- /dev/null +++ b/notemyprogress/classes/observer/observer.php @@ -0,0 +1,122 @@ +<?php +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see <http://www.gnu.org/licenses/>. + +/** + * notemyprogress Observer + * + * @package local_notemyprogress + * @autor Edisson Sigua, Bryan Aguilar + * @copyright 2020 Edisson Sigua <edissonf.sigua@gmail.com>, Bryan Aguilar <bryan.aguilar6174@gmail.com> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace local_notemyprogress\observer; +defined('MOODLE_INTERNAL') || die(); + +/** + * notemyprogress observer class. + * + * @package local_notemyprogress + * @autor Edisson Sigua, Bryan Aguilar + * @copyright 2020 Edisson Sigua <edissonf.sigua@gmail.com>, Bryan Aguilar <bryan.aguilar6174@gmail.com> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class observer +{ + + /** + * When a course is deleted. + * + * @param \core\event\course_deleted $event The event. + * @return void + */ + public static function course_deleted(\core\event\course_deleted $event) + { + global $DB; + + $courseid = $event->objectid; + + // Clean up the data that could be left behind. + $conditions = array('courseid' => $courseid); +// $DB->delete_records('block_xp', $conditions); +// $DB->delete_records('block_xp_config', $conditions); +// $DB->delete_records('block_xp_filters', $conditions); +// $DB->delete_records('block_xp_log', $conditions); + + // Flags. Note that this is based on the actually implementation. +// $sql = $DB->sql_like('name', ':name'); +// $DB->delete_records_select('user_preferences', $sql, [ +// 'name' => 'block_xp-notice-block_intro_' . $courseid +// ]); +// $DB->delete_records_select('user_preferences', $sql, [ +// 'name' => 'block_xp_notify_level_up_' . $courseid +// ]); + + // Delete the files. +// $fs = get_file_storage(); +// $fs->delete_area_files($event->contextid, 'block_xp', 'badges'); + } + + /** + * Observe all events. + * + * @param \core\event\base $event The event. + * @return void + */ + public static function catch_all(\core\event\base $event) { + + global $COURSE, $USER; + $userid = $event->userid; + + if ($event->component === 'local_notemyprogress') { + // omit your own events. + return; + } else if (!$userid || isguestuser($userid) || is_siteadmin($userid)) { + // Omitting users and invited that in Hayan started Sesión. + return; + } + else if ($event->anonymous) { + // Omit all events marked as anonymous. + return; + } + else if (!in_array($event->contextlevel, array(CONTEXT_COURSE, CONTEXT_MODULE))) { + // Omit events that are not in the right context. + return; + } else if ($event->edulevel !== \core\event\base::LEVEL_PARTICIPATING) { + // Ignore events that are not participating. + return; + } else if (!$event->get_context()) { + // If for some reason the context does not exist ... + return; + } + + try { + // It has been reported that this can generate an exception when the context is missing ... + $canearn = has_capability('local/notemyprogress:earnxp', $event->get_context(), $userid); + } catch (moodle_exception $e) { + return; + } + + // Omit events if the user does not have the ability to earn points. + if (!$canearn) { + return; + } + + $cs = new \local_notemyprogress\event_strategy($COURSE, $USER); + $cs->collect_event($event); + } + +} \ No newline at end of file diff --git a/notemyprogress/classes/report.php b/notemyprogress/classes/report.php index 080ed7cc552b440247f16c464ea1df1179bc5be5..9cdf8cc9c7e3e94773a35898887a7c24bf311797 100644 --- a/notemyprogress/classes/report.php +++ b/notemyprogress/classes/report.php @@ -69,11 +69,23 @@ abstract class report $this->past_week = $configweeks->get_past_week(); } + /** + * Stores the student id(s) in the $users variable of the class. + */ abstract public function set_users(); - + + /** + * Stores the display profile of the class in the class variable $profile + */ abstract public function set_profile(); - + + /** + * Get the information about the reflexion questions of a specific week + * + * @param string $weekcode code of the week assigned to the questions + * @return object the informations about the questions + */ public function questions_report_metereflexion($weekcode = null) { if (!self::course_in_transit()) { @@ -83,7 +95,6 @@ abstract class report return null; } $week = $this->current_week; - //debug_text::print("this->past_week",$this->past_week); if (!empty($weekcode)) { $week = self::find_week($weekcode); } @@ -98,7 +109,6 @@ abstract class report $last_week->benefit_going_class = null; $last_week->feeling = null; - //debug_text::print("week",$week); $query_last_week = self::get_last($week->weekcode); if ($query_last_week != null){ $last_week = $query_last_week; @@ -108,11 +118,15 @@ abstract class report $questions = self::find_questions($last_week); $last_week->questions = $questions; - //debug_text::print("last_week",$last_week); return $last_week; } - + /** + * Get the questions and answers selected of a specific week with their text assigned + * + * @param object $last_week the object containing the structure of the informations about the questions + * @return object object containing the questions and answers + */ private function find_questions($last_week) { global $DB; @@ -137,10 +151,15 @@ abstract class report $question->answers = $answers; } $questions = self::update_texts_from_strings($questions); - //debug_text::print("questions",$questions); return $questions; - } + } + /** + * Assign text corresponding to the questions and answers specified + * + * @param array $questions array containing questions and answers + * @return array an array with the text added + */ private function update_texts_from_strings($questions) { foreach ($questions as $question) { @@ -151,23 +170,38 @@ abstract class report } return $questions; } - - public function find_answers($id_questions) + /** + * Find the answers for a specific question id + * + * @param string $id_question id of the question + * @return object the answer for the question id + */ + public function find_answers($id_question) { global $DB; $sql = "select * from {st_rpt_answers} where questionid = ?"; - $answers = $DB->get_records_sql($sql, array($id_questions)); + $answers = $DB->get_records_sql($sql, array($id_question)); return $answers; } - + /** + * Find the st_rpt_work_last_weeks entry corresponding to a weekcode + * + * @param string $weekcode identifier of the week + * @return object the answer for the question id + */ public function get_last($weekcode){ global $DB; $sql = "select * from {st_rpt_work_last_weeks} where weekcode = ? and userid = ? order by id desc limit 1"; $last_week_query = $DB->get_record_sql($sql, array($weekcode, $this->user->id)); return $last_week_query; } - + + /** + * Returns a array showing wich week have a weekschedule + * + * @return array an associtive array containing boolean values to show the weeks which have schedules + */ public function get_week_schedule() { @@ -184,15 +218,24 @@ abstract class report } } } - //debug_text::print("array_ws",$array_ws); return $array_ws; } + /** + * Give the profile of the user + * + * @return string the profile of the user + */ public function render_has() { return $this->profile; } + /** + * Returns if the course is valid + * + * @return boolean course validity + */ protected function course_is_valid() { $in_transit = isset($this->current_week) || isset($this->past_week) ? true : false; @@ -201,10 +244,10 @@ abstract class report } /** - * Verifica si el curso aún no ha terminado o si el tiempo transcurrido desde que ha terminado las - * semanas configuradas de Fliplearning es menor a una semana + * Check if the course is not yet finished or if the time elapsed since the end of the configured weeks of NoteMyProgress is less than a week. + * configured weeks of Fliplearning is less than one week * - * @return boolean valor booleano que indica si el curso aun sigue activo + * @return boolean boolean value indicating if the course is still active */ protected function course_in_transit() { @@ -213,9 +256,9 @@ abstract class report } /** - * Verifica si el curso tiene estudiantes + * Verify if the course has students * - * @return boolean valor booleano que indica si el curso tiene estudiantes + * @return boolean boolean value indicating if the course has students */ protected function course_has_users() { @@ -224,12 +267,11 @@ abstract class report } /** - * Busca la semana con codigo igual al parametro $weekcode y lo retorna. En caso de no encontrar - * la semana con el codigo de paramtero, se imprime un error + * Searches for the week with code equal to the $weekcode parameter and returns it. * - * @param string $weekcode identificador de la semana que se desea obtener + * @param string $weekcode identifier of the week you want to get. * - * @return object objecto con la semana que hace match con el parametro + * @return object object with the week that matches the parameter */ protected function find_week($weekcode) { @@ -238,9 +280,19 @@ abstract class report return $week; } } - //print_error("Weekcode not found"); } + + /** + * Get informations about the course modules and the users + * + * @param array $users information about sessions + * @param array $cms information about the modules + * @param boolean $enable_completion if module completion is handled + * @param boolean $include_sessions if sessions should be included in the value returned + * + * @return array an array containing objects with informations about the modules and the users + */ protected function get_progress_table($users, $cms, $enable_completion, $include_sessions = false) { $table = array(); @@ -270,10 +322,19 @@ abstract class report array_push($table, $record); } } - ////debug_text::print("table",$table); return $table; } + + /** + * Get informations about the course modules + * + * @param array $users information about sessions + * @param array $cms information about the modules + * @param boolean $cms_completion_enabled if module completion is handled + * + * @return object an object with informations about the modules + */ private function cms_interactions($cms, $user, $cms_completion_enabled) { $complete_cms = 0; @@ -315,17 +376,21 @@ abstract class report $interaction->modules = $cms_ids; $interaction->total = count($cms); return $interaction; + } - + /** + * Returns if a module if a specific module is completed by a specific user + * + * @param string $userid id of the user + * @param string $cm_id id of the module + * + * @return boolean if the module has beend completed of not + */ private function finished_cm_by_conditions($userid, $cm_id) { global $DB; $complete = false; - $item = $DB->get_record( - 'course_modules_completion', - array('coursemoduleid' => $cm_id, 'userid' => $userid), - 'id, timemodified' - ); + $item = $DB->get_record('course_modules_completion', array('coursemoduleid' => $cm_id, 'userid' => $userid),'id, timemodified'); if ($item) { $complete = true; } @@ -399,7 +464,7 @@ abstract class report $month_number = 0; } - $month_name = get_string("fml_" . $month_code . "_short", "local_notemyprogress"); + $month_name = get_string("nmp_" . $month_code . "_short", "local_notemyprogress"); $year = date("Y", $startdate); $category_name = "$month_name $year"; array_push($categories, $category_name); @@ -428,12 +493,12 @@ abstract class report while (strtolower(date("M", $date)) == $month_code) { $day_code = strtolower(date("D", $date)); - $start_day_name = get_string("fml_$day_code", "local_notemyprogress"); + $start_day_name = get_string("nmp_$day_code", "local_notemyprogress"); $start_day_number = strtolower(date("d", $date)); $end = strtotime("+ 7 days", $date) - 1; $day_code = strtolower(date("D", $end)); - $end_day_name = get_string("fml_$day_code", "local_notemyprogress"); + $end_day_name = get_string("nmp_$day_code", "local_notemyprogress"); $end_day_number = strtolower(date("d", $end)); $label = "$start_day_name $start_day_number - $end_day_name $end_day_number"; @@ -520,16 +585,16 @@ abstract class report $response->inverted_time_converted = self::convert_time("hours", $response->inverted_time, "string"); $inverted_time = new stdClass(); - $inverted_time->name = get_string("fml_inverted_time", "local_notemyprogress"); + $inverted_time->name = get_string("nmp_inverted_time", "local_notemyprogress"); $inverted_time->y = $response->inverted_time; $expected_time = new stdClass(); - $expected_time->name = get_string("fml_expected_time", "local_notemyprogress"); + $expected_time->name = get_string("nmp_expected_time", "local_notemyprogress"); $expected_time->y = $response->expected_time; if (!$average_time) { - $inverted_time->name = get_string("fml_student_inverted_time", "local_notemyprogress"); - $expected_time->name = get_string("fml_student_expected_time", "local_notemyprogress"); + $inverted_time->name = get_string("nmp_student_inverted_time", "local_notemyprogress"); + $expected_time->name = get_string("nmp_student_expected_time", "local_notemyprogress"); } $data[] = $inverted_time; $data[] = $expected_time; @@ -558,7 +623,6 @@ abstract class report } $conditions = self::conditions_for_work_sessions($start, $end); $sessions_users = self::get_sessions_from_logs($conditions); - //debug_text::print("sessions_users",$sessions_users); return $sessions_users; } @@ -611,20 +675,20 @@ abstract class report $users[$userid] = array(); } } - ////debug_text::print("users",$users); return $users; } /** - * Obtiene una cadena de texto que representa una condicion 'where' de busqueda en lenguaje sql - * cuyos campos se concatenan en base al parámetro $filters con el prefijo $prefix + * Gets a text string representing a 'where' search condition in sql language. + * whose fields are concatenated based on the $filters parameter with the $prefix prefix * - * @param array $filters lista de condiciones para la cadena de texto que representa la condicion - * @param string $prefix prefijo con el que se une cada condicion de la variable $filters. Si se - * omite, por defecto toma el valor de and + * @param array $filters list of conditions for the text string representing the condition + * @param string $prefix prefix with which each condition of the $filters variable is bound. If omitted, it defaults to + * omitted, it defaults to and * - * @return string cadena de texto que representa una condicional 'where' el lenguaje sql + * @return string string representing a 'where' conditional in the sql language. */ + private function get_query_from_conditions($filters = array(), $prefix = "and") { $conditions = ""; @@ -871,12 +935,7 @@ abstract class report if (isset($item->itemmodule)) { $result = $DB->get_record('modules', array('name' => $item->itemmodule), 'id', MUST_EXIST); $moduleid = $result->id; - $result = $DB->get_record( - 'course_modules', - array('course' => $this->course->id, 'module' => $moduleid, 'instance' => $item->iteminstance), - 'id', - MUST_EXIST - ); + $result = $DB->get_record('course_modules', array('course' => $this->course->id, 'module' => $moduleid, 'instance' => $item->iteminstance),'id', MUST_EXIST); $coursemoduleid = (int) $result->id; } return $coursemoduleid; @@ -961,50 +1020,50 @@ abstract class report "resetZoom" => get_string("chart_resetZoom", "local_notemyprogress"), "resetZoomTitle" => get_string("chart_resetZoomTitle", "local_notemyprogress"), "months" => array( - get_string("fml_jan", "local_notemyprogress"), - get_string("fml_feb", "local_notemyprogress"), - get_string("fml_mar", "local_notemyprogress"), - get_string("fml_apr", "local_notemyprogress"), - get_string("fml_may", "local_notemyprogress"), - get_string("fml_jun", "local_notemyprogress"), - get_string("fml_jul", "local_notemyprogress"), - get_string("fml_aug", "local_notemyprogress"), - get_string("fml_sep", "local_notemyprogress"), - get_string("fml_oct", "local_notemyprogress"), - get_string("fml_nov", "local_notemyprogress"), - get_string("fml_dec", "local_notemyprogress"), + get_string("nmp_jan", "local_notemyprogress"), + get_string("nmp_feb", "local_notemyprogress"), + get_string("nmp_mar", "local_notemyprogress"), + get_string("nmp_apr", "local_notemyprogress"), + get_string("nmp_may", "local_notemyprogress"), + get_string("nmp_jun", "local_notemyprogress"), + get_string("nmp_jul", "local_notemyprogress"), + get_string("nmp_aug", "local_notemyprogress"), + get_string("nmp_sep", "local_notemyprogress"), + get_string("nmp_oct", "local_notemyprogress"), + get_string("nmp_nov", "local_notemyprogress"), + get_string("nmp_dec", "local_notemyprogress"), ), "shortMonths" => array( - get_string("fml_jan_short", "local_notemyprogress"), - get_string("fml_feb_short", "local_notemyprogress"), - get_string("fml_mar_short", "local_notemyprogress"), - get_string("fml_apr_short", "local_notemyprogress"), - get_string("fml_may_short", "local_notemyprogress"), - get_string("fml_jun_short", "local_notemyprogress"), - get_string("fml_jul_short", "local_notemyprogress"), - get_string("fml_aug_short", "local_notemyprogress"), - get_string("fml_sep_short", "local_notemyprogress"), - get_string("fml_oct_short", "local_notemyprogress"), - get_string("fml_nov_short", "local_notemyprogress"), - get_string("fml_dec_short", "local_notemyprogress"), + get_string("nmp_jan_short", "local_notemyprogress"), + get_string("nmp_feb_short", "local_notemyprogress"), + get_string("nmp_mar_short", "local_notemyprogress"), + get_string("nmp_apr_short", "local_notemyprogress"), + get_string("nmp_may_short", "local_notemyprogress"), + get_string("nmp_jun_short", "local_notemyprogress"), + get_string("nmp_jul_short", "local_notemyprogress"), + get_string("nmp_aug_short", "local_notemyprogress"), + get_string("nmp_sep_short", "local_notemyprogress"), + get_string("nmp_oct_short", "local_notemyprogress"), + get_string("nmp_nov_short", "local_notemyprogress"), + get_string("nmp_dec_short", "local_notemyprogress"), ), "weekdays" => array( - get_string("fml_sun", "local_notemyprogress"), - get_string("fml_mon", "local_notemyprogress"), - get_string("fml_tue", "local_notemyprogress"), - get_string("fml_wed", "local_notemyprogress"), - get_string("fml_thu", "local_notemyprogress"), - get_string("fml_fri", "local_notemyprogress"), - get_string("fml_sat", "local_notemyprogress"), + get_string("nmp_sun", "local_notemyprogress"), + get_string("nmp_mon", "local_notemyprogress"), + get_string("nmp_tue", "local_notemyprogress"), + get_string("nmp_wed", "local_notemyprogress"), + get_string("nmp_thu", "local_notemyprogress"), + get_string("nmp_fri", "local_notemyprogress"), + get_string("nmp_sat", "local_notemyprogress"), ), "shortWeekdays" => array( - get_string("fml_sun_short", "local_notemyprogress"), - get_string("fml_mon_short", "local_notemyprogress"), - get_string("fml_tue_short", "local_notemyprogress"), - get_string("fml_wed_short", "local_notemyprogress"), - get_string("fml_thu_short", "local_notemyprogress"), - get_string("fml_fri_short", "local_notemyprogress"), - get_string("fml_sat_short", "local_notemyprogress"), + get_string("nmp_sun_short", "local_notemyprogress"), + get_string("nmp_mon_short", "local_notemyprogress"), + get_string("nmp_tue_short", "local_notemyprogress"), + get_string("nmp_wed_short", "local_notemyprogress"), + get_string("nmp_thu_short", "local_notemyprogress"), + get_string("nmp_fri_short", "local_notemyprogress"), + get_string("nmp_sat_short", "local_notemyprogress"), ), ); return $langs; @@ -1028,28 +1087,7 @@ abstract class report $tz = self::get_timezone(); date_default_timezone_set($tz); $planifications = self::days_report_metereflexion($weekcode); - ////debug_text::print("planifications",$planifications); - $weekstart = $week->weekstart; - $current_time = time(); $status = self::get_respect_planning($planifications,$week); - - // foreach ($planifications->dias_planificados as $key => $planification) { - // $current_day = strtotime($weekstart . " + $key day"); - // if ($planification) { - // if ($planifications->dias_trabajados[$key] > 0) { - // array_push($status, 'completed'); - // } else { - // if ($current_day < $current_time) { - // array_push($status, 'failed'); - // } else { - // array_push($status, 'pending'); - // } - // } - // } else { - // array_push($status, 'unplanned'); - // } - // } - ////debug_text::print("status",$status); return $status; } @@ -1163,15 +1201,12 @@ abstract class report $work_sessions = self::get_work_sessions($week->weekstart, $week->weekend); $days_module_worked = self::get_modules_days_worked($work_sessions); - //debug_text::print("days_module_planned",$days_module_planned); - //debug_text::print("days_module_worked",$days_module_worked); //$number_planned_days_logs = self::number_schedules_day_log($work_sessions); $data_report_meta = new stdClass(); $data_report_meta->dias_planificados = $days_module_planned; $data_report_meta->dias_trabajados = $days_module_worked; - //debug_text::print("data_report_meta",$data_report_meta); return $data_report_meta; } @@ -1223,7 +1258,6 @@ abstract class report "sunday" => array(), ); $logs = $work_sessions[0]->logs; - //debug_text::print("work_sessions[0]->logs",$work_sessions[0]->logs); foreach ($logs as $log) { if (strpos($log->eventname, "course_module_viewed")) { $moduleid = $this->get_module_id($log->objectid, $log->objecttable); @@ -1252,7 +1286,6 @@ abstract class report } } } - //debug_text::print("days_committed",$days_worked); return $days_worked; } @@ -1269,21 +1302,16 @@ abstract class report ); $mods_days = self::get_modules_days_by_week($weekcode); foreach ($mods_days as $key => $mod_day) { - ////debug_text::print("mod_day",$mod_day); array_push($days_planned[$mod_day->daydesc], $mod_day->cmid); } - //debug_text::print("days_planned",$days_planned); return $days_planned; } protected function get_modules_days_by_week($weekcode) { - //debug_text::print("week_schedule->id",$week_schedule->id); - //debug_text::print("this->user->id",$this->user->id); global $DB; $sql = "select dm.id, dm.id_course_modules cmid, d.description daydesc from {notemyprogress_days_modules} dm,{notemyprogress_days} d, {st_rpt_weekly_schedules} ws where dm.id_days = d.id and d.id_weekly_schedules = ws.id and ws.weekcode = ? and ws.userid = ? "; $mods_weeks = $DB->get_records_sql($sql, array($weekcode,$this->user->id)); - //debug_text::print("mods_weeks",$mods_weeks); return $mods_weeks; } @@ -1319,15 +1347,9 @@ abstract class report $status = []; $weekstart = $week->weekstart; $current_time = time(); - //debug_text::print("days_module_planned",$days_module_planned); foreach ($days_module_planned as $key => $day_planned) { $day_num = self::get_num_day($key); $current_day = strtotime("+ $day_num day ",$weekstart); - //debug_text::print("day_num",$day_num); - //debug_text::print("key",$key); - //debug_text::print("weekstart",$weekstart); - //debug_text::print("current_time",$current_time); - //debug_text::print("current_day",$current_day); if ($day_planned) { if (!array_diff($day_planned, $days_module_worked[$key])) { array_push($status, 'completed'); @@ -1342,7 +1364,6 @@ abstract class report array_push($status, 'unplanned'); } } - //debug_text::print("status",$status); return $status; } @@ -1447,55 +1468,6 @@ abstract class report } } - // protected function number_schedules_day($week_schedules) - // { - // $count_planned_days = new stdClass(); - // $count_planned_days->lun = 0; - // $count_planned_days->mar = 0; - // $count_planned_days->mie = 0; - // $count_planned_days->jue = 0; - // $count_planned_days->vie = 0; - // $count_planned_days->sab = 0; - // $count_planned_days->dom = 0; - - // foreach ($week_schedules as $key => $week_schedule) { - // $days = explode(',', $week_schedule->days); - - // foreach ($days as $key => $day) { - // switch ($day) { - // case 'lun': - // $count_planned_days->lun++; - // break; - // case 'mar': - // $count_planned_days->mar++; - // break; - // case 'mie': - // $count_planned_days->mie++; - // break; - // case 'jue': - // $count_planned_days->jue++; - // break; - // case 'vie': - // $count_planned_days->vie++; - // break; - // case 'sab': - // $count_planned_days->sab++; - // break; - // case 'dom': - // $count_planned_days->dom++; - // break; - // } - // } - // } - - // $data_days = array(); - // foreach (array_values((array)$count_planned_days) as $key => $value) { - // array_push($data_days, $value); - // } - - // return $data_days; - // } - public function goals_report_metereflexion($weekcode = null) { if (!self::course_in_transit()) { @@ -1511,7 +1483,6 @@ abstract class report $schedule = self::get_schedule($week->weekcode); if ($schedule != null) { $query_goals = $this->get_goals_id($schedule); - //debug_text::print("query_goals",$query_goals); } else { $query_goals = []; } @@ -1521,8 +1492,6 @@ abstract class report public function get_goals_id($week_schedule) { global $DB; - //debug_text::print("week_schedule->id",$week_schedule->id); - //debug_text::print("this->user->id",$this->user->id); $sql = "select g.id_goals_categories from {notemyprogress_goals} g,{st_rpt_weekly_schedules} ws where g.id_weekly_schedules = ws.id and g.id_weekly_schedules = ? and ws.userid = ? "; $goals_res = array_values($DB->get_records_sql($sql, array($week_schedule->id,$this->user->id))); $arr_goal = []; @@ -1565,14 +1534,13 @@ abstract class report } $sum_hours_per_week = self::planned_week($weekcode); - //debug_text::print("sum_hours_per_week",$sum_hours_per_week = null); $data_report_meta_hours = new stdClass(); $data_report_meta_hours->title = 'Tiempo invertido'; - $data_report_meta_hours->horas_trabajadas = $sum_hours_work; - $data_report_meta_hours->label_horas_trabajadas = $label_horas; - $data_report_meta_hours->horas_planificadas = $sum_hours_per_week != null ? $sum_hours_per_week : 0 ; - $data_report_meta_hours->label_horas_planificadas = self::convert_time('hours', $sum_hours_per_week); + $data_report_meta_hours->hours_worked = $sum_hours_work; + $data_report_meta_hours->label_hours_worked = $label_horas; + $data_report_meta_hours->hours_planned = $sum_hours_per_week != null ? $sum_hours_per_week : 0 ; + $data_report_meta_hours->label_hours_planned = self::convert_time('hours', $sum_hours_per_week); $data_report_meta_hours->total_users = count($work_sessions); $data_report_meta_hours->interacted_users = $user_with_planning; return $data_report_meta_hours; diff --git a/notemyprogress/classes/student.php b/notemyprogress/classes/student.php index 818e05ab95d410152fc85e3da3dafe53c1e5e0aa..b842328a8cffbd6ef1bd21a43557b7edeb9ed466 100644 --- a/notemyprogress/classes/student.php +++ b/notemyprogress/classes/student.php @@ -131,7 +131,7 @@ class student extends report /** - * Almacena el perfil de visualización de la clase en la variable $profile de clase + * Stores the display profile of the class in the class variable $profile */ public function set_profile() { @@ -139,7 +139,7 @@ class student extends report } /** - * Almacena el id del estudiante en la variable $users de la clase + * Stores the student id in the $users variable of the class. */ public function set_users() { diff --git a/notemyprogress/classes/student_planning.php b/notemyprogress/classes/student_planning.php deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/notemyprogress/classes/teacher.php b/notemyprogress/classes/teacher.php index 99ed2080ae1eaf5324cbe97f86cf0433d01e921e..0b99c7e76b740cac53141f222cd2cae6f9f5462b 100644 --- a/notemyprogress/classes/teacher.php +++ b/notemyprogress/classes/teacher.php @@ -38,7 +38,7 @@ class teacher extends report } /** - * Almacena el perfil de visualización de la clase en la variable $profile de clase + * Stores the display profile of the class in the class variable $profile */ public function set_profile() { @@ -46,7 +46,7 @@ class teacher extends report } /** - * Almacena los ids de los estudiantes en la variable $users de la clase + * Stores the student ids in the $users variable of the class */ public function set_users() { @@ -134,17 +134,17 @@ class teacher extends report $course->fullname = $this->course->fullname; $course->shortname = $this->course->shortname; - $startdate = get_string("fml_not_configured", "local_notemyprogress"); + $startdate = get_string("nmp_not_configured", "local_notemyprogress"); if (!empty($this->course->startdate)) { $startdate = $this->format_date($this->course->startdate); } - $enddate = get_string("fml_not_configured", "local_notemyprogress"); + $enddate = get_string("nmp_not_configured", "local_notemyprogress"); if (!empty($this->course->enddate)) { $enddate = $this->format_date($this->course->enddate); } - $completion = get_string("fml_disabled", "local_notemyprogress"); + $completion = get_string("nmp_disabled", "local_notemyprogress"); if ($this->course->enablecompletion == "1") { - $completion = get_string("fml_activated", "local_notemyprogress"); + $completion = get_string("nmp_activated", "local_notemyprogress"); } $format = $this->course->format; $identifier = "course_format_$format"; @@ -165,9 +165,9 @@ class teacher extends report $date = (int) $date; $year = date("Y", $date); $month = strtolower(date("M", $date)); - $month = get_string("fml_$month", "local_notemyprogress"); + $month = get_string("nmp_$month", "local_notemyprogress"); $day = strtolower(date("D", $date)); - $day = get_string("fml_$day", "local_notemyprogress"); + $day = get_string("nmp_$day", "local_notemyprogress"); $day_number = date("j", $date); $hour = date("G", $date); $min = date("i", $date); @@ -344,9 +344,9 @@ class teacher extends report $data->greater60 = array(); $names = new stdClass; - $names->smaller30 = get_string("fml_smaller30", "local_notemyprogress"); - $names->greater30 = get_string("fml_greater30", "local_notemyprogress"); - $names->greater60 = get_string("fml_greater60", "local_notemyprogress"); + $names->smaller30 = get_string("nmp_smaller30", "local_notemyprogress"); + $names->greater30 = get_string("nmp_greater30", "local_notemyprogress"); + $names->greater60 = get_string("nmp_greater60", "local_notemyprogress"); for ($i = 0; $i < 7; $i++) { $month = strtolower(date("M", $start)); @@ -405,7 +405,7 @@ class teacher extends report private function get_month_name($month_code) { - $text = "fml_" . $month_code . "_short"; + $text = "nmp_" . $month_code . "_short"; $month_name = get_string($text, "local_notemyprogress"); return $month_name; } @@ -513,9 +513,9 @@ class teacher extends report $data->no_sub = array(); $names = new stdClass; - $names->intime_sub = get_string("fml_intime_sub", "local_notemyprogress"); - $names->late_sub = get_string("fml_late_sub", "local_notemyprogress"); - $names->no_sub = get_string("fml_no_sub", "local_notemyprogress"); + $names->intime_sub = get_string("nmp_intime_sub", "local_notemyprogress"); + $names->late_sub = get_string("nmp_late_sub", "local_notemyprogress"); + $names->no_sub = get_string("nmp_no_sub", "local_notemyprogress"); foreach ($assigns as $assign) { if (isset($assign_submissions[$assign->id])) { @@ -534,7 +534,7 @@ class teacher extends report $submissions = self::get_submissions_with_users($submissions); array_push($submissions_users, $submissions); - $date_label = get_string("fml_assign_nodue", 'local_notemyprogress'); + $date_label = get_string("nmp_assign_nodue", 'local_notemyprogress'); if ($assign->duedate != "0") { $date_label = self::get_date_label($assign->duedate); } @@ -675,7 +675,7 @@ class teacher extends report if (!isset($types[$module->modname])) { $type_name = $module->modname; - $identifier = "fml_{$module->modname}"; + $identifier = "nmp_{$module->modname}"; if (get_string_manager()->string_exists($identifier, "local_notemyprogress")) { $type_name = get_string($identifier, "local_notemyprogress"); } @@ -952,7 +952,7 @@ class teacher extends report $rows = array_values($rows); $clusters = array(); - $cluster_text = get_string("fml_cluster_label", "local_notemyprogress"); + $cluster_text = get_string("nmp_cluster_label", "local_notemyprogress"); foreach ($rows as $row) { if (!isset($clusters[$row->cluster])) { $cluster = new stdClass(); @@ -983,15 +983,15 @@ class teacher extends report private function get_user_last_access($userid, $users_access) { $access = new stdClass(); - $access->label = get_string("fml_dropout_user_never_access", "local_notemyprogress"); + $access->label = get_string("nmp_dropout_user_never_access", "local_notemyprogress"); $access->timestamp = 0; if (isset($users_access[$userid])) { $timestamp = (int)$users_access[$userid]->timeaccess; $str = strtolower(date("D", $timestamp)); - $day_text = get_string("fml_$str", "local_notemyprogress"); + $day_text = get_string("nmp_$str", "local_notemyprogress"); $month_day = date("d", $timestamp); $str = strtolower(date("M", $timestamp)); - $month_text = get_string("fml_$str", "local_notemyprogress"); + $month_text = get_string("nmp_$str", "local_notemyprogress"); $year = date("Y", $timestamp); $hour = date("h", $timestamp); $min = date("i", $timestamp); @@ -1008,14 +1008,14 @@ class teacher extends report { $now = (int) date("U"); $diff = $now - $timestamp; - $ago = get_string("fml_ago", "local_notemyprogress"); + $ago = get_string("nmp_ago", "local_notemyprogress"); $interval = $diff / 86400; if ($interval >= 1) { $interval = floor($interval); - $text = get_string("fml_days", "local_notemyprogress"); + $text = get_string("nmp_days", "local_notemyprogress"); if ($interval == 1) { - $text = get_string("fml_day", "local_notemyprogress"); + $text = get_string("nmp_day", "local_notemyprogress"); } return "$interval $text $ago"; } @@ -1023,9 +1023,9 @@ class teacher extends report $interval = $diff / 3600; if ($interval >= 1) { $interval = floor($interval); - $text = get_string("fml_hours", "local_notemyprogress"); + $text = get_string("nmp_hours", "local_notemyprogress"); if ($interval == 1) { - $text = get_string("fml_hour", "local_notemyprogress"); + $text = get_string("nmp_hour", "local_notemyprogress"); } return "$interval $text $ago"; } @@ -1033,22 +1033,22 @@ class teacher extends report $interval = $diff / 60; if ($interval >= 1) { $interval = floor($interval); - $text = get_string("fml_minutes", "local_notemyprogress"); + $text = get_string("nmp_minutes", "local_notemyprogress"); if ($interval == 1) { - $text = get_string("fml_minute", "local_notemyprogress"); + $text = get_string("nmp_minute", "local_notemyprogress"); } return "$interval $text $ago"; } if ($diff >= 1) { - $text = get_string("fml_seconds", "local_notemyprogress"); + $text = get_string("nmp_seconds", "local_notemyprogress"); if ($diff == 1) { - $text = get_string("fml_second", "local_notemyprogress"); + $text = get_string("nmp_second", "local_notemyprogress"); } return "$diff $text $ago"; } - $text = get_string("fml_now", "local_notemyprogress"); + $text = get_string("nmp_now", "local_notemyprogress"); return "$text"; } } diff --git a/notemyprogress/css/materialdesignicons.css b/notemyprogress/css/materialdesignicons.css index 9954f8f7029dea12ba5b5b28ca094175db4b2ab1..741d922f30eee458110add5ac3bd1c69a0fd65e2 100644 --- a/notemyprogress/css/materialdesignicons.css +++ b/notemyprogress/css/materialdesignicons.css @@ -1,3 +1,3 @@ @font-face{font-family:"Material Design Icons";src:url("../fonts/materialdesignicons-webfont.eot?v=3.9.97");src:url("../fonts/materialdesignicons-webfont.eot?#iefix&v=3.9.97") format("embedded-opentype"),url("../fonts/materialdesignicons-webfont.woff2?v=3.9.97") format("woff2"),url("../fonts/materialdesignicons-webfont.woff?v=3.9.97") format("woff"),url("../fonts/materialdesignicons-webfont.ttf?v=3.9.97") format("truetype");font-weight:normal;font-style:normal}.mdi:before,.mdi-set{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mdi-access-point::before{content:"\F002"}.mdi-access-point-network::before{content:"\F003"}.mdi-access-point-network-off::before{content:"\FBBD"}.mdi-account::before{content:"\F004"}.mdi-account-alert::before{content:"\F005"}.mdi-account-alert-outline::before{content:"\FB2C"}.mdi-account-arrow-left::before{content:"\FB2D"}.mdi-account-arrow-left-outline::before{content:"\FB2E"}.mdi-account-arrow-right::before{content:"\FB2F"}.mdi-account-arrow-right-outline::before{content:"\FB30"}.mdi-account-badge::before{content:"\FD83"}.mdi-account-badge-alert::before{content:"\FD84"}.mdi-account-badge-alert-outline::before{content:"\FD85"}.mdi-account-badge-horizontal::before{content:"\FDF0"}.mdi-account-badge-horizontal-outline::before{content:"\FDF1"}.mdi-account-badge-outline::before{content:"\FD86"}.mdi-account-box::before{content:"\F006"}.mdi-account-box-multiple::before{content:"\F933"}.mdi-account-box-outline::before{content:"\F007"}.mdi-account-card-details::before{content:"\F5D2"}.mdi-account-card-details-outline::before{content:"\FD87"}.mdi-account-check::before{content:"\F008"}.mdi-account-check-outline::before{content:"\FBBE"}.mdi-account-child::before{content:"\FA88"}.mdi-account-child-circle::before{content:"\FA89"}.mdi-account-circle::before{content:"\F009"}.mdi-account-circle-outline::before{content:"\FB31"}.mdi-account-clock::before{content:"\FB32"}.mdi-account-clock-outline::before{content:"\FB33"}.mdi-account-convert::before{content:"\F00A"}.mdi-account-details::before{content:"\F631"}.mdi-account-edit::before{content:"\F6BB"}.mdi-account-group::before{content:"\F848"}.mdi-account-group-outline::before{content:"\FB34"}.mdi-account-heart::before{content:"\F898"}.mdi-account-heart-outline::before{content:"\FBBF"}.mdi-account-key::before{content:"\F00B"}.mdi-account-key-outline::before{content:"\FBC0"}.mdi-account-minus::before{content:"\F00D"}.mdi-account-minus-outline::before{content:"\FAEB"}.mdi-account-multiple::before{content:"\F00E"}.mdi-account-multiple-check::before{content:"\F8C4"}.mdi-account-multiple-minus::before{content:"\F5D3"}.mdi-account-multiple-minus-outline::before{content:"\FBC1"}.mdi-account-multiple-outline::before{content:"\F00F"}.mdi-account-multiple-plus::before{content:"\F010"}.mdi-account-multiple-plus-outline::before{content:"\F7FF"}.mdi-account-network::before{content:"\F011"}.mdi-account-network-outline::before{content:"\FBC2"}.mdi-account-off::before{content:"\F012"}.mdi-account-off-outline::before{content:"\FBC3"}.mdi-account-outline::before{content:"\F013"}.mdi-account-plus::before{content:"\F014"}.mdi-account-plus-outline::before{content:"\F800"}.mdi-account-question::before{content:"\FB35"}.mdi-account-question-outline::before{content:"\FB36"}.mdi-account-remove::before{content:"\F015"}.mdi-account-remove-outline::before{content:"\FAEC"}.mdi-account-search::before{content:"\F016"}.mdi-account-search-outline::before{content:"\F934"}.mdi-account-settings::before{content:"\F630"}.mdi-account-star::before{content:"\F017"}.mdi-account-star-outline::before{content:"\FBC4"}.mdi-account-supervisor::before{content:"\FA8A"}.mdi-account-supervisor-circle::before{content:"\FA8B"}.mdi-account-switch::before{content:"\F019"}.mdi-account-tie::before{content:"\FCBF"}.mdi-accusoft::before{content:"\F849"}.mdi-adchoices::before{content:"\FD1E"}.mdi-adjust::before{content:"\F01A"}.mdi-adobe::before{content:"\F935"}.mdi-air-conditioner::before{content:"\F01B"}.mdi-air-filter::before{content:"\FD1F"}.mdi-air-horn::before{content:"\FD88"}.mdi-air-purifier::before{content:"\FD20"}.mdi-airbag::before{content:"\FBC5"}.mdi-airballoon::before{content:"\F01C"}.mdi-airplane::before{content:"\F01D"}.mdi-airplane-landing::before{content:"\F5D4"}.mdi-airplane-off::before{content:"\F01E"}.mdi-airplane-takeoff::before{content:"\F5D5"}.mdi-airplay::before{content:"\F01F"}.mdi-airport::before{content:"\F84A"}.mdi-alarm::before{content:"\F020"}.mdi-alarm-bell::before{content:"\F78D"}.mdi-alarm-check::before{content:"\F021"}.mdi-alarm-light::before{content:"\F78E"}.mdi-alarm-light-outline::before{content:"\FBC6"}.mdi-alarm-multiple::before{content:"\F022"}.mdi-alarm-note::before{content:"\FE8E"}.mdi-alarm-note-off::before{content:"\FE8F"}.mdi-alarm-off::before{content:"\F023"}.mdi-alarm-plus::before{content:"\F024"}.mdi-alarm-snooze::before{content:"\F68D"}.mdi-album::before{content:"\F025"}.mdi-alert::before{content:"\F026"}.mdi-alert-box::before{content:"\F027"}.mdi-alert-box-outline::before{content:"\FCC0"}.mdi-alert-circle::before{content:"\F028"}.mdi-alert-circle-outline::before{content:"\F5D6"}.mdi-alert-decagram::before{content:"\F6BC"}.mdi-alert-decagram-outline::before{content:"\FCC1"}.mdi-alert-octagon::before{content:"\F029"}.mdi-alert-octagon-outline::before{content:"\FCC2"}.mdi-alert-octagram::before{content:"\F766"}.mdi-alert-octagram-outline::before{content:"\FCC3"}.mdi-alert-outline::before{content:"\F02A"}.mdi-alien::before{content:"\F899"}.mdi-all-inclusive::before{content:"\F6BD"}.mdi-alpha::before{content:"\F02B"}.mdi-alpha-a::before{content:"\41"}.mdi-alpha-a-box::before{content:"\FAED"}.mdi-alpha-a-box-outline::before{content:"\FBC7"}.mdi-alpha-a-circle::before{content:"\FBC8"}.mdi-alpha-a-circle-outline::before{content:"\FBC9"}.mdi-alpha-b::before{content:"\42"}.mdi-alpha-b-box::before{content:"\FAEE"}.mdi-alpha-b-box-outline::before{content:"\FBCA"}.mdi-alpha-b-circle::before{content:"\FBCB"}.mdi-alpha-b-circle-outline::before{content:"\FBCC"}.mdi-alpha-c::before{content:"\43"}.mdi-alpha-c-box::before{content:"\FAEF"}.mdi-alpha-c-box-outline::before{content:"\FBCD"}.mdi-alpha-c-circle::before{content:"\FBCE"}.mdi-alpha-c-circle-outline::before{content:"\FBCF"}.mdi-alpha-d::before{content:"\44"}.mdi-alpha-d-box::before{content:"\FAF0"}.mdi-alpha-d-box-outline::before{content:"\FBD0"}.mdi-alpha-d-circle::before{content:"\FBD1"}.mdi-alpha-d-circle-outline::before{content:"\FBD2"}.mdi-alpha-e::before{content:"\45"}.mdi-alpha-e-box::before{content:"\FAF1"}.mdi-alpha-e-box-outline::before{content:"\FBD3"}.mdi-alpha-e-circle::before{content:"\FBD4"}.mdi-alpha-e-circle-outline::before{content:"\FBD5"}.mdi-alpha-f::before{content:"\46"}.mdi-alpha-f-box::before{content:"\FAF2"}.mdi-alpha-f-box-outline::before{content:"\FBD6"}.mdi-alpha-f-circle::before{content:"\FBD7"}.mdi-alpha-f-circle-outline::before{content:"\FBD8"}.mdi-alpha-g::before{content:"\47"}.mdi-alpha-g-box::before{content:"\FAF3"}.mdi-alpha-g-box-outline::before{content:"\FBD9"}.mdi-alpha-g-circle::before{content:"\FBDA"}.mdi-alpha-g-circle-outline::before{content:"\FBDB"}.mdi-alpha-h::before{content:"\48"}.mdi-alpha-h-box::before{content:"\FAF4"}.mdi-alpha-h-box-outline::before{content:"\FBDC"}.mdi-alpha-h-circle::before{content:"\FBDD"}.mdi-alpha-h-circle-outline::before{content:"\FBDE"}.mdi-alpha-i::before{content:"\49"}.mdi-alpha-i-box::before{content:"\FAF5"}.mdi-alpha-i-box-outline::before{content:"\FBDF"}.mdi-alpha-i-circle::before{content:"\FBE0"}.mdi-alpha-i-circle-outline::before{content:"\FBE1"}.mdi-alpha-j::before{content:"\4A"}.mdi-alpha-j-box::before{content:"\FAF6"}.mdi-alpha-j-box-outline::before{content:"\FBE2"}.mdi-alpha-j-circle::before{content:"\FBE3"}.mdi-alpha-j-circle-outline::before{content:"\FBE4"}.mdi-alpha-k::before{content:"\4B"}.mdi-alpha-k-box::before{content:"\FAF7"}.mdi-alpha-k-box-outline::before{content:"\FBE5"}.mdi-alpha-k-circle::before{content:"\FBE6"}.mdi-alpha-k-circle-outline::before{content:"\FBE7"}.mdi-alpha-l::before{content:"\4C"}.mdi-alpha-l-box::before{content:"\FAF8"}.mdi-alpha-l-box-outline::before{content:"\FBE8"}.mdi-alpha-l-circle::before{content:"\FBE9"}.mdi-alpha-l-circle-outline::before{content:"\FBEA"}.mdi-alpha-m::before{content:"\4D"}.mdi-alpha-m-box::before{content:"\FAF9"}.mdi-alpha-m-box-outline::before{content:"\FBEB"}.mdi-alpha-m-circle::before{content:"\FBEC"}.mdi-alpha-m-circle-outline::before{content:"\FBED"}.mdi-alpha-n::before{content:"\4E"}.mdi-alpha-n-box::before{content:"\FAFA"}.mdi-alpha-n-box-outline::before{content:"\FBEE"}.mdi-alpha-n-circle::before{content:"\FBEF"}.mdi-alpha-n-circle-outline::before{content:"\FBF0"}.mdi-alpha-o::before{content:"\4F"}.mdi-alpha-o-box::before{content:"\FAFB"}.mdi-alpha-o-box-outline::before{content:"\FBF1"}.mdi-alpha-o-circle::before{content:"\FBF2"}.mdi-alpha-o-circle-outline::before{content:"\FBF3"}.mdi-alpha-p::before{content:"\50"}.mdi-alpha-p-box::before{content:"\FAFC"}.mdi-alpha-p-box-outline::before{content:"\FBF4"}.mdi-alpha-p-circle::before{content:"\FBF5"}.mdi-alpha-p-circle-outline::before{content:"\FBF6"}.mdi-alpha-q::before{content:"\51"}.mdi-alpha-q-box::before{content:"\FAFD"}.mdi-alpha-q-box-outline::before{content:"\FBF7"}.mdi-alpha-q-circle::before{content:"\FBF8"}.mdi-alpha-q-circle-outline::before{content:"\FBF9"}.mdi-alpha-r::before{content:"\52"}.mdi-alpha-r-box::before{content:"\FAFE"}.mdi-alpha-r-box-outline::before{content:"\FBFA"}.mdi-alpha-r-circle::before{content:"\FBFB"}.mdi-alpha-r-circle-outline::before{content:"\FBFC"}.mdi-alpha-s::before{content:"\53"}.mdi-alpha-s-box::before{content:"\FAFF"}.mdi-alpha-s-box-outline::before{content:"\FBFD"}.mdi-alpha-s-circle::before{content:"\FBFE"}.mdi-alpha-s-circle-outline::before{content:"\FBFF"}.mdi-alpha-t::before{content:"\54"}.mdi-alpha-t-box::before{content:"\FB00"}.mdi-alpha-t-box-outline::before{content:"\FC00"}.mdi-alpha-t-circle::before{content:"\FC01"}.mdi-alpha-t-circle-outline::before{content:"\FC02"}.mdi-alpha-u::before{content:"\55"}.mdi-alpha-u-box::before{content:"\FB01"}.mdi-alpha-u-box-outline::before{content:"\FC03"}.mdi-alpha-u-circle::before{content:"\FC04"}.mdi-alpha-u-circle-outline::before{content:"\FC05"}.mdi-alpha-v::before{content:"\56"}.mdi-alpha-v-box::before{content:"\FB02"}.mdi-alpha-v-box-outline::before{content:"\FC06"}.mdi-alpha-v-circle::before{content:"\FC07"}.mdi-alpha-v-circle-outline::before{content:"\FC08"}.mdi-alpha-w::before{content:"\57"}.mdi-alpha-w-box::before{content:"\FB03"}.mdi-alpha-w-box-outline::before{content:"\FC09"}.mdi-alpha-w-circle::before{content:"\FC0A"}.mdi-alpha-w-circle-outline::before{content:"\FC0B"}.mdi-alpha-x::before{content:"\58"}.mdi-alpha-x-box::before{content:"\FB04"}.mdi-alpha-x-box-outline::before{content:"\FC0C"}.mdi-alpha-x-circle::before{content:"\FC0D"}.mdi-alpha-x-circle-outline::before{content:"\FC0E"}.mdi-alpha-y::before{content:"\59"}.mdi-alpha-y-box::before{content:"\FB05"}.mdi-alpha-y-box-outline::before{content:"\FC0F"}.mdi-alpha-y-circle::before{content:"\FC10"}.mdi-alpha-y-circle-outline::before{content:"\FC11"}.mdi-alpha-z::before{content:"\5A"}.mdi-alpha-z-box::before{content:"\FB06"}.mdi-alpha-z-box-outline::before{content:"\FC12"}.mdi-alpha-z-circle::before{content:"\FC13"}.mdi-alpha-z-circle-outline::before{content:"\FC14"}.mdi-alphabetical::before{content:"\F02C"}.mdi-altimeter::before{content:"\F5D7"}.mdi-amazon::before{content:"\F02D"}.mdi-amazon-alexa::before{content:"\F8C5"}.mdi-amazon-drive::before{content:"\F02E"}.mdi-ambulance::before{content:"\F02F"}.mdi-ammunition::before{content:"\FCC4"}.mdi-ampersand::before{content:"\FA8C"}.mdi-amplifier::before{content:"\F030"}.mdi-anchor::before{content:"\F031"}.mdi-android::before{content:"\F032"}.mdi-android-auto::before{content:"\FA8D"}.mdi-android-debug-bridge::before{content:"\F033"}.mdi-android-head::before{content:"\F78F"}.mdi-android-messages::before{content:"\FD21"}.mdi-android-studio::before{content:"\F034"}.mdi-angle-acute::before{content:"\F936"}.mdi-angle-obtuse::before{content:"\F937"}.mdi-angle-right::before{content:"\F938"}.mdi-angular::before{content:"\F6B1"}.mdi-angularjs::before{content:"\F6BE"}.mdi-animation::before{content:"\F5D8"}.mdi-animation-outline::before{content:"\FA8E"}.mdi-animation-play::before{content:"\F939"}.mdi-animation-play-outline::before{content:"\FA8F"}.mdi-anvil::before{content:"\F89A"}.mdi-apple::before{content:"\F035"}.mdi-apple-finder::before{content:"\F036"}.mdi-apple-icloud::before{content:"\F038"}.mdi-apple-ios::before{content:"\F037"}.mdi-apple-keyboard-caps::before{content:"\F632"}.mdi-apple-keyboard-command::before{content:"\F633"}.mdi-apple-keyboard-control::before{content:"\F634"}.mdi-apple-keyboard-option::before{content:"\F635"}.mdi-apple-keyboard-shift::before{content:"\F636"}.mdi-apple-safari::before{content:"\F039"}.mdi-application::before{content:"\F614"}.mdi-application-export::before{content:"\FD89"}.mdi-application-import::before{content:"\FD8A"}.mdi-apps::before{content:"\F03B"}.mdi-apps-box::before{content:"\FD22"}.mdi-arch::before{content:"\F8C6"}.mdi-archive::before{content:"\F03C"}.mdi-arrange-bring-forward::before{content:"\F03D"}.mdi-arrange-bring-to-front::before{content:"\F03E"}.mdi-arrange-send-backward::before{content:"\F03F"}.mdi-arrange-send-to-back::before{content:"\F040"}.mdi-arrow-all::before{content:"\F041"}.mdi-arrow-bottom-left::before{content:"\F042"}.mdi-arrow-bottom-left-bold-outline::before{content:"\F9B6"}.mdi-arrow-bottom-left-thick::before{content:"\F9B7"}.mdi-arrow-bottom-right::before{content:"\F043"}.mdi-arrow-bottom-right-bold-outline::before{content:"\F9B8"}.mdi-arrow-bottom-right-thick::before{content:"\F9B9"}.mdi-arrow-collapse::before{content:"\F615"}.mdi-arrow-collapse-all::before{content:"\F044"}.mdi-arrow-collapse-down::before{content:"\F791"}.mdi-arrow-collapse-horizontal::before{content:"\F84B"}.mdi-arrow-collapse-left::before{content:"\F792"}.mdi-arrow-collapse-right::before{content:"\F793"}.mdi-arrow-collapse-up::before{content:"\F794"}.mdi-arrow-collapse-vertical::before{content:"\F84C"}.mdi-arrow-decision::before{content:"\F9BA"}.mdi-arrow-decision-auto::before{content:"\F9BB"}.mdi-arrow-decision-auto-outline::before{content:"\F9BC"}.mdi-arrow-decision-outline::before{content:"\F9BD"}.mdi-arrow-down::before{content:"\F045"}.mdi-arrow-down-bold::before{content:"\F72D"}.mdi-arrow-down-bold-box::before{content:"\F72E"}.mdi-arrow-down-bold-box-outline::before{content:"\F72F"}.mdi-arrow-down-bold-circle::before{content:"\F047"}.mdi-arrow-down-bold-circle-outline::before{content:"\F048"}.mdi-arrow-down-bold-hexagon-outline::before{content:"\F049"}.mdi-arrow-down-bold-outline::before{content:"\F9BE"}.mdi-arrow-down-box::before{content:"\F6BF"}.mdi-arrow-down-circle::before{content:"\FCB7"}.mdi-arrow-down-circle-outline::before{content:"\FCB8"}.mdi-arrow-down-drop-circle::before{content:"\F04A"}.mdi-arrow-down-drop-circle-outline::before{content:"\F04B"}.mdi-arrow-down-thick::before{content:"\F046"}.mdi-arrow-expand::before{content:"\F616"}.mdi-arrow-expand-all::before{content:"\F04C"}.mdi-arrow-expand-down::before{content:"\F795"}.mdi-arrow-expand-horizontal::before{content:"\F84D"}.mdi-arrow-expand-left::before{content:"\F796"}.mdi-arrow-expand-right::before{content:"\F797"}.mdi-arrow-expand-up::before{content:"\F798"}.mdi-arrow-expand-vertical::before{content:"\F84E"}.mdi-arrow-left::before{content:"\F04D"}.mdi-arrow-left-bold::before{content:"\F730"}.mdi-arrow-left-bold-box::before{content:"\F731"}.mdi-arrow-left-bold-box-outline::before{content:"\F732"}.mdi-arrow-left-bold-circle::before{content:"\F04F"}.mdi-arrow-left-bold-circle-outline::before{content:"\F050"}.mdi-arrow-left-bold-hexagon-outline::before{content:"\F051"}.mdi-arrow-left-bold-outline::before{content:"\F9BF"}.mdi-arrow-left-box::before{content:"\F6C0"}.mdi-arrow-left-circle::before{content:"\FCB9"}.mdi-arrow-left-circle-outline::before{content:"\FCBA"}.mdi-arrow-left-drop-circle::before{content:"\F052"}.mdi-arrow-left-drop-circle-outline::before{content:"\F053"}.mdi-arrow-left-right::before{content:"\FE90"}.mdi-arrow-left-right-bold::before{content:"\FE91"}.mdi-arrow-left-right-bold-outline::before{content:"\F9C0"}.mdi-arrow-left-thick::before{content:"\F04E"}.mdi-arrow-right::before{content:"\F054"}.mdi-arrow-right-bold::before{content:"\F733"}.mdi-arrow-right-bold-box::before{content:"\F734"}.mdi-arrow-right-bold-box-outline::before{content:"\F735"}.mdi-arrow-right-bold-circle::before{content:"\F056"}.mdi-arrow-right-bold-circle-outline::before{content:"\F057"}.mdi-arrow-right-bold-hexagon-outline::before{content:"\F058"}.mdi-arrow-right-bold-outline::before{content:"\F9C1"}.mdi-arrow-right-box::before{content:"\F6C1"}.mdi-arrow-right-circle::before{content:"\FCBB"}.mdi-arrow-right-circle-outline::before{content:"\FCBC"}.mdi-arrow-right-drop-circle::before{content:"\F059"}.mdi-arrow-right-drop-circle-outline::before{content:"\F05A"}.mdi-arrow-right-thick::before{content:"\F055"}.mdi-arrow-split-horizontal::before{content:"\F93A"}.mdi-arrow-split-vertical::before{content:"\F93B"}.mdi-arrow-top-left::before{content:"\F05B"}.mdi-arrow-top-left-bold-outline::before{content:"\F9C2"}.mdi-arrow-top-left-bottom-right::before{content:"\FE92"}.mdi-arrow-top-left-bottom-right-bold::before{content:"\FE93"}.mdi-arrow-top-left-thick::before{content:"\F9C3"}.mdi-arrow-top-right::before{content:"\F05C"}.mdi-arrow-top-right-bold-outline::before{content:"\F9C4"}.mdi-arrow-top-right-bottom-left::before{content:"\FE94"}.mdi-arrow-top-right-bottom-left-bold::before{content:"\FE95"}.mdi-arrow-top-right-thick::before{content:"\F9C5"}.mdi-arrow-up::before{content:"\F05D"}.mdi-arrow-up-bold::before{content:"\F736"}.mdi-arrow-up-bold-box::before{content:"\F737"}.mdi-arrow-up-bold-box-outline::before{content:"\F738"}.mdi-arrow-up-bold-circle::before{content:"\F05F"}.mdi-arrow-up-bold-circle-outline::before{content:"\F060"}.mdi-arrow-up-bold-hexagon-outline::before{content:"\F061"}.mdi-arrow-up-bold-outline::before{content:"\F9C6"}.mdi-arrow-up-box::before{content:"\F6C2"}.mdi-arrow-up-circle::before{content:"\FCBD"}.mdi-arrow-up-circle-outline::before{content:"\FCBE"}.mdi-arrow-up-down::before{content:"\FE96"}.mdi-arrow-up-down-bold::before{content:"\FE97"}.mdi-arrow-up-down-bold-outline::before{content:"\F9C7"}.mdi-arrow-up-drop-circle::before{content:"\F062"}.mdi-arrow-up-drop-circle-outline::before{content:"\F063"}.mdi-arrow-up-thick::before{content:"\F05E"}.mdi-artist::before{content:"\F802"}.mdi-artist-outline::before{content:"\FCC5"}.mdi-artstation::before{content:"\FB37"}.mdi-aspect-ratio::before{content:"\FA23"}.mdi-assistant::before{content:"\F064"}.mdi-asterisk::before{content:"\F6C3"}.mdi-at::before{content:"\F065"}.mdi-atlassian::before{content:"\F803"}.mdi-atm::before{content:"\FD23"}.mdi-atom::before{content:"\F767"}.mdi-atom-variant::before{content:"\FE98"}.mdi-attachment::before{content:"\F066"}.mdi-audio-video::before{content:"\F93C"}.mdi-audiobook::before{content:"\F067"}.mdi-augmented-reality::before{content:"\F84F"}.mdi-auto-fix::before{content:"\F068"}.mdi-auto-upload::before{content:"\F069"}.mdi-autorenew::before{content:"\F06A"}.mdi-av-timer::before{content:"\F06B"}.mdi-aws::before{content:"\FDF2"}.mdi-axe::before{content:"\F8C7"}.mdi-axis::before{content:"\FD24"}.mdi-axis-arrow::before{content:"\FD25"}.mdi-axis-arrow-lock::before{content:"\FD26"}.mdi-axis-lock::before{content:"\FD27"}.mdi-axis-x-arrow::before{content:"\FD28"}.mdi-axis-x-arrow-lock::before{content:"\FD29"}.mdi-axis-x-rotate-clockwise::before{content:"\FD2A"}.mdi-axis-x-rotate-counterclockwise::before{content:"\FD2B"}.mdi-axis-x-y-arrow-lock::before{content:"\FD2C"}.mdi-axis-y-arrow::before{content:"\FD2D"}.mdi-axis-y-arrow-lock::before{content:"\FD2E"}.mdi-axis-y-rotate-clockwise::before{content:"\FD2F"}.mdi-axis-y-rotate-counterclockwise::before{content:"\FD30"}.mdi-axis-z-arrow::before{content:"\FD31"}.mdi-axis-z-arrow-lock::before{content:"\FD32"}.mdi-axis-z-rotate-clockwise::before{content:"\FD33"}.mdi-axis-z-rotate-counterclockwise::before{content:"\FD34"}.mdi-azure::before{content:"\F804"}.mdi-babel::before{content:"\FA24"}.mdi-baby::before{content:"\F06C"}.mdi-baby-bottle::before{content:"\FF56"}.mdi-baby-bottle-outline::before{content:"\FF57"}.mdi-baby-buggy::before{content:"\F68E"}.mdi-baby-face::before{content:"\FE99"}.mdi-baby-face-outline::before{content:"\FE9A"}.mdi-backburger::before{content:"\F06D"}.mdi-backspace::before{content:"\F06E"}.mdi-backspace-outline::before{content:"\FB38"}.mdi-backspace-reverse::before{content:"\FE9B"}.mdi-backspace-reverse-outline::before{content:"\FE9C"}.mdi-backup-restore::before{content:"\F06F"}.mdi-bacteria::before{content:"\FEF2"}.mdi-bacteria-outline::before{content:"\FEF3"}.mdi-badminton::before{content:"\F850"}.mdi-bag-carry-on::before{content:"\FF58"}.mdi-bag-carry-on-check::before{content:"\FD41"}.mdi-bag-carry-on-off::before{content:"\FF59"}.mdi-bag-checked::before{content:"\FF5A"}.mdi-bag-personal::before{content:"\FDF3"}.mdi-bag-personal-off::before{content:"\FDF4"}.mdi-bag-personal-off-outline::before{content:"\FDF5"}.mdi-bag-personal-outline::before{content:"\FDF6"}.mdi-baguette::before{content:"\FF5B"}.mdi-balloon::before{content:"\FA25"}.mdi-ballot::before{content:"\F9C8"}.mdi-ballot-outline::before{content:"\F9C9"}.mdi-ballot-recount::before{content:"\FC15"}.mdi-ballot-recount-outline::before{content:"\FC16"}.mdi-bandage::before{content:"\FD8B"}.mdi-bandcamp::before{content:"\F674"}.mdi-bank::before{content:"\F070"}.mdi-bank-minus::before{content:"\FD8C"}.mdi-bank-outline::before{content:"\FE9D"}.mdi-bank-plus::before{content:"\FD8D"}.mdi-bank-remove::before{content:"\FD8E"}.mdi-bank-transfer::before{content:"\FA26"}.mdi-bank-transfer-in::before{content:"\FA27"}.mdi-bank-transfer-out::before{content:"\FA28"}.mdi-barcode::before{content:"\F071"}.mdi-barcode-scan::before{content:"\F072"}.mdi-barley::before{content:"\F073"}.mdi-barley-off::before{content:"\FB39"}.mdi-barn::before{content:"\FB3A"}.mdi-barrel::before{content:"\F074"}.mdi-baseball::before{content:"\F851"}.mdi-baseball-bat::before{content:"\F852"}.mdi-basecamp::before{content:"\F075"}.mdi-basket::before{content:"\F076"}.mdi-basket-fill::before{content:"\F077"}.mdi-basket-unfill::before{content:"\F078"}.mdi-basketball::before{content:"\F805"}.mdi-basketball-hoop::before{content:"\FC17"}.mdi-basketball-hoop-outline::before{content:"\FC18"}.mdi-bat::before{content:"\FB3B"}.mdi-battery::before{content:"\F079"}.mdi-battery-10::before{content:"\F07A"}.mdi-battery-10-bluetooth::before{content:"\F93D"}.mdi-battery-20::before{content:"\F07B"}.mdi-battery-20-bluetooth::before{content:"\F93E"}.mdi-battery-30::before{content:"\F07C"}.mdi-battery-30-bluetooth::before{content:"\F93F"}.mdi-battery-40::before{content:"\F07D"}.mdi-battery-40-bluetooth::before{content:"\F940"}.mdi-battery-50::before{content:"\F07E"}.mdi-battery-50-bluetooth::before{content:"\F941"}.mdi-battery-60::before{content:"\F07F"}.mdi-battery-60-bluetooth::before{content:"\F942"}.mdi-battery-70::before{content:"\F080"}.mdi-battery-70-bluetooth::before{content:"\F943"}.mdi-battery-80::before{content:"\F081"}.mdi-battery-80-bluetooth::before{content:"\F944"}.mdi-battery-90::before{content:"\F082"}.mdi-battery-90-bluetooth::before{content:"\F945"}.mdi-battery-alert::before{content:"\F083"}.mdi-battery-alert-bluetooth::before{content:"\F946"}.mdi-battery-bluetooth::before{content:"\F947"}.mdi-battery-bluetooth-variant::before{content:"\F948"}.mdi-battery-charging::before{content:"\F084"}.mdi-battery-charging-10::before{content:"\F89B"}.mdi-battery-charging-100::before{content:"\F085"}.mdi-battery-charging-20::before{content:"\F086"}.mdi-battery-charging-30::before{content:"\F087"}.mdi-battery-charging-40::before{content:"\F088"}.mdi-battery-charging-50::before{content:"\F89C"}.mdi-battery-charging-60::before{content:"\F089"}.mdi-battery-charging-70::before{content:"\F89D"}.mdi-battery-charging-80::before{content:"\F08A"}.mdi-battery-charging-90::before{content:"\F08B"}.mdi-battery-charging-outline::before{content:"\F89E"}.mdi-battery-charging-wireless::before{content:"\F806"}.mdi-battery-charging-wireless-10::before{content:"\F807"}.mdi-battery-charging-wireless-20::before{content:"\F808"}.mdi-battery-charging-wireless-30::before{content:"\F809"}.mdi-battery-charging-wireless-40::before{content:"\F80A"}.mdi-battery-charging-wireless-50::before{content:"\F80B"}.mdi-battery-charging-wireless-60::before{content:"\F80C"}.mdi-battery-charging-wireless-70::before{content:"\F80D"}.mdi-battery-charging-wireless-80::before{content:"\F80E"}.mdi-battery-charging-wireless-90::before{content:"\F80F"}.mdi-battery-charging-wireless-alert::before{content:"\F810"}.mdi-battery-charging-wireless-outline::before{content:"\F811"}.mdi-battery-minus::before{content:"\F08C"}.mdi-battery-negative::before{content:"\F08D"}.mdi-battery-outline::before{content:"\F08E"}.mdi-battery-plus::before{content:"\F08F"}.mdi-battery-positive::before{content:"\F090"}.mdi-battery-unknown::before{content:"\F091"}.mdi-battery-unknown-bluetooth::before{content:"\F949"}.mdi-battlenet::before{content:"\FB3C"}.mdi-beach::before{content:"\F092"}.mdi-beaker::before{content:"\FCC6"}.mdi-beaker-outline::before{content:"\F68F"}.mdi-beats::before{content:"\F097"}.mdi-bed-empty::before{content:"\F89F"}.mdi-beer::before{content:"\F098"}.mdi-behance::before{content:"\F099"}.mdi-bell::before{content:"\F09A"}.mdi-bell-alert::before{content:"\FD35"}.mdi-bell-alert-outline::before{content:"\FE9E"}.mdi-bell-circle::before{content:"\FD36"}.mdi-bell-circle-outline::before{content:"\FD37"}.mdi-bell-off::before{content:"\F09B"}.mdi-bell-off-outline::before{content:"\FA90"}.mdi-bell-outline::before{content:"\F09C"}.mdi-bell-plus::before{content:"\F09D"}.mdi-bell-plus-outline::before{content:"\FA91"}.mdi-bell-ring::before{content:"\F09E"}.mdi-bell-ring-outline::before{content:"\F09F"}.mdi-bell-sleep::before{content:"\F0A0"}.mdi-bell-sleep-outline::before{content:"\FA92"}.mdi-beta::before{content:"\F0A1"}.mdi-betamax::before{content:"\F9CA"}.mdi-biathlon::before{content:"\FDF7"}.mdi-bible::before{content:"\F0A2"}.mdi-bike::before{content:"\F0A3"}.mdi-billiards::before{content:"\FB3D"}.mdi-billiards-rack::before{content:"\FB3E"}.mdi-bing::before{content:"\F0A4"}.mdi-binoculars::before{content:"\F0A5"}.mdi-bio::before{content:"\F0A6"}.mdi-biohazard::before{content:"\F0A7"}.mdi-bitbucket::before{content:"\F0A8"}.mdi-bitcoin::before{content:"\F812"}.mdi-black-mesa::before{content:"\F0A9"}.mdi-blackberry::before{content:"\F0AA"}.mdi-blender::before{content:"\FCC7"}.mdi-blender-software::before{content:"\F0AB"}.mdi-blinds::before{content:"\F0AC"}.mdi-block-helper::before{content:"\F0AD"}.mdi-blogger::before{content:"\F0AE"}.mdi-blood-bag::before{content:"\FCC8"}.mdi-bluetooth::before{content:"\F0AF"}.mdi-bluetooth-audio::before{content:"\F0B0"}.mdi-bluetooth-connect::before{content:"\F0B1"}.mdi-bluetooth-off::before{content:"\F0B2"}.mdi-bluetooth-settings::before{content:"\F0B3"}.mdi-bluetooth-transfer::before{content:"\F0B4"}.mdi-blur::before{content:"\F0B5"}.mdi-blur-linear::before{content:"\F0B6"}.mdi-blur-off::before{content:"\F0B7"}.mdi-blur-radial::before{content:"\F0B8"}.mdi-bolnisi-cross::before{content:"\FCC9"}.mdi-bolt::before{content:"\FD8F"}.mdi-bomb::before{content:"\F690"}.mdi-bomb-off::before{content:"\F6C4"}.mdi-bone::before{content:"\F0B9"}.mdi-book::before{content:"\F0BA"}.mdi-book-lock::before{content:"\F799"}.mdi-book-lock-open::before{content:"\F79A"}.mdi-book-minus::before{content:"\F5D9"}.mdi-book-minus-multiple::before{content:"\FA93"}.mdi-book-multiple::before{content:"\F0BB"}.mdi-book-open::before{content:"\F0BD"}.mdi-book-open-outline::before{content:"\FB3F"}.mdi-book-open-page-variant::before{content:"\F5DA"}.mdi-book-open-variant::before{content:"\F0BE"}.mdi-book-outline::before{content:"\FB40"}.mdi-book-play::before{content:"\FE9F"}.mdi-book-play-outline::before{content:"\FEA0"}.mdi-book-plus::before{content:"\F5DB"}.mdi-book-plus-multiple::before{content:"\FA94"}.mdi-book-remove::before{content:"\FA96"}.mdi-book-remove-multiple::before{content:"\FA95"}.mdi-book-search::before{content:"\FEA1"}.mdi-book-search-outline::before{content:"\FEA2"}.mdi-book-variant::before{content:"\F0BF"}.mdi-book-variant-multiple::before{content:"\F0BC"}.mdi-bookmark::before{content:"\F0C0"}.mdi-bookmark-check::before{content:"\F0C1"}.mdi-bookmark-minus::before{content:"\F9CB"}.mdi-bookmark-minus-outline::before{content:"\F9CC"}.mdi-bookmark-multiple::before{content:"\FDF8"}.mdi-bookmark-multiple-outline::before{content:"\FDF9"}.mdi-bookmark-music::before{content:"\F0C2"}.mdi-bookmark-off::before{content:"\F9CD"}.mdi-bookmark-off-outline::before{content:"\F9CE"}.mdi-bookmark-outline::before{content:"\F0C3"}.mdi-bookmark-plus::before{content:"\F0C5"}.mdi-bookmark-plus-outline::before{content:"\F0C4"}.mdi-bookmark-remove::before{content:"\F0C6"}.mdi-boom-gate::before{content:"\FEA3"}.mdi-boom-gate-alert::before{content:"\FEA4"}.mdi-boom-gate-alert-outline::before{content:"\FEA5"}.mdi-boom-gate-down::before{content:"\FEA6"}.mdi-boom-gate-down-outline::before{content:"\FEA7"}.mdi-boom-gate-outline::before{content:"\FEA8"}.mdi-boom-gate-up::before{content:"\FEA9"}.mdi-boom-gate-up-outline::before{content:"\FEAA"}.mdi-boombox::before{content:"\F5DC"}.mdi-bootstrap::before{content:"\F6C5"}.mdi-border-all::before{content:"\F0C7"}.mdi-border-all-variant::before{content:"\F8A0"}.mdi-border-bottom::before{content:"\F0C8"}.mdi-border-bottom-variant::before{content:"\F8A1"}.mdi-border-color::before{content:"\F0C9"}.mdi-border-horizontal::before{content:"\F0CA"}.mdi-border-inside::before{content:"\F0CB"}.mdi-border-left::before{content:"\F0CC"}.mdi-border-left-variant::before{content:"\F8A2"}.mdi-border-none::before{content:"\F0CD"}.mdi-border-none-variant::before{content:"\F8A3"}.mdi-border-outside::before{content:"\F0CE"}.mdi-border-right::before{content:"\F0CF"}.mdi-border-right-variant::before{content:"\F8A4"}.mdi-border-style::before{content:"\F0D0"}.mdi-border-top::before{content:"\F0D1"}.mdi-border-top-variant::before{content:"\F8A5"}.mdi-border-vertical::before{content:"\F0D2"}.mdi-bottle-wine::before{content:"\F853"}.mdi-bow-tie::before{content:"\F677"}.mdi-bowl::before{content:"\F617"}.mdi-bowling::before{content:"\F0D3"}.mdi-box::before{content:"\F0D4"}.mdi-box-cutter::before{content:"\F0D5"}.mdi-box-shadow::before{content:"\F637"}.mdi-boxing-glove::before{content:"\FB41"}.mdi-braille::before{content:"\F9CF"}.mdi-brain::before{content:"\F9D0"}.mdi-bread-slice::before{content:"\FCCA"}.mdi-bread-slice-outline::before{content:"\FCCB"}.mdi-bridge::before{content:"\F618"}.mdi-briefcase::before{content:"\F0D6"}.mdi-briefcase-account::before{content:"\FCCC"}.mdi-briefcase-account-outline::before{content:"\FCCD"}.mdi-briefcase-check::before{content:"\F0D7"}.mdi-briefcase-download::before{content:"\F0D8"}.mdi-briefcase-download-outline::before{content:"\FC19"}.mdi-briefcase-edit::before{content:"\FA97"}.mdi-briefcase-edit-outline::before{content:"\FC1A"}.mdi-briefcase-minus::before{content:"\FA29"}.mdi-briefcase-minus-outline::before{content:"\FC1B"}.mdi-briefcase-outline::before{content:"\F813"}.mdi-briefcase-plus::before{content:"\FA2A"}.mdi-briefcase-plus-outline::before{content:"\FC1C"}.mdi-briefcase-remove::before{content:"\FA2B"}.mdi-briefcase-remove-outline::before{content:"\FC1D"}.mdi-briefcase-search::before{content:"\FA2C"}.mdi-briefcase-search-outline::before{content:"\FC1E"}.mdi-briefcase-upload::before{content:"\F0D9"}.mdi-briefcase-upload-outline::before{content:"\FC1F"}.mdi-brightness-1::before{content:"\F0DA"}.mdi-brightness-2::before{content:"\F0DB"}.mdi-brightness-3::before{content:"\F0DC"}.mdi-brightness-4::before{content:"\F0DD"}.mdi-brightness-5::before{content:"\F0DE"}.mdi-brightness-6::before{content:"\F0DF"}.mdi-brightness-7::before{content:"\F0E0"}.mdi-brightness-auto::before{content:"\F0E1"}.mdi-brightness-percent::before{content:"\FCCE"}.mdi-broom::before{content:"\F0E2"}.mdi-brush::before{content:"\F0E3"}.mdi-buddhism::before{content:"\F94A"}.mdi-buffer::before{content:"\F619"}.mdi-bug::before{content:"\F0E4"}.mdi-bug-check::before{content:"\FA2D"}.mdi-bug-check-outline::before{content:"\FA2E"}.mdi-bug-outline::before{content:"\FA2F"}.mdi-bugle::before{content:"\FD90"}.mdi-bulldozer::before{content:"\FB07"}.mdi-bullet::before{content:"\FCCF"}.mdi-bulletin-board::before{content:"\F0E5"}.mdi-bullhorn::before{content:"\F0E6"}.mdi-bullhorn-outline::before{content:"\FB08"}.mdi-bullseye::before{content:"\F5DD"}.mdi-bullseye-arrow::before{content:"\F8C8"}.mdi-bus::before{content:"\F0E7"}.mdi-bus-alert::before{content:"\FA98"}.mdi-bus-articulated-end::before{content:"\F79B"}.mdi-bus-articulated-front::before{content:"\F79C"}.mdi-bus-clock::before{content:"\F8C9"}.mdi-bus-double-decker::before{content:"\F79D"}.mdi-bus-multiple::before{content:"\FF5C"}.mdi-bus-school::before{content:"\F79E"}.mdi-bus-side::before{content:"\F79F"}.mdi-cached::before{content:"\F0E8"}.mdi-cactus::before{content:"\FD91"}.mdi-cake::before{content:"\F0E9"}.mdi-cake-layered::before{content:"\F0EA"}.mdi-cake-variant::before{content:"\F0EB"}.mdi-calculator::before{content:"\F0EC"}.mdi-calculator-variant::before{content:"\FA99"}.mdi-calendar::before{content:"\F0ED"}.mdi-calendar-account::before{content:"\FEF4"}.mdi-calendar-account-outline::before{content:"\FEF5"}.mdi-calendar-alert::before{content:"\FA30"}.mdi-calendar-blank::before{content:"\F0EE"}.mdi-calendar-blank-outline::before{content:"\FB42"}.mdi-calendar-check::before{content:"\F0EF"}.mdi-calendar-check-outline::before{content:"\FC20"}.mdi-calendar-clock::before{content:"\F0F0"}.mdi-calendar-edit::before{content:"\F8A6"}.mdi-calendar-export::before{content:"\FB09"}.mdi-calendar-heart::before{content:"\F9D1"}.mdi-calendar-import::before{content:"\FB0A"}.mdi-calendar-minus::before{content:"\FD38"}.mdi-calendar-month::before{content:"\FDFA"}.mdi-calendar-month-outline::before{content:"\FDFB"}.mdi-calendar-multiple::before{content:"\F0F1"}.mdi-calendar-multiple-check::before{content:"\F0F2"}.mdi-calendar-multiselect::before{content:"\FA31"}.mdi-calendar-outline::before{content:"\FB43"}.mdi-calendar-plus::before{content:"\F0F3"}.mdi-calendar-question::before{content:"\F691"}.mdi-calendar-range::before{content:"\F678"}.mdi-calendar-range-outline::before{content:"\FB44"}.mdi-calendar-remove::before{content:"\F0F4"}.mdi-calendar-remove-outline::before{content:"\FC21"}.mdi-calendar-repeat::before{content:"\FEAB"}.mdi-calendar-repeat-outline::before{content:"\FEAC"}.mdi-calendar-search::before{content:"\F94B"}.mdi-calendar-star::before{content:"\F9D2"}.mdi-calendar-text::before{content:"\F0F5"}.mdi-calendar-text-outline::before{content:"\FC22"}.mdi-calendar-today::before{content:"\F0F6"}.mdi-calendar-week::before{content:"\FA32"}.mdi-calendar-week-begin::before{content:"\FA33"}.mdi-calendar-weekend::before{content:"\FEF6"}.mdi-calendar-weekend-outline::before{content:"\FEF7"}.mdi-call-made::before{content:"\F0F7"}.mdi-call-merge::before{content:"\F0F8"}.mdi-call-missed::before{content:"\F0F9"}.mdi-call-received::before{content:"\F0FA"}.mdi-call-split::before{content:"\F0FB"}.mdi-camcorder::before{content:"\F0FC"}.mdi-camcorder-box::before{content:"\F0FD"}.mdi-camcorder-box-off::before{content:"\F0FE"}.mdi-camcorder-off::before{content:"\F0FF"}.mdi-camera::before{content:"\F100"}.mdi-camera-account::before{content:"\F8CA"}.mdi-camera-burst::before{content:"\F692"}.mdi-camera-control::before{content:"\FB45"}.mdi-camera-enhance::before{content:"\F101"}.mdi-camera-enhance-outline::before{content:"\FB46"}.mdi-camera-front::before{content:"\F102"}.mdi-camera-front-variant::before{content:"\F103"}.mdi-camera-gopro::before{content:"\F7A0"}.mdi-camera-image::before{content:"\F8CB"}.mdi-camera-iris::before{content:"\F104"}.mdi-camera-metering-center::before{content:"\F7A1"}.mdi-camera-metering-matrix::before{content:"\F7A2"}.mdi-camera-metering-partial::before{content:"\F7A3"}.mdi-camera-metering-spot::before{content:"\F7A4"}.mdi-camera-off::before{content:"\F5DF"}.mdi-camera-outline::before{content:"\FD39"}.mdi-camera-party-mode::before{content:"\F105"}.mdi-camera-plus::before{content:"\FEF8"}.mdi-camera-plus-outline::before{content:"\FEF9"}.mdi-camera-rear::before{content:"\F106"}.mdi-camera-rear-variant::before{content:"\F107"}.mdi-camera-retake::before{content:"\FDFC"}.mdi-camera-retake-outline::before{content:"\FDFD"}.mdi-camera-switch::before{content:"\F108"}.mdi-camera-timer::before{content:"\F109"}.mdi-camera-wireless::before{content:"\FD92"}.mdi-camera-wireless-outline::before{content:"\FD93"}.mdi-campfire::before{content:"\FEFA"}.mdi-cancel::before{content:"\F739"}.mdi-candle::before{content:"\F5E2"}.mdi-candycane::before{content:"\F10A"}.mdi-cannabis::before{content:"\F7A5"}.mdi-caps-lock::before{content:"\FA9A"}.mdi-car::before{content:"\F10B"}.mdi-car-back::before{content:"\FDFE"}.mdi-car-battery::before{content:"\F10C"}.mdi-car-brake-abs::before{content:"\FC23"}.mdi-car-brake-alert::before{content:"\FC24"}.mdi-car-brake-hold::before{content:"\FD3A"}.mdi-car-brake-parking::before{content:"\FD3B"}.mdi-car-connected::before{content:"\F10D"}.mdi-car-convertible::before{content:"\F7A6"}.mdi-car-cruise-control::before{content:"\FD3C"}.mdi-car-defrost-front::before{content:"\FD3D"}.mdi-car-defrost-rear::before{content:"\FD3E"}.mdi-car-door::before{content:"\FB47"}.mdi-car-electric::before{content:"\FB48"}.mdi-car-esp::before{content:"\FC25"}.mdi-car-estate::before{content:"\F7A7"}.mdi-car-hatchback::before{content:"\F7A8"}.mdi-car-key::before{content:"\FB49"}.mdi-car-light-dimmed::before{content:"\FC26"}.mdi-car-light-fog::before{content:"\FC27"}.mdi-car-light-high::before{content:"\FC28"}.mdi-car-limousine::before{content:"\F8CC"}.mdi-car-multiple::before{content:"\FB4A"}.mdi-car-off::before{content:"\FDFF"}.mdi-car-parking-lights::before{content:"\FD3F"}.mdi-car-pickup::before{content:"\F7A9"}.mdi-car-shift-pattern::before{content:"\FF5D"}.mdi-car-side::before{content:"\F7AA"}.mdi-car-sports::before{content:"\F7AB"}.mdi-car-tire-alert::before{content:"\FC29"}.mdi-car-traction-control::before{content:"\FD40"}.mdi-car-wash::before{content:"\F10E"}.mdi-caravan::before{content:"\F7AC"}.mdi-card::before{content:"\FB4B"}.mdi-card-bulleted::before{content:"\FB4C"}.mdi-card-bulleted-off::before{content:"\FB4D"}.mdi-card-bulleted-off-outline::before{content:"\FB4E"}.mdi-card-bulleted-outline::before{content:"\FB4F"}.mdi-card-bulleted-settings::before{content:"\FB50"}.mdi-card-bulleted-settings-outline::before{content:"\FB51"}.mdi-card-outline::before{content:"\FB52"}.mdi-card-text::before{content:"\FB53"}.mdi-card-text-outline::before{content:"\FB54"}.mdi-cards::before{content:"\F638"}.mdi-cards-club::before{content:"\F8CD"}.mdi-cards-diamond::before{content:"\F8CE"}.mdi-cards-heart::before{content:"\F8CF"}.mdi-cards-outline::before{content:"\F639"}.mdi-cards-playing-outline::before{content:"\F63A"}.mdi-cards-spade::before{content:"\F8D0"}.mdi-cards-variant::before{content:"\F6C6"}.mdi-carrot::before{content:"\F10F"}.mdi-cart::before{content:"\F110"}.mdi-cart-arrow-down::before{content:"\FD42"}.mdi-cart-arrow-right::before{content:"\FC2A"}.mdi-cart-arrow-up::before{content:"\FD43"}.mdi-cart-minus::before{content:"\FD44"}.mdi-cart-off::before{content:"\F66B"}.mdi-cart-outline::before{content:"\F111"}.mdi-cart-plus::before{content:"\F112"}.mdi-cart-remove::before{content:"\FD45"}.mdi-case-sensitive-alt::before{content:"\F113"}.mdi-cash::before{content:"\F114"}.mdi-cash-100::before{content:"\F115"}.mdi-cash-marker::before{content:"\FD94"}.mdi-cash-multiple::before{content:"\F116"}.mdi-cash-refund::before{content:"\FA9B"}.mdi-cash-register::before{content:"\FCD0"}.mdi-cash-usd::before{content:"\F117"}.mdi-cassette::before{content:"\F9D3"}.mdi-cast::before{content:"\F118"}.mdi-cast-connected::before{content:"\F119"}.mdi-cast-education::before{content:"\FE6D"}.mdi-cast-off::before{content:"\F789"}.mdi-castle::before{content:"\F11A"}.mdi-cat::before{content:"\F11B"}.mdi-cctv::before{content:"\F7AD"}.mdi-ceiling-light::before{content:"\F768"}.mdi-cellphone::before{content:"\F11C"}.mdi-cellphone-android::before{content:"\F11D"}.mdi-cellphone-arrow-down::before{content:"\F9D4"}.mdi-cellphone-basic::before{content:"\F11E"}.mdi-cellphone-dock::before{content:"\F11F"}.mdi-cellphone-erase::before{content:"\F94C"}.mdi-cellphone-information::before{content:"\FF5E"}.mdi-cellphone-iphone::before{content:"\F120"}.mdi-cellphone-key::before{content:"\F94D"}.mdi-cellphone-link::before{content:"\F121"}.mdi-cellphone-link-off::before{content:"\F122"}.mdi-cellphone-lock::before{content:"\F94E"}.mdi-cellphone-message::before{content:"\F8D2"}.mdi-cellphone-nfc::before{content:"\FEAD"}.mdi-cellphone-off::before{content:"\F94F"}.mdi-cellphone-screenshot::before{content:"\FA34"}.mdi-cellphone-settings::before{content:"\F123"}.mdi-cellphone-settings-variant::before{content:"\F950"}.mdi-cellphone-sound::before{content:"\F951"}.mdi-cellphone-text::before{content:"\F8D1"}.mdi-cellphone-wireless::before{content:"\F814"}.mdi-celtic-cross::before{content:"\FCD1"}.mdi-certificate::before{content:"\F124"}.mdi-chair-rolling::before{content:"\FFBA"}.mdi-chair-school::before{content:"\F125"}.mdi-charity::before{content:"\FC2B"}.mdi-chart-arc::before{content:"\F126"}.mdi-chart-areaspline::before{content:"\F127"}.mdi-chart-areaspline-variant::before{content:"\FEAE"}.mdi-chart-bar::before{content:"\F128"}.mdi-chart-bar-stacked::before{content:"\F769"}.mdi-chart-bell-curve::before{content:"\FC2C"}.mdi-chart-bubble::before{content:"\F5E3"}.mdi-chart-donut::before{content:"\F7AE"}.mdi-chart-donut-variant::before{content:"\F7AF"}.mdi-chart-gantt::before{content:"\F66C"}.mdi-chart-histogram::before{content:"\F129"}.mdi-chart-line::before{content:"\F12A"}.mdi-chart-line-stacked::before{content:"\F76A"}.mdi-chart-line-variant::before{content:"\F7B0"}.mdi-chart-multiline::before{content:"\F8D3"}.mdi-chart-pie::before{content:"\F12B"}.mdi-chart-scatter-plot::before{content:"\FEAF"}.mdi-chart-scatter-plot-hexbin::before{content:"\F66D"}.mdi-chart-timeline::before{content:"\F66E"}.mdi-chart-timeline-variant::before{content:"\FEB0"}.mdi-chart-tree::before{content:"\FEB1"}.mdi-chat::before{content:"\FB55"}.mdi-chat-alert::before{content:"\FB56"}.mdi-chat-outline::before{content:"\FEFB"}.mdi-chat-processing::before{content:"\FB57"}.mdi-check::before{content:"\F12C"}.mdi-check-all::before{content:"\F12D"}.mdi-check-bold::before{content:"\FE6E"}.mdi-check-box-multiple-outline::before{content:"\FC2D"}.mdi-check-box-outline::before{content:"\FC2E"}.mdi-check-circle::before{content:"\F5E0"}.mdi-check-circle-outline::before{content:"\F5E1"}.mdi-check-decagram::before{content:"\F790"}.mdi-check-network::before{content:"\FC2F"}.mdi-check-network-outline::before{content:"\FC30"}.mdi-check-outline::before{content:"\F854"}.mdi-check-underline::before{content:"\FE70"}.mdi-check-underline-circle::before{content:"\FE71"}.mdi-check-underline-circle-outline::before{content:"\FE72"}.mdi-checkbook::before{content:"\FA9C"}.mdi-checkbox-blank::before{content:"\F12E"}.mdi-checkbox-blank-circle::before{content:"\F12F"}.mdi-checkbox-blank-circle-outline::before{content:"\F130"}.mdi-checkbox-blank-outline::before{content:"\F131"}.mdi-checkbox-intermediate::before{content:"\F855"}.mdi-checkbox-marked::before{content:"\F132"}.mdi-checkbox-marked-circle::before{content:"\F133"}.mdi-checkbox-marked-circle-outline::before{content:"\F134"}.mdi-checkbox-marked-outline::before{content:"\F135"}.mdi-checkbox-multiple-blank::before{content:"\F136"}.mdi-checkbox-multiple-blank-circle::before{content:"\F63B"}.mdi-checkbox-multiple-blank-circle-outline::before{content:"\F63C"}.mdi-checkbox-multiple-blank-outline::before{content:"\F137"}.mdi-checkbox-multiple-marked::before{content:"\F138"}.mdi-checkbox-multiple-marked-circle::before{content:"\F63D"}.mdi-checkbox-multiple-marked-circle-outline::before{content:"\F63E"}.mdi-checkbox-multiple-marked-outline::before{content:"\F139"}.mdi-checkerboard::before{content:"\F13A"}.mdi-chef-hat::before{content:"\FB58"}.mdi-chemical-weapon::before{content:"\F13B"}.mdi-chess-bishop::before{content:"\F85B"}.mdi-chess-king::before{content:"\F856"}.mdi-chess-knight::before{content:"\F857"}.mdi-chess-pawn::before{content:"\F858"}.mdi-chess-queen::before{content:"\F859"}.mdi-chess-rook::before{content:"\F85A"}.mdi-chevron-double-down::before{content:"\F13C"}.mdi-chevron-double-left::before{content:"\F13D"}.mdi-chevron-double-right::before{content:"\F13E"}.mdi-chevron-double-up::before{content:"\F13F"}.mdi-chevron-down::before{content:"\F140"}.mdi-chevron-down-box::before{content:"\F9D5"}.mdi-chevron-down-box-outline::before{content:"\F9D6"}.mdi-chevron-down-circle::before{content:"\FB0B"}.mdi-chevron-down-circle-outline::before{content:"\FB0C"}.mdi-chevron-left::before{content:"\F141"}.mdi-chevron-left-box::before{content:"\F9D7"}.mdi-chevron-left-box-outline::before{content:"\F9D8"}.mdi-chevron-left-circle::before{content:"\FB0D"}.mdi-chevron-left-circle-outline::before{content:"\FB0E"}.mdi-chevron-right::before{content:"\F142"}.mdi-chevron-right-box::before{content:"\F9D9"}.mdi-chevron-right-box-outline::before{content:"\F9DA"}.mdi-chevron-right-circle::before{content:"\FB0F"}.mdi-chevron-right-circle-outline::before{content:"\FB10"}.mdi-chevron-triple-down::before{content:"\FD95"}.mdi-chevron-triple-left::before{content:"\FD96"}.mdi-chevron-triple-right::before{content:"\FD97"}.mdi-chevron-triple-up::before{content:"\FD98"}.mdi-chevron-up::before{content:"\F143"}.mdi-chevron-up-box::before{content:"\F9DB"}.mdi-chevron-up-box-outline::before{content:"\F9DC"}.mdi-chevron-up-circle::before{content:"\FB11"}.mdi-chevron-up-circle-outline::before{content:"\FB12"}.mdi-chili-hot::before{content:"\F7B1"}.mdi-chili-medium::before{content:"\F7B2"}.mdi-chili-mild::before{content:"\F7B3"}.mdi-chip::before{content:"\F61A"}.mdi-christianity::before{content:"\F952"}.mdi-christianity-outline::before{content:"\FCD2"}.mdi-church::before{content:"\F144"}.mdi-circle::before{content:"\F764"}.mdi-circle-double::before{content:"\FEB2"}.mdi-circle-edit-outline::before{content:"\F8D4"}.mdi-circle-expand::before{content:"\FEB3"}.mdi-circle-medium::before{content:"\F9DD"}.mdi-circle-outline::before{content:"\F765"}.mdi-circle-slice-1::before{content:"\FA9D"}.mdi-circle-slice-2::before{content:"\FA9E"}.mdi-circle-slice-3::before{content:"\FA9F"}.mdi-circle-slice-4::before{content:"\FAA0"}.mdi-circle-slice-5::before{content:"\FAA1"}.mdi-circle-slice-6::before{content:"\FAA2"}.mdi-circle-slice-7::before{content:"\FAA3"}.mdi-circle-slice-8::before{content:"\FAA4"}.mdi-circle-small::before{content:"\F9DE"}.mdi-circular-saw::before{content:"\FE73"}.mdi-cisco-webex::before{content:"\F145"}.mdi-city::before{content:"\F146"}.mdi-city-variant::before{content:"\FA35"}.mdi-city-variant-outline::before{content:"\FA36"}.mdi-clipboard::before{content:"\F147"}.mdi-clipboard-account::before{content:"\F148"}.mdi-clipboard-account-outline::before{content:"\FC31"}.mdi-clipboard-alert::before{content:"\F149"}.mdi-clipboard-alert-outline::before{content:"\FCD3"}.mdi-clipboard-arrow-down::before{content:"\F14A"}.mdi-clipboard-arrow-down-outline::before{content:"\FC32"}.mdi-clipboard-arrow-left::before{content:"\F14B"}.mdi-clipboard-arrow-left-outline::before{content:"\FCD4"}.mdi-clipboard-arrow-right::before{content:"\FCD5"}.mdi-clipboard-arrow-right-outline::before{content:"\FCD6"}.mdi-clipboard-arrow-up::before{content:"\FC33"}.mdi-clipboard-arrow-up-outline::before{content:"\FC34"}.mdi-clipboard-check::before{content:"\F14C"}.mdi-clipboard-check-outline::before{content:"\F8A7"}.mdi-clipboard-flow::before{content:"\F6C7"}.mdi-clipboard-outline::before{content:"\F14D"}.mdi-clipboard-play::before{content:"\FC35"}.mdi-clipboard-play-outline::before{content:"\FC36"}.mdi-clipboard-plus::before{content:"\F750"}.mdi-clipboard-pulse::before{content:"\F85C"}.mdi-clipboard-pulse-outline::before{content:"\F85D"}.mdi-clipboard-text::before{content:"\F14E"}.mdi-clipboard-text-outline::before{content:"\FA37"}.mdi-clipboard-text-play::before{content:"\FC37"}.mdi-clipboard-text-play-outline::before{content:"\FC38"}.mdi-clippy::before{content:"\F14F"}.mdi-clock::before{content:"\F953"}.mdi-clock-alert::before{content:"\F954"}.mdi-clock-alert-outline::before{content:"\F5CE"}.mdi-clock-digital::before{content:"\FEB4"}.mdi-clock-end::before{content:"\F151"}.mdi-clock-fast::before{content:"\F152"}.mdi-clock-in::before{content:"\F153"}.mdi-clock-out::before{content:"\F154"}.mdi-clock-outline::before{content:"\F150"}.mdi-clock-start::before{content:"\F155"}.mdi-close::before{content:"\F156"}.mdi-close-box::before{content:"\F157"}.mdi-close-box-multiple::before{content:"\FC39"}.mdi-close-box-multiple-outline::before{content:"\FC3A"}.mdi-close-box-outline::before{content:"\F158"}.mdi-close-circle::before{content:"\F159"}.mdi-close-circle-outline::before{content:"\F15A"}.mdi-close-network::before{content:"\F15B"}.mdi-close-network-outline::before{content:"\FC3B"}.mdi-close-octagon::before{content:"\F15C"}.mdi-close-octagon-outline::before{content:"\F15D"}.mdi-close-outline::before{content:"\F6C8"}.mdi-closed-caption::before{content:"\F15E"}.mdi-closed-caption-outline::before{content:"\FD99"}.mdi-cloud::before{content:"\F15F"}.mdi-cloud-alert::before{content:"\F9DF"}.mdi-cloud-braces::before{content:"\F7B4"}.mdi-cloud-check::before{content:"\F160"}.mdi-cloud-circle::before{content:"\F161"}.mdi-cloud-download::before{content:"\F162"}.mdi-cloud-download-outline::before{content:"\FB59"}.mdi-cloud-off-outline::before{content:"\F164"}.mdi-cloud-outline::before{content:"\F163"}.mdi-cloud-print::before{content:"\F165"}.mdi-cloud-print-outline::before{content:"\F166"}.mdi-cloud-question::before{content:"\FA38"}.mdi-cloud-search::before{content:"\F955"}.mdi-cloud-search-outline::before{content:"\F956"}.mdi-cloud-sync::before{content:"\F63F"}.mdi-cloud-tags::before{content:"\F7B5"}.mdi-cloud-upload::before{content:"\F167"}.mdi-cloud-upload-outline::before{content:"\FB5A"}.mdi-clover::before{content:"\F815"}.mdi-code-array::before{content:"\F168"}.mdi-code-braces::before{content:"\F169"}.mdi-code-brackets::before{content:"\F16A"}.mdi-code-equal::before{content:"\F16B"}.mdi-code-greater-than::before{content:"\F16C"}.mdi-code-greater-than-or-equal::before{content:"\F16D"}.mdi-code-less-than::before{content:"\F16E"}.mdi-code-less-than-or-equal::before{content:"\F16F"}.mdi-code-not-equal::before{content:"\F170"}.mdi-code-not-equal-variant::before{content:"\F171"}.mdi-code-parentheses::before{content:"\F172"}.mdi-code-string::before{content:"\F173"}.mdi-code-tags::before{content:"\F174"}.mdi-code-tags-check::before{content:"\F693"}.mdi-codepen::before{content:"\F175"}.mdi-coffee::before{content:"\F176"}.mdi-coffee-off::before{content:"\FFCA"}.mdi-coffee-off-outline::before{content:"\FFCB"}.mdi-coffee-outline::before{content:"\F6C9"}.mdi-coffee-to-go::before{content:"\F177"}.mdi-coffin::before{content:"\FB5B"}.mdi-cogs::before{content:"\F8D5"}.mdi-coin::before{content:"\F178"}.mdi-coins::before{content:"\F694"}.mdi-collage::before{content:"\F640"}.mdi-collapse-all::before{content:"\FAA5"}.mdi-collapse-all-outline::before{content:"\FAA6"}.mdi-color-helper::before{content:"\F179"}.mdi-comma::before{content:"\FE74"}.mdi-comma-box::before{content:"\FE75"}.mdi-comma-box-outline::before{content:"\FE76"}.mdi-comma-circle::before{content:"\FE77"}.mdi-comma-circle-outline::before{content:"\FE78"}.mdi-comment::before{content:"\F17A"}.mdi-comment-account::before{content:"\F17B"}.mdi-comment-account-outline::before{content:"\F17C"}.mdi-comment-alert::before{content:"\F17D"}.mdi-comment-alert-outline::before{content:"\F17E"}.mdi-comment-arrow-left::before{content:"\F9E0"}.mdi-comment-arrow-left-outline::before{content:"\F9E1"}.mdi-comment-arrow-right::before{content:"\F9E2"}.mdi-comment-arrow-right-outline::before{content:"\F9E3"}.mdi-comment-check::before{content:"\F17F"}.mdi-comment-check-outline::before{content:"\F180"}.mdi-comment-eye::before{content:"\FA39"}.mdi-comment-eye-outline::before{content:"\FA3A"}.mdi-comment-multiple::before{content:"\F85E"}.mdi-comment-multiple-outline::before{content:"\F181"}.mdi-comment-outline::before{content:"\F182"}.mdi-comment-plus::before{content:"\F9E4"}.mdi-comment-plus-outline::before{content:"\F183"}.mdi-comment-processing::before{content:"\F184"}.mdi-comment-processing-outline::before{content:"\F185"}.mdi-comment-question::before{content:"\F816"}.mdi-comment-question-outline::before{content:"\F186"}.mdi-comment-remove::before{content:"\F5DE"}.mdi-comment-remove-outline::before{content:"\F187"}.mdi-comment-search::before{content:"\FA3B"}.mdi-comment-search-outline::before{content:"\FA3C"}.mdi-comment-text::before{content:"\F188"}.mdi-comment-text-multiple::before{content:"\F85F"}.mdi-comment-text-multiple-outline::before{content:"\F860"}.mdi-comment-text-outline::before{content:"\F189"}.mdi-compare::before{content:"\F18A"}.mdi-compass::before{content:"\F18B"}.mdi-compass-off::before{content:"\FB5C"}.mdi-compass-off-outline::before{content:"\FB5D"}.mdi-compass-outline::before{content:"\F18C"}.mdi-console::before{content:"\F18D"}.mdi-console-line::before{content:"\F7B6"}.mdi-console-network::before{content:"\F8A8"}.mdi-console-network-outline::before{content:"\FC3C"}.mdi-contact-mail::before{content:"\F18E"}.mdi-contact-mail-outline::before{content:"\FEB5"}.mdi-contact-phone::before{content:"\FEB6"}.mdi-contact-phone-outline::before{content:"\FEB7"}.mdi-contactless-payment::before{content:"\FD46"}.mdi-contacts::before{content:"\F6CA"}.mdi-contain::before{content:"\FA3D"}.mdi-contain-end::before{content:"\FA3E"}.mdi-contain-start::before{content:"\FA3F"}.mdi-content-copy::before{content:"\F18F"}.mdi-content-cut::before{content:"\F190"}.mdi-content-duplicate::before{content:"\F191"}.mdi-content-paste::before{content:"\F192"}.mdi-content-save::before{content:"\F193"}.mdi-content-save-alert::before{content:"\FF5F"}.mdi-content-save-alert-outline::before{content:"\FF60"}.mdi-content-save-all::before{content:"\F194"}.mdi-content-save-all-outline::before{content:"\FF61"}.mdi-content-save-edit::before{content:"\FCD7"}.mdi-content-save-edit-outline::before{content:"\FCD8"}.mdi-content-save-move::before{content:"\FE79"}.mdi-content-save-move-outline::before{content:"\FE7A"}.mdi-content-save-outline::before{content:"\F817"}.mdi-content-save-settings::before{content:"\F61B"}.mdi-content-save-settings-outline::before{content:"\FB13"}.mdi-contrast::before{content:"\F195"}.mdi-contrast-box::before{content:"\F196"}.mdi-contrast-circle::before{content:"\F197"}.mdi-controller-classic::before{content:"\FB5E"}.mdi-controller-classic-outline::before{content:"\FB5F"}.mdi-cookie::before{content:"\F198"}.mdi-copyright::before{content:"\F5E6"}.mdi-cordova::before{content:"\F957"}.mdi-corn::before{content:"\F7B7"}.mdi-counter::before{content:"\F199"}.mdi-cow::before{content:"\F19A"}.mdi-cowboy::before{content:"\FEB8"}.mdi-cpu-32-bit::before{content:"\FEFC"}.mdi-cpu-64-bit::before{content:"\FEFD"}.mdi-crane::before{content:"\F861"}.mdi-creation::before{content:"\F1C9"}.mdi-creative-commons::before{content:"\FD47"}.mdi-credit-card::before{content:"\F19B"}.mdi-credit-card-clock::before{content:"\FEFE"}.mdi-credit-card-clock-outline::before{content:"\FFBC"}.mdi-credit-card-marker::before{content:"\FD9A"}.mdi-credit-card-multiple::before{content:"\F19C"}.mdi-credit-card-off::before{content:"\F5E4"}.mdi-credit-card-plus::before{content:"\F675"}.mdi-credit-card-refund::before{content:"\FAA7"}.mdi-credit-card-scan::before{content:"\F19D"}.mdi-credit-card-settings::before{content:"\F8D6"}.mdi-credit-card-wireless::before{content:"\FD48"}.mdi-cricket::before{content:"\FD49"}.mdi-crop::before{content:"\F19E"}.mdi-crop-free::before{content:"\F19F"}.mdi-crop-landscape::before{content:"\F1A0"}.mdi-crop-portrait::before{content:"\F1A1"}.mdi-crop-rotate::before{content:"\F695"}.mdi-crop-square::before{content:"\F1A2"}.mdi-crosshairs::before{content:"\F1A3"}.mdi-crosshairs-gps::before{content:"\F1A4"}.mdi-crosshairs-off::before{content:"\FF62"}.mdi-crown::before{content:"\F1A5"}.mdi-cryengine::before{content:"\F958"}.mdi-crystal-ball::before{content:"\FB14"}.mdi-cube::before{content:"\F1A6"}.mdi-cube-outline::before{content:"\F1A7"}.mdi-cube-scan::before{content:"\FB60"}.mdi-cube-send::before{content:"\F1A8"}.mdi-cube-unfolded::before{content:"\F1A9"}.mdi-cup::before{content:"\F1AA"}.mdi-cup-off::before{content:"\F5E5"}.mdi-cup-water::before{content:"\F1AB"}.mdi-cupboard::before{content:"\FF63"}.mdi-cupboard-outline::before{content:"\FF64"}.mdi-cupcake::before{content:"\F959"}.mdi-curling::before{content:"\F862"}.mdi-currency-bdt::before{content:"\F863"}.mdi-currency-brl::before{content:"\FB61"}.mdi-currency-btc::before{content:"\F1AC"}.mdi-currency-chf::before{content:"\F7B8"}.mdi-currency-cny::before{content:"\F7B9"}.mdi-currency-eth::before{content:"\F7BA"}.mdi-currency-eur::before{content:"\F1AD"}.mdi-currency-gbp::before{content:"\F1AE"}.mdi-currency-ils::before{content:"\FC3D"}.mdi-currency-inr::before{content:"\F1AF"}.mdi-currency-jpy::before{content:"\F7BB"}.mdi-currency-krw::before{content:"\F7BC"}.mdi-currency-kzt::before{content:"\F864"}.mdi-currency-ngn::before{content:"\F1B0"}.mdi-currency-php::before{content:"\F9E5"}.mdi-currency-rial::before{content:"\FEB9"}.mdi-currency-rub::before{content:"\F1B1"}.mdi-currency-sign::before{content:"\F7BD"}.mdi-currency-try::before{content:"\F1B2"}.mdi-currency-twd::before{content:"\F7BE"}.mdi-currency-usd::before{content:"\F1B3"}.mdi-currency-usd-off::before{content:"\F679"}.mdi-current-ac::before{content:"\F95A"}.mdi-current-dc::before{content:"\F95B"}.mdi-cursor-default::before{content:"\F1B4"}.mdi-cursor-default-click::before{content:"\FCD9"}.mdi-cursor-default-click-outline::before{content:"\FCDA"}.mdi-cursor-default-outline::before{content:"\F1B5"}.mdi-cursor-move::before{content:"\F1B6"}.mdi-cursor-pointer::before{content:"\F1B7"}.mdi-cursor-text::before{content:"\F5E7"}.mdi-database::before{content:"\F1B8"}.mdi-database-check::before{content:"\FAA8"}.mdi-database-edit::before{content:"\FB62"}.mdi-database-export::before{content:"\F95D"}.mdi-database-import::before{content:"\F95C"}.mdi-database-lock::before{content:"\FAA9"}.mdi-database-minus::before{content:"\F1B9"}.mdi-database-plus::before{content:"\F1BA"}.mdi-database-refresh::before{content:"\FCDB"}.mdi-database-remove::before{content:"\FCDC"}.mdi-database-search::before{content:"\F865"}.mdi-database-settings::before{content:"\FCDD"}.mdi-death-star::before{content:"\F8D7"}.mdi-death-star-variant::before{content:"\F8D8"}.mdi-deathly-hallows::before{content:"\FB63"}.mdi-debian::before{content:"\F8D9"}.mdi-debug-step-into::before{content:"\F1BB"}.mdi-debug-step-out::before{content:"\F1BC"}.mdi-debug-step-over::before{content:"\F1BD"}.mdi-decagram::before{content:"\F76B"}.mdi-decagram-outline::before{content:"\F76C"}.mdi-decimal-decrease::before{content:"\F1BE"}.mdi-decimal-increase::before{content:"\F1BF"}.mdi-delete::before{content:"\F1C0"}.mdi-delete-circle::before{content:"\F682"}.mdi-delete-circle-outline::before{content:"\FB64"}.mdi-delete-empty::before{content:"\F6CB"}.mdi-delete-empty-outline::before{content:"\FEBA"}.mdi-delete-forever::before{content:"\F5E8"}.mdi-delete-forever-outline::before{content:"\FB65"}.mdi-delete-outline::before{content:"\F9E6"}.mdi-delete-restore::before{content:"\F818"}.mdi-delete-sweep::before{content:"\F5E9"}.mdi-delete-sweep-outline::before{content:"\FC3E"}.mdi-delete-variant::before{content:"\F1C1"}.mdi-delta::before{content:"\F1C2"}.mdi-desk-lamp::before{content:"\F95E"}.mdi-deskphone::before{content:"\F1C3"}.mdi-desktop-classic::before{content:"\F7BF"}.mdi-desktop-mac::before{content:"\F1C4"}.mdi-desktop-mac-dashboard::before{content:"\F9E7"}.mdi-desktop-tower::before{content:"\F1C5"}.mdi-desktop-tower-monitor::before{content:"\FAAA"}.mdi-details::before{content:"\F1C6"}.mdi-dev-to::before{content:"\FD4A"}.mdi-developer-board::before{content:"\F696"}.mdi-deviantart::before{content:"\F1C7"}.mdi-dialpad::before{content:"\F61C"}.mdi-diameter::before{content:"\FC3F"}.mdi-diameter-outline::before{content:"\FC40"}.mdi-diameter-variant::before{content:"\FC41"}.mdi-diamond::before{content:"\FB66"}.mdi-diamond-outline::before{content:"\FB67"}.mdi-diamond-stone::before{content:"\F1C8"}.mdi-dice-1::before{content:"\F1CA"}.mdi-dice-2::before{content:"\F1CB"}.mdi-dice-3::before{content:"\F1CC"}.mdi-dice-4::before{content:"\F1CD"}.mdi-dice-5::before{content:"\F1CE"}.mdi-dice-6::before{content:"\F1CF"}.mdi-dice-d10::before{content:"\F76E"}.mdi-dice-d12::before{content:"\F866"}.mdi-dice-d20::before{content:"\F5EA"}.mdi-dice-d4::before{content:"\F5EB"}.mdi-dice-d6::before{content:"\F5EC"}.mdi-dice-d8::before{content:"\F5ED"}.mdi-dice-multiple::before{content:"\F76D"}.mdi-dictionary::before{content:"\F61D"}.mdi-dip-switch::before{content:"\F7C0"}.mdi-directions::before{content:"\F1D0"}.mdi-directions-fork::before{content:"\F641"}.mdi-disc::before{content:"\F5EE"}.mdi-disc-alert::before{content:"\F1D1"}.mdi-disc-player::before{content:"\F95F"}.mdi-discord::before{content:"\F66F"}.mdi-dishwasher::before{content:"\FAAB"}.mdi-disqus::before{content:"\F1D2"}.mdi-disqus-outline::before{content:"\F1D3"}.mdi-diving-flippers::before{content:"\FD9B"}.mdi-diving-helmet::before{content:"\FD9C"}.mdi-diving-scuba::before{content:"\FD9D"}.mdi-diving-scuba-flag::before{content:"\FD9E"}.mdi-diving-scuba-tank::before{content:"\FD9F"}.mdi-diving-scuba-tank-multiple::before{content:"\FDA0"}.mdi-diving-snorkel::before{content:"\FDA1"}.mdi-division::before{content:"\F1D4"}.mdi-division-box::before{content:"\F1D5"}.mdi-dlna::before{content:"\FA40"}.mdi-dna::before{content:"\F683"}.mdi-dns::before{content:"\F1D6"}.mdi-dns-outline::before{content:"\FB68"}.mdi-do-not-disturb::before{content:"\F697"}.mdi-do-not-disturb-off::before{content:"\F698"}.mdi-docker::before{content:"\F867"}.mdi-doctor::before{content:"\FA41"}.mdi-dog::before{content:"\FA42"}.mdi-dog-service::before{content:"\FAAC"}.mdi-dog-side::before{content:"\FA43"}.mdi-dolby::before{content:"\F6B2"}.mdi-dolly::before{content:"\FEBB"}.mdi-domain::before{content:"\F1D7"}.mdi-domain-off::before{content:"\FD4B"}.mdi-donkey::before{content:"\F7C1"}.mdi-door::before{content:"\F819"}.mdi-door-closed::before{content:"\F81A"}.mdi-door-open::before{content:"\F81B"}.mdi-doorbell-video::before{content:"\F868"}.mdi-dot-net::before{content:"\FAAD"}.mdi-dots-horizontal::before{content:"\F1D8"}.mdi-dots-horizontal-circle::before{content:"\F7C2"}.mdi-dots-horizontal-circle-outline::before{content:"\FB69"}.mdi-dots-vertical::before{content:"\F1D9"}.mdi-dots-vertical-circle::before{content:"\F7C3"}.mdi-dots-vertical-circle-outline::before{content:"\FB6A"}.mdi-douban::before{content:"\F699"}.mdi-download::before{content:"\F1DA"}.mdi-download-multiple::before{content:"\F9E8"}.mdi-download-network::before{content:"\F6F3"}.mdi-download-network-outline::before{content:"\FC42"}.mdi-download-outline::before{content:"\FB6B"}.mdi-drag::before{content:"\F1DB"}.mdi-drag-horizontal::before{content:"\F1DC"}.mdi-drag-variant::before{content:"\FB6C"}.mdi-drag-vertical::before{content:"\F1DD"}.mdi-drama-masks::before{content:"\FCDE"}.mdi-draw::before{content:"\FF66"}.mdi-drawing::before{content:"\F1DE"}.mdi-drawing-box::before{content:"\F1DF"}.mdi-dresser::before{content:"\FF67"}.mdi-dresser-outline::before{content:"\FF68"}.mdi-dribbble::before{content:"\F1E0"}.mdi-dribbble-box::before{content:"\F1E1"}.mdi-drone::before{content:"\F1E2"}.mdi-dropbox::before{content:"\F1E3"}.mdi-drupal::before{content:"\F1E4"}.mdi-duck::before{content:"\F1E5"}.mdi-dumbbell::before{content:"\F1E6"}.mdi-dump-truck::before{content:"\FC43"}.mdi-ear-hearing::before{content:"\F7C4"}.mdi-ear-hearing-off::before{content:"\FA44"}.mdi-earth::before{content:"\F1E7"}.mdi-earth-box::before{content:"\F6CC"}.mdi-earth-box-off::before{content:"\F6CD"}.mdi-earth-off::before{content:"\F1E8"}.mdi-edge::before{content:"\F1E9"}.mdi-egg::before{content:"\FAAE"}.mdi-egg-easter::before{content:"\FAAF"}.mdi-eight-track::before{content:"\F9E9"}.mdi-eject::before{content:"\F1EA"}.mdi-eject-outline::before{content:"\FB6D"}.mdi-electric-switch::before{content:"\FEBC"}.mdi-elephant::before{content:"\F7C5"}.mdi-elevation-decline::before{content:"\F1EB"}.mdi-elevation-rise::before{content:"\F1EC"}.mdi-elevator::before{content:"\F1ED"}.mdi-ellipse::before{content:"\FEBD"}.mdi-ellipse-outline::before{content:"\FEBE"}.mdi-email::before{content:"\F1EE"}.mdi-email-alert::before{content:"\F6CE"}.mdi-email-box::before{content:"\FCDF"}.mdi-email-check::before{content:"\FAB0"}.mdi-email-check-outline::before{content:"\FAB1"}.mdi-email-edit::before{content:"\FF00"}.mdi-email-edit-outline::before{content:"\FF01"}.mdi-email-lock::before{content:"\F1F1"}.mdi-email-mark-as-unread::before{content:"\FB6E"}.mdi-email-minus::before{content:"\FF02"}.mdi-email-minus-outline::before{content:"\FF03"}.mdi-email-multiple::before{content:"\FF04"}.mdi-email-multiple-outline::before{content:"\FF05"}.mdi-email-open::before{content:"\F1EF"}.mdi-email-open-multiple::before{content:"\FF06"}.mdi-email-open-multiple-outline::before{content:"\FF07"}.mdi-email-open-outline::before{content:"\F5EF"}.mdi-email-outline::before{content:"\F1F0"}.mdi-email-plus::before{content:"\F9EA"}.mdi-email-plus-outline::before{content:"\F9EB"}.mdi-email-search::before{content:"\F960"}.mdi-email-search-outline::before{content:"\F961"}.mdi-email-variant::before{content:"\F5F0"}.mdi-ember::before{content:"\FB15"}.mdi-emby::before{content:"\F6B3"}.mdi-emoticon::before{content:"\FC44"}.mdi-emoticon-angry::before{content:"\FC45"}.mdi-emoticon-angry-outline::before{content:"\FC46"}.mdi-emoticon-cool::before{content:"\FC47"}.mdi-emoticon-cool-outline::before{content:"\F1F3"}.mdi-emoticon-cry::before{content:"\FC48"}.mdi-emoticon-cry-outline::before{content:"\FC49"}.mdi-emoticon-dead::before{content:"\FC4A"}.mdi-emoticon-dead-outline::before{content:"\F69A"}.mdi-emoticon-devil::before{content:"\FC4B"}.mdi-emoticon-devil-outline::before{content:"\F1F4"}.mdi-emoticon-excited::before{content:"\FC4C"}.mdi-emoticon-excited-outline::before{content:"\F69B"}.mdi-emoticon-frown::before{content:"\FF69"}.mdi-emoticon-frown-outline::before{content:"\FF6A"}.mdi-emoticon-happy::before{content:"\FC4D"}.mdi-emoticon-happy-outline::before{content:"\F1F5"}.mdi-emoticon-kiss::before{content:"\FC4E"}.mdi-emoticon-kiss-outline::before{content:"\FC4F"}.mdi-emoticon-neutral::before{content:"\FC50"}.mdi-emoticon-neutral-outline::before{content:"\F1F6"}.mdi-emoticon-outline::before{content:"\F1F2"}.mdi-emoticon-poop::before{content:"\F1F7"}.mdi-emoticon-poop-outline::before{content:"\FC51"}.mdi-emoticon-sad::before{content:"\FC52"}.mdi-emoticon-sad-outline::before{content:"\F1F8"}.mdi-emoticon-tongue::before{content:"\F1F9"}.mdi-emoticon-tongue-outline::before{content:"\FC53"}.mdi-emoticon-wink::before{content:"\FC54"}.mdi-emoticon-wink-outline::before{content:"\FC55"}.mdi-engine::before{content:"\F1FA"}.mdi-engine-off::before{content:"\FA45"}.mdi-engine-off-outline::before{content:"\FA46"}.mdi-engine-outline::before{content:"\F1FB"}.mdi-equal::before{content:"\F1FC"}.mdi-equal-box::before{content:"\F1FD"}.mdi-equalizer::before{content:"\FEBF"}.mdi-equalizer-outline::before{content:"\FEC0"}.mdi-eraser::before{content:"\F1FE"}.mdi-eraser-variant::before{content:"\F642"}.mdi-escalator::before{content:"\F1FF"}.mdi-eslint::before{content:"\FC56"}.mdi-et::before{content:"\FAB2"}.mdi-ethereum::before{content:"\F869"}.mdi-ethernet::before{content:"\F200"}.mdi-ethernet-cable::before{content:"\F201"}.mdi-ethernet-cable-off::before{content:"\F202"}.mdi-etsy::before{content:"\F203"}.mdi-ev-station::before{content:"\F5F1"}.mdi-eventbrite::before{content:"\F7C6"}.mdi-evernote::before{content:"\F204"}.mdi-exclamation::before{content:"\F205"}.mdi-exit-run::before{content:"\FA47"}.mdi-exit-to-app::before{content:"\F206"}.mdi-expand-all::before{content:"\FAB3"}.mdi-expand-all-outline::before{content:"\FAB4"}.mdi-exponent::before{content:"\F962"}.mdi-exponent-box::before{content:"\F963"}.mdi-export::before{content:"\F207"}.mdi-export-variant::before{content:"\FB6F"}.mdi-eye::before{content:"\F208"}.mdi-eye-check::before{content:"\FCE0"}.mdi-eye-check-outline::before{content:"\FCE1"}.mdi-eye-circle::before{content:"\FB70"}.mdi-eye-circle-outline::before{content:"\FB71"}.mdi-eye-off::before{content:"\F209"}.mdi-eye-off-outline::before{content:"\F6D0"}.mdi-eye-outline::before{content:"\F6CF"}.mdi-eye-plus::before{content:"\F86A"}.mdi-eye-plus-outline::before{content:"\F86B"}.mdi-eye-settings::before{content:"\F86C"}.mdi-eye-settings-outline::before{content:"\F86D"}.mdi-eyedropper::before{content:"\F20A"}.mdi-eyedropper-variant::before{content:"\F20B"}.mdi-face::before{content:"\F643"}.mdi-face-agent::before{content:"\FD4C"}.mdi-face-outline::before{content:"\FB72"}.mdi-face-profile::before{content:"\F644"}.mdi-face-recognition::before{content:"\FC57"}.mdi-facebook::before{content:"\F20C"}.mdi-facebook-box::before{content:"\F20D"}.mdi-facebook-messenger::before{content:"\F20E"}.mdi-facebook-workplace::before{content:"\FB16"}.mdi-factory::before{content:"\F20F"}.mdi-fan::before{content:"\F210"}.mdi-fan-off::before{content:"\F81C"}.mdi-fast-forward::before{content:"\F211"}.mdi-fast-forward-10::before{content:"\FD4D"}.mdi-fast-forward-30::before{content:"\FCE2"}.mdi-fast-forward-outline::before{content:"\F6D1"}.mdi-fax::before{content:"\F212"}.mdi-feather::before{content:"\F6D2"}.mdi-feature-search::before{content:"\FA48"}.mdi-feature-search-outline::before{content:"\FA49"}.mdi-fedora::before{content:"\F8DA"}.mdi-ferris-wheel::before{content:"\FEC1"}.mdi-ferry::before{content:"\F213"}.mdi-file::before{content:"\F214"}.mdi-file-account::before{content:"\F73A"}.mdi-file-alert::before{content:"\FA4A"}.mdi-file-alert-outline::before{content:"\FA4B"}.mdi-file-cabinet::before{content:"\FAB5"}.mdi-file-cad::before{content:"\FF08"}.mdi-file-cad-box::before{content:"\FF09"}.mdi-file-cancel::before{content:"\FDA2"}.mdi-file-cancel-outline::before{content:"\FDA3"}.mdi-file-chart::before{content:"\F215"}.mdi-file-check::before{content:"\F216"}.mdi-file-check-outline::before{content:"\FE7B"}.mdi-file-cloud::before{content:"\F217"}.mdi-file-compare::before{content:"\F8A9"}.mdi-file-delimited::before{content:"\F218"}.mdi-file-delimited-outline::before{content:"\FEC2"}.mdi-file-document::before{content:"\F219"}.mdi-file-document-box::before{content:"\F21A"}.mdi-file-document-box-check::before{content:"\FEC3"}.mdi-file-document-box-check-outline::before{content:"\FEC4"}.mdi-file-document-box-minus::before{content:"\FEC5"}.mdi-file-document-box-minus-outline::before{content:"\FEC6"}.mdi-file-document-box-multiple::before{content:"\FAB6"}.mdi-file-document-box-multiple-outline::before{content:"\FAB7"}.mdi-file-document-box-outline::before{content:"\F9EC"}.mdi-file-document-box-plus::before{content:"\FEC7"}.mdi-file-document-box-plus-outline::before{content:"\FEC8"}.mdi-file-document-box-remove::before{content:"\FEC9"}.mdi-file-document-box-remove-outline::before{content:"\FECA"}.mdi-file-document-box-search::before{content:"\FECB"}.mdi-file-document-box-search-outline::before{content:"\FECC"}.mdi-file-document-edit::before{content:"\FDA4"}.mdi-file-document-edit-outline::before{content:"\FDA5"}.mdi-file-document-outline::before{content:"\F9ED"}.mdi-file-download::before{content:"\F964"}.mdi-file-download-outline::before{content:"\F965"}.mdi-file-excel::before{content:"\F21B"}.mdi-file-excel-box::before{content:"\F21C"}.mdi-file-export::before{content:"\F21D"}.mdi-file-eye::before{content:"\FDA6"}.mdi-file-eye-outline::before{content:"\FDA7"}.mdi-file-find::before{content:"\F21E"}.mdi-file-find-outline::before{content:"\FB73"}.mdi-file-hidden::before{content:"\F613"}.mdi-file-image::before{content:"\F21F"}.mdi-file-image-outline::before{content:"\FECD"}.mdi-file-import::before{content:"\F220"}.mdi-file-lock::before{content:"\F221"}.mdi-file-move::before{content:"\FAB8"}.mdi-file-multiple::before{content:"\F222"}.mdi-file-music::before{content:"\F223"}.mdi-file-music-outline::before{content:"\FE7C"}.mdi-file-outline::before{content:"\F224"}.mdi-file-pdf::before{content:"\F225"}.mdi-file-pdf-box::before{content:"\F226"}.mdi-file-pdf-outline::before{content:"\FE7D"}.mdi-file-percent::before{content:"\F81D"}.mdi-file-plus::before{content:"\F751"}.mdi-file-plus-outline::before{content:"\FF0A"}.mdi-file-powerpoint::before{content:"\F227"}.mdi-file-powerpoint-box::before{content:"\F228"}.mdi-file-presentation-box::before{content:"\F229"}.mdi-file-question::before{content:"\F86E"}.mdi-file-remove::before{content:"\FB74"}.mdi-file-replace::before{content:"\FB17"}.mdi-file-replace-outline::before{content:"\FB18"}.mdi-file-restore::before{content:"\F670"}.mdi-file-search::before{content:"\FC58"}.mdi-file-search-outline::before{content:"\FC59"}.mdi-file-send::before{content:"\F22A"}.mdi-file-table::before{content:"\FC5A"}.mdi-file-table-outline::before{content:"\FC5B"}.mdi-file-tree::before{content:"\F645"}.mdi-file-undo::before{content:"\F8DB"}.mdi-file-upload::before{content:"\FA4C"}.mdi-file-upload-outline::before{content:"\FA4D"}.mdi-file-video::before{content:"\F22B"}.mdi-file-video-outline::before{content:"\FE10"}.mdi-file-word::before{content:"\F22C"}.mdi-file-word-box::before{content:"\F22D"}.mdi-file-xml::before{content:"\F22E"}.mdi-film::before{content:"\F22F"}.mdi-filmstrip::before{content:"\F230"}.mdi-filmstrip-off::before{content:"\F231"}.mdi-filter::before{content:"\F232"}.mdi-filter-minus::before{content:"\FF0B"}.mdi-filter-minus-outline::before{content:"\FF0C"}.mdi-filter-outline::before{content:"\F233"}.mdi-filter-plus::before{content:"\FF0D"}.mdi-filter-plus-outline::before{content:"\FF0E"}.mdi-filter-remove::before{content:"\F234"}.mdi-filter-remove-outline::before{content:"\F235"}.mdi-filter-variant::before{content:"\F236"}.mdi-finance::before{content:"\F81E"}.mdi-find-replace::before{content:"\F6D3"}.mdi-fingerprint::before{content:"\F237"}.mdi-fingerprint-off::before{content:"\FECE"}.mdi-fire::before{content:"\F238"}.mdi-fire-extinguisher::before{content:"\FF0F"}.mdi-fire-truck::before{content:"\F8AA"}.mdi-firebase::before{content:"\F966"}.mdi-firefox::before{content:"\F239"}.mdi-fireplace::before{content:"\FE11"}.mdi-fireplace-off::before{content:"\FE12"}.mdi-firework::before{content:"\FE13"}.mdi-fish::before{content:"\F23A"}.mdi-fishbowl::before{content:"\FF10"}.mdi-fishbowl-outline::before{content:"\FF11"}.mdi-fit-to-page::before{content:"\FF12"}.mdi-fit-to-page-outline::before{content:"\FF13"}.mdi-flag::before{content:"\F23B"}.mdi-flag-checkered::before{content:"\F23C"}.mdi-flag-minus::before{content:"\FB75"}.mdi-flag-outline::before{content:"\F23D"}.mdi-flag-plus::before{content:"\FB76"}.mdi-flag-remove::before{content:"\FB77"}.mdi-flag-triangle::before{content:"\F23F"}.mdi-flag-variant::before{content:"\F240"}.mdi-flag-variant-outline::before{content:"\F23E"}.mdi-flare::before{content:"\FD4E"}.mdi-flash::before{content:"\F241"}.mdi-flash-alert::before{content:"\FF14"}.mdi-flash-alert-outline::before{content:"\FF15"}.mdi-flash-auto::before{content:"\F242"}.mdi-flash-circle::before{content:"\F81F"}.mdi-flash-off::before{content:"\F243"}.mdi-flash-outline::before{content:"\F6D4"}.mdi-flash-red-eye::before{content:"\F67A"}.mdi-flashlight::before{content:"\F244"}.mdi-flashlight-off::before{content:"\F245"}.mdi-flask::before{content:"\F093"}.mdi-flask-empty::before{content:"\F094"}.mdi-flask-empty-outline::before{content:"\F095"}.mdi-flask-outline::before{content:"\F096"}.mdi-flattr::before{content:"\F246"}.mdi-flickr::before{content:"\FCE3"}.mdi-flip-to-back::before{content:"\F247"}.mdi-flip-to-front::before{content:"\F248"}.mdi-floor-lamp::before{content:"\F8DC"}.mdi-floor-plan::before{content:"\F820"}.mdi-floppy::before{content:"\F249"}.mdi-floppy-variant::before{content:"\F9EE"}.mdi-flower::before{content:"\F24A"}.mdi-flower-outline::before{content:"\F9EF"}.mdi-flower-poppy::before{content:"\FCE4"}.mdi-flower-tulip::before{content:"\F9F0"}.mdi-flower-tulip-outline::before{content:"\F9F1"}.mdi-focus-auto::before{content:"\FF6B"}.mdi-focus-field::before{content:"\FF6C"}.mdi-focus-field-horizontal::before{content:"\FF6D"}.mdi-focus-field-vertical::before{content:"\FF6E"}.mdi-folder::before{content:"\F24B"}.mdi-folder-account::before{content:"\F24C"}.mdi-folder-account-outline::before{content:"\FB78"}.mdi-folder-alert::before{content:"\FDA8"}.mdi-folder-alert-outline::before{content:"\FDA9"}.mdi-folder-clock::before{content:"\FAB9"}.mdi-folder-clock-outline::before{content:"\FABA"}.mdi-folder-download::before{content:"\F24D"}.mdi-folder-edit::before{content:"\F8DD"}.mdi-folder-edit-outline::before{content:"\FDAA"}.mdi-folder-google-drive::before{content:"\F24E"}.mdi-folder-image::before{content:"\F24F"}.mdi-folder-key::before{content:"\F8AB"}.mdi-folder-key-network::before{content:"\F8AC"}.mdi-folder-key-network-outline::before{content:"\FC5C"}.mdi-folder-lock::before{content:"\F250"}.mdi-folder-lock-open::before{content:"\F251"}.mdi-folder-move::before{content:"\F252"}.mdi-folder-multiple::before{content:"\F253"}.mdi-folder-multiple-image::before{content:"\F254"}.mdi-folder-multiple-outline::before{content:"\F255"}.mdi-folder-network::before{content:"\F86F"}.mdi-folder-network-outline::before{content:"\FC5D"}.mdi-folder-open::before{content:"\F76F"}.mdi-folder-open-outline::before{content:"\FDAB"}.mdi-folder-outline::before{content:"\F256"}.mdi-folder-plus::before{content:"\F257"}.mdi-folder-plus-outline::before{content:"\FB79"}.mdi-folder-pound::before{content:"\FCE5"}.mdi-folder-pound-outline::before{content:"\FCE6"}.mdi-folder-remove::before{content:"\F258"}.mdi-folder-remove-outline::before{content:"\FB7A"}.mdi-folder-search::before{content:"\F967"}.mdi-folder-search-outline::before{content:"\F968"}.mdi-folder-star::before{content:"\F69C"}.mdi-folder-star-outline::before{content:"\FB7B"}.mdi-folder-sync::before{content:"\FCE7"}.mdi-folder-sync-outline::before{content:"\FCE8"}.mdi-folder-text::before{content:"\FC5E"}.mdi-folder-text-outline::before{content:"\FC5F"}.mdi-folder-upload::before{content:"\F259"}.mdi-font-awesome::before{content:"\F03A"}.mdi-food::before{content:"\F25A"}.mdi-food-apple::before{content:"\F25B"}.mdi-food-apple-outline::before{content:"\FC60"}.mdi-food-croissant::before{content:"\F7C7"}.mdi-food-fork-drink::before{content:"\F5F2"}.mdi-food-off::before{content:"\F5F3"}.mdi-food-variant::before{content:"\F25C"}.mdi-foot-print::before{content:"\FF6F"}.mdi-football::before{content:"\F25D"}.mdi-football-australian::before{content:"\F25E"}.mdi-football-helmet::before{content:"\F25F"}.mdi-forklift::before{content:"\F7C8"}.mdi-format-align-bottom::before{content:"\F752"}.mdi-format-align-center::before{content:"\F260"}.mdi-format-align-justify::before{content:"\F261"}.mdi-format-align-left::before{content:"\F262"}.mdi-format-align-middle::before{content:"\F753"}.mdi-format-align-right::before{content:"\F263"}.mdi-format-align-top::before{content:"\F754"}.mdi-format-annotation-minus::before{content:"\FABB"}.mdi-format-annotation-plus::before{content:"\F646"}.mdi-format-bold::before{content:"\F264"}.mdi-format-clear::before{content:"\F265"}.mdi-format-color-fill::before{content:"\F266"}.mdi-format-color-highlight::before{content:"\FE14"}.mdi-format-color-text::before{content:"\F69D"}.mdi-format-columns::before{content:"\F8DE"}.mdi-format-float-center::before{content:"\F267"}.mdi-format-float-left::before{content:"\F268"}.mdi-format-float-none::before{content:"\F269"}.mdi-format-float-right::before{content:"\F26A"}.mdi-format-font::before{content:"\F6D5"}.mdi-format-font-size-decrease::before{content:"\F9F2"}.mdi-format-font-size-increase::before{content:"\F9F3"}.mdi-format-header-1::before{content:"\F26B"}.mdi-format-header-2::before{content:"\F26C"}.mdi-format-header-3::before{content:"\F26D"}.mdi-format-header-4::before{content:"\F26E"}.mdi-format-header-5::before{content:"\F26F"}.mdi-format-header-6::before{content:"\F270"}.mdi-format-header-decrease::before{content:"\F271"}.mdi-format-header-equal::before{content:"\F272"}.mdi-format-header-increase::before{content:"\F273"}.mdi-format-header-pound::before{content:"\F274"}.mdi-format-horizontal-align-center::before{content:"\F61E"}.mdi-format-horizontal-align-left::before{content:"\F61F"}.mdi-format-horizontal-align-right::before{content:"\F620"}.mdi-format-indent-decrease::before{content:"\F275"}.mdi-format-indent-increase::before{content:"\F276"}.mdi-format-italic::before{content:"\F277"}.mdi-format-letter-case::before{content:"\FB19"}.mdi-format-letter-case-lower::before{content:"\FB1A"}.mdi-format-letter-case-upper::before{content:"\FB1B"}.mdi-format-line-spacing::before{content:"\F278"}.mdi-format-line-style::before{content:"\F5C8"}.mdi-format-line-weight::before{content:"\F5C9"}.mdi-format-list-bulleted::before{content:"\F279"}.mdi-format-list-bulleted-square::before{content:"\FDAC"}.mdi-format-list-bulleted-type::before{content:"\F27A"}.mdi-format-list-checkbox::before{content:"\F969"}.mdi-format-list-checks::before{content:"\F755"}.mdi-format-list-numbered::before{content:"\F27B"}.mdi-format-list-numbered-rtl::before{content:"\FCE9"}.mdi-format-list-triangle::before{content:"\FECF"}.mdi-format-overline::before{content:"\FED0"}.mdi-format-page-break::before{content:"\F6D6"}.mdi-format-paint::before{content:"\F27C"}.mdi-format-paragraph::before{content:"\F27D"}.mdi-format-pilcrow::before{content:"\F6D7"}.mdi-format-quote-close::before{content:"\F27E"}.mdi-format-quote-open::before{content:"\F756"}.mdi-format-rotate-90::before{content:"\F6A9"}.mdi-format-section::before{content:"\F69E"}.mdi-format-size::before{content:"\F27F"}.mdi-format-strikethrough::before{content:"\F280"}.mdi-format-strikethrough-variant::before{content:"\F281"}.mdi-format-subscript::before{content:"\F282"}.mdi-format-superscript::before{content:"\F283"}.mdi-format-text::before{content:"\F284"}.mdi-format-text-rotation-down::before{content:"\FD4F"}.mdi-format-text-rotation-none::before{content:"\FD50"}.mdi-format-text-variant::before{content:"\FE15"}.mdi-format-text-wrapping-clip::before{content:"\FCEA"}.mdi-format-text-wrapping-overflow::before{content:"\FCEB"}.mdi-format-text-wrapping-wrap::before{content:"\FCEC"}.mdi-format-textbox::before{content:"\FCED"}.mdi-format-textdirection-l-to-r::before{content:"\F285"}.mdi-format-textdirection-r-to-l::before{content:"\F286"}.mdi-format-title::before{content:"\F5F4"}.mdi-format-underline::before{content:"\F287"}.mdi-format-vertical-align-bottom::before{content:"\F621"}.mdi-format-vertical-align-center::before{content:"\F622"}.mdi-format-vertical-align-top::before{content:"\F623"}.mdi-format-wrap-inline::before{content:"\F288"}.mdi-format-wrap-square::before{content:"\F289"}.mdi-format-wrap-tight::before{content:"\F28A"}.mdi-format-wrap-top-bottom::before{content:"\F28B"}.mdi-forum::before{content:"\F28C"}.mdi-forum-outline::before{content:"\F821"}.mdi-forward::before{content:"\F28D"}.mdi-forwardburger::before{content:"\FD51"}.mdi-fountain::before{content:"\F96A"}.mdi-fountain-pen::before{content:"\FCEE"}.mdi-fountain-pen-tip::before{content:"\FCEF"}.mdi-foursquare::before{content:"\F28E"}.mdi-freebsd::before{content:"\F8DF"}.mdi-frequently-asked-questions::before{content:"\FED1"}.mdi-fridge::before{content:"\F290"}.mdi-fridge-bottom::before{content:"\F292"}.mdi-fridge-outline::before{content:"\F28F"}.mdi-fridge-top::before{content:"\F291"}.mdi-fuel::before{content:"\F7C9"}.mdi-fullscreen::before{content:"\F293"}.mdi-fullscreen-exit::before{content:"\F294"}.mdi-function::before{content:"\F295"}.mdi-function-variant::before{content:"\F870"}.mdi-fuse::before{content:"\FC61"}.mdi-fuse-blade::before{content:"\FC62"}.mdi-gamepad::before{content:"\F296"}.mdi-gamepad-circle::before{content:"\FE16"}.mdi-gamepad-circle-down::before{content:"\FE17"}.mdi-gamepad-circle-left::before{content:"\FE18"}.mdi-gamepad-circle-outline::before{content:"\FE19"}.mdi-gamepad-circle-right::before{content:"\FE1A"}.mdi-gamepad-circle-up::before{content:"\FE1B"}.mdi-gamepad-down::before{content:"\FE1C"}.mdi-gamepad-left::before{content:"\FE1D"}.mdi-gamepad-right::before{content:"\FE1E"}.mdi-gamepad-round::before{content:"\FE1F"}.mdi-gamepad-round-down::before{content:"\FE7E"}.mdi-gamepad-round-left::before{content:"\FE7F"}.mdi-gamepad-round-outline::before{content:"\FE80"}.mdi-gamepad-round-right::before{content:"\FE81"}.mdi-gamepad-round-up::before{content:"\FE82"}.mdi-gamepad-square::before{content:"\FED2"}.mdi-gamepad-square-outline::before{content:"\FED3"}.mdi-gamepad-up::before{content:"\FE83"}.mdi-gamepad-variant::before{content:"\F297"}.mdi-gamepad-variant-outline::before{content:"\FED4"}.mdi-gantry-crane::before{content:"\FDAD"}.mdi-garage::before{content:"\F6D8"}.mdi-garage-alert::before{content:"\F871"}.mdi-garage-open::before{content:"\F6D9"}.mdi-gas-cylinder::before{content:"\F647"}.mdi-gas-station::before{content:"\F298"}.mdi-gas-station-outline::before{content:"\FED5"}.mdi-gate::before{content:"\F299"}.mdi-gate-and::before{content:"\F8E0"}.mdi-gate-nand::before{content:"\F8E1"}.mdi-gate-nor::before{content:"\F8E2"}.mdi-gate-not::before{content:"\F8E3"}.mdi-gate-or::before{content:"\F8E4"}.mdi-gate-xnor::before{content:"\F8E5"}.mdi-gate-xor::before{content:"\F8E6"}.mdi-gatsby::before{content:"\FE84"}.mdi-gauge::before{content:"\F29A"}.mdi-gauge-empty::before{content:"\F872"}.mdi-gauge-full::before{content:"\F873"}.mdi-gauge-low::before{content:"\F874"}.mdi-gavel::before{content:"\F29B"}.mdi-gender-female::before{content:"\F29C"}.mdi-gender-male::before{content:"\F29D"}.mdi-gender-male-female::before{content:"\F29E"}.mdi-gender-transgender::before{content:"\F29F"}.mdi-gentoo::before{content:"\F8E7"}.mdi-gesture::before{content:"\F7CA"}.mdi-gesture-double-tap::before{content:"\F73B"}.mdi-gesture-pinch::before{content:"\FABC"}.mdi-gesture-spread::before{content:"\FABD"}.mdi-gesture-swipe::before{content:"\FD52"}.mdi-gesture-swipe-down::before{content:"\F73C"}.mdi-gesture-swipe-horizontal::before{content:"\FABE"}.mdi-gesture-swipe-left::before{content:"\F73D"}.mdi-gesture-swipe-right::before{content:"\F73E"}.mdi-gesture-swipe-up::before{content:"\F73F"}.mdi-gesture-swipe-vertical::before{content:"\FABF"}.mdi-gesture-tap::before{content:"\F740"}.mdi-gesture-tap-hold::before{content:"\FD53"}.mdi-gesture-two-double-tap::before{content:"\F741"}.mdi-gesture-two-tap::before{content:"\F742"}.mdi-ghost::before{content:"\F2A0"}.mdi-ghost-off::before{content:"\F9F4"}.mdi-gif::before{content:"\FD54"}.mdi-gift::before{content:"\FE85"}.mdi-gift-outline::before{content:"\F2A1"}.mdi-git::before{content:"\F2A2"}.mdi-github-box::before{content:"\F2A3"}.mdi-github-circle::before{content:"\F2A4"}.mdi-github-face::before{content:"\F6DA"}.mdi-gitlab::before{content:"\FB7C"}.mdi-glass-cocktail::before{content:"\F356"}.mdi-glass-flute::before{content:"\F2A5"}.mdi-glass-mug::before{content:"\F2A6"}.mdi-glass-stange::before{content:"\F2A7"}.mdi-glass-tulip::before{content:"\F2A8"}.mdi-glass-wine::before{content:"\F875"}.mdi-glassdoor::before{content:"\F2A9"}.mdi-glasses::before{content:"\F2AA"}.mdi-globe-model::before{content:"\F8E8"}.mdi-gmail::before{content:"\F2AB"}.mdi-gnome::before{content:"\F2AC"}.mdi-go-kart::before{content:"\FD55"}.mdi-go-kart-track::before{content:"\FD56"}.mdi-gog::before{content:"\FB7D"}.mdi-golf::before{content:"\F822"}.mdi-gondola::before{content:"\F685"}.mdi-goodreads::before{content:"\FD57"}.mdi-google::before{content:"\F2AD"}.mdi-google-adwords::before{content:"\FC63"}.mdi-google-allo::before{content:"\F801"}.mdi-google-analytics::before{content:"\F7CB"}.mdi-google-assistant::before{content:"\F7CC"}.mdi-google-cardboard::before{content:"\F2AE"}.mdi-google-chrome::before{content:"\F2AF"}.mdi-google-circles::before{content:"\F2B0"}.mdi-google-circles-communities::before{content:"\F2B1"}.mdi-google-circles-extended::before{content:"\F2B2"}.mdi-google-circles-group::before{content:"\F2B3"}.mdi-google-classroom::before{content:"\F2C0"}.mdi-google-controller::before{content:"\F2B4"}.mdi-google-controller-off::before{content:"\F2B5"}.mdi-google-drive::before{content:"\F2B6"}.mdi-google-earth::before{content:"\F2B7"}.mdi-google-fit::before{content:"\F96B"}.mdi-google-glass::before{content:"\F2B8"}.mdi-google-hangouts::before{content:"\F2C9"}.mdi-google-home::before{content:"\F823"}.mdi-google-keep::before{content:"\F6DB"}.mdi-google-lens::before{content:"\F9F5"}.mdi-google-maps::before{content:"\F5F5"}.mdi-google-nearby::before{content:"\F2B9"}.mdi-google-pages::before{content:"\F2BA"}.mdi-google-photos::before{content:"\F6DC"}.mdi-google-physical-web::before{content:"\F2BB"}.mdi-google-play::before{content:"\F2BC"}.mdi-google-plus::before{content:"\F2BD"}.mdi-google-plus-box::before{content:"\F2BE"}.mdi-google-podcast::before{content:"\FED6"}.mdi-google-spreadsheet::before{content:"\F9F6"}.mdi-google-street-view::before{content:"\FC64"}.mdi-google-translate::before{content:"\F2BF"}.mdi-gpu::before{content:"\F8AD"}.mdi-gradient::before{content:"\F69F"}.mdi-grain::before{content:"\FD58"}.mdi-graphql::before{content:"\F876"}.mdi-grave-stone::before{content:"\FB7E"}.mdi-grease-pencil::before{content:"\F648"}.mdi-greater-than::before{content:"\F96C"}.mdi-greater-than-or-equal::before{content:"\F96D"}.mdi-grid::before{content:"\F2C1"}.mdi-grid-large::before{content:"\F757"}.mdi-grid-off::before{content:"\F2C2"}.mdi-grill::before{content:"\FE86"}.mdi-group::before{content:"\F2C3"}.mdi-guitar-acoustic::before{content:"\F770"}.mdi-guitar-electric::before{content:"\F2C4"}.mdi-guitar-pick::before{content:"\F2C5"}.mdi-guitar-pick-outline::before{content:"\F2C6"}.mdi-guy-fawkes-mask::before{content:"\F824"}.mdi-hackernews::before{content:"\F624"}.mdi-hail::before{content:"\FAC0"}.mdi-halloween::before{content:"\FB7F"}.mdi-hamburger::before{content:"\F684"}.mdi-hammer::before{content:"\F8E9"}.mdi-hand::before{content:"\FA4E"}.mdi-hand-left::before{content:"\FE87"}.mdi-hand-okay::before{content:"\FA4F"}.mdi-hand-peace::before{content:"\FA50"}.mdi-hand-peace-variant::before{content:"\FA51"}.mdi-hand-pointing-down::before{content:"\FA52"}.mdi-hand-pointing-left::before{content:"\FA53"}.mdi-hand-pointing-right::before{content:"\F2C7"}.mdi-hand-pointing-up::before{content:"\FA54"}.mdi-hand-right::before{content:"\FE88"}.mdi-hand-saw::before{content:"\FE89"}.mdi-handball::before{content:"\FF70"}.mdi-hanger::before{content:"\F2C8"}.mdi-hard-hat::before{content:"\F96E"}.mdi-harddisk::before{content:"\F2CA"}.mdi-hat-fedora::before{content:"\FB80"}.mdi-hazard-lights::before{content:"\FC65"}.mdi-hdr::before{content:"\FD59"}.mdi-hdr-off::before{content:"\FD5A"}.mdi-headphones::before{content:"\F2CB"}.mdi-headphones-bluetooth::before{content:"\F96F"}.mdi-headphones-box::before{content:"\F2CC"}.mdi-headphones-off::before{content:"\F7CD"}.mdi-headphones-settings::before{content:"\F2CD"}.mdi-headset::before{content:"\F2CE"}.mdi-headset-dock::before{content:"\F2CF"}.mdi-headset-off::before{content:"\F2D0"}.mdi-heart::before{content:"\F2D1"}.mdi-heart-box::before{content:"\F2D2"}.mdi-heart-box-outline::before{content:"\F2D3"}.mdi-heart-broken::before{content:"\F2D4"}.mdi-heart-broken-outline::before{content:"\FCF0"}.mdi-heart-circle::before{content:"\F970"}.mdi-heart-circle-outline::before{content:"\F971"}.mdi-heart-flash::before{content:"\FF16"}.mdi-heart-half::before{content:"\F6DE"}.mdi-heart-half-full::before{content:"\F6DD"}.mdi-heart-half-outline::before{content:"\F6DF"}.mdi-heart-multiple::before{content:"\FA55"}.mdi-heart-multiple-outline::before{content:"\FA56"}.mdi-heart-off::before{content:"\F758"}.mdi-heart-outline::before{content:"\F2D5"}.mdi-heart-pulse::before{content:"\F5F6"}.mdi-helicopter::before{content:"\FAC1"}.mdi-help::before{content:"\F2D6"}.mdi-help-box::before{content:"\F78A"}.mdi-help-circle::before{content:"\F2D7"}.mdi-help-circle-outline::before{content:"\F625"}.mdi-help-network::before{content:"\F6F4"}.mdi-help-network-outline::before{content:"\FC66"}.mdi-help-rhombus::before{content:"\FB81"}.mdi-help-rhombus-outline::before{content:"\FB82"}.mdi-hexagon::before{content:"\F2D8"}.mdi-hexagon-multiple::before{content:"\F6E0"}.mdi-hexagon-outline::before{content:"\F2D9"}.mdi-hexagon-slice-1::before{content:"\FAC2"}.mdi-hexagon-slice-2::before{content:"\FAC3"}.mdi-hexagon-slice-3::before{content:"\FAC4"}.mdi-hexagon-slice-4::before{content:"\FAC5"}.mdi-hexagon-slice-5::before{content:"\FAC6"}.mdi-hexagon-slice-6::before{content:"\FAC7"}.mdi-hexagram::before{content:"\FAC8"}.mdi-hexagram-outline::before{content:"\FAC9"}.mdi-high-definition::before{content:"\F7CE"}.mdi-high-definition-box::before{content:"\F877"}.mdi-highway::before{content:"\F5F7"}.mdi-hiking::before{content:"\FD5B"}.mdi-hinduism::before{content:"\F972"}.mdi-history::before{content:"\F2DA"}.mdi-hockey-puck::before{content:"\F878"}.mdi-hockey-sticks::before{content:"\F879"}.mdi-hololens::before{content:"\F2DB"}.mdi-home::before{content:"\F2DC"}.mdi-home-account::before{content:"\F825"}.mdi-home-alert::before{content:"\F87A"}.mdi-home-analytics::before{content:"\FED7"}.mdi-home-assistant::before{content:"\F7CF"}.mdi-home-automation::before{content:"\F7D0"}.mdi-home-circle::before{content:"\F7D1"}.mdi-home-city::before{content:"\FCF1"}.mdi-home-city-outline::before{content:"\FCF2"}.mdi-home-currency-usd::before{content:"\F8AE"}.mdi-home-export-outline::before{content:"\FFB8"}.mdi-home-flood::before{content:"\FF17"}.mdi-home-floor-0::before{content:"\FDAE"}.mdi-home-floor-1::before{content:"\FD5C"}.mdi-home-floor-2::before{content:"\FD5D"}.mdi-home-floor-3::before{content:"\FD5E"}.mdi-home-floor-a::before{content:"\FD5F"}.mdi-home-floor-b::before{content:"\FD60"}.mdi-home-floor-g::before{content:"\FD61"}.mdi-home-floor-l::before{content:"\FD62"}.mdi-home-floor-negative-1::before{content:"\FDAF"}.mdi-home-group::before{content:"\FDB0"}.mdi-home-heart::before{content:"\F826"}.mdi-home-import-outline::before{content:"\FFB9"}.mdi-home-lock::before{content:"\F8EA"}.mdi-home-lock-open::before{content:"\F8EB"}.mdi-home-map-marker::before{content:"\F5F8"}.mdi-home-minus::before{content:"\F973"}.mdi-home-modern::before{content:"\F2DD"}.mdi-home-outline::before{content:"\F6A0"}.mdi-home-plus::before{content:"\F974"}.mdi-home-thermometer::before{content:"\FF71"}.mdi-home-thermometer-outline::before{content:"\FF72"}.mdi-home-variant::before{content:"\F2DE"}.mdi-home-variant-outline::before{content:"\FB83"}.mdi-hook::before{content:"\F6E1"}.mdi-hook-off::before{content:"\F6E2"}.mdi-hops::before{content:"\F2DF"}.mdi-horseshoe::before{content:"\FA57"}.mdi-hospital::before{content:"\F2E0"}.mdi-hospital-building::before{content:"\F2E1"}.mdi-hospital-marker::before{content:"\F2E2"}.mdi-hot-tub::before{content:"\F827"}.mdi-hotel::before{content:"\F2E3"}.mdi-houzz::before{content:"\F2E4"}.mdi-houzz-box::before{content:"\F2E5"}.mdi-hubspot::before{content:"\FCF3"}.mdi-hulu::before{content:"\F828"}.mdi-human::before{content:"\F2E6"}.mdi-human-child::before{content:"\F2E7"}.mdi-human-female::before{content:"\F649"}.mdi-human-female-boy::before{content:"\FA58"}.mdi-human-female-female::before{content:"\FA59"}.mdi-human-female-girl::before{content:"\FA5A"}.mdi-human-greeting::before{content:"\F64A"}.mdi-human-handsdown::before{content:"\F64B"}.mdi-human-handsup::before{content:"\F64C"}.mdi-human-male::before{content:"\F64D"}.mdi-human-male-boy::before{content:"\FA5B"}.mdi-human-male-female::before{content:"\F2E8"}.mdi-human-male-girl::before{content:"\FA5C"}.mdi-human-male-height::before{content:"\FF18"}.mdi-human-male-height-variant::before{content:"\FF19"}.mdi-human-male-male::before{content:"\FA5D"}.mdi-human-pregnant::before{content:"\F5CF"}.mdi-humble-bundle::before{content:"\F743"}.mdi-ice-cream::before{content:"\F829"}.mdi-ice-pop::before{content:"\FF1A"}.mdi-identifier::before{content:"\FF1B"}.mdi-iframe::before{content:"\FC67"}.mdi-iframe-outline::before{content:"\FC68"}.mdi-image::before{content:"\F2E9"}.mdi-image-album::before{content:"\F2EA"}.mdi-image-area::before{content:"\F2EB"}.mdi-image-area-close::before{content:"\F2EC"}.mdi-image-broken::before{content:"\F2ED"}.mdi-image-broken-variant::before{content:"\F2EE"}.mdi-image-filter::before{content:"\F2EF"}.mdi-image-filter-black-white::before{content:"\F2F0"}.mdi-image-filter-center-focus::before{content:"\F2F1"}.mdi-image-filter-center-focus-strong::before{content:"\FF1C"}.mdi-image-filter-center-focus-strong-outline::before{content:"\FF1D"}.mdi-image-filter-center-focus-weak::before{content:"\F2F2"}.mdi-image-filter-drama::before{content:"\F2F3"}.mdi-image-filter-frames::before{content:"\F2F4"}.mdi-image-filter-hdr::before{content:"\F2F5"}.mdi-image-filter-none::before{content:"\F2F6"}.mdi-image-filter-tilt-shift::before{content:"\F2F7"}.mdi-image-filter-vintage::before{content:"\F2F8"}.mdi-image-frame::before{content:"\FE8A"}.mdi-image-move::before{content:"\F9F7"}.mdi-image-multiple::before{content:"\F2F9"}.mdi-image-off::before{content:"\F82A"}.mdi-image-outline::before{content:"\F975"}.mdi-image-plus::before{content:"\F87B"}.mdi-image-search::before{content:"\F976"}.mdi-image-search-outline::before{content:"\F977"}.mdi-image-size-select-actual::before{content:"\FC69"}.mdi-image-size-select-large::before{content:"\FC6A"}.mdi-image-size-select-small::before{content:"\FC6B"}.mdi-import::before{content:"\F2FA"}.mdi-inbox::before{content:"\F686"}.mdi-inbox-arrow-down::before{content:"\F2FB"}.mdi-inbox-arrow-up::before{content:"\F3D1"}.mdi-inbox-multiple::before{content:"\F8AF"}.mdi-inbox-multiple-outline::before{content:"\FB84"}.mdi-incognito::before{content:"\F5F9"}.mdi-infinity::before{content:"\F6E3"}.mdi-information::before{content:"\F2FC"}.mdi-information-outline::before{content:"\F2FD"}.mdi-information-variant::before{content:"\F64E"}.mdi-instagram::before{content:"\F2FE"}.mdi-instapaper::before{content:"\F2FF"}.mdi-internet-explorer::before{content:"\F300"}.mdi-invert-colors::before{content:"\F301"}.mdi-invert-colors-off::before{content:"\FE8B"}.mdi-ip::before{content:"\FA5E"}.mdi-ip-network::before{content:"\FA5F"}.mdi-ip-network-outline::before{content:"\FC6C"}.mdi-ipod::before{content:"\FC6D"}.mdi-islam::before{content:"\F978"}.mdi-itunes::before{content:"\F676"}.mdi-jabber::before{content:"\FDB1"}.mdi-jeepney::before{content:"\F302"}.mdi-jellyfish::before{content:"\FF1E"}.mdi-jellyfish-outline::before{content:"\FF1F"}.mdi-jira::before{content:"\F303"}.mdi-jquery::before{content:"\F87C"}.mdi-jsfiddle::before{content:"\F304"}.mdi-json::before{content:"\F626"}.mdi-judaism::before{content:"\F979"}.mdi-kabaddi::before{content:"\FD63"}.mdi-karate::before{content:"\F82B"}.mdi-keg::before{content:"\F305"}.mdi-kettle::before{content:"\F5FA"}.mdi-kettle-outline::before{content:"\FF73"}.mdi-key::before{content:"\F306"}.mdi-key-change::before{content:"\F307"}.mdi-key-minus::before{content:"\F308"}.mdi-key-outline::before{content:"\FDB2"}.mdi-key-plus::before{content:"\F309"}.mdi-key-remove::before{content:"\F30A"}.mdi-key-variant::before{content:"\F30B"}.mdi-keyboard::before{content:"\F30C"}.mdi-keyboard-backspace::before{content:"\F30D"}.mdi-keyboard-caps::before{content:"\F30E"}.mdi-keyboard-close::before{content:"\F30F"}.mdi-keyboard-off::before{content:"\F310"}.mdi-keyboard-off-outline::before{content:"\FE8C"}.mdi-keyboard-outline::before{content:"\F97A"}.mdi-keyboard-return::before{content:"\F311"}.mdi-keyboard-settings::before{content:"\F9F8"}.mdi-keyboard-settings-outline::before{content:"\F9F9"}.mdi-keyboard-tab::before{content:"\F312"}.mdi-keyboard-variant::before{content:"\F313"}.mdi-kickstarter::before{content:"\F744"}.mdi-knife::before{content:"\F9FA"}.mdi-knife-military::before{content:"\F9FB"}.mdi-kodi::before{content:"\F314"}.mdi-label::before{content:"\F315"}.mdi-label-off::before{content:"\FACA"}.mdi-label-off-outline::before{content:"\FACB"}.mdi-label-outline::before{content:"\F316"}.mdi-label-variant::before{content:"\FACC"}.mdi-label-variant-outline::before{content:"\FACD"}.mdi-ladybug::before{content:"\F82C"}.mdi-lambda::before{content:"\F627"}.mdi-lamp::before{content:"\F6B4"}.mdi-lan::before{content:"\F317"}.mdi-lan-connect::before{content:"\F318"}.mdi-lan-disconnect::before{content:"\F319"}.mdi-lan-pending::before{content:"\F31A"}.mdi-language-c::before{content:"\F671"}.mdi-language-cpp::before{content:"\F672"}.mdi-language-csharp::before{content:"\F31B"}.mdi-language-css3::before{content:"\F31C"}.mdi-language-go::before{content:"\F7D2"}.mdi-language-haskell::before{content:"\FC6E"}.mdi-language-html5::before{content:"\F31D"}.mdi-language-java::before{content:"\FB1C"}.mdi-language-javascript::before{content:"\F31E"}.mdi-language-lua::before{content:"\F8B0"}.mdi-language-php::before{content:"\F31F"}.mdi-language-python::before{content:"\F320"}.mdi-language-python-text::before{content:"\F321"}.mdi-language-r::before{content:"\F7D3"}.mdi-language-ruby-on-rails::before{content:"\FACE"}.mdi-language-swift::before{content:"\F6E4"}.mdi-language-typescript::before{content:"\F6E5"}.mdi-laptop::before{content:"\F322"}.mdi-laptop-chromebook::before{content:"\F323"}.mdi-laptop-mac::before{content:"\F324"}.mdi-laptop-off::before{content:"\F6E6"}.mdi-laptop-windows::before{content:"\F325"}.mdi-laravel::before{content:"\FACF"}.mdi-lasso::before{content:"\FF20"}.mdi-lastfm::before{content:"\F326"}.mdi-lastpass::before{content:"\F446"}.mdi-latitude::before{content:"\FF74"}.mdi-launch::before{content:"\F327"}.mdi-lava-lamp::before{content:"\F7D4"}.mdi-layers::before{content:"\F328"}.mdi-layers-minus::before{content:"\FE8D"}.mdi-layers-off::before{content:"\F329"}.mdi-layers-off-outline::before{content:"\F9FC"}.mdi-layers-outline::before{content:"\F9FD"}.mdi-layers-plus::before{content:"\FE30"}.mdi-layers-remove::before{content:"\FE31"}.mdi-layers-triple::before{content:"\FF75"}.mdi-layers-triple-outline::before{content:"\FF76"}.mdi-lead-pencil::before{content:"\F64F"}.mdi-leaf::before{content:"\F32A"}.mdi-leaf-maple::before{content:"\FC6F"}.mdi-leak::before{content:"\FDB3"}.mdi-leak-off::before{content:"\FDB4"}.mdi-led-off::before{content:"\F32B"}.mdi-led-on::before{content:"\F32C"}.mdi-led-outline::before{content:"\F32D"}.mdi-led-strip::before{content:"\F7D5"}.mdi-led-variant-off::before{content:"\F32E"}.mdi-led-variant-on::before{content:"\F32F"}.mdi-led-variant-outline::before{content:"\F330"}.mdi-less-than::before{content:"\F97B"}.mdi-less-than-or-equal::before{content:"\F97C"}.mdi-library::before{content:"\F331"}.mdi-library-books::before{content:"\F332"}.mdi-library-movie::before{content:"\FCF4"}.mdi-library-music::before{content:"\F333"}.mdi-library-music-outline::before{content:"\FF21"}.mdi-library-plus::before{content:"\F334"}.mdi-library-shelves::before{content:"\FB85"}.mdi-library-video::before{content:"\FCF5"}.mdi-lifebuoy::before{content:"\F87D"}.mdi-light-switch::before{content:"\F97D"}.mdi-lightbulb::before{content:"\F335"}.mdi-lightbulb-off::before{content:"\FE32"}.mdi-lightbulb-off-outline::before{content:"\FE33"}.mdi-lightbulb-on::before{content:"\F6E7"}.mdi-lightbulb-on-outline::before{content:"\F6E8"}.mdi-lightbulb-outline::before{content:"\F336"}.mdi-lighthouse::before{content:"\F9FE"}.mdi-lighthouse-on::before{content:"\F9FF"}.mdi-link::before{content:"\F337"}.mdi-link-box::before{content:"\FCF6"}.mdi-link-box-outline::before{content:"\FCF7"}.mdi-link-box-variant::before{content:"\FCF8"}.mdi-link-box-variant-outline::before{content:"\FCF9"}.mdi-link-off::before{content:"\F338"}.mdi-link-plus::before{content:"\FC70"}.mdi-link-variant::before{content:"\F339"}.mdi-link-variant-off::before{content:"\F33A"}.mdi-linkedin::before{content:"\F33B"}.mdi-linkedin-box::before{content:"\F33C"}.mdi-linux::before{content:"\F33D"}.mdi-linux-mint::before{content:"\F8EC"}.mdi-litecoin::before{content:"\FA60"}.mdi-loading::before{content:"\F771"}.mdi-lock::before{content:"\F33E"}.mdi-lock-alert::before{content:"\F8ED"}.mdi-lock-clock::before{content:"\F97E"}.mdi-lock-open::before{content:"\F33F"}.mdi-lock-open-outline::before{content:"\F340"}.mdi-lock-outline::before{content:"\F341"}.mdi-lock-pattern::before{content:"\F6E9"}.mdi-lock-plus::before{content:"\F5FB"}.mdi-lock-question::before{content:"\F8EE"}.mdi-lock-reset::before{content:"\F772"}.mdi-lock-smart::before{content:"\F8B1"}.mdi-locker::before{content:"\F7D6"}.mdi-locker-multiple::before{content:"\F7D7"}.mdi-login::before{content:"\F342"}.mdi-login-variant::before{content:"\F5FC"}.mdi-logout::before{content:"\F343"}.mdi-logout-variant::before{content:"\F5FD"}.mdi-longitude::before{content:"\FF77"}.mdi-looks::before{content:"\F344"}.mdi-loop::before{content:"\F6EA"}.mdi-loupe::before{content:"\F345"}.mdi-lumx::before{content:"\F346"}.mdi-lyft::before{content:"\FB1D"}.mdi-magnet::before{content:"\F347"}.mdi-magnet-on::before{content:"\F348"}.mdi-magnify::before{content:"\F349"}.mdi-magnify-close::before{content:"\F97F"}.mdi-magnify-minus::before{content:"\F34A"}.mdi-magnify-minus-cursor::before{content:"\FA61"}.mdi-magnify-minus-outline::before{content:"\F6EB"}.mdi-magnify-plus::before{content:"\F34B"}.mdi-magnify-plus-cursor::before{content:"\FA62"}.mdi-magnify-plus-outline::before{content:"\F6EC"}.mdi-mail::before{content:"\FED8"}.mdi-mail-ru::before{content:"\F34C"}.mdi-mailbox::before{content:"\F6ED"}.mdi-mailbox-open::before{content:"\FD64"}.mdi-mailbox-open-outline::before{content:"\FD65"}.mdi-mailbox-open-up::before{content:"\FD66"}.mdi-mailbox-open-up-outline::before{content:"\FD67"}.mdi-mailbox-outline::before{content:"\FD68"}.mdi-mailbox-up::before{content:"\FD69"}.mdi-mailbox-up-outline::before{content:"\FD6A"}.mdi-map::before{content:"\F34D"}.mdi-map-check::before{content:"\FED9"}.mdi-map-check-outline::before{content:"\FEDA"}.mdi-map-clock::before{content:"\FCFA"}.mdi-map-clock-outline::before{content:"\FCFB"}.mdi-map-legend::before{content:"\FA00"}.mdi-map-marker::before{content:"\F34E"}.mdi-map-marker-alert::before{content:"\FF22"}.mdi-map-marker-alert-outline::before{content:"\FF23"}.mdi-map-marker-check::before{content:"\FC71"}.mdi-map-marker-circle::before{content:"\F34F"}.mdi-map-marker-distance::before{content:"\F8EF"}.mdi-map-marker-minus::before{content:"\F650"}.mdi-map-marker-multiple::before{content:"\F350"}.mdi-map-marker-off::before{content:"\F351"}.mdi-map-marker-outline::before{content:"\F7D8"}.mdi-map-marker-path::before{content:"\FCFC"}.mdi-map-marker-plus::before{content:"\F651"}.mdi-map-marker-question::before{content:"\FF24"}.mdi-map-marker-question-outline::before{content:"\FF25"}.mdi-map-marker-radius::before{content:"\F352"}.mdi-map-marker-remove::before{content:"\FF26"}.mdi-map-marker-remove-variant::before{content:"\FF27"}.mdi-map-minus::before{content:"\F980"}.mdi-map-outline::before{content:"\F981"}.mdi-map-plus::before{content:"\F982"}.mdi-map-search::before{content:"\F983"}.mdi-map-search-outline::before{content:"\F984"}.mdi-mapbox::before{content:"\FB86"}.mdi-margin::before{content:"\F353"}.mdi-markdown::before{content:"\F354"}.mdi-markdown-outline::before{content:"\FF78"}.mdi-marker::before{content:"\F652"}.mdi-marker-cancel::before{content:"\FDB5"}.mdi-marker-check::before{content:"\F355"}.mdi-mastodon::before{content:"\FAD0"}.mdi-mastodon-variant::before{content:"\FAD1"}.mdi-material-design::before{content:"\F985"}.mdi-material-ui::before{content:"\F357"}.mdi-math-compass::before{content:"\F358"}.mdi-math-cos::before{content:"\FC72"}.mdi-math-sin::before{content:"\FC73"}.mdi-math-tan::before{content:"\FC74"}.mdi-matrix::before{content:"\F628"}.mdi-maxcdn::before{content:"\F359"}.mdi-medal::before{content:"\F986"}.mdi-medical-bag::before{content:"\F6EE"}.mdi-medium::before{content:"\F35A"}.mdi-meetup::before{content:"\FAD2"}.mdi-memory::before{content:"\F35B"}.mdi-menu::before{content:"\F35C"}.mdi-menu-down::before{content:"\F35D"}.mdi-menu-down-outline::before{content:"\F6B5"}.mdi-menu-left::before{content:"\F35E"}.mdi-menu-left-outline::before{content:"\FA01"}.mdi-menu-open::before{content:"\FB87"}.mdi-menu-right::before{content:"\F35F"}.mdi-menu-right-outline::before{content:"\FA02"}.mdi-menu-swap::before{content:"\FA63"}.mdi-menu-swap-outline::before{content:"\FA64"}.mdi-menu-up::before{content:"\F360"}.mdi-menu-up-outline::before{content:"\F6B6"}.mdi-merge::before{content:"\FF79"}.mdi-message::before{content:"\F361"}.mdi-message-alert::before{content:"\F362"}.mdi-message-alert-outline::before{content:"\FA03"}.mdi-message-bulleted::before{content:"\F6A1"}.mdi-message-bulleted-off::before{content:"\F6A2"}.mdi-message-draw::before{content:"\F363"}.mdi-message-image::before{content:"\F364"}.mdi-message-outline::before{content:"\F365"}.mdi-message-plus::before{content:"\F653"}.mdi-message-processing::before{content:"\F366"}.mdi-message-reply::before{content:"\F367"}.mdi-message-reply-text::before{content:"\F368"}.mdi-message-settings::before{content:"\F6EF"}.mdi-message-settings-variant::before{content:"\F6F0"}.mdi-message-text::before{content:"\F369"}.mdi-message-text-outline::before{content:"\F36A"}.mdi-message-video::before{content:"\F36B"}.mdi-meteor::before{content:"\F629"}.mdi-metronome::before{content:"\F7D9"}.mdi-metronome-tick::before{content:"\F7DA"}.mdi-micro-sd::before{content:"\F7DB"}.mdi-microphone::before{content:"\F36C"}.mdi-microphone-minus::before{content:"\F8B2"}.mdi-microphone-off::before{content:"\F36D"}.mdi-microphone-outline::before{content:"\F36E"}.mdi-microphone-plus::before{content:"\F8B3"}.mdi-microphone-settings::before{content:"\F36F"}.mdi-microphone-variant::before{content:"\F370"}.mdi-microphone-variant-off::before{content:"\F371"}.mdi-microscope::before{content:"\F654"}.mdi-microsoft::before{content:"\F372"}.mdi-microsoft-dynamics::before{content:"\F987"}.mdi-microwave::before{content:"\FC75"}.mdi-middleware::before{content:"\FF7A"}.mdi-middleware-outline::before{content:"\FF7B"}.mdi-midi::before{content:"\F8F0"}.mdi-midi-port::before{content:"\F8F1"}.mdi-mine::before{content:"\FDB6"}.mdi-minecraft::before{content:"\F373"}.mdi-mini-sd::before{content:"\FA04"}.mdi-minidisc::before{content:"\FA05"}.mdi-minus::before{content:"\F374"}.mdi-minus-box::before{content:"\F375"}.mdi-minus-box-outline::before{content:"\F6F1"}.mdi-minus-circle::before{content:"\F376"}.mdi-minus-circle-outline::before{content:"\F377"}.mdi-minus-network::before{content:"\F378"}.mdi-minus-network-outline::before{content:"\FC76"}.mdi-mixcloud::before{content:"\F62A"}.mdi-mixed-martial-arts::before{content:"\FD6B"}.mdi-mixed-reality::before{content:"\F87E"}.mdi-mixer::before{content:"\F7DC"}.mdi-molecule::before{content:"\FB88"}.mdi-monitor::before{content:"\F379"}.mdi-monitor-cellphone::before{content:"\F988"}.mdi-monitor-cellphone-star::before{content:"\F989"}.mdi-monitor-dashboard::before{content:"\FA06"}.mdi-monitor-lock::before{content:"\FDB7"}.mdi-monitor-multiple::before{content:"\F37A"}.mdi-monitor-off::before{content:"\FD6C"}.mdi-monitor-screenshot::before{content:"\FE34"}.mdi-monitor-speaker::before{content:"\FF7C"}.mdi-monitor-speaker-off::before{content:"\FF7D"}.mdi-monitor-star::before{content:"\FDB8"}.mdi-moon-first-quarter::before{content:"\FF7E"}.mdi-moon-full::before{content:"\FF7F"}.mdi-moon-last-quarter::before{content:"\FF80"}.mdi-moon-new::before{content:"\FF81"}.mdi-moon-waning-crescent::before{content:"\FF82"}.mdi-moon-waning-gibbous::before{content:"\FF83"}.mdi-moon-waxing-crescent::before{content:"\FF84"}.mdi-moon-waxing-gibbous::before{content:"\FF85"}.mdi-more::before{content:"\F37B"}.mdi-mother-nurse::before{content:"\FCFD"}.mdi-motion-sensor::before{content:"\FD6D"}.mdi-motorbike::before{content:"\F37C"}.mdi-mouse::before{content:"\F37D"}.mdi-mouse-bluetooth::before{content:"\F98A"}.mdi-mouse-off::before{content:"\F37E"}.mdi-mouse-variant::before{content:"\F37F"}.mdi-mouse-variant-off::before{content:"\F380"}.mdi-move-resize::before{content:"\F655"}.mdi-move-resize-variant::before{content:"\F656"}.mdi-movie::before{content:"\F381"}.mdi-movie-outline::before{content:"\FDB9"}.mdi-movie-roll::before{content:"\F7DD"}.mdi-muffin::before{content:"\F98B"}.mdi-multiplication::before{content:"\F382"}.mdi-multiplication-box::before{content:"\F383"}.mdi-mushroom::before{content:"\F7DE"}.mdi-mushroom-outline::before{content:"\F7DF"}.mdi-music::before{content:"\F759"}.mdi-music-accidental-double-flat::before{content:"\FF86"}.mdi-music-accidental-double-sharp::before{content:"\FF87"}.mdi-music-accidental-flat::before{content:"\FF88"}.mdi-music-accidental-natural::before{content:"\FF89"}.mdi-music-accidental-sharp::before{content:"\FF8A"}.mdi-music-box::before{content:"\F384"}.mdi-music-box-outline::before{content:"\F385"}.mdi-music-circle::before{content:"\F386"}.mdi-music-circle-outline::before{content:"\FAD3"}.mdi-music-clef-alto::before{content:"\FF8B"}.mdi-music-clef-bass::before{content:"\FF8C"}.mdi-music-clef-treble::before{content:"\FF8D"}.mdi-music-note::before{content:"\F387"}.mdi-music-note-bluetooth::before{content:"\F5FE"}.mdi-music-note-bluetooth-off::before{content:"\F5FF"}.mdi-music-note-eighth::before{content:"\F388"}.mdi-music-note-eighth-dotted::before{content:"\FF8E"}.mdi-music-note-half::before{content:"\F389"}.mdi-music-note-half-dotted::before{content:"\FF8F"}.mdi-music-note-off::before{content:"\F38A"}.mdi-music-note-off-outline::before{content:"\FF90"}.mdi-music-note-outline::before{content:"\FF91"}.mdi-music-note-plus::before{content:"\FDBA"}.mdi-music-note-quarter::before{content:"\F38B"}.mdi-music-note-quarter-dotted::before{content:"\FF92"}.mdi-music-note-sixteenth::before{content:"\F38C"}.mdi-music-note-sixteenth-dotted::before{content:"\FF93"}.mdi-music-note-whole::before{content:"\F38D"}.mdi-music-note-whole-dotted::before{content:"\FF94"}.mdi-music-off::before{content:"\F75A"}.mdi-music-rest-eighth::before{content:"\FF95"}.mdi-music-rest-half::before{content:"\FF96"}.mdi-music-rest-quarter::before{content:"\FF97"}.mdi-music-rest-sixteenth::before{content:"\FF98"}.mdi-music-rest-whole::before{content:"\FF99"}.mdi-nail::before{content:"\FDBB"}.mdi-nas::before{content:"\F8F2"}.mdi-nativescript::before{content:"\F87F"}.mdi-nature::before{content:"\F38E"}.mdi-nature-people::before{content:"\F38F"}.mdi-navigation::before{content:"\F390"}.mdi-near-me::before{content:"\F5CD"}.mdi-necklace::before{content:"\FF28"}.mdi-needle::before{content:"\F391"}.mdi-netflix::before{content:"\F745"}.mdi-network::before{content:"\F6F2"}.mdi-network-off::before{content:"\FC77"}.mdi-network-off-outline::before{content:"\FC78"}.mdi-network-outline::before{content:"\FC79"}.mdi-network-strength-1::before{content:"\F8F3"}.mdi-network-strength-1-alert::before{content:"\F8F4"}.mdi-network-strength-2::before{content:"\F8F5"}.mdi-network-strength-2-alert::before{content:"\F8F6"}.mdi-network-strength-3::before{content:"\F8F7"}.mdi-network-strength-3-alert::before{content:"\F8F8"}.mdi-network-strength-4::before{content:"\F8F9"}.mdi-network-strength-4-alert::before{content:"\F8FA"}.mdi-network-strength-off::before{content:"\F8FB"}.mdi-network-strength-off-outline::before{content:"\F8FC"}.mdi-network-strength-outline::before{content:"\F8FD"}.mdi-new-box::before{content:"\F394"}.mdi-newspaper::before{content:"\F395"}.mdi-newspaper-minus::before{content:"\FF29"}.mdi-newspaper-plus::before{content:"\FF2A"}.mdi-nfc::before{content:"\F396"}.mdi-nfc-off::before{content:"\FE35"}.mdi-nfc-search-variant::before{content:"\FE36"}.mdi-nfc-tap::before{content:"\F397"}.mdi-nfc-variant::before{content:"\F398"}.mdi-nfc-variant-off::before{content:"\FE37"}.mdi-ninja::before{content:"\F773"}.mdi-nintendo-switch::before{content:"\F7E0"}.mdi-nodejs::before{content:"\F399"}.mdi-not-equal::before{content:"\F98C"}.mdi-not-equal-variant::before{content:"\F98D"}.mdi-note::before{content:"\F39A"}.mdi-note-circle::before{content:"\FEDB"}.mdi-note-multiple::before{content:"\F6B7"}.mdi-note-multiple-outline::before{content:"\F6B8"}.mdi-note-outline::before{content:"\F39B"}.mdi-note-plus::before{content:"\F39C"}.mdi-note-plus-outline::before{content:"\F39D"}.mdi-note-text::before{content:"\F39E"}.mdi-notebook::before{content:"\F82D"}.mdi-notebook-multiple::before{content:"\FE38"}.mdi-notebook-outline::before{content:"\FEDC"}.mdi-notification-clear-all::before{content:"\F39F"}.mdi-npm::before{content:"\F6F6"}.mdi-npm-variant::before{content:"\F98E"}.mdi-npm-variant-outline::before{content:"\F98F"}.mdi-nuke::before{content:"\F6A3"}.mdi-null::before{content:"\F7E1"}.mdi-numeric::before{content:"\F3A0"}.mdi-numeric-0::before{content:"\30"}.mdi-numeric-0-box::before{content:"\F3A1"}.mdi-numeric-0-box-multiple::before{content:"\FF2B"}.mdi-numeric-0-box-multiple-outline::before{content:"\F3A2"}.mdi-numeric-0-box-outline::before{content:"\F3A3"}.mdi-numeric-0-circle::before{content:"\FC7A"}.mdi-numeric-0-circle-outline::before{content:"\FC7B"}.mdi-numeric-1::before{content:"\31"}.mdi-numeric-1-box::before{content:"\F3A4"}.mdi-numeric-1-box-multiple::before{content:"\FF2C"}.mdi-numeric-1-box-multiple-outline::before{content:"\F3A5"}.mdi-numeric-1-box-outline::before{content:"\F3A6"}.mdi-numeric-1-circle::before{content:"\FC7C"}.mdi-numeric-1-circle-outline::before{content:"\FC7D"}.mdi-numeric-10-box::before{content:"\FF9A"}.mdi-numeric-10-box-outline::before{content:"\FF9B"}.mdi-numeric-2::before{content:"\32"}.mdi-numeric-2-box::before{content:"\F3A7"}.mdi-numeric-2-box-multiple::before{content:"\FF2D"}.mdi-numeric-2-box-multiple-outline::before{content:"\F3A8"}.mdi-numeric-2-box-outline::before{content:"\F3A9"}.mdi-numeric-2-circle::before{content:"\FC7E"}.mdi-numeric-2-circle-outline::before{content:"\FC7F"}.mdi-numeric-3::before{content:"\33"}.mdi-numeric-3-box::before{content:"\F3AA"}.mdi-numeric-3-box-multiple::before{content:"\FF2E"}.mdi-numeric-3-box-multiple-outline::before{content:"\F3AB"}.mdi-numeric-3-box-outline::before{content:"\F3AC"}.mdi-numeric-3-circle::before{content:"\FC80"}.mdi-numeric-3-circle-outline::before{content:"\FC81"}.mdi-numeric-4::before{content:"\34"}.mdi-numeric-4-box::before{content:"\F3AD"}.mdi-numeric-4-box-multiple::before{content:"\FF2F"}.mdi-numeric-4-box-multiple-outline::before{content:"\F3AE"}.mdi-numeric-4-box-outline::before{content:"\F3AF"}.mdi-numeric-4-circle::before{content:"\FC82"}.mdi-numeric-4-circle-outline::before{content:"\FC83"}.mdi-numeric-5::before{content:"\35"}.mdi-numeric-5-box::before{content:"\F3B0"}.mdi-numeric-5-box-multiple::before{content:"\FF30"}.mdi-numeric-5-box-multiple-outline::before{content:"\F3B1"}.mdi-numeric-5-box-outline::before{content:"\F3B2"}.mdi-numeric-5-circle::before{content:"\FC84"}.mdi-numeric-5-circle-outline::before{content:"\FC85"}.mdi-numeric-6::before{content:"\36"}.mdi-numeric-6-box::before{content:"\F3B3"}.mdi-numeric-6-box-multiple::before{content:"\FF31"}.mdi-numeric-6-box-multiple-outline::before{content:"\F3B4"}.mdi-numeric-6-box-outline::before{content:"\F3B5"}.mdi-numeric-6-circle::before{content:"\FC86"}.mdi-numeric-6-circle-outline::before{content:"\FC87"}.mdi-numeric-7::before{content:"\37"}.mdi-numeric-7-box::before{content:"\F3B6"}.mdi-numeric-7-box-multiple::before{content:"\FF32"}.mdi-numeric-7-box-multiple-outline::before{content:"\F3B7"}.mdi-numeric-7-box-outline::before{content:"\F3B8"}.mdi-numeric-7-circle::before{content:"\FC88"}.mdi-numeric-7-circle-outline::before{content:"\FC89"}.mdi-numeric-8::before{content:"\38"}.mdi-numeric-8-box::before{content:"\F3B9"}.mdi-numeric-8-box-multiple::before{content:"\FF33"}.mdi-numeric-8-box-multiple-outline::before{content:"\F3BA"}.mdi-numeric-8-box-outline::before{content:"\F3BB"}.mdi-numeric-8-circle::before{content:"\FC8A"}.mdi-numeric-8-circle-outline::before{content:"\FC8B"}.mdi-numeric-9::before{content:"\39"}.mdi-numeric-9-box::before{content:"\F3BC"}.mdi-numeric-9-box-multiple::before{content:"\FF34"}.mdi-numeric-9-box-multiple-outline::before{content:"\F3BD"}.mdi-numeric-9-box-outline::before{content:"\F3BE"}.mdi-numeric-9-circle::before{content:"\FC8C"}.mdi-numeric-9-circle-outline::before{content:"\FC8D"}.mdi-numeric-9-plus-box::before{content:"\F3BF"}.mdi-numeric-9-plus-box-multiple::before{content:"\FF35"}.mdi-numeric-9-plus-box-multiple-outline::before{content:"\F3C0"}.mdi-numeric-9-plus-box-outline::before{content:"\F3C1"}.mdi-numeric-9-plus-circle::before{content:"\FC8E"}.mdi-numeric-9-plus-circle-outline::before{content:"\FC8F"}.mdi-nut::before{content:"\F6F7"}.mdi-nutrition::before{content:"\F3C2"}.mdi-oar::before{content:"\F67B"}.mdi-ocarina::before{content:"\FDBC"}.mdi-octagon::before{content:"\F3C3"}.mdi-octagon-outline::before{content:"\F3C4"}.mdi-octagram::before{content:"\F6F8"}.mdi-octagram-outline::before{content:"\F774"}.mdi-odnoklassniki::before{content:"\F3C5"}.mdi-office::before{content:"\F3C6"}.mdi-office-building::before{content:"\F990"}.mdi-oil::before{content:"\F3C7"}.mdi-oil-lamp::before{content:"\FF36"}.mdi-oil-temperature::before{content:"\F3C8"}.mdi-omega::before{content:"\F3C9"}.mdi-one-up::before{content:"\FB89"}.mdi-onedrive::before{content:"\F3CA"}.mdi-onenote::before{content:"\F746"}.mdi-onepassword::before{content:"\F880"}.mdi-opacity::before{content:"\F5CC"}.mdi-open-in-app::before{content:"\F3CB"}.mdi-open-in-new::before{content:"\F3CC"}.mdi-open-source-initiative::before{content:"\FB8A"}.mdi-openid::before{content:"\F3CD"}.mdi-opera::before{content:"\F3CE"}.mdi-orbit::before{content:"\F018"}.mdi-origin::before{content:"\FB2B"}.mdi-ornament::before{content:"\F3CF"}.mdi-ornament-variant::before{content:"\F3D0"}.mdi-outlook::before{content:"\FCFE"}.mdi-owl::before{content:"\F3D2"}.mdi-pac-man::before{content:"\FB8B"}.mdi-package::before{content:"\F3D3"}.mdi-package-down::before{content:"\F3D4"}.mdi-package-up::before{content:"\F3D5"}.mdi-package-variant::before{content:"\F3D6"}.mdi-package-variant-closed::before{content:"\F3D7"}.mdi-page-first::before{content:"\F600"}.mdi-page-last::before{content:"\F601"}.mdi-page-layout-body::before{content:"\F6F9"}.mdi-page-layout-footer::before{content:"\F6FA"}.mdi-page-layout-header::before{content:"\F6FB"}.mdi-page-layout-header-footer::before{content:"\FF9C"}.mdi-page-layout-sidebar-left::before{content:"\F6FC"}.mdi-page-layout-sidebar-right::before{content:"\F6FD"}.mdi-page-next::before{content:"\FB8C"}.mdi-page-next-outline::before{content:"\FB8D"}.mdi-page-previous::before{content:"\FB8E"}.mdi-page-previous-outline::before{content:"\FB8F"}.mdi-palette::before{content:"\F3D8"}.mdi-palette-advanced::before{content:"\F3D9"}.mdi-palette-outline::before{content:"\FE6C"}.mdi-palette-swatch::before{content:"\F8B4"}.mdi-pan::before{content:"\FB90"}.mdi-pan-bottom-left::before{content:"\FB91"}.mdi-pan-bottom-right::before{content:"\FB92"}.mdi-pan-down::before{content:"\FB93"}.mdi-pan-horizontal::before{content:"\FB94"}.mdi-pan-left::before{content:"\FB95"}.mdi-pan-right::before{content:"\FB96"}.mdi-pan-top-left::before{content:"\FB97"}.mdi-pan-top-right::before{content:"\FB98"}.mdi-pan-up::before{content:"\FB99"}.mdi-pan-vertical::before{content:"\FB9A"}.mdi-panda::before{content:"\F3DA"}.mdi-pandora::before{content:"\F3DB"}.mdi-panorama::before{content:"\F3DC"}.mdi-panorama-fisheye::before{content:"\F3DD"}.mdi-panorama-horizontal::before{content:"\F3DE"}.mdi-panorama-vertical::before{content:"\F3DF"}.mdi-panorama-wide-angle::before{content:"\F3E0"}.mdi-paper-cut-vertical::before{content:"\F3E1"}.mdi-paperclip::before{content:"\F3E2"}.mdi-parachute::before{content:"\FC90"}.mdi-parachute-outline::before{content:"\FC91"}.mdi-parking::before{content:"\F3E3"}.mdi-passport::before{content:"\F7E2"}.mdi-passport-biometric::before{content:"\FDBD"}.mdi-patio-heater::before{content:"\FF9D"}.mdi-patreon::before{content:"\F881"}.mdi-pause::before{content:"\F3E4"}.mdi-pause-circle::before{content:"\F3E5"}.mdi-pause-circle-outline::before{content:"\F3E6"}.mdi-pause-octagon::before{content:"\F3E7"}.mdi-pause-octagon-outline::before{content:"\F3E8"}.mdi-paw::before{content:"\F3E9"}.mdi-paw-off::before{content:"\F657"}.mdi-paypal::before{content:"\F882"}.mdi-pdf-box::before{content:"\FE39"}.mdi-peace::before{content:"\F883"}.mdi-pen::before{content:"\F3EA"}.mdi-pen-lock::before{content:"\FDBE"}.mdi-pen-minus::before{content:"\FDBF"}.mdi-pen-off::before{content:"\FDC0"}.mdi-pen-plus::before{content:"\FDC1"}.mdi-pen-remove::before{content:"\FDC2"}.mdi-pencil::before{content:"\F3EB"}.mdi-pencil-box::before{content:"\F3EC"}.mdi-pencil-box-outline::before{content:"\F3ED"}.mdi-pencil-circle::before{content:"\F6FE"}.mdi-pencil-circle-outline::before{content:"\F775"}.mdi-pencil-lock::before{content:"\F3EE"}.mdi-pencil-lock-outline::before{content:"\FDC3"}.mdi-pencil-minus::before{content:"\FDC4"}.mdi-pencil-minus-outline::before{content:"\FDC5"}.mdi-pencil-off::before{content:"\F3EF"}.mdi-pencil-off-outline::before{content:"\FDC6"}.mdi-pencil-outline::before{content:"\FC92"}.mdi-pencil-plus::before{content:"\FDC7"}.mdi-pencil-plus-outline::before{content:"\FDC8"}.mdi-pencil-remove::before{content:"\FDC9"}.mdi-pencil-remove-outline::before{content:"\FDCA"}.mdi-penguin::before{content:"\FEDD"}.mdi-pentagon::before{content:"\F6FF"}.mdi-pentagon-outline::before{content:"\F700"}.mdi-percent::before{content:"\F3F0"}.mdi-periodic-table::before{content:"\F8B5"}.mdi-periodic-table-co2::before{content:"\F7E3"}.mdi-periscope::before{content:"\F747"}.mdi-perspective-less::before{content:"\FCFF"}.mdi-perspective-more::before{content:"\FD00"}.mdi-pharmacy::before{content:"\F3F1"}.mdi-phone::before{content:"\F3F2"}.mdi-phone-alert::before{content:"\FF37"}.mdi-phone-bluetooth::before{content:"\F3F3"}.mdi-phone-classic::before{content:"\F602"}.mdi-phone-forward::before{content:"\F3F4"}.mdi-phone-hangup::before{content:"\F3F5"}.mdi-phone-in-talk::before{content:"\F3F6"}.mdi-phone-incoming::before{content:"\F3F7"}.mdi-phone-lock::before{content:"\F3F8"}.mdi-phone-log::before{content:"\F3F9"}.mdi-phone-minus::before{content:"\F658"}.mdi-phone-missed::before{content:"\F3FA"}.mdi-phone-off::before{content:"\FDCB"}.mdi-phone-outgoing::before{content:"\F3FB"}.mdi-phone-outline::before{content:"\FDCC"}.mdi-phone-paused::before{content:"\F3FC"}.mdi-phone-plus::before{content:"\F659"}.mdi-phone-return::before{content:"\F82E"}.mdi-phone-rotate-landscape::before{content:"\F884"}.mdi-phone-rotate-portrait::before{content:"\F885"}.mdi-phone-settings::before{content:"\F3FD"}.mdi-phone-voip::before{content:"\F3FE"}.mdi-pi::before{content:"\F3FF"}.mdi-pi-box::before{content:"\F400"}.mdi-pi-hole::before{content:"\FDCD"}.mdi-piano::before{content:"\F67C"}.mdi-pickaxe::before{content:"\F8B6"}.mdi-picture-in-picture-bottom-right::before{content:"\FE3A"}.mdi-picture-in-picture-bottom-right-outline::before{content:"\FE3B"}.mdi-picture-in-picture-top-right::before{content:"\FE3C"}.mdi-picture-in-picture-top-right-outline::before{content:"\FE3D"}.mdi-pier::before{content:"\F886"}.mdi-pier-crane::before{content:"\F887"}.mdi-pig::before{content:"\F401"}.mdi-pill::before{content:"\F402"}.mdi-pillar::before{content:"\F701"}.mdi-pin::before{content:"\F403"}.mdi-pin-off::before{content:"\F404"}.mdi-pin-off-outline::before{content:"\F92F"}.mdi-pin-outline::before{content:"\F930"}.mdi-pine-tree::before{content:"\F405"}.mdi-pine-tree-box::before{content:"\F406"}.mdi-pinterest::before{content:"\F407"}.mdi-pinterest-box::before{content:"\F408"}.mdi-pinwheel::before{content:"\FAD4"}.mdi-pinwheel-outline::before{content:"\FAD5"}.mdi-pipe::before{content:"\F7E4"}.mdi-pipe-disconnected::before{content:"\F7E5"}.mdi-pipe-leak::before{content:"\F888"}.mdi-pirate::before{content:"\FA07"}.mdi-pistol::before{content:"\F702"}.mdi-piston::before{content:"\F889"}.mdi-pizza::before{content:"\F409"}.mdi-play::before{content:"\F40A"}.mdi-play-box-outline::before{content:"\F40B"}.mdi-play-circle::before{content:"\F40C"}.mdi-play-circle-outline::before{content:"\F40D"}.mdi-play-network::before{content:"\F88A"}.mdi-play-network-outline::before{content:"\FC93"}.mdi-play-outline::before{content:"\FF38"}.mdi-play-pause::before{content:"\F40E"}.mdi-play-protected-content::before{content:"\F40F"}.mdi-play-speed::before{content:"\F8FE"}.mdi-playlist-check::before{content:"\F5C7"}.mdi-playlist-edit::before{content:"\F8FF"}.mdi-playlist-minus::before{content:"\F410"}.mdi-playlist-music::before{content:"\FC94"}.mdi-playlist-music-outline::before{content:"\FC95"}.mdi-playlist-play::before{content:"\F411"}.mdi-playlist-plus::before{content:"\F412"}.mdi-playlist-remove::before{content:"\F413"}.mdi-playlist-star::before{content:"\FDCE"}.mdi-playstation::before{content:"\F414"}.mdi-plex::before{content:"\F6B9"}.mdi-plus::before{content:"\F415"}.mdi-plus-box::before{content:"\F416"}.mdi-plus-box-outline::before{content:"\F703"}.mdi-plus-circle::before{content:"\F417"}.mdi-plus-circle-multiple-outline::before{content:"\F418"}.mdi-plus-circle-outline::before{content:"\F419"}.mdi-plus-minus::before{content:"\F991"}.mdi-plus-minus-box::before{content:"\F992"}.mdi-plus-network::before{content:"\F41A"}.mdi-plus-network-outline::before{content:"\FC96"}.mdi-plus-one::before{content:"\F41B"}.mdi-plus-outline::before{content:"\F704"}.mdi-pocket::before{content:"\F41C"}.mdi-podcast::before{content:"\F993"}.mdi-podium::before{content:"\FD01"}.mdi-podium-bronze::before{content:"\FD02"}.mdi-podium-gold::before{content:"\FD03"}.mdi-podium-silver::before{content:"\FD04"}.mdi-point-of-sale::before{content:"\FD6E"}.mdi-pokeball::before{content:"\F41D"}.mdi-pokemon-go::before{content:"\FA08"}.mdi-poker-chip::before{content:"\F82F"}.mdi-polaroid::before{content:"\F41E"}.mdi-poll::before{content:"\F41F"}.mdi-poll-box::before{content:"\F420"}.mdi-polymer::before{content:"\F421"}.mdi-pool::before{content:"\F606"}.mdi-popcorn::before{content:"\F422"}.mdi-postage-stamp::before{content:"\FC97"}.mdi-pot::before{content:"\F65A"}.mdi-pot-mix::before{content:"\F65B"}.mdi-pound::before{content:"\F423"}.mdi-pound-box::before{content:"\F424"}.mdi-power::before{content:"\F425"}.mdi-power-cycle::before{content:"\F900"}.mdi-power-off::before{content:"\F901"}.mdi-power-on::before{content:"\F902"}.mdi-power-plug::before{content:"\F6A4"}.mdi-power-plug-off::before{content:"\F6A5"}.mdi-power-settings::before{content:"\F426"}.mdi-power-sleep::before{content:"\F903"}.mdi-power-socket::before{content:"\F427"}.mdi-power-socket-au::before{content:"\F904"}.mdi-power-socket-eu::before{content:"\F7E6"}.mdi-power-socket-uk::before{content:"\F7E7"}.mdi-power-socket-us::before{content:"\F7E8"}.mdi-power-standby::before{content:"\F905"}.mdi-powershell::before{content:"\FA09"}.mdi-prescription::before{content:"\F705"}.mdi-presentation::before{content:"\F428"}.mdi-presentation-play::before{content:"\F429"}.mdi-printer::before{content:"\F42A"}.mdi-printer-3d::before{content:"\F42B"}.mdi-printer-3d-nozzle::before{content:"\FE3E"}.mdi-printer-3d-nozzle-outline::before{content:"\FE3F"}.mdi-printer-alert::before{content:"\F42C"}.mdi-printer-off::before{content:"\FE40"}.mdi-printer-settings::before{content:"\F706"}.mdi-printer-wireless::before{content:"\FA0A"}.mdi-priority-high::before{content:"\F603"}.mdi-priority-low::before{content:"\F604"}.mdi-professional-hexagon::before{content:"\F42D"}.mdi-progress-alert::before{content:"\FC98"}.mdi-progress-check::before{content:"\F994"}.mdi-progress-clock::before{content:"\F995"}.mdi-progress-download::before{content:"\F996"}.mdi-progress-upload::before{content:"\F997"}.mdi-progress-wrench::before{content:"\FC99"}.mdi-projector::before{content:"\F42E"}.mdi-projector-screen::before{content:"\F42F"}.mdi-publish::before{content:"\F6A6"}.mdi-pulse::before{content:"\F430"}.mdi-pumpkin::before{content:"\FB9B"}.mdi-purse::before{content:"\FF39"}.mdi-purse-outline::before{content:"\FF3A"}.mdi-puzzle::before{content:"\F431"}.mdi-puzzle-outline::before{content:"\FA65"}.mdi-qi::before{content:"\F998"}.mdi-qqchat::before{content:"\F605"}.mdi-qrcode::before{content:"\F432"}.mdi-qrcode-edit::before{content:"\F8B7"}.mdi-qrcode-scan::before{content:"\F433"}.mdi-quadcopter::before{content:"\F434"}.mdi-quality-high::before{content:"\F435"}.mdi-quality-low::before{content:"\FA0B"}.mdi-quality-medium::before{content:"\FA0C"}.mdi-quicktime::before{content:"\F436"}.mdi-quora::before{content:"\FD05"}.mdi-rabbit::before{content:"\F906"}.mdi-racing-helmet::before{content:"\FD6F"}.mdi-racquetball::before{content:"\FD70"}.mdi-radar::before{content:"\F437"}.mdi-radiator::before{content:"\F438"}.mdi-radiator-disabled::before{content:"\FAD6"}.mdi-radiator-off::before{content:"\FAD7"}.mdi-radio::before{content:"\F439"}.mdi-radio-am::before{content:"\FC9A"}.mdi-radio-fm::before{content:"\FC9B"}.mdi-radio-handheld::before{content:"\F43A"}.mdi-radio-tower::before{content:"\F43B"}.mdi-radioactive::before{content:"\F43C"}.mdi-radioactive-off::before{content:"\FEDE"}.mdi-radiobox-blank::before{content:"\F43D"}.mdi-radiobox-marked::before{content:"\F43E"}.mdi-radius::before{content:"\FC9C"}.mdi-radius-outline::before{content:"\FC9D"}.mdi-railroad-light::before{content:"\FF3B"}.mdi-raspberry-pi::before{content:"\F43F"}.mdi-ray-end::before{content:"\F440"}.mdi-ray-end-arrow::before{content:"\F441"}.mdi-ray-start::before{content:"\F442"}.mdi-ray-start-arrow::before{content:"\F443"}.mdi-ray-start-end::before{content:"\F444"}.mdi-ray-vertex::before{content:"\F445"}.mdi-react::before{content:"\F707"}.mdi-read::before{content:"\F447"}.mdi-receipt::before{content:"\F449"}.mdi-record::before{content:"\F44A"}.mdi-record-circle::before{content:"\FEDF"}.mdi-record-circle-outline::before{content:"\FEE0"}.mdi-record-player::before{content:"\F999"}.mdi-record-rec::before{content:"\F44B"}.mdi-rectangle::before{content:"\FE41"}.mdi-rectangle-outline::before{content:"\FE42"}.mdi-recycle::before{content:"\F44C"}.mdi-reddit::before{content:"\F44D"}.mdi-redo::before{content:"\F44E"}.mdi-redo-variant::before{content:"\F44F"}.mdi-reflect-horizontal::before{content:"\FA0D"}.mdi-reflect-vertical::before{content:"\FA0E"}.mdi-refresh::before{content:"\F450"}.mdi-regex::before{content:"\F451"}.mdi-registered-trademark::before{content:"\FA66"}.mdi-relative-scale::before{content:"\F452"}.mdi-reload::before{content:"\F453"}.mdi-reminder::before{content:"\F88B"}.mdi-remote::before{content:"\F454"}.mdi-remote-desktop::before{content:"\F8B8"}.mdi-remote-off::before{content:"\FEE1"}.mdi-remote-tv::before{content:"\FEE2"}.mdi-remote-tv-off::before{content:"\FEE3"}.mdi-rename-box::before{content:"\F455"}.mdi-reorder-horizontal::before{content:"\F687"}.mdi-reorder-vertical::before{content:"\F688"}.mdi-repeat::before{content:"\F456"}.mdi-repeat-off::before{content:"\F457"}.mdi-repeat-once::before{content:"\F458"}.mdi-replay::before{content:"\F459"}.mdi-reply::before{content:"\F45A"}.mdi-reply-all::before{content:"\F45B"}.mdi-reply-all-outline::before{content:"\FF3C"}.mdi-reply-outline::before{content:"\FF3D"}.mdi-reproduction::before{content:"\F45C"}.mdi-resistor::before{content:"\FB1F"}.mdi-resistor-nodes::before{content:"\FB20"}.mdi-resize::before{content:"\FA67"}.mdi-resize-bottom-right::before{content:"\F45D"}.mdi-responsive::before{content:"\F45E"}.mdi-restart::before{content:"\F708"}.mdi-restart-off::before{content:"\FD71"}.mdi-restore::before{content:"\F99A"}.mdi-restore-clock::before{content:"\F6A7"}.mdi-rewind::before{content:"\F45F"}.mdi-rewind-10::before{content:"\FD06"}.mdi-rewind-30::before{content:"\FD72"}.mdi-rewind-outline::before{content:"\F709"}.mdi-rhombus::before{content:"\F70A"}.mdi-rhombus-medium::before{content:"\FA0F"}.mdi-rhombus-outline::before{content:"\F70B"}.mdi-rhombus-split::before{content:"\FA10"}.mdi-ribbon::before{content:"\F460"}.mdi-rice::before{content:"\F7E9"}.mdi-ring::before{content:"\F7EA"}.mdi-rivet::before{content:"\FE43"}.mdi-road::before{content:"\F461"}.mdi-road-variant::before{content:"\F462"}.mdi-robot::before{content:"\F6A8"}.mdi-robot-industrial::before{content:"\FB21"}.mdi-robot-vacuum::before{content:"\F70C"}.mdi-robot-vacuum-variant::before{content:"\F907"}.mdi-rocket::before{content:"\F463"}.mdi-roller-skate::before{content:"\FD07"}.mdi-rollerblade::before{content:"\FD08"}.mdi-rollupjs::before{content:"\FB9C"}.mdi-room-service::before{content:"\F88C"}.mdi-room-service-outline::before{content:"\FD73"}.mdi-rotate-3d::before{content:"\FEE4"}.mdi-rotate-3d-variant::before{content:"\F464"}.mdi-rotate-left::before{content:"\F465"}.mdi-rotate-left-variant::before{content:"\F466"}.mdi-rotate-orbit::before{content:"\FD74"}.mdi-rotate-right::before{content:"\F467"}.mdi-rotate-right-variant::before{content:"\F468"}.mdi-rounded-corner::before{content:"\F607"}.mdi-router-wireless::before{content:"\F469"}.mdi-router-wireless-settings::before{content:"\FA68"}.mdi-routes::before{content:"\F46A"}.mdi-rowing::before{content:"\F608"}.mdi-rss::before{content:"\F46B"}.mdi-rss-box::before{content:"\F46C"}.mdi-rss-off::before{content:"\FF3E"}.mdi-ruby::before{content:"\FD09"}.mdi-rugby::before{content:"\FD75"}.mdi-ruler::before{content:"\F46D"}.mdi-ruler-square::before{content:"\FC9E"}.mdi-run::before{content:"\F70D"}.mdi-run-fast::before{content:"\F46E"}.mdi-sack::before{content:"\FD0A"}.mdi-sack-percent::before{content:"\FD0B"}.mdi-safe::before{content:"\FA69"}.mdi-safety-goggles::before{content:"\FD0C"}.mdi-sailing::before{content:"\FEE5"}.mdi-sale::before{content:"\F46F"}.mdi-salesforce::before{content:"\F88D"}.mdi-sass::before{content:"\F7EB"}.mdi-satellite::before{content:"\F470"}.mdi-satellite-uplink::before{content:"\F908"}.mdi-satellite-variant::before{content:"\F471"}.mdi-sausage::before{content:"\F8B9"}.mdi-saw-blade::before{content:"\FE44"}.mdi-saxophone::before{content:"\F609"}.mdi-scale::before{content:"\F472"}.mdi-scale-balance::before{content:"\F5D1"}.mdi-scale-bathroom::before{content:"\F473"}.mdi-scanner::before{content:"\F6AA"}.mdi-scanner-off::before{content:"\F909"}.mdi-scatter-plot::before{content:"\FEE6"}.mdi-scatter-plot-outline::before{content:"\FEE7"}.mdi-school::before{content:"\F474"}.mdi-scissors-cutting::before{content:"\FA6A"}.mdi-screen-rotation::before{content:"\F475"}.mdi-screen-rotation-lock::before{content:"\F476"}.mdi-screw-flat-top::before{content:"\FDCF"}.mdi-screw-lag::before{content:"\FE54"}.mdi-screw-machine-flat-top::before{content:"\FE55"}.mdi-screw-machine-round-top::before{content:"\FE56"}.mdi-screw-round-top::before{content:"\FE57"}.mdi-screwdriver::before{content:"\F477"}.mdi-script::before{content:"\FB9D"}.mdi-script-outline::before{content:"\F478"}.mdi-script-text::before{content:"\FB9E"}.mdi-script-text-outline::before{content:"\FB9F"}.mdi-sd::before{content:"\F479"}.mdi-seal::before{content:"\F47A"}.mdi-search-web::before{content:"\F70E"}.mdi-seat::before{content:"\FC9F"}.mdi-seat-flat::before{content:"\F47B"}.mdi-seat-flat-angled::before{content:"\F47C"}.mdi-seat-individual-suite::before{content:"\F47D"}.mdi-seat-legroom-extra::before{content:"\F47E"}.mdi-seat-legroom-normal::before{content:"\F47F"}.mdi-seat-legroom-reduced::before{content:"\F480"}.mdi-seat-outline::before{content:"\FCA0"}.mdi-seat-recline-extra::before{content:"\F481"}.mdi-seat-recline-normal::before{content:"\F482"}.mdi-seatbelt::before{content:"\FCA1"}.mdi-security::before{content:"\F483"}.mdi-security-network::before{content:"\F484"}.mdi-seed::before{content:"\FE45"}.mdi-seed-outline::before{content:"\FE46"}.mdi-segment::before{content:"\FEE8"}.mdi-select::before{content:"\F485"}.mdi-select-all::before{content:"\F486"}.mdi-select-color::before{content:"\FD0D"}.mdi-select-compare::before{content:"\FAD8"}.mdi-select-drag::before{content:"\FA6B"}.mdi-select-group::before{content:"\FF9F"}.mdi-select-inverse::before{content:"\F487"}.mdi-select-off::before{content:"\F488"}.mdi-selection::before{content:"\F489"}.mdi-selection-drag::before{content:"\FA6C"}.mdi-selection-ellipse::before{content:"\FD0E"}.mdi-selection-ellipse-arrow-inside::before{content:"\FF3F"}.mdi-selection-off::before{content:"\F776"}.mdi-send::before{content:"\F48A"}.mdi-send-circle::before{content:"\FE58"}.mdi-send-circle-outline::before{content:"\FE59"}.mdi-send-lock::before{content:"\F7EC"}.mdi-serial-port::before{content:"\F65C"}.mdi-server::before{content:"\F48B"}.mdi-server-minus::before{content:"\F48C"}.mdi-server-network::before{content:"\F48D"}.mdi-server-network-off::before{content:"\F48E"}.mdi-server-off::before{content:"\F48F"}.mdi-server-plus::before{content:"\F490"}.mdi-server-remove::before{content:"\F491"}.mdi-server-security::before{content:"\F492"}.mdi-set-all::before{content:"\F777"}.mdi-set-center::before{content:"\F778"}.mdi-set-center-right::before{content:"\F779"}.mdi-set-left::before{content:"\F77A"}.mdi-set-left-center::before{content:"\F77B"}.mdi-set-left-right::before{content:"\F77C"}.mdi-set-none::before{content:"\F77D"}.mdi-set-right::before{content:"\F77E"}.mdi-set-top-box::before{content:"\F99E"}.mdi-settings::before{content:"\F493"}.mdi-settings-box::before{content:"\F494"}.mdi-settings-helper::before{content:"\FA6D"}.mdi-settings-outline::before{content:"\F8BA"}.mdi-shape::before{content:"\F830"}.mdi-shape-circle-plus::before{content:"\F65D"}.mdi-shape-outline::before{content:"\F831"}.mdi-shape-plus::before{content:"\F495"}.mdi-shape-polygon-plus::before{content:"\F65E"}.mdi-shape-rectangle-plus::before{content:"\F65F"}.mdi-shape-square-plus::before{content:"\F660"}.mdi-share::before{content:"\F496"}.mdi-share-off::before{content:"\FF40"}.mdi-share-off-outline::before{content:"\FF41"}.mdi-share-outline::before{content:"\F931"}.mdi-share-variant::before{content:"\F497"}.mdi-sheep::before{content:"\FCA2"}.mdi-shield::before{content:"\F498"}.mdi-shield-account::before{content:"\F88E"}.mdi-shield-account-outline::before{content:"\FA11"}.mdi-shield-airplane::before{content:"\F6BA"}.mdi-shield-airplane-outline::before{content:"\FCA3"}.mdi-shield-alert::before{content:"\FEE9"}.mdi-shield-alert-outline::before{content:"\FEEA"}.mdi-shield-car::before{content:"\FFA0"}.mdi-shield-check::before{content:"\F565"}.mdi-shield-check-outline::before{content:"\FCA4"}.mdi-shield-cross::before{content:"\FCA5"}.mdi-shield-cross-outline::before{content:"\FCA6"}.mdi-shield-half-full::before{content:"\F77F"}.mdi-shield-home::before{content:"\F689"}.mdi-shield-home-outline::before{content:"\FCA7"}.mdi-shield-key::before{content:"\FBA0"}.mdi-shield-key-outline::before{content:"\FBA1"}.mdi-shield-link-variant::before{content:"\FD0F"}.mdi-shield-link-variant-outline::before{content:"\FD10"}.mdi-shield-lock::before{content:"\F99C"}.mdi-shield-lock-outline::before{content:"\FCA8"}.mdi-shield-off::before{content:"\F99D"}.mdi-shield-off-outline::before{content:"\F99B"}.mdi-shield-outline::before{content:"\F499"}.mdi-shield-plus::before{content:"\FAD9"}.mdi-shield-plus-outline::before{content:"\FADA"}.mdi-shield-remove::before{content:"\FADB"}.mdi-shield-remove-outline::before{content:"\FADC"}.mdi-shield-search::before{content:"\FD76"}.mdi-ship-wheel::before{content:"\F832"}.mdi-shoe-formal::before{content:"\FB22"}.mdi-shoe-heel::before{content:"\FB23"}.mdi-shoe-print::before{content:"\FE5A"}.mdi-shopify::before{content:"\FADD"}.mdi-shopping::before{content:"\F49A"}.mdi-shopping-music::before{content:"\F49B"}.mdi-shopping-search::before{content:"\FFA1"}.mdi-shovel::before{content:"\F70F"}.mdi-shovel-off::before{content:"\F710"}.mdi-shower::before{content:"\F99F"}.mdi-shower-head::before{content:"\F9A0"}.mdi-shredder::before{content:"\F49C"}.mdi-shuffle::before{content:"\F49D"}.mdi-shuffle-disabled::before{content:"\F49E"}.mdi-shuffle-variant::before{content:"\F49F"}.mdi-sigma::before{content:"\F4A0"}.mdi-sigma-lower::before{content:"\F62B"}.mdi-sign-caution::before{content:"\F4A1"}.mdi-sign-direction::before{content:"\F780"}.mdi-sign-text::before{content:"\F781"}.mdi-signal::before{content:"\F4A2"}.mdi-signal-2g::before{content:"\F711"}.mdi-signal-3g::before{content:"\F712"}.mdi-signal-4g::before{content:"\F713"}.mdi-signal-5g::before{content:"\FA6E"}.mdi-signal-cellular-1::before{content:"\F8BB"}.mdi-signal-cellular-2::before{content:"\F8BC"}.mdi-signal-cellular-3::before{content:"\F8BD"}.mdi-signal-cellular-outline::before{content:"\F8BE"}.mdi-signal-distance-variant::before{content:"\FE47"}.mdi-signal-hspa::before{content:"\F714"}.mdi-signal-hspa-plus::before{content:"\F715"}.mdi-signal-off::before{content:"\F782"}.mdi-signal-variant::before{content:"\F60A"}.mdi-signature::before{content:"\FE5B"}.mdi-signature-freehand::before{content:"\FE5C"}.mdi-signature-image::before{content:"\FE5D"}.mdi-signature-text::before{content:"\FE5E"}.mdi-silo::before{content:"\FB24"}.mdi-silverware::before{content:"\F4A3"}.mdi-silverware-fork::before{content:"\F4A4"}.mdi-silverware-fork-knife::before{content:"\FA6F"}.mdi-silverware-spoon::before{content:"\F4A5"}.mdi-silverware-variant::before{content:"\F4A6"}.mdi-sim::before{content:"\F4A7"}.mdi-sim-alert::before{content:"\F4A8"}.mdi-sim-off::before{content:"\F4A9"}.mdi-sina-weibo::before{content:"\FADE"}.mdi-sitemap::before{content:"\F4AA"}.mdi-skate::before{content:"\FD11"}.mdi-skew-less::before{content:"\FD12"}.mdi-skew-more::before{content:"\FD13"}.mdi-skip-backward::before{content:"\F4AB"}.mdi-skip-backward-outline::before{content:"\FF42"}.mdi-skip-forward::before{content:"\F4AC"}.mdi-skip-forward-outline::before{content:"\FF43"}.mdi-skip-next::before{content:"\F4AD"}.mdi-skip-next-circle::before{content:"\F661"}.mdi-skip-next-circle-outline::before{content:"\F662"}.mdi-skip-next-outline::before{content:"\FF44"}.mdi-skip-previous::before{content:"\F4AE"}.mdi-skip-previous-circle::before{content:"\F663"}.mdi-skip-previous-circle-outline::before{content:"\F664"}.mdi-skip-previous-outline::before{content:"\FF45"}.mdi-skull::before{content:"\F68B"}.mdi-skull-crossbones::before{content:"\FBA2"}.mdi-skull-crossbones-outline::before{content:"\FBA3"}.mdi-skull-outline::before{content:"\FBA4"}.mdi-skype::before{content:"\F4AF"}.mdi-skype-business::before{content:"\F4B0"}.mdi-slack::before{content:"\F4B1"}.mdi-slackware::before{content:"\F90A"}.mdi-sleep::before{content:"\F4B2"}.mdi-sleep-off::before{content:"\F4B3"}.mdi-slope-downhill::before{content:"\FE5F"}.mdi-slope-uphill::before{content:"\FE60"}.mdi-smog::before{content:"\FA70"}.mdi-smoke-detector::before{content:"\F392"}.mdi-smoking::before{content:"\F4B4"}.mdi-smoking-off::before{content:"\F4B5"}.mdi-snapchat::before{content:"\F4B6"}.mdi-snowflake::before{content:"\F716"}.mdi-snowflake-alert::before{content:"\FF46"}.mdi-snowflake-variant::before{content:"\FF47"}.mdi-snowman::before{content:"\F4B7"}.mdi-soccer::before{content:"\F4B8"}.mdi-soccer-field::before{content:"\F833"}.mdi-sofa::before{content:"\F4B9"}.mdi-solar-panel::before{content:"\FD77"}.mdi-solar-panel-large::before{content:"\FD78"}.mdi-solar-power::before{content:"\FA71"}.mdi-solid::before{content:"\F68C"}.mdi-sort::before{content:"\F4BA"}.mdi-sort-alphabetical::before{content:"\F4BB"}.mdi-sort-ascending::before{content:"\F4BC"}.mdi-sort-descending::before{content:"\F4BD"}.mdi-sort-numeric::before{content:"\F4BE"}.mdi-sort-variant::before{content:"\F4BF"}.mdi-sort-variant-lock::before{content:"\FCA9"}.mdi-sort-variant-lock-open::before{content:"\FCAA"}.mdi-soundcloud::before{content:"\F4C0"}.mdi-source-branch::before{content:"\F62C"}.mdi-source-commit::before{content:"\F717"}.mdi-source-commit-end::before{content:"\F718"}.mdi-source-commit-end-local::before{content:"\F719"}.mdi-source-commit-local::before{content:"\F71A"}.mdi-source-commit-next-local::before{content:"\F71B"}.mdi-source-commit-start::before{content:"\F71C"}.mdi-source-commit-start-next-local::before{content:"\F71D"}.mdi-source-fork::before{content:"\F4C1"}.mdi-source-merge::before{content:"\F62D"}.mdi-source-pull::before{content:"\F4C2"}.mdi-source-repository::before{content:"\FCAB"}.mdi-source-repository-multiple::before{content:"\FCAC"}.mdi-soy-sauce::before{content:"\F7ED"}.mdi-spa::before{content:"\FCAD"}.mdi-spa-outline::before{content:"\FCAE"}.mdi-space-invaders::before{content:"\FBA5"}.mdi-spade::before{content:"\FE48"}.mdi-speaker::before{content:"\F4C3"}.mdi-speaker-bluetooth::before{content:"\F9A1"}.mdi-speaker-multiple::before{content:"\FD14"}.mdi-speaker-off::before{content:"\F4C4"}.mdi-speaker-wireless::before{content:"\F71E"}.mdi-speedometer::before{content:"\F4C5"}.mdi-speedometer-medium::before{content:"\FFA2"}.mdi-speedometer-slow::before{content:"\FFA3"}.mdi-spellcheck::before{content:"\F4C6"}.mdi-spider-web::before{content:"\FBA6"}.mdi-spotify::before{content:"\F4C7"}.mdi-spotlight::before{content:"\F4C8"}.mdi-spotlight-beam::before{content:"\F4C9"}.mdi-spray::before{content:"\F665"}.mdi-spray-bottle::before{content:"\FADF"}.mdi-sprout::before{content:"\FE49"}.mdi-sprout-outline::before{content:"\FE4A"}.mdi-square::before{content:"\F763"}.mdi-square-edit-outline::before{content:"\F90B"}.mdi-square-inc::before{content:"\F4CA"}.mdi-square-inc-cash::before{content:"\F4CB"}.mdi-square-medium::before{content:"\FA12"}.mdi-square-medium-outline::before{content:"\FA13"}.mdi-square-outline::before{content:"\F762"}.mdi-square-root::before{content:"\F783"}.mdi-square-root-box::before{content:"\F9A2"}.mdi-square-small::before{content:"\FA14"}.mdi-squeegee::before{content:"\FAE0"}.mdi-ssh::before{content:"\F8BF"}.mdi-stack-exchange::before{content:"\F60B"}.mdi-stack-overflow::before{content:"\F4CC"}.mdi-stadium::before{content:"\F71F"}.mdi-stairs::before{content:"\F4CD"}.mdi-stamper::before{content:"\FD15"}.mdi-standard-definition::before{content:"\F7EE"}.mdi-star::before{content:"\F4CE"}.mdi-star-box::before{content:"\FA72"}.mdi-star-box-outline::before{content:"\FA73"}.mdi-star-circle::before{content:"\F4CF"}.mdi-star-circle-outline::before{content:"\F9A3"}.mdi-star-face::before{content:"\F9A4"}.mdi-star-four-points::before{content:"\FAE1"}.mdi-star-four-points-outline::before{content:"\FAE2"}.mdi-star-half::before{content:"\F4D0"}.mdi-star-off::before{content:"\F4D1"}.mdi-star-outline::before{content:"\F4D2"}.mdi-star-three-points::before{content:"\FAE3"}.mdi-star-three-points-outline::before{content:"\FAE4"}.mdi-steam::before{content:"\F4D3"}.mdi-steam-box::before{content:"\F90C"}.mdi-steering::before{content:"\F4D4"}.mdi-steering-off::before{content:"\F90D"}.mdi-step-backward::before{content:"\F4D5"}.mdi-step-backward-2::before{content:"\F4D6"}.mdi-step-forward::before{content:"\F4D7"}.mdi-step-forward-2::before{content:"\F4D8"}.mdi-stethoscope::before{content:"\F4D9"}.mdi-sticker::before{content:"\F5D0"}.mdi-sticker-emoji::before{content:"\F784"}.mdi-stocking::before{content:"\F4DA"}.mdi-stop::before{content:"\F4DB"}.mdi-stop-circle::before{content:"\F666"}.mdi-stop-circle-outline::before{content:"\F667"}.mdi-store::before{content:"\F4DC"}.mdi-store-24-hour::before{content:"\F4DD"}.mdi-stove::before{content:"\F4DE"}.mdi-strava::before{content:"\FB25"}.mdi-stretch-to-page::before{content:"\FF48"}.mdi-stretch-to-page-outline::before{content:"\FF49"}.mdi-subdirectory-arrow-left::before{content:"\F60C"}.mdi-subdirectory-arrow-right::before{content:"\F60D"}.mdi-subtitles::before{content:"\FA15"}.mdi-subtitles-outline::before{content:"\FA16"}.mdi-subway::before{content:"\F6AB"}.mdi-subway-alert-variant::before{content:"\FD79"}.mdi-subway-variant::before{content:"\F4DF"}.mdi-summit::before{content:"\F785"}.mdi-sunglasses::before{content:"\F4E0"}.mdi-surround-sound::before{content:"\F5C5"}.mdi-surround-sound-2-0::before{content:"\F7EF"}.mdi-surround-sound-3-1::before{content:"\F7F0"}.mdi-surround-sound-5-1::before{content:"\F7F1"}.mdi-surround-sound-7-1::before{content:"\F7F2"}.mdi-svg::before{content:"\F720"}.mdi-swap-horizontal::before{content:"\F4E1"}.mdi-swap-horizontal-bold::before{content:"\FBA9"}.mdi-swap-horizontal-variant::before{content:"\F8C0"}.mdi-swap-vertical::before{content:"\F4E2"}.mdi-swap-vertical-bold::before{content:"\FBAA"}.mdi-swap-vertical-variant::before{content:"\F8C1"}.mdi-swim::before{content:"\F4E3"}.mdi-switch::before{content:"\F4E4"}.mdi-sword::before{content:"\F4E5"}.mdi-sword-cross::before{content:"\F786"}.mdi-symfony::before{content:"\FAE5"}.mdi-sync::before{content:"\F4E6"}.mdi-sync-alert::before{content:"\F4E7"}.mdi-sync-off::before{content:"\F4E8"}.mdi-tab::before{content:"\F4E9"}.mdi-tab-minus::before{content:"\FB26"}.mdi-tab-plus::before{content:"\F75B"}.mdi-tab-remove::before{content:"\FB27"}.mdi-tab-unselected::before{content:"\F4EA"}.mdi-table::before{content:"\F4EB"}.mdi-table-border::before{content:"\FA17"}.mdi-table-column::before{content:"\F834"}.mdi-table-column-plus-after::before{content:"\F4EC"}.mdi-table-column-plus-before::before{content:"\F4ED"}.mdi-table-column-remove::before{content:"\F4EE"}.mdi-table-column-width::before{content:"\F4EF"}.mdi-table-edit::before{content:"\F4F0"}.mdi-table-large::before{content:"\F4F1"}.mdi-table-large-plus::before{content:"\FFA4"}.mdi-table-large-remove::before{content:"\FFA5"}.mdi-table-merge-cells::before{content:"\F9A5"}.mdi-table-of-contents::before{content:"\F835"}.mdi-table-plus::before{content:"\FA74"}.mdi-table-remove::before{content:"\FA75"}.mdi-table-row::before{content:"\F836"}.mdi-table-row-height::before{content:"\F4F2"}.mdi-table-row-plus-after::before{content:"\F4F3"}.mdi-table-row-plus-before::before{content:"\F4F4"}.mdi-table-row-remove::before{content:"\F4F5"}.mdi-table-search::before{content:"\F90E"}.mdi-table-settings::before{content:"\F837"}.mdi-table-tennis::before{content:"\FE4B"}.mdi-tablet::before{content:"\F4F6"}.mdi-tablet-android::before{content:"\F4F7"}.mdi-tablet-cellphone::before{content:"\F9A6"}.mdi-tablet-dashboard::before{content:"\FEEB"}.mdi-tablet-ipad::before{content:"\F4F8"}.mdi-taco::before{content:"\F761"}.mdi-tag::before{content:"\F4F9"}.mdi-tag-faces::before{content:"\F4FA"}.mdi-tag-heart::before{content:"\F68A"}.mdi-tag-heart-outline::before{content:"\FBAB"}.mdi-tag-minus::before{content:"\F90F"}.mdi-tag-multiple::before{content:"\F4FB"}.mdi-tag-outline::before{content:"\F4FC"}.mdi-tag-plus::before{content:"\F721"}.mdi-tag-remove::before{content:"\F722"}.mdi-tag-text-outline::before{content:"\F4FD"}.mdi-tank::before{content:"\FD16"}.mdi-tape-measure::before{content:"\FB28"}.mdi-target::before{content:"\F4FE"}.mdi-target-account::before{content:"\FBAC"}.mdi-target-variant::before{content:"\FA76"}.mdi-taxi::before{content:"\F4FF"}.mdi-tea::before{content:"\FD7A"}.mdi-tea-outline::before{content:"\FD7B"}.mdi-teach::before{content:"\F88F"}.mdi-teamviewer::before{content:"\F500"}.mdi-telegram::before{content:"\F501"}.mdi-telescope::before{content:"\FB29"}.mdi-television::before{content:"\F502"}.mdi-television-box::before{content:"\F838"}.mdi-television-classic::before{content:"\F7F3"}.mdi-television-classic-off::before{content:"\F839"}.mdi-television-guide::before{content:"\F503"}.mdi-television-off::before{content:"\F83A"}.mdi-television-pause::before{content:"\FFA6"}.mdi-television-play::before{content:"\FEEC"}.mdi-television-stop::before{content:"\FFA7"}.mdi-temperature-celsius::before{content:"\F504"}.mdi-temperature-fahrenheit::before{content:"\F505"}.mdi-temperature-kelvin::before{content:"\F506"}.mdi-tennis::before{content:"\FD7C"}.mdi-tennis-ball::before{content:"\F507"}.mdi-tent::before{content:"\F508"}.mdi-terrain::before{content:"\F509"}.mdi-test-tube::before{content:"\F668"}.mdi-test-tube-empty::before{content:"\F910"}.mdi-test-tube-off::before{content:"\F911"}.mdi-text::before{content:"\F9A7"}.mdi-text-shadow::before{content:"\F669"}.mdi-text-short::before{content:"\F9A8"}.mdi-text-subject::before{content:"\F9A9"}.mdi-text-to-speech::before{content:"\F50A"}.mdi-text-to-speech-off::before{content:"\F50B"}.mdi-textbox::before{content:"\F60E"}.mdi-textbox-password::before{content:"\F7F4"}.mdi-texture::before{content:"\F50C"}.mdi-theater::before{content:"\F50D"}.mdi-theme-light-dark::before{content:"\F50E"}.mdi-thermometer::before{content:"\F50F"}.mdi-thermometer-alert::before{content:"\FE61"}.mdi-thermometer-chevron-down::before{content:"\FE62"}.mdi-thermometer-chevron-up::before{content:"\FE63"}.mdi-thermometer-lines::before{content:"\F510"}.mdi-thermometer-minus::before{content:"\FE64"}.mdi-thermometer-plus::before{content:"\FE65"}.mdi-thermostat::before{content:"\F393"}.mdi-thermostat-box::before{content:"\F890"}.mdi-thought-bubble::before{content:"\F7F5"}.mdi-thought-bubble-outline::before{content:"\F7F6"}.mdi-thumb-down::before{content:"\F511"}.mdi-mdi-thumb-down-outline::before{content:"\F512"}.mdi-thumb-up::before{content:"\F513"}.mdi-thumb-up-outline::before{content:"\F514"}.mdi-thumbs-up-down::before{content:"\F515"}.mdi-ticket::before{content:"\F516"}.mdi-ticket-account::before{content:"\F517"}.mdi-ticket-confirmation::before{content:"\F518"}.mdi-ticket-outline::before{content:"\F912"}.mdi-ticket-percent::before{content:"\F723"}.mdi-tie::before{content:"\F519"}.mdi-tilde::before{content:"\F724"}.mdi-timelapse::before{content:"\F51A"}.mdi-timeline::before{content:"\FBAD"}.mdi-timeline-alert::before{content:"\FFB2"}.mdi-timeline-alert-outline::before{content:"\FFB5"}.mdi-timeline-help::before{content:"\FFB6"}.mdi-timeline-help-outline::before{content:"\FFB7"}.mdi-timeline-outline::before{content:"\FBAE"}.mdi-timeline-plus::before{content:"\FFB3"}.mdi-timeline-plus-outline::before{content:"\FFB4"}.mdi-timeline-text::before{content:"\FBAF"}.mdi-timeline-text-outline::before{content:"\FBB0"}.mdi-timer::before{content:"\F51B"}.mdi-timer-10::before{content:"\F51C"}.mdi-timer-3::before{content:"\F51D"}.mdi-timer-off::before{content:"\F51E"}.mdi-timer-sand::before{content:"\F51F"}.mdi-timer-sand-empty::before{content:"\F6AC"}.mdi-timer-sand-full::before{content:"\F78B"}.mdi-timetable::before{content:"\F520"}.mdi-toaster-oven::before{content:"\FCAF"}.mdi-toggle-switch::before{content:"\F521"}.mdi-toggle-switch-off::before{content:"\F522"}.mdi-toggle-switch-off-outline::before{content:"\FA18"}.mdi-toggle-switch-outline::before{content:"\FA19"}.mdi-toilet::before{content:"\F9AA"}.mdi-toolbox::before{content:"\F9AB"}.mdi-toolbox-outline::before{content:"\F9AC"}.mdi-tooltip::before{content:"\F523"}.mdi-tooltip-account::before{content:"\F00C"}.mdi-tooltip-edit::before{content:"\F524"}.mdi-tooltip-image::before{content:"\F525"}.mdi-tooltip-image-outline::before{content:"\FBB1"}.mdi-tooltip-outline::before{content:"\F526"}.mdi-tooltip-plus::before{content:"\FBB2"}.mdi-tooltip-plus-outline::before{content:"\F527"}.mdi-tooltip-text::before{content:"\F528"}.mdi-tooltip-text-outline::before{content:"\FBB3"}.mdi-tooth::before{content:"\F8C2"}.mdi-tooth-outline::before{content:"\F529"}.mdi-tor::before{content:"\F52A"}.mdi-tortoise::before{content:"\FD17"}.mdi-tournament::before{content:"\F9AD"}.mdi-tower-beach::before{content:"\F680"}.mdi-tower-fire::before{content:"\F681"}.mdi-towing::before{content:"\F83B"}.mdi-track-light::before{content:"\F913"}.mdi-trackpad::before{content:"\F7F7"}.mdi-trackpad-lock::before{content:"\F932"}.mdi-tractor::before{content:"\F891"}.mdi-trademark::before{content:"\FA77"}.mdi-traffic-light::before{content:"\F52B"}.mdi-train::before{content:"\F52C"}.mdi-train-car::before{content:"\FBB4"}.mdi-train-variant::before{content:"\F8C3"}.mdi-tram::before{content:"\F52D"}.mdi-transcribe::before{content:"\F52E"}.mdi-transcribe-close::before{content:"\F52F"}.mdi-transfer-down::before{content:"\FD7D"}.mdi-transfer-left::before{content:"\FD7E"}.mdi-transfer-right::before{content:"\F530"}.mdi-transfer-up::before{content:"\FD7F"}.mdi-transit-connection::before{content:"\FD18"}.mdi-transit-connection-variant::before{content:"\FD19"}.mdi-transit-detour::before{content:"\FFA8"}.mdi-transit-transfer::before{content:"\F6AD"}.mdi-transition::before{content:"\F914"}.mdi-transition-masked::before{content:"\F915"}.mdi-translate::before{content:"\F5CA"}.mdi-translate-off::before{content:"\FE66"}.mdi-transmission-tower::before{content:"\FD1A"}.mdi-trash-can::before{content:"\FA78"}.mdi-trash-can-outline::before{content:"\FA79"}.mdi-treasure-chest::before{content:"\F725"}.mdi-tree::before{content:"\F531"}.mdi-tree-outline::before{content:"\FE4C"}.mdi-trello::before{content:"\F532"}.mdi-trending-down::before{content:"\F533"}.mdi-trending-neutral::before{content:"\F534"}.mdi-trending-up::before{content:"\F535"}.mdi-triangle::before{content:"\F536"}.mdi-triangle-outline::before{content:"\F537"}.mdi-triforce::before{content:"\FBB5"}.mdi-trophy::before{content:"\F538"}.mdi-trophy-award::before{content:"\F539"}.mdi-trophy-broken::before{content:"\FD80"}.mdi-trophy-outline::before{content:"\F53A"}.mdi-trophy-variant::before{content:"\F53B"}.mdi-trophy-variant-outline::before{content:"\F53C"}.mdi-truck::before{content:"\F53D"}.mdi-truck-check::before{content:"\FCB0"}.mdi-truck-delivery::before{content:"\F53E"}.mdi-truck-fast::before{content:"\F787"}.mdi-truck-trailer::before{content:"\F726"}.mdi-tshirt-crew::before{content:"\FA7A"}.mdi-tshirt-crew-outline::before{content:"\F53F"}.mdi-tshirt-v::before{content:"\FA7B"}.mdi-tshirt-v-outline::before{content:"\F540"}.mdi-tumble-dryer::before{content:"\F916"}.mdi-tumblr::before{content:"\F541"}.mdi-tumblr-box::before{content:"\F917"}.mdi-tumblr-reblog::before{content:"\F542"}.mdi-tune::before{content:"\F62E"}.mdi-tune-vertical::before{content:"\F66A"}.mdi-turnstile::before{content:"\FCB1"}.mdi-turnstile-outline::before{content:"\FCB2"}.mdi-turtle::before{content:"\FCB3"}.mdi-twitch::before{content:"\F543"}.mdi-twitter::before{content:"\F544"}.mdi-twitter-box::before{content:"\F545"}.mdi-twitter-circle::before{content:"\F546"}.mdi-twitter-retweet::before{content:"\F547"}.mdi-two-factor-authentication::before{content:"\F9AE"}.mdi-typewriter::before{content:"\FF4A"}.mdi-uber::before{content:"\F748"}.mdi-ubisoft::before{content:"\FBB6"}.mdi-ubuntu::before{content:"\F548"}.mdi-ultra-high-definition::before{content:"\F7F8"}.mdi-umbraco::before{content:"\F549"}.mdi-umbrella::before{content:"\F54A"}.mdi-umbrella-closed::before{content:"\F9AF"}.mdi-umbrella-outline::before{content:"\F54B"}.mdi-undo::before{content:"\F54C"}.mdi-undo-variant::before{content:"\F54D"}.mdi-unfold-less-horizontal::before{content:"\F54E"}.mdi-unfold-less-vertical::before{content:"\F75F"}.mdi-unfold-more-horizontal::before{content:"\F54F"}.mdi-unfold-more-vertical::before{content:"\F760"}.mdi-ungroup::before{content:"\F550"}.mdi-unicode::before{content:"\FEED"}.mdi-unity::before{content:"\F6AE"}.mdi-unreal::before{content:"\F9B0"}.mdi-untappd::before{content:"\F551"}.mdi-update::before{content:"\F6AF"}.mdi-upload::before{content:"\F552"}.mdi-upload-multiple::before{content:"\F83C"}.mdi-upload-network::before{content:"\F6F5"}.mdi-upload-network-outline::before{content:"\FCB4"}.mdi-upload-outline::before{content:"\FE67"}.mdi-usb::before{content:"\F553"}.mdi-van-passenger::before{content:"\F7F9"}.mdi-van-utility::before{content:"\F7FA"}.mdi-vanish::before{content:"\F7FB"}.mdi-variable::before{content:"\FAE6"}.mdi-vector-arrange-above::before{content:"\F554"}.mdi-vector-arrange-below::before{content:"\F555"}.mdi-vector-bezier::before{content:"\FAE7"}.mdi-vector-circle::before{content:"\F556"}.mdi-vector-circle-variant::before{content:"\F557"}.mdi-vector-combine::before{content:"\F558"}.mdi-vector-curve::before{content:"\F559"}.mdi-vector-difference::before{content:"\F55A"}.mdi-vector-difference-ab::before{content:"\F55B"}.mdi-vector-difference-ba::before{content:"\F55C"}.mdi-vector-ellipse::before{content:"\F892"}.mdi-vector-intersection::before{content:"\F55D"}.mdi-vector-line::before{content:"\F55E"}.mdi-vector-point::before{content:"\F55F"}.mdi-vector-polygon::before{content:"\F560"}.mdi-vector-polyline::before{content:"\F561"}.mdi-vector-radius::before{content:"\F749"}.mdi-vector-rectangle::before{content:"\F5C6"}.mdi-vector-selection::before{content:"\F562"}.mdi-vector-square::before{content:"\F001"}.mdi-vector-triangle::before{content:"\F563"}.mdi-vector-union::before{content:"\F564"}.mdi-venmo::before{content:"\F578"}.mdi-vhs::before{content:"\FA1A"}.mdi-vibrate::before{content:"\F566"}.mdi-vibrate-off::before{content:"\FCB5"}.mdi-video::before{content:"\F567"}.mdi-video-3d::before{content:"\F7FC"}.mdi-video-3d-variant::before{content:"\FEEE"}.mdi-video-4k-box::before{content:"\F83D"}.mdi-video-account::before{content:"\F918"}.mdi-video-image::before{content:"\F919"}.mdi-video-input-antenna::before{content:"\F83E"}.mdi-video-input-component::before{content:"\F83F"}.mdi-video-input-hdmi::before{content:"\F840"}.mdi-video-input-scart::before{content:"\FFA9"}.mdi-video-input-svideo::before{content:"\F841"}.mdi-video-minus::before{content:"\F9B1"}.mdi-video-off::before{content:"\F568"}.mdi-video-off-outline::before{content:"\FBB7"}.mdi-video-outline::before{content:"\FBB8"}.mdi-video-plus::before{content:"\F9B2"}.mdi-video-stabilization::before{content:"\F91A"}.mdi-video-switch::before{content:"\F569"}.mdi-video-vintage::before{content:"\FA1B"}.mdi-video-wireless::before{content:"\FEEF"}.mdi-video-wireless-outline::before{content:"\FEF0"}.mdi-view-agenda::before{content:"\F56A"}.mdi-view-array::before{content:"\F56B"}.mdi-view-carousel::before{content:"\F56C"}.mdi-view-column::before{content:"\F56D"}.mdi-view-comfy::before{content:"\FE4D"}.mdi-view-compact::before{content:"\FE4E"}.mdi-view-compact-outline::before{content:"\FE4F"}.mdi-view-dashboard::before{content:"\F56E"}.mdi-view-dashboard-outline::before{content:"\FA1C"}.mdi-view-dashboard-variant::before{content:"\F842"}.mdi-view-day::before{content:"\F56F"}.mdi-view-grid::before{content:"\F570"}.mdi-view-grid-plus::before{content:"\FFAA"}.mdi-view-headline::before{content:"\F571"}.mdi-view-list::before{content:"\F572"}.mdi-view-module::before{content:"\F573"}.mdi-view-parallel::before{content:"\F727"}.mdi-view-quilt::before{content:"\F574"}.mdi-view-sequential::before{content:"\F728"}.mdi-view-split-horizontal::before{content:"\FBA7"}.mdi-view-split-vertical::before{content:"\FBA8"}.mdi-view-stream::before{content:"\F575"}.mdi-view-week::before{content:"\F576"}.mdi-vimeo::before{content:"\F577"}.mdi-violin::before{content:"\F60F"}.mdi-virtual-reality::before{content:"\F893"}.mdi-visual-studio::before{content:"\F610"}.mdi-visual-studio-code::before{content:"\FA1D"}.mdi-vk::before{content:"\F579"}.mdi-vk-box::before{content:"\F57A"}.mdi-vk-circle::before{content:"\F57B"}.mdi-vlc::before{content:"\F57C"}.mdi-voice::before{content:"\F5CB"}.mdi-voice-off::before{content:"\FEF1"}.mdi-voicemail::before{content:"\F57D"}.mdi-volleyball::before{content:"\F9B3"}.mdi-volume-high::before{content:"\F57E"}.mdi-volume-low::before{content:"\F57F"}.mdi-volume-medium::before{content:"\F580"}.mdi-volume-minus::before{content:"\F75D"}.mdi-volume-mute::before{content:"\F75E"}.mdi-volume-off::before{content:"\F581"}.mdi-volume-plus::before{content:"\F75C"}.mdi-volume-variant-off::before{content:"\FE68"}.mdi-vote::before{content:"\FA1E"}.mdi-vote-outline::before{content:"\FA1F"}.mdi-vpn::before{content:"\F582"}.mdi-vuejs::before{content:"\F843"}.mdi-vuetify::before{content:"\FE50"}.mdi-walk::before{content:"\F583"}.mdi-wall::before{content:"\F7FD"}.mdi-wall-sconce::before{content:"\F91B"}.mdi-wall-sconce-flat::before{content:"\F91C"}.mdi-wall-sconce-variant::before{content:"\F91D"}.mdi-wallet::before{content:"\F584"}.mdi-wallet-giftcard::before{content:"\F585"}.mdi-wallet-membership::before{content:"\F586"}.mdi-wallet-outline::before{content:"\FBB9"}.mdi-wallet-plus::before{content:"\FFAB"}.mdi-wallet-plus-outline::before{content:"\FFAC"}.mdi-wallet-travel::before{content:"\F587"}.mdi-wallpaper::before{content:"\FE69"}.mdi-wan::before{content:"\F588"}.mdi-wardrobe::before{content:"\FFAD"}.mdi-wardrobe-outline::before{content:"\FFAE"}.mdi-warehouse::before{content:"\FFBB"}.mdi-washing-machine::before{content:"\F729"}.mdi-watch::before{content:"\F589"}.mdi-watch-export::before{content:"\F58A"}.mdi-watch-export-variant::before{content:"\F894"}.mdi-watch-import::before{content:"\F58B"}.mdi-watch-import-variant::before{content:"\F895"}.mdi-watch-variant::before{content:"\F896"}.mdi-watch-vibrate::before{content:"\F6B0"}.mdi-watch-vibrate-off::before{content:"\FCB6"}.mdi-water::before{content:"\F58C"}.mdi-water-boiler::before{content:"\FFAF"}.mdi-water-off::before{content:"\F58D"}.mdi-water-outline::before{content:"\FE6A"}.mdi-water-percent::before{content:"\F58E"}.mdi-water-pump::before{content:"\F58F"}.mdi-water-pump-off::before{content:"\FFB0"}.mdi-watermark::before{content:"\F612"}.mdi-wave::before{content:"\FF4B"}.mdi-waves::before{content:"\F78C"}.mdi-waze::before{content:"\FBBA"}.mdi-weather-cloudy::before{content:"\F590"}.mdi-weather-cloudy-alert::before{content:"\FF4C"}.mdi-weather-cloudy-arrow-right::before{content:"\FE51"}.mdi-weather-fog::before{content:"\F591"}.mdi-weather-hail::before{content:"\F592"}.mdi-weather-hazy::before{content:"\FF4D"}.mdi-weather-hurricane::before{content:"\F897"}.mdi-weather-lightning::before{content:"\F593"}.mdi-weather-lightning-rainy::before{content:"\F67D"}.mdi-weather-night::before{content:"\F594"}.mdi-weather-night-partly-cloudy::before{content:"\FF4E"}.mdi-weather-partly-cloudy::before{content:"\F595"}.mdi-weather-partly-lightning::before{content:"\FF4F"}.mdi-weather-partly-rainy::before{content:"\FF50"}.mdi-weather-partly-snowy::before{content:"\FF51"}.mdi-weather-partly-snowy-rainy::before{content:"\FF52"}.mdi-weather-pouring::before{content:"\F596"}.mdi-weather-rainy::before{content:"\F597"}.mdi-weather-snowy::before{content:"\F598"}.mdi-weather-snowy-heavy::before{content:"\FF53"}.mdi-weather-snowy-rainy::before{content:"\F67E"}.mdi-weather-sunny::before{content:"\F599"}.mdi-weather-sunny-alert::before{content:"\FF54"}.mdi-weather-sunset::before{content:"\F59A"}.mdi-weather-sunset-down::before{content:"\F59B"}.mdi-weather-sunset-up::before{content:"\F59C"}.mdi-weather-tornado::before{content:"\FF55"}.mdi-weather-windy::before{content:"\F59D"}.mdi-weather-windy-variant::before{content:"\F59E"}.mdi-web::before{content:"\F59F"}.mdi-web-box::before{content:"\FFB1"}.mdi-webcam::before{content:"\F5A0"}.mdi-webhook::before{content:"\F62F"}.mdi-webpack::before{content:"\F72A"}.mdi-wechat::before{content:"\F611"}.mdi-weight::before{content:"\F5A1"}.mdi-weight-gram::before{content:"\FD1B"}.mdi-weight-kilogram::before{content:"\F5A2"}.mdi-weight-pound::before{content:"\F9B4"}.mdi-whatsapp::before{content:"\F5A3"}.mdi-wheelchair-accessibility::before{content:"\F5A4"}.mdi-whistle::before{content:"\F9B5"}.mdi-white-balance-auto::before{content:"\F5A5"}.mdi-white-balance-incandescent::before{content:"\F5A6"}.mdi-white-balance-iridescent::before{content:"\F5A7"}.mdi-white-balance-sunny::before{content:"\F5A8"}.mdi-widgets::before{content:"\F72B"}.mdi-wifi::before{content:"\F5A9"}.mdi-wifi-off::before{content:"\F5AA"}.mdi-wifi-star::before{content:"\FE6B"}.mdi-wifi-strength-1::before{content:"\F91E"}.mdi-wifi-strength-1-alert::before{content:"\F91F"}.mdi-wifi-strength-1-lock::before{content:"\F920"}.mdi-wifi-strength-2::before{content:"\F921"}.mdi-wifi-strength-2-alert::before{content:"\F922"}.mdi-wifi-strength-2-lock::before{content:"\F923"}.mdi-wifi-strength-3::before{content:"\F924"}.mdi-wifi-strength-3-alert::before{content:"\F925"}.mdi-wifi-strength-3-lock::before{content:"\F926"}.mdi-wifi-strength-4::before{content:"\F927"}.mdi-wifi-strength-4-alert::before{content:"\F928"}.mdi-wifi-strength-4-lock::before{content:"\F929"}.mdi-wifi-strength-alert-outline::before{content:"\F92A"}.mdi-wifi-strength-lock-outline::before{content:"\F92B"}.mdi-wifi-strength-off::before{content:"\F92C"}.mdi-wifi-strength-off-outline::before{content:"\F92D"}.mdi-wifi-strength-outline::before{content:"\F92E"}.mdi-wii::before{content:"\F5AB"}.mdi-wiiu::before{content:"\F72C"}.mdi-wikipedia::before{content:"\F5AC"}.mdi-wind-turbine::before{content:"\FD81"}.mdi-window-close::before{content:"\F5AD"}.mdi-window-closed::before{content:"\F5AE"}.mdi-window-maximize::before{content:"\F5AF"}.mdi-window-minimize::before{content:"\F5B0"}.mdi-window-open::before{content:"\F5B1"}.mdi-window-restore::before{content:"\F5B2"}.mdi-windows::before{content:"\F5B3"}.mdi-windows-classic::before{content:"\FA20"}.mdi-wiper::before{content:"\FAE8"}.mdi-wiper-wash::before{content:"\FD82"}.mdi-wordpress::before{content:"\F5B4"}.mdi-worker::before{content:"\F5B5"}.mdi-wrap::before{content:"\F5B6"}.mdi-wrap-disabled::before{content:"\FBBB"}.mdi-wrench::before{content:"\F5B7"}.mdi-wrench-outline::before{content:"\FBBC"}.mdi-wunderlist::before{content:"\F5B8"}.mdi-xamarin::before{content:"\F844"}.mdi-xamarin-outline::before{content:"\F845"}.mdi-xaml::before{content:"\F673"}.mdi-xbox::before{content:"\F5B9"}.mdi-xbox-controller::before{content:"\F5BA"}.mdi-xbox-controller-battery-alert::before{content:"\F74A"}.mdi-xbox-controller-battery-charging::before{content:"\FA21"}.mdi-xbox-controller-battery-empty::before{content:"\F74B"}.mdi-xbox-controller-battery-full::before{content:"\F74C"}.mdi-xbox-controller-battery-low::before{content:"\F74D"}.mdi-xbox-controller-battery-medium::before{content:"\F74E"}.mdi-xbox-controller-battery-unknown::before{content:"\F74F"}.mdi-xbox-controller-menu::before{content:"\FE52"}.mdi-xbox-controller-off::before{content:"\F5BB"}.mdi-xbox-controller-view::before{content:"\FE53"}.mdi-xda::before{content:"\F5BC"}.mdi-xing::before{content:"\F5BD"}.mdi-xing-box::before{content:"\F5BE"}.mdi-xing-circle::before{content:"\F5BF"}.mdi-xml::before{content:"\F5C0"}.mdi-xmpp::before{content:"\F7FE"}.mdi-yahoo::before{content:"\FB2A"}.mdi-yammer::before{content:"\F788"}.mdi-yeast::before{content:"\F5C1"}.mdi-yelp::before{content:"\F5C2"}.mdi-yin-yang::before{content:"\F67F"}.mdi-youtube::before{content:"\F5C3"}.mdi-youtube-creator-studio::before{content:"\F846"}.mdi-youtube-gaming::before{content:"\F847"}.mdi-youtube-subscription::before{content:"\FD1C"}.mdi-youtube-tv::before{content:"\F448"}.mdi-z-wave::before{content:"\FAE9"}.mdi-zend::before{content:"\FAEA"}.mdi-zigbee::before{content:"\FD1D"}.mdi-zip-box::before{content:"\F5C4"}.mdi-zip-disk::before{content:"\FA22"}.mdi-zodiac-aquarius::before{content:"\FA7C"}.mdi-zodiac-aries::before{content:"\FA7D"}.mdi-zodiac-cancer::before{content:"\FA7E"}.mdi-zodiac-capricorn::before{content:"\FA7F"}.mdi-zodiac-gemini::before{content:"\FA80"}.mdi-zodiac-leo::before{content:"\FA81"}.mdi-zodiac-libra::before{content:"\FA82"}.mdi-zodiac-pisces::before{content:"\FA83"}.mdi-zodiac-sagittarius::before{content:"\FA84"}.mdi-zodiac-scorpio::before{content:"\FA85"}.mdi-zodiac-taurus::before{content:"\FA86"}.mdi-zodiac-virgo::before{content:"\FA87"}.mdi-blank::before{content:"\F68C";visibility:hidden}.mdi-18px.mdi-set,.mdi-18px.mdi:before{font-size:18px}.mdi-24px.mdi-set,.mdi-24px.mdi:before{font-size:24px}.mdi-36px.mdi-set,.mdi-36px.mdi:before{font-size:36px}.mdi-48px.mdi-set,.mdi-48px.mdi:before{font-size:48px}.mdi-dark:before{color:rgba(0,0,0,0.54)}.mdi-dark.mdi-inactive:before{color:rgba(0,0,0,0.26)}.mdi-light:before{color:#fff}.mdi-light.mdi-inactive:before{color:rgba(255,255,255,0.3)}.mdi-rotate-45:before{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.mdi-rotate-90:before{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.mdi-rotate-135:before{-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg)}.mdi-rotate-180:before{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.mdi-rotate-225:before{-webkit-transform:rotate(225deg);-ms-transform:rotate(225deg);transform:rotate(225deg)}.mdi-rotate-270:before{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.mdi-rotate-315:before{-webkit-transform:rotate(315deg);-ms-transform:rotate(315deg);transform:rotate(315deg)}.mdi-flip-h:before{-webkit-transform:scaleX(-1);transform:scaleX(-1);filter:FlipH;-ms-filter:"FlipH"}.mdi-flip-v:before{-webkit-transform:scaleY(-1);transform:scaleY(-1);filter:FlipV;-ms-filter:"FlipV"}.mdi-spin:before{-webkit-animation:mdi-spin 2s infinite linear;animation:mdi-spin 2s infinite linear}@-webkit-keyframes mdi-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes mdi-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}} -/*# sourceMappingURL=materialdesignicons.css.map */ \ No newline at end of file +/*# sourceMappingURL=materialdesignicons.css.map */ diff --git a/notemyprogress/db/access.php b/notemyprogress/db/access.php index f3fdcaec36b9c5d8d00a77364b919efdc8d84434..d052adf870063d1ca882b727a73818ee7f9820ee 100644 --- a/notemyprogress/db/access.php +++ b/notemyprogress/db/access.php @@ -165,4 +165,30 @@ $capabilities = array( 'student' => CAP_ALLOW, ) ), + + 'local/notemyprogress:teacher_gamification' => array( + 'captype' => 'read', + 'contextlevel' => CONTEXT_COURSE, + 'archetypes' => array( + 'teacher' => CAP_ALLOW, + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), + 'local/notemyprogress:student_gamification' => array( + 'captype' => 'read', + 'contextlevel' => CONTEXT_COURSE, + 'archetypes' => array( + 'student' => CAP_ALLOW, + ) + ), + + + 'local/notemyprogress:earnxp' => array( + 'captype' => 'read', + 'contextlevel' => CONTEXT_MODULE, + 'archetypes' => array( + 'student' => CAP_ALLOW + ), + ), ); diff --git a/notemyprogress/db/events.php b/notemyprogress/db/events.php new file mode 100644 index 0000000000000000000000000000000000000000..7a10a57177ecef0ccf703d1627f16cecf33da2d9 --- /dev/null +++ b/notemyprogress/db/events.php @@ -0,0 +1,38 @@ +<?php +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see <http://www.gnu.org/licenses/>. + +/** + * Observers + * + * @package local_notemyprogress + * @autor Edisson Sigua, Bryan Aguilar + * @copyright 2020 Edisson Sigua <edissonf.sigua@gmail.com>, Bryan Aguilar <bryan.aguilar6174@gmail.com> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$observers = [ + [ + 'eventname' => '*', + 'callback' => 'local_notemyprogress\\observer\\observer::catch_all', + 'internal' => false + ], + [ + 'eventname' => '\\core\\event\\course_deleted', + 'callback' => 'local_notemyprogress\\observer\\observer::course_deleted' + ] +]; \ No newline at end of file diff --git a/notemyprogress/db/install.php b/notemyprogress/db/install.php index 8637b100e653bf6c1f68b91f7f65621298e8087f..f882841f9cfe0e75e5d38600b0e4a8b731ad7789 100644 --- a/notemyprogress/db/install.php +++ b/notemyprogress/db/install.php @@ -35,9 +35,9 @@ function xmldb_local_notemyprogress_install() $goal1 = new stdClass(); $goal2 = new stdClass(); $goal3 = new stdClass(); - $goal1->description = "objectif 1"; - $goal2->description = "objectif 2"; - $goal3->description = "objectif 3"; + $goal1->description = "goal1"; + $goal2->description = "goal2"; + $goal3->description = "goal3"; $DB->insert_record("notemyprogress_goals_ct", $goal1, true); $DB->insert_record("notemyprogress_goals_ct", $goal2, true); $DB->insert_record("notemyprogress_goals_ct", $goal3, true); @@ -155,4 +155,5 @@ function xmldb_local_notemyprogress_install() $answer->questionid = $questionid; $answer->enunciated = 'answers_number_four_option_four'; $DB->insert_record("st_rpt_answers", $answer, true); -} + +} \ No newline at end of file diff --git a/notemyprogress/db/install.xml b/notemyprogress/db/install.xml index c1225693c1d0358a0b3c84b706bd8b76be010d0a..61b51441ca44979aba5fbd8a5477ee631f2183e9 100644 --- a/notemyprogress/db/install.xml +++ b/notemyprogress/db/install.xml @@ -199,5 +199,73 @@ <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" HINTS="userid" COMMENT="userid index"/> </INDEXES> </TABLE> + + <TABLE NAME="notemyprogress_levels_data" COMMENT="Default comment for the table, please edit me"> + <FIELDS> + <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> + <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/> + <FIELD NAME="levelsdata" TYPE="text" NOTNULL="false" SEQUENCE="false"/> + <FIELD NAME="settings" TYPE="text" NOTNULL="false" SEQUENCE="false"/> + <FIELD NAME="rules" TYPE="text" NOTNULL="false" SEQUENCE="false"/> + <FIELD NAME="created_by" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + <FIELD NAME="modified_by" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + <FIELD NAME ="timedeleted" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/> + </FIELDS> + <KEYS> + <KEY NAME="primary" TYPE="primary" FIELDS="id"/> + </KEYS> + </TABLE> + <TABLE NAME="notemyprogress_xp" COMMENT="Esta tabla contiene el nivel y los puntos de experiencia de los usuarios"> + <FIELDS> + <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> + <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + <FIELD NAME="points" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/> + <FIELD NAME="level" TYPE="int" LENGTH="5" NOTNULL="false" SEQUENCE="false"/> + <FIELD NAME="rankable" TYPE="int" LENGTH="5" NOTNULL="false" SEQUENCE="false"/> + </FIELDS> + <KEYS> + <KEY NAME="primary" TYPE="primary" FIELDS="id"/> + </KEYS> + </TABLE> + <TABLE NAME="notemyprogress_xp_log" COMMENT="Esta tabla almacena los eventos por los cuales los estudiantes reciben puntos de experiencia"> + <FIELDS> + <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> + <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/> + <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + <FIELD NAME="event" TYPE="text" NOTNULL="false" SEQUENCE="false"/> + <FIELD NAME="points" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/> + <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + </FIELDS> + <KEYS> + <KEY NAME="primary" TYPE="primary" FIELDS="id"/> + </KEYS> + </TABLE> + <TABLE NAME="notemyprogress_times" COMMENT="notemyprogress students times"> + <FIELDS> + <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> + <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + <FIELD NAME="weeks" TYPE="text" NOTNULL="false" SEQUENCE="false"/> + <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + </FIELDS> + <KEYS> + <KEY NAME="primary" TYPE="primary" FIELDS="id"/> + </KEYS> + </TABLE> + <TABLE NAME="notemyprogress_gamification" COMMENT="gamification parameters"> + <FIELDS> + <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> + <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + <FIELD NAME="enablegamification" TYPE="int" LENGTH="1" NOTNULL="true" SEQUENCE="false" /> + <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/> + </FIELDS> + <KEYS> + <KEY NAME="primary" TYPE="primary" FIELDS="id"/> + </KEYS> + </TABLE> </TABLES> </XMLDB> \ No newline at end of file diff --git a/notemyprogress/db/services.php b/notemyprogress/db/services.php new file mode 100644 index 0000000000000000000000000000000000000000..9784a00f6fd570a83711313ac91fc3bebc5d00a3 --- /dev/null +++ b/notemyprogress/db/services.php @@ -0,0 +1,33 @@ +<?php +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see <http://www.gnu.org/licenses/>. + +/** + * This file defines available ajax calls for mod_millionaire. + * + * @package mod_millionaire + * @copyright 2019 Benedikt Kulmann <b@kulmann.biz> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +$functions = [ + 'local_notemyprogress_get_levels' => [ + 'classname' => 'local_notemyprogress\external\external', + 'methodname' => 'get_levels', + 'description' => 'Get levels for the game overview.', + 'type' => 'read', + 'ajax' => true, + ], +]; \ No newline at end of file diff --git a/notemyprogress/dropout.php b/notemyprogress/dropout.php index fe6dfb0f6cdf3c5576536aeecfa6b372f41e14fa..f4cc7e4f8ef6cf1ff75f0c34bb568fbc49f56489 100644 --- a/notemyprogress/dropout.php +++ b/notemyprogress/dropout.php @@ -94,82 +94,82 @@ $content = [ "pagination_title" => get_string("pagination_title", "local_notemyprogress"), "helplabel" => get_string("helplabel", "local_notemyprogress"), "exitbutton" => get_string("exitbutton", "local_notemyprogress"), - "dropout_no_data" => get_string("fml_dropout_no_data", "local_notemyprogress"), - "dropout_no_users_cluster" => get_string("fml_dropout_no_users_cluster", "local_notemyprogress"), - "generate_data_manually" => get_string("fml_dropout_generate_data_manually", "local_notemyprogress"), - "generating_data" => get_string("fml_dropout_generating_data", "local_notemyprogress"), - "about" => get_string("fml_about", "local_notemyprogress"), - "about_table" => get_string("fml_about_table", "local_notemyprogress"), - - "cluster_label" => get_string("fml_cluster_label", "local_notemyprogress"), - "cluster_select" => get_string("fml_cluster_select", "local_notemyprogress"), + "dropout_no_data" => get_string("nmp_dropout_no_data", "local_notemyprogress"), + "dropout_no_users_cluster" => get_string("nmp_dropout_no_users_cluster", "local_notemyprogress"), + "generate_data_manually" => get_string("nmp_dropout_generate_data_manually", "local_notemyprogress"), + "generating_data" => get_string("nmp_dropout_generating_data", "local_notemyprogress"), + "about" => get_string("nmp_about", "local_notemyprogress"), + "about_table" => get_string("nmp_about_table", "local_notemyprogress"), + + "cluster_label" => get_string("nmp_cluster_label", "local_notemyprogress"), + "cluster_select" => get_string("nmp_cluster_select", "local_notemyprogress"), "thead_name" => get_string("thead_name", "local_notemyprogress"), "thead_lastname" => get_string("thead_lastname", "local_notemyprogress"), "thead_progress" => get_string("thead_progress", "local_notemyprogress"), - "table_title" => get_string("fml_dropout_table_title", "local_notemyprogress"), - "see_profile" => get_string("fml_dropout_see_profile", "local_notemyprogress"), - "send_mail_to_user" => get_string("fml_send_mail_to_user", "local_notemyprogress"), - "send_mail_to_group" => get_string("fml_send_mail_to_group", "local_notemyprogress"), + "table_title" => get_string("nmp_dropout_table_title", "local_notemyprogress"), + "see_profile" => get_string("nmp_dropout_see_profile", "local_notemyprogress"), + "send_mail_to_user" => get_string("nmp_send_mail_to_user", "local_notemyprogress"), + "send_mail_to_group" => get_string("nmp_send_mail_to_group", "local_notemyprogress"), "email_strings" => array( - "validation_subject_text" => get_string("fml_validation_subject_text","local_notemyprogress"), - "validation_message_text" => get_string("fml_validation_message_text","local_notemyprogress"), + "validation_subject_text" => get_string("nmp_validation_subject_text","local_notemyprogress"), + "validation_message_text" => get_string("nmp_validation_message_text","local_notemyprogress"), "subject" => "", "subject_prefix" => $COURSE->fullname, - "subject_label" => get_string("fml_subject_label","local_notemyprogress"), - "message_label" => get_string("fml_message_label","local_notemyprogress"), - - "submit_button" => get_string("fml_submit_button","local_notemyprogress"), - "cancel_button" => get_string("fml_cancel_button","local_notemyprogress"), - "emailform_title" => get_string("fml_emailform_title","local_notemyprogress"), - "sending_text" => get_string("fml_sending_text","local_notemyprogress"), - "recipients_label" => get_string("fml_recipients_label","local_notemyprogress"), - "mailsended_text" => get_string("fml_mailsended_text","local_notemyprogress"), + "subject_label" => get_string("nmp_subject_label","local_notemyprogress"), + "message_label" => get_string("nmp_message_label","local_notemyprogress"), + + "submit_button" => get_string("nmp_submit_button","local_notemyprogress"), + "cancel_button" => get_string("nmp_cancel_button","local_notemyprogress"), + "emailform_title" => get_string("nmp_emailform_title","local_notemyprogress"), + "sending_text" => get_string("nmp_sending_text","local_notemyprogress"), + "recipients_label" => get_string("nmp_recipients_label","local_notemyprogress"), + "mailsended_text" => get_string("nmp_mailsended_text","local_notemyprogress"), "api_error_network" => get_string("api_error_network", "local_notemyprogress"), "scriptname" => $scriptname, ), "modules_strings" => array( - "title" => get_string("fml_modules_access_chart_title","local_notemyprogress"), - "modules_no_viewed" => get_string("fml_modules_no_viewed","local_notemyprogress"), - "modules_viewed" => get_string("fml_modules_viewed","local_notemyprogress"), - "modules_complete" => get_string("fml_modules_complete","local_notemyprogress"), - "close_button" => get_string("fml_close_button","local_notemyprogress"), - "modules_interaction" => get_string("fml_modules_interaction","local_notemyprogress"), - "modules_interactions" => get_string("fml_modules_interactions","local_notemyprogress"), + "title" => get_string("nmp_modules_access_chart_title","local_notemyprogress"), + "modules_no_viewed" => get_string("nmp_modules_no_viewed","local_notemyprogress"), + "modules_viewed" => get_string("nmp_modules_viewed","local_notemyprogress"), + "modules_complete" => get_string("nmp_modules_complete","local_notemyprogress"), + "close_button" => get_string("nmp_close_button","local_notemyprogress"), + "modules_interaction" => get_string("nmp_modules_interaction","local_notemyprogress"), + "modules_interactions" => get_string("nmp_modules_interactions","local_notemyprogress"), ), - "student_progress_title" => get_string("fml_dropout_student_progress_title", "local_notemyprogress"), - "module_label" => get_string("fml_module_label", "local_notemyprogress"), - "modules_label" => get_string("fml_modules_label", "local_notemyprogress"), - "of_conector" => get_string("fml_of_conector", "local_notemyprogress"), - "finished_label" => get_string("fml_finished_label", "local_notemyprogress"), - "finisheds_label" => get_string("fml_finisheds_label", "local_notemyprogress"), + "student_progress_title" => get_string("nmp_dropout_student_progress_title", "local_notemyprogress"), + "module_label" => get_string("nmp_module_label", "local_notemyprogress"), + "modules_label" => get_string("nmp_modules_label", "local_notemyprogress"), + "of_conector" => get_string("nmp_of_conector", "local_notemyprogress"), + "finished_label" => get_string("nmp_finished_label", "local_notemyprogress"), + "finisheds_label" => get_string("nmp_finisheds_label", "local_notemyprogress"), "inverted_time_title" => get_string("thead_time", "local_notemyprogress"), "count_sessions_title" => get_string("thead_sessions", "local_notemyprogress"), - "student_grade_title" => get_string("fml_dropout_student_grade_title", "local_notemyprogress"), - "modules_access_chart_title" => get_string("fml_modules_access_chart_title", "local_notemyprogress"), - "modules_access_chart_series_total" => get_string("fml_modules_access_chart_series_total", "local_notemyprogress"), - "modules_access_chart_series_complete" => get_string("fml_modules_access_chart_series_complete", "local_notemyprogress"), - "modules_access_chart_series_viewed" => get_string("fml_modules_access_chart_series_viewed", "local_notemyprogress"), - "week_modules_chart_title" => get_string("fml_week_modules_chart_title", "local_notemyprogress"), - "modules_amount" => get_string("fml_modules_amount", "local_notemyprogress"), - "modules_details" => get_string("fml_modules_details", "local_notemyprogress"), - "sessions_evolution_chart_title" => get_string("fml_sessions_evolution_chart_title", "local_notemyprogress"), - "sessions_evolution_chart_xaxis1" => get_string("fml_sessions_evolution_chart_xaxis1", "local_notemyprogress"), - "sessions_evolution_chart_xaxis2" => get_string("fml_sessions_evolution_chart_xaxis2", "local_notemyprogress"), - "sessions_evolution_chart_legend1" => get_string("fml_sessions_evolution_chart_legend1", "local_notemyprogress"), - "sessions_evolution_chart_legend2" => get_string("fml_sessions_evolution_chart_legend2", "local_notemyprogress"), - "session_text" => get_string("fml_session_text", "local_notemyprogress"), - "sessions_text" => get_string("fml_sessions_text", "local_notemyprogress"), - "hours_short" => get_string("fml_hours_short", "local_notemyprogress"), - "minutes_short" => get_string("fml_minutes_short", "local_notemyprogress"), - "seconds_short" => get_string("fml_seconds_short", "local_notemyprogress"), - "user_grades_chart_title" => get_string("fml_user_grades_chart_title", "local_notemyprogress"), - "user_grades_chart_yaxis" => get_string("fml_user_grades_chart_yaxis", "local_notemyprogress"), - "user_grades_chart_xaxis" => get_string("fml_user_grades_chart_xaxis", "local_notemyprogress"), - "user_grades_chart_legend" => get_string("fml_user_grades_chart_legend", "local_notemyprogress"), - "user_grades_chart_tooltip_no_graded" => get_string("fml_user_grades_chart_tooltip_no_graded", "local_notemyprogress"), - "user_grades_chart_view_activity" => get_string("fml_user_grades_chart_view_activity", "local_notemyprogress"), + "student_grade_title" => get_string("nmp_dropout_student_grade_title", "local_notemyprogress"), + "modules_access_chart_title" => get_string("nmp_modules_access_chart_title", "local_notemyprogress"), + "modules_access_chart_series_total" => get_string("nmp_modules_access_chart_series_total", "local_notemyprogress"), + "modules_access_chart_series_complete" => get_string("nmp_modules_access_chart_series_complete", "local_notemyprogress"), + "modules_access_chart_series_viewed" => get_string("nmp_modules_access_chart_series_viewed", "local_notemyprogress"), + "week_modules_chart_title" => get_string("nmp_week_modules_chart_title", "local_notemyprogress"), + "modules_amount" => get_string("nmp_modules_amount", "local_notemyprogress"), + "modules_details" => get_string("nmp_modules_details", "local_notemyprogress"), + "sessions_evolution_chart_title" => get_string("nmp_sessions_evolution_chart_title", "local_notemyprogress"), + "sessions_evolution_chart_xaxis1" => get_string("nmp_sessions_evolution_chart_xaxis1", "local_notemyprogress"), + "sessions_evolution_chart_xaxis2" => get_string("nmp_sessions_evolution_chart_xaxis2", "local_notemyprogress"), + "sessions_evolution_chart_legend1" => get_string("nmp_sessions_evolution_chart_legend1", "local_notemyprogress"), + "sessions_evolution_chart_legend2" => get_string("nmp_sessions_evolution_chart_legend2", "local_notemyprogress"), + "session_text" => get_string("nmp_session_text", "local_notemyprogress"), + "sessions_text" => get_string("nmp_sessions_text", "local_notemyprogress"), + "hours_short" => get_string("nmp_hours_short", "local_notemyprogress"), + "minutes_short" => get_string("nmp_minutes_short", "local_notemyprogress"), + "seconds_short" => get_string("nmp_seconds_short", "local_notemyprogress"), + "user_grades_chart_title" => get_string("nmp_user_grades_chart_title", "local_notemyprogress"), + "user_grades_chart_yaxis" => get_string("nmp_user_grades_chart_yaxis", "local_notemyprogress"), + "user_grades_chart_xaxis" => get_string("nmp_user_grades_chart_xaxis", "local_notemyprogress"), + "user_grades_chart_legend" => get_string("nmp_user_grades_chart_legend", "local_notemyprogress"), + "user_grades_chart_tooltip_no_graded" => get_string("nmp_user_grades_chart_tooltip_no_graded", "local_notemyprogress"), + "user_grades_chart_view_activity" => get_string("nmp_user_grades_chart_view_activity", "local_notemyprogress"), ], 'modules_access_colors' => array('#FFD166', '#06D6A0', '#118AB2'), diff --git a/notemyprogress/gamification.php b/notemyprogress/gamification.php new file mode 100644 index 0000000000000000000000000000000000000000..00afb3d9164b8295d689769eec3e8ea5a1d2715d --- /dev/null +++ b/notemyprogress/gamification.php @@ -0,0 +1,132 @@ +<?php + +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see <http://www.gnu.org/licenses/>. + +/** + * local notemyprogress + * + * @package local_notemyprogress + * @copyright 2020 Edisson Sigua <edissonf.sigua@gmail.com>, Bryan Aguilar <bryan.aguilar6174@gmail.com> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +require_once('locallib.php'); +global $COURSE, $USER , $DB; + +$courseid = required_param('courseid', PARAM_INT); +$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST); +$context = context_course::instance($course->id); + +$url = '/local/notemyprogress/gamification.php'; +local_notemyprogress_set_page($course, $url); + +require_capability('local/notemyprogress:usepluggin', $context); +require_capability('local/notemyprogress:teacher_gamification', $context); +require_capability('local/notemyprogress:setweeks', $context); + +$maxTimeSql = "SELECT MAX(timecreated) as maximum from {notemyprogress_gamification} where courseid=? "; +$timecrated = $DB->get_record_sql($maxTimeSql, array("courseid="=>($courseid))); + +$sql = "SELECT enablegamification from {notemyprogress_gamification} where courseid=? AND timecreated=? "; +$value = $DB->get_record_sql($sql, array("courseid="=>($courseid),"timecreated="=>$timecrated->maximum)); +if($value->enablegamification==1){ + $swValue = true; +}else{ + $swValue = false; +} + +$actualLink = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; + +$logs = new \local_notemyprogress\logs($COURSE->id, $USER->id); +$logs->addLogsNMP("viewed", "section", "CONFIGURATION_GAMIFICATION", "configuration_gamification", $actualLink, "Section where teacher can configure gamification"); + +$configgamification = new \local_notemyprogress\configgamification($COURSE->id, $USER->id); +$es = new \local_notemyprogress\event_strategy($COURSE, $USER); +$reports = new \local_notemyprogress\teacher($COURSE->id, $USER->id); + + + +$content = [ + 'strings' =>[ + 'title' => get_string('tg_section_title', 'local_notemyprogress'), + 'help_title' => get_string('tg_section_help_title', 'local_notemyprogress'), + 'help_description' => get_string('tg_section_help_description', 'local_notemyprogress'), + 'helplabel' => get_string("helplabel","local_notemyprogress"), + 'error_network' => get_string('nmp_api_error_network', 'local_notemyprogress'), + 'save_successful' => get_string('nmp_api_save_successful', 'local_notemyprogress'), + 'cancel_action' => get_string('nmp_api_cancel_action', 'local_notemyprogress'), + 'save_warning_title' => get_string('tg_save_warning_title', 'local_notemyprogress'), + 'save_warning_content' => get_string('tg_save_warning_content', 'local_notemyprogress'), + 'confirm_ok' => get_string('tg_confirm_ok', 'local_notemyprogress'), + 'confirm_cancel' => get_string('tg_confirm_cancel', 'local_notemyprogress'), + 'exitbutton' => get_string("exitbutton","local_notemyprogress"), + 'save' => get_string("tg_save","local_notemyprogress"), + 'preview' => get_string("tg_section_preview","local_notemyprogress"), + 'information' => get_string("tg_section_information","local_notemyprogress"), + 'ranking' => get_string("tg_section_ranking","local_notemyprogress"), + 'settings' => get_string("tg_section_settings","local_notemyprogress"), + 'points' => get_string("tg_section_points","local_notemyprogress"), + 'no_description' => get_string("tg_section_no_description","local_notemyprogress"), + 'no_name' => get_string("tg_section_no_name","local_notemyprogress"), + 'description' => get_string("tg_section_description","local_notemyprogress"), + 'to_next_level' => get_string("tg_section_preview_next_level","local_notemyprogress"), + 'ranking_text' => get_string("tg_section_ranking_ranking_text","local_notemyprogress"), + 'level' => get_string("tg_section_ranking_level","local_notemyprogress"), + 'student' => get_string("tg_section_ranking_student","local_notemyprogress"), + 'total' => get_string("tg_section_ranking_total","local_notemyprogress"), + 'progress' => get_string("tg_section_ranking_progress","local_notemyprogress"), + 'appearance' => get_string("tg_section_settings_appearance","local_notemyprogress"), + 'appearance_title' => get_string("tg_section_settings_appearance_title","local_notemyprogress"), + 'settings_level' => get_string("tg_section_settings_levels","local_notemyprogress"), + 'quantity' => get_string("tg_section_settings_levels_quantity","local_notemyprogress"), + 'base_points' => get_string("tg_section_settings_levels_base_points","local_notemyprogress"), + 'calculated' => get_string("tg_section_settings_levels_calculated","local_notemyprogress"), + 'manually' => get_string("tg_section_settings_levels_manually","local_notemyprogress"), + 'name' => get_string("tg_section_settings_levels_name","local_notemyprogress"), + 'levels_required' => get_string("tg_section_settings_levels_required","local_notemyprogress"), + 'rules' => get_string("tg_section_settings_rules","local_notemyprogress"), + 'add_rule' => get_string("tg_section_settings_add_rule","local_notemyprogress"), + 'earn' => get_string("tg_section_settings_earn","local_notemyprogress"), + 'select_event' => get_string("tg_section_settings_select_event","local_notemyprogress"), + 'enable'=>get_string("EnableGame","local_notemyprogress"), + 'swValue'=>$swValue, + 'chart' => $reports->get_chart_langs(), + 'pointError'=>get_string("game_point_error","local_notemyprogress"), + 'eventError'=>get_string("game_event_error","local_notemyprogress"), + 'nameError'=>get_string("game_name_error","local_notemyprogress"), + 'chartTitle'=>get_string("gm_Chart_Title","local_notemyprogress"), + 'chartYaxis'=>get_string("gm_Chart_Y","local_notemyprogress"), + ], + 'token' => local_notemyprogress_generate_token($COURSE->id, $USER->id, "teacher"), + 'userid' => $USER->id, + 'courseid' => $courseid, + 'levels_data' => $configgamification->get_levels_data(), + 'ranking' => $es->get_ranking(0), + 'events' => $configgamification->events_list(), + 'image' => $OUTPUT->image_url('badge', 'local_notemyprogress'), + 'indicators' => $reports->get_general_indicators(), + 'profile_render' => $reports->render_has(), + 'timezone' => $reports->timezone, + 'chart_data' => $configgamification->get_spread_chart($COURSE->id), +]; + +$templatecontext = [ + 'image' => $OUTPUT->image_url('badge', 'local_notemyprogress') +]; + +$PAGE->requires->js_call_amd('local_notemyprogress/gamification','init', ['content' => $content]); +echo $OUTPUT->header(); +echo $OUTPUT->render_from_template('local_notemyprogress/gamification', $templatecontext); +echo $OUTPUT->footer(); \ No newline at end of file diff --git a/notemyprogress/grades.php b/notemyprogress/grades.php index 4b7a537d37135b687eac7e78939f6d00f645b242..fdd33173ddd6da800b08073cb8ae428af014796d 100644 --- a/notemyprogress/grades.php +++ b/notemyprogress/grades.php @@ -76,56 +76,56 @@ $content = [ "api_error_network" => get_string("api_error_network", "local_notemyprogress"), "helplabel" => get_string("helplabel", "local_notemyprogress"), "exitbutton" => get_string("exitbutton", "local_notemyprogress"), - "about" => get_string("fml_about", "local_notemyprogress"), - - "grades_select_label" => get_string("fml_grades_select_label", "local_notemyprogress"), - "grades_chart_title" => get_string("fml_grades_chart_title", 'local_notemyprogress'), - "grades_yaxis_title" => get_string("fml_grades_yaxis_title", 'local_notemyprogress'), - "grades_tooltip_average" => get_string("fml_grades_tooltip_average", 'local_notemyprogress'), - "grades_tooltip_grade" => get_string("fml_grades_tooltip_grade", 'local_notemyprogress'), - "grades_tooltip_student" => get_string("fml_grades_tooltip_student", 'local_notemyprogress'), - "grades_tooltip_students" => get_string("fml_grades_tooltip_students", 'local_notemyprogress'), - "grades_greater_than" => get_string("fml_grades_distribution_greater_than", 'local_notemyprogress'), - "grades_smaller_than" => get_string("fml_grades_distribution_smaller_than", 'local_notemyprogress'), - "grades_details_subtitle" => get_string("fml_grades_details_subtitle", 'local_notemyprogress'), - "grades_distribution_subtitle" => get_string("fml_grades_distribution_subtitle", 'local_notemyprogress'), - "grades_distribution_yaxis_title" => get_string("fml_grades_distribution_yaxis_title", 'local_notemyprogress'), - "grades_distribution_tooltip_prefix" => get_string("fml_grades_distribution_tooltip_prefix", 'local_notemyprogress'), - "grades_distribution_tooltip_suffix" => get_string("fml_grades_distribution_tooltip_suffix", 'local_notemyprogress'), - "student_text" => get_string("fml_student_text", "local_notemyprogress"), - "students_text" => get_string("fml_students_text", "local_notemyprogress"), + "about" => get_string("nmp_about", "local_notemyprogress"), + + "grades_select_label" => get_string("nmp_grades_select_label", "local_notemyprogress"), + "grades_chart_title" => get_string("nmp_grades_chart_title", 'local_notemyprogress'), + "grades_yaxis_title" => get_string("nmp_grades_yaxis_title", 'local_notemyprogress'), + "grades_tooltip_average" => get_string("nmp_grades_tooltip_average", 'local_notemyprogress'), + "grades_tooltip_grade" => get_string("nmp_grades_tooltip_grade", 'local_notemyprogress'), + "grades_tooltip_student" => get_string("nmp_grades_tooltip_student", 'local_notemyprogress'), + "grades_tooltip_students" => get_string("nmp_grades_tooltip_students", 'local_notemyprogress'), + "grades_greater_than" => get_string("nmp_grades_distribution_greater_than", 'local_notemyprogress'), + "grades_smaller_than" => get_string("nmp_grades_distribution_smaller_than", 'local_notemyprogress'), + "grades_details_subtitle" => get_string("nmp_grades_details_subtitle", 'local_notemyprogress'), + "grades_distribution_subtitle" => get_string("nmp_grades_distribution_subtitle", 'local_notemyprogress'), + "grades_distribution_yaxis_title" => get_string("nmp_grades_distribution_yaxis_title", 'local_notemyprogress'), + "grades_distribution_tooltip_prefix" => get_string("nmp_grades_distribution_tooltip_prefix", 'local_notemyprogress'), + "grades_distribution_tooltip_suffix" => get_string("nmp_grades_distribution_tooltip_suffix", 'local_notemyprogress'), + "student_text" => get_string("nmp_student_text", "local_notemyprogress"), + "students_text" => get_string("nmp_students_text", "local_notemyprogress"), "email_strings" => array( - "validation_subject_text" => get_string("fml_validation_subject_text","local_notemyprogress"), - "validation_message_text" => get_string("fml_validation_message_text","local_notemyprogress"), + "validation_subject_text" => get_string("nmp_validation_subject_text","local_notemyprogress"), + "validation_message_text" => get_string("nmp_validation_message_text","local_notemyprogress"), "subject" => "", "subject_prefix" => $COURSE->fullname, - "subject_label" => get_string("fml_subject_label","local_notemyprogress"), - "message_label" => get_string("fml_message_label","local_notemyprogress"), - - "submit_button" => get_string("fml_submit_button","local_notemyprogress"), - "cancel_button" => get_string("fml_cancel_button","local_notemyprogress"), - "emailform_title" => get_string("fml_emailform_title","local_notemyprogress"), - "sending_text" => get_string("fml_sending_text","local_notemyprogress"), - "recipients_label" => get_string("fml_recipients_label","local_notemyprogress"), - "mailsended_text" => get_string("fml_mailsended_text","local_notemyprogress"), + "subject_label" => get_string("nmp_subject_label","local_notemyprogress"), + "message_label" => get_string("nmp_message_label","local_notemyprogress"), + + "submit_button" => get_string("nmp_submit_button","local_notemyprogress"), + "cancel_button" => get_string("nmp_cancel_button","local_notemyprogress"), + "emailform_title" => get_string("nmp_emailform_title","local_notemyprogress"), + "sending_text" => get_string("nmp_sending_text","local_notemyprogress"), + "recipients_label" => get_string("nmp_recipients_label","local_notemyprogress"), + "mailsended_text" => get_string("nmp_mailsended_text","local_notemyprogress"), "api_error_network" => get_string("api_error_network", "local_notemyprogress"), "scriptname" => $scriptname, ), "grade_item_details_categories" => array( - get_string("fml_grades_best_grade","local_notemyprogress"), - get_string("fml_grades_average_grade","local_notemyprogress"), - get_string("fml_grades_worst_grade","local_notemyprogress"), + get_string("nmp_grades_best_grade","local_notemyprogress"), + get_string("nmp_grades_average_grade","local_notemyprogress"), + get_string("nmp_grades_worst_grade","local_notemyprogress"), ), - "grades_best_grade" => get_string("fml_grades_best_grade","local_notemyprogress"), - "grades_average_grade" => get_string("fml_grades_average_grade","local_notemyprogress"), - "grades_worst_grade" => get_string("fml_grades_worst_grade","local_notemyprogress"), + "grades_best_grade" => get_string("nmp_grades_best_grade","local_notemyprogress"), + "grades_average_grade" => get_string("nmp_grades_average_grade","local_notemyprogress"), + "grades_worst_grade" => get_string("nmp_grades_worst_grade","local_notemyprogress"), "grade_item_details_title" => "", - "view_details" => get_string("fml_view_details", "local_notemyprogress"), - "send_mail" => get_string("fml_send_mail", "local_notemyprogress"), + "view_details" => get_string("nmp_view_details", "local_notemyprogress"), + "send_mail" => get_string("nmp_send_mail", "local_notemyprogress"), ], 'grade_items_average_colors' => array('#118AB2'), diff --git a/notemyprogress/js/alertify.js b/notemyprogress/js/alertify.js index 745a8a92965c172f231b528782f35106efec7de0..33a34522a46302071f7a3ef8f509c40a93b2749a 100644 --- a/notemyprogress/js/alertify.js +++ b/notemyprogress/js/alertify.js @@ -1,3609 +1,3831 @@ /** * alertifyjs 1.11.4 http://alertifyjs.com * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. - * Copyright 2019 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) + * Copyright 2019 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/ -( function ( window ) { - 'use strict'; - +(function (window) { + "use strict"; + + /** + * Keys enum + * @type {Object} + */ + var keys = { + ENTER: 13, + ESC: 27, + F1: 112, + F12: 123, + LEFT: 37, + RIGHT: 39, + }; + /** + * Default options + * @type {Object} + */ + var defaults = { + autoReset: true, + basic: false, + closable: true, + closableByDimmer: true, + frameless: false, + maintainFocus: true, //global default not per instance, applies to all dialogs + maximizable: true, + modal: true, + movable: true, + moveBounded: false, + overflow: true, + padding: true, + pinnable: true, + pinned: true, + preventBodyShift: false, //global default not per instance, applies to all dialogs + resizable: true, + startMaximized: false, + transition: "pulse", + notifier: { + delay: 5, + position: "bottom-right", + closeButton: false, + }, + glossary: { + title: "AlertifyJS", + ok: "OK", + cancel: "Cancel", + acccpt: "Accept", + deny: "Deny", + confirm: "Confirm", + decline: "Decline", + close: "Close", + maximize: "Maximize", + restore: "Restore", + }, + theme: { + input: "ajs-input", + ok: "ajs-ok", + cancel: "ajs-cancel", + }, + }; + + //holds open dialogs instances + var openDialogs = []; + + /** + * [Helper] Adds the specified class(es) to the element. + * + * @element {node} The element + * @className {string} One or more space-separated classes to be added to the class attribute of the element. + * + * @return {undefined} + */ + function addClass(element, classNames) { + element.className += " " + classNames; + } + + /** + * [Helper] Removes the specified class(es) from the element. + * + * @element {node} The element + * @className {string} One or more space-separated classes to be removed from the class attribute of the element. + * + * @return {undefined} + */ + function removeClass(element, classNames) { + var original = element.className.split(" "); + var toBeRemoved = classNames.split(" "); + for (var x = 0; x < toBeRemoved.length; x += 1) { + var index = original.indexOf(toBeRemoved[x]); + if (index > -1) { + original.splice(index, 1); + } + } + element.className = original.join(" "); + } + + /** + * [Helper] Checks if the document is RTL + * + * @return {Boolean} True if the document is RTL, false otherwise. + */ + function isRightToLeft() { + return window.getComputedStyle(document.body).direction === "rtl"; + } + /** + * [Helper] Get the document current scrollTop + * + * @return {Number} current document scrollTop value + */ + function getScrollTop() { + return ( + (document.documentElement && document.documentElement.scrollTop) || + document.body.scrollTop + ); + } + + /** + * [Helper] Get the document current scrollLeft + * + * @return {Number} current document scrollLeft value + */ + function getScrollLeft() { + return ( + (document.documentElement && document.documentElement.scrollLeft) || + document.body.scrollLeft + ); + } + + /** + * Helper: clear contents + * + */ + function clearContents(element) { + while (element.lastChild) { + element.removeChild(element.lastChild); + } + } + /** + * Extends a given prototype by merging properties from base into sub. + * + * @sub {Object} sub The prototype being overwritten. + * @base {Object} base The prototype being written. + * + * @return {Object} The extended prototype. + */ + function copy(src) { + if (null === src) { + return src; + } + var cpy; + if (Array.isArray(src)) { + cpy = []; + for (var x = 0; x < src.length; x += 1) { + cpy.push(copy(src[x])); + } + return cpy; + } + + if (src instanceof Date) { + return new Date(src.getTime()); + } + + if (src instanceof RegExp) { + cpy = new RegExp(src.source); + cpy.global = src.global; + cpy.ignoreCase = src.ignoreCase; + cpy.multiline = src.multiline; + cpy.lastIndex = src.lastIndex; + return cpy; + } + + if (typeof src === "object") { + cpy = {}; + // copy dialog pototype over definition. + for (var prop in src) { + if (src.hasOwnProperty(prop)) { + cpy[prop] = copy(src[prop]); + } + } + return cpy; + } + return src; + } + /** + * Helper: destruct the dialog + * + */ + function destruct(instance, initialize) { + if (instance.elements) { + //delete the dom and it's references. + var root = instance.elements.root; + root.parentNode.removeChild(root); + delete instance.elements; + //copy back initial settings. + instance.settings = copy(instance.__settings); + //re-reference init function. + instance.__init = initialize; + //delete __internal variable to allow re-initialization. + delete instance.__internal; + } + } + + /** + * Use a closure to return proper event listener method. Try to use + * `addEventListener` by default but fallback to `attachEvent` for + * unsupported browser. The closure simply ensures that the test doesn't + * happen every time the method is called. + * + * @param {Node} el Node element + * @param {String} event Event type + * @param {Function} fn Callback of event + * @return {Function} + */ + var on = (function () { + if (document.addEventListener) { + return function (el, event, fn, useCapture) { + el.addEventListener(event, fn, useCapture === true); + }; + } else if (document.attachEvent) { + return function (el, event, fn) { + el.attachEvent("on" + event, fn); + }; + } + })(); + + /** + * Use a closure to return proper event listener method. Try to use + * `removeEventListener` by default but fallback to `detachEvent` for + * unsupported browser. The closure simply ensures that the test doesn't + * happen every time the method is called. + * + * @param {Node} el Node element + * @param {String} event Event type + * @param {Function} fn Callback of event + * @return {Function} + */ + var off = (function () { + if (document.removeEventListener) { + return function (el, event, fn, useCapture) { + el.removeEventListener(event, fn, useCapture === true); + }; + } else if (document.detachEvent) { + return function (el, event, fn) { + el.detachEvent("on" + event, fn); + }; + } + })(); + + /** + * Prevent default event from firing + * + * @param {Event} event Event object + * @return {undefined} + + function prevent ( event ) { + if ( event ) { + if ( event.preventDefault ) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + } + */ + var transition = (function () { + var t, type; + var supported = false; + var transitions = { + animation: "animationend", + OAnimation: "oAnimationEnd oanimationend", + msAnimation: "MSAnimationEnd", + MozAnimation: "animationend", + WebkitAnimation: "webkitAnimationEnd", + }; + + for (t in transitions) { + if (document.documentElement.style[t] !== undefined) { + type = transitions[t]; + supported = true; + break; + } + } + + return { + type: type, + supported: supported, + }; + })(); + + /** + * Creates event handler delegate that sends the instance as last argument. + * + * @return {Function} a function wrapper which sends the instance as last argument. + */ + function delegate(context, method) { + return function () { + if (arguments.length > 0) { + var args = []; + for (var x = 0; x < arguments.length; x += 1) { + args.push(arguments[x]); + } + args.push(context); + return method.apply(context, args); + } + return method.apply(context, [null, context]); + }; + } + /** + * Helper for creating a dialog close event. + * + * @return {object} + */ + function createCloseEvent(index, button) { + return { + index: index, + button: button, + cancel: false, + }; + } + /** + * Helper for dispatching events. + * + * @param {string} evenType The type of the event to disptach. + * @param {object} instance The dialog instance disptaching the event. + * + * @return {any} The result of the invoked function. + */ + function dispatchEvent(eventType, instance) { + if (typeof instance.get(eventType) === "function") { + return instance.get(eventType).call(instance); + } + } + + /** + * Super class for all dialogs + * + * @return {Object} base dialog prototype + */ + var dialog = (function () { + var //holds the list of used keys. + usedKeys = [], + //dummy variable, used to trigger dom reflow. + reflow = null, + //holds body tab index in case it has any. + tabindex = false, + //condition for detecting safari + isSafari = + window.navigator.userAgent.indexOf("Safari") > -1 && + window.navigator.userAgent.indexOf("Chrome") < 0, + //dialog building blocks + templates = { + dimmer: '<div class="ajs-dimmer"></div>', + /*tab index required to fire click event before body focus*/ + modal: '<div class="ajs-modal" tabindex="0"></div>', + dialog: '<div class="ajs-dialog" tabindex="0"></div>', + reset: '<button class="ajs-reset"></button>', + commands: + '<div class="ajs-commands"><button class="ajs-pin"></button><button class="ajs-maximize"></button><button class="ajs-close"></button></div>', + header: '<div class="ajs-header"></div>', + body: '<div class="ajs-body"></div>', + content: '<div class="ajs-content"></div>', + footer: '<div class="ajs-footer"></div>', + buttons: { + primary: '<div class="ajs-primary ajs-buttons"></div>', + auxiliary: '<div class="ajs-auxiliary ajs-buttons"></div>', + }, + button: '<button class="ajs-button"></button>', + resizeHandle: '<div class="ajs-handle"></div>', + }, + //common class names + classes = { + animationIn: "ajs-in", + animationOut: "ajs-out", + base: "alertify", + basic: "ajs-basic", + capture: "ajs-capture", + closable: "ajs-closable", + fixed: "ajs-fixed", + frameless: "ajs-frameless", + hidden: "ajs-hidden", + maximize: "ajs-maximize", + maximized: "ajs-maximized", + maximizable: "ajs-maximizable", + modeless: "ajs-modeless", + movable: "ajs-movable", + noSelection: "ajs-no-selection", + noOverflow: "ajs-no-overflow", + noPadding: "ajs-no-padding", + pin: "ajs-pin", + pinnable: "ajs-pinnable", + prefix: "ajs-", + resizable: "ajs-resizable", + restore: "ajs-restore", + shake: "ajs-shake", + unpinned: "ajs-unpinned", + }; + /** - * Keys enum - * @type {Object} + * Helper: initializes the dialog instance + * + * @return {Number} The total count of currently open modals. */ - var keys = { - ENTER: 13, - ESC: 27, - F1: 112, - F12: 123, - LEFT: 37, - RIGHT: 39 - }; + function initialize(instance) { + if (!instance.__internal) { + //no need to expose init after this. + delete instance.__init; + + //keep a copy of initial dialog settings + if (!instance.__settings) { + instance.__settings = copy(instance.settings); + } + + //get dialog buttons/focus setup + var setup; + if (typeof instance.setup === "function") { + setup = instance.setup(); + setup.options = setup.options || {}; + setup.focus = setup.focus || {}; + } else { + setup = { + buttons: [], + focus: { + element: null, + select: false, + }, + options: {}, + }; + } + + //initialize hooks object. + if (typeof instance.hooks !== "object") { + instance.hooks = {}; + } + + //copy buttons defintion + var buttonsDefinition = []; + if (Array.isArray(setup.buttons)) { + for (var b = 0; b < setup.buttons.length; b += 1) { + var ref = setup.buttons[b], + cpy = {}; + for (var i in ref) { + if (ref.hasOwnProperty(i)) { + cpy[i] = ref[i]; + } + } + buttonsDefinition.push(cpy); + } + } + + var internal = (instance.__internal = { + /** + * Flag holding the open state of the dialog + * + * @type {Boolean} + */ + isOpen: false, + /** + * Active element is the element that will receive focus after + * closing the dialog. It defaults as the body tag, but gets updated + * to the last focused element before the dialog was opened. + * + * @type {Node} + */ + activeElement: document.body, + timerIn: undefined, + timerOut: undefined, + buttons: buttonsDefinition, + focus: setup.focus, + options: { + title: undefined, + modal: undefined, + basic: undefined, + frameless: undefined, + pinned: undefined, + movable: undefined, + moveBounded: undefined, + resizable: undefined, + autoReset: undefined, + closable: undefined, + closableByDimmer: undefined, + maximizable: undefined, + startMaximized: undefined, + pinnable: undefined, + transition: undefined, + padding: undefined, + overflow: undefined, + onshow: undefined, + onclosing: undefined, + onclose: undefined, + onfocus: undefined, + onmove: undefined, + onmoved: undefined, + onresize: undefined, + onresized: undefined, + onmaximize: undefined, + onmaximized: undefined, + onrestore: undefined, + onrestored: undefined, + }, + resetHandler: undefined, + beginMoveHandler: undefined, + beginResizeHandler: undefined, + bringToFrontHandler: undefined, + modalClickHandler: undefined, + buttonsClickHandler: undefined, + commandsClickHandler: undefined, + transitionInHandler: undefined, + transitionOutHandler: undefined, + destroy: undefined, + }); + + var elements = {}; + //root node + elements.root = document.createElement("div"); + //prevent FOUC in case of async styles loading. + elements.root.style.display = "none"; + elements.root.className = classes.base + " " + classes.hidden + " "; + + elements.root.innerHTML = templates.dimmer + templates.modal; + + //dimmer + elements.dimmer = elements.root.firstChild; + + //dialog + elements.modal = elements.root.lastChild; + elements.modal.innerHTML = templates.dialog; + elements.dialog = elements.modal.firstChild; + elements.dialog.innerHTML = + templates.reset + + templates.commands + + templates.header + + templates.body + + templates.footer + + templates.resizeHandle + + templates.reset; + + //reset links + elements.reset = []; + elements.reset.push(elements.dialog.firstChild); + elements.reset.push(elements.dialog.lastChild); + + //commands + elements.commands = {}; + elements.commands.container = elements.reset[0].nextSibling; + elements.commands.pin = elements.commands.container.firstChild; + elements.commands.maximize = elements.commands.pin.nextSibling; + elements.commands.close = elements.commands.maximize.nextSibling; + + //header + elements.header = elements.commands.container.nextSibling; + + //body + elements.body = elements.header.nextSibling; + elements.body.innerHTML = templates.content; + elements.content = elements.body.firstChild; + + //footer + elements.footer = elements.body.nextSibling; + elements.footer.innerHTML = + templates.buttons.auxiliary + templates.buttons.primary; + + //resize handle + elements.resizeHandle = elements.footer.nextSibling; + + //buttons + elements.buttons = {}; + elements.buttons.auxiliary = elements.footer.firstChild; + elements.buttons.primary = elements.buttons.auxiliary.nextSibling; + elements.buttons.primary.innerHTML = templates.button; + elements.buttonTemplate = elements.buttons.primary.firstChild; + //remove button template + elements.buttons.primary.removeChild(elements.buttonTemplate); + + for (var x = 0; x < instance.__internal.buttons.length; x += 1) { + var button = instance.__internal.buttons[x]; + + // add to the list of used keys. + if (usedKeys.indexOf(button.key) < 0) { + usedKeys.push(button.key); + } + + button.element = elements.buttonTemplate.cloneNode(); + button.element.innerHTML = button.text; + if (typeof button.className === "string" && button.className !== "") { + addClass(button.element, button.className); + } + for (var key in button.attrs) { + if (key !== "className" && button.attrs.hasOwnProperty(key)) { + button.element.setAttribute(key, button.attrs[key]); + } + } + if (button.scope === "auxiliary") { + elements.buttons.auxiliary.appendChild(button.element); + } else { + elements.buttons.primary.appendChild(button.element); + } + } + //make elements pubic + instance.elements = elements; + + //save event handlers delegates + internal.resetHandler = delegate(instance, onReset); + internal.beginMoveHandler = delegate(instance, beginMove); + internal.beginResizeHandler = delegate(instance, beginResize); + internal.bringToFrontHandler = delegate(instance, bringToFront); + internal.modalClickHandler = delegate(instance, modalClickHandler); + internal.buttonsClickHandler = delegate(instance, buttonsClickHandler); + internal.commandsClickHandler = delegate( + instance, + commandsClickHandler + ); + internal.transitionInHandler = delegate( + instance, + handleTransitionInEvent + ); + internal.transitionOutHandler = delegate( + instance, + handleTransitionOutEvent + ); + + //settings + for (var opKey in internal.options) { + if (setup.options[opKey] !== undefined) { + // if found in user options + instance.set(opKey, setup.options[opKey]); + } else if (alertify.defaults.hasOwnProperty(opKey)) { + // else if found in defaults options + instance.set(opKey, alertify.defaults[opKey]); + } else if (opKey === "title") { + // else if title key, use alertify.defaults.glossary + instance.set(opKey, alertify.defaults.glossary[opKey]); + } + } + + // allow dom customization + if (typeof instance.build === "function") { + instance.build(); + } + } + + //add to the end of the DOM tree. + document.body.appendChild(instance.elements.root); + } + /** - * Default options - * @type {Object} + * Helper: maintains scroll position + * */ - var defaults = { - autoReset:true, - basic:false, - closable:true, - closableByDimmer:true, - frameless:false, - maintainFocus:true, //global default not per instance, applies to all dialogs - maximizable:true, - modal:true, - movable:true, - moveBounded:false, - overflow:true, - padding: true, - pinnable:true, - pinned:true, - preventBodyShift:false, //global default not per instance, applies to all dialogs - resizable:true, - startMaximized:false, - transition:'pulse', - notifier:{ - delay:5, - position:'bottom-right', - closeButton:false - }, - glossary:{ - title:'AlertifyJS', - ok: 'OK', - cancel: 'Cancel', - acccpt: 'Accept', - deny: 'Deny', - confirm: 'Confirm', - decline: 'Decline', - close: 'Close', - maximize: 'Maximize', - restore: 'Restore', - }, - theme:{ - input:'ajs-input', - ok:'ajs-ok', - cancel:'ajs-cancel', - } - }; - - //holds open dialogs instances - var openDialogs = []; + var scrollX, scrollY; + function saveScrollPosition() { + scrollX = getScrollLeft(); + scrollY = getScrollTop(); + } + function restoreScrollPosition() { + window.scrollTo(scrollX, scrollY); + } /** - * [Helper] Adds the specified class(es) to the element. + * Helper: adds/removes no-overflow class from body + * + */ + function ensureNoOverflow() { + var requiresNoOverflow = 0; + for (var x = 0; x < openDialogs.length; x += 1) { + var instance = openDialogs[x]; + if (instance.isModal() || instance.isMaximized()) { + requiresNoOverflow += 1; + } + } + if ( + requiresNoOverflow === 0 && + document.body.className.indexOf(classes.noOverflow) >= 0 + ) { + //last open modal or last maximized one + removeClass(document.body, classes.noOverflow); + preventBodyShift(false); + } else if ( + requiresNoOverflow > 0 && + document.body.className.indexOf(classes.noOverflow) < 0 + ) { + //first open modal or first maximized one + preventBodyShift(true); + addClass(document.body, classes.noOverflow); + } + } + var top = "", + topScroll = 0; + /** + * Helper: prevents body shift. + * + */ + function preventBodyShift(add) { + if (alertify.defaults.preventBodyShift) { + if ( + add && + document.documentElement.scrollHeight > + document.documentElement.clientHeight + ) { + //&& openDialogs[openDialogs.length-1].elements.dialog.clientHeight <= document.documentElement.clientHeight){ + topScroll = scrollY; + top = window.getComputedStyle(document.body).top; + addClass(document.body, classes.fixed); + document.body.style.top = -scrollY + "px"; + } else if (!add) { + scrollY = topScroll; + document.body.style.top = top; + removeClass(document.body, classes.fixed); + restoreScrollPosition(); + } + } + } + + /** + * Sets the name of the transition used to show/hide the dialog + * + * @param {Object} instance The dilog instance. * - * @element {node} The element - * @className {string} One or more space-separated classes to be added to the class attribute of the element. - * - * @return {undefined} */ - function addClass(element,classNames){ - element.className += ' ' + classNames; + function updateTransition(instance, value, oldValue) { + if (typeof oldValue === "string") { + removeClass(instance.elements.root, classes.prefix + oldValue); + } + addClass(instance.elements.root, classes.prefix + value); + reflow = instance.elements.root.offsetWidth; } - + /** - * [Helper] Removes the specified class(es) from the element. + * Toggles the dialog display mode + * + * @param {Object} instance The dilog instance. * - * @element {node} The element - * @className {string} One or more space-separated classes to be removed from the class attribute of the element. - * * @return {undefined} */ - function removeClass(element, classNames) { - var original = element.className.split(' '); - var toBeRemoved = classNames.split(' '); - for (var x = 0; x < toBeRemoved.length; x += 1) { - var index = original.indexOf(toBeRemoved[x]); - if (index > -1){ - original.splice(index,1); - } + function updateDisplayMode(instance) { + if (instance.get("modal")) { + //make modal + removeClass(instance.elements.root, classes.modeless); + + //only if open + if (instance.isOpen()) { + unbindModelessEvents(instance); + + //in case a pinned modless dialog was made modal while open. + updateAbsPositionFix(instance); + + ensureNoOverflow(); + } + } else { + //make modelss + addClass(instance.elements.root, classes.modeless); + + //only if open + if (instance.isOpen()) { + bindModelessEvents(instance); + + //in case pin/unpin was called while a modal is open + updateAbsPositionFix(instance); + + ensureNoOverflow(); } - element.className = original.join(' '); + } } /** - * [Helper] Checks if the document is RTL + * Toggles the dialog basic view mode + * + * @param {Object} instance The dilog instance. * - * @return {Boolean} True if the document is RTL, false otherwise. + * @return {undefined} */ - function isRightToLeft(){ - return window.getComputedStyle(document.body).direction === 'rtl'; + function updateBasicMode(instance) { + if (instance.get("basic")) { + // add class + addClass(instance.elements.root, classes.basic); + } else { + // remove class + removeClass(instance.elements.root, classes.basic); + } } + /** - * [Helper] Get the document current scrollTop + * Toggles the dialog frameless view mode * - * @return {Number} current document scrollTop value + * @param {Object} instance The dilog instance. + * + * @return {undefined} */ - function getScrollTop(){ - return ((document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop); + function updateFramelessMode(instance) { + if (instance.get("frameless")) { + // add class + addClass(instance.elements.root, classes.frameless); + } else { + // remove class + removeClass(instance.elements.root, classes.frameless); + } } /** - * [Helper] Get the document current scrollLeft + * Helper: Brings the modeless dialog to front, attached to modeless dialogs. * - * @return {Number} current document scrollLeft value + * @param {Event} event Focus event + * @param {Object} instance The dilog instance. + * + * @return {undefined} */ - function getScrollLeft(){ - return ((document.documentElement && document.documentElement.scrollLeft) || document.body.scrollLeft); + function bringToFront(event, instance) { + // Do not bring to front if preceeded by an open modal + var index = openDialogs.indexOf(instance); + for (var x = index + 1; x < openDialogs.length; x += 1) { + if (openDialogs[x].isModal()) { + return; + } + } + + // Bring to front by making it the last child. + if (document.body.lastChild !== instance.elements.root) { + document.body.appendChild(instance.elements.root); + //also make sure its at the end of the list + openDialogs.splice(openDialogs.indexOf(instance), 1); + openDialogs.push(instance); + setFocus(instance); + } + + return false; } /** - * Helper: clear contents - * - */ - function clearContents(element){ - while (element.lastChild) { - element.removeChild(element.lastChild); - } + * Helper: reflects dialogs options updates + * + * @param {Object} instance The dilog instance. + * @param {String} option The updated option name. + * + * @return {undefined} + */ + function optionUpdated(instance, option, oldValue, newValue) { + switch (option) { + case "title": + instance.setHeader(newValue); + break; + case "modal": + updateDisplayMode(instance); + break; + case "basic": + updateBasicMode(instance); + break; + case "frameless": + updateFramelessMode(instance); + break; + case "pinned": + updatePinned(instance); + break; + case "closable": + updateClosable(instance); + break; + case "maximizable": + updateMaximizable(instance); + break; + case "pinnable": + updatePinnable(instance); + break; + case "movable": + updateMovable(instance); + break; + case "resizable": + updateResizable(instance); + break; + case "padding": + if (newValue) { + removeClass(instance.elements.root, classes.noPadding); + } else if ( + instance.elements.root.className.indexOf(classes.noPadding) < 0 + ) { + addClass(instance.elements.root, classes.noPadding); + } + break; + case "overflow": + if (newValue) { + removeClass(instance.elements.root, classes.noOverflow); + } else if ( + instance.elements.root.className.indexOf(classes.noOverflow) < 0 + ) { + addClass(instance.elements.root, classes.noOverflow); + } + break; + case "transition": + updateTransition(instance, newValue, oldValue); + break; + } + + // internal on option updated event + if (typeof instance.hooks.onupdate === "function") { + instance.hooks.onupdate.call(instance, option, oldValue, newValue); + } } + /** - * Extends a given prototype by merging properties from base into sub. + * Helper: reflects dialogs options updates * - * @sub {Object} sub The prototype being overwritten. - * @base {Object} base The prototype being written. + * @param {Object} instance The dilog instance. + * @param {Object} obj The object to set/get a value on/from. + * @param {Function} callback The callback function to call if the key was found. + * @param {String|Object} key A string specifying a propery name or a collection of key value pairs. + * @param {Object} value Optional, the value associated with the key (in case it was a string). + * @param {String} option The updated option name. * - * @return {Object} The extended prototype. + * @return {Object} result object + * The result objects has an 'op' property, indicating of this is a SET or GET operation. + * GET: + * - found: a flag indicating if the key was found or not. + * - value: the property value. + * SET: + * - items: a list of key value pairs of the properties being set. + * each contains: + * - found: a flag indicating if the key was found or not. + * - key: the property key. + * - value: the property value. */ - function copy(src) { - if(null === src){ - return src; - } - var cpy; - if(Array.isArray(src)){ - cpy = []; - for(var x=0;x<src.length;x+=1){ - cpy.push(copy(src[x])); - } - return cpy; - } - - if(src instanceof Date){ - return new Date(src.getTime()); - } - - if(src instanceof RegExp){ - cpy = new RegExp(src.source); - cpy.global = src.global; - cpy.ignoreCase = src.ignoreCase; - cpy.multiline = src.multiline; - cpy.lastIndex = src.lastIndex; - return cpy; - } - - if(typeof src === 'object'){ - cpy = {}; - // copy dialog pototype over definition. - for (var prop in src) { - if (src.hasOwnProperty(prop)) { - cpy[prop] = copy(src[prop]); - } - } - return cpy; - } - return src; + function update(instance, obj, callback, key, value) { + var result = { op: undefined, items: [] }; + if (typeof value === "undefined" && typeof key === "string") { + //get + result.op = "get"; + if (obj.hasOwnProperty(key)) { + result.found = true; + result.value = obj[key]; + } else { + result.found = false; + result.value = undefined; + } + } else { + var old; + //set + result.op = "set"; + if (typeof key === "object") { + //set multiple + var args = key; + for (var prop in args) { + if (obj.hasOwnProperty(prop)) { + if (obj[prop] !== args[prop]) { + old = obj[prop]; + obj[prop] = args[prop]; + callback.call(instance, prop, old, args[prop]); + } + result.items.push({ key: prop, value: args[prop], found: true }); + } else { + result.items.push({ key: prop, value: args[prop], found: false }); + } + } + } else if (typeof key === "string") { + //set single + if (obj.hasOwnProperty(key)) { + if (obj[key] !== value) { + old = obj[key]; + obj[key] = value; + callback.call(instance, key, old, value); + } + result.items.push({ key: key, value: value, found: true }); + } else { + result.items.push({ key: key, value: value, found: false }); + } + } else { + //invalid params + throw new Error("args must be a string or object"); + } + } + return result; } + /** - * Helper: destruct the dialog - * - */ - function destruct(instance, initialize){ - if(instance.elements){ - //delete the dom and it's references. - var root = instance.elements.root; - root.parentNode.removeChild(root); - delete instance.elements; - //copy back initial settings. - instance.settings = copy(instance.__settings); - //re-reference init function. - instance.__init = initialize; - //delete __internal variable to allow re-initialization. - delete instance.__internal; - } + * Triggers a close event. + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function triggerClose(instance) { + var found; + triggerCallback(instance, function (button) { + return (found = button.invokeOnClose === true); + }); + //none of the buttons registered as onclose callback + //close the dialog + if (!found && instance.isOpen()) { + instance.close(); + } } /** - * Use a closure to return proper event listener method. Try to use - * `addEventListener` by default but fallback to `attachEvent` for - * unsupported browser. The closure simply ensures that the test doesn't - * happen every time the method is called. - * - * @param {Node} el Node element - * @param {String} event Event type - * @param {Function} fn Callback of event - * @return {Function} + * Dialogs commands event handler, attached to the dialog commands element. + * + * @param {Event} event DOM event object. + * @param {Object} instance The dilog instance. + * + * @return {undefined} */ - var on = (function () { - if (document.addEventListener) { - return function (el, event, fn, useCapture) { - el.addEventListener(event, fn, useCapture === true); - }; - } else if (document.attachEvent) { - return function (el, event, fn) { - el.attachEvent('on' + event, fn); - }; - } - }()); + function commandsClickHandler(event, instance) { + var target = event.srcElement || event.target; + switch (target) { + case instance.elements.commands.pin: + if (!instance.isPinned()) { + pin(instance); + } else { + unpin(instance); + } + break; + case instance.elements.commands.maximize: + if (!instance.isMaximized()) { + maximize(instance); + } else { + restore(instance); + } + break; + case instance.elements.commands.close: + triggerClose(instance); + break; + } + return false; + } /** - * Use a closure to return proper event listener method. Try to use - * `removeEventListener` by default but fallback to `detachEvent` for - * unsupported browser. The closure simply ensures that the test doesn't - * happen every time the method is called. - * - * @param {Node} el Node element - * @param {String} event Event type - * @param {Function} fn Callback of event - * @return {Function} + * Helper: pins the modeless dialog. + * + * @param {Object} instance The dialog instance. + * + * @return {undefined} */ - var off = (function () { - if (document.removeEventListener) { - return function (el, event, fn, useCapture) { - el.removeEventListener(event, fn, useCapture === true); - }; - } else if (document.detachEvent) { - return function (el, event, fn) { - el.detachEvent('on' + event, fn); - }; - } - }()); + function pin(instance) { + //pin the dialog + instance.set("pinned", true); + } /** - * Prevent default event from firing + * Helper: unpins the modeless dialog. + * + * @param {Object} instance The dilog instance. * - * @param {Event} event Event object * @return {undefined} + */ + function unpin(instance) { + //unpin the dialog + instance.set("pinned", false); + } - function prevent ( event ) { - if ( event ) { - if ( event.preventDefault ) { - event.preventDefault(); - } else { - event.returnValue = false; - } - } + /** + * Helper: enlarges the dialog to fill the entire screen. + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function maximize(instance) { + // allow custom `onmaximize` method + dispatchEvent("onmaximize", instance); + //maximize the dialog + addClass(instance.elements.root, classes.maximized); + if (instance.isOpen()) { + ensureNoOverflow(); + } + // allow custom `onmaximized` method + dispatchEvent("onmaximized", instance); } - */ - var transition = (function () { - var t, type; - var supported = false; - var transitions = { - 'animation' : 'animationend', - 'OAnimation' : 'oAnimationEnd oanimationend', - 'msAnimation' : 'MSAnimationEnd', - 'MozAnimation' : 'animationend', - 'WebkitAnimation' : 'webkitAnimationEnd' - }; - for (t in transitions) { - if (document.documentElement.style[t] !== undefined) { - type = transitions[t]; - supported = true; - break; - } - } + /** + * Helper: returns the dialog to its former size. + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function restore(instance) { + // allow custom `onrestore` method + dispatchEvent("onrestore", instance); + //maximize the dialog + removeClass(instance.elements.root, classes.maximized); + if (instance.isOpen()) { + ensureNoOverflow(); + } + // allow custom `onrestored` method + dispatchEvent("onrestored", instance); + } - return { - type: type, - supported: supported - }; - }()); + /** + * Show or hide the maximize box. + * + * @param {Object} instance The dilog instance. + * @param {Boolean} on True to add the behavior, removes it otherwise. + * + * @return {undefined} + */ + function updatePinnable(instance) { + if (instance.get("pinnable")) { + // add class + addClass(instance.elements.root, classes.pinnable); + } else { + // remove class + removeClass(instance.elements.root, classes.pinnable); + } + } /** - * Creates event handler delegate that sends the instance as last argument. - * - * @return {Function} a function wrapper which sends the instance as last argument. - */ - function delegate(context, method) { - return function () { - if (arguments.length > 0) { - var args = []; - for (var x = 0; x < arguments.length; x += 1) { - args.push(arguments[x]); - } - args.push(context); - return method.apply(context, args); - } - return method.apply(context, [null, context]); - }; + * Helper: Fixes the absolutly positioned modal div position. + * + * @param {Object} instance The dialog instance. + * + * @return {undefined} + */ + function addAbsPositionFix(instance) { + var scrollLeft = getScrollLeft(); + instance.elements.modal.style.marginTop = getScrollTop() + "px"; + instance.elements.modal.style.marginLeft = scrollLeft + "px"; + instance.elements.modal.style.marginRight = -scrollLeft + "px"; } + /** - * Helper for creating a dialog close event. - * - * @return {object} - */ - function createCloseEvent(index, button) { - return { - index: index, - button: button, - cancel: false - }; + * Helper: Removes the absolutly positioned modal div position fix. + * + * @param {Object} instance The dialog instance. + * + * @return {undefined} + */ + function removeAbsPositionFix(instance) { + var marginTop = parseInt(instance.elements.modal.style.marginTop, 10); + var marginLeft = parseInt(instance.elements.modal.style.marginLeft, 10); + instance.elements.modal.style.marginTop = ""; + instance.elements.modal.style.marginLeft = ""; + instance.elements.modal.style.marginRight = ""; + + if (instance.isOpen()) { + var top = 0, + left = 0; + if (instance.elements.dialog.style.top !== "") { + top = parseInt(instance.elements.dialog.style.top, 10); + } + instance.elements.dialog.style.top = + top + (marginTop - getScrollTop()) + "px"; + + if (instance.elements.dialog.style.left !== "") { + left = parseInt(instance.elements.dialog.style.left, 10); + } + instance.elements.dialog.style.left = + left + (marginLeft - getScrollLeft()) + "px"; + } } /** - * Helper for dispatching events. - * - * @param {string} evenType The type of the event to disptach. - * @param {object} instance The dialog instance disptaching the event. - * - * @return {any} The result of the invoked function. - */ - function dispatchEvent(eventType, instance) { - if ( typeof instance.get(eventType) === 'function' ) { - return instance.get(eventType).call(instance); - } + * Helper: Adds/Removes the absolutly positioned modal div position fix based on its pinned setting. + * + * @param {Object} instance The dialog instance. + * + * @return {undefined} + */ + function updateAbsPositionFix(instance) { + // if modeless and unpinned add fix + if (!instance.get("modal") && !instance.get("pinned")) { + addAbsPositionFix(instance); + } else { + removeAbsPositionFix(instance); + } + } + /** + * Toggles the dialog position lock | modeless only. + * + * @param {Object} instance The dilog instance. + * @param {Boolean} on True to make it modal, false otherwise. + * + * @return {undefined} + */ + function updatePinned(instance) { + if (instance.get("pinned")) { + removeClass(instance.elements.root, classes.unpinned); + if (instance.isOpen()) { + removeAbsPositionFix(instance); + } + } else { + addClass(instance.elements.root, classes.unpinned); + if (instance.isOpen() && !instance.isModal()) { + addAbsPositionFix(instance); + } + } } + /** + * Show or hide the maximize box. + * + * @param {Object} instance The dilog instance. + * @param {Boolean} on True to add the behavior, removes it otherwise. + * + * @return {undefined} + */ + function updateMaximizable(instance) { + if (instance.get("maximizable")) { + // add class + addClass(instance.elements.root, classes.maximizable); + } else { + // remove class + removeClass(instance.elements.root, classes.maximizable); + } + } /** - * Super class for all dialogs + * Show or hide the close box. * - * @return {Object} base dialog prototype + * @param {Object} instance The dilog instance. + * @param {Boolean} on True to add the behavior, removes it otherwise. + * + * @return {undefined} */ - var dialog = (function () { - var //holds the list of used keys. - usedKeys = [], - //dummy variable, used to trigger dom reflow. - reflow = null, - //holds body tab index in case it has any. - tabindex = false, - //condition for detecting safari - isSafari = window.navigator.userAgent.indexOf('Safari') > -1 && window.navigator.userAgent.indexOf('Chrome') < 0, - //dialog building blocks - templates = { - dimmer:'<div class="ajs-dimmer"></div>', - /*tab index required to fire click event before body focus*/ - modal: '<div class="ajs-modal" tabindex="0"></div>', - dialog: '<div class="ajs-dialog" tabindex="0"></div>', - reset: '<button class="ajs-reset"></button>', - commands: '<div class="ajs-commands"><button class="ajs-pin"></button><button class="ajs-maximize"></button><button class="ajs-close"></button></div>', - header: '<div class="ajs-header"></div>', - body: '<div class="ajs-body"></div>', - content: '<div class="ajs-content"></div>', - footer: '<div class="ajs-footer"></div>', - buttons: { primary: '<div class="ajs-primary ajs-buttons"></div>', auxiliary: '<div class="ajs-auxiliary ajs-buttons"></div>' }, - button: '<button class="ajs-button"></button>', - resizeHandle: '<div class="ajs-handle"></div>', - }, - //common class names - classes = { - animationIn: 'ajs-in', - animationOut: 'ajs-out', - base: 'alertify', - basic:'ajs-basic', - capture: 'ajs-capture', - closable:'ajs-closable', - fixed: 'ajs-fixed', - frameless:'ajs-frameless', - hidden: 'ajs-hidden', - maximize: 'ajs-maximize', - maximized: 'ajs-maximized', - maximizable:'ajs-maximizable', - modeless: 'ajs-modeless', - movable: 'ajs-movable', - noSelection: 'ajs-no-selection', - noOverflow: 'ajs-no-overflow', - noPadding:'ajs-no-padding', - pin:'ajs-pin', - pinnable:'ajs-pinnable', - prefix: 'ajs-', - resizable: 'ajs-resizable', - restore: 'ajs-restore', - shake:'ajs-shake', - unpinned:'ajs-unpinned', - }; + function updateClosable(instance) { + if (instance.get("closable")) { + // add class + addClass(instance.elements.root, classes.closable); + bindClosableEvents(instance); + } else { + // remove class + removeClass(instance.elements.root, classes.closable); + unbindClosableEvents(instance); + } + } - /** - * Helper: initializes the dialog instance - * - * @return {Number} The total count of currently open modals. - */ - function initialize(instance){ - - if(!instance.__internal){ - - //no need to expose init after this. - delete instance.__init; - - //keep a copy of initial dialog settings - if(!instance.__settings){ - instance.__settings = copy(instance.settings); - } - - //get dialog buttons/focus setup - var setup; - if(typeof instance.setup === 'function'){ - setup = instance.setup(); - setup.options = setup.options || {}; - setup.focus = setup.focus || {}; - }else{ - setup = { - buttons:[], - focus:{ - element:null, - select:false - }, - options:{ - } - }; - } - - //initialize hooks object. - if(typeof instance.hooks !== 'object'){ - instance.hooks = {}; - } + var cancelClick = false, // flag to cancel click event if already handled by end resize event (the mousedown, mousemove, mouseup sequence fires a click event.). + modalClickHandlerTS = 0; // stores last click timestamp to prevent executing the handler twice on double click. + /** + * Helper: closes the modal dialog when clicking the modal + * + * @param {Event} event DOM event object. + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function modalClickHandler(event, instance) { + if ( + event.timeStamp - modalClickHandlerTS > 200 && + (modalClickHandlerTS = event.timeStamp) && + !cancelClick + ) { + var target = event.srcElement || event.target; + if ( + instance.get("closableByDimmer") === true && + target === instance.elements.modal + ) { + triggerClose(instance); + } + cancelClick = false; + return false; + } + } - //copy buttons defintion - var buttonsDefinition = []; - if(Array.isArray(setup.buttons)){ - for(var b=0;b<setup.buttons.length;b+=1){ - var ref = setup.buttons[b], - cpy = {}; - for (var i in ref) { - if (ref.hasOwnProperty(i)) { - cpy[i] = ref[i]; - } - } - buttonsDefinition.push(cpy); - } - } + // stores last call timestamp to prevent triggering the callback twice. + var callbackTS = 0; + // flag to cancel keyup event if already handled by click event (pressing Enter on a focusted button). + var cancelKeyup = false; + /** + * Helper: triggers a button callback + * + * @param {Object} The dilog instance. + * @param {Function} Callback to check which button triggered the event. + * + * @return {undefined} + */ + function triggerCallback(instance, check) { + if (Date.now() - callbackTS > 200 && (callbackTS = Date.now())) { + for (var idx = 0; idx < instance.__internal.buttons.length; idx += 1) { + var button = instance.__internal.buttons[idx]; + if (!button.element.disabled && check(button)) { + var closeEvent = createCloseEvent(idx, button); + if (typeof instance.callback === "function") { + instance.callback.apply(instance, [closeEvent]); + } + //close the dialog only if not canceled. + if (closeEvent.cancel === false) { + instance.close(); + } + break; + } + } + } + } - var internal = instance.__internal = { - /** - * Flag holding the open state of the dialog - * - * @type {Boolean} - */ - isOpen:false, - /** - * Active element is the element that will receive focus after - * closing the dialog. It defaults as the body tag, but gets updated - * to the last focused element before the dialog was opened. - * - * @type {Node} - */ - activeElement:document.body, - timerIn:undefined, - timerOut:undefined, - buttons: buttonsDefinition, - focus: setup.focus, - options: { - title: undefined, - modal: undefined, - basic:undefined, - frameless:undefined, - pinned: undefined, - movable: undefined, - moveBounded:undefined, - resizable: undefined, - autoReset: undefined, - closable: undefined, - closableByDimmer: undefined, - maximizable: undefined, - startMaximized: undefined, - pinnable: undefined, - transition: undefined, - padding:undefined, - overflow:undefined, - onshow:undefined, - onclosing:undefined, - onclose:undefined, - onfocus:undefined, - onmove:undefined, - onmoved:undefined, - onresize:undefined, - onresized:undefined, - onmaximize:undefined, - onmaximized:undefined, - onrestore:undefined, - onrestored:undefined - }, - resetHandler:undefined, - beginMoveHandler:undefined, - beginResizeHandler:undefined, - bringToFrontHandler:undefined, - modalClickHandler:undefined, - buttonsClickHandler:undefined, - commandsClickHandler:undefined, - transitionInHandler:undefined, - transitionOutHandler:undefined, - destroy:undefined - }; - - var elements = {}; - //root node - elements.root = document.createElement('div'); - //prevent FOUC in case of async styles loading. - elements.root.style.display = 'none'; - elements.root.className = classes.base + ' ' + classes.hidden + ' '; - - elements.root.innerHTML = templates.dimmer + templates.modal; - - //dimmer - elements.dimmer = elements.root.firstChild; - - //dialog - elements.modal = elements.root.lastChild; - elements.modal.innerHTML = templates.dialog; - elements.dialog = elements.modal.firstChild; - elements.dialog.innerHTML = templates.reset + templates.commands + templates.header + templates.body + templates.footer + templates.resizeHandle + templates.reset; - - //reset links - elements.reset = []; - elements.reset.push(elements.dialog.firstChild); - elements.reset.push(elements.dialog.lastChild); - - //commands - elements.commands = {}; - elements.commands.container = elements.reset[0].nextSibling; - elements.commands.pin = elements.commands.container.firstChild; - elements.commands.maximize = elements.commands.pin.nextSibling; - elements.commands.close = elements.commands.maximize.nextSibling; - - //header - elements.header = elements.commands.container.nextSibling; - - //body - elements.body = elements.header.nextSibling; - elements.body.innerHTML = templates.content; - elements.content = elements.body.firstChild; - - //footer - elements.footer = elements.body.nextSibling; - elements.footer.innerHTML = templates.buttons.auxiliary + templates.buttons.primary; - - //resize handle - elements.resizeHandle = elements.footer.nextSibling; - - //buttons - elements.buttons = {}; - elements.buttons.auxiliary = elements.footer.firstChild; - elements.buttons.primary = elements.buttons.auxiliary.nextSibling; - elements.buttons.primary.innerHTML = templates.button; - elements.buttonTemplate = elements.buttons.primary.firstChild; - //remove button template - elements.buttons.primary.removeChild(elements.buttonTemplate); - - for(var x=0; x < instance.__internal.buttons.length; x+=1) { - var button = instance.__internal.buttons[x]; - - // add to the list of used keys. - if(usedKeys.indexOf(button.key) < 0){ - usedKeys.push(button.key); - } - - button.element = elements.buttonTemplate.cloneNode(); - button.element.innerHTML = button.text; - if(typeof button.className === 'string' && button.className !== ''){ - addClass(button.element, button.className); - } - for(var key in button.attrs){ - if(key !== 'className' && button.attrs.hasOwnProperty(key)){ - button.element.setAttribute(key, button.attrs[key]); - } - } - if(button.scope === 'auxiliary'){ - elements.buttons.auxiliary.appendChild(button.element); - }else{ - elements.buttons.primary.appendChild(button.element); - } - } - //make elements pubic - instance.elements = elements; - - //save event handlers delegates - internal.resetHandler = delegate(instance, onReset); - internal.beginMoveHandler = delegate(instance, beginMove); - internal.beginResizeHandler = delegate(instance, beginResize); - internal.bringToFrontHandler = delegate(instance, bringToFront); - internal.modalClickHandler = delegate(instance, modalClickHandler); - internal.buttonsClickHandler = delegate(instance, buttonsClickHandler); - internal.commandsClickHandler = delegate(instance, commandsClickHandler); - internal.transitionInHandler = delegate(instance, handleTransitionInEvent); - internal.transitionOutHandler = delegate(instance, handleTransitionOutEvent); - - //settings - for(var opKey in internal.options){ - if(setup.options[opKey] !== undefined){ - // if found in user options - instance.set(opKey, setup.options[opKey]); - }else if(alertify.defaults.hasOwnProperty(opKey)) { - // else if found in defaults options - instance.set(opKey, alertify.defaults[opKey]); - }else if(opKey === 'title' ) { - // else if title key, use alertify.defaults.glossary - instance.set(opKey, alertify.defaults.glossary[opKey]); - } - } + /** + * Clicks event handler, attached to the dialog footer. + * + * @param {Event} DOM event object. + * @param {Object} The dilog instance. + * + * @return {undefined} + */ + function buttonsClickHandler(event, instance) { + var target = event.srcElement || event.target; + triggerCallback(instance, function (button) { + // if this button caused the click, cancel keyup event + return button.element === target && (cancelKeyup = true); + }); + } - // allow dom customization - if(typeof instance.build === 'function'){ - instance.build(); - } + /** + * Keyup event handler, attached to the document.body + * + * @param {Event} DOM event object. + * @param {Object} The dilog instance. + * + * @return {undefined} + */ + function keyupHandler(event) { + //hitting enter while button has focus will trigger keyup too. + //ignore if handled by clickHandler + if (cancelKeyup) { + cancelKeyup = false; + return; + } + var instance = openDialogs[openDialogs.length - 1]; + var keyCode = event.keyCode; + if ( + instance.__internal.buttons.length === 0 && + keyCode === keys.ESC && + instance.get("closable") === true + ) { + triggerClose(instance); + return false; + } else if (usedKeys.indexOf(keyCode) > -1) { + triggerCallback(instance, function (button) { + return button.key === keyCode; + }); + return false; + } + } + /** + * Keydown event handler, attached to the document.body + * + * @param {Event} DOM event object. + * @param {Object} The dilog instance. + * + * @return {undefined} + */ + function keydownHandler(event) { + var instance = openDialogs[openDialogs.length - 1]; + var keyCode = event.keyCode; + if (keyCode === keys.LEFT || keyCode === keys.RIGHT) { + var buttons = instance.__internal.buttons; + for (var x = 0; x < buttons.length; x += 1) { + if (document.activeElement === buttons[x].element) { + switch (keyCode) { + case keys.LEFT: + buttons[(x || buttons.length) - 1].element.focus(); + return; + case keys.RIGHT: + buttons[(x + 1) % buttons.length].element.focus(); + return; } - - //add to the end of the DOM tree. - document.body.appendChild(instance.elements.root); - } + } + } + } else if ( + keyCode < keys.F12 + 1 && + keyCode > keys.F1 - 1 && + usedKeys.indexOf(keyCode) > -1 + ) { + event.preventDefault(); + event.stopPropagation(); + triggerCallback(instance, function (button) { + return button.key === keyCode; + }); + return false; + } + } - /** - * Helper: maintains scroll position - * - */ - var scrollX, scrollY; - function saveScrollPosition(){ - scrollX = getScrollLeft(); - scrollY = getScrollTop(); - } - function restoreScrollPosition(){ - window.scrollTo(scrollX, scrollY); - } + /** + * Sets focus to proper dialog element + * + * @param {Object} instance The dilog instance. + * @param {Node} [resetTarget=undefined] DOM element to reset focus to. + * + * @return {undefined} + */ + function setFocus(instance, resetTarget) { + // reset target has already been determined. + if (resetTarget) { + resetTarget.focus(); + } else { + // current instance focus settings + var focus = instance.__internal.focus; + // the focus element. + var element = focus.element; + + switch (typeof focus.element) { + // a number means a button index + case "number": + if (instance.__internal.buttons.length > focus.element) { + //in basic view, skip focusing the buttons. + if (instance.get("basic") === true) { + element = instance.elements.reset[0]; + } else { + element = instance.__internal.buttons[focus.element].element; + } + } + break; + // a string means querySelector to select from dialog body contents. + case "string": + element = instance.elements.body.querySelector(focus.element); + break; + // a function should return the focus element. + case "function": + element = focus.element.call(instance); + break; + } + + // if no focus element, default to first reset element. + if ( + (typeof element === "undefined" || element === null) && + instance.__internal.buttons.length === 0 + ) { + element = instance.elements.reset[0]; + } + // focus + if (element && element.focus) { + element.focus(); + // if selectable + if (focus.select && element.select) { + element.select(); + } + } + } + } - /** - * Helper: adds/removes no-overflow class from body - * - */ - function ensureNoOverflow(){ - var requiresNoOverflow = 0; - for(var x=0;x<openDialogs.length;x+=1){ - var instance = openDialogs[x]; - if(instance.isModal() || instance.isMaximized()){ - requiresNoOverflow+=1; - } - } - if(requiresNoOverflow === 0 && document.body.className.indexOf(classes.noOverflow) >= 0){ - //last open modal or last maximized one - removeClass(document.body, classes.noOverflow); - preventBodyShift(false); - }else if(requiresNoOverflow > 0 && document.body.className.indexOf(classes.noOverflow) < 0){ - //first open modal or first maximized one - preventBodyShift(true); - addClass(document.body, classes.noOverflow); - } - } - var top = '', topScroll = 0; - /** - * Helper: prevents body shift. - * - */ - function preventBodyShift(add){ - if(alertify.defaults.preventBodyShift){ - if(add && document.documentElement.scrollHeight > document.documentElement.clientHeight ){//&& openDialogs[openDialogs.length-1].elements.dialog.clientHeight <= document.documentElement.clientHeight){ - topScroll = scrollY; - top = window.getComputedStyle(document.body).top; - addClass(document.body, classes.fixed); - document.body.style.top = -scrollY + 'px'; - } else if(!add) { - scrollY = topScroll; - document.body.style.top = top; - removeClass(document.body, classes.fixed); - restoreScrollPosition(); - } - } - } - - /** - * Sets the name of the transition used to show/hide the dialog - * - * @param {Object} instance The dilog instance. - * - */ - function updateTransition(instance, value, oldValue){ - if(typeof oldValue === 'string'){ - removeClass(instance.elements.root,classes.prefix + oldValue); - } - addClass(instance.elements.root, classes.prefix + value); - reflow = instance.elements.root.offsetWidth; - } - - /** - * Toggles the dialog display mode - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function updateDisplayMode(instance){ - if(instance.get('modal')){ - - //make modal - removeClass(instance.elements.root, classes.modeless); - - //only if open - if(instance.isOpen()){ - unbindModelessEvents(instance); - - //in case a pinned modless dialog was made modal while open. - updateAbsPositionFix(instance); - - ensureNoOverflow(); - } - }else{ - //make modelss - addClass(instance.elements.root, classes.modeless); - - //only if open - if(instance.isOpen()){ - bindModelessEvents(instance); - - //in case pin/unpin was called while a modal is open - updateAbsPositionFix(instance); - - ensureNoOverflow(); - } - } - } - - /** - * Toggles the dialog basic view mode - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function updateBasicMode(instance){ - if (instance.get('basic')) { - // add class - addClass(instance.elements.root, classes.basic); - } else { - // remove class - removeClass(instance.elements.root, classes.basic); - } - } - - /** - * Toggles the dialog frameless view mode - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function updateFramelessMode(instance){ - if (instance.get('frameless')) { - // add class - addClass(instance.elements.root, classes.frameless); - } else { - // remove class - removeClass(instance.elements.root, classes.frameless); - } - } - - /** - * Helper: Brings the modeless dialog to front, attached to modeless dialogs. - * - * @param {Event} event Focus event - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function bringToFront(event, instance){ - - // Do not bring to front if preceeded by an open modal - var index = openDialogs.indexOf(instance); - for(var x=index+1;x<openDialogs.length;x+=1){ - if(openDialogs[x].isModal()){ - return; - } - } - - // Bring to front by making it the last child. - if(document.body.lastChild !== instance.elements.root){ - document.body.appendChild(instance.elements.root); - //also make sure its at the end of the list - openDialogs.splice(openDialogs.indexOf(instance),1); - openDialogs.push(instance); - setFocus(instance); - } - - return false; - } - - /** - * Helper: reflects dialogs options updates - * - * @param {Object} instance The dilog instance. - * @param {String} option The updated option name. - * - * @return {undefined} - */ - function optionUpdated(instance, option, oldValue, newValue){ - switch(option){ - case 'title': - instance.setHeader(newValue); - break; - case 'modal': - updateDisplayMode(instance); - break; - case 'basic': - updateBasicMode(instance); - break; - case 'frameless': - updateFramelessMode(instance); - break; - case 'pinned': - updatePinned(instance); - break; - case 'closable': - updateClosable(instance); - break; - case 'maximizable': - updateMaximizable(instance); - break; - case 'pinnable': - updatePinnable(instance); - break; - case 'movable': - updateMovable(instance); - break; - case 'resizable': - updateResizable(instance); - break; - case 'padding': - if(newValue){ - removeClass(instance.elements.root, classes.noPadding); - }else if(instance.elements.root.className.indexOf(classes.noPadding) < 0){ - addClass(instance.elements.root, classes.noPadding); - } - break; - case 'overflow': - if(newValue){ - removeClass(instance.elements.root, classes.noOverflow); - }else if(instance.elements.root.className.indexOf(classes.noOverflow) < 0){ - addClass(instance.elements.root, classes.noOverflow); - } - break; - case 'transition': - updateTransition(instance,newValue, oldValue); - break; - } - - // internal on option updated event - if(typeof instance.hooks.onupdate === 'function'){ - instance.hooks.onupdate.call(instance, option, oldValue, newValue); - } - } - - /** - * Helper: reflects dialogs options updates - * - * @param {Object} instance The dilog instance. - * @param {Object} obj The object to set/get a value on/from. - * @param {Function} callback The callback function to call if the key was found. - * @param {String|Object} key A string specifying a propery name or a collection of key value pairs. - * @param {Object} value Optional, the value associated with the key (in case it was a string). - * @param {String} option The updated option name. - * - * @return {Object} result object - * The result objects has an 'op' property, indicating of this is a SET or GET operation. - * GET: - * - found: a flag indicating if the key was found or not. - * - value: the property value. - * SET: - * - items: a list of key value pairs of the properties being set. - * each contains: - * - found: a flag indicating if the key was found or not. - * - key: the property key. - * - value: the property value. - */ - function update(instance, obj, callback, key, value){ - var result = {op:undefined, items: [] }; - if(typeof value === 'undefined' && typeof key === 'string') { - //get - result.op = 'get'; - if(obj.hasOwnProperty(key)){ - result.found = true; - result.value = obj[key]; - }else{ - result.found = false; - result.value = undefined; - } - } - else - { - var old; - //set - result.op = 'set'; - if(typeof key === 'object'){ - //set multiple - var args = key; - for (var prop in args) { - if (obj.hasOwnProperty(prop)) { - if(obj[prop] !== args[prop]){ - old = obj[prop]; - obj[prop] = args[prop]; - callback.call(instance,prop, old, args[prop]); - } - result.items.push({ 'key': prop, 'value': args[prop], 'found':true}); - }else{ - result.items.push({ 'key': prop, 'value': args[prop], 'found':false}); - } - } - } else if (typeof key === 'string'){ - //set single - if (obj.hasOwnProperty(key)) { - if(obj[key] !== value){ - old = obj[key]; - obj[key] = value; - callback.call(instance,key, old, value); - } - result.items.push({'key': key, 'value': value , 'found':true}); - - }else{ - result.items.push({'key': key, 'value': value , 'found':false}); - } - } else { - //invalid params - throw new Error('args must be a string or object'); - } - } - return result; - } - - - /** - * Triggers a close event. - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function triggerClose(instance) { - var found; - triggerCallback(instance, function (button) { - return found = (button.invokeOnClose === true); - }); - //none of the buttons registered as onclose callback - //close the dialog - if (!found && instance.isOpen()) { - instance.close(); - } - } - - /** - * Dialogs commands event handler, attached to the dialog commands element. - * - * @param {Event} event DOM event object. - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function commandsClickHandler(event, instance) { - var target = event.srcElement || event.target; - switch (target) { - case instance.elements.commands.pin: - if (!instance.isPinned()) { - pin(instance); - } else { - unpin(instance); - } - break; - case instance.elements.commands.maximize: - if (!instance.isMaximized()) { - maximize(instance); - } else { - restore(instance); - } - break; - case instance.elements.commands.close: - triggerClose(instance); - break; - } - return false; - } - - /** - * Helper: pins the modeless dialog. - * - * @param {Object} instance The dialog instance. - * - * @return {undefined} - */ - function pin(instance) { - //pin the dialog - instance.set('pinned', true); - } - - /** - * Helper: unpins the modeless dialog. - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function unpin(instance) { - //unpin the dialog - instance.set('pinned', false); - } - - - /** - * Helper: enlarges the dialog to fill the entire screen. - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function maximize(instance) { - // allow custom `onmaximize` method - dispatchEvent('onmaximize', instance); - //maximize the dialog - addClass(instance.elements.root, classes.maximized); - if (instance.isOpen()) { - ensureNoOverflow(); - } - // allow custom `onmaximized` method - dispatchEvent('onmaximized', instance); - } - - /** - * Helper: returns the dialog to its former size. - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function restore(instance) { - // allow custom `onrestore` method - dispatchEvent('onrestore', instance); - //maximize the dialog - removeClass(instance.elements.root, classes.maximized); - if (instance.isOpen()) { - ensureNoOverflow(); - } - // allow custom `onrestored` method - dispatchEvent('onrestored', instance); - } - - /** - * Show or hide the maximize box. - * - * @param {Object} instance The dilog instance. - * @param {Boolean} on True to add the behavior, removes it otherwise. - * - * @return {undefined} - */ - function updatePinnable(instance) { - if (instance.get('pinnable')) { - // add class - addClass(instance.elements.root, classes.pinnable); - } else { - // remove class - removeClass(instance.elements.root, classes.pinnable); - } - } - - /** - * Helper: Fixes the absolutly positioned modal div position. - * - * @param {Object} instance The dialog instance. - * - * @return {undefined} - */ - function addAbsPositionFix(instance) { - var scrollLeft = getScrollLeft(); - instance.elements.modal.style.marginTop = getScrollTop() + 'px'; - instance.elements.modal.style.marginLeft = scrollLeft + 'px'; - instance.elements.modal.style.marginRight = (-scrollLeft) + 'px'; - } - - /** - * Helper: Removes the absolutly positioned modal div position fix. - * - * @param {Object} instance The dialog instance. - * - * @return {undefined} - */ - function removeAbsPositionFix(instance) { - var marginTop = parseInt(instance.elements.modal.style.marginTop, 10); - var marginLeft = parseInt(instance.elements.modal.style.marginLeft, 10); - instance.elements.modal.style.marginTop = ''; - instance.elements.modal.style.marginLeft = ''; - instance.elements.modal.style.marginRight = ''; - - if (instance.isOpen()) { - var top = 0, - left = 0 - ; - if (instance.elements.dialog.style.top !== '') { - top = parseInt(instance.elements.dialog.style.top, 10); - } - instance.elements.dialog.style.top = (top + (marginTop - getScrollTop())) + 'px'; - - if (instance.elements.dialog.style.left !== '') { - left = parseInt(instance.elements.dialog.style.left, 10); - } - instance.elements.dialog.style.left = (left + (marginLeft - getScrollLeft())) + 'px'; - } - } - /** - * Helper: Adds/Removes the absolutly positioned modal div position fix based on its pinned setting. - * - * @param {Object} instance The dialog instance. - * - * @return {undefined} - */ - function updateAbsPositionFix(instance) { - // if modeless and unpinned add fix - if (!instance.get('modal') && !instance.get('pinned')) { - addAbsPositionFix(instance); - } else { - removeAbsPositionFix(instance); - } - } - /** - * Toggles the dialog position lock | modeless only. - * - * @param {Object} instance The dilog instance. - * @param {Boolean} on True to make it modal, false otherwise. - * - * @return {undefined} - */ - function updatePinned(instance) { - if (instance.get('pinned')) { - removeClass(instance.elements.root, classes.unpinned); - if (instance.isOpen()) { - removeAbsPositionFix(instance); - } - } else { - addClass(instance.elements.root, classes.unpinned); - if (instance.isOpen() && !instance.isModal()) { - addAbsPositionFix(instance); - } - } - } - - /** - * Show or hide the maximize box. - * - * @param {Object} instance The dilog instance. - * @param {Boolean} on True to add the behavior, removes it otherwise. - * - * @return {undefined} - */ - function updateMaximizable(instance) { - if (instance.get('maximizable')) { - // add class - addClass(instance.elements.root, classes.maximizable); - } else { - // remove class - removeClass(instance.elements.root, classes.maximizable); - } - } - - /** - * Show or hide the close box. - * - * @param {Object} instance The dilog instance. - * @param {Boolean} on True to add the behavior, removes it otherwise. - * - * @return {undefined} - */ - function updateClosable(instance) { - if (instance.get('closable')) { - // add class - addClass(instance.elements.root, classes.closable); - bindClosableEvents(instance); - } else { - // remove class - removeClass(instance.elements.root, classes.closable); - unbindClosableEvents(instance); - } - } - - - var cancelClick = false,// flag to cancel click event if already handled by end resize event (the mousedown, mousemove, mouseup sequence fires a click event.). - modalClickHandlerTS=0 // stores last click timestamp to prevent executing the handler twice on double click. - ; - - /** - * Helper: closes the modal dialog when clicking the modal - * - * @param {Event} event DOM event object. - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function modalClickHandler(event, instance) { - if(event.timeStamp - modalClickHandlerTS > 200 && (modalClickHandlerTS = event.timeStamp) && !cancelClick){ - var target = event.srcElement || event.target; - if (instance.get('closableByDimmer') === true && target === instance.elements.modal) { - triggerClose(instance); - } - cancelClick = false; - return false; - } - } - - // stores last call timestamp to prevent triggering the callback twice. - var callbackTS = 0; - // flag to cancel keyup event if already handled by click event (pressing Enter on a focusted button). - var cancelKeyup = false; - /** - * Helper: triggers a button callback - * - * @param {Object} The dilog instance. - * @param {Function} Callback to check which button triggered the event. - * - * @return {undefined} - */ - function triggerCallback(instance, check) { - if(Date.now() - callbackTS > 200 && (callbackTS = Date.now())){ - for (var idx = 0; idx < instance.__internal.buttons.length; idx += 1) { - var button = instance.__internal.buttons[idx]; - if (!button.element.disabled && check(button)) { - var closeEvent = createCloseEvent(idx, button); - if (typeof instance.callback === 'function') { - instance.callback.apply(instance, [closeEvent]); - } - //close the dialog only if not canceled. - if (closeEvent.cancel === false) { - instance.close(); - } - break; - } - } - } - } - - /** - * Clicks event handler, attached to the dialog footer. - * - * @param {Event} DOM event object. - * @param {Object} The dilog instance. - * - * @return {undefined} - */ - function buttonsClickHandler(event, instance) { - var target = event.srcElement || event.target; - triggerCallback(instance, function (button) { - // if this button caused the click, cancel keyup event - return button.element === target && (cancelKeyup = true); - }); - } - - /** - * Keyup event handler, attached to the document.body - * - * @param {Event} DOM event object. - * @param {Object} The dilog instance. - * - * @return {undefined} - */ - function keyupHandler(event) { - //hitting enter while button has focus will trigger keyup too. - //ignore if handled by clickHandler - if (cancelKeyup) { - cancelKeyup = false; - return; - } - var instance = openDialogs[openDialogs.length - 1]; - var keyCode = event.keyCode; - if (instance.__internal.buttons.length === 0 && keyCode === keys.ESC && instance.get('closable') === true) { - triggerClose(instance); - return false; - }else if (usedKeys.indexOf(keyCode) > -1) { - triggerCallback(instance, function (button) { - return button.key === keyCode; - }); - return false; - } - } - /** - * Keydown event handler, attached to the document.body - * - * @param {Event} DOM event object. - * @param {Object} The dilog instance. - * - * @return {undefined} - */ - function keydownHandler(event) { - var instance = openDialogs[openDialogs.length - 1]; - var keyCode = event.keyCode; - if (keyCode === keys.LEFT || keyCode === keys.RIGHT) { - var buttons = instance.__internal.buttons; - for (var x = 0; x < buttons.length; x += 1) { - if (document.activeElement === buttons[x].element) { - switch (keyCode) { - case keys.LEFT: - buttons[(x || buttons.length) - 1].element.focus(); - return; - case keys.RIGHT: - buttons[(x + 1) % buttons.length].element.focus(); - return; - } - } - } - }else if (keyCode < keys.F12 + 1 && keyCode > keys.F1 - 1 && usedKeys.indexOf(keyCode) > -1) { - event.preventDefault(); - event.stopPropagation(); - triggerCallback(instance, function (button) { - return button.key === keyCode; - }); - return false; - } - } - - - /** - * Sets focus to proper dialog element - * - * @param {Object} instance The dilog instance. - * @param {Node} [resetTarget=undefined] DOM element to reset focus to. - * - * @return {undefined} - */ - function setFocus(instance, resetTarget) { - // reset target has already been determined. - if (resetTarget) { - resetTarget.focus(); - } else { - // current instance focus settings - var focus = instance.__internal.focus; - // the focus element. - var element = focus.element; - - switch (typeof focus.element) { - // a number means a button index - case 'number': - if (instance.__internal.buttons.length > focus.element) { - //in basic view, skip focusing the buttons. - if (instance.get('basic') === true) { - element = instance.elements.reset[0]; - } else { - element = instance.__internal.buttons[focus.element].element; - } - } - break; - // a string means querySelector to select from dialog body contents. - case 'string': - element = instance.elements.body.querySelector(focus.element); - break; - // a function should return the focus element. - case 'function': - element = focus.element.call(instance); - break; - } - - // if no focus element, default to first reset element. - if ((typeof element === 'undefined' || element === null) && instance.__internal.buttons.length === 0) { - element = instance.elements.reset[0]; - } - // focus - if (element && element.focus) { - element.focus(); - // if selectable - if (focus.select && element.select) { - element.select(); - } - } - } - } - - /** - * Focus event handler, attached to document.body and dialogs own reset links. - * handles the focus for modal dialogs only. - * - * @param {Event} event DOM focus event object. - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function onReset(event, instance) { - - // should work on last modal if triggered from document.body - if (!instance) { - for (var x = openDialogs.length - 1; x > -1; x -= 1) { - if (openDialogs[x].isModal()) { - instance = openDialogs[x]; - break; - } - } - } - // if modal - if (instance && instance.isModal()) { - // determine reset target to enable forward/backward tab cycle. - var resetTarget, target = event.srcElement || event.target; - var lastResetElement = target === instance.elements.reset[1] || (instance.__internal.buttons.length === 0 && target === document.body); - - // if last reset link, then go to maximize or close - if (lastResetElement) { - if (instance.get('maximizable')) { - resetTarget = instance.elements.commands.maximize; - } else if (instance.get('closable')) { - resetTarget = instance.elements.commands.close; - } - } - // if no reset target found, try finding the best button - if (resetTarget === undefined) { - if (typeof instance.__internal.focus.element === 'number') { - // button focus element, go to first available button - if (target === instance.elements.reset[0]) { - resetTarget = instance.elements.buttons.auxiliary.firstChild || instance.elements.buttons.primary.firstChild; - } else if (lastResetElement) { - //restart the cycle by going to first reset link - resetTarget = instance.elements.reset[0]; - } - } else { - // will reach here when tapping backwards, so go to last child - // The focus element SHOULD NOT be a button (logically!). - if (target === instance.elements.reset[0]) { - resetTarget = instance.elements.buttons.primary.lastChild || instance.elements.buttons.auxiliary.lastChild; - } - } - } - // focus - setFocus(instance, resetTarget); - } - } - /** - * Transition in transitionend event handler. - * - * @param {Event} TransitionEnd event object. - * @param {Object} The dilog instance. - * - * @return {undefined} - */ - function handleTransitionInEvent(event, instance) { - // clear the timer - clearTimeout(instance.__internal.timerIn); - - // once transition is complete, set focus - setFocus(instance); - - //restore scroll to prevent document jump - restoreScrollPosition(); - - // allow handling key up after transition ended. - cancelKeyup = false; - - // allow custom `onfocus` method - dispatchEvent('onfocus', instance); - - // unbind the event - off(instance.elements.dialog, transition.type, instance.__internal.transitionInHandler); - - removeClass(instance.elements.root, classes.animationIn); - } - - /** - * Transition out transitionend event handler. - * - * @param {Event} TransitionEnd event object. - * @param {Object} The dilog instance. - * - * @return {undefined} - */ - function handleTransitionOutEvent(event, instance) { - // clear the timer - clearTimeout(instance.__internal.timerOut); - // unbind the event - off(instance.elements.dialog, transition.type, instance.__internal.transitionOutHandler); - - // reset move updates - resetMove(instance); - // reset resize updates - resetResize(instance); - - // restore if maximized - if (instance.isMaximized() && !instance.get('startMaximized')) { - restore(instance); - } - - // return focus to the last active element - if (alertify.defaults.maintainFocus && instance.__internal.activeElement) { - instance.__internal.activeElement.focus(); - instance.__internal.activeElement = null; - } - - //destory the instance - if (typeof instance.__internal.destroy === 'function') { - instance.__internal.destroy.apply(instance); - } - } - /* Controls moving a dialog around */ - //holde the current moving instance - var movable = null, - //holds the current X offset when move starts - offsetX = 0, - //holds the current Y offset when move starts - offsetY = 0, - xProp = 'pageX', - yProp = 'pageY', - bounds = null, - refreshTop = false, - moveDelegate = null - ; - - /** - * Helper: sets the element top/left coordinates - * - * @param {Event} event DOM event object. - * @param {Node} element The element being moved. - * - * @return {undefined} - */ - function moveElement(event, element) { - var left = (event[xProp] - offsetX), - top = (event[yProp] - offsetY); - - if(refreshTop){ - top -= document.body.scrollTop; - } - - element.style.left = left + 'px'; - element.style.top = top + 'px'; - - } - /** - * Helper: sets the element top/left coordinates within screen bounds - * - * @param {Event} event DOM event object. - * @param {Node} element The element being moved. - * - * @return {undefined} - */ - function moveElementBounded(event, element) { - var left = (event[xProp] - offsetX), - top = (event[yProp] - offsetY); + /** + * Focus event handler, attached to document.body and dialogs own reset links. + * handles the focus for modal dialogs only. + * + * @param {Event} event DOM focus event object. + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function onReset(event, instance) { + // should work on last modal if triggered from document.body + if (!instance) { + for (var x = openDialogs.length - 1; x > -1; x -= 1) { + if (openDialogs[x].isModal()) { + instance = openDialogs[x]; + break; + } + } + } + // if modal + if (instance && instance.isModal()) { + // determine reset target to enable forward/backward tab cycle. + var resetTarget, + target = event.srcElement || event.target; + var lastResetElement = + target === instance.elements.reset[1] || + (instance.__internal.buttons.length === 0 && + target === document.body); + + // if last reset link, then go to maximize or close + if (lastResetElement) { + if (instance.get("maximizable")) { + resetTarget = instance.elements.commands.maximize; + } else if (instance.get("closable")) { + resetTarget = instance.elements.commands.close; + } + } + // if no reset target found, try finding the best button + if (resetTarget === undefined) { + if (typeof instance.__internal.focus.element === "number") { + // button focus element, go to first available button + if (target === instance.elements.reset[0]) { + resetTarget = + instance.elements.buttons.auxiliary.firstChild || + instance.elements.buttons.primary.firstChild; + } else if (lastResetElement) { + //restart the cycle by going to first reset link + resetTarget = instance.elements.reset[0]; + } + } else { + // will reach here when tapping backwards, so go to last child + // The focus element SHOULD NOT be a button (logically!). + if (target === instance.elements.reset[0]) { + resetTarget = + instance.elements.buttons.primary.lastChild || + instance.elements.buttons.auxiliary.lastChild; + } + } + } + // focus + setFocus(instance, resetTarget); + } + } + /** + * Transition in transitionend event handler. + * + * @param {Event} TransitionEnd event object. + * @param {Object} The dilog instance. + * + * @return {undefined} + */ + function handleTransitionInEvent(event, instance) { + // clear the timer + clearTimeout(instance.__internal.timerIn); - if(refreshTop){ - top -= document.body.scrollTop; - } - - element.style.left = Math.min(bounds.maxLeft, Math.max(bounds.minLeft, left)) + 'px'; - if(refreshTop){ - element.style.top = Math.min(bounds.maxTop, Math.max(bounds.minTop, top)) + 'px'; - }else{ - element.style.top = Math.max(bounds.minTop, top) + 'px'; - } - } - + // once transition is complete, set focus + setFocus(instance); - /** - * Triggers the start of a move event, attached to the header element mouse down event. - * Adds no-selection class to the body, disabling selection while moving. - * - * @param {Event} event DOM event object. - * @param {Object} instance The dilog instance. - * - * @return {Boolean} false - */ - function beginMove(event, instance) { - if (resizable === null && !instance.isMaximized() && instance.get('movable')) { - var eventSrc, left=0, top=0; - if (event.type === 'touchstart') { - event.preventDefault(); - eventSrc = event.targetTouches[0]; - xProp = 'clientX'; - yProp = 'clientY'; - } else if (event.button === 0) { - eventSrc = event; - } + //restore scroll to prevent document jump + restoreScrollPosition(); - if (eventSrc) { - - var element = instance.elements.dialog; - addClass(element, classes.capture); - - if (element.style.left) { - left = parseInt(element.style.left, 10); - } - - if (element.style.top) { - top = parseInt(element.style.top, 10); - } - - offsetX = eventSrc[xProp] - left; - offsetY = eventSrc[yProp] - top; - - if(instance.isModal()){ - offsetY += instance.elements.modal.scrollTop; - }else if(instance.isPinned()){ - offsetY -= document.body.scrollTop; - } - - if(instance.get('moveBounded')){ - var current = element, - offsetLeft = -left, - offsetTop = -top; - - //calc offset - do { - offsetLeft += current.offsetLeft; - offsetTop += current.offsetTop; - } while (current = current.offsetParent); - - bounds = { - maxLeft : offsetLeft, - minLeft : -offsetLeft, - maxTop : document.documentElement.clientHeight - element.clientHeight - offsetTop, - minTop : -offsetTop - }; - moveDelegate = moveElementBounded; - }else{ - bounds = null; - moveDelegate = moveElement; - } - - // allow custom `onmove` method - dispatchEvent('onmove', instance); - - refreshTop = !instance.isModal() && instance.isPinned(); - movable = instance; - moveDelegate(eventSrc, element); - addClass(document.body, classes.noSelection); - return false; - } - } - } + // allow handling key up after transition ended. + cancelKeyup = false; - /** - * The actual move handler, attached to document.body mousemove event. - * - * @param {Event} event DOM event object. - * - * @return {undefined} - */ - function move(event) { - if (movable) { - var eventSrc; - if (event.type === 'touchmove') { - event.preventDefault(); - eventSrc = event.targetTouches[0]; - } else if (event.button === 0) { - eventSrc = event; - } - if (eventSrc) { - moveDelegate(eventSrc, movable.elements.dialog); - } - } - } + // allow custom `onfocus` method + dispatchEvent("onfocus", instance); - /** - * Triggers the end of a move event, attached to document.body mouseup event. - * Removes no-selection class from document.body, allowing selection. - * - * @return {undefined} - */ - function endMove() { - if (movable) { - var instance = movable; - movable = bounds = null; - removeClass(document.body, classes.noSelection); - removeClass(instance.elements.dialog, classes.capture); - // allow custom `onmoved` method - dispatchEvent('onmoved', instance); - } - } + // unbind the event + off( + instance.elements.dialog, + transition.type, + instance.__internal.transitionInHandler + ); - /** - * Resets any changes made by moving the element to its original state, - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function resetMove(instance) { - movable = null; - var element = instance.elements.dialog; - element.style.left = element.style.top = ''; - } + removeClass(instance.elements.root, classes.animationIn); + } - /** - * Updates the dialog move behavior. - * - * @param {Object} instance The dilog instance. - * @param {Boolean} on True to add the behavior, removes it otherwise. - * - * @return {undefined} - */ - function updateMovable(instance) { - if (instance.get('movable')) { - // add class - addClass(instance.elements.root, classes.movable); - if (instance.isOpen()) { - bindMovableEvents(instance); - } - } else { + /** + * Transition out transitionend event handler. + * + * @param {Event} TransitionEnd event object. + * @param {Object} The dilog instance. + * + * @return {undefined} + */ + function handleTransitionOutEvent(event, instance) { + // clear the timer + clearTimeout(instance.__internal.timerOut); + // unbind the event + off( + instance.elements.dialog, + transition.type, + instance.__internal.transitionOutHandler + ); + + // reset move updates + resetMove(instance); + // reset resize updates + resetResize(instance); + + // restore if maximized + if (instance.isMaximized() && !instance.get("startMaximized")) { + restore(instance); + } + + // return focus to the last active element + if ( + alertify.defaults.maintainFocus && + instance.__internal.activeElement + ) { + instance.__internal.activeElement.focus(); + instance.__internal.activeElement = null; + } + + //destory the instance + if (typeof instance.__internal.destroy === "function") { + instance.__internal.destroy.apply(instance); + } + } + /* Controls moving a dialog around */ + //holde the current moving instance + var movable = null, + //holds the current X offset when move starts + offsetX = 0, + //holds the current Y offset when move starts + offsetY = 0, + xProp = "pageX", + yProp = "pageY", + bounds = null, + refreshTop = false, + moveDelegate = null; + /** + * Helper: sets the element top/left coordinates + * + * @param {Event} event DOM event object. + * @param {Node} element The element being moved. + * + * @return {undefined} + */ + function moveElement(event, element) { + var left = event[xProp] - offsetX, + top = event[yProp] - offsetY; - //reset - resetMove(instance); - // remove class - removeClass(instance.elements.root, classes.movable); - if (instance.isOpen()) { - unbindMovableEvents(instance); - } - } - } + if (refreshTop) { + top -= document.body.scrollTop; + } - /* Controls moving a dialog around */ - //holde the current instance being resized - var resizable = null, - //holds the staring left offset when resize starts. - startingLeft = Number.Nan, - //holds the staring width when resize starts. - startingWidth = 0, - //holds the initial width when resized for the first time. - minWidth = 0, - //holds the offset of the resize handle. - handleOffset = 0 - ; - - /** - * Helper: sets the element width/height and updates left coordinate if neccessary. - * - * @param {Event} event DOM mousemove event object. - * @param {Node} element The element being moved. - * @param {Boolean} pinned A flag indicating if the element being resized is pinned to the screen. - * - * @return {undefined} - */ - function resizeElement(event, element, pageRelative) { + element.style.left = left + "px"; + element.style.top = top + "px"; + } + /** + * Helper: sets the element top/left coordinates within screen bounds + * + * @param {Event} event DOM event object. + * @param {Node} element The element being moved. + * + * @return {undefined} + */ + function moveElementBounded(event, element) { + var left = event[xProp] - offsetX, + top = event[yProp] - offsetY; + + if (refreshTop) { + top -= document.body.scrollTop; + } + + element.style.left = + Math.min(bounds.maxLeft, Math.max(bounds.minLeft, left)) + "px"; + if (refreshTop) { + element.style.top = + Math.min(bounds.maxTop, Math.max(bounds.minTop, top)) + "px"; + } else { + element.style.top = Math.max(bounds.minTop, top) + "px"; + } + } - //calculate offsets from 0,0 - var current = element; - var offsetLeft = 0; - var offsetTop = 0; + /** + * Triggers the start of a move event, attached to the header element mouse down event. + * Adds no-selection class to the body, disabling selection while moving. + * + * @param {Event} event DOM event object. + * @param {Object} instance The dilog instance. + * + * @return {Boolean} false + */ + function beginMove(event, instance) { + if ( + resizable === null && + !instance.isMaximized() && + instance.get("movable") + ) { + var eventSrc, + left = 0, + top = 0; + if (event.type === "touchstart") { + event.preventDefault(); + eventSrc = event.targetTouches[0]; + xProp = "clientX"; + yProp = "clientY"; + } else if (event.button === 0) { + eventSrc = event; + } + + if (eventSrc) { + var element = instance.elements.dialog; + addClass(element, classes.capture); + + if (element.style.left) { + left = parseInt(element.style.left, 10); + } + + if (element.style.top) { + top = parseInt(element.style.top, 10); + } + + offsetX = eventSrc[xProp] - left; + offsetY = eventSrc[yProp] - top; + + if (instance.isModal()) { + offsetY += instance.elements.modal.scrollTop; + } else if (instance.isPinned()) { + offsetY -= document.body.scrollTop; + } + + if (instance.get("moveBounded")) { + var current = element, + offsetLeft = -left, + offsetTop = -top; + + //calc offset do { - offsetLeft += current.offsetLeft; - offsetTop += current.offsetTop; - } while (current = current.offsetParent); - - // determine X,Y coordinates. - var X, Y; - if (pageRelative === true) { - X = event.pageX; - Y = event.pageY; - } else { - X = event.clientX; - Y = event.clientY; - } - // rtl handling - var isRTL = isRightToLeft(); - if (isRTL) { - // reverse X - X = document.body.offsetWidth - X; - // if has a starting left, calculate offsetRight - if (!isNaN(startingLeft)) { - offsetLeft = document.body.offsetWidth - offsetLeft - element.offsetWidth; - } - } - - // set width/height - element.style.height = (Y - offsetTop + handleOffset) + 'px'; - element.style.width = (X - offsetLeft + handleOffset) + 'px'; - - // if the element being resized has a starting left, maintain it. - // the dialog is centered, divide by half the offset to maintain the margins. - if (!isNaN(startingLeft)) { - var diff = Math.abs(element.offsetWidth - startingWidth) * 0.5; - if (isRTL) { - //negate the diff, why? - //when growing it should decrease left - //when shrinking it should increase left - diff *= -1; - } - if (element.offsetWidth > startingWidth) { - //growing - element.style.left = (startingLeft + diff) + 'px'; - } else if (element.offsetWidth >= minWidth) { - //shrinking - element.style.left = (startingLeft - diff) + 'px'; - } - } - } - - /** - * Triggers the start of a resize event, attached to the resize handle element mouse down event. - * Adds no-selection class to the body, disabling selection while moving. - * - * @param {Event} event DOM event object. - * @param {Object} instance The dilog instance. - * - * @return {Boolean} false - */ - function beginResize(event, instance) { - if (!instance.isMaximized()) { - var eventSrc; - if (event.type === 'touchstart') { - event.preventDefault(); - eventSrc = event.targetTouches[0]; - } else if (event.button === 0) { - eventSrc = event; - } - if (eventSrc) { - // allow custom `onresize` method - dispatchEvent('onresize', instance); - - resizable = instance; - handleOffset = instance.elements.resizeHandle.offsetHeight / 2; - var element = instance.elements.dialog; - addClass(element, classes.capture); - startingLeft = parseInt(element.style.left, 10); - element.style.height = element.offsetHeight + 'px'; - element.style.minHeight = instance.elements.header.offsetHeight + instance.elements.footer.offsetHeight + 'px'; - element.style.width = (startingWidth = element.offsetWidth) + 'px'; - - if (element.style.maxWidth !== 'none') { - element.style.minWidth = (minWidth = element.offsetWidth) + 'px'; - } - element.style.maxWidth = 'none'; - addClass(document.body, classes.noSelection); - return false; - } - } - } - - /** - * The actual resize handler, attached to document.body mousemove event. - * - * @param {Event} event DOM event object. - * - * @return {undefined} - */ - function resize(event) { - if (resizable) { - var eventSrc; - if (event.type === 'touchmove') { - event.preventDefault(); - eventSrc = event.targetTouches[0]; - } else if (event.button === 0) { - eventSrc = event; - } - if (eventSrc) { - resizeElement(eventSrc, resizable.elements.dialog, !resizable.get('modal') && !resizable.get('pinned')); - } - } - } - - /** - * Triggers the end of a resize event, attached to document.body mouseup event. - * Removes no-selection class from document.body, allowing selection. - * - * @return {undefined} - */ - function endResize() { - if (resizable) { - var instance = resizable; - resizable = null; - removeClass(document.body, classes.noSelection); - removeClass(instance.elements.dialog, classes.capture); - cancelClick = true; - // allow custom `onresized` method - dispatchEvent('onresized', instance); - } - } - - /** - * Resets any changes made by resizing the element to its original state. - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function resetResize(instance) { - resizable = null; - var element = instance.elements.dialog; - if (element.style.maxWidth === 'none') { - //clear inline styles. - element.style.maxWidth = element.style.minWidth = element.style.width = element.style.height = element.style.minHeight = element.style.left = ''; - //reset variables. - startingLeft = Number.Nan; - startingWidth = minWidth = handleOffset = 0; - } - } - - - /** - * Updates the dialog move behavior. - * - * @param {Object} instance The dilog instance. - * @param {Boolean} on True to add the behavior, removes it otherwise. - * - * @return {undefined} - */ - function updateResizable(instance) { - if (instance.get('resizable')) { - // add class - addClass(instance.elements.root, classes.resizable); - if (instance.isOpen()) { - bindResizableEvents(instance); - } - } else { - //reset - resetResize(instance); - // remove class - removeClass(instance.elements.root, classes.resizable); - if (instance.isOpen()) { - unbindResizableEvents(instance); - } - } - } - - /** - * Reset move/resize on window resize. - * - * @param {Event} event window resize event object. - * - * @return {undefined} - */ - function windowResize(/*event*/) { - for (var x = 0; x < openDialogs.length; x += 1) { - var instance = openDialogs[x]; - if (instance.get('autoReset')) { - resetMove(instance); - resetResize(instance); - } - } - } - /** - * Bind dialogs events - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function bindEvents(instance) { - // if first dialog, hook global handlers - if (openDialogs.length === 1) { - //global - on(window, 'resize', windowResize); - on(document.body, 'keyup', keyupHandler); - on(document.body, 'keydown', keydownHandler); - on(document.body, 'focus', onReset); - - //move - on(document.documentElement, 'mousemove', move); - on(document.documentElement, 'touchmove', move); - on(document.documentElement, 'mouseup', endMove); - on(document.documentElement, 'touchend', endMove); - //resize - on(document.documentElement, 'mousemove', resize); - on(document.documentElement, 'touchmove', resize); - on(document.documentElement, 'mouseup', endResize); - on(document.documentElement, 'touchend', endResize); - } - - // common events - on(instance.elements.commands.container, 'click', instance.__internal.commandsClickHandler); - on(instance.elements.footer, 'click', instance.__internal.buttonsClickHandler); - on(instance.elements.reset[0], 'focus', instance.__internal.resetHandler); - on(instance.elements.reset[1], 'focus', instance.__internal.resetHandler); - - //prevent handling key up when dialog is being opened by a key stroke. - cancelKeyup = true; - // hook in transition handler - on(instance.elements.dialog, transition.type, instance.__internal.transitionInHandler); - - // modelss only events - if (!instance.get('modal')) { - bindModelessEvents(instance); - } - - // resizable - if (instance.get('resizable')) { - bindResizableEvents(instance); - } - - // movable - if (instance.get('movable')) { - bindMovableEvents(instance); - } - } - - /** - * Unbind dialogs events - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function unbindEvents(instance) { - // if last dialog, remove global handlers - if (openDialogs.length === 1) { - //global - off(window, 'resize', windowResize); - off(document.body, 'keyup', keyupHandler); - off(document.body, 'keydown', keydownHandler); - off(document.body, 'focus', onReset); - //move - off(document.documentElement, 'mousemove', move); - off(document.documentElement, 'mouseup', endMove); - //resize - off(document.documentElement, 'mousemove', resize); - off(document.documentElement, 'mouseup', endResize); - } - - // common events - off(instance.elements.commands.container, 'click', instance.__internal.commandsClickHandler); - off(instance.elements.footer, 'click', instance.__internal.buttonsClickHandler); - off(instance.elements.reset[0], 'focus', instance.__internal.resetHandler); - off(instance.elements.reset[1], 'focus', instance.__internal.resetHandler); - - // hook out transition handler - on(instance.elements.dialog, transition.type, instance.__internal.transitionOutHandler); - - // modelss only events - if (!instance.get('modal')) { - unbindModelessEvents(instance); - } - - // movable - if (instance.get('movable')) { - unbindMovableEvents(instance); - } - - // resizable - if (instance.get('resizable')) { - unbindResizableEvents(instance); - } - - } - - /** - * Bind modeless specific events - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function bindModelessEvents(instance) { - on(instance.elements.dialog, 'focus', instance.__internal.bringToFrontHandler, true); - } + offsetLeft += current.offsetLeft; + offsetTop += current.offsetTop; + } while ((current = current.offsetParent)); + + bounds = { + maxLeft: offsetLeft, + minLeft: -offsetLeft, + maxTop: + document.documentElement.clientHeight - + element.clientHeight - + offsetTop, + minTop: -offsetTop, + }; + moveDelegate = moveElementBounded; + } else { + bounds = null; + moveDelegate = moveElement; + } + + // allow custom `onmove` method + dispatchEvent("onmove", instance); + + refreshTop = !instance.isModal() && instance.isPinned(); + movable = instance; + moveDelegate(eventSrc, element); + addClass(document.body, classes.noSelection); + return false; + } + } + } - /** - * Unbind modeless specific events - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function unbindModelessEvents(instance) { - off(instance.elements.dialog, 'focus', instance.__internal.bringToFrontHandler, true); - } + /** + * The actual move handler, attached to document.body mousemove event. + * + * @param {Event} event DOM event object. + * + * @return {undefined} + */ + function move(event) { + if (movable) { + var eventSrc; + if (event.type === "touchmove") { + event.preventDefault(); + eventSrc = event.targetTouches[0]; + } else if (event.button === 0) { + eventSrc = event; + } + if (eventSrc) { + moveDelegate(eventSrc, movable.elements.dialog); + } + } + } + /** + * Triggers the end of a move event, attached to document.body mouseup event. + * Removes no-selection class from document.body, allowing selection. + * + * @return {undefined} + */ + function endMove() { + if (movable) { + var instance = movable; + movable = bounds = null; + removeClass(document.body, classes.noSelection); + removeClass(instance.elements.dialog, classes.capture); + // allow custom `onmoved` method + dispatchEvent("onmoved", instance); + } + } + /** + * Resets any changes made by moving the element to its original state, + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function resetMove(instance) { + movable = null; + var element = instance.elements.dialog; + element.style.left = element.style.top = ""; + } - /** - * Bind movable specific events - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function bindMovableEvents(instance) { - on(instance.elements.header, 'mousedown', instance.__internal.beginMoveHandler); - on(instance.elements.header, 'touchstart', instance.__internal.beginMoveHandler); - } + /** + * Updates the dialog move behavior. + * + * @param {Object} instance The dilog instance. + * @param {Boolean} on True to add the behavior, removes it otherwise. + * + * @return {undefined} + */ + function updateMovable(instance) { + if (instance.get("movable")) { + // add class + addClass(instance.elements.root, classes.movable); + if (instance.isOpen()) { + bindMovableEvents(instance); + } + } else { + //reset + resetMove(instance); + // remove class + removeClass(instance.elements.root, classes.movable); + if (instance.isOpen()) { + unbindMovableEvents(instance); + } + } + } - /** - * Unbind movable specific events - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function unbindMovableEvents(instance) { - off(instance.elements.header, 'mousedown', instance.__internal.beginMoveHandler); - off(instance.elements.header, 'touchstart', instance.__internal.beginMoveHandler); - } + /* Controls moving a dialog around */ + //holde the current instance being resized + var resizable = null, + //holds the staring left offset when resize starts. + startingLeft = Number.Nan, + //holds the staring width when resize starts. + startingWidth = 0, + //holds the initial width when resized for the first time. + minWidth = 0, + //holds the offset of the resize handle. + handleOffset = 0; + /** + * Helper: sets the element width/height and updates left coordinate if neccessary. + * + * @param {Event} event DOM mousemove event object. + * @param {Node} element The element being moved. + * @param {Boolean} pinned A flag indicating if the element being resized is pinned to the screen. + * + * @return {undefined} + */ + function resizeElement(event, element, pageRelative) { + //calculate offsets from 0,0 + var current = element; + var offsetLeft = 0; + var offsetTop = 0; + do { + offsetLeft += current.offsetLeft; + offsetTop += current.offsetTop; + } while ((current = current.offsetParent)); + + // determine X,Y coordinates. + var X, Y; + if (pageRelative === true) { + X = event.pageX; + Y = event.pageY; + } else { + X = event.clientX; + Y = event.clientY; + } + // rtl handling + var isRTL = isRightToLeft(); + if (isRTL) { + // reverse X + X = document.body.offsetWidth - X; + // if has a starting left, calculate offsetRight + if (!isNaN(startingLeft)) { + offsetLeft = + document.body.offsetWidth - offsetLeft - element.offsetWidth; + } + } + + // set width/height + element.style.height = Y - offsetTop + handleOffset + "px"; + element.style.width = X - offsetLeft + handleOffset + "px"; + + // if the element being resized has a starting left, maintain it. + // the dialog is centered, divide by half the offset to maintain the margins. + if (!isNaN(startingLeft)) { + var diff = Math.abs(element.offsetWidth - startingWidth) * 0.5; + if (isRTL) { + //negate the diff, why? + //when growing it should decrease left + //when shrinking it should increase left + diff *= -1; + } + if (element.offsetWidth > startingWidth) { + //growing + element.style.left = startingLeft + diff + "px"; + } else if (element.offsetWidth >= minWidth) { + //shrinking + element.style.left = startingLeft - diff + "px"; + } + } + } + /** + * Triggers the start of a resize event, attached to the resize handle element mouse down event. + * Adds no-selection class to the body, disabling selection while moving. + * + * @param {Event} event DOM event object. + * @param {Object} instance The dilog instance. + * + * @return {Boolean} false + */ + function beginResize(event, instance) { + if (!instance.isMaximized()) { + var eventSrc; + if (event.type === "touchstart") { + event.preventDefault(); + eventSrc = event.targetTouches[0]; + } else if (event.button === 0) { + eventSrc = event; + } + if (eventSrc) { + // allow custom `onresize` method + dispatchEvent("onresize", instance); + + resizable = instance; + handleOffset = instance.elements.resizeHandle.offsetHeight / 2; + var element = instance.elements.dialog; + addClass(element, classes.capture); + startingLeft = parseInt(element.style.left, 10); + element.style.height = element.offsetHeight + "px"; + element.style.minHeight = + instance.elements.header.offsetHeight + + instance.elements.footer.offsetHeight + + "px"; + element.style.width = (startingWidth = element.offsetWidth) + "px"; + + if (element.style.maxWidth !== "none") { + element.style.minWidth = (minWidth = element.offsetWidth) + "px"; + } + element.style.maxWidth = "none"; + addClass(document.body, classes.noSelection); + return false; + } + } + } + /** + * The actual resize handler, attached to document.body mousemove event. + * + * @param {Event} event DOM event object. + * + * @return {undefined} + */ + function resize(event) { + if (resizable) { + var eventSrc; + if (event.type === "touchmove") { + event.preventDefault(); + eventSrc = event.targetTouches[0]; + } else if (event.button === 0) { + eventSrc = event; + } + if (eventSrc) { + resizeElement( + eventSrc, + resizable.elements.dialog, + !resizable.get("modal") && !resizable.get("pinned") + ); + } + } + } - /** - * Bind resizable specific events - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function bindResizableEvents(instance) { - on(instance.elements.resizeHandle, 'mousedown', instance.__internal.beginResizeHandler); - on(instance.elements.resizeHandle, 'touchstart', instance.__internal.beginResizeHandler); - } + /** + * Triggers the end of a resize event, attached to document.body mouseup event. + * Removes no-selection class from document.body, allowing selection. + * + * @return {undefined} + */ + function endResize() { + if (resizable) { + var instance = resizable; + resizable = null; + removeClass(document.body, classes.noSelection); + removeClass(instance.elements.dialog, classes.capture); + cancelClick = true; + // allow custom `onresized` method + dispatchEvent("onresized", instance); + } + } - /** - * Unbind resizable specific events - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function unbindResizableEvents(instance) { - off(instance.elements.resizeHandle, 'mousedown', instance.__internal.beginResizeHandler); - off(instance.elements.resizeHandle, 'touchstart', instance.__internal.beginResizeHandler); - } + /** + * Resets any changes made by resizing the element to its original state. + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function resetResize(instance) { + resizable = null; + var element = instance.elements.dialog; + if (element.style.maxWidth === "none") { + //clear inline styles. + element.style.maxWidth = + element.style.minWidth = + element.style.width = + element.style.height = + element.style.minHeight = + element.style.left = + ""; + //reset variables. + startingLeft = Number.Nan; + startingWidth = minWidth = handleOffset = 0; + } + } - /** - * Bind closable events - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function bindClosableEvents(instance) { - on(instance.elements.modal, 'click', instance.__internal.modalClickHandler); - } + /** + * Updates the dialog move behavior. + * + * @param {Object} instance The dilog instance. + * @param {Boolean} on True to add the behavior, removes it otherwise. + * + * @return {undefined} + */ + function updateResizable(instance) { + if (instance.get("resizable")) { + // add class + addClass(instance.elements.root, classes.resizable); + if (instance.isOpen()) { + bindResizableEvents(instance); + } + } else { + //reset + resetResize(instance); + // remove class + removeClass(instance.elements.root, classes.resizable); + if (instance.isOpen()) { + unbindResizableEvents(instance); + } + } + } - /** - * Unbind closable specific events - * - * @param {Object} instance The dilog instance. - * - * @return {undefined} - */ - function unbindClosableEvents(instance) { - off(instance.elements.modal, 'click', instance.__internal.modalClickHandler); - } - // dialog API - return { - __init:initialize, - /** - * Check if dialog is currently open - * - * @return {Boolean} - */ - isOpen: function () { - return this.__internal.isOpen; - }, - isModal: function (){ - return this.elements.root.className.indexOf(classes.modeless) < 0; - }, - isMaximized:function(){ - return this.elements.root.className.indexOf(classes.maximized) > -1; - }, - isPinned:function(){ - return this.elements.root.className.indexOf(classes.unpinned) < 0; - }, - maximize:function(){ - if(!this.isMaximized()){ - maximize(this); - } - return this; - }, - restore:function(){ - if(this.isMaximized()){ - restore(this); - } - return this; - }, - pin:function(){ - if(!this.isPinned()){ - pin(this); - } - return this; - }, - unpin:function(){ - if(this.isPinned()){ - unpin(this); - } - return this; - }, - bringToFront:function(){ - bringToFront(null, this); - return this; - }, - /** - * Move the dialog to a specific x/y coordinates - * - * @param {Number} x The new dialog x coordinate in pixels. - * @param {Number} y The new dialog y coordinate in pixels. - * - * @return {Object} The dialog instance. - */ - moveTo:function(x,y){ - if(!isNaN(x) && !isNaN(y)){ - // allow custom `onmove` method - dispatchEvent('onmove', this); - - var element = this.elements.dialog, - current = element, - offsetLeft = 0, - offsetTop = 0; - - //subtract existing left,top - if (element.style.left) { - offsetLeft -= parseInt(element.style.left, 10); - } - if (element.style.top) { - offsetTop -= parseInt(element.style.top, 10); - } - //calc offset - do { - offsetLeft += current.offsetLeft; - offsetTop += current.offsetTop; - } while (current = current.offsetParent); - - //calc left, top - var left = (x - offsetLeft); - var top = (y - offsetTop); - - //// rtl handling - if (isRightToLeft()) { - left *= -1; - } - - element.style.left = left + 'px'; - element.style.top = top + 'px'; - - // allow custom `onmoved` method - dispatchEvent('onmoved', this); - } - return this; - }, - /** - * Resize the dialog to a specific width/height (the dialog must be 'resizable'). - * The dialog can be resized to: - * A minimum width equal to the initial display width - * A minimum height equal to the sum of header/footer heights. - * - * - * @param {Number or String} width The new dialog width in pixels or in percent. - * @param {Number or String} height The new dialog height in pixels or in percent. - * - * @return {Object} The dialog instance. - */ - resizeTo:function(width,height){ - var w = parseFloat(width), - h = parseFloat(height), - regex = /(\d*\.\d+|\d+)%/ - ; - - if(!isNaN(w) && !isNaN(h) && this.get('resizable') === true){ - - // allow custom `onresize` method - dispatchEvent('onresize', this); - - if(('' + width).match(regex)){ - w = w / 100 * document.documentElement.clientWidth ; - } - - if(('' + height).match(regex)){ - h = h / 100 * document.documentElement.clientHeight; - } - - var element = this.elements.dialog; - if (element.style.maxWidth !== 'none') { - element.style.minWidth = (minWidth = element.offsetWidth) + 'px'; - } - element.style.maxWidth = 'none'; - element.style.minHeight = this.elements.header.offsetHeight + this.elements.footer.offsetHeight + 'px'; - element.style.width = w + 'px'; - element.style.height = h + 'px'; - - // allow custom `onresized` method - dispatchEvent('onresized', this); - } - return this; - }, - /** - * Gets or Sets dialog settings/options - * - * @param {String|Object} key A string specifying a propery name or a collection of key/value pairs. - * @param {Object} value Optional, the value associated with the key (in case it was a string). - * - * @return {undefined} - */ - setting : function (key, value) { - var self = this; - var result = update(this, this.__internal.options, function(k,o,n){ optionUpdated(self,k,o,n); }, key, value); - if(result.op === 'get'){ - if(result.found){ - return result.value; - }else if(typeof this.settings !== 'undefined'){ - return update(this, this.settings, this.settingUpdated || function(){}, key, value).value; - }else{ - return undefined; - } - }else if(result.op === 'set'){ - if(result.items.length > 0){ - var callback = this.settingUpdated || function(){}; - for(var x=0;x<result.items.length;x+=1){ - var item = result.items[x]; - if(!item.found && typeof this.settings !== 'undefined'){ - update(this, this.settings, callback, item.key, item.value); - } - } - } - return this; - } - }, - /** - * [Alias] Sets dialog settings/options - */ - set:function(key, value){ - this.setting(key,value); - return this; - }, - /** - * [Alias] Gets dialog settings/options - */ - get:function(key){ - return this.setting(key); - }, - /** - * Sets dialog header - * @content {string or element} - * - * @return {undefined} - */ - setHeader:function(content){ - if(typeof content === 'string'){ - clearContents(this.elements.header); - this.elements.header.innerHTML = content; - }else if (content instanceof window.HTMLElement && this.elements.header.firstChild !== content){ - clearContents(this.elements.header); - this.elements.header.appendChild(content); - } - return this; - }, - /** - * Sets dialog contents - * @content {string or element} - * - * @return {undefined} - */ - setContent:function(content){ - if(typeof content === 'string'){ - clearContents(this.elements.content); - this.elements.content.innerHTML = content; - }else if (content instanceof window.HTMLElement && this.elements.content.firstChild !== content){ - clearContents(this.elements.content); - this.elements.content.appendChild(content); - } - return this; - }, - /** - * Show the dialog as modal - * - * @return {Object} the dialog instance. - */ - showModal: function(className){ - return this.show(true, className); - }, - /** - * Show the dialog - * - * @return {Object} the dialog instance. - */ - show: function (modal, className) { - - // ensure initialization - initialize(this); - - if ( !this.__internal.isOpen ) { - - // add to open dialogs - this.__internal.isOpen = true; - openDialogs.push(this); - - // save last focused element - if(alertify.defaults.maintainFocus){ - this.__internal.activeElement = document.activeElement; - } - - // set tabindex attribute on body element this allows script to give it focusable - if(!document.body.hasAttribute('tabindex')) { - document.body.setAttribute( 'tabindex', tabindex = '0'); - } - - //allow custom dom manipulation updates before showing the dialog. - if(typeof this.prepare === 'function'){ - this.prepare(); - } - - bindEvents(this); - - if(modal !== undefined){ - this.set('modal', modal); - } - - //save scroll to prevent document jump - saveScrollPosition(); - - ensureNoOverflow(); - - // allow custom dialog class on show - if(typeof className === 'string' && className !== ''){ - this.__internal.className = className; - addClass(this.elements.root, className); - } - - // maximize if start maximized - if ( this.get('startMaximized')) { - this.maximize(); - }else if(this.isMaximized()){ - restore(this); - } - - updateAbsPositionFix(this); - this.elements.root.removeAttribute('style'); - removeClass(this.elements.root, classes.animationOut); - addClass(this.elements.root, classes.animationIn); - - // set 1s fallback in case transition event doesn't fire - clearTimeout( this.__internal.timerIn); - this.__internal.timerIn = setTimeout( this.__internal.transitionInHandler, transition.supported ? 1000 : 100 ); - - if(isSafari){ - // force desktop safari reflow - var root = this.elements.root; - root.style.display = 'none'; - setTimeout(function(){root.style.display = 'block';}, 0); - } - - //reflow - reflow = this.elements.root.offsetWidth; - - // show dialog - removeClass(this.elements.root, classes.hidden); - - // internal on show event - if(typeof this.hooks.onshow === 'function'){ - this.hooks.onshow.call(this); - } - - // allow custom `onshow` method - dispatchEvent('onshow', this); - - }else{ - // reset move updates - resetMove(this); - // reset resize updates - resetResize(this); - // shake the dialog to indicate its already open - addClass(this.elements.dialog, classes.shake); - var self = this; - setTimeout(function(){ - removeClass(self.elements.dialog, classes.shake); - },200); - } - return this; - }, - /** - * Close the dialog - * - * @return {Object} The dialog instance - */ - close: function () { - if (this.__internal.isOpen ) { - // custom `onclosing` event - if(dispatchEvent('onclosing', this) !== false){ - - unbindEvents(this); - - removeClass(this.elements.root, classes.animationIn); - addClass(this.elements.root, classes.animationOut); - - // set 1s fallback in case transition event doesn't fire - clearTimeout( this.__internal.timerOut ); - this.__internal.timerOut = setTimeout( this.__internal.transitionOutHandler, transition.supported ? 1000 : 100 ); - // hide dialog - addClass(this.elements.root, classes.hidden); - //reflow - reflow = this.elements.modal.offsetWidth; - - // remove custom dialog class on hide - if (typeof this.__internal.className !== 'undefined' && this.__internal.className !== '') { - removeClass(this.elements.root, this.__internal.className); - } - - // internal on close event - if(typeof this.hooks.onclose === 'function'){ - this.hooks.onclose.call(this); - } - - // allow custom `onclose` method - dispatchEvent('onclose', this); - - //remove from open dialogs - openDialogs.splice(openDialogs.indexOf(this),1); - this.__internal.isOpen = false; - - ensureNoOverflow(); - } + /** + * Reset move/resize on window resize. + * + * @param {Event} event window resize event object. + * + * @return {undefined} + */ + function windowResize(/*event*/) { + for (var x = 0; x < openDialogs.length; x += 1) { + var instance = openDialogs[x]; + if (instance.get("autoReset")) { + resetMove(instance); + resetResize(instance); + } + } + } + /** + * Bind dialogs events + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function bindEvents(instance) { + // if first dialog, hook global handlers + if (openDialogs.length === 1) { + //global + on(window, "resize", windowResize); + on(document.body, "keyup", keyupHandler); + on(document.body, "keydown", keydownHandler); + on(document.body, "focus", onReset); + + //move + on(document.documentElement, "mousemove", move); + on(document.documentElement, "touchmove", move); + on(document.documentElement, "mouseup", endMove); + on(document.documentElement, "touchend", endMove); + //resize + on(document.documentElement, "mousemove", resize); + on(document.documentElement, "touchmove", resize); + on(document.documentElement, "mouseup", endResize); + on(document.documentElement, "touchend", endResize); + } + + // common events + on( + instance.elements.commands.container, + "click", + instance.__internal.commandsClickHandler + ); + on( + instance.elements.footer, + "click", + instance.__internal.buttonsClickHandler + ); + on(instance.elements.reset[0], "focus", instance.__internal.resetHandler); + on(instance.elements.reset[1], "focus", instance.__internal.resetHandler); + + //prevent handling key up when dialog is being opened by a key stroke. + cancelKeyup = true; + // hook in transition handler + on( + instance.elements.dialog, + transition.type, + instance.__internal.transitionInHandler + ); + + // modelss only events + if (!instance.get("modal")) { + bindModelessEvents(instance); + } + + // resizable + if (instance.get("resizable")) { + bindResizableEvents(instance); + } + + // movable + if (instance.get("movable")) { + bindMovableEvents(instance); + } + } - } - // last dialog and tab index was set by us, remove it. - if(!openDialogs.length && tabindex === '0'){ - document.body.removeAttribute('tabindex'); - } - return this; - }, - /** - * Close all open dialogs except this. - * - * @return {undefined} - */ - closeOthers:function(){ - alertify.closeAll(this); - return this; - }, - /** - * Destroys this dialog instance - * - * @return {undefined} - */ - destroy:function(){ - if(this.__internal) { - if (this.__internal.isOpen ) { - //mark dialog for destruction, this will be called on tranistionOut event. - this.__internal.destroy = function(){ - destruct(this, initialize); - }; - //close the dialog to unbind all events. - this.close(); - }else if(!this.__internal.destroy){ - destruct(this, initialize); - } - } - return this; - }, - }; - } () ); - var notifier = (function () { - var reflow, - element, - openInstances = [], - classes = { - base: 'alertify-notifier', - message: 'ajs-message', - top: 'ajs-top', - right: 'ajs-right', - bottom: 'ajs-bottom', - left: 'ajs-left', - center: 'ajs-center', - visible: 'ajs-visible', - hidden: 'ajs-hidden', - close: 'ajs-close' - }; - /** - * Helper: initializes the notifier instance - * - */ - function initialize(instance) { + /** + * Unbind dialogs events + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function unbindEvents(instance) { + // if last dialog, remove global handlers + if (openDialogs.length === 1) { + //global + off(window, "resize", windowResize); + off(document.body, "keyup", keyupHandler); + off(document.body, "keydown", keydownHandler); + off(document.body, "focus", onReset); + //move + off(document.documentElement, "mousemove", move); + off(document.documentElement, "mouseup", endMove); + //resize + off(document.documentElement, "mousemove", resize); + off(document.documentElement, "mouseup", endResize); + } + + // common events + off( + instance.elements.commands.container, + "click", + instance.__internal.commandsClickHandler + ); + off( + instance.elements.footer, + "click", + instance.__internal.buttonsClickHandler + ); + off( + instance.elements.reset[0], + "focus", + instance.__internal.resetHandler + ); + off( + instance.elements.reset[1], + "focus", + instance.__internal.resetHandler + ); + + // hook out transition handler + on( + instance.elements.dialog, + transition.type, + instance.__internal.transitionOutHandler + ); + + // modelss only events + if (!instance.get("modal")) { + unbindModelessEvents(instance); + } + + // movable + if (instance.get("movable")) { + unbindMovableEvents(instance); + } + + // resizable + if (instance.get("resizable")) { + unbindResizableEvents(instance); + } + } - if (!instance.__internal) { - instance.__internal = { - position: alertify.defaults.notifier.position, - delay: alertify.defaults.notifier.delay, - }; + /** + * Bind modeless specific events + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function bindModelessEvents(instance) { + on( + instance.elements.dialog, + "focus", + instance.__internal.bringToFrontHandler, + true + ); + } - element = document.createElement('DIV'); + /** + * Unbind modeless specific events + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function unbindModelessEvents(instance) { + off( + instance.elements.dialog, + "focus", + instance.__internal.bringToFrontHandler, + true + ); + } - updatePosition(instance); - } + /** + * Bind movable specific events + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function bindMovableEvents(instance) { + on( + instance.elements.header, + "mousedown", + instance.__internal.beginMoveHandler + ); + on( + instance.elements.header, + "touchstart", + instance.__internal.beginMoveHandler + ); + } - //add to DOM tree. - if (element.parentNode !== document.body) { - document.body.appendChild(element); - } - } + /** + * Unbind movable specific events + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function unbindMovableEvents(instance) { + off( + instance.elements.header, + "mousedown", + instance.__internal.beginMoveHandler + ); + off( + instance.elements.header, + "touchstart", + instance.__internal.beginMoveHandler + ); + } - function pushInstance(instance) { - instance.__internal.pushed = true; - openInstances.push(instance); - } - function popInstance(instance) { - openInstances.splice(openInstances.indexOf(instance), 1); - instance.__internal.pushed = false; - } - /** - * Helper: update the notifier instance position - * - */ - function updatePosition(instance) { - element.className = classes.base; - switch (instance.__internal.position) { - case 'top-right': - addClass(element, classes.top + ' ' + classes.right); - break; - case 'top-left': - addClass(element, classes.top + ' ' + classes.left); - break; - case 'top-center': - addClass(element, classes.top + ' ' + classes.center); - break; - case 'bottom-left': - addClass(element, classes.bottom + ' ' + classes.left); - break; - case 'bottom-center': - addClass(element, classes.bottom + ' ' + classes.center); - break; + /** + * Bind resizable specific events + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function bindResizableEvents(instance) { + on( + instance.elements.resizeHandle, + "mousedown", + instance.__internal.beginResizeHandler + ); + on( + instance.elements.resizeHandle, + "touchstart", + instance.__internal.beginResizeHandler + ); + } - default: - case 'bottom-right': - addClass(element, classes.bottom + ' ' + classes.right); - break; - } - } + /** + * Unbind resizable specific events + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function unbindResizableEvents(instance) { + off( + instance.elements.resizeHandle, + "mousedown", + instance.__internal.beginResizeHandler + ); + off( + instance.elements.resizeHandle, + "touchstart", + instance.__internal.beginResizeHandler + ); + } - /** - * creates a new notification message - * - * @param {DOMElement} message The notifier message element - * @param {Number} wait Time (in ms) to wait before the message is dismissed, a value of 0 means keep open till clicked. - * @param {Function} callback A callback function to be invoked when the message is dismissed. - * - * @return {undefined} - */ - function create(div, callback) { - - function clickDelegate(event, instance) { - if(!instance.__internal.closeButton || event.target.getAttribute('data-close') === 'true'){ - instance.dismiss(true); - } - } + /** + * Bind closable events + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function bindClosableEvents(instance) { + on( + instance.elements.modal, + "click", + instance.__internal.modalClickHandler + ); + } - function transitionDone(event, instance) { - // unbind event - off(instance.element, transition.type, transitionDone); - // remove the message - element.removeChild(instance.element); - } + /** + * Unbind closable specific events + * + * @param {Object} instance The dilog instance. + * + * @return {undefined} + */ + function unbindClosableEvents(instance) { + off( + instance.elements.modal, + "click", + instance.__internal.modalClickHandler + ); + } + // dialog API + return { + __init: initialize, + /** + * Check if dialog is currently open + * + * @return {Boolean} + */ + isOpen: function () { + return this.__internal.isOpen; + }, + isModal: function () { + return this.elements.root.className.indexOf(classes.modeless) < 0; + }, + isMaximized: function () { + return this.elements.root.className.indexOf(classes.maximized) > -1; + }, + isPinned: function () { + return this.elements.root.className.indexOf(classes.unpinned) < 0; + }, + maximize: function () { + if (!this.isMaximized()) { + maximize(this); + } + return this; + }, + restore: function () { + if (this.isMaximized()) { + restore(this); + } + return this; + }, + pin: function () { + if (!this.isPinned()) { + pin(this); + } + return this; + }, + unpin: function () { + if (this.isPinned()) { + unpin(this); + } + return this; + }, + bringToFront: function () { + bringToFront(null, this); + return this; + }, + /** + * Move the dialog to a specific x/y coordinates + * + * @param {Number} x The new dialog x coordinate in pixels. + * @param {Number} y The new dialog y coordinate in pixels. + * + * @return {Object} The dialog instance. + */ + moveTo: function (x, y) { + if (!isNaN(x) && !isNaN(y)) { + // allow custom `onmove` method + dispatchEvent("onmove", this); + + var element = this.elements.dialog, + current = element, + offsetLeft = 0, + offsetTop = 0; + + //subtract existing left,top + if (element.style.left) { + offsetLeft -= parseInt(element.style.left, 10); + } + if (element.style.top) { + offsetTop -= parseInt(element.style.top, 10); + } + //calc offset + do { + offsetLeft += current.offsetLeft; + offsetTop += current.offsetTop; + } while ((current = current.offsetParent)); + + //calc left, top + var left = x - offsetLeft; + var top = y - offsetTop; + + //// rtl handling + if (isRightToLeft()) { + left *= -1; + } + + element.style.left = left + "px"; + element.style.top = top + "px"; + + // allow custom `onmoved` method + dispatchEvent("onmoved", this); + } + return this; + }, + /** + * Resize the dialog to a specific width/height (the dialog must be 'resizable'). + * The dialog can be resized to: + * A minimum width equal to the initial display width + * A minimum height equal to the sum of header/footer heights. + * + * + * @param {Number or String} width The new dialog width in pixels or in percent. + * @param {Number or String} height The new dialog height in pixels or in percent. + * + * @return {Object} The dialog instance. + */ + resizeTo: function (width, height) { + var w = parseFloat(width), + h = parseFloat(height), + regex = /(\d*\.\d+|\d+)%/; + if (!isNaN(w) && !isNaN(h) && this.get("resizable") === true) { + // allow custom `onresize` method + dispatchEvent("onresize", this); + + if (("" + width).match(regex)) { + w = (w / 100) * document.documentElement.clientWidth; + } + + if (("" + height).match(regex)) { + h = (h / 100) * document.documentElement.clientHeight; + } + + var element = this.elements.dialog; + if (element.style.maxWidth !== "none") { + element.style.minWidth = (minWidth = element.offsetWidth) + "px"; + } + element.style.maxWidth = "none"; + element.style.minHeight = + this.elements.header.offsetHeight + + this.elements.footer.offsetHeight + + "px"; + element.style.width = w + "px"; + element.style.height = h + "px"; + + // allow custom `onresized` method + dispatchEvent("onresized", this); + } + return this; + }, + /** + * Gets or Sets dialog settings/options + * + * @param {String|Object} key A string specifying a propery name or a collection of key/value pairs. + * @param {Object} value Optional, the value associated with the key (in case it was a string). + * + * @return {undefined} + */ + setting: function (key, value) { + var self = this; + var result = update( + this, + this.__internal.options, + function (k, o, n) { + optionUpdated(self, k, o, n); + }, + key, + value + ); + if (result.op === "get") { + if (result.found) { + return result.value; + } else if (typeof this.settings !== "undefined") { + return update( + this, + this.settings, + this.settingUpdated || function () {}, + key, + value + ).value; + } else { + return undefined; + } + } else if (result.op === "set") { + if (result.items.length > 0) { + var callback = this.settingUpdated || function () {}; + for (var x = 0; x < result.items.length; x += 1) { + var item = result.items[x]; + if (!item.found && typeof this.settings !== "undefined") { + update(this, this.settings, callback, item.key, item.value); + } + } + } + return this; + } + }, + /** + * [Alias] Sets dialog settings/options + */ + set: function (key, value) { + this.setting(key, value); + return this; + }, + /** + * [Alias] Gets dialog settings/options + */ + get: function (key) { + return this.setting(key); + }, + /** + * Sets dialog header + * @content {string or element} + * + * @return {undefined} + */ + setHeader: function (content) { + if (typeof content === "string") { + clearContents(this.elements.header); + this.elements.header.innerHTML = content; + } else if ( + content instanceof window.HTMLElement && + this.elements.header.firstChild !== content + ) { + clearContents(this.elements.header); + this.elements.header.appendChild(content); + } + return this; + }, + /** + * Sets dialog contents + * @content {string or element} + * + * @return {undefined} + */ + setContent: function (content) { + if (typeof content === "string") { + clearContents(this.elements.content); + this.elements.content.innerHTML = content; + } else if ( + content instanceof window.HTMLElement && + this.elements.content.firstChild !== content + ) { + clearContents(this.elements.content); + this.elements.content.appendChild(content); + } + return this; + }, + /** + * Show the dialog as modal + * + * @return {Object} the dialog instance. + */ + showModal: function (className) { + return this.show(true, className); + }, + /** + * Show the dialog + * + * @return {Object} the dialog instance. + */ + show: function (modal, className) { + // ensure initialization + initialize(this); + + if (!this.__internal.isOpen) { + // add to open dialogs + this.__internal.isOpen = true; + openDialogs.push(this); + + // save last focused element + if (alertify.defaults.maintainFocus) { + this.__internal.activeElement = document.activeElement; + } + + // set tabindex attribute on body element this allows script to give it focusable + if (!document.body.hasAttribute("tabindex")) { + document.body.setAttribute("tabindex", (tabindex = "0")); + } + + //allow custom dom manipulation updates before showing the dialog. + if (typeof this.prepare === "function") { + this.prepare(); + } + + bindEvents(this); + + if (modal !== undefined) { + this.set("modal", modal); + } + + //save scroll to prevent document jump + saveScrollPosition(); + + ensureNoOverflow(); + + // allow custom dialog class on show + if (typeof className === "string" && className !== "") { + this.__internal.className = className; + addClass(this.elements.root, className); + } + + // maximize if start maximized + if (this.get("startMaximized")) { + this.maximize(); + } else if (this.isMaximized()) { + restore(this); + } + + updateAbsPositionFix(this); + this.elements.root.removeAttribute("style"); + removeClass(this.elements.root, classes.animationOut); + addClass(this.elements.root, classes.animationIn); + + // set 1s fallback in case transition event doesn't fire + clearTimeout(this.__internal.timerIn); + this.__internal.timerIn = setTimeout( + this.__internal.transitionInHandler, + transition.supported ? 1000 : 100 + ); + + if (isSafari) { + // force desktop safari reflow + var root = this.elements.root; + root.style.display = "none"; + setTimeout(function () { + root.style.display = "block"; + }, 0); + } + + //reflow + reflow = this.elements.root.offsetWidth; + + // show dialog + removeClass(this.elements.root, classes.hidden); + + // internal on show event + if (typeof this.hooks.onshow === "function") { + this.hooks.onshow.call(this); + } + + // allow custom `onshow` method + dispatchEvent("onshow", this); + } else { + // reset move updates + resetMove(this); + // reset resize updates + resetResize(this); + // shake the dialog to indicate its already open + addClass(this.elements.dialog, classes.shake); + var self = this; + setTimeout(function () { + removeClass(self.elements.dialog, classes.shake); + }, 200); + } + return this; + }, + /** + * Close the dialog + * + * @return {Object} The dialog instance + */ + close: function () { + if (this.__internal.isOpen) { + // custom `onclosing` event + if (dispatchEvent("onclosing", this) !== false) { + unbindEvents(this); + + removeClass(this.elements.root, classes.animationIn); + addClass(this.elements.root, classes.animationOut); + + // set 1s fallback in case transition event doesn't fire + clearTimeout(this.__internal.timerOut); + this.__internal.timerOut = setTimeout( + this.__internal.transitionOutHandler, + transition.supported ? 1000 : 100 + ); + // hide dialog + addClass(this.elements.root, classes.hidden); + //reflow + reflow = this.elements.modal.offsetWidth; + + // remove custom dialog class on hide + if ( + typeof this.__internal.className !== "undefined" && + this.__internal.className !== "" + ) { + removeClass(this.elements.root, this.__internal.className); + } + + // internal on close event + if (typeof this.hooks.onclose === "function") { + this.hooks.onclose.call(this); + } + + // allow custom `onclose` method + dispatchEvent("onclose", this); + + //remove from open dialogs + openDialogs.splice(openDialogs.indexOf(this), 1); + this.__internal.isOpen = false; + + ensureNoOverflow(); + } + } + // last dialog and tab index was set by us, remove it. + if (!openDialogs.length && tabindex === "0") { + document.body.removeAttribute("tabindex"); + } + return this; + }, + /** + * Close all open dialogs except this. + * + * @return {undefined} + */ + closeOthers: function () { + alertify.closeAll(this); + return this; + }, + /** + * Destroys this dialog instance + * + * @return {undefined} + */ + destroy: function () { + if (this.__internal) { + if (this.__internal.isOpen) { + //mark dialog for destruction, this will be called on tranistionOut event. + this.__internal.destroy = function () { + destruct(this, initialize); + }; + //close the dialog to unbind all events. + this.close(); + } else if (!this.__internal.destroy) { + destruct(this, initialize); + } + } + return this; + }, + }; + })(); + var notifier = (function () { + var reflow, + element, + openInstances = [], + classes = { + base: "alertify-notifier", + message: "ajs-message", + top: "ajs-top", + right: "ajs-right", + bottom: "ajs-bottom", + left: "ajs-left", + center: "ajs-center", + visible: "ajs-visible", + hidden: "ajs-hidden", + close: "ajs-close", + }; + /** + * Helper: initializes the notifier instance + * + */ + function initialize(instance) { + if (!instance.__internal) { + instance.__internal = { + position: alertify.defaults.notifier.position, + delay: alertify.defaults.notifier.delay, + }; - function initialize(instance) { - if (!instance.__internal) { - instance.__internal = { - pushed: false, - delay : undefined, - timer: undefined, - clickHandler: undefined, - transitionEndHandler: undefined, - transitionTimeout: undefined - }; - instance.__internal.clickHandler = delegate(instance, clickDelegate); - instance.__internal.transitionEndHandler = delegate(instance, transitionDone); - } - return instance; - } - function clearTimers(instance) { - clearTimeout(instance.__internal.timer); - clearTimeout(instance.__internal.transitionTimeout); - } - return initialize({ - /* notification DOM element*/ - element: div, - /* - * Pushes a notification message - * @param {string or DOMElement} content The notification message content - * @param {Number} wait The time (in seconds) to wait before the message is dismissed, a value of 0 means keep open till clicked. - * - */ - push: function (_content, _wait) { - if (!this.__internal.pushed) { - - pushInstance(this); - clearTimers(this); - - var content, wait; - switch (arguments.length) { - case 0: - wait = this.__internal.delay; - break; - case 1: - if (typeof (_content) === 'number') { - wait = _content; - } else { - content = _content; - wait = this.__internal.delay; - } - break; - case 2: - content = _content; - wait = _wait; - break; - } - this.__internal.closeButton = alertify.defaults.notifier.closeButton; - // set contents - if (typeof content !== 'undefined') { - this.setContent(content); - } - // append or insert - if (notifier.__internal.position.indexOf('top') < 0) { - element.appendChild(this.element); - } else { - element.insertBefore(this.element, element.firstChild); - } - reflow = this.element.offsetWidth; - addClass(this.element, classes.visible); - // attach click event - on(this.element, 'click', this.__internal.clickHandler); - return this.delay(wait); - } - return this; - }, - /* - * {Function} callback function to be invoked before dismissing the notification message. - * Remarks: A return value === 'false' will cancel the dismissal - * - */ - ondismiss: function () { }, - /* - * {Function} callback function to be invoked when the message is dismissed. - * - */ - callback: callback, - /* - * Dismisses the notification message - * @param {Boolean} clicked A flag indicating if the dismissal was caused by a click. - * - */ - dismiss: function (clicked) { - if (this.__internal.pushed) { - clearTimers(this); - if (!(typeof this.ondismiss === 'function' && this.ondismiss.call(this) === false)) { - //detach click event - off(this.element, 'click', this.__internal.clickHandler); - // ensure element exists - if (typeof this.element !== 'undefined' && this.element.parentNode === element) { - //transition end or fallback - this.__internal.transitionTimeout = setTimeout(this.__internal.transitionEndHandler, transition.supported ? 1000 : 100); - removeClass(this.element, classes.visible); - - // custom callback on dismiss - if (typeof this.callback === 'function') { - this.callback.call(this, clicked); - } - } - popInstance(this); - } - } - return this; - }, - /* - * Delays the notification message dismissal - * @param {Number} wait The time (in seconds) to wait before the message is dismissed, a value of 0 means keep open till clicked. - * - */ - delay: function (wait) { - clearTimers(this); - this.__internal.delay = typeof wait !== 'undefined' && !isNaN(+wait) ? +wait : notifier.__internal.delay; - if (this.__internal.delay > 0) { - var self = this; - this.__internal.timer = setTimeout(function () { self.dismiss(); }, this.__internal.delay * 1000); - } - return this; - }, - /* - * Sets the notification message contents - * @param {string or DOMElement} content The notification message content - * - */ - setContent: function (content) { - if (typeof content === 'string') { - clearContents(this.element); - this.element.innerHTML = content; - } else if (content instanceof window.HTMLElement && this.element.firstChild !== content) { - clearContents(this.element); - this.element.appendChild(content); - } - if(this.__internal.closeButton){ - var close = document.createElement('span'); - addClass(close, classes.close); - close.setAttribute('data-close', true); - this.element.appendChild(close); - } - return this; - }, - /* - * Dismisses all open notifications except this. - * - */ - dismissOthers: function () { - notifier.dismissAll(this); - return this; - } - }); - } + element = document.createElement("DIV"); - //notifier api - return { - /** - * Gets or Sets notifier settings. - * - * @param {string} key The setting name - * @param {Variant} value The setting value. - * - * @return {Object} if the called as a setter, return the notifier instance. - */ - setting: function (key, value) { - //ensure init - initialize(this); - - if (typeof value === 'undefined') { - //get - return this.__internal[key]; - } else { - //set - switch (key) { - case 'position': - this.__internal.position = value; - updatePosition(this); - break; - case 'delay': - this.__internal.delay = value; - break; - } - } - return this; - }, - /** - * [Alias] Sets dialog settings/options - */ - set:function(key,value){ - this.setting(key,value); - return this; - }, - /** - * [Alias] Gets dialog settings/options - */ - get:function(key){ - return this.setting(key); - }, - /** - * Creates a new notification message - * - * @param {string} type The type of notification message (simply a CSS class name 'ajs-{type}' to be added). - * @param {Function} callback A callback function to be invoked when the message is dismissed. - * - * @return {undefined} - */ - create: function (type, callback) { - //ensure notifier init - initialize(this); - //create new notification message - var div = document.createElement('div'); - div.className = classes.message + ((typeof type === 'string' && type !== '') ? ' ajs-' + type : ''); - return create(div, callback); - }, - /** - * Dismisses all open notifications. - * - * @param {Object} excpet [optional] The notification object to exclude from dismissal. - * - */ - dismissAll: function (except) { - var clone = openInstances.slice(0); - for (var x = 0; x < clone.length; x += 1) { - var instance = clone[x]; - if (except === undefined || except !== instance) { - instance.dismiss(); - } - } - } - }; - })(); + updatePosition(instance); + } + + //add to DOM tree. + if (element.parentNode !== document.body) { + document.body.appendChild(element); + } + } + function pushInstance(instance) { + instance.__internal.pushed = true; + openInstances.push(instance); + } + function popInstance(instance) { + openInstances.splice(openInstances.indexOf(instance), 1); + instance.__internal.pushed = false; + } /** - * Alertify public API - * This contains everything that is exposed through the alertify object. + * Helper: update the notifier instance position * - * @return {Object} */ - function Alertify() { - - // holds a references of created dialogs - var dialogs = {}; + function updatePosition(instance) { + element.className = classes.base; + switch (instance.__internal.position) { + case "top-right": + addClass(element, classes.top + " " + classes.right); + break; + case "top-left": + addClass(element, classes.top + " " + classes.left); + break; + case "top-center": + addClass(element, classes.top + " " + classes.center); + break; + case "bottom-left": + addClass(element, classes.bottom + " " + classes.left); + break; + case "bottom-center": + addClass(element, classes.bottom + " " + classes.center); + break; + + default: + case "bottom-right": + addClass(element, classes.bottom + " " + classes.right); + break; + } + } - /** - * Extends a given prototype by merging properties from base into sub. - * - * @sub {Object} sub The prototype being overwritten. - * @base {Object} base The prototype being written. + /** + * creates a new notification message + * + * @param {DOMElement} message The notifier message element + * @param {Number} wait Time (in ms) to wait before the message is dismissed, a value of 0 means keep open till clicked. + * @param {Function} callback A callback function to be invoked when the message is dismissed. + * + * @return {undefined} + */ + function create(div, callback) { + function clickDelegate(event, instance) { + if ( + !instance.__internal.closeButton || + event.target.getAttribute("data-close") === "true" + ) { + instance.dismiss(true); + } + } + + function transitionDone(event, instance) { + // unbind event + off(instance.element, transition.type, transitionDone); + // remove the message + element.removeChild(instance.element); + } + + function initialize(instance) { + if (!instance.__internal) { + instance.__internal = { + pushed: false, + delay: undefined, + timer: undefined, + clickHandler: undefined, + transitionEndHandler: undefined, + transitionTimeout: undefined, + }; + instance.__internal.clickHandler = delegate(instance, clickDelegate); + instance.__internal.transitionEndHandler = delegate( + instance, + transitionDone + ); + } + return instance; + } + function clearTimers(instance) { + clearTimeout(instance.__internal.timer); + clearTimeout(instance.__internal.transitionTimeout); + } + return initialize({ + /* notification DOM element*/ + element: div, + /* + * Pushes a notification message + * @param {string or DOMElement} content The notification message content + * @param {Number} wait The time (in seconds) to wait before the message is dismissed, a value of 0 means keep open till clicked. * - * @return {Object} The extended prototype. */ - function extend(sub, base) { - // copy dialog pototype over definition. - for (var prop in base) { - if (base.hasOwnProperty(prop)) { - sub[prop] = base[prop]; + push: function (_content, _wait) { + if (!this.__internal.pushed) { + pushInstance(this); + clearTimers(this); + + var content, wait; + switch (arguments.length) { + case 0: + wait = this.__internal.delay; + break; + case 1: + if (typeof _content === "number") { + wait = _content; + } else { + content = _content; + wait = this.__internal.delay; } + break; + case 2: + content = _content; + wait = _wait; + break; } - return sub; - } - - - /** - * Helper: returns a dialog instance from saved dialogs. - * and initializes the dialog if its not already initialized. - * - * @name {String} name The dialog name. - * - * @return {Object} The dialog instance. - */ - function get_dialog(name) { - var dialog = dialogs[name].dialog; - //initialize the dialog if its not already initialized. - if (dialog && typeof dialog.__init === 'function') { - dialog.__init(dialog); + this.__internal.closeButton = + alertify.defaults.notifier.closeButton; + // set contents + if (typeof content !== "undefined") { + this.setContent(content); } - return dialog; - } - - /** - * Helper: registers a new dialog definition. + // append or insert + if (notifier.__internal.position.indexOf("top") < 0) { + element.appendChild(this.element); + } else { + element.insertBefore(this.element, element.firstChild); + } + reflow = this.element.offsetWidth; + addClass(this.element, classes.visible); + // attach click event + on(this.element, "click", this.__internal.clickHandler); + return this.delay(wait); + } + return this; + }, + /* + * {Function} callback function to be invoked before dismissing the notification message. + * Remarks: A return value === 'false' will cancel the dismissal * - * @name {String} name The dialog name. - * @Factory {Function} Factory a function resposible for creating dialog prototype. - * @transient {Boolean} transient True to create a new dialog instance each time the dialog is invoked, false otherwise. - * @base {String} base the name of another dialog to inherit from. + */ + ondismiss: function () {}, + /* + * {Function} callback function to be invoked when the message is dismissed. * - * @return {Object} The dialog definition. */ - function register(name, Factory, transient, base) { - var definition = { - dialog: null, - factory: Factory - }; - - //if this is based on an existing dialog, create a new definition - //by applying the new protoype over the existing one. - if (base !== undefined) { - definition.factory = function () { - return extend(new dialogs[base].factory(), new Factory()); - }; - } - - if (!transient) { - //create a new definition based on dialog - definition.dialog = extend(new definition.factory(), dialog); - } - return dialogs[name] = definition; - } - - return { - /** - * Alertify defaults - * - * @type {Object} - */ - defaults: defaults, - /** - * Dialogs factory - * - * @param {string} Dialog name. - * @param {Function} A Dialog factory function. - * @param {Boolean} Indicates whether to create a singleton or transient dialog. - * @param {String} The name of the base type to inherit from. - */ - dialog: function (name, Factory, transient, base) { - - // get request, create a new instance and return it. - if (typeof Factory !== 'function') { - return get_dialog(name); - } - - if (this.hasOwnProperty(name)) { - throw new Error('alertify.dialog: name already exists'); - } + callback: callback, + /* + * Dismisses the notification message + * @param {Boolean} clicked A flag indicating if the dismissal was caused by a click. + * + */ + dismiss: function (clicked) { + if (this.__internal.pushed) { + clearTimers(this); + if ( + !( + typeof this.ondismiss === "function" && + this.ondismiss.call(this) === false + ) + ) { + //detach click event + off(this.element, "click", this.__internal.clickHandler); + // ensure element exists + if ( + typeof this.element !== "undefined" && + this.element.parentNode === element + ) { + //transition end or fallback + this.__internal.transitionTimeout = setTimeout( + this.__internal.transitionEndHandler, + transition.supported ? 1000 : 100 + ); + removeClass(this.element, classes.visible); + + // custom callback on dismiss + if (typeof this.callback === "function") { + this.callback.call(this, clicked); + } + } + popInstance(this); + } + } + return this; + }, + /* + * Delays the notification message dismissal + * @param {Number} wait The time (in seconds) to wait before the message is dismissed, a value of 0 means keep open till clicked. + * + */ + delay: function (wait) { + clearTimers(this); + this.__internal.delay = + typeof wait !== "undefined" && !isNaN(+wait) + ? +wait + : notifier.__internal.delay; + if (this.__internal.delay > 0) { + var self = this; + this.__internal.timer = setTimeout(function () { + self.dismiss(); + }, this.__internal.delay * 1000); + } + return this; + }, + /* + * Sets the notification message contents + * @param {string or DOMElement} content The notification message content + * + */ + setContent: function (content) { + if (typeof content === "string") { + clearContents(this.element); + this.element.innerHTML = content; + } else if ( + content instanceof window.HTMLElement && + this.element.firstChild !== content + ) { + clearContents(this.element); + this.element.appendChild(content); + } + if (this.__internal.closeButton) { + var close = document.createElement("span"); + addClass(close, classes.close); + close.setAttribute("data-close", true); + this.element.appendChild(close); + } + return this; + }, + /* + * Dismisses all open notifications except this. + * + */ + dismissOthers: function () { + notifier.dismissAll(this); + return this; + }, + }); + } - // register the dialog - var definition = register(name, Factory, transient, base); - - if (transient) { - - // make it public - this[name] = function () { - //if passed with no params, consider it a get request - if (arguments.length === 0) { - return definition.dialog; - } else { - var instance = extend(new definition.factory(), dialog); - //ensure init - if (instance && typeof instance.__init === 'function') { - instance.__init(instance); - } - instance['main'].apply(instance, arguments); - return instance['show'].apply(instance); - } - }; - } else { - // make it public - this[name] = function () { - //ensure init - if (definition.dialog && typeof definition.dialog.__init === 'function') { - definition.dialog.__init(definition.dialog); - } - //if passed with no params, consider it a get request - if (arguments.length === 0) { - return definition.dialog; - } else { - var dialog = definition.dialog; - dialog['main'].apply(definition.dialog, arguments); - return dialog['show'].apply(definition.dialog); - } - }; - } - }, - /** - * Close all open dialogs. - * - * @param {Object} excpet [optional] The dialog object to exclude from closing. - * - * @return {undefined} - */ - closeAll: function (except) { - var clone = openDialogs.slice(0); - for (var x = 0; x < clone.length; x += 1) { - var instance = clone[x]; - if (except === undefined || except !== instance) { - instance.close(); - } - } - }, - /** - * Gets or Sets dialog settings/options. if the dialog is transient, this call does nothing. - * - * @param {string} name The dialog name. - * @param {String|Object} key A string specifying a propery name or a collection of key/value pairs. - * @param {Variant} value Optional, the value associated with the key (in case it was a string). - * - * @return {undefined} - */ - setting: function (name, key, value) { - - if (name === 'notifier') { - return notifier.setting(key, value); - } + //notifier api + return { + /** + * Gets or Sets notifier settings. + * + * @param {string} key The setting name + * @param {Variant} value The setting value. + * + * @return {Object} if the called as a setter, return the notifier instance. + */ + setting: function (key, value) { + //ensure init + initialize(this); + + if (typeof value === "undefined") { + //get + return this.__internal[key]; + } else { + //set + switch (key) { + case "position": + this.__internal.position = value; + updatePosition(this); + break; + case "delay": + this.__internal.delay = value; + break; + } + } + return this; + }, + /** + * [Alias] Sets dialog settings/options + */ + set: function (key, value) { + this.setting(key, value); + return this; + }, + /** + * [Alias] Gets dialog settings/options + */ + get: function (key) { + return this.setting(key); + }, + /** + * Creates a new notification message + * + * @param {string} type The type of notification message (simply a CSS class name 'ajs-{type}' to be added). + * @param {Function} callback A callback function to be invoked when the message is dismissed. + * + * @return {undefined} + */ + create: function (type, callback) { + //ensure notifier init + initialize(this); + //create new notification message + var div = document.createElement("div"); + div.className = + classes.message + + (typeof type === "string" && type !== "" ? " ajs-" + type : ""); + return create(div, callback); + }, + /** + * Dismisses all open notifications. + * + * @param {Object} excpet [optional] The notification object to exclude from dismissal. + * + */ + dismissAll: function (except) { + var clone = openInstances.slice(0); + for (var x = 0; x < clone.length; x += 1) { + var instance = clone[x]; + if (except === undefined || except !== instance) { + instance.dismiss(); + } + } + }, + }; + })(); + + /** + * Alertify public API + * This contains everything that is exposed through the alertify object. + * + * @return {Object} + */ + function Alertify() { + // holds a references of created dialogs + var dialogs = {}; - var dialog = get_dialog(name); - if (dialog) { - return dialog.setting(key, value); - } - }, - /** - * [Alias] Sets dialog settings/options - */ - set: function(name,key,value){ - return this.setting(name, key,value); - }, - /** - * [Alias] Gets dialog settings/options - */ - get: function(name, key){ - return this.setting(name, key); - }, - /** - * Creates a new notification message. - * If a type is passed, a class name "ajs-{type}" will be added. - * This allows for custom look and feel for various types of notifications. - * - * @param {String | DOMElement} [message=undefined] Message text - * @param {String} [type=''] Type of log message - * @param {String} [wait=''] Time (in seconds) to wait before auto-close - * @param {Function} [callback=undefined] A callback function to be invoked when the log is closed. - * - * @return {Object} Notification object. - */ - notify: function (message, type, wait, callback) { - return notifier.create(type, callback).push(message, wait); - }, - /** - * Creates a new notification message. - * - * @param {String} [message=undefined] Message text - * @param {String} [wait=''] Time (in seconds) to wait before auto-close - * @param {Function} [callback=undefined] A callback function to be invoked when the log is closed. - * - * @return {Object} Notification object. - */ - message: function (message, wait, callback) { - return notifier.create(null, callback).push(message, wait); - }, - /** - * Creates a new notification message of type 'success'. - * - * @param {String} [message=undefined] Message text - * @param {String} [wait=''] Time (in seconds) to wait before auto-close - * @param {Function} [callback=undefined] A callback function to be invoked when the log is closed. - * - * @return {Object} Notification object. - */ - success: function (message, wait, callback) { - return notifier.create('success', callback).push(message, wait); - }, - /** - * Creates a new notification message of type 'error'. - * - * @param {String} [message=undefined] Message text - * @param {String} [wait=''] Time (in seconds) to wait before auto-close - * @param {Function} [callback=undefined] A callback function to be invoked when the log is closed. - * - * @return {Object} Notification object. - */ - error: function (message, wait, callback) { - return notifier.create('error', callback).push(message, wait); - }, - /** - * Creates a new notification message of type 'warning'. - * - * @param {String} [message=undefined] Message text - * @param {String} [wait=''] Time (in seconds) to wait before auto-close - * @param {Function} [callback=undefined] A callback function to be invoked when the log is closed. - * - * @return {Object} Notification object. - */ - warning: function (message, wait, callback) { - return notifier.create('warning', callback).push(message, wait); - }, - /** - * Dismisses all open notifications - * - * @return {undefined} - */ - dismissAll: function () { - notifier.dismissAll(); - } - }; + /** + * Extends a given prototype by merging properties from base into sub. + * + * @sub {Object} sub The prototype being overwritten. + * @base {Object} base The prototype being written. + * + * @return {Object} The extended prototype. + */ + function extend(sub, base) { + // copy dialog pototype over definition. + for (var prop in base) { + if (base.hasOwnProperty(prop)) { + sub[prop] = base[prop]; + } + } + return sub; } - var alertify = new Alertify(); /** - * Alert dialog definition - * - * invoked by: - * alertify.alert(message); - * alertify.alert(title, message); - * alertify.alert(message, onok); - * alertify.alert(title, message, onok); + * Helper: returns a dialog instance from saved dialogs. + * and initializes the dialog if its not already initialized. + * + * @name {String} name The dialog name. + * + * @return {Object} The dialog instance. */ - alertify.dialog('alert', function () { - return { - main: function (_title, _message, _onok) { - var title, message, onok; - switch (arguments.length) { - case 1: - message = _title; - break; - case 2: - if (typeof _message === 'function') { - message = _title; - onok = _message; - } else { - title = _title; - message = _message; - } - break; - case 3: - title = _title; - message = _message; - onok = _onok; - break; - } - this.set('title', title); - this.set('message', message); - this.set('onok', onok); - return this; - }, - setup: function () { - return { - buttons: [ - { - text: alertify.defaults.glossary.ok, - key: keys.ESC, - invokeOnClose: true, - className: alertify.defaults.theme.ok, - } - ], - focus: { - element: 0, - select: false - }, - options: { - maximizable: false, - resizable: false - } - }; - }, - build: function () { - // nothing - }, - prepare: function () { - //nothing - }, - setMessage: function (message) { - this.setContent(message); - }, - settings: { - message: undefined, - onok: undefined, - label: undefined, - }, - settingUpdated: function (key, oldValue, newValue) { - switch (key) { - case 'message': - this.setMessage(newValue); - break; - case 'label': - if (this.__internal.buttons[0].element) { - this.__internal.buttons[0].element.innerHTML = newValue; - } - break; - } - }, - callback: function (closeEvent) { - if (typeof this.get('onok') === 'function') { - var returnValue = this.get('onok').call(this, closeEvent); - if (typeof returnValue !== 'undefined') { - closeEvent.cancel = !returnValue; - } - } - } - }; - }); + function get_dialog(name) { + var dialog = dialogs[name].dialog; + //initialize the dialog if its not already initialized. + if (dialog && typeof dialog.__init === "function") { + dialog.__init(dialog); + } + return dialog; + } + /** - * Confirm dialog object + * Helper: registers a new dialog definition. * - * alertify.confirm(message); - * alertify.confirm(message, onok); - * alertify.confirm(message, onok, oncancel); - * alertify.confirm(title, message, onok, oncancel); + * @name {String} name The dialog name. + * @Factory {Function} Factory a function resposible for creating dialog prototype. + * @transient {Boolean} transient True to create a new dialog instance each time the dialog is invoked, false otherwise. + * @base {String} base the name of another dialog to inherit from. + * + * @return {Object} The dialog definition. */ - alertify.dialog('confirm', function () { - - var autoConfirm = { - timer: null, - index: null, - text: null, - duration: null, - task: function (event, self) { - if (self.isOpen()) { - self.__internal.buttons[autoConfirm.index].element.innerHTML = autoConfirm.text + ' (‏' + autoConfirm.duration + '‏) '; - autoConfirm.duration -= 1; - if (autoConfirm.duration === -1) { - clearAutoConfirm(self); - var button = self.__internal.buttons[autoConfirm.index]; - var closeEvent = createCloseEvent(autoConfirm.index, button); - - if (typeof self.callback === 'function') { - self.callback.apply(self, [closeEvent]); - } - //close the dialog. - if (closeEvent.close !== false) { - self.close(); - } - } - } else { - clearAutoConfirm(self); - } - } + function register(name, Factory, transient, base) { + var definition = { + dialog: null, + factory: Factory, + }; + + //if this is based on an existing dialog, create a new definition + //by applying the new protoype over the existing one. + if (base !== undefined) { + definition.factory = function () { + return extend(new dialogs[base].factory(), new Factory()); }; + } - function clearAutoConfirm(self) { - if (autoConfirm.timer !== null) { - clearInterval(autoConfirm.timer); - autoConfirm.timer = null; - self.__internal.buttons[autoConfirm.index].element.innerHTML = autoConfirm.text; - } - } + if (!transient) { + //create a new definition based on dialog + definition.dialog = extend(new definition.factory(), dialog); + } + return (dialogs[name] = definition); + } - function startAutoConfirm(self, index, duration) { + return { + /** + * Alertify defaults + * + * @type {Object} + */ + defaults: defaults, + /** + * Dialogs factory + * + * @param {string} Dialog name. + * @param {Function} A Dialog factory function. + * @param {Boolean} Indicates whether to create a singleton or transient dialog. + * @param {String} The name of the base type to inherit from. + */ + dialog: function (name, Factory, transient, base) { + // get request, create a new instance and return it. + if (typeof Factory !== "function") { + return get_dialog(name); + } + + if (this.hasOwnProperty(name)) { + throw new Error("alertify.dialog: name already exists"); + } + + // register the dialog + var definition = register(name, Factory, transient, base); + + if (transient) { + // make it public + this[name] = function () { + //if passed with no params, consider it a get request + if (arguments.length === 0) { + return definition.dialog; + } else { + var instance = extend(new definition.factory(), dialog); + //ensure init + if (instance && typeof instance.__init === "function") { + instance.__init(instance); + } + instance["main"].apply(instance, arguments); + return instance["show"].apply(instance); + } + }; + } else { + // make it public + this[name] = function () { + //ensure init + if ( + definition.dialog && + typeof definition.dialog.__init === "function" + ) { + definition.dialog.__init(definition.dialog); + } + //if passed with no params, consider it a get request + if (arguments.length === 0) { + return definition.dialog; + } else { + var dialog = definition.dialog; + dialog["main"].apply(definition.dialog, arguments); + return dialog["show"].apply(definition.dialog); + } + }; + } + }, + /** + * Close all open dialogs. + * + * @param {Object} excpet [optional] The dialog object to exclude from closing. + * + * @return {undefined} + */ + closeAll: function (except) { + var clone = openDialogs.slice(0); + for (var x = 0; x < clone.length; x += 1) { + var instance = clone[x]; + if (except === undefined || except !== instance) { + instance.close(); + } + } + }, + /** + * Gets or Sets dialog settings/options. if the dialog is transient, this call does nothing. + * + * @param {string} name The dialog name. + * @param {String|Object} key A string specifying a propery name or a collection of key/value pairs. + * @param {Variant} value Optional, the value associated with the key (in case it was a string). + * + * @return {undefined} + */ + setting: function (name, key, value) { + if (name === "notifier") { + return notifier.setting(key, value); + } + + var dialog = get_dialog(name); + if (dialog) { + return dialog.setting(key, value); + } + }, + /** + * [Alias] Sets dialog settings/options + */ + set: function (name, key, value) { + return this.setting(name, key, value); + }, + /** + * [Alias] Gets dialog settings/options + */ + get: function (name, key) { + return this.setting(name, key); + }, + /** + * Creates a new notification message. + * If a type is passed, a class name "ajs-{type}" will be added. + * This allows for custom look and feel for various types of notifications. + * + * @param {String | DOMElement} [message=undefined] Message text + * @param {String} [type=''] Type of log message + * @param {String} [wait=''] Time (in seconds) to wait before auto-close + * @param {Function} [callback=undefined] A callback function to be invoked when the log is closed. + * + * @return {Object} Notification object. + */ + notify: function (message, type, wait, callback) { + return notifier.create(type, callback).push(message, wait); + }, + /** + * Creates a new notification message. + * + * @param {String} [message=undefined] Message text + * @param {String} [wait=''] Time (in seconds) to wait before auto-close + * @param {Function} [callback=undefined] A callback function to be invoked when the log is closed. + * + * @return {Object} Notification object. + */ + message: function (message, wait, callback) { + return notifier.create(null, callback).push(message, wait); + }, + /** + * Creates a new notification message of type 'success'. + * + * @param {String} [message=undefined] Message text + * @param {String} [wait=''] Time (in seconds) to wait before auto-close + * @param {Function} [callback=undefined] A callback function to be invoked when the log is closed. + * + * @return {Object} Notification object. + */ + success: function (message, wait, callback) { + return notifier.create("success", callback).push(message, wait); + }, + /** + * Creates a new notification message of type 'error'. + * + * @param {String} [message=undefined] Message text + * @param {String} [wait=''] Time (in seconds) to wait before auto-close + * @param {Function} [callback=undefined] A callback function to be invoked when the log is closed. + * + * @return {Object} Notification object. + */ + error: function (message, wait, callback) { + return notifier.create("error", callback).push(message, wait); + }, + /** + * Creates a new notification message of type 'warning'. + * + * @param {String} [message=undefined] Message text + * @param {String} [wait=''] Time (in seconds) to wait before auto-close + * @param {Function} [callback=undefined] A callback function to be invoked when the log is closed. + * + * @return {Object} Notification object. + */ + warning: function (message, wait, callback) { + return notifier.create("warning", callback).push(message, wait); + }, + /** + * Dismisses all open notifications + * + * @return {undefined} + */ + dismissAll: function () { + notifier.dismissAll(); + }, + }; + } + var alertify = new Alertify(); + + /** + * Alert dialog definition + * + * invoked by: + * alertify.alert(message); + * alertify.alert(title, message); + * alertify.alert(message, onok); + * alertify.alert(title, message, onok); + */ + alertify.dialog("alert", function () { + return { + main: function (_title, _message, _onok) { + var title, message, onok; + switch (arguments.length) { + case 1: + message = _title; + break; + case 2: + if (typeof _message === "function") { + message = _title; + onok = _message; + } else { + title = _title; + message = _message; + } + break; + case 3: + title = _title; + message = _message; + onok = _onok; + break; + } + this.set("title", title); + this.set("message", message); + this.set("onok", onok); + return this; + }, + setup: function () { + return { + buttons: [ + { + text: alertify.defaults.glossary.ok, + key: keys.ESC, + invokeOnClose: true, + className: alertify.defaults.theme.ok, + }, + ], + focus: { + element: 0, + select: false, + }, + options: { + maximizable: false, + resizable: false, + }, + }; + }, + build: function () { + // nothing + }, + prepare: function () { + //nothing + }, + setMessage: function (message) { + this.setContent(message); + }, + settings: { + message: undefined, + onok: undefined, + label: undefined, + }, + settingUpdated: function (key, oldValue, newValue) { + switch (key) { + case "message": + this.setMessage(newValue); + break; + case "label": + if (this.__internal.buttons[0].element) { + this.__internal.buttons[0].element.innerHTML = newValue; + } + break; + } + }, + callback: function (closeEvent) { + if (typeof this.get("onok") === "function") { + var returnValue = this.get("onok").call(this, closeEvent); + if (typeof returnValue !== "undefined") { + closeEvent.cancel = !returnValue; + } + } + }, + }; + }); + /** + * Confirm dialog object + * + * alertify.confirm(message); + * alertify.confirm(message, onok); + * alertify.confirm(message, onok, oncancel); + * alertify.confirm(title, message, onok, oncancel); + */ + alertify.dialog("confirm", function () { + var autoConfirm = { + timer: null, + index: null, + text: null, + duration: null, + task: function (event, self) { + if (self.isOpen()) { + self.__internal.buttons[autoConfirm.index].element.innerHTML = + autoConfirm.text + " (‏" + autoConfirm.duration + "‏) "; + autoConfirm.duration -= 1; + if (autoConfirm.duration === -1) { clearAutoConfirm(self); - autoConfirm.duration = duration; - autoConfirm.index = index; - autoConfirm.text = self.__internal.buttons[index].element.innerHTML; - autoConfirm.timer = setInterval(delegate(self, autoConfirm.task), 1000); - autoConfirm.task(null, self); + var button = self.__internal.buttons[autoConfirm.index]; + var closeEvent = createCloseEvent(autoConfirm.index, button); + + if (typeof self.callback === "function") { + self.callback.apply(self, [closeEvent]); + } + //close the dialog. + if (closeEvent.close !== false) { + self.close(); + } + } + } else { + clearAutoConfirm(self); } + }, + }; + function clearAutoConfirm(self) { + if (autoConfirm.timer !== null) { + clearInterval(autoConfirm.timer); + autoConfirm.timer = null; + self.__internal.buttons[autoConfirm.index].element.innerHTML = + autoConfirm.text; + } + } + + function startAutoConfirm(self, index, duration) { + clearAutoConfirm(self); + autoConfirm.duration = duration; + autoConfirm.index = index; + autoConfirm.text = self.__internal.buttons[index].element.innerHTML; + autoConfirm.timer = setInterval(delegate(self, autoConfirm.task), 1000); + autoConfirm.task(null, self); + } + return { + main: function (_title, _message, _onok, _oncancel) { + var title, message, onok, oncancel; + switch (arguments.length) { + case 1: + message = _title; + break; + case 2: + message = _title; + onok = _message; + break; + case 3: + message = _title; + onok = _message; + oncancel = _onok; + break; + case 4: + title = _title; + message = _message; + onok = _onok; + oncancel = _oncancel; + break; + } + this.set("title", title); + this.set("message", message); + this.set("onok", onok); + this.set("oncancel", oncancel); + return this; + }, + setup: function () { return { - main: function (_title, _message, _onok, _oncancel) { - var title, message, onok, oncancel; - switch (arguments.length) { - case 1: - message = _title; - break; - case 2: - message = _title; - onok = _message; - break; - case 3: - message = _title; - onok = _message; - oncancel = _onok; - break; - case 4: - title = _title; - message = _message; - onok = _onok; - oncancel = _oncancel; - break; - } - this.set('title', title); - this.set('message', message); - this.set('onok', onok); - this.set('oncancel', oncancel); - return this; - }, - setup: function () { - return { - buttons: [ - { - text: alertify.defaults.glossary.ok, - key: keys.ENTER, - className: alertify.defaults.theme.ok, - }, - { - text: alertify.defaults.glossary.cancel, - key: keys.ESC, - invokeOnClose: true, - className: alertify.defaults.theme.cancel, - } - ], - focus: { - element: 0, - select: false - }, - options: { - maximizable: false, - resizable: false - } - }; - }, - build: function () { - //nothing - }, - prepare: function () { - //nothing - }, - setMessage: function (message) { - this.setContent(message); - }, - settings: { - message: null, - labels: null, - onok: null, - oncancel: null, - defaultFocus: null, - reverseButtons: null, - }, - settingUpdated: function (key, oldValue, newValue) { - switch (key) { - case 'message': - this.setMessage(newValue); - break; - case 'labels': - if ('ok' in newValue && this.__internal.buttons[0].element) { - this.__internal.buttons[0].text = newValue.ok; - this.__internal.buttons[0].element.innerHTML = newValue.ok; - } - if ('cancel' in newValue && this.__internal.buttons[1].element) { - this.__internal.buttons[1].text = newValue.cancel; - this.__internal.buttons[1].element.innerHTML = newValue.cancel; - } - break; - case 'reverseButtons': - if (newValue === true) { - this.elements.buttons.primary.appendChild(this.__internal.buttons[0].element); - } else { - this.elements.buttons.primary.appendChild(this.__internal.buttons[1].element); - } - break; - case 'defaultFocus': - this.__internal.focus.element = newValue === 'ok' ? 0 : 1; - break; - } - }, - callback: function (closeEvent) { - clearAutoConfirm(this); - var returnValue; - switch (closeEvent.index) { - case 0: - if (typeof this.get('onok') === 'function') { - returnValue = this.get('onok').call(this, closeEvent); - if (typeof returnValue !== 'undefined') { - closeEvent.cancel = !returnValue; - } - } - break; - case 1: - if (typeof this.get('oncancel') === 'function') { - returnValue = this.get('oncancel').call(this, closeEvent); - if (typeof returnValue !== 'undefined') { - closeEvent.cancel = !returnValue; - } - } - break; - } + buttons: [ + { + text: alertify.defaults.glossary.ok, + key: keys.ENTER, + className: alertify.defaults.theme.ok, }, - autoOk: function (duration) { - startAutoConfirm(this, 0, duration); - return this; + { + text: alertify.defaults.glossary.cancel, + key: keys.ESC, + invokeOnClose: true, + className: alertify.defaults.theme.cancel, }, - autoCancel: function (duration) { - startAutoConfirm(this, 1, duration); - return this; - } + ], + focus: { + element: 0, + select: false, + }, + options: { + maximizable: false, + resizable: false, + }, }; - }); - /** - * Prompt dialog object - * - * invoked by: - * alertify.prompt(message); - * alertify.prompt(message, value); - * alertify.prompt(message, value, onok); - * alertify.prompt(message, value, onok, oncancel); - * alertify.prompt(title, message, value, onok, oncancel); - */ - alertify.dialog('prompt', function () { - var input = document.createElement('INPUT'); - var p = document.createElement('P'); + }, + build: function () { + //nothing + }, + prepare: function () { + //nothing + }, + setMessage: function (message) { + this.setContent(message); + }, + settings: { + message: null, + labels: null, + onok: null, + oncancel: null, + defaultFocus: null, + reverseButtons: null, + }, + settingUpdated: function (key, oldValue, newValue) { + switch (key) { + case "message": + this.setMessage(newValue); + break; + case "labels": + if ("ok" in newValue && this.__internal.buttons[0].element) { + this.__internal.buttons[0].text = newValue.ok; + this.__internal.buttons[0].element.innerHTML = newValue.ok; + } + if ("cancel" in newValue && this.__internal.buttons[1].element) { + this.__internal.buttons[1].text = newValue.cancel; + this.__internal.buttons[1].element.innerHTML = newValue.cancel; + } + break; + case "reverseButtons": + if (newValue === true) { + this.elements.buttons.primary.appendChild( + this.__internal.buttons[0].element + ); + } else { + this.elements.buttons.primary.appendChild( + this.__internal.buttons[1].element + ); + } + break; + case "defaultFocus": + this.__internal.focus.element = newValue === "ok" ? 0 : 1; + break; + } + }, + callback: function (closeEvent) { + clearAutoConfirm(this); + var returnValue; + switch (closeEvent.index) { + case 0: + if (typeof this.get("onok") === "function") { + returnValue = this.get("onok").call(this, closeEvent); + if (typeof returnValue !== "undefined") { + closeEvent.cancel = !returnValue; + } + } + break; + case 1: + if (typeof this.get("oncancel") === "function") { + returnValue = this.get("oncancel").call(this, closeEvent); + if (typeof returnValue !== "undefined") { + closeEvent.cancel = !returnValue; + } + } + break; + } + }, + autoOk: function (duration) { + startAutoConfirm(this, 0, duration); + return this; + }, + autoCancel: function (duration) { + startAutoConfirm(this, 1, duration); + return this; + }, + }; + }); + /** + * Prompt dialog object + * + * invoked by: + * alertify.prompt(message); + * alertify.prompt(message, value); + * alertify.prompt(message, value, onok); + * alertify.prompt(message, value, onok, oncancel); + * alertify.prompt(title, message, value, onok, oncancel); + */ + alertify.dialog("prompt", function () { + var input = document.createElement("INPUT"); + var p = document.createElement("P"); + return { + main: function (_title, _message, _value, _onok, _oncancel) { + var title, message, value, onok, oncancel; + switch (arguments.length) { + case 1: + message = _title; + break; + case 2: + message = _title; + value = _message; + break; + case 3: + message = _title; + value = _message; + onok = _value; + break; + case 4: + message = _title; + value = _message; + onok = _value; + oncancel = _onok; + break; + case 5: + title = _title; + message = _message; + value = _value; + onok = _onok; + oncancel = _oncancel; + break; + } + this.set("title", title); + this.set("message", message); + this.set("value", value); + this.set("onok", onok); + this.set("oncancel", oncancel); + return this; + }, + setup: function () { return { - main: function (_title, _message, _value, _onok, _oncancel) { - var title, message, value, onok, oncancel; - switch (arguments.length) { - case 1: - message = _title; - break; - case 2: - message = _title; - value = _message; - break; - case 3: - message = _title; - value = _message; - onok = _value; - break; - case 4: - message = _title; - value = _message; - onok = _value; - oncancel = _onok; - break; - case 5: - title = _title; - message = _message; - value = _value; - onok = _onok; - oncancel = _oncancel; - break; - } - this.set('title', title); - this.set('message', message); - this.set('value', value); - this.set('onok', onok); - this.set('oncancel', oncancel); - return this; - }, - setup: function () { - return { - buttons: [ - { - text: alertify.defaults.glossary.ok, - key: keys.ENTER, - className: alertify.defaults.theme.ok, - }, - { - text: alertify.defaults.glossary.cancel, - key: keys.ESC, - invokeOnClose: true, - className: alertify.defaults.theme.cancel, - } - ], - focus: { - element: input, - select: true - }, - options: { - maximizable: false, - resizable: false - } - }; - }, - build: function () { - input.className = alertify.defaults.theme.input; - input.setAttribute('type', 'text'); - input.value = this.get('value'); - this.elements.content.appendChild(p); - this.elements.content.appendChild(input); - }, - prepare: function () { - //nothing - }, - setMessage: function (message) { - if (typeof message === 'string') { - clearContents(p); - p.innerHTML = message; - } else if (message instanceof window.HTMLElement && p.firstChild !== message) { - clearContents(p); - p.appendChild(message); - } - }, - settings: { - message: undefined, - labels: undefined, - onok: undefined, - oncancel: undefined, - value: '', - type:'text', - reverseButtons: undefined, + buttons: [ + { + text: alertify.defaults.glossary.ok, + key: keys.ENTER, + className: alertify.defaults.theme.ok, }, - settingUpdated: function (key, oldValue, newValue) { - switch (key) { - case 'message': - this.setMessage(newValue); - break; - case 'value': - input.value = newValue; - break; - case 'type': - switch (newValue) { - case 'text': - case 'color': - case 'date': - case 'datetime-local': - case 'email': - case 'month': - case 'number': - case 'password': - case 'search': - case 'tel': - case 'time': - case 'week': - input.type = newValue; - break; - default: - input.type = 'text'; - break; - } - break; - case 'labels': - if (newValue.ok && this.__internal.buttons[0].element) { - this.__internal.buttons[0].element.innerHTML = newValue.ok; - } - if (newValue.cancel && this.__internal.buttons[1].element) { - this.__internal.buttons[1].element.innerHTML = newValue.cancel; - } - break; - case 'reverseButtons': - if (newValue === true) { - this.elements.buttons.primary.appendChild(this.__internal.buttons[0].element); - } else { - this.elements.buttons.primary.appendChild(this.__internal.buttons[1].element); - } - break; - } + { + text: alertify.defaults.glossary.cancel, + key: keys.ESC, + invokeOnClose: true, + className: alertify.defaults.theme.cancel, }, - callback: function (closeEvent) { - var returnValue; - switch (closeEvent.index) { - case 0: - this.settings.value = input.value; - if (typeof this.get('onok') === 'function') { - returnValue = this.get('onok').call(this, closeEvent, this.settings.value); - if (typeof returnValue !== 'undefined') { - closeEvent.cancel = !returnValue; - } - } - break; - case 1: - if (typeof this.get('oncancel') === 'function') { - returnValue = this.get('oncancel').call(this, closeEvent); - if (typeof returnValue !== 'undefined') { - closeEvent.cancel = !returnValue; - } - } - if(!closeEvent.cancel){ - input.value = this.settings.value; - } - break; - } - } + ], + focus: { + element: input, + select: true, + }, + options: { + maximizable: false, + resizable: false, + }, }; - }); + }, + build: function () { + input.className = alertify.defaults.theme.input; + input.setAttribute("type", "text"); + input.value = this.get("value"); + this.elements.content.appendChild(p); + this.elements.content.appendChild(input); + }, + prepare: function () { + //nothing + }, + setMessage: function (message) { + if (typeof message === "string") { + clearContents(p); + p.innerHTML = message; + } else if ( + message instanceof window.HTMLElement && + p.firstChild !== message + ) { + clearContents(p); + p.appendChild(message); + } + }, + settings: { + message: undefined, + labels: undefined, + onok: undefined, + oncancel: undefined, + value: "", + type: "text", + reverseButtons: undefined, + }, + settingUpdated: function (key, oldValue, newValue) { + switch (key) { + case "message": + this.setMessage(newValue); + break; + case "value": + input.value = newValue; + break; + case "type": + switch (newValue) { + case "text": + case "color": + case "date": + case "datetime-local": + case "email": + case "month": + case "number": + case "password": + case "search": + case "tel": + case "time": + case "week": + input.type = newValue; + break; + default: + input.type = "text"; + break; + } + break; + case "labels": + if (newValue.ok && this.__internal.buttons[0].element) { + this.__internal.buttons[0].element.innerHTML = newValue.ok; + } + if (newValue.cancel && this.__internal.buttons[1].element) { + this.__internal.buttons[1].element.innerHTML = newValue.cancel; + } + break; + case "reverseButtons": + if (newValue === true) { + this.elements.buttons.primary.appendChild( + this.__internal.buttons[0].element + ); + } else { + this.elements.buttons.primary.appendChild( + this.__internal.buttons[1].element + ); + } + break; + } + }, + callback: function (closeEvent) { + var returnValue; + switch (closeEvent.index) { + case 0: + this.settings.value = input.value; + if (typeof this.get("onok") === "function") { + returnValue = this.get("onok").call( + this, + closeEvent, + this.settings.value + ); + if (typeof returnValue !== "undefined") { + closeEvent.cancel = !returnValue; + } + } + break; + case 1: + if (typeof this.get("oncancel") === "function") { + returnValue = this.get("oncancel").call(this, closeEvent); + if (typeof returnValue !== "undefined") { + closeEvent.cancel = !returnValue; + } + } + if (!closeEvent.cancel) { + input.value = this.settings.value; + } + break; + } + }, + }; + }); - // CommonJS - if ( typeof module === 'object' && typeof module.exports === 'object' ) { - module.exports = alertify; + // CommonJS + if (typeof module === "object" && typeof module.exports === "object") { + module.exports = alertify; // AMD - } else if ( typeof define === 'function' && define.amd) { - define( [], function () { - return alertify; - } ); + } else if (typeof define === "function" && define.amd) { + define([], function () { + return alertify; + }); // window - } else if ( !window.alertify ) { - window.alertify = alertify; - } - -} ( typeof window !== 'undefined' ? window : this ) ); + } else if (!window.alertify) { + window.alertify = alertify; + } +})(typeof window !== "undefined" ? window : this); diff --git a/notemyprogress/js/highcharts/modules/accessibility.js b/notemyprogress/js/highcharts/modules/accessibility.js index 05cad981ff09c89e33328b9d9eadcfd771a831e7..7df713986a0e8ebfe31ba0cbe87a584d7124e553 100644 --- a/notemyprogress/js/highcharts/modules/accessibility.js +++ b/notemyprogress/js/highcharts/modules/accessibility.js @@ -8,174 +8,4199 @@ License: www.highcharts.com/license */ -(function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/accessibility",["highcharts"],function(p){a(p);a.Highcharts=p;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function p(a,f,l,m){a.hasOwnProperty(f)||(a[f]=m.apply(null,l))}a=a?a._modules:{};p(a,"Accessibility/Utils/HTMLUtilities.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,f){function u(a){return a.replace(/&/g, -"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}var m=a.doc,n=a.win,g=f.merge;return{addClass:function(a,g){a.classList?a.classList.add(g):0>a.className.indexOf(g)&&(a.className+=g)},escapeStringForHTML:u,getElement:function(a){return m.getElementById(a)},getFakeMouseEvent:function(a){if("function"===typeof n.MouseEvent)return new n.MouseEvent(a);if(m.createEvent){var g=m.createEvent("MouseEvent");if(g.initMouseEvent)return g.initMouseEvent(a, -!0,!0,n,"click"===a?1:0,0,0,0,0,!1,!1,!1,!1,0,null),g}return{type:a}},removeElement:function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},reverseChildNodes:function(a){for(var g=a.childNodes.length;g--;)a.appendChild(a.childNodes[g])},setElAttrs:function(a,g){Object.keys(g).forEach(function(e){var d=g[e];null===d?a.removeAttribute(e):(d=u(""+d),a.setAttribute(e,d))})},stripHTMLTagsFromString:function(a){return"string"===typeof a?a.replace(/<\/?[^>]+(>|$)/g,""):a},visuallyHideElement:function(a){g(!0, -a.style,{position:"absolute",width:"1px",height:"1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(1px, 1px, 1px, 1px)",marginTop:"-3px","-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=1)",filter:"alpha(opacity=1)",opacity:"0.01"})}}});p(a,"Accessibility/Utils/ChartUtilities.js",[a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,f){function u(d){var b,c;if(null===(b=d.points)||void 0===b?0:b.length)return d=q(d.points,function(c){return!!c.graphic}),null=== -(c=null===d||void 0===d?void 0:d.graphic)||void 0===c?void 0:c.element}function m(d){var b=u(d);return b&&b.parentNode||d.graph&&d.graph.element||d.group&&d.group.element}function n(d,b){b.setAttribute("aria-hidden",!1);b!==d.renderTo&&b.parentNode&&(Array.prototype.forEach.call(b.parentNode.childNodes,function(c){c.hasAttribute("aria-hidden")||c.setAttribute("aria-hidden",!0)}),n(d,b.parentNode))}var g=a.stripHTMLTagsFromString,h=f.defined,q=f.find,e=f.fireEvent;return{getChartTitle:function(d){return g(d.options.title.text|| -d.langFormat("accessibility.defaultChartTitle",{chart:d}))},getAxisDescription:function(d){return g(d&&(d.userOptions&&d.userOptions.accessibility&&d.userOptions.accessibility.description||d.axisTitle&&d.axisTitle.textStr||d.options.id||d.categories&&"categories"||d.dateTime&&"Time"||"values"))},getPointFromXY:function(d,b,c){for(var k=d.length,t;k--;)if(t=q(d[k].points||[],function(v){return v.x===b&&v.y===c}))return t},getSeriesFirstPointElement:u,getSeriesFromName:function(d,b){return b?(d.series|| -[]).filter(function(c){return c.name===b}):d.series},getSeriesA11yElement:m,unhideChartElementFromAT:n,hideSeriesFromAT:function(d){(d=m(d))&&d.setAttribute("aria-hidden",!0)},scrollToPoint:function(d){var b=d.series.xAxis,c=d.series.yAxis,k=(null===b||void 0===b?0:b.scrollbar)?b:c;if((b=null===k||void 0===k?void 0:k.scrollbar)&&h(b.to)&&h(b.from)){c=b.to-b.from;if(h(k.dataMin)&&h(k.dataMax)){var t=k.toPixels(k.dataMin),v=k.toPixels(k.dataMax);d=(k.toPixels(d["xAxis"===k.coll?"x":"y"]||0)-t)/(v-t)}else d= -0;b.updatePosition(d-c/2,d+c/2);e(b,"changed",{from:b.from,to:b.to,trigger:"scrollbar",DOMEvent:null})}}}});p(a,"Accessibility/KeyboardNavigationHandler.js",[a["Core/Utilities.js"]],function(a){function f(a,f){this.chart=a;this.keyCodeMap=f.keyCodeMap||[];this.validate=f.validate;this.init=f.init;this.terminate=f.terminate;this.response={success:1,prev:2,next:3,noHandler:4,fail:5}}var u=a.find;f.prototype={run:function(a){var f=a.which||a.keyCode,g=this.response.noHandler,h=u(this.keyCodeMap,function(a){return-1< -a[0].indexOf(f)});h?g=h[1].call(this,f,a):9===f&&(g=this.response[a.shiftKey?"prev":"next"]);return g}};return f});p(a,"Accessibility/Utils/DOMElementProvider.js",[a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,f,l){var u=a.doc,n=f.removeElement;a=l.extend;f=function(){this.elements=[]};a(f.prototype,{createElement:function(){var a=u.createElement.apply(u,arguments);this.elements.push(a);return a},destroyCreatedElements:function(){this.elements.forEach(function(a){n(a)}); -this.elements=[]}});return f});p(a,"Accessibility/Utils/EventProvider.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,f){var u=f.addEvent;f=f.extend;var m=function(){this.eventRemovers=[]};f(m.prototype,{addEvent:function(){var f=u.apply(a,arguments);this.eventRemovers.push(f);return f},removeAddedEvents:function(){this.eventRemovers.forEach(function(a){a()});this.eventRemovers=[]}});return m});p(a,"Accessibility/AccessibilityComponent.js",[a["Accessibility/Utils/ChartUtilities.js"], -a["Accessibility/Utils/DOMElementProvider.js"],a["Accessibility/Utils/EventProvider.js"],a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,f,l,m,n,g){function h(){}var q=a.unhideChartElementFromAT,e=m.doc,d=m.win,b=n.removeElement,c=n.getFakeMouseEvent;a=g.extend;var k=g.fireEvent,t=g.merge;h.prototype={initBase:function(c){this.chart=c;this.eventProvider=new l;this.domElementProvider=new f;this.keyCodes={left:37,right:39,up:38,down:40,enter:13,space:32, -esc:27,tab:9}},addEvent:function(){return this.eventProvider.addEvent.apply(this.eventProvider,arguments)},createElement:function(){return this.domElementProvider.createElement.apply(this.domElementProvider,arguments)},fireEventOnWrappedOrUnwrappedElement:function(c,b){var v=b.type;e.createEvent&&(c.dispatchEvent||c.fireEvent)?c.dispatchEvent?c.dispatchEvent(b):c.fireEvent(v,b):k(c,v,b)},fakeClickEvent:function(b){if(b){var v=c("click");this.fireEventOnWrappedOrUnwrappedElement(b,v)}},addProxyGroup:function(c){this.createOrUpdateProxyContainer(); -var b=this.createElement("div");Object.keys(c||{}).forEach(function(v){null!==c[v]&&b.setAttribute(v,c[v])});this.chart.a11yProxyContainer.appendChild(b);return b},createOrUpdateProxyContainer:function(){var c=this.chart,b=c.renderer.box;c.a11yProxyContainer=c.a11yProxyContainer||this.createProxyContainerElement();b.nextSibling!==c.a11yProxyContainer&&c.container.insertBefore(c.a11yProxyContainer,b.nextSibling)},createProxyContainerElement:function(){var c=e.createElement("div");c.className="highcharts-a11y-proxy-container"; -return c},createProxyButton:function(c,b,a,d,k){var v=c.element,e=this.createElement("button"),w=t({"aria-label":v.getAttribute("aria-label")},a);Object.keys(w).forEach(function(c){null!==w[c]&&e.setAttribute(c,w[c])});e.className="highcharts-a11y-proxy-button";k&&this.addEvent(e,"click",k);this.setProxyButtonStyle(e);this.updateProxyButtonPosition(e,d||c);this.proxyMouseEventsForButton(v,e);b.appendChild(e);w["aria-hidden"]||q(this.chart,e);return e},getElementPosition:function(c){var b=c.element; -return(c=this.chart.renderTo)&&b&&b.getBoundingClientRect?(b=b.getBoundingClientRect(),c=c.getBoundingClientRect(),{x:b.left-c.left,y:b.top-c.top,width:b.right-b.left,height:b.bottom-b.top}):{x:0,y:0,width:1,height:1}},setProxyButtonStyle:function(c){t(!0,c.style,{"border-width":0,"background-color":"transparent",cursor:"pointer",outline:"none",opacity:.001,filter:"alpha(opacity=1)","-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=1)",zIndex:999,overflow:"hidden",padding:0,margin:0,display:"block", -position:"absolute"})},updateProxyButtonPosition:function(c,b){b=this.getElementPosition(b);t(!0,c.style,{width:(b.width||1)+"px",height:(b.height||1)+"px",left:(b.x||0)+"px",top:(b.y||0)+"px"})},proxyMouseEventsForButton:function(c,b){var a=this;"click touchstart touchend touchcancel touchmove mouseover mouseenter mouseleave mouseout".split(" ").forEach(function(d){var t=0===d.indexOf("touch");a.addEvent(b,d,function(b){var d=t?a.cloneTouchEvent(b):a.cloneMouseEvent(b);c&&a.fireEventOnWrappedOrUnwrappedElement(c, -d);b.stopPropagation();b.preventDefault()})})},cloneMouseEvent:function(b){if("function"===typeof d.MouseEvent)return new d.MouseEvent(b.type,b);if(e.createEvent){var a=e.createEvent("MouseEvent");if(a.initMouseEvent)return a.initMouseEvent(b.type,b.bubbles,b.cancelable,b.view||d,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget),a}return c(b.type)},cloneTouchEvent:function(b){var c=function(b){for(var c=[],a=0;a<b.length;++a){var d= -b.item(a);d&&c.push(d)}return c};if("function"===typeof d.TouchEvent)return c=new d.TouchEvent(b.type,{touches:c(b.touches),targetTouches:c(b.targetTouches),changedTouches:c(b.changedTouches),ctrlKey:b.ctrlKey,shiftKey:b.shiftKey,altKey:b.altKey,metaKey:b.metaKey,bubbles:b.bubbles,cancelable:b.cancelable,composed:b.composed,detail:b.detail,view:b.view}),b.defaultPrevented&&c.preventDefault(),c;c=this.cloneMouseEvent(b);c.touches=b.touches;c.changedTouches=b.changedTouches;c.targetTouches=b.targetTouches; -return c},destroyBase:function(){b(this.chart.a11yProxyContainer);this.domElementProvider.destroyCreatedElements();this.eventProvider.removeAddedEvents()}};a(h.prototype,{init:function(){},getKeyboardNavigation:function(){},onChartUpdate:function(){},onChartRender:function(){},destroy:function(){}});return h});p(a,"Accessibility/KeyboardNavigation.js",[a["Core/Globals.js"],a["Core/Utilities.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Accessibility/Utils/EventProvider.js"]],function(a,f,l,m){function n(b, -c){this.init(b,c)}var g=a.doc,h=a.win,q=f.addEvent,e=f.fireEvent,d=l.getElement;q(g,"keydown",function(b){27===(b.which||b.keyCode)&&a.charts&&a.charts.forEach(function(b){b&&b.dismissPopupContent&&b.dismissPopupContent()})});a.Chart.prototype.dismissPopupContent=function(){var b=this;e(this,"dismissPopupContent",{},function(){b.tooltip&&b.tooltip.hide(0);b.hideExportMenu()})};n.prototype={init:function(b,c){var a=this,d=this.eventProvider=new m;this.chart=b;this.components=c;this.modules=[];this.currentModuleIx= -0;this.update();d.addEvent(this.tabindexContainer,"keydown",function(b){return a.onKeydown(b)});d.addEvent(this.tabindexContainer,"focus",function(b){return a.onFocus(b)});["mouseup","touchend"].forEach(function(b){return d.addEvent(g,b,function(){return a.onMouseUp()})});["mousedown","touchstart"].forEach(function(c){return d.addEvent(b.renderTo,c,function(){a.isClickingChart=!0})});d.addEvent(b.renderTo,"mouseover",function(){a.pointerIsOverChart=!0});d.addEvent(b.renderTo,"mouseout",function(){a.pointerIsOverChart= -!1});this.modules.length&&this.modules[0].init(1)},update:function(b){var c=this.chart.options.accessibility;c=c&&c.keyboardNavigation;var a=this.components;this.updateContainerTabindex();c&&c.enabled&&b&&b.length?(this.modules=b.reduce(function(b,c){c=a[c].getKeyboardNavigation();return b.concat(c)},[]),this.updateExitAnchor()):(this.modules=[],this.currentModuleIx=0,this.removeExitAnchor())},onFocus:function(b){var c,a=this.chart;b=b.relatedTarget&&a.container.contains(b.relatedTarget);this.isClickingChart|| -b||(null===(c=this.modules[0])||void 0===c?void 0:c.init(1))},onMouseUp:function(){delete this.isClickingChart;if(!this.keyboardReset&&!this.pointerIsOverChart){var b=this.chart,c=this.modules&&this.modules[this.currentModuleIx||0];c&&c.terminate&&c.terminate();b.focusElement&&b.focusElement.removeFocusBorder();this.currentModuleIx=0;this.keyboardReset=!0}},onKeydown:function(b){b=b||h.event;var c,a=this.modules&&this.modules.length&&this.modules[this.currentModuleIx];this.keyboardReset=!1;if(a){var d= -a.run(b);d===a.response.success?c=!0:d===a.response.prev?c=this.prev():d===a.response.next&&(c=this.next());c&&(b.preventDefault(),b.stopPropagation())}},prev:function(){return this.move(-1)},next:function(){return this.move(1)},move:function(b){var c=this.modules&&this.modules[this.currentModuleIx];c&&c.terminate&&c.terminate(b);this.chart.focusElement&&this.chart.focusElement.removeFocusBorder();this.currentModuleIx+=b;if(c=this.modules&&this.modules[this.currentModuleIx]){if(c.validate&&!c.validate())return this.move(b); -if(c.init)return c.init(b),!0}this.currentModuleIx=0;0<b?(this.exiting=!0,this.exitAnchor.focus()):this.tabindexContainer.focus();return!1},updateExitAnchor:function(){var b=d("highcharts-end-of-chart-marker-"+this.chart.index);this.removeExitAnchor();b?(this.makeElementAnExitAnchor(b),this.exitAnchor=b):this.createExitAnchor()},updateContainerTabindex:function(){var b=this.chart.options.accessibility;b=b&&b.keyboardNavigation;b=!(b&&!1===b.enabled);var c=this.chart,a=c.container;c.renderTo.hasAttribute("tabindex")&& -(a.removeAttribute("tabindex"),a=c.renderTo);this.tabindexContainer=a;var d=a.getAttribute("tabindex");b&&!d?a.setAttribute("tabindex","0"):b||c.container.removeAttribute("tabindex")},makeElementAnExitAnchor:function(b){var c=this.tabindexContainer.getAttribute("tabindex")||0;b.setAttribute("class","highcharts-exit-anchor");b.setAttribute("tabindex",c);b.setAttribute("aria-hidden",!1);this.addExitAnchorEventsToEl(b)},createExitAnchor:function(){var b=this.chart,c=this.exitAnchor=g.createElement("div"); -b.renderTo.appendChild(c);this.makeElementAnExitAnchor(c)},removeExitAnchor:function(){this.exitAnchor&&this.exitAnchor.parentNode&&(this.exitAnchor.parentNode.removeChild(this.exitAnchor),delete this.exitAnchor)},addExitAnchorEventsToEl:function(b){var c=this.chart,a=this;this.eventProvider.addEvent(b,"focus",function(b){b=b||h.event;b.relatedTarget&&c.container.contains(b.relatedTarget)||a.exiting?a.exiting=!1:(a.tabindexContainer.focus(),b.preventDefault(),a.modules&&a.modules.length&&(a.currentModuleIx= -a.modules.length-1,(b=a.modules[a.currentModuleIx])&&b.validate&&!b.validate()?a.prev():b&&b.init(-1)))})},destroy:function(){this.removeExitAnchor();this.eventProvider.removeAddedEvents();this.chart.container.removeAttribute("tabindex")}};return n});p(a,"Accessibility/Components/LegendComponent.js",[a["Core/Globals.js"],a["Core/Legend.js"],a["Core/Utilities.js"],a["Accessibility/AccessibilityComponent.js"],a["Accessibility/KeyboardNavigationHandler.js"],a["Accessibility/Utils/HTMLUtilities.js"]], -function(a,f,l,m,n,g){function h(b){var c=b.legend&&b.legend.allItems,a=b.options.legend.accessibility||{};return!(!c||!c.length||b.colorAxis&&b.colorAxis.length||!1===a.enabled)}var q=l.addEvent,e=l.extend,d=l.find,b=l.fireEvent,c=g.stripHTMLTagsFromString,k=g.removeElement;a.Chart.prototype.highlightLegendItem=function(c){var a=this.legend.allItems,d=this.highlightedLegendItemIx;if(a[c]){a[d]&&b(a[d].legendGroup.element,"mouseout");d=this.legend;var k=d.allItems[c].pageIx,t=d.currentPage;"undefined"!== -typeof k&&k+1!==t&&d.scroll(1+k-t);this.setFocusToElement(a[c].legendItem,a[c].a11yProxyElement);b(a[c].legendGroup.element,"mouseover");return!0}return!1};q(f,"afterColorizeItem",function(b){var c=b.item;this.chart.options.accessibility.enabled&&c&&c.a11yProxyElement&&c.a11yProxyElement.setAttribute("aria-pressed",b.visible?"false":"true")});a=function(){};a.prototype=new m;e(a.prototype,{init:function(){var b=this;this.proxyElementsList=[];this.recreateProxies();this.addEvent(f,"afterScroll",function(){this.chart=== -b.chart&&(b.updateProxiesPositions(),b.updateLegendItemProxyVisibility(),this.chart.highlightLegendItem(b.highlightedLegendItemIx))});this.addEvent(f,"afterPositionItem",function(c){this.chart===b.chart&&this.chart.renderer&&b.updateProxyPositionForItem(c.item)})},updateLegendItemProxyVisibility:function(){var b=this.chart.legend,c=b.currentPage||1,a=b.clipHeight||0;(b.allItems||[]).forEach(function(d){var k=d.pageIx||0,t=d._legendItemPos?d._legendItemPos[1]:0,e=d.legendItem?Math.round(d.legendItem.getBBox().height): -0;k=t+e-b.pages[k]>a||k!==c-1;d.a11yProxyElement&&(d.a11yProxyElement.style.visibility=k?"hidden":"visible")})},onChartRender:function(){h(this.chart)?this.updateProxiesPositions():this.removeProxies()},updateProxiesPositions:function(){for(var b=0,c=this.proxyElementsList;b<c.length;b++){var a=c[b];this.updateProxyButtonPosition(a.element,a.posElement)}},updateProxyPositionForItem:function(b){var c=d(this.proxyElementsList,function(c){return c.item===b});c&&this.updateProxyButtonPosition(c.element, -c.posElement)},recreateProxies:function(){this.removeProxies();h(this.chart)&&(this.addLegendProxyGroup(),this.proxyLegendItems(),this.updateLegendItemProxyVisibility())},removeProxies:function(){k(this.legendProxyGroup);this.proxyElementsList=[]},addLegendProxyGroup:function(){var b=this.chart.options.accessibility,c=this.chart.langFormat("accessibility.legend.legendLabel",{});this.legendProxyGroup=this.addProxyGroup({"aria-label":c,role:"all"===b.landmarkVerbosity?"region":null})},proxyLegendItems:function(){var b= -this;(this.chart.legend&&this.chart.legend.allItems||[]).forEach(function(c){c.legendItem&&c.legendItem.element&&b.proxyLegendItem(c)})},proxyLegendItem:function(b){if(b.legendItem&&b.legendGroup){var a=this.chart.langFormat("accessibility.legend.legendItem",{chart:this.chart,itemName:c(b.name)}),d=b.legendGroup.div?b.legendItem:b.legendGroup;b.a11yProxyElement=this.createProxyButton(b.legendItem,this.legendProxyGroup,{tabindex:-1,"aria-pressed":!b.visible,"aria-label":a},d);this.proxyElementsList.push({item:b, -element:b.a11yProxyElement,posElement:d})}},getKeyboardNavigation:function(){var b=this.keyCodes,c=this;return new n(this.chart,{keyCodeMap:[[[b.left,b.right,b.up,b.down],function(b){return c.onKbdArrowKey(this,b)}],[[b.enter,b.space],function(){return c.onKbdClick(this)}]],validate:function(){return c.shouldHaveLegendNavigation()},init:function(b){return c.onKbdNavigationInit(b)}})},onKbdArrowKey:function(b,c){var a=this.keyCodes,d=b.response,k=this.chart,e=k.options.accessibility,t=k.legend.allItems.length; -c=c===a.left||c===a.up?-1:1;return k.highlightLegendItem(this.highlightedLegendItemIx+c)?(this.highlightedLegendItemIx+=c,d.success):1<t&&e.keyboardNavigation.wrapAround?(b.init(c),d.success):d[0<c?"next":"prev"]},onKbdClick:function(c){var a=this.chart.legend.allItems[this.highlightedLegendItemIx];a&&a.a11yProxyElement&&b(a.a11yProxyElement,"click");return c.response.success},shouldHaveLegendNavigation:function(){var b=this.chart,c=b.colorAxis&&b.colorAxis.length,a=(b.options.legend||{}).accessibility|| -{};return!!(b.legend&&b.legend.allItems&&b.legend.display&&!c&&a.enabled&&a.keyboardNavigation&&a.keyboardNavigation.enabled)},onKbdNavigationInit:function(b){var c=this.chart,a=c.legend.allItems.length-1;b=0<b?0:a;c.highlightLegendItem(b);this.highlightedLegendItemIx=b}});return a});p(a,"Accessibility/Components/MenuComponent.js",[a["Core/Globals.js"],a["Core/Utilities.js"],a["Accessibility/AccessibilityComponent.js"],a["Accessibility/KeyboardNavigationHandler.js"],a["Accessibility/Utils/ChartUtilities.js"], -a["Accessibility/Utils/HTMLUtilities.js"]],function(a,f,l,m,n,g){function h(b){return b.exportSVGElements&&b.exportSVGElements[0]}f=f.extend;var q=n.unhideChartElementFromAT,e=g.removeElement,d=g.getFakeMouseEvent;a.Chart.prototype.showExportMenu=function(){var b=h(this);if(b&&(b=b.element,b.onclick))b.onclick(d("click"))};a.Chart.prototype.hideExportMenu=function(){var b=this.exportDivElements;b&&this.exportContextMenu&&(b.forEach(function(b){if("highcharts-menu-item"===b.className&&b.onmouseout)b.onmouseout(d("mouseout"))}), -this.highlightedExportItemIx=0,this.exportContextMenu.hideMenu(),this.container.focus())};a.Chart.prototype.highlightExportItem=function(b){var c=this.exportDivElements&&this.exportDivElements[b],a=this.exportDivElements&&this.exportDivElements[this.highlightedExportItemIx];if(c&&"LI"===c.tagName&&(!c.children||!c.children.length)){var e=!!(this.renderTo.getElementsByTagName("g")[0]||{}).focus;c.focus&&e&&c.focus();if(a&&a.onmouseout)a.onmouseout(d("mouseout"));if(c.onmouseover)c.onmouseover(d("mouseover")); -this.highlightedExportItemIx=b;return!0}return!1};a.Chart.prototype.highlightLastExportItem=function(){var b;if(this.exportDivElements)for(b=this.exportDivElements.length;b--;)if(this.highlightExportItem(b))return!0;return!1};a=function(){};a.prototype=new l;f(a.prototype,{init:function(){var b=this.chart,c=this;this.addEvent(b,"exportMenuShown",function(){c.onMenuShown()});this.addEvent(b,"exportMenuHidden",function(){c.onMenuHidden()})},onMenuHidden:function(){var b=this.chart.exportContextMenu; -b&&b.setAttribute("aria-hidden","true");this.isExportMenuShown=!1;this.setExportButtonExpandedState("false")},onMenuShown:function(){var b=this.chart,c=b.exportContextMenu;c&&(this.addAccessibleContextMenuAttribs(),q(b,c));this.isExportMenuShown=!0;this.setExportButtonExpandedState("true")},setExportButtonExpandedState:function(b){var c=this.exportButtonProxy;c&&c.setAttribute("aria-expanded",b)},onChartRender:function(){var b=this.chart,c=b.options.accessibility;e(this.exportProxyGroup);var a=b.options.exporting, -d=h(b);a&&!1!==a.enabled&&a.accessibility&&a.accessibility.enabled&&d&&d.element&&(this.exportProxyGroup=this.addProxyGroup("all"===c.landmarkVerbosity?{"aria-label":b.langFormat("accessibility.exporting.exportRegionLabel",{chart:b}),role:"region"}:{}),c=h(this.chart),this.exportButtonProxy=this.createProxyButton(c,this.exportProxyGroup,{"aria-label":b.langFormat("accessibility.exporting.menuButtonLabel",{chart:b}),"aria-expanded":"false"}))},addAccessibleContextMenuAttribs:function(){var b=this.chart, -c=b.exportDivElements;c&&c.length&&(c.forEach(function(b){"LI"!==b.tagName||b.children&&b.children.length?b.setAttribute("aria-hidden","true"):b.setAttribute("tabindex",-1)}),c=c[0].parentNode,c.removeAttribute("aria-hidden"),c.setAttribute("aria-label",b.langFormat("accessibility.exporting.chartMenuLabel",{chart:b})))},getKeyboardNavigation:function(){var b=this.keyCodes,c=this.chart,a=this;return new m(c,{keyCodeMap:[[[b.left,b.up],function(){return a.onKbdPrevious(this)}],[[b.right,b.down],function(){return a.onKbdNext(this)}], -[[b.enter,b.space],function(){return a.onKbdClick(this)}]],validate:function(){return c.exportChart&&!1!==c.options.exporting.enabled&&!1!==c.options.exporting.accessibility.enabled},init:function(){var b=a.exportButtonProxy,d=c.exportingGroup;d&&b&&c.setFocusToElement(d,b)},terminate:function(){c.hideExportMenu()}})},onKbdPrevious:function(b){var c=this.chart,a=c.options.accessibility;b=b.response;for(var d=c.highlightedExportItemIx||0;d--;)if(c.highlightExportItem(d))return b.success;return a.keyboardNavigation.wrapAround? -(c.highlightLastExportItem(),b.success):b.prev},onKbdNext:function(b){var c=this.chart,a=c.options.accessibility;b=b.response;for(var d=(c.highlightedExportItemIx||0)+1;d<c.exportDivElements.length;++d)if(c.highlightExportItem(d))return b.success;return a.keyboardNavigation.wrapAround?(c.highlightExportItem(0),b.success):b.next},onKbdClick:function(b){var c=this.chart,a=c.exportDivElements[c.highlightedExportItemIx],d=h(c).element;this.isExportMenuShown?this.fakeClickEvent(a):(this.fakeClickEvent(d), -c.highlightExportItem(0));return b.response.success}});return a});p(a,"Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js",[a["Core/Series/Series.js"],a["Core/Series/CartesianSeries.js"],a["Core/Chart/Chart.js"],a["Core/Series/Point.js"],a["Core/Utilities.js"],a["Accessibility/KeyboardNavigationHandler.js"],a["Accessibility/Utils/EventProvider.js"],a["Accessibility/Utils/ChartUtilities.js"]],function(a,f,l,m,n,g,h,q){function e(b){var c=b.index,a=b.series.points,d=a.length;if(a[c]!== -b)for(;d--;){if(a[d]===b)return d}else return c}function d(b){var c=b.chart.options.accessibility.keyboardNavigation.seriesNavigation,a=b.options.accessibility||{},d=a.keyboardNavigation;return d&&!1===d.enabled||!1===a.enabled||!1===b.options.enableMouseTracking||!b.visible||c.pointNavigationEnabledThreshold&&c.pointNavigationEnabledThreshold<=b.points.length}function b(b){var c=b.series.chart.options.accessibility;return b.isNull&&c.keyboardNavigation.seriesNavigation.skipNullPoints||!1===b.visible|| -d(b.series)}function c(b,c,a,d){var r=Infinity,e=c.points.length,k=function(b){return!(w(b.plotX)&&w(b.plotY))};if(!k(b)){for(;e--;){var g=c.points[e];if(!k(g)&&(g=(b.plotX-g.plotX)*(b.plotX-g.plotX)*(a||1)+(b.plotY-g.plotY)*(b.plotY-g.plotY)*(d||1),g<r)){r=g;var h=e}}return w(h)?c.points[h]:void 0}}function k(b){var c=!1;delete b.highlightedPoint;return c=b.series.reduce(function(b,c){return b||c.highlightFirstValidPoint()},!1)}function t(b,c){this.keyCodes=c;this.chart=b}var v=a.seriesTypes,w=n.defined; -a=n.extend;var u=q.getPointFromXY,A=q.getSeriesFromName,p=q.scrollToPoint;f.prototype.keyboardMoveVertical=!0;["column","pie"].forEach(function(b){v[b]&&(v[b].prototype.keyboardMoveVertical=!1)});m.prototype.highlight=function(){var b=this.series.chart;if(this.isNull)b.tooltip&&b.tooltip.hide(0);else this.onMouseOver();p(this);this.graphic&&b.setFocusToElement(this.graphic);b.highlightedPoint=this;return this};l.prototype.highlightAdjacentPoint=function(c){var a=this.series,k=this.highlightedPoint, -r=k&&e(k)||0,g=k&&k.series.points,h=this.series&&this.series[this.series.length-1];h=h&&h.points&&h.points[h.points.length-1];if(!a[0]||!a[0].points)return!1;if(k){if(a=a[k.series.index+(c?1:-1)],r=g[r+(c?1:-1)],!r&&a&&(r=a.points[c?0:a.points.length-1]),!r)return!1}else r=c?a[0].points[0]:h;return b(r)?(a=r.series,d(a)?this.highlightedPoint=c?a.points[a.points.length-1]:a.points[0]:this.highlightedPoint=r,this.highlightAdjacentPoint(c)):r.highlight()};f.prototype.highlightFirstValidPoint=function(){var c= -this.chart.highlightedPoint,a=(c&&c.series)===this?e(c):0;c=this.points;var d=c.length;if(c&&d){for(var r=a;r<d;++r)if(!b(c[r]))return c[r].highlight();for(;0<=a;--a)if(!b(c[a]))return c[a].highlight()}return!1};l.prototype.highlightAdjacentSeries=function(b){var a,k=this.highlightedPoint;var r=(a=this.series&&this.series[this.series.length-1])&&a.points&&a.points[a.points.length-1];if(!this.highlightedPoint)return a=b?this.series&&this.series[0]:a,(r=b?a&&a.points&&a.points[0]:r)?r.highlight():!1; -a=this.series[k.series.index+(b?-1:1)];if(!a)return!1;r=c(k,a,4);if(!r)return!1;if(d(a))return r.highlight(),b=this.highlightAdjacentSeries(b),b?b:(k.highlight(),!1);r.highlight();return r.series.highlightFirstValidPoint()};l.prototype.highlightAdjacentPointVertical=function(c){var a=this.highlightedPoint,k=Infinity,r;if(!w(a.plotX)||!w(a.plotY))return!1;this.series.forEach(function(e){d(e)||e.points.forEach(function(d){if(w(d.plotY)&&w(d.plotX)&&d!==a){var g=d.plotY-a.plotY,h=Math.abs(d.plotX-a.plotX); -h=Math.abs(g)*Math.abs(g)+h*h*4;e.yAxis&&e.yAxis.reversed&&(g*=-1);!(0>=g&&c||0<=g&&!c||5>h||b(d))&&h<k&&(k=h,r=d)}})});return r?r.highlight():!1};a(t.prototype,{init:function(){var b=this,c=this.chart,a=this.eventProvider=new h;a.addEvent(f,"destroy",function(){return b.onSeriesDestroy(this)});a.addEvent(c,"afterDrilldown",function(){k(this);this.focusElement&&this.focusElement.removeFocusBorder()});a.addEvent(c,"drilldown",function(c){c=c.point;var a=c.series;b.lastDrilledDownPoint={x:c.x,y:c.y, -seriesName:a?a.name:""}});a.addEvent(c,"drillupall",function(){setTimeout(function(){b.onDrillupAll()},10)})},onDrillupAll:function(){var b=this.lastDrilledDownPoint,c=this.chart,a=b&&A(c,b.seriesName),d;b&&a&&w(b.x)&&w(b.y)&&(d=u(a,b.x,b.y));c.container&&c.container.focus();d&&d.highlight&&d.highlight();c.focusElement&&c.focusElement.removeFocusBorder()},getKeyboardNavigationHandler:function(){var b=this,c=this.keyCodes,a=this.chart,d=a.inverted;return new g(a,{keyCodeMap:[[d?[c.up,c.down]:[c.left, -c.right],function(c){return b.onKbdSideways(this,c)}],[d?[c.left,c.right]:[c.up,c.down],function(c){return b.onKbdVertical(this,c)}],[[c.enter,c.space],function(){a.highlightedPoint&&a.highlightedPoint.firePointEvent("click");return this.response.success}]],init:function(c){return b.onHandlerInit(this,c)},terminate:function(){return b.onHandlerTerminate()}})},onKbdSideways:function(b,c){var a=this.keyCodes;return this.attemptHighlightAdjacentPoint(b,c===a.right||c===a.down)},onKbdVertical:function(b, -c){var a=this.chart,d=this.keyCodes;c=c===d.down||c===d.right;d=a.options.accessibility.keyboardNavigation.seriesNavigation;if(d.mode&&"serialize"===d.mode)return this.attemptHighlightAdjacentPoint(b,c);a[a.highlightedPoint&&a.highlightedPoint.series.keyboardMoveVertical?"highlightAdjacentPointVertical":"highlightAdjacentSeries"](c);return b.response.success},onHandlerInit:function(b,c){var a=this.chart;if(0<c)k(a);else{c=a.series.length;for(var d;c--&&!(a.highlightedPoint=a.series[c].points[a.series[c].points.length- -1],d=a.series[c].highlightFirstValidPoint()););}return b.response.success},onHandlerTerminate:function(){var b,c,a=this.chart,d=a.highlightedPoint;null===(b=a.tooltip)||void 0===b?void 0:b.hide(0);null===(c=null===d||void 0===d?void 0:d.onMouseOut)||void 0===c?void 0:c.call(d);delete a.highlightedPoint},attemptHighlightAdjacentPoint:function(b,c){var a=this.chart,d=a.options.accessibility.keyboardNavigation.wrapAround;return a.highlightAdjacentPoint(c)?b.response.success:d?b.init(c?1:-1):b.response[c? -"next":"prev"]},onSeriesDestroy:function(b){var c=this.chart;c.highlightedPoint&&c.highlightedPoint.series===b&&(delete c.highlightedPoint,c.focusElement&&c.focusElement.removeFocusBorder())},destroy:function(){this.eventProvider.removeAddedEvents()}});return t});p(a,"Accessibility/Components/AnnotationsA11y.js",[a["Accessibility/Utils/HTMLUtilities.js"]],function(a){function f(a){return(a.annotations||[]).reduce(function(a,d){var b;!1!==(null===(b=d.options)||void 0===b?void 0:b.visible)&&(a=a.concat(d.labels)); -return a},[])}function l(a){var e,d,b,c,k=null===(d=null===(e=a.options)||void 0===e?void 0:e.accessibility)||void 0===d?void 0:d.description;return k?k:(null===(c=null===(b=a.graphic)||void 0===b?void 0:b.text)||void 0===c?void 0:c.textStr)||""}function m(a){var e,d,b=null===(d=null===(e=a.options)||void 0===e?void 0:e.accessibility)||void 0===d?void 0:d.description;if(b)return b;e=a.chart;d=l(a);b=a.points.filter(function(b){return!!b.graphic}).map(function(b){var c,a;if(!(a=null===(c=null===b|| -void 0===b?void 0:b.accessibility)||void 0===c?void 0:c.valueDescription)){var d,e;a=(null===(e=null===(d=null===b||void 0===b?void 0:b.graphic)||void 0===d?void 0:d.element)||void 0===e?void 0:e.getAttribute("aria-label"))||""}b=(null===b||void 0===b?void 0:b.series.name)||"";return(b?b+", ":"")+"data point "+a}).filter(function(b){return!!b});var c=b.length;a="accessibility.screenReaderSection.annotations.description"+(1<c?"MultiplePoints":c?"SinglePoint":"NoPoints");d={annotationText:d,numPoints:c, -annotationPoint:b[0],additionalAnnotationPoints:b.slice(1)};return e.langFormat(a,d)}function n(a){return f(a).map(function(a){return(a=g(h(m(a))))?"<li>"+a+"</li>":""})}var g=a.escapeStringForHTML,h=a.stripHTMLTagsFromString;return{getAnnotationsInfoHTML:function(a){var e=a.annotations;return e&&e.length?"<ul>"+n(a).join(" ")+"</ul>":""},getAnnotationLabelDescription:m,getAnnotationListItems:n,getPointAnnotationTexts:function(a){var e=f(a.series.chart).filter(function(d){return-1<d.points.indexOf(a)}); -return e.length?e.map(function(a){return""+l(a)}):[]}}});p(a,"Accessibility/Components/SeriesComponent/SeriesDescriber.js",[a["Accessibility/Components/AnnotationsA11y.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Tooltip.js"],a["Core/Utilities.js"]],function(a,f,l,m,n){function g(b){var c=b.index;return b.series&&b.series.data&&G(c)?K(b.series.data,function(b){return!!(b&&"undefined"!==typeof b.index&&b.index>c&&b.graphic&&b.graphic.element)})|| -null:null}function h(b){var c=b.chart.options.accessibility.series.pointDescriptionEnabledThreshold;return!!(!1!==c&&b.points&&b.points.length>=c)}function q(b){var c=b.options.accessibility||{};return!h(b)&&!c.exposeAsGroupOnly}function e(b){var c=b.chart.options.accessibility.keyboardNavigation.seriesNavigation;return!(!b.points||!(b.points.length<c.pointNavigationEnabledThreshold||!1===c.pointNavigationEnabledThreshold))}function d(b,c){var a=b.series.chart,d=a.options.accessibility.point||{}; -b=b.series.tooltipOptions||{};a=a.options.lang;return L(c)?M(c,d.valueDecimals||b.valueDecimals||-1,a.decimalPoint,a.accessibility.thousandsSep||a.thousandsSep):c}function b(b){var c=(b.options.accessibility||{}).description;return c&&b.chart.langFormat("accessibility.series.description",{description:c,series:b})||""}function c(b,c){return b.chart.langFormat("accessibility.series."+c+"Description",{name:x(b[c]),series:b})}function k(b){var c=b.series,a=c.chart,d=a.options.accessibility.point||{}; -if(c.xAxis&&c.xAxis.dateTime)return c=m.prototype.getXDateFormat.call({getDateFormat:m.prototype.getDateFormat,chart:a},b,a.options.tooltip,c.xAxis),d=d.dateFormatter&&d.dateFormatter(b)||d.dateFormat||c,a.time.dateFormat(d,b.x,void 0)}function t(b){var c=k(b),a=(b.series.xAxis||{}).categories&&G(b.category)&&(""+b.category).replace("<br/>"," "),d=b.id&&0>b.id.indexOf("highcharts-"),e="x, "+b.x;return b.name||c||a||(d?b.id:e)}function v(b,c,a){var e=c||"",k=a||"";return b.series.pointArrayMap.reduce(function(c, -a){c+=c.length?", ":"";var r=d(b,C(b[a],b.options[a]));return c+(a+": "+e+r+k)},"")}function w(b){var c=b.series,a=c.chart.options.accessibility.point||{},e=c.tooltipOptions||{},k=a.valuePrefix||e.valuePrefix||"";a=a.valueSuffix||e.valueSuffix||"";e=d(b,b["undefined"!==typeof b.value?"value":"y"]);return b.isNull?c.chart.langFormat("accessibility.series.nullPointValue",{point:b}):c.pointArrayMap?v(b,k,a):k+e+a}function u(b){var c=b.series,a=c.chart,d=a.options.accessibility.point.valueDescriptionFormat, -e=(c=C(c.xAxis&&c.xAxis.options.accessibility&&c.xAxis.options.accessibility.enabled,!a.angular))?t(b):"";b={point:b,index:G(b.index)?b.index+1:"",xDescription:e,value:w(b),separator:c?", ":""};return N(d,b,a)}function A(b){var c=b.series,a=c.chart,d=u(b),e=b.options&&b.options.accessibility&&b.options.accessibility.description;e=e?" "+e:"";c=1<a.series.length&&c.name?" "+c.name+".":"";a=b.series.chart;var k=z(b),r={point:b,annotations:k};a=k.length?a.langFormat("accessibility.series.pointAnnotationsDescription", -r):"";b.accessibility=b.accessibility||{};b.accessibility.valueDescription=d;return d+e+c+(a?" "+a:"")}function p(b){var c=q(b),a=e(b);(c||a)&&b.points.forEach(function(b){var a;if(!(a=b.graphic&&b.graphic.element)&&(a=b.series&&b.series.is("sunburst"),a=b.isNull&&!a)){var d=b.series,e=g(b);d=(a=e&&e.graphic)?a.parentGroup:d.graph||d.group;e=e?{x:C(b.plotX,e.plotX,0),y:C(b.plotY,e.plotY,0)}:{x:C(b.plotX,0),y:C(b.plotY,0)};e=b.series.chart.renderer.rect(e.x,e.y,1,1);e.attr({"class":"highcharts-a11y-dummy-point", -fill:"none",opacity:0,"fill-opacity":0,"stroke-opacity":0});d&&d.element?(b.graphic=e,b.hasDummyGraphic=!0,e.add(d),d.element.insertBefore(e.element,a?a.element:null),a=e.element):a=void 0}a&&(a.setAttribute("tabindex","-1"),a.style.outline="0",c?(e=b.series,d=e.chart.options.accessibility.point||{},e=e.options.accessibility||{},b=B(I(e.pointDescriptionFormatter&&e.pointDescriptionFormatter(b)||d.descriptionFormatter&&d.descriptionFormatter(b)||A(b))),a.setAttribute("role","img"),a.setAttribute("aria-label", -b)):a.setAttribute("aria-hidden",!0))})}function y(a){var d=a.chart,e=d.types||[],k=b(a),r=function(b){return d[b]&&1<d[b].length&&a[b]},g=c(a,"xAxis"),h=c(a,"yAxis"),f={name:a.name||"",ix:a.index+1,numSeries:d.series&&d.series.length,numPoints:a.points&&a.points.length,series:a};e=1<e.length?"Combination":"";return(d.langFormat("accessibility.series.summary."+a.type+e,f)||d.langFormat("accessibility.series.summary.default"+e,f))+(k?" "+k:"")+(r("yAxis")?" "+h:"")+(r("xAxis")?" "+g:"")}var z=a.getPointAnnotationTexts, -x=f.getAxisDescription,r=f.getSeriesFirstPointElement,J=f.getSeriesA11yElement,F=f.unhideChartElementFromAT,B=l.escapeStringForHTML,E=l.reverseChildNodes,I=l.stripHTMLTagsFromString,K=n.find,N=n.format,L=n.isNumber,M=n.numberFormat,C=n.pick,G=n.defined;return{describeSeries:function(b){var c=b.chart,a=r(b),d=J(b),e=c.is3d&&c.is3d();if(d){d.lastChild!==a||e||E(d);p(b);F(c,d);e=b.chart;c=e.options.chart||{};a=1<e.series.length;e=e.options.accessibility.series.describeSingleSeries;var k=(b.options.accessibility|| -{}).exposeAsGroupOnly;c.options3d&&c.options3d.enabled&&a||!(a||e||k||h(b))?d.setAttribute("aria-label",""):(c=b.chart.options.accessibility,a=c.landmarkVerbosity,(b.options.accessibility||{}).exposeAsGroupOnly?d.setAttribute("role","img"):"all"===a&&d.setAttribute("role","region"),d.setAttribute("tabindex","-1"),d.style.outline="0",d.setAttribute("aria-label",B(I(c.series.descriptionFormatter&&c.series.descriptionFormatter(b)||y(b)))))}},defaultPointDescriptionFormatter:A,defaultSeriesDescriptionFormatter:y, -getPointA11yTimeDescription:k,getPointXDescription:t,getPointValue:w,getPointValueDescription:u}});p(a,"Accessibility/Utils/Announcer.js",[a["Core/Globals.js"],a["Accessibility/Utils/DOMElementProvider.js"],a["Accessibility/Utils/HTMLUtilities.js"]],function(a,f,l){var m=l.visuallyHideElement;l=function(){function a(a,h){this.chart=a;this.domElementProvider=new f;this.announceRegion=this.addAnnounceRegion(h)}a.prototype.destroy=function(){this.domElementProvider.destroyCreatedElements()};a.prototype.announce= -function(a){var g=this;this.announceRegion.innerHTML=a;this.clearAnnouncementRegionTimer&&clearTimeout(this.clearAnnouncementRegionTimer);this.clearAnnouncementRegionTimer=setTimeout(function(){g.announceRegion.innerHTML="";delete g.clearAnnouncementRegionTimer},1E3)};a.prototype.addAnnounceRegion=function(a){var g=this.chart.renderTo,f=this.domElementProvider.createElement("div");f.setAttribute("aria-hidden",!1);f.setAttribute("aria-live",a);m(f);g.insertBefore(f,g.firstChild);return f};return a}(); -return a.Announcer=l});p(a,"Accessibility/Components/SeriesComponent/NewDataAnnouncer.js",[a["Core/Globals.js"],a["Core/Series/CartesianSeries.js"],a["Core/Utilities.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Accessibility/Components/SeriesComponent/SeriesDescriber.js"],a["Accessibility/Utils/Announcer.js"],a["Accessibility/Utils/EventProvider.js"]],function(a,f,l,m,n,g,h){function q(b){var c=b.series.data.filter(function(c){return b.x===c.x&&b.y===c.y});return 1===c.length?c[0]:b}function e(b, -c){var a=(b||[]).concat(c||[]).reduce(function(b,c){b[c.name+c.index]=c;return b},{});return Object.keys(a).map(function(b){return a[b]})}var d=l.extend,b=l.defined,c=m.getChartTitle,k=n.defaultPointDescriptionFormatter,t=n.defaultSeriesDescriptionFormatter;l=function(b){this.chart=b};d(l.prototype,{init:function(){var b=this.chart,c=b.options.accessibility.announceNewData.interruptUser?"assertive":"polite";this.lastAnnouncementTime=0;this.dirty={allSeries:{}};this.eventProvider=new h;this.announcer= -new g(b,c);this.addEventListeners()},destroy:function(){this.eventProvider.removeAddedEvents();this.announcer.destroy()},addEventListeners:function(){var b=this,c=this.chart,a=this.eventProvider;a.addEvent(c,"afterDrilldown",function(){b.lastAnnouncementTime=0});a.addEvent(f,"updatedData",function(){b.onSeriesUpdatedData(this)});a.addEvent(c,"afterAddSeries",function(c){b.onSeriesAdded(c.series)});a.addEvent(f,"addPoint",function(c){b.onPointAdded(c.point)});a.addEvent(c,"redraw",function(){b.announceDirtyData()})}, -onSeriesUpdatedData:function(b){var c=this.chart;b.chart===c&&c.options.accessibility.announceNewData.enabled&&(this.dirty.hasDirty=!0,this.dirty.allSeries[b.name+b.index]=b)},onSeriesAdded:function(c){this.chart.options.accessibility.announceNewData.enabled&&(this.dirty.hasDirty=!0,this.dirty.allSeries[c.name+c.index]=c,this.dirty.newSeries=b(this.dirty.newSeries)?void 0:c)},onPointAdded:function(c){var a=c.series.chart;this.chart===a&&a.options.accessibility.announceNewData.enabled&&(this.dirty.newPoint= -b(this.dirty.newPoint)?void 0:c)},announceDirtyData:function(){var b=this;if(this.chart.options.accessibility.announceNewData&&this.dirty.hasDirty){var c=this.dirty.newPoint;c&&(c=q(c));this.queueAnnouncement(Object.keys(this.dirty.allSeries).map(function(c){return b.dirty.allSeries[c]}),this.dirty.newSeries,c);this.dirty={allSeries:{}}}},queueAnnouncement:function(b,c,a){var d=this,k=this.chart.options.accessibility.announceNewData;if(k.enabled){var g=+new Date;k=Math.max(0,k.minAnnounceInterval- -(g-this.lastAnnouncementTime));b=e(this.queuedAnnouncement&&this.queuedAnnouncement.series,b);if(c=this.buildAnnouncementMessage(b,c,a))this.queuedAnnouncement&&clearTimeout(this.queuedAnnouncementTimer),this.queuedAnnouncement={time:g,message:c,series:b},this.queuedAnnouncementTimer=setTimeout(function(){d&&d.announcer&&(d.lastAnnouncementTime=+new Date,d.announcer.announce(d.queuedAnnouncement.message),delete d.queuedAnnouncement,delete d.queuedAnnouncementTimer)},k)}},buildAnnouncementMessage:function(b, -d,e){var g=this.chart,h=g.options.accessibility.announceNewData;if(h.announcementFormatter&&(b=h.announcementFormatter(b,d,e),!1!==b))return b.length?b:null;b=a.charts&&1<a.charts.length?"Multiple":"Single";b=d?"newSeriesAnnounce"+b:e?"newPointAnnounce"+b:"newDataAnnounce";h=c(g);return g.langFormat("accessibility.announceNewData."+b,{chartTitle:h,seriesDesc:d?t(d):null,pointDesc:e?k(e):null,point:e,series:d})}});return l});p(a,"Accessibility/Components/SeriesComponent/ForcedMarkers.js",[a["Core/Series/CartesianSeries.js"], -a["Core/Utilities.js"]],function(a,f){function l(a){n(!0,a,{marker:{enabled:!0,states:{normal:{opacity:0}}}})}var m=f.addEvent,n=f.merge;return function(){m(a,"render",function(){var a=this.options,h=!1!==(this.options.accessibility&&this.options.accessibility.enabled);if(h=this.chart.options.accessibility.enabled&&h)h=this.chart.options.accessibility,h=this.points.length<h.series.pointDescriptionEnabledThreshold||!1===h.series.pointDescriptionEnabledThreshold;if(h){if(a.marker&&!1===a.marker.enabled&& -(this.a11yMarkersForced=!0,l(this.options)),this._hasPointMarkers&&this.points&&this.points.length)for(a=this.points.length;a--;){h=this.points[a];var f=h.options;delete h.hasForcedA11yMarker;f.marker&&(f.marker.enabled?(n(!0,f.marker,{states:{normal:{opacity:f.marker.states&&f.marker.states.normal&&f.marker.states.normal.opacity||1}}}),h.hasForcedA11yMarker=!1):(l(f),h.hasForcedA11yMarker=!0))}}else this.a11yMarkersForced&&(delete this.a11yMarkersForced,(a=this.resetA11yMarkerOptions)&&n(!0,this.options, -{marker:{enabled:a.enabled,states:{normal:{opacity:a.states&&a.states.normal&&a.states.normal.opacity}}}}))});m(a,"afterSetOptions",function(a){this.resetA11yMarkerOptions=n(a.options.marker||{},this.userOptions.marker||{})});m(a,"afterRender",function(){if(this.chart.styledMode){if(this.markerGroup)this.markerGroup[this.a11yMarkersForced?"addClass":"removeClass"]("highcharts-a11y-markers-hidden");this._hasPointMarkers&&this.points&&this.points.length&&this.points.forEach(function(a){a.graphic&&(a.graphic[a.hasForcedA11yMarker? -"addClass":"removeClass"]("highcharts-a11y-marker-hidden"),a.graphic[!1===a.hasForcedA11yMarker?"addClass":"removeClass"]("highcharts-a11y-marker-visible"))})}})}});p(a,"Accessibility/Components/SeriesComponent/SeriesComponent.js",[a["Core/Globals.js"],a["Core/Utilities.js"],a["Accessibility/AccessibilityComponent.js"],a["Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js"],a["Accessibility/Components/SeriesComponent/NewDataAnnouncer.js"],a["Accessibility/Components/SeriesComponent/ForcedMarkers.js"], -a["Accessibility/Utils/ChartUtilities.js"],a["Accessibility/Components/SeriesComponent/SeriesDescriber.js"],a["Core/Tooltip.js"]],function(a,f,l,m,n,g,h,q,e){f=f.extend;var d=h.hideSeriesFromAT,b=q.describeSeries;a.SeriesAccessibilityDescriber=q;g();a=function(){};a.prototype=new l;f(a.prototype,{init:function(){this.newDataAnnouncer=new n(this.chart);this.newDataAnnouncer.init();this.keyboardNavigation=new m(this.chart,this.keyCodes);this.keyboardNavigation.init();this.hideTooltipFromATWhenShown(); -this.hideSeriesLabelsFromATWhenShown()},hideTooltipFromATWhenShown:function(){var b=this;this.addEvent(e,"refresh",function(){this.chart===b.chart&&this.label&&this.label.element&&this.label.element.setAttribute("aria-hidden",!0)})},hideSeriesLabelsFromATWhenShown:function(){this.addEvent(this.chart,"afterDrawSeriesLabels",function(){this.series.forEach(function(b){b.labelBySeries&&b.labelBySeries.attr("aria-hidden",!0)})})},onChartRender:function(){this.chart.series.forEach(function(c){!1!==(c.options.accessibility&& -c.options.accessibility.enabled)&&c.visible?b(c):d(c)})},getKeyboardNavigation:function(){return this.keyboardNavigation.getKeyboardNavigationHandler()},destroy:function(){this.newDataAnnouncer.destroy();this.keyboardNavigation.destroy()}});return a});p(a,"Accessibility/Components/ZoomComponent.js",[a["Accessibility/AccessibilityComponent.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Accessibility/KeyboardNavigationHandler.js"],a["Core/Utilities.js"]], -function(a,f,l,m,n,g){var h=f.unhideChartElementFromAT;f=l.noop;var q=m.removeElement,e=m.setElAttrs;m=g.extend;var d=g.pick;l.Axis.prototype.panStep=function(b,c){var a=c||3;c=this.getExtremes();var d=(c.max-c.min)/a*b;a=c.max+d;d=c.min+d;var e=a-d;0>b&&d<c.dataMin?(d=c.dataMin,a=d+e):0<b&&a>c.dataMax&&(a=c.dataMax,d=a-e);this.setExtremes(d,a)};f.prototype=new a;m(f.prototype,{init:function(){var b=this,c=this.chart;["afterShowResetZoom","afterDrilldown","drillupall"].forEach(function(a){b.addEvent(c, -a,function(){b.updateProxyOverlays()})})},onChartUpdate:function(){var b=this.chart,c=this;b.mapNavButtons&&b.mapNavButtons.forEach(function(a,d){h(b,a.element);c.setMapNavButtonAttrs(a.element,"accessibility.zoom.mapZoom"+(d?"Out":"In"))})},setMapNavButtonAttrs:function(b,c){var a=this.chart;c=a.langFormat(c,{chart:a});e(b,{tabindex:-1,role:"button","aria-label":c})},onChartRender:function(){this.updateProxyOverlays()},updateProxyOverlays:function(){var b=this.chart;q(this.drillUpProxyGroup);q(this.resetZoomProxyGroup); -b.resetZoomButton&&this.recreateProxyButtonAndGroup(b.resetZoomButton,"resetZoomProxyButton","resetZoomProxyGroup",b.langFormat("accessibility.zoom.resetZoomButton",{chart:b}));b.drillUpButton&&this.recreateProxyButtonAndGroup(b.drillUpButton,"drillUpProxyButton","drillUpProxyGroup",b.langFormat("accessibility.drillUpButton",{chart:b,buttonText:b.getDrilldownBackText()}))},recreateProxyButtonAndGroup:function(b,c,a,d){q(this[a]);this[a]=this.addProxyGroup();this[c]=this.createProxyButton(b,this[a], -{"aria-label":d,tabindex:-1})},getMapZoomNavigation:function(){var b=this.keyCodes,a=this.chart,d=this;return new n(a,{keyCodeMap:[[[b.up,b.down,b.left,b.right],function(b){return d.onMapKbdArrow(this,b)}],[[b.tab],function(b,a){return d.onMapKbdTab(this,a)}],[[b.space,b.enter],function(){return d.onMapKbdClick(this)}]],validate:function(){return!!(a.mapZoom&&a.mapNavButtons&&a.mapNavButtons.length)},init:function(b){return d.onMapNavInit(b)}})},onMapKbdArrow:function(b,a){var c=this.keyCodes;this.chart[a=== -c.up||a===c.down?"yAxis":"xAxis"][0].panStep(a===c.left||a===c.up?-1:1);return b.response.success},onMapKbdTab:function(b,a){var c=this.chart;b=b.response;var d=(a=a.shiftKey)&&!this.focusedMapNavButtonIx||!a&&this.focusedMapNavButtonIx;c.mapNavButtons[this.focusedMapNavButtonIx].setState(0);if(d)return c.mapZoom(),b[a?"prev":"next"];this.focusedMapNavButtonIx+=a?-1:1;a=c.mapNavButtons[this.focusedMapNavButtonIx];c.setFocusToElement(a.box,a.element);a.setState(2);return b.success},onMapKbdClick:function(b){this.fakeClickEvent(this.chart.mapNavButtons[this.focusedMapNavButtonIx].element); -return b.response.success},onMapNavInit:function(b){var a=this.chart,d=a.mapNavButtons[0],e=a.mapNavButtons[1];d=0<b?d:e;a.setFocusToElement(d.box,d.element);d.setState(2);this.focusedMapNavButtonIx=0<b?0:1},simpleButtonNavigation:function(b,a,e){var c=this.keyCodes,k=this,g=this.chart;return new n(g,{keyCodeMap:[[[c.tab,c.up,c.down,c.left,c.right],function(b,a){return this.response[b===c.tab&&a.shiftKey||b===c.left||b===c.up?"prev":"next"]}],[[c.space,c.enter],function(){var b=e(this,g);return d(b, -this.response.success)}]],validate:function(){return g[b]&&g[b].box&&k[a]},init:function(){g.setFocusToElement(g[b].box,k[a])}})},getKeyboardNavigation:function(){return[this.simpleButtonNavigation("resetZoomButton","resetZoomProxyButton",function(b,a){a.zoomOut()}),this.simpleButtonNavigation("drillUpButton","drillUpProxyButton",function(b,a){a.drillUp();return b.response.prev}),this.getMapZoomNavigation()]}});return f});p(a,"Accessibility/Components/RangeSelectorComponent.js",[a["Accessibility/AccessibilityComponent.js"], -a["Accessibility/Utils/ChartUtilities.js"],a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Accessibility/KeyboardNavigationHandler.js"],a["Core/Utilities.js"]],function(a,f,l,m,n,g){var h=f.unhideChartElementFromAT,q=m.setElAttrs;f=g.extend;l.Chart.prototype.highlightRangeSelectorButton=function(a){var d=this.rangeSelector.buttons,b=this.highlightedRangeSelectorItemIx;"undefined"!==typeof b&&d[b]&&d[b].setState(this.oldRangeSelectorItemState||0);this.highlightedRangeSelectorItemIx= -a;return d[a]?(this.setFocusToElement(d[a].box,d[a].element),this.oldRangeSelectorItemState=d[a].state,d[a].setState(2),!0):!1};l=function(){};l.prototype=new a;f(l.prototype,{onChartUpdate:function(){var a=this.chart,d=this,b=a.rangeSelector;b&&(b.buttons&&b.buttons.length&&b.buttons.forEach(function(b){h(a,b.element);d.setRangeButtonAttrs(b)}),b.maxInput&&b.minInput&&["minInput","maxInput"].forEach(function(c,e){if(c=b[c])h(a,c),d.setRangeInputAttrs(c,"accessibility.rangeSelector."+(e?"max":"min")+ -"InputLabel")}))},setRangeButtonAttrs:function(a){var d=this.chart;d=d.langFormat("accessibility.rangeSelector.buttonText",{chart:d,buttonText:a.text&&a.text.textStr});q(a.element,{tabindex:-1,role:"button","aria-label":d})},setRangeInputAttrs:function(a,d){var b=this.chart;q(a,{tabindex:-1,role:"textbox","aria-label":b.langFormat(d,{chart:b})})},getRangeSelectorButtonNavigation:function(){var a=this.chart,d=this.keyCodes,b=this;return new n(a,{keyCodeMap:[[[d.left,d.right,d.up,d.down],function(a){return b.onButtonNavKbdArrowKey(this, -a)}],[[d.enter,d.space],function(){return b.onButtonNavKbdClick(this)}]],validate:function(){return a.rangeSelector&&a.rangeSelector.buttons&&a.rangeSelector.buttons.length},init:function(b){var c=a.rangeSelector.buttons.length-1;a.highlightRangeSelectorButton(0<b?0:c)}})},onButtonNavKbdArrowKey:function(a,d){var b=a.response,c=this.keyCodes,e=this.chart,g=e.options.accessibility.keyboardNavigation.wrapAround;d=d===c.left||d===c.up?-1:1;return e.highlightRangeSelectorButton(e.highlightedRangeSelectorItemIx+ -d)?b.success:g?(a.init(d),b.success):b[0<d?"next":"prev"]},onButtonNavKbdClick:function(a){a=a.response;var d=this.chart;3!==d.oldRangeSelectorItemState&&this.fakeClickEvent(d.rangeSelector.buttons[d.highlightedRangeSelectorItemIx].element);return a.success},getRangeSelectorInputNavigation:function(){var a=this.chart,d=this.keyCodes,b=this;return new n(a,{keyCodeMap:[[[d.tab,d.up,d.down],function(a,e){return b.onInputKbdMove(this,a===d.tab&&e.shiftKey||a===d.up?-1:1)}]],validate:function(){return a.rangeSelector&& -a.rangeSelector.inputGroup&&"hidden"!==a.rangeSelector.inputGroup.element.getAttribute("visibility")&&!1!==a.options.rangeSelector.inputEnabled&&a.rangeSelector.minInput&&a.rangeSelector.maxInput},init:function(a){b.onInputNavInit(a)},terminate:function(){b.onInputNavTerminate()}})},onInputKbdMove:function(a,d){var b=this.chart;a=a.response;var c=b.highlightedInputRangeIx+=d;if(1<c||0>c)return a[0<d?"next":"prev"];b.rangeSelector[c?"maxInput":"minInput"].focus();return a.success},onInputNavInit:function(a){var d= -this.chart;a=0<a?0:1;d.highlightedInputRangeIx=a;d.rangeSelector[a?"maxInput":"minInput"].focus()},onInputNavTerminate:function(){var a=this.chart.rangeSelector||{};a.maxInput&&a.hideInput("max");a.minInput&&a.hideInput("min")},getKeyboardNavigation:function(){return[this.getRangeSelectorButtonNavigation(),this.getRangeSelectorInputNavigation()]}});return l});p(a,"Accessibility/Components/InfoRegionsComponent.js",[a["Core/Globals.js"],a["Core/Utilities.js"],a["Accessibility/AccessibilityComponent.js"], -a["Accessibility/Utils/Announcer.js"],a["Accessibility/Components/AnnotationsA11y.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Accessibility/Utils/HTMLUtilities.js"]],function(a,f,l,m,n,g,h){function q(b){return b.replace(/<(h[1-7]|p|div|ul|ol|li)>/g,"<$1>").replace(/</(h[1-7]|p|div|ul|ol|li|a|button)>/g,"</$1>").replace(/<(div|a|button) id="([a-zA-Z\-0-9#]*?)">/g,'<$1 id="$2">')}var e=a.doc,d=f.extend,b=f.format,c=f.pick,k=n.getAnnotationsInfoHTML,t=g.unhideChartElementFromAT, -v=g.getChartTitle,w=g.getAxisDescription,p=h.addClass,u=h.setElAttrs,D=h.escapeStringForHTML,y=h.stripHTMLTagsFromString,z=h.getElement,x=h.visuallyHideElement;a.Chart.prototype.getTypeDescription=function(b){var a=b[0],c=this.series&&this.series[0]||{};c={numSeries:this.series.length,numPoints:c.points&&c.points.length,chart:this,mapTitle:c.mapTitle};if(!a)return this.langFormat("accessibility.chartTypes.emptyChart",c);if("map"===a)return c.mapTitle?this.langFormat("accessibility.chartTypes.mapTypeDescription", -c):this.langFormat("accessibility.chartTypes.unknownMap",c);if(1<this.types.length)return this.langFormat("accessibility.chartTypes.combinationChart",c);b=b[0];a=this.langFormat("accessibility.seriesTypeDescriptions."+b,c);var d=this.series&&2>this.series.length?"Single":"Multiple";return(this.langFormat("accessibility.chartTypes."+b+d,c)||this.langFormat("accessibility.chartTypes.default"+d,c))+(a?" "+a:"")};f=function(){};f.prototype=new l;d(f.prototype,{init:function(){var b=this.chart,a=this; -this.initRegionsDefinitions();this.addEvent(b,"afterGetTable",function(b){a.onDataTableCreated(b)});this.addEvent(b,"afterViewData",function(b){a.dataTableDiv=b;setTimeout(function(){a.focusDataTable()},300)});this.announcer=new m(b,"assertive")},initRegionsDefinitions:function(){var b=this;this.screenReaderSections={before:{element:null,buildContent:function(a){var c=a.options.accessibility.screenReaderSection.beforeChartFormatter;return c?c(a):b.defaultBeforeChartFormatter(a)},insertIntoDOM:function(b, -a){a.renderTo.insertBefore(b,a.renderTo.firstChild)},afterInserted:function(){"undefined"!==typeof b.sonifyButtonId&&b.initSonifyButton(b.sonifyButtonId);"undefined"!==typeof b.dataTableButtonId&&b.initDataTableButton(b.dataTableButtonId)}},after:{element:null,buildContent:function(a){var c=a.options.accessibility.screenReaderSection.afterChartFormatter;return c?c(a):b.defaultAfterChartFormatter()},insertIntoDOM:function(b,a){a.renderTo.insertBefore(b,a.container.nextSibling)}}}},onChartRender:function(){var b= -this;this.linkedDescriptionElement=this.getLinkedDescriptionElement();this.setLinkedDescriptionAttrs();Object.keys(this.screenReaderSections).forEach(function(a){b.updateScreenReaderSection(a)})},getLinkedDescriptionElement:function(){var a=this.chart.options.accessibility.linkedDescription;if(a){if("string"!==typeof a)return a;a=b(a,this.chart);a=e.querySelectorAll(a);if(1===a.length)return a[0]}},setLinkedDescriptionAttrs:function(){var b=this.linkedDescriptionElement;b&&(b.setAttribute("aria-hidden", -"true"),p(b,"highcharts-linked-description"))},updateScreenReaderSection:function(b){var a=this.chart,c=this.screenReaderSections[b],d=c.buildContent(a),e=c.element=c.element||this.createElement("div"),g=e.firstChild||this.createElement("div");this.setScreenReaderSectionAttribs(e,b);g.innerHTML=d;e.appendChild(g);c.insertIntoDOM(e,a);x(g);t(a,g);c.afterInserted&&c.afterInserted()},setScreenReaderSectionAttribs:function(b,a){var c=this.chart,d=c.langFormat("accessibility.screenReaderSection."+a+"RegionLabel", -{chart:c});u(b,{id:"highcharts-screen-reader-region-"+a+"-"+c.index,"aria-label":d});b.style.position="relative";"all"===c.options.accessibility.landmarkVerbosity&&d&&b.setAttribute("role","region")},defaultBeforeChartFormatter:function(){var b,c=this.chart,d=c.options.accessibility.screenReaderSection.beforeChartFormat,e=this.getAxesDescription(),g=c.sonify&&(null===(b=c.options.sonification)||void 0===b?void 0:b.enabled);b="highcharts-a11y-sonify-data-btn-"+c.index;var h="hc-linkto-highcharts-data-table-"+ -c.index,f=k(c),t=c.langFormat("accessibility.screenReaderSection.annotations.heading",{chart:c});e={chartTitle:v(c),typeDescription:this.getTypeDescriptionText(),chartSubtitle:this.getSubtitleText(),chartLongdesc:this.getLongdescText(),xAxisDescription:e.xAxis,yAxisDescription:e.yAxis,playAsSoundButton:g?this.getSonifyButtonText(b):"",viewTableButton:c.getCSV?this.getDataTableButtonText(h):"",annotationsTitle:f?t:"",annotationsList:f};c=a.i18nFormat(d,e,c);this.dataTableButtonId=h;this.sonifyButtonId= -b;return q(D(c)).replace(/<(\w+)[^>]*?>\s*<\/\1>/g,"")},defaultAfterChartFormatter:function(){var b=this.chart,c=b.options.accessibility.screenReaderSection.afterChartFormat,d={endOfChartMarker:this.getEndOfChartMarkerText()};b=a.i18nFormat(c,d,b);return q(D(b)).replace(/<(\w+)[^>]*?>\s*<\/\1>/g,"")},getLinkedDescription:function(){var b=this.linkedDescriptionElement;return y(b&&b.innerHTML||"")},getLongdescText:function(){var b=this.chart.options,a=b.caption;a=a&&a.text;var c=this.getLinkedDescription(); -return b.accessibility.description||c||a||""},getTypeDescriptionText:function(){var b=this.chart;return b.types?b.options.accessibility.typeDescription||b.getTypeDescription(b.types):""},getDataTableButtonText:function(b){var a=this.chart;a=a.langFormat("accessibility.table.viewAsDataTableButtonText",{chart:a,chartTitle:v(a)});return'<button id="'+b+'">'+a+"</button>"},getSonifyButtonText:function(b){var a,c=this.chart;if(!1===(null===(a=c.options.sonification)||void 0===a?void 0:a.enabled))return""; -a=c.langFormat("accessibility.sonification.playAsSoundButtonText",{chart:c,chartTitle:v(c)});return'<button id="'+b+'">'+a+"</button>"},getSubtitleText:function(){var b=this.chart.options.subtitle;return y(b&&b.text||"")},getEndOfChartMarkerText:function(){var b=this.chart,a=b.langFormat("accessibility.screenReaderSection.endOfChartMarker",{chart:b});return'<div id="highcharts-end-of-chart-marker-'+b.index+'">'+a+"</div>"},onDataTableCreated:function(b){var a=this.chart;a.options.accessibility.enabled&& -(this.viewDataTableButton&&this.viewDataTableButton.setAttribute("aria-expanded","true"),b.html=b.html.replace("<table ",'<table tabindex="-1" summary="'+a.langFormat("accessibility.table.tableSummary",{chart:a})+'"'))},focusDataTable:function(){var b=this.dataTableDiv;(b=b&&b.getElementsByTagName("table")[0])&&b.focus&&b.focus()},initSonifyButton:function(b){var a=this,c=this.sonifyButton=z(b),d=this.chart,e=function(b){null===c||void 0===c?void 0:c.setAttribute("aria-hidden","true");null===c||void 0=== -c?void 0:c.setAttribute("aria-label","");b.preventDefault();b.stopPropagation();b=d.langFormat("accessibility.sonification.playAsSoundClickAnnouncement",{chart:d});a.announcer.announce(b);setTimeout(function(){null===c||void 0===c?void 0:c.removeAttribute("aria-hidden");null===c||void 0===c?void 0:c.removeAttribute("aria-label");d.sonify&&d.sonify()},1E3)};c&&d&&(u(c,{tabindex:"-1"}),c.onclick=function(b){var a;((null===(a=d.options.accessibility)||void 0===a?void 0:a.screenReaderSection.onPlayAsSoundClick)|| -e).call(this,b,d)})},initDataTableButton:function(b){var a=this.viewDataTableButton=z(b),c=this.chart;b=b.replace("hc-linkto-","");a&&(u(a,{tabindex:"-1","aria-expanded":!!z(b)}),a.onclick=c.options.accessibility.screenReaderSection.onViewDataTableClick||function(){c.viewData()})},getAxesDescription:function(){var b=this.chart,a=function(a,d){a=b[a];return 1<a.length||a[0]&&c(a[0].options.accessibility&&a[0].options.accessibility.enabled,d)},d=!!b.types&&0>b.types.indexOf("map"),e=!!b.hasCartesianSeries, -g=a("xAxis",!b.angular&&e&&d);a=a("yAxis",e&&d);d={};g&&(d.xAxis=this.getAxisDescriptionText("xAxis"));a&&(d.yAxis=this.getAxisDescriptionText("yAxis"));return d},getAxisDescriptionText:function(b){var a=this,c=this.chart,d=c[b];return c.langFormat("accessibility.axis."+b+"Description"+(1<d.length?"Plural":"Singular"),{chart:c,names:d.map(function(b){return w(b)}),ranges:d.map(function(b){return a.getAxisRangeDescription(b)}),numAxes:d.length})},getAxisRangeDescription:function(b){var a=b.options|| -{};return a.accessibility&&"undefined"!==typeof a.accessibility.rangeDescription?a.accessibility.rangeDescription:b.categories?this.getCategoryAxisRangeDesc(b):!b.dateTime||0!==b.min&&0!==b.dataMin?this.getAxisFromToDescription(b):this.getAxisTimeLengthDesc(b)},getCategoryAxisRangeDesc:function(b){var a=this.chart;return b.dataMax&&b.dataMin?a.langFormat("accessibility.axis.rangeCategories",{chart:a,axis:b,numCategories:b.dataMax-b.dataMin+1}):""},getAxisTimeLengthDesc:function(b){var a=this.chart, -c={},d="Seconds";c.Seconds=((b.max||0)-(b.min||0))/1E3;c.Minutes=c.Seconds/60;c.Hours=c.Minutes/60;c.Days=c.Hours/24;["Minutes","Hours","Days"].forEach(function(b){2<c[b]&&(d=b)});var e=c[d].toFixed("Seconds"!==d&&"Minutes"!==d?1:0);return a.langFormat("accessibility.axis.timeRange"+d,{chart:a,axis:b,range:e.replace(".0","")})},getAxisFromToDescription:function(b){var a=this.chart,c=a.options.accessibility.screenReaderSection.axisRangeDateFormat,d=function(d){return b.dateTime?a.time.dateFormat(c, -b[d]):b[d]};return a.langFormat("accessibility.axis.rangeFromTo",{chart:a,axis:b,rangeFrom:d("min"),rangeTo:d("max")})},destroy:function(){var b;null===(b=this.announcer)||void 0===b?void 0:b.destroy()}});return f});p(a,"Accessibility/Components/ContainerComponent.js",[a["Accessibility/AccessibilityComponent.js"],a["Accessibility/Utils/ChartUtilities.js"],a["Core/Globals.js"],a["Accessibility/Utils/HTMLUtilities.js"],a["Core/Utilities.js"]],function(a,f,l,m,n){var g=f.unhideChartElementFromAT,h=f.getChartTitle, -q=l.doc,e=m.stripHTMLTagsFromString;f=n.extend;l=function(){};l.prototype=new a;f(l.prototype,{onChartUpdate:function(){this.handleSVGTitleElement();this.setSVGContainerLabel();this.setGraphicContainerAttrs();this.setRenderToAttrs();this.makeCreditsAccessible()},handleSVGTitleElement:function(){var a=this.chart,b="highcharts-title-"+a.index,c=e(a.langFormat("accessibility.svgContainerTitle",{chartTitle:h(a)}));if(c.length){var g=this.svgTitleElement=this.svgTitleElement||q.createElementNS("http://www.w3.org/2000/svg", -"title");g.textContent=c;g.id=b;a.renderTo.insertBefore(g,a.renderTo.firstChild)}},setSVGContainerLabel:function(){var a=this.chart,b=e(a.langFormat("accessibility.svgContainerLabel",{chartTitle:h(a)}));a.renderer.box&&b.length&&a.renderer.box.setAttribute("aria-label",b)},setGraphicContainerAttrs:function(){var a=this.chart,b=a.langFormat("accessibility.graphicContainerLabel",{chartTitle:h(a)});b.length&&a.container.setAttribute("aria-label",b)},setRenderToAttrs:function(){var a=this.chart;"disabled"!== -a.options.accessibility.landmarkVerbosity?a.renderTo.setAttribute("role","region"):a.renderTo.removeAttribute("role");a.renderTo.setAttribute("aria-label",a.langFormat("accessibility.chartContainerLabel",{title:h(a),chart:a}))},makeCreditsAccessible:function(){var a=this.chart,b=a.credits;b&&(b.textStr&&b.element.setAttribute("aria-label",e(a.langFormat("accessibility.credits",{creditsStr:b.textStr}))),g(a,b.element))},destroy:function(){this.chart.renderTo.setAttribute("aria-hidden",!0)}});return l}); -p(a,"Accessibility/HighContrastMode.js",[a["Core/Globals.js"]],function(a){var f=a.isMS,l=a.win,m=l.document;return{isHighContrastModeActive:function(){var a=/(Edg)/.test(l.navigator.userAgent);if(l.matchMedia&&a)return l.matchMedia("(-ms-high-contrast: active)").matches;if(f&&l.getComputedStyle){a=m.createElement("div");a.style.backgroundImage="url(data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)";m.body.appendChild(a);var g=(a.currentStyle||l.getComputedStyle(a)).backgroundImage; -m.body.removeChild(a);return"none"===g}return!1},setHighContrastTheme:function(a){a.highContrastModeActive=!0;var g=a.options.accessibility.highContrastTheme;a.update(g,!1);a.series.forEach(function(a){var f=g.plotOptions[a.type]||{};a.update({color:f.color||"windowText",colors:[f.color||"windowText"],borderColor:f.borderColor||"window"});a.points.forEach(function(a){a.options&&a.options.color&&a.update({color:f.color||"windowText",borderColor:f.borderColor||"window"},!1)})});a.redraw()}}});p(a,"Accessibility/HighContrastTheme.js", -[],function(){return{chart:{backgroundColor:"window"},title:{style:{color:"windowText"}},subtitle:{style:{color:"windowText"}},colorAxis:{minColor:"windowText",maxColor:"windowText",stops:[]},colors:["windowText"],xAxis:{gridLineColor:"windowText",labels:{style:{color:"windowText"}},lineColor:"windowText",minorGridLineColor:"windowText",tickColor:"windowText",title:{style:{color:"windowText"}}},yAxis:{gridLineColor:"windowText",labels:{style:{color:"windowText"}},lineColor:"windowText",minorGridLineColor:"windowText", -tickColor:"windowText",title:{style:{color:"windowText"}}},tooltip:{backgroundColor:"window",borderColor:"windowText",style:{color:"windowText"}},plotOptions:{series:{lineColor:"windowText",fillColor:"window",borderColor:"windowText",edgeColor:"windowText",borderWidth:1,dataLabels:{connectorColor:"windowText",color:"windowText",style:{color:"windowText",textOutline:"none"}},marker:{lineColor:"windowText",fillColor:"windowText"}},pie:{color:"window",colors:["window"],borderColor:"windowText",borderWidth:1}, -boxplot:{fillColor:"window"},candlestick:{lineColor:"windowText",fillColor:"window"},errorbar:{fillColor:"window"}},legend:{backgroundColor:"window",itemStyle:{color:"windowText"},itemHoverStyle:{color:"windowText"},itemHiddenStyle:{color:"#555"},title:{style:{color:"windowText"}}},credits:{style:{color:"windowText"}},labels:{style:{color:"windowText"}},drilldown:{activeAxisLabelStyle:{color:"windowText"},activeDataLabelStyle:{color:"windowText"}},navigation:{buttonOptions:{symbolStroke:"windowText", -theme:{fill:"window"}}},rangeSelector:{buttonTheme:{fill:"window",stroke:"windowText",style:{color:"windowText"},states:{hover:{fill:"window",stroke:"windowText",style:{color:"windowText"}},select:{fill:"#444",stroke:"windowText",style:{color:"windowText"}}}},inputBoxBorderColor:"windowText",inputStyle:{backgroundColor:"window",color:"windowText"},labelStyle:{color:"windowText"}},navigator:{handles:{backgroundColor:"window",borderColor:"windowText"},outlineColor:"windowText",maskFill:"transparent", -series:{color:"windowText",lineColor:"windowText"},xAxis:{gridLineColor:"windowText"}},scrollbar:{barBackgroundColor:"#444",barBorderColor:"windowText",buttonArrowColor:"windowText",buttonBackgroundColor:"window",buttonBorderColor:"windowText",rifleColor:"windowText",trackBackgroundColor:"window",trackBorderColor:"windowText"}}});p(a,"Accessibility/Options/Options.js",[],function(){return{accessibility:{enabled:!0,screenReaderSection:{beforeChartFormat:"<h5>{chartTitle}</h5><div>{typeDescription}</div><div>{chartSubtitle}</div><div>{chartLongdesc}</div><div>{playAsSoundButton}</div><div>{viewTableButton}</div><div>{xAxisDescription}</div><div>{yAxisDescription}</div><div>{annotationsTitle}{annotationsList}</div>", -afterChartFormat:"{endOfChartMarker}",axisRangeDateFormat:"%Y-%m-%d %H:%M:%S"},series:{describeSingleSeries:!1,pointDescriptionEnabledThreshold:200},point:{valueDescriptionFormat:"{index}. {xDescription}{separator}{value}."},landmarkVerbosity:"all",linkedDescription:'*[data-highcharts-chart="{index}"] + .highcharts-description',keyboardNavigation:{enabled:!0,focusBorder:{enabled:!0,hideBrowserFocusOutline:!0,style:{color:"#335cad",lineWidth:2,borderRadius:3},margin:2},order:["series","zoom","rangeSelector", -"legend","chartMenu"],wrapAround:!0,seriesNavigation:{skipNullPoints:!0,pointNavigationEnabledThreshold:!1}},announceNewData:{enabled:!1,minAnnounceInterval:5E3,interruptUser:!1}},legend:{accessibility:{enabled:!0,keyboardNavigation:{enabled:!0}}},exporting:{accessibility:{enabled:!0}}}});p(a,"Accessibility/Options/LangOptions.js",[],function(){return{accessibility:{defaultChartTitle:"Chart",chartContainerLabel:"{title}. Highcharts interactive chart.",svgContainerLabel:"Interactive chart",drillUpButton:"{buttonText}", -credits:"Chart credits: {creditsStr}",thousandsSep:",",svgContainerTitle:"",graphicContainerLabel:"",screenReaderSection:{beforeRegionLabel:"Chart screen reader information.",afterRegionLabel:"",annotations:{heading:"Chart annotations summary",descriptionSinglePoint:"{annotationText}. Related to {annotationPoint}",descriptionMultiplePoints:"{annotationText}. Related to {annotationPoint}{ Also related to, #each(additionalAnnotationPoints)}",descriptionNoPoints:"{annotationText}"},endOfChartMarker:"End of interactive chart."}, -sonification:{playAsSoundButtonText:"Play as sound, {chartTitle}",playAsSoundClickAnnouncement:"Play"},legend:{legendLabel:"Toggle series visibility",legendItem:"Hide {itemName}"},zoom:{mapZoomIn:"Zoom chart",mapZoomOut:"Zoom out chart",resetZoomButton:"Reset zoom"},rangeSelector:{minInputLabel:"Select start date.",maxInputLabel:"Select end date.",buttonText:"Select range {buttonText}"},table:{viewAsDataTableButtonText:"View as data table, {chartTitle}",tableSummary:"Table representation of chart."}, -announceNewData:{newDataAnnounce:"Updated data for chart {chartTitle}",newSeriesAnnounceSingle:"New data series: {seriesDesc}",newPointAnnounceSingle:"New data point: {pointDesc}",newSeriesAnnounceMultiple:"New data series in chart {chartTitle}: {seriesDesc}",newPointAnnounceMultiple:"New data point in chart {chartTitle}: {pointDesc}"},seriesTypeDescriptions:{boxplot:"Box plot charts are typically used to display groups of statistical data. Each data point in the chart can have up to 5 values: minimum, lower quartile, median, upper quartile, and maximum.", -arearange:"Arearange charts are line charts displaying a range between a lower and higher value for each point.",areasplinerange:"These charts are line charts displaying a range between a lower and higher value for each point.",bubble:"Bubble charts are scatter charts where each data point also has a size value.",columnrange:"Columnrange charts are column charts displaying a range between a lower and higher value for each point.",errorbar:"Errorbar series are used to display the variability of the data.", -funnel:"Funnel charts are used to display reduction of data in stages.",pyramid:"Pyramid charts consist of a single pyramid with item heights corresponding to each point value.",waterfall:"A waterfall chart is a column chart where each column contributes towards a total end value."},chartTypes:{emptyChart:"Empty chart",mapTypeDescription:"Map of {mapTitle} with {numSeries} data series.",unknownMap:"Map of unspecified region with {numSeries} data series.",combinationChart:"Combination chart with {numSeries} data series.", -defaultSingle:"Chart with {numPoints} data {#plural(numPoints, points, point)}.",defaultMultiple:"Chart with {numSeries} data series.",splineSingle:"Line chart with {numPoints} data {#plural(numPoints, points, point)}.",splineMultiple:"Line chart with {numSeries} lines.",lineSingle:"Line chart with {numPoints} data {#plural(numPoints, points, point)}.",lineMultiple:"Line chart with {numSeries} lines.",columnSingle:"Bar chart with {numPoints} {#plural(numPoints, bars, bar)}.",columnMultiple:"Bar chart with {numSeries} data series.", -barSingle:"Bar chart with {numPoints} {#plural(numPoints, bars, bar)}.",barMultiple:"Bar chart with {numSeries} data series.",pieSingle:"Pie chart with {numPoints} {#plural(numPoints, slices, slice)}.",pieMultiple:"Pie chart with {numSeries} pies.",scatterSingle:"Scatter chart with {numPoints} {#plural(numPoints, points, point)}.",scatterMultiple:"Scatter chart with {numSeries} data series.",boxplotSingle:"Boxplot with {numPoints} {#plural(numPoints, boxes, box)}.",boxplotMultiple:"Boxplot with {numSeries} data series.", -bubbleSingle:"Bubble chart with {numPoints} {#plural(numPoints, bubbles, bubble)}.",bubbleMultiple:"Bubble chart with {numSeries} data series."},axis:{xAxisDescriptionSingular:"The chart has 1 X axis displaying {names[0]}. {ranges[0]}",xAxisDescriptionPlural:"The chart has {numAxes} X axes displaying {#each(names, -1) }and {names[-1]}.",yAxisDescriptionSingular:"The chart has 1 Y axis displaying {names[0]}. {ranges[0]}",yAxisDescriptionPlural:"The chart has {numAxes} Y axes displaying {#each(names, -1) }and {names[-1]}.", -timeRangeDays:"Range: {range} days.",timeRangeHours:"Range: {range} hours.",timeRangeMinutes:"Range: {range} minutes.",timeRangeSeconds:"Range: {range} seconds.",rangeFromTo:"Range: {rangeFrom} to {rangeTo}.",rangeCategories:"Range: {numCategories} categories."},exporting:{chartMenuLabel:"Chart menu",menuButtonLabel:"View chart menu",exportRegionLabel:"Chart menu"},series:{summary:{"default":"{name}, series {ix} of {numSeries} with {numPoints} data {#plural(numPoints, points, point)}.",defaultCombination:"{name}, series {ix} of {numSeries} with {numPoints} data {#plural(numPoints, points, point)}.", -line:"{name}, line {ix} of {numSeries} with {numPoints} data {#plural(numPoints, points, point)}.",lineCombination:"{name}, series {ix} of {numSeries}. Line with {numPoints} data {#plural(numPoints, points, point)}.",spline:"{name}, line {ix} of {numSeries} with {numPoints} data {#plural(numPoints, points, point)}.",splineCombination:"{name}, series {ix} of {numSeries}. Line with {numPoints} data {#plural(numPoints, points, point)}.",column:"{name}, bar series {ix} of {numSeries} with {numPoints} {#plural(numPoints, bars, bar)}.", -columnCombination:"{name}, series {ix} of {numSeries}. Bar series with {numPoints} {#plural(numPoints, bars, bar)}.",bar:"{name}, bar series {ix} of {numSeries} with {numPoints} {#plural(numPoints, bars, bar)}.",barCombination:"{name}, series {ix} of {numSeries}. Bar series with {numPoints} {#plural(numPoints, bars, bar)}.",pie:"{name}, pie {ix} of {numSeries} with {numPoints} {#plural(numPoints, slices, slice)}.",pieCombination:"{name}, series {ix} of {numSeries}. Pie with {numPoints} {#plural(numPoints, slices, slice)}.", -scatter:"{name}, scatter plot {ix} of {numSeries} with {numPoints} {#plural(numPoints, points, point)}.",scatterCombination:"{name}, series {ix} of {numSeries}, scatter plot with {numPoints} {#plural(numPoints, points, point)}.",boxplot:"{name}, boxplot {ix} of {numSeries} with {numPoints} {#plural(numPoints, boxes, box)}.",boxplotCombination:"{name}, series {ix} of {numSeries}. Boxplot with {numPoints} {#plural(numPoints, boxes, box)}.",bubble:"{name}, bubble series {ix} of {numSeries} with {numPoints} {#plural(numPoints, bubbles, bubble)}.", -bubbleCombination:"{name}, series {ix} of {numSeries}. Bubble series with {numPoints} {#plural(numPoints, bubbles, bubble)}.",map:"{name}, map {ix} of {numSeries} with {numPoints} {#plural(numPoints, areas, area)}.",mapCombination:"{name}, series {ix} of {numSeries}. Map with {numPoints} {#plural(numPoints, areas, area)}.",mapline:"{name}, line {ix} of {numSeries} with {numPoints} data {#plural(numPoints, points, point)}.",maplineCombination:"{name}, series {ix} of {numSeries}. Line with {numPoints} data {#plural(numPoints, points, point)}.", -mapbubble:"{name}, bubble series {ix} of {numSeries} with {numPoints} {#plural(numPoints, bubbles, bubble)}.",mapbubbleCombination:"{name}, series {ix} of {numSeries}. Bubble series with {numPoints} {#plural(numPoints, bubbles, bubble)}."},description:"{description}",xAxisDescription:"X axis, {name}",yAxisDescription:"Y axis, {name}",nullPointValue:"No value",pointAnnotationsDescription:"{Annotation: #each(annotations). }"}}}});p(a,"Accessibility/Options/DeprecatedOptions.js",[a["Core/Utilities.js"]], -function(a){function f(a,d,b){for(var c,e=0;e<d.length-1;++e)c=d[e],a=a[c]=q(a[c],{});a[d[d.length-1]]=b}function l(a,d,b,c){function e(b,a){return a.reduce(function(b,a){return b[a]},b)}var g=e(a.options,d),l=e(a.options,b);Object.keys(c).forEach(function(e){var k,t=g[e];"undefined"!==typeof t&&(f(l,c[e],t),h(32,!1,a,(k={},k[d.join(".")+"."+e]=b.join(".")+"."+c[e].join("."),k)))})}function m(a){var d=a.options.chart||{},b=a.options.accessibility||{};["description","typeDescription"].forEach(function(c){var e; -d[c]&&(b[c]=d[c],h(32,!1,a,(e={},e["chart."+c]="use accessibility."+c,e)))})}function n(a){a.axes.forEach(function(d){(d=d.options)&&d.description&&(d.accessibility=d.accessibility||{},d.accessibility.description=d.description,h(32,!1,a,{"axis.description":"use axis.accessibility.description"}))})}function g(a){var d={description:["accessibility","description"],exposeElementToA11y:["accessibility","exposeAsGroupOnly"],pointDescriptionFormatter:["accessibility","pointDescriptionFormatter"],skipKeyboardNavigation:["accessibility", -"keyboardNavigation","enabled"]};a.series.forEach(function(b){Object.keys(d).forEach(function(c){var e,g=b.options[c];"undefined"!==typeof g&&(f(b.options,d[c],"skipKeyboardNavigation"===c?!g:g),h(32,!1,a,(e={},e["series."+c]="series."+d[c].join("."),e)))})})}var h=a.error,q=a.pick;return function(a){m(a);n(a);a.series&&g(a);l(a,["accessibility"],["accessibility"],{pointDateFormat:["point","dateFormat"],pointDateFormatter:["point","dateFormatter"],pointDescriptionFormatter:["point","descriptionFormatter"], -pointDescriptionThreshold:["series","pointDescriptionEnabledThreshold"],pointNavigationThreshold:["keyboardNavigation","seriesNavigation","pointNavigationEnabledThreshold"],pointValueDecimals:["point","valueDecimals"],pointValuePrefix:["point","valuePrefix"],pointValueSuffix:["point","valueSuffix"],screenReaderSectionFormatter:["screenReaderSection","beforeChartFormatter"],describeSingleSeries:["series","describeSingleSeries"],seriesDescriptionFormatter:["series","descriptionFormatter"],onTableAnchorClick:["screenReaderSection", -"onViewDataTableClick"],axisRangeDateFormat:["screenReaderSection","axisRangeDateFormat"]});l(a,["accessibility","keyboardNavigation"],["accessibility","keyboardNavigation","seriesNavigation"],{skipNullPoints:["skipNullPoints"],mode:["mode"]});l(a,["lang","accessibility"],["lang","accessibility"],{legendItem:["legend","legendItem"],legendLabel:["legend","legendLabel"],mapZoomIn:["zoom","mapZoomIn"],mapZoomOut:["zoom","mapZoomOut"],resetZoomButton:["zoom","resetZoomButton"],screenReaderRegionLabel:["screenReaderSection", -"beforeRegionLabel"],rangeSelectorButton:["rangeSelector","buttonText"],rangeSelectorMaxInput:["rangeSelector","maxInputLabel"],rangeSelectorMinInput:["rangeSelector","minInputLabel"],svgContainerEnd:["screenReaderSection","endOfChartMarker"],viewAsDataTable:["table","viewAsDataTableButtonText"],tableSummary:["table","tableSummary"]})}});p(a,"Accessibility/A11yI18n.js",[a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,f){function l(a,f){var g=a.indexOf("#each("),e=a.indexOf("#plural("),d=a.indexOf("["), -b=a.indexOf("]");if(-1<g){d=a.slice(g).indexOf(")")+g;var c=a.substring(0,g);e=a.substring(d+1);d=a.substring(g+6,d).split(",");g=Number(d[1]);a="";if(f=f[d[0]])for(g=isNaN(g)?f.length:g,g=0>g?f.length+g:Math.min(g,f.length),d=0;d<g;++d)a+=c+f[d]+e;return a.length?a:""}if(-1<e){c=a.slice(e).indexOf(")")+e;a=a.substring(e+8,c).split(",");switch(Number(f[a[0]])){case 0:a=n(a[4],a[1]);break;case 1:a=n(a[2],a[1]);break;case 2:a=n(a[3],a[1]);break;default:a=a[1]}a?(f=a,f=f.trim&&f.trim()||f.replace(/^\s+|\s+$/g, -"")):f="";return f}return-1<d?(e=a.substring(0,d),a=Number(a.substring(d+1,b)),f=f[e],!isNaN(a)&&f&&(0>a?(c=f[f.length+a],"undefined"===typeof c&&(c=f[0])):(c=f[a],"undefined"===typeof c&&(c=f[f.length-1]))),"undefined"!==typeof c?c:""):"{"+a+"}"}var m=f.format,n=f.pick;a.i18nFormat=function(a,f,n){var e=function(a,b){a=a.slice(b||0);var c=a.indexOf("{"),d=a.indexOf("}");if(-1<c&&d>c)return{statement:a.substring(c+1,d),begin:b+c+1,end:b+d}},d=[],b=0;do{var c=e(a,b);var g=a.substring(b,c&&c.begin- -1);g.length&&d.push({value:g,type:"constant"});c&&d.push({value:c.statement,type:"statement"});b=c?c.end+1:b+1}while(c);d.forEach(function(a){"statement"===a.type&&(a.value=l(a.value,f))});return m(d.reduce(function(a,b){return a+b.value},""),f,n)};a.Chart.prototype.langFormat=function(f,h){f=f.split(".");for(var g=this.options.lang,e=0;e<f.length;++e)g=g&&g[f[e]];return"string"===typeof g?a.i18nFormat(g,h,this):""}});p(a,"Accessibility/FocusBorder.js",[a["Core/Globals.js"],a["Core/Renderer/SVG/SVGElement.js"], -a["Core/Renderer/SVG/SVGLabel.js"],a["Core/Utilities.js"]],function(a,f,l,m){function n(a){if(!a.focusBorderDestroyHook){var b=a.destroy;a.destroy=function(){var c,d;null===(d=null===(c=a.focusBorder)||void 0===c?void 0:c.destroy)||void 0===d?void 0:d.call(c);return b.apply(a,arguments)};a.focusBorderDestroyHook=b}}function g(a){for(var c=[],d=1;d<arguments.length;d++)c[d-1]=arguments[d];a.focusBorderUpdateHooks||(a.focusBorderUpdateHooks={},b.forEach(function(b){b+="Setter";var d=a[b]||a._defaultSetter; -a.focusBorderUpdateHooks[b]=d;a[b]=function(){var b=d.apply(a,arguments);a.addFocusBorder.apply(a,c);return b}}))}function h(a){a.focusBorderUpdateHooks&&(Object.keys(a.focusBorderUpdateHooks).forEach(function(b){var c=a.focusBorderUpdateHooks[b];c===a._defaultSetter?delete a[b]:a[b]=c}),delete a.focusBorderUpdateHooks)}var q=m.addEvent,e=m.extend,d=m.pick,b="x y transform width height r d stroke-width".split(" ");e(f.prototype,{addFocusBorder:function(b,e){this.focusBorder&&this.removeFocusBorder(); -var c=this.getBBox(),f=d(b,3);c.x+=this.translateX?this.translateX:0;c.y+=this.translateY?this.translateY:0;var h=c.x-f,k=c.y-f,m=c.width+2*f,q=c.height+2*f,p=this instanceof l;if("text"===this.element.nodeName||p){var u=!!this.rotation;if(p)var x={x:u?1:0,y:0};else h=x=0,"middle"===this.attr("text-anchor")?(x=a.isFirefox&&this.rotation?.25:.5,h=a.isFirefox&&!this.rotation?.75:.5):this.rotation?x=.25:h=.75,x={x:x,y:h};h=+this.attr("x")-c.width*x.x-f;k=+this.attr("y")-c.height*x.y-f;p&&u&&(p=m,m=q, -q=p,h=+this.attr("x")-c.height*x.x-f,k=+this.attr("y")-c.width*x.y-f)}this.focusBorder=this.renderer.rect(h,k,m,q,parseInt((e&&e.borderRadius||0).toString(),10)).addClass("highcharts-focus-border").attr({zIndex:99}).add(this.parentGroup);this.renderer.styledMode||this.focusBorder.attr({stroke:e&&e.stroke,"stroke-width":e&&e.strokeWidth});g(this,b,e);n(this)},removeFocusBorder:function(){h(this);this.focusBorderDestroyHook&&(this.destroy=this.focusBorderDestroyHook,delete this.focusBorderDestroyHook); -this.focusBorder&&(this.focusBorder.destroy(),delete this.focusBorder)}});a.Chart.prototype.renderFocusBorder=function(){var a=this.focusElement,b=this.options.accessibility.keyboardNavigation.focusBorder;a&&(a.removeFocusBorder(),b.enabled&&a.addFocusBorder(b.margin,{stroke:b.style.color,strokeWidth:b.style.lineWidth,borderRadius:b.style.borderRadius}))};a.Chart.prototype.setFocusToElement=function(a,b){var c=this.options.accessibility.keyboardNavigation.focusBorder;(b=b||a.element)&&b.focus&&(b.hcEvents&& -b.hcEvents.focusin||q(b,"focusin",function(){}),b.focus(),c.hideBrowserFocusOutline&&(b.style.outline="none"));this.focusElement&&this.focusElement.removeFocusBorder();this.focusElement=a;this.renderFocusBorder()}});p(a,"Accessibility/Accessibility.js",[a["Accessibility/Utils/ChartUtilities.js"],a["Core/Globals.js"],a["Accessibility/KeyboardNavigationHandler.js"],a["Core/Series/CartesianSeries.js"],a["Core/Options.js"],a["Core/Series/Point.js"],a["Core/Utilities.js"],a["Accessibility/AccessibilityComponent.js"], -a["Accessibility/KeyboardNavigation.js"],a["Accessibility/Components/LegendComponent.js"],a["Accessibility/Components/MenuComponent.js"],a["Accessibility/Components/SeriesComponent/SeriesComponent.js"],a["Accessibility/Components/ZoomComponent.js"],a["Accessibility/Components/RangeSelectorComponent.js"],a["Accessibility/Components/InfoRegionsComponent.js"],a["Accessibility/Components/ContainerComponent.js"],a["Accessibility/HighContrastMode.js"],a["Accessibility/HighContrastTheme.js"],a["Accessibility/Options/Options.js"], -a["Accessibility/Options/LangOptions.js"],a["Accessibility/Options/DeprecatedOptions.js"]],function(a,f,l,m,n,g,h,p,e,d,b,c,k,t,v,w,H,A,D,y,z){function q(a){this.init(a)}var r=f.doc,u=h.addEvent,F=h.extend,B=h.fireEvent,E=h.merge;E(!0,n.defaultOptions,D,{accessibility:{highContrastTheme:A},lang:y});f.A11yChartUtilities=a;f.KeyboardNavigationHandler=l;f.AccessibilityComponent=p;q.prototype={init:function(a){this.chart=a;r.addEventListener&&a.renderer.isSVG?(z(a),this.initComponents(),this.keyboardNavigation= -new e(a,this.components),this.update()):a.renderTo.setAttribute("aria-hidden",!0)},initComponents:function(){var a=this.chart,e=a.options.accessibility;this.components={container:new w,infoRegions:new v,legend:new d,chartMenu:new b,rangeSelector:new t,series:new c,zoom:new k};e.customComponents&&F(this.components,e.customComponents);var f=this.components;this.getComponentOrder().forEach(function(b){f[b].initBase(a);f[b].init()})},getComponentOrder:function(){if(!this.components)return[];if(!this.components.series)return Object.keys(this.components); -var a=Object.keys(this.components).filter(function(a){return"series"!==a});return["series"].concat(a)},update:function(){var a=this.components,b=this.chart,c=b.options.accessibility;B(b,"beforeA11yUpdate");b.types=this.getChartTypes();this.getComponentOrder().forEach(function(c){a[c].onChartUpdate();B(b,"afterA11yComponentUpdate",{name:c,component:a[c]})});this.keyboardNavigation.update(c.keyboardNavigation.order);!b.highContrastModeActive&&H.isHighContrastModeActive()&&H.setHighContrastTheme(b); -B(b,"afterA11yUpdate",{accessibility:this})},destroy:function(){var a=this.chart||{},b=this.components;Object.keys(b).forEach(function(a){b[a].destroy();b[a].destroyBase()});this.keyboardNavigation&&this.keyboardNavigation.destroy();a.renderTo&&a.renderTo.setAttribute("aria-hidden",!0);a.focusElement&&a.focusElement.removeFocusBorder()},getChartTypes:function(){var a={};this.chart.series.forEach(function(b){a[b.type]=1});return Object.keys(a)}};f.Chart.prototype.updateA11yEnabled=function(){var a= -this.accessibility,b=this.options.accessibility;b&&b.enabled?a?a.update():this.accessibility=new q(this):a?(a.destroy&&a.destroy(),delete this.accessibility):this.renderTo.setAttribute("aria-hidden",!0)};u(f.Chart,"render",function(a){this.a11yDirty&&this.renderTo&&(delete this.a11yDirty,this.updateA11yEnabled());var b=this.accessibility;b&&b.getComponentOrder().forEach(function(a){b.components[a].onChartRender()})});u(f.Chart,"update",function(a){if(a=a.options.accessibility)a.customComponents&& -(this.options.accessibility.customComponents=a.customComponents,delete a.customComponents),E(!0,this.options.accessibility,a),this.accessibility&&this.accessibility.destroy&&(this.accessibility.destroy(),delete this.accessibility);this.a11yDirty=!0});u(g,"update",function(){this.series.chart.accessibility&&(this.series.chart.a11yDirty=!0)});["addSeries","init"].forEach(function(a){u(f.Chart,a,function(){this.a11yDirty=!0})});["update","updatedData","remove"].forEach(function(a){u(m,a,function(){this.chart.accessibility&& -(this.chart.a11yDirty=!0)})});["afterDrilldown","drillupall"].forEach(function(a){u(f.Chart,a,function(){this.accessibility&&this.accessibility.update()})});u(f.Chart,"destroy",function(){this.accessibility&&this.accessibility.destroy()})});p(a,"masters/modules/accessibility.src.js",[],function(){})}); -//# sourceMappingURL=accessibility.js.map \ No newline at end of file +(function (a) { + "object" === typeof module && module.exports + ? ((a["default"] = a), (module.exports = a)) + : "function" === typeof define && define.amd + ? define("highcharts/modules/accessibility", ["highcharts"], function (p) { + a(p); + a.Highcharts = p; + return a; + }) + : a("undefined" !== typeof Highcharts ? Highcharts : void 0); +})(function (a) { + function p(a, f, l, m) { + a.hasOwnProperty(f) || (a[f] = m.apply(null, l)); + } + a = a ? a._modules : {}; + p( + a, + "Accessibility/Utils/HTMLUtilities.js", + [a["Core/Globals.js"], a["Core/Utilities.js"]], + function (a, f) { + function u(a) { + return a + .replace(/&/g, "&") + .replace(/</g, "<") + .replace(/>/g, ">") + .replace(/"/g, """) + .replace(/'/g, "'") + .replace(/\//g, "/"); + } + var m = a.doc, + n = a.win, + g = f.merge; + return { + addClass: function (a, g) { + a.classList + ? a.classList.add(g) + : 0 > a.className.indexOf(g) && (a.className += g); + }, + escapeStringForHTML: u, + getElement: function (a) { + return m.getElementById(a); + }, + getFakeMouseEvent: function (a) { + if ("function" === typeof n.MouseEvent) return new n.MouseEvent(a); + if (m.createEvent) { + var g = m.createEvent("MouseEvent"); + if (g.initMouseEvent) + return ( + g.initMouseEvent( + a, + !0, + !0, + n, + "click" === a ? 1 : 0, + 0, + 0, + 0, + 0, + !1, + !1, + !1, + !1, + 0, + null + ), + g + ); + } + return { type: a }; + }, + removeElement: function (a) { + a && a.parentNode && a.parentNode.removeChild(a); + }, + reverseChildNodes: function (a) { + for (var g = a.childNodes.length; g--; ) + a.appendChild(a.childNodes[g]); + }, + setElAttrs: function (a, g) { + Object.keys(g).forEach(function (e) { + var d = g[e]; + null === d + ? a.removeAttribute(e) + : ((d = u("" + d)), a.setAttribute(e, d)); + }); + }, + stripHTMLTagsFromString: function (a) { + return "string" === typeof a ? a.replace(/<\/?[^>]+(>|$)/g, "") : a; + }, + visuallyHideElement: function (a) { + g(!0, a.style, { + position: "absolute", + width: "1px", + height: "1px", + overflow: "hidden", + whiteSpace: "nowrap", + clip: "rect(1px, 1px, 1px, 1px)", + marginTop: "-3px", + "-ms-filter": "progid:DXImageTransform.Microsoft.Alpha(Opacity=1)", + filter: "alpha(opacity=1)", + opacity: "0.01", + }); + }, + }; + } + ); + p( + a, + "Accessibility/Utils/ChartUtilities.js", + [a["Accessibility/Utils/HTMLUtilities.js"], a["Core/Utilities.js"]], + function (a, f) { + function u(d) { + var b, c; + if (null === (b = d.points) || void 0 === b ? 0 : b.length) + return ( + (d = q(d.points, function (c) { + return !!c.graphic; + })), + null === (c = null === d || void 0 === d ? void 0 : d.graphic) || + void 0 === c + ? void 0 + : c.element + ); + } + function m(d) { + var b = u(d); + return ( + (b && b.parentNode) || + (d.graph && d.graph.element) || + (d.group && d.group.element) + ); + } + function n(d, b) { + b.setAttribute("aria-hidden", !1); + b !== d.renderTo && + b.parentNode && + (Array.prototype.forEach.call(b.parentNode.childNodes, function (c) { + c.hasAttribute("aria-hidden") || c.setAttribute("aria-hidden", !0); + }), + n(d, b.parentNode)); + } + var g = a.stripHTMLTagsFromString, + h = f.defined, + q = f.find, + e = f.fireEvent; + return { + getChartTitle: function (d) { + return g( + d.options.title.text || + d.langFormat("accessibility.defaultChartTitle", { chart: d }) + ); + }, + getAxisDescription: function (d) { + return g( + d && + ((d.userOptions && + d.userOptions.accessibility && + d.userOptions.accessibility.description) || + (d.axisTitle && d.axisTitle.textStr) || + d.options.id || + (d.categories && "categories") || + (d.dateTime && "Time") || + "values") + ); + }, + getPointFromXY: function (d, b, c) { + for (var k = d.length, t; k--; ) + if ( + (t = q(d[k].points || [], function (v) { + return v.x === b && v.y === c; + })) + ) + return t; + }, + getSeriesFirstPointElement: u, + getSeriesFromName: function (d, b) { + return b + ? (d.series || []).filter(function (c) { + return c.name === b; + }) + : d.series; + }, + getSeriesA11yElement: m, + unhideChartElementFromAT: n, + hideSeriesFromAT: function (d) { + (d = m(d)) && d.setAttribute("aria-hidden", !0); + }, + scrollToPoint: function (d) { + var b = d.series.xAxis, + c = d.series.yAxis, + k = (null === b || void 0 === b ? 0 : b.scrollbar) ? b : c; + if ( + (b = null === k || void 0 === k ? void 0 : k.scrollbar) && + h(b.to) && + h(b.from) + ) { + c = b.to - b.from; + if (h(k.dataMin) && h(k.dataMax)) { + var t = k.toPixels(k.dataMin), + v = k.toPixels(k.dataMax); + d = + (k.toPixels(d["xAxis" === k.coll ? "x" : "y"] || 0) - t) / + (v - t); + } else d = 0; + b.updatePosition(d - c / 2, d + c / 2); + e(b, "changed", { + from: b.from, + to: b.to, + trigger: "scrollbar", + DOMEvent: null, + }); + } + }, + }; + } + ); + p( + a, + "Accessibility/KeyboardNavigationHandler.js", + [a["Core/Utilities.js"]], + function (a) { + function f(a, f) { + this.chart = a; + this.keyCodeMap = f.keyCodeMap || []; + this.validate = f.validate; + this.init = f.init; + this.terminate = f.terminate; + this.response = { success: 1, prev: 2, next: 3, noHandler: 4, fail: 5 }; + } + var u = a.find; + f.prototype = { + run: function (a) { + var f = a.which || a.keyCode, + g = this.response.noHandler, + h = u(this.keyCodeMap, function (a) { + return -1 < a[0].indexOf(f); + }); + h + ? (g = h[1].call(this, f, a)) + : 9 === f && (g = this.response[a.shiftKey ? "prev" : "next"]); + return g; + }, + }; + return f; + } + ); + p( + a, + "Accessibility/Utils/DOMElementProvider.js", + [ + a["Core/Globals.js"], + a["Accessibility/Utils/HTMLUtilities.js"], + a["Core/Utilities.js"], + ], + function (a, f, l) { + var u = a.doc, + n = f.removeElement; + a = l.extend; + f = function () { + this.elements = []; + }; + a(f.prototype, { + createElement: function () { + var a = u.createElement.apply(u, arguments); + this.elements.push(a); + return a; + }, + destroyCreatedElements: function () { + this.elements.forEach(function (a) { + n(a); + }); + this.elements = []; + }, + }); + return f; + } + ); + p( + a, + "Accessibility/Utils/EventProvider.js", + [a["Core/Globals.js"], a["Core/Utilities.js"]], + function (a, f) { + var u = f.addEvent; + f = f.extend; + var m = function () { + this.eventRemovers = []; + }; + f(m.prototype, { + addEvent: function () { + var f = u.apply(a, arguments); + this.eventRemovers.push(f); + return f; + }, + removeAddedEvents: function () { + this.eventRemovers.forEach(function (a) { + a(); + }); + this.eventRemovers = []; + }, + }); + return m; + } + ); + p( + a, + "Accessibility/AccessibilityComponent.js", + [ + a["Accessibility/Utils/ChartUtilities.js"], + a["Accessibility/Utils/DOMElementProvider.js"], + a["Accessibility/Utils/EventProvider.js"], + a["Core/Globals.js"], + a["Accessibility/Utils/HTMLUtilities.js"], + a["Core/Utilities.js"], + ], + function (a, f, l, m, n, g) { + function h() {} + var q = a.unhideChartElementFromAT, + e = m.doc, + d = m.win, + b = n.removeElement, + c = n.getFakeMouseEvent; + a = g.extend; + var k = g.fireEvent, + t = g.merge; + h.prototype = { + initBase: function (c) { + this.chart = c; + this.eventProvider = new l(); + this.domElementProvider = new f(); + this.keyCodes = { + left: 37, + right: 39, + up: 38, + down: 40, + enter: 13, + space: 32, + esc: 27, + tab: 9, + }; + }, + addEvent: function () { + return this.eventProvider.addEvent.apply( + this.eventProvider, + arguments + ); + }, + createElement: function () { + return this.domElementProvider.createElement.apply( + this.domElementProvider, + arguments + ); + }, + fireEventOnWrappedOrUnwrappedElement: function (c, b) { + var v = b.type; + e.createEvent && (c.dispatchEvent || c.fireEvent) + ? c.dispatchEvent + ? c.dispatchEvent(b) + : c.fireEvent(v, b) + : k(c, v, b); + }, + fakeClickEvent: function (b) { + if (b) { + var v = c("click"); + this.fireEventOnWrappedOrUnwrappedElement(b, v); + } + }, + addProxyGroup: function (c) { + this.createOrUpdateProxyContainer(); + var b = this.createElement("div"); + Object.keys(c || {}).forEach(function (v) { + null !== c[v] && b.setAttribute(v, c[v]); + }); + this.chart.a11yProxyContainer.appendChild(b); + return b; + }, + createOrUpdateProxyContainer: function () { + var c = this.chart, + b = c.renderer.box; + c.a11yProxyContainer = + c.a11yProxyContainer || this.createProxyContainerElement(); + b.nextSibling !== c.a11yProxyContainer && + c.container.insertBefore(c.a11yProxyContainer, b.nextSibling); + }, + createProxyContainerElement: function () { + var c = e.createElement("div"); + c.className = "highcharts-a11y-proxy-container"; + return c; + }, + createProxyButton: function (c, b, a, d, k) { + var v = c.element, + e = this.createElement("button"), + w = t({ "aria-label": v.getAttribute("aria-label") }, a); + Object.keys(w).forEach(function (c) { + null !== w[c] && e.setAttribute(c, w[c]); + }); + e.className = "highcharts-a11y-proxy-button"; + k && this.addEvent(e, "click", k); + this.setProxyButtonStyle(e); + this.updateProxyButtonPosition(e, d || c); + this.proxyMouseEventsForButton(v, e); + b.appendChild(e); + w["aria-hidden"] || q(this.chart, e); + return e; + }, + getElementPosition: function (c) { + var b = c.element; + return (c = this.chart.renderTo) && b && b.getBoundingClientRect + ? ((b = b.getBoundingClientRect()), + (c = c.getBoundingClientRect()), + { + x: b.left - c.left, + y: b.top - c.top, + width: b.right - b.left, + height: b.bottom - b.top, + }) + : { x: 0, y: 0, width: 1, height: 1 }; + }, + setProxyButtonStyle: function (c) { + t(!0, c.style, { + "border-width": 0, + "background-color": "transparent", + cursor: "pointer", + outline: "none", + opacity: 0.001, + filter: "alpha(opacity=1)", + "-ms-filter": "progid:DXImageTransform.Microsoft.Alpha(Opacity=1)", + zIndex: 999, + overflow: "hidden", + padding: 0, + margin: 0, + display: "block", + position: "absolute", + }); + }, + updateProxyButtonPosition: function (c, b) { + b = this.getElementPosition(b); + t(!0, c.style, { + width: (b.width || 1) + "px", + height: (b.height || 1) + "px", + left: (b.x || 0) + "px", + top: (b.y || 0) + "px", + }); + }, + proxyMouseEventsForButton: function (c, b) { + var a = this; + "click touchstart touchend touchcancel touchmove mouseover mouseenter mouseleave mouseout" + .split(" ") + .forEach(function (d) { + var t = 0 === d.indexOf("touch"); + a.addEvent(b, d, function (b) { + var d = t ? a.cloneTouchEvent(b) : a.cloneMouseEvent(b); + c && a.fireEventOnWrappedOrUnwrappedElement(c, d); + b.stopPropagation(); + b.preventDefault(); + }); + }); + }, + cloneMouseEvent: function (b) { + if ("function" === typeof d.MouseEvent) + return new d.MouseEvent(b.type, b); + if (e.createEvent) { + var a = e.createEvent("MouseEvent"); + if (a.initMouseEvent) + return ( + a.initMouseEvent( + b.type, + b.bubbles, + b.cancelable, + b.view || d, + b.detail, + b.screenX, + b.screenY, + b.clientX, + b.clientY, + b.ctrlKey, + b.altKey, + b.shiftKey, + b.metaKey, + b.button, + b.relatedTarget + ), + a + ); + } + return c(b.type); + }, + cloneTouchEvent: function (b) { + var c = function (b) { + for (var c = [], a = 0; a < b.length; ++a) { + var d = b.item(a); + d && c.push(d); + } + return c; + }; + if ("function" === typeof d.TouchEvent) + return ( + (c = new d.TouchEvent(b.type, { + touches: c(b.touches), + targetTouches: c(b.targetTouches), + changedTouches: c(b.changedTouches), + ctrlKey: b.ctrlKey, + shiftKey: b.shiftKey, + altKey: b.altKey, + metaKey: b.metaKey, + bubbles: b.bubbles, + cancelable: b.cancelable, + composed: b.composed, + detail: b.detail, + view: b.view, + })), + b.defaultPrevented && c.preventDefault(), + c + ); + c = this.cloneMouseEvent(b); + c.touches = b.touches; + c.changedTouches = b.changedTouches; + c.targetTouches = b.targetTouches; + return c; + }, + destroyBase: function () { + b(this.chart.a11yProxyContainer); + this.domElementProvider.destroyCreatedElements(); + this.eventProvider.removeAddedEvents(); + }, + }; + a(h.prototype, { + init: function () {}, + getKeyboardNavigation: function () {}, + onChartUpdate: function () {}, + onChartRender: function () {}, + destroy: function () {}, + }); + return h; + } + ); + p( + a, + "Accessibility/KeyboardNavigation.js", + [ + a["Core/Globals.js"], + a["Core/Utilities.js"], + a["Accessibility/Utils/HTMLUtilities.js"], + a["Accessibility/Utils/EventProvider.js"], + ], + function (a, f, l, m) { + function n(b, c) { + this.init(b, c); + } + var g = a.doc, + h = a.win, + q = f.addEvent, + e = f.fireEvent, + d = l.getElement; + q(g, "keydown", function (b) { + 27 === (b.which || b.keyCode) && + a.charts && + a.charts.forEach(function (b) { + b && b.dismissPopupContent && b.dismissPopupContent(); + }); + }); + a.Chart.prototype.dismissPopupContent = function () { + var b = this; + e(this, "dismissPopupContent", {}, function () { + b.tooltip && b.tooltip.hide(0); + b.hideExportMenu(); + }); + }; + n.prototype = { + init: function (b, c) { + var a = this, + d = (this.eventProvider = new m()); + this.chart = b; + this.components = c; + this.modules = []; + this.currentModuleIx = 0; + this.update(); + d.addEvent(this.tabindexContainer, "keydown", function (b) { + return a.onKeydown(b); + }); + d.addEvent(this.tabindexContainer, "focus", function (b) { + return a.onFocus(b); + }); + ["mouseup", "touchend"].forEach(function (b) { + return d.addEvent(g, b, function () { + return a.onMouseUp(); + }); + }); + ["mousedown", "touchstart"].forEach(function (c) { + return d.addEvent(b.renderTo, c, function () { + a.isClickingChart = !0; + }); + }); + d.addEvent(b.renderTo, "mouseover", function () { + a.pointerIsOverChart = !0; + }); + d.addEvent(b.renderTo, "mouseout", function () { + a.pointerIsOverChart = !1; + }); + this.modules.length && this.modules[0].init(1); + }, + update: function (b) { + var c = this.chart.options.accessibility; + c = c && c.keyboardNavigation; + var a = this.components; + this.updateContainerTabindex(); + c && c.enabled && b && b.length + ? ((this.modules = b.reduce(function (b, c) { + c = a[c].getKeyboardNavigation(); + return b.concat(c); + }, [])), + this.updateExitAnchor()) + : ((this.modules = []), + (this.currentModuleIx = 0), + this.removeExitAnchor()); + }, + onFocus: function (b) { + var c, + a = this.chart; + b = b.relatedTarget && a.container.contains(b.relatedTarget); + this.isClickingChart || + b || + (null === (c = this.modules[0]) || void 0 === c + ? void 0 + : c.init(1)); + }, + onMouseUp: function () { + delete this.isClickingChart; + if (!this.keyboardReset && !this.pointerIsOverChart) { + var b = this.chart, + c = this.modules && this.modules[this.currentModuleIx || 0]; + c && c.terminate && c.terminate(); + b.focusElement && b.focusElement.removeFocusBorder(); + this.currentModuleIx = 0; + this.keyboardReset = !0; + } + }, + onKeydown: function (b) { + b = b || h.event; + var c, + a = + this.modules && + this.modules.length && + this.modules[this.currentModuleIx]; + this.keyboardReset = !1; + if (a) { + var d = a.run(b); + d === a.response.success + ? (c = !0) + : d === a.response.prev + ? (c = this.prev()) + : d === a.response.next && (c = this.next()); + c && (b.preventDefault(), b.stopPropagation()); + } + }, + prev: function () { + return this.move(-1); + }, + next: function () { + return this.move(1); + }, + move: function (b) { + var c = this.modules && this.modules[this.currentModuleIx]; + c && c.terminate && c.terminate(b); + this.chart.focusElement && + this.chart.focusElement.removeFocusBorder(); + this.currentModuleIx += b; + if ((c = this.modules && this.modules[this.currentModuleIx])) { + if (c.validate && !c.validate()) return this.move(b); + if (c.init) return c.init(b), !0; + } + this.currentModuleIx = 0; + 0 < b + ? ((this.exiting = !0), this.exitAnchor.focus()) + : this.tabindexContainer.focus(); + return !1; + }, + updateExitAnchor: function () { + var b = d("highcharts-end-of-chart-marker-" + this.chart.index); + this.removeExitAnchor(); + b + ? (this.makeElementAnExitAnchor(b), (this.exitAnchor = b)) + : this.createExitAnchor(); + }, + updateContainerTabindex: function () { + var b = this.chart.options.accessibility; + b = b && b.keyboardNavigation; + b = !(b && !1 === b.enabled); + var c = this.chart, + a = c.container; + c.renderTo.hasAttribute("tabindex") && + (a.removeAttribute("tabindex"), (a = c.renderTo)); + this.tabindexContainer = a; + var d = a.getAttribute("tabindex"); + b && !d + ? a.setAttribute("tabindex", "0") + : b || c.container.removeAttribute("tabindex"); + }, + makeElementAnExitAnchor: function (b) { + var c = this.tabindexContainer.getAttribute("tabindex") || 0; + b.setAttribute("class", "highcharts-exit-anchor"); + b.setAttribute("tabindex", c); + b.setAttribute("aria-hidden", !1); + this.addExitAnchorEventsToEl(b); + }, + createExitAnchor: function () { + var b = this.chart, + c = (this.exitAnchor = g.createElement("div")); + b.renderTo.appendChild(c); + this.makeElementAnExitAnchor(c); + }, + removeExitAnchor: function () { + this.exitAnchor && + this.exitAnchor.parentNode && + (this.exitAnchor.parentNode.removeChild(this.exitAnchor), + delete this.exitAnchor); + }, + addExitAnchorEventsToEl: function (b) { + var c = this.chart, + a = this; + this.eventProvider.addEvent(b, "focus", function (b) { + b = b || h.event; + (b.relatedTarget && c.container.contains(b.relatedTarget)) || + a.exiting + ? (a.exiting = !1) + : (a.tabindexContainer.focus(), + b.preventDefault(), + a.modules && + a.modules.length && + ((a.currentModuleIx = a.modules.length - 1), + (b = a.modules[a.currentModuleIx]) && + b.validate && + !b.validate() + ? a.prev() + : b && b.init(-1))); + }); + }, + destroy: function () { + this.removeExitAnchor(); + this.eventProvider.removeAddedEvents(); + this.chart.container.removeAttribute("tabindex"); + }, + }; + return n; + } + ); + p( + a, + "Accessibility/Components/LegendComponent.js", + [ + a["Core/Globals.js"], + a["Core/Legend.js"], + a["Core/Utilities.js"], + a["Accessibility/AccessibilityComponent.js"], + a["Accessibility/KeyboardNavigationHandler.js"], + a["Accessibility/Utils/HTMLUtilities.js"], + ], + function (a, f, l, m, n, g) { + function h(b) { + var c = b.legend && b.legend.allItems, + a = b.options.legend.accessibility || {}; + return !( + !c || + !c.length || + (b.colorAxis && b.colorAxis.length) || + !1 === a.enabled + ); + } + var q = l.addEvent, + e = l.extend, + d = l.find, + b = l.fireEvent, + c = g.stripHTMLTagsFromString, + k = g.removeElement; + a.Chart.prototype.highlightLegendItem = function (c) { + var a = this.legend.allItems, + d = this.highlightedLegendItemIx; + if (a[c]) { + a[d] && b(a[d].legendGroup.element, "mouseout"); + d = this.legend; + var k = d.allItems[c].pageIx, + t = d.currentPage; + "undefined" !== typeof k && k + 1 !== t && d.scroll(1 + k - t); + this.setFocusToElement(a[c].legendItem, a[c].a11yProxyElement); + b(a[c].legendGroup.element, "mouseover"); + return !0; + } + return !1; + }; + q(f, "afterColorizeItem", function (b) { + var c = b.item; + this.chart.options.accessibility.enabled && + c && + c.a11yProxyElement && + c.a11yProxyElement.setAttribute( + "aria-pressed", + b.visible ? "false" : "true" + ); + }); + a = function () {}; + a.prototype = new m(); + e(a.prototype, { + init: function () { + var b = this; + this.proxyElementsList = []; + this.recreateProxies(); + this.addEvent(f, "afterScroll", function () { + this.chart === b.chart && + (b.updateProxiesPositions(), + b.updateLegendItemProxyVisibility(), + this.chart.highlightLegendItem(b.highlightedLegendItemIx)); + }); + this.addEvent(f, "afterPositionItem", function (c) { + this.chart === b.chart && + this.chart.renderer && + b.updateProxyPositionForItem(c.item); + }); + }, + updateLegendItemProxyVisibility: function () { + var b = this.chart.legend, + c = b.currentPage || 1, + a = b.clipHeight || 0; + (b.allItems || []).forEach(function (d) { + var k = d.pageIx || 0, + t = d._legendItemPos ? d._legendItemPos[1] : 0, + e = d.legendItem ? Math.round(d.legendItem.getBBox().height) : 0; + k = t + e - b.pages[k] > a || k !== c - 1; + d.a11yProxyElement && + (d.a11yProxyElement.style.visibility = k ? "hidden" : "visible"); + }); + }, + onChartRender: function () { + h(this.chart) ? this.updateProxiesPositions() : this.removeProxies(); + }, + updateProxiesPositions: function () { + for (var b = 0, c = this.proxyElementsList; b < c.length; b++) { + var a = c[b]; + this.updateProxyButtonPosition(a.element, a.posElement); + } + }, + updateProxyPositionForItem: function (b) { + var c = d(this.proxyElementsList, function (c) { + return c.item === b; + }); + c && this.updateProxyButtonPosition(c.element, c.posElement); + }, + recreateProxies: function () { + this.removeProxies(); + h(this.chart) && + (this.addLegendProxyGroup(), + this.proxyLegendItems(), + this.updateLegendItemProxyVisibility()); + }, + removeProxies: function () { + k(this.legendProxyGroup); + this.proxyElementsList = []; + }, + addLegendProxyGroup: function () { + var b = this.chart.options.accessibility, + c = this.chart.langFormat("accessibility.legend.legendLabel", {}); + this.legendProxyGroup = this.addProxyGroup({ + "aria-label": c, + role: "all" === b.landmarkVerbosity ? "region" : null, + }); + }, + proxyLegendItems: function () { + var b = this; + ((this.chart.legend && this.chart.legend.allItems) || []).forEach( + function (c) { + c.legendItem && c.legendItem.element && b.proxyLegendItem(c); + } + ); + }, + proxyLegendItem: function (b) { + if (b.legendItem && b.legendGroup) { + var a = this.chart.langFormat("accessibility.legend.legendItem", { + chart: this.chart, + itemName: c(b.name), + }), + d = b.legendGroup.div ? b.legendItem : b.legendGroup; + b.a11yProxyElement = this.createProxyButton( + b.legendItem, + this.legendProxyGroup, + { tabindex: -1, "aria-pressed": !b.visible, "aria-label": a }, + d + ); + this.proxyElementsList.push({ + item: b, + element: b.a11yProxyElement, + posElement: d, + }); + } + }, + getKeyboardNavigation: function () { + var b = this.keyCodes, + c = this; + return new n(this.chart, { + keyCodeMap: [ + [ + [b.left, b.right, b.up, b.down], + function (b) { + return c.onKbdArrowKey(this, b); + }, + ], + [ + [b.enter, b.space], + function () { + return c.onKbdClick(this); + }, + ], + ], + validate: function () { + return c.shouldHaveLegendNavigation(); + }, + init: function (b) { + return c.onKbdNavigationInit(b); + }, + }); + }, + onKbdArrowKey: function (b, c) { + var a = this.keyCodes, + d = b.response, + k = this.chart, + e = k.options.accessibility, + t = k.legend.allItems.length; + c = c === a.left || c === a.up ? -1 : 1; + return k.highlightLegendItem(this.highlightedLegendItemIx + c) + ? ((this.highlightedLegendItemIx += c), d.success) + : 1 < t && e.keyboardNavigation.wrapAround + ? (b.init(c), d.success) + : d[0 < c ? "next" : "prev"]; + }, + onKbdClick: function (c) { + var a = this.chart.legend.allItems[this.highlightedLegendItemIx]; + a && a.a11yProxyElement && b(a.a11yProxyElement, "click"); + return c.response.success; + }, + shouldHaveLegendNavigation: function () { + var b = this.chart, + c = b.colorAxis && b.colorAxis.length, + a = (b.options.legend || {}).accessibility || {}; + return !!( + b.legend && + b.legend.allItems && + b.legend.display && + !c && + a.enabled && + a.keyboardNavigation && + a.keyboardNavigation.enabled + ); + }, + onKbdNavigationInit: function (b) { + var c = this.chart, + a = c.legend.allItems.length - 1; + b = 0 < b ? 0 : a; + c.highlightLegendItem(b); + this.highlightedLegendItemIx = b; + }, + }); + return a; + } + ); + p( + a, + "Accessibility/Components/MenuComponent.js", + [ + a["Core/Globals.js"], + a["Core/Utilities.js"], + a["Accessibility/AccessibilityComponent.js"], + a["Accessibility/KeyboardNavigationHandler.js"], + a["Accessibility/Utils/ChartUtilities.js"], + a["Accessibility/Utils/HTMLUtilities.js"], + ], + function (a, f, l, m, n, g) { + function h(b) { + return b.exportSVGElements && b.exportSVGElements[0]; + } + f = f.extend; + var q = n.unhideChartElementFromAT, + e = g.removeElement, + d = g.getFakeMouseEvent; + a.Chart.prototype.showExportMenu = function () { + var b = h(this); + if (b && ((b = b.element), b.onclick)) b.onclick(d("click")); + }; + a.Chart.prototype.hideExportMenu = function () { + var b = this.exportDivElements; + b && + this.exportContextMenu && + (b.forEach(function (b) { + if ("highcharts-menu-item" === b.className && b.onmouseout) + b.onmouseout(d("mouseout")); + }), + (this.highlightedExportItemIx = 0), + this.exportContextMenu.hideMenu(), + this.container.focus()); + }; + a.Chart.prototype.highlightExportItem = function (b) { + var c = this.exportDivElements && this.exportDivElements[b], + a = + this.exportDivElements && + this.exportDivElements[this.highlightedExportItemIx]; + if (c && "LI" === c.tagName && (!c.children || !c.children.length)) { + var e = !!(this.renderTo.getElementsByTagName("g")[0] || {}).focus; + c.focus && e && c.focus(); + if (a && a.onmouseout) a.onmouseout(d("mouseout")); + if (c.onmouseover) c.onmouseover(d("mouseover")); + this.highlightedExportItemIx = b; + return !0; + } + return !1; + }; + a.Chart.prototype.highlightLastExportItem = function () { + var b; + if (this.exportDivElements) + for (b = this.exportDivElements.length; b--; ) + if (this.highlightExportItem(b)) return !0; + return !1; + }; + a = function () {}; + a.prototype = new l(); + f(a.prototype, { + init: function () { + var b = this.chart, + c = this; + this.addEvent(b, "exportMenuShown", function () { + c.onMenuShown(); + }); + this.addEvent(b, "exportMenuHidden", function () { + c.onMenuHidden(); + }); + }, + onMenuHidden: function () { + var b = this.chart.exportContextMenu; + b && b.setAttribute("aria-hidden", "true"); + this.isExportMenuShown = !1; + this.setExportButtonExpandedState("false"); + }, + onMenuShown: function () { + var b = this.chart, + c = b.exportContextMenu; + c && (this.addAccessibleContextMenuAttribs(), q(b, c)); + this.isExportMenuShown = !0; + this.setExportButtonExpandedState("true"); + }, + setExportButtonExpandedState: function (b) { + var c = this.exportButtonProxy; + c && c.setAttribute("aria-expanded", b); + }, + onChartRender: function () { + var b = this.chart, + c = b.options.accessibility; + e(this.exportProxyGroup); + var a = b.options.exporting, + d = h(b); + a && + !1 !== a.enabled && + a.accessibility && + a.accessibility.enabled && + d && + d.element && + ((this.exportProxyGroup = this.addProxyGroup( + "all" === c.landmarkVerbosity + ? { + "aria-label": b.langFormat( + "accessibility.exporting.exportRegionLabel", + { chart: b } + ), + role: "region", + } + : {} + )), + (c = h(this.chart)), + (this.exportButtonProxy = this.createProxyButton( + c, + this.exportProxyGroup, + { + "aria-label": b.langFormat( + "accessibility.exporting.menuButtonLabel", + { chart: b } + ), + "aria-expanded": "false", + } + ))); + }, + addAccessibleContextMenuAttribs: function () { + var b = this.chart, + c = b.exportDivElements; + c && + c.length && + (c.forEach(function (b) { + "LI" !== b.tagName || (b.children && b.children.length) + ? b.setAttribute("aria-hidden", "true") + : b.setAttribute("tabindex", -1); + }), + (c = c[0].parentNode), + c.removeAttribute("aria-hidden"), + c.setAttribute( + "aria-label", + b.langFormat("accessibility.exporting.chartMenuLabel", { + chart: b, + }) + )); + }, + getKeyboardNavigation: function () { + var b = this.keyCodes, + c = this.chart, + a = this; + return new m(c, { + keyCodeMap: [ + [ + [b.left, b.up], + function () { + return a.onKbdPrevious(this); + }, + ], + [ + [b.right, b.down], + function () { + return a.onKbdNext(this); + }, + ], + [ + [b.enter, b.space], + function () { + return a.onKbdClick(this); + }, + ], + ], + validate: function () { + return ( + c.exportChart && + !1 !== c.options.exporting.enabled && + !1 !== c.options.exporting.accessibility.enabled + ); + }, + init: function () { + var b = a.exportButtonProxy, + d = c.exportingGroup; + d && b && c.setFocusToElement(d, b); + }, + terminate: function () { + c.hideExportMenu(); + }, + }); + }, + onKbdPrevious: function (b) { + var c = this.chart, + a = c.options.accessibility; + b = b.response; + for (var d = c.highlightedExportItemIx || 0; d--; ) + if (c.highlightExportItem(d)) return b.success; + return a.keyboardNavigation.wrapAround + ? (c.highlightLastExportItem(), b.success) + : b.prev; + }, + onKbdNext: function (b) { + var c = this.chart, + a = c.options.accessibility; + b = b.response; + for ( + var d = (c.highlightedExportItemIx || 0) + 1; + d < c.exportDivElements.length; + ++d + ) + if (c.highlightExportItem(d)) return b.success; + return a.keyboardNavigation.wrapAround + ? (c.highlightExportItem(0), b.success) + : b.next; + }, + onKbdClick: function (b) { + var c = this.chart, + a = c.exportDivElements[c.highlightedExportItemIx], + d = h(c).element; + this.isExportMenuShown + ? this.fakeClickEvent(a) + : (this.fakeClickEvent(d), c.highlightExportItem(0)); + return b.response.success; + }, + }); + return a; + } + ); + p( + a, + "Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js", + [ + a["Core/Series/Series.js"], + a["Core/Series/CartesianSeries.js"], + a["Core/Chart/Chart.js"], + a["Core/Series/Point.js"], + a["Core/Utilities.js"], + a["Accessibility/KeyboardNavigationHandler.js"], + a["Accessibility/Utils/EventProvider.js"], + a["Accessibility/Utils/ChartUtilities.js"], + ], + function (a, f, l, m, n, g, h, q) { + function e(b) { + var c = b.index, + a = b.series.points, + d = a.length; + if (a[c] !== b) + for (; d--; ) { + if (a[d] === b) return d; + } + else return c; + } + function d(b) { + var c = + b.chart.options.accessibility.keyboardNavigation.seriesNavigation, + a = b.options.accessibility || {}, + d = a.keyboardNavigation; + return ( + (d && !1 === d.enabled) || + !1 === a.enabled || + !1 === b.options.enableMouseTracking || + !b.visible || + (c.pointNavigationEnabledThreshold && + c.pointNavigationEnabledThreshold <= b.points.length) + ); + } + function b(b) { + var c = b.series.chart.options.accessibility; + return ( + (b.isNull && c.keyboardNavigation.seriesNavigation.skipNullPoints) || + !1 === b.visible || + d(b.series) + ); + } + function c(b, c, a, d) { + var r = Infinity, + e = c.points.length, + k = function (b) { + return !(w(b.plotX) && w(b.plotY)); + }; + if (!k(b)) { + for (; e--; ) { + var g = c.points[e]; + if ( + !k(g) && + ((g = + (b.plotX - g.plotX) * (b.plotX - g.plotX) * (a || 1) + + (b.plotY - g.plotY) * (b.plotY - g.plotY) * (d || 1)), + g < r) + ) { + r = g; + var h = e; + } + } + return w(h) ? c.points[h] : void 0; + } + } + function k(b) { + var c = !1; + delete b.highlightedPoint; + return (c = b.series.reduce(function (b, c) { + return b || c.highlightFirstValidPoint(); + }, !1)); + } + function t(b, c) { + this.keyCodes = c; + this.chart = b; + } + var v = a.seriesTypes, + w = n.defined; + a = n.extend; + var u = q.getPointFromXY, + A = q.getSeriesFromName, + p = q.scrollToPoint; + f.prototype.keyboardMoveVertical = !0; + ["column", "pie"].forEach(function (b) { + v[b] && (v[b].prototype.keyboardMoveVertical = !1); + }); + m.prototype.highlight = function () { + var b = this.series.chart; + if (this.isNull) b.tooltip && b.tooltip.hide(0); + else this.onMouseOver(); + p(this); + this.graphic && b.setFocusToElement(this.graphic); + b.highlightedPoint = this; + return this; + }; + l.prototype.highlightAdjacentPoint = function (c) { + var a = this.series, + k = this.highlightedPoint, + r = (k && e(k)) || 0, + g = k && k.series.points, + h = this.series && this.series[this.series.length - 1]; + h = h && h.points && h.points[h.points.length - 1]; + if (!a[0] || !a[0].points) return !1; + if (k) { + if ( + ((a = a[k.series.index + (c ? 1 : -1)]), + (r = g[r + (c ? 1 : -1)]), + !r && a && (r = a.points[c ? 0 : a.points.length - 1]), + !r) + ) + return !1; + } else r = c ? a[0].points[0] : h; + return b(r) + ? ((a = r.series), + d(a) + ? (this.highlightedPoint = c + ? a.points[a.points.length - 1] + : a.points[0]) + : (this.highlightedPoint = r), + this.highlightAdjacentPoint(c)) + : r.highlight(); + }; + f.prototype.highlightFirstValidPoint = function () { + var c = this.chart.highlightedPoint, + a = (c && c.series) === this ? e(c) : 0; + c = this.points; + var d = c.length; + if (c && d) { + for (var r = a; r < d; ++r) if (!b(c[r])) return c[r].highlight(); + for (; 0 <= a; --a) if (!b(c[a])) return c[a].highlight(); + } + return !1; + }; + l.prototype.highlightAdjacentSeries = function (b) { + var a, + k = this.highlightedPoint; + var r = + (a = this.series && this.series[this.series.length - 1]) && + a.points && + a.points[a.points.length - 1]; + if (!this.highlightedPoint) + return ( + (a = b ? this.series && this.series[0] : a), + (r = b ? a && a.points && a.points[0] : r) ? r.highlight() : !1 + ); + a = this.series[k.series.index + (b ? -1 : 1)]; + if (!a) return !1; + r = c(k, a, 4); + if (!r) return !1; + if (d(a)) + return ( + r.highlight(), + (b = this.highlightAdjacentSeries(b)), + b ? b : (k.highlight(), !1) + ); + r.highlight(); + return r.series.highlightFirstValidPoint(); + }; + l.prototype.highlightAdjacentPointVertical = function (c) { + var a = this.highlightedPoint, + k = Infinity, + r; + if (!w(a.plotX) || !w(a.plotY)) return !1; + this.series.forEach(function (e) { + d(e) || + e.points.forEach(function (d) { + if (w(d.plotY) && w(d.plotX) && d !== a) { + var g = d.plotY - a.plotY, + h = Math.abs(d.plotX - a.plotX); + h = Math.abs(g) * Math.abs(g) + h * h * 4; + e.yAxis && e.yAxis.reversed && (g *= -1); + !((0 >= g && c) || (0 <= g && !c) || 5 > h || b(d)) && + h < k && + ((k = h), (r = d)); + } + }); + }); + return r ? r.highlight() : !1; + }; + a(t.prototype, { + init: function () { + var b = this, + c = this.chart, + a = (this.eventProvider = new h()); + a.addEvent(f, "destroy", function () { + return b.onSeriesDestroy(this); + }); + a.addEvent(c, "afterDrilldown", function () { + k(this); + this.focusElement && this.focusElement.removeFocusBorder(); + }); + a.addEvent(c, "drilldown", function (c) { + c = c.point; + var a = c.series; + b.lastDrilledDownPoint = { + x: c.x, + y: c.y, + seriesName: a ? a.name : "", + }; + }); + a.addEvent(c, "drillupall", function () { + setTimeout(function () { + b.onDrillupAll(); + }, 10); + }); + }, + onDrillupAll: function () { + var b = this.lastDrilledDownPoint, + c = this.chart, + a = b && A(c, b.seriesName), + d; + b && a && w(b.x) && w(b.y) && (d = u(a, b.x, b.y)); + c.container && c.container.focus(); + d && d.highlight && d.highlight(); + c.focusElement && c.focusElement.removeFocusBorder(); + }, + getKeyboardNavigationHandler: function () { + var b = this, + c = this.keyCodes, + a = this.chart, + d = a.inverted; + return new g(a, { + keyCodeMap: [ + [ + d ? [c.up, c.down] : [c.left, c.right], + function (c) { + return b.onKbdSideways(this, c); + }, + ], + [ + d ? [c.left, c.right] : [c.up, c.down], + function (c) { + return b.onKbdVertical(this, c); + }, + ], + [ + [c.enter, c.space], + function () { + a.highlightedPoint && + a.highlightedPoint.firePointEvent("click"); + return this.response.success; + }, + ], + ], + init: function (c) { + return b.onHandlerInit(this, c); + }, + terminate: function () { + return b.onHandlerTerminate(); + }, + }); + }, + onKbdSideways: function (b, c) { + var a = this.keyCodes; + return this.attemptHighlightAdjacentPoint( + b, + c === a.right || c === a.down + ); + }, + onKbdVertical: function (b, c) { + var a = this.chart, + d = this.keyCodes; + c = c === d.down || c === d.right; + d = a.options.accessibility.keyboardNavigation.seriesNavigation; + if (d.mode && "serialize" === d.mode) + return this.attemptHighlightAdjacentPoint(b, c); + a[ + a.highlightedPoint && a.highlightedPoint.series.keyboardMoveVertical + ? "highlightAdjacentPointVertical" + : "highlightAdjacentSeries" + ](c); + return b.response.success; + }, + onHandlerInit: function (b, c) { + var a = this.chart; + if (0 < c) k(a); + else { + c = a.series.length; + for ( + var d; + c-- && + !((a.highlightedPoint = + a.series[c].points[a.series[c].points.length - 1]), + (d = a.series[c].highlightFirstValidPoint())); + + ); + } + return b.response.success; + }, + onHandlerTerminate: function () { + var b, + c, + a = this.chart, + d = a.highlightedPoint; + null === (b = a.tooltip) || void 0 === b ? void 0 : b.hide(0); + null === (c = null === d || void 0 === d ? void 0 : d.onMouseOut) || + void 0 === c + ? void 0 + : c.call(d); + delete a.highlightedPoint; + }, + attemptHighlightAdjacentPoint: function (b, c) { + var a = this.chart, + d = a.options.accessibility.keyboardNavigation.wrapAround; + return a.highlightAdjacentPoint(c) + ? b.response.success + : d + ? b.init(c ? 1 : -1) + : b.response[c ? "next" : "prev"]; + }, + onSeriesDestroy: function (b) { + var c = this.chart; + c.highlightedPoint && + c.highlightedPoint.series === b && + (delete c.highlightedPoint, + c.focusElement && c.focusElement.removeFocusBorder()); + }, + destroy: function () { + this.eventProvider.removeAddedEvents(); + }, + }); + return t; + } + ); + p( + a, + "Accessibility/Components/AnnotationsA11y.js", + [a["Accessibility/Utils/HTMLUtilities.js"]], + function (a) { + function f(a) { + return (a.annotations || []).reduce(function (a, d) { + var b; + !1 !== + (null === (b = d.options) || void 0 === b ? void 0 : b.visible) && + (a = a.concat(d.labels)); + return a; + }, []); + } + function l(a) { + var e, + d, + b, + c, + k = + null === + (d = + null === (e = a.options) || void 0 === e + ? void 0 + : e.accessibility) || void 0 === d + ? void 0 + : d.description; + return k + ? k + : (null === + (c = + null === (b = a.graphic) || void 0 === b ? void 0 : b.text) || + void 0 === c + ? void 0 + : c.textStr) || ""; + } + function m(a) { + var e, + d, + b = + null === + (d = + null === (e = a.options) || void 0 === e + ? void 0 + : e.accessibility) || void 0 === d + ? void 0 + : d.description; + if (b) return b; + e = a.chart; + d = l(a); + b = a.points + .filter(function (b) { + return !!b.graphic; + }) + .map(function (b) { + var c, a; + if ( + !(a = + null === + (c = null === b || void 0 === b ? void 0 : b.accessibility) || + void 0 === c + ? void 0 + : c.valueDescription) + ) { + var d, e; + a = + (null === + (e = + null === + (d = null === b || void 0 === b ? void 0 : b.graphic) || + void 0 === d + ? void 0 + : d.element) || void 0 === e + ? void 0 + : e.getAttribute("aria-label")) || ""; + } + b = (null === b || void 0 === b ? void 0 : b.series.name) || ""; + return (b ? b + ", " : "") + "data point " + a; + }) + .filter(function (b) { + return !!b; + }); + var c = b.length; + a = + "accessibility.screenReaderSection.annotations.description" + + (1 < c ? "MultiplePoints" : c ? "SinglePoint" : "NoPoints"); + d = { + annotationText: d, + numPoints: c, + annotationPoint: b[0], + additionalAnnotationPoints: b.slice(1), + }; + return e.langFormat(a, d); + } + function n(a) { + return f(a).map(function (a) { + return (a = g(h(m(a)))) ? "<li>" + a + "</li>" : ""; + }); + } + var g = a.escapeStringForHTML, + h = a.stripHTMLTagsFromString; + return { + getAnnotationsInfoHTML: function (a) { + var e = a.annotations; + return e && e.length ? "<ul>" + n(a).join(" ") + "</ul>" : ""; + }, + getAnnotationLabelDescription: m, + getAnnotationListItems: n, + getPointAnnotationTexts: function (a) { + var e = f(a.series.chart).filter(function (d) { + return -1 < d.points.indexOf(a); + }); + return e.length + ? e.map(function (a) { + return "" + l(a); + }) + : []; + }, + }; + } + ); + p( + a, + "Accessibility/Components/SeriesComponent/SeriesDescriber.js", + [ + a["Accessibility/Components/AnnotationsA11y.js"], + a["Accessibility/Utils/ChartUtilities.js"], + a["Accessibility/Utils/HTMLUtilities.js"], + a["Core/Tooltip.js"], + a["Core/Utilities.js"], + ], + function (a, f, l, m, n) { + function g(b) { + var c = b.index; + return b.series && b.series.data && G(c) + ? K(b.series.data, function (b) { + return !!( + b && + "undefined" !== typeof b.index && + b.index > c && + b.graphic && + b.graphic.element + ); + }) || null + : null; + } + function h(b) { + var c = + b.chart.options.accessibility.series.pointDescriptionEnabledThreshold; + return !!(!1 !== c && b.points && b.points.length >= c); + } + function q(b) { + var c = b.options.accessibility || {}; + return !h(b) && !c.exposeAsGroupOnly; + } + function e(b) { + var c = + b.chart.options.accessibility.keyboardNavigation.seriesNavigation; + return !( + !b.points || + !( + b.points.length < c.pointNavigationEnabledThreshold || + !1 === c.pointNavigationEnabledThreshold + ) + ); + } + function d(b, c) { + var a = b.series.chart, + d = a.options.accessibility.point || {}; + b = b.series.tooltipOptions || {}; + a = a.options.lang; + return L(c) + ? M( + c, + d.valueDecimals || b.valueDecimals || -1, + a.decimalPoint, + a.accessibility.thousandsSep || a.thousandsSep + ) + : c; + } + function b(b) { + var c = (b.options.accessibility || {}).description; + return ( + (c && + b.chart.langFormat("accessibility.series.description", { + description: c, + series: b, + })) || + "" + ); + } + function c(b, c) { + return b.chart.langFormat("accessibility.series." + c + "Description", { + name: x(b[c]), + series: b, + }); + } + function k(b) { + var c = b.series, + a = c.chart, + d = a.options.accessibility.point || {}; + if (c.xAxis && c.xAxis.dateTime) + return ( + (c = m.prototype.getXDateFormat.call( + { getDateFormat: m.prototype.getDateFormat, chart: a }, + b, + a.options.tooltip, + c.xAxis + )), + (d = (d.dateFormatter && d.dateFormatter(b)) || d.dateFormat || c), + a.time.dateFormat(d, b.x, void 0) + ); + } + function t(b) { + var c = k(b), + a = + (b.series.xAxis || {}).categories && + G(b.category) && + ("" + b.category).replace("<br/>", " "), + d = b.id && 0 > b.id.indexOf("highcharts-"), + e = "x, " + b.x; + return b.name || c || a || (d ? b.id : e); + } + function v(b, c, a) { + var e = c || "", + k = a || ""; + return b.series.pointArrayMap.reduce(function (c, a) { + c += c.length ? ", " : ""; + var r = d(b, C(b[a], b.options[a])); + return c + (a + ": " + e + r + k); + }, ""); + } + function w(b) { + var c = b.series, + a = c.chart.options.accessibility.point || {}, + e = c.tooltipOptions || {}, + k = a.valuePrefix || e.valuePrefix || ""; + a = a.valueSuffix || e.valueSuffix || ""; + e = d(b, b["undefined" !== typeof b.value ? "value" : "y"]); + return b.isNull + ? c.chart.langFormat("accessibility.series.nullPointValue", { + point: b, + }) + : c.pointArrayMap + ? v(b, k, a) + : k + e + a; + } + function u(b) { + var c = b.series, + a = c.chart, + d = a.options.accessibility.point.valueDescriptionFormat, + e = (c = C( + c.xAxis && + c.xAxis.options.accessibility && + c.xAxis.options.accessibility.enabled, + !a.angular + )) + ? t(b) + : ""; + b = { + point: b, + index: G(b.index) ? b.index + 1 : "", + xDescription: e, + value: w(b), + separator: c ? ", " : "", + }; + return N(d, b, a); + } + function A(b) { + var c = b.series, + a = c.chart, + d = u(b), + e = + b.options && + b.options.accessibility && + b.options.accessibility.description; + e = e ? " " + e : ""; + c = 1 < a.series.length && c.name ? " " + c.name + "." : ""; + a = b.series.chart; + var k = z(b), + r = { point: b, annotations: k }; + a = k.length + ? a.langFormat("accessibility.series.pointAnnotationsDescription", r) + : ""; + b.accessibility = b.accessibility || {}; + b.accessibility.valueDescription = d; + return d + e + c + (a ? " " + a : ""); + } + function p(b) { + var c = q(b), + a = e(b); + (c || a) && + b.points.forEach(function (b) { + var a; + if ( + !(a = b.graphic && b.graphic.element) && + ((a = b.series && b.series.is("sunburst")), (a = b.isNull && !a)) + ) { + var d = b.series, + e = g(b); + d = (a = e && e.graphic) ? a.parentGroup : d.graph || d.group; + e = e + ? { x: C(b.plotX, e.plotX, 0), y: C(b.plotY, e.plotY, 0) } + : { x: C(b.plotX, 0), y: C(b.plotY, 0) }; + e = b.series.chart.renderer.rect(e.x, e.y, 1, 1); + e.attr({ + class: "highcharts-a11y-dummy-point", + fill: "none", + opacity: 0, + "fill-opacity": 0, + "stroke-opacity": 0, + }); + d && d.element + ? ((b.graphic = e), + (b.hasDummyGraphic = !0), + e.add(d), + d.element.insertBefore(e.element, a ? a.element : null), + (a = e.element)) + : (a = void 0); + } + a && + (a.setAttribute("tabindex", "-1"), + (a.style.outline = "0"), + c + ? ((e = b.series), + (d = e.chart.options.accessibility.point || {}), + (e = e.options.accessibility || {}), + (b = B( + I( + (e.pointDescriptionFormatter && + e.pointDescriptionFormatter(b)) || + (d.descriptionFormatter && d.descriptionFormatter(b)) || + A(b) + ) + )), + a.setAttribute("role", "img"), + a.setAttribute("aria-label", b)) + : a.setAttribute("aria-hidden", !0)); + }); + } + function y(a) { + var d = a.chart, + e = d.types || [], + k = b(a), + r = function (b) { + return d[b] && 1 < d[b].length && a[b]; + }, + g = c(a, "xAxis"), + h = c(a, "yAxis"), + f = { + name: a.name || "", + ix: a.index + 1, + numSeries: d.series && d.series.length, + numPoints: a.points && a.points.length, + series: a, + }; + e = 1 < e.length ? "Combination" : ""; + return ( + (d.langFormat("accessibility.series.summary." + a.type + e, f) || + d.langFormat("accessibility.series.summary.default" + e, f)) + + (k ? " " + k : "") + + (r("yAxis") ? " " + h : "") + + (r("xAxis") ? " " + g : "") + ); + } + var z = a.getPointAnnotationTexts, + x = f.getAxisDescription, + r = f.getSeriesFirstPointElement, + J = f.getSeriesA11yElement, + F = f.unhideChartElementFromAT, + B = l.escapeStringForHTML, + E = l.reverseChildNodes, + I = l.stripHTMLTagsFromString, + K = n.find, + N = n.format, + L = n.isNumber, + M = n.numberFormat, + C = n.pick, + G = n.defined; + return { + describeSeries: function (b) { + var c = b.chart, + a = r(b), + d = J(b), + e = c.is3d && c.is3d(); + if (d) { + d.lastChild !== a || e || E(d); + p(b); + F(c, d); + e = b.chart; + c = e.options.chart || {}; + a = 1 < e.series.length; + e = e.options.accessibility.series.describeSingleSeries; + var k = (b.options.accessibility || {}).exposeAsGroupOnly; + (c.options3d && c.options3d.enabled && a) || !(a || e || k || h(b)) + ? d.setAttribute("aria-label", "") + : ((c = b.chart.options.accessibility), + (a = c.landmarkVerbosity), + (b.options.accessibility || {}).exposeAsGroupOnly + ? d.setAttribute("role", "img") + : "all" === a && d.setAttribute("role", "region"), + d.setAttribute("tabindex", "-1"), + (d.style.outline = "0"), + d.setAttribute( + "aria-label", + B( + I( + (c.series.descriptionFormatter && + c.series.descriptionFormatter(b)) || + y(b) + ) + ) + )); + } + }, + defaultPointDescriptionFormatter: A, + defaultSeriesDescriptionFormatter: y, + getPointA11yTimeDescription: k, + getPointXDescription: t, + getPointValue: w, + getPointValueDescription: u, + }; + } + ); + p( + a, + "Accessibility/Utils/Announcer.js", + [ + a["Core/Globals.js"], + a["Accessibility/Utils/DOMElementProvider.js"], + a["Accessibility/Utils/HTMLUtilities.js"], + ], + function (a, f, l) { + var m = l.visuallyHideElement; + l = (function () { + function a(a, h) { + this.chart = a; + this.domElementProvider = new f(); + this.announceRegion = this.addAnnounceRegion(h); + } + a.prototype.destroy = function () { + this.domElementProvider.destroyCreatedElements(); + }; + a.prototype.announce = function (a) { + var g = this; + this.announceRegion.innerHTML = a; + this.clearAnnouncementRegionTimer && + clearTimeout(this.clearAnnouncementRegionTimer); + this.clearAnnouncementRegionTimer = setTimeout(function () { + g.announceRegion.innerHTML = ""; + delete g.clearAnnouncementRegionTimer; + }, 1e3); + }; + a.prototype.addAnnounceRegion = function (a) { + var g = this.chart.renderTo, + f = this.domElementProvider.createElement("div"); + f.setAttribute("aria-hidden", !1); + f.setAttribute("aria-live", a); + m(f); + g.insertBefore(f, g.firstChild); + return f; + }; + return a; + })(); + return (a.Announcer = l); + } + ); + p( + a, + "Accessibility/Components/SeriesComponent/NewDataAnnouncer.js", + [ + a["Core/Globals.js"], + a["Core/Series/CartesianSeries.js"], + a["Core/Utilities.js"], + a["Accessibility/Utils/ChartUtilities.js"], + a["Accessibility/Components/SeriesComponent/SeriesDescriber.js"], + a["Accessibility/Utils/Announcer.js"], + a["Accessibility/Utils/EventProvider.js"], + ], + function (a, f, l, m, n, g, h) { + function q(b) { + var c = b.series.data.filter(function (c) { + return b.x === c.x && b.y === c.y; + }); + return 1 === c.length ? c[0] : b; + } + function e(b, c) { + var a = (b || []).concat(c || []).reduce(function (b, c) { + b[c.name + c.index] = c; + return b; + }, {}); + return Object.keys(a).map(function (b) { + return a[b]; + }); + } + var d = l.extend, + b = l.defined, + c = m.getChartTitle, + k = n.defaultPointDescriptionFormatter, + t = n.defaultSeriesDescriptionFormatter; + l = function (b) { + this.chart = b; + }; + d(l.prototype, { + init: function () { + var b = this.chart, + c = b.options.accessibility.announceNewData.interruptUser + ? "assertive" + : "polite"; + this.lastAnnouncementTime = 0; + this.dirty = { allSeries: {} }; + this.eventProvider = new h(); + this.announcer = new g(b, c); + this.addEventListeners(); + }, + destroy: function () { + this.eventProvider.removeAddedEvents(); + this.announcer.destroy(); + }, + addEventListeners: function () { + var b = this, + c = this.chart, + a = this.eventProvider; + a.addEvent(c, "afterDrilldown", function () { + b.lastAnnouncementTime = 0; + }); + a.addEvent(f, "updatedData", function () { + b.onSeriesUpdatedData(this); + }); + a.addEvent(c, "afterAddSeries", function (c) { + b.onSeriesAdded(c.series); + }); + a.addEvent(f, "addPoint", function (c) { + b.onPointAdded(c.point); + }); + a.addEvent(c, "redraw", function () { + b.announceDirtyData(); + }); + }, + onSeriesUpdatedData: function (b) { + var c = this.chart; + b.chart === c && + c.options.accessibility.announceNewData.enabled && + ((this.dirty.hasDirty = !0), + (this.dirty.allSeries[b.name + b.index] = b)); + }, + onSeriesAdded: function (c) { + this.chart.options.accessibility.announceNewData.enabled && + ((this.dirty.hasDirty = !0), + (this.dirty.allSeries[c.name + c.index] = c), + (this.dirty.newSeries = b(this.dirty.newSeries) ? void 0 : c)); + }, + onPointAdded: function (c) { + var a = c.series.chart; + this.chart === a && + a.options.accessibility.announceNewData.enabled && + (this.dirty.newPoint = b(this.dirty.newPoint) ? void 0 : c); + }, + announceDirtyData: function () { + var b = this; + if ( + this.chart.options.accessibility.announceNewData && + this.dirty.hasDirty + ) { + var c = this.dirty.newPoint; + c && (c = q(c)); + this.queueAnnouncement( + Object.keys(this.dirty.allSeries).map(function (c) { + return b.dirty.allSeries[c]; + }), + this.dirty.newSeries, + c + ); + this.dirty = { allSeries: {} }; + } + }, + queueAnnouncement: function (b, c, a) { + var d = this, + k = this.chart.options.accessibility.announceNewData; + if (k.enabled) { + var g = +new Date(); + k = Math.max( + 0, + k.minAnnounceInterval - (g - this.lastAnnouncementTime) + ); + b = e(this.queuedAnnouncement && this.queuedAnnouncement.series, b); + if ((c = this.buildAnnouncementMessage(b, c, a))) + this.queuedAnnouncement && + clearTimeout(this.queuedAnnouncementTimer), + (this.queuedAnnouncement = { time: g, message: c, series: b }), + (this.queuedAnnouncementTimer = setTimeout(function () { + d && + d.announcer && + ((d.lastAnnouncementTime = +new Date()), + d.announcer.announce(d.queuedAnnouncement.message), + delete d.queuedAnnouncement, + delete d.queuedAnnouncementTimer); + }, k)); + } + }, + buildAnnouncementMessage: function (b, d, e) { + var g = this.chart, + h = g.options.accessibility.announceNewData; + if ( + h.announcementFormatter && + ((b = h.announcementFormatter(b, d, e)), !1 !== b) + ) + return b.length ? b : null; + b = a.charts && 1 < a.charts.length ? "Multiple" : "Single"; + b = d + ? "newSeriesAnnounce" + b + : e + ? "newPointAnnounce" + b + : "newDataAnnounce"; + h = c(g); + return g.langFormat("accessibility.announceNewData." + b, { + chartTitle: h, + seriesDesc: d ? t(d) : null, + pointDesc: e ? k(e) : null, + point: e, + series: d, + }); + }, + }); + return l; + } + ); + p( + a, + "Accessibility/Components/SeriesComponent/ForcedMarkers.js", + [a["Core/Series/CartesianSeries.js"], a["Core/Utilities.js"]], + function (a, f) { + function l(a) { + n(!0, a, { + marker: { enabled: !0, states: { normal: { opacity: 0 } } }, + }); + } + var m = f.addEvent, + n = f.merge; + return function () { + m(a, "render", function () { + var a = this.options, + h = + !1 !== + (this.options.accessibility && + this.options.accessibility.enabled); + if ((h = this.chart.options.accessibility.enabled && h)) + (h = this.chart.options.accessibility), + (h = + this.points.length < + h.series.pointDescriptionEnabledThreshold || + !1 === h.series.pointDescriptionEnabledThreshold); + if (h) { + if ( + (a.marker && + !1 === a.marker.enabled && + ((this.a11yMarkersForced = !0), l(this.options)), + this._hasPointMarkers && this.points && this.points.length) + ) + for (a = this.points.length; a--; ) { + h = this.points[a]; + var f = h.options; + delete h.hasForcedA11yMarker; + f.marker && + (f.marker.enabled + ? (n(!0, f.marker, { + states: { + normal: { + opacity: + (f.marker.states && + f.marker.states.normal && + f.marker.states.normal.opacity) || + 1, + }, + }, + }), + (h.hasForcedA11yMarker = !1)) + : (l(f), (h.hasForcedA11yMarker = !0))); + } + } else this.a11yMarkersForced && (delete this.a11yMarkersForced, (a = this.resetA11yMarkerOptions) && n(!0, this.options, { marker: { enabled: a.enabled, states: { normal: { opacity: a.states && a.states.normal && a.states.normal.opacity } } } })); + }); + m(a, "afterSetOptions", function (a) { + this.resetA11yMarkerOptions = n( + a.options.marker || {}, + this.userOptions.marker || {} + ); + }); + m(a, "afterRender", function () { + if (this.chart.styledMode) { + if (this.markerGroup) + this.markerGroup[ + this.a11yMarkersForced ? "addClass" : "removeClass" + ]("highcharts-a11y-markers-hidden"); + this._hasPointMarkers && + this.points && + this.points.length && + this.points.forEach(function (a) { + a.graphic && + (a.graphic[ + a.hasForcedA11yMarker ? "addClass" : "removeClass" + ]("highcharts-a11y-marker-hidden"), + a.graphic[ + !1 === a.hasForcedA11yMarker ? "addClass" : "removeClass" + ]("highcharts-a11y-marker-visible")); + }); + } + }); + }; + } + ); + p( + a, + "Accessibility/Components/SeriesComponent/SeriesComponent.js", + [ + a["Core/Globals.js"], + a["Core/Utilities.js"], + a["Accessibility/AccessibilityComponent.js"], + a["Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js"], + a["Accessibility/Components/SeriesComponent/NewDataAnnouncer.js"], + a["Accessibility/Components/SeriesComponent/ForcedMarkers.js"], + a["Accessibility/Utils/ChartUtilities.js"], + a["Accessibility/Components/SeriesComponent/SeriesDescriber.js"], + a["Core/Tooltip.js"], + ], + function (a, f, l, m, n, g, h, q, e) { + f = f.extend; + var d = h.hideSeriesFromAT, + b = q.describeSeries; + a.SeriesAccessibilityDescriber = q; + g(); + a = function () {}; + a.prototype = new l(); + f(a.prototype, { + init: function () { + this.newDataAnnouncer = new n(this.chart); + this.newDataAnnouncer.init(); + this.keyboardNavigation = new m(this.chart, this.keyCodes); + this.keyboardNavigation.init(); + this.hideTooltipFromATWhenShown(); + this.hideSeriesLabelsFromATWhenShown(); + }, + hideTooltipFromATWhenShown: function () { + var b = this; + this.addEvent(e, "refresh", function () { + this.chart === b.chart && + this.label && + this.label.element && + this.label.element.setAttribute("aria-hidden", !0); + }); + }, + hideSeriesLabelsFromATWhenShown: function () { + this.addEvent(this.chart, "afterDrawSeriesLabels", function () { + this.series.forEach(function (b) { + b.labelBySeries && b.labelBySeries.attr("aria-hidden", !0); + }); + }); + }, + onChartRender: function () { + this.chart.series.forEach(function (c) { + !1 !== + (c.options.accessibility && c.options.accessibility.enabled) && + c.visible + ? b(c) + : d(c); + }); + }, + getKeyboardNavigation: function () { + return this.keyboardNavigation.getKeyboardNavigationHandler(); + }, + destroy: function () { + this.newDataAnnouncer.destroy(); + this.keyboardNavigation.destroy(); + }, + }); + return a; + } + ); + p( + a, + "Accessibility/Components/ZoomComponent.js", + [ + a["Accessibility/AccessibilityComponent.js"], + a["Accessibility/Utils/ChartUtilities.js"], + a["Core/Globals.js"], + a["Accessibility/Utils/HTMLUtilities.js"], + a["Accessibility/KeyboardNavigationHandler.js"], + a["Core/Utilities.js"], + ], + function (a, f, l, m, n, g) { + var h = f.unhideChartElementFromAT; + f = l.noop; + var q = m.removeElement, + e = m.setElAttrs; + m = g.extend; + var d = g.pick; + l.Axis.prototype.panStep = function (b, c) { + var a = c || 3; + c = this.getExtremes(); + var d = ((c.max - c.min) / a) * b; + a = c.max + d; + d = c.min + d; + var e = a - d; + 0 > b && d < c.dataMin + ? ((d = c.dataMin), (a = d + e)) + : 0 < b && a > c.dataMax && ((a = c.dataMax), (d = a - e)); + this.setExtremes(d, a); + }; + f.prototype = new a(); + m(f.prototype, { + init: function () { + var b = this, + c = this.chart; + ["afterShowResetZoom", "afterDrilldown", "drillupall"].forEach( + function (a) { + b.addEvent(c, a, function () { + b.updateProxyOverlays(); + }); + } + ); + }, + onChartUpdate: function () { + var b = this.chart, + c = this; + b.mapNavButtons && + b.mapNavButtons.forEach(function (a, d) { + h(b, a.element); + c.setMapNavButtonAttrs( + a.element, + "accessibility.zoom.mapZoom" + (d ? "Out" : "In") + ); + }); + }, + setMapNavButtonAttrs: function (b, c) { + var a = this.chart; + c = a.langFormat(c, { chart: a }); + e(b, { tabindex: -1, role: "button", "aria-label": c }); + }, + onChartRender: function () { + this.updateProxyOverlays(); + }, + updateProxyOverlays: function () { + var b = this.chart; + q(this.drillUpProxyGroup); + q(this.resetZoomProxyGroup); + b.resetZoomButton && + this.recreateProxyButtonAndGroup( + b.resetZoomButton, + "resetZoomProxyButton", + "resetZoomProxyGroup", + b.langFormat("accessibility.zoom.resetZoomButton", { chart: b }) + ); + b.drillUpButton && + this.recreateProxyButtonAndGroup( + b.drillUpButton, + "drillUpProxyButton", + "drillUpProxyGroup", + b.langFormat("accessibility.drillUpButton", { + chart: b, + buttonText: b.getDrilldownBackText(), + }) + ); + }, + recreateProxyButtonAndGroup: function (b, c, a, d) { + q(this[a]); + this[a] = this.addProxyGroup(); + this[c] = this.createProxyButton(b, this[a], { + "aria-label": d, + tabindex: -1, + }); + }, + getMapZoomNavigation: function () { + var b = this.keyCodes, + a = this.chart, + d = this; + return new n(a, { + keyCodeMap: [ + [ + [b.up, b.down, b.left, b.right], + function (b) { + return d.onMapKbdArrow(this, b); + }, + ], + [ + [b.tab], + function (b, a) { + return d.onMapKbdTab(this, a); + }, + ], + [ + [b.space, b.enter], + function () { + return d.onMapKbdClick(this); + }, + ], + ], + validate: function () { + return !!(a.mapZoom && a.mapNavButtons && a.mapNavButtons.length); + }, + init: function (b) { + return d.onMapNavInit(b); + }, + }); + }, + onMapKbdArrow: function (b, a) { + var c = this.keyCodes; + this.chart[a === c.up || a === c.down ? "yAxis" : "xAxis"][0].panStep( + a === c.left || a === c.up ? -1 : 1 + ); + return b.response.success; + }, + onMapKbdTab: function (b, a) { + var c = this.chart; + b = b.response; + var d = + ((a = a.shiftKey) && !this.focusedMapNavButtonIx) || + (!a && this.focusedMapNavButtonIx); + c.mapNavButtons[this.focusedMapNavButtonIx].setState(0); + if (d) return c.mapZoom(), b[a ? "prev" : "next"]; + this.focusedMapNavButtonIx += a ? -1 : 1; + a = c.mapNavButtons[this.focusedMapNavButtonIx]; + c.setFocusToElement(a.box, a.element); + a.setState(2); + return b.success; + }, + onMapKbdClick: function (b) { + this.fakeClickEvent( + this.chart.mapNavButtons[this.focusedMapNavButtonIx].element + ); + return b.response.success; + }, + onMapNavInit: function (b) { + var a = this.chart, + d = a.mapNavButtons[0], + e = a.mapNavButtons[1]; + d = 0 < b ? d : e; + a.setFocusToElement(d.box, d.element); + d.setState(2); + this.focusedMapNavButtonIx = 0 < b ? 0 : 1; + }, + simpleButtonNavigation: function (b, a, e) { + var c = this.keyCodes, + k = this, + g = this.chart; + return new n(g, { + keyCodeMap: [ + [ + [c.tab, c.up, c.down, c.left, c.right], + function (b, a) { + return this.response[ + (b === c.tab && a.shiftKey) || b === c.left || b === c.up + ? "prev" + : "next" + ]; + }, + ], + [ + [c.space, c.enter], + function () { + var b = e(this, g); + return d(b, this.response.success); + }, + ], + ], + validate: function () { + return g[b] && g[b].box && k[a]; + }, + init: function () { + g.setFocusToElement(g[b].box, k[a]); + }, + }); + }, + getKeyboardNavigation: function () { + return [ + this.simpleButtonNavigation( + "resetZoomButton", + "resetZoomProxyButton", + function (b, a) { + a.zoomOut(); + } + ), + this.simpleButtonNavigation( + "drillUpButton", + "drillUpProxyButton", + function (b, a) { + a.drillUp(); + return b.response.prev; + } + ), + this.getMapZoomNavigation(), + ]; + }, + }); + return f; + } + ); + p( + a, + "Accessibility/Components/RangeSelectorComponent.js", + [ + a["Accessibility/AccessibilityComponent.js"], + a["Accessibility/Utils/ChartUtilities.js"], + a["Core/Globals.js"], + a["Accessibility/Utils/HTMLUtilities.js"], + a["Accessibility/KeyboardNavigationHandler.js"], + a["Core/Utilities.js"], + ], + function (a, f, l, m, n, g) { + var h = f.unhideChartElementFromAT, + q = m.setElAttrs; + f = g.extend; + l.Chart.prototype.highlightRangeSelectorButton = function (a) { + var d = this.rangeSelector.buttons, + b = this.highlightedRangeSelectorItemIx; + "undefined" !== typeof b && + d[b] && + d[b].setState(this.oldRangeSelectorItemState || 0); + this.highlightedRangeSelectorItemIx = a; + return d[a] + ? (this.setFocusToElement(d[a].box, d[a].element), + (this.oldRangeSelectorItemState = d[a].state), + d[a].setState(2), + !0) + : !1; + }; + l = function () {}; + l.prototype = new a(); + f(l.prototype, { + onChartUpdate: function () { + var a = this.chart, + d = this, + b = a.rangeSelector; + b && + (b.buttons && + b.buttons.length && + b.buttons.forEach(function (b) { + h(a, b.element); + d.setRangeButtonAttrs(b); + }), + b.maxInput && + b.minInput && + ["minInput", "maxInput"].forEach(function (c, e) { + if ((c = b[c])) + h(a, c), + d.setRangeInputAttrs( + c, + "accessibility.rangeSelector." + + (e ? "max" : "min") + + "InputLabel" + ); + })); + }, + setRangeButtonAttrs: function (a) { + var d = this.chart; + d = d.langFormat("accessibility.rangeSelector.buttonText", { + chart: d, + buttonText: a.text && a.text.textStr, + }); + q(a.element, { tabindex: -1, role: "button", "aria-label": d }); + }, + setRangeInputAttrs: function (a, d) { + var b = this.chart; + q(a, { + tabindex: -1, + role: "textbox", + "aria-label": b.langFormat(d, { chart: b }), + }); + }, + getRangeSelectorButtonNavigation: function () { + var a = this.chart, + d = this.keyCodes, + b = this; + return new n(a, { + keyCodeMap: [ + [ + [d.left, d.right, d.up, d.down], + function (a) { + return b.onButtonNavKbdArrowKey(this, a); + }, + ], + [ + [d.enter, d.space], + function () { + return b.onButtonNavKbdClick(this); + }, + ], + ], + validate: function () { + return ( + a.rangeSelector && + a.rangeSelector.buttons && + a.rangeSelector.buttons.length + ); + }, + init: function (b) { + var c = a.rangeSelector.buttons.length - 1; + a.highlightRangeSelectorButton(0 < b ? 0 : c); + }, + }); + }, + onButtonNavKbdArrowKey: function (a, d) { + var b = a.response, + c = this.keyCodes, + e = this.chart, + g = e.options.accessibility.keyboardNavigation.wrapAround; + d = d === c.left || d === c.up ? -1 : 1; + return e.highlightRangeSelectorButton( + e.highlightedRangeSelectorItemIx + d + ) + ? b.success + : g + ? (a.init(d), b.success) + : b[0 < d ? "next" : "prev"]; + }, + onButtonNavKbdClick: function (a) { + a = a.response; + var d = this.chart; + 3 !== d.oldRangeSelectorItemState && + this.fakeClickEvent( + d.rangeSelector.buttons[d.highlightedRangeSelectorItemIx].element + ); + return a.success; + }, + getRangeSelectorInputNavigation: function () { + var a = this.chart, + d = this.keyCodes, + b = this; + return new n(a, { + keyCodeMap: [ + [ + [d.tab, d.up, d.down], + function (a, e) { + return b.onInputKbdMove( + this, + (a === d.tab && e.shiftKey) || a === d.up ? -1 : 1 + ); + }, + ], + ], + validate: function () { + return ( + a.rangeSelector && + a.rangeSelector.inputGroup && + "hidden" !== + a.rangeSelector.inputGroup.element.getAttribute( + "visibility" + ) && + !1 !== a.options.rangeSelector.inputEnabled && + a.rangeSelector.minInput && + a.rangeSelector.maxInput + ); + }, + init: function (a) { + b.onInputNavInit(a); + }, + terminate: function () { + b.onInputNavTerminate(); + }, + }); + }, + onInputKbdMove: function (a, d) { + var b = this.chart; + a = a.response; + var c = (b.highlightedInputRangeIx += d); + if (1 < c || 0 > c) return a[0 < d ? "next" : "prev"]; + b.rangeSelector[c ? "maxInput" : "minInput"].focus(); + return a.success; + }, + onInputNavInit: function (a) { + var d = this.chart; + a = 0 < a ? 0 : 1; + d.highlightedInputRangeIx = a; + d.rangeSelector[a ? "maxInput" : "minInput"].focus(); + }, + onInputNavTerminate: function () { + var a = this.chart.rangeSelector || {}; + a.maxInput && a.hideInput("max"); + a.minInput && a.hideInput("min"); + }, + getKeyboardNavigation: function () { + return [ + this.getRangeSelectorButtonNavigation(), + this.getRangeSelectorInputNavigation(), + ]; + }, + }); + return l; + } + ); + p( + a, + "Accessibility/Components/InfoRegionsComponent.js", + [ + a["Core/Globals.js"], + a["Core/Utilities.js"], + a["Accessibility/AccessibilityComponent.js"], + a["Accessibility/Utils/Announcer.js"], + a["Accessibility/Components/AnnotationsA11y.js"], + a["Accessibility/Utils/ChartUtilities.js"], + a["Accessibility/Utils/HTMLUtilities.js"], + ], + function (a, f, l, m, n, g, h) { + function q(b) { + return b + .replace(/<(h[1-7]|p|div|ul|ol|li)>/g, "<$1>") + .replace(/</(h[1-7]|p|div|ul|ol|li|a|button)>/g, "</$1>") + .replace( + /<(div|a|button) id="([a-zA-Z\-0-9#]*?)">/g, + '<$1 id="$2">' + ); + } + var e = a.doc, + d = f.extend, + b = f.format, + c = f.pick, + k = n.getAnnotationsInfoHTML, + t = g.unhideChartElementFromAT, + v = g.getChartTitle, + w = g.getAxisDescription, + p = h.addClass, + u = h.setElAttrs, + D = h.escapeStringForHTML, + y = h.stripHTMLTagsFromString, + z = h.getElement, + x = h.visuallyHideElement; + a.Chart.prototype.getTypeDescription = function (b) { + var a = b[0], + c = (this.series && this.series[0]) || {}; + c = { + numSeries: this.series.length, + numPoints: c.points && c.points.length, + chart: this, + mapTitle: c.mapTitle, + }; + if (!a) + return this.langFormat("accessibility.chartTypes.emptyChart", c); + if ("map" === a) + return c.mapTitle + ? this.langFormat("accessibility.chartTypes.mapTypeDescription", c) + : this.langFormat("accessibility.chartTypes.unknownMap", c); + if (1 < this.types.length) + return this.langFormat( + "accessibility.chartTypes.combinationChart", + c + ); + b = b[0]; + a = this.langFormat("accessibility.seriesTypeDescriptions." + b, c); + var d = this.series && 2 > this.series.length ? "Single" : "Multiple"; + return ( + (this.langFormat("accessibility.chartTypes." + b + d, c) || + this.langFormat("accessibility.chartTypes.default" + d, c)) + + (a ? " " + a : "") + ); + }; + f = function () {}; + f.prototype = new l(); + d(f.prototype, { + init: function () { + var b = this.chart, + a = this; + this.initRegionsDefinitions(); + this.addEvent(b, "afterGetTable", function (b) { + a.onDataTableCreated(b); + }); + this.addEvent(b, "afterViewData", function (b) { + a.dataTableDiv = b; + setTimeout(function () { + a.focusDataTable(); + }, 300); + }); + this.announcer = new m(b, "assertive"); + }, + initRegionsDefinitions: function () { + var b = this; + this.screenReaderSections = { + before: { + element: null, + buildContent: function (a) { + var c = + a.options.accessibility.screenReaderSection + .beforeChartFormatter; + return c ? c(a) : b.defaultBeforeChartFormatter(a); + }, + insertIntoDOM: function (b, a) { + a.renderTo.insertBefore(b, a.renderTo.firstChild); + }, + afterInserted: function () { + "undefined" !== typeof b.sonifyButtonId && + b.initSonifyButton(b.sonifyButtonId); + "undefined" !== typeof b.dataTableButtonId && + b.initDataTableButton(b.dataTableButtonId); + }, + }, + after: { + element: null, + buildContent: function (a) { + var c = + a.options.accessibility.screenReaderSection + .afterChartFormatter; + return c ? c(a) : b.defaultAfterChartFormatter(); + }, + insertIntoDOM: function (b, a) { + a.renderTo.insertBefore(b, a.container.nextSibling); + }, + }, + }; + }, + onChartRender: function () { + var b = this; + this.linkedDescriptionElement = this.getLinkedDescriptionElement(); + this.setLinkedDescriptionAttrs(); + Object.keys(this.screenReaderSections).forEach(function (a) { + b.updateScreenReaderSection(a); + }); + }, + getLinkedDescriptionElement: function () { + var a = this.chart.options.accessibility.linkedDescription; + if (a) { + if ("string" !== typeof a) return a; + a = b(a, this.chart); + a = e.querySelectorAll(a); + if (1 === a.length) return a[0]; + } + }, + setLinkedDescriptionAttrs: function () { + var b = this.linkedDescriptionElement; + b && + (b.setAttribute("aria-hidden", "true"), + p(b, "highcharts-linked-description")); + }, + updateScreenReaderSection: function (b) { + var a = this.chart, + c = this.screenReaderSections[b], + d = c.buildContent(a), + e = (c.element = c.element || this.createElement("div")), + g = e.firstChild || this.createElement("div"); + this.setScreenReaderSectionAttribs(e, b); + g.innerHTML = d; + e.appendChild(g); + c.insertIntoDOM(e, a); + x(g); + t(a, g); + c.afterInserted && c.afterInserted(); + }, + setScreenReaderSectionAttribs: function (b, a) { + var c = this.chart, + d = c.langFormat( + "accessibility.screenReaderSection." + a + "RegionLabel", + { chart: c } + ); + u(b, { + id: "highcharts-screen-reader-region-" + a + "-" + c.index, + "aria-label": d, + }); + b.style.position = "relative"; + "all" === c.options.accessibility.landmarkVerbosity && + d && + b.setAttribute("role", "region"); + }, + defaultBeforeChartFormatter: function () { + var b, + c = this.chart, + d = c.options.accessibility.screenReaderSection.beforeChartFormat, + e = this.getAxesDescription(), + g = + c.sonify && + (null === (b = c.options.sonification) || void 0 === b + ? void 0 + : b.enabled); + b = "highcharts-a11y-sonify-data-btn-" + c.index; + var h = "hc-linkto-highcharts-data-table-" + c.index, + f = k(c), + t = c.langFormat( + "accessibility.screenReaderSection.annotations.heading", + { chart: c } + ); + e = { + chartTitle: v(c), + typeDescription: this.getTypeDescriptionText(), + chartSubtitle: this.getSubtitleText(), + chartLongdesc: this.getLongdescText(), + xAxisDescription: e.xAxis, + yAxisDescription: e.yAxis, + playAsSoundButton: g ? this.getSonifyButtonText(b) : "", + viewTableButton: c.getCSV ? this.getDataTableButtonText(h) : "", + annotationsTitle: f ? t : "", + annotationsList: f, + }; + c = a.i18nFormat(d, e, c); + this.dataTableButtonId = h; + this.sonifyButtonId = b; + return q(D(c)).replace(/<(\w+)[^>]*?>\s*<\/\1>/g, ""); + }, + defaultAfterChartFormatter: function () { + var b = this.chart, + c = b.options.accessibility.screenReaderSection.afterChartFormat, + d = { endOfChartMarker: this.getEndOfChartMarkerText() }; + b = a.i18nFormat(c, d, b); + return q(D(b)).replace(/<(\w+)[^>]*?>\s*<\/\1>/g, ""); + }, + getLinkedDescription: function () { + var b = this.linkedDescriptionElement; + return y((b && b.innerHTML) || ""); + }, + getLongdescText: function () { + var b = this.chart.options, + a = b.caption; + a = a && a.text; + var c = this.getLinkedDescription(); + return b.accessibility.description || c || a || ""; + }, + getTypeDescriptionText: function () { + var b = this.chart; + return b.types + ? b.options.accessibility.typeDescription || + b.getTypeDescription(b.types) + : ""; + }, + getDataTableButtonText: function (b) { + var a = this.chart; + a = a.langFormat("accessibility.table.viewAsDataTableButtonText", { + chart: a, + chartTitle: v(a), + }); + return '<button id="' + b + '">' + a + "</button>"; + }, + getSonifyButtonText: function (b) { + var a, + c = this.chart; + if ( + !1 === + (null === (a = c.options.sonification) || void 0 === a + ? void 0 + : a.enabled) + ) + return ""; + a = c.langFormat("accessibility.sonification.playAsSoundButtonText", { + chart: c, + chartTitle: v(c), + }); + return '<button id="' + b + '">' + a + "</button>"; + }, + getSubtitleText: function () { + var b = this.chart.options.subtitle; + return y((b && b.text) || ""); + }, + getEndOfChartMarkerText: function () { + var b = this.chart, + a = b.langFormat( + "accessibility.screenReaderSection.endOfChartMarker", + { chart: b } + ); + return ( + '<div id="highcharts-end-of-chart-marker-' + + b.index + + '">' + + a + + "</div>" + ); + }, + onDataTableCreated: function (b) { + var a = this.chart; + a.options.accessibility.enabled && + (this.viewDataTableButton && + this.viewDataTableButton.setAttribute("aria-expanded", "true"), + (b.html = b.html.replace( + "<table ", + '<table tabindex="-1" summary="' + + a.langFormat("accessibility.table.tableSummary", { chart: a }) + + '"' + ))); + }, + focusDataTable: function () { + var b = this.dataTableDiv; + (b = b && b.getElementsByTagName("table")[0]) && b.focus && b.focus(); + }, + initSonifyButton: function (b) { + var a = this, + c = (this.sonifyButton = z(b)), + d = this.chart, + e = function (b) { + null === c || void 0 === c + ? void 0 + : c.setAttribute("aria-hidden", "true"); + null === c || void 0 === c + ? void 0 + : c.setAttribute("aria-label", ""); + b.preventDefault(); + b.stopPropagation(); + b = d.langFormat( + "accessibility.sonification.playAsSoundClickAnnouncement", + { chart: d } + ); + a.announcer.announce(b); + setTimeout(function () { + null === c || void 0 === c + ? void 0 + : c.removeAttribute("aria-hidden"); + null === c || void 0 === c + ? void 0 + : c.removeAttribute("aria-label"); + d.sonify && d.sonify(); + }, 1e3); + }; + c && + d && + (u(c, { tabindex: "-1" }), + (c.onclick = function (b) { + var a; + ( + (null === (a = d.options.accessibility) || void 0 === a + ? void 0 + : a.screenReaderSection.onPlayAsSoundClick) || e + ).call(this, b, d); + })); + }, + initDataTableButton: function (b) { + var a = (this.viewDataTableButton = z(b)), + c = this.chart; + b = b.replace("hc-linkto-", ""); + a && + (u(a, { tabindex: "-1", "aria-expanded": !!z(b) }), + (a.onclick = + c.options.accessibility.screenReaderSection + .onViewDataTableClick || + function () { + c.viewData(); + })); + }, + getAxesDescription: function () { + var b = this.chart, + a = function (a, d) { + a = b[a]; + return ( + 1 < a.length || + (a[0] && + c( + a[0].options.accessibility && + a[0].options.accessibility.enabled, + d + )) + ); + }, + d = !!b.types && 0 > b.types.indexOf("map"), + e = !!b.hasCartesianSeries, + g = a("xAxis", !b.angular && e && d); + a = a("yAxis", e && d); + d = {}; + g && (d.xAxis = this.getAxisDescriptionText("xAxis")); + a && (d.yAxis = this.getAxisDescriptionText("yAxis")); + return d; + }, + getAxisDescriptionText: function (b) { + var a = this, + c = this.chart, + d = c[b]; + return c.langFormat( + "accessibility.axis." + + b + + "Description" + + (1 < d.length ? "Plural" : "Singular"), + { + chart: c, + names: d.map(function (b) { + return w(b); + }), + ranges: d.map(function (b) { + return a.getAxisRangeDescription(b); + }), + numAxes: d.length, + } + ); + }, + getAxisRangeDescription: function (b) { + var a = b.options || {}; + return a.accessibility && + "undefined" !== typeof a.accessibility.rangeDescription + ? a.accessibility.rangeDescription + : b.categories + ? this.getCategoryAxisRangeDesc(b) + : !b.dateTime || (0 !== b.min && 0 !== b.dataMin) + ? this.getAxisFromToDescription(b) + : this.getAxisTimeLengthDesc(b); + }, + getCategoryAxisRangeDesc: function (b) { + var a = this.chart; + return b.dataMax && b.dataMin + ? a.langFormat("accessibility.axis.rangeCategories", { + chart: a, + axis: b, + numCategories: b.dataMax - b.dataMin + 1, + }) + : ""; + }, + getAxisTimeLengthDesc: function (b) { + var a = this.chart, + c = {}, + d = "Seconds"; + c.Seconds = ((b.max || 0) - (b.min || 0)) / 1e3; + c.Minutes = c.Seconds / 60; + c.Hours = c.Minutes / 60; + c.Days = c.Hours / 24; + ["Minutes", "Hours", "Days"].forEach(function (b) { + 2 < c[b] && (d = b); + }); + var e = c[d].toFixed("Seconds" !== d && "Minutes" !== d ? 1 : 0); + return a.langFormat("accessibility.axis.timeRange" + d, { + chart: a, + axis: b, + range: e.replace(".0", ""), + }); + }, + getAxisFromToDescription: function (b) { + var a = this.chart, + c = a.options.accessibility.screenReaderSection.axisRangeDateFormat, + d = function (d) { + return b.dateTime ? a.time.dateFormat(c, b[d]) : b[d]; + }; + return a.langFormat("accessibility.axis.rangeFromTo", { + chart: a, + axis: b, + rangeFrom: d("min"), + rangeTo: d("max"), + }); + }, + destroy: function () { + var b; + null === (b = this.announcer) || void 0 === b ? void 0 : b.destroy(); + }, + }); + return f; + } + ); + p( + a, + "Accessibility/Components/ContainerComponent.js", + [ + a["Accessibility/AccessibilityComponent.js"], + a["Accessibility/Utils/ChartUtilities.js"], + a["Core/Globals.js"], + a["Accessibility/Utils/HTMLUtilities.js"], + a["Core/Utilities.js"], + ], + function (a, f, l, m, n) { + var g = f.unhideChartElementFromAT, + h = f.getChartTitle, + q = l.doc, + e = m.stripHTMLTagsFromString; + f = n.extend; + l = function () {}; + l.prototype = new a(); + f(l.prototype, { + onChartUpdate: function () { + this.handleSVGTitleElement(); + this.setSVGContainerLabel(); + this.setGraphicContainerAttrs(); + this.setRenderToAttrs(); + this.makeCreditsAccessible(); + }, + handleSVGTitleElement: function () { + var a = this.chart, + b = "highcharts-title-" + a.index, + c = e( + a.langFormat("accessibility.svgContainerTitle", { + chartTitle: h(a), + }) + ); + if (c.length) { + var g = (this.svgTitleElement = + this.svgTitleElement || + q.createElementNS("http://www.w3.org/2000/svg", "title")); + g.textContent = c; + g.id = b; + a.renderTo.insertBefore(g, a.renderTo.firstChild); + } + }, + setSVGContainerLabel: function () { + var a = this.chart, + b = e( + a.langFormat("accessibility.svgContainerLabel", { + chartTitle: h(a), + }) + ); + a.renderer.box && + b.length && + a.renderer.box.setAttribute("aria-label", b); + }, + setGraphicContainerAttrs: function () { + var a = this.chart, + b = a.langFormat("accessibility.graphicContainerLabel", { + chartTitle: h(a), + }); + b.length && a.container.setAttribute("aria-label", b); + }, + setRenderToAttrs: function () { + var a = this.chart; + "disabled" !== a.options.accessibility.landmarkVerbosity + ? a.renderTo.setAttribute("role", "region") + : a.renderTo.removeAttribute("role"); + a.renderTo.setAttribute( + "aria-label", + a.langFormat("accessibility.chartContainerLabel", { + title: h(a), + chart: a, + }) + ); + }, + makeCreditsAccessible: function () { + var a = this.chart, + b = a.credits; + b && + (b.textStr && + b.element.setAttribute( + "aria-label", + e( + a.langFormat("accessibility.credits", { + creditsStr: b.textStr, + }) + ) + ), + g(a, b.element)); + }, + destroy: function () { + this.chart.renderTo.setAttribute("aria-hidden", !0); + }, + }); + return l; + } + ); + p( + a, + "Accessibility/HighContrastMode.js", + [a["Core/Globals.js"]], + function (a) { + var f = a.isMS, + l = a.win, + m = l.document; + return { + isHighContrastModeActive: function () { + var a = /(Edg)/.test(l.navigator.userAgent); + if (l.matchMedia && a) + return l.matchMedia("(-ms-high-contrast: active)").matches; + if (f && l.getComputedStyle) { + a = m.createElement("div"); + a.style.backgroundImage = + "url(data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)"; + m.body.appendChild(a); + var g = (a.currentStyle || l.getComputedStyle(a)).backgroundImage; + m.body.removeChild(a); + return "none" === g; + } + return !1; + }, + setHighContrastTheme: function (a) { + a.highContrastModeActive = !0; + var g = a.options.accessibility.highContrastTheme; + a.update(g, !1); + a.series.forEach(function (a) { + var f = g.plotOptions[a.type] || {}; + a.update({ + color: f.color || "windowText", + colors: [f.color || "windowText"], + borderColor: f.borderColor || "window", + }); + a.points.forEach(function (a) { + a.options && + a.options.color && + a.update( + { + color: f.color || "windowText", + borderColor: f.borderColor || "window", + }, + !1 + ); + }); + }); + a.redraw(); + }, + }; + } + ); + p(a, "Accessibility/HighContrastTheme.js", [], function () { + return { + chart: { backgroundColor: "window" }, + title: { style: { color: "windowText" } }, + subtitle: { style: { color: "windowText" } }, + colorAxis: { minColor: "windowText", maxColor: "windowText", stops: [] }, + colors: ["windowText"], + xAxis: { + gridLineColor: "windowText", + labels: { style: { color: "windowText" } }, + lineColor: "windowText", + minorGridLineColor: "windowText", + tickColor: "windowText", + title: { style: { color: "windowText" } }, + }, + yAxis: { + gridLineColor: "windowText", + labels: { style: { color: "windowText" } }, + lineColor: "windowText", + minorGridLineColor: "windowText", + tickColor: "windowText", + title: { style: { color: "windowText" } }, + }, + tooltip: { + backgroundColor: "window", + borderColor: "windowText", + style: { color: "windowText" }, + }, + plotOptions: { + series: { + lineColor: "windowText", + fillColor: "window", + borderColor: "windowText", + edgeColor: "windowText", + borderWidth: 1, + dataLabels: { + connectorColor: "windowText", + color: "windowText", + style: { color: "windowText", textOutline: "none" }, + }, + marker: { lineColor: "windowText", fillColor: "windowText" }, + }, + pie: { + color: "window", + colors: ["window"], + borderColor: "windowText", + borderWidth: 1, + }, + boxplot: { fillColor: "window" }, + candlestick: { lineColor: "windowText", fillColor: "window" }, + errorbar: { fillColor: "window" }, + }, + legend: { + backgroundColor: "window", + itemStyle: { color: "windowText" }, + itemHoverStyle: { color: "windowText" }, + itemHiddenStyle: { color: "#555" }, + title: { style: { color: "windowText" } }, + }, + credits: { style: { color: "windowText" } }, + labels: { style: { color: "windowText" } }, + drilldown: { + activeAxisLabelStyle: { color: "windowText" }, + activeDataLabelStyle: { color: "windowText" }, + }, + navigation: { + buttonOptions: { + symbolStroke: "windowText", + theme: { fill: "window" }, + }, + }, + rangeSelector: { + buttonTheme: { + fill: "window", + stroke: "windowText", + style: { color: "windowText" }, + states: { + hover: { + fill: "window", + stroke: "windowText", + style: { color: "windowText" }, + }, + select: { + fill: "#444", + stroke: "windowText", + style: { color: "windowText" }, + }, + }, + }, + inputBoxBorderColor: "windowText", + inputStyle: { backgroundColor: "window", color: "windowText" }, + labelStyle: { color: "windowText" }, + }, + navigator: { + handles: { backgroundColor: "window", borderColor: "windowText" }, + outlineColor: "windowText", + maskFill: "transparent", + series: { color: "windowText", lineColor: "windowText" }, + xAxis: { gridLineColor: "windowText" }, + }, + scrollbar: { + barBackgroundColor: "#444", + barBorderColor: "windowText", + buttonArrowColor: "windowText", + buttonBackgroundColor: "window", + buttonBorderColor: "windowText", + rifleColor: "windowText", + trackBackgroundColor: "window", + trackBorderColor: "windowText", + }, + }; + }); + p(a, "Accessibility/Options/Options.js", [], function () { + return { + accessibility: { + enabled: !0, + screenReaderSection: { + beforeChartFormat: + "<h5>{chartTitle}</h5><div>{typeDescription}</div><div>{chartSubtitle}</div><div>{chartLongdesc}</div><div>{playAsSoundButton}</div><div>{viewTableButton}</div><div>{xAxisDescription}</div><div>{yAxisDescription}</div><div>{annotationsTitle}{annotationsList}</div>", + afterChartFormat: "{endOfChartMarker}", + axisRangeDateFormat: "%Y-%m-%d %H:%M:%S", + }, + series: { + describeSingleSeries: !1, + pointDescriptionEnabledThreshold: 200, + }, + point: { + valueDescriptionFormat: "{index}. {xDescription}{separator}{value}.", + }, + landmarkVerbosity: "all", + linkedDescription: + '*[data-highcharts-chart="{index}"] + .highcharts-description', + keyboardNavigation: { + enabled: !0, + focusBorder: { + enabled: !0, + hideBrowserFocusOutline: !0, + style: { color: "#335cad", lineWidth: 2, borderRadius: 3 }, + margin: 2, + }, + order: ["series", "zoom", "rangeSelector", "legend", "chartMenu"], + wrapAround: !0, + seriesNavigation: { + skipNullPoints: !0, + pointNavigationEnabledThreshold: !1, + }, + }, + announceNewData: { + enabled: !1, + minAnnounceInterval: 5e3, + interruptUser: !1, + }, + }, + legend: { + accessibility: { enabled: !0, keyboardNavigation: { enabled: !0 } }, + }, + exporting: { accessibility: { enabled: !0 } }, + }; + }); + p(a, "Accessibility/Options/LangOptions.js", [], function () { + return { + accessibility: { + defaultChartTitle: "Chart", + chartContainerLabel: "{title}. Highcharts interactive chart.", + svgContainerLabel: "Interactive chart", + drillUpButton: "{buttonText}", + credits: "Chart credits: {creditsStr}", + thousandsSep: ",", + svgContainerTitle: "", + graphicContainerLabel: "", + screenReaderSection: { + beforeRegionLabel: "Chart screen reader information.", + afterRegionLabel: "", + annotations: { + heading: "Chart annotations summary", + descriptionSinglePoint: + "{annotationText}. Related to {annotationPoint}", + descriptionMultiplePoints: + "{annotationText}. Related to {annotationPoint}{ Also related to, #each(additionalAnnotationPoints)}", + descriptionNoPoints: "{annotationText}", + }, + endOfChartMarker: "End of interactive chart.", + }, + sonification: { + playAsSoundButtonText: "Play as sound, {chartTitle}", + playAsSoundClickAnnouncement: "Play", + }, + legend: { + legendLabel: "Toggle series visibility", + legendItem: "Hide {itemName}", + }, + zoom: { + mapZoomIn: "Zoom chart", + mapZoomOut: "Zoom out chart", + resetZoomButton: "Reset zoom", + }, + rangeSelector: { + minInputLabel: "Select start date.", + maxInputLabel: "Select end date.", + buttonText: "Select range {buttonText}", + }, + table: { + viewAsDataTableButtonText: "View as data table, {chartTitle}", + tableSummary: "Table representation of chart.", + }, + announceNewData: { + newDataAnnounce: "Updated data for chart {chartTitle}", + newSeriesAnnounceSingle: "New data series: {seriesDesc}", + newPointAnnounceSingle: "New data point: {pointDesc}", + newSeriesAnnounceMultiple: + "New data series in chart {chartTitle}: {seriesDesc}", + newPointAnnounceMultiple: + "New data point in chart {chartTitle}: {pointDesc}", + }, + seriesTypeDescriptions: { + boxplot: + "Box plot charts are typically used to display groups of statistical data. Each data point in the chart can have up to 5 values: minimum, lower quartile, median, upper quartile, and maximum.", + arearange: + "Arearange charts are line charts displaying a range between a lower and higher value for each point.", + areasplinerange: + "These charts are line charts displaying a range between a lower and higher value for each point.", + bubble: + "Bubble charts are scatter charts where each data point also has a size value.", + columnrange: + "Columnrange charts are column charts displaying a range between a lower and higher value for each point.", + errorbar: + "Errorbar series are used to display the variability of the data.", + funnel: + "Funnel charts are used to display reduction of data in stages.", + pyramid: + "Pyramid charts consist of a single pyramid with item heights corresponding to each point value.", + waterfall: + "A waterfall chart is a column chart where each column contributes towards a total end value.", + }, + chartTypes: { + emptyChart: "Empty chart", + mapTypeDescription: "Map of {mapTitle} with {numSeries} data series.", + unknownMap: "Map of unspecified region with {numSeries} data series.", + combinationChart: "Combination chart with {numSeries} data series.", + defaultSingle: + "Chart with {numPoints} data {#plural(numPoints, points, point)}.", + defaultMultiple: "Chart with {numSeries} data series.", + splineSingle: + "Line chart with {numPoints} data {#plural(numPoints, points, point)}.", + splineMultiple: "Line chart with {numSeries} lines.", + lineSingle: + "Line chart with {numPoints} data {#plural(numPoints, points, point)}.", + lineMultiple: "Line chart with {numSeries} lines.", + columnSingle: + "Bar chart with {numPoints} {#plural(numPoints, bars, bar)}.", + columnMultiple: "Bar chart with {numSeries} data series.", + barSingle: + "Bar chart with {numPoints} {#plural(numPoints, bars, bar)}.", + barMultiple: "Bar chart with {numSeries} data series.", + pieSingle: + "Pie chart with {numPoints} {#plural(numPoints, slices, slice)}.", + pieMultiple: "Pie chart with {numSeries} pies.", + scatterSingle: + "Scatter chart with {numPoints} {#plural(numPoints, points, point)}.", + scatterMultiple: "Scatter chart with {numSeries} data series.", + boxplotSingle: + "Boxplot with {numPoints} {#plural(numPoints, boxes, box)}.", + boxplotMultiple: "Boxplot with {numSeries} data series.", + bubbleSingle: + "Bubble chart with {numPoints} {#plural(numPoints, bubbles, bubble)}.", + bubbleMultiple: "Bubble chart with {numSeries} data series.", + }, + axis: { + xAxisDescriptionSingular: + "The chart has 1 X axis displaying {names[0]}. {ranges[0]}", + xAxisDescriptionPlural: + "The chart has {numAxes} X axes displaying {#each(names, -1) }and {names[-1]}.", + yAxisDescriptionSingular: + "The chart has 1 Y axis displaying {names[0]}. {ranges[0]}", + yAxisDescriptionPlural: + "The chart has {numAxes} Y axes displaying {#each(names, -1) }and {names[-1]}.", + timeRangeDays: "Range: {range} days.", + timeRangeHours: "Range: {range} hours.", + timeRangeMinutes: "Range: {range} minutes.", + timeRangeSeconds: "Range: {range} seconds.", + rangeFromTo: "Range: {rangeFrom} to {rangeTo}.", + rangeCategories: "Range: {numCategories} categories.", + }, + exporting: { + chartMenuLabel: "Chart menu", + menuButtonLabel: "View chart menu", + exportRegionLabel: "Chart menu", + }, + series: { + summary: { + default: + "{name}, series {ix} of {numSeries} with {numPoints} data {#plural(numPoints, points, point)}.", + defaultCombination: + "{name}, series {ix} of {numSeries} with {numPoints} data {#plural(numPoints, points, point)}.", + line: "{name}, line {ix} of {numSeries} with {numPoints} data {#plural(numPoints, points, point)}.", + lineCombination: + "{name}, series {ix} of {numSeries}. Line with {numPoints} data {#plural(numPoints, points, point)}.", + spline: + "{name}, line {ix} of {numSeries} with {numPoints} data {#plural(numPoints, points, point)}.", + splineCombination: + "{name}, series {ix} of {numSeries}. Line with {numPoints} data {#plural(numPoints, points, point)}.", + column: + "{name}, bar series {ix} of {numSeries} with {numPoints} {#plural(numPoints, bars, bar)}.", + columnCombination: + "{name}, series {ix} of {numSeries}. Bar series with {numPoints} {#plural(numPoints, bars, bar)}.", + bar: "{name}, bar series {ix} of {numSeries} with {numPoints} {#plural(numPoints, bars, bar)}.", + barCombination: + "{name}, series {ix} of {numSeries}. Bar series with {numPoints} {#plural(numPoints, bars, bar)}.", + pie: "{name}, pie {ix} of {numSeries} with {numPoints} {#plural(numPoints, slices, slice)}.", + pieCombination: + "{name}, series {ix} of {numSeries}. Pie with {numPoints} {#plural(numPoints, slices, slice)}.", + scatter: + "{name}, scatter plot {ix} of {numSeries} with {numPoints} {#plural(numPoints, points, point)}.", + scatterCombination: + "{name}, series {ix} of {numSeries}, scatter plot with {numPoints} {#plural(numPoints, points, point)}.", + boxplot: + "{name}, boxplot {ix} of {numSeries} with {numPoints} {#plural(numPoints, boxes, box)}.", + boxplotCombination: + "{name}, series {ix} of {numSeries}. Boxplot with {numPoints} {#plural(numPoints, boxes, box)}.", + bubble: + "{name}, bubble series {ix} of {numSeries} with {numPoints} {#plural(numPoints, bubbles, bubble)}.", + bubbleCombination: + "{name}, series {ix} of {numSeries}. Bubble series with {numPoints} {#plural(numPoints, bubbles, bubble)}.", + map: "{name}, map {ix} of {numSeries} with {numPoints} {#plural(numPoints, areas, area)}.", + mapCombination: + "{name}, series {ix} of {numSeries}. Map with {numPoints} {#plural(numPoints, areas, area)}.", + mapline: + "{name}, line {ix} of {numSeries} with {numPoints} data {#plural(numPoints, points, point)}.", + maplineCombination: + "{name}, series {ix} of {numSeries}. Line with {numPoints} data {#plural(numPoints, points, point)}.", + mapbubble: + "{name}, bubble series {ix} of {numSeries} with {numPoints} {#plural(numPoints, bubbles, bubble)}.", + mapbubbleCombination: + "{name}, series {ix} of {numSeries}. Bubble series with {numPoints} {#plural(numPoints, bubbles, bubble)}.", + }, + description: "{description}", + xAxisDescription: "X axis, {name}", + yAxisDescription: "Y axis, {name}", + nullPointValue: "No value", + pointAnnotationsDescription: "{Annotation: #each(annotations). }", + }, + }, + }; + }); + p( + a, + "Accessibility/Options/DeprecatedOptions.js", + [a["Core/Utilities.js"]], + function (a) { + function f(a, d, b) { + for (var c, e = 0; e < d.length - 1; ++e) + (c = d[e]), (a = a[c] = q(a[c], {})); + a[d[d.length - 1]] = b; + } + function l(a, d, b, c) { + function e(b, a) { + return a.reduce(function (b, a) { + return b[a]; + }, b); + } + var g = e(a.options, d), + l = e(a.options, b); + Object.keys(c).forEach(function (e) { + var k, + t = g[e]; + "undefined" !== typeof t && + (f(l, c[e], t), + h( + 32, + !1, + a, + ((k = {}), + (k[d.join(".") + "." + e] = b.join(".") + "." + c[e].join(".")), + k) + )); + }); + } + function m(a) { + var d = a.options.chart || {}, + b = a.options.accessibility || {}; + ["description", "typeDescription"].forEach(function (c) { + var e; + d[c] && + ((b[c] = d[c]), + h( + 32, + !1, + a, + ((e = {}), (e["chart." + c] = "use accessibility." + c), e) + )); + }); + } + function n(a) { + a.axes.forEach(function (d) { + (d = d.options) && + d.description && + ((d.accessibility = d.accessibility || {}), + (d.accessibility.description = d.description), + h(32, !1, a, { + "axis.description": "use axis.accessibility.description", + })); + }); + } + function g(a) { + var d = { + description: ["accessibility", "description"], + exposeElementToA11y: ["accessibility", "exposeAsGroupOnly"], + pointDescriptionFormatter: [ + "accessibility", + "pointDescriptionFormatter", + ], + skipKeyboardNavigation: [ + "accessibility", + "keyboardNavigation", + "enabled", + ], + }; + a.series.forEach(function (b) { + Object.keys(d).forEach(function (c) { + var e, + g = b.options[c]; + "undefined" !== typeof g && + (f(b.options, d[c], "skipKeyboardNavigation" === c ? !g : g), + h( + 32, + !1, + a, + ((e = {}), (e["series." + c] = "series." + d[c].join(".")), e) + )); + }); + }); + } + var h = a.error, + q = a.pick; + return function (a) { + m(a); + n(a); + a.series && g(a); + l(a, ["accessibility"], ["accessibility"], { + pointDateFormat: ["point", "dateFormat"], + pointDateFormatter: ["point", "dateFormatter"], + pointDescriptionFormatter: ["point", "descriptionFormatter"], + pointDescriptionThreshold: [ + "series", + "pointDescriptionEnabledThreshold", + ], + pointNavigationThreshold: [ + "keyboardNavigation", + "seriesNavigation", + "pointNavigationEnabledThreshold", + ], + pointValueDecimals: ["point", "valueDecimals"], + pointValuePrefix: ["point", "valuePrefix"], + pointValueSuffix: ["point", "valueSuffix"], + screenReaderSectionFormatter: [ + "screenReaderSection", + "beforeChartFormatter", + ], + describeSingleSeries: ["series", "describeSingleSeries"], + seriesDescriptionFormatter: ["series", "descriptionFormatter"], + onTableAnchorClick: ["screenReaderSection", "onViewDataTableClick"], + axisRangeDateFormat: ["screenReaderSection", "axisRangeDateFormat"], + }); + l( + a, + ["accessibility", "keyboardNavigation"], + ["accessibility", "keyboardNavigation", "seriesNavigation"], + { skipNullPoints: ["skipNullPoints"], mode: ["mode"] } + ); + l(a, ["lang", "accessibility"], ["lang", "accessibility"], { + legendItem: ["legend", "legendItem"], + legendLabel: ["legend", "legendLabel"], + mapZoomIn: ["zoom", "mapZoomIn"], + mapZoomOut: ["zoom", "mapZoomOut"], + resetZoomButton: ["zoom", "resetZoomButton"], + screenReaderRegionLabel: ["screenReaderSection", "beforeRegionLabel"], + rangeSelectorButton: ["rangeSelector", "buttonText"], + rangeSelectorMaxInput: ["rangeSelector", "maxInputLabel"], + rangeSelectorMinInput: ["rangeSelector", "minInputLabel"], + svgContainerEnd: ["screenReaderSection", "endOfChartMarker"], + viewAsDataTable: ["table", "viewAsDataTableButtonText"], + tableSummary: ["table", "tableSummary"], + }); + }; + } + ); + p( + a, + "Accessibility/A11yI18n.js", + [a["Core/Globals.js"], a["Core/Utilities.js"]], + function (a, f) { + function l(a, f) { + var g = a.indexOf("#each("), + e = a.indexOf("#plural("), + d = a.indexOf("["), + b = a.indexOf("]"); + if (-1 < g) { + d = a.slice(g).indexOf(")") + g; + var c = a.substring(0, g); + e = a.substring(d + 1); + d = a.substring(g + 6, d).split(","); + g = Number(d[1]); + a = ""; + if ((f = f[d[0]])) + for ( + g = isNaN(g) ? f.length : g, + g = 0 > g ? f.length + g : Math.min(g, f.length), + d = 0; + d < g; + ++d + ) + a += c + f[d] + e; + return a.length ? a : ""; + } + if (-1 < e) { + c = a.slice(e).indexOf(")") + e; + a = a.substring(e + 8, c).split(","); + switch (Number(f[a[0]])) { + case 0: + a = n(a[4], a[1]); + break; + case 1: + a = n(a[2], a[1]); + break; + case 2: + a = n(a[3], a[1]); + break; + default: + a = a[1]; + } + a + ? ((f = a), + (f = (f.trim && f.trim()) || f.replace(/^\s+|\s+$/g, ""))) + : (f = ""); + return f; + } + return -1 < d + ? ((e = a.substring(0, d)), + (a = Number(a.substring(d + 1, b))), + (f = f[e]), + !isNaN(a) && + f && + (0 > a + ? ((c = f[f.length + a]), + "undefined" === typeof c && (c = f[0])) + : ((c = f[a]), + "undefined" === typeof c && (c = f[f.length - 1]))), + "undefined" !== typeof c ? c : "") + : "{" + a + "}"; + } + var m = f.format, + n = f.pick; + a.i18nFormat = function (a, f, n) { + var e = function (a, b) { + a = a.slice(b || 0); + var c = a.indexOf("{"), + d = a.indexOf("}"); + if (-1 < c && d > c) + return { + statement: a.substring(c + 1, d), + begin: b + c + 1, + end: b + d, + }; + }, + d = [], + b = 0; + do { + var c = e(a, b); + var g = a.substring(b, c && c.begin - 1); + g.length && d.push({ value: g, type: "constant" }); + c && d.push({ value: c.statement, type: "statement" }); + b = c ? c.end + 1 : b + 1; + } while (c); + d.forEach(function (a) { + "statement" === a.type && (a.value = l(a.value, f)); + }); + return m( + d.reduce(function (a, b) { + return a + b.value; + }, ""), + f, + n + ); + }; + a.Chart.prototype.langFormat = function (f, h) { + f = f.split("."); + for (var g = this.options.lang, e = 0; e < f.length; ++e) + g = g && g[f[e]]; + return "string" === typeof g ? a.i18nFormat(g, h, this) : ""; + }; + } + ); + p( + a, + "Accessibility/FocusBorder.js", + [ + a["Core/Globals.js"], + a["Core/Renderer/SVG/SVGElement.js"], + a["Core/Renderer/SVG/SVGLabel.js"], + a["Core/Utilities.js"], + ], + function (a, f, l, m) { + function n(a) { + if (!a.focusBorderDestroyHook) { + var b = a.destroy; + a.destroy = function () { + var c, d; + null === + (d = + null === (c = a.focusBorder) || void 0 === c + ? void 0 + : c.destroy) || void 0 === d + ? void 0 + : d.call(c); + return b.apply(a, arguments); + }; + a.focusBorderDestroyHook = b; + } + } + function g(a) { + for (var c = [], d = 1; d < arguments.length; d++) + c[d - 1] = arguments[d]; + a.focusBorderUpdateHooks || + ((a.focusBorderUpdateHooks = {}), + b.forEach(function (b) { + b += "Setter"; + var d = a[b] || a._defaultSetter; + a.focusBorderUpdateHooks[b] = d; + a[b] = function () { + var b = d.apply(a, arguments); + a.addFocusBorder.apply(a, c); + return b; + }; + })); + } + function h(a) { + a.focusBorderUpdateHooks && + (Object.keys(a.focusBorderUpdateHooks).forEach(function (b) { + var c = a.focusBorderUpdateHooks[b]; + c === a._defaultSetter ? delete a[b] : (a[b] = c); + }), + delete a.focusBorderUpdateHooks); + } + var q = m.addEvent, + e = m.extend, + d = m.pick, + b = "x y transform width height r d stroke-width".split(" "); + e(f.prototype, { + addFocusBorder: function (b, e) { + this.focusBorder && this.removeFocusBorder(); + var c = this.getBBox(), + f = d(b, 3); + c.x += this.translateX ? this.translateX : 0; + c.y += this.translateY ? this.translateY : 0; + var h = c.x - f, + k = c.y - f, + m = c.width + 2 * f, + q = c.height + 2 * f, + p = this instanceof l; + if ("text" === this.element.nodeName || p) { + var u = !!this.rotation; + if (p) var x = { x: u ? 1 : 0, y: 0 }; + else + (h = x = 0), + "middle" === this.attr("text-anchor") + ? ((x = a.isFirefox && this.rotation ? 0.25 : 0.5), + (h = a.isFirefox && !this.rotation ? 0.75 : 0.5)) + : this.rotation + ? (x = 0.25) + : (h = 0.75), + (x = { x: x, y: h }); + h = +this.attr("x") - c.width * x.x - f; + k = +this.attr("y") - c.height * x.y - f; + p && + u && + ((p = m), + (m = q), + (q = p), + (h = +this.attr("x") - c.height * x.x - f), + (k = +this.attr("y") - c.width * x.y - f)); + } + this.focusBorder = this.renderer + .rect( + h, + k, + m, + q, + parseInt(((e && e.borderRadius) || 0).toString(), 10) + ) + .addClass("highcharts-focus-border") + .attr({ zIndex: 99 }) + .add(this.parentGroup); + this.renderer.styledMode || + this.focusBorder.attr({ + stroke: e && e.stroke, + "stroke-width": e && e.strokeWidth, + }); + g(this, b, e); + n(this); + }, + removeFocusBorder: function () { + h(this); + this.focusBorderDestroyHook && + ((this.destroy = this.focusBorderDestroyHook), + delete this.focusBorderDestroyHook); + this.focusBorder && + (this.focusBorder.destroy(), delete this.focusBorder); + }, + }); + a.Chart.prototype.renderFocusBorder = function () { + var a = this.focusElement, + b = this.options.accessibility.keyboardNavigation.focusBorder; + a && + (a.removeFocusBorder(), + b.enabled && + a.addFocusBorder(b.margin, { + stroke: b.style.color, + strokeWidth: b.style.lineWidth, + borderRadius: b.style.borderRadius, + })); + }; + a.Chart.prototype.setFocusToElement = function (a, b) { + var c = this.options.accessibility.keyboardNavigation.focusBorder; + (b = b || a.element) && + b.focus && + ((b.hcEvents && b.hcEvents.focusin) || + q(b, "focusin", function () {}), + b.focus(), + c.hideBrowserFocusOutline && (b.style.outline = "none")); + this.focusElement && this.focusElement.removeFocusBorder(); + this.focusElement = a; + this.renderFocusBorder(); + }; + } + ); + p( + a, + "Accessibility/Accessibility.js", + [ + a["Accessibility/Utils/ChartUtilities.js"], + a["Core/Globals.js"], + a["Accessibility/KeyboardNavigationHandler.js"], + a["Core/Series/CartesianSeries.js"], + a["Core/Options.js"], + a["Core/Series/Point.js"], + a["Core/Utilities.js"], + a["Accessibility/AccessibilityComponent.js"], + a["Accessibility/KeyboardNavigation.js"], + a["Accessibility/Components/LegendComponent.js"], + a["Accessibility/Components/MenuComponent.js"], + a["Accessibility/Components/SeriesComponent/SeriesComponent.js"], + a["Accessibility/Components/ZoomComponent.js"], + a["Accessibility/Components/RangeSelectorComponent.js"], + a["Accessibility/Components/InfoRegionsComponent.js"], + a["Accessibility/Components/ContainerComponent.js"], + a["Accessibility/HighContrastMode.js"], + a["Accessibility/HighContrastTheme.js"], + a["Accessibility/Options/Options.js"], + a["Accessibility/Options/LangOptions.js"], + a["Accessibility/Options/DeprecatedOptions.js"], + ], + function (a, f, l, m, n, g, h, p, e, d, b, c, k, t, v, w, H, A, D, y, z) { + function q(a) { + this.init(a); + } + var r = f.doc, + u = h.addEvent, + F = h.extend, + B = h.fireEvent, + E = h.merge; + E(!0, n.defaultOptions, D, { + accessibility: { highContrastTheme: A }, + lang: y, + }); + f.A11yChartUtilities = a; + f.KeyboardNavigationHandler = l; + f.AccessibilityComponent = p; + q.prototype = { + init: function (a) { + this.chart = a; + r.addEventListener && a.renderer.isSVG + ? (z(a), + this.initComponents(), + (this.keyboardNavigation = new e(a, this.components)), + this.update()) + : a.renderTo.setAttribute("aria-hidden", !0); + }, + initComponents: function () { + var a = this.chart, + e = a.options.accessibility; + this.components = { + container: new w(), + infoRegions: new v(), + legend: new d(), + chartMenu: new b(), + rangeSelector: new t(), + series: new c(), + zoom: new k(), + }; + e.customComponents && F(this.components, e.customComponents); + var f = this.components; + this.getComponentOrder().forEach(function (b) { + f[b].initBase(a); + f[b].init(); + }); + }, + getComponentOrder: function () { + if (!this.components) return []; + if (!this.components.series) return Object.keys(this.components); + var a = Object.keys(this.components).filter(function (a) { + return "series" !== a; + }); + return ["series"].concat(a); + }, + update: function () { + var a = this.components, + b = this.chart, + c = b.options.accessibility; + B(b, "beforeA11yUpdate"); + b.types = this.getChartTypes(); + this.getComponentOrder().forEach(function (c) { + a[c].onChartUpdate(); + B(b, "afterA11yComponentUpdate", { name: c, component: a[c] }); + }); + this.keyboardNavigation.update(c.keyboardNavigation.order); + !b.highContrastModeActive && + H.isHighContrastModeActive() && + H.setHighContrastTheme(b); + B(b, "afterA11yUpdate", { accessibility: this }); + }, + destroy: function () { + var a = this.chart || {}, + b = this.components; + Object.keys(b).forEach(function (a) { + b[a].destroy(); + b[a].destroyBase(); + }); + this.keyboardNavigation && this.keyboardNavigation.destroy(); + a.renderTo && a.renderTo.setAttribute("aria-hidden", !0); + a.focusElement && a.focusElement.removeFocusBorder(); + }, + getChartTypes: function () { + var a = {}; + this.chart.series.forEach(function (b) { + a[b.type] = 1; + }); + return Object.keys(a); + }, + }; + f.Chart.prototype.updateA11yEnabled = function () { + var a = this.accessibility, + b = this.options.accessibility; + b && b.enabled + ? a + ? a.update() + : (this.accessibility = new q(this)) + : a + ? (a.destroy && a.destroy(), delete this.accessibility) + : this.renderTo.setAttribute("aria-hidden", !0); + }; + u(f.Chart, "render", function (a) { + this.a11yDirty && + this.renderTo && + (delete this.a11yDirty, this.updateA11yEnabled()); + var b = this.accessibility; + b && + b.getComponentOrder().forEach(function (a) { + b.components[a].onChartRender(); + }); + }); + u(f.Chart, "update", function (a) { + if ((a = a.options.accessibility)) + a.customComponents && + ((this.options.accessibility.customComponents = a.customComponents), + delete a.customComponents), + E(!0, this.options.accessibility, a), + this.accessibility && + this.accessibility.destroy && + (this.accessibility.destroy(), delete this.accessibility); + this.a11yDirty = !0; + }); + u(g, "update", function () { + this.series.chart.accessibility && (this.series.chart.a11yDirty = !0); + }); + ["addSeries", "init"].forEach(function (a) { + u(f.Chart, a, function () { + this.a11yDirty = !0; + }); + }); + ["update", "updatedData", "remove"].forEach(function (a) { + u(m, a, function () { + this.chart.accessibility && (this.chart.a11yDirty = !0); + }); + }); + ["afterDrilldown", "drillupall"].forEach(function (a) { + u(f.Chart, a, function () { + this.accessibility && this.accessibility.update(); + }); + }); + u(f.Chart, "destroy", function () { + this.accessibility && this.accessibility.destroy(); + }); + } + ); + p(a, "masters/modules/accessibility.src.js", [], function () {}); +}); +//# sourceMappingURL=accessibility.js.map diff --git a/notemyprogress/js/vue.js b/notemyprogress/js/vue.js index 919aa1251299c4970b9860571d26c1852141e4ad..5632204c8494f4ae8ceada93ee28f233ee07433b 100644 --- a/notemyprogress/js/vue.js +++ b/notemyprogress/js/vue.js @@ -4,10 +4,13 @@ * Released under the MIT License. */ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.Vue = factory()); -}(this, function () { 'use strict'; + typeof exports === "object" && typeof module !== "undefined" + ? (module.exports = factory()) + : typeof define === "function" && define.amd + ? define(factory) + : ((global = global || self), (global.Vue = factory())); +})(this, function () { + "use strict"; /* */ @@ -15,33 +18,33 @@ // These helpers produce better VM code in JS engines due to their // explicitness and function inlining. - function isUndef (v) { - return v === undefined || v === null + function isUndef(v) { + return v === undefined || v === null; } - function isDef (v) { - return v !== undefined && v !== null + function isDef(v) { + return v !== undefined && v !== null; } - function isTrue (v) { - return v === true + function isTrue(v) { + return v === true; } - function isFalse (v) { - return v === false + function isFalse(v) { + return v === false; } /** * Check if value is primitive. */ - function isPrimitive (value) { + function isPrimitive(value) { return ( - typeof value === 'string' || - typeof value === 'number' || + typeof value === "string" || + typeof value === "number" || // $flow-disable-line - typeof value === 'symbol' || - typeof value === 'boolean' - ) + typeof value === "symbol" || + typeof value === "boolean" + ); } /** @@ -49,8 +52,8 @@ * Objects from primitive values when we know the value * is a JSON-compliant type. */ - function isObject (obj) { - return obj !== null && typeof obj === 'object' + function isObject(obj) { + return obj !== null && typeof obj === "object"; } /** @@ -58,94 +61,95 @@ */ var _toString = Object.prototype.toString; - function toRawType (value) { - return _toString.call(value).slice(8, -1) + function toRawType(value) { + return _toString.call(value).slice(8, -1); } /** * Strict object type check. Only returns true * for plain JavaScript objects. */ - function isPlainObject (obj) { - return _toString.call(obj) === '[object Object]' + function isPlainObject(obj) { + return _toString.call(obj) === "[object Object]"; } - function isRegExp (v) { - return _toString.call(v) === '[object RegExp]' + function isRegExp(v) { + return _toString.call(v) === "[object RegExp]"; } /** * Check if val is a valid array index. */ - function isValidArrayIndex (val) { + function isValidArrayIndex(val) { var n = parseFloat(String(val)); - return n >= 0 && Math.floor(n) === n && isFinite(val) + return n >= 0 && Math.floor(n) === n && isFinite(val); } - function isPromise (val) { + function isPromise(val) { return ( isDef(val) && - typeof val.then === 'function' && - typeof val.catch === 'function' - ) + typeof val.then === "function" && + typeof val.catch === "function" + ); } /** * Convert a value to a string that is actually rendered. */ - function toString (val) { + function toString(val) { return val == null - ? '' + ? "" : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString) - ? JSON.stringify(val, null, 2) - : String(val) + ? JSON.stringify(val, null, 2) + : String(val); } /** * Convert an input value to a number for persistence. * If the conversion fails, return original string. */ - function toNumber (val) { + function toNumber(val) { var n = parseFloat(val); - return isNaN(n) ? val : n + return isNaN(n) ? val : n; } /** * Make a map and return a function for checking if a key * is in that map. */ - function makeMap ( - str, - expectsLowerCase - ) { + function makeMap(str, expectsLowerCase) { var map = Object.create(null); - var list = str.split(','); + var list = str.split(","); for (var i = 0; i < list.length; i++) { map[list[i]] = true; } return expectsLowerCase - ? function (val) { return map[val.toLowerCase()]; } - : function (val) { return map[val]; } + ? function (val) { + return map[val.toLowerCase()]; + } + : function (val) { + return map[val]; + }; } /** * Check if a tag is a built-in tag. */ - var isBuiltInTag = makeMap('slot,component', true); + var isBuiltInTag = makeMap("slot,component", true); /** * Check if an attribute is a reserved attribute. */ - var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); + var isReservedAttribute = makeMap("key,ref,slot,slot-scope,is"); /** * Remove an item from an array. */ - function remove (arr, item) { + function remove(arr, item) { if (arr.length) { var index = arr.indexOf(item); if (index > -1) { - return arr.splice(index, 1) + return arr.splice(index, 1); } } } @@ -154,19 +158,19 @@ * Check whether an object has the property. */ var hasOwnProperty = Object.prototype.hasOwnProperty; - function hasOwn (obj, key) { - return hasOwnProperty.call(obj, key) + function hasOwn(obj, key) { + return hasOwnProperty.call(obj, key); } /** * Create a cached version of a pure function. */ - function cached (fn) { + function cached(fn) { var cache = Object.create(null); - return (function cachedFn (str) { + return function cachedFn(str) { var hit = cache[str]; - return hit || (cache[str] = fn(str)) - }) + return hit || (cache[str] = fn(str)); + }; } /** @@ -174,14 +178,16 @@ */ var camelizeRE = /-(\w)/g; var camelize = cached(function (str) { - return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) + return str.replace(camelizeRE, function (_, c) { + return c ? c.toUpperCase() : ""; + }); }); /** * Capitalize a string. */ var capitalize = cached(function (str) { - return str.charAt(0).toUpperCase() + str.slice(1) + return str.charAt(0).toUpperCase() + str.slice(1); }); /** @@ -189,7 +195,7 @@ */ var hyphenateRE = /\B([A-Z])/g; var hyphenate = cached(function (str) { - return str.replace(hyphenateRE, '-$1').toLowerCase() + return str.replace(hyphenateRE, "-$1").toLowerCase(); }); /** @@ -201,62 +207,60 @@ */ /* istanbul ignore next */ - function polyfillBind (fn, ctx) { - function boundFn (a) { + function polyfillBind(fn, ctx) { + function boundFn(a) { var l = arguments.length; return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) - : fn.call(ctx) + : fn.call(ctx); } boundFn._length = fn.length; - return boundFn + return boundFn; } - function nativeBind (fn, ctx) { - return fn.bind(ctx) + function nativeBind(fn, ctx) { + return fn.bind(ctx); } - var bind = Function.prototype.bind - ? nativeBind - : polyfillBind; + var bind = Function.prototype.bind ? nativeBind : polyfillBind; /** * Convert an Array-like object to a real Array. */ - function toArray (list, start) { + function toArray(list, start) { start = start || 0; var i = list.length - start; var ret = new Array(i); while (i--) { ret[i] = list[i + start]; } - return ret + return ret; } /** * Mix properties into target object. */ - function extend (to, _from) { + function extend(to, _from) { for (var key in _from) { to[key] = _from[key]; } - return to + return to; } /** * Merge an Array of Objects into a single Object. */ - function toObject (arr) { + function toObject(arr) { var res = {}; for (var i = 0; i < arr.length; i++) { if (arr[i]) { extend(res, arr[i]); } } - return res + return res; } /* eslint-disable no-unused-vars */ @@ -266,35 +270,43 @@ * Stubbing args to make Flow happy without leaving useless transpiled code * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/). */ - function noop (a, b, c) {} + function noop(a, b, c) {} /** * Always return false. */ - var no = function (a, b, c) { return false; }; + var no = function (a, b, c) { + return false; + }; /* eslint-enable no-unused-vars */ /** * Return the same value. */ - var identity = function (_) { return _; }; + var identity = function (_) { + return _; + }; /** * Generate a string containing static keys from compiler modules. */ - function genStaticKeys (modules) { - return modules.reduce(function (keys, m) { - return keys.concat(m.staticKeys || []) - }, []).join(',') + function genStaticKeys(modules) { + return modules + .reduce(function (keys, m) { + return keys.concat(m.staticKeys || []); + }, []) + .join(","); } /** * Check if two values are loosely equal - that is, * if they are plain objects, do they have the same shape? */ - function looseEqual (a, b) { - if (a === b) { return true } + function looseEqual(a, b) { + if (a === b) { + return true; + } var isObjectA = isObject(a); var isObjectB = isObject(b); if (isObjectA && isObjectB) { @@ -302,29 +314,35 @@ var isArrayA = Array.isArray(a); var isArrayB = Array.isArray(b); if (isArrayA && isArrayB) { - return a.length === b.length && a.every(function (e, i) { - return looseEqual(e, b[i]) - }) + return ( + a.length === b.length && + a.every(function (e, i) { + return looseEqual(e, b[i]); + }) + ); } else if (a instanceof Date && b instanceof Date) { - return a.getTime() === b.getTime() + return a.getTime() === b.getTime(); } else if (!isArrayA && !isArrayB) { var keysA = Object.keys(a); var keysB = Object.keys(b); - return keysA.length === keysB.length && keysA.every(function (key) { - return looseEqual(a[key], b[key]) - }) + return ( + keysA.length === keysB.length && + keysA.every(function (key) { + return looseEqual(a[key], b[key]); + }) + ); } else { /* istanbul ignore next */ - return false + return false; } } catch (e) { /* istanbul ignore next */ - return false + return false; } } else if (!isObjectA && !isObjectB) { - return String(a) === String(b) + return String(a) === String(b); } else { - return false + return false; } } @@ -333,54 +351,50 @@ * found in the array (if value is a plain object, the array must * contain an object of the same shape), or -1 if it is not present. */ - function looseIndexOf (arr, val) { + function looseIndexOf(arr, val) { for (var i = 0; i < arr.length; i++) { - if (looseEqual(arr[i], val)) { return i } + if (looseEqual(arr[i], val)) { + return i; + } } - return -1 + return -1; } /** * Ensure a function is called only once. */ - function once (fn) { + function once(fn) { var called = false; return function () { if (!called) { called = true; fn.apply(this, arguments); } - } + }; } - var SSR_ATTR = 'data-server-rendered'; + var SSR_ATTR = "data-server-rendered"; - var ASSET_TYPES = [ - 'component', - 'directive', - 'filter' - ]; + var ASSET_TYPES = ["component", "directive", "filter"]; var LIFECYCLE_HOOKS = [ - 'beforeCreate', - 'created', - 'beforeMount', - 'mounted', - 'beforeUpdate', - 'updated', - 'beforeDestroy', - 'destroyed', - 'activated', - 'deactivated', - 'errorCaptured', - 'serverPrefetch' + "beforeCreate", + "created", + "beforeMount", + "mounted", + "beforeUpdate", + "updated", + "beforeDestroy", + "destroyed", + "activated", + "deactivated", + "errorCaptured", + "serverPrefetch", ]; /* */ - - - var config = ({ + var config = { /** * Option merge strategies (used in core/util/options) */ @@ -395,12 +409,12 @@ /** * Show production mode tip message on boot? */ - productionTip: "development" !== 'production', + productionTip: "development" !== "production", /** * Whether to enable devtools */ - devtools: "development" !== 'production', + devtools: "development" !== "production", /** * Whether to record perf @@ -471,8 +485,8 @@ /** * Exposed for legacy reasons */ - _lifecycleHooks: LIFECYCLE_HOOKS - }); + _lifecycleHooks: LIFECYCLE_HOOKS, + }; /* */ @@ -481,79 +495,83 @@ * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname * skipping \u10000-\uEFFFF due to it freezing up PhantomJS */ - var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/; + var unicodeRegExp = + /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/; /** * Check if a string starts with $ or _ */ - function isReserved (str) { - var c = (str + '').charCodeAt(0); - return c === 0x24 || c === 0x5F + function isReserved(str) { + var c = (str + "").charCodeAt(0); + return c === 0x24 || c === 0x5f; } /** * Define a property. */ - function def (obj, key, val, enumerable) { + function def(obj, key, val, enumerable) { Object.defineProperty(obj, key, { value: val, enumerable: !!enumerable, writable: true, - configurable: true + configurable: true, }); } /** * Parse simple path. */ - var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]")); - function parsePath (path) { + var bailRE = new RegExp("[^" + unicodeRegExp.source + ".$_\\d]"); + function parsePath(path) { if (bailRE.test(path)) { - return + return; } - var segments = path.split('.'); + var segments = path.split("."); return function (obj) { for (var i = 0; i < segments.length; i++) { - if (!obj) { return } + if (!obj) { + return; + } obj = obj[segments[i]]; } - return obj - } + return obj; + }; } /* */ // can we use __proto__? - var hasProto = '__proto__' in {}; + var hasProto = "__proto__" in {}; // Browser environment sniffing - var inBrowser = typeof window !== 'undefined'; - var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; + var inBrowser = typeof window !== "undefined"; + var inWeex = typeof WXEnvironment !== "undefined" && !!WXEnvironment.platform; var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); var UA = inBrowser && window.navigator.userAgent.toLowerCase(); var isIE = UA && /msie|trident/.test(UA); - var isIE9 = UA && UA.indexOf('msie 9.0') > 0; - var isEdge = UA && UA.indexOf('edge/') > 0; - var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); - var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); + var isIE9 = UA && UA.indexOf("msie 9.0") > 0; + var isEdge = UA && UA.indexOf("edge/") > 0; + var isAndroid = + (UA && UA.indexOf("android") > 0) || weexPlatform === "android"; + var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || weexPlatform === "ios"; var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; var isPhantomJS = UA && /phantomjs/.test(UA); var isFF = UA && UA.match(/firefox\/(\d+)/); // Firefox has a "watch" function on Object.prototype... - var nativeWatch = ({}).watch; + var nativeWatch = {}.watch; var supportsPassive = false; if (inBrowser) { try { var opts = {}; - Object.defineProperty(opts, 'passive', ({ - get: function get () { + Object.defineProperty(opts, "passive", { + get: function get() { /* istanbul ignore next */ supportsPassive = true; - } - })); // https://github.com/facebook/flow/issues/285 - window.addEventListener('test-passive', null, opts); + }, + }); // https://github.com/facebook/flow/issues/285 + window.addEventListener("test-passive", null, opts); } catch (e) {} } @@ -563,93 +581,101 @@ var isServerRendering = function () { if (_isServer === undefined) { /* istanbul ignore if */ - if (!inBrowser && !inWeex && typeof global !== 'undefined') { + if (!inBrowser && !inWeex && typeof global !== "undefined") { // detect presence of vue-server-renderer and avoid // Webpack shimming the process - _isServer = global['process'] && global['process'].env.VUE_ENV === 'server'; + _isServer = + global["process"] && global["process"].env.VUE_ENV === "server"; } else { _isServer = false; } } - return _isServer + return _isServer; }; // detect devtools var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; /* istanbul ignore next */ - function isNative (Ctor) { - return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) + function isNative(Ctor) { + return typeof Ctor === "function" && /native code/.test(Ctor.toString()); } var hasSymbol = - typeof Symbol !== 'undefined' && isNative(Symbol) && - typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); + typeof Symbol !== "undefined" && + isNative(Symbol) && + typeof Reflect !== "undefined" && + isNative(Reflect.ownKeys); var _Set; /* istanbul ignore if */ // $flow-disable-line - if (typeof Set !== 'undefined' && isNative(Set)) { + if (typeof Set !== "undefined" && isNative(Set)) { // use native Set when available. _Set = Set; } else { // a non-standard Set polyfill that only works with primitive keys. - _Set = /*@__PURE__*/(function () { - function Set () { + _Set = /*@__PURE__*/ (function () { + function Set() { this.set = Object.create(null); } - Set.prototype.has = function has (key) { - return this.set[key] === true + Set.prototype.has = function has(key) { + return this.set[key] === true; }; - Set.prototype.add = function add (key) { + Set.prototype.add = function add(key) { this.set[key] = true; }; - Set.prototype.clear = function clear () { + Set.prototype.clear = function clear() { this.set = Object.create(null); }; return Set; - }()); + })(); } /* */ var warn = noop; var tip = noop; - var generateComponentTrace = (noop); // work around flow check - var formatComponentName = (noop); + var generateComponentTrace = noop; // work around flow check + var formatComponentName = noop; { - var hasConsole = typeof console !== 'undefined'; + var hasConsole = typeof console !== "undefined"; var classifyRE = /(?:^|[-_])(\w)/g; - var classify = function (str) { return str - .replace(classifyRE, function (c) { return c.toUpperCase(); }) - .replace(/[-_]/g, ''); }; + var classify = function (str) { + return str + .replace(classifyRE, function (c) { + return c.toUpperCase(); + }) + .replace(/[-_]/g, ""); + }; warn = function (msg, vm) { - var trace = vm ? generateComponentTrace(vm) : ''; + var trace = vm ? generateComponentTrace(vm) : ""; if (config.warnHandler) { config.warnHandler.call(null, msg, vm, trace); - } else if (hasConsole && (!config.silent)) { - console.error(("[Vue warn]: " + msg + trace)); + } else if (hasConsole && !config.silent) { + console.error("[Vue warn]: " + msg + trace); } }; tip = function (msg, vm) { - if (hasConsole && (!config.silent)) { - console.warn("[Vue tip]: " + msg + ( - vm ? generateComponentTrace(vm) : '' - )); + if (hasConsole && !config.silent) { + console.warn( + "[Vue tip]: " + msg + (vm ? generateComponentTrace(vm) : "") + ); } }; formatComponentName = function (vm, includeFile) { if (vm.$root === vm) { - return '<Root>' + return "<Root>"; } - var options = typeof vm === 'function' && vm.cid != null - ? vm.options - : vm._isVue + var options = + typeof vm === "function" && vm.cid != null + ? vm.options + : vm._isVue ? vm.$options || vm.constructor.options : vm; var name = options.name || options._componentTag; @@ -660,19 +686,23 @@ } return ( - (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") + - (file && includeFile !== false ? (" at " + file) : '') - ) + (name ? "<" + classify(name) + ">" : "<Anonymous>") + + (file && includeFile !== false ? " at " + file : "") + ); }; var repeat = function (str, n) { - var res = ''; + var res = ""; while (n) { - if (n % 2 === 1) { res += str; } - if (n > 1) { str += str; } + if (n % 2 === 1) { + res += str; + } + if (n > 1) { + str += str; + } n >>= 1; } - return res + return res; }; generateComponentTrace = function (vm) { @@ -685,7 +715,7 @@ if (last.constructor === vm.constructor) { currentRecursiveSequence++; vm = vm.$parent; - continue + continue; } else if (currentRecursiveSequence > 0) { tree[tree.length - 1] = [last, currentRecursiveSequence]; currentRecursiveSequence = 0; @@ -694,13 +724,25 @@ tree.push(vm); vm = vm.$parent; } - return '\n\nfound in\n\n' + tree - .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) - ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") - : formatComponentName(vm))); }) - .join('\n') + return ( + "\n\nfound in\n\n" + + tree + .map(function (vm, i) { + return ( + "" + + (i === 0 ? "---> " : repeat(" ", 5 + i * 2)) + + (Array.isArray(vm) + ? formatComponentName(vm[0]) + + "... (" + + vm[1] + + " recursive calls)" + : formatComponentName(vm)) + ); + }) + .join("\n") + ); } else { - return ("\n\n(found in " + (formatComponentName(vm)) + ")") + return "\n\n(found in " + formatComponentName(vm) + ")"; } }; } @@ -713,33 +755,35 @@ * A dep is an observable that can have multiple * directives subscribing to it. */ - var Dep = function Dep () { + var Dep = function Dep() { this.id = uid++; this.subs = []; }; - Dep.prototype.addSub = function addSub (sub) { + Dep.prototype.addSub = function addSub(sub) { this.subs.push(sub); }; - Dep.prototype.removeSub = function removeSub (sub) { + Dep.prototype.removeSub = function removeSub(sub) { remove(this.subs, sub); }; - Dep.prototype.depend = function depend () { + Dep.prototype.depend = function depend() { if (Dep.target) { Dep.target.addDep(this); } }; - Dep.prototype.notify = function notify () { + Dep.prototype.notify = function notify() { // stabilize the subscriber list first var subs = this.subs.slice(); if (!config.async) { // subs aren't sorted in scheduler if not running async // we need to sort them now to make sure they fire in correct // order - subs.sort(function (a, b) { return a.id - b.id; }); + subs.sort(function (a, b) { + return a.id - b.id; + }); } for (var i = 0, l = subs.length; i < l; i++) { subs[i].update(); @@ -752,19 +796,19 @@ Dep.target = null; var targetStack = []; - function pushTarget (target) { + function pushTarget(target) { targetStack.push(target); Dep.target = target; } - function popTarget () { + function popTarget() { targetStack.pop(); Dep.target = targetStack[targetStack.length - 1]; } /* */ - var VNode = function VNode ( + var VNode = function VNode( tag, data, children, @@ -804,29 +848,29 @@ // DEPRECATED: alias for componentInstance for backwards compat. /* istanbul ignore next */ prototypeAccessors.child.get = function () { - return this.componentInstance + return this.componentInstance; }; - Object.defineProperties( VNode.prototype, prototypeAccessors ); + Object.defineProperties(VNode.prototype, prototypeAccessors); var createEmptyVNode = function (text) { - if ( text === void 0 ) text = ''; + if (text === void 0) text = ""; var node = new VNode(); node.text = text; node.isComment = true; - return node + return node; }; - function createTextVNode (val) { - return new VNode(undefined, undefined, undefined, String(val)) + function createTextVNode(val) { + return new VNode(undefined, undefined, undefined, String(val)); } // optimized shallow clone // used for static nodes and slot nodes because they may be reused across // multiple renders, cloning them avoids errors when DOM manipulations rely // on their elm reference. - function cloneVNode (vnode) { + function cloneVNode(vnode) { var cloned = new VNode( vnode.tag, vnode.data, @@ -849,7 +893,7 @@ cloned.fnScopeId = vnode.fnScopeId; cloned.asyncMeta = vnode.asyncMeta; cloned.isCloned = true; - return cloned + return cloned; } /* @@ -861,13 +905,13 @@ var arrayMethods = Object.create(arrayProto); var methodsToPatch = [ - 'push', - 'pop', - 'shift', - 'unshift', - 'splice', - 'sort', - 'reverse' + "push", + "pop", + "shift", + "unshift", + "splice", + "sort", + "reverse", ]; /** @@ -876,26 +920,29 @@ methodsToPatch.forEach(function (method) { // cache original method var original = arrayProto[method]; - def(arrayMethods, method, function mutator () { - var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; + def(arrayMethods, method, function mutator() { + var args = [], + len = arguments.length; + while (len--) args[len] = arguments[len]; var result = original.apply(this, args); var ob = this.__ob__; var inserted; switch (method) { - case 'push': - case 'unshift': + case "push": + case "unshift": inserted = args; - break - case 'splice': + break; + case "splice": inserted = args.slice(2); - break + break; + } + if (inserted) { + ob.observeArray(inserted); } - if (inserted) { ob.observeArray(inserted); } // notify change ob.dep.notify(); - return result + return result; }); }); @@ -909,7 +956,7 @@ */ var shouldObserve = true; - function toggleObserving (value) { + function toggleObserving(value) { shouldObserve = value; } @@ -919,11 +966,11 @@ * object's property keys into getter/setters that * collect dependencies and dispatch updates. */ - var Observer = function Observer (value) { + var Observer = function Observer(value) { this.value = value; this.dep = new Dep(); this.vmCount = 0; - def(value, '__ob__', this); + def(value, "__ob__", this); if (Array.isArray(value)) { if (hasProto) { protoAugment(value, arrayMethods); @@ -941,7 +988,7 @@ * getter/setters. This method should only be called when * value type is Object. */ - Observer.prototype.walk = function walk (obj) { + Observer.prototype.walk = function walk(obj) { var keys = Object.keys(obj); for (var i = 0; i < keys.length; i++) { defineReactive$$1(obj, keys[i]); @@ -951,7 +998,7 @@ /** * Observe a list of Array items. */ - Observer.prototype.observeArray = function observeArray (items) { + Observer.prototype.observeArray = function observeArray(items) { for (var i = 0, l = items.length; i < l; i++) { observe(items[i]); } @@ -963,7 +1010,7 @@ * Augment a target Object or Array by intercepting * the prototype chain using __proto__ */ - function protoAugment (target, src) { + function protoAugment(target, src) { /* eslint-disable no-proto */ target.__proto__ = src; /* eslint-enable no-proto */ @@ -974,7 +1021,7 @@ * hidden properties. */ /* istanbul ignore next */ - function copyAugment (target, src, keys) { + function copyAugment(target, src, keys) { for (var i = 0, l = keys.length; i < l; i++) { var key = keys[i]; def(target, key, src[key]); @@ -986,12 +1033,12 @@ * returns the new observer if successfully observed, * or the existing observer if the value already has one. */ - function observe (value, asRootData) { + function observe(value, asRootData) { if (!isObject(value) || value instanceof VNode) { - return + return; } var ob; - if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { + if (hasOwn(value, "__ob__") && value.__ob__ instanceof Observer) { ob = value.__ob__; } else if ( shouldObserve && @@ -1005,24 +1052,18 @@ if (asRootData && ob) { ob.vmCount++; } - return ob + return ob; } /** * Define a reactive property on an Object. */ - function defineReactive$$1 ( - obj, - key, - val, - customSetter, - shallow - ) { + function defineReactive$$1(obj, key, val, customSetter, shallow) { var dep = new Dep(); var property = Object.getOwnPropertyDescriptor(obj, key); if (property && property.configurable === false) { - return + return; } // cater for pre-defined getter/setters @@ -1036,7 +1077,7 @@ Object.defineProperty(obj, key, { enumerable: true, configurable: true, - get: function reactiveGetter () { + get: function reactiveGetter() { var value = getter ? getter.call(obj) : val; if (Dep.target) { dep.depend(); @@ -1047,20 +1088,22 @@ } } } - return value + return value; }, - set: function reactiveSetter (newVal) { + set: function reactiveSetter(newVal) { var value = getter ? getter.call(obj) : val; /* eslint-disable no-self-compare */ if (newVal === value || (newVal !== newVal && value !== value)) { - return + return; } /* eslint-enable no-self-compare */ if (customSetter) { customSetter(); } // #7981: for accessor properties without setter - if (getter && !setter) { return } + if (getter && !setter) { + return; + } if (setter) { setter.call(obj, newVal); } else { @@ -1068,7 +1111,7 @@ } childOb = !shallow && observe(newVal); dep.notify(); - } + }, }); } @@ -1077,63 +1120,67 @@ * triggers change notification if the property doesn't * already exist. */ - function set (target, key, val) { - if (isUndef(target) || isPrimitive(target) - ) { - warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target)))); + function set(target, key, val) { + if (isUndef(target) || isPrimitive(target)) { + warn( + "Cannot set reactive property on undefined, null, or primitive value: " + + target + ); } if (Array.isArray(target) && isValidArrayIndex(key)) { target.length = Math.max(target.length, key); target.splice(key, 1, val); - return val + return val; } if (key in target && !(key in Object.prototype)) { target[key] = val; - return val + return val; } - var ob = (target).__ob__; + var ob = target.__ob__; if (target._isVue || (ob && ob.vmCount)) { warn( - 'Avoid adding reactive properties to a Vue instance or its root $data ' + - 'at runtime - declare it upfront in the data option.' + "Avoid adding reactive properties to a Vue instance or its root $data " + + "at runtime - declare it upfront in the data option." ); - return val + return val; } if (!ob) { target[key] = val; - return val + return val; } defineReactive$$1(ob.value, key, val); ob.dep.notify(); - return val + return val; } /** * Delete a property and trigger change if necessary. */ - function del (target, key) { - if (isUndef(target) || isPrimitive(target) - ) { - warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target)))); + function del(target, key) { + if (isUndef(target) || isPrimitive(target)) { + warn( + "Cannot delete reactive property on undefined, null, or primitive value: " + + target + ); } if (Array.isArray(target) && isValidArrayIndex(key)) { target.splice(key, 1); - return + return; } - var ob = (target).__ob__; + var ob = target.__ob__; if (target._isVue || (ob && ob.vmCount)) { warn( - 'Avoid deleting properties on a Vue instance or its root $data ' + - '- just set it to null.' + "Avoid deleting properties on a Vue instance or its root $data " + + "- just set it to null." ); - return + return; } if (!hasOwn(target, key)) { - return + return; } delete target[key]; if (!ob) { - return + return; } ob.dep.notify(); } @@ -1142,8 +1189,8 @@ * Collect dependencies on array elements when the array is touched, since * we cannot intercept array element access like property getters. */ - function dependArray (value) { - for (var e = (void 0), i = 0, l = value.length; i < l; i++) { + function dependArray(value) { + for (var e = void 0, i = 0, l = value.length; i < l; i++) { e = value[i]; e && e.__ob__ && e.__ob__.dep.depend(); if (Array.isArray(e)) { @@ -1168,29 +1215,33 @@ strats.el = strats.propsData = function (parent, child, vm, key) { if (!vm) { warn( - "option \"" + key + "\" can only be used during instance " + - 'creation with the `new` keyword.' + 'option "' + + key + + '" can only be used during instance ' + + "creation with the `new` keyword." ); } - return defaultStrat(parent, child) + return defaultStrat(parent, child); }; } /** * Helper that recursively merges two data objects together. */ - function mergeData (to, from) { - if (!from) { return to } + function mergeData(to, from) { + if (!from) { + return to; + } var key, toVal, fromVal; - var keys = hasSymbol - ? Reflect.ownKeys(from) - : Object.keys(from); + var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from); for (var i = 0; i < keys.length; i++) { key = keys[i]; // in case the object is already observed... - if (key === '__ob__') { continue } + if (key === "__ob__") { + continue; + } toVal = to[key]; fromVal = from[key]; if (!hasOwn(to, key)) { @@ -1203,103 +1254,90 @@ mergeData(toVal, fromVal); } } - return to + return to; } /** * Data */ - function mergeDataOrFn ( - parentVal, - childVal, - vm - ) { + function mergeDataOrFn(parentVal, childVal, vm) { if (!vm) { // in a Vue.extend merge, both should be functions if (!childVal) { - return parentVal + return parentVal; } if (!parentVal) { - return childVal + return childVal; } // when parentVal & childVal are both present, // we need to return a function that returns the // merged result of both functions... no need to // check if parentVal is a function here because // it has to be a function to pass previous merges. - return function mergedDataFn () { + return function mergedDataFn() { return mergeData( - typeof childVal === 'function' ? childVal.call(this, this) : childVal, - typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal - ) - } + typeof childVal === "function" ? childVal.call(this, this) : childVal, + typeof parentVal === "function" + ? parentVal.call(this, this) + : parentVal + ); + }; } else { - return function mergedInstanceDataFn () { + return function mergedInstanceDataFn() { // instance merge - var instanceData = typeof childVal === 'function' - ? childVal.call(vm, vm) - : childVal; - var defaultData = typeof parentVal === 'function' - ? parentVal.call(vm, vm) - : parentVal; + var instanceData = + typeof childVal === "function" ? childVal.call(vm, vm) : childVal; + var defaultData = + typeof parentVal === "function" ? parentVal.call(vm, vm) : parentVal; if (instanceData) { - return mergeData(instanceData, defaultData) + return mergeData(instanceData, defaultData); } else { - return defaultData + return defaultData; } - } + }; } } - strats.data = function ( - parentVal, - childVal, - vm - ) { + strats.data = function (parentVal, childVal, vm) { if (!vm) { - if (childVal && typeof childVal !== 'function') { + if (childVal && typeof childVal !== "function") { warn( 'The "data" option should be a function ' + - 'that returns a per-instance value in component ' + - 'definitions.', + "that returns a per-instance value in component " + + "definitions.", vm ); - return parentVal + return parentVal; } - return mergeDataOrFn(parentVal, childVal) + return mergeDataOrFn(parentVal, childVal); } - return mergeDataOrFn(parentVal, childVal, vm) + return mergeDataOrFn(parentVal, childVal, vm); }; /** * Hooks and props are merged as arrays. */ - function mergeHook ( - parentVal, - childVal - ) { + function mergeHook(parentVal, childVal) { var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) - ? childVal - : [childVal] + ? childVal + : [childVal] : parentVal; - return res - ? dedupeHooks(res) - : res + return res ? dedupeHooks(res) : res; } - function dedupeHooks (hooks) { + function dedupeHooks(hooks) { var res = []; for (var i = 0; i < hooks.length; i++) { if (res.indexOf(hooks[i]) === -1) { res.push(hooks[i]); } } - return res + return res; } LIFECYCLE_HOOKS.forEach(function (hook) { @@ -1313,23 +1351,18 @@ * a three-way merge between constructor options, instance * options and parent options. */ - function mergeAssets ( - parentVal, - childVal, - vm, - key - ) { + function mergeAssets(parentVal, childVal, vm, key) { var res = Object.create(parentVal || null); if (childVal) { assertObjectType(key, childVal, vm); - return extend(res, childVal) + return extend(res, childVal); } else { - return res + return res; } } ASSET_TYPES.forEach(function (type) { - strats[type + 's'] = mergeAssets; + strats[type + "s"] = mergeAssets; }); /** @@ -1338,21 +1371,24 @@ * Watchers hashes should not overwrite one * another, so we merge them as arrays. */ - strats.watch = function ( - parentVal, - childVal, - vm, - key - ) { + strats.watch = function (parentVal, childVal, vm, key) { // work around Firefox's Object.prototype.watch... - if (parentVal === nativeWatch) { parentVal = undefined; } - if (childVal === nativeWatch) { childVal = undefined; } + if (parentVal === nativeWatch) { + parentVal = undefined; + } + if (childVal === nativeWatch) { + childVal = undefined; + } /* istanbul ignore if */ - if (!childVal) { return Object.create(parentVal || null) } + if (!childVal) { + return Object.create(parentVal || null); + } { assertObjectType(key, childVal, vm); } - if (!parentVal) { return childVal } + if (!parentVal) { + return childVal; + } var ret = {}; extend(ret, parentVal); for (var key$1 in childVal) { @@ -1363,63 +1399,70 @@ } ret[key$1] = parent ? parent.concat(child) - : Array.isArray(child) ? child : [child]; + : Array.isArray(child) + ? child + : [child]; } - return ret + return ret; }; /** * Other object hashes. */ strats.props = - strats.methods = - strats.inject = - strats.computed = function ( - parentVal, - childVal, - vm, - key - ) { - if (childVal && "development" !== 'production') { - assertObjectType(key, childVal, vm); - } - if (!parentVal) { return childVal } - var ret = Object.create(null); - extend(ret, parentVal); - if (childVal) { extend(ret, childVal); } - return ret - }; + strats.methods = + strats.inject = + strats.computed = + function (parentVal, childVal, vm, key) { + if (childVal && "development" !== "production") { + assertObjectType(key, childVal, vm); + } + if (!parentVal) { + return childVal; + } + var ret = Object.create(null); + extend(ret, parentVal); + if (childVal) { + extend(ret, childVal); + } + return ret; + }; strats.provide = mergeDataOrFn; /** * Default strategy. */ var defaultStrat = function (parentVal, childVal) { - return childVal === undefined - ? parentVal - : childVal + return childVal === undefined ? parentVal : childVal; }; /** * Validate component names */ - function checkComponents (options) { + function checkComponents(options) { for (var key in options.components) { validateComponentName(key); } } - function validateComponentName (name) { - if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) { + function validateComponentName(name) { + if ( + !new RegExp("^[a-zA-Z][\\-\\.0-9_" + unicodeRegExp.source + "]*$").test( + name + ) + ) { warn( - 'Invalid component name: "' + name + '". Component names ' + - 'should conform to valid custom element name in html5 specification.' + 'Invalid component name: "' + + name + + '". Component names ' + + "should conform to valid custom element name in html5 specification." ); } if (isBuiltInTag(name) || config.isReservedTag(name)) { warn( - 'Do not use built-in or reserved HTML elements as component ' + - 'id: ' + name + "Do not use built-in or reserved HTML elements as component " + + "id: " + + name ); } } @@ -1428,34 +1471,36 @@ * Ensure all props option syntax are normalized into the * Object-based format. */ - function normalizeProps (options, vm) { + function normalizeProps(options, vm) { var props = options.props; - if (!props) { return } + if (!props) { + return; + } var res = {}; var i, val, name; if (Array.isArray(props)) { i = props.length; while (i--) { val = props[i]; - if (typeof val === 'string') { + if (typeof val === "string") { name = camelize(val); res[name] = { type: null }; } else { - warn('props must be strings when using array syntax.'); + warn("props must be strings when using array syntax."); } } } else if (isPlainObject(props)) { for (var key in props) { val = props[key]; name = camelize(key); - res[name] = isPlainObject(val) - ? val - : { type: val }; + res[name] = isPlainObject(val) ? val : { type: val }; } } else { warn( - "Invalid value for option \"props\": expected an Array or an Object, " + - "but got " + (toRawType(props)) + ".", + 'Invalid value for option "props": expected an Array or an Object, ' + + "but got " + + toRawType(props) + + ".", vm ); } @@ -1465,10 +1510,12 @@ /** * Normalize all injections into Object-based format */ - function normalizeInject (options, vm) { + function normalizeInject(options, vm) { var inject = options.inject; - if (!inject) { return } - var normalized = options.inject = {}; + if (!inject) { + return; + } + var normalized = (options.inject = {}); if (Array.isArray(inject)) { for (var i = 0; i < inject.length; i++) { normalized[inject[i]] = { from: inject[i] }; @@ -1482,8 +1529,10 @@ } } else { warn( - "Invalid value for option \"inject\": expected an Array or an Object, " + - "but got " + (toRawType(inject)) + ".", + 'Invalid value for option "inject": expected an Array or an Object, ' + + "but got " + + toRawType(inject) + + ".", vm ); } @@ -1492,23 +1541,27 @@ /** * Normalize raw function directives into object format. */ - function normalizeDirectives (options) { + function normalizeDirectives(options) { var dirs = options.directives; if (dirs) { for (var key in dirs) { var def$$1 = dirs[key]; - if (typeof def$$1 === 'function') { + if (typeof def$$1 === "function") { dirs[key] = { bind: def$$1, update: def$$1 }; } } } } - function assertObjectType (name, value, vm) { + function assertObjectType(name, value, vm) { if (!isPlainObject(value)) { warn( - "Invalid value for option \"" + name + "\": expected an Object, " + - "but got " + (toRawType(value)) + ".", + 'Invalid value for option "' + + name + + '": expected an Object, ' + + "but got " + + toRawType(value) + + ".", vm ); } @@ -1518,16 +1571,12 @@ * Merge two option objects into a new one. * Core utility used in both instantiation and inheritance. */ - function mergeOptions ( - parent, - child, - vm - ) { + function mergeOptions(parent, child, vm) { { checkComponents(child); } - if (typeof child === 'function') { + if (typeof child === "function") { child = child.options; } @@ -1560,11 +1609,11 @@ mergeField(key); } } - function mergeField (key) { + function mergeField(key) { var strat = strats[key] || defaultStrat; options[key] = strat(parent[key], child[key], vm, key); } - return options + return options; } /** @@ -1572,53 +1621,44 @@ * This function is used because child instances need access * to assets defined in its ancestor chain. */ - function resolveAsset ( - options, - type, - id, - warnMissing - ) { + function resolveAsset(options, type, id, warnMissing) { /* istanbul ignore if */ - if (typeof id !== 'string') { - return + if (typeof id !== "string") { + return; } var assets = options[type]; // check local registration variations first - if (hasOwn(assets, id)) { return assets[id] } + if (hasOwn(assets, id)) { + return assets[id]; + } var camelizedId = camelize(id); - if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } + if (hasOwn(assets, camelizedId)) { + return assets[camelizedId]; + } var PascalCaseId = capitalize(camelizedId); - if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } + if (hasOwn(assets, PascalCaseId)) { + return assets[PascalCaseId]; + } // fallback to prototype chain var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; if (warnMissing && !res) { - warn( - 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, - options - ); + warn("Failed to resolve " + type.slice(0, -1) + ": " + id, options); } - return res + return res; } /* */ - - - function validateProp ( - key, - propOptions, - propsData, - vm - ) { + function validateProp(key, propOptions, propsData, vm) { var prop = propOptions[key]; var absent = !hasOwn(propsData, key); var value = propsData[key]; // boolean casting var booleanIndex = getTypeIndex(Boolean, prop.type); if (booleanIndex > -1) { - if (absent && !hasOwn(prop, 'default')) { + if (absent && !hasOwn(prop, "default")) { value = false; - } else if (value === '' || value === hyphenate(key)) { + } else if (value === "" || value === hyphenate(key)) { // only cast empty string / same name to boolean if // boolean has higher priority var stringIndex = getTypeIndex(String, prop.type); @@ -1640,61 +1680,56 @@ { assertProp(prop, key, value, vm, absent); } - return value + return value; } /** * Get the default value of a prop. */ - function getPropDefaultValue (vm, prop, key) { + function getPropDefaultValue(vm, prop, key) { // no default, return undefined - if (!hasOwn(prop, 'default')) { - return undefined + if (!hasOwn(prop, "default")) { + return undefined; } var def = prop.default; // warn against non-factory defaults for Object & Array if (isObject(def)) { warn( - 'Invalid default value for prop "' + key + '": ' + - 'Props with type Object/Array must use a factory function ' + - 'to return the default value.', + 'Invalid default value for prop "' + + key + + '": ' + + "Props with type Object/Array must use a factory function " + + "to return the default value.", vm ); } // the raw prop value was also undefined from previous render, // return previous default value to avoid unnecessary watcher trigger - if (vm && vm.$options.propsData && + if ( + vm && + vm.$options.propsData && vm.$options.propsData[key] === undefined && vm._props[key] !== undefined ) { - return vm._props[key] + return vm._props[key]; } // call factory function for non-Function types // a value is Function if its prototype is function even across different execution context - return typeof def === 'function' && getType(prop.type) !== 'Function' + return typeof def === "function" && getType(prop.type) !== "Function" ? def.call(vm) - : def + : def; } /** * Assert whether a prop is valid. */ - function assertProp ( - prop, - name, - value, - vm, - absent - ) { + function assertProp(prop, name, value, vm, absent) { if (prop.required && absent) { - warn( - 'Missing required prop: "' + name + '"', - vm - ); - return + warn('Missing required prop: "' + name + '"', vm); + return; } if (value == null && !prop.required) { - return + return; } var type = prop.type; var valid = !type || type === true; @@ -1705,23 +1740,22 @@ } for (var i = 0; i < type.length && !valid; i++) { var assertedType = assertType(value, type[i]); - expectedTypes.push(assertedType.expectedType || ''); + expectedTypes.push(assertedType.expectedType || ""); valid = assertedType.valid; } } if (!valid) { - warn( - getInvalidTypeMessage(name, value, expectedTypes), - vm - ); - return + warn(getInvalidTypeMessage(name, value, expectedTypes), vm); + return; } var validator = prop.validator; if (validator) { if (!validator(value)) { warn( - 'Invalid prop: custom validator check failed for prop "' + name + '".', + 'Invalid prop: custom validator check failed for prop "' + + name + + '".', vm ); } @@ -1730,27 +1764,27 @@ var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/; - function assertType (value, type) { + function assertType(value, type) { var valid; var expectedType = getType(type); if (simpleCheckRE.test(expectedType)) { var t = typeof value; valid = t === expectedType.toLowerCase(); // for primitive wrapper objects - if (!valid && t === 'object') { + if (!valid && t === "object") { valid = value instanceof type; } - } else if (expectedType === 'Object') { + } else if (expectedType === "Object") { valid = isPlainObject(value); - } else if (expectedType === 'Array') { + } else if (expectedType === "Array") { valid = Array.isArray(value); } else { valid = value instanceof type; } return { valid: valid, - expectedType: expectedType - } + expectedType: expectedType, + }; } /** @@ -1758,38 +1792,44 @@ * because a simple equality check will fail when running * across different vms / iframes. */ - function getType (fn) { + function getType(fn) { var match = fn && fn.toString().match(/^\s*function (\w+)/); - return match ? match[1] : '' + return match ? match[1] : ""; } - function isSameType (a, b) { - return getType(a) === getType(b) + function isSameType(a, b) { + return getType(a) === getType(b); } - function getTypeIndex (type, expectedTypes) { + function getTypeIndex(type, expectedTypes) { if (!Array.isArray(expectedTypes)) { - return isSameType(expectedTypes, type) ? 0 : -1 + return isSameType(expectedTypes, type) ? 0 : -1; } for (var i = 0, len = expectedTypes.length; i < len; i++) { if (isSameType(expectedTypes[i], type)) { - return i + return i; } } - return -1 + return -1; } - function getInvalidTypeMessage (name, value, expectedTypes) { - var message = "Invalid prop: type check failed for prop \"" + name + "\"." + - " Expected " + (expectedTypes.map(capitalize).join(', ')); + function getInvalidTypeMessage(name, value, expectedTypes) { + var message = + 'Invalid prop: type check failed for prop "' + + name + + '".' + + " Expected " + + expectedTypes.map(capitalize).join(", "); var expectedType = expectedTypes[0]; var receivedType = toRawType(value); var expectedValue = styleValue(value, expectedType); var receivedValue = styleValue(value, receivedType); // check if we need to specify expected value - if (expectedTypes.length === 1 && - isExplicable(expectedType) && - !isBoolean(expectedType, receivedType)) { + if ( + expectedTypes.length === 1 && + isExplicable(expectedType) && + !isBoolean(expectedType, receivedType) + ) { message += " with value " + expectedValue; } message += ", got " + receivedType + " "; @@ -1797,34 +1837,39 @@ if (isExplicable(receivedType)) { message += "with value " + receivedValue + "."; } - return message + return message; } - function styleValue (value, type) { - if (type === 'String') { - return ("\"" + value + "\"") - } else if (type === 'Number') { - return ("" + (Number(value))) + function styleValue(value, type) { + if (type === "String") { + return '"' + value + '"'; + } else if (type === "Number") { + return "" + Number(value); } else { - return ("" + value) + return "" + value; } } - function isExplicable (value) { - var explicitTypes = ['string', 'number', 'boolean']; - return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; }) + function isExplicable(value) { + var explicitTypes = ["string", "number", "boolean"]; + return explicitTypes.some(function (elem) { + return value.toLowerCase() === elem; + }); } - function isBoolean () { - var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; + function isBoolean() { + var args = [], + len = arguments.length; + while (len--) args[len] = arguments[len]; - return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; }) + return args.some(function (elem) { + return elem.toLowerCase() === "boolean"; + }); } /* */ - function handleError (err, vm, info) { + function handleError(err, vm, info) { // Deactivate deps tracking while processing error handler to avoid possible infinite rendering. // See: https://github.com/vuejs/vuex/issues/1505 pushTarget(); @@ -1837,9 +1882,11 @@ for (var i = 0; i < hooks.length; i++) { try { var capture = hooks[i].call(cur, err, vm, info) === false; - if (capture) { return } + if (capture) { + return; + } } catch (e) { - globalHandleError(e, cur, 'errorCaptured hook'); + globalHandleError(e, cur, "errorCaptured hook"); } } } @@ -1851,18 +1898,14 @@ } } - function invokeWithErrorHandling ( - handler, - context, - args, - vm, - info - ) { + function invokeWithErrorHandling(handler, context, args, vm, info) { var res; try { res = args ? handler.apply(context, args) : handler.call(context); if (res && !res._isVue && isPromise(res) && !res._handled) { - res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); }); + res.catch(function (e) { + return handleError(e, vm, info + " (Promise/async)"); + }); // issue #9511 // avoid catch triggering multiple times when nested calls res._handled = true; @@ -1870,33 +1913,33 @@ } catch (e) { handleError(e, vm, info); } - return res + return res; } - function globalHandleError (err, vm, info) { + function globalHandleError(err, vm, info) { if (config.errorHandler) { try { - return config.errorHandler.call(null, err, vm, info) + return config.errorHandler.call(null, err, vm, info); } catch (e) { // if the user intentionally throws the original error in the handler, // do not log it twice if (e !== err) { - logError(e, null, 'config.errorHandler'); + logError(e, null, "config.errorHandler"); } } } logError(err, vm, info); } - function logError (err, vm, info) { + function logError(err, vm, info) { { - warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); + warn("Error in " + info + ': "' + err.toString() + '"', vm); } /* istanbul ignore else */ - if ((inBrowser || inWeex) && typeof console !== 'undefined') { + if ((inBrowser || inWeex) && typeof console !== "undefined") { console.error(err); } else { - throw err + throw err; } } @@ -1907,7 +1950,7 @@ var callbacks = []; var pending = false; - function flushCallbacks () { + function flushCallbacks() { pending = false; var copies = callbacks.slice(0); callbacks.length = 0; @@ -1936,7 +1979,7 @@ // completely stops working after triggering a few times... so, if native // Promise is available, we will use it: /* istanbul ignore next, $flow-disable-line */ - if (typeof Promise !== 'undefined' && isNative(Promise)) { + if (typeof Promise !== "undefined" && isNative(Promise)) { var p = Promise.resolve(); timerFunc = function () { p.then(flushCallbacks); @@ -1945,14 +1988,18 @@ // microtask queue but the queue isn't being flushed, until the browser // needs to do some other work, e.g. handle a timer. Therefore we can // "force" the microtask queue to be flushed by adding an empty timer. - if (isIOS) { setTimeout(noop); } + if (isIOS) { + setTimeout(noop); + } }; isUsingMicroTask = true; - } else if (!isIE && typeof MutationObserver !== 'undefined' && ( - isNative(MutationObserver) || - // PhantomJS and iOS 7.x - MutationObserver.toString() === '[object MutationObserverConstructor]' - )) { + } else if ( + !isIE && + typeof MutationObserver !== "undefined" && + (isNative(MutationObserver) || + // PhantomJS and iOS 7.x + MutationObserver.toString() === "[object MutationObserverConstructor]") + ) { // Use MutationObserver where native Promise is not available, // e.g. PhantomJS, iOS7, Android 4.4 // (#6466 MutationObserver is unreliable in IE11) @@ -1960,14 +2007,14 @@ var observer = new MutationObserver(flushCallbacks); var textNode = document.createTextNode(String(counter)); observer.observe(textNode, { - characterData: true + characterData: true, }); timerFunc = function () { counter = (counter + 1) % 2; textNode.data = String(counter); }; isUsingMicroTask = true; - } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { + } else if (typeof setImmediate !== "undefined" && isNative(setImmediate)) { // Fallback to setImmediate. // Technically it leverages the (macro) task queue, // but it is still a better choice than setTimeout. @@ -1981,14 +2028,14 @@ }; } - function nextTick (cb, ctx) { + function nextTick(cb, ctx) { var _resolve; callbacks.push(function () { if (cb) { try { cb.call(ctx); } catch (e) { - handleError(e, ctx, 'nextTick'); + handleError(e, ctx, "nextTick"); } } else if (_resolve) { _resolve(ctx); @@ -1999,10 +2046,10 @@ timerFunc(); } // $flow-disable-line - if (!cb && typeof Promise !== 'undefined') { + if (!cb && typeof Promise !== "undefined") { return new Promise(function (resolve) { _resolve = resolve; - }) + }); } } @@ -2021,7 +2068,9 @@ perf.clearMarks && perf.clearMeasures ) { - mark = function (tag) { return perf.mark(tag); }; + mark = function (tag) { + return perf.mark(tag); + }; measure = function (name, startTag, endTag) { perf.measure(name, startTag, endTag); perf.clearMarks(startTag); @@ -2037,81 +2086,100 @@ { var allowedGlobals = makeMap( - 'Infinity,undefined,NaN,isFinite,isNaN,' + - 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + - 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + - 'require' // for Webpack/Browserify + "Infinity,undefined,NaN,isFinite,isNaN," + + "parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent," + + "Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl," + + "require" // for Webpack/Browserify ); var warnNonPresent = function (target, key) { warn( - "Property or method \"" + key + "\" is not defined on the instance but " + - 'referenced during render. Make sure that this property is reactive, ' + - 'either in the data option, or for class-based components, by ' + - 'initializing the property. ' + - 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', + 'Property or method "' + + key + + '" is not defined on the instance but ' + + "referenced during render. Make sure that this property is reactive, " + + "either in the data option, or for class-based components, by " + + "initializing the property. " + + "See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.", target ); }; var warnReservedPrefix = function (target, key) { warn( - "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + - 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + - 'prevent conflicts with Vue internals. ' + - 'See: https://vuejs.org/v2/api/#data', + 'Property "' + + key + + '" must be accessed with "$data.' + + key + + '" because ' + + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + + "prevent conflicts with Vue internals. " + + "See: https://vuejs.org/v2/api/#data", target ); }; - var hasProxy = - typeof Proxy !== 'undefined' && isNative(Proxy); + var hasProxy = typeof Proxy !== "undefined" && isNative(Proxy); if (hasProxy) { - var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); + var isBuiltInModifier = makeMap( + "stop,prevent,self,ctrl,shift,alt,meta,exact" + ); config.keyCodes = new Proxy(config.keyCodes, { - set: function set (target, key, value) { + set: function set(target, key, value) { if (isBuiltInModifier(key)) { - warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); - return false + warn( + "Avoid overwriting built-in modifier in config.keyCodes: ." + key + ); + return false; } else { target[key] = value; - return true + return true; } - } + }, }); } var hasHandler = { - has: function has (target, key) { + has: function has(target, key) { var has = key in target; - var isAllowed = allowedGlobals(key) || - (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data)); + var isAllowed = + allowedGlobals(key) || + (typeof key === "string" && + key.charAt(0) === "_" && + !(key in target.$data)); if (!has && !isAllowed) { - if (key in target.$data) { warnReservedPrefix(target, key); } - else { warnNonPresent(target, key); } + if (key in target.$data) { + warnReservedPrefix(target, key); + } else { + warnNonPresent(target, key); + } } - return has || !isAllowed - } + return has || !isAllowed; + }, }; var getHandler = { - get: function get (target, key) { - if (typeof key === 'string' && !(key in target)) { - if (key in target.$data) { warnReservedPrefix(target, key); } - else { warnNonPresent(target, key); } + get: function get(target, key) { + if (typeof key === "string" && !(key in target)) { + if (key in target.$data) { + warnReservedPrefix(target, key); + } else { + warnNonPresent(target, key); + } } - return target[key] - } + return target[key]; + }, }; - initProxy = function initProxy (vm) { + initProxy = function initProxy(vm) { if (hasProxy) { // determine which proxy handler to use var options = vm.$options; - var handlers = options.render && options.render._withStripped - ? getHandler - : hasHandler; + var handlers = + options.render && options.render._withStripped + ? getHandler + : hasHandler; vm._renderProxy = new Proxy(vm, handlers); } else { vm._renderProxy = vm; @@ -2128,78 +2196,91 @@ * getters, so that every nested property inside the object * is collected as a "deep" dependency. */ - function traverse (val) { + function traverse(val) { _traverse(val, seenObjects); seenObjects.clear(); } - function _traverse (val, seen) { + function _traverse(val, seen) { var i, keys; var isA = Array.isArray(val); - if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) { - return + if ( + (!isA && !isObject(val)) || + Object.isFrozen(val) || + val instanceof VNode + ) { + return; } if (val.__ob__) { var depId = val.__ob__.dep.id; if (seen.has(depId)) { - return + return; } seen.add(depId); } if (isA) { i = val.length; - while (i--) { _traverse(val[i], seen); } + while (i--) { + _traverse(val[i], seen); + } } else { keys = Object.keys(val); i = keys.length; - while (i--) { _traverse(val[keys[i]], seen); } + while (i--) { + _traverse(val[keys[i]], seen); + } } } /* */ var normalizeEvent = cached(function (name) { - var passive = name.charAt(0) === '&'; + var passive = name.charAt(0) === "&"; name = passive ? name.slice(1) : name; - var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first + var once$$1 = name.charAt(0) === "~"; // Prefixed last, checked first name = once$$1 ? name.slice(1) : name; - var capture = name.charAt(0) === '!'; + var capture = name.charAt(0) === "!"; name = capture ? name.slice(1) : name; return { name: name, once: once$$1, capture: capture, - passive: passive - } + passive: passive, + }; }); - function createFnInvoker (fns, vm) { - function invoker () { + function createFnInvoker(fns, vm) { + function invoker() { var arguments$1 = arguments; var fns = invoker.fns; if (Array.isArray(fns)) { var cloned = fns.slice(); for (var i = 0; i < cloned.length; i++) { - invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler"); + invokeWithErrorHandling( + cloned[i], + null, + arguments$1, + vm, + "v-on handler" + ); } } else { // return handler return value for single handlers - return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler") + return invokeWithErrorHandling( + fns, + null, + arguments, + vm, + "v-on handler" + ); } } invoker.fns = fns; - return invoker + return invoker; } - function updateListeners ( - on, - oldOn, - add, - remove$$1, - createOnceHandler, - vm - ) { + function updateListeners(on, oldOn, add, remove$$1, createOnceHandler, vm) { var name, def$$1, cur, old, event; for (name in on) { def$$1 = cur = on[name]; @@ -2207,7 +2288,7 @@ event = normalizeEvent(name); if (isUndef(cur)) { warn( - "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), + 'Invalid handler for event "' + event.name + '": got ' + String(cur), vm ); } else if (isUndef(old)) { @@ -2233,14 +2314,14 @@ /* */ - function mergeVNodeHook (def, hookKey, hook) { + function mergeVNodeHook(def, hookKey, hook) { if (def instanceof VNode) { def = def.data.hook || (def.data.hook = {}); } var invoker; var oldHook = def[hookKey]; - function wrappedHook () { + function wrappedHook() { hook.apply(this, arguments); // important: remove merged hook to ensure it's called only once // and prevent memory leak @@ -2268,17 +2349,13 @@ /* */ - function extractPropsFromVNodeData ( - data, - Ctor, - tag - ) { + function extractPropsFromVNodeData(data, Ctor, tag) { // we are only extracting raw values here. // validation and default values are handled in the child // component itself. var propOptions = Ctor.options.props; if (isUndef(propOptions)) { - return + return; } var res = {}; var attrs = data.attrs; @@ -2290,48 +2367,52 @@ var keyInLowerCase = key.toLowerCase(); if ( key !== keyInLowerCase && - attrs && hasOwn(attrs, keyInLowerCase) + attrs && + hasOwn(attrs, keyInLowerCase) ) { tip( - "Prop \"" + keyInLowerCase + "\" is passed to component " + - (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + - " \"" + key + "\". " + - "Note that HTML attributes are case-insensitive and camelCased " + - "props need to use their kebab-case equivalents when using in-DOM " + - "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." + 'Prop "' + + keyInLowerCase + + '" is passed to component ' + + formatComponentName(tag || Ctor) + + ", but the declared prop name is" + + ' "' + + key + + '". ' + + "Note that HTML attributes are case-insensitive and camelCased " + + "props need to use their kebab-case equivalents when using in-DOM " + + 'templates. You should probably use "' + + altKey + + '" instead of "' + + key + + '".' ); } } checkProp(res, props, key, altKey, true) || - checkProp(res, attrs, key, altKey, false); + checkProp(res, attrs, key, altKey, false); } } - return res + return res; } - function checkProp ( - res, - hash, - key, - altKey, - preserve - ) { + function checkProp(res, hash, key, altKey, preserve) { if (isDef(hash)) { if (hasOwn(hash, key)) { res[key] = hash[key]; if (!preserve) { delete hash[key]; } - return true + return true; } else if (hasOwn(hash, altKey)) { res[key] = hash[altKey]; if (!preserve) { delete hash[altKey]; } - return true + return true; } } - return false + return false; } /* */ @@ -2348,46 +2429,48 @@ // normalization is needed - if any child is an Array, we flatten the whole // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep // because functional components already normalize their own children. - function simpleNormalizeChildren (children) { + function simpleNormalizeChildren(children) { for (var i = 0; i < children.length; i++) { if (Array.isArray(children[i])) { - return Array.prototype.concat.apply([], children) + return Array.prototype.concat.apply([], children); } } - return children + return children; } // 2. When the children contains constructs that always generated nested Arrays, // e.g. <template>, <slot>, v-for, or when the children is provided by user // with hand-written render functions / JSX. In such cases a full normalization // is needed to cater to all possible types of children values. - function normalizeChildren (children) { + function normalizeChildren(children) { return isPrimitive(children) ? [createTextVNode(children)] : Array.isArray(children) - ? normalizeArrayChildren(children) - : undefined + ? normalizeArrayChildren(children) + : undefined; } - function isTextNode (node) { - return isDef(node) && isDef(node.text) && isFalse(node.isComment) + function isTextNode(node) { + return isDef(node) && isDef(node.text) && isFalse(node.isComment); } - function normalizeArrayChildren (children, nestedIndex) { + function normalizeArrayChildren(children, nestedIndex) { var res = []; var i, c, lastIndex, last; for (i = 0; i < children.length; i++) { c = children[i]; - if (isUndef(c) || typeof c === 'boolean') { continue } + if (isUndef(c) || typeof c === "boolean") { + continue; + } lastIndex = res.length - 1; last = res[lastIndex]; // nested if (Array.isArray(c)) { if (c.length > 0) { - c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)); + c = normalizeArrayChildren(c, (nestedIndex || "") + "_" + i); // merge adjacent text nodes if (isTextNode(c[0]) && isTextNode(last)) { - res[lastIndex] = createTextVNode(last.text + (c[0]).text); + res[lastIndex] = createTextVNode(last.text + c[0].text); c.shift(); } res.push.apply(res, c); @@ -2398,7 +2481,7 @@ // this is necessary for SSR hydration because text nodes are // essentially merged when rendered to HTML strings res[lastIndex] = createTextVNode(last.text + c); - } else if (c !== '') { + } else if (c !== "") { // convert primitive to vnode res.push(createTextVNode(c)); } @@ -2408,31 +2491,31 @@ res[lastIndex] = createTextVNode(last.text + c.text); } else { // default key for nested array children (likely generated by v-for) - if (isTrue(children._isVList) && + if ( + isTrue(children._isVList) && isDef(c.tag) && isUndef(c.key) && - isDef(nestedIndex)) { + isDef(nestedIndex) + ) { c.key = "__vlist" + nestedIndex + "_" + i + "__"; } res.push(c); } } } - return res + return res; } /* */ - function initProvide (vm) { + function initProvide(vm) { var provide = vm.$options.provide; if (provide) { - vm._provided = typeof provide === 'function' - ? provide.call(vm) - : provide; + vm._provided = typeof provide === "function" ? provide.call(vm) : provide; } } - function initInjections (vm) { + function initInjections(vm) { var result = resolveInject(vm.$options.inject, vm); if (result) { toggleObserving(false); @@ -2442,8 +2525,10 @@ defineReactive$$1(vm, key, result[key], function () { warn( "Avoid mutating an injected value directly since the changes will be " + - "overwritten whenever the provided component re-renders. " + - "injection being mutated: \"" + key + "\"", + "overwritten whenever the provided component re-renders. " + + 'injection being mutated: "' + + key + + '"', vm ); }); @@ -2453,55 +2538,51 @@ } } - function resolveInject (inject, vm) { + function resolveInject(inject, vm) { if (inject) { // inject is :any because flow is not smart enough to figure out cached var result = Object.create(null); - var keys = hasSymbol - ? Reflect.ownKeys(inject) - : Object.keys(inject); + var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject); for (var i = 0; i < keys.length; i++) { var key = keys[i]; // #6574 in case the inject object is observed... - if (key === '__ob__') { continue } + if (key === "__ob__") { + continue; + } var provideKey = inject[key].from; var source = vm; while (source) { if (source._provided && hasOwn(source._provided, provideKey)) { result[key] = source._provided[provideKey]; - break + break; } source = source.$parent; } if (!source) { - if ('default' in inject[key]) { + if ("default" in inject[key]) { var provideDefault = inject[key].default; - result[key] = typeof provideDefault === 'function' - ? provideDefault.call(vm) - : provideDefault; + result[key] = + typeof provideDefault === "function" + ? provideDefault.call(vm) + : provideDefault; } else { - warn(("Injection \"" + key + "\" not found"), vm); + warn('Injection "' + key + '" not found', vm); } } } - return result + return result; } } /* */ - - /** * Runtime helper for resolving raw children VNodes into a slot object. */ - function resolveSlots ( - children, - context - ) { + function resolveSlots(children, context) { if (!children || !children.length) { - return {} + return {}; } var slots = {}; for (var i = 0, l = children.length; i < l; i++) { @@ -2513,12 +2594,14 @@ } // named slots should only be respected if the vnode was rendered in the // same context. - if ((child.context === context || child.fnContext === context) && - data && data.slot != null + if ( + (child.context === context || child.fnContext === context) && + data && + data.slot != null ) { var name = data.slot; - var slot = (slots[name] || (slots[name] = [])); - if (child.tag === 'template') { + var slot = slots[name] || (slots[name] = []); + if (child.tag === "template") { slot.push.apply(slot, child.children || []); } else { slot.push(child); @@ -2533,20 +2616,16 @@ delete slots[name$1]; } } - return slots + return slots; } - function isWhitespace (node) { - return (node.isComment && !node.asyncFactory) || node.text === ' ' + function isWhitespace(node) { + return (node.isComment && !node.asyncFactory) || node.text === " "; } /* */ - function normalizeScopedSlots ( - slots, - normalSlots, - prevSlots - ) { + function normalizeScopedSlots(slots, normalSlots, prevSlots) { var res; var hasNormalSlots = Object.keys(normalSlots).length > 0; var isStable = slots ? !!slots.$stable : !hasNormalSlots; @@ -2555,7 +2634,7 @@ res = {}; } else if (slots._normalized) { // fast path 1: child component re-render only, parent did not change - return slots._normalized + return slots._normalized; } else if ( isStable && prevSlots && @@ -2566,11 +2645,11 @@ ) { // fast path 2: stable scoped slots w/ no normal slots to proxy, // only need to normalize once - return prevSlots + return prevSlots; } else { res = {}; for (var key$1 in slots) { - if (slots[key$1] && key$1[0] !== '$') { + if (slots[key$1] && key$1[0] !== "$") { res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]); } } @@ -2584,25 +2663,25 @@ // avoriaz seems to mock a non-extensible $scopedSlots object // and when that is passed down this would cause an error if (slots && Object.isExtensible(slots)) { - (slots)._normalized = res; + slots._normalized = res; } - def(res, '$stable', isStable); - def(res, '$key', key); - def(res, '$hasNormal', hasNormalSlots); - return res + def(res, "$stable", isStable); + def(res, "$key", key); + def(res, "$hasNormal", hasNormalSlots); + return res; } function normalizeScopedSlot(normalSlots, key, fn) { var normalized = function () { var res = arguments.length ? fn.apply(null, arguments) : fn({}); - res = res && typeof res === 'object' && !Array.isArray(res) - ? [res] // single vnode - : normalizeChildren(res); - return res && ( - res.length === 0 || - (res.length === 1 && res[0].isComment) // #9658 - ) ? undefined - : res + res = + res && typeof res === "object" && !Array.isArray(res) + ? [res] // single vnode + : normalizeChildren(res); + return res && + (res.length === 0 || (res.length === 1 && res[0].isComment)) // #9658 + ? undefined + : res; }; // this is a slot using the new v-slot syntax without scope. although it is // compiled as a scoped slot, render fn users would expect it to be present @@ -2611,14 +2690,16 @@ Object.defineProperty(normalSlots, key, { get: normalized, enumerable: true, - configurable: true + configurable: true, }); } - return normalized + return normalized; } function proxyNormalSlot(slots, key) { - return function () { return slots[key]; } + return function () { + return slots[key]; + }; } /* */ @@ -2626,17 +2707,14 @@ /** * Runtime helper for rendering v-for lists. */ - function renderList ( - val, - render - ) { + function renderList(val, render) { var ret, i, l, keys, key; - if (Array.isArray(val) || typeof val === 'string') { + if (Array.isArray(val) || typeof val === "string") { ret = new Array(val.length); for (i = 0, l = val.length; i < l; i++) { ret[i] = render(val[i], i); } - } else if (typeof val === 'number') { + } else if (typeof val === "number") { ret = new Array(val); for (i = 0; i < val; i++) { ret[i] = render(i + 1, i); @@ -2662,8 +2740,8 @@ if (!isDef(ret)) { ret = []; } - (ret)._isVList = true; - return ret + ret._isVList = true; + return ret; } /* */ @@ -2671,22 +2749,15 @@ /** * Runtime helper for rendering <slot> */ - function renderSlot ( - name, - fallback, - props, - bindObject - ) { + function renderSlot(name, fallback, props, bindObject) { var scopedSlotFn = this.$scopedSlots[name]; var nodes; - if (scopedSlotFn) { // scoped slot + if (scopedSlotFn) { + // scoped slot props = props || {}; if (bindObject) { if (!isObject(bindObject)) { - warn( - 'slot v-bind without argument expects an Object', - this - ); + warn("slot v-bind without argument expects an Object", this); } props = extend(extend({}, bindObject), props); } @@ -2697,9 +2768,9 @@ var target = props && props.slot; if (target) { - return this.$createElement('template', { slot: target }, nodes) + return this.$createElement("template", { slot: target }, nodes); } else { - return nodes + return nodes; } } @@ -2708,17 +2779,17 @@ /** * Runtime helper for resolving filters */ - function resolveFilter (id) { - return resolveAsset(this.$options, 'filters', id, true) || identity + function resolveFilter(id) { + return resolveAsset(this.$options, "filters", id, true) || identity; } /* */ - function isKeyNotMatch (expect, actual) { + function isKeyNotMatch(expect, actual) { if (Array.isArray(expect)) { - return expect.indexOf(actual) === -1 + return expect.indexOf(actual) === -1; } else { - return expect !== actual + return expect !== actual; } } @@ -2727,7 +2798,7 @@ * exposed as Vue.prototype._k * passing in eventKeyName as last argument separately for backwards compat */ - function checkKeyCodes ( + function checkKeyCodes( eventKeyCode, key, builtInKeyCode, @@ -2736,11 +2807,11 @@ ) { var mappedKeyCode = config.keyCodes[key] || builtInKeyCode; if (builtInKeyName && eventKeyName && !config.keyCodes[key]) { - return isKeyNotMatch(builtInKeyName, eventKeyName) + return isKeyNotMatch(builtInKeyName, eventKeyName); } else if (mappedKeyCode) { - return isKeyNotMatch(mappedKeyCode, eventKeyCode) + return isKeyNotMatch(mappedKeyCode, eventKeyCode); } else if (eventKeyName) { - return hyphenate(eventKeyName) !== key + return hyphenate(eventKeyName) !== key; } } @@ -2749,36 +2820,24 @@ /** * Runtime helper for merging v-bind="object" into a VNode's data. */ - function bindObjectProps ( - data, - tag, - value, - asProp, - isSync - ) { + function bindObjectProps(data, tag, value, asProp, isSync) { if (value) { if (!isObject(value)) { - warn( - 'v-bind without argument expects an Object or Array value', - this - ); + warn("v-bind without argument expects an Object or Array value", this); } else { if (Array.isArray(value)) { value = toObject(value); } var hash; - var loop = function ( key ) { - if ( - key === 'class' || - key === 'style' || - isReservedAttribute(key) - ) { + var loop = function (key) { + if (key === "class" || key === "style" || isReservedAttribute(key)) { hash = data; } else { var type = data.attrs && data.attrs.type; - hash = asProp || config.mustUseProp(tag, type, key) - ? data.domProps || (data.domProps = {}) - : data.attrs || (data.attrs = {}); + hash = + asProp || config.mustUseProp(tag, type, key) + ? data.domProps || (data.domProps = {}) + : data.attrs || (data.attrs = {}); } var camelizedKey = camelize(key); var hyphenatedKey = hyphenate(key); @@ -2787,17 +2846,17 @@ if (isSync) { var on = data.on || (data.on = {}); - on[("update:" + key)] = function ($event) { + on["update:" + key] = function ($event) { value[key] = $event; }; } } }; - for (var key in value) loop( key ); + for (var key in value) loop(key); } } - return data + return data; } /* */ @@ -2805,16 +2864,13 @@ /** * Runtime helper for rendering static trees. */ - function renderStatic ( - index, - isInFor - ) { + function renderStatic(index, isInFor) { var cached = this._staticTrees || (this._staticTrees = []); var tree = cached[index]; // if has already-rendered static tree and not inside v-for, // we can reuse the same tree. if (tree && !isInFor) { - return tree + return tree; } // otherwise, render a fresh tree. tree = cached[index] = this.$options.staticRenderFns[index].call( @@ -2822,32 +2878,24 @@ null, this // for render fns generated for functional component templates ); - markStatic(tree, ("__static__" + index), false); - return tree + markStatic(tree, "__static__" + index, false); + return tree; } /** * Runtime helper for v-once. * Effectively it means marking the node as static with a unique key. */ - function markOnce ( - tree, - index, - key - ) { - markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true); - return tree + function markOnce(tree, index, key) { + markStatic(tree, "__once__" + index + (key ? "_" + key : ""), true); + return tree; } - function markStatic ( - tree, - key, - isOnce - ) { + function markStatic(tree, key, isOnce) { if (Array.isArray(tree)) { for (var i = 0; i < tree.length; i++) { - if (tree[i] && typeof tree[i] !== 'string') { - markStaticNode(tree[i], (key + "_" + i), isOnce); + if (tree[i] && typeof tree[i] !== "string") { + markStaticNode(tree[i], key + "_" + i, isOnce); } } } else { @@ -2855,7 +2903,7 @@ } } - function markStaticNode (node, key, isOnce) { + function markStaticNode(node, key, isOnce) { node.isStatic = true; node.key = key; node.isOnce = isOnce; @@ -2863,15 +2911,12 @@ /* */ - function bindObjectListeners (data, value) { + function bindObjectListeners(data, value) { if (value) { if (!isPlainObject(value)) { - warn( - 'v-on without argument expects an Object value', - this - ); + warn("v-on without argument expects an Object value", this); } else { - var on = data.on = data.on ? extend({}, data.on) : {}; + var on = (data.on = data.on ? extend({}, data.on) : {}); for (var key in value) { var existing = on[key]; var ours = value[key]; @@ -2879,12 +2924,12 @@ } } } - return data + return data; } /* */ - function resolveScopedSlots ( + function resolveScopedSlots( fns, // see flow/vnode res, // the following are added in 2.6 @@ -2905,39 +2950,40 @@ } } if (contentHashKey) { - (res).$key = contentHashKey; + res.$key = contentHashKey; } - return res + return res; } /* */ - function bindDynamicKeys (baseObj, values) { + function bindDynamicKeys(baseObj, values) { for (var i = 0; i < values.length; i += 2) { var key = values[i]; - if (typeof key === 'string' && key) { + if (typeof key === "string" && key) { baseObj[values[i]] = values[i + 1]; - } else if (key !== '' && key !== null) { + } else if (key !== "" && key !== null) { // null is a special value for explicitly removing a binding warn( - ("Invalid value for dynamic directive argument (expected string or null): " + key), + "Invalid value for dynamic directive argument (expected string or null): " + + key, this ); } } - return baseObj + return baseObj; } // helper to dynamically append modifier runtime markers to event names. // ensure only append when value is already string, otherwise it will be cast // to string and cause the type check to miss. - function prependModifier (value, symbol) { - return typeof value === 'string' ? symbol + value : value + function prependModifier(value, symbol) { + return typeof value === "string" ? symbol + value : value; } /* */ - function installRenderHelpers (target) { + function installRenderHelpers(target) { target._o = markOnce; target._n = toNumber; target._s = toString; @@ -2959,20 +3005,14 @@ /* */ - function FunctionalRenderContext ( - data, - props, - children, - parent, - Ctor - ) { + function FunctionalRenderContext(data, props, children, parent, Ctor) { var this$1 = this; var options = Ctor.options; // ensure the createElement function in functional components // gets a unique context - this is necessary for correct named slot check var contextVm; - if (hasOwn(parent, '_uid')) { + if (hasOwn(parent, "_uid")) { contextVm = Object.create(parent); // $flow-disable-line contextVm._original = parent; @@ -2997,18 +3037,18 @@ if (!this$1.$slots) { normalizeScopedSlots( data.scopedSlots, - this$1.$slots = resolveSlots(children, parent) + (this$1.$slots = resolveSlots(children, parent)) ); } - return this$1.$slots + return this$1.$slots; }; - Object.defineProperty(this, 'scopedSlots', ({ + Object.defineProperty(this, "scopedSlots", { enumerable: true, - get: function get () { - return normalizeScopedSlots(data.scopedSlots, this.slots()) - } - })); + get: function get() { + return normalizeScopedSlots(data.scopedSlots, this.slots()); + }, + }); // support for compiled functional template if (isCompiled) { @@ -3026,16 +3066,18 @@ vnode.fnScopeId = options._scopeId; vnode.fnContext = parent; } - return vnode + return vnode; }; } else { - this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); }; + this._c = function (a, b, c, d) { + return createElement(contextVm, a, b, c, d, needNormalization); + }; } } installRenderHelpers(FunctionalRenderContext.prototype); - function createFunctionalComponent ( + function createFunctionalComponent( Ctor, propsData, data, @@ -3050,8 +3092,12 @@ props[key] = validateProp(key, propOptions, propsData || emptyObject); } } else { - if (isDef(data.attrs)) { mergeProps(props, data.attrs); } - if (isDef(data.props)) { mergeProps(props, data.props); } + if (isDef(data.attrs)) { + mergeProps(props, data.attrs); + } + if (isDef(data.props)) { + mergeProps(props, data.props); + } } var renderContext = new FunctionalRenderContext( @@ -3065,18 +3111,36 @@ var vnode = options.render.call(null, renderContext._c, renderContext); if (vnode instanceof VNode) { - return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext) + return cloneAndMarkFunctionalResult( + vnode, + data, + renderContext.parent, + options, + renderContext + ); } else if (Array.isArray(vnode)) { var vnodes = normalizeChildren(vnode) || []; var res = new Array(vnodes.length); for (var i = 0; i < vnodes.length; i++) { - res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext); + res[i] = cloneAndMarkFunctionalResult( + vnodes[i], + data, + renderContext.parent, + options, + renderContext + ); } - return res + return res; } } - function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) { + function cloneAndMarkFunctionalResult( + vnode, + data, + contextVm, + options, + renderContext + ) { // #7817 clone node before setting fnContext, otherwise if the node is reused // (e.g. it was from a cached normal slot) the fnContext causes named slots // that should not be matched to match. @@ -3084,15 +3148,16 @@ clone.fnContext = contextVm; clone.fnOptions = options; { - (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext; + (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = + renderContext; } if (data.slot) { (clone.data || (clone.data = {})).slot = data.slot; } - return clone + return clone; } - function mergeProps (to, from) { + function mergeProps(to, from) { for (var key in from) { to[camelize(key)] = from[key]; } @@ -3108,7 +3173,7 @@ // inline hooks to be invoked on component VNodes during patch var componentVNodeHooks = { - init: function init (vnode, hydrating) { + init: function init(vnode, hydrating) { if ( vnode.componentInstance && !vnode.componentInstance._isDestroyed && @@ -3118,17 +3183,17 @@ var mountedNode = vnode; // work around flow componentVNodeHooks.prepatch(mountedNode, mountedNode); } else { - var child = vnode.componentInstance = createComponentInstanceForVnode( + var child = (vnode.componentInstance = createComponentInstanceForVnode( vnode, activeInstance - ); + )); child.$mount(hydrating ? vnode.elm : undefined, hydrating); } }, - prepatch: function prepatch (oldVnode, vnode) { + prepatch: function prepatch(oldVnode, vnode) { var options = vnode.componentOptions; - var child = vnode.componentInstance = oldVnode.componentInstance; + var child = (vnode.componentInstance = oldVnode.componentInstance); updateChildComponent( child, options.propsData, // updated props @@ -3138,12 +3203,12 @@ ); }, - insert: function insert (vnode) { + insert: function insert(vnode) { var context = vnode.context; var componentInstance = vnode.componentInstance; if (!componentInstance._isMounted) { componentInstance._isMounted = true; - callHook(componentInstance, 'mounted'); + callHook(componentInstance, "mounted"); } if (vnode.data.keepAlive) { if (context._isMounted) { @@ -3159,7 +3224,7 @@ } }, - destroy: function destroy (vnode) { + destroy: function destroy(vnode) { var componentInstance = vnode.componentInstance; if (!componentInstance._isDestroyed) { if (!vnode.data.keepAlive) { @@ -3168,20 +3233,14 @@ deactivateChildComponent(componentInstance, true /* direct */); } } - } + }, }; var hooksToMerge = Object.keys(componentVNodeHooks); - function createComponent ( - Ctor, - data, - context, - children, - tag - ) { + function createComponent(Ctor, data, context, children, tag) { if (isUndef(Ctor)) { - return + return; } var baseCtor = context.$options._base; @@ -3193,11 +3252,11 @@ // if at this stage it's not a constructor or an async component factory, // reject. - if (typeof Ctor !== 'function') { + if (typeof Ctor !== "function") { { - warn(("Invalid Component definition: " + (String(Ctor))), context); + warn("Invalid Component definition: " + String(Ctor), context); } - return + return; } // async component @@ -3215,7 +3274,7 @@ context, children, tag - ) + ); } } @@ -3235,7 +3294,13 @@ // functional component if (isTrue(Ctor.options.functional)) { - return createFunctionalComponent(Ctor, propsData, data, context, children) + return createFunctionalComponent( + Ctor, + propsData, + data, + context, + children + ); } // extract listeners, since these needs to be treated as @@ -3263,23 +3328,33 @@ // return a placeholder vnode var name = Ctor.options.name || tag; var vnode = new VNode( - ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')), - data, undefined, undefined, undefined, context, - { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, + "vue-component-" + Ctor.cid + (name ? "-" + name : ""), + data, + undefined, + undefined, + undefined, + context, + { + Ctor: Ctor, + propsData: propsData, + listeners: listeners, + tag: tag, + children: children, + }, asyncFactory ); - return vnode + return vnode; } - function createComponentInstanceForVnode ( + function createComponentInstanceForVnode( vnode, // we know it's MountedComponentVNode but flow doesn't parent // activeInstance in lifecycle state ) { var options = { _isComponent: true, _parentVnode: vnode, - parent: parent + parent: parent, }; // check inline-template render functions var inlineTemplate = vnode.data.inlineTemplate; @@ -3287,10 +3362,10 @@ options.render = inlineTemplate.render; options.staticRenderFns = inlineTemplate.staticRenderFns; } - return new vnode.componentOptions.Ctor(options) + return new vnode.componentOptions.Ctor(options); } - function installComponentHooks (data) { + function installComponentHooks(data) { var hooks = data.hook || (data.hook = {}); for (var i = 0; i < hooksToMerge.length; i++) { var key = hooksToMerge[i]; @@ -3302,22 +3377,22 @@ } } - function mergeHook$1 (f1, f2) { + function mergeHook$1(f1, f2) { var merged = function (a, b) { // flow complains about extra args which is why we use any f1(a, b); f2(a, b); }; merged._merged = true; - return merged + return merged; } // transform component v-model info (value and callback) into // prop and event handler respectively. - function transformModel (options, data) { - var prop = (options.model && options.model.prop) || 'value'; - var event = (options.model && options.model.event) || 'input' - ;(data.attrs || (data.attrs = {}))[prop] = data.model.value; + function transformModel(options, data) { + var prop = (options.model && options.model.prop) || "value"; + var event = (options.model && options.model.event) || "input"; + (data.attrs || (data.attrs = {}))[prop] = data.model.value; var on = data.on || (data.on = {}); var existing = on[event]; var callback = data.model.callback; @@ -3341,7 +3416,7 @@ // wrapper function for providing a more flexible interface // without getting yelled at by flow - function createElement ( + function createElement( context, tag, data, @@ -3357,23 +3432,19 @@ if (isTrue(alwaysNormalize)) { normalizationType = ALWAYS_NORMALIZE; } - return _createElement(context, tag, data, children, normalizationType) + return _createElement(context, tag, data, children, normalizationType); } - function _createElement ( - context, - tag, - data, - children, - normalizationType - ) { - if (isDef(data) && isDef((data).__ob__)) { + function _createElement(context, tag, data, children, normalizationType) { + if (isDef(data) && isDef(data.__ob__)) { warn( - "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" + - 'Always create fresh vnode data objects in each render!', + "Avoid using observed data object as vnode data: " + + JSON.stringify(data) + + "\n" + + "Always create fresh vnode data objects in each render!", context ); - return createEmptyVNode() + return createEmptyVNode(); } // object syntax in v-bind if (isDef(data) && isDef(data.is)) { @@ -3381,23 +3452,20 @@ } if (!tag) { // in case of component :is set to falsy value - return createEmptyVNode() + return createEmptyVNode(); } // warn against non-primitive key - if (isDef(data) && isDef(data.key) && !isPrimitive(data.key) - ) { + if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)) { { warn( - 'Avoid using non-primitive value as key, ' + - 'use string/number value instead.', + "Avoid using non-primitive value as key, " + + "use string/number value instead.", context ); } } // support single function children as default scoped slot - if (Array.isArray(children) && - typeof children[0] === 'function' - ) { + if (Array.isArray(children) && typeof children[0] === "function") { data = data || {}; data.scopedSlots = { default: children[0] }; children.length = 0; @@ -3408,51 +3476,61 @@ children = simpleNormalizeChildren(children); } var vnode, ns; - if (typeof tag === 'string') { + if (typeof tag === "string") { var Ctor; ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); if (config.isReservedTag(tag)) { // platform built-in elements if (isDef(data) && isDef(data.nativeOn)) { warn( - ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."), + "The .native modifier for v-on is only valid on components but it was used on <" + + tag + + ">.", context ); } vnode = new VNode( - config.parsePlatformTagName(tag), data, children, - undefined, undefined, context + config.parsePlatformTagName(tag), + data, + children, + undefined, + undefined, + context ); - } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) { + } else if ( + (!data || !data.pre) && + isDef((Ctor = resolveAsset(context.$options, "components", tag))) + ) { // component vnode = createComponent(Ctor, data, context, children, tag); } else { // unknown or unlisted namespaced elements // check at runtime because it may get assigned a namespace when its // parent normalizes children - vnode = new VNode( - tag, data, children, - undefined, undefined, context - ); + vnode = new VNode(tag, data, children, undefined, undefined, context); } } else { // direct component options / constructor vnode = createComponent(tag, data, context, children); } if (Array.isArray(vnode)) { - return vnode + return vnode; } else if (isDef(vnode)) { - if (isDef(ns)) { applyNS(vnode, ns); } - if (isDef(data)) { registerDeepBindings(data); } - return vnode + if (isDef(ns)) { + applyNS(vnode, ns); + } + if (isDef(data)) { + registerDeepBindings(data); + } + return vnode; } else { - return createEmptyVNode() + return createEmptyVNode(); } } - function applyNS (vnode, ns, force) { + function applyNS(vnode, ns, force) { vnode.ns = ns; - if (vnode.tag === 'foreignObject') { + if (vnode.tag === "foreignObject") { // use default namespace inside foreignObject ns = undefined; force = true; @@ -3460,8 +3538,10 @@ if (isDef(vnode.children)) { for (var i = 0, l = vnode.children.length; i < l; i++) { var child = vnode.children[i]; - if (isDef(child.tag) && ( - isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) { + if ( + isDef(child.tag) && + (isUndef(child.ns) || (isTrue(force) && child.tag !== "svg")) + ) { applyNS(child, ns, force); } } @@ -3471,7 +3551,7 @@ // ref #5318 // necessary to ensure parent re-render when deep bindings like :style and // :class are used on slot nodes - function registerDeepBindings (data) { + function registerDeepBindings(data) { if (isObject(data.style)) { traverse(data.style); } @@ -3482,11 +3562,11 @@ /* */ - function initRender (vm) { + function initRender(vm) { vm._vnode = null; // the root of the child tree vm._staticTrees = null; // v-once cached trees var options = vm.$options; - var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree + var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree var renderContext = parentVnode && parentVnode.context; vm.$slots = resolveSlots(options._renderChildren, renderContext); vm.$scopedSlots = emptyObject; @@ -3494,10 +3574,14 @@ // so that we get proper render context inside it. // args order: tag, data, children, normalizationType, alwaysNormalize // internal version is used by render functions compiled from templates - vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); }; + vm._c = function (a, b, c, d) { + return createElement(vm, a, b, c, d, false); + }; // normalization is always applied for the public version, used in // user-written render functions. - vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }; + vm.$createElement = function (a, b, c, d) { + return createElement(vm, a, b, c, d, true); + }; // $attrs & $listeners are exposed for easier HOC creation. // they need to be reactive so that HOCs using them are always updated @@ -3505,23 +3589,35 @@ /* istanbul ignore else */ { - defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () { - !isUpdatingChildComponent && warn("$attrs is readonly.", vm); - }, true); - defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () { - !isUpdatingChildComponent && warn("$listeners is readonly.", vm); - }, true); + defineReactive$$1( + vm, + "$attrs", + (parentData && parentData.attrs) || emptyObject, + function () { + !isUpdatingChildComponent && warn("$attrs is readonly.", vm); + }, + true + ); + defineReactive$$1( + vm, + "$listeners", + options._parentListeners || emptyObject, + function () { + !isUpdatingChildComponent && warn("$listeners is readonly.", vm); + }, + true + ); } } var currentRenderingInstance = null; - function renderMixin (Vue) { + function renderMixin(Vue) { // install runtime convenience helpers installRenderHelpers(Vue.prototype); Vue.prototype.$nextTick = function (fn) { - return nextTick(fn, this) + return nextTick(fn, this); }; Vue.prototype._render = function () { @@ -3556,7 +3652,11 @@ /* istanbul ignore else */ if (vm.$options.renderError) { try { - vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e); + vnode = vm.$options.renderError.call( + vm._renderProxy, + vm.$createElement, + e + ); } catch (e) { handleError(e, vm, "renderError"); vnode = vm._vnode; @@ -3575,8 +3675,8 @@ if (!(vnode instanceof VNode)) { if (Array.isArray(vnode)) { warn( - 'Multiple root nodes returned from render function. Render function ' + - 'should return a single root node.', + "Multiple root nodes returned from render function. Render function " + + "should return a single root node.", vm ); } @@ -3584,70 +3684,70 @@ } // set parent vnode.parent = _parentVnode; - return vnode + return vnode; }; } /* */ - function ensureCtor (comp, base) { + function ensureCtor(comp, base) { if ( comp.__esModule || - (hasSymbol && comp[Symbol.toStringTag] === 'Module') + (hasSymbol && comp[Symbol.toStringTag] === "Module") ) { comp = comp.default; } - return isObject(comp) - ? base.extend(comp) - : comp + return isObject(comp) ? base.extend(comp) : comp; } - function createAsyncPlaceholder ( - factory, - data, - context, - children, - tag - ) { + function createAsyncPlaceholder(factory, data, context, children, tag) { var node = createEmptyVNode(); node.asyncFactory = factory; - node.asyncMeta = { data: data, context: context, children: children, tag: tag }; - return node + node.asyncMeta = { + data: data, + context: context, + children: children, + tag: tag, + }; + return node; } - function resolveAsyncComponent ( - factory, - baseCtor - ) { + function resolveAsyncComponent(factory, baseCtor) { if (isTrue(factory.error) && isDef(factory.errorComp)) { - return factory.errorComp + return factory.errorComp; } if (isDef(factory.resolved)) { - return factory.resolved + return factory.resolved; } var owner = currentRenderingInstance; - if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) { + if ( + owner && + isDef(factory.owners) && + factory.owners.indexOf(owner) === -1 + ) { // already pending factory.owners.push(owner); } if (isTrue(factory.loading) && isDef(factory.loadingComp)) { - return factory.loadingComp + return factory.loadingComp; } if (owner && !isDef(factory.owners)) { - var owners = factory.owners = [owner]; + var owners = (factory.owners = [owner]); var sync = true; var timerLoading = null; - var timerTimeout = null + var timerTimeout = null; - ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); }); + owner.$on("hook:destroyed", function () { + return remove(owners, owner); + }); var forceRender = function (renderCompleted) { for (var i = 0, l = owners.length; i < l; i++) { - (owners[i]).$forceUpdate(); + owners[i].$forceUpdate(); } if (renderCompleted) { @@ -3677,8 +3777,9 @@ var reject = once(function (reason) { warn( - "Failed to resolve async component: " + (String(factory)) + - (reason ? ("\nReason: " + reason) : '') + "Failed to resolve async component: " + + String(factory) + + (reason ? "\nReason: " + reason : "") ); if (isDef(factory.errorComp)) { factory.error = true; @@ -3720,9 +3821,7 @@ timerTimeout = setTimeout(function () { timerTimeout = null; if (isUndef(factory.resolved)) { - reject( - "timeout (" + (res.timeout) + "ms)" - ); + reject("timeout (" + res.timeout + "ms)"); } }, res.timeout); } @@ -3731,26 +3830,24 @@ sync = false; // return in case resolved synchronously - return factory.loading - ? factory.loadingComp - : factory.resolved + return factory.loading ? factory.loadingComp : factory.resolved; } } /* */ - function isAsyncPlaceholder (node) { - return node.isComment && node.asyncFactory + function isAsyncPlaceholder(node) { + return node.isComment && node.asyncFactory; } /* */ - function getFirstComponentChild (children) { + function getFirstComponentChild(children) { if (Array.isArray(children)) { for (var i = 0; i < children.length; i++) { var c = children[i]; if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) { - return c + return c; } } } @@ -3760,7 +3857,7 @@ /* */ - function initEvents (vm) { + function initEvents(vm) { vm._events = Object.create(null); vm._hasHookEvent = false; // init parent attached events @@ -3772,35 +3869,38 @@ var target; - function add (event, fn) { + function add(event, fn) { target.$on(event, fn); } - function remove$1 (event, fn) { + function remove$1(event, fn) { target.$off(event, fn); } - function createOnceHandler (event, fn) { + function createOnceHandler(event, fn) { var _target = target; - return function onceHandler () { + return function onceHandler() { var res = fn.apply(null, arguments); if (res !== null) { _target.$off(event, onceHandler); } - } + }; } - function updateComponentListeners ( - vm, - listeners, - oldListeners - ) { + function updateComponentListeners(vm, listeners, oldListeners) { target = vm; - updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm); + updateListeners( + listeners, + oldListeners || {}, + add, + remove$1, + createOnceHandler, + vm + ); target = undefined; } - function eventsMixin (Vue) { + function eventsMixin(Vue) { var hookRE = /^hook:/; Vue.prototype.$on = function (event, fn) { var vm = this; @@ -3816,18 +3916,18 @@ vm._hasHookEvent = true; } } - return vm + return vm; }; Vue.prototype.$once = function (event, fn) { var vm = this; - function on () { + function on() { vm.$off(event, on); fn.apply(vm, arguments); } on.fn = fn; vm.$on(event, on); - return vm + return vm; }; Vue.prototype.$off = function (event, fn) { @@ -3835,23 +3935,23 @@ // all if (!arguments.length) { vm._events = Object.create(null); - return vm + return vm; } // array of events if (Array.isArray(event)) { for (var i$1 = 0, l = event.length; i$1 < l; i$1++) { vm.$off(event[i$1], fn); } - return vm + return vm; } // specific event var cbs = vm._events[event]; if (!cbs) { - return vm + return vm; } if (!fn) { vm._events[event] = null; - return vm + return vm; } // specific handler var cb; @@ -3860,10 +3960,10 @@ cb = cbs[i]; if (cb === fn || cb.fn === fn) { cbs.splice(i, 1); - break + break; } } - return vm + return vm; }; Vue.prototype.$emit = function (event) { @@ -3872,11 +3972,20 @@ var lowerCaseEvent = event.toLowerCase(); if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) { tip( - "Event \"" + lowerCaseEvent + "\" is emitted in component " + - (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " + - "Note that HTML attributes are case-insensitive and you cannot use " + - "v-on to listen to camelCase events when using in-DOM templates. " + - "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"." + 'Event "' + + lowerCaseEvent + + '" is emitted in component ' + + formatComponentName(vm) + + ' but the handler is registered for "' + + event + + '". ' + + "Note that HTML attributes are case-insensitive and you cannot use " + + "v-on to listen to camelCase events when using in-DOM templates. " + + 'You should probably use "' + + hyphenate(event) + + '" instead of "' + + event + + '".' ); } } @@ -3884,12 +3993,12 @@ if (cbs) { cbs = cbs.length > 1 ? toArray(cbs) : cbs; var args = toArray(arguments, 1); - var info = "event handler for \"" + event + "\""; + var info = 'event handler for "' + event + '"'; for (var i = 0, l = cbs.length; i < l; i++) { invokeWithErrorHandling(cbs[i], vm, args, vm, info); } } - return vm + return vm; }; } @@ -3903,10 +4012,10 @@ activeInstance = vm; return function () { activeInstance = prevActiveInstance; - } + }; } - function initLifecycle (vm) { + function initLifecycle(vm) { var options = vm.$options; // locate first non-abstract parent @@ -3932,7 +4041,7 @@ vm._isBeingDestroyed = false; } - function lifecycleMixin (Vue) { + function lifecycleMixin(Vue) { Vue.prototype._update = function (vnode, hydrating) { var vm = this; var prevEl = vm.$el; @@ -3974,9 +4083,9 @@ Vue.prototype.$destroy = function () { var vm = this; if (vm._isBeingDestroyed) { - return + return; } - callHook(vm, 'beforeDestroy'); + callHook(vm, "beforeDestroy"); vm._isBeingDestroyed = true; // remove self from parent var parent = vm.$parent; @@ -4001,7 +4110,7 @@ // invoke destroy hooks on current rendered tree vm.__patch__(vm._vnode, null); // fire destroyed hook - callHook(vm, 'destroyed'); + callHook(vm, "destroyed"); // turn off all instance listeners. vm.$off(); // remove __vue__ reference @@ -4015,33 +4124,32 @@ }; } - function mountComponent ( - vm, - el, - hydrating - ) { + function mountComponent(vm, el, hydrating) { vm.$el = el; if (!vm.$options.render) { vm.$options.render = createEmptyVNode; { /* istanbul ignore if */ - if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') || - vm.$options.el || el) { + if ( + (vm.$options.template && vm.$options.template.charAt(0) !== "#") || + vm.$options.el || + el + ) { warn( - 'You are using the runtime-only build of Vue where the template ' + - 'compiler is not available. Either pre-compile the templates into ' + - 'render functions, or use the compiler-included build.', + "You are using the runtime-only build of Vue where the template " + + "compiler is not available. Either pre-compile the templates into " + + "render functions, or use the compiler-included build.", vm ); } else { warn( - 'Failed to mount component: template or render function not defined.', + "Failed to mount component: template or render function not defined.", vm ); } } } - callHook(vm, 'beforeMount'); + callHook(vm, "beforeMount"); var updateComponent; /* istanbul ignore if */ @@ -4055,12 +4163,12 @@ mark(startTag); var vnode = vm._render(); mark(endTag); - measure(("vue " + name + " render"), startTag, endTag); + measure("vue " + name + " render", startTag, endTag); mark(startTag); vm._update(vnode, hydrating); mark(endTag); - measure(("vue " + name + " patch"), startTag, endTag); + measure("vue " + name + " patch", startTag, endTag); }; } else { updateComponent = function () { @@ -4071,25 +4179,31 @@ // we set this to vm._watcher inside the watcher's constructor // since the watcher's initial patch may call $forceUpdate (e.g. inside child // component's mounted hook), which relies on vm._watcher being already defined - new Watcher(vm, updateComponent, noop, { - before: function before () { - if (vm._isMounted && !vm._isDestroyed) { - callHook(vm, 'beforeUpdate'); - } - } - }, true /* isRenderWatcher */); + new Watcher( + vm, + updateComponent, + noop, + { + before: function before() { + if (vm._isMounted && !vm._isDestroyed) { + callHook(vm, "beforeUpdate"); + } + }, + }, + true /* isRenderWatcher */ + ); hydrating = false; // manually mounted instance, call mounted on self // mounted is called for render-created child components in its inserted hook if (vm.$vnode == null) { vm._isMounted = true; - callHook(vm, 'mounted'); + callHook(vm, "mounted"); } - return vm + return vm; } - function updateChildComponent ( + function updateChildComponent( vm, propsData, listeners, @@ -4118,15 +4232,16 @@ // update. Dynamic scoped slots may also have changed. In such cases, a forced // update is necessary to ensure correctness. var needsForceUpdate = !!( - renderChildren || // has new static slots - vm.$options._renderChildren || // has old static slots + renderChildren || // has new static slots + vm.$options._renderChildren || // has old static slots hasDynamicScopedSlot ); vm.$options._parentVnode = parentVnode; vm.$vnode = parentVnode; // update vm's placeholder node without re-render - if (vm._vnode) { // update child tree's parent + if (vm._vnode) { + // update child tree's parent vm._vnode.parent = parentVnode; } vm.$options._renderChildren = renderChildren; @@ -4169,36 +4284,38 @@ } } - function isInInactiveTree (vm) { + function isInInactiveTree(vm) { while (vm && (vm = vm.$parent)) { - if (vm._inactive) { return true } + if (vm._inactive) { + return true; + } } - return false + return false; } - function activateChildComponent (vm, direct) { + function activateChildComponent(vm, direct) { if (direct) { vm._directInactive = false; if (isInInactiveTree(vm)) { - return + return; } } else if (vm._directInactive) { - return + return; } if (vm._inactive || vm._inactive === null) { vm._inactive = false; for (var i = 0; i < vm.$children.length; i++) { activateChildComponent(vm.$children[i]); } - callHook(vm, 'activated'); + callHook(vm, "activated"); } } - function deactivateChildComponent (vm, direct) { + function deactivateChildComponent(vm, direct) { if (direct) { vm._directInactive = true; if (isInInactiveTree(vm)) { - return + return; } } if (!vm._inactive) { @@ -4206,11 +4323,11 @@ for (var i = 0; i < vm.$children.length; i++) { deactivateChildComponent(vm.$children[i]); } - callHook(vm, 'deactivated'); + callHook(vm, "deactivated"); } } - function callHook (vm, hook) { + function callHook(vm, hook) { // #7573 disable dep collection when invoking lifecycle hooks pushTarget(); var handlers = vm.$options[hook]; @@ -4221,7 +4338,7 @@ } } if (vm._hasHookEvent) { - vm.$emit('hook:' + hook); + vm.$emit("hook:" + hook); } popTarget(); } @@ -4241,7 +4358,7 @@ /** * Reset the scheduler's state. */ - function resetSchedulerState () { + function resetSchedulerState() { index = queue.length = activatedChildren.length = 0; has = {}; { @@ -4270,21 +4387,23 @@ var performance = window.performance; if ( performance && - typeof performance.now === 'function' && - getNow() > document.createEvent('Event').timeStamp + typeof performance.now === "function" && + getNow() > document.createEvent("Event").timeStamp ) { // if the event timestamp, although evaluated AFTER the Date.now(), is // smaller than it, it means the event is using a hi-res timestamp, // and we need to use the hi-res version for event listener timestamps as // well. - getNow = function () { return performance.now(); }; + getNow = function () { + return performance.now(); + }; } } /** * Flush both queues and run the watchers. */ - function flushSchedulerQueue () { + function flushSchedulerQueue() { currentFlushTimestamp = getNow(); flushing = true; var watcher, id; @@ -4297,7 +4416,9 @@ // user watchers are created before the render watcher) // 3. If a component is destroyed during a parent component's watcher run, // its watchers can be skipped. - queue.sort(function (a, b) { return a.id - b.id; }); + queue.sort(function (a, b) { + return a.id - b.id; + }); // do not cache length because more watchers might be pushed // as we run existing watchers @@ -4314,14 +4435,13 @@ circular[id] = (circular[id] || 0) + 1; if (circular[id] > MAX_UPDATE_COUNT) { warn( - 'You may have an infinite update loop ' + ( - watcher.user - ? ("in watcher with expression \"" + (watcher.expression) + "\"") - : "in a component render function." - ), + "You may have an infinite update loop " + + (watcher.user + ? 'in watcher with expression "' + watcher.expression + '"' + : "in a component render function."), watcher.vm ); - break + break; } } } @@ -4339,17 +4459,17 @@ // devtool hook /* istanbul ignore if */ if (devtools && config.devtools) { - devtools.emit('flush'); + devtools.emit("flush"); } } - function callUpdatedHooks (queue) { + function callUpdatedHooks(queue) { var i = queue.length; while (i--) { var watcher = queue[i]; var vm = watcher.vm; if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) { - callHook(vm, 'updated'); + callHook(vm, "updated"); } } } @@ -4358,14 +4478,14 @@ * Queue a kept-alive component that was activated during patch. * The queue will be processed after the entire tree has been patched. */ - function queueActivatedComponent (vm) { + function queueActivatedComponent(vm) { // setting _inactive to false here so that a render function can // rely on checking whether it's in an inactive tree (e.g. router-view) vm._inactive = false; activatedChildren.push(vm); } - function callActivatedHooks (queue) { + function callActivatedHooks(queue) { for (var i = 0; i < queue.length; i++) { queue[i]._inactive = true; activateChildComponent(queue[i], true /* true */); @@ -4377,7 +4497,7 @@ * Jobs with duplicate IDs will be skipped unless it's * pushed when the queue is being flushed. */ - function queueWatcher (watcher) { + function queueWatcher(watcher) { var id = watcher.id; if (has[id] == null) { has[id] = true; @@ -4398,7 +4518,7 @@ if (!config.async) { flushSchedulerQueue(); - return + return; } nextTick(flushSchedulerQueue); } @@ -4407,8 +4527,6 @@ /* */ - - var uid$2 = 0; /** @@ -4416,13 +4534,7 @@ * and fires callback when the expression value changes. * This is used for both the $watch() api and directives. */ - var Watcher = function Watcher ( - vm, - expOrFn, - cb, - options, - isRenderWatcher - ) { + var Watcher = function Watcher(vm, expOrFn, cb, options, isRenderWatcher) { this.vm = vm; if (isRenderWatcher) { vm._watcher = this; @@ -4448,29 +4560,29 @@ this.newDepIds = new _Set(); this.expression = expOrFn.toString(); // parse expression for getter - if (typeof expOrFn === 'function') { + if (typeof expOrFn === "function") { this.getter = expOrFn; } else { this.getter = parsePath(expOrFn); if (!this.getter) { this.getter = noop; warn( - "Failed watching path: \"" + expOrFn + "\" " + - 'Watcher only accepts simple dot-delimited paths. ' + - 'For full control, use a function instead.', + 'Failed watching path: "' + + expOrFn + + '" ' + + "Watcher only accepts simple dot-delimited paths. " + + "For full control, use a function instead.", vm ); } } - this.value = this.lazy - ? undefined - : this.get(); + this.value = this.lazy ? undefined : this.get(); }; /** * Evaluate the getter, and re-collect dependencies. */ - Watcher.prototype.get = function get () { + Watcher.prototype.get = function get() { pushTarget(this); var value; var vm = this.vm; @@ -4478,9 +4590,9 @@ value = this.getter.call(vm, vm); } catch (e) { if (this.user) { - handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\"")); + handleError(e, vm, 'getter for watcher "' + this.expression + '"'); } else { - throw e + throw e; } } finally { // "touch" every property so they are all tracked as @@ -4491,13 +4603,13 @@ popTarget(); this.cleanupDeps(); } - return value + return value; }; /** * Add a dependency to this directive. */ - Watcher.prototype.addDep = function addDep (dep) { + Watcher.prototype.addDep = function addDep(dep) { var id = dep.id; if (!this.newDepIds.has(id)) { this.newDepIds.add(id); @@ -4511,7 +4623,7 @@ /** * Clean up for dependency collection. */ - Watcher.prototype.cleanupDeps = function cleanupDeps () { + Watcher.prototype.cleanupDeps = function cleanupDeps() { var i = this.deps.length; while (i--) { var dep = this.deps[i]; @@ -4533,7 +4645,7 @@ * Subscriber interface. * Will be called when a dependency changes. */ - Watcher.prototype.update = function update () { + Watcher.prototype.update = function update() { /* istanbul ignore else */ if (this.lazy) { this.dirty = true; @@ -4548,7 +4660,7 @@ * Scheduler job interface. * Will be called by the scheduler. */ - Watcher.prototype.run = function run () { + Watcher.prototype.run = function run() { if (this.active) { var value = this.get(); if ( @@ -4566,7 +4678,11 @@ try { this.cb.call(this.vm, value, oldValue); } catch (e) { - handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\"")); + handleError( + e, + this.vm, + 'callback for watcher "' + this.expression + '"' + ); } } else { this.cb.call(this.vm, value, oldValue); @@ -4579,7 +4695,7 @@ * Evaluate the value of the watcher. * This only gets called for lazy watchers. */ - Watcher.prototype.evaluate = function evaluate () { + Watcher.prototype.evaluate = function evaluate() { this.value = this.get(); this.dirty = false; }; @@ -4587,7 +4703,7 @@ /** * Depend on all deps collected by this watcher. */ - Watcher.prototype.depend = function depend () { + Watcher.prototype.depend = function depend() { var i = this.deps.length; while (i--) { this.deps[i].depend(); @@ -4597,7 +4713,7 @@ /** * Remove self from all dependencies' subscriber list. */ - Watcher.prototype.teardown = function teardown () { + Watcher.prototype.teardown = function teardown() { if (this.active) { // remove self from vm's watcher list // this is a somewhat expensive operation so we skip it @@ -4619,56 +4735,66 @@ enumerable: true, configurable: true, get: noop, - set: noop + set: noop, }; - function proxy (target, sourceKey, key) { - sharedPropertyDefinition.get = function proxyGetter () { - return this[sourceKey][key] + function proxy(target, sourceKey, key) { + sharedPropertyDefinition.get = function proxyGetter() { + return this[sourceKey][key]; }; - sharedPropertyDefinition.set = function proxySetter (val) { + sharedPropertyDefinition.set = function proxySetter(val) { this[sourceKey][key] = val; }; Object.defineProperty(target, key, sharedPropertyDefinition); } - function initState (vm) { + function initState(vm) { vm._watchers = []; var opts = vm.$options; - if (opts.props) { initProps(vm, opts.props); } - if (opts.methods) { initMethods(vm, opts.methods); } + if (opts.props) { + initProps(vm, opts.props); + } + if (opts.methods) { + initMethods(vm, opts.methods); + } if (opts.data) { initData(vm); } else { - observe(vm._data = {}, true /* asRootData */); + observe((vm._data = {}), true /* asRootData */); + } + if (opts.computed) { + initComputed(vm, opts.computed); } - if (opts.computed) { initComputed(vm, opts.computed); } if (opts.watch && opts.watch !== nativeWatch) { initWatch(vm, opts.watch); } } - function initProps (vm, propsOptions) { + function initProps(vm, propsOptions) { var propsData = vm.$options.propsData || {}; - var props = vm._props = {}; + var props = (vm._props = {}); // cache prop keys so that future props updates can iterate using Array // instead of dynamic object key enumeration. - var keys = vm.$options._propKeys = []; + var keys = (vm.$options._propKeys = []); var isRoot = !vm.$parent; // root instance props should be converted if (!isRoot) { toggleObserving(false); } - var loop = function ( key ) { + var loop = function (key) { keys.push(key); var value = validateProp(key, propsOptions, propsData, vm); /* istanbul ignore else */ { var hyphenatedKey = hyphenate(key); - if (isReservedAttribute(hyphenatedKey) || - config.isReservedAttr(hyphenatedKey)) { + if ( + isReservedAttribute(hyphenatedKey) || + config.isReservedAttr(hyphenatedKey) + ) { warn( - ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."), + '"' + + hyphenatedKey + + '" is a reserved attribute and cannot be used as component prop.', vm ); } @@ -4676,9 +4802,11 @@ if (!isRoot && !isUpdatingChildComponent) { warn( "Avoid mutating a prop directly since the value will be " + - "overwritten whenever the parent component re-renders. " + - "Instead, use a data or computed property based on the prop's " + - "value. Prop being mutated: \"" + key + "\"", + "overwritten whenever the parent component re-renders. " + + "Instead, use a data or computed property based on the prop's " + + 'value. Prop being mutated: "' + + key + + '"', vm ); } @@ -4692,20 +4820,19 @@ } }; - for (var key in propsOptions) loop( key ); + for (var key in propsOptions) loop(key); toggleObserving(true); } - function initData (vm) { + function initData(vm) { var data = vm.$options.data; - data = vm._data = typeof data === 'function' - ? getData(data, vm) - : data || {}; + data = vm._data = + typeof data === "function" ? getData(data, vm) : data || {}; if (!isPlainObject(data)) { data = {}; warn( - 'data functions should return an object:\n' + - 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', + "data functions should return an object:\n" + + "https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function", vm ); } @@ -4719,15 +4846,17 @@ { if (methods && hasOwn(methods, key)) { warn( - ("Method \"" + key + "\" has already been defined as a data property."), + 'Method "' + key + '" has already been defined as a data property.', vm ); } } if (props && hasOwn(props, key)) { warn( - "The data property \"" + key + "\" is already declared as a prop. " + - "Use prop default value instead.", + 'The data property "' + + key + + '" is already declared as a prop. ' + + "Use prop default value instead.", vm ); } else if (!isReserved(key)) { @@ -4738,14 +4867,14 @@ observe(data, true /* asRootData */); } - function getData (data, vm) { + function getData(data, vm) { // #7573 disable dep collection when invoking data getters pushTarget(); try { - return data.call(vm, vm) + return data.call(vm, vm); } catch (e) { handleError(e, vm, "data()"); - return {} + return {}; } finally { popTarget(); } @@ -4753,20 +4882,17 @@ var computedWatcherOptions = { lazy: true }; - function initComputed (vm, computed) { + function initComputed(vm, computed) { // $flow-disable-line - var watchers = vm._computedWatchers = Object.create(null); + var watchers = (vm._computedWatchers = Object.create(null)); // computed properties are just getters during SSR var isSSR = isServerRendering(); for (var key in computed) { var userDef = computed[key]; - var getter = typeof userDef === 'function' ? userDef : userDef.get; + var getter = typeof userDef === "function" ? userDef : userDef.get; if (getter == null) { - warn( - ("Getter is missing for computed property \"" + key + "\"."), - vm - ); + warn('Getter is missing for computed property "' + key + '".', vm); } if (!isSSR) { @@ -4786,21 +4912,23 @@ defineComputed(vm, key, userDef); } else { if (key in vm.$data) { - warn(("The computed property \"" + key + "\" is already defined in data."), vm); + warn( + 'The computed property "' + key + '" is already defined in data.', + vm + ); } else if (vm.$options.props && key in vm.$options.props) { - warn(("The computed property \"" + key + "\" is already defined as a prop."), vm); + warn( + 'The computed property "' + key + '" is already defined as a prop.', + vm + ); } } } } - function defineComputed ( - target, - key, - userDef - ) { + function defineComputed(target, key, userDef) { var shouldCache = !isServerRendering(); - if (typeof userDef === 'function') { + if (typeof userDef === "function") { sharedPropertyDefinition.get = shouldCache ? createComputedGetter(key) : createGetterInvoker(userDef); @@ -4816,7 +4944,9 @@ if (sharedPropertyDefinition.set === noop) { sharedPropertyDefinition.set = function () { warn( - ("Computed property \"" + key + "\" was assigned to but it has no setter."), + 'Computed property "' + + key + + '" was assigned to but it has no setter.', this ); }; @@ -4824,8 +4954,8 @@ Object.defineProperty(target, key, sharedPropertyDefinition); } - function createComputedGetter (key) { - return function computedGetter () { + function createComputedGetter(key) { + return function computedGetter() { var watcher = this._computedWatchers && this._computedWatchers[key]; if (watcher) { if (watcher.dirty) { @@ -4834,46 +4964,50 @@ if (Dep.target) { watcher.depend(); } - return watcher.value + return watcher.value; } - } + }; } function createGetterInvoker(fn) { - return function computedGetter () { - return fn.call(this, this) - } + return function computedGetter() { + return fn.call(this, this); + }; } - function initMethods (vm, methods) { + function initMethods(vm, methods) { var props = vm.$options.props; for (var key in methods) { { - if (typeof methods[key] !== 'function') { + if (typeof methods[key] !== "function") { warn( - "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " + - "Did you reference the function correctly?", + 'Method "' + + key + + '" has type "' + + typeof methods[key] + + '" in the component definition. ' + + "Did you reference the function correctly?", vm ); } if (props && hasOwn(props, key)) { - warn( - ("Method \"" + key + "\" has already been defined as a prop."), - vm - ); + warn('Method "' + key + '" has already been defined as a prop.', vm); } - if ((key in vm) && isReserved(key)) { + if (key in vm && isReserved(key)) { warn( - "Method \"" + key + "\" conflicts with an existing Vue instance method. " + - "Avoid defining component methods that start with _ or $." + 'Method "' + + key + + '" conflicts with an existing Vue instance method. ' + + "Avoid defining component methods that start with _ or $." ); } } - vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm); + vm[key] = + typeof methods[key] !== "function" ? noop : bind(methods[key], vm); } } - function initWatch (vm, watch) { + function initWatch(vm, watch) { for (var key in watch) { var handler = watch[key]; if (Array.isArray(handler)) { @@ -4886,35 +5020,34 @@ } } - function createWatcher ( - vm, - expOrFn, - handler, - options - ) { + function createWatcher(vm, expOrFn, handler, options) { if (isPlainObject(handler)) { options = handler; handler = handler.handler; } - if (typeof handler === 'string') { + if (typeof handler === "string") { handler = vm[handler]; } - return vm.$watch(expOrFn, handler, options) + return vm.$watch(expOrFn, handler, options); } - function stateMixin (Vue) { + function stateMixin(Vue) { // flow somehow has problems with directly declared definition object // when using Object.defineProperty, so we have to procedurally build up // the object here. var dataDef = {}; - dataDef.get = function () { return this._data }; + dataDef.get = function () { + return this._data; + }; var propsDef = {}; - propsDef.get = function () { return this._props }; + propsDef.get = function () { + return this._props; + }; { dataDef.set = function () { warn( - 'Avoid replacing instance root $data. ' + - 'Use nested data properties instead.', + "Avoid replacing instance root $data. " + + "Use nested data properties instead.", this ); }; @@ -4922,20 +5055,16 @@ warn("$props is readonly.", this); }; } - Object.defineProperty(Vue.prototype, '$data', dataDef); - Object.defineProperty(Vue.prototype, '$props', propsDef); + Object.defineProperty(Vue.prototype, "$data", dataDef); + Object.defineProperty(Vue.prototype, "$props", propsDef); Vue.prototype.$set = set; Vue.prototype.$delete = del; - Vue.prototype.$watch = function ( - expOrFn, - cb, - options - ) { + Vue.prototype.$watch = function (expOrFn, cb, options) { var vm = this; if (isPlainObject(cb)) { - return createWatcher(vm, expOrFn, cb, options) + return createWatcher(vm, expOrFn, cb, options); } options = options || {}; options.user = true; @@ -4944,12 +5073,16 @@ try { cb.call(vm, watcher.value); } catch (error) { - handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\"")); + handleError( + error, + vm, + 'callback for immediate watcher "' + watcher.expression + '"' + ); } } - return function unwatchFn () { + return function unwatchFn() { watcher.teardown(); - } + }; }; } @@ -4957,7 +5090,7 @@ var uid$3 = 0; - function initMixin (Vue) { + function initMixin(Vue) { Vue.prototype._init = function (options) { var vm = this; // a uid @@ -4966,8 +5099,8 @@ var startTag, endTag; /* istanbul ignore if */ if (config.performance && mark) { - startTag = "vue-perf-start:" + (vm._uid); - endTag = "vue-perf-end:" + (vm._uid); + startTag = "vue-perf-start:" + vm._uid; + endTag = "vue-perf-end:" + vm._uid; mark(startTag); } @@ -4995,17 +5128,17 @@ initLifecycle(vm); initEvents(vm); initRender(vm); - callHook(vm, 'beforeCreate'); + callHook(vm, "beforeCreate"); initInjections(vm); // resolve injections before data/props initState(vm); initProvide(vm); // resolve provide after data/props - callHook(vm, 'created'); + callHook(vm, "created"); /* istanbul ignore if */ if (config.performance && mark) { vm._name = formatComponentName(vm, false); mark(endTag); - measure(("vue " + (vm._name) + " init"), startTag, endTag); + measure("vue " + vm._name + " init", startTag, endTag); } if (vm.$options.el) { @@ -5014,8 +5147,8 @@ }; } - function initInternalComponent (vm, options) { - var opts = vm.$options = Object.create(vm.constructor.options); + function initInternalComponent(vm, options) { + var opts = (vm.$options = Object.create(vm.constructor.options)); // doing this because it's faster than dynamic enumeration. var parentVnode = options._parentVnode; opts.parent = options.parent; @@ -5033,7 +5166,7 @@ } } - function resolveConstructorOptions (Ctor) { + function resolveConstructorOptions(Ctor) { var options = Ctor.options; if (Ctor.super) { var superOptions = resolveConstructorOptions(Ctor.super); @@ -5054,26 +5187,27 @@ } } } - return options + return options; } - function resolveModifiedOptions (Ctor) { + function resolveModifiedOptions(Ctor) { var modified; var latest = Ctor.options; var sealed = Ctor.sealedOptions; for (var key in latest) { if (latest[key] !== sealed[key]) { - if (!modified) { modified = {}; } + if (!modified) { + modified = {}; + } modified[key] = latest[key]; } } - return modified + return modified; } - function Vue (options) { - if (!(this instanceof Vue) - ) { - warn('Vue is a constructor and should be called with the `new` keyword'); + function Vue(options) { + if (!(this instanceof Vue)) { + warn("Vue is a constructor and should be called with the `new` keyword"); } this._init(options); } @@ -5086,38 +5220,39 @@ /* */ - function initUse (Vue) { + function initUse(Vue) { Vue.use = function (plugin) { - var installedPlugins = (this._installedPlugins || (this._installedPlugins = [])); + var installedPlugins = + this._installedPlugins || (this._installedPlugins = []); if (installedPlugins.indexOf(plugin) > -1) { - return this + return this; } // additional parameters var args = toArray(arguments, 1); args.unshift(this); - if (typeof plugin.install === 'function') { + if (typeof plugin.install === "function") { plugin.install.apply(plugin, args); - } else if (typeof plugin === 'function') { + } else if (typeof plugin === "function") { plugin.apply(null, args); } installedPlugins.push(plugin); - return this + return this; }; } /* */ - function initMixin$1 (Vue) { + function initMixin$1(Vue) { Vue.mixin = function (mixin) { this.options = mergeOptions(this.options, mixin); - return this + return this; }; } /* */ - function initExtend (Vue) { + function initExtend(Vue) { /** * Each instance constructor, including Vue, has a unique * cid. This enables us to create wrapped "child @@ -5135,7 +5270,7 @@ var SuperId = Super.cid; var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {}); if (cachedCtors[SuperId]) { - return cachedCtors[SuperId] + return cachedCtors[SuperId]; } var name = extendOptions.name || Super.options.name; @@ -5143,17 +5278,14 @@ validateComponentName(name); } - var Sub = function VueComponent (options) { + var Sub = function VueComponent(options) { this._init(options); }; Sub.prototype = Object.create(Super.prototype); Sub.prototype.constructor = Sub; Sub.cid = cid++; - Sub.options = mergeOptions( - Super.options, - extendOptions - ); - Sub['super'] = Super; + Sub.options = mergeOptions(Super.options, extendOptions); + Sub["super"] = Super; // For props and computed properties, we define the proxy getters on // the Vue instances at extension time, on the extended prototype. This @@ -5189,18 +5321,18 @@ // cache constructor cachedCtors[SuperId] = Sub; - return Sub + return Sub; }; } - function initProps$1 (Comp) { + function initProps$1(Comp) { var props = Comp.options.props; for (var key in props) { proxy(Comp.prototype, "_props", key); } } - function initComputed$1 (Comp) { + function initComputed$1(Comp) { var computed = Comp.options.computed; for (var key in computed) { defineComputed(Comp.prototype, key, computed[key]); @@ -5209,31 +5341,28 @@ /* */ - function initAssetRegisters (Vue) { + function initAssetRegisters(Vue) { /** * Create asset registration methods. */ ASSET_TYPES.forEach(function (type) { - Vue[type] = function ( - id, - definition - ) { + Vue[type] = function (id, definition) { if (!definition) { - return this.options[type + 's'][id] + return this.options[type + "s"][id]; } else { /* istanbul ignore if */ - if (type === 'component') { + if (type === "component") { validateComponentName(id); } - if (type === 'component' && isPlainObject(definition)) { + if (type === "component" && isPlainObject(definition)) { definition.name = definition.name || id; definition = this.options._base.extend(definition); } - if (type === 'directive' && typeof definition === 'function') { + if (type === "directive" && typeof definition === "function") { definition = { bind: definition, update: definition }; } - this.options[type + 's'][id] = definition; - return definition + this.options[type + "s"][id] = definition; + return definition; } }; }); @@ -5241,25 +5370,23 @@ /* */ - - - function getComponentName (opts) { - return opts && (opts.Ctor.options.name || opts.tag) + function getComponentName(opts) { + return opts && (opts.Ctor.options.name || opts.tag); } - function matches (pattern, name) { + function matches(pattern, name) { if (Array.isArray(pattern)) { - return pattern.indexOf(name) > -1 - } else if (typeof pattern === 'string') { - return pattern.split(',').indexOf(name) > -1 + return pattern.indexOf(name) > -1; + } else if (typeof pattern === "string") { + return pattern.split(",").indexOf(name) > -1; } else if (isRegExp(pattern)) { - return pattern.test(name) + return pattern.test(name); } /* istanbul ignore next */ - return false + return false; } - function pruneCache (keepAliveInstance, filter) { + function pruneCache(keepAliveInstance, filter) { var cache = keepAliveInstance.cache; var keys = keepAliveInstance.keys; var _vnode = keepAliveInstance._vnode; @@ -5274,12 +5401,7 @@ } } - function pruneCacheEntry ( - cache, - key, - keys, - current - ) { + function pruneCacheEntry(cache, key, keys, current) { var cached$$1 = cache[key]; if (cached$$1 && (!current || cached$$1.tag !== current.tag)) { cached$$1.componentInstance.$destroy(); @@ -5291,38 +5413,42 @@ var patternTypes = [String, RegExp, Array]; var KeepAlive = { - name: 'keep-alive', + name: "keep-alive", abstract: true, props: { include: patternTypes, exclude: patternTypes, - max: [String, Number] + max: [String, Number], }, - created: function created () { + created: function created() { this.cache = Object.create(null); this.keys = []; }, - destroyed: function destroyed () { + destroyed: function destroyed() { for (var key in this.cache) { pruneCacheEntry(this.cache, key, this.keys); } }, - mounted: function mounted () { + mounted: function mounted() { var this$1 = this; - this.$watch('include', function (val) { - pruneCache(this$1, function (name) { return matches(val, name); }); + this.$watch("include", function (val) { + pruneCache(this$1, function (name) { + return matches(val, name); + }); }); - this.$watch('exclude', function (val) { - pruneCache(this$1, function (name) { return !matches(val, name); }); + this.$watch("exclude", function (val) { + pruneCache(this$1, function (name) { + return !matches(val, name); + }); }); }, - render: function render () { + render: function render() { var slot = this.$slots.default; var vnode = getFirstComponentChild(slot); var componentOptions = vnode && vnode.componentOptions; @@ -5338,17 +5464,19 @@ // excluded (exclude && name && matches(exclude, name)) ) { - return vnode + return vnode; } var ref$1 = this; var cache = ref$1.cache; var keys = ref$1.keys; - var key = vnode.key == null - // same constructor may get registered as different local components - // so cid alone is not enough (#3269) - ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '') - : vnode.key; + var key = + vnode.key == null + ? // same constructor may get registered as different local components + // so cid alone is not enough (#3269) + componentOptions.Ctor.cid + + (componentOptions.tag ? "::" + componentOptions.tag : "") + : vnode.key; if (cache[key]) { vnode.componentInstance = cache[key].componentInstance; // make current key freshest @@ -5365,28 +5493,30 @@ vnode.data.keepAlive = true; } - return vnode || (slot && slot[0]) - } + return vnode || (slot && slot[0]); + }, }; var builtInComponents = { - KeepAlive: KeepAlive + KeepAlive: KeepAlive, }; /* */ - function initGlobalAPI (Vue) { + function initGlobalAPI(Vue) { // config var configDef = {}; - configDef.get = function () { return config; }; + configDef.get = function () { + return config; + }; { configDef.set = function () { warn( - 'Do not replace the Vue.config object, set individual fields instead.' + "Do not replace the Vue.config object, set individual fields instead." ); }; } - Object.defineProperty(Vue, 'config', configDef); + Object.defineProperty(Vue, "config", configDef); // exposed util methods. // NOTE: these are not considered part of the public API - avoid relying on @@ -5395,7 +5525,7 @@ warn: warn, extend: extend, mergeOptions: mergeOptions, - defineReactive: defineReactive$$1 + defineReactive: defineReactive$$1, }; Vue.set = set; @@ -5405,12 +5535,12 @@ // 2.6 explicit observable API Vue.observable = function (obj) { observe(obj); - return obj + return obj; }; Vue.options = Object.create(null); ASSET_TYPES.forEach(function (type) { - Vue.options[type + 's'] = Object.create(null); + Vue.options[type + "s"] = Object.create(null); }); // this is used to identify the "base" constructor to extend all plain-object @@ -5427,80 +5557,82 @@ initGlobalAPI(Vue); - Object.defineProperty(Vue.prototype, '$isServer', { - get: isServerRendering + Object.defineProperty(Vue.prototype, "$isServer", { + get: isServerRendering, }); - Object.defineProperty(Vue.prototype, '$ssrContext', { - get: function get () { + Object.defineProperty(Vue.prototype, "$ssrContext", { + get: function get() { /* istanbul ignore next */ - return this.$vnode && this.$vnode.ssrContext - } + return this.$vnode && this.$vnode.ssrContext; + }, }); // expose FunctionalRenderContext for ssr runtime helper installation - Object.defineProperty(Vue, 'FunctionalRenderContext', { - value: FunctionalRenderContext + Object.defineProperty(Vue, "FunctionalRenderContext", { + value: FunctionalRenderContext, }); - Vue.version = '2.6.12'; + Vue.version = "2.6.12"; /* */ // these are reserved for web because they are directly compiled away // during template compilation - var isReservedAttr = makeMap('style,class'); + var isReservedAttr = makeMap("style,class"); // attributes that should be using props for binding - var acceptValue = makeMap('input,textarea,option,select,progress'); + var acceptValue = makeMap("input,textarea,option,select,progress"); var mustUseProp = function (tag, type, attr) { return ( - (attr === 'value' && acceptValue(tag)) && type !== 'button' || - (attr === 'selected' && tag === 'option') || - (attr === 'checked' && tag === 'input') || - (attr === 'muted' && tag === 'video') - ) + (attr === "value" && acceptValue(tag) && type !== "button") || + (attr === "selected" && tag === "option") || + (attr === "checked" && tag === "input") || + (attr === "muted" && tag === "video") + ); }; - var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck'); + var isEnumeratedAttr = makeMap("contenteditable,draggable,spellcheck"); - var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only'); + var isValidContentEditableValue = makeMap( + "events,caret,typing,plaintext-only" + ); var convertEnumeratedValue = function (key, value) { - return isFalsyAttrValue(value) || value === 'false' - ? 'false' - // allow arbitrary string value for contenteditable - : key === 'contenteditable' && isValidContentEditableValue(value) - ? value - : 'true' + return isFalsyAttrValue(value) || value === "false" + ? "false" + : // allow arbitrary string value for contenteditable + key === "contenteditable" && isValidContentEditableValue(value) + ? value + : "true"; }; var isBooleanAttr = makeMap( - 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' + - 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' + - 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' + - 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' + - 'required,reversed,scoped,seamless,selected,sortable,translate,' + - 'truespeed,typemustmatch,visible' + "allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare," + + "default,defaultchecked,defaultmuted,defaultselected,defer,disabled," + + "enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple," + + "muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly," + + "required,reversed,scoped,seamless,selected,sortable,translate," + + "truespeed,typemustmatch,visible" ); - var xlinkNS = 'http://www.w3.org/1999/xlink'; + var xlinkNS = "http://www.w3.org/1999/xlink"; var isXlink = function (name) { - return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink' + return name.charAt(5) === ":" && name.slice(0, 5) === "xlink"; }; var getXlinkProp = function (name) { - return isXlink(name) ? name.slice(6, name.length) : '' + return isXlink(name) ? name.slice(6, name.length) : ""; }; var isFalsyAttrValue = function (val) { - return val == null || val === false + return val == null || val === false; }; /* */ - function genClassForVnode (vnode) { + function genClassForVnode(vnode) { var data = vnode.data; var parentNode = vnode; var childNode = vnode; @@ -5510,229 +5642,236 @@ data = mergeClassData(childNode.data, data); } } - while (isDef(parentNode = parentNode.parent)) { + while (isDef((parentNode = parentNode.parent))) { if (parentNode && parentNode.data) { data = mergeClassData(data, parentNode.data); } } - return renderClass(data.staticClass, data.class) + return renderClass(data.staticClass, data.class); } - function mergeClassData (child, parent) { + function mergeClassData(child, parent) { return { staticClass: concat(child.staticClass, parent.staticClass), - class: isDef(child.class) - ? [child.class, parent.class] - : parent.class - } + class: isDef(child.class) ? [child.class, parent.class] : parent.class, + }; } - function renderClass ( - staticClass, - dynamicClass - ) { + function renderClass(staticClass, dynamicClass) { if (isDef(staticClass) || isDef(dynamicClass)) { - return concat(staticClass, stringifyClass(dynamicClass)) + return concat(staticClass, stringifyClass(dynamicClass)); } /* istanbul ignore next */ - return '' + return ""; } - function concat (a, b) { - return a ? b ? (a + ' ' + b) : a : (b || '') + function concat(a, b) { + return a ? (b ? a + " " + b : a) : b || ""; } - function stringifyClass (value) { + function stringifyClass(value) { if (Array.isArray(value)) { - return stringifyArray(value) + return stringifyArray(value); } if (isObject(value)) { - return stringifyObject(value) + return stringifyObject(value); } - if (typeof value === 'string') { - return value + if (typeof value === "string") { + return value; } /* istanbul ignore next */ - return '' + return ""; } - function stringifyArray (value) { - var res = ''; + function stringifyArray(value) { + var res = ""; var stringified; for (var i = 0, l = value.length; i < l; i++) { - if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') { - if (res) { res += ' '; } + if ( + isDef((stringified = stringifyClass(value[i]))) && + stringified !== "" + ) { + if (res) { + res += " "; + } res += stringified; } } - return res + return res; } - function stringifyObject (value) { - var res = ''; + function stringifyObject(value) { + var res = ""; for (var key in value) { if (value[key]) { - if (res) { res += ' '; } + if (res) { + res += " "; + } res += key; } } - return res + return res; } /* */ var namespaceMap = { - svg: 'http://www.w3.org/2000/svg', - math: 'http://www.w3.org/1998/Math/MathML' + svg: "http://www.w3.org/2000/svg", + math: "http://www.w3.org/1998/Math/MathML", }; var isHTMLTag = makeMap( - 'html,body,base,head,link,meta,style,title,' + - 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' + - 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' + - 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' + - 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' + - 'embed,object,param,source,canvas,script,noscript,del,ins,' + - 'caption,col,colgroup,table,thead,tbody,td,th,tr,' + - 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' + - 'output,progress,select,textarea,' + - 'details,dialog,menu,menuitem,summary,' + - 'content,element,shadow,template,blockquote,iframe,tfoot' + "html,body,base,head,link,meta,style,title," + + "address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section," + + "div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul," + + "a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby," + + "s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video," + + "embed,object,param,source,canvas,script,noscript,del,ins," + + "caption,col,colgroup,table,thead,tbody,td,th,tr," + + "button,datalist,fieldset,form,input,label,legend,meter,optgroup,option," + + "output,progress,select,textarea," + + "details,dialog,menu,menuitem,summary," + + "content,element,shadow,template,blockquote,iframe,tfoot" ); // this map is intentionally selective, only covering SVG elements that may // contain child elements. var isSVG = makeMap( - 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' + - 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + - 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', + "svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face," + + "foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern," + + "polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view", true ); - var isPreTag = function (tag) { return tag === 'pre'; }; + var isPreTag = function (tag) { + return tag === "pre"; + }; var isReservedTag = function (tag) { - return isHTMLTag(tag) || isSVG(tag) + return isHTMLTag(tag) || isSVG(tag); }; - function getTagNamespace (tag) { + function getTagNamespace(tag) { if (isSVG(tag)) { - return 'svg' + return "svg"; } // basic support for MathML // note it doesn't support other MathML elements being component roots - if (tag === 'math') { - return 'math' + if (tag === "math") { + return "math"; } } var unknownElementCache = Object.create(null); - function isUnknownElement (tag) { + function isUnknownElement(tag) { /* istanbul ignore if */ if (!inBrowser) { - return true + return true; } if (isReservedTag(tag)) { - return false + return false; } tag = tag.toLowerCase(); /* istanbul ignore if */ if (unknownElementCache[tag] != null) { - return unknownElementCache[tag] + return unknownElementCache[tag]; } var el = document.createElement(tag); - if (tag.indexOf('-') > -1) { + if (tag.indexOf("-") > -1) { // http://stackoverflow.com/a/28210364/1070244 - return (unknownElementCache[tag] = ( + return (unknownElementCache[tag] = el.constructor === window.HTMLUnknownElement || - el.constructor === window.HTMLElement - )) + el.constructor === window.HTMLElement); } else { - return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString())) + return (unknownElementCache[tag] = /HTMLUnknownElement/.test( + el.toString() + )); } } - var isTextInputType = makeMap('text,number,password,search,email,tel,url'); + var isTextInputType = makeMap("text,number,password,search,email,tel,url"); /* */ /** * Query an element selector if it's not an element already. */ - function query (el) { - if (typeof el === 'string') { + function query(el) { + if (typeof el === "string") { var selected = document.querySelector(el); if (!selected) { - warn( - 'Cannot find element: ' + el - ); - return document.createElement('div') + warn("Cannot find element: " + el); + return document.createElement("div"); } - return selected + return selected; } else { - return el + return el; } } /* */ - function createElement$1 (tagName, vnode) { + function createElement$1(tagName, vnode) { var elm = document.createElement(tagName); - if (tagName !== 'select') { - return elm + if (tagName !== "select") { + return elm; } // false or null will remove the attribute but undefined will not - if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) { - elm.setAttribute('multiple', 'multiple'); + if ( + vnode.data && + vnode.data.attrs && + vnode.data.attrs.multiple !== undefined + ) { + elm.setAttribute("multiple", "multiple"); } - return elm + return elm; } - function createElementNS (namespace, tagName) { - return document.createElementNS(namespaceMap[namespace], tagName) + function createElementNS(namespace, tagName) { + return document.createElementNS(namespaceMap[namespace], tagName); } - function createTextNode (text) { - return document.createTextNode(text) + function createTextNode(text) { + return document.createTextNode(text); } - function createComment (text) { - return document.createComment(text) + function createComment(text) { + return document.createComment(text); } - function insertBefore (parentNode, newNode, referenceNode) { + function insertBefore(parentNode, newNode, referenceNode) { parentNode.insertBefore(newNode, referenceNode); } - function removeChild (node, child) { + function removeChild(node, child) { node.removeChild(child); } - function appendChild (node, child) { + function appendChild(node, child) { node.appendChild(child); } - function parentNode (node) { - return node.parentNode + function parentNode(node) { + return node.parentNode; } - function nextSibling (node) { - return node.nextSibling + function nextSibling(node) { + return node.nextSibling; } - function tagName (node) { - return node.tagName + function tagName(node) { + return node.tagName; } - function setTextContent (node, text) { + function setTextContent(node, text) { node.textContent = text; } - function setStyleScope (node, scopeId) { - node.setAttribute(scopeId, ''); + function setStyleScope(node, scopeId) { + node.setAttribute(scopeId, ""); } - var nodeOps = /*#__PURE__*/Object.freeze({ + var nodeOps = /*#__PURE__*/ Object.freeze({ createElement: createElement$1, createElementNS: createElementNS, createTextNode: createTextNode, @@ -5744,29 +5883,31 @@ nextSibling: nextSibling, tagName: tagName, setTextContent: setTextContent, - setStyleScope: setStyleScope + setStyleScope: setStyleScope, }); /* */ var ref = { - create: function create (_, vnode) { + create: function create(_, vnode) { registerRef(vnode); }, - update: function update (oldVnode, vnode) { + update: function update(oldVnode, vnode) { if (oldVnode.data.ref !== vnode.data.ref) { registerRef(oldVnode, true); registerRef(vnode); } }, - destroy: function destroy (vnode) { + destroy: function destroy(vnode) { registerRef(vnode, true); - } + }, }; - function registerRef (vnode, isRemoval) { + function registerRef(vnode, isRemoval) { var key = vnode.data.ref; - if (!isDef(key)) { return } + if (!isDef(key)) { + return; + } var vm = vnode.context; var ref = vnode.componentInstance || vnode.elm; @@ -5803,46 +5944,48 @@ * of making flow understand it is not worth it. */ - var emptyNode = new VNode('', {}, []); + var emptyNode = new VNode("", {}, []); - var hooks = ['create', 'activate', 'update', 'remove', 'destroy']; + var hooks = ["create", "activate", "update", "remove", "destroy"]; - function sameVnode (a, b) { + function sameVnode(a, b) { return ( - a.key === b.key && ( - ( - a.tag === b.tag && - a.isComment === b.isComment && - isDef(a.data) === isDef(b.data) && - sameInputType(a, b) - ) || ( - isTrue(a.isAsyncPlaceholder) && + a.key === b.key && + ((a.tag === b.tag && + a.isComment === b.isComment && + isDef(a.data) === isDef(b.data) && + sameInputType(a, b)) || + (isTrue(a.isAsyncPlaceholder) && a.asyncFactory === b.asyncFactory && - isUndef(b.asyncFactory.error) - ) - ) - ) + isUndef(b.asyncFactory.error))) + ); } - function sameInputType (a, b) { - if (a.tag !== 'input') { return true } + function sameInputType(a, b) { + if (a.tag !== "input") { + return true; + } var i; - var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type; - var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type; - return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB) + var typeA = isDef((i = a.data)) && isDef((i = i.attrs)) && i.type; + var typeB = isDef((i = b.data)) && isDef((i = i.attrs)) && i.type; + return ( + typeA === typeB || (isTextInputType(typeA) && isTextInputType(typeB)) + ); } - function createKeyToOldIdx (children, beginIdx, endIdx) { + function createKeyToOldIdx(children, beginIdx, endIdx) { var i, key; var map = {}; for (i = beginIdx; i <= endIdx; ++i) { key = children[i].key; - if (isDef(key)) { map[key] = i; } + if (isDef(key)) { + map[key] = i; + } } - return map + return map; } - function createPatchFunction (backend) { + function createPatchFunction(backend) { var i, j; var cbs = {}; @@ -5858,21 +6001,27 @@ } } - function emptyNodeAt (elm) { - return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm) + function emptyNodeAt(elm) { + return new VNode( + nodeOps.tagName(elm).toLowerCase(), + {}, + [], + undefined, + elm + ); } - function createRmCb (childElm, listeners) { - function remove$$1 () { + function createRmCb(childElm, listeners) { + function remove$$1() { if (--remove$$1.listeners === 0) { removeNode(childElm); } } remove$$1.listeners = listeners; - return remove$$1 + return remove$$1; } - function removeNode (el) { + function removeNode(el) { var parent = nodeOps.parentNode(el); // element may have already been removed due to v-html / v-text if (isDef(parent)) { @@ -5880,7 +6029,7 @@ } } - function isUnknownElement$$1 (vnode, inVPre) { + function isUnknownElement$$1(vnode, inVPre) { return ( !inVPre && !vnode.ns && @@ -5889,16 +6038,16 @@ config.ignoredElements.some(function (ignore) { return isRegExp(ignore) ? ignore.test(vnode.tag) - : ignore === vnode.tag + : ignore === vnode.tag; }) ) && config.isUnknownElement(vnode.tag) - ) + ); } var creatingElmInVPre = 0; - function createElm ( + function createElm( vnode, insertedVnodeQueue, parentElm, @@ -5918,7 +6067,7 @@ vnode.isRootInsert = !nested; // for transition enter check if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) { - return + return; } var data = vnode.data; @@ -5931,9 +6080,11 @@ } if (isUnknownElement$$1(vnode, creatingElmInVPre)) { warn( - 'Unknown custom element: <' + tag + '> - did you ' + - 'register the component correctly? For recursive components, ' + - 'make sure to provide the "name" option.', + "Unknown custom element: <" + + tag + + "> - did you " + + "register the component correctly? For recursive components, " + + 'make sure to provide the "name" option.', vnode.context ); } @@ -5965,11 +6116,11 @@ } } - function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) { + function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) { var i = vnode.data; if (isDef(i)) { var isReactivated = isDef(vnode.componentInstance) && i.keepAlive; - if (isDef(i = i.hook) && isDef(i = i.init)) { + if (isDef((i = i.hook)) && isDef((i = i.init))) { i(vnode, false /* hydrating */); } // after calling the init hook, if the vnode is a child component @@ -5982,14 +6133,17 @@ if (isTrue(isReactivated)) { reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm); } - return true + return true; } } } - function initComponent (vnode, insertedVnodeQueue) { + function initComponent(vnode, insertedVnodeQueue) { if (isDef(vnode.data.pendingInsert)) { - insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert); + insertedVnodeQueue.push.apply( + insertedVnodeQueue, + vnode.data.pendingInsert + ); vnode.data.pendingInsert = null; } vnode.elm = vnode.componentInstance.$el; @@ -6005,7 +6159,7 @@ } } - function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) { + function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) { var i; // hack for #4339: a reactivated component with inner transition // does not trigger because the inner node's created hooks are not called @@ -6014,12 +6168,12 @@ var innerNode = vnode; while (innerNode.componentInstance) { innerNode = innerNode.componentInstance._vnode; - if (isDef(i = innerNode.data) && isDef(i = i.transition)) { + if (isDef((i = innerNode.data)) && isDef((i = i.transition))) { for (i = 0; i < cbs.activate.length; ++i) { cbs.activate[i](emptyNode, innerNode); } insertedVnodeQueue.push(innerNode); - break + break; } } // unlike a newly created component, @@ -6027,7 +6181,7 @@ insert(parentElm, vnode.elm, refElm); } - function insert (parent, elm, ref$$1) { + function insert(parent, elm, ref$$1) { if (isDef(parent)) { if (isDef(ref$$1)) { if (nodeOps.parentNode(ref$$1) === parent) { @@ -6039,98 +6193,137 @@ } } - function createChildren (vnode, children, insertedVnodeQueue) { + function createChildren(vnode, children, insertedVnodeQueue) { if (Array.isArray(children)) { { checkDuplicateKeys(children); } for (var i = 0; i < children.length; ++i) { - createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i); + createElm( + children[i], + insertedVnodeQueue, + vnode.elm, + null, + true, + children, + i + ); } } else if (isPrimitive(vnode.text)) { - nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text))); + nodeOps.appendChild( + vnode.elm, + nodeOps.createTextNode(String(vnode.text)) + ); } } - function isPatchable (vnode) { + function isPatchable(vnode) { while (vnode.componentInstance) { vnode = vnode.componentInstance._vnode; } - return isDef(vnode.tag) + return isDef(vnode.tag); } - function invokeCreateHooks (vnode, insertedVnodeQueue) { + function invokeCreateHooks(vnode, insertedVnodeQueue) { for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { cbs.create[i$1](emptyNode, vnode); } i = vnode.data.hook; // Reuse variable if (isDef(i)) { - if (isDef(i.create)) { i.create(emptyNode, vnode); } - if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); } + if (isDef(i.create)) { + i.create(emptyNode, vnode); + } + if (isDef(i.insert)) { + insertedVnodeQueue.push(vnode); + } } } // set scope id attribute for scoped CSS. // this is implemented as a special case to avoid the overhead // of going through the normal attribute patching process. - function setScope (vnode) { + function setScope(vnode) { var i; - if (isDef(i = vnode.fnScopeId)) { + if (isDef((i = vnode.fnScopeId))) { nodeOps.setStyleScope(vnode.elm, i); } else { var ancestor = vnode; while (ancestor) { - if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) { + if ( + isDef((i = ancestor.context)) && + isDef((i = i.$options._scopeId)) + ) { nodeOps.setStyleScope(vnode.elm, i); } ancestor = ancestor.parent; } } // for slot content they should also get the scopeId from the host instance. - if (isDef(i = activeInstance) && + if ( + isDef((i = activeInstance)) && i !== vnode.context && i !== vnode.fnContext && - isDef(i = i.$options._scopeId) + isDef((i = i.$options._scopeId)) ) { nodeOps.setStyleScope(vnode.elm, i); } } - function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) { + function addVnodes( + parentElm, + refElm, + vnodes, + startIdx, + endIdx, + insertedVnodeQueue + ) { for (; startIdx <= endIdx; ++startIdx) { - createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx); + createElm( + vnodes[startIdx], + insertedVnodeQueue, + parentElm, + refElm, + false, + vnodes, + startIdx + ); } } - function invokeDestroyHook (vnode) { + function invokeDestroyHook(vnode) { var i, j; var data = vnode.data; if (isDef(data)) { - if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); } - for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); } + if (isDef((i = data.hook)) && isDef((i = i.destroy))) { + i(vnode); + } + for (i = 0; i < cbs.destroy.length; ++i) { + cbs.destroy[i](vnode); + } } - if (isDef(i = vnode.children)) { + if (isDef((i = vnode.children))) { for (j = 0; j < vnode.children.length; ++j) { invokeDestroyHook(vnode.children[j]); } } } - function removeVnodes (vnodes, startIdx, endIdx) { + function removeVnodes(vnodes, startIdx, endIdx) { for (; startIdx <= endIdx; ++startIdx) { var ch = vnodes[startIdx]; if (isDef(ch)) { if (isDef(ch.tag)) { removeAndInvokeRemoveHook(ch); invokeDestroyHook(ch); - } else { // Text node + } else { + // Text node removeNode(ch.elm); } } } } - function removeAndInvokeRemoveHook (vnode, rm) { + function removeAndInvokeRemoveHook(vnode, rm) { if (isDef(rm) || isDef(vnode.data)) { var i; var listeners = cbs.remove.length + 1; @@ -6143,13 +6336,17 @@ rm = createRmCb(vnode.elm, listeners); } // recursively invoke hooks on child component root node - if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { + if ( + isDef((i = vnode.componentInstance)) && + isDef((i = i._vnode)) && + isDef(i.data) + ) { removeAndInvokeRemoveHook(i, rm); } for (i = 0; i < cbs.remove.length; ++i) { cbs.remove[i](vnode, rm); } - if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) { + if (isDef((i = vnode.data.hook)) && isDef((i = i.remove))) { i(vnode, rm); } else { rm(); @@ -6159,7 +6356,13 @@ } } - function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) { + function updateChildren( + parentElm, + oldCh, + newCh, + insertedVnodeQueue, + removeOnly + ) { var oldStartIdx = 0; var newStartIdx = 0; var oldEndIdx = oldCh.length - 1; @@ -6185,53 +6388,124 @@ } else if (isUndef(oldEndVnode)) { oldEndVnode = oldCh[--oldEndIdx]; } else if (sameVnode(oldStartVnode, newStartVnode)) { - patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); + patchVnode( + oldStartVnode, + newStartVnode, + insertedVnodeQueue, + newCh, + newStartIdx + ); oldStartVnode = oldCh[++oldStartIdx]; newStartVnode = newCh[++newStartIdx]; } else if (sameVnode(oldEndVnode, newEndVnode)) { - patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx); + patchVnode( + oldEndVnode, + newEndVnode, + insertedVnodeQueue, + newCh, + newEndIdx + ); oldEndVnode = oldCh[--oldEndIdx]; newEndVnode = newCh[--newEndIdx]; - } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right - patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx); - canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm)); + } else if (sameVnode(oldStartVnode, newEndVnode)) { + // Vnode moved right + patchVnode( + oldStartVnode, + newEndVnode, + insertedVnodeQueue, + newCh, + newEndIdx + ); + canMove && + nodeOps.insertBefore( + parentElm, + oldStartVnode.elm, + nodeOps.nextSibling(oldEndVnode.elm) + ); oldStartVnode = oldCh[++oldStartIdx]; newEndVnode = newCh[--newEndIdx]; - } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left - patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); - canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); + } else if (sameVnode(oldEndVnode, newStartVnode)) { + // Vnode moved left + patchVnode( + oldEndVnode, + newStartVnode, + insertedVnodeQueue, + newCh, + newStartIdx + ); + canMove && + nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); oldEndVnode = oldCh[--oldEndIdx]; newStartVnode = newCh[++newStartIdx]; } else { - if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); } + if (isUndef(oldKeyToIdx)) { + oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); + } idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx); - if (isUndef(idxInOld)) { // New element - createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); + if (isUndef(idxInOld)) { + // New element + createElm( + newStartVnode, + insertedVnodeQueue, + parentElm, + oldStartVnode.elm, + false, + newCh, + newStartIdx + ); } else { vnodeToMove = oldCh[idxInOld]; if (sameVnode(vnodeToMove, newStartVnode)) { - patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); + patchVnode( + vnodeToMove, + newStartVnode, + insertedVnodeQueue, + newCh, + newStartIdx + ); oldCh[idxInOld] = undefined; - canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm); + canMove && + nodeOps.insertBefore( + parentElm, + vnodeToMove.elm, + oldStartVnode.elm + ); } else { // same key but different element. treat as new element - createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); + createElm( + newStartVnode, + insertedVnodeQueue, + parentElm, + oldStartVnode.elm, + false, + newCh, + newStartIdx + ); } } newStartVnode = newCh[++newStartIdx]; } } if (oldStartIdx > oldEndIdx) { - refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; - addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); + refElm = isUndef(newCh[newEndIdx + 1]) + ? null + : newCh[newEndIdx + 1].elm; + addVnodes( + parentElm, + refElm, + newCh, + newStartIdx, + newEndIdx, + insertedVnodeQueue + ); } else if (newStartIdx > newEndIdx) { removeVnodes(oldCh, oldStartIdx, oldEndIdx); } } - function checkDuplicateKeys (children) { + function checkDuplicateKeys(children) { var seenKeys = {}; for (var i = 0; i < children.length; i++) { var vnode = children[i]; @@ -6239,7 +6513,9 @@ if (isDef(key)) { if (seenKeys[key]) { warn( - ("Duplicate keys detected: '" + key + "'. This may cause an update error."), + "Duplicate keys detected: '" + + key + + "'. This may cause an update error.", vnode.context ); } else { @@ -6249,14 +6525,16 @@ } } - function findIdxInOld (node, oldCh, start, end) { + function findIdxInOld(node, oldCh, start, end) { for (var i = start; i < end; i++) { var c = oldCh[i]; - if (isDef(c) && sameVnode(node, c)) { return i } + if (isDef(c) && sameVnode(node, c)) { + return i; + } } } - function patchVnode ( + function patchVnode( oldVnode, vnode, insertedVnodeQueue, @@ -6265,7 +6543,7 @@ removeOnly ) { if (oldVnode === vnode) { - return + return; } if (isDef(vnode.elm) && isDef(ownerArray)) { @@ -6273,7 +6551,7 @@ vnode = ownerArray[index] = cloneVNode(vnode); } - var elm = vnode.elm = oldVnode.elm; + var elm = (vnode.elm = oldVnode.elm); if (isTrue(oldVnode.isAsyncPlaceholder)) { if (isDef(vnode.asyncFactory.resolved)) { @@ -6281,57 +6559,68 @@ } else { vnode.isAsyncPlaceholder = true; } - return + return; } // reuse element for static trees. // note we only do this if the vnode is cloned - // if the new node is not cloned it means the render functions have been // reset by the hot-reload-api and we need to do a proper re-render. - if (isTrue(vnode.isStatic) && + if ( + isTrue(vnode.isStatic) && isTrue(oldVnode.isStatic) && vnode.key === oldVnode.key && (isTrue(vnode.isCloned) || isTrue(vnode.isOnce)) ) { vnode.componentInstance = oldVnode.componentInstance; - return + return; } var i; var data = vnode.data; - if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) { + if (isDef(data) && isDef((i = data.hook)) && isDef((i = i.prepatch))) { i(oldVnode, vnode); } var oldCh = oldVnode.children; var ch = vnode.children; if (isDef(data) && isPatchable(vnode)) { - for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); } - if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); } + for (i = 0; i < cbs.update.length; ++i) { + cbs.update[i](oldVnode, vnode); + } + if (isDef((i = data.hook)) && isDef((i = i.update))) { + i(oldVnode, vnode); + } } if (isUndef(vnode.text)) { if (isDef(oldCh) && isDef(ch)) { - if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); } + if (oldCh !== ch) { + updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); + } } else if (isDef(ch)) { { checkDuplicateKeys(ch); } - if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } + if (isDef(oldVnode.text)) { + nodeOps.setTextContent(elm, ""); + } addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); } else if (isDef(oldCh)) { removeVnodes(oldCh, 0, oldCh.length - 1); } else if (isDef(oldVnode.text)) { - nodeOps.setTextContent(elm, ''); + nodeOps.setTextContent(elm, ""); } } else if (oldVnode.text !== vnode.text) { nodeOps.setTextContent(elm, vnode.text); } if (isDef(data)) { - if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); } + if (isDef((i = data.hook)) && isDef((i = i.postpatch))) { + i(oldVnode, vnode); + } } } - function invokeInsertHook (vnode, queue, initial) { + function invokeInsertHook(vnode, queue, initial) { // delay insert hooks for component root nodes, invoke them after the // element is really inserted if (isTrue(initial) && isDef(vnode.parent)) { @@ -6348,10 +6637,10 @@ // are already rendered on the client or has no need for initialization // Note: style is excluded because it relies on initial clone for future // deep updates (#7063). - var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key'); + var isRenderedModule = makeMap("attrs,class,staticClass,staticStyle,key"); // Note: this is a browser-only function so we can assume elms are DOM nodes. - function hydrate (elm, vnode, insertedVnodeQueue, inVPre) { + function hydrate(elm, vnode, insertedVnodeQueue, inVPre) { var i; var tag = vnode.tag; var data = vnode.data; @@ -6361,20 +6650,22 @@ if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) { vnode.isAsyncPlaceholder = true; - return true + return true; } // assert node match { if (!assertNodeMatch(elm, vnode, inVPre)) { - return false + return false; } } if (isDef(data)) { - if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); } - if (isDef(i = vnode.componentInstance)) { + if (isDef((i = data.hook)) && isDef((i = i.init))) { + i(vnode, true /* hydrating */); + } + if (isDef((i = vnode.componentInstance))) { // child component. it should have hydrated its own tree. initComponent(vnode, insertedVnodeQueue); - return true + return true; } } if (isDef(tag)) { @@ -6384,27 +6675,32 @@ createChildren(vnode, children, insertedVnodeQueue); } else { // v-html and domProps: innerHTML - if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) { + if ( + isDef((i = data)) && + isDef((i = i.domProps)) && + isDef((i = i.innerHTML)) + ) { if (i !== elm.innerHTML) { /* istanbul ignore if */ - if (typeof console !== 'undefined' && - !hydrationBailed - ) { + if (typeof console !== "undefined" && !hydrationBailed) { hydrationBailed = true; - console.warn('Parent: ', elm); - console.warn('server innerHTML: ', i); - console.warn('client innerHTML: ', elm.innerHTML); + console.warn("Parent: ", elm); + console.warn("server innerHTML: ", i); + console.warn("client innerHTML: ", elm.innerHTML); } - return false + return false; } } else { // iterate and compare children lists var childrenMatch = true; var childNode = elm.firstChild; for (var i$1 = 0; i$1 < children.length; i$1++) { - if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) { + if ( + !childNode || + !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre) + ) { childrenMatch = false; - break + break; } childNode = childNode.nextSibling; } @@ -6412,14 +6708,16 @@ // longer than the virtual children list. if (!childrenMatch || childNode) { /* istanbul ignore if */ - if (typeof console !== 'undefined' && - !hydrationBailed - ) { + if (typeof console !== "undefined" && !hydrationBailed) { hydrationBailed = true; - console.warn('Parent: ', elm); - console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children); + console.warn("Parent: ", elm); + console.warn( + "Mismatching childNodes vs. VNodes: ", + elm.childNodes, + children + ); } - return false + return false; } } } @@ -6430,35 +6728,39 @@ if (!isRenderedModule(key)) { fullInvoke = true; invokeCreateHooks(vnode, insertedVnodeQueue); - break + break; } } - if (!fullInvoke && data['class']) { + if (!fullInvoke && data["class"]) { // ensure collecting deps for deep class bindings for future updates - traverse(data['class']); + traverse(data["class"]); } } } else if (elm.data !== vnode.text) { elm.data = vnode.text; } - return true + return true; } - function assertNodeMatch (node, vnode, inVPre) { + function assertNodeMatch(node, vnode, inVPre) { if (isDef(vnode.tag)) { - return vnode.tag.indexOf('vue-component') === 0 || ( - !isUnknownElement$$1(vnode, inVPre) && - vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase()) - ) + return ( + vnode.tag.indexOf("vue-component") === 0 || + (!isUnknownElement$$1(vnode, inVPre) && + vnode.tag.toLowerCase() === + (node.tagName && node.tagName.toLowerCase())) + ); } else { - return node.nodeType === (vnode.isComment ? 8 : 3) + return node.nodeType === (vnode.isComment ? 8 : 3); } } - return function patch (oldVnode, vnode, hydrating, removeOnly) { + return function patch(oldVnode, vnode, hydrating, removeOnly) { if (isUndef(vnode)) { - if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); } - return + if (isDef(oldVnode)) { + invokeDestroyHook(oldVnode); + } + return; } var isInitialPatch = false; @@ -6472,7 +6774,14 @@ var isRealElement = isDef(oldVnode.nodeType); if (!isRealElement && sameVnode(oldVnode, vnode)) { // patch existing root node - patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly); + patchVnode( + oldVnode, + vnode, + insertedVnodeQueue, + null, + null, + removeOnly + ); } else { if (isRealElement) { // mounting to a real element @@ -6485,14 +6794,14 @@ if (isTrue(hydrating)) { if (hydrate(oldVnode, vnode, insertedVnodeQueue)) { invokeInsertHook(vnode, insertedVnodeQueue, true); - return oldVnode + return oldVnode; } else { warn( - 'The client-side rendered virtual DOM tree is not matching ' + - 'server-rendered content. This is likely caused by incorrect ' + - 'HTML markup, for example nesting block-level elements inside ' + - '<p>, or missing <tbody>. Bailing hydration and performing ' + - 'full client-side render.' + "The client-side rendered virtual DOM tree is not matching " + + "server-rendered content. This is likely caused by incorrect " + + "HTML markup, for example nesting block-level elements inside " + + "<p>, or missing <tbody>. Bailing hydration and performing " + + "full client-side render." ); } } @@ -6556,8 +6865,8 @@ } invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch); - return vnode.elm - } + return vnode.elm; + }; } /* */ @@ -6565,21 +6874,24 @@ var directives = { create: updateDirectives, update: updateDirectives, - destroy: function unbindDirectives (vnode) { + destroy: function unbindDirectives(vnode) { updateDirectives(vnode, emptyNode); - } + }, }; - function updateDirectives (oldVnode, vnode) { + function updateDirectives(oldVnode, vnode) { if (oldVnode.data.directives || vnode.data.directives) { _update(oldVnode, vnode); } } - function _update (oldVnode, vnode) { + function _update(oldVnode, vnode) { var isCreate = oldVnode === emptyNode; var isDestroy = vnode === emptyNode; - var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context); + var oldDirs = normalizeDirectives$1( + oldVnode.data.directives, + oldVnode.context + ); var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context); var dirsWithInsert = []; @@ -6591,7 +6903,7 @@ dir = newDirs[key]; if (!oldDir) { // new directive, bind - callHook$1(dir, 'bind', vnode, oldVnode); + callHook$1(dir, "bind", vnode, oldVnode); if (dir.def && dir.def.inserted) { dirsWithInsert.push(dir); } @@ -6599,7 +6911,7 @@ // existing directive, update dir.oldValue = oldDir.value; dir.oldArg = oldDir.arg; - callHook$1(dir, 'update', vnode, oldVnode); + callHook$1(dir, "update", vnode, oldVnode); if (dir.def && dir.def.componentUpdated) { dirsWithPostpatch.push(dir); } @@ -6609,20 +6921,20 @@ if (dirsWithInsert.length) { var callInsert = function () { for (var i = 0; i < dirsWithInsert.length; i++) { - callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode); + callHook$1(dirsWithInsert[i], "inserted", vnode, oldVnode); } }; if (isCreate) { - mergeVNodeHook(vnode, 'insert', callInsert); + mergeVNodeHook(vnode, "insert", callInsert); } else { callInsert(); } } if (dirsWithPostpatch.length) { - mergeVNodeHook(vnode, 'postpatch', function () { + mergeVNodeHook(vnode, "postpatch", function () { for (var i = 0; i < dirsWithPostpatch.length; i++) { - callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode); + callHook$1(dirsWithPostpatch[i], "componentUpdated", vnode, oldVnode); } }); } @@ -6631,7 +6943,7 @@ for (key in oldDirs) { if (!newDirs[key]) { // no longer present, unbind - callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy); + callHook$1(oldDirs[key], "unbind", oldVnode, oldVnode, isDestroy); } } } @@ -6639,14 +6951,11 @@ var emptyModifiers = Object.create(null); - function normalizeDirectives$1 ( - dirs, - vm - ) { + function normalizeDirectives$1(dirs, vm) { var res = Object.create(null); if (!dirs) { // $flow-disable-line - return res + return res; } var i, dir; for (i = 0; i < dirs.length; i++) { @@ -6656,41 +6965,44 @@ dir.modifiers = emptyModifiers; } res[getRawDirName(dir)] = dir; - dir.def = resolveAsset(vm.$options, 'directives', dir.name, true); + dir.def = resolveAsset(vm.$options, "directives", dir.name, true); } // $flow-disable-line - return res + return res; } - function getRawDirName (dir) { - return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.'))) + function getRawDirName(dir) { + return ( + dir.rawName || dir.name + "." + Object.keys(dir.modifiers || {}).join(".") + ); } - function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) { + function callHook$1(dir, hook, vnode, oldVnode, isDestroy) { var fn = dir.def && dir.def[hook]; if (fn) { try { fn(vnode.elm, dir, vnode, oldVnode, isDestroy); } catch (e) { - handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook")); + handleError( + e, + vnode.context, + "directive " + dir.name + " " + hook + " hook" + ); } } } - var baseModules = [ - ref, - directives - ]; + var baseModules = [ref, directives]; /* */ - function updateAttrs (oldVnode, vnode) { + function updateAttrs(oldVnode, vnode) { var opts = vnode.componentOptions; if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) { - return + return; } if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) { - return + return; } var key, cur, old; var elm = vnode.elm; @@ -6712,7 +7024,7 @@ // #6666: IE/Edge forces progress value down to 1 before setting a max /* istanbul ignore if */ if ((isIE || isEdge) && attrs.value !== oldAttrs.value) { - setAttr(elm, 'value', attrs.value); + setAttr(elm, "value", attrs.value); } for (key in oldAttrs) { if (isUndef(attrs[key])) { @@ -6725,8 +7037,8 @@ } } - function setAttr (el, key, value) { - if (el.tagName.indexOf('-') > -1) { + function setAttr(el, key, value) { + if (el.tagName.indexOf("-") > -1) { baseSetAttr(el, key, value); } else if (isBooleanAttr(key)) { // set attribute for blank value @@ -6736,9 +7048,8 @@ } else { // technically allowfullscreen is a boolean attribute for <iframe>, // but Flash expects a value of "true" when used on <embed> tag - value = key === 'allowfullscreen' && el.tagName === 'EMBED' - ? 'true' - : key; + value = + key === "allowfullscreen" && el.tagName === "EMBED" ? "true" : key; el.setAttribute(key, value); } } else if (isEnumeratedAttr(key)) { @@ -6754,7 +7065,7 @@ } } - function baseSetAttr (el, key, value) { + function baseSetAttr(el, key, value) { if (isFalsyAttrValue(value)) { el.removeAttribute(key); } else { @@ -6763,15 +7074,18 @@ // immediately. /* istanbul ignore if */ if ( - isIE && !isIE9 && - el.tagName === 'TEXTAREA' && - key === 'placeholder' && value !== '' && !el.__ieph + isIE && + !isIE9 && + el.tagName === "TEXTAREA" && + key === "placeholder" && + value !== "" && + !el.__ieph ) { var blocker = function (e) { e.stopImmediatePropagation(); - el.removeEventListener('input', blocker); + el.removeEventListener("input", blocker); }; - el.addEventListener('input', blocker); + el.addEventListener("input", blocker); // $flow-disable-line el.__ieph = true; /* IE placeholder patched */ } @@ -6781,25 +7095,22 @@ var attrs = { create: updateAttrs, - update: updateAttrs + update: updateAttrs, }; /* */ - function updateClass (oldVnode, vnode) { + function updateClass(oldVnode, vnode) { var el = vnode.elm; var data = vnode.data; var oldData = oldVnode.data; if ( isUndef(data.staticClass) && - isUndef(data.class) && ( - isUndef(oldData) || ( - isUndef(oldData.staticClass) && - isUndef(oldData.class) - ) - ) + isUndef(data.class) && + (isUndef(oldData) || + (isUndef(oldData.staticClass) && isUndef(oldData.class))) ) { - return + return; } var cls = genClassForVnode(vnode); @@ -6812,21 +7123,21 @@ // set the class if (cls !== el._prevClass) { - el.setAttribute('class', cls); + el.setAttribute("class", cls); el._prevClass = cls; } } var klass = { create: updateClass, - update: updateClass + update: updateClass, }; /* */ var validDivisionCharRE = /[\w).+\-_$\]]/; - function parseFilters (exp) { + function parseFilters(exp) { var inSingle = false; var inDouble = false; var inTemplateString = false; @@ -6841,18 +7152,28 @@ prev = c; c = exp.charCodeAt(i); if (inSingle) { - if (c === 0x27 && prev !== 0x5C) { inSingle = false; } + if (c === 0x27 && prev !== 0x5c) { + inSingle = false; + } } else if (inDouble) { - if (c === 0x22 && prev !== 0x5C) { inDouble = false; } + if (c === 0x22 && prev !== 0x5c) { + inDouble = false; + } } else if (inTemplateString) { - if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; } + if (c === 0x60 && prev !== 0x5c) { + inTemplateString = false; + } } else if (inRegex) { - if (c === 0x2f && prev !== 0x5C) { inRegex = false; } + if (c === 0x2f && prev !== 0x5c) { + inRegex = false; + } } else if ( - c === 0x7C && // pipe - exp.charCodeAt(i + 1) !== 0x7C && - exp.charCodeAt(i - 1) !== 0x7C && - !curly && !square && !paren + c === 0x7c && // pipe + exp.charCodeAt(i + 1) !== 0x7c && + exp.charCodeAt(i - 1) !== 0x7c && + !curly && + !square && + !paren ) { if (expression === undefined) { // first filter, end of expression @@ -6863,23 +7184,44 @@ } } else { switch (c) { - case 0x22: inDouble = true; break // " - case 0x27: inSingle = true; break // ' - case 0x60: inTemplateString = true; break // ` - case 0x28: paren++; break // ( - case 0x29: paren--; break // ) - case 0x5B: square++; break // [ - case 0x5D: square--; break // ] - case 0x7B: curly++; break // { - case 0x7D: curly--; break // } - } - if (c === 0x2f) { // / + case 0x22: + inDouble = true; + break; // " + case 0x27: + inSingle = true; + break; // ' + case 0x60: + inTemplateString = true; + break; // ` + case 0x28: + paren++; + break; // ( + case 0x29: + paren--; + break; // ) + case 0x5b: + square++; + break; // [ + case 0x5d: + square--; + break; // ] + case 0x7b: + curly++; + break; // { + case 0x7d: + curly--; + break; // } + } + if (c === 0x2f) { + // / var j = i - 1; - var p = (void 0); + var p = void 0; // find first non-whitespace prev char for (; j >= 0; j--) { p = exp.charAt(j); - if (p !== ' ') { break } + if (p !== " ") { + break; + } } if (!p || !validDivisionCharRE.test(p)) { inRegex = true; @@ -6894,7 +7236,7 @@ pushFilter(); } - function pushFilter () { + function pushFilter() { (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim()); lastFilterIndex = i + 1; } @@ -6905,60 +7247,65 @@ } } - return expression + return expression; } - function wrapFilter (exp, filter) { - var i = filter.indexOf('('); + function wrapFilter(exp, filter) { + var i = filter.indexOf("("); if (i < 0) { // _f: resolveFilter - return ("_f(\"" + filter + "\")(" + exp + ")") + return '_f("' + filter + '")(' + exp + ")"; } else { var name = filter.slice(0, i); var args = filter.slice(i + 1); - return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args)) + return '_f("' + name + '")(' + exp + (args !== ")" ? "," + args : args); } } /* */ - - /* eslint-disable no-unused-vars */ - function baseWarn (msg, range) { - console.error(("[Vue compiler]: " + msg)); + function baseWarn(msg, range) { + console.error("[Vue compiler]: " + msg); } /* eslint-enable no-unused-vars */ - function pluckModuleFunction ( - modules, - key - ) { + function pluckModuleFunction(modules, key) { return modules - ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; }) - : [] + ? modules + .map(function (m) { + return m[key]; + }) + .filter(function (_) { + return _; + }) + : []; } - function addProp (el, name, value, range, dynamic) { - (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range)); + function addProp(el, name, value, range, dynamic) { + (el.props || (el.props = [])).push( + rangeSetItem({ name: name, value: value, dynamic: dynamic }, range) + ); el.plain = false; } - function addAttr (el, name, value, range, dynamic) { + function addAttr(el, name, value, range, dynamic) { var attrs = dynamic - ? (el.dynamicAttrs || (el.dynamicAttrs = [])) - : (el.attrs || (el.attrs = [])); - attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range)); + ? el.dynamicAttrs || (el.dynamicAttrs = []) + : el.attrs || (el.attrs = []); + attrs.push( + rangeSetItem({ name: name, value: value, dynamic: dynamic }, range) + ); el.plain = false; } // add a raw attr (use this in preTransforms) - function addRawAttr (el, name, value, range) { + function addRawAttr(el, name, value, range) { el.attrsMap[name] = value; el.attrsList.push(rangeSetItem({ name: name, value: value }, range)); } - function addDirective ( + function addDirective( el, name, rawName, @@ -6968,24 +7315,27 @@ modifiers, range ) { - (el.directives || (el.directives = [])).push(rangeSetItem({ - name: name, - rawName: rawName, - value: value, - arg: arg, - isDynamicArg: isDynamicArg, - modifiers: modifiers - }, range)); + (el.directives || (el.directives = [])).push( + rangeSetItem( + { + name: name, + rawName: rawName, + value: value, + arg: arg, + isDynamicArg: isDynamicArg, + modifiers: modifiers, + }, + range + ) + ); el.plain = false; } - function prependModifierMarker (symbol, name, dynamic) { - return dynamic - ? ("_p(" + name + ",\"" + symbol + "\")") - : symbol + name // mark the event as captured + function prependModifierMarker(symbol, name, dynamic) { + return dynamic ? "_p(" + name + ',"' + symbol + '")' : symbol + name; // mark the event as captured } - function addHandler ( + function addHandler( el, name, value, @@ -6998,13 +7348,10 @@ modifiers = modifiers || emptyObject; // warn prevent and passive modifier /* istanbul ignore if */ - if ( - warn && - modifiers.prevent && modifiers.passive - ) { + if (warn && modifiers.prevent && modifiers.passive) { warn( - 'passive and prevent can\'t be used together. ' + - 'Passive handler can\'t prevent default event.', + "passive and prevent can't be used together. " + + "Passive handler can't prevent default event.", range ); } @@ -7015,31 +7362,31 @@ if (modifiers.right) { if (dynamic) { name = "(" + name + ")==='click'?'contextmenu':(" + name + ")"; - } else if (name === 'click') { - name = 'contextmenu'; + } else if (name === "click") { + name = "contextmenu"; delete modifiers.right; } } else if (modifiers.middle) { if (dynamic) { name = "(" + name + ")==='click'?'mouseup':(" + name + ")"; - } else if (name === 'click') { - name = 'mouseup'; + } else if (name === "click") { + name = "mouseup"; } } // check capture modifier if (modifiers.capture) { delete modifiers.capture; - name = prependModifierMarker('!', name, dynamic); + name = prependModifierMarker("!", name, dynamic); } if (modifiers.once) { delete modifiers.once; - name = prependModifierMarker('~', name, dynamic); + name = prependModifierMarker("~", name, dynamic); } /* istanbul ignore if */ if (modifiers.passive) { delete modifiers.passive; - name = prependModifierMarker('&', name, dynamic); + name = prependModifierMarker("&", name, dynamic); } var events; @@ -7050,7 +7397,10 @@ events = el.events || (el.events = {}); } - var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range); + var newHandler = rangeSetItem( + { value: value.trim(), dynamic: dynamic }, + range + ); if (modifiers !== emptyObject) { newHandler.modifiers = modifiers; } @@ -7060,7 +7410,9 @@ if (Array.isArray(handlers)) { important ? handlers.unshift(newHandler) : handlers.push(newHandler); } else if (handlers) { - events[name] = important ? [newHandler, handlers] : [handlers, newHandler]; + events[name] = important + ? [newHandler, handlers] + : [handlers, newHandler]; } else { events[name] = newHandler; } @@ -7068,29 +7420,24 @@ el.plain = false; } - function getRawBindingAttr ( - el, - name - ) { - return el.rawAttrsMap[':' + name] || - el.rawAttrsMap['v-bind:' + name] || + function getRawBindingAttr(el, name) { + return ( + el.rawAttrsMap[":" + name] || + el.rawAttrsMap["v-bind:" + name] || el.rawAttrsMap[name] + ); } - function getBindingAttr ( - el, - name, - getStatic - ) { + function getBindingAttr(el, name, getStatic) { var dynamicValue = - getAndRemoveAttr(el, ':' + name) || - getAndRemoveAttr(el, 'v-bind:' + name); + getAndRemoveAttr(el, ":" + name) || + getAndRemoveAttr(el, "v-bind:" + name); if (dynamicValue != null) { - return parseFilters(dynamicValue) + return parseFilters(dynamicValue); } else if (getStatic !== false) { var staticValue = getAndRemoveAttr(el, name); if (staticValue != null) { - return JSON.stringify(staticValue) + return JSON.stringify(staticValue); } } } @@ -7099,45 +7446,35 @@ // doesn't get processed by processAttrs. // By default it does NOT remove it from the map (attrsMap) because the map is // needed during codegen. - function getAndRemoveAttr ( - el, - name, - removeFromMap - ) { + function getAndRemoveAttr(el, name, removeFromMap) { var val; if ((val = el.attrsMap[name]) != null) { var list = el.attrsList; for (var i = 0, l = list.length; i < l; i++) { if (list[i].name === name) { list.splice(i, 1); - break + break; } } } if (removeFromMap) { delete el.attrsMap[name]; } - return val + return val; } - function getAndRemoveAttrByRegex ( - el, - name - ) { + function getAndRemoveAttrByRegex(el, name) { var list = el.attrsList; for (var i = 0, l = list.length; i < l; i++) { var attr = list[i]; if (name.test(attr.name)) { list.splice(i, 1); - return attr + return attr; } } } - function rangeSetItem ( - item, - range - ) { + function rangeSetItem(item, range) { if (range) { if (range.start != null) { item.start = range.start; @@ -7146,7 +7483,7 @@ item.end = range.end; } } - return item + return item; } /* */ @@ -7154,22 +7491,24 @@ /** * Cross-platform code generation for component v-model */ - function genComponentModel ( - el, - value, - modifiers - ) { + function genComponentModel(el, value, modifiers) { var ref = modifiers || {}; var number = ref.number; var trim = ref.trim; - var baseValueExpression = '$$v'; + var baseValueExpression = "$$v"; var valueExpression = baseValueExpression; if (trim) { valueExpression = - "(typeof " + baseValueExpression + " === 'string'" + - "? " + baseValueExpression + ".trim()" + - ": " + baseValueExpression + ")"; + "(typeof " + + baseValueExpression + + " === 'string'" + + "? " + + baseValueExpression + + ".trim()" + + ": " + + baseValueExpression + + ")"; } if (number) { valueExpression = "_n(" + valueExpression + ")"; @@ -7177,24 +7516,21 @@ var assignment = genAssignmentCode(value, valueExpression); el.model = { - value: ("(" + value + ")"), + value: "(" + value + ")", expression: JSON.stringify(value), - callback: ("function (" + baseValueExpression + ") {" + assignment + "}") + callback: "function (" + baseValueExpression + ") {" + assignment + "}", }; } /** * Cross-platform codegen helper for generating v-model value assignment code. */ - function genAssignmentCode ( - value, - assignment - ) { + function genAssignmentCode(value, assignment) { var res = parseModel(value); if (res.key === null) { - return (value + "=" + assignment) + return value + "=" + assignment; } else { - return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")") + return "$set(" + res.exp + ", " + res.key + ", " + assignment + ")"; } } @@ -7215,26 +7551,24 @@ var len, str, chr, index$1, expressionPos, expressionEndPos; - - - function parseModel (val) { + function parseModel(val) { // Fix https://github.com/vuejs/vue/pull/7730 // allow v-model="obj.val " (trailing whitespace) val = val.trim(); len = val.length; - if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) { - index$1 = val.lastIndexOf('.'); + if (val.indexOf("[") < 0 || val.lastIndexOf("]") < len - 1) { + index$1 = val.lastIndexOf("."); if (index$1 > -1) { return { exp: val.slice(0, index$1), - key: '"' + val.slice(index$1 + 1) + '"' - } + key: '"' + val.slice(index$1 + 1) + '"', + }; } else { return { exp: val, - key: null - } + key: null, + }; } } @@ -7246,53 +7580,57 @@ /* istanbul ignore if */ if (isStringStart(chr)) { parseString(chr); - } else if (chr === 0x5B) { + } else if (chr === 0x5b) { parseBracket(chr); } } return { exp: val.slice(0, expressionPos), - key: val.slice(expressionPos + 1, expressionEndPos) - } + key: val.slice(expressionPos + 1, expressionEndPos), + }; } - function next () { - return str.charCodeAt(++index$1) + function next() { + return str.charCodeAt(++index$1); } - function eof () { - return index$1 >= len + function eof() { + return index$1 >= len; } - function isStringStart (chr) { - return chr === 0x22 || chr === 0x27 + function isStringStart(chr) { + return chr === 0x22 || chr === 0x27; } - function parseBracket (chr) { + function parseBracket(chr) { var inBracket = 1; expressionPos = index$1; while (!eof()) { chr = next(); if (isStringStart(chr)) { parseString(chr); - continue + continue; + } + if (chr === 0x5b) { + inBracket++; + } + if (chr === 0x5d) { + inBracket--; } - if (chr === 0x5B) { inBracket++; } - if (chr === 0x5D) { inBracket--; } if (inBracket === 0) { expressionEndPos = index$1; - break + break; } } } - function parseString (chr) { + function parseString(chr) { var stringQuote = chr; while (!eof()) { chr = next(); if (chr === stringQuote) { - break + break; } } } @@ -7303,14 +7641,10 @@ // in some cases, the event used has to be determined at runtime // so we used some reserved tokens during compile. - var RANGE_TOKEN = '__r'; - var CHECKBOX_RADIO_TOKEN = '__c'; + var RANGE_TOKEN = "__r"; + var CHECKBOX_RADIO_TOKEN = "__c"; - function model ( - el, - dir, - _warn - ) { + function model(el, dir, _warn) { warn$1 = _warn; var value = dir.value; var modifiers = dir.modifiers; @@ -7320,11 +7654,15 @@ { // inputs with type="file" are read only and setting the input's // value will throw an error. - if (tag === 'input' && type === 'file') { + if (tag === "input" && type === "file") { warn$1( - "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" + - "File inputs are read only. Use a v-on:change listener instead.", - el.rawAttrsMap['v-model'] + "<" + + el.tag + + ' v-model="' + + value + + '" type="file">:\n' + + "File inputs are read only. Use a v-on:change listener instead.", + el.rawAttrsMap["v-model"] ); } } @@ -7332,110 +7670,135 @@ if (el.component) { genComponentModel(el, value, modifiers); // component v-model doesn't need extra runtime - return false - } else if (tag === 'select') { + return false; + } else if (tag === "select") { genSelect(el, value, modifiers); - } else if (tag === 'input' && type === 'checkbox') { + } else if (tag === "input" && type === "checkbox") { genCheckboxModel(el, value, modifiers); - } else if (tag === 'input' && type === 'radio') { + } else if (tag === "input" && type === "radio") { genRadioModel(el, value, modifiers); - } else if (tag === 'input' || tag === 'textarea') { + } else if (tag === "input" || tag === "textarea") { genDefaultModel(el, value, modifiers); } else if (!config.isReservedTag(tag)) { genComponentModel(el, value, modifiers); // component v-model doesn't need extra runtime - return false + return false; } else { warn$1( - "<" + (el.tag) + " v-model=\"" + value + "\">: " + - "v-model is not supported on this element type. " + - 'If you are working with contenteditable, it\'s recommended to ' + - 'wrap a library dedicated for that purpose inside a custom component.', - el.rawAttrsMap['v-model'] + "<" + + el.tag + + ' v-model="' + + value + + '">: ' + + "v-model is not supported on this element type. " + + "If you are working with contenteditable, it's recommended to " + + "wrap a library dedicated for that purpose inside a custom component.", + el.rawAttrsMap["v-model"] ); } // ensure runtime directive metadata - return true + return true; } - function genCheckboxModel ( - el, - value, - modifiers - ) { + function genCheckboxModel(el, value, modifiers) { var number = modifiers && modifiers.number; - var valueBinding = getBindingAttr(el, 'value') || 'null'; - var trueValueBinding = getBindingAttr(el, 'true-value') || 'true'; - var falseValueBinding = getBindingAttr(el, 'false-value') || 'false'; - addProp(el, 'checked', - "Array.isArray(" + value + ")" + - "?_i(" + value + "," + valueBinding + ")>-1" + ( - trueValueBinding === 'true' - ? (":(" + value + ")") - : (":_q(" + value + "," + trueValueBinding + ")") - ) + var valueBinding = getBindingAttr(el, "value") || "null"; + var trueValueBinding = getBindingAttr(el, "true-value") || "true"; + var falseValueBinding = getBindingAttr(el, "false-value") || "false"; + addProp( + el, + "checked", + "Array.isArray(" + + value + + ")" + + "?_i(" + + value + + "," + + valueBinding + + ")>-1" + + (trueValueBinding === "true" + ? ":(" + value + ")" + : ":_q(" + value + "," + trueValueBinding + ")") ); - addHandler(el, 'change', - "var $$a=" + value + "," + - '$$el=$event.target,' + - "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" + - 'if(Array.isArray($$a)){' + - "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," + - '$$i=_i($$a,$$v);' + - "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" + - "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" + - "}else{" + (genAssignmentCode(value, '$$c')) + "}", - null, true + addHandler( + el, + "change", + "var $$a=" + + value + + "," + + "$$el=$event.target," + + "$$c=$$el.checked?(" + + trueValueBinding + + "):(" + + falseValueBinding + + ");" + + "if(Array.isArray($$a)){" + + "var $$v=" + + (number ? "_n(" + valueBinding + ")" : valueBinding) + + "," + + "$$i=_i($$a,$$v);" + + "if($$el.checked){$$i<0&&(" + + genAssignmentCode(value, "$$a.concat([$$v])") + + ")}" + + "else{$$i>-1&&(" + + genAssignmentCode(value, "$$a.slice(0,$$i).concat($$a.slice($$i+1))") + + ")}" + + "}else{" + + genAssignmentCode(value, "$$c") + + "}", + null, + true ); } - function genRadioModel ( - el, - value, - modifiers - ) { + function genRadioModel(el, value, modifiers) { var number = modifiers && modifiers.number; - var valueBinding = getBindingAttr(el, 'value') || 'null'; - valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding; - addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")")); - addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true); + var valueBinding = getBindingAttr(el, "value") || "null"; + valueBinding = number ? "_n(" + valueBinding + ")" : valueBinding; + addProp(el, "checked", "_q(" + value + "," + valueBinding + ")"); + addHandler( + el, + "change", + genAssignmentCode(value, valueBinding), + null, + true + ); } - function genSelect ( - el, - value, - modifiers - ) { + function genSelect(el, value, modifiers) { var number = modifiers && modifiers.number; - var selectedVal = "Array.prototype.filter" + + var selectedVal = + "Array.prototype.filter" + ".call($event.target.options,function(o){return o.selected})" + - ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" + - "return " + (number ? '_n(val)' : 'val') + "})"; + '.map(function(o){var val = "_value" in o ? o._value : o.value;' + + "return " + + (number ? "_n(val)" : "val") + + "})"; - var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]'; + var assignment = + "$event.target.multiple ? $$selectedVal : $$selectedVal[0]"; var code = "var $$selectedVal = " + selectedVal + ";"; - code = code + " " + (genAssignmentCode(value, assignment)); - addHandler(el, 'change', code, null, true); + code = code + " " + genAssignmentCode(value, assignment); + addHandler(el, "change", code, null, true); } - function genDefaultModel ( - el, - value, - modifiers - ) { + function genDefaultModel(el, value, modifiers) { var type = el.attrsMap.type; // warn if v-bind:value conflicts with v-model // except for inputs with v-bind:type { - var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value']; - var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type']; + var value$1 = el.attrsMap["v-bind:value"] || el.attrsMap[":value"]; + var typeBinding = el.attrsMap["v-bind:type"] || el.attrsMap[":type"]; if (value$1 && !typeBinding) { - var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value'; + var binding = el.attrsMap["v-bind:value"] ? "v-bind:value" : ":value"; warn$1( - binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " + - 'because the latter already expands to a value binding internally', + binding + + '="' + + value$1 + + '" conflicts with v-model on the same element ' + + "because the latter already expands to a value binding internally", el.rawAttrsMap[binding] ); } @@ -7445,14 +7808,10 @@ var lazy = ref.lazy; var number = ref.number; var trim = ref.trim; - var needCompositionGuard = !lazy && type !== 'range'; - var event = lazy - ? 'change' - : type === 'range' - ? RANGE_TOKEN - : 'input'; - - var valueExpression = '$event.target.value'; + var needCompositionGuard = !lazy && type !== "range"; + var event = lazy ? "change" : type === "range" ? RANGE_TOKEN : "input"; + + var valueExpression = "$event.target.value"; if (trim) { valueExpression = "$event.target.value.trim()"; } @@ -7465,10 +7824,10 @@ code = "if($event.target.composing)return;" + code; } - addProp(el, 'value', ("(" + value + ")")); + addProp(el, "value", "(" + value + ")"); addHandler(el, event, code, null, true); if (trim || number) { - addHandler(el, 'blur', '$forceUpdate()'); + addHandler(el, "blur", "$forceUpdate()"); } } @@ -7478,11 +7837,11 @@ // it's important to place the event as the first in the array because // the whole point is ensuring the v-model callback gets called before // user-attached handlers. - function normalizeEvents (on) { + function normalizeEvents(on) { /* istanbul ignore if */ if (isDef(on[RANGE_TOKEN])) { // IE input[type=range] only supports `change` event - var event = isIE ? 'change' : 'input'; + var event = isIE ? "change" : "input"; on[event] = [].concat(on[RANGE_TOKEN], on[event] || []); delete on[RANGE_TOKEN]; } @@ -7497,14 +7856,14 @@ var target$1; - function createOnceHandler$1 (event, handler, capture) { + function createOnceHandler$1(event, handler, capture) { var _target = target$1; // save current target element in closure - return function onceHandler () { + return function onceHandler() { var res = handler.apply(null, arguments); if (res !== null) { remove$2(event, onceHandler, capture, _target); } - } + }; } // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp @@ -7512,12 +7871,7 @@ // safe to exclude. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53); - function add$1 ( - name, - handler, - capture, - passive - ) { + function add$1(name, handler, capture, passive) { // async edge case #6566: inner click event triggers patch, event handler // attached to outer element during patch, and triggered again. This // happens because browsers fire microtask ticks between event propagation. @@ -7544,25 +7898,18 @@ // starting reference e.target.ownerDocument !== document ) { - return original.apply(this, arguments) + return original.apply(this, arguments); } }; } target$1.addEventListener( name, handler, - supportsPassive - ? { capture: capture, passive: passive } - : capture + supportsPassive ? { capture: capture, passive: passive } : capture ); } - function remove$2 ( - name, - handler, - capture, - _target - ) { + function remove$2(name, handler, capture, _target) { (_target || target$1).removeEventListener( name, handler._wrapper || handler, @@ -7570,30 +7917,37 @@ ); } - function updateDOMListeners (oldVnode, vnode) { + function updateDOMListeners(oldVnode, vnode) { if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) { - return + return; } var on = vnode.data.on || {}; var oldOn = oldVnode.data.on || {}; target$1 = vnode.elm; normalizeEvents(on); - updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context); + updateListeners( + on, + oldOn, + add$1, + remove$2, + createOnceHandler$1, + vnode.context + ); target$1 = undefined; } var events = { create: updateDOMListeners, - update: updateDOMListeners + update: updateDOMListeners, }; /* */ var svgContainer; - function updateDOMProps (oldVnode, vnode) { + function updateDOMProps(oldVnode, vnode) { if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) { - return + return; } var key, cur; var elm = vnode.elm; @@ -7606,7 +7960,7 @@ for (key in oldProps) { if (!(key in props)) { - elm[key] = ''; + elm[key] = ""; } } @@ -7615,9 +7969,13 @@ // ignore children if the node has textContent or innerHTML, // as these will throw away existing DOM nodes and cause removal errors // on subsequent patches (#3360) - if (key === 'textContent' || key === 'innerHTML') { - if (vnode.children) { vnode.children.length = 0; } - if (cur === oldProps[key]) { continue } + if (key === "textContent" || key === "innerHTML") { + if (vnode.children) { + vnode.children.length = 0; + } + if (cur === oldProps[key]) { + continue; + } // #6601 work around Chrome version <= 55 bug where single textNode // replaced by innerHTML/textContent retains its parentNode property if (elm.childNodes.length === 1) { @@ -7625,18 +7983,22 @@ } } - if (key === 'value' && elm.tagName !== 'PROGRESS') { + if (key === "value" && elm.tagName !== "PROGRESS") { // store value as _value as well since // non-string values will be stringified elm._value = cur; // avoid resetting cursor position when value is the same - var strCur = isUndef(cur) ? '' : String(cur); + var strCur = isUndef(cur) ? "" : String(cur); if (shouldUpdateValue(elm, strCur)) { elm.value = strCur; } - } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) { + } else if ( + key === "innerHTML" && + isSVG(elm.tagName) && + isUndef(elm.innerHTML) + ) { // IE doesn't support innerHTML for SVG elements - svgContainer = svgContainer || document.createElement('div'); + svgContainer = svgContainer || document.createElement("div"); svgContainer.innerHTML = "<svg>" + cur + "</svg>"; var svg = svgContainer.firstChild; while (elm.firstChild) { @@ -7663,42 +8025,44 @@ // check platforms/web/util/attrs.js acceptValue + function shouldUpdateValue(elm, checkVal) { + return ( + !elm.composing && + (elm.tagName === "OPTION" || + isNotInFocusAndDirty(elm, checkVal) || + isDirtyWithModifiers(elm, checkVal)) + ); + } - function shouldUpdateValue (elm, checkVal) { - return (!elm.composing && ( - elm.tagName === 'OPTION' || - isNotInFocusAndDirty(elm, checkVal) || - isDirtyWithModifiers(elm, checkVal) - )) - } - - function isNotInFocusAndDirty (elm, checkVal) { + function isNotInFocusAndDirty(elm, checkVal) { // return true when textbox (.number and .trim) loses focus and its value is // not equal to the updated value var notInFocus = true; // #6157 // work around IE bug when accessing document.activeElement in an iframe - try { notInFocus = document.activeElement !== elm; } catch (e) {} - return notInFocus && elm.value !== checkVal + try { + notInFocus = document.activeElement !== elm; + } catch (e) {} + return notInFocus && elm.value !== checkVal; } - function isDirtyWithModifiers (elm, newVal) { + function isDirtyWithModifiers(elm, newVal) { var value = elm.value; var modifiers = elm._vModifiers; // injected by v-model runtime if (isDef(modifiers)) { if (modifiers.number) { - return toNumber(value) !== toNumber(newVal) + return toNumber(value) !== toNumber(newVal); } if (modifiers.trim) { - return value.trim() !== newVal.trim() + return value.trim() !== newVal.trim(); } } - return value !== newVal + return value !== newVal; } var domProps = { create: updateDOMProps, - update: updateDOMProps + update: updateDOMProps, }; /* */ @@ -7713,35 +8077,33 @@ tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim()); } }); - return res + return res; }); // merge static and dynamic style data on the same vnode - function normalizeStyleData (data) { + function normalizeStyleData(data) { var style = normalizeStyleBinding(data.style); // static style is pre-processed into an object during compilation // and is always a fresh object, so it's safe to merge into it - return data.staticStyle - ? extend(data.staticStyle, style) - : style + return data.staticStyle ? extend(data.staticStyle, style) : style; } // normalize possible array / string values into Object - function normalizeStyleBinding (bindingStyle) { + function normalizeStyleBinding(bindingStyle) { if (Array.isArray(bindingStyle)) { - return toObject(bindingStyle) + return toObject(bindingStyle); } - if (typeof bindingStyle === 'string') { - return parseStyleText(bindingStyle) + if (typeof bindingStyle === "string") { + return parseStyleText(bindingStyle); } - return bindingStyle + return bindingStyle; } /** * parent component style should be after child's * so that parent component's style could override it */ - function getStyle (vnode, checkChild) { + function getStyle(vnode, checkChild) { var res = {}; var styleData; @@ -7750,7 +8112,8 @@ while (childNode.componentInstance) { childNode = childNode.componentInstance._vnode; if ( - childNode && childNode.data && + childNode && + childNode.data && (styleData = normalizeStyleData(childNode.data)) ) { extend(res, styleData); @@ -7764,11 +8127,14 @@ var parentNode = vnode; while ((parentNode = parentNode.parent)) { - if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) { + if ( + parentNode.data && + (styleData = normalizeStyleData(parentNode.data)) + ) { extend(res, styleData); } } - return res + return res; } /* */ @@ -7780,7 +8146,11 @@ if (cssVarRE.test(name)) { el.style.setProperty(name, val); } else if (importantRE.test(val)) { - el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important'); + el.style.setProperty( + hyphenate(name), + val.replace(importantRE, ""), + "important" + ); } else { var normalizedName = normalize(name); if (Array.isArray(val)) { @@ -7796,32 +8166,35 @@ } }; - var vendorNames = ['Webkit', 'Moz', 'ms']; + var vendorNames = ["Webkit", "Moz", "ms"]; var emptyStyle; var normalize = cached(function (prop) { - emptyStyle = emptyStyle || document.createElement('div').style; + emptyStyle = emptyStyle || document.createElement("div").style; prop = camelize(prop); - if (prop !== 'filter' && (prop in emptyStyle)) { - return prop + if (prop !== "filter" && prop in emptyStyle) { + return prop; } var capName = prop.charAt(0).toUpperCase() + prop.slice(1); for (var i = 0; i < vendorNames.length; i++) { var name = vendorNames[i] + capName; if (name in emptyStyle) { - return name + return name; } } }); - function updateStyle (oldVnode, vnode) { + function updateStyle(oldVnode, vnode) { var data = vnode.data; var oldData = oldVnode.data; - if (isUndef(data.staticStyle) && isUndef(data.style) && - isUndef(oldData.staticStyle) && isUndef(oldData.style) + if ( + isUndef(data.staticStyle) && + isUndef(data.style) && + isUndef(oldData.staticStyle) && + isUndef(oldData.style) ) { - return + return; } var cur, name; @@ -7845,21 +8218,21 @@ for (name in oldStyle) { if (isUndef(newStyle[name])) { - setProp(el, name, ''); + setProp(el, name, ""); } } for (name in newStyle) { cur = newStyle[name]; if (cur !== oldStyle[name]) { // ie9 setting to null has no effect, must use empty string - setProp(el, name, cur == null ? '' : cur); + setProp(el, name, cur == null ? "" : cur); } } } var style = { create: updateStyle, - update: updateStyle + update: updateStyle, }; /* */ @@ -7870,23 +8243,25 @@ * Add class with compatibility for SVG since classList is not supported on * SVG elements in IE */ - function addClass (el, cls) { + function addClass(el, cls) { /* istanbul ignore if */ if (!cls || !(cls = cls.trim())) { - return + return; } /* istanbul ignore else */ if (el.classList) { - if (cls.indexOf(' ') > -1) { - cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); }); + if (cls.indexOf(" ") > -1) { + cls.split(whitespaceRE).forEach(function (c) { + return el.classList.add(c); + }); } else { el.classList.add(cls); } } else { - var cur = " " + (el.getAttribute('class') || '') + " "; - if (cur.indexOf(' ' + cls + ' ') < 0) { - el.setAttribute('class', (cur + cls).trim()); + var cur = " " + (el.getAttribute("class") || "") + " "; + if (cur.indexOf(" " + cls + " ") < 0) { + el.setAttribute("class", (cur + cls).trim()); } } } @@ -7895,89 +8270,93 @@ * Remove class with compatibility for SVG since classList is not supported on * SVG elements in IE */ - function removeClass (el, cls) { + function removeClass(el, cls) { /* istanbul ignore if */ if (!cls || !(cls = cls.trim())) { - return + return; } /* istanbul ignore else */ if (el.classList) { - if (cls.indexOf(' ') > -1) { - cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); }); + if (cls.indexOf(" ") > -1) { + cls.split(whitespaceRE).forEach(function (c) { + return el.classList.remove(c); + }); } else { el.classList.remove(cls); } if (!el.classList.length) { - el.removeAttribute('class'); + el.removeAttribute("class"); } } else { - var cur = " " + (el.getAttribute('class') || '') + " "; - var tar = ' ' + cls + ' '; + var cur = " " + (el.getAttribute("class") || "") + " "; + var tar = " " + cls + " "; while (cur.indexOf(tar) >= 0) { - cur = cur.replace(tar, ' '); + cur = cur.replace(tar, " "); } cur = cur.trim(); if (cur) { - el.setAttribute('class', cur); + el.setAttribute("class", cur); } else { - el.removeAttribute('class'); + el.removeAttribute("class"); } } } /* */ - function resolveTransition (def$$1) { + function resolveTransition(def$$1) { if (!def$$1) { - return + return; } /* istanbul ignore else */ - if (typeof def$$1 === 'object') { + if (typeof def$$1 === "object") { var res = {}; if (def$$1.css !== false) { - extend(res, autoCssTransition(def$$1.name || 'v')); + extend(res, autoCssTransition(def$$1.name || "v")); } extend(res, def$$1); - return res - } else if (typeof def$$1 === 'string') { - return autoCssTransition(def$$1) + return res; + } else if (typeof def$$1 === "string") { + return autoCssTransition(def$$1); } } var autoCssTransition = cached(function (name) { return { - enterClass: (name + "-enter"), - enterToClass: (name + "-enter-to"), - enterActiveClass: (name + "-enter-active"), - leaveClass: (name + "-leave"), - leaveToClass: (name + "-leave-to"), - leaveActiveClass: (name + "-leave-active") - } + enterClass: name + "-enter", + enterToClass: name + "-enter-to", + enterActiveClass: name + "-enter-active", + leaveClass: name + "-leave", + leaveToClass: name + "-leave-to", + leaveActiveClass: name + "-leave-active", + }; }); var hasTransition = inBrowser && !isIE9; - var TRANSITION = 'transition'; - var ANIMATION = 'animation'; + var TRANSITION = "transition"; + var ANIMATION = "animation"; // Transition property/event sniffing - var transitionProp = 'transition'; - var transitionEndEvent = 'transitionend'; - var animationProp = 'animation'; - var animationEndEvent = 'animationend'; + var transitionProp = "transition"; + var transitionEndEvent = "transitionend"; + var animationProp = "animation"; + var animationEndEvent = "animationend"; if (hasTransition) { /* istanbul ignore if */ - if (window.ontransitionend === undefined && + if ( + window.ontransitionend === undefined && window.onwebkittransitionend !== undefined ) { - transitionProp = 'WebkitTransition'; - transitionEndEvent = 'webkitTransitionEnd'; + transitionProp = "WebkitTransition"; + transitionEndEvent = "webkitTransitionEnd"; } - if (window.onanimationend === undefined && + if ( + window.onanimationend === undefined && window.onwebkitanimationend !== undefined ) { - animationProp = 'WebkitAnimation'; - animationEndEvent = 'webkitAnimationEnd'; + animationProp = "WebkitAnimation"; + animationEndEvent = "webkitAnimationEnd"; } } @@ -7986,39 +8365,40 @@ ? window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout - : /* istanbul ignore next */ function (fn) { return fn(); }; + : /* istanbul ignore next */ function (fn) { + return fn(); + }; - function nextFrame (fn) { + function nextFrame(fn) { raf(function () { raf(fn); }); } - function addTransitionClass (el, cls) { - var transitionClasses = el._transitionClasses || (el._transitionClasses = []); + function addTransitionClass(el, cls) { + var transitionClasses = + el._transitionClasses || (el._transitionClasses = []); if (transitionClasses.indexOf(cls) < 0) { transitionClasses.push(cls); addClass(el, cls); } } - function removeTransitionClass (el, cls) { + function removeTransitionClass(el, cls) { if (el._transitionClasses) { remove(el._transitionClasses, cls); } removeClass(el, cls); } - function whenTransitionEnds ( - el, - expectedType, - cb - ) { + function whenTransitionEnds(el, expectedType, cb) { var ref = getTransitionInfo(el, expectedType); var type = ref.type; var timeout = ref.timeout; var propCount = ref.propCount; - if (!type) { return cb() } + if (!type) { + return cb(); + } var event = type === TRANSITION ? transitionEndEvent : animationEndEvent; var ended = 0; var end = function () { @@ -8042,14 +8422,18 @@ var transformRE = /\b(transform|all)(,|$)/; - function getTransitionInfo (el, expectedType) { + function getTransitionInfo(el, expectedType) { var styles = window.getComputedStyle(el); // JSDOM may return undefined for transition properties - var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', '); - var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', '); + var transitionDelays = (styles[transitionProp + "Delay"] || "").split(", "); + var transitionDurations = (styles[transitionProp + "Duration"] || "").split( + ", " + ); var transitionTimeout = getTimeout(transitionDelays, transitionDurations); - var animationDelays = (styles[animationProp + 'Delay'] || '').split(', '); - var animationDurations = (styles[animationProp + 'Duration'] || '').split(', '); + var animationDelays = (styles[animationProp + "Delay"] || "").split(", "); + var animationDurations = (styles[animationProp + "Duration"] || "").split( + ", " + ); var animationTimeout = getTimeout(animationDelays, animationDurations); var type; @@ -8070,11 +8454,12 @@ } } else { timeout = Math.max(transitionTimeout, animationTimeout); - type = timeout > 0 - ? transitionTimeout > animationTimeout - ? TRANSITION - : ANIMATION - : null; + type = + timeout > 0 + ? transitionTimeout > animationTimeout + ? TRANSITION + : ANIMATION + : null; propCount = type ? type === TRANSITION ? transitionDurations.length @@ -8083,37 +8468,40 @@ } var hasTransform = type === TRANSITION && - transformRE.test(styles[transitionProp + 'Property']); + transformRE.test(styles[transitionProp + "Property"]); return { type: type, timeout: timeout, propCount: propCount, - hasTransform: hasTransform - } + hasTransform: hasTransform, + }; } - function getTimeout (delays, durations) { + function getTimeout(delays, durations) { /* istanbul ignore next */ while (delays.length < durations.length) { delays = delays.concat(delays); } - return Math.max.apply(null, durations.map(function (d, i) { - return toMs(d) + toMs(delays[i]) - })) + return Math.max.apply( + null, + durations.map(function (d, i) { + return toMs(d) + toMs(delays[i]); + }) + ); } // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers // in a locale-dependent way, using a comma instead of a dot. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting // as a floor function) causing unexpected behaviors - function toMs (s) { - return Number(s.slice(0, -1).replace(',', '.')) * 1000 + function toMs(s) { + return Number(s.slice(0, -1).replace(",", ".")) * 1000; } /* */ - function enter (vnode, toggleDisplay) { + function enter(vnode, toggleDisplay) { var el = vnode.elm; // call leave callback now @@ -8124,12 +8512,12 @@ var data = resolveTransition(vnode.data.transition); if (isUndef(data)) { - return + return; } /* istanbul ignore if */ if (isDef(el._enterCb) || el.nodeType !== 1) { - return + return; } var css = data.css; @@ -8163,47 +8551,38 @@ var isAppear = !context._isMounted || !vnode.isRootInsert; - if (isAppear && !appear && appear !== '') { - return + if (isAppear && !appear && appear !== "") { + return; } - var startClass = isAppear && appearClass - ? appearClass - : enterClass; - var activeClass = isAppear && appearActiveClass - ? appearActiveClass - : enterActiveClass; - var toClass = isAppear && appearToClass - ? appearToClass - : enterToClass; + var startClass = isAppear && appearClass ? appearClass : enterClass; + var activeClass = + isAppear && appearActiveClass ? appearActiveClass : enterActiveClass; + var toClass = isAppear && appearToClass ? appearToClass : enterToClass; - var beforeEnterHook = isAppear - ? (beforeAppear || beforeEnter) - : beforeEnter; + var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter; var enterHook = isAppear - ? (typeof appear === 'function' ? appear : enter) + ? typeof appear === "function" + ? appear + : enter : enter; - var afterEnterHook = isAppear - ? (afterAppear || afterEnter) - : afterEnter; + var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter; var enterCancelledHook = isAppear - ? (appearCancelled || enterCancelled) + ? appearCancelled || enterCancelled : enterCancelled; var explicitEnterDuration = toNumber( - isObject(duration) - ? duration.enter - : duration + isObject(duration) ? duration.enter : duration ); if (explicitEnterDuration != null) { - checkDuration(explicitEnterDuration, 'enter', vnode); + checkDuration(explicitEnterDuration, "enter", vnode); } var expectsCSS = css !== false && !isIE9; var userWantsControl = getHookArgumentsLength(enterHook); - var cb = el._enterCb = once(function () { + var cb = (el._enterCb = once(function () { if (expectsCSS) { removeTransitionClass(el, toClass); removeTransitionClass(el, activeClass); @@ -8217,14 +8596,16 @@ afterEnterHook && afterEnterHook(el); } el._enterCb = null; - }); + })); if (!vnode.data.show) { // remove pending leave element on enter by injecting an insert hook - mergeVNodeHook(vnode, 'insert', function () { + mergeVNodeHook(vnode, "insert", function () { var parent = el.parentNode; - var pendingNode = parent && parent._pending && parent._pending[vnode.key]; - if (pendingNode && + var pendingNode = + parent && parent._pending && parent._pending[vnode.key]; + if ( + pendingNode && pendingNode.tag === vnode.tag && pendingNode.elm._leaveCb ) { @@ -8264,7 +8645,7 @@ } } - function leave (vnode, rm) { + function leave(vnode, rm) { var el = vnode.elm; // call enter callback now @@ -8275,12 +8656,12 @@ var data = resolveTransition(vnode.data.transition); if (isUndef(data) || el.nodeType !== 1) { - return rm() + return rm(); } /* istanbul ignore if */ if (isDef(el._leaveCb)) { - return + return; } var css = data.css; @@ -8299,16 +8680,14 @@ var userWantsControl = getHookArgumentsLength(leave); var explicitLeaveDuration = toNumber( - isObject(duration) - ? duration.leave - : duration + isObject(duration) ? duration.leave : duration ); if (isDef(explicitLeaveDuration)) { - checkDuration(explicitLeaveDuration, 'leave', vnode); + checkDuration(explicitLeaveDuration, "leave", vnode); } - var cb = el._leaveCb = once(function () { + var cb = (el._leaveCb = once(function () { if (el.parentNode && el.parentNode._pending) { el.parentNode._pending[vnode.key] = null; } @@ -8326,7 +8705,7 @@ afterLeave && afterLeave(el); } el._leaveCb = null; - }); + })); if (delayLeave) { delayLeave(performLeave); @@ -8334,14 +8713,15 @@ performLeave(); } - function performLeave () { + function performLeave() { // the delayed leave may have already been cancelled if (cb.cancelled) { - return + return; } // record leaving element if (!vnode.data.show && el.parentNode) { - (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode; + (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = + vnode; } beforeLeave && beforeLeave(el); if (expectsCSS) { @@ -8369,24 +8749,30 @@ } // only used in dev mode - function checkDuration (val, name, vnode) { - if (typeof val !== 'number') { + function checkDuration(val, name, vnode) { + if (typeof val !== "number") { warn( - "<transition> explicit " + name + " duration is not a valid number - " + - "got " + (JSON.stringify(val)) + ".", + "<transition> explicit " + + name + + " duration is not a valid number - " + + "got " + + JSON.stringify(val) + + ".", vnode.context ); } else if (isNaN(val)) { warn( - "<transition> explicit " + name + " duration is NaN - " + - 'the duration expression might be incorrect.', + "<transition> explicit " + + name + + " duration is NaN - " + + "the duration expression might be incorrect.", vnode.context ); } } - function isValidDuration (val) { - return typeof val === 'number' && !isNaN(val) + function isValidDuration(val) { + return typeof val === "number" && !isNaN(val); } /** @@ -8395,50 +8781,43 @@ * - a wrapped component method (check ._length) * - a plain function (.length) */ - function getHookArgumentsLength (fn) { + function getHookArgumentsLength(fn) { if (isUndef(fn)) { - return false + return false; } var invokerFns = fn.fns; if (isDef(invokerFns)) { // invoker return getHookArgumentsLength( - Array.isArray(invokerFns) - ? invokerFns[0] - : invokerFns - ) + Array.isArray(invokerFns) ? invokerFns[0] : invokerFns + ); } else { - return (fn._length || fn.length) > 1 + return (fn._length || fn.length) > 1; } } - function _enter (_, vnode) { + function _enter(_, vnode) { if (vnode.data.show !== true) { enter(vnode); } } - var transition = inBrowser ? { - create: _enter, - activate: _enter, - remove: function remove$$1 (vnode, rm) { - /* istanbul ignore else */ - if (vnode.data.show !== true) { - leave(vnode, rm); - } else { - rm(); + var transition = inBrowser + ? { + create: _enter, + activate: _enter, + remove: function remove$$1(vnode, rm) { + /* istanbul ignore else */ + if (vnode.data.show !== true) { + leave(vnode, rm); + } else { + rm(); + } + }, } - } - } : {}; + : {}; - var platformModules = [ - attrs, - klass, - events, - domProps, - style, - transition - ]; + var platformModules = [attrs, klass, events, domProps, style, transition]; /* */ @@ -8456,36 +8835,36 @@ /* istanbul ignore if */ if (isIE9) { // http://www.matts411.com/post/internet-explorer-9-oninput/ - document.addEventListener('selectionchange', function () { + document.addEventListener("selectionchange", function () { var el = document.activeElement; if (el && el.vmodel) { - trigger(el, 'input'); + trigger(el, "input"); } }); } var directive = { - inserted: function inserted (el, binding, vnode, oldVnode) { - if (vnode.tag === 'select') { + inserted: function inserted(el, binding, vnode, oldVnode) { + if (vnode.tag === "select") { // #6903 if (oldVnode.elm && !oldVnode.elm._vOptions) { - mergeVNodeHook(vnode, 'postpatch', function () { + mergeVNodeHook(vnode, "postpatch", function () { directive.componentUpdated(el, binding, vnode); }); } else { setSelected(el, binding, vnode.context); } el._vOptions = [].map.call(el.options, getValue); - } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) { + } else if (vnode.tag === "textarea" || isTextInputType(el.type)) { el._vModifiers = binding.modifiers; if (!binding.modifiers.lazy) { - el.addEventListener('compositionstart', onCompositionStart); - el.addEventListener('compositionend', onCompositionEnd); + el.addEventListener("compositionstart", onCompositionStart); + el.addEventListener("compositionend", onCompositionEnd); // Safari < 10.2 & UIWebView doesn't fire compositionend when // switching focus before confirming composition choice // this also fixes the issue where some browsers e.g. iOS Chrome // fires "change" instead of "input" on autocomplete. - el.addEventListener('change', onCompositionEnd); + el.addEventListener("change", onCompositionEnd); /* istanbul ignore if */ if (isIE9) { el.vmodel = true; @@ -8494,30 +8873,37 @@ } }, - componentUpdated: function componentUpdated (el, binding, vnode) { - if (vnode.tag === 'select') { + componentUpdated: function componentUpdated(el, binding, vnode) { + if (vnode.tag === "select") { setSelected(el, binding, vnode.context); // in case the options rendered by v-for have changed, // it's possible that the value is out-of-sync with the rendered options. // detect such cases and filter out values that no longer has a matching // option in the DOM. var prevOptions = el._vOptions; - var curOptions = el._vOptions = [].map.call(el.options, getValue); - if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) { + var curOptions = (el._vOptions = [].map.call(el.options, getValue)); + if ( + curOptions.some(function (o, i) { + return !looseEqual(o, prevOptions[i]); + }) + ) { // trigger change event if // no matching option found for at least one value var needReset = el.multiple - ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); }) - : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions); + ? binding.value.some(function (v) { + return hasNoMatchingOption(v, curOptions); + }) + : binding.value !== binding.oldValue && + hasNoMatchingOption(binding.value, curOptions); if (needReset) { - trigger(el, 'change'); + trigger(el, "change"); } } } - } + }, }; - function setSelected (el, binding, vm) { + function setSelected(el, binding, vm) { actuallySetSelected(el, binding, vm); /* istanbul ignore if */ if (isIE || isEdge) { @@ -8527,16 +8913,19 @@ } } - function actuallySetSelected (el, binding, vm) { + function actuallySetSelected(el, binding, vm) { var value = binding.value; var isMultiple = el.multiple; if (isMultiple && !Array.isArray(value)) { warn( - "<select multiple v-model=\"" + (binding.expression) + "\"> " + - "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)), + '<select multiple v-model="' + + binding.expression + + '"> ' + + "expects an Array value for its binding, but got " + + Object.prototype.toString.call(value).slice(8, -1), vm ); - return + return; } var selected, option; for (var i = 0, l = el.options.length; i < l; i++) { @@ -8551,7 +8940,7 @@ if (el.selectedIndex !== i) { el.selectedIndex = i; } - return + return; } } } @@ -8560,29 +8949,31 @@ } } - function hasNoMatchingOption (value, options) { - return options.every(function (o) { return !looseEqual(o, value); }) + function hasNoMatchingOption(value, options) { + return options.every(function (o) { + return !looseEqual(o, value); + }); } - function getValue (option) { - return '_value' in option - ? option._value - : option.value + function getValue(option) { + return "_value" in option ? option._value : option.value; } - function onCompositionStart (e) { + function onCompositionStart(e) { e.target.composing = true; } - function onCompositionEnd (e) { + function onCompositionEnd(e) { // prevent triggering an input event for no reason - if (!e.target.composing) { return } + if (!e.target.composing) { + return; + } e.target.composing = false; - trigger(e.target, 'input'); + trigger(e.target, "input"); } - function trigger (el, type) { - var e = document.createEvent('HTMLEvents'); + function trigger(el, type) { + var e = document.createEvent("HTMLEvents"); e.initEvent(type, true, true); el.dispatchEvent(e); } @@ -8590,36 +8981,38 @@ /* */ // recursively search for possible transition defined inside the component root - function locateNode (vnode) { + function locateNode(vnode) { return vnode.componentInstance && (!vnode.data || !vnode.data.transition) ? locateNode(vnode.componentInstance._vnode) - : vnode + : vnode; } var show = { - bind: function bind (el, ref, vnode) { + bind: function bind(el, ref, vnode) { var value = ref.value; vnode = locateNode(vnode); var transition$$1 = vnode.data && vnode.data.transition; - var originalDisplay = el.__vOriginalDisplay = - el.style.display === 'none' ? '' : el.style.display; + var originalDisplay = (el.__vOriginalDisplay = + el.style.display === "none" ? "" : el.style.display); if (value && transition$$1) { vnode.data.show = true; enter(vnode, function () { el.style.display = originalDisplay; }); } else { - el.style.display = value ? originalDisplay : 'none'; + el.style.display = value ? originalDisplay : "none"; } }, - update: function update (el, ref, vnode) { + update: function update(el, ref, vnode) { var value = ref.value; var oldValue = ref.oldValue; /* istanbul ignore if */ - if (!value === !oldValue) { return } + if (!value === !oldValue) { + return; + } vnode = locateNode(vnode); var transition$$1 = vnode.data && vnode.data.transition; if (transition$$1) { @@ -8630,30 +9023,24 @@ }); } else { leave(vnode, function () { - el.style.display = 'none'; + el.style.display = "none"; }); } } else { - el.style.display = value ? el.__vOriginalDisplay : 'none'; + el.style.display = value ? el.__vOriginalDisplay : "none"; } }, - unbind: function unbind ( - el, - binding, - vnode, - oldVnode, - isDestroy - ) { + unbind: function unbind(el, binding, vnode, oldVnode, isDestroy) { if (!isDestroy) { el.style.display = el.__vOriginalDisplay; } - } + }, }; var platformDirectives = { model: directive, - show: show + show: show, }; /* */ @@ -8673,21 +9060,21 @@ appearClass: String, appearActiveClass: String, appearToClass: String, - duration: [Number, String, Object] + duration: [Number, String, Object], }; // in case the child is also an abstract component, e.g. <keep-alive> // we want to recursively retrieve the real component to be rendered - function getRealChild (vnode) { + function getRealChild(vnode) { var compOptions = vnode && vnode.componentOptions; if (compOptions && compOptions.Ctor.options.abstract) { - return getRealChild(getFirstComponentChild(compOptions.children)) + return getRealChild(getFirstComponentChild(compOptions.children)); } else { - return vnode + return vnode; } } - function extractTransitionData (comp) { + function extractTransitionData(comp) { var data = {}; var options = comp.$options; // props @@ -8700,58 +9087,62 @@ for (var key$1 in listeners) { data[camelize(key$1)] = listeners[key$1]; } - return data + return data; } - function placeholder (h, rawChild) { + function placeholder(h, rawChild) { if (/\d-keep-alive$/.test(rawChild.tag)) { - return h('keep-alive', { - props: rawChild.componentOptions.propsData - }) + return h("keep-alive", { + props: rawChild.componentOptions.propsData, + }); } } - function hasParentTransition (vnode) { + function hasParentTransition(vnode) { while ((vnode = vnode.parent)) { if (vnode.data.transition) { - return true + return true; } } } - function isSameChild (child, oldChild) { - return oldChild.key === child.key && oldChild.tag === child.tag + function isSameChild(child, oldChild) { + return oldChild.key === child.key && oldChild.tag === child.tag; } - var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); }; + var isNotTextNode = function (c) { + return c.tag || isAsyncPlaceholder(c); + }; - var isVShowDirective = function (d) { return d.name === 'show'; }; + var isVShowDirective = function (d) { + return d.name === "show"; + }; var Transition = { - name: 'transition', + name: "transition", props: transitionProps, abstract: true, - render: function render (h) { + render: function render(h) { var this$1 = this; var children = this.$slots.default; if (!children) { - return + return; } // filter out text nodes (possible whitespaces) children = children.filter(isNotTextNode); /* istanbul ignore if */ if (!children.length) { - return + return; } // warn multiple elements if (children.length > 1) { warn( - '<transition> can only be used on a single element. Use ' + - '<transition-group> for lists.', + "<transition> can only be used on a single element. Use " + + "<transition-group> for lists.", this.$parent ); } @@ -8759,12 +9150,8 @@ var mode = this.mode; // warn invalid mode - if (mode && mode !== 'in-out' && mode !== 'out-in' - ) { - warn( - 'invalid <transition> mode: ' + mode, - this.$parent - ); + if (mode && mode !== "in-out" && mode !== "out-in") { + warn("invalid <transition> mode: " + mode, this.$parent); } var rawChild = children[0]; @@ -8772,7 +9159,7 @@ // if this is a component root node and the component's // parent container node also has transition, skip. if (hasParentTransition(this.$vnode)) { - return rawChild + return rawChild; } // apply transition data to child @@ -8780,32 +9167,39 @@ var child = getRealChild(rawChild); /* istanbul ignore if */ if (!child) { - return rawChild + return rawChild; } if (this._leaving) { - return placeholder(h, rawChild) + return placeholder(h, rawChild); } // ensure a key that is unique to the vnode type and to this transition // component instance. This key will be used to remove pending leaving nodes // during entering. - var id = "__transition-" + (this._uid) + "-"; - child.key = child.key == null - ? child.isComment - ? id + 'comment' - : id + child.tag - : isPrimitive(child.key) - ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key) + var id = "__transition-" + this._uid + "-"; + child.key = + child.key == null + ? child.isComment + ? id + "comment" + : id + child.tag + : isPrimitive(child.key) + ? String(child.key).indexOf(id) === 0 + ? child.key + : id + child.key : child.key; - var data = (child.data || (child.data = {})).transition = extractTransitionData(this); + var data = ((child.data || (child.data = {})).transition = + extractTransitionData(this)); var oldRawChild = this._vnode; var oldChild = getRealChild(oldRawChild); // mark v-show // so that the transition module can hand over the control to the directive - if (child.data.directives && child.data.directives.some(isVShowDirective)) { + if ( + child.data.directives && + child.data.directives.some(isVShowDirective) + ) { child.data.show = true; } @@ -8815,49 +9209,59 @@ !isSameChild(child, oldChild) && !isAsyncPlaceholder(oldChild) && // #6687 component root is a comment node - !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment) + !( + oldChild.componentInstance && + oldChild.componentInstance._vnode.isComment + ) ) { // replace old child transition data with fresh one // important for dynamic transitions! - var oldData = oldChild.data.transition = extend({}, data); + var oldData = (oldChild.data.transition = extend({}, data)); // handle transition mode - if (mode === 'out-in') { + if (mode === "out-in") { // return placeholder node and queue update when leave finishes this._leaving = true; - mergeVNodeHook(oldData, 'afterLeave', function () { + mergeVNodeHook(oldData, "afterLeave", function () { this$1._leaving = false; this$1.$forceUpdate(); }); - return placeholder(h, rawChild) - } else if (mode === 'in-out') { + return placeholder(h, rawChild); + } else if (mode === "in-out") { if (isAsyncPlaceholder(child)) { - return oldRawChild + return oldRawChild; } var delayedLeave; - var performLeave = function () { delayedLeave(); }; - mergeVNodeHook(data, 'afterEnter', performLeave); - mergeVNodeHook(data, 'enterCancelled', performLeave); - mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; }); + var performLeave = function () { + delayedLeave(); + }; + mergeVNodeHook(data, "afterEnter", performLeave); + mergeVNodeHook(data, "enterCancelled", performLeave); + mergeVNodeHook(oldData, "delayLeave", function (leave) { + delayedLeave = leave; + }); } } - return rawChild - } + return rawChild; + }, }; /* */ - var props = extend({ - tag: String, - moveClass: String - }, transitionProps); + var props = extend( + { + tag: String, + moveClass: String, + }, + transitionProps + ); delete props.mode; var TransitionGroup = { props: props, - beforeMount: function beforeMount () { + beforeMount: function beforeMount() { var this$1 = this; var update = this._update; @@ -8876,25 +9280,25 @@ }; }, - render: function render (h) { - var tag = this.tag || this.$vnode.data.tag || 'span'; + render: function render(h) { + var tag = this.tag || this.$vnode.data.tag || "span"; var map = Object.create(null); - var prevChildren = this.prevChildren = this.children; + var prevChildren = (this.prevChildren = this.children); var rawChildren = this.$slots.default || []; - var children = this.children = []; + var children = (this.children = []); var transitionData = extractTransitionData(this); for (var i = 0; i < rawChildren.length; i++) { var c = rawChildren[i]; if (c.tag) { - if (c.key != null && String(c.key).indexOf('__vlist') !== 0) { + if (c.key != null && String(c.key).indexOf("__vlist") !== 0) { children.push(c); - map[c.key] = c - ;(c.data || (c.data = {})).transition = transitionData; + map[c.key] = c; + (c.data || (c.data = {})).transition = transitionData; } else { var opts = c.componentOptions; - var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag; - warn(("<transition-group> children must be keyed: <" + name + ">")); + var name = opts ? opts.Ctor.options.name || opts.tag || "" : c.tag; + warn("<transition-group> children must be keyed: <" + name + ">"); } } } @@ -8916,14 +9320,14 @@ this.removed = removed; } - return h(tag, null, children) + return h(tag, null, children); }, - updated: function updated () { + updated: function updated() { var children = this.prevChildren; - var moveClass = this.moveClass || ((this.name || 'v') + '-move'); + var moveClass = this.moveClass || (this.name || "v") + "-move"; if (!children.length || !this.hasMove(children[0].elm, moveClass)) { - return + return; } // we divide the work into three loops to avoid mixing DOM reads and writes @@ -8942,30 +9346,33 @@ var el = c.elm; var s = el.style; addTransitionClass(el, moveClass); - s.transform = s.WebkitTransform = s.transitionDuration = ''; - el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) { - if (e && e.target !== el) { - return - } - if (!e || /transform$/.test(e.propertyName)) { - el.removeEventListener(transitionEndEvent, cb); - el._moveCb = null; - removeTransitionClass(el, moveClass); - } - }); + s.transform = s.WebkitTransform = s.transitionDuration = ""; + el.addEventListener( + transitionEndEvent, + (el._moveCb = function cb(e) { + if (e && e.target !== el) { + return; + } + if (!e || /transform$/.test(e.propertyName)) { + el.removeEventListener(transitionEndEvent, cb); + el._moveCb = null; + removeTransitionClass(el, moveClass); + } + }) + ); } }); }, methods: { - hasMove: function hasMove (el, moveClass) { + hasMove: function hasMove(el, moveClass) { /* istanbul ignore if */ if (!hasTransition) { - return false + return false; } /* istanbul ignore if */ if (this._hasMove) { - return this._hasMove + return this._hasMove; } // Detect whether an element with the move class applied has // CSS transitions. Since the element may be inside an entering @@ -8974,19 +9381,21 @@ // is applied. var clone = el.cloneNode(); if (el._transitionClasses) { - el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); }); + el._transitionClasses.forEach(function (cls) { + removeClass(clone, cls); + }); } addClass(clone, moveClass); - clone.style.display = 'none'; + clone.style.display = "none"; this.$el.appendChild(clone); var info = getTransitionInfo(clone); this.$el.removeChild(clone); - return (this._hasMove = info.hasTransform) - } - } + return (this._hasMove = info.hasTransform); + }, + }, }; - function callPendingCbs (c) { + function callPendingCbs(c) { /* istanbul ignore if */ if (c.elm._moveCb) { c.elm._moveCb(); @@ -8997,11 +9406,11 @@ } } - function recordPosition (c) { + function recordPosition(c) { c.data.newPos = c.elm.getBoundingClientRect(); } - function applyTranslation (c) { + function applyTranslation(c) { var oldPos = c.data.pos; var newPos = c.data.newPos; var dx = oldPos.left - newPos.left; @@ -9010,13 +9419,13 @@ c.data.moved = true; var s = c.elm.style; s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)"; - s.transitionDuration = '0s'; + s.transitionDuration = "0s"; } } var platformComponents = { Transition: Transition, - TransitionGroup: TransitionGroup + TransitionGroup: TransitionGroup, }; /* */ @@ -9036,12 +9445,9 @@ Vue.prototype.__patch__ = inBrowser ? patch : noop; // public mount method - Vue.prototype.$mount = function ( - el, - hydrating - ) { + Vue.prototype.$mount = function (el, hydrating) { el = el && inBrowser ? query(el) : undefined; - return mountComponent(this, el, hydrating) + return mountComponent(this, el, hydrating); }; // devtools global hook @@ -9050,21 +9456,19 @@ setTimeout(function () { if (config.devtools) { if (devtools) { - devtools.emit('init', Vue); + devtools.emit("init", Vue); } else { - console[console.info ? 'info' : 'log']( - 'Download the Vue Devtools extension for a better development experience:\n' + - 'https://github.com/vuejs/vue-devtools' + console[console.info ? "info" : "log"]( + "Download the Vue Devtools extension for a better development experience:\n" + + "https://github.com/vuejs/vue-devtools" ); } } - if (config.productionTip !== false && - typeof console !== 'undefined' - ) { - console[console.info ? 'info' : 'log']( + if (config.productionTip !== false && typeof console !== "undefined") { + console[console.info ? "info" : "log"]( "You are running Vue in development mode.\n" + - "Make sure to turn on production mode when deploying for production.\n" + - "See more tips at https://vuejs.org/guide/deployment.html" + "Make sure to turn on production mode when deploying for production.\n" + + "See more tips at https://vuejs.org/guide/deployment.html" ); } }, 0); @@ -9076,134 +9480,133 @@ var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g; var buildRegex = cached(function (delimiters) { - var open = delimiters[0].replace(regexEscapeRE, '\\$&'); - var close = delimiters[1].replace(regexEscapeRE, '\\$&'); - return new RegExp(open + '((?:.|\\n)+?)' + close, 'g') + var open = delimiters[0].replace(regexEscapeRE, "\\$&"); + var close = delimiters[1].replace(regexEscapeRE, "\\$&"); + return new RegExp(open + "((?:.|\\n)+?)" + close, "g"); }); - - - function parseText ( - text, - delimiters - ) { + function parseText(text, delimiters) { var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE; if (!tagRE.test(text)) { - return + return; } var tokens = []; var rawTokens = []; - var lastIndex = tagRE.lastIndex = 0; + var lastIndex = (tagRE.lastIndex = 0); var match, index, tokenValue; while ((match = tagRE.exec(text))) { index = match.index; // push text token if (index > lastIndex) { - rawTokens.push(tokenValue = text.slice(lastIndex, index)); + rawTokens.push((tokenValue = text.slice(lastIndex, index))); tokens.push(JSON.stringify(tokenValue)); } // tag token var exp = parseFilters(match[1].trim()); - tokens.push(("_s(" + exp + ")")); - rawTokens.push({ '@binding': exp }); + tokens.push("_s(" + exp + ")"); + rawTokens.push({ "@binding": exp }); lastIndex = index + match[0].length; } if (lastIndex < text.length) { - rawTokens.push(tokenValue = text.slice(lastIndex)); + rawTokens.push((tokenValue = text.slice(lastIndex))); tokens.push(JSON.stringify(tokenValue)); } return { - expression: tokens.join('+'), - tokens: rawTokens - } + expression: tokens.join("+"), + tokens: rawTokens, + }; } /* */ - function transformNode (el, options) { + function transformNode(el, options) { var warn = options.warn || baseWarn; - var staticClass = getAndRemoveAttr(el, 'class'); + var staticClass = getAndRemoveAttr(el, "class"); if (staticClass) { var res = parseText(staticClass, options.delimiters); if (res) { warn( - "class=\"" + staticClass + "\": " + - 'Interpolation inside attributes has been removed. ' + - 'Use v-bind or the colon shorthand instead. For example, ' + - 'instead of <div class="{{ val }}">, use <div :class="val">.', - el.rawAttrsMap['class'] + 'class="' + + staticClass + + '": ' + + "Interpolation inside attributes has been removed. " + + "Use v-bind or the colon shorthand instead. For example, " + + 'instead of <div class="{{ val }}">, use <div :class="val">.', + el.rawAttrsMap["class"] ); } } if (staticClass) { el.staticClass = JSON.stringify(staticClass); } - var classBinding = getBindingAttr(el, 'class', false /* getStatic */); + var classBinding = getBindingAttr(el, "class", false /* getStatic */); if (classBinding) { el.classBinding = classBinding; } } - function genData (el) { - var data = ''; + function genData(el) { + var data = ""; if (el.staticClass) { - data += "staticClass:" + (el.staticClass) + ","; + data += "staticClass:" + el.staticClass + ","; } if (el.classBinding) { - data += "class:" + (el.classBinding) + ","; + data += "class:" + el.classBinding + ","; } - return data + return data; } var klass$1 = { - staticKeys: ['staticClass'], + staticKeys: ["staticClass"], transformNode: transformNode, - genData: genData + genData: genData, }; /* */ - function transformNode$1 (el, options) { + function transformNode$1(el, options) { var warn = options.warn || baseWarn; - var staticStyle = getAndRemoveAttr(el, 'style'); + var staticStyle = getAndRemoveAttr(el, "style"); if (staticStyle) { /* istanbul ignore if */ { var res = parseText(staticStyle, options.delimiters); if (res) { warn( - "style=\"" + staticStyle + "\": " + - 'Interpolation inside attributes has been removed. ' + - 'Use v-bind or the colon shorthand instead. For example, ' + - 'instead of <div style="{{ val }}">, use <div :style="val">.', - el.rawAttrsMap['style'] + 'style="' + + staticStyle + + '": ' + + "Interpolation inside attributes has been removed. " + + "Use v-bind or the colon shorthand instead. For example, " + + 'instead of <div style="{{ val }}">, use <div :style="val">.', + el.rawAttrsMap["style"] ); } } el.staticStyle = JSON.stringify(parseStyleText(staticStyle)); } - var styleBinding = getBindingAttr(el, 'style', false /* getStatic */); + var styleBinding = getBindingAttr(el, "style", false /* getStatic */); if (styleBinding) { el.styleBinding = styleBinding; } } - function genData$1 (el) { - var data = ''; + function genData$1(el) { + var data = ""; if (el.staticStyle) { - data += "staticStyle:" + (el.staticStyle) + ","; + data += "staticStyle:" + el.staticStyle + ","; } if (el.styleBinding) { - data += "style:(" + (el.styleBinding) + "),"; + data += "style:(" + el.styleBinding + "),"; } - return data + return data; } var style$1 = { - staticKeys: ['staticStyle'], + staticKeys: ["staticStyle"], transformNode: transformNode$1, - genData: genData$1 + genData: genData$1, }; /* */ @@ -9211,34 +9614,34 @@ var decoder; var he = { - decode: function decode (html) { - decoder = decoder || document.createElement('div'); + decode: function decode(html) { + decoder = decoder || document.createElement("div"); decoder.innerHTML = html; - return decoder.textContent - } + return decoder.textContent; + }, }; /* */ var isUnaryTag = makeMap( - 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' + - 'link,meta,param,source,track,wbr' + "area,base,br,col,embed,frame,hr,img,input,isindex,keygen," + + "link,meta,param,source,track,wbr" ); // Elements that you can, intentionally, leave open // (and which close themselves) var canBeLeftOpenTag = makeMap( - 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source' + "colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source" ); // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3 // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content var isNonPhrasingTag = makeMap( - 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' + - 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' + - 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' + - 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' + - 'title,tr,track' + "address,article,aside,base,blockquote,body,caption,col,colgroup,dd," + + "details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form," + + "h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta," + + "optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead," + + "title,tr,track" ); /** @@ -9246,44 +9649,50 @@ */ // Regular Expressions for parsing tags and attributes - var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; - var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; - var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*"; + var attribute = + /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; + var dynamicArgAttribute = + /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; + var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + unicodeRegExp.source + "]*"; var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")"; - var startTagOpen = new RegExp(("^<" + qnameCapture)); + var startTagOpen = new RegExp("^<" + qnameCapture); var startTagClose = /^\s*(\/?)>/; - var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); + var endTag = new RegExp("^<\\/" + qnameCapture + "[^>]*>"); var doctype = /^<!DOCTYPE [^>]+>/i; // #7298: escape - to avoid being passed as HTML comment when inlined in page var comment = /^<!\--/; var conditionalComment = /^<!\[/; // Special Elements (can contain anything) - var isPlainTextElement = makeMap('script,style,textarea', true); + var isPlainTextElement = makeMap("script,style,textarea", true); var reCache = {}; var decodingMap = { - '<': '<', - '>': '>', - '"': '"', - '&': '&', - ' ': '\n', - '	': '\t', - ''': "'" + "<": "<", + ">": ">", + """: '"', + "&": "&", + " ": "\n", + "	": "\t", + "'": "'", }; var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g; var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g; // #5992 - var isIgnoreNewlineTag = makeMap('pre,textarea', true); - var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; }; + var isIgnoreNewlineTag = makeMap("pre,textarea", true); + var shouldIgnoreFirstNewline = function (tag, html) { + return tag && isIgnoreNewlineTag(tag) && html[0] === "\n"; + }; - function decodeAttr (value, shouldDecodeNewlines) { + function decodeAttr(value, shouldDecodeNewlines) { var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr; - return value.replace(re, function (match) { return decodingMap[match]; }) + return value.replace(re, function (match) { + return decodingMap[match]; + }); } - function parseHTML (html, options) { + function parseHTML(html, options) { var stack = []; var expectHTML = options.expectHTML; var isUnaryTag$$1 = options.isUnaryTag || no; @@ -9294,28 +9703,32 @@ last = html; // Make sure we're not in a plaintext content element like script/style if (!lastTag || !isPlainTextElement(lastTag)) { - var textEnd = html.indexOf('<'); + var textEnd = html.indexOf("<"); if (textEnd === 0) { // Comment: if (comment.test(html)) { - var commentEnd = html.indexOf('-->'); + var commentEnd = html.indexOf("-->"); if (commentEnd >= 0) { if (options.shouldKeepComment) { - options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3); + options.comment( + html.substring(4, commentEnd), + index, + index + commentEnd + 3 + ); } advance(commentEnd + 3); - continue + continue; } } // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment if (conditionalComment.test(html)) { - var conditionalEnd = html.indexOf(']>'); + var conditionalEnd = html.indexOf("]>"); if (conditionalEnd >= 0) { advance(conditionalEnd + 2); - continue + continue; } } @@ -9323,7 +9736,7 @@ var doctypeMatch = html.match(doctype); if (doctypeMatch) { advance(doctypeMatch[0].length); - continue + continue; } // End tag: @@ -9332,7 +9745,7 @@ var curIndex = index; advance(endTagMatch[0].length); parseEndTag(endTagMatch[1], curIndex, index); - continue + continue; } // Start tag: @@ -9342,11 +9755,13 @@ if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) { advance(1); } - continue + continue; } } - var text = (void 0), rest = (void 0), next = (void 0); + var text = void 0, + rest = void 0, + next = void 0; if (textEnd >= 0) { rest = html.slice(textEnd); while ( @@ -9356,8 +9771,10 @@ !conditionalComment.test(rest) ) { // < in plain text, be forgiving and treat it as text - next = rest.indexOf('<', 1); - if (next < 0) { break } + next = rest.indexOf("<", 1); + if (next < 0) { + break; + } textEnd += next; rest = html.slice(textEnd); } @@ -9378,13 +9795,18 @@ } else { var endTagLength = 0; var stackedTag = lastTag.toLowerCase(); - var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i')); + var reStackedTag = + reCache[stackedTag] || + (reCache[stackedTag] = new RegExp( + "([\\s\\S]*?)(</" + stackedTag + "[^>]*>)", + "i" + )); var rest$1 = html.replace(reStackedTag, function (all, text, endTag) { endTagLength = endTag.length; - if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') { + if (!isPlainTextElement(stackedTag) && stackedTag !== "noscript") { text = text - .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298 - .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1'); + .replace(/<!\--([\s\S]*?)-->/g, "$1") // #7298 + .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, "$1"); } if (shouldIgnoreFirstNewline(stackedTag, text)) { text = text.slice(1); @@ -9392,7 +9814,7 @@ if (options.chars) { options.chars(text); } - return '' + return ""; }); index += html.length - rest$1.length; html = rest$1; @@ -9402,31 +9824,36 @@ if (html === last) { options.chars && options.chars(html); if (!stack.length && options.warn) { - options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length }); + options.warn('Mal-formatted tag at end of template: "' + html + '"', { + start: index + html.length, + }); } - break + break; } } // Clean up any remaining tags parseEndTag(); - function advance (n) { + function advance(n) { index += n; html = html.substring(n); } - function parseStartTag () { + function parseStartTag() { var start = html.match(startTagOpen); if (start) { var match = { tagName: start[1], attrs: [], - start: index + start: index, }; advance(start[0].length); var end, attr; - while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) { + while ( + !(end = html.match(startTagClose)) && + (attr = html.match(dynamicArgAttribute) || html.match(attribute)) + ) { attr.start = index; advance(attr[0].length); attr.end = index; @@ -9436,17 +9863,17 @@ match.unarySlash = end[1]; advance(end[0].length); match.end = index; - return match + return match; } } } - function handleStartTag (match) { + function handleStartTag(match) { var tagName = match.tagName; var unarySlash = match.unarySlash; if (expectHTML) { - if (lastTag === 'p' && isNonPhrasingTag(tagName)) { + if (lastTag === "p" && isNonPhrasingTag(tagName)) { parseEndTag(lastTag); } if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) { @@ -9460,13 +9887,14 @@ var attrs = new Array(l); for (var i = 0; i < l; i++) { var args = match.attrs[i]; - var value = args[3] || args[4] || args[5] || ''; - var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href' - ? options.shouldDecodeNewlinesForHref - : options.shouldDecodeNewlines; + var value = args[3] || args[4] || args[5] || ""; + var shouldDecodeNewlines = + tagName === "a" && args[1] === "href" + ? options.shouldDecodeNewlinesForHref + : options.shouldDecodeNewlines; attrs[i] = { name: args[1], - value: decodeAttr(value, shouldDecodeNewlines) + value: decodeAttr(value, shouldDecodeNewlines), }; if (options.outputSourceRange) { attrs[i].start = args.start + args[0].match(/^\s*/).length; @@ -9475,7 +9903,13 @@ } if (!unary) { - stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end }); + stack.push({ + tag: tagName, + lowerCasedTag: tagName.toLowerCase(), + attrs: attrs, + start: match.start, + end: match.end, + }); lastTag = tagName; } @@ -9484,17 +9918,21 @@ } } - function parseEndTag (tagName, start, end) { + function parseEndTag(tagName, start, end) { var pos, lowerCasedTagName; - if (start == null) { start = index; } - if (end == null) { end = index; } + if (start == null) { + start = index; + } + if (end == null) { + end = index; + } // Find the closest opened tag of the same type if (tagName) { lowerCasedTagName = tagName.toLowerCase(); for (pos = stack.length - 1; pos >= 0; pos--) { if (stack[pos].lowerCasedTag === lowerCasedTagName) { - break + break; } } } else { @@ -9505,11 +9943,9 @@ if (pos >= 0) { // Close all the open elements, up the stack for (var i = stack.length - 1; i >= pos; i--) { - if (i > pos || !tagName && - options.warn - ) { + if (i > pos || (!tagName && options.warn)) { options.warn( - ("tag <" + (stack[i].tag) + "> has no matching end tag."), + "tag <" + stack[i].tag + "> has no matching end tag.", { start: stack[i].start, end: stack[i].end } ); } @@ -9521,11 +9957,11 @@ // Remove the open elements from the stack stack.length = pos; lastTag = pos && stack[pos - 1].tag; - } else if (lowerCasedTagName === 'br') { + } else if (lowerCasedTagName === "br") { if (options.start) { options.start(tagName, [], true, start, end); } - } else if (lowerCasedTagName === 'p') { + } else if (lowerCasedTagName === "p") { if (options.start) { options.start(tagName, [], false, start, end); } @@ -9571,11 +10007,7 @@ var platformGetTagNamespace; var maybeComponent; - function createASTElement ( - tag, - attrs, - parent - ) { + function createASTElement(tag, attrs, parent) { return { type: 1, tag: tag, @@ -9583,28 +10015,27 @@ attrsMap: makeAttrsMap(attrs), rawAttrsMap: {}, parent: parent, - children: [] - } + children: [], + }; } /** * Convert HTML string to AST. */ - function parse ( - template, - options - ) { + function parse(template, options) { warn$2 = options.warn || baseWarn; platformIsPreTag = options.isPreTag || no; platformMustUseProp = options.mustUseProp || no; platformGetTagNamespace = options.getTagNamespace || no; var isReservedTag = options.isReservedTag || no; - maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); }; + maybeComponent = function (el) { + return !!el.component || !isReservedTag(el.tag); + }; - transforms = pluckModuleFunction(options.modules, 'transformNode'); - preTransforms = pluckModuleFunction(options.modules, 'preTransformNode'); - postTransforms = pluckModuleFunction(options.modules, 'postTransformNode'); + transforms = pluckModuleFunction(options.modules, "transformNode"); + preTransforms = pluckModuleFunction(options.modules, "preTransformNode"); + postTransforms = pluckModuleFunction(options.modules, "postTransformNode"); delimiters = options.delimiters; @@ -9617,14 +10048,14 @@ var inPre = false; var warned = false; - function warnOnce (msg, range) { + function warnOnce(msg, range) { if (!warned) { warned = true; warn$2(msg, range); } } - function closeElement (element) { + function closeElement(element) { trimEndingWhitespace(element); if (!inVPre && !element.processed) { element = processElement(element, options); @@ -9638,13 +10069,13 @@ } addIfCondition(root, { exp: element.elseif, - block: element + block: element, }); } else { warnOnce( "Component template should contain exactly one root element. " + - "If you are using v-if on multiple elements, " + - "use v-else-if to chain them instead.", + "If you are using v-if on multiple elements, " + + "use v-else-if to chain them instead.", { start: element.start } ); } @@ -9657,8 +10088,10 @@ // scoped slot // keep it in the children list so that v-else(-if) conditions can // find it as the prev node. - var name = element.slotTarget || '"default"' - ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element; + var name = element.slotTarget || '"default"'; + (currentParent.scopedSlots || (currentParent.scopedSlots = {}))[ + name + ] = element; } currentParent.children.push(element); element.parent = currentParent; @@ -9667,7 +10100,9 @@ // final children cleanup // filter out scoped slots - element.children = element.children.filter(function (c) { return !(c).slotScope; }); + element.children = element.children.filter(function (c) { + return !c.slotScope; + }); // remove trailing whitespace node again trimEndingWhitespace(element); @@ -9684,33 +10119,35 @@ } } - function trimEndingWhitespace (el) { + function trimEndingWhitespace(el) { // remove trailing whitespace node if (!inPre) { var lastNode; while ( (lastNode = el.children[el.children.length - 1]) && lastNode.type === 3 && - lastNode.text === ' ' + lastNode.text === " " ) { el.children.pop(); } } } - function checkRootConstraints (el) { - if (el.tag === 'slot' || el.tag === 'template') { + function checkRootConstraints(el) { + if (el.tag === "slot" || el.tag === "template") { warnOnce( - "Cannot use <" + (el.tag) + "> as component root element because it may " + - 'contain multiple nodes.', + "Cannot use <" + + el.tag + + "> as component root element because it may " + + "contain multiple nodes.", { start: el.start } ); } - if (el.attrsMap.hasOwnProperty('v-for')) { + if (el.attrsMap.hasOwnProperty("v-for")) { warnOnce( - 'Cannot use v-for on stateful component root element because ' + - 'it renders multiple elements.', - el.rawAttrsMap['v-for'] + "Cannot use v-for on stateful component root element because " + + "it renders multiple elements.", + el.rawAttrsMap["v-for"] ); } } @@ -9724,14 +10161,15 @@ shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref, shouldKeepComment: options.comments, outputSourceRange: options.outputSourceRange, - start: function start (tag, attrs, unary, start$1, end) { + start: function start(tag, attrs, unary, start$1, end) { // check namespace. // inherit parent ns if there is one - var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag); + var ns = + (currentParent && currentParent.ns) || platformGetTagNamespace(tag); // handle IE svg bug /* istanbul ignore if */ - if (isIE && ns === 'svg') { + if (isIE && ns === "svg") { attrs = guardIESVGBug(attrs); } @@ -9744,19 +10182,23 @@ if (options.outputSourceRange) { element.start = start$1; element.end = end; - element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) { + element.rawAttrsMap = element.attrsList.reduce(function ( + cumulated, + attr + ) { cumulated[attr.name] = attr; - return cumulated - }, {}); + return cumulated; + }, + {}); } attrs.forEach(function (attr) { if (invalidAttributeRE.test(attr.name)) { warn$2( "Invalid dynamic argument expression: attribute names cannot contain " + - "spaces, quotes, <, >, / or =.", + "spaces, quotes, <, >, / or =.", { start: attr.start + attr.name.indexOf("["), - end: attr.start + attr.name.length + end: attr.start + attr.name.length, } ); } @@ -9766,9 +10208,12 @@ if (isForbiddenTag(element) && !isServerRendering()) { element.forbidden = true; warn$2( - 'Templates should only be responsible for mapping the state to the ' + - 'UI. Avoid placing tags with side-effects in your templates, such as ' + - "<" + tag + ">" + ', as they will not be parsed.', + "Templates should only be responsible for mapping the state to the " + + "UI. Avoid placing tags with side-effects in your templates, such as " + + "<" + + tag + + ">" + + ", as they will not be parsed.", { start: element.start } ); } @@ -9811,7 +10256,7 @@ } }, - end: function end (tag, start, end$1) { + end: function end(tag, start, end$1) { var element = stack[stack.length - 1]; // pop stack stack.length -= 1; @@ -9822,66 +10267,71 @@ closeElement(element); }, - chars: function chars (text, start, end) { + chars: function chars(text, start, end) { if (!currentParent) { { if (text === template) { warnOnce( - 'Component template requires a root element, rather than just text.', + "Component template requires a root element, rather than just text.", { start: start } ); } else if ((text = text.trim())) { warnOnce( - ("text \"" + text + "\" outside root element will be ignored."), + 'text "' + text + '" outside root element will be ignored.', { start: start } ); } } - return + return; } // IE textarea placeholder bug /* istanbul ignore if */ - if (isIE && - currentParent.tag === 'textarea' && + if ( + isIE && + currentParent.tag === "textarea" && currentParent.attrsMap.placeholder === text ) { - return + return; } var children = currentParent.children; if (inPre || text.trim()) { text = isTextTag(currentParent) ? text : decodeHTMLCached(text); } else if (!children.length) { // remove the whitespace-only node right after an opening tag - text = ''; + text = ""; } else if (whitespaceOption) { - if (whitespaceOption === 'condense') { + if (whitespaceOption === "condense") { // in condense mode, remove the whitespace node if it contains // line break, otherwise condense to a single space - text = lineBreakRE.test(text) ? '' : ' '; + text = lineBreakRE.test(text) ? "" : " "; } else { - text = ' '; + text = " "; } } else { - text = preserveWhitespace ? ' ' : ''; + text = preserveWhitespace ? " " : ""; } if (text) { - if (!inPre && whitespaceOption === 'condense') { + if (!inPre && whitespaceOption === "condense") { // condense consecutive whitespaces into single space - text = text.replace(whitespaceRE$1, ' '); + text = text.replace(whitespaceRE$1, " "); } var res; var child; - if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) { + if (!inVPre && text !== " " && (res = parseText(text, delimiters))) { child = { type: 2, expression: res.expression, tokens: res.tokens, - text: text + text: text, }; - } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') { + } else if ( + text !== " " || + !children.length || + children[children.length - 1].text !== " " + ) { child = { type: 3, - text: text + text: text, }; } if (child) { @@ -9893,14 +10343,14 @@ } } }, - comment: function comment (text, start, end) { + comment: function comment(text, start, end) { // adding anything as a sibling to the root node is forbidden // comments should still be allowed, but ignored if (currentParent) { var child = { type: 3, text: text, - isComment: true + isComment: true, }; if (options.outputSourceRange) { child.start = start; @@ -9908,26 +10358,26 @@ } currentParent.children.push(child); } - } + }, }); - return root + return root; } - function processPre (el) { - if (getAndRemoveAttr(el, 'v-pre') != null) { + function processPre(el) { + if (getAndRemoveAttr(el, "v-pre") != null) { el.pre = true; } } - function processRawAttrs (el) { + function processRawAttrs(el) { var list = el.attrsList; var len = list.length; if (len) { - var attrs = el.attrs = new Array(len); + var attrs = (el.attrs = new Array(len)); for (var i = 0; i < len; i++) { attrs[i] = { name: list[i].name, - value: JSON.stringify(list[i].value) + value: JSON.stringify(list[i].value), }; if (list[i].start != null) { attrs[i].start = list[i].start; @@ -9940,19 +10390,13 @@ } } - function processElement ( - element, - options - ) { + function processElement(element, options) { processKey(element); // determine whether this is a plain element after // removing structural attributes - element.plain = ( - !element.key && - !element.scopedSlots && - !element.attrsList.length - ); + element.plain = + !element.key && !element.scopedSlots && !element.attrsList.length; processRef(element); processSlotContent(element); @@ -9962,27 +10406,32 @@ element = transforms[i](element, options) || element; } processAttrs(element); - return element + return element; } - function processKey (el) { - var exp = getBindingAttr(el, 'key'); + function processKey(el) { + var exp = getBindingAttr(el, "key"); if (exp) { { - if (el.tag === 'template') { + if (el.tag === "template") { warn$2( "<template> cannot be keyed. Place the key on real elements instead.", - getRawBindingAttr(el, 'key') + getRawBindingAttr(el, "key") ); } if (el.for) { var iterator = el.iterator2 || el.iterator1; var parent = el.parent; - if (iterator && iterator === exp && parent && parent.tag === 'transition-group') { + if ( + iterator && + iterator === exp && + parent && + parent.tag === "transition-group" + ) { warn$2( "Do not use v-for index as key on <transition-group> children, " + - "this is the same as not using keys.", - getRawBindingAttr(el, 'key'), + "this is the same as not using keys.", + getRawBindingAttr(el, "key"), true /* tip */ ); } @@ -9992,40 +10441,37 @@ } } - function processRef (el) { - var ref = getBindingAttr(el, 'ref'); + function processRef(el) { + var ref = getBindingAttr(el, "ref"); if (ref) { el.ref = ref; el.refInFor = checkInFor(el); } } - function processFor (el) { + function processFor(el) { var exp; - if ((exp = getAndRemoveAttr(el, 'v-for'))) { + if ((exp = getAndRemoveAttr(el, "v-for"))) { var res = parseFor(exp); if (res) { extend(el, res); } else { - warn$2( - ("Invalid v-for expression: " + exp), - el.rawAttrsMap['v-for'] - ); + warn$2("Invalid v-for expression: " + exp, el.rawAttrsMap["v-for"]); } } } - - - function parseFor (exp) { + function parseFor(exp) { var inMatch = exp.match(forAliasRE); - if (!inMatch) { return } + if (!inMatch) { + return; + } var res = {}; res.for = inMatch[2].trim(); - var alias = inMatch[1].trim().replace(stripParensRE, ''); + var alias = inMatch[1].trim().replace(stripParensRE, ""); var iteratorMatch = alias.match(forIteratorRE); if (iteratorMatch) { - res.alias = alias.replace(forIteratorRE, '').trim(); + res.alias = alias.replace(forIteratorRE, "").trim(); res.iterator1 = iteratorMatch[1].trim(); if (iteratorMatch[2]) { res.iterator2 = iteratorMatch[2].trim(); @@ -10033,54 +10479,60 @@ } else { res.alias = alias; } - return res + return res; } - function processIf (el) { - var exp = getAndRemoveAttr(el, 'v-if'); + function processIf(el) { + var exp = getAndRemoveAttr(el, "v-if"); if (exp) { el.if = exp; addIfCondition(el, { exp: exp, - block: el + block: el, }); } else { - if (getAndRemoveAttr(el, 'v-else') != null) { + if (getAndRemoveAttr(el, "v-else") != null) { el.else = true; } - var elseif = getAndRemoveAttr(el, 'v-else-if'); + var elseif = getAndRemoveAttr(el, "v-else-if"); if (elseif) { el.elseif = elseif; } } } - function processIfConditions (el, parent) { + function processIfConditions(el, parent) { var prev = findPrevElement(parent.children); if (prev && prev.if) { addIfCondition(prev, { exp: el.elseif, - block: el + block: el, }); } else { warn$2( - "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " + - "used on element <" + (el.tag) + "> without corresponding v-if.", - el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else'] + "v-" + + (el.elseif ? 'else-if="' + el.elseif + '"' : "else") + + " " + + "used on element <" + + el.tag + + "> without corresponding v-if.", + el.rawAttrsMap[el.elseif ? "v-else-if" : "v-else"] ); } } - function findPrevElement (children) { + function findPrevElement(children) { var i = children.length; while (i--) { if (children[i].type === 1) { - return children[i] + return children[i]; } else { - if (children[i].text !== ' ') { + if (children[i].text !== " ") { warn$2( - "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " + - "will be ignored.", + 'text "' + + children[i].text.trim() + + '" between v-if and v-else(-if) ' + + "will be ignored.", children[i] ); } @@ -10089,15 +10541,15 @@ } } - function addIfCondition (el, condition) { + function addIfCondition(el, condition) { if (!el.ifConditions) { el.ifConditions = []; } el.ifConditions.push(condition); } - function processOnce (el) { - var once$$1 = getAndRemoveAttr(el, 'v-once'); + function processOnce(el) { + var once$$1 = getAndRemoveAttr(el, "v-once"); if (once$$1 != null) { el.once = true; } @@ -10105,30 +10557,32 @@ // handle content being passed to a component as slot, // e.g. <template slot="xxx">, <div slot-scope="xxx"> - function processSlotContent (el) { + function processSlotContent(el) { var slotScope; - if (el.tag === 'template') { - slotScope = getAndRemoveAttr(el, 'scope'); + if (el.tag === "template") { + slotScope = getAndRemoveAttr(el, "scope"); /* istanbul ignore if */ if (slotScope) { warn$2( - "the \"scope\" attribute for scoped slots have been deprecated and " + - "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " + - "can also be used on plain elements in addition to <template> to " + - "denote scoped slots.", - el.rawAttrsMap['scope'], + 'the "scope" attribute for scoped slots have been deprecated and ' + + 'replaced by "slot-scope" since 2.5. The new "slot-scope" attribute ' + + "can also be used on plain elements in addition to <template> to " + + "denote scoped slots.", + el.rawAttrsMap["scope"], true ); } - el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); - } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { + el.slotScope = slotScope || getAndRemoveAttr(el, "slot-scope"); + } else if ((slotScope = getAndRemoveAttr(el, "slot-scope"))) { /* istanbul ignore if */ - if (el.attrsMap['v-for']) { + if (el.attrsMap["v-for"]) { warn$2( - "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " + - "(v-for takes higher priority). Use a wrapper <template> for the " + - "scoped slot to make it clearer.", - el.rawAttrsMap['slot-scope'], + "Ambiguous combined usage of slot-scope and v-for on <" + + el.tag + + "> " + + "(v-for takes higher priority). Use a wrapper <template> for the " + + "scoped slot to make it clearer.", + el.rawAttrsMap["slot-scope"], true ); } @@ -10136,34 +10590,33 @@ } // slot="xxx" - var slotTarget = getBindingAttr(el, 'slot'); + var slotTarget = getBindingAttr(el, "slot"); if (slotTarget) { el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget; - el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']); + el.slotTargetDynamic = !!( + el.attrsMap[":slot"] || el.attrsMap["v-bind:slot"] + ); // preserve slot as an attribute for native shadow DOM compat // only for non-scoped slots. - if (el.tag !== 'template' && !el.slotScope) { - addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot')); + if (el.tag !== "template" && !el.slotScope) { + addAttr(el, "slot", slotTarget, getRawBindingAttr(el, "slot")); } } // 2.6 v-slot syntax { - if (el.tag === 'template') { + if (el.tag === "template") { // v-slot on <template> var slotBinding = getAndRemoveAttrByRegex(el, slotRE); if (slotBinding) { { if (el.slotTarget || el.slotScope) { - warn$2( - "Unexpected mixed usage of different slot syntaxes.", - el - ); + warn$2("Unexpected mixed usage of different slot syntaxes.", el); } if (el.parent && !maybeComponent(el.parent)) { warn$2( "<template v-slot> can only appear at the root level inside " + - "the receiving component", + "the receiving component", el ); } @@ -10187,15 +10640,12 @@ ); } if (el.slotScope || el.slotTarget) { - warn$2( - "Unexpected mixed usage of different slot syntaxes.", - el - ); + warn$2("Unexpected mixed usage of different slot syntaxes.", el); } if (el.scopedSlots) { warn$2( "To avoid scope ambiguity, the default slot should also use " + - "<template> syntax when there are other named slots.", + "<template> syntax when there are other named slots.", slotBinding$1 ); } @@ -10205,13 +10655,17 @@ var ref$1 = getSlotName(slotBinding$1); var name$1 = ref$1.name; var dynamic$1 = ref$1.dynamic; - var slotContainer = slots[name$1] = createASTElement('template', [], el); + var slotContainer = (slots[name$1] = createASTElement( + "template", + [], + el + )); slotContainer.slotTarget = name$1; slotContainer.slotTargetDynamic = dynamic$1; slotContainer.children = el.children.filter(function (c) { if (!c.slotScope) { c.parent = slotContainer; - return true + return true; } }); slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken; @@ -10224,51 +10678,48 @@ } } - function getSlotName (binding) { - var name = binding.name.replace(slotRE, ''); + function getSlotName(binding) { + var name = binding.name.replace(slotRE, ""); if (!name) { - if (binding.name[0] !== '#') { - name = 'default'; + if (binding.name[0] !== "#") { + name = "default"; } else { - warn$2( - "v-slot shorthand syntax requires a slot name.", - binding - ); + warn$2("v-slot shorthand syntax requires a slot name.", binding); } } return dynamicArgRE.test(name) - // dynamic [name] - ? { name: name.slice(1, -1), dynamic: true } - // static name - : { name: ("\"" + name + "\""), dynamic: false } + ? // dynamic [name] + { name: name.slice(1, -1), dynamic: true } + : // static name + { name: '"' + name + '"', dynamic: false }; } // handle <slot/> outlets - function processSlotOutlet (el) { - if (el.tag === 'slot') { - el.slotName = getBindingAttr(el, 'name'); + function processSlotOutlet(el) { + if (el.tag === "slot") { + el.slotName = getBindingAttr(el, "name"); if (el.key) { warn$2( "`key` does not work on <slot> because slots are abstract outlets " + - "and can possibly expand into multiple elements. " + - "Use the key on a wrapping element instead.", - getRawBindingAttr(el, 'key') + "and can possibly expand into multiple elements. " + + "Use the key on a wrapping element instead.", + getRawBindingAttr(el, "key") ); } } } - function processComponent (el) { + function processComponent(el) { var binding; - if ((binding = getBindingAttr(el, 'is'))) { + if ((binding = getBindingAttr(el, "is"))) { el.component = binding; } - if (getAndRemoveAttr(el, 'inline-template') != null) { + if (getAndRemoveAttr(el, "inline-template") != null) { el.inlineTemplate = true; } } - function processAttrs (el) { + function processAttrs(el) { var list = el.attrsList; var i, l, name, rawName, value, modifiers, syncGen, isDynamic; for (i = 0, l = list.length; i < l; i++) { @@ -10278,29 +10729,32 @@ // mark element as dynamic el.hasBindings = true; // modifiers - modifiers = parseModifiers(name.replace(dirRE, '')); + modifiers = parseModifiers(name.replace(dirRE, "")); // support .foo shorthand syntax for the .prop modifier if (modifiers) { - name = name.replace(modifierRE, ''); + name = name.replace(modifierRE, ""); } - if (bindRE.test(name)) { // v-bind - name = name.replace(bindRE, ''); + if (bindRE.test(name)) { + // v-bind + name = name.replace(bindRE, ""); value = parseFilters(value); isDynamic = dynamicArgRE.test(name); if (isDynamic) { name = name.slice(1, -1); } - if ( - value.trim().length === 0 - ) { + if (value.trim().length === 0) { warn$2( - ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"") + 'The value for a v-bind expression cannot be empty. Found in "v-bind:' + + name + + '"' ); } if (modifiers) { if (modifiers.prop && !isDynamic) { name = camelize(name); - if (name === 'innerHtml') { name = 'innerHTML'; } + if (name === "innerHtml") { + name = "innerHTML"; + } } if (modifiers.camel && !isDynamic) { name = camelize(name); @@ -10310,7 +10764,7 @@ if (!isDynamic) { addHandler( el, - ("update:" + (camelize(name))), + "update:" + camelize(name), syncGen, null, false, @@ -10320,7 +10774,7 @@ if (hyphenate(name) !== camelize(name)) { addHandler( el, - ("update:" + (hyphenate(name))), + "update:" + hyphenate(name), syncGen, null, false, @@ -10332,7 +10786,7 @@ // handler w/ dynamic event name addHandler( el, - ("\"update:\"+(" + name + ")"), + '"update:"+(' + name + ")", syncGen, null, false, @@ -10343,22 +10797,35 @@ } } } - if ((modifiers && modifiers.prop) || ( - !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name) - )) { + if ( + (modifiers && modifiers.prop) || + (!el.component && + platformMustUseProp(el.tag, el.attrsMap.type, name)) + ) { addProp(el, name, value, list[i], isDynamic); } else { addAttr(el, name, value, list[i], isDynamic); } - } else if (onRE.test(name)) { // v-on - name = name.replace(onRE, ''); + } else if (onRE.test(name)) { + // v-on + name = name.replace(onRE, ""); isDynamic = dynamicArgRE.test(name); if (isDynamic) { name = name.slice(1, -1); } - addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic); - } else { // normal directives - name = name.replace(dirRE, ''); + addHandler( + el, + name, + value, + modifiers, + false, + warn$2, + list[i], + isDynamic + ); + } else { + // normal directives + name = name.replace(dirRE, ""); // parse arg var argMatch = name.match(argRE); var arg = argMatch && argMatch[1]; @@ -10370,8 +10837,17 @@ isDynamic = true; } } - addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]); - if (name === 'model') { + addDirective( + el, + name, + rawName, + value, + arg, + isDynamic, + modifiers, + list[i] + ); + if (name === "model") { checkForAliasModel(el, value); } } @@ -10381,10 +10857,13 @@ var res = parseText(value, delimiters); if (res) { warn$2( - name + "=\"" + value + "\": " + - 'Interpolation inside attributes has been removed. ' + - 'Use v-bind or the colon shorthand instead. For example, ' + - 'instead of <div id="{{ val }}">, use <div :id="val">.', + name + + '="' + + value + + '": ' + + "Interpolation inside attributes has been removed. " + + "Use v-bind or the colon shorthand instead. For example, " + + 'instead of <div id="{{ val }}">, use <div :id="val">.', list[i] ); } @@ -10392,90 +10871,94 @@ addAttr(el, name, JSON.stringify(value), list[i]); // #6887 firefox doesn't update muted state if set via attribute // even immediately after element creation - if (!el.component && - name === 'muted' && - platformMustUseProp(el.tag, el.attrsMap.type, name)) { - addProp(el, name, 'true', list[i]); + if ( + !el.component && + name === "muted" && + platformMustUseProp(el.tag, el.attrsMap.type, name) + ) { + addProp(el, name, "true", list[i]); } } } } - function checkInFor (el) { + function checkInFor(el) { var parent = el; while (parent) { if (parent.for !== undefined) { - return true + return true; } parent = parent.parent; } - return false + return false; } - function parseModifiers (name) { + function parseModifiers(name) { var match = name.match(modifierRE); if (match) { var ret = {}; - match.forEach(function (m) { ret[m.slice(1)] = true; }); - return ret + match.forEach(function (m) { + ret[m.slice(1)] = true; + }); + return ret; } } - function makeAttrsMap (attrs) { + function makeAttrsMap(attrs) { var map = {}; for (var i = 0, l = attrs.length; i < l; i++) { - if ( - map[attrs[i].name] && !isIE && !isEdge - ) { - warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]); + if (map[attrs[i].name] && !isIE && !isEdge) { + warn$2("duplicate attribute: " + attrs[i].name, attrs[i]); } map[attrs[i].name] = attrs[i].value; } - return map + return map; } // for script (e.g. type="x/template") or style, do not decode content - function isTextTag (el) { - return el.tag === 'script' || el.tag === 'style' + function isTextTag(el) { + return el.tag === "script" || el.tag === "style"; } - function isForbiddenTag (el) { + function isForbiddenTag(el) { return ( - el.tag === 'style' || - (el.tag === 'script' && ( - !el.attrsMap.type || - el.attrsMap.type === 'text/javascript' - )) - ) + el.tag === "style" || + (el.tag === "script" && + (!el.attrsMap.type || el.attrsMap.type === "text/javascript")) + ); } var ieNSBug = /^xmlns:NS\d+/; var ieNSPrefix = /^NS\d+:/; /* istanbul ignore next */ - function guardIESVGBug (attrs) { + function guardIESVGBug(attrs) { var res = []; for (var i = 0; i < attrs.length; i++) { var attr = attrs[i]; if (!ieNSBug.test(attr.name)) { - attr.name = attr.name.replace(ieNSPrefix, ''); + attr.name = attr.name.replace(ieNSPrefix, ""); res.push(attr); } } - return res + return res; } - function checkForAliasModel (el, value) { + function checkForAliasModel(el, value) { var _el = el; while (_el) { if (_el.for && _el.alias === value) { warn$2( - "<" + (el.tag) + " v-model=\"" + value + "\">: " + - "You are binding v-model directly to a v-for iteration alias. " + - "This will not be able to modify the v-for source array because " + - "writing to the alias is like modifying a function local variable. " + - "Consider using an array of objects and use v-model on an object property instead.", - el.rawAttrsMap['v-model'] + "<" + + el.tag + + ' v-model="' + + value + + '">: ' + + "You are binding v-model directly to a v-for iteration alias. " + + "This will not be able to modify the v-for source array because " + + "writing to the alias is like modifying a function local variable. " + + "Consider using an array of objects and use v-model on an object property instead.", + el.rawAttrsMap["v-model"] ); } _el = _el.parent; @@ -10484,55 +10967,55 @@ /* */ - function preTransformNode (el, options) { - if (el.tag === 'input') { + function preTransformNode(el, options) { + if (el.tag === "input") { var map = el.attrsMap; - if (!map['v-model']) { - return + if (!map["v-model"]) { + return; } var typeBinding; - if (map[':type'] || map['v-bind:type']) { - typeBinding = getBindingAttr(el, 'type'); + if (map[":type"] || map["v-bind:type"]) { + typeBinding = getBindingAttr(el, "type"); } - if (!map.type && !typeBinding && map['v-bind']) { - typeBinding = "(" + (map['v-bind']) + ").type"; + if (!map.type && !typeBinding && map["v-bind"]) { + typeBinding = "(" + map["v-bind"] + ").type"; } if (typeBinding) { - var ifCondition = getAndRemoveAttr(el, 'v-if', true); - var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : ""; - var hasElse = getAndRemoveAttr(el, 'v-else', true) != null; - var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true); + var ifCondition = getAndRemoveAttr(el, "v-if", true); + var ifConditionExtra = ifCondition ? "&&(" + ifCondition + ")" : ""; + var hasElse = getAndRemoveAttr(el, "v-else", true) != null; + var elseIfCondition = getAndRemoveAttr(el, "v-else-if", true); // 1. checkbox var branch0 = cloneASTElement(el); // process for on the main node processFor(branch0); - addRawAttr(branch0, 'type', 'checkbox'); + addRawAttr(branch0, "type", "checkbox"); processElement(branch0, options); branch0.processed = true; // prevent it from double-processed branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra; addIfCondition(branch0, { exp: branch0.if, - block: branch0 + block: branch0, }); // 2. add radio else-if condition var branch1 = cloneASTElement(el); - getAndRemoveAttr(branch1, 'v-for', true); - addRawAttr(branch1, 'type', 'radio'); + getAndRemoveAttr(branch1, "v-for", true); + addRawAttr(branch1, "type", "radio"); processElement(branch1, options); addIfCondition(branch0, { exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra, - block: branch1 + block: branch1, }); // 3. other var branch2 = cloneASTElement(el); - getAndRemoveAttr(branch2, 'v-for', true); - addRawAttr(branch2, ':type', typeBinding); + getAndRemoveAttr(branch2, "v-for", true); + addRawAttr(branch2, ":type", typeBinding); processElement(branch2, options); addIfCondition(branch0, { exp: ifCondition, - block: branch2 + block: branch2, }); if (hasElse) { @@ -10541,45 +11024,41 @@ branch0.elseif = elseIfCondition; } - return branch0 + return branch0; } } } - function cloneASTElement (el) { - return createASTElement(el.tag, el.attrsList.slice(), el.parent) + function cloneASTElement(el) { + return createASTElement(el.tag, el.attrsList.slice(), el.parent); } var model$1 = { - preTransformNode: preTransformNode + preTransformNode: preTransformNode, }; - var modules$1 = [ - klass$1, - style$1, - model$1 - ]; + var modules$1 = [klass$1, style$1, model$1]; /* */ - function text (el, dir) { + function text(el, dir) { if (dir.value) { - addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir); + addProp(el, "textContent", "_s(" + dir.value + ")", dir); } } /* */ - function html (el, dir) { + function html(el, dir) { if (dir.value) { - addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir); + addProp(el, "innerHTML", "_s(" + dir.value + ")", dir); } } var directives$1 = { model: model, text: text, - html: html + html: html, }; /* */ @@ -10594,7 +11073,7 @@ canBeLeftOpenTag: canBeLeftOpenTag, isReservedTag: isReservedTag, getTagNamespace: getTagNamespace, - staticKeys: genStaticKeys(modules$1) + staticKeys: genStaticKeys(modules$1), }; /* */ @@ -10615,9 +11094,11 @@ * create fresh nodes for them on each re-render; * 2. Completely skip them in the patching process. */ - function optimize (root, options) { - if (!root) { return } - isStaticKey = genStaticKeysCached(options.staticKeys || ''); + function optimize(root, options) { + if (!root) { + return; + } + isStaticKey = genStaticKeysCached(options.staticKeys || ""); isPlatformReservedTag = options.isReservedTag || no; // first pass: mark all non-static nodes. markStatic$1(root); @@ -10625,14 +11106,14 @@ markStaticRoots(root, false); } - function genStaticKeys$1 (keys) { + function genStaticKeys$1(keys) { return makeMap( - 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' + - (keys ? ',' + keys : '') - ) + "type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap" + + (keys ? "," + keys : "") + ); } - function markStatic$1 (node) { + function markStatic$1(node) { node.static = isStatic(node); if (node.type === 1) { // do not make component slot content static. this avoids @@ -10640,10 +11121,10 @@ // 2. static slot content fails for hot-reloading if ( !isPlatformReservedTag(node.tag) && - node.tag !== 'slot' && - node.attrsMap['inline-template'] == null + node.tag !== "slot" && + node.attrsMap["inline-template"] == null ) { - return + return; } for (var i = 0, l = node.children.length; i < l; i++) { var child = node.children[i]; @@ -10664,7 +11145,7 @@ } } - function markStaticRoots (node, isInFor) { + function markStaticRoots(node, isInFor) { if (node.type === 1) { if (node.static || node.once) { node.staticInFor = isInFor; @@ -10672,12 +11153,13 @@ // For a node to qualify as a static root, it should have children that // are not just static text. Otherwise the cost of hoisting out will // outweigh the benefits and it's better off to just always render it fresh. - if (node.static && node.children.length && !( - node.children.length === 1 && - node.children[0].type === 3 - )) { + if ( + node.static && + node.children.length && + !(node.children.length === 1 && node.children[0].type === 3) + ) { node.staticRoot = true; - return + return; } else { node.staticRoot = false; } @@ -10694,41 +11176,46 @@ } } - function isStatic (node) { - if (node.type === 2) { // expression - return false + function isStatic(node) { + if (node.type === 2) { + // expression + return false; } - if (node.type === 3) { // text - return true + if (node.type === 3) { + // text + return true; } - return !!(node.pre || ( - !node.hasBindings && // no dynamic bindings - !node.if && !node.for && // not v-if or v-for or v-else - !isBuiltInTag(node.tag) && // not a built-in - isPlatformReservedTag(node.tag) && // not a component - !isDirectChildOfTemplateFor(node) && - Object.keys(node).every(isStaticKey) - )) + return !!( + node.pre || + (!node.hasBindings && // no dynamic bindings + !node.if && + !node.for && // not v-if or v-for or v-else + !isBuiltInTag(node.tag) && // not a built-in + isPlatformReservedTag(node.tag) && // not a component + !isDirectChildOfTemplateFor(node) && + Object.keys(node).every(isStaticKey)) + ); } - function isDirectChildOfTemplateFor (node) { + function isDirectChildOfTemplateFor(node) { while (node.parent) { node = node.parent; - if (node.tag !== 'template') { - return false + if (node.tag !== "template") { + return false; } if (node.for) { - return true + return true; } } - return false + return false; } /* */ var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/; var fnInvokeRE = /\([^)]*?\);*$/; - var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; + var simplePathRE = + /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; // KeyboardEvent.keyCode aliases var keyCodes = { @@ -10740,34 +11227,36 @@ left: 37, right: 39, down: 40, - 'delete': [8, 46] + delete: [8, 46], }; // KeyboardEvent.key aliases var keyNames = { // #7880: IE11 and Edge use `Esc` for Escape key name. - esc: ['Esc', 'Escape'], - tab: 'Tab', - enter: 'Enter', + esc: ["Esc", "Escape"], + tab: "Tab", + enter: "Enter", // #9112: IE11 uses `Spacebar` for Space key name. - space: [' ', 'Spacebar'], + space: [" ", "Spacebar"], // #7806: IE11 uses key names without `Arrow` prefix for arrow keys. - up: ['Up', 'ArrowUp'], - left: ['Left', 'ArrowLeft'], - right: ['Right', 'ArrowRight'], - down: ['Down', 'ArrowDown'], + up: ["Up", "ArrowUp"], + left: ["Left", "ArrowLeft"], + right: ["Right", "ArrowRight"], + down: ["Down", "ArrowDown"], // #9112: IE11 uses `Del` for Delete key name. - 'delete': ['Backspace', 'Delete', 'Del'] + delete: ["Backspace", "Delete", "Del"], }; // #4868: modifiers that prevent the execution of the listener // need to explicitly return null so that we can determine whether to remove // the listener for .once - var genGuard = function (condition) { return ("if(" + condition + ")return null;"); }; + var genGuard = function (condition) { + return "if(" + condition + ")return null;"; + }; var modifierCode = { - stop: '$event.stopPropagation();', - prevent: '$event.preventDefault();', + stop: "$event.stopPropagation();", + prevent: "$event.preventDefault();", self: genGuard("$event.target !== $event.currentTarget"), ctrl: genGuard("!$event.ctrlKey"), shift: genGuard("!$event.shiftKey"), @@ -10775,14 +11264,11 @@ meta: genGuard("!$event.metaKey"), left: genGuard("'button' in $event && $event.button !== 0"), middle: genGuard("'button' in $event && $event.button !== 1"), - right: genGuard("'button' in $event && $event.button !== 2") + right: genGuard("'button' in $event && $event.button !== 2"), }; - function genHandlers ( - events, - isNative - ) { - var prefix = isNative ? 'nativeOn:' : 'on:'; + function genHandlers(events, isNative) { + var prefix = isNative ? "nativeOn:" : "on:"; var staticHandlers = ""; var dynamicHandlers = ""; for (var name in events) { @@ -10790,38 +11276,59 @@ if (events[name] && events[name].dynamic) { dynamicHandlers += name + "," + handlerCode + ","; } else { - staticHandlers += "\"" + name + "\":" + handlerCode + ","; + staticHandlers += '"' + name + '":' + handlerCode + ","; } } - staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}"; + staticHandlers = "{" + staticHandlers.slice(0, -1) + "}"; if (dynamicHandlers) { - return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])" + return ( + prefix + + "_d(" + + staticHandlers + + ",[" + + dynamicHandlers.slice(0, -1) + + "])" + ); } else { - return prefix + staticHandlers + return prefix + staticHandlers; } } - function genHandler (handler) { + function genHandler(handler) { if (!handler) { - return 'function(){}' + return "function(){}"; } if (Array.isArray(handler)) { - return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]") + return ( + "[" + + handler + .map(function (handler) { + return genHandler(handler); + }) + .join(",") + + "]" + ); } var isMethodPath = simplePathRE.test(handler.value); var isFunctionExpression = fnExpRE.test(handler.value); - var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, '')); + var isFunctionInvocation = simplePathRE.test( + handler.value.replace(fnInvokeRE, "") + ); if (!handler.modifiers) { if (isMethodPath || isFunctionExpression) { - return handler.value + return handler.value; } - return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement + return ( + "function($event){" + + (isFunctionInvocation ? "return " + handler.value : handler.value) + + "}" + ); // inline statement } else { - var code = ''; - var genModifierCode = ''; + var code = ""; + var genModifierCode = ""; var keys = []; for (var key in handler.modifiers) { if (modifierCode[key]) { @@ -10830,13 +11337,17 @@ if (keyCodes[key]) { keys.push(key); } - } else if (key === 'exact') { - var modifiers = (handler.modifiers); + } else if (key === "exact") { + var modifiers = handler.modifiers; genModifierCode += genGuard( - ['ctrl', 'shift', 'alt', 'meta'] - .filter(function (keyModifier) { return !modifiers[keyModifier]; }) - .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); }) - .join('||') + ["ctrl", "shift", "alt", "meta"] + .filter(function (keyModifier) { + return !modifiers[keyModifier]; + }) + .map(function (keyModifier) { + return "$event." + keyModifier + "Key"; + }) + .join("||") ); } else { keys.push(key); @@ -10850,57 +11361,74 @@ code += genModifierCode; } var handlerCode = isMethodPath - ? ("return " + (handler.value) + "($event)") + ? "return " + handler.value + "($event)" : isFunctionExpression - ? ("return (" + (handler.value) + ")($event)") - : isFunctionInvocation - ? ("return " + (handler.value)) - : handler.value; - return ("function($event){" + code + handlerCode + "}") + ? "return (" + handler.value + ")($event)" + : isFunctionInvocation + ? "return " + handler.value + : handler.value; + return "function($event){" + code + handlerCode + "}"; } } - function genKeyFilter (keys) { + function genKeyFilter(keys) { return ( // make sure the key filters only apply to KeyboardEvents // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake // key events that do not have keyCode property... "if(!$event.type.indexOf('key')&&" + - (keys.map(genFilterCode).join('&&')) + ")return null;" - ) + keys.map(genFilterCode).join("&&") + + ")return null;" + ); } - function genFilterCode (key) { + function genFilterCode(key) { var keyVal = parseInt(key, 10); if (keyVal) { - return ("$event.keyCode!==" + keyVal) + return "$event.keyCode!==" + keyVal; } var keyCode = keyCodes[key]; var keyName = keyNames[key]; return ( "_k($event.keyCode," + - (JSON.stringify(key)) + "," + - (JSON.stringify(keyCode)) + "," + + JSON.stringify(key) + + "," + + JSON.stringify(keyCode) + + "," + "$event.key," + - "" + (JSON.stringify(keyName)) + + "" + + JSON.stringify(keyName) + ")" - ) + ); } /* */ - function on (el, dir) { + function on(el, dir) { if (dir.modifiers) { warn("v-on without argument does not support modifiers."); } - el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); }; + el.wrapListeners = function (code) { + return "_g(" + code + "," + dir.value + ")"; + }; } /* */ - function bind$1 (el, dir) { + function bind$1(el, dir) { el.wrapData = function (code) { - return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")") + return ( + "_b(" + + code + + ",'" + + el.tag + + "'," + + dir.value + + "," + + (dir.modifiers && dir.modifiers.prop ? "true" : "false") + + (dir.modifiers && dir.modifiers.sync ? ",true" : "") + + ")" + ); }; } @@ -10909,59 +11437,52 @@ var baseDirectives = { on: on, bind: bind$1, - cloak: noop + cloak: noop, }; /* */ - - - - - var CodegenState = function CodegenState (options) { + var CodegenState = function CodegenState(options) { this.options = options; this.warn = options.warn || baseWarn; - this.transforms = pluckModuleFunction(options.modules, 'transformCode'); - this.dataGenFns = pluckModuleFunction(options.modules, 'genData'); + this.transforms = pluckModuleFunction(options.modules, "transformCode"); + this.dataGenFns = pluckModuleFunction(options.modules, "genData"); this.directives = extend(extend({}, baseDirectives), options.directives); var isReservedTag = options.isReservedTag || no; - this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); }; + this.maybeComponent = function (el) { + return !!el.component || !isReservedTag(el.tag); + }; this.onceId = 0; this.staticRenderFns = []; this.pre = false; }; - - - function generate ( - ast, - options - ) { + function generate(ast, options) { var state = new CodegenState(options); var code = ast ? genElement(ast, state) : '_c("div")'; return { - render: ("with(this){return " + code + "}"), - staticRenderFns: state.staticRenderFns - } + render: "with(this){return " + code + "}", + staticRenderFns: state.staticRenderFns, + }; } - function genElement (el, state) { + function genElement(el, state) { if (el.parent) { el.pre = el.pre || el.parent.pre; } if (el.staticRoot && !el.staticProcessed) { - return genStatic(el, state) + return genStatic(el, state); } else if (el.once && !el.onceProcessed) { - return genOnce(el, state) + return genOnce(el, state); } else if (el.for && !el.forProcessed) { - return genFor(el, state) + return genFor(el, state); } else if (el.if && !el.ifProcessed) { - return genIf(el, state) - } else if (el.tag === 'template' && !el.slotTarget && !state.pre) { - return genChildren(el, state) || 'void 0' - } else if (el.tag === 'slot') { - return genSlot(el, state) + return genIf(el, state); + } else if (el.tag === "template" && !el.slotTarget && !state.pre) { + return genChildren(el, state) || "void 0"; + } else if (el.tag === "slot") { + return genSlot(el, state); } else { // component or element var code; @@ -10974,18 +11495,24 @@ } var children = el.inlineTemplate ? null : genChildren(el, state, true); - code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")"; + code = + "_c('" + + el.tag + + "'" + + (data ? "," + data : "") + + (children ? "," + children : "") + + ")"; } // module transforms for (var i = 0; i < state.transforms.length; i++) { code = state.transforms[i](el, code); } - return code + return code; } } // hoist static sub-trees out - function genStatic (el, state) { + function genStatic(el, state) { el.staticProcessed = true; // Some elements (templates) need to behave differently inside of a v-pre // node. All pre nodes are static roots, so we can use this as a location to @@ -10994,123 +11521,143 @@ if (el.pre) { state.pre = el.pre; } - state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}")); + state.staticRenderFns.push( + "with(this){return " + genElement(el, state) + "}" + ); state.pre = originalPreState; - return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")") + return ( + "_m(" + + (state.staticRenderFns.length - 1) + + (el.staticInFor ? ",true" : "") + + ")" + ); } // v-once - function genOnce (el, state) { + function genOnce(el, state) { el.onceProcessed = true; if (el.if && !el.ifProcessed) { - return genIf(el, state) + return genIf(el, state); } else if (el.staticInFor) { - var key = ''; + var key = ""; var parent = el.parent; while (parent) { if (parent.for) { key = parent.key; - break + break; } parent = parent.parent; } if (!key) { state.warn( "v-once can only be used inside v-for that is keyed. ", - el.rawAttrsMap['v-once'] + el.rawAttrsMap["v-once"] ); - return genElement(el, state) + return genElement(el, state); } - return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")") + return ( + "_o(" + genElement(el, state) + "," + state.onceId++ + "," + key + ")" + ); } else { - return genStatic(el, state) + return genStatic(el, state); } } - function genIf ( - el, - state, - altGen, - altEmpty - ) { + function genIf(el, state, altGen, altEmpty) { el.ifProcessed = true; // avoid recursion - return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty) + return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty); } - function genIfConditions ( - conditions, - state, - altGen, - altEmpty - ) { + function genIfConditions(conditions, state, altGen, altEmpty) { if (!conditions.length) { - return altEmpty || '_e()' + return altEmpty || "_e()"; } var condition = conditions.shift(); if (condition.exp) { - return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty))) + return ( + "(" + + condition.exp + + ")?" + + genTernaryExp(condition.block) + + ":" + + genIfConditions(conditions, state, altGen, altEmpty) + ); } else { - return ("" + (genTernaryExp(condition.block))) + return "" + genTernaryExp(condition.block); } // v-if with v-once should generate code like (a)?_m(0):_m(1) - function genTernaryExp (el) { + function genTernaryExp(el) { return altGen ? altGen(el, state) : el.once - ? genOnce(el, state) - : genElement(el, state) + ? genOnce(el, state) + : genElement(el, state); } } - function genFor ( - el, - state, - altGen, - altHelper - ) { + function genFor(el, state, altGen, altHelper) { var exp = el.for; var alias = el.alias; - var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : ''; - var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : ''; + var iterator1 = el.iterator1 ? "," + el.iterator1 : ""; + var iterator2 = el.iterator2 ? "," + el.iterator2 : ""; - if (state.maybeComponent(el) && - el.tag !== 'slot' && - el.tag !== 'template' && + if ( + state.maybeComponent(el) && + el.tag !== "slot" && + el.tag !== "template" && !el.key ) { state.warn( - "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " + - "v-for should have explicit keys. " + - "See https://vuejs.org/guide/list.html#key for more info.", - el.rawAttrsMap['v-for'], + "<" + + el.tag + + ' v-for="' + + alias + + " in " + + exp + + '">: component lists rendered with ' + + "v-for should have explicit keys. " + + "See https://vuejs.org/guide/list.html#key for more info.", + el.rawAttrsMap["v-for"], true /* tip */ ); } el.forProcessed = true; // avoid recursion - return (altHelper || '_l') + "((" + exp + ")," + - "function(" + alias + iterator1 + iterator2 + "){" + - "return " + ((altGen || genElement)(el, state)) + - '})' + return ( + (altHelper || "_l") + + "((" + + exp + + ")," + + "function(" + + alias + + iterator1 + + iterator2 + + "){" + + "return " + + (altGen || genElement)(el, state) + + "})" + ); } - function genData$2 (el, state) { - var data = '{'; + function genData$2(el, state) { + var data = "{"; // directives first. // directives may mutate the el's other properties before they are generated. var dirs = genDirectives(el, state); - if (dirs) { data += dirs + ','; } + if (dirs) { + data += dirs + ","; + } // key if (el.key) { - data += "key:" + (el.key) + ","; + data += "key:" + el.key + ","; } // ref if (el.ref) { - data += "ref:" + (el.ref) + ","; + data += "ref:" + el.ref + ","; } if (el.refInFor) { data += "refInFor:true,"; @@ -11121,7 +11668,7 @@ } // record original tag name for components using "is" attribute if (el.component) { - data += "tag:\"" + (el.tag) + "\","; + data += 'tag:"' + el.tag + '",'; } // module data generation functions for (var i = 0; i < state.dataGenFns.length; i++) { @@ -11129,31 +11676,38 @@ } // attributes if (el.attrs) { - data += "attrs:" + (genProps(el.attrs)) + ","; + data += "attrs:" + genProps(el.attrs) + ","; } // DOM props if (el.props) { - data += "domProps:" + (genProps(el.props)) + ","; + data += "domProps:" + genProps(el.props) + ","; } // event handlers if (el.events) { - data += (genHandlers(el.events, false)) + ","; + data += genHandlers(el.events, false) + ","; } if (el.nativeEvents) { - data += (genHandlers(el.nativeEvents, true)) + ","; + data += genHandlers(el.nativeEvents, true) + ","; } // slot target // only for non-scoped slots if (el.slotTarget && !el.slotScope) { - data += "slot:" + (el.slotTarget) + ","; + data += "slot:" + el.slotTarget + ","; } // scoped slots if (el.scopedSlots) { - data += (genScopedSlots(el, el.scopedSlots, state)) + ","; + data += genScopedSlots(el, el.scopedSlots, state) + ","; } // component v-model if (el.model) { - data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},"; + data += + "model:{value:" + + el.model.value + + ",callback:" + + el.model.callback + + ",expression:" + + el.model.expression + + "},"; } // inline-template if (el.inlineTemplate) { @@ -11162,12 +11716,13 @@ data += inlineTemplate + ","; } } - data = data.replace(/,$/, '') + '}'; + data = data.replace(/,$/, "") + "}"; // v-bind dynamic argument wrap // v-bind with dynamic arguments must be applied using the same v-bind object // merge helper so that class/style/mustUseProp attrs are handled correctly. if (el.dynamicAttrs) { - data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")"; + data = + "_b(" + data + ',"' + el.tag + '",' + genProps(el.dynamicAttrs) + ")"; } // v-bind data wrap if (el.wrapData) { @@ -11177,13 +11732,15 @@ if (el.wrapListeners) { data = el.wrapListeners(data); } - return data + return data; } - function genDirectives (el, state) { + function genDirectives(el, state) { var dirs = el.directives; - if (!dirs) { return } - var res = 'directives:['; + if (!dirs) { + return; + } + var res = "directives:["; var hasRuntime = false; var i, l, dir, needRuntime; for (i = 0, l = dirs.length; i < l; i++) { @@ -11197,46 +11754,70 @@ } if (needRuntime) { hasRuntime = true; - res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},"; + res += + '{name:"' + + dir.name + + '",rawName:"' + + dir.rawName + + '"' + + (dir.value + ? ",value:(" + + dir.value + + "),expression:" + + JSON.stringify(dir.value) + : "") + + (dir.arg + ? ",arg:" + (dir.isDynamicArg ? dir.arg : '"' + dir.arg + '"') + : "") + + (dir.modifiers ? ",modifiers:" + JSON.stringify(dir.modifiers) : "") + + "},"; } } if (hasRuntime) { - return res.slice(0, -1) + ']' + return res.slice(0, -1) + "]"; } } - function genInlineTemplate (el, state) { + function genInlineTemplate(el, state) { var ast = el.children[0]; if (el.children.length !== 1 || ast.type !== 1) { state.warn( - 'Inline-template components must have exactly one child element.', + "Inline-template components must have exactly one child element.", { start: el.start } ); } if (ast && ast.type === 1) { var inlineRenderFns = generate(ast, state.options); - return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}") + return ( + "inlineTemplate:{render:function(){" + + inlineRenderFns.render + + "},staticRenderFns:[" + + inlineRenderFns.staticRenderFns + .map(function (code) { + return "function(){" + code + "}"; + }) + .join(",") + + "]}" + ); } } - function genScopedSlots ( - el, - slots, - state - ) { + function genScopedSlots(el, slots, state) { // by default scoped slots are considered "stable", this allows child // components with only scoped slots to skip forced updates from parent. // but in some cases we have to bail-out of this optimization // for example if the slot contains dynamic names, has v-if or v-for on them... - var needsForceUpdate = el.for || Object.keys(slots).some(function (key) { - var slot = slots[key]; - return ( - slot.slotTargetDynamic || - slot.if || - slot.for || - containsSlotChild(slot) // is passing down slot from parent which may be dynamic - ) - }); + var needsForceUpdate = + el.for || + Object.keys(slots).some(function (key) { + var slot = slots[key]; + return ( + slot.slotTargetDynamic || + slot.if || + slot.for || + containsSlotChild(slot) // is passing down slot from parent which may be dynamic + ); + }); // #9534: if a component with scoped slots is inside a conditional branch, // it's possible for the same component to be reused but with different @@ -11257,7 +11838,7 @@ parent.for ) { needsForceUpdate = true; - break + break; } if (parent.if) { needsKey = true; @@ -11267,82 +11848,113 @@ } var generatedSlots = Object.keys(slots) - .map(function (key) { return genScopedSlot(slots[key], state); }) - .join(','); + .map(function (key) { + return genScopedSlot(slots[key], state); + }) + .join(","); - return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")") + return ( + "scopedSlots:_u([" + + generatedSlots + + "]" + + (needsForceUpdate ? ",null,true" : "") + + (!needsForceUpdate && needsKey + ? ",null,false," + hash(generatedSlots) + : "") + + ")" + ); } function hash(str) { var hash = 5381; var i = str.length; - while(i) { + while (i) { hash = (hash * 33) ^ str.charCodeAt(--i); } - return hash >>> 0 + return hash >>> 0; } - function containsSlotChild (el) { + function containsSlotChild(el) { if (el.type === 1) { - if (el.tag === 'slot') { - return true + if (el.tag === "slot") { + return true; } - return el.children.some(containsSlotChild) + return el.children.some(containsSlotChild); } - return false + return false; } - function genScopedSlot ( - el, - state - ) { - var isLegacySyntax = el.attrsMap['slot-scope']; + function genScopedSlot(el, state) { + var isLegacySyntax = el.attrsMap["slot-scope"]; if (el.if && !el.ifProcessed && !isLegacySyntax) { - return genIf(el, state, genScopedSlot, "null") + return genIf(el, state, genScopedSlot, "null"); } if (el.for && !el.forProcessed) { - return genFor(el, state, genScopedSlot) - } - var slotScope = el.slotScope === emptySlotScopeToken - ? "" - : String(el.slotScope); - var fn = "function(" + slotScope + "){" + - "return " + (el.tag === 'template' + return genFor(el, state, genScopedSlot); + } + var slotScope = + el.slotScope === emptySlotScopeToken ? "" : String(el.slotScope); + var fn = + "function(" + + slotScope + + "){" + + "return " + + (el.tag === "template" ? el.if && isLegacySyntax - ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined") - : genChildren(el, state) || 'undefined' - : genElement(el, state)) + "}"; + ? "(" + + el.if + + ")?" + + (genChildren(el, state) || "undefined") + + ":undefined" + : genChildren(el, state) || "undefined" + : genElement(el, state)) + + "}"; // reverse proxy v-slot without scope on this.$slots var reverseProxy = slotScope ? "" : ",proxy:true"; - return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}") + return ( + "{key:" + + (el.slotTarget || '"default"') + + ",fn:" + + fn + + reverseProxy + + "}" + ); } - function genChildren ( - el, - state, - checkSkip, - altGenElement, - altGenNode - ) { + function genChildren(el, state, checkSkip, altGenElement, altGenNode) { var children = el.children; if (children.length) { var el$1 = children[0]; // optimize single v-for - if (children.length === 1 && + if ( + children.length === 1 && el$1.for && - el$1.tag !== 'template' && - el$1.tag !== 'slot' + el$1.tag !== "template" && + el$1.tag !== "slot" ) { var normalizationType = checkSkip - ? state.maybeComponent(el$1) ? ",1" : ",0" + ? state.maybeComponent(el$1) + ? ",1" + : ",0" : ""; - return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType) + return ( + "" + (altGenElement || genElement)(el$1, state) + normalizationType + ); } var normalizationType$1 = checkSkip ? getNormalizationType(children, state.maybeComponent) : 0; var gen = altGenNode || genNode; - return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : '')) + return ( + "[" + + children + .map(function (c) { + return gen(c, state); + }) + .join(",") + + "]" + + (normalizationType$1 ? "," + normalizationType$1 : "") + ); } } @@ -11350,66 +11962,82 @@ // 0: no normalization needed // 1: simple normalization needed (possible 1-level deep nested array) // 2: full normalization needed - function getNormalizationType ( - children, - maybeComponent - ) { + function getNormalizationType(children, maybeComponent) { var res = 0; for (var i = 0; i < children.length; i++) { var el = children[i]; if (el.type !== 1) { - continue + continue; } - if (needsNormalization(el) || - (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) { + if ( + needsNormalization(el) || + (el.ifConditions && + el.ifConditions.some(function (c) { + return needsNormalization(c.block); + })) + ) { res = 2; - break + break; } - if (maybeComponent(el) || - (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) { + if ( + maybeComponent(el) || + (el.ifConditions && + el.ifConditions.some(function (c) { + return maybeComponent(c.block); + })) + ) { res = 1; } } - return res + return res; } - function needsNormalization (el) { - return el.for !== undefined || el.tag === 'template' || el.tag === 'slot' + function needsNormalization(el) { + return el.for !== undefined || el.tag === "template" || el.tag === "slot"; } - function genNode (node, state) { + function genNode(node, state) { if (node.type === 1) { - return genElement(node, state) + return genElement(node, state); } else if (node.type === 3 && node.isComment) { - return genComment(node) + return genComment(node); } else { - return genText(node) + return genText(node); } } - function genText (text) { - return ("_v(" + (text.type === 2 - ? text.expression // no need for () because already wrapped in _s() - : transformSpecialNewlines(JSON.stringify(text.text))) + ")") + function genText(text) { + return ( + "_v(" + + (text.type === 2 + ? text.expression // no need for () because already wrapped in _s() + : transformSpecialNewlines(JSON.stringify(text.text))) + + ")" + ); } - function genComment (comment) { - return ("_e(" + (JSON.stringify(comment.text)) + ")") + function genComment(comment) { + return "_e(" + JSON.stringify(comment.text) + ")"; } - function genSlot (el, state) { + function genSlot(el, state) { var slotName = el.slotName || '"default"'; var children = genChildren(el, state); - var res = "_t(" + slotName + (children ? ("," + children) : ''); - var attrs = el.attrs || el.dynamicAttrs - ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({ - // slot props are camelized - name: camelize(attr.name), - value: attr.value, - dynamic: attr.dynamic - }); })) - : null; - var bind$$1 = el.attrsMap['v-bind']; + var res = "_t(" + slotName + (children ? "," + children : ""); + var attrs = + el.attrs || el.dynamicAttrs + ? genProps( + (el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { + return { + // slot props are camelized + name: camelize(attr.name), + value: attr.value, + dynamic: attr.dynamic, + }; + }) + ) + : null; + var bind$$1 = el.attrsMap["v-bind"]; if ((attrs || bind$$1) && !children) { res += ",null"; } @@ -11417,90 +12045,103 @@ res += "," + attrs; } if (bind$$1) { - res += (attrs ? '' : ',null') + "," + bind$$1; + res += (attrs ? "" : ",null") + "," + bind$$1; } - return res + ')' + return res + ")"; } // componentName is el.component, take it as argument to shun flow's pessimistic refinement - function genComponent ( - componentName, - el, - state - ) { + function genComponent(componentName, el, state) { var children = el.inlineTemplate ? null : genChildren(el, state, true); - return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")") + return ( + "_c(" + + componentName + + "," + + genData$2(el, state) + + (children ? "," + children : "") + + ")" + ); } - function genProps (props) { + function genProps(props) { var staticProps = ""; var dynamicProps = ""; for (var i = 0; i < props.length; i++) { var prop = props[i]; var value = transformSpecialNewlines(prop.value); if (prop.dynamic) { - dynamicProps += (prop.name) + "," + value + ","; + dynamicProps += prop.name + "," + value + ","; } else { - staticProps += "\"" + (prop.name) + "\":" + value + ","; + staticProps += '"' + prop.name + '":' + value + ","; } } - staticProps = "{" + (staticProps.slice(0, -1)) + "}"; + staticProps = "{" + staticProps.slice(0, -1) + "}"; if (dynamicProps) { - return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])") + return "_d(" + staticProps + ",[" + dynamicProps.slice(0, -1) + "])"; } else { - return staticProps + return staticProps; } } // #3895, #4268 - function transformSpecialNewlines (text) { - return text - .replace(/\u2028/g, '\\u2028') - .replace(/\u2029/g, '\\u2029') + function transformSpecialNewlines(text) { + return text.replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); } /* */ - - // these keywords should not appear inside expressions, but operators like // typeof, instanceof and in are allowed - var prohibitedKeywordRE = new RegExp('\\b' + ( - 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' + - 'super,throw,while,yield,delete,export,import,return,switch,default,' + - 'extends,finally,continue,debugger,function,arguments' - ).split(',').join('\\b|\\b') + '\\b'); + var prohibitedKeywordRE = new RegExp( + "\\b" + + ( + "do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const," + + "super,throw,while,yield,delete,export,import,return,switch,default," + + "extends,finally,continue,debugger,function,arguments" + ) + .split(",") + .join("\\b|\\b") + + "\\b" + ); // these unary operators should not be used as property/method names - var unaryOperatorsRE = new RegExp('\\b' + ( - 'delete,typeof,void' - ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); + var unaryOperatorsRE = new RegExp( + "\\b" + + "delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b") + + "\\s*\\([^\\)]*\\)" + ); // strip strings in expressions - var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; + var stripStringRE = + /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; // detect problematic expressions in a template - function detectErrors (ast, warn) { + function detectErrors(ast, warn) { if (ast) { checkNode(ast, warn); } } - function checkNode (node, warn) { + function checkNode(node, warn) { if (node.type === 1) { for (var name in node.attrsMap) { if (dirRE.test(name)) { var value = node.attrsMap[name]; if (value) { var range = node.rawAttrsMap[name]; - if (name === 'v-for') { - checkFor(node, ("v-for=\"" + value + "\""), warn, range); - } else if (name === 'v-slot' || name[0] === '#') { - checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range); + if (name === "v-for") { + checkFor(node, 'v-for="' + value + '"', warn, range); + } else if (name === "v-slot" || name[0] === "#") { + checkFunctionParameterExpression( + value, + name + '="' + value + '"', + warn, + range + ); } else if (onRE.test(name)) { - checkEvent(value, (name + "=\"" + value + "\""), warn, range); + checkEvent(value, name + '="' + value + '"', warn, range); } else { - checkExpression(value, (name + "=\"" + value + "\""), warn, range); + checkExpression(value, name + '="' + value + '"', warn, range); } } } @@ -11515,72 +12156,89 @@ } } - function checkEvent (exp, text, warn, range) { - var stripped = exp.replace(stripStringRE, ''); + function checkEvent(exp, text, warn, range) { + var stripped = exp.replace(stripStringRE, ""); var keywordMatch = stripped.match(unaryOperatorsRE); - if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') { + if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== "$") { warn( "avoid using JavaScript unary operator as property name: " + - "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), + '"' + + keywordMatch[0] + + '" in expression ' + + text.trim(), range ); } checkExpression(exp, text, warn, range); } - function checkFor (node, text, warn, range) { - checkExpression(node.for || '', text, warn, range); - checkIdentifier(node.alias, 'v-for alias', text, warn, range); - checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range); - checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range); + function checkFor(node, text, warn, range) { + checkExpression(node.for || "", text, warn, range); + checkIdentifier(node.alias, "v-for alias", text, warn, range); + checkIdentifier(node.iterator1, "v-for iterator", text, warn, range); + checkIdentifier(node.iterator2, "v-for iterator", text, warn, range); } - function checkIdentifier ( - ident, - type, - text, - warn, - range - ) { - if (typeof ident === 'string') { + function checkIdentifier(ident, type, text, warn, range) { + if (typeof ident === "string") { try { - new Function(("var " + ident + "=_")); + new Function("var " + ident + "=_"); } catch (e) { - warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range); + warn( + "invalid " + type + ' "' + ident + '" in expression: ' + text.trim(), + range + ); } } } - function checkExpression (exp, text, warn, range) { + function checkExpression(exp, text, warn, range) { try { - new Function(("return " + exp)); + new Function("return " + exp); } catch (e) { - var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE); + var keywordMatch = exp + .replace(stripStringRE, "") + .match(prohibitedKeywordRE); if (keywordMatch) { warn( "avoid using JavaScript keyword as property name: " + - "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()), + '"' + + keywordMatch[0] + + '"\n Raw expression: ' + + text.trim(), range ); } else { warn( - "invalid expression: " + (e.message) + " in\n\n" + - " " + exp + "\n\n" + - " Raw expression: " + (text.trim()) + "\n", + "invalid expression: " + + e.message + + " in\n\n" + + " " + + exp + + "\n\n" + + " Raw expression: " + + text.trim() + + "\n", range ); } } } - function checkFunctionParameterExpression (exp, text, warn, range) { + function checkFunctionParameterExpression(exp, text, warn, range) { try { - new Function(exp, ''); + new Function(exp, ""); } catch (e) { warn( - "invalid function parameter expression: " + (e.message) + " in\n\n" + - " " + exp + "\n\n" + - " Raw expression: " + (text.trim()) + "\n", + "invalid function parameter expression: " + + e.message + + " in\n\n" + + " " + + exp + + "\n\n" + + " Raw expression: " + + text.trim() + + "\n", range ); } @@ -11590,13 +12248,9 @@ var range = 2; - function generateCodeFrame ( - source, - start, - end - ) { - if ( start === void 0 ) start = 0; - if ( end === void 0 ) end = source.length; + function generateCodeFrame(source, start, end) { + if (start === void 0) start = 0; + if (end === void 0) end = source.length; var lines = source.split(/\r?\n/); var count = 0; @@ -11605,8 +12259,16 @@ count += lines[i].length + 1; if (count >= start) { for (var j = i - range; j <= i + range || end > count; j++) { - if (j < 0 || j >= lines.length) { continue } - res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j]))); + if (j < 0 || j >= lines.length) { + continue; + } + res.push( + "" + + (j + 1) + + repeat$1(" ", 3 - String(j + 1).length) + + "| " + + lines[j] + ); var lineLength = lines[j].length; if (j === i) { // push underline @@ -11621,46 +12283,45 @@ count += lineLength + 1; } } - break + break; } } - return res.join('\n') + return res.join("\n"); } - function repeat$1 (str, n) { - var result = ''; + function repeat$1(str, n) { + var result = ""; if (n > 0) { - while (true) { // eslint-disable-line - if (n & 1) { result += str; } + while (true) { + // eslint-disable-line + if (n & 1) { + result += str; + } n >>>= 1; - if (n <= 0) { break } + if (n <= 0) { + break; + } str += str; } } - return result + return result; } /* */ - - - function createFunction (code, errors) { + function createFunction(code, errors) { try { - return new Function(code) + return new Function(code); } catch (err) { errors.push({ err: err, code: code }); - return noop + return noop; } } - function createCompileToFunctionFn (compile) { + function createCompileToFunctionFn(compile) { var cache = Object.create(null); - return function compileToFunctions ( - template, - options, - vm - ) { + return function compileToFunctions(template, options, vm) { options = extend({}, options); var warn$$1 = options.warn || warn; delete options.warn; @@ -11669,15 +12330,15 @@ { // detect possible CSP restriction try { - new Function('return 1'); + new Function("return 1"); } catch (e) { if (e.toString().match(/unsafe-eval|CSP/)) { warn$$1( - 'It seems you are using the standalone build of Vue.js in an ' + - 'environment with Content Security Policy that prohibits unsafe-eval. ' + - 'The template compiler cannot work in this environment. Consider ' + - 'relaxing the policy to allow unsafe-eval or pre-compiling your ' + - 'templates into render functions.' + "It seems you are using the standalone build of Vue.js in an " + + "environment with Content Security Policy that prohibits unsafe-eval. " + + "The template compiler cannot work in this environment. Consider " + + "relaxing the policy to allow unsafe-eval or pre-compiling your " + + "templates into render functions." ); } } @@ -11688,7 +12349,7 @@ ? String(options.delimiters) + template : template; if (cache[key]) { - return cache[key] + return cache[key]; } // compile @@ -11700,24 +12361,37 @@ if (options.outputSourceRange) { compiled.errors.forEach(function (e) { warn$$1( - "Error compiling template:\n\n" + (e.msg) + "\n\n" + - generateCodeFrame(template, e.start, e.end), + "Error compiling template:\n\n" + + e.msg + + "\n\n" + + generateCodeFrame(template, e.start, e.end), vm ); }); } else { warn$$1( - "Error compiling template:\n\n" + template + "\n\n" + - compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n', + "Error compiling template:\n\n" + + template + + "\n\n" + + compiled.errors + .map(function (e) { + return "- " + e; + }) + .join("\n") + + "\n", vm ); } } if (compiled.tips && compiled.tips.length) { if (options.outputSourceRange) { - compiled.tips.forEach(function (e) { return tip(e.msg, vm); }); + compiled.tips.forEach(function (e) { + return tip(e.msg, vm); + }); } else { - compiled.tips.forEach(function (msg) { return tip(msg, vm); }); + compiled.tips.forEach(function (msg) { + return tip(msg, vm); + }); } } } @@ -11727,7 +12401,7 @@ var fnGenErrors = []; res.render = createFunction(compiled.render, fnGenErrors); res.staticRenderFns = compiled.staticRenderFns.map(function (code) { - return createFunction(code, fnGenErrors) + return createFunction(code, fnGenErrors); }); // check function generation errors. @@ -11735,32 +12409,34 @@ // mostly for codegen development use /* istanbul ignore if */ { - if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) { + if ( + (!compiled.errors || !compiled.errors.length) && + fnGenErrors.length + ) { warn$$1( "Failed to generate render function:\n\n" + - fnGenErrors.map(function (ref) { - var err = ref.err; - var code = ref.code; - - return ((err.toString()) + " in\n\n" + code + "\n"); - }).join('\n'), + fnGenErrors + .map(function (ref) { + var err = ref.err; + var code = ref.code; + + return err.toString() + " in\n\n" + code + "\n"; + }) + .join("\n"), vm ); } } - return (cache[key] = res) - } + return (cache[key] = res); + }; } /* */ - function createCompilerCreator (baseCompile) { - return function createCompiler (baseOptions) { - function compile ( - template, - options - ) { + function createCompilerCreator(baseCompile) { + return function createCompiler(baseOptions) { + function compile(template, options) { var finalOptions = Object.create(baseOptions); var errors = []; var tips = []; @@ -11789,8 +12465,9 @@ } // merge custom modules if (options.modules) { - finalOptions.modules = - (baseOptions.modules || []).concat(options.modules); + finalOptions.modules = (baseOptions.modules || []).concat( + options.modules + ); } // merge custom directives if (options.directives) { @@ -11801,7 +12478,7 @@ } // copy other options for (var key in options) { - if (key !== 'modules' && key !== 'directives') { + if (key !== "modules" && key !== "directives") { finalOptions[key] = options[key]; } } @@ -11815,14 +12492,14 @@ } compiled.errors = errors; compiled.tips = tips; - return compiled + return compiled; } return { compile: compile, - compileToFunctions: createCompileToFunctionFn(compile) - } - } + compileToFunctions: createCompileToFunctionFn(compile), + }; + }; } /* */ @@ -11830,7 +12507,7 @@ // `createCompilerCreator` allows creating compilers that use alternative // parser/optimizer/codegen, e.g the SSR optimizing compiler. // Here we just export a default compiler using the default parts. - var createCompiler = createCompilerCreator(function baseCompile ( + var createCompiler = createCompilerCreator(function baseCompile( template, options ) { @@ -11842,8 +12519,8 @@ return { ast: ast, render: code.render, - staticRenderFns: code.staticRenderFns - } + staticRenderFns: code.staticRenderFns, + }; }); /* */ @@ -11856,10 +12533,10 @@ // check whether current browser encodes a char inside attribute values var div; - function getShouldDecode (href) { - div = div || document.createElement('div'); - div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>"; - return div.innerHTML.indexOf(' ') > 0 + function getShouldDecode(href) { + div = div || document.createElement("div"); + div.innerHTML = href ? '<a href="\n"/>' : '<div a="\n"/>'; + return div.innerHTML.indexOf(" ") > 0; } // #3663: IE encodes newlines inside attribute values while other browsers don't @@ -11871,14 +12548,11 @@ var idToTemplate = cached(function (id) { var el = query(id); - return el && el.innerHTML + return el && el.innerHTML; }); var mount = Vue.prototype.$mount; - Vue.prototype.$mount = function ( - el, - hydrating - ) { + Vue.prototype.$mount = function (el, hydrating) { el = el && query(el); /* istanbul ignore if */ @@ -11886,7 +12560,7 @@ warn( "Do not mount Vue to <html> or <body> - mount to normal elements instead." ); - return this + return this; } var options = this.$options; @@ -11894,13 +12568,13 @@ if (!options.render) { var template = options.template; if (template) { - if (typeof template === 'string') { - if (template.charAt(0) === '#') { + if (typeof template === "string") { + if (template.charAt(0) === "#") { template = idToTemplate(template); /* istanbul ignore if */ if (!template) { warn( - ("Template element not found or is empty: " + (options.template)), + "Template element not found or is empty: " + options.template, this ); } @@ -11909,9 +12583,9 @@ template = template.innerHTML; } else { { - warn('invalid template option:' + template, this); + warn("invalid template option:" + template, this); } - return this + return this; } } else if (el) { template = getOuterHTML(el); @@ -11919,16 +12593,20 @@ if (template) { /* istanbul ignore if */ if (config.performance && mark) { - mark('compile'); + mark("compile"); } - var ref = compileToFunctions(template, { - outputSourceRange: "development" !== 'production', - shouldDecodeNewlines: shouldDecodeNewlines, - shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref, - delimiters: options.delimiters, - comments: options.comments - }, this); + var ref = compileToFunctions( + template, + { + outputSourceRange: "development" !== "production", + shouldDecodeNewlines: shouldDecodeNewlines, + shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref, + delimiters: options.delimiters, + comments: options.comments, + }, + this + ); var render = ref.render; var staticRenderFns = ref.staticRenderFns; options.render = render; @@ -11936,30 +12614,29 @@ /* istanbul ignore if */ if (config.performance && mark) { - mark('compile end'); - measure(("vue " + (this._name) + " compile"), 'compile', 'compile end'); + mark("compile end"); + measure("vue " + this._name + " compile", "compile", "compile end"); } } } - return mount.call(this, el, hydrating) + return mount.call(this, el, hydrating); }; /** * Get outerHTML of elements, taking care * of SVG elements in IE as well. */ - function getOuterHTML (el) { + function getOuterHTML(el) { if (el.outerHTML) { - return el.outerHTML + return el.outerHTML; } else { - var container = document.createElement('div'); + var container = document.createElement("div"); container.appendChild(el.cloneNode(true)); - return container.innerHTML + return container.innerHTML; } } Vue.compile = compileToFunctions; return Vue; - -})); +}); diff --git a/notemyprogress/lang/en/local_notemyprogress.php b/notemyprogress/lang/en/local_notemyprogress.php index f1c2e8ceaa951e6fc3f9306450c95ce71cbca924..9180c8f4db7091658fb591f991985697d3b6d99e 100644 --- a/notemyprogress/lang/en/local_notemyprogress.php +++ b/notemyprogress/lang/en/local_notemyprogress.php @@ -37,12 +37,12 @@ $string['helplabel'] = 'Help'; $string['exitbutton'] = 'OK!'; $string['no_data'] = 'There is no data to display'; $string['only_student'] = 'This report is for students only'; -$string["fml_send_mail"] = "(Click to send an e-mail)"; -$string["fml_about"] = "About this chart"; -$string["fml_about_table"] = "About this table"; -$string["fml_not_configured"] = "Not configured"; -$string["fml_activated"] = "Activated"; -$string["fml_disabled"] = "Disabled"; +$string["nmp_send_mail"] = "(Click to send an e-mail)"; +$string["nmp_about"] = "About this chart"; +$string["nmp_about_table"] = "About this table"; +$string["nmp_not_configured"] = "Not configured"; +$string["nmp_activated"] = "Activated"; +$string["nmp_disabled"] = "Disabled"; /* Menu */ $string['menu_main_title'] = "Progression of the scoreboard"; @@ -134,77 +134,77 @@ $string['plugin_hidden'] = 'Hidden reports.'; $string['title_conditions'] = 'Terms of use '; /* Heure */ -$string['fml_mon'] = 'Monday'; -$string['fml_tue'] = 'Tuesday'; -$string['fml_wed'] = 'Wednesday'; -$string['fml_thu'] = 'Thursday'; -$string['fml_fri'] = 'Friday'; -$string['fml_sat'] = 'Saturday'; -$string['fml_sun'] = 'Sunday'; -$string['fml_mon_short'] = 'Mon'; -$string['fml_tue_short'] = 'Tue'; -$string['fml_wed_short'] = 'Wed'; -$string['fml_thu_short'] = 'Thu'; -$string['fml_fri_short'] = 'Fri'; -$string['fml_sat_short'] = 'Sat'; -$string['fml_sun_short'] = 'Sun'; - -$string['fml_jan'] = 'January'; -$string['fml_feb'] = 'February'; -$string['fml_mar'] = 'March'; -$string['fml_apr'] = 'April'; -$string['fml_may'] = 'May'; -$string['fml_jun'] = 'June'; -$string['fml_jul'] = 'July'; -$string['fml_aug'] = 'August'; -$string['fml_sep'] = 'September'; -$string['fml_oct'] = 'October'; -$string['fml_nov'] = 'November'; -$string['fml_dec'] = 'December'; -$string['fml_jan_short'] = 'Jan'; -$string['fml_feb_short'] = 'Feb'; -$string['fml_mar_short'] = 'Mar'; -$string['fml_apr_short'] = 'Apr'; -$string['fml_may_short'] = 'May'; -$string['fml_jun_short'] = 'Jun'; -$string['fml_jul_short'] = 'Jul'; -$string['fml_aug_short'] = 'Aug'; -$string['fml_sep_short'] = 'Sep'; -$string['fml_oct_short'] = 'Oct'; -$string['fml_nov_short'] = 'Nov'; -$string['fml_dec_short'] = 'Dec'; - -$string['fml_week1'] = 'Week 1'; -$string['fml_week2'] = 'Week 2'; -$string['fml_week3'] = 'Week 3'; -$string['fml_week4'] = 'Week 4'; -$string['fml_week5'] = 'Week 5'; -$string['fml_week6'] = 'Week 6'; - -$string['fml_00'] = '12:00am'; -$string['fml_01'] = '01:00am'; -$string['fml_02'] = '02:00am'; -$string['fml_03'] = '03:00am'; -$string['fml_04'] = '04:00am'; -$string['fml_05'] = '05:00am'; -$string['fml_06'] = '06:00am'; -$string['fml_07'] = '07:00am'; -$string['fml_08'] = '08:00am'; -$string['fml_09'] = '09:00am'; -$string['fml_10'] = '10:00am'; -$string['fml_11'] = '11:00am'; -$string['fml_12'] = '12:00pm'; -$string['fml_13'] = '01:00pm'; -$string['fml_14'] = '02:00pm'; -$string['fml_15'] = '03:00pm'; -$string['fml_16'] = '04:00pm'; -$string['fml_17'] = '05:00pm'; -$string['fml_18'] = '06:00pm'; -$string['fml_19'] = '07:00pm'; -$string['fml_20'] = '08:00pm'; -$string['fml_21'] = '09:00pm'; -$string['fml_22'] = '10:00pm'; -$string['fml_23'] = '11:00pm'; +$string['nmp_mon'] = 'Monday'; +$string['nmp_tue'] = 'Tuesday'; +$string['nmp_wed'] = 'Wednesday'; +$string['nmp_thu'] = 'Thursday'; +$string['nmp_fri'] = 'Friday'; +$string['nmp_sat'] = 'Saturday'; +$string['nmp_sun'] = 'Sunday'; +$string['nmp_mon_short'] = 'Mon'; +$string['nmp_tue_short'] = 'Tue'; +$string['nmp_wed_short'] = 'Wed'; +$string['nmp_thu_short'] = 'Thu'; +$string['nmp_fri_short'] = 'Fri'; +$string['nmp_sat_short'] = 'Sat'; +$string['nmp_sun_short'] = 'Sun'; + +$string['nmp_jan'] = 'January'; +$string['nmp_feb'] = 'February'; +$string['nmp_mar'] = 'March'; +$string['nmp_apr'] = 'April'; +$string['nmp_may'] = 'May'; +$string['nmp_jun'] = 'June'; +$string['nmp_jul'] = 'July'; +$string['nmp_aug'] = 'August'; +$string['nmp_sep'] = 'September'; +$string['nmp_oct'] = 'October'; +$string['nmp_nov'] = 'November'; +$string['nmp_dec'] = 'December'; +$string['nmp_jan_short'] = 'Jan'; +$string['nmp_feb_short'] = 'Feb'; +$string['nmp_mar_short'] = 'Mar'; +$string['nmp_apr_short'] = 'Apr'; +$string['nmp_may_short'] = 'May'; +$string['nmp_jun_short'] = 'Jun'; +$string['nmp_jul_short'] = 'Jul'; +$string['nmp_aug_short'] = 'Aug'; +$string['nmp_sep_short'] = 'Sep'; +$string['nmp_oct_short'] = 'Oct'; +$string['nmp_nov_short'] = 'Nov'; +$string['nmp_dec_short'] = 'Dec'; + +$string['nmp_week1'] = 'Week 1'; +$string['nmp_week2'] = 'Week 2'; +$string['nmp_week3'] = 'Week 3'; +$string['nmp_week4'] = 'Week 4'; +$string['nmp_week5'] = 'Week 5'; +$string['nmp_week6'] = 'Week 6'; + +$string['nmp_00'] = '12:00am'; +$string['nmp_01'] = '01:00am'; +$string['nmp_02'] = '02:00am'; +$string['nmp_03'] = '03:00am'; +$string['nmp_04'] = '04:00am'; +$string['nmp_05'] = '05:00am'; +$string['nmp_06'] = '06:00am'; +$string['nmp_07'] = '07:00am'; +$string['nmp_08'] = '08:00am'; +$string['nmp_09'] = '09:00am'; +$string['nmp_10'] = '10:00am'; +$string['nmp_11'] = '11:00am'; +$string['nmp_12'] = '12:00pm'; +$string['nmp_13'] = '01:00pm'; +$string['nmp_14'] = '02:00pm'; +$string['nmp_15'] = '03:00pm'; +$string['nmp_16'] = '04:00pm'; +$string['nmp_17'] = '05:00pm'; +$string['nmp_18'] = '06:00pm'; +$string['nmp_19'] = '07:00pm'; +$string['nmp_20'] = '08:00pm'; +$string['nmp_21'] = '09:00pm'; +$string['nmp_22'] = '10:00pm'; +$string['nmp_23'] = '11:00pm'; /* Enseignant général */ $string['tg_section_help_title'] = 'Global indicators'; @@ -218,7 +218,7 @@ $string['tg_week_sessions_help_description_p2'] = 'On the x-axis of the graph ar $string['tg_progress_table_help_title'] = 'Student progress'; $string['tg_progress_table_help_description'] = 'This table shows a list of all students enrolled in the course together with their progress, number of sessions and time spent. For the calculation of the progress all the resources of the course have been considered except for those of type <i>Label</i>. To determine whether a student has completed a resource, the first step is to check whether the resource has the completeness setting enabled. If so, we look to see if the student has already completed the activity based on that setting. Otherwise, the activity is considered complete if the student has viewed it at least once. '; -$string['fml_title'] = 'Work sessions'; +$string['nmp_title'] = 'Work sessions'; $string['table_title'] = 'Course progress'; $string['thead_name'] = 'First name'; $string['thead_lastname'] = 'Last name'; @@ -227,25 +227,25 @@ $string['thead_progress'] = 'Progression (%)'; $string['thead_sessions'] = 'Sessions'; $string['thead_time'] = 'Time invested'; -$string['fml_module_label'] = 'ressource'; -$string['fml_modules_label'] = 'ressources'; -$string['fml_of_conector'] = 'of'; -$string['fml_finished_label'] = 'finished'; -$string['fml_finisheds_label'] = 'finished'; +$string['nmp_module_label'] = 'ressource'; +$string['nmp_modules_label'] = 'ressources'; +$string['nmp_of_conector'] = 'of'; +$string['nmp_finished_label'] = 'finished'; +$string['nmp_finisheds_label'] = 'finished'; -$string['fml_smaller30'] = 'Under 30 minutes'; -$string['fml_greater30'] = 'Over 30 minutes'; -$string['fml_greater60'] = 'Over 60 minutes'; +$string['nmp_smaller30'] = 'Under 30 minutes'; +$string['nmp_greater30'] = 'Over 30 minutes'; +$string['nmp_greater60'] = 'Over 60 minutes'; -$string['fml_session_count_title'] = 'Sessions of the week'; -$string['fml_session_count_yaxis_title'] = 'Number of Sessions'; -$string['fml_session_count_tooltip_suffix'] = ' sessions'; +$string['nmp_session_count_title'] = 'Sessions of the week'; +$string['nmp_session_count_yaxis_title'] = 'Number of Sessions'; +$string['nmp_session_count_tooltip_suffix'] = ' sessions'; -$string['fml_hours_sessions_title'] = 'Sessions by day and time'; -$string['fml_weeks_sessions_title'] = 'Sessions per week'; +$string['nmp_hours_sessions_title'] = 'Sessions by day and time'; +$string['nmp_weeks_sessions_title'] = 'Sessions per week'; -$string["fml_session_text"] = "session"; -$string["fml_sessions_text"] = "sessions"; +$string["nmp_session_text"] = "session"; +$string["nmp_sessions_text"] = "sessions"; $string['ss_change_timezone'] = 'Timezone:'; // $string['ss_activity_inside_plataform_student'] = 'Mon activité sur la plateforme'; @@ -270,28 +270,28 @@ $string['ts_sessions_count_help_title'] = 'Sessions of the Week'; $string['ts_sessions_count_help_description_p1'] = 'This graph shows the number of sessions classified by their duration in time ranges: less than 30 minutes, more than 30 minutes and more than 60 minutes. The student\'s access to the course is considered as the start of a study session. A session is considered finished when the time elapsed between two student interactions exceeds 30 minutes.'; $string['ts_sessions_count_help_description_p2'] = 'On the x-axis of the graph are the days of the configured week. On the y-axis is the number of sessions held.'; -$string['fml_time_inverted_title'] = 'Time invested by students'; -$string['fml_time_inverted_x_axis'] = 'Number of hours'; -$string['fml_inverted_time'] = 'Average time invested'; -$string['fml_expected_time'] = 'Average time to invest'; - -$string['fml_year'] = 'year'; -$string['fml_years'] = 'years'; -$string['fml_month'] = 'month'; -$string['fml_months'] = 'months'; -$string['fml_day'] = 'day'; -$string['fml_days'] = 'days'; -$string['fml_hour'] = 'hour'; -$string['fml_hours'] = 'hours'; -$string['fml_hours_short'] = 'h'; -$string['fml_minute'] = 'minute'; -$string['fml_minutes'] = 'minutes'; -$string['fml_minutes_short'] = 'm'; -$string['fml_second'] = 'second'; -$string['fml_seconds'] = 'seconds'; -$string['fml_seconds_short'] = 's'; -$string['fml_ago'] = 'ago'; -$string['fml_now'] = 'now'; +$string['nmp_time_inverted_title'] = 'Time invested by students'; +$string['nmp_time_inverted_x_axis'] = 'Number of hours'; +$string['nmp_inverted_time'] = 'Average time invested'; +$string['nmp_expected_time'] = 'Average time to invest'; + +$string['nmp_year'] = 'year'; +$string['nmp_years'] = 'years'; +$string['nmp_month'] = 'month'; +$string['nmp_months'] = 'months'; +$string['nmp_day'] = 'day'; +$string['nmp_days'] = 'days'; +$string['nmp_hour'] = 'hour'; +$string['nmp_hours'] = 'hours'; +$string['nmp_hours_short'] = 'h'; +$string['nmp_minute'] = 'minute'; +$string['nmp_minutes'] = 'minutes'; +$string['nmp_minutes_short'] = 'm'; +$string['nmp_second'] = 'second'; +$string['nmp_seconds'] = 'seconds'; +$string['nmp_seconds_short'] = 's'; +$string['nmp_ago'] = 'ago'; +$string['nmp_now'] = 'now'; /*Devoirs des enseignants */ @@ -305,91 +305,91 @@ $string['ta_access_content_help_description_p1'] = 'This graph shows the number $string['ta_access_content_help_description_p2'] = 'The x-axis of the graph shows the number of students enrolled in the course. The y-axis of the graph shows the section resources assigned for the week. In addition, this graph allows you to send an email to students who have accessed the resource or to those who have not by clicking on the graph. '; /* Assign Submissions */ -$string['fml_intime_sub'] = 'Assignment submitted on time'; -$string['fml_late_sub'] = 'Late submission of assignments.'; -$string['fml_no_sub'] = 'Assignment not submitted'; -$string['fml_assign_nodue'] = 'No deadline'; -$string['fml_assignsubs_title'] = 'Follow-up of submitted assignments in the deposit areas'; -$string['fml_assignsubs_yaxis'] = 'Number of students'; +$string['nmp_intime_sub'] = 'Assignment submitted on time'; +$string['nmp_late_sub'] = 'Late submission of assignments.'; +$string['nmp_no_sub'] = 'Assignment not submitted'; +$string['nmp_assign_nodue'] = 'No deadline'; +$string['nmp_assignsubs_title'] = 'Follow-up of submitted assignments in the deposit areas'; +$string['nmp_assignsubs_yaxis'] = 'Number of students'; /* Accès au contenu */ -$string['fml_assign'] = 'Assign'; -$string['fml_assignment'] = 'Assignment'; -$string['fml_attendance'] = 'Attendance'; -$string['fml_book'] = 'Book'; -$string['fml_chat'] = 'Chat'; -$string['fml_choice'] = 'Choice'; -$string['fml_data'] = 'Database'; -$string['fml_feedback'] = 'Feedback'; -$string['fml_folder'] = 'Folder'; -$string['fml_forum'] = 'Forum'; -$string['fml_glossary'] = 'Glossary'; -$string['fml_h5pactivity'] = 'H5P'; -$string['fml_imscp'] = 'IMS Content'; -$string['fml_label'] = 'Label'; -$string['fml_lesson'] = 'Lesson'; -$string['fml_lti'] = 'LTI Content'; -$string['fml_page'] = 'Page'; -$string['fml_quiz'] = 'Quiz'; -$string['fml_resource'] = 'Resource'; -$string['fml_scorm'] = 'Package SCORM'; -$string['fml_survey'] = 'Survey'; -$string['fml_url'] = 'Url'; -$string['fml_wiki'] = 'Wiki'; -$string['fml_workshop'] = 'Workshop'; - -$string['fml_access'] = 'Accessed'; -$string['fml_no_access'] = 'No access'; -$string['fml_access_chart_title'] = 'Access to the course content'; -$string['fml_access_chart_yaxis_label'] = 'Number of students'; -$string['fml_access_chart_suffix'] = 'students'; +$string['nmp_assign'] = 'Assign'; +$string['nmp_assignment'] = 'Assignment'; +$string['nmp_attendance'] = 'Attendance'; +$string['nmp_book'] = 'Book'; +$string['nmp_chat'] = 'Chat'; +$string['nmp_choice'] = 'Choice'; +$string['nmp_data'] = 'Database'; +$string['nmp_feedback'] = 'Feedback'; +$string['nmp_folder'] = 'Folder'; +$string['nmp_forum'] = 'Forum'; +$string['nmp_glossary'] = 'Glossary'; +$string['nmp_h5pactivity'] = 'H5P'; +$string['nmp_imscp'] = 'IMS Content'; +$string['nmp_label'] = 'Label'; +$string['nmp_lesson'] = 'Lesson'; +$string['nmp_lti'] = 'LTI Content'; +$string['nmp_page'] = 'Page'; +$string['nmp_quiz'] = 'Quiz'; +$string['nmp_resource'] = 'Resource'; +$string['nmp_scorm'] = 'Package SCORM'; +$string['nmp_survey'] = 'Survey'; +$string['nmp_url'] = 'Url'; +$string['nmp_wiki'] = 'Wiki'; +$string['nmp_workshop'] = 'Workshop'; + +$string['nmp_access'] = 'Accessed'; +$string['nmp_no_access'] = 'No access'; +$string['nmp_access_chart_title'] = 'Access to the course content'; +$string['nmp_access_chart_yaxis_label'] = 'Number of students'; +$string['nmp_access_chart_suffix'] = 'students'; /* Email */ -$string['fml_validation_subject_text'] = 'The subject is mandatory'; -$string['fml_validation_message_text'] = 'Please write a message'; -$string['fml_subject_label'] = 'Add a topic'; -$string['fml_message_label'] = 'Add a message'; - -$string['fml_submit_button'] = 'Send'; -$string['fml_cancel_button'] = 'Cancel'; -$string['fml_close_button'] = 'Close'; -$string['fml_emailform_title'] = 'Send an e-mail'; -$string['fml_sending_text'] = 'Sending emails'; - -$string['fml_recipients_label'] = 'To'; -$string['fml_mailsended_text'] = 'mails sent'; - -$string['fml_email_footer_text'] = 'This is an email sent with NoteMyProgress.'; -$string['fml_email_footer_prefix'] = 'Go to'; -$string['fml_email_footer_suffix'] = 'for more information.'; -$string['fml_mailsended_text'] = 'Emails sent'; - -$string['fml_assign_url'] = '/mod/assign/view.php?id='; -$string['fml_assignment_url'] = '/mod/assignment/view.php?id='; -$string['fml_book_url'] = '/mod/book/view.php?id='; -$string['fml_chat_url'] = '/mod/chat/view.php?id='; -$string['fml_choice_url'] = '/mod/choice/view.php?id='; -$string['fml_data_url'] = '/mod/data/view.php?id='; -$string['fml_feedback_url'] = '/mod/feedback/view.php?id='; -$string['fml_folder_url'] = '/mod/folder/view.php?id='; -$string['fml_forum_url'] = '/mod/forum/view.php?id='; -$string['fml_glossary_url'] = '/mod/glossary/view.php?id='; -$string['fml_h5pactivity_url'] = '/mod/h5pactivity/view.php?id='; -$string['fml_imscp_url'] = '/mod/imscp/view.php?id='; -$string['fml_label_url'] = '/mod/label/view.php?id='; -$string['fml_lesson_url'] = '/mod/lesson/view.php?id='; -$string['fml_lti_url'] = '/mod/lti/view.php?id='; -$string['fml_page_url'] = '/mod/page/view.php?id='; -$string['fml_quiz_url'] = '/mod/quiz/view.php?id='; -$string['fml_resource_url'] = '/mod/resource/view.php?id='; -$string['fml_scorm_url'] = '/mod/scorm/view.php?id='; -$string['fml_survey_url'] = '/mod/survey/view.php?id='; -$string['fml_url_url'] = '/mod/url/view.php?id='; -$string['fml_wiki_url'] = '/mod/wiki/view.php?id='; -$string['fml_workshop_url'] = '/mod/workshop/view.php?id='; -$string['fml_course_url'] = '/course/view.php?id='; +$string['nmp_validation_subject_text'] = 'The subject is mandatory'; +$string['nmp_validation_message_text'] = 'Please write a message'; +$string['nmp_subject_label'] = 'Add a topic'; +$string['nmp_message_label'] = 'Add a message'; + +$string['nmp_submit_button'] = 'Send'; +$string['nmp_cancel_button'] = 'Cancel'; +$string['nmp_close_button'] = 'Close'; +$string['nmp_emailform_title'] = 'Send an e-mail'; +$string['nmp_sending_text'] = 'Sending emails'; + +$string['nmp_recipients_label'] = 'To'; +$string['nmp_mailsended_text'] = 'mails sent'; + +$string['nmp_email_footer_text'] = 'This is an email sent with NoteMyProgress.'; +$string['nmp_email_footer_prefix'] = 'Go to'; +$string['nmp_email_footer_suffix'] = 'for more information.'; +$string['nmp_mailsended_text'] = 'Emails sent'; + +$string['nmp_assign_url'] = '/mod/assign/view.php?id='; +$string['nmp_assignment_url'] = '/mod/assignment/view.php?id='; +$string['nmp_book_url'] = '/mod/book/view.php?id='; +$string['nmp_chat_url'] = '/mod/chat/view.php?id='; +$string['nmp_choice_url'] = '/mod/choice/view.php?id='; +$string['nmp_data_url'] = '/mod/data/view.php?id='; +$string['nmp_feedback_url'] = '/mod/feedback/view.php?id='; +$string['nmp_folder_url'] = '/mod/folder/view.php?id='; +$string['nmp_forum_url'] = '/mod/forum/view.php?id='; +$string['nmp_glossary_url'] = '/mod/glossary/view.php?id='; +$string['nmp_h5pactivity_url'] = '/mod/h5pactivity/view.php?id='; +$string['nmp_imscp_url'] = '/mod/imscp/view.php?id='; +$string['nmp_label_url'] = '/mod/label/view.php?id='; +$string['nmp_lesson_url'] = '/mod/lesson/view.php?id='; +$string['nmp_lti_url'] = '/mod/lti/view.php?id='; +$string['nmp_page_url'] = '/mod/page/view.php?id='; +$string['nmp_quiz_url'] = '/mod/quiz/view.php?id='; +$string['nmp_resource_url'] = '/mod/resource/view.php?id='; +$string['nmp_scorm_url'] = '/mod/scorm/view.php?id='; +$string['nmp_survey_url'] = '/mod/survey/view.php?id='; +$string['nmp_url_url'] = '/mod/url/view.php?id='; +$string['nmp_wiki_url'] = '/mod/wiki/view.php?id='; +$string['nmp_workshop_url'] = '/mod/workshop/view.php?id='; +$string['nmp_course_url'] = '/course/view.php?id='; /* Évaluation de l\'enseignant */ @@ -408,26 +408,26 @@ $string['tr_item_grades_distribution_help_description_p2'] = 'On the x-axis are $string['tr_item_grades_distribution_help_description_p3'] = 'By clicking on the bar corresponding to a rank, you can send an email to the students in the ranking.'; /* Notes */ -$string['fml_grades_select_label'] = 'Grade category'; -$string['fml_grades_chart_title'] = 'Averages of assessable activities'; -$string['fml_grades_yaxis_title'] = 'Average grade (%)'; -$string['fml_grades_tooltip_average'] = 'Average grade'; -$string['fml_grades_tooltip_grade'] = 'Highest grade'; -$string['fml_grades_tooltip_student'] = 'student graded from'; -$string['fml_grades_tooltip_students'] = 'students graded from'; - -$string['fml_grades_best_grade'] = 'Highest grades'; -$string['fml_grades_average_grade'] = 'Average grade'; -$string['fml_grades_worst_grade'] = 'Worst grade'; -$string['fml_grades_details_subtitle'] = 'Best grade, worst grade and average grade'; - -$string['fml_grades_distribution_subtitle'] = 'Distribution of grades'; -$string['fml_grades_distribution_greater_than'] = 'greater than'; -$string['fml_grades_distribution_smaller_than'] = 'lower than'; -$string['fml_grades_distribution_yaxis_title'] = 'Number of students'; -$string['fml_grades_distribution_tooltip_prefix'] = 'Range'; -$string['fml_grades_distribution_tooltip_suffix'] = 'in this range'; -$string["fml_view_details"] = "(Click to see details)"; +$string['nmp_grades_select_label'] = 'Grade category'; +$string['nmp_grades_chart_title'] = 'Averages of assessable activities'; +$string['nmp_grades_yaxis_title'] = 'Average grade (%)'; +$string['nmp_grades_tooltip_average'] = 'Average grade'; +$string['nmp_grades_tooltip_grade'] = 'Highest grade'; +$string['nmp_grades_tooltip_student'] = 'student graded from'; +$string['nmp_grades_tooltip_students'] = 'students graded from'; + +$string['nmp_grades_best_grade'] = 'Highest grades'; +$string['nmp_grades_average_grade'] = 'Average grade'; +$string['nmp_grades_worst_grade'] = 'Worst grade'; +$string['nmp_grades_details_subtitle'] = 'Best grade, worst grade and average grade'; + +$string['nmp_grades_distribution_subtitle'] = 'Distribution of grades'; +$string['nmp_grades_distribution_greater_than'] = 'greater than'; +$string['nmp_grades_distribution_smaller_than'] = 'lower than'; +$string['nmp_grades_distribution_yaxis_title'] = 'Number of students'; +$string['nmp_grades_distribution_tooltip_prefix'] = 'Range'; +$string['nmp_grades_distribution_tooltip_suffix'] = 'in this range'; +$string["nmp_view_details"] = "(Click to see details)"; /* Quiz enseignant */ @@ -442,26 +442,26 @@ $string['tq_hardest_questions_help_description_p1'] = 'This graph shows the asse $string['tq_hardest_questions_help_description_p2'] = 'On the x-axis of the graph are the assessment questions identified by name. The y-axis shows the percentage of incorrect attempts relative to the total number of attempts for the question. This axis helps to identify the questions that represented the greatest difficulty for the students who took the assessment. '; $string['tq_hardest_questions_help_description_p3'] = 'By clicking on one of the bars corresponding to a question, it is possible to see the assessment question in a pop-up window.'; -$string["fml_quiz_info_text"] = "This evaluation has"; -$string["fml_question_text"] = "question"; -$string["fml_questions_text"] = "questions"; -$string["fml_doing_text_singular"] = "attempt made by"; -$string["fml_doing_text_plural"] = "attempts made by"; -$string["fml_attempt_text"] = "attempt"; -$string["fml_attempts_text"] = "attempts"; -$string["fml_student_text"] = "student"; -$string["fml_students_text"] = "students"; -$string["fml_quiz"] = "Assessments"; -$string["fml_questions_attempts_chart_title"] = "Attempted questions"; -$string["fml_questions_attempts_yaxis_title"] = "No. of attempts"; -$string["fml_hardest_questions_chart_title"] = "More difficult questions"; -$string["fml_hardest_questions_yaxis_title"] = "Incorrect attempts"; -$string["fml_correct_attempt"] = "Correct"; -$string["fml_partcorrect_attempt"] = "Partially correct"; -$string["fml_incorrect_attempt"] = "Wrong"; -$string["fml_blank_attempt"] = "Empty"; -$string["fml_needgraded_attempt"] = "Not rated"; -$string["fml_review_question"] = "(Click to review the question)"; +$string["nmp_quiz_info_text"] = "This evaluation has"; +$string["nmp_question_text"] = "question"; +$string["nmp_questions_text"] = "questions"; +$string["nmp_doing_text_singular"] = "attempt made by"; +$string["nmp_doing_text_plural"] = "attempts made by"; +$string["nmp_attempt_text"] = "attempt"; +$string["nmp_attempts_text"] = "attempts"; +$string["nmp_student_text"] = "student"; +$string["nmp_students_text"] = "students"; +$string["nmp_quiz"] = "Assessments"; +$string["nmp_questions_attempts_chart_title"] = "Attempted questions"; +$string["nmp_questions_attempts_yaxis_title"] = "No. of attempts"; +$string["nmp_hardest_questions_chart_title"] = "More difficult questions"; +$string["nmp_hardest_questions_yaxis_title"] = "Incorrect attempts"; +$string["nmp_correct_attempt"] = "Correct"; +$string["nmp_partcorrect_attempt"] = "Partially correct"; +$string["nmp_incorrect_attempt"] = "Wrong"; +$string["nmp_blank_attempt"] = "Empty"; +$string["nmp_needgraded_attempt"] = "Not rated"; +$string["nmp_review_question"] = "(Click to review the question)"; /* Abandon */ @@ -487,42 +487,42 @@ $string['td_user_grades_help_description_p1'] = 'This graph shows a comparison o $string['td_user_grades_help_description_p2'] = 'The various assessable activities are displayed on the x-axis of the graph. On the y-axis are the student\'s grade and the average grade of their peers. The student\'s grade and the course average are displayed as a percentage to maintain the symmetry of the graph. '; $string['td_user_grades_help_description_p3'] = 'With a click on the bar corresponding to an activity, it is possible to go to the analysed activity. '; -$string["fml_cluster_label"] = "Group"; -$string["fml_cluster_select"] = 'Student group'; -$string["fml_dropout_table_title"] = "Students in the group"; -$string["fml_dropout_see_profile"] = "View profile"; -$string["fml_dropout_user_never_access"] = "Never accessed"; -$string["fml_dropout_student_progress_title"] = "Student's progression"; -$string["fml_dropout_student_grade_title"] = "Grade"; -$string['fml_dropout_no_data'] = "There is no dropout data for this course yet"; -$string['fml_dropout_no_users_cluster'] = "There are no students in this group"; -$string['fml_dropout_generate_data_manually'] = "Generate manually"; -$string['fml_dropout_generating_data'] = "Generating data..."; -$string["fml_modules_access_chart_title"] = "Course resources"; -$string["fml_modules_access_chart_series_total"] = "Total"; -$string["fml_modules_access_chart_series_complete"] = "Completed"; -$string["fml_modules_access_chart_series_viewed"] = "Accessed"; -$string["fml_week_modules_chart_title"] = "Resources per week"; -$string["fml_modules_amount"] = "Quantity of resources"; -$string["fml_modules_details"] = "(Click to view resources)"; -$string["fml_modules_interaction"] = "interaction"; -$string["fml_modules_interactions"] = "interactions"; -$string["fml_modules_viewed"] = "Accessed"; -$string["fml_modules_no_viewed"] = "Not accessed"; -$string["fml_modules_complete"] = "Completed"; -$string["fml_sessions_evolution_chart_title"] = "Sessions and time invested"; -$string["fml_sessions_evolution_chart_xaxis1"] = "No. of sessions"; -$string["fml_sessions_evolution_chart_xaxis2"] = "No. of hours"; -$string["fml_sessions_evolution_chart_legend1"] = "No. of sessions"; -$string["fml_sessions_evolution_chart_legend2"] = "Time invested"; -$string["fml_user_grades_chart_title"] = "Grades"; -$string["fml_user_grades_chart_yaxis"] = "Percentage grade"; -$string["fml_user_grades_chart_xaxis"] = "Assessable activities"; -$string["fml_user_grades_chart_legend"] = "Course (average)"; -$string["fml_user_grades_chart_tooltip_no_graded"] = "No rating"; -$string["fml_user_grades_chart_view_activity"] = "Click to view the activity"; -$string['fml_send_mail_to_user'] = 'Send an e-mail to'; -$string['fml_send_mail_to_group'] = 'Send an e-mail to the group'; +$string["nmp_cluster_label"] = "Group"; +$string["nmp_cluster_select"] = 'Student group'; +$string["nmp_dropout_table_title"] = "Students in the group"; +$string["nmp_dropout_see_profile"] = "View profile"; +$string["nmp_dropout_user_never_access"] = "Never accessed"; +$string["nmp_dropout_student_progress_title"] = "Student's progression"; +$string["nmp_dropout_student_grade_title"] = "Grade"; +$string['nmp_dropout_no_data'] = "There is no dropout data for this course yet"; +$string['nmp_dropout_no_users_cluster'] = "There are no students in this group"; +$string['nmp_dropout_generate_data_manually'] = "Generate manually"; +$string['nmp_dropout_generating_data'] = "Generating data..."; +$string["nmp_modules_access_chart_title"] = "Course resources"; +$string["nmp_modules_access_chart_series_total"] = "Total"; +$string["nmp_modules_access_chart_series_complete"] = "Completed"; +$string["nmp_modules_access_chart_series_viewed"] = "Accessed"; +$string["nmp_week_modules_chart_title"] = "Resources per week"; +$string["nmp_modules_amount"] = "Quantity of resources"; +$string["nmp_modules_details"] = "(Click to view resources)"; +$string["nmp_modules_interaction"] = "interaction"; +$string["nmp_modules_interactions"] = "interactions"; +$string["nmp_modules_viewed"] = "Accessed"; +$string["nmp_modules_no_viewed"] = "Not accessed"; +$string["nmp_modules_complete"] = "Completed"; +$string["nmp_sessions_evolution_chart_title"] = "Sessions and time invested"; +$string["nmp_sessions_evolution_chart_xaxis1"] = "No. of sessions"; +$string["nmp_sessions_evolution_chart_xaxis2"] = "No. of hours"; +$string["nmp_sessions_evolution_chart_legend1"] = "No. of sessions"; +$string["nmp_sessions_evolution_chart_legend2"] = "Time invested"; +$string["nmp_user_grades_chart_title"] = "Grades"; +$string["nmp_user_grades_chart_yaxis"] = "Percentage grade"; +$string["nmp_user_grades_chart_xaxis"] = "Assessable activities"; +$string["nmp_user_grades_chart_legend"] = "Course (average)"; +$string["nmp_user_grades_chart_tooltip_no_graded"] = "No rating"; +$string["nmp_user_grades_chart_view_activity"] = "Click to view the activity"; +$string['nmp_send_mail_to_user'] = 'Send an e-mail to'; +$string['nmp_send_mail_to_group'] = 'Send an e-mail to the group'; /* Général étudiant */ @@ -559,18 +559,18 @@ $string['ss_resources_access_help_description_p2'] = 'The x-axis of the graph sh $string['ss_resources_access_help_description_p3'] = 'By clicking on any bar, it is possible to see the resources and activities available in the course (in a pop-up window) as well as the number of interactions you have had with each resource and a label of not accessed, accessed or completed. '; -$string['fml_student_time_inverted_title'] = 'Your time invested'; -$string['fml_student_time_inverted_x_axis'] = 'No. of hours'; -$string['fml_student_inverted_time'] = 'Time invested'; -$string['fml_student_expected_time'] = 'Time to invest'; +$string['nmp_student_time_inverted_title'] = 'Your time invested'; +$string['nmp_student_time_inverted_x_axis'] = 'No. of hours'; +$string['nmp_student_inverted_time'] = 'Time invested'; +$string['nmp_student_expected_time'] = 'Time to invest'; -$string['fml_resource_access_title'] = 'Interaction by type of resource'; -$string['fml_resource_access_y_axis'] = 'Quantity of resources'; -$string['fml_resource_access_x_axis'] = 'Types of resources'; -$string['fml_resource_access_legend1'] = 'Completed'; -$string['fml_resource_access_legend2'] = 'Waiting'; +$string['nmp_resource_access_title'] = 'Interaction by type of resource'; +$string['nmp_resource_access_y_axis'] = 'Quantity of resources'; +$string['nmp_resource_access_x_axis'] = 'Types of resources'; +$string['nmp_resource_access_legend1'] = 'Completed'; +$string['nmp_resource_access_legend2'] = 'Waiting'; -$string['fml_week_progress_title'] = 'Progress of the week'; +$string['nmp_week_progress_title'] = 'Progress of the week'; @@ -635,145 +635,145 @@ $string['tv_time_should_spend_teacher'] = 'Tiempo promedio que se debería inver /* Indicateurs de l\'enseignant */ -$string['fml_teacher_indicators_title'] = 'General indicators'; -$string['fml_teacher_indicators_students'] = 'Students'; -$string['fml_teacher_indicators_weeks'] = 'Weeks'; -$string['fml_teacher_indicators_grademax'] = 'Grades'; -$string['fml_teacher_indicators_course_start'] = 'Start the'; -$string['fml_teacher_indicators_course_end'] = 'End the'; -$string['fml_teacher_indicators_course_format'] = 'Format'; -$string['fml_teacher_indicators_course_completion'] = 'Completeness of the modules'; -$string["fml_teacher_indicators_student_progress"] = "Student progress"; -$string["fml_teacher_indicators_week_resources_chart_title"] = "Resources per week"; -$string["fml_teacher_indicators_week_resources_yaxis_title"] = "Quantity of resources"; +$string['nmp_teacher_indicators_title'] = 'General indicators'; +$string['nmp_teacher_indicators_students'] = 'Students'; +$string['nmp_teacher_indicators_weeks'] = 'Weeks'; +$string['nmp_teacher_indicators_grademax'] = 'Grades'; +$string['nmp_teacher_indicators_course_start'] = 'Start the'; +$string['nmp_teacher_indicators_course_end'] = 'End the'; +$string['nmp_teacher_indicators_course_format'] = 'Format'; +$string['nmp_teacher_indicators_course_completion'] = 'Completeness of the modules'; +$string["nmp_teacher_indicators_student_progress"] = "Student progress"; +$string["nmp_teacher_indicators_week_resources_chart_title"] = "Resources per week"; +$string["nmp_teacher_indicators_week_resources_yaxis_title"] = "Quantity of resources"; /* Logs section */ -$string['fml_logs_title'] = 'Download the activity logs'; -$string['fml_logs_help_description'] = 'This section allows you to download the activity logs that have been performed. That is, you have access to the actions that have been carried out by registered users on the platform in a spreadsheet format.'; -$string['fml_logs_title_MoodleSetpoint_title'] = 'Select a date range for actions performed on Moodle'; -$string['fml_logs_title_MMPSetpoint_title'] = 'Select a date range for actions performed on NoteMyProgress'; -$string['fml_logs_help'] = 'This section allows you to download a log file of activities performed.'; -$string['fml_logs_select_date'] = 'Select a time interval for the log'; -$string['fml_logs_first_date'] = 'Start date'; -$string['fml_logs_last_date'] = 'End date'; -$string['fml_logs_valid_Moodlebtn'] = 'Download the Moodle activity log'; -$string['fml_logs_valid_NMPbtn'] = 'Download the NoteMyProgress activity log'; -$string['fml_logs_invalid_date'] = 'Please enter a date'; -$string['fml_logs_download_btn'] = 'Download in progress'; -$string['fml_logs_download_nmp_help_title'] = 'About the actions carried out on NoteMyProgress'; -$string['fml_logs_download_moodle_help_title'] = 'About the actions carried out on Moodle'; -$string['fml_logs_download_nmp_help_description'] = 'The log file that is downloaded lists all the actions that have been performed by the user within the NoteMyProgress plugin only (viewing progress, viewing general indicators, etc.).'; -$string['fml_logs_download_moodle_help_description'] = 'The log file that is uploaded lists all the actions that have been performed by the user within Moodle only (viewing the course, viewing resources, submitting an assignment, etc).'; +$string['nmp_logs_title'] = 'Download the activity logs'; +$string['nmp_logs_help_description'] = 'This section allows you to download the activity logs that have been performed. That is, you have access to the actions that have been carried out by registered users on the platform in a spreadsheet format.'; +$string['nmp_logs_title_MoodleSetpoint_title'] = 'Select a date range for actions performed on Moodle'; +$string['nmp_logs_title_MMPSetpoint_title'] = 'Select a date range for actions performed on NoteMyProgress'; +$string['nmp_logs_help'] = 'This section allows you to download a log file of activities performed.'; +$string['nmp_logs_select_date'] = 'Select a time interval for the log'; +$string['nmp_logs_first_date'] = 'Start date'; +$string['nmp_logs_last_date'] = 'End date'; +$string['nmp_logs_valid_Moodlebtn'] = 'Download the Moodle activity log'; +$string['nmp_logs_valid_NMPbtn'] = 'Download the NoteMyProgress activity log'; +$string['nmp_logs_invalid_date'] = 'Please enter a date'; +$string['nmp_logs_download_btn'] = 'Download in progress'; +$string['nmp_logs_download_nmp_help_title'] = 'About the actions carried out on NoteMyProgress'; +$string['nmp_logs_download_moodle_help_title'] = 'About the actions carried out on Moodle'; +$string['nmp_logs_download_nmp_help_description'] = 'The log file that is downloaded lists all the actions that have been performed by the user within the NoteMyProgress plugin only (viewing progress, viewing general indicators, etc.).'; +$string['nmp_logs_download_moodle_help_description'] = 'The log file that is uploaded lists all the actions that have been performed by the user within Moodle only (viewing the course, viewing resources, submitting an assignment, etc).'; /* Logfiles + Logs section */ -$string['fml_logs_csv_headers_username'] = 'Username'; -$string['fml_logs_csv_headers_firstname'] = 'First name'; -$string['fml_logs_csv_headers_lastname'] = 'Last name'; -$string['fml_logs_csv_headers_date'] = 'Date'; -$string['fml_logs_csv_headers_hour'] = 'Hour'; -$string['fml_logs_csv_headers_action'] = 'Action'; -$string['fml_logs_csv_headers_coursename'] = 'Course name'; -$string['fml_logs_csv_headers_detail'] = 'Object_Name'; -$string['fml_logs_csv_headers_detailtype'] = 'Object_Type'; - -$string['fml_logs_error_begin_date_superior'] = 'The start date cannot be later than the current date'; -$string['fml_logs_error_begin_date_inferior'] = 'The start date must be earlier than the end date'; -$string['fml_logs_error_empty_dates'] = 'Dates cannot be empty'; -$string['fml_logs_error_problem_encountered'] = 'A problem has been encountered, please try again'; - -$string['fml_logs_success_file_downloaded'] = 'File uploaded!'; - -$string['fml_logs_moodle_csv_headers_role'] = 'Role'; -$string['fml_logs_moodle_csv_headers_email'] = 'Email'; -$string['fml_logs_moodle_csv_headers_username'] = 'Username'; -$string['fml_logs_moodle_csv_headers_fullname'] = 'Fullname'; -$string['fml_logs_moodle_csv_headers_date'] = 'Date'; -$string['fml_logs_moodle_csv_headers_hour'] = 'Hour'; -$string['fml_logs_moodle_csv_headers_action'] = 'Action'; -$string['fml_logs_moodle_csv_headers_courseid'] = 'CourseID'; -$string['fml_logs_moodle_csv_headers_coursename'] = 'Course_name'; -$string['fml_logs_moodle_csv_headers_detailid'] = 'Detail ID'; -$string['fml_logs_moodle_csv_headers_details'] = 'Details'; -$string['fml_logs_moodle_csv_headers_detailstype'] = 'Details_type'; - -$string['fml_logs_moodle_csv_headers_role_description'] = 'Gives the role the user has on the course on which they have taken an action (student, teacher...)'; -$string['fml_logs_moodle_csv_headers_email_description'] = 'Gives the user\'s e-mail address'; -$string['fml_logs_moodle_csv_headers_username_description'] = 'Gives the moodle username of the person who performed the action'; -$string['fml_logs_moodle_csv_headers_fullname_description'] = 'Gives the user\'s full name (First + Last)'; -$string['fml_logs_moodle_csv_headers_date_description'] = 'Gives the date on which the action was performed in the format dd-MM-YYYY'; -$string['fml_logs_moodle_csv_headers_hour_description'] = 'Gives the time at which the action was performed'; -$string['fml_logs_moodle_csv_headers_action_description'] = 'Give a verb describing the action that has been performed (e.g. clicked, viewed...)'; -$string['fml_logs_moodle_csv_headers_courseid_description'] = 'Gives the ID on which the action was performed'; -$string['fml_logs_moodle_csv_headers_coursename_description'] = 'Give the name of the price on which the action was carried out'; -$string['fml_logs_moodle_csv_headers_detailid_description'] = 'Gives the ID of the object with which the user has interacted'; -$string['fml_logs_moodle_csv_headers_details_description'] = 'Give the name of the object that was targeted'; -$string['fml_logs_moodle_csv_headers_detailstype_description'] = 'Gives the type of object that has been targeted (examples of objects: Repository, Quiz, Resources...)'; - -$string['fml_logs_nmp_csv_headers_role_description'] = 'Gives the role the user has on the course on which they have taken an action (student, teacher...)'; -$string['fml_logs_nmp_csv_headers_email_description'] = 'Gives the user\'s e-mail address'; -$string['fml_logs_nmp_csv_headers_username_description'] = 'Gives the moodle username of the person who performed the action'; -$string['fml_logs_nmp_csv_headers_fullname_description'] = 'Gives the user\'s full name (First + Last)'; -$string['fml_logs_nmp_csv_headers_date_description'] = 'Gives the date on which the action was performed in the format dd-MM-YYYY'; -$string['fml_logs_nmp_csv_headers_hour_description'] = 'Gives the time at which the action was performed'; -$string['fml_logs_nmp_csv_headers_courseid_description'] = 'Gives the price identifier on which the action was performed'; -$string['fml_logs_nmp_csv_headers_section_name_description'] = 'Gives the name of the section of NoteMyProgress that the user was in when they performed the action'; -$string['fml_logs_nmp_csv_headers_action_type_description'] = 'Gives a full description of the action that was performed by the user in the form of verb + subject + object (e.g. downloaded_moodle_logfile)'; - -$string['fml_logs_moodle_table_title'] = 'Description of headings'; -$string['fml_logs_moodle_table_subtitle'] = 'Regarding Moodle logs'; - -$string['fml_logs_nmp_table_title'] = 'Description of headings'; -$string['fml_logs_nmp_table_subtitle'] = 'Regarding NoteMyProgress logs'; - -$string['fml_logs_nmp_csv_headers_role'] = 'Role'; -$string['fml_logs_nmp_csv_headers_email'] = 'Email'; -$string['fml_logs_nmp_csv_headers_username'] = 'Username'; -$string['fml_logs_nmp_csv_headers_fullname'] = 'Fullname'; -$string['fml_logs_nmp_csv_headers_date'] = 'Date'; -$string['fml_logs_nmp_csv_headers_hour'] = 'Hour'; -$string['fml_logs_nmp_csv_headers_courseid'] = 'CourseID'; -$string['fml_logs_nmp_csv_headers_section_name'] = 'NMP_SECTION_NAME'; -$string['fml_logs_nmp_csv_headers_action_type'] = 'NMP_ACTION_TYPE'; - -$string['fml_logs_table_title'] = 'Heading'; -$string['fml_logs_table_title_bis'] = 'Description'; - -$string['fml_logs_help_button_nmp'] = 'About the actions carried out on NoteMyProgress'; -$string['fml_logs_help_button_moodle'] = 'About the actions carried out on Moodle'; - -$string['fml_logs_download_details_link'] = 'Read more'; -$string['fml_logs_download_details_title'] = 'Are you sure you want a detailed explanation report?'; -$string['fml_logs_download_details_description'] = 'If you accept, a file in PDF format will be downloaded.'; -$string['fml_logs_download_details_ok'] = 'Download'; -$string['fml_logs_download_details_cancel'] = 'Cancel'; -$string['fml_logs_download_details_validation'] = 'The report has been downloaded'; +$string['nmp_logs_csv_headers_username'] = 'Username'; +$string['nmp_logs_csv_headers_firstname'] = 'First name'; +$string['nmp_logs_csv_headers_lastname'] = 'Last name'; +$string['nmp_logs_csv_headers_date'] = 'Date'; +$string['nmp_logs_csv_headers_hour'] = 'Hour'; +$string['nmp_logs_csv_headers_action'] = 'Action'; +$string['nmp_logs_csv_headers_coursename'] = 'Course name'; +$string['nmp_logs_csv_headers_detail'] = 'Object_Name'; +$string['nmp_logs_csv_headers_detailtype'] = 'Object_Type'; + +$string['nmp_logs_error_begin_date_superior'] = 'The start date cannot be later than the current date'; +$string['nmp_logs_error_begin_date_inferior'] = 'The start date must be earlier than the end date'; +$string['nmp_logs_error_empty_dates'] = 'Dates cannot be empty'; +$string['nmp_logs_error_problem_encountered'] = 'A problem has been encountered, please try again'; + +$string['nmp_logs_success_file_downloaded'] = 'File uploaded!'; + +$string['nmp_logs_moodle_csv_headers_role'] = 'Role'; +$string['nmp_logs_moodle_csv_headers_email'] = 'Email'; +$string['nmp_logs_moodle_csv_headers_username'] = 'Username'; +$string['nmp_logs_moodle_csv_headers_fullname'] = 'Fullname'; +$string['nmp_logs_moodle_csv_headers_date'] = 'Date'; +$string['nmp_logs_moodle_csv_headers_hour'] = 'Hour'; +$string['nmp_logs_moodle_csv_headers_action'] = 'Action'; +$string['nmp_logs_moodle_csv_headers_courseid'] = 'CourseID'; +$string['nmp_logs_moodle_csv_headers_coursename'] = 'Course_name'; +$string['nmp_logs_moodle_csv_headers_detailid'] = 'Detail ID'; +$string['nmp_logs_moodle_csv_headers_details'] = 'Details'; +$string['nmp_logs_moodle_csv_headers_detailstype'] = 'Details_type'; + +$string['nmp_logs_moodle_csv_headers_role_description'] = 'Gives the role the user has on the course on which they have taken an action (student, teacher...)'; +$string['nmp_logs_moodle_csv_headers_email_description'] = 'Gives the user\'s e-mail address'; +$string['nmp_logs_moodle_csv_headers_username_description'] = 'Gives the moodle username of the person who performed the action'; +$string['nmp_logs_moodle_csv_headers_fullname_description'] = 'Gives the user\'s full name (First + Last)'; +$string['nmp_logs_moodle_csv_headers_date_description'] = 'Gives the date on which the action was performed in the format dd-MM-YYYY'; +$string['nmp_logs_moodle_csv_headers_hour_description'] = 'Gives the time at which the action was performed'; +$string['nmp_logs_moodle_csv_headers_action_description'] = 'Give a verb describing the action that has been performed (e.g. clicked, viewed...)'; +$string['nmp_logs_moodle_csv_headers_courseid_description'] = 'Gives the ID on which the action was performed'; +$string['nmp_logs_moodle_csv_headers_coursename_description'] = 'Give the name of the price on which the action was carried out'; +$string['nmp_logs_moodle_csv_headers_detailid_description'] = 'Gives the ID of the object with which the user has interacted'; +$string['nmp_logs_moodle_csv_headers_details_description'] = 'Give the name of the object that was targeted'; +$string['nmp_logs_moodle_csv_headers_detailstype_description'] = 'Gives the type of object that has been targeted (examples of objects: Repository, Quiz, Resources...)'; + +$string['nmp_logs_nmp_csv_headers_role_description'] = 'Gives the role the user has on the course on which they have taken an action (student, teacher...)'; +$string['nmp_logs_nmp_csv_headers_email_description'] = 'Gives the user\'s e-mail address'; +$string['nmp_logs_nmp_csv_headers_username_description'] = 'Gives the moodle username of the person who performed the action'; +$string['nmp_logs_nmp_csv_headers_fullname_description'] = 'Gives the user\'s full name (First + Last)'; +$string['nmp_logs_nmp_csv_headers_date_description'] = 'Gives the date on which the action was performed in the format dd-MM-YYYY'; +$string['nmp_logs_nmp_csv_headers_hour_description'] = 'Gives the time at which the action was performed'; +$string['nmp_logs_nmp_csv_headers_courseid_description'] = 'Gives the price identifier on which the action was performed'; +$string['nmp_logs_nmp_csv_headers_section_name_description'] = 'Gives the name of the section of NoteMyProgress that the user was in when they performed the action'; +$string['nmp_logs_nmp_csv_headers_action_type_description'] = 'Gives a full description of the action that was performed by the user in the form of verb + subject + object (e.g. downloaded_moodle_logfile)'; + +$string['nmp_logs_moodle_table_title'] = 'Description of headings'; +$string['nmp_logs_moodle_table_subtitle'] = 'Regarding Moodle logs'; + +$string['nmp_logs_nmp_table_title'] = 'Description of headings'; +$string['nmp_logs_nmp_table_subtitle'] = 'Regarding NoteMyProgress logs'; + +$string['nmp_logs_nmp_csv_headers_role'] = 'Role'; +$string['nmp_logs_nmp_csv_headers_email'] = 'Email'; +$string['nmp_logs_nmp_csv_headers_username'] = 'Username'; +$string['nmp_logs_nmp_csv_headers_fullname'] = 'Fullname'; +$string['nmp_logs_nmp_csv_headers_date'] = 'Date'; +$string['nmp_logs_nmp_csv_headers_hour'] = 'Hour'; +$string['nmp_logs_nmp_csv_headers_courseid'] = 'CourseID'; +$string['nmp_logs_nmp_csv_headers_section_name'] = 'NMP_SECTION_NAME'; +$string['nmp_logs_nmp_csv_headers_action_type'] = 'NMP_ACTION_TYPE'; + +$string['nmp_logs_table_title'] = 'Heading'; +$string['nmp_logs_table_title_bis'] = 'Description'; + +$string['nmp_logs_help_button_nmp'] = 'About the actions carried out on NoteMyProgress'; +$string['nmp_logs_help_button_moodle'] = 'About the actions carried out on Moodle'; + +$string['nmp_logs_download_details_link'] = 'Read more'; +$string['nmp_logs_download_details_title'] = 'Are you sure you want a detailed explanation report?'; +$string['nmp_logs_download_details_description'] = 'If you accept, a file in PDF format will be downloaded.'; +$string['nmp_logs_download_details_ok'] = 'Download'; +$string['nmp_logs_download_details_cancel'] = 'Cancel'; +$string['nmp_logs_download_details_validation'] = 'The report has been downloaded'; /* NoteMyProgress admin settings */ -$string['fml_settings_bddusername_label'] = 'Database username'; -$string['fml_settings_bddusername_description'] = 'This parameter designates the username from which the MongoDB database can be accessed. If this parameter is entered, you will need to enter the password and the name of the database you wish to connect to.'; -$string['fml_settings_bddusername_default'] = 'Empty'; +$string['nmp_settings_bddusername_label'] = 'Database username'; +$string['nmp_settings_bddusername_description'] = 'This parameter designates the username from which the MongoDB database can be accessed. If this parameter is entered, you will need to enter the password and the name of the database you wish to connect to.'; +$string['nmp_settings_bddusername_default'] = 'Empty'; -$string['fml_settings_bddpassword_label'] = 'Account password'; -$string['fml_settings_bddpassword_description'] = 'This parameter is the password for the account from which the MongoDB database can be accessed. If this parameter is entered, you will need to enter the username and the name of the database you wish to connect to.'; -$string['fml_settings_bddpassword_default'] = 'Empty'; +$string['nmp_settings_bddpassword_label'] = 'Account password'; +$string['nmp_settings_bddpassword_description'] = 'This parameter is the password for the account from which the MongoDB database can be accessed. If this parameter is entered, you will need to enter the username and the name of the database you wish to connect to.'; +$string['nmp_settings_bddpassword_default'] = 'Empty'; -$string['fml_settings_bddaddress_label'] = 'MongoDB server address *'; -$string['fml_settings_bddaddress_description'] = 'This parameter is the address from which the MongoDB database is accessible. This parameter is mandatory and is in the form: 151.125.45.58 or yourserver.com'; -$string['fml_settings_bddaddress_default'] = 'localhost'; +$string['nmp_settings_bddaddress_label'] = 'MongoDB server address *'; +$string['nmp_settings_bddaddress_description'] = 'This parameter is the address from which the MongoDB database is accessible. This parameter is mandatory and is in the form: 151.125.45.58 or yourserver.com'; +$string['nmp_settings_bddaddress_default'] = 'localhost'; -$string['fml_settings_bddport_label'] = 'Communication port *'; -$string['fml_settings_bddport_description'] = 'This parameter designates the port to be used to communicate with the database. This parameter is mandatory and must be a number.'; -$string['fml_settings_bddport_default'] = '27017'; +$string['nmp_settings_bddport_label'] = 'Communication port *'; +$string['nmp_settings_bddport_description'] = 'This parameter designates the port to be used to communicate with the database. This parameter is mandatory and must be a number.'; +$string['nmp_settings_bddport_default'] = '27017'; -$string['fml_settings_bddname_label'] = 'Name of the database'; -$string['fml_settings_bddname_description'] = 'This parameter designates the name of the MongoDB database in which the information will be stored.'; -$string['fml_settings_bddname_default'] = 'Empty'; +$string['nmp_settings_bddname_label'] = 'Name of the database'; +$string['nmp_settings_bddname_description'] = 'This parameter designates the name of the MongoDB database in which the information will be stored.'; +$string['nmp_settings_bddname_default'] = 'Empty'; //Planning /* Global */ @@ -866,6 +866,11 @@ $string['set_weeks_title'] = "Setting up the course weeks"; $string['set_weeks'] = "Configuration of the course weeks"; /*Metareflexion*/ +$string['metareflexion_goal1'] = "Learning something new"; +$string['metareflexion_goal2'] = "Reviewing what I’ve learned"; +$string['metareflexion_goal3'] = "Plan my learning"; + +$string['metareflexion_no_modules_in_section'] = "This week has no modules"; $string['compare_with_course'] = "Compare my results with those of my colleagues"; $string['sr_menu_metareflexion'] = "Metareflexion"; $string['metareflexion_last_week_created'] = "Last week's reflections have been saved"; @@ -1093,4 +1098,76 @@ $string['group_allstudent'] = "All students"; /* Admin Settings */ $string['nmp_use_navbar_menu'] = 'Activate new menu'; $string['nmp_use_navbar_menu_desc'] = 'Display the plugin menu in the top navigation bar, otherwise it will include the menu in the navigation block.'; +/* Gamification */ +$string['EnableGame']="Disable/Enable :"; +$string['studentRanking1']="Do you want to appear in the Ranking Board ?"; +$string['studentRanking2']=" /!\ All the registered in this course having accepted you will see. Accepting is final:"; +$string['studentRanking3']="Accept"; +$string['gamification_denied'] = 'gamification has been desactivated by your teacher'; +$string['tg_colon'] = '{$a->a}: {$a->b}'; +$string['tg_section_title'] = 'Course gamification settings'; +$string['tg_section_help_title'] = 'Course gamification settings'; +$string['tg_section_help_description'] = 'You can give the option of gamification to the students of the course.'; +$string['tg_save_warning_title'] = "Are you sure you want to save the changes?"; +$string['tg_save_warning_content'] = "If you change the settings for the gamification when the course has already started, data may be lost..."; +$string['tg_confirm_ok'] = "Save"; +$string['tg_confirm_cancel'] = "Cancel"; +$string['tg_save'] = "Save configuration"; +$string['tg_section_preview'] = 'Preview'; +$string['tg_section_experience'] = 'Experience points'; +$string['tg_section_information'] = 'Information'; +$string['tg_section_ranking'] = 'Ranking/Report'; +$string['tg_section_settings'] = 'Settings'; + +$string['tg_section_points'] = 'points'; +$string['tg_section_description'] = 'Description'; +$string['tg_section_no_description'] = 'No description'; +$string['tg_section_no_name'] = 'No name'; + +$string['tg_section_preview_next_level'] = 'to the next level'; +$string['tg_section_ranking_ranking_text'] = 'Ranking'; +$string['tg_section_ranking_level'] = 'Level'; +$string['tg_section_ranking_student'] = 'Student'; +$string['tg_section_ranking_total'] = 'Total'; +$string['tg_section_ranking_progress'] = 'Progress %'; + +$string['tg_section_settings_appearance'] = 'Appearance'; +$string['tg_section_settings_appearance_title'] = 'Title'; +$string['tg_section_settings_levels'] = 'Level settings'; +$string['tg_section_settings_levels_quantity'] = 'Levels'; +$string['tg_section_settings_levels_base_points'] = 'Base Points'; +$string['tg_section_settings_levels_calculated'] = 'Automatic'; +$string['tg_section_settings_levels_manually'] = 'Manually'; +$string['tg_section_settings_levels_name'] = 'Name'; +$string['tg_section_settings_levels_required'] = 'Points required'; +$string['tg_section_settings_rules'] = 'Rules setting'; +$string['tg_section_settings_add_rule'] = 'Add new rule'; +$string['tg_section_settings_earn'] = 'For this event win:'; +$string['tg_section_settings_select_event'] = 'Select an event'; +$string['gm_Chart_Title']='Spreading chart'; +$string['gm_Chart_Y']='Students'; + +$string['tg_timenow'] = 'Just now'; +$string['tg_timeseconds'] = '{$a}s ago'; +$string['tg_timeminutes'] = '{$a}m ago'; +$string['tg_timehours'] = '{$a}h ago'; +$string['tg_timedays'] = '{$a}d ago'; +$string['tg_timeweeks'] = '{$a}w ago'; +$string['tg_timewithinayearformat'] = '%b %e'; +$string['tg_timeolderyearformat'] = '%b %Y'; + +/* General Errors */ +$string['nmp_api_error_network'] = "An error has occurred in communication with the server."; +$string['nmp_api_invalid_data'] = 'Incorrect data'; +$string['nmp_api_json_decode_error'] = 'Error Decoding sent data'; +$string['nmp_api_invalid_token_error'] = 'The token sent in the transaction is invalid, please refresh the page'; +$string['nmp_api_invalid_transaction'] = 'The request is incorrect'; +$string['nmp_api_invalid_profile'] = 'You cannot do this action, your profile is incorrect'; +$string['nmp_api_save_successful'] = 'The data has been successfully saved on the server'; +$string['nmp_api_cancel_action'] = 'You have canceled the action'; +$string['overview']='Overview : '; +$string['game_point_error']='Points are required'; +$string['game_event_error']='Event is required'; +$string['game_name_error']='Name required'; + diff --git a/notemyprogress/lang/es/local_notemyprogress.php b/notemyprogress/lang/es/local_notemyprogress.php index 79899c07d9190a6bfcf527c1b858de22117a74cd..5157e0d089db112fb5b66a6fc51c95f4d7a46bb4 100644 --- a/notemyprogress/lang/es/local_notemyprogress.php +++ b/notemyprogress/lang/es/local_notemyprogress.php @@ -37,12 +37,12 @@ $string['helplabel'] = 'Ayuda'; $string['exitbutton'] = '¡Entendido!'; $string['no_data'] = 'No hay datos que mostrar'; $string['only_student'] = 'Este reporte es solo para estudiantes'; -$string["fml_send_mail"] = "(Clic para enviar correo)"; -$string["fml_about"] = "Acerca de este Gráfico"; -$string["fml_about_table"] = "Acerca de esta Tabla"; -$string["fml_not_configured"] = "No Configurado"; -$string["fml_activated"] = "Activado"; -$string["fml_disabled"] = "Desactivado"; +$string["nmp_send_mail"] = "(Clic para enviar correo)"; +$string["nmp_about"] = "Acerca de este Gráfico"; +$string["nmp_about_table"] = "Acerca de esta Tabla"; +$string["nmp_not_configured"] = "No Configurado"; +$string["nmp_activated"] = "Activado"; +$string["nmp_disabled"] = "Desactivado"; /* Menú */ $string['menu_main_title'] = "Dashboard Progreso"; @@ -57,7 +57,7 @@ $string['menu_logs'] = "Registros de actividad"; $string['menu_general'] = "Indicadores Generales"; /* Nav Bar Menu */ -$string['togglemenu'] = 'Mostrar/Ocultar menú de FML'; +$string['togglemenu'] = 'Mostrar/Ocultar menú de nmp'; /* Pagination component */ $string['pagination_component_to'] = 'al'; @@ -133,77 +133,77 @@ $string['plugin_hidden'] = 'Reportes ocultos.'; $string['title_conditions'] = 'Condiciones de uso'; /* Time */ -$string['fml_mon'] = 'Lunes'; -$string['fml_tue'] = 'Martes'; -$string['fml_wed'] = 'Miércoles'; -$string['fml_thu'] = 'Jueves'; -$string['fml_fri'] = 'Viernes'; -$string['fml_sat'] = 'Sábado'; -$string['fml_sun'] = 'Domingo'; -$string['fml_mon_short'] = 'Lun'; -$string['fml_tue_short'] = 'Mar'; -$string['fml_wed_short'] = 'Mié'; -$string['fml_thu_short'] = 'Jue'; -$string['fml_fri_short'] = 'Vie'; -$string['fml_sat_short'] = 'Sáb'; -$string['fml_sun_short'] = 'Dom'; - -$string['fml_jan'] = 'Enero'; -$string['fml_feb'] = 'Febrero'; -$string['fml_mar'] = 'Marzo'; -$string['fml_apr'] = 'Abril'; -$string['fml_may'] = 'Mayo'; -$string['fml_jun'] = 'Junio'; -$string['fml_jul'] = 'Julio'; -$string['fml_aug'] = 'Agosto'; -$string['fml_sep'] = 'Septiembre'; -$string['fml_oct'] = 'Octubre'; -$string['fml_nov'] = 'Noviembre'; -$string['fml_dec'] = 'Diciembre'; -$string['fml_jan_short'] = 'Ene'; -$string['fml_feb_short'] = 'Feb'; -$string['fml_mar_short'] = 'Mar'; -$string['fml_apr_short'] = 'Abr'; -$string['fml_may_short'] = 'May'; -$string['fml_jun_short'] = 'Jun'; -$string['fml_jul_short'] = 'Jul'; -$string['fml_aug_short'] = 'Ago'; -$string['fml_sep_short'] = 'Sep'; -$string['fml_oct_short'] = 'Oct'; -$string['fml_nov_short'] = 'Nov'; -$string['fml_dec_short'] = 'Dic'; - -$string['fml_week1'] = 'Sem 1'; -$string['fml_week2'] = 'Sem 2'; -$string['fml_week3'] = 'Sem 3'; -$string['fml_week4'] = 'Sem 4'; -$string['fml_week5'] = 'Sem 5'; -$string['fml_week6'] = 'Sem 6'; - -$string['fml_00'] = '12am'; -$string['fml_01'] = '1am'; -$string['fml_02'] = '2am'; -$string['fml_03'] = '3am'; -$string['fml_04'] = '4am'; -$string['fml_05'] = '5am'; -$string['fml_06'] = '6am'; -$string['fml_07'] = '7am'; -$string['fml_08'] = '8am'; -$string['fml_09'] = '9am'; -$string['fml_10'] = '10am'; -$string['fml_11'] = '11am'; -$string['fml_12'] = '12pm'; -$string['fml_13'] = '1pm'; -$string['fml_14'] = '2pm'; -$string['fml_15'] = '3pm'; -$string['fml_16'] = '4pm'; -$string['fml_17'] = '5pm'; -$string['fml_18'] = '6pm'; -$string['fml_19'] = '7pm'; -$string['fml_20'] = '8pm'; -$string['fml_21'] = '9pm'; -$string['fml_22'] = '10pm'; -$string['fml_23'] = '11pm'; +$string['nmp_mon'] = 'Lunes'; +$string['nmp_tue'] = 'Martes'; +$string['nmp_wed'] = 'Miércoles'; +$string['nmp_thu'] = 'Jueves'; +$string['nmp_fri'] = 'Viernes'; +$string['nmp_sat'] = 'Sábado'; +$string['nmp_sun'] = 'Domingo'; +$string['nmp_mon_short'] = 'Lun'; +$string['nmp_tue_short'] = 'Mar'; +$string['nmp_wed_short'] = 'Mié'; +$string['nmp_thu_short'] = 'Jue'; +$string['nmp_fri_short'] = 'Vie'; +$string['nmp_sat_short'] = 'Sáb'; +$string['nmp_sun_short'] = 'Dom'; + +$string['nmp_jan'] = 'Enero'; +$string['nmp_feb'] = 'Febrero'; +$string['nmp_mar'] = 'Marzo'; +$string['nmp_apr'] = 'Abril'; +$string['nmp_may'] = 'Mayo'; +$string['nmp_jun'] = 'Junio'; +$string['nmp_jul'] = 'Julio'; +$string['nmp_aug'] = 'Agosto'; +$string['nmp_sep'] = 'Septiembre'; +$string['nmp_oct'] = 'Octubre'; +$string['nmp_nov'] = 'Noviembre'; +$string['nmp_dec'] = 'Diciembre'; +$string['nmp_jan_short'] = 'Ene'; +$string['nmp_feb_short'] = 'Feb'; +$string['nmp_mar_short'] = 'Mar'; +$string['nmp_apr_short'] = 'Abr'; +$string['nmp_may_short'] = 'May'; +$string['nmp_jun_short'] = 'Jun'; +$string['nmp_jul_short'] = 'Jul'; +$string['nmp_aug_short'] = 'Ago'; +$string['nmp_sep_short'] = 'Sep'; +$string['nmp_oct_short'] = 'Oct'; +$string['nmp_nov_short'] = 'Nov'; +$string['nmp_dec_short'] = 'Dic'; + +$string['nmp_week1'] = 'Sem 1'; +$string['nmp_week2'] = 'Sem 2'; +$string['nmp_week3'] = 'Sem 3'; +$string['nmp_week4'] = 'Sem 4'; +$string['nmp_week5'] = 'Sem 5'; +$string['nmp_week6'] = 'Sem 6'; + +$string['nmp_00'] = '12am'; +$string['nmp_01'] = '1am'; +$string['nmp_02'] = '2am'; +$string['nmp_03'] = '3am'; +$string['nmp_04'] = '4am'; +$string['nmp_05'] = '5am'; +$string['nmp_06'] = '6am'; +$string['nmp_07'] = '7am'; +$string['nmp_08'] = '8am'; +$string['nmp_09'] = '9am'; +$string['nmp_10'] = '10am'; +$string['nmp_11'] = '11am'; +$string['nmp_12'] = '12pm'; +$string['nmp_13'] = '1pm'; +$string['nmp_14'] = '2pm'; +$string['nmp_15'] = '3pm'; +$string['nmp_16'] = '4pm'; +$string['nmp_17'] = '5pm'; +$string['nmp_18'] = '6pm'; +$string['nmp_19'] = '7pm'; +$string['nmp_20'] = '8pm'; +$string['nmp_21'] = '9pm'; +$string['nmp_22'] = '10pm'; +$string['nmp_23'] = '11pm'; /* Teacher General */ $string['tg_section_help_title'] = 'Indicadores Generales'; @@ -217,7 +217,7 @@ $string['tg_week_sessions_help_description_p2'] = 'En el eje x del gráfico se e $string['tg_progress_table_help_title'] = 'Progreso de los estudiantes'; $string['tg_progress_table_help_description'] = 'Este tabla muestra una lista con todos los estudiantes matriculados en el curso junto con su progreso, cantidad de sesiones y tiempo invertido. Para el cálculo del progreso se han considerado todos los recursos del curso a excepción de los de tipo <i>Label</i>. Para determinar si un estudiante ha finalizado un recurso se verifica en primer lugar si el recurso tiene habilitada la configuración de completitud. En caso de ser así, se busca si el estudiante ya ha completado la actividad en base a esa configuración. De lo contrario, la actividad se considera completa si el estudiante la ha visto al menos una vez.'; -$string['fml_title'] = 'Sesiones de Trabajo'; +$string['nmp_title'] = 'Sesiones de Trabajo'; $string['table_title'] = 'Progreso del Curso'; $string['thead_name'] = 'Nombre'; $string['thead_lastname'] = 'Apellidos'; @@ -226,25 +226,25 @@ $string['thead_progress'] = 'Progreso (%)'; $string['thead_sessions'] = 'Sesiones'; $string['thead_time'] = 'Tiempo Invertido'; -$string['fml_module_label'] = 'recurso'; -$string['fml_modules_label'] = 'recursos'; -$string['fml_of_conector'] = 'de'; -$string['fml_finished_label'] = 'finalizado'; -$string['fml_finisheds_label'] = 'finalizados'; +$string['nmp_module_label'] = 'recurso'; +$string['nmp_modules_label'] = 'recursos'; +$string['nmp_of_conector'] = 'de'; +$string['nmp_finished_label'] = 'finalizado'; +$string['nmp_finisheds_label'] = 'finalizados'; -$string['fml_smaller30'] = 'Menores que 30 minutos'; -$string['fml_greater30'] = 'Mayores que 30 minutos'; -$string['fml_greater60'] = 'Mayores que 60 minutos'; +$string['nmp_smaller30'] = 'Menores que 30 minutos'; +$string['nmp_greater30'] = 'Mayores que 30 minutos'; +$string['nmp_greater60'] = 'Mayores que 60 minutos'; -$string['fml_session_count_title'] = 'Sesiones de la Semana'; -$string['fml_session_count_yaxis_title'] = 'Cantidad de Sesiones'; -$string['fml_session_count_tooltip_suffix'] = ' sesiones'; +$string['nmp_session_count_title'] = 'Sesiones de la Semana'; +$string['nmp_session_count_yaxis_title'] = 'Cantidad de Sesiones'; +$string['nmp_session_count_tooltip_suffix'] = ' sesiones'; -$string['fml_hours_sessions_title'] = 'Sesiones por Día y Hora'; -$string['fml_weeks_sessions_title'] = 'Sesiones por Semana'; +$string['nmp_hours_sessions_title'] = 'Sesiones por Día y Hora'; +$string['nmp_weeks_sessions_title'] = 'Sesiones por Semana'; -$string["fml_session_text"] = "sesión"; -$string["fml_sessions_text"] = "sesiones"; +$string["nmp_session_text"] = "sesión"; +$string["nmp_sessions_text"] = "sesiones"; $string['ss_change_timezone'] = 'Zona horaria:'; //$string['ss_activity_inside_plataform_student'] = 'Mi actividad en la plataforma'; @@ -269,28 +269,28 @@ $string['ts_sessions_count_help_title'] = 'Sesiones de la Semana'; $string['ts_sessions_count_help_description_p1'] = 'Este gráfico muestra el número de sesiones clasificadas por su duración en rangos de tiempo: menores a 30 minutos, mayores a 30 minutos y mayores a 60 minutos. Se considera el acceso al curso por parte del estudiante como el inicio de una sesión de estudio. Una sesión se considera finalizada cuando el tiempo transcurrido entre dos interacciones de un estudiante supera los 30 minutos.'; $string['ts_sessions_count_help_description_p2'] = 'En el eje x del gráfico están los días de la semana configurada. En el eje y está la cantidad de sesiones realizadas.'; -$string['fml_time_inverted_title'] = 'Tiempo invertido de los Estudiantes'; -$string['fml_time_inverted_x_axis'] = 'Número de Horas'; -$string['fml_inverted_time'] = 'Tiempo Promedio Invertido'; -$string['fml_expected_time'] = 'Tiempo Promedio que se debería Invertir'; - -$string['fml_year'] = 'año'; -$string['fml_years'] = 'años'; -$string['fml_month'] = 'mes'; -$string['fml_months'] = 'meses'; -$string['fml_day'] = 'día'; -$string['fml_days'] = 'días'; -$string['fml_hour'] = 'hora'; -$string['fml_hours'] = 'horas'; -$string['fml_hours_short'] = 'h'; -$string['fml_minute'] = 'minuto'; -$string['fml_minutes'] = 'minutos'; -$string['fml_minutes_short'] = 'm'; -$string['fml_second'] = 'segundo'; -$string['fml_seconds'] = 'segundos'; -$string['fml_seconds_short'] = 's'; -$string['fml_ago'] = 'atrás'; -$string['fml_now'] = 'justo ahora'; +$string['nmp_time_inverted_title'] = 'Tiempo invertido de los Estudiantes'; +$string['nmp_time_inverted_x_axis'] = 'Número de Horas'; +$string['nmp_inverted_time'] = 'Tiempo Promedio Invertido'; +$string['nmp_expected_time'] = 'Tiempo Promedio que se debería Invertir'; + +$string['nmp_year'] = 'año'; +$string['nmp_years'] = 'años'; +$string['nmp_month'] = 'mes'; +$string['nmp_months'] = 'meses'; +$string['nmp_day'] = 'día'; +$string['nmp_days'] = 'días'; +$string['nmp_hour'] = 'hora'; +$string['nmp_hours'] = 'horas'; +$string['nmp_hours_short'] = 'h'; +$string['nmp_minute'] = 'minuto'; +$string['nmp_minutes'] = 'minutos'; +$string['nmp_minutes_short'] = 'm'; +$string['nmp_second'] = 'segundo'; +$string['nmp_seconds'] = 'segundos'; +$string['nmp_seconds_short'] = 's'; +$string['nmp_ago'] = 'atrás'; +$string['nmp_now'] = 'justo ahora'; /*Teacher Assignments*/ $string['ta_section_help_title'] = 'Seguimiento de Tareas'; @@ -303,91 +303,91 @@ $string['ta_access_content_help_description_p1'] = 'Este gráfico presenta la ca $string['ta_access_content_help_description_p2'] = 'En el eje x del gráfico se encuentran la cantidad de estudiantes matriculados en el curso. En el eje y del gráfico se encuentran los recursos de las secciones asignadas a la semana. Además, este gráfico permite enviar un correo electrónico a los estudiantes que han accedido al recurso o bien a aquellos que no han accedido al dar clic sobre el gráfico.'; /* Assign Submissions */ -$string['fml_intime_sub'] = 'Envíos a tiempo'; -$string['fml_late_sub'] = 'Envíos tardíos'; -$string['fml_no_sub'] = 'Sin envío'; -$string['fml_assign_nodue'] = 'Sin fecha límite'; -$string['fml_assignsubs_title'] = 'Envíos de Tareas'; -$string['fml_assignsubs_yaxis'] = 'Número de Estudiantes'; +$string['nmp_intime_sub'] = 'Envíos a tiempo'; +$string['nmp_late_sub'] = 'Envíos tardíos'; +$string['nmp_no_sub'] = 'Sin envío'; +$string['nmp_assign_nodue'] = 'Sin fecha límite'; +$string['nmp_assignsubs_title'] = 'Envíos de Tareas'; +$string['nmp_assignsubs_yaxis'] = 'Número de Estudiantes'; /* Content Access */ -$string['fml_assign'] = 'Tarea'; -$string['fml_assignment'] = 'Tarea'; -$string['fml_attendance'] = 'Asistencia'; -$string['fml_book'] = 'Libro'; -$string['fml_chat'] = 'Chat'; -$string['fml_choice'] = 'Elección'; -$string['fml_data'] = 'Base de Datos'; -$string['fml_feedback'] = 'Retroalimentación'; -$string['fml_folder'] = 'Carpeta'; -$string['fml_forum'] = 'Foro'; -$string['fml_glossary'] = 'Glosario'; -$string['fml_h5pactivity'] = 'H5P'; -$string['fml_imscp'] = 'Contenido IMS'; -$string['fml_label'] = 'Etiqueta'; -$string['fml_lesson'] = 'Lección'; -$string['fml_lti'] = 'Contenido IMS'; -$string['fml_page'] = 'Página'; -$string['fml_quiz'] = 'Examen'; -$string['fml_resource'] = 'Recurso'; -$string['fml_scorm'] = 'Paquete SCORM'; -$string['fml_survey'] = 'Encuesta'; -$string['fml_url'] = 'Url'; -$string['fml_wiki'] = 'Wiki'; -$string['fml_workshop'] = 'Taller'; - -$string['fml_access'] = 'Accedido'; -$string['fml_no_access'] = 'Sin Acceso'; -$string['fml_access_chart_title'] = 'Acceso a los Contenidos Curso'; -$string['fml_access_chart_yaxis_label'] = 'Cantidad de Estudiantes'; -$string['fml_access_chart_suffix'] = ' estudiantes'; +$string['nmp_assign'] = 'Tarea'; +$string['nmp_assignment'] = 'Tarea'; +$string['nmp_attendance'] = 'Asistencia'; +$string['nmp_book'] = 'Libro'; +$string['nmp_chat'] = 'Chat'; +$string['nmp_choice'] = 'Elección'; +$string['nmp_data'] = 'Base de Datos'; +$string['nmp_feedback'] = 'Retroalimentación'; +$string['nmp_folder'] = 'Carpeta'; +$string['nmp_forum'] = 'Foro'; +$string['nmp_glossary'] = 'Glosario'; +$string['nmp_h5pactivity'] = 'H5P'; +$string['nmp_imscp'] = 'Contenido IMS'; +$string['nmp_label'] = 'Etiqueta'; +$string['nmp_lesson'] = 'Lección'; +$string['nmp_lti'] = 'Contenido IMS'; +$string['nmp_page'] = 'Página'; +$string['nmp_quiz'] = 'Examen'; +$string['nmp_resource'] = 'Recurso'; +$string['nmp_scorm'] = 'Paquete SCORM'; +$string['nmp_survey'] = 'Encuesta'; +$string['nmp_url'] = 'Url'; +$string['nmp_wiki'] = 'Wiki'; +$string['nmp_workshop'] = 'Taller'; + +$string['nmp_access'] = 'Accedido'; +$string['nmp_no_access'] = 'Sin Acceso'; +$string['nmp_access_chart_title'] = 'Acceso a los Contenidos Curso'; +$string['nmp_access_chart_yaxis_label'] = 'Cantidad de Estudiantes'; +$string['nmp_access_chart_suffix'] = ' estudiantes'; /* Email */ -$string['fml_validation_subject_text'] = 'Asunto es requerido'; -$string['fml_validation_message_text'] = 'Mensaje es requerido'; -$string['fml_subject_label'] = 'Agrega un asunto'; -$string['fml_message_label'] = 'Agrega un mensaje'; - -$string['fml_submit_button'] = 'Enviar'; -$string['fml_cancel_button'] = 'Cancelar'; -$string['fml_close_button'] = 'Cerrar'; -$string['fml_emailform_title'] = 'Enviar Correo'; -$string['fml_sending_text'] = 'Enviando Correos'; - -$string['fml_recipients_label'] = 'Para'; -$string['fml_mailsended_text'] = 'Correos Enviados'; - -$string['fml_email_footer_text'] = 'Este es un correo electrónico enviado con Note My Progress.'; -$string['fml_email_footer_prefix'] = 'Ve a'; -$string['fml_email_footer_suffix'] = 'para más información.'; -$string['fml_mailsended_text'] = 'Correos Enviados'; - -$string['fml_assign_url'] = '/mod/assign/view.php?id='; -$string['fml_assignment_url'] = '/mod/assignment/view.php?id='; -$string['fml_book_url'] = '/mod/book/view.php?id='; -$string['fml_chat_url'] = '/mod/chat/view.php?id='; -$string['fml_choice_url'] = '/mod/choice/view.php?id='; -$string['fml_data_url'] = '/mod/data/view.php?id='; -$string['fml_feedback_url'] = '/mod/feedback/view.php?id='; -$string['fml_folder_url'] = '/mod/folder/view.php?id='; -$string['fml_forum_url'] = '/mod/forum/view.php?id='; -$string['fml_glossary_url'] = '/mod/glossary/view.php?id='; -$string['fml_h5pactivity_url'] = '/mod/h5pactivity/view.php?id='; -$string['fml_imscp_url'] = '/mod/imscp/view.php?id='; -$string['fml_label_url'] = '/mod/label/view.php?id='; -$string['fml_lesson_url'] = '/mod/lesson/view.php?id='; -$string['fml_lti_url'] = '/mod/lti/view.php?id='; -$string['fml_page_url'] = '/mod/page/view.php?id='; -$string['fml_quiz_url'] = '/mod/quiz/view.php?id='; -$string['fml_resource_url'] = '/mod/resource/view.php?id='; -$string['fml_scorm_url'] = '/mod/scorm/view.php?id='; -$string['fml_survey_url'] = '/mod/survey/view.php?id='; -$string['fml_url_url'] = '/mod/url/view.php?id='; -$string['fml_wiki_url'] = '/mod/wiki/view.php?id='; -$string['fml_workshop_url'] = '/mod/workshop/view.php?id='; -$string['fml_course_url'] = '/course/view.php?id='; +$string['nmp_validation_subject_text'] = 'Asunto es requerido'; +$string['nmp_validation_message_text'] = 'Mensaje es requerido'; +$string['nmp_subject_label'] = 'Agrega un asunto'; +$string['nmp_message_label'] = 'Agrega un mensaje'; + +$string['nmp_submit_button'] = 'Enviar'; +$string['nmp_cancel_button'] = 'Cancelar'; +$string['nmp_close_button'] = 'Cerrar'; +$string['nmp_emailform_title'] = 'Enviar Correo'; +$string['nmp_sending_text'] = 'Enviando Correos'; + +$string['nmp_recipients_label'] = 'Para'; +$string['nmp_mailsended_text'] = 'Correos Enviados'; + +$string['nmp_email_footer_text'] = 'Este es un correo electrónico enviado con Note My Progress.'; +$string['nmp_email_footer_prefix'] = 'Ve a'; +$string['nmp_email_footer_suffix'] = 'para más información.'; +$string['nmp_mailsended_text'] = 'Correos Enviados'; + +$string['nmp_assign_url'] = '/mod/assign/view.php?id='; +$string['nmp_assignment_url'] = '/mod/assignment/view.php?id='; +$string['nmp_book_url'] = '/mod/book/view.php?id='; +$string['nmp_chat_url'] = '/mod/chat/view.php?id='; +$string['nmp_choice_url'] = '/mod/choice/view.php?id='; +$string['nmp_data_url'] = '/mod/data/view.php?id='; +$string['nmp_feedback_url'] = '/mod/feedback/view.php?id='; +$string['nmp_folder_url'] = '/mod/folder/view.php?id='; +$string['nmp_forum_url'] = '/mod/forum/view.php?id='; +$string['nmp_glossary_url'] = '/mod/glossary/view.php?id='; +$string['nmp_h5pactivity_url'] = '/mod/h5pactivity/view.php?id='; +$string['nmp_imscp_url'] = '/mod/imscp/view.php?id='; +$string['nmp_label_url'] = '/mod/label/view.php?id='; +$string['nmp_lesson_url'] = '/mod/lesson/view.php?id='; +$string['nmp_lti_url'] = '/mod/lti/view.php?id='; +$string['nmp_page_url'] = '/mod/page/view.php?id='; +$string['nmp_quiz_url'] = '/mod/quiz/view.php?id='; +$string['nmp_resource_url'] = '/mod/resource/view.php?id='; +$string['nmp_scorm_url'] = '/mod/scorm/view.php?id='; +$string['nmp_survey_url'] = '/mod/survey/view.php?id='; +$string['nmp_url_url'] = '/mod/url/view.php?id='; +$string['nmp_wiki_url'] = '/mod/wiki/view.php?id='; +$string['nmp_workshop_url'] = '/mod/workshop/view.php?id='; +$string['nmp_course_url'] = '/course/view.php?id='; /* Teacher Rating*/ @@ -406,26 +406,26 @@ $string['tr_item_grades_distribution_help_description_p2'] = 'En el eje x están $string['tr_item_grades_distribution_help_description_p3'] = 'Al hacer clic sobre la barra correspondiente a un rango se puede enviar un correo electrónico a los estudiantes dentro del rango de calificación.'; /* Grades */ -$string['fml_grades_select_label'] = 'Categoría de Calificación'; -$string['fml_grades_chart_title'] = 'Promedios de Actividades Evaluables'; -$string['fml_grades_yaxis_title'] = 'Promedio de Calificaciones (%)'; -$string['fml_grades_tooltip_average'] = 'Calificación Promedio'; -$string['fml_grades_tooltip_grade'] = 'Calificación Máxima'; -$string['fml_grades_tooltip_student'] = 'estudiante calificado de'; -$string['fml_grades_tooltip_students'] = 'estudiantes calificados de'; - -$string['fml_grades_best_grade'] = 'Mejor Calificación'; -$string['fml_grades_average_grade'] = 'Calificación Promedio'; -$string['fml_grades_worst_grade'] = 'Peor Calificación'; -$string['fml_grades_details_subtitle'] = 'Mejor, Peor y Calificación Promedio'; - -$string['fml_grades_distribution_subtitle'] = 'Distribución de Calificaciones'; -$string['fml_grades_distribution_greater_than'] = 'mayor al'; -$string['fml_grades_distribution_smaller_than'] = 'menor al'; -$string['fml_grades_distribution_yaxis_title'] = 'Número de Estudiantes'; -$string['fml_grades_distribution_tooltip_prefix'] = 'Rango'; -$string['fml_grades_distribution_tooltip_suffix'] = 'en este rango'; -$string["fml_view_details"] = "(Clic para ver detalles)"; +$string['nmp_grades_select_label'] = 'Categoría de Calificación'; +$string['nmp_grades_chart_title'] = 'Promedios de Actividades Evaluables'; +$string['nmp_grades_yaxis_title'] = 'Promedio de Calificaciones (%)'; +$string['nmp_grades_tooltip_average'] = 'Calificación Promedio'; +$string['nmp_grades_tooltip_grade'] = 'Calificación Máxima'; +$string['nmp_grades_tooltip_student'] = 'estudiante calificado de'; +$string['nmp_grades_tooltip_students'] = 'estudiantes calificados de'; + +$string['nmp_grades_best_grade'] = 'Mejor Calificación'; +$string['nmp_grades_average_grade'] = 'Calificación Promedio'; +$string['nmp_grades_worst_grade'] = 'Peor Calificación'; +$string['nmp_grades_details_subtitle'] = 'Mejor, Peor y Calificación Promedio'; + +$string['nmp_grades_distribution_subtitle'] = 'Distribución de Calificaciones'; +$string['nmp_grades_distribution_greater_than'] = 'mayor al'; +$string['nmp_grades_distribution_smaller_than'] = 'menor al'; +$string['nmp_grades_distribution_yaxis_title'] = 'Número de Estudiantes'; +$string['nmp_grades_distribution_tooltip_prefix'] = 'Rango'; +$string['nmp_grades_distribution_tooltip_suffix'] = 'en este rango'; +$string["nmp_view_details"] = "(Clic para ver detalles)"; /* Teacher Quiz */ @@ -440,26 +440,26 @@ $string['tq_hardest_questions_help_description_p1'] = 'Este gráfico muestra las $string['tq_hardest_questions_help_description_p2'] = 'En el eje x del gráfico se encuentran las preguntas de la evaluación identificadas por el nombre. En el eje y se encuentran el porcentaje de intentos incorrectos del total de intentos de la pregunta. Este eje permite identificar cuáles han sido las preguntas que han representado mayor dificultad para los estudiantes que rindieron la evaluación.'; $string['tq_hardest_questions_help_description_p3'] = 'Al hacer clic en alguna de las barras correspondiente a una pregunta es posible ver la pregunta de la evaluación en una ventana emergente.'; -$string["fml_quiz_info_text"] = "Esta Evaluación tiene"; -$string["fml_question_text"] = "pregunta"; -$string["fml_questions_text"] = "preguntas"; -$string["fml_doing_text_singular"] = "intento realizado por"; -$string["fml_doing_text_plural"] = "intentos realizados por"; -$string["fml_attempt_text"] = "intento"; -$string["fml_attempts_text"] = "intentos"; -$string["fml_student_text"] = "estudiante"; -$string["fml_students_text"] = "estudiantes"; -$string["fml_quiz"] = "Evaluaciones"; -$string["fml_questions_attempts_chart_title"] = "Intentos de Preguntas"; -$string["fml_questions_attempts_yaxis_title"] = "Número de Intentos"; -$string["fml_hardest_questions_chart_title"] = "Preguntas mas Difíciles"; -$string["fml_hardest_questions_yaxis_title"] = "Intentos Incorrectos"; -$string["fml_correct_attempt"] = "Correctos"; -$string["fml_partcorrect_attempt"] = "Parcialmente Correctos"; -$string["fml_incorrect_attempt"] = "Incorrectos"; -$string["fml_blank_attempt"] = "En Blanco"; -$string["fml_needgraded_attempt"] = "Sin Calificar"; -$string["fml_review_question"] = "(Clic para revisar la pregunta)"; +$string["nmp_quiz_info_text"] = "Esta Evaluación tiene"; +$string["nmp_question_text"] = "pregunta"; +$string["nmp_questions_text"] = "preguntas"; +$string["nmp_doing_text_singular"] = "intento realizado por"; +$string["nmp_doing_text_plural"] = "intentos realizados por"; +$string["nmp_attempt_text"] = "intento"; +$string["nmp_attempts_text"] = "intentos"; +$string["nmp_student_text"] = "estudiante"; +$string["nmp_students_text"] = "estudiantes"; +$string["nmp_quiz"] = "Evaluaciones"; +$string["nmp_questions_attempts_chart_title"] = "Intentos de Preguntas"; +$string["nmp_questions_attempts_yaxis_title"] = "Número de Intentos"; +$string["nmp_hardest_questions_chart_title"] = "Preguntas mas Difíciles"; +$string["nmp_hardest_questions_yaxis_title"] = "Intentos Incorrectos"; +$string["nmp_correct_attempt"] = "Correctos"; +$string["nmp_partcorrect_attempt"] = "Parcialmente Correctos"; +$string["nmp_incorrect_attempt"] = "Incorrectos"; +$string["nmp_blank_attempt"] = "En Blanco"; +$string["nmp_needgraded_attempt"] = "Sin Calificar"; +$string["nmp_review_question"] = "(Clic para revisar la pregunta)"; /* Deserción */ @@ -485,42 +485,42 @@ $string['td_user_grades_help_description_p1'] = 'Este gráfico muestra una compa $string['td_user_grades_help_description_p2'] = 'En el eje x del gráfico se muestran las diferentes actividades evaluables. En el eje y se encuentra la calificación del estudiante y la media de calificaciones de sus compañeros. Tanto la calificación del estudiante como la media del curso se muestran en porcentaje para mantener la simetría del gráfico.'; $string['td_user_grades_help_description_p3'] = 'Con un clic en la barra correspondiente a alguna actividad es posible dirigirse a dicha analizada.'; -$string["fml_cluster_label"] = "Grupo"; -$string["fml_cluster_select"] = "Grupo de Estudiantes"; -$string["fml_dropout_table_title"] = "Estudiantes del Grupo"; -$string["fml_dropout_see_profile"] = "Ver Perfil"; -$string["fml_dropout_user_never_access"] = "Nunca Accedido"; -$string["fml_dropout_student_progress_title"] = "Progreso del Estudiante"; -$string["fml_dropout_student_grade_title"] = "Calificación"; -$string['fml_dropout_no_data'] = "Aún no hay datos de desercion para este curso"; -$string['fml_dropout_no_users_cluster'] = "No hay estudiantes de este grupo"; -$string['fml_dropout_generate_data_manually'] = "Generar Manualmente"; -$string['fml_dropout_generating_data'] = "Generando datos..."; -$string["fml_modules_access_chart_title"] = "Recursos del Curso"; -$string["fml_modules_access_chart_series_total"] = "Total"; -$string["fml_modules_access_chart_series_complete"] = "Completos"; -$string["fml_modules_access_chart_series_viewed"] = "Accedidos"; -$string["fml_week_modules_chart_title"] = "Recursos por Semanas"; -$string["fml_modules_amount"] = "Cantidad de Recursos"; -$string["fml_modules_details"] = "(Clic para ver recursos)"; -$string["fml_modules_interaction"] = "interacción"; -$string["fml_modules_interactions"] = "interacciones"; -$string["fml_modules_viewed"] = "Accedido"; -$string["fml_modules_no_viewed"] = "No accedido"; -$string["fml_modules_complete"] = "Completado"; -$string["fml_sessions_evolution_chart_title"] = "Sesiones y Tiempo Invertido"; -$string["fml_sessions_evolution_chart_xaxis1"] = "Número de Sesiones"; -$string["fml_sessions_evolution_chart_xaxis2"] = "Cantidad de Horas"; -$string["fml_sessions_evolution_chart_legend1"] = "Cantidad de Sesiones"; -$string["fml_sessions_evolution_chart_legend2"] = "Tiempo Invertido"; -$string["fml_user_grades_chart_title"] = "Calificaciones"; -$string["fml_user_grades_chart_yaxis"] = "Calificación en Porcentaje"; -$string["fml_user_grades_chart_xaxis"] = "Actividades Evaluables"; -$string["fml_user_grades_chart_legend"] = "Curso (Media)"; -$string["fml_user_grades_chart_tooltip_no_graded"] = "Sin Calificaciones"; -$string["fml_user_grades_chart_view_activity"] = "Clic para ver la actividad"; -$string['fml_send_mail_to_user'] = 'Correo a'; -$string['fml_send_mail_to_group'] = 'Correo al Grupo'; +$string["nmp_cluster_label"] = "Grupo"; +$string["nmp_cluster_select"] = "Grupo de Estudiantes"; +$string["nmp_dropout_table_title"] = "Estudiantes del Grupo"; +$string["nmp_dropout_see_profile"] = "Ver Perfil"; +$string["nmp_dropout_user_never_access"] = "Nunca Accedido"; +$string["nmp_dropout_student_progress_title"] = "Progreso del Estudiante"; +$string["nmp_dropout_student_grade_title"] = "Calificación"; +$string['nmp_dropout_no_data'] = "Aún no hay datos de desercion para este curso"; +$string['nmp_dropout_no_users_cluster'] = "No hay estudiantes de este grupo"; +$string['nmp_dropout_generate_data_manually'] = "Generar Manualmente"; +$string['nmp_dropout_generating_data'] = "Generando datos..."; +$string["nmp_modules_access_chart_title"] = "Recursos del Curso"; +$string["nmp_modules_access_chart_series_total"] = "Total"; +$string["nmp_modules_access_chart_series_complete"] = "Completos"; +$string["nmp_modules_access_chart_series_viewed"] = "Accedidos"; +$string["nmp_week_modules_chart_title"] = "Recursos por Semanas"; +$string["nmp_modules_amount"] = "Cantidad de Recursos"; +$string["nmp_modules_details"] = "(Clic para ver recursos)"; +$string["nmp_modules_interaction"] = "interacción"; +$string["nmp_modules_interactions"] = "interacciones"; +$string["nmp_modules_viewed"] = "Accedido"; +$string["nmp_modules_no_viewed"] = "No accedido"; +$string["nmp_modules_complete"] = "Completado"; +$string["nmp_sessions_evolution_chart_title"] = "Sesiones y Tiempo Invertido"; +$string["nmp_sessions_evolution_chart_xaxis1"] = "Número de Sesiones"; +$string["nmp_sessions_evolution_chart_xaxis2"] = "Cantidad de Horas"; +$string["nmp_sessions_evolution_chart_legend1"] = "Cantidad de Sesiones"; +$string["nmp_sessions_evolution_chart_legend2"] = "Tiempo Invertido"; +$string["nmp_user_grades_chart_title"] = "Calificaciones"; +$string["nmp_user_grades_chart_yaxis"] = "Calificación en Porcentaje"; +$string["nmp_user_grades_chart_xaxis"] = "Actividades Evaluables"; +$string["nmp_user_grades_chart_legend"] = "Curso (Media)"; +$string["nmp_user_grades_chart_tooltip_no_graded"] = "Sin Calificaciones"; +$string["nmp_user_grades_chart_view_activity"] = "Clic para ver la actividad"; +$string['nmp_send_mail_to_user'] = 'Correo a'; +$string['nmp_send_mail_to_group'] = 'Correo al Grupo'; /*Student General*/ @@ -557,163 +557,163 @@ $string['ss_resources_access_help_description_p2'] = 'En el eje x del gráfico s $string['ss_resources_access_help_description_p3'] = 'Al hacer clic sobre alguna barra es posible ver los recursos y actividades disponibles en el curso (en una ventana emergente) junto con la cantidad de interacciones que has realizado con cada recurso y una etiqueta de no accedido, accedido o completado.'; -$string['fml_student_time_inverted_title'] = 'Tu Tiempo Invertido'; -$string['fml_student_time_inverted_x_axis'] = 'Número de Horas'; -$string['fml_student_inverted_time'] = 'Tiempo Invertido'; -$string['fml_student_expected_time'] = 'Tiempo que se debería Invertir'; +$string['nmp_student_time_inverted_title'] = 'Tu Tiempo Invertido'; +$string['nmp_student_time_inverted_x_axis'] = 'Número de Horas'; +$string['nmp_student_inverted_time'] = 'Tiempo Invertido'; +$string['nmp_student_expected_time'] = 'Tiempo que se debería Invertir'; -$string['fml_resource_access_title'] = 'Interacción por Tipos de Recursos'; -$string['fml_resource_access_y_axis'] = 'Cantidad de Recursos'; -$string['fml_resource_access_x_axis'] = 'Tipos de Recursos'; -$string['fml_resource_access_legend1'] = 'Completos'; -$string['fml_resource_access_legend2'] = 'Pendientes'; +$string['nmp_resource_access_title'] = 'Interacción por Tipos de Recursos'; +$string['nmp_resource_access_y_axis'] = 'Cantidad de Recursos'; +$string['nmp_resource_access_x_axis'] = 'Tipos de Recursos'; +$string['nmp_resource_access_legend1'] = 'Completos'; +$string['nmp_resource_access_legend2'] = 'Pendientes'; -$string['fml_week_progress_title'] = 'Progreso de la Semana'; +$string['nmp_week_progress_title'] = 'Progreso de la Semana'; /*Teacher Indicators*/ -$string['fml_teacher_indicators_title'] = 'Indicadores Generales'; -$string['fml_teacher_indicators_students'] = 'Estudiantes'; -$string['fml_teacher_indicators_weeks'] = 'Semanas'; -$string['fml_teacher_indicators_grademax'] = 'Calificación'; -$string['fml_teacher_indicators_course_start'] = 'Inicio'; -$string['fml_teacher_indicators_course_end'] = 'Fin'; -$string['fml_teacher_indicators_course_format'] = 'Formato'; -$string['fml_teacher_indicators_course_completion'] = 'Completitud de Módulos'; -$string["fml_teacher_indicators_student_progress"] = "Progreso del los Estudiantes"; -$string["fml_teacher_indicators_week_resources_chart_title"] = "Recursos por Semanas"; -$string["fml_teacher_indicators_week_resources_yaxis_title"] = "Cantidad de Recursos"; +$string['nmp_teacher_indicators_title'] = 'Indicadores Generales'; +$string['nmp_teacher_indicators_students'] = 'Estudiantes'; +$string['nmp_teacher_indicators_weeks'] = 'Semanas'; +$string['nmp_teacher_indicators_grademax'] = 'Calificación'; +$string['nmp_teacher_indicators_course_start'] = 'Inicio'; +$string['nmp_teacher_indicators_course_end'] = 'Fin'; +$string['nmp_teacher_indicators_course_format'] = 'Formato'; +$string['nmp_teacher_indicators_course_completion'] = 'Completitud de Módulos'; +$string["nmp_teacher_indicators_student_progress"] = "Progreso del los Estudiantes"; +$string["nmp_teacher_indicators_week_resources_chart_title"] = "Recursos por Semanas"; +$string["nmp_teacher_indicators_week_resources_yaxis_title"] = "Cantidad de Recursos"; /* Logs */ -$string['fml_logs_title'] = 'Descargar los registros de actividad'; -$string['fml_logs_help_description'] = 'Esta sección le permite descargar los registros de actividad que se han realizado. Es decir, tienes acceso a las acciones que han realizado los usuarios registrados en la plataforma en un formato de hoja de cálculo.'; -$string['fml_logs_title_MoodleSetpoint_title'] = 'Seleccione un rango de fechas para las acciones realizadas en Moodle'; -$string['fml_logs_title_MMPSetpoint_title'] = 'Seleccione un rango de fechas para las acciones realizadas en Note My Progress'; -$string['fml_logs_help'] = 'Esta sección le permite descargar un archivo de registro de las actividades realizadas.'; -$string['fml_logs_select_date'] = 'Seleccione un intervalo de tiempo para el registro'; -$string['fml_logs_first_date'] = 'Fecha de inicio'; -$string['fml_logs_last_date'] = 'Fecha de finalización'; -$string['fml_logs_valid_Moodlebtn'] = 'Descargar el registro de actividades de Moodle'; -$string['fml_logs_valid_NMPbtn'] = 'Descargar el registro de actividades de Note My Progress'; -$string['fml_logs_invalid_date'] = 'Introduzca una fecha'; -$string['fml_logs_download_btn'] = 'Descarga en curso'; -$string['fml_logs_download_nmp_help_title'] = 'Sobre las acciones realizadas en Note My Progress'; -$string['fml_logs_download_moodle_help_title'] = 'Sobre las acciones realizadas en Moodle'; -$string['fml_logs_download_nmp_help_description'] = 'El archivo de registro que se descarga enumera todas las acciones que ha realizado el usuario únicamente dentro del plugin Note My Progress (ver el progreso, ver los indicadores generales...)'; -$string['fml_logs_download_moodle_help_description'] = 'El archivo de registro que se sube enumera todas las acciones que ha realizado el usuario sólo dentro de Moodle (ver el curso, ver los recursos, enviar una tarea...)'; +$string['nmp_logs_title'] = 'Descargar los registros de actividad'; +$string['nmp_logs_help_description'] = 'Esta sección le permite descargar los registros de actividad que se han realizado. Es decir, tienes acceso a las acciones que han realizado los usuarios registrados en la plataforma en un formato de hoja de cálculo.'; +$string['nmp_logs_title_MoodleSetpoint_title'] = 'Seleccione un rango de fechas para las acciones realizadas en Moodle'; +$string['nmp_logs_title_MMPSetpoint_title'] = 'Seleccione un rango de fechas para las acciones realizadas en Note My Progress'; +$string['nmp_logs_help'] = 'Esta sección le permite descargar un archivo de registro de las actividades realizadas.'; +$string['nmp_logs_select_date'] = 'Seleccione un intervalo de tiempo para el registro'; +$string['nmp_logs_first_date'] = 'Fecha de inicio'; +$string['nmp_logs_last_date'] = 'Fecha de finalización'; +$string['nmp_logs_valid_Moodlebtn'] = 'Descargar el registro de actividades de Moodle'; +$string['nmp_logs_valid_NMPbtn'] = 'Descargar el registro de actividades de Note My Progress'; +$string['nmp_logs_invalid_date'] = 'Introduzca una fecha'; +$string['nmp_logs_download_btn'] = 'Descarga en curso'; +$string['nmp_logs_download_nmp_help_title'] = 'Sobre las acciones realizadas en Note My Progress'; +$string['nmp_logs_download_moodle_help_title'] = 'Sobre las acciones realizadas en Moodle'; +$string['nmp_logs_download_nmp_help_description'] = 'El archivo de registro que se descarga enumera todas las acciones que ha realizado el usuario únicamente dentro del plugin Note My Progress (ver el progreso, ver los indicadores generales...)'; +$string['nmp_logs_download_moodle_help_description'] = 'El archivo de registro que se sube enumera todas las acciones que ha realizado el usuario sólo dentro de Moodle (ver el curso, ver los recursos, enviar una tarea...)'; /* Logs CSV Header */ -$string['fml_logs_csv_headers_username'] = 'Nombre de usuario'; -$string['fml_logs_csv_headers_firstname'] = 'Nombre'; -$string['fml_logs_csv_headers_lastname'] = 'Apellido'; -$string['fml_logs_csv_headers_date'] = 'Fecha'; -$string['fml_logs_csv_headers_hour'] = 'Hora'; -$string['fml_logs_csv_headers_action'] = 'Acción'; -$string['fml_logs_csv_headers_coursename'] = 'Nombre del curso'; -$string['fml_logs_csv_headers_detail'] = 'Detalle'; -$string['fml_logs_csv_headers_detailtype'] = 'Tipo de objeto utilizado'; - -$string['fml_logs_error_begin_date_superior'] = 'La fecha de inicio no puede ser mayor que la fecha actual'; -$string['fml_logs_error_begin_date_inferior'] = 'La fecha de inicio debe ser anterior a la fecha de finalización'; -$string['fml_logs_error_empty_dates'] = 'Las fechas no pueden estar vacías'; -$string['fml_logs_error_problem_encountered'] = 'Se ha encontrado un problema, por favor, inténtelo de nuevo'; - -$string['fml_logs_success_file_downloaded'] = '¡Archivo cargado!'; - - -$string['fml_logs_moodle_csv_headers_role'] = 'Role'; -$string['fml_logs_moodle_csv_headers_email'] = 'Email'; -$string['fml_logs_moodle_csv_headers_username'] = 'Username'; -$string['fml_logs_moodle_csv_headers_fullname'] = 'Fullname'; -$string['fml_logs_moodle_csv_headers_date'] = 'Date'; -$string['fml_logs_moodle_csv_headers_hour'] = 'Hour'; -$string['fml_logs_moodle_csv_headers_action'] = 'Action'; -$string['fml_logs_moodle_csv_headers_courseid'] = 'CourseID'; -$string['fml_logs_moodle_csv_headers_coursename'] = 'Course_name'; -$string['fml_logs_moodle_csv_headers_detailid'] = 'Detail ID'; -$string['fml_logs_moodle_csv_headers_details'] = 'Details'; -$string['fml_logs_moodle_csv_headers_detailstype'] = 'Details_type'; - -$string['fml_logs_moodle_csv_headers_role_description'] = 'Da el rol que tiene el usuario en el curso en el que ha realizado una acción (alumno, profesor...)'; -$string['fml_logs_moodle_csv_headers_email_description'] = 'Proporciona el correo electrónico del usuario'; -$string['fml_logs_moodle_csv_headers_username_description'] = 'Da el nombre de usuario de moodle de la persona que realizó la acción'; -$string['fml_logs_moodle_csv_headers_fullname_description'] = 'Da el nombre completo del usuario (Nombre + Apellido)'; -$string['fml_logs_moodle_csv_headers_date_description'] = 'Indica la fecha en que se realizó la acción en el formato dd-MM-AAAA'; -$string['fml_logs_moodle_csv_headers_hour_description'] = 'Indica la hora en que se realizó la acción'; -$string['fml_logs_moodle_csv_headers_action_description'] = 'Dar un verbo que describa la acción realizada (por ejemplo, hacer clic, ver...)'; -$string['fml_logs_moodle_csv_headers_courseid_description'] = 'Indica el identificador del precio sobre el que se ha realizado la acción'; -$string['fml_logs_moodle_csv_headers_coursename_description'] = 'Indique el nombre de la acción en la que se realizó la acción'; -$string['fml_logs_moodle_csv_headers_detailid_description'] = 'Da el ID del objeto con el que el usuario ha interactuado'; -$string['fml_logs_moodle_csv_headers_details_description'] = 'Indicar el nombre del objeto al que se apunta'; -$string['fml_logs_moodle_csv_headers_detailstype_description'] = 'Indica el tipo de objeto al que se apunta (ejemplos de objetos: Repositorio, Concurso, Recursos...)'; - -$string['fml_logs_moodle_table_title'] = 'Descripción de las rúbricas'; -$string['fml_logs_moodle_table_subtitle'] = 'Acerca de los registros de Moodle'; - -$string['fml_logs_nmp_table_title'] = 'Descripción de las rúbricas'; -$string['fml_logs_nmp_table_subtitle'] = 'Acerca de los registros de Note My Progress'; - -$string['fml_logs_nmp_csv_headers_role'] = 'Role'; -$string['fml_logs_nmp_csv_headers_email'] = 'Email'; -$string['fml_logs_nmp_csv_headers_username'] = 'Username'; -$string['fml_logs_nmp_csv_headers_fullname'] = 'Fullname'; -$string['fml_logs_nmp_csv_headers_date'] = 'Date'; -$string['fml_logs_nmp_csv_headers_hour'] = 'Hour'; -$string['fml_logs_nmp_csv_headers_courseid'] = 'CourseID'; -$string['fml_logs_nmp_csv_headers_section_name'] = 'NMP_SECTION_NAME'; -$string['fml_logs_nmp_csv_headers_action_type'] = 'NMP_ACTION_TYPE'; - -$string['fml_logs_nmp_csv_headers_role_description'] = 'Da el rol que tiene el usuario en el curso en el que ha realizado una acción (alumno, profesor...)'; -$string['fml_logs_nmp_csv_headers_email_description'] = 'Proporciona el correo electrónico del usuari'; -$string['fml_logs_nmp_csv_headers_username_description'] = 'Da el nombre de usuario de moodle de la persona que realizó la acción'; -$string['fml_logs_nmp_csv_headers_fullname_description'] = 'Da el nombre completo del usuario (Nombre + Apellido)'; -$string['fml_logs_nmp_csv_headers_date_description'] = 'Indica la fecha en que se realizó la acción en el formato dd-MM-AAAA'; -$string['fml_logs_nmp_csv_headers_hour_description'] = 'Indica la hora en que se realizó la acción'; -$string['fml_logs_nmp_csv_headers_courseid_description'] = 'Indica el identificador del precio sobre el que se ha realizado la acción'; -$string['fml_logs_nmp_csv_headers_section_name_description'] = 'Da el nombre de la sección de note my progress en la que se encontraba el usuario cuando realizó la acción'; -$string['fml_logs_nmp_csv_headers_action_type_description'] = 'Proporciona una descripción completa de la acción realizada por el usuario en forma de verbo + sujeto + objeto (por ejemplo, download_moodle_logfile)'; - -$string['fml_logs_table_title'] = 'Título'; -$string['fml_logs_table_title_bis'] = 'Descripción'; - -$string['fml_logs_help_button_nmp'] = 'Sobre las acciones realizadas en Note My Progress'; -$string['fml_logs_help_button_moodle'] = 'Sobre las acciones realizadas en Moodle'; - - -$string['fml_logs_download_details_link'] = 'Leer más'; -$string['fml_logs_download_details_title'] = '¿Está seguro de que quiere un informe explicativo detallado?'; -$string['fml_logs_download_details_description'] = 'Si acepta, se descargará un archivo en formato PDF.'; -$string['fml_logs_download_details_ok'] = 'Descargar'; -$string['fml_logs_download_details_cancel'] = 'Cancelar'; -$string['fml_logs_download_details_validation'] = 'El informe se ha descargado'; +$string['nmp_logs_csv_headers_username'] = 'Nombre de usuario'; +$string['nmp_logs_csv_headers_firstname'] = 'Nombre'; +$string['nmp_logs_csv_headers_lastname'] = 'Apellido'; +$string['nmp_logs_csv_headers_date'] = 'Fecha'; +$string['nmp_logs_csv_headers_hour'] = 'Hora'; +$string['nmp_logs_csv_headers_action'] = 'Acción'; +$string['nmp_logs_csv_headers_coursename'] = 'Nombre del curso'; +$string['nmp_logs_csv_headers_detail'] = 'Detalle'; +$string['nmp_logs_csv_headers_detailtype'] = 'Tipo de objeto utilizado'; + +$string['nmp_logs_error_begin_date_superior'] = 'La fecha de inicio no puede ser mayor que la fecha actual'; +$string['nmp_logs_error_begin_date_inferior'] = 'La fecha de inicio debe ser anterior a la fecha de finalización'; +$string['nmp_logs_error_empty_dates'] = 'Las fechas no pueden estar vacías'; +$string['nmp_logs_error_problem_encountered'] = 'Se ha encontrado un problema, por favor, inténtelo de nuevo'; + +$string['nmp_logs_success_file_downloaded'] = '¡Archivo cargado!'; + + +$string['nmp_logs_moodle_csv_headers_role'] = 'Role'; +$string['nmp_logs_moodle_csv_headers_email'] = 'Email'; +$string['nmp_logs_moodle_csv_headers_username'] = 'Username'; +$string['nmp_logs_moodle_csv_headers_fullname'] = 'Fullname'; +$string['nmp_logs_moodle_csv_headers_date'] = 'Date'; +$string['nmp_logs_moodle_csv_headers_hour'] = 'Hour'; +$string['nmp_logs_moodle_csv_headers_action'] = 'Action'; +$string['nmp_logs_moodle_csv_headers_courseid'] = 'CourseID'; +$string['nmp_logs_moodle_csv_headers_coursename'] = 'Course_name'; +$string['nmp_logs_moodle_csv_headers_detailid'] = 'Detail ID'; +$string['nmp_logs_moodle_csv_headers_details'] = 'Details'; +$string['nmp_logs_moodle_csv_headers_detailstype'] = 'Details_type'; + +$string['nmp_logs_moodle_csv_headers_role_description'] = 'Da el rol que tiene el usuario en el curso en el que ha realizado una acción (alumno, profesor...)'; +$string['nmp_logs_moodle_csv_headers_email_description'] = 'Proporciona el correo electrónico del usuario'; +$string['nmp_logs_moodle_csv_headers_username_description'] = 'Da el nombre de usuario de moodle de la persona que realizó la acción'; +$string['nmp_logs_moodle_csv_headers_fullname_description'] = 'Da el nombre completo del usuario (Nombre + Apellido)'; +$string['nmp_logs_moodle_csv_headers_date_description'] = 'Indica la fecha en que se realizó la acción en el formato dd-MM-AAAA'; +$string['nmp_logs_moodle_csv_headers_hour_description'] = 'Indica la hora en que se realizó la acción'; +$string['nmp_logs_moodle_csv_headers_action_description'] = 'Dar un verbo que describa la acción realizada (por ejemplo, hacer clic, ver...)'; +$string['nmp_logs_moodle_csv_headers_courseid_description'] = 'Indica el identificador del precio sobre el que se ha realizado la acción'; +$string['nmp_logs_moodle_csv_headers_coursename_description'] = 'Indique el nombre de la acción en la que se realizó la acción'; +$string['nmp_logs_moodle_csv_headers_detailid_description'] = 'Da el ID del objeto con el que el usuario ha interactuado'; +$string['nmp_logs_moodle_csv_headers_details_description'] = 'Indicar el nombre del objeto al que se apunta'; +$string['nmp_logs_moodle_csv_headers_detailstype_description'] = 'Indica el tipo de objeto al que se apunta (ejemplos de objetos: Repositorio, Concurso, Recursos...)'; + +$string['nmp_logs_moodle_table_title'] = 'Descripción de las rúbricas'; +$string['nmp_logs_moodle_table_subtitle'] = 'Acerca de los registros de Moodle'; + +$string['nmp_logs_nmp_table_title'] = 'Descripción de las rúbricas'; +$string['nmp_logs_nmp_table_subtitle'] = 'Acerca de los registros de Note My Progress'; + +$string['nmp_logs_nmp_csv_headers_role'] = 'Role'; +$string['nmp_logs_nmp_csv_headers_email'] = 'Email'; +$string['nmp_logs_nmp_csv_headers_username'] = 'Username'; +$string['nmp_logs_nmp_csv_headers_fullname'] = 'Fullname'; +$string['nmp_logs_nmp_csv_headers_date'] = 'Date'; +$string['nmp_logs_nmp_csv_headers_hour'] = 'Hour'; +$string['nmp_logs_nmp_csv_headers_courseid'] = 'CourseID'; +$string['nmp_logs_nmp_csv_headers_section_name'] = 'NMP_SECTION_NAME'; +$string['nmp_logs_nmp_csv_headers_action_type'] = 'NMP_ACTION_TYPE'; + +$string['nmp_logs_nmp_csv_headers_role_description'] = 'Da el rol que tiene el usuario en el curso en el que ha realizado una acción (alumno, profesor...)'; +$string['nmp_logs_nmp_csv_headers_email_description'] = 'Proporciona el correo electrónico del usuari'; +$string['nmp_logs_nmp_csv_headers_username_description'] = 'Da el nombre de usuario de moodle de la persona que realizó la acción'; +$string['nmp_logs_nmp_csv_headers_fullname_description'] = 'Da el nombre completo del usuario (Nombre + Apellido)'; +$string['nmp_logs_nmp_csv_headers_date_description'] = 'Indica la fecha en que se realizó la acción en el formato dd-MM-AAAA'; +$string['nmp_logs_nmp_csv_headers_hour_description'] = 'Indica la hora en que se realizó la acción'; +$string['nmp_logs_nmp_csv_headers_courseid_description'] = 'Indica el identificador del precio sobre el que se ha realizado la acción'; +$string['nmp_logs_nmp_csv_headers_section_name_description'] = 'Da el nombre de la sección de note my progress en la que se encontraba el usuario cuando realizó la acción'; +$string['nmp_logs_nmp_csv_headers_action_type_description'] = 'Proporciona una descripción completa de la acción realizada por el usuario en forma de verbo + sujeto + objeto (por ejemplo, download_moodle_logfile)'; + +$string['nmp_logs_table_title'] = 'Título'; +$string['nmp_logs_table_title_bis'] = 'Descripción'; + +$string['nmp_logs_help_button_nmp'] = 'Sobre las acciones realizadas en Note My Progress'; +$string['nmp_logs_help_button_moodle'] = 'Sobre las acciones realizadas en Moodle'; + + +$string['nmp_logs_download_details_link'] = 'Leer más'; +$string['nmp_logs_download_details_title'] = '¿Está seguro de que quiere un informe explicativo detallado?'; +$string['nmp_logs_download_details_description'] = 'Si acepta, se descargará un archivo en formato PDF.'; +$string['nmp_logs_download_details_ok'] = 'Descargar'; +$string['nmp_logs_download_details_cancel'] = 'Cancelar'; +$string['nmp_logs_download_details_validation'] = 'El informe se ha descargado'; /* NoteMyProgress admin settings */ -$string['fml_settings_bddusername_label'] = 'Nombre de usuario de la base de datos'; -$string['fml_settings_bddusername_description'] = 'Este parámetro designa el nombre de usuario desde el que se puede acceder a la base de datos MongoDB. Si se introduce este parámetro, se debe introducir la contraseña así como el nombre de la base de datos de destino.'; -$string['fml_settings_bddusername_default'] = 'Vacío'; +$string['nmp_settings_bddusername_label'] = 'Nombre de usuario de la base de datos'; +$string['nmp_settings_bddusername_description'] = 'Este parámetro designa el nombre de usuario desde el que se puede acceder a la base de datos MongoDB. Si se introduce este parámetro, se debe introducir la contraseña así como el nombre de la base de datos de destino.'; +$string['nmp_settings_bddusername_default'] = 'Vacío'; -$string['fml_settings_bddpassword_label'] = 'Contraseña de la cuenta'; -$string['fml_settings_bddpassword_description'] = 'Este parámetro es la contraseña de la cuenta desde la que se puede acceder a la base de datos MongoDB. Si se introduce este parámetro, será necesario introducir el nombre de usuario así como el nombre de la base de datos de destino.'; -$string['fml_settings_bddpassword_default'] = 'Vacío'; +$string['nmp_settings_bddpassword_label'] = 'Contraseña de la cuenta'; +$string['nmp_settings_bddpassword_description'] = 'Este parámetro es la contraseña de la cuenta desde la que se puede acceder a la base de datos MongoDB. Si se introduce este parámetro, será necesario introducir el nombre de usuario así como el nombre de la base de datos de destino.'; +$string['nmp_settings_bddpassword_default'] = 'Vacío'; -$string['fml_settings_bddaddress_label'] = 'Dirección del servidor MongoDB *'; -$string['fml_settings_bddaddress_description'] = 'Este parámetro es la dirección desde la que se puede acceder a la base de datos MongoDB. Este parámetro es obligatorio y tiene la forma: 151.125.45.58 or yourserver.com'; -$string['fml_settings_bddaddress_default'] = 'localhost'; +$string['nmp_settings_bddaddress_label'] = 'Dirección del servidor MongoDB *'; +$string['nmp_settings_bddaddress_description'] = 'Este parámetro es la dirección desde la que se puede acceder a la base de datos MongoDB. Este parámetro es obligatorio y tiene la forma: 151.125.45.58 or yourserver.com'; +$string['nmp_settings_bddaddress_default'] = 'localhost'; -$string['fml_settings_bddport_label'] = 'Puerto de comunicación *'; -$string['fml_settings_bddport_description'] = 'Este parámetro designa el puerto a utilizar para comunicarse con la base de datos. Este parámetro es obligatorio y debe ser un número.'; -$string['fml_settings_bddport_default'] = '27017'; +$string['nmp_settings_bddport_label'] = 'Puerto de comunicación *'; +$string['nmp_settings_bddport_description'] = 'Este parámetro designa el puerto a utilizar para comunicarse con la base de datos. Este parámetro es obligatorio y debe ser un número.'; +$string['nmp_settings_bddport_default'] = '27017'; -$string['fml_settings_bddname_label'] = 'Nombre de la base de datos'; -$string['fml_settings_bddname_description'] = 'Este parámetro designa el nombre de la base de datos MongoDB en la que se guardará la información.'; -$string['fml_settings_bddname_default'] = 'Vacío'; +$string['nmp_settings_bddname_label'] = 'Nombre de la base de datos'; +$string['nmp_settings_bddname_description'] = 'Este parámetro designa el nombre de la base de datos MongoDB en la que se guardará la información.'; +$string['nmp_settings_bddname_default'] = 'Vacío'; //Planning /* Global */ @@ -868,7 +868,11 @@ $string['notes_message_not_updated'] = 'No se ha podido actualizar la nota.'; /*Metareflexion*/ +$string['metareflexion_goal1'] = "Aprender cosas nuevas"; +$string['metareflexion_goal2'] = "Repasando lo que he visto"; +$string['metareflexion_goal3'] = "Planificar mi aprendizaje"; +$string['metareflexion_no_modules_in_section'] = "Esta semana no hay módulos"; $string['compare_with_course'] = "Comparar mis resultados con los de mis compañeros"; $string['sr_menu_metareflexion'] = "Metareflexión"; $string['metareflexion_last_week_created'] = 'Reflexiones de la semana pasada guardadas'; @@ -1094,3 +1098,74 @@ $string['group_allstudent'] = 'Todos los estudiantes'; /* Admin Settings */ $string['nmp_use_navbar_menu'] = 'Habilitar nuevo menú'; $string['nmp_use_navbar_menu_desc'] = 'Despliega el menú del plugin en la barra de navegación superior, del contrario incluirá el menú en el bloque de navegación.'; +/* Gamification */ +$string['EnableGame']="Desactivar/Activar :"; +$string['studentRanking1']="¿Quieres aparecer en el ranking ? "; +$string['studentRanking2']="/!\ Te verán todos los inscritos en este curso que hayan aceptado. Aceptar es definitivo: "; +$string['studentRanking3']="Acceptar"; +$string['gamification_denied'] = 'La gamificación ha sido desactivada por su maestro'; +$string['tg_colon'] = '{$a->a}: {$a->b}'; +$string['tg_section_title'] = 'Configuración de gamificación del curso'; +$string['tg_section_help_title'] = 'Configuración de gamificación del curso'; +$string['tg_section_help_description'] = 'Puede dar la opción de gamificación a los estudiantes del curso.'; +$string['tg_save_warning_title'] = "¿Estás seguro de que quieres guardar los cambios?"; +$string['tg_save_warning_content'] = "Si cambia la configuración de la gamificación cuando el curso ya ha comenzado, los datos pueden perderse ..."; +$string['tg_confirm_ok'] = "Guardar"; +$string['tg_confirm_cancel'] = "Cancelar"; +$string['tg_save'] = "Guardar configuración"; +$string['tg_section_preview'] = 'Avance'; +$string['tg_section_experience'] = 'Puntos de experiencia'; +$string['tg_section_information'] = 'Información'; +$string['tg_section_ranking'] = 'Clasificación/informe'; +$string['tg_section_settings'] = 'Ajustes'; + +$string['tg_section_points'] = 'puntos'; +$string['tg_section_description'] = 'Descripción'; +$string['tg_section_no_description'] = 'Sin descripción'; +$string['tg_section_no_name'] = 'Sin nombre'; + +$string['tg_section_preview_next_level'] = 'al siguiente nivel'; +$string['tg_section_ranking_ranking_text'] = 'Clasificación'; +$string['tg_section_ranking_level'] = 'Nivel'; +$string['tg_section_ranking_student'] = 'Alumna'; +$string['tg_section_ranking_total'] = 'Total'; +$string['tg_section_ranking_progress'] = 'Progreso %'; + +$string['tg_section_settings_appearance'] = 'Apariencia'; +$string['tg_section_settings_appearance_title'] = 'Título'; +$string['tg_section_settings_levels'] = 'Configuración de nivel'; +$string['tg_section_settings_levels_quantity'] = 'Nivel'; +$string['tg_section_settings_levels_base_points'] = 'Puntos base'; +$string['tg_section_settings_levels_calculated'] = 'automático'; +$string['tg_section_settings_levels_manually'] = 'A mano'; +$string['tg_section_settings_levels_name'] = 'Nombre'; +$string['tg_section_settings_levels_required'] = 'Se requieren puntos'; +$string['tg_section_settings_rules'] = 'Establecimiento de reglas'; +$string['tg_section_settings_add_rule'] = 'Agregar nueva regla'; +$string['tg_section_settings_earn'] = 'Para este evento, gane:'; +$string['tg_section_settings_select_event'] = 'Seleccione un evento'; +$string['gm_Chart_Title']='Tabla de esparcimiento'; +$string['gm_Chart_Y']='Alumno'; + +$string['tg_timenow'] = 'Justo ahora'; +$string['tg_timeseconds'] = '{$a}s atrás'; +$string['tg_timeminutes'] = '{$a}m atrás'; +$string['tg_timehours'] = '{$a}h atrás'; +$string['tg_timedays'] = '{$a}d atrás'; +$string['tg_timeweeks'] = '{$a}w atrás'; +$string['tg_timewithinayearformat'] = '%b %e'; +$string['tg_timeolderyearformat'] = '%b %Y'; + +/* General Errors */ +$string['nmp_api_error_network'] = "Se ha producido un error en la comunicación con el servidor."; +$string['nmp_api_invalid_data'] = 'Datos Incorrectos'; +$string['nmp_api_json_decode_error'] = 'Error en decodificación de datos enviados'; +$string['nmp_api_invalid_token_error'] = 'El token enviado en la transacción no es válido, actualice la página'; +$string['nmp_api_invalid_transaction'] = 'La solicitud es incorrecta'; +$string['nmp_api_invalid_profile'] = 'No puedes hacer esta acción, tu perfil es incorrecto'; +$string['nmp_api_save_successful'] = 'Los datos se han guardado correctamente en el servidor'; +$string['nmp_api_cancel_action'] = 'Has cancelado la acción'; +$string['overview']='Visión de conjunto : '; +$string['game_point_error']='Los puntos son requeridos'; +$string['game_event_error']='El evento es requerido'; +$string['game_name_error']='Se requiere el nombre'; diff --git a/notemyprogress/lang/fr/local_notemyprogress.php b/notemyprogress/lang/fr/local_notemyprogress.php index bda740ecf1def50b47f641564576156088fe5cde..25080a1748217fc3e94731b842c08476837356c0 100644 --- a/notemyprogress/lang/fr/local_notemyprogress.php +++ b/notemyprogress/lang/fr/local_notemyprogress.php @@ -36,12 +36,12 @@ $string['helplabel'] = 'Aide'; $string['exitbutton'] = 'OK!'; $string['no_data'] = 'Il n\'y a aucune donnée à afficher'; $string['only_student'] = 'Ce rapport est réservé aux étudiants'; -$string["fml_send_mail"] = "(Cliquez pour envoyer un e-mail)"; -$string["fml_about"] = "À propos de ce graphique"; -$string["fml_about_table"] = "À propos de cette table"; -$string["fml_not_configured"] = "Non configuré"; -$string["fml_activated"] = "Activé"; -$string["fml_disabled"] = "Désactivé"; +$string["nmp_send_mail"] = "(Cliquez pour envoyer un e-mail)"; +$string["nmp_about"] = "À propos de ce graphique"; +$string["nmp_about_table"] = "À propos de cette table"; +$string["nmp_not_configured"] = "Non configuré"; +$string["nmp_activated"] = "Activé"; +$string["nmp_disabled"] = "Désactivé"; /* Menu */ $string['menu_main_title'] = "Progression du tableau de bord"; @@ -56,7 +56,7 @@ $string['menu_logs'] = "Journaux d'activités"; $string['menu_general'] = "Indicateurs généraux"; /* Nav Bar Menu */ -$string['togglemenu'] = 'Afficher / Masquer le menu FML'; +$string['togglemenu'] = 'Afficher / Masquer le menu nmp'; /* Composant de pagination */ $string['pagination_component_to'] = 'al'; @@ -132,77 +132,77 @@ $string['plugin_hidden'] = 'Rapports masqués.'; $string['title_conditions'] = 'Conditions d\' utilisation '; /* Heure */ -$string['fml_mon'] = 'Lundi'; -$string['fml_tue'] = 'Mardi'; -$string['fml_wed'] = 'Mercredi'; -$string['fml_thu'] = 'Jeudi'; -$string['fml_fri'] = 'Vendredi'; -$string['fml_sat'] = 'Samedi'; -$string['fml_sun'] = 'Dimanche'; -$string['fml_mon_short'] = 'Lun'; -$string['fml_tue_short'] = 'Mar'; -$string['fml_wed_short'] = 'Mer'; -$string['fml_thu_short'] = 'Jeu'; -$string['fml_fri_short'] = 'Ven'; -$string['fml_sat_short'] = 'Sam'; -$string['fml_sun_short'] = 'Dim'; - -$string['fml_jan'] = 'Janvier'; -$string['fml_feb'] = 'Février'; -$string['fml_mar'] = 'Mars'; -$string['fml_apr'] = 'Avril'; -$string['fml_may'] = 'Mai'; -$string['fml_jun'] = 'Juin'; -$string['fml_jul'] = 'Juillet'; -$string['fml_aug'] = 'Août'; -$string['fml_sep'] = 'Septembre'; -$string['fml_oct'] = 'Octobre'; -$string['fml_nov'] = 'Novembre'; -$string['fml_dec'] = 'Décembre'; -$string['fml_jan_short'] = 'Jan'; -$string['fml_feb_short'] = 'Fév'; -$string['fml_mar_short'] = 'Mar'; -$string['fml_apr_short'] = 'Apr'; -$string['fml_may_short'] = 'Mai'; -$string['fml_jun_short'] = 'Juin'; -$string['fml_jul_short'] = 'Juil'; -$string['fml_aug_short'] = 'Août'; -$string['fml_sep_short'] = 'Sep'; -$string['fml_oct_short'] = 'Oct'; -$string['fml_nov_short'] = 'Nov'; -$string['fml_dec_short'] = 'Déc'; - -$string['fml_week1'] = 'Sem 1'; -$string['fml_week2'] = 'Sem 2'; -$string['fml_week3'] = 'Sem 3'; -$string['fml_week4'] = 'Sem 4'; -$string['fml_week5'] = 'Sem 5'; -$string['fml_week6'] = 'Sem 6'; - -$string['fml_00'] = '00h'; -$string['fml_01'] = '01h'; -$string['fml_02'] = '02h'; -$string['fml_03'] = '03h'; -$string['fml_04'] = '04h'; -$string['fml_05'] = '05h'; -$string['fml_06'] = '06h'; -$string['fml_07'] = '07h'; -$string['fml_08'] = '08h'; -$string['fml_09'] = '09h'; -$string['fml_10'] = '10h'; -$string['fml_11'] = '11h'; -$string['fml_12'] = '12h'; -$string['fml_13'] = '13h'; -$string['fml_14'] = '14h'; -$string['fml_15'] = '15h'; -$string['fml_16'] = '16h'; -$string['fml_17'] = '17h'; -$string['fml_18'] = '18h'; -$string['fml_19'] = '19h'; -$string['fml_20'] = '20h'; -$string['fml_21'] = '21h'; -$string['fml_22'] = '22h'; -$string['fml_23'] = '23h'; +$string['nmp_mon'] = 'Lundi'; +$string['nmp_tue'] = 'Mardi'; +$string['nmp_wed'] = 'Mercredi'; +$string['nmp_thu'] = 'Jeudi'; +$string['nmp_fri'] = 'Vendredi'; +$string['nmp_sat'] = 'Samedi'; +$string['nmp_sun'] = 'Dimanche'; +$string['nmp_mon_short'] = 'Lun'; +$string['nmp_tue_short'] = 'Mar'; +$string['nmp_wed_short'] = 'Mer'; +$string['nmp_thu_short'] = 'Jeu'; +$string['nmp_fri_short'] = 'Ven'; +$string['nmp_sat_short'] = 'Sam'; +$string['nmp_sun_short'] = 'Dim'; + +$string['nmp_jan'] = 'Janvier'; +$string['nmp_feb'] = 'Février'; +$string['nmp_mar'] = 'Mars'; +$string['nmp_apr'] = 'Avril'; +$string['nmp_may'] = 'Mai'; +$string['nmp_jun'] = 'Juin'; +$string['nmp_jul'] = 'Juillet'; +$string['nmp_aug'] = 'Août'; +$string['nmp_sep'] = 'Septembre'; +$string['nmp_oct'] = 'Octobre'; +$string['nmp_nov'] = 'Novembre'; +$string['nmp_dec'] = 'Décembre'; +$string['nmp_jan_short'] = 'Jan'; +$string['nmp_feb_short'] = 'Fév'; +$string['nmp_mar_short'] = 'Mar'; +$string['nmp_apr_short'] = 'Apr'; +$string['nmp_may_short'] = 'Mai'; +$string['nmp_jun_short'] = 'Juin'; +$string['nmp_jul_short'] = 'Juil'; +$string['nmp_aug_short'] = 'Août'; +$string['nmp_sep_short'] = 'Sep'; +$string['nmp_oct_short'] = 'Oct'; +$string['nmp_nov_short'] = 'Nov'; +$string['nmp_dec_short'] = 'Déc'; + +$string['nmp_week1'] = 'Sem 1'; +$string['nmp_week2'] = 'Sem 2'; +$string['nmp_week3'] = 'Sem 3'; +$string['nmp_week4'] = 'Sem 4'; +$string['nmp_week5'] = 'Sem 5'; +$string['nmp_week6'] = 'Sem 6'; + +$string['nmp_00'] = '00h'; +$string['nmp_01'] = '01h'; +$string['nmp_02'] = '02h'; +$string['nmp_03'] = '03h'; +$string['nmp_04'] = '04h'; +$string['nmp_05'] = '05h'; +$string['nmp_06'] = '06h'; +$string['nmp_07'] = '07h'; +$string['nmp_08'] = '08h'; +$string['nmp_09'] = '09h'; +$string['nmp_10'] = '10h'; +$string['nmp_11'] = '11h'; +$string['nmp_12'] = '12h'; +$string['nmp_13'] = '13h'; +$string['nmp_14'] = '14h'; +$string['nmp_15'] = '15h'; +$string['nmp_16'] = '16h'; +$string['nmp_17'] = '17h'; +$string['nmp_18'] = '18h'; +$string['nmp_19'] = '19h'; +$string['nmp_20'] = '20h'; +$string['nmp_21'] = '21h'; +$string['nmp_22'] = '22h'; +$string['nmp_23'] = '23h'; /* Enseignant général */ $string['tg_section_help_title'] = 'Indicateurs généraux'; @@ -216,7 +216,7 @@ $string['tg_week_sessions_help_description_p2'] = 'Sur l\' axe des x du graphiqu $string['tg_progress_table_help_title'] = 'Progression des étudiants'; $string['tg_progress_table_help_description'] = 'Ce tableau montre une liste de tous les étudiants inscrits au cours avec leur progression, le nombre de sessions et le temps passé. Pour calculer la progression, toutes les ressources du cours ont été prises en compte, à l\'exception de celles de type <i> Label </i>. Pour déterminer si un étudiant a terminé une ressource, il est d\'abord vérifié pour voir si le paramètre d\'exhaustivité de la ressource est activé. Si tel est le cas, il est recherché si l\'élève a déjà terminé l\'activité basée sur cette configuration. Sinon, l’activité est considérée comme terminée si l’élève l’a vue au moins une fois. '; -$string['fml_title'] = 'Sessions d\'étude'; +$string['nmp_title'] = 'Sessions d\'étude'; $string['table_title'] = 'Progression du cours'; $string['thead_name'] = 'Prénom'; $string['thead_lastname'] = 'Nom'; @@ -225,25 +225,25 @@ $string['thead_progress'] = 'Progression (%)'; $string['thead_sessions'] = 'Sessions'; $string['thead_time'] = 'Temps investi'; -$string['fml_module_label'] = 'ressource'; -$string['fml_modules_label'] = 'Ressources'; -$string['fml_of_conector'] = 'de'; -$string['fml_finished_label'] = 'terminé'; -$string['fml_finisheds_label'] = 'terminé'; +$string['nmp_module_label'] = 'ressource'; +$string['nmp_modules_label'] = 'Ressources'; +$string['nmp_of_conector'] = 'de'; +$string['nmp_finished_label'] = 'terminé'; +$string['nmp_finisheds_label'] = 'terminé'; -$string['fml_smaller30'] = 'Moins de 30 minutes'; -$string['fml_greater30'] = 'Plus de 30 minutes'; -$string['fml_greater60'] = 'Plus de 60 minutes'; +$string['nmp_smaller30'] = 'Moins de 30 minutes'; +$string['nmp_greater30'] = 'Plus de 30 minutes'; +$string['nmp_greater60'] = 'Plus de 60 minutes'; -$string['fml_session_count_title'] = 'Sessions de la semaine'; -$string['fml_session_count_yaxis_title'] = 'Nombre de sessions'; -$string['fml_session_count_tooltip_suffix'] = 'sessions'; +$string['nmp_session_count_title'] = 'Sessions de la semaine'; +$string['nmp_session_count_yaxis_title'] = 'Nombre de sessions'; +$string['nmp_session_count_tooltip_suffix'] = 'sessions'; -$string['fml_hours_sessions_title'] = 'Sessions par jour et heure'; -$string['fml_weeks_sessions_title'] = 'Sessions par semaine'; +$string['nmp_hours_sessions_title'] = 'Sessions par jour et heure'; +$string['nmp_weeks_sessions_title'] = 'Sessions par semaine'; -$string["fml_session_text"] = "session"; -$string["fml_sessions_text"] = "sessions"; +$string["nmp_session_text"] = "session"; +$string["nmp_sessions_text"] = "sessions"; $string['ss_change_timezone'] = 'Fuseau horaire:'; // $string['ss_activity_inside_plataform_student'] = 'Mon activité sur la plateforme'; @@ -268,28 +268,28 @@ $string['ts_sessions_count_help_title'] = 'Sessions de la semaine'; $string['ts_sessions_count_help_description_p1'] = 'Ce graphique montre le nombre de sessions classées par durée dans des plages horaires: moins de 30 minutes, plus de 30 minutes et plus de 60 minutes. l\'accès au cours par l\'étudiant est considéré comme le début d\'une session d\'étude. Une session est considérée comme terminée lorsque le temps entre deux interactions d\'un élève dépasse 30 minutes. '; $string['ts_sessions_count_help_description_p2'] = 'Sur l\'axe des x du graphique se trouvent les jours de la semaine configurés. Sur l’axe des y figure le nombre de sessions effectuées. '; -$string['fml_time_inverted_title'] = 'Temps investi par les étudiants sur le cours'; -$string['fml_time_inverted_x_axis'] = 'Nombre d\'heures'; -$string['fml_inverted_time'] = 'Temps moyen investi'; -$string['fml_expected_time'] = 'Temps moyen à investir'; - -$string['fml_year'] = 'année'; -$string['fml_years'] = 'années'; -$string['fml_month'] = 'mois'; -$string['fml_months'] = 'mois'; -$string['fml_day'] = 'jour'; -$string['fml_days'] = 'jours'; -$string['fml_hour'] = 'heure'; -$string['fml_hours'] = 'heures'; -$string['fml_hours_short'] = 'h'; -$string['fml_minute'] = 'minute'; -$string['fml_minutes'] = 'minutes'; -$string['fml_minutes_short'] = 'm'; -$string['fml_second'] = 'seconde'; -$string['fml_seconds'] = 'secondes'; -$string['fml_seconds_short'] = 's'; -$string['fml_ago'] = 'avant'; -$string['fml_now'] = 'à l\'instant'; +$string['nmp_time_inverted_title'] = 'Temps investi par les étudiants sur le cours'; +$string['nmp_time_inverted_x_axis'] = 'Nombre d\'heures'; +$string['nmp_inverted_time'] = 'Temps moyen investi'; +$string['nmp_expected_time'] = 'Temps moyen à investir'; + +$string['nmp_year'] = 'année'; +$string['nmp_years'] = 'années'; +$string['nmp_month'] = 'mois'; +$string['nmp_months'] = 'mois'; +$string['nmp_day'] = 'jour'; +$string['nmp_days'] = 'jours'; +$string['nmp_hour'] = 'heure'; +$string['nmp_hours'] = 'heures'; +$string['nmp_hours_short'] = 'h'; +$string['nmp_minute'] = 'minute'; +$string['nmp_minutes'] = 'minutes'; +$string['nmp_minutes_short'] = 'm'; +$string['nmp_second'] = 'seconde'; +$string['nmp_seconds'] = 'secondes'; +$string['nmp_seconds_short'] = 's'; +$string['nmp_ago'] = 'avant'; +$string['nmp_now'] = 'à l\'instant'; /*Devoirs des enseignants */ @@ -303,91 +303,91 @@ $string['ta_access_content_help_description_p1'] = 'Ce graphique montre le nombr $string['ta_access_content_help_description_p2'] = 'L\' axe des x du graphique montre le nombre d\'étudiants inscrits au cours. l\'axe des y du graphique montre les ressources des sections affectées à la semaine. De plus, ce graphique vous permet d’envoyer un e-mail aux étudiants qui ont accédé à la ressource ou à ceux qui n’y ont pas accédé en cliquant sur le graphique. '; /* Assign Submissions */ -$string['fml_intime_sub'] = 'Devoir déposé à temps'; -$string['fml_late_sub'] = 'Devoir déposé en retard'; -$string['fml_no_sub'] = 'Devoir non déposé'; -$string['fml_assign_nodue'] = 'Pas de date limite'; -$string['fml_assignsubs_title'] = 'Suivi des devoirs soumis dans les zones de dépôts'; -$string['fml_assignsubs_yaxis'] = 'Nombre d\'étudiants'; +$string['nmp_intime_sub'] = 'Devoir déposé à temps'; +$string['nmp_late_sub'] = 'Devoir déposé en retard'; +$string['nmp_no_sub'] = 'Devoir non déposé'; +$string['nmp_assign_nodue'] = 'Pas de date limite'; +$string['nmp_assignsubs_title'] = 'Suivi des devoirs soumis dans les zones de dépôts'; +$string['nmp_assignsubs_yaxis'] = 'Nombre d\'étudiants'; /* Accès au contenu */ -$string['fml_assign'] = 'Tâche'; -$string['fml_assignment'] = 'Tâche'; -$string['fml_attendance'] = 'Participation'; -$string['fml_book'] = 'Livre'; -$string['fml_chat'] = 'Chatter'; -$string['fml_choice'] = 'Choix'; -$string['fml_data'] = 'Base de données'; -$string['fml_feedback'] = 'Commentaires'; -$string['fml_folder'] = 'Dossier'; -$string['fml_forum'] = 'Forum'; -$string['fml_glossary'] = 'Glossaire'; -$string['fml_h5pactivity'] = 'H5P'; -$string['fml_imscp'] = 'Contenu IMS'; -$string['fml_label'] = 'Label'; -$string['fml_lesson'] = 'Leçon'; -$string['fml_lti'] = 'Contenu IMS'; -$string['fml_page'] = 'Page'; -$string['fml_quiz'] = 'Quiz'; -$string['fml_resource'] = 'Ressource'; -$string['fml_scorm'] = 'Package SCORM'; -$string['fml_survey'] = 'Sondage'; -$string['fml_url'] = 'Url'; -$string['fml_wiki'] = 'Wiki'; -$string['fml_workshop'] = 'Atelier'; - -$string['fml_access'] = 'Ressources accédées'; -$string['fml_no_access'] = 'Ressources non accédées'; -$string['fml_access_chart_title'] = 'Accès au contenu du cours'; -$string['fml_access_chart_yaxis_label'] = 'Nombre d\'étudiants'; -$string['fml_access_chart_suffix'] = 'étudiants'; +$string['nmp_assign'] = 'Tâche'; +$string['nmp_assignment'] = 'Tâche'; +$string['nmp_attendance'] = 'Participation'; +$string['nmp_book'] = 'Livre'; +$string['nmp_chat'] = 'Chatter'; +$string['nmp_choice'] = 'Choix'; +$string['nmp_data'] = 'Base de données'; +$string['nmp_feedback'] = 'Commentaires'; +$string['nmp_folder'] = 'Dossier'; +$string['nmp_forum'] = 'Forum'; +$string['nmp_glossary'] = 'Glossaire'; +$string['nmp_h5pactivity'] = 'H5P'; +$string['nmp_imscp'] = 'Contenu IMS'; +$string['nmp_label'] = 'Label'; +$string['nmp_lesson'] = 'Leçon'; +$string['nmp_lti'] = 'Contenu IMS'; +$string['nmp_page'] = 'Page'; +$string['nmp_quiz'] = 'Quiz'; +$string['nmp_resource'] = 'Ressource'; +$string['nmp_scorm'] = 'Package SCORM'; +$string['nmp_survey'] = 'Sondage'; +$string['nmp_url'] = 'Url'; +$string['nmp_wiki'] = 'Wiki'; +$string['nmp_workshop'] = 'Atelier'; + +$string['nmp_access'] = 'Ressources accédées'; +$string['nmp_no_access'] = 'Ressources non accédées'; +$string['nmp_access_chart_title'] = 'Accès au contenu du cours'; +$string['nmp_access_chart_yaxis_label'] = 'Nombre d\'étudiants'; +$string['nmp_access_chart_suffix'] = 'étudiants'; /* Email */ -$string['fml_validation_subject_text'] = 'Le sujet est obligatoire'; -$string['fml_validation_message_text'] = 'Veuillez écrire un message'; -$string['fml_subject_label'] = 'Ajouter un sujet'; -$string['fml_message_label'] = 'Ajouter un message'; - -$string['fml_submit_button'] = 'Envoyer'; -$string['fml_cancel_button'] = 'Annuler'; -$string['fml_close_button'] = 'Fermer'; -$string['fml_emailform_title'] = 'Envoyer un e-mail'; -$string['fml_sending_text'] = 'Envoi de courriels'; - -$string['fml_recipients_label'] = 'À'; -$string['fml_mailsended_text'] = 'Emails envoyés'; - -$string['fml_email_footer_text'] = 'Ceci est un email envoyé avec note my progress.'; -$string['fml_email_footer_prefix'] = 'Aller à'; -$string['fml_email_footer_suffix'] = 'pour plus d\'informations.'; -$string['fml_mailsended_text'] = 'Emails envoyés'; - -$string['fml_assign_url'] = '/mod/assign/view.php?id='; -$string['fml_assignment_url'] = '/mod/assignment/view.php?id='; -$string['fml_book_url'] = '/mod/book/view.php?id='; -$string['fml_chat_url'] = '/mod/chat/view.php?id='; -$string['fml_choice_url'] = '/mod/choice/view.php?id='; -$string['fml_data_url'] = '/mod/data/view.php?id='; -$string['fml_feedback_url'] = '/mod/feedback/view.php?id='; -$string['fml_folder_url'] = '/mod/folder/view.php?id='; -$string['fml_forum_url'] = '/mod/forum/view.php?id='; -$string['fml_glossary_url'] = '/mod/glossary/view.php?id='; -$string['fml_h5pactivity_url'] = '/mod/h5pactivity/view.php?id='; -$string['fml_imscp_url'] = '/mod/imscp/view.php?id='; -$string['fml_label_url'] = '/mod/label/view.php?id='; -$string['fml_lesson_url'] = '/mod/lesson/view.php?id='; -$string['fml_lti_url'] = '/mod/lti/view.php?id='; -$string['fml_page_url'] = '/mod/page/view.php?id='; -$string['fml_quiz_url'] = '/mod/quiz/view.php?id='; -$string['fml_resource_url'] = '/mod/resource/view.php?id='; -$string['fml_scorm_url'] = '/mod/scorm/view.php?id='; -$string['fml_survey_url'] = '/mod/survey/view.php?id='; -$string['fml_url_url'] = '/mod/url/view.php?id='; -$string['fml_wiki_url'] = '/mod/wiki/view.php?id='; -$string['fml_workshop_url'] = '/mod/workshop/view.php?id='; -$string['fml_course_url'] = '/course/view.php?id='; +$string['nmp_validation_subject_text'] = 'Le sujet est obligatoire'; +$string['nmp_validation_message_text'] = 'Veuillez écrire un message'; +$string['nmp_subject_label'] = 'Ajouter un sujet'; +$string['nmp_message_label'] = 'Ajouter un message'; + +$string['nmp_submit_button'] = 'Envoyer'; +$string['nmp_cancel_button'] = 'Annuler'; +$string['nmp_close_button'] = 'Fermer'; +$string['nmp_emailform_title'] = 'Envoyer un e-mail'; +$string['nmp_sending_text'] = 'Envoi de courriels'; + +$string['nmp_recipients_label'] = 'À'; +$string['nmp_mailsended_text'] = 'Emails envoyés'; + +$string['nmp_email_footer_text'] = 'Ceci est un email envoyé avec note my progress.'; +$string['nmp_email_footer_prefix'] = 'Aller à'; +$string['nmp_email_footer_suffix'] = 'pour plus d\'informations.'; +$string['nmp_mailsended_text'] = 'Emails envoyés'; + +$string['nmp_assign_url'] = '/mod/assign/view.php?id='; +$string['nmp_assignment_url'] = '/mod/assignment/view.php?id='; +$string['nmp_book_url'] = '/mod/book/view.php?id='; +$string['nmp_chat_url'] = '/mod/chat/view.php?id='; +$string['nmp_choice_url'] = '/mod/choice/view.php?id='; +$string['nmp_data_url'] = '/mod/data/view.php?id='; +$string['nmp_feedback_url'] = '/mod/feedback/view.php?id='; +$string['nmp_folder_url'] = '/mod/folder/view.php?id='; +$string['nmp_forum_url'] = '/mod/forum/view.php?id='; +$string['nmp_glossary_url'] = '/mod/glossary/view.php?id='; +$string['nmp_h5pactivity_url'] = '/mod/h5pactivity/view.php?id='; +$string['nmp_imscp_url'] = '/mod/imscp/view.php?id='; +$string['nmp_label_url'] = '/mod/label/view.php?id='; +$string['nmp_lesson_url'] = '/mod/lesson/view.php?id='; +$string['nmp_lti_url'] = '/mod/lti/view.php?id='; +$string['nmp_page_url'] = '/mod/page/view.php?id='; +$string['nmp_quiz_url'] = '/mod/quiz/view.php?id='; +$string['nmp_resource_url'] = '/mod/resource/view.php?id='; +$string['nmp_scorm_url'] = '/mod/scorm/view.php?id='; +$string['nmp_survey_url'] = '/mod/survey/view.php?id='; +$string['nmp_url_url'] = '/mod/url/view.php?id='; +$string['nmp_wiki_url'] = '/mod/wiki/view.php?id='; +$string['nmp_workshop_url'] = '/mod/workshop/view.php?id='; +$string['nmp_course_url'] = '/course/view.php?id='; /* Évaluation de l\'enseignant */ @@ -406,26 +406,26 @@ $string['tr_item_grades_distribution_help_description_p2'] = 'Sur l\' axe des x $string['tr_item_grades_distribution_help_description_p3'] = 'En cliquant sur la barre correspondant à un rang, vous pouvez envoyer un email aux étudiants dans le classement.'; /* Notes */ -$string['fml_grades_select_label'] = 'Catégorie de note'; -$string['fml_grades_chart_title'] = 'Moyennes des activités évaluables'; -$string['fml_grades_yaxis_title'] = 'Note moyenne (%)'; -$string['fml_grades_tooltip_average'] = 'Note moyenne'; -$string['fml_grades_tooltip_grade'] = 'Note maximale'; -$string['fml_grades_tooltip_student'] = 'étudiant noté de'; -$string['fml_grades_tooltip_students'] = 'élèves notés de'; - -$string['fml_grades_best_grade'] = 'Meilleure note'; -$string['fml_grades_average_grade'] = 'Note moyenne'; -$string['fml_grades_worst_grade'] = 'Pire note'; -$string['fml_grades_details_subtitle'] = 'Meilleure note, pire note et note moyenne'; - -$string['fml_grades_distribution_subtitle'] = 'Répartition des notes'; -$string['fml_grades_distribution_greater_than'] = 'supérieur à'; -$string['fml_grades_distribution_smaller_than'] = 'inférieur à'; -$string['fml_grades_distribution_yaxis_title'] = 'Nombre d\'étudiants'; -$string['fml_grades_distribution_tooltip_prefix'] = 'Plage'; -$string['fml_grades_distribution_tooltip_suffix'] = 'dans cette plage'; -$string["fml_view_details"] = "(Cliquez pour voir les détails)"; +$string['nmp_grades_select_label'] = 'Catégorie de note'; +$string['nmp_grades_chart_title'] = 'Moyennes des activités évaluables'; +$string['nmp_grades_yaxis_title'] = 'Note moyenne (%)'; +$string['nmp_grades_tooltip_average'] = 'Note moyenne'; +$string['nmp_grades_tooltip_grade'] = 'Note maximale'; +$string['nmp_grades_tooltip_student'] = 'étudiant noté de'; +$string['nmp_grades_tooltip_students'] = 'élèves notés de'; + +$string['nmp_grades_best_grade'] = 'Meilleure note'; +$string['nmp_grades_average_grade'] = 'Note moyenne'; +$string['nmp_grades_worst_grade'] = 'Pire note'; +$string['nmp_grades_details_subtitle'] = 'Meilleure note, pire note et note moyenne'; + +$string['nmp_grades_distribution_subtitle'] = 'Répartition des notes'; +$string['nmp_grades_distribution_greater_than'] = 'supérieur à'; +$string['nmp_grades_distribution_smaller_than'] = 'inférieur à'; +$string['nmp_grades_distribution_yaxis_title'] = 'Nombre d\'étudiants'; +$string['nmp_grades_distribution_tooltip_prefix'] = 'Plage'; +$string['nmp_grades_distribution_tooltip_suffix'] = 'dans cette plage'; +$string["nmp_view_details"] = "(Cliquez pour voir les détails)"; /* Quiz enseignant */ @@ -440,26 +440,26 @@ $string['tq_hardest_questions_help_description_p1'] = 'Ce graphique montre les q $string['tq_hardest_questions_help_description_p2'] = 'Sur l\' axe des x du graphique se trouvent les questions d\'évaluation identifiées par leur nom. l\'axe des y montre le pourcentage de tentatives incorrectes par rapport au nombre total de tentatives pour la question. Cet axe permet d\'identifier les questions qui ont représenté la plus grande difficulté pour les étudiants qui ont passé l\'évaluation. '; $string['tq_hardest_questions_help_description_p3'] = 'En cliquant sur l\' une des barres correspondant à une question, il est possible de voir la question d\'évaluation dans une fenêtre pop-up.'; -$string["fml_quiz_info_text"] = "Cette évaluation a"; -$string["fml_question_text"] = "question"; -$string["fml_questions_text"] = "questions"; -$string["fml_doing_text_singular"] = "tentative faite par"; -$string["fml_doing_text_plural"] = "tentatives faites par"; -$string["fml_attempt_text"] = "tentative"; -$string["fml_attempts_text"] = "tentatives"; -$string["fml_student_text"] = "étudiant"; -$string["fml_students_text"] = "étudiants"; -$string["fml_quiz"] = "Évaluations"; -$string["fml_questions_attempts_chart_title"] = "Tentatives de questions"; -$string["fml_questions_attempts_yaxis_title"] = "Nombre de tentatives"; -$string["fml_hardest_questions_chart_title"] = "Questions plus difficiles"; -$string["fml_hardest_questions_yaxis_title"] = "Tentatives incorrectes"; -$string["fml_correct_attempt"] = "Correcte"; -$string["fml_partcorrect_attempt"] = "Partiellement correcte"; -$string["fml_incorrect_attempt"] = "Incorrecte"; -$string["fml_blank_attempt"] = "Vide"; -$string["fml_needgraded_attempt"] = "Non noté"; -$string["fml_review_question"] = "(Cliquez pour revoir la question)"; +$string["nmp_quiz_info_text"] = "Cette évaluation a"; +$string["nmp_question_text"] = "question"; +$string["nmp_questions_text"] = "questions"; +$string["nmp_doing_text_singular"] = "tentative faite par"; +$string["nmp_doing_text_plural"] = "tentatives faites par"; +$string["nmp_attempt_text"] = "tentative"; +$string["nmp_attempts_text"] = "tentatives"; +$string["nmp_student_text"] = "étudiant"; +$string["nmp_students_text"] = "étudiants"; +$string["nmp_quiz"] = "Évaluations"; +$string["nmp_questions_attempts_chart_title"] = "Tentatives de questions"; +$string["nmp_questions_attempts_yaxis_title"] = "Nombre de tentatives"; +$string["nmp_hardest_questions_chart_title"] = "Questions plus difficiles"; +$string["nmp_hardest_questions_yaxis_title"] = "Tentatives incorrectes"; +$string["nmp_correct_attempt"] = "Correcte"; +$string["nmp_partcorrect_attempt"] = "Partiellement correcte"; +$string["nmp_incorrect_attempt"] = "Incorrecte"; +$string["nmp_blank_attempt"] = "Vide"; +$string["nmp_needgraded_attempt"] = "Non noté"; +$string["nmp_review_question"] = "(Cliquez pour revoir la question)"; /* Décrochage */ @@ -485,42 +485,42 @@ $string['td_user_grades_help_description_p1'] = 'Ce graphique montre une compara $string['td_user_grades_help_description_p2'] = 'Les différentes activités évaluables sont affichées sur l\' axe des x du graphique. Sur l\'axe des y se trouvent la note de l\'élève et la note moyenne de ses pairs. La note de l\'étudiant et la moyenne du cours sont affichées sous forme de pourcentage pour maintenir la symétrie du graphique. '; $string['td_user_grades_help_description_p3'] = 'Avec un clic sur la barre correspondant à une activité, il est possible d\' aller à ladite analysée. '; -$string["fml_cluster_label"] = "Groupe"; -$string["fml_cluster_select"] = 'Groupe d\'étudiants'; -$string["fml_dropout_table_title"] = "Étudiants du groupe"; -$string["fml_dropout_see_profile"] = "Afficher le profil"; -$string["fml_dropout_user_never_access"] = "Jamais accédé"; -$string["fml_dropout_student_progress_title"] = "Progression de l'élève"; -$string["fml_dropout_student_grade_title"] = "Note"; -$string['fml_dropout_no_data'] = "Il n'y a pas encore de données de décrochage scolaire concernant ce cours."; -$string['fml_dropout_no_users_cluster'] = "Il n'y a aucun étudiant dans ce groupe"; -$string['fml_dropout_generate_data_manually'] = "Générer manuellement les données"; -$string['fml_dropout_generating_data'] = "Génération de données..."; -$string["fml_modules_access_chart_title"] = "Ressources du cours"; -$string["fml_modules_access_chart_series_total"] = "Total"; -$string["fml_modules_access_chart_series_complete"] = "Terminé"; -$string["fml_modules_access_chart_series_viewed"] = "Consulté"; -$string["fml_week_modules_chart_title"] = "Ressources par semaines"; -$string["fml_modules_amount"] = "Quantité de ressources"; -$string["fml_modules_details"] = "(Cliquez pour voir les ressources)"; -$string["fml_modules_interaction"] = "interaction"; -$string["fml_modules_interactions"] = "interactions"; -$string["fml_modules_viewed"] = "Consulté"; -$string["fml_modules_no_viewed"] = "Non consulté"; -$string["fml_modules_complete"] = "Terminé"; -$string["fml_sessions_evolution_chart_title"] = "Sessions et temps investi"; -$string["fml_sessions_evolution_chart_xaxis1"] = "Nombre de sessions"; -$string["fml_sessions_evolution_chart_xaxis2"] = "Nombre d'heures"; -$string["fml_sessions_evolution_chart_legend1"] = "Nombre de sessions"; -$string["fml_sessions_evolution_chart_legend2"] = "Temps investi"; -$string["fml_user_grades_chart_title"] = "Notes"; -$string["fml_user_grades_chart_yaxis"] = "Note en pourcentage"; -$string["fml_user_grades_chart_xaxis"] = "Activités évaluables"; -$string["fml_user_grades_chart_legend"] = "Cours (moyen)"; -$string["fml_user_grades_chart_tooltip_no_graded"] = "Aucune note"; -$string["fml_user_grades_chart_view_activity"] = "Cliquez pour voir l'activité"; -$string['fml_send_mail_to_user'] = 'Envoyer un e-mail à'; -$string['fml_send_mail_to_group'] = 'Envoyer un e-mail au groupe'; +$string["nmp_cluster_label"] = "Groupe"; +$string["nmp_cluster_select"] = 'Groupe d\'étudiants'; +$string["nmp_dropout_table_title"] = "Étudiants du groupe"; +$string["nmp_dropout_see_profile"] = "Afficher le profil"; +$string["nmp_dropout_user_never_access"] = "Jamais accédé"; +$string["nmp_dropout_student_progress_title"] = "Progression de l'élève"; +$string["nmp_dropout_student_grade_title"] = "Note"; +$string['nmp_dropout_no_data'] = "Il n'y a pas encore de données de décrochage scolaire concernant ce cours."; +$string['nmp_dropout_no_users_cluster'] = "Il n'y a aucun étudiant dans ce groupe"; +$string['nmp_dropout_generate_data_manually'] = "Générer manuellement les données"; +$string['nmp_dropout_generating_data'] = "Génération de données..."; +$string["nmp_modules_access_chart_title"] = "Ressources du cours"; +$string["nmp_modules_access_chart_series_total"] = "Total"; +$string["nmp_modules_access_chart_series_complete"] = "Terminé"; +$string["nmp_modules_access_chart_series_viewed"] = "Consulté"; +$string["nmp_week_modules_chart_title"] = "Ressources par semaines"; +$string["nmp_modules_amount"] = "Quantité de ressources"; +$string["nmp_modules_details"] = "(Cliquez pour voir les ressources)"; +$string["nmp_modules_interaction"] = "interaction"; +$string["nmp_modules_interactions"] = "interactions"; +$string["nmp_modules_viewed"] = "Consulté"; +$string["nmp_modules_no_viewed"] = "Non consulté"; +$string["nmp_modules_complete"] = "Terminé"; +$string["nmp_sessions_evolution_chart_title"] = "Sessions et temps investi"; +$string["nmp_sessions_evolution_chart_xaxis1"] = "Nombre de sessions"; +$string["nmp_sessions_evolution_chart_xaxis2"] = "Nombre d'heures"; +$string["nmp_sessions_evolution_chart_legend1"] = "Nombre de sessions"; +$string["nmp_sessions_evolution_chart_legend2"] = "Temps investi"; +$string["nmp_user_grades_chart_title"] = "Notes"; +$string["nmp_user_grades_chart_yaxis"] = "Note en pourcentage"; +$string["nmp_user_grades_chart_xaxis"] = "Activités évaluables"; +$string["nmp_user_grades_chart_legend"] = "Cours (moyen)"; +$string["nmp_user_grades_chart_tooltip_no_graded"] = "Aucune note"; +$string["nmp_user_grades_chart_view_activity"] = "Cliquez pour voir l'activité"; +$string['nmp_send_mail_to_user'] = 'Envoyer un e-mail à'; +$string['nmp_send_mail_to_group'] = 'Envoyer un e-mail au groupe'; /* Général étudiant */ @@ -557,168 +557,168 @@ $string['ss_resources_access_help_description_p2'] = 'Sur l\'axe des x du graphi $string['ss_resources_access_help_description_p3'] = 'En cliquant sur n\'importe quelle barre, il est possible de voir les ressources et activités disponibles dans le cours (dans une fenêtre pop-up) ainsi que le nombre d\'interactions que vous avez faites avec chaque ressource et une étiquette non consulté, consulté ou terminé. '; -$string['fml_student_time_inverted_title'] = 'Votre temps investi'; -$string['fml_student_time_inverted_x_axis'] = 'Nombre d\'heures'; -$string['fml_student_inverted_time'] = 'Temps investi'; -$string['fml_student_expected_time'] = 'Temps à investir'; +$string['nmp_student_time_inverted_title'] = 'Votre temps investi'; +$string['nmp_student_time_inverted_x_axis'] = 'Nombre d\'heures'; +$string['nmp_student_inverted_time'] = 'Temps investi'; +$string['nmp_student_expected_time'] = 'Temps à investir'; -$string['fml_resource_access_title'] = 'Interaction par types de ressources'; -$string['fml_resource_access_y_axis'] = 'Quantité de ressources'; -$string['fml_resource_access_x_axis'] = 'Types de ressources'; -$string['fml_resource_access_legend1'] = 'Terminé'; -$string['fml_resource_access_legend2'] = 'En attente'; +$string['nmp_resource_access_title'] = 'Interaction par types de ressources'; +$string['nmp_resource_access_y_axis'] = 'Quantité de ressources'; +$string['nmp_resource_access_x_axis'] = 'Types de ressources'; +$string['nmp_resource_access_legend1'] = 'Terminé'; +$string['nmp_resource_access_legend2'] = 'En attente'; -$string['fml_week_progress_title'] = 'Progrès de la semaine'; +$string['nmp_week_progress_title'] = 'Progrès de la semaine'; /* Indicateurs de l\'enseignant */ -$string['fml_teacher_indicators_title'] = 'Indicateurs généraux'; -$string['fml_teacher_indicators_students'] = 'Etudiants inscrits'; -$string['fml_teacher_indicators_weeks'] = 'Semaines configurées'; -$string['fml_teacher_indicators_grademax'] = 'Note maximum'; -$string['fml_teacher_indicators_course_start'] = 'Démarre le'; -$string['fml_teacher_indicators_course_end'] = 'Se termine le'; -$string['fml_teacher_indicators_course_format'] = 'Format'; -$string['fml_teacher_indicators_course_completion'] = 'Complétude des modules'; -$string["fml_teacher_indicators_student_progress"] = "Progression des élèves"; -$string["fml_teacher_indicators_week_resources_chart_title"] = "Ressources par semaines"; -$string["fml_teacher_indicators_week_resources_yaxis_title"] = "Quantité de ressources"; +$string['nmp_teacher_indicators_title'] = 'Indicateurs généraux'; +$string['nmp_teacher_indicators_students'] = 'Etudiants inscrits'; +$string['nmp_teacher_indicators_weeks'] = 'Semaines configurées'; +$string['nmp_teacher_indicators_grademax'] = 'Note maximum'; +$string['nmp_teacher_indicators_course_start'] = 'Démarre le'; +$string['nmp_teacher_indicators_course_end'] = 'Se termine le'; +$string['nmp_teacher_indicators_course_format'] = 'Format'; +$string['nmp_teacher_indicators_course_completion'] = 'Complétude des modules'; +$string["nmp_teacher_indicators_student_progress"] = "Progression des élèves"; +$string["nmp_teacher_indicators_week_resources_chart_title"] = "Ressources par semaines"; +$string["nmp_teacher_indicators_week_resources_yaxis_title"] = "Quantité de ressources"; /* Logs visualisation */ -$string['fml_logs_title'] = 'Télécharger les journaux d\'activités'; -$string['fml_logs_help_description'] = 'Cette section vous permet de télécharger les journaux d\'activités qui ont été réalisés. C\'est-à-dire que vous avez accès aux actions qui ont été réalisées par les utilisateurs inscrits sur la plate-forme sous forme d\'un tableur.'; -$string['fml_logs_title_MoodleSetpoint_title'] = 'Sélectionnez un interval de date pour les actions réalisées sur Moodle'; -$string['fml_logs_title_MMPSetpoint_title'] = 'Sélectionnez un interval de date pour les actions réalisées sur Note My Progress'; -$string['fml_logs_help'] = 'Cette section vous permet de télécharger un fichier de journal des activités effectuées.'; -$string['fml_logs_select_date'] = 'Sélectionnez un interval de temps pour le journal'; -$string['fml_logs_first_date'] = 'Date de début'; -$string['fml_logs_last_date'] = 'Date de fin'; -$string['fml_logs_valid_Moodlebtn'] = 'Télécharger le journal d\'activités de Moodle'; -$string['fml_logs_valid_NMPbtn'] = 'Télécharger le journal d\'activités de Note My Progress'; -$string['fml_logs_invalid_date'] = 'Veuillez saisir une date'; -$string['fml_logs_download_btn'] = 'Téléchargement en cours'; -$string['fml_logs_download_nmp_help_title'] = 'A propos des actions réalisées sur Note My Progress'; -$string['fml_logs_download_moodle_help_title'] = 'A propos des actions réalisées sur Moodle'; -$string['fml_logs_download_nmp_help_description'] = 'Le fichier de logs qui est téléchargé répertorie toutes les actions qui ont été réalisées par l\'utilisateur au sein du plugin Note My Progress uniquement (consultation des avancées, consultation des indicateurs généraux, etc.).'; -$string['fml_logs_download_moodle_help_description'] = 'Le fichier de logs qui est téléchargé répertorie toutes les actions qui ont été réalisées par l\'utilisateur au sein de Moodle uniquement (visualisation du cours, visualisation des ressources, dépôt d\'un devoir, etc.)'; +$string['nmp_logs_title'] = 'Télécharger les journaux d\'activités'; +$string['nmp_logs_help_description'] = 'Cette section vous permet de télécharger les journaux d\'activités qui ont été réalisés. C\'est-à-dire que vous avez accès aux actions qui ont été réalisées par les utilisateurs inscrits sur la plate-forme sous forme d\'un tableur.'; +$string['nmp_logs_title_MoodleSetpoint_title'] = 'Sélectionnez un interval de date pour les actions réalisées sur Moodle'; +$string['nmp_logs_title_MMPSetpoint_title'] = 'Sélectionnez un interval de date pour les actions réalisées sur Note My Progress'; +$string['nmp_logs_help'] = 'Cette section vous permet de télécharger un fichier de journal des activités effectuées.'; +$string['nmp_logs_select_date'] = 'Sélectionnez un interval de temps pour le journal'; +$string['nmp_logs_first_date'] = 'Date de début'; +$string['nmp_logs_last_date'] = 'Date de fin'; +$string['nmp_logs_valid_Moodlebtn'] = 'Télécharger le journal d\'activités de Moodle'; +$string['nmp_logs_valid_NMPbtn'] = 'Télécharger le journal d\'activités de Note My Progress'; +$string['nmp_logs_invalid_date'] = 'Veuillez saisir une date'; +$string['nmp_logs_download_btn'] = 'Téléchargement en cours'; +$string['nmp_logs_download_nmp_help_title'] = 'A propos des actions réalisées sur Note My Progress'; +$string['nmp_logs_download_moodle_help_title'] = 'A propos des actions réalisées sur Moodle'; +$string['nmp_logs_download_nmp_help_description'] = 'Le fichier de logs qui est téléchargé répertorie toutes les actions qui ont été réalisées par l\'utilisateur au sein du plugin Note My Progress uniquement (consultation des avancées, consultation des indicateurs généraux, etc.).'; +$string['nmp_logs_download_moodle_help_description'] = 'Le fichier de logs qui est téléchargé répertorie toutes les actions qui ont été réalisées par l\'utilisateur au sein de Moodle uniquement (visualisation du cours, visualisation des ressources, dépôt d\'un devoir, etc.)'; /* Logs CSV Header */ -$string['fml_logs_csv_headers_username'] = 'Nom d\'utilisateur'; -$string['fml_logs_csv_headers_firstname'] = 'Prénom'; -$string['fml_logs_csv_headers_lastname'] = 'Nom'; -$string['fml_logs_csv_headers_date'] = 'Date'; -$string['fml_logs_csv_headers_hour'] = 'Heure'; -$string['fml_logs_csv_headers_action'] = 'Action'; -$string['fml_logs_csv_headers_coursename'] = 'Nom du cours'; -$string['fml_logs_csv_headers_detail'] = 'Détail'; -$string['fml_logs_csv_headers_detailtype'] = 'Type d\'objet utilisé'; +$string['nmp_logs_csv_headers_username'] = 'Nom d\'utilisateur'; +$string['nmp_logs_csv_headers_firstname'] = 'Prénom'; +$string['nmp_logs_csv_headers_lastname'] = 'Nom'; +$string['nmp_logs_csv_headers_date'] = 'Date'; +$string['nmp_logs_csv_headers_hour'] = 'Heure'; +$string['nmp_logs_csv_headers_action'] = 'Action'; +$string['nmp_logs_csv_headers_coursename'] = 'Nom du cours'; +$string['nmp_logs_csv_headers_detail'] = 'Détail'; +$string['nmp_logs_csv_headers_detailtype'] = 'Type d\'objet utilisé'; -$string['fml_logs_error_begin_date_superior'] = 'La date de début ne peut pas être supérieure à la date actuelle'; -$string['fml_logs_error_begin_date_inferior'] = 'La date de début doit être antérieure à la date de fin'; -$string['fml_logs_error_empty_dates'] = 'Les dates ne peuvent pas être vides'; -$string['fml_logs_error_problem_encountered'] = 'Un problème a été rencontré, veuillez réessayer'; +$string['nmp_logs_error_begin_date_superior'] = 'La date de début ne peut pas être supérieure à la date actuelle'; +$string['nmp_logs_error_begin_date_inferior'] = 'La date de début doit être antérieure à la date de fin'; +$string['nmp_logs_error_empty_dates'] = 'Les dates ne peuvent pas être vides'; +$string['nmp_logs_error_problem_encountered'] = 'Un problème a été rencontré, veuillez réessayer'; -$string['fml_logs_success_file_downloaded'] = 'Fichier téléchargé !'; +$string['nmp_logs_success_file_downloaded'] = 'Fichier téléchargé !'; -$string['fml_logs_moodle_csv_headers_role'] = 'Role'; -$string['fml_logs_moodle_csv_headers_email'] = 'Email'; -$string['fml_logs_moodle_csv_headers_username'] = 'Username'; -$string['fml_logs_moodle_csv_headers_fullname'] = 'Fullname'; -$string['fml_logs_moodle_csv_headers_date'] = 'Date'; -$string['fml_logs_moodle_csv_headers_hour'] = 'Hour'; -$string['fml_logs_moodle_csv_headers_action'] = 'Action'; -$string['fml_logs_moodle_csv_headers_courseid'] = 'CourseID'; -$string['fml_logs_moodle_csv_headers_coursename'] = 'Course_name'; -$string['fml_logs_moodle_csv_headers_detailid'] = 'Detail ID'; -$string['fml_logs_moodle_csv_headers_details'] = 'Details'; -$string['fml_logs_moodle_csv_headers_detailstype'] = 'Details_type'; +$string['nmp_logs_moodle_csv_headers_role'] = 'Role'; +$string['nmp_logs_moodle_csv_headers_email'] = 'Email'; +$string['nmp_logs_moodle_csv_headers_username'] = 'Username'; +$string['nmp_logs_moodle_csv_headers_fullname'] = 'Fullname'; +$string['nmp_logs_moodle_csv_headers_date'] = 'Date'; +$string['nmp_logs_moodle_csv_headers_hour'] = 'Hour'; +$string['nmp_logs_moodle_csv_headers_action'] = 'Action'; +$string['nmp_logs_moodle_csv_headers_courseid'] = 'CourseID'; +$string['nmp_logs_moodle_csv_headers_coursename'] = 'Course_name'; +$string['nmp_logs_moodle_csv_headers_detailid'] = 'Detail ID'; +$string['nmp_logs_moodle_csv_headers_details'] = 'Details'; +$string['nmp_logs_moodle_csv_headers_detailstype'] = 'Details_type'; -$string['fml_logs_moodle_csv_headers_role_description'] = 'Donne le rôle qu\'a l\'utilisateur sur le cours sur lequel il a fait une action (étudiant, enseignant...)'; -$string['fml_logs_moodle_csv_headers_email_description'] = 'Donne l\'e-mail de l\'utilisateur'; -$string['fml_logs_moodle_csv_headers_username_description'] = 'Donne le nom d\'utilisateur moodle de la personne ayant réalisée l\'action'; -$string['fml_logs_moodle_csv_headers_fullname_description'] = 'Donne le nom complet de l\'utilisateur (Prénom + Nom)'; -$string['fml_logs_moodle_csv_headers_date_description'] = 'Donne la date à laquelle l\'action a été réalisée au format dd-MM-YYYY'; -$string['fml_logs_moodle_csv_headers_hour_description'] = 'Donne l\'heure a laquelle a été réalisée l\'action'; -$string['fml_logs_moodle_csv_headers_action_description'] = 'Donne un verbe décrivant l\'action qui a été réalisée (ex: cliqué, vu...)'; -$string['fml_logs_moodle_csv_headers_courseid_description'] = 'Donne l\'identifiant du cours sur lequel a été réalisée l\'action'; -$string['fml_logs_moodle_csv_headers_coursename_description'] = 'Donne le nom du cours sur lequel a été réalisée l\'action'; -$string['fml_logs_moodle_csv_headers_detailid_description'] = 'Donne l\'identifiant de l\'objet avec lequel l\'utilisateur a interagi'; -$string['fml_logs_moodle_csv_headers_details_description'] = 'Donne le nom de l\'objet qui a été visé'; -$string['fml_logs_moodle_csv_headers_detailstype_description'] = 'Donne le type d\'objet qui a été visé (exemples d\'objets: Dépôt, Quizz, Ressources...)'; +$string['nmp_logs_moodle_csv_headers_role_description'] = 'Donne le rôle qu\'a l\'utilisateur sur le cours sur lequel il a fait une action (étudiant, enseignant...)'; +$string['nmp_logs_moodle_csv_headers_email_description'] = 'Donne l\'e-mail de l\'utilisateur'; +$string['nmp_logs_moodle_csv_headers_username_description'] = 'Donne le nom d\'utilisateur moodle de la personne ayant réalisée l\'action'; +$string['nmp_logs_moodle_csv_headers_fullname_description'] = 'Donne le nom complet de l\'utilisateur (Prénom + Nom)'; +$string['nmp_logs_moodle_csv_headers_date_description'] = 'Donne la date à laquelle l\'action a été réalisée au format dd-MM-YYYY'; +$string['nmp_logs_moodle_csv_headers_hour_description'] = 'Donne l\'heure a laquelle a été réalisée l\'action'; +$string['nmp_logs_moodle_csv_headers_action_description'] = 'Donne un verbe décrivant l\'action qui a été réalisée (ex: cliqué, vu...)'; +$string['nmp_logs_moodle_csv_headers_courseid_description'] = 'Donne l\'identifiant du cours sur lequel a été réalisée l\'action'; +$string['nmp_logs_moodle_csv_headers_coursename_description'] = 'Donne le nom du cours sur lequel a été réalisée l\'action'; +$string['nmp_logs_moodle_csv_headers_detailid_description'] = 'Donne l\'identifiant de l\'objet avec lequel l\'utilisateur a interagi'; +$string['nmp_logs_moodle_csv_headers_details_description'] = 'Donne le nom de l\'objet qui a été visé'; +$string['nmp_logs_moodle_csv_headers_detailstype_description'] = 'Donne le type d\'objet qui a été visé (exemples d\'objets: Dépôt, Quizz, Ressources...)'; -$string['fml_logs_nmp_csv_headers_role_description'] = 'Donne le rôle qu\'a l\'utilisateur sur le cours sur lequel il a fait une action (étudiant, enseignant...)'; -$string['fml_logs_nmp_csv_headers_email_description'] = 'Donne l\'e-mail de l\'utilisateur'; -$string['fml_logs_nmp_csv_headers_username_description'] = 'Donne le nom d\'utilisateur moodle de la personne ayant réalisée l\'action'; -$string['fml_logs_nmp_csv_headers_fullname_description'] = 'Donne le nom complet de l\'utilisateur (Prénom + Nom)'; -$string['fml_logs_nmp_csv_headers_date_description'] = 'Donne la date à laquelle l\'action a été réalisée au format dd-MM-YYYY'; -$string['fml_logs_nmp_csv_headers_hour_description'] = 'Donne l\'heure a laquelle a été réalisée l\'action'; -$string['fml_logs_nmp_csv_headers_courseid_description'] = 'Donne l\'identifiant du cours sur lequel a été réalisée l\'action'; -$string['fml_logs_nmp_csv_headers_section_name_description'] = 'Donne le nom de la section de note my progress dans laquelle se trouvait l\'utilisateur lorsqu\'il a réalisé l\'action'; -$string['fml_logs_nmp_csv_headers_action_type_description'] = 'Donne une description complète de l\'action qui a été réalisée par l\'utilisateur sous la forme verbe + sujet + objet (ex: downloaded_moodle_logfile)'; +$string['nmp_logs_nmp_csv_headers_role_description'] = 'Donne le rôle qu\'a l\'utilisateur sur le cours sur lequel il a fait une action (étudiant, enseignant...)'; +$string['nmp_logs_nmp_csv_headers_email_description'] = 'Donne l\'e-mail de l\'utilisateur'; +$string['nmp_logs_nmp_csv_headers_username_description'] = 'Donne le nom d\'utilisateur moodle de la personne ayant réalisée l\'action'; +$string['nmp_logs_nmp_csv_headers_fullname_description'] = 'Donne le nom complet de l\'utilisateur (Prénom + Nom)'; +$string['nmp_logs_nmp_csv_headers_date_description'] = 'Donne la date à laquelle l\'action a été réalisée au format dd-MM-YYYY'; +$string['nmp_logs_nmp_csv_headers_hour_description'] = 'Donne l\'heure a laquelle a été réalisée l\'action'; +$string['nmp_logs_nmp_csv_headers_courseid_description'] = 'Donne l\'identifiant du cours sur lequel a été réalisée l\'action'; +$string['nmp_logs_nmp_csv_headers_section_name_description'] = 'Donne le nom de la section de note my progress dans laquelle se trouvait l\'utilisateur lorsqu\'il a réalisé l\'action'; +$string['nmp_logs_nmp_csv_headers_action_type_description'] = 'Donne une description complète de l\'action qui a été réalisée par l\'utilisateur sous la forme verbe + sujet + objet (ex: downloaded_moodle_logfile)'; -$string['fml_logs_moodle_table_title'] = 'Description des intitulés'; -$string['fml_logs_moodle_table_subtitle'] = 'Concernant les logs de Moodle'; +$string['nmp_logs_moodle_table_title'] = 'Description des intitulés'; +$string['nmp_logs_moodle_table_subtitle'] = 'Concernant les logs de Moodle'; -$string['fml_logs_nmp_table_title'] = 'Description des intitulés'; -$string['fml_logs_nmp_table_subtitle'] = 'Concernant les logs de Note My Progress'; +$string['nmp_logs_nmp_table_title'] = 'Description des intitulés'; +$string['nmp_logs_nmp_table_subtitle'] = 'Concernant les logs de Note My Progress'; -$string['fml_logs_nmp_csv_headers_role'] = 'Role'; -$string['fml_logs_nmp_csv_headers_email'] = 'Email'; -$string['fml_logs_nmp_csv_headers_username'] = 'Username'; -$string['fml_logs_nmp_csv_headers_fullname'] = 'Fullname'; -$string['fml_logs_nmp_csv_headers_date'] = 'Date'; -$string['fml_logs_nmp_csv_headers_hour'] = 'Hour'; -$string['fml_logs_nmp_csv_headers_courseid'] = 'CourseID'; -$string['fml_logs_nmp_csv_headers_section_name'] = 'NMP_SECTION_NAME'; -$string['fml_logs_nmp_csv_headers_action_type'] = 'NMP_ACTION_TYPE'; +$string['nmp_logs_nmp_csv_headers_role'] = 'Role'; +$string['nmp_logs_nmp_csv_headers_email'] = 'Email'; +$string['nmp_logs_nmp_csv_headers_username'] = 'Username'; +$string['nmp_logs_nmp_csv_headers_fullname'] = 'Fullname'; +$string['nmp_logs_nmp_csv_headers_date'] = 'Date'; +$string['nmp_logs_nmp_csv_headers_hour'] = 'Hour'; +$string['nmp_logs_nmp_csv_headers_courseid'] = 'CourseID'; +$string['nmp_logs_nmp_csv_headers_section_name'] = 'NMP_SECTION_NAME'; +$string['nmp_logs_nmp_csv_headers_action_type'] = 'NMP_ACTION_TYPE'; -$string['fml_logs_table_title'] = 'Intitulé'; -$string['fml_logs_table_title_bis'] = 'Description'; +$string['nmp_logs_table_title'] = 'Intitulé'; +$string['nmp_logs_table_title_bis'] = 'Description'; -$string['fml_logs_help_button_nmp'] = 'A propos des actions réalisées sur Note My Progress'; -$string['fml_logs_help_button_moodle'] = 'A propos des actions réalisées sur Moodle'; +$string['nmp_logs_help_button_nmp'] = 'A propos des actions réalisées sur Note My Progress'; +$string['nmp_logs_help_button_moodle'] = 'A propos des actions réalisées sur Moodle'; -$string['fml_logs_download_details_link'] = 'En savoir plus'; -$string['fml_logs_download_details_title'] = 'Êtes-vous sûr de vouloir un rapport d\'explications détaillées ?'; -$string['fml_logs_download_details_description'] = 'Si vous acceptez, un fichier au format PDF sera téléchargé.'; -$string['fml_logs_download_details_ok'] = 'Télécharger'; -$string['fml_logs_download_details_cancel'] = 'Annuler'; -$string['fml_logs_download_details_validation'] = 'Le rapport a bien été téléchargé'; +$string['nmp_logs_download_details_link'] = 'En savoir plus'; +$string['nmp_logs_download_details_title'] = 'Êtes-vous sûr de vouloir un rapport d\'explications détaillées ?'; +$string['nmp_logs_download_details_description'] = 'Si vous acceptez, un fichier au format PDF sera téléchargé.'; +$string['nmp_logs_download_details_ok'] = 'Télécharger'; +$string['nmp_logs_download_details_cancel'] = 'Annuler'; +$string['nmp_logs_download_details_validation'] = 'Le rapport a bien été téléchargé'; /* NoteMyProgress admin settings */ -$string['fml_settings_bddusername_label'] = 'Nom d\'utilisateur de la base de données'; -$string['fml_settings_bddusername_description'] = 'Ce paramètre désigne le nom d\'utilisateur depuis lequel la base de données MongoDB est accessible. Si ce paramètre est entré, il vous faut entrer le mot de passe ainsi que le nom de la base de données sur laquelle vous souhaitez vous connecter.'; -$string['fml_settings_bddusername_default'] = 'Vide'; +$string['nmp_settings_bddusername_label'] = 'Nom d\'utilisateur de la base de données'; +$string['nmp_settings_bddusername_description'] = 'Ce paramètre désigne le nom d\'utilisateur depuis lequel la base de données MongoDB est accessible. Si ce paramètre est entré, il vous faut entrer le mot de passe ainsi que le nom de la base de données sur laquelle vous souhaitez vous connecter.'; +$string['nmp_settings_bddusername_default'] = 'Vide'; -$string['fml_settings_bddpassword_label'] = 'Mot de passe du compte'; -$string['fml_settings_bddpassword_description'] = 'Ce paramètre désigne le mot de passe du compte depuis lequel la base de données MongoDB est accessible. Si ce paramètre est entré, il vous faut entrer le nom d\'utilisateur ainsi que le nom de la base de données sur laquelle vous souhaitez vous connecter.'; -$string['fml_settings_bddpassword_default'] = 'Vide'; +$string['nmp_settings_bddpassword_label'] = 'Mot de passe du compte'; +$string['nmp_settings_bddpassword_description'] = 'Ce paramètre désigne le mot de passe du compte depuis lequel la base de données MongoDB est accessible. Si ce paramètre est entré, il vous faut entrer le nom d\'utilisateur ainsi que le nom de la base de données sur laquelle vous souhaitez vous connecter.'; +$string['nmp_settings_bddpassword_default'] = 'Vide'; -$string['fml_settings_bddaddress_label'] = 'Adresse du serveur MongoDB *'; -$string['fml_settings_bddaddress_description'] = 'Ce paramètre est l\'adresse depuis laquelle la base de données MongoDB est accessible. Ce paramètre est obligatoire et est sous la forme : 151.125.45.58 ou bien votreserveur.com'; -$string['fml_settings_bddaddress_default'] = 'localhost'; +$string['nmp_settings_bddaddress_label'] = 'Adresse du serveur MongoDB *'; +$string['nmp_settings_bddaddress_description'] = 'Ce paramètre est l\'adresse depuis laquelle la base de données MongoDB est accessible. Ce paramètre est obligatoire et est sous la forme : 151.125.45.58 ou bien votreserveur.com'; +$string['nmp_settings_bddaddress_default'] = 'localhost'; -$string['fml_settings_bddport_label'] = 'Port de communication *'; -$string['fml_settings_bddport_description'] = 'Ce paramètre désigne le port à utiliser pour communiquer avec la base de données. Ce paramètre est obligatoire et doit être un nombre.'; -$string['fml_settings_bddport_default'] = '27017'; +$string['nmp_settings_bddport_label'] = 'Port de communication *'; +$string['nmp_settings_bddport_description'] = 'Ce paramètre désigne le port à utiliser pour communiquer avec la base de données. Ce paramètre est obligatoire et doit être un nombre.'; +$string['nmp_settings_bddport_default'] = '27017'; -$string['fml_settings_bddname_label'] = 'Nom de la base de données'; -$string['fml_settings_bddname_description'] = 'Ce paramètre désigne le nom de la base de données MongoDB dans laquelle vont être enregistrées les informations.'; -$string['fml_settings_bddname_default'] = 'Vide'; +$string['nmp_settings_bddname_label'] = 'Nom de la base de données'; +$string['nmp_settings_bddname_description'] = 'Ce paramètre désigne le nom de la base de données MongoDB dans laquelle vont être enregistrées les informations.'; +$string['nmp_settings_bddname_default'] = 'Vide'; //Planning /* Global */ @@ -869,6 +869,12 @@ $string['notes_message_updated'] = "La note a été mise à jour"; $string['notes_message_not_updated'] = "Note n'a pas pu être mise à jour'"; /*Metareflexion*/ + +$string['metareflexion_goal1'] = "Apprendre de nouvelles choses"; +$string['metareflexion_goal2'] = "Revoir ce que j'ai vu"; +$string['metareflexion_goal3'] = "Planifier mon apprentissage"; + +$string['metareflexion_no_modules_in_section'] = "Cette semaine n'as pas de modules"; $string['compare_with_course'] = "Comparer mes résultats avec ceux de mes collègues"; $string['sr_menu_metareflexion'] = "Méta-réflexion"; $string['metareflexion_last_week_created'] = "Les réflexions de la semaine dernière ont été sauvegardées"; @@ -1093,3 +1099,75 @@ $string['group_allstudent'] = "Tous les étudiants"; /* Admin Settings */ $string['nmp_use_navbar_menu'] = 'Activer le nouveau menu'; $string['nmp_use_navbar_menu_desc'] = 'Afficher le menu du plugin dans la barre de navigation supérieure, sinon il inclura le menu dans le bloc de navigation.'; + +/* Gamification */ +$string['EnableGame']="Désactiver/Activer :"; +$string['studentRanking1']="Voulez vous apparaitre dans le ranking board ? "; +$string['studentRanking2']= "/!\ Tout les inscrits à ce cours ayant accepté vous verrons. Accepter est définitif:"; +$string['studentRanking3']="Accepter"; +$string['gamification_denied'] = 'La gamification a été désactivée par votre professeur'; +$string['tg_colon'] = '{$a->a}: {$a->b}'; +$string['tg_section_title'] = 'Gamification :'; +$string['tg_section_help_title'] = 'Paramètres de gamification des cours'; +$string['tg_section_help_description'] = 'Vous pouvez donner la possibilité de gamification aux étudiants du cours.'; +$string['tg_save_warning_title'] = "Êtes-vous sûr de vouloir enregistrer les modifications?"; +$string['tg_save_warning_content'] = "Si vous modifiez les paramètres de la gamification au début du cours, les données peuvent être perdues ..."; +$string['tg_confirm_ok'] = "Sauver"; +$string['tg_confirm_cancel'] = "Annuler"; +$string['tg_save'] = "Enregistrer la configuration"; +$string['tg_section_preview'] = 'Point de vue étudiant'; +$string['tg_section_experience'] = 'Points d\'experience'; +$string['tg_section_information'] = 'Information'; +$string['tg_section_ranking'] = 'Classement / rapport'; +$string['tg_section_settings'] = 'Réglages'; + +$string['tg_section_points'] = 'points'; +$string['tg_section_description'] = 'Description'; +$string['tg_section_no_description'] = 'Pas de description'; +$string['tg_section_no_name'] = 'Sans nom'; + +$string['tg_section_preview_next_level'] = 'au niveau supérieur'; +$string['tg_section_ranking_ranking_text'] = 'Classement'; +$string['tg_section_ranking_level'] = 'Niveau'; +$string['tg_section_ranking_student'] = 'Élève'; +$string['tg_section_ranking_total'] = 'Total'; +$string['tg_section_ranking_progress'] ='Progréssion %'; + +$string['tg_section_settings_appearance'] = 'Apparence'; +$string['tg_section_settings_appearance_title'] = 'Titre'; +$string['tg_section_settings_levels'] = 'Paramètres de niveau'; +$string['tg_section_settings_levels_quantity'] = 'Niveaux'; +$string['tg_section_settings_levels_base_points'] = 'Points de base'; +$string['tg_section_settings_levels_calculated'] = 'Automatique'; +$string['tg_section_settings_levels_manually'] = 'Manuellement'; +$string['tg_section_settings_levels_name'] = 'Nom'; +$string['tg_section_settings_levels_required'] = 'Points requis'; +$string['tg_section_settings_rules'] = 'Liste des régles'; +$string['tg_section_settings_add_rule'] = 'Nouvelle règle'; +$string['tg_section_settings_earn'] = 'Pour cet événement, victoire:'; +$string['tg_section_settings_select_event'] = 'Sélectionnez un événement'; +$string['gm_Chart_Title']='Graphique de répartion'; +$string['gm_Chart_Y']='Etudiants'; + +$string['tg_timenow'] = 'Juste maintenant'; +$string['tg_timeseconds'] = 'il y a {$a}s '; +$string['tg_timeminutes'] = 'il y a {$a}m '; +$string['tg_timehours'] = 'il y a {$a}h '; +$string['tg_timedays'] = 'il y a {$a}d '; +$string['tg_timeweeks'] = 'il y a {$a}w '; +$string['tg_timewithinayearformat'] = '%b %e'; +$string['tg_timeolderyearformat'] = '%b %Y'; + +/* General Errors */ +$string['nmp_api_error_network'] = "Une erreur s'est produite dans la communication avec le serveur."; +$string['nmp_api_invalid_data'] = 'Données incorrectes'; +$string['nmp_api_json_decode_error'] = 'Décodage d erreur de données envoyées'; +$string['nmp_api_invalid_token_error'] = 'Le jeton envoyé dans la transaction n\'est pas valide, veuillez actualiser la page'; +$string['nmp_api_invalid_transaction'] = 'La demande est incorrecte'; +$string['nmp_api_invalid_profile'] = 'Vous ne pouvez pas faire cette action, votre profil est incorrect'; +$string['nmp_api_save_successful'] = 'Les données ont été enregistrées avec succès sur le serveur'; +$string['nmp_api_cancel_action'] = 'Vous avez annulé l\'action'; +$string['overview']='Vue d\'ensemble : '; +$string['game_point_error']='Veuillez saisir les points'; +$string['game_event_error']='Veuillez saisir l\'évènement'; +$string['game_name_error']='Le nom est requis'; diff --git a/notemyprogress/lib.php b/notemyprogress/lib.php index bae1b722ef8c9a293c1e90ede045de5e435aaa92..95b9ec7190073768af2252440527173e46a58c7d 100644 --- a/notemyprogress/lib.php +++ b/notemyprogress/lib.php @@ -107,8 +107,8 @@ function local_notemyprogress_render_navbar_output(\renderer_base $renderer) array_push($items, local_notemyprogress_new_menu_item(s($text), $url)); } - //ADD - if (has_capability('local/notemyprogress:logs', $context) && $configuration_is_set) { + //ADD menu items + if(has_capability('local/notemyprogress:logs', $context) && $configuration_is_set){ $text = get_string('menu_logs', 'local_notemyprogress'); $url = new moodle_url('/local/notemyprogress/logs.php?courseid=' . $COURSE->id); array_push($items, local_notemyprogress_new_menu_item(s($text), $url)); @@ -128,6 +128,17 @@ function local_notemyprogress_render_navbar_output(\renderer_base $renderer) + if(has_capability('local/notemyprogress:teacher_gamification', $context) && $configuration_is_set){ + $text = 'Gamification'; + $url = new moodle_url('/local/notemyprogress/gamification.php?courseid='.$COURSE->id); + array_push($items, local_notemyprogress_new_menu_item(s($text), $url)); + } + if(has_capability('local/notemyprogress:student_gamification', $context) && !is_siteadmin() && $configuration_is_set){ + $text = 'Gamification'; + $url = new moodle_url('/local/notemyprogress/student_gamification.php?courseid='.$COURSE->id); + array_push($items, local_notemyprogress_new_menu_item(s($text), $url)); + } + $params = [ "title" => get_string('menu_main_title', 'local_notemyprogress'), "items" => $items diff --git a/notemyprogress/locallib.php b/notemyprogress/locallib.php index 8c78722ebc231653fa3640e3dff1e7a4fdf1e06f..8f6d967d18cc0e3f098fe1a9d0af18380158e8cf 100644 --- a/notemyprogress/locallib.php +++ b/notemyprogress/locallib.php @@ -124,3 +124,119 @@ function local_notemyprogress_add_selected_property($groups, $groupid = null){ } return $groups; } + +//////////////////////////////////// +// Gamification function /// +//////////////////////////////////// +function local_notemyprogress_generate_token($courseid, $userid, $profile){ + $key = local_notemyprogress_get_token_signature(); + $payload = array( + "uid" => $userid, + "cid" => $courseid, + "pro" => $profile, + ); + $time = local_notemyprogress_get_token_time_valid(); + if ($time) { + $date = new DateTime(); + $date = $date->format('U'); + $payload['exp'] = intval($date) + $time; + } + return \local_notemyprogress\jwt\JWT::encode($payload, $key); +} +function local_notemyprogress_get_token_signature() { + $key = get_config("local_notemyprogress", "token_signature"); + if (empty($key)) { + $key = "m73YvSn2mhFVeXtut5UY"; // default signature + } + return $key; +} + +function local_notemyprogress_get_token_time_valid() { + return intval(get_config("local_notemyprogress", "token_time_valid")); +} + +function local_notemyprogress_validate_token($token){ + try { + global $DB; + $key = local_notemyprogress_get_token_signature(); + + $token = validate_param($token, PARAM_TEXT); + + $decoded = \local_notemyprogress\jwt\JWT::decode($token, $key, array('HS256')); + + $userid = validate_param($decoded->uid, PARAM_INT); + $courseid = validate_param($decoded->cid, PARAM_INT); + + $COURSE = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST); + $USER = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST); + + require_login($COURSE, false); + $context = context_course::instance($courseid); + require_capability('local/notemyprogress:ajax', $context); + + $result = new stdClass(); + $result->courseid = $COURSE->id; + $result->userid = $USER->id; + $result->profile = $decoded->pro; + + return $result; + } catch (Exception $e) { + $message = get_string('nmp_api_invalid_token_error', 'local_notemyprogress'); + local_notemyprogress_ajax_response(null, $message, false, 403); + } + function local_notemyprogress_save_gamification_config($courseid, $userid, $rules, $levels, $settings, $url,$enable){ + // \local_notemyprogress\logs::create( + // "setgamification", + // "configweeks", + // "saved", + // "weeks_settings", + // $url, + // 4, + // $userid, + // $courseid + // ); + $logs = new \local_notemyprogress\logs($courseid, $userid); + $logs->addLogsNMP("Saved", "section", "CONFIGURATION_GAMIFICATION", "configuration_gamification", $url, "GamificationSaved"); + + $configLevels = new \local_notemyprogress\configgamification($courseid, $userid); + $configLevels->save_levels($levels, $settings, $rules); + $configLevels->save_enable($enable); + $message = get_string('nmp_api_save_successful', 'local_notemyprogress'); + local_notemyprogress_ajax_response(true, $message); + } + + function local_notemyprogress_validate_action_and_profile($action, $profile){ + $message = ""; + + // Validate action + try { + $action = validate_param($action, PARAM_ALPHA); + } catch (Exception $e) { + $message = get_string('nmp_api_invalid_transaction', 'local_notemyprogress'); + } + + // Validate profile + if ($profile == "teacher") { + if ($action != "saveconfigweek" && $action != "changegroup" && $action != "worksessions" && + $action != "assignments" && $action != "sendmail" && $action != "quiz" && + $action != "wordcloud" && $action != "dropoutdata" && $action != "downloadlogs" && + $action != "saveinteraction" && $action != "saveconfiggamification") { + $message = get_string('nmp_api_invalid_transaction', 'local_notemyprogress'); + } + } elseif ($profile == "student") { + if ($action != "studentsessions" && $action != "studentassigns" && + $action != "studenttimes" && $action != "saveinteraction") { + $message = get_string('nmp_api_invalid_transaction', 'local_notemyprogress'); + } + } else { + $message = get_string('nmp_api_invalid_profile', 'local_notemyprogress'); + } + + if ($message != "") { + local_notemyprogress_ajax_response(null, $message, false, 400); + } + + return $action; + } +} + diff --git a/notemyprogress/logs.php b/notemyprogress/logs.php index 0e2f1551490fbc408863e2e9f82df41ed37f0b61..f5dd7246595bc2911c75981368dda768342869d8 100644 --- a/notemyprogress/logs.php +++ b/notemyprogress/logs.php @@ -56,103 +56,103 @@ $content = [ "userid" => $USER->id, 'timezone' => $reports->timezone, 'strings' => [ - "section_help_title" => get_string("fml_logs_help_title", "local_notemyprogress"), - "section_help_description" => get_string("fml_logs_help", "local_notemyprogress"), + "section_help_title" => get_string("nmp_logs_help_title", "local_notemyprogress"), + "section_help_description" => get_string("nmp_logs_help", "local_notemyprogress"), - "title" => get_string("fml_logs_title", "local_notemyprogress"), - "description" => get_string("fml_logs_help_description", "local_notemyprogress"), + "title" => get_string("nmp_logs_title", "local_notemyprogress"), + "description" => get_string("nmp_logs_help_description", "local_notemyprogress"), "helplabel" => get_string("helplabel","local_notemyprogress"), "exitbutton" => get_string("exitbutton","local_notemyprogress"), "ss_change_timezone" => get_string("ss_change_timezone", "local_notemyprogress"), "graph_generating" => get_string("graph_generating", "local_notemyprogress"), - "about" => get_string("fml_about", "local_notemyprogress"), - "about_table" => get_string("fml_about_table", "local_notemyprogress"), - - "logs_indicators_first_date" => get_string("fml_logs_first_date", "local_notemyprogress"), - "logs_indicators_last_date" => get_string("fml_logs_last_date", "local_notemyprogress"), - "logs_indicators_title_select" => get_string("fml_logs_select_date", "local_notemyprogress"), - "logs_valid_date" => get_string("fml_logs_valid_date", "local_notemyprogress"), - "logs_valid_Moodlebtn" => get_string("fml_logs_valid_Moodlebtn", "local_notemyprogress"), - "logs_valid_NMPbtn" => get_string("fml_logs_valid_NMPbtn", "local_notemyprogress"), - "logs_invalid_date" => get_string("fml_logs_invalid_date", "local_notemyprogress"), - "logs_title_MoodleSetpoint_title" => get_string("fml_logs_title_MoodleSetpoint_title", "local_notemyprogress"), - "logs_title_MMPSetpoint_title" => get_string("fml_logs_title_MMPSetpoint_title", "local_notemyprogress"), - "logs_download_btn" => get_string("fml_logs_download_btn", "local_notemyprogress"), - - "logs_download_nmp_help_title" => get_string("fml_logs_download_nmp_help_title", "local_notemyprogress"), - "logs_download_moodle_help_title" => get_string("fml_logs_download_moodle_help_title", "local_notemyprogress"), - "logs_download_moodle_help_description" => get_string("fml_logs_download_moodle_help_description","local_notemyprogress"), - "logs_download_nmp_help_description" => get_string("fml_logs_download_nmp_help_description","local_notemyprogress"), - - "logs_moodle_csv_headers_role" => get_string("fml_logs_moodle_csv_headers_role", "local_notemyprogress"), - "logs_moodle_csv_headers_email" => get_string("fml_logs_moodle_csv_headers_email","local_notemyprogress"), - "logs_moodle_csv_headers_username" => get_string("fml_logs_moodle_csv_headers_username","local_notemyprogress"), - "logs_moodle_csv_headers_fullname" => get_string("fml_logs_moodle_csv_headers_fullname","local_notemyprogress"), - "logs_moodle_csv_headers_date" => get_string("fml_logs_moodle_csv_headers_date","local_notemyprogress"), - "logs_moodle_csv_headers_hour" => get_string("fml_logs_moodle_csv_headers_hour","local_notemyprogress"), - "logs_moodle_csv_headers_action" => get_string("fml_logs_moodle_csv_headers_action","local_notemyprogress"), - "logs_moodle_csv_headers_courseid" => get_string("fml_logs_moodle_csv_headers_courseid","local_notemyprogress"), - "logs_moodle_csv_headers_coursename" => get_string("fml_logs_moodle_csv_headers_coursename","local_notemyprogress"), - "logs_moodle_csv_headers_detailid" => get_string("fml_logs_moodle_csv_headers_detailid", "local_notemyprogress"), - "logs_moodle_csv_headers_details" => get_string("fml_logs_moodle_csv_headers_details", "local_notemyprogress"), - "logs_moodle_csv_headers_detailstype" => get_string("fml_logs_moodle_csv_headers_detailstype", "local_notemyprogress"), - - "logs_moodle_csv_headers_role_description" => get_string("fml_logs_moodle_csv_headers_role_description", "local_notemyprogress"), - "logs_moodle_csv_headers_email_description" => get_string("fml_logs_moodle_csv_headers_email_description","local_notemyprogress"), - "logs_moodle_csv_headers_username_description" => get_string("fml_logs_moodle_csv_headers_username_description","local_notemyprogress"), - "logs_moodle_csv_headers_fullname_description" => get_string("fml_logs_moodle_csv_headers_fullname_description","local_notemyprogress"), - "logs_moodle_csv_headers_date_description" => get_string("fml_logs_moodle_csv_headers_date_description","local_notemyprogress"), - "logs_moodle_csv_headers_hour_description" => get_string("fml_logs_moodle_csv_headers_hour_description","local_notemyprogress"), - "logs_moodle_csv_headers_action_description" => get_string("fml_logs_moodle_csv_headers_action_description","local_notemyprogress"), - "logs_moodle_csv_headers_courseid_description" => get_string("fml_logs_moodle_csv_headers_courseid_description","local_notemyprogress"), - "logs_moodle_csv_headers_coursename_description" => get_string("fml_logs_moodle_csv_headers_coursename_description","local_notemyprogress"), - "logs_moodle_csv_headers_detailid_description" => get_string("fml_logs_moodle_csv_headers_detailid_description", "local_notemyprogress"), - "logs_moodle_csv_headers_details_description" => get_string("fml_logs_moodle_csv_headers_details_description", "local_notemyprogress"), - "logs_moodle_csv_headers_detailstype_description" => get_string("fml_logs_moodle_csv_headers_detailstype_description", "local_notemyprogress"), - - - - "logs_nmp_csv_headers_role" => get_string("fml_logs_nmp_csv_headers_role", "local_notemyprogress"), - "logs_nmp_csv_headers_email" => get_string("fml_logs_nmp_csv_headers_email","local_notemyprogress"), - "logs_nmp_csv_headers_username" => get_string("fml_logs_nmp_csv_headers_username","local_notemyprogress"), - "logs_nmp_csv_headers_fullname" => get_string("fml_logs_nmp_csv_headers_fullname","local_notemyprogress"), - "logs_nmp_csv_headers_date" => get_string("fml_logs_nmp_csv_headers_date","local_notemyprogress"), - "logs_nmp_csv_headers_hour" => get_string("fml_logs_nmp_csv_headers_hour","local_notemyprogress"), - "logs_nmp_csv_headers_courseid" => get_string("fml_logs_nmp_csv_headers_courseid","local_notemyprogress"), - "logs_nmp_csv_headers_section_name" => get_string("fml_logs_nmp_csv_headers_section_name", "local_notemyprogress"), - "logs_nmp_csv_headers_action_type" => get_string("fml_logs_nmp_csv_headers_action_type", "local_notemyprogress"), - - "logs_nmp_csv_headers_role_description" => get_string("fml_logs_nmp_csv_headers_role_description", "local_notemyprogress"), - "logs_nmp_csv_headers_email_description" => get_string("fml_logs_nmp_csv_headers_email_description","local_notemyprogress"), - "logs_nmp_csv_headers_username_description" => get_string("fml_logs_nmp_csv_headers_username_description","local_notemyprogress"), - "logs_nmp_csv_headers_fullname_description" => get_string("fml_logs_nmp_csv_headers_fullname_description","local_notemyprogress"), - "logs_nmp_csv_headers_date_description" => get_string("fml_logs_nmp_csv_headers_date_description","local_notemyprogress"), - "logs_nmp_csv_headers_hour_description" => get_string("fml_logs_nmp_csv_headers_hour_description","local_notemyprogress"), - "logs_nmp_csv_headers_courseid_description" => get_string("fml_logs_nmp_csv_headers_courseid_description","local_notemyprogress"), - "logs_nmp_csv_headers_section_name_description" => get_string("fml_logs_nmp_csv_headers_section_name_description", "local_notemyprogress"), - "logs_nmp_csv_headers_action_type_description" => get_string("fml_logs_nmp_csv_headers_action_type_description", "local_notemyprogress"), - - "logs_success_file_downloaded" => get_string("fml_logs_success_file_downloaded", "local_notemyprogress"), - "logs_error_problem_encountered" => get_string("fml_logs_error_problem_encountered", "local_notemyprogress"), - "logs_error_begin_date_superior" => get_string("fml_logs_error_begin_date_superior", "local_notemyprogress"), - "logs_error_begin_date_inferior" => get_string("fml_logs_error_begin_date_inferior", "local_notemyprogress"), - "logs_error_empty_dates" => get_string("fml_logs_error_empty_dates", "local_notemyprogress"), - - "logs_moodle_table_title" => get_string("fml_logs_moodle_table_title", "local_notemyprogress"), - "logs_moodle_table_subtitle" => get_string("fml_logs_moodle_table_subtitle", "local_notemyprogress"), - - "logs_nmp_table_title" => get_string("fml_logs_nmp_table_title", "local_notemyprogress"), - "logs_nmp_table_subtitle" => get_string("fml_logs_nmp_table_subtitle", "local_notemyprogress"), - - "logs_help_button_nmp" => get_string("fml_logs_help_button_nmp", "local_notemyprogress"), - "logs_help_button_moodle" => get_string("fml_logs_help_button_moodle", "local_notemyprogress"), - - "logs_download_details_title" => get_string("fml_logs_download_details_title", "local_notemyprogress"), - "logs_download_details_description" => get_string("fml_logs_download_details_title", "local_notemyprogress"), - "logs_download_details_ok" => get_string("fml_logs_download_details_ok", "local_notemyprogress"), - "logs_download_details_cancel" => get_string("fml_logs_download_details_cancel", "local_notemyprogress"), - "logs_download_details_validation" => get_string("fml_logs_download_details_validation", "local_notemyprogress"), - "logs_download_details_link" => get_string("fml_logs_download_details_link", "local_notemyprogress"), + "about" => get_string("nmp_about", "local_notemyprogress"), + "about_table" => get_string("nmp_about_table", "local_notemyprogress"), + + "logs_indicators_first_date" => get_string("nmp_logs_first_date", "local_notemyprogress"), + "logs_indicators_last_date" => get_string("nmp_logs_last_date", "local_notemyprogress"), + "logs_indicators_title_select" => get_string("nmp_logs_select_date", "local_notemyprogress"), + "logs_valid_date" => get_string("nmp_logs_valid_date", "local_notemyprogress"), + "logs_valid_Moodlebtn" => get_string("nmp_logs_valid_Moodlebtn", "local_notemyprogress"), + "logs_valid_NMPbtn" => get_string("nmp_logs_valid_NMPbtn", "local_notemyprogress"), + "logs_invalid_date" => get_string("nmp_logs_invalid_date", "local_notemyprogress"), + "logs_title_MoodleSetpoint_title" => get_string("nmp_logs_title_MoodleSetpoint_title", "local_notemyprogress"), + "logs_title_MMPSetpoint_title" => get_string("nmp_logs_title_MMPSetpoint_title", "local_notemyprogress"), + "logs_download_btn" => get_string("nmp_logs_download_btn", "local_notemyprogress"), + + "logs_download_nmp_help_title" => get_string("nmp_logs_download_nmp_help_title", "local_notemyprogress"), + "logs_download_moodle_help_title" => get_string("nmp_logs_download_moodle_help_title", "local_notemyprogress"), + "logs_download_moodle_help_description" => get_string("nmp_logs_download_moodle_help_description","local_notemyprogress"), + "logs_download_nmp_help_description" => get_string("nmp_logs_download_nmp_help_description","local_notemyprogress"), + + "logs_moodle_csv_headers_role" => get_string("nmp_logs_moodle_csv_headers_role", "local_notemyprogress"), + "logs_moodle_csv_headers_email" => get_string("nmp_logs_moodle_csv_headers_email","local_notemyprogress"), + "logs_moodle_csv_headers_username" => get_string("nmp_logs_moodle_csv_headers_username","local_notemyprogress"), + "logs_moodle_csv_headers_fullname" => get_string("nmp_logs_moodle_csv_headers_fullname","local_notemyprogress"), + "logs_moodle_csv_headers_date" => get_string("nmp_logs_moodle_csv_headers_date","local_notemyprogress"), + "logs_moodle_csv_headers_hour" => get_string("nmp_logs_moodle_csv_headers_hour","local_notemyprogress"), + "logs_moodle_csv_headers_action" => get_string("nmp_logs_moodle_csv_headers_action","local_notemyprogress"), + "logs_moodle_csv_headers_courseid" => get_string("nmp_logs_moodle_csv_headers_courseid","local_notemyprogress"), + "logs_moodle_csv_headers_coursename" => get_string("nmp_logs_moodle_csv_headers_coursename","local_notemyprogress"), + "logs_moodle_csv_headers_detailid" => get_string("nmp_logs_moodle_csv_headers_detailid", "local_notemyprogress"), + "logs_moodle_csv_headers_details" => get_string("nmp_logs_moodle_csv_headers_details", "local_notemyprogress"), + "logs_moodle_csv_headers_detailstype" => get_string("nmp_logs_moodle_csv_headers_detailstype", "local_notemyprogress"), + + "logs_moodle_csv_headers_role_description" => get_string("nmp_logs_moodle_csv_headers_role_description", "local_notemyprogress"), + "logs_moodle_csv_headers_email_description" => get_string("nmp_logs_moodle_csv_headers_email_description","local_notemyprogress"), + "logs_moodle_csv_headers_username_description" => get_string("nmp_logs_moodle_csv_headers_username_description","local_notemyprogress"), + "logs_moodle_csv_headers_fullname_description" => get_string("nmp_logs_moodle_csv_headers_fullname_description","local_notemyprogress"), + "logs_moodle_csv_headers_date_description" => get_string("nmp_logs_moodle_csv_headers_date_description","local_notemyprogress"), + "logs_moodle_csv_headers_hour_description" => get_string("nmp_logs_moodle_csv_headers_hour_description","local_notemyprogress"), + "logs_moodle_csv_headers_action_description" => get_string("nmp_logs_moodle_csv_headers_action_description","local_notemyprogress"), + "logs_moodle_csv_headers_courseid_description" => get_string("nmp_logs_moodle_csv_headers_courseid_description","local_notemyprogress"), + "logs_moodle_csv_headers_coursename_description" => get_string("nmp_logs_moodle_csv_headers_coursename_description","local_notemyprogress"), + "logs_moodle_csv_headers_detailid_description" => get_string("nmp_logs_moodle_csv_headers_detailid_description", "local_notemyprogress"), + "logs_moodle_csv_headers_details_description" => get_string("nmp_logs_moodle_csv_headers_details_description", "local_notemyprogress"), + "logs_moodle_csv_headers_detailstype_description" => get_string("nmp_logs_moodle_csv_headers_detailstype_description", "local_notemyprogress"), + + + + "logs_nmp_csv_headers_role" => get_string("nmp_logs_nmp_csv_headers_role", "local_notemyprogress"), + "logs_nmp_csv_headers_email" => get_string("nmp_logs_nmp_csv_headers_email","local_notemyprogress"), + "logs_nmp_csv_headers_username" => get_string("nmp_logs_nmp_csv_headers_username","local_notemyprogress"), + "logs_nmp_csv_headers_fullname" => get_string("nmp_logs_nmp_csv_headers_fullname","local_notemyprogress"), + "logs_nmp_csv_headers_date" => get_string("nmp_logs_nmp_csv_headers_date","local_notemyprogress"), + "logs_nmp_csv_headers_hour" => get_string("nmp_logs_nmp_csv_headers_hour","local_notemyprogress"), + "logs_nmp_csv_headers_courseid" => get_string("nmp_logs_nmp_csv_headers_courseid","local_notemyprogress"), + "logs_nmp_csv_headers_section_name" => get_string("nmp_logs_nmp_csv_headers_section_name", "local_notemyprogress"), + "logs_nmp_csv_headers_action_type" => get_string("nmp_logs_nmp_csv_headers_action_type", "local_notemyprogress"), + + "logs_nmp_csv_headers_role_description" => get_string("nmp_logs_nmp_csv_headers_role_description", "local_notemyprogress"), + "logs_nmp_csv_headers_email_description" => get_string("nmp_logs_nmp_csv_headers_email_description","local_notemyprogress"), + "logs_nmp_csv_headers_username_description" => get_string("nmp_logs_nmp_csv_headers_username_description","local_notemyprogress"), + "logs_nmp_csv_headers_fullname_description" => get_string("nmp_logs_nmp_csv_headers_fullname_description","local_notemyprogress"), + "logs_nmp_csv_headers_date_description" => get_string("nmp_logs_nmp_csv_headers_date_description","local_notemyprogress"), + "logs_nmp_csv_headers_hour_description" => get_string("nmp_logs_nmp_csv_headers_hour_description","local_notemyprogress"), + "logs_nmp_csv_headers_courseid_description" => get_string("nmp_logs_nmp_csv_headers_courseid_description","local_notemyprogress"), + "logs_nmp_csv_headers_section_name_description" => get_string("nmp_logs_nmp_csv_headers_section_name_description", "local_notemyprogress"), + "logs_nmp_csv_headers_action_type_description" => get_string("nmp_logs_nmp_csv_headers_action_type_description", "local_notemyprogress"), + + "logs_success_file_downloaded" => get_string("nmp_logs_success_file_downloaded", "local_notemyprogress"), + "logs_error_problem_encountered" => get_string("nmp_logs_error_problem_encountered", "local_notemyprogress"), + "logs_error_begin_date_superior" => get_string("nmp_logs_error_begin_date_superior", "local_notemyprogress"), + "logs_error_begin_date_inferior" => get_string("nmp_logs_error_begin_date_inferior", "local_notemyprogress"), + "logs_error_empty_dates" => get_string("nmp_logs_error_empty_dates", "local_notemyprogress"), + + "logs_moodle_table_title" => get_string("nmp_logs_moodle_table_title", "local_notemyprogress"), + "logs_moodle_table_subtitle" => get_string("nmp_logs_moodle_table_subtitle", "local_notemyprogress"), + + "logs_nmp_table_title" => get_string("nmp_logs_nmp_table_title", "local_notemyprogress"), + "logs_nmp_table_subtitle" => get_string("nmp_logs_nmp_table_subtitle", "local_notemyprogress"), + + "logs_help_button_nmp" => get_string("nmp_logs_help_button_nmp", "local_notemyprogress"), + "logs_help_button_moodle" => get_string("nmp_logs_help_button_moodle", "local_notemyprogress"), + + "logs_download_details_title" => get_string("nmp_logs_download_details_title", "local_notemyprogress"), + "logs_download_details_description" => get_string("nmp_logs_download_details_title", "local_notemyprogress"), + "logs_download_details_ok" => get_string("nmp_logs_download_details_ok", "local_notemyprogress"), + "logs_download_details_cancel" => get_string("nmp_logs_download_details_cancel", "local_notemyprogress"), + "logs_download_details_validation" => get_string("nmp_logs_download_details_validation", "local_notemyprogress"), + "logs_download_details_link" => get_string("nmp_logs_download_details_link", "local_notemyprogress"), ] ]; diff --git a/notemyprogress/metareflexion.php b/notemyprogress/metareflexion.php index dd942332fd9571046628a01e9b42e95da8cb492d..cdf73d07a45f874d5d0cbf57bb2f613d295eed4a 100644 --- a/notemyprogress/metareflexion.php +++ b/notemyprogress/metareflexion.php @@ -9,8 +9,8 @@ $course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST); $context = context_course::instance($course->id); require_capability('local/notemyprogress:usepluggin', $context); -//require_capability('local/notemyprogress:view_as_student', $context); -//require_capability('local/notemyprogress:student_sessions', $context); +require_capability('local/notemyprogress:view_as_student', $context); +require_capability('local/notemyprogress:student_sessions', $context); $url = '/local/student_reports/metareflexion.php'; local_notemyprogress_set_page($course, $url); @@ -33,35 +33,35 @@ if (!$configweeks->is_set()) { $content = [ 'strings' => array( - "inverted_time_chart_title" => get_string("fml_student_time_inverted_title", "local_notemyprogress"), - "inverted_time_chart_x_axis" => get_string("fml_student_time_inverted_x_axis", "local_notemyprogress"), - "inverted_time" => get_string("fml_student_inverted_time", "local_notemyprogress"), - "expected_time" => get_string("fml_student_expected_time", "local_notemyprogress"), - - "resource_access_title" => get_string("fml_resource_access_title", "local_notemyprogress"), - "resource_access_x_axis" => get_string("fml_resource_access_x_axis", "local_notemyprogress"), - "resource_access_y_axis" => get_string("fml_resource_access_y_axis", "local_notemyprogress"), - "resource_access_legend1" => get_string("fml_resource_access_legend1", "local_notemyprogress"), - "resource_access_legend2" => get_string("fml_resource_access_legend2", "local_notemyprogress"), - - "hours_sessions_title" => get_string("fml_hours_sessions_title", "local_notemyprogress"), - "week_progress_title" => get_string("fml_week_progress_title", "local_notemyprogress"), - - "session_text" => get_string("fml_session_text", "local_notemyprogress"), - "sessions_text" => get_string("fml_sessions_text", "local_notemyprogress"), - "modules_details" => get_string("fml_modules_details", "local_notemyprogress"), - - "hours_short" => get_string("fml_hours_short", "local_notemyprogress"), - "minutes_short" => get_string("fml_minutes_short", "local_notemyprogress"), - "seconds_short" => get_string("fml_seconds_short", "local_notemyprogress"), - - "modules_access_chart_title" => get_string("fml_modules_access_chart_title", "local_notemyprogress"), - "modules_viewed" => get_string("fml_modules_viewed", "local_notemyprogress"), - "modules_no_viewed" => get_string("fml_modules_no_viewed", "local_notemyprogress"), - "modules_complete" => get_string("fml_modules_complete", "local_notemyprogress"), - "modules_interaction" => get_string("fml_modules_interaction", "local_notemyprogress"), - "modules_interactions" => get_string("fml_modules_interactions", "local_notemyprogress"), - "close_button" => get_string("fml_close_button", "local_notemyprogress"), + "inverted_time_chart_title" => get_string("nmp_student_time_inverted_title", "local_notemyprogress"), + "inverted_time_chart_x_axis" => get_string("nmp_student_time_inverted_x_axis", "local_notemyprogress"), + "inverted_time" => get_string("nmp_student_inverted_time", "local_notemyprogress"), + "expected_time" => get_string("nmp_student_expected_time", "local_notemyprogress"), + + "resource_access_title" => get_string("nmp_resource_access_title", "local_notemyprogress"), + "resource_access_x_axis" => get_string("nmp_resource_access_x_axis", "local_notemyprogress"), + "resource_access_y_axis" => get_string("nmp_resource_access_y_axis", "local_notemyprogress"), + "resource_access_legend1" => get_string("nmp_resource_access_legend1", "local_notemyprogress"), + "resource_access_legend2" => get_string("nmp_resource_access_legend2", "local_notemyprogress"), + + "hours_sessions_title" => get_string("nmp_hours_sessions_title", "local_notemyprogress"), + "week_progress_title" => get_string("nmp_week_progress_title", "local_notemyprogress"), + + "session_text" => get_string("nmp_session_text", "local_notemyprogress"), + "sessions_text" => get_string("nmp_sessions_text", "local_notemyprogress"), + "modules_details" => get_string("nmp_modules_details", "local_notemyprogress"), + + "hours_short" => get_string("nmp_hours_short", "local_notemyprogress"), + "minutes_short" => get_string("nmp_minutes_short", "local_notemyprogress"), + "seconds_short" => get_string("nmp_seconds_short", "local_notemyprogress"), + + "modules_access_chart_title" => get_string("nmp_modules_access_chart_title", "local_notemyprogress"), + "modules_viewed" => get_string("nmp_modules_viewed", "local_notemyprogress"), + "modules_no_viewed" => get_string("nmp_modules_no_viewed", "local_notemyprogress"), + "modules_complete" => get_string("nmp_modules_complete", "local_notemyprogress"), + "modules_interaction" => get_string("nmp_modules_interaction", "local_notemyprogress"), + "modules_interactions" => get_string("nmp_modules_interactions", "local_notemyprogress"), + "close_button" => get_string("nmp_close_button", "local_notemyprogress"), 'hours_unit_time_label' => get_string('hours_unit_time_label', 'local_notemyprogress'), 'graph_generating' => get_string('graph_generating', 'local_notemyprogress'), @@ -179,6 +179,9 @@ $content = [ "goals_reflexion_title" => get_string("metareflexion_goals_reflexion_title", "local_notemyprogress"), "title_hours_plan" => get_string("metareflexion_title_hours_plan", "local_notemyprogress"), "title_retrospective" => get_string("metareflexion_title_retrospective", "local_notemyprogress"), + "goal1" => get_string("metareflexion_goal1", "local_notemyprogress"), + "goal2" => get_string("metareflexion_goal2", "local_notemyprogress"), + "goal3" => get_string("metareflexion_goal3", "local_notemyprogress"), ), //'indicators' => $reports->get_general_indicators(), @@ -200,7 +203,6 @@ $content = [ //metareflexion/last_week 'lastweek' => $metareflexion->find_last_week(), - 'data_report_hours_questions' => $reports->questions_report_metereflexion(), //other @@ -215,14 +217,13 @@ $content = [ //'students_planification' => $reports->students_planification_summary(), //Classroom UNUSED - 'data_report_classroom' => $reports->classroom_report_metareflexion(), - 'data_report_of_classroom' => $reports->classroom_report_metareflexion(), - 'report_last_week' => $reports->report_last_week(), + //'data_report_classroom' => $reports->classroom_report_metareflexion(), + //'data_report_of_classroom' => $reports->classroom_report_metareflexion(), + //'report_last_week' => $reports->report_last_week(), ]; -//debug_text::print("reports",$reports->status_planning()); //if (!has_capability('local/notemyprogress:view_as_teacher', $context)) { -$teacher = new \local_notemyprogress\teacher($COURSE->id, $USER->id); -$content['course_report_hours'] = $teacher->hours_report_metereflexion(); +//$teacher = new \local_notemyprogress\teacher($COURSE->id, $USER->id); +$content['course_report_hours'] = $reports->hours_report_metereflexion(); //} $PAGE->requires->js_call_amd('local_notemyprogress/metareflexion', 'init', ['content' => $content]); diff --git a/notemyprogress/pix/badge.png b/notemyprogress/pix/badge.png new file mode 100644 index 0000000000000000000000000000000000000000..a8967018c82681ff21d40c98ba76980a64c70ca6 Binary files /dev/null and b/notemyprogress/pix/badge.png differ diff --git a/notemyprogress/pix/rankImage.jpg b/notemyprogress/pix/rankImage.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d76465c8405a7cbe5825e39e070d0709e5d4b493 Binary files /dev/null and b/notemyprogress/pix/rankImage.jpg differ diff --git a/notemyprogress/prueba.php b/notemyprogress/prueba.php index f20ae14939f78114f144ac7374c4086c3e2918ce..5c3f44e44f9e2fb696965e09136be37c3ecc701e 100644 --- a/notemyprogress/prueba.php +++ b/notemyprogress/prueba.php @@ -47,7 +47,7 @@ $content = [ -$PAGE->requires->js_call_amd('local_notemyprogress/prueba','init', ['content' => $content]); +$PAGE->requires->js_call_amd('local_notemyprogress/prueba', 'init', ['content' => $content]); echo $OUTPUT->header(); echo $OUTPUT->render_from_template('local_notemyprogress/prueba', ['content' => $content]); -echo $OUTPUT->footer(); \ No newline at end of file +echo $OUTPUT->footer(); diff --git a/notemyprogress/quiz.php b/notemyprogress/quiz.php index cff6b700f1ee1e41f35435c2e1943eb8af6cc0b9..986fe17d2a31bfa1b24a1b51739e848b5abcc064 100644 --- a/notemyprogress/quiz.php +++ b/notemyprogress/quiz.php @@ -73,31 +73,31 @@ $content = [ "pagination_title" => get_string("pagination_title","local_notemyprogress"), "helplabel" => get_string("helplabel","local_notemyprogress"), "exitbutton" => get_string("exitbutton","local_notemyprogress"), - "about" => get_string("fml_about", "local_notemyprogress"), + "about" => get_string("nmp_about", "local_notemyprogress"), - "quiz_info_text" => get_string("fml_quiz_info_text", "local_notemyprogress"), - "question_text" => get_string("fml_question_text", "local_notemyprogress"), - "questions_text" => get_string("fml_questions_text", "local_notemyprogress"), - "doing_text_singular" => get_string("fml_doing_text_singular", "local_notemyprogress"), - "doing_text_plural" => get_string("fml_doing_text_plural", "local_notemyprogress"), - "attempt_text" => get_string("fml_attempt_text", "local_notemyprogress"), - "attempts_text" => get_string("fml_attempts_text", "local_notemyprogress"), - "student_text" => get_string("fml_student_text", "local_notemyprogress"), - "students_text" => get_string("fml_students_text", "local_notemyprogress"), - "of_conector" => get_string("fml_of_conector", "local_notemyprogress"), - "quiz_label" => get_string("fml_quiz", "local_notemyprogress"), + "quiz_info_text" => get_string("nmp_quiz_info_text", "local_notemyprogress"), + "question_text" => get_string("nmp_question_text", "local_notemyprogress"), + "questions_text" => get_string("nmp_questions_text", "local_notemyprogress"), + "doing_text_singular" => get_string("nmp_doing_text_singular", "local_notemyprogress"), + "doing_text_plural" => get_string("nmp_doing_text_plural", "local_notemyprogress"), + "attempt_text" => get_string("nmp_attempt_text", "local_notemyprogress"), + "attempts_text" => get_string("nmp_attempts_text", "local_notemyprogress"), + "student_text" => get_string("nmp_student_text", "local_notemyprogress"), + "students_text" => get_string("nmp_students_text", "local_notemyprogress"), + "of_conector" => get_string("nmp_of_conector", "local_notemyprogress"), + "quiz_label" => get_string("nmp_quiz", "local_notemyprogress"), - "questions_attempts_chart_title" => get_string("fml_questions_attempts_chart_title", "local_notemyprogress"), - "questions_attempts_yaxis_title" => get_string("fml_questions_attempts_yaxis_title", "local_notemyprogress"), - "hardest_questions_chart_title" => get_string("fml_hardest_questions_chart_title", "local_notemyprogress"), - "hardest_questions_yaxis_title" => get_string("fml_hardest_questions_yaxis_title", "local_notemyprogress"), + "questions_attempts_chart_title" => get_string("nmp_questions_attempts_chart_title", "local_notemyprogress"), + "questions_attempts_yaxis_title" => get_string("nmp_questions_attempts_yaxis_title", "local_notemyprogress"), + "hardest_questions_chart_title" => get_string("nmp_hardest_questions_chart_title", "local_notemyprogress"), + "hardest_questions_yaxis_title" => get_string("nmp_hardest_questions_yaxis_title", "local_notemyprogress"), - "correct_attempt" => get_string("fml_correct_attempt", "local_notemyprogress"), - "partcorrect_attempt" => get_string("fml_partcorrect_attempt", "local_notemyprogress"), - "incorrect_attempt" => get_string("fml_incorrect_attempt", "local_notemyprogress"), - "blank_attempt" => get_string("fml_blank_attempt", "local_notemyprogress"), - "needgraded_attempt" => get_string("fml_needgraded_attempt", "local_notemyprogress"), - "review_question" => get_string("fml_review_question", "local_notemyprogress"), + "correct_attempt" => get_string("nmp_correct_attempt", "local_notemyprogress"), + "partcorrect_attempt" => get_string("nmp_partcorrect_attempt", "local_notemyprogress"), + "incorrect_attempt" => get_string("nmp_incorrect_attempt", "local_notemyprogress"), + "blank_attempt" => get_string("nmp_blank_attempt", "local_notemyprogress"), + "needgraded_attempt" => get_string("nmp_needgraded_attempt", "local_notemyprogress"), + "review_question" => get_string("nmp_review_question", "local_notemyprogress"), ], 'questions_attempts_colors' => array('#06D6A0', '#FFD166', '#EF476F', '#118AB2', '#264653'), diff --git a/notemyprogress/sessions.php b/notemyprogress/sessions.php index ee60fe6cacafe0c226119d9fcd64279993eea61f..ba04d472e3031ef4378482759d039d55a0eb43aa 100644 --- a/notemyprogress/sessions.php +++ b/notemyprogress/sessions.php @@ -62,50 +62,50 @@ $content = [ "sessions_count_help_description_p1" => get_string("ts_sessions_count_help_description_p1", "local_notemyprogress"), "sessions_count_help_description_p2" => get_string("ts_sessions_count_help_description_p2", "local_notemyprogress"), - "title" => get_string("fml_title", "local_notemyprogress"), + "title" => get_string("nmp_title", "local_notemyprogress"), "chart" => $reports->get_chart_langs(), "days" => array( - get_string("fml_mon_short", "local_notemyprogress"), - get_string("fml_tue_short", "local_notemyprogress"), - get_string("fml_wed_short", "local_notemyprogress"), - get_string("fml_thu_short", "local_notemyprogress"), - get_string("fml_fri_short", "local_notemyprogress"), - get_string("fml_sat_short", "local_notemyprogress"), - get_string("fml_sun_short", "local_notemyprogress"), + get_string("nmp_mon_short", "local_notemyprogress"), + get_string("nmp_tue_short", "local_notemyprogress"), + get_string("nmp_wed_short", "local_notemyprogress"), + get_string("nmp_thu_short", "local_notemyprogress"), + get_string("nmp_fri_short", "local_notemyprogress"), + get_string("nmp_sat_short", "local_notemyprogress"), + get_string("nmp_sun_short", "local_notemyprogress"), ), "hours" => array( - get_string("fml_00", "local_notemyprogress"), - get_string("fml_01", "local_notemyprogress"), - get_string("fml_02", "local_notemyprogress"), - get_string("fml_03", "local_notemyprogress"), - get_string("fml_04", "local_notemyprogress"), - get_string("fml_05", "local_notemyprogress"), - get_string("fml_06", "local_notemyprogress"), - get_string("fml_07", "local_notemyprogress"), - get_string("fml_08", "local_notemyprogress"), - get_string("fml_09", "local_notemyprogress"), - get_string("fml_10", "local_notemyprogress"), - get_string("fml_11", "local_notemyprogress"), - get_string("fml_12", "local_notemyprogress"), - get_string("fml_13", "local_notemyprogress"), - get_string("fml_14", "local_notemyprogress"), - get_string("fml_15", "local_notemyprogress"), - get_string("fml_16", "local_notemyprogress"), - get_string("fml_17", "local_notemyprogress"), - get_string("fml_18", "local_notemyprogress"), - get_string("fml_19", "local_notemyprogress"), - get_string("fml_20", "local_notemyprogress"), - get_string("fml_21", "local_notemyprogress"), - get_string("fml_22", "local_notemyprogress"), - get_string("fml_23", "local_notemyprogress"), + get_string("nmp_00", "local_notemyprogress"), + get_string("nmp_01", "local_notemyprogress"), + get_string("nmp_02", "local_notemyprogress"), + get_string("nmp_03", "local_notemyprogress"), + get_string("nmp_04", "local_notemyprogress"), + get_string("nmp_05", "local_notemyprogress"), + get_string("nmp_06", "local_notemyprogress"), + get_string("nmp_07", "local_notemyprogress"), + get_string("nmp_08", "local_notemyprogress"), + get_string("nmp_09", "local_notemyprogress"), + get_string("nmp_10", "local_notemyprogress"), + get_string("nmp_11", "local_notemyprogress"), + get_string("nmp_12", "local_notemyprogress"), + get_string("nmp_13", "local_notemyprogress"), + get_string("nmp_14", "local_notemyprogress"), + get_string("nmp_15", "local_notemyprogress"), + get_string("nmp_16", "local_notemyprogress"), + get_string("nmp_17", "local_notemyprogress"), + get_string("nmp_18", "local_notemyprogress"), + get_string("nmp_19", "local_notemyprogress"), + get_string("nmp_20", "local_notemyprogress"), + get_string("nmp_21", "local_notemyprogress"), + get_string("nmp_22", "local_notemyprogress"), + get_string("nmp_23", "local_notemyprogress"), ), "weeks" => array( - get_string("fml_week1", "local_notemyprogress"), - get_string("fml_week2", "local_notemyprogress"), - get_string("fml_week3", "local_notemyprogress"), - get_string("fml_week4", "local_notemyprogress"), - get_string("fml_week5", "local_notemyprogress"), - get_string("fml_week6", "local_notemyprogress"), + get_string("nmp_week1", "local_notemyprogress"), + get_string("nmp_week2", "local_notemyprogress"), + get_string("nmp_week3", "local_notemyprogress"), + get_string("nmp_week4", "local_notemyprogress"), + get_string("nmp_week5", "local_notemyprogress"), + get_string("nmp_week6", "local_notemyprogress"), ), "table_title" => get_string("table_title", "local_notemyprogress"), "thead_name" => get_string("thead_name", "local_notemyprogress"), @@ -114,20 +114,20 @@ $content = [ "thead_progress" => get_string("thead_progress", "local_notemyprogress"), "thead_sessions" => get_string("thead_sessions", "local_notemyprogress"), "thead_time" => get_string("thead_time", "local_notemyprogress"), - "about" => get_string("fml_about", "local_notemyprogress"), + "about" => get_string("nmp_about", "local_notemyprogress"), - "module_label" => get_string("fml_module_label", "local_notemyprogress"), - "modules_label" => get_string("fml_modules_label", "local_notemyprogress"), - "of_conector" => get_string("fml_of_conector", "local_notemyprogress"), - "finished_label" => get_string("fml_finished_label", "local_notemyprogress"), - "finisheds_label" => get_string("fml_finisheds_label", "local_notemyprogress"), + "module_label" => get_string("nmp_module_label", "local_notemyprogress"), + "modules_label" => get_string("nmp_modules_label", "local_notemyprogress"), + "of_conector" => get_string("nmp_of_conector", "local_notemyprogress"), + "finished_label" => get_string("nmp_finished_label", "local_notemyprogress"), + "finisheds_label" => get_string("nmp_finisheds_label", "local_notemyprogress"), - "session_count_title" => get_string("fml_session_count_title", "local_notemyprogress"), - "session_count_yaxis_title" => get_string("fml_session_count_yaxis_title", "local_notemyprogress"), - "session_count_tooltip_suffix" => get_string("fml_session_count_tooltip_suffix", "local_notemyprogress"), + "session_count_title" => get_string("nmp_session_count_title", "local_notemyprogress"), + "session_count_yaxis_title" => get_string("nmp_session_count_yaxis_title", "local_notemyprogress"), + "session_count_tooltip_suffix" => get_string("nmp_session_count_tooltip_suffix", "local_notemyprogress"), - "hours_sessions_title" => get_string("fml_hours_sessions_title", "local_notemyprogress"), - "weeks_sessions_title" => get_string("fml_weeks_sessions_title", "local_notemyprogress"), + "hours_sessions_title" => get_string("nmp_hours_sessions_title", "local_notemyprogress"), + "weeks_sessions_title" => get_string("nmp_weeks_sessions_title", "local_notemyprogress"), "no_data" => get_string("no_data", "local_notemyprogress"), "pagination" => get_string("pagination", "local_notemyprogress"), @@ -140,17 +140,17 @@ $content = [ "helplabel" => get_string("helplabel", "local_notemyprogress"), "exitbutton" => get_string("exitbutton", "local_notemyprogress"), - "session_text" => get_string("fml_session_text", "local_notemyprogress"), - "sessions_text" => get_string("fml_sessions_text", "local_notemyprogress"), + "session_text" => get_string("nmp_session_text", "local_notemyprogress"), + "sessions_text" => get_string("nmp_sessions_text", "local_notemyprogress"), - "time_inverted_title" => get_string("fml_time_inverted_title", "local_notemyprogress"), - "time_inverted_x_axis" => get_string("fml_time_inverted_x_axis", "local_notemyprogress"), - "inverted_time" => get_string("fml_inverted_time", "local_notemyprogress"), - "expected_time" => get_string("fml_expected_time", "local_notemyprogress"), + "time_inverted_title" => get_string("nmp_time_inverted_title", "local_notemyprogress"), + "time_inverted_x_axis" => get_string("nmp_time_inverted_x_axis", "local_notemyprogress"), + "inverted_time" => get_string("nmp_inverted_time", "local_notemyprogress"), + "expected_time" => get_string("nmp_expected_time", "local_notemyprogress"), - "hours_short" => get_string("fml_hours_short", "local_notemyprogress"), - "minutes_short" => get_string("fml_minutes_short", "local_notemyprogress"), - "seconds_short" => get_string("fml_seconds_short", "local_notemyprogress"), + "hours_short" => get_string("nmp_hours_short", "local_notemyprogress"), + "minutes_short" => get_string("nmp_minutes_short", "local_notemyprogress"), + "seconds_short" => get_string("nmp_seconds_short", "local_notemyprogress"), ], 'inverted_time_colors' => array('#118AB2', '#06D6A0'), 'sessions_count_colors' => array('#FFD166', '#06D6A0', '#118AB2'), diff --git a/notemyprogress/settings.php b/notemyprogress/settings.php index c68f382fb15dba74ecc845902b1619519e44c6ba..7a7bff26ef1c10c36f582b363bc0822067c3a36d 100644 --- a/notemyprogress/settings.php +++ b/notemyprogress/settings.php @@ -17,32 +17,32 @@ if ($hassiteconfig) { $ADMIN->add('localplugins', $settings); // MongoDB hostname - $label = get_string('fml_settings_bddaddress_label', 'local_notemyprogress'); - $desc = get_string('fml_settings_bddaddress_description', 'local_notemyprogress'); + $label = get_string('nmp_settings_bddaddress_label', 'local_notemyprogress'); + $desc = get_string('nmp_settings_bddaddress_description', 'local_notemyprogress'); $default = "localhost"; $settings->add(new \admin_setting_configtext('local_notemyprogress/mongoDBlink', $label, $desc, $default)); // MongoDB database port - $label = get_string('fml_settings_bddport_label', 'local_notemyprogress'); - $desc = get_string('fml_settings_bddport_description', 'local_notemyprogress'); + $label = get_string('nmp_settings_bddport_label', 'local_notemyprogress'); + $desc = get_string('nmp_settings_bddport_description', 'local_notemyprogress'); $default = "27017"; $settings->add(new \admin_setting_configtext('local_notemyprogress/mongoDBport', $label, $desc, $default)); // MongoDB Username - $label = get_string('fml_settings_bddusername_label', 'local_notemyprogress'); - $desc = get_string('fml_settings_bddusername_description', 'local_notemyprogress'); + $label = get_string('nmp_settings_bddusername_label', 'local_notemyprogress'); + $desc = get_string('nmp_settings_bddusername_description', 'local_notemyprogress'); $default = ""; $settings->add(new \admin_setting_configtext('local_notemyprogress/mongoDBusername', $label, $desc, $default)); // MongoDB Password - $label = get_string('fml_settings_bddpassword_label', 'local_notemyprogress'); - $desc = get_string('fml_settings_bddpassword_description', 'local_notemyprogress'); + $label = get_string('nmp_settings_bddpassword_label', 'local_notemyprogress'); + $desc = get_string('nmp_settings_bddpassword_description', 'local_notemyprogress'); $default = ""; $settings->add(new \admin_setting_configtext('local_notemyprogress/mongoDBpassword', $label, $desc, $default)); // MongoDB database name - $label = get_string('fml_settings_bddname_label', 'local_notemyprogress'); - $desc = get_string('fml_settings_bddname_description', 'local_notemyprogress'); + $label = get_string('nmp_settings_bddname_label', 'local_notemyprogress'); + $desc = get_string('nmp_settings_bddname_description', 'local_notemyprogress'); $default = "logs_notemyprogress"; $settings->add(new \admin_setting_configtext('local_notemyprogress/mongoDBname', $label, $desc, $default)); } diff --git a/notemyprogress/student.php b/notemyprogress/student.php index c9bdb332d9943808223f05350b699f906ca8db0d..21ee848ee6f2e3b67422b5619cb2a29d37c2dc4c 100644 --- a/notemyprogress/student.php +++ b/notemyprogress/student.php @@ -85,65 +85,65 @@ $content = [ "api_error_network" => get_string("api_error_network", "local_notemyprogress"), "helplabel" => get_string("helplabel", "local_notemyprogress"), "exitbutton" => get_string("exitbutton", "local_notemyprogress"), - "about" => get_string("fml_about", "local_notemyprogress"), + "about" => get_string("nmp_about", "local_notemyprogress"), "weeks" => array( - get_string("fml_week1", "local_notemyprogress"), - get_string("fml_week2", "local_notemyprogress"), - get_string("fml_week3", "local_notemyprogress"), - get_string("fml_week4", "local_notemyprogress"), - get_string("fml_week5", "local_notemyprogress"), - get_string("fml_week6", "local_notemyprogress"), + get_string("nmp_week1", "local_notemyprogress"), + get_string("nmp_week2", "local_notemyprogress"), + get_string("nmp_week3", "local_notemyprogress"), + get_string("nmp_week4", "local_notemyprogress"), + get_string("nmp_week5", "local_notemyprogress"), + get_string("nmp_week6", "local_notemyprogress"), ), "modules_strings" => array( - "title" => get_string("fml_modules_access_chart_title","local_notemyprogress"), - "modules_no_viewed" => get_string("fml_modules_no_viewed","local_notemyprogress"), - "modules_viewed" => get_string("fml_modules_viewed","local_notemyprogress"), - "modules_complete" => get_string("fml_modules_complete","local_notemyprogress"), - "close_button" => get_string("fml_close_button","local_notemyprogress"), - "modules_interaction" => get_string("fml_modules_interaction","local_notemyprogress"), - "modules_interactions" => get_string("fml_modules_interactions","local_notemyprogress"), + "title" => get_string("nmp_modules_access_chart_title","local_notemyprogress"), + "modules_no_viewed" => get_string("nmp_modules_no_viewed","local_notemyprogress"), + "modules_viewed" => get_string("nmp_modules_viewed","local_notemyprogress"), + "modules_complete" => get_string("nmp_modules_complete","local_notemyprogress"), + "close_button" => get_string("nmp_close_button","local_notemyprogress"), + "modules_interaction" => get_string("nmp_modules_interaction","local_notemyprogress"), + "modules_interactions" => get_string("nmp_modules_interactions","local_notemyprogress"), ), - "student_progress_title" => get_string("fml_dropout_student_progress_title", "local_notemyprogress"), - "see_profile" => get_string("fml_dropout_see_profile", "local_notemyprogress"), - "module_label" => get_string("fml_module_label", "local_notemyprogress"), - "modules_label" => get_string("fml_modules_label", "local_notemyprogress"), - "of_conector" => get_string("fml_of_conector", "local_notemyprogress"), - "finished_label" => get_string("fml_finished_label", "local_notemyprogress"), - "finisheds_label" => get_string("fml_finisheds_label", "local_notemyprogress"), - "session_text" => get_string("fml_session_text", "local_notemyprogress"), - "sessions_text" => get_string("fml_sessions_text", "local_notemyprogress"), - "hours_short" => get_string("fml_hours_short", "local_notemyprogress"), - "minutes_short" => get_string("fml_minutes_short", "local_notemyprogress"), - "seconds_short" => get_string("fml_seconds_short", "local_notemyprogress"), + "student_progress_title" => get_string("nmp_dropout_student_progress_title", "local_notemyprogress"), + "see_profile" => get_string("nmp_dropout_see_profile", "local_notemyprogress"), + "module_label" => get_string("nmp_module_label", "local_notemyprogress"), + "modules_label" => get_string("nmp_modules_label", "local_notemyprogress"), + "of_conector" => get_string("nmp_of_conector", "local_notemyprogress"), + "finished_label" => get_string("nmp_finished_label", "local_notemyprogress"), + "finisheds_label" => get_string("nmp_finisheds_label", "local_notemyprogress"), + "session_text" => get_string("nmp_session_text", "local_notemyprogress"), + "sessions_text" => get_string("nmp_sessions_text", "local_notemyprogress"), + "hours_short" => get_string("nmp_hours_short", "local_notemyprogress"), + "minutes_short" => get_string("nmp_minutes_short", "local_notemyprogress"), + "seconds_short" => get_string("nmp_seconds_short", "local_notemyprogress"), "inverted_time_title" => get_string("thead_time", "local_notemyprogress"), "count_sessions_title" => get_string("thead_sessions", "local_notemyprogress"), - "student_grade_title" => get_string("fml_dropout_student_grade_title", "local_notemyprogress"), - "modules_access_chart_title" => get_string("fml_modules_access_chart_title", "local_notemyprogress"), - "modules_amount" => get_string("fml_modules_amount", "local_notemyprogress"), - "modules_details" => get_string("fml_modules_details", "local_notemyprogress"), - "modules_interaction" => get_string("fml_modules_interaction", "local_notemyprogress"), - "modules_interactions" => get_string("fml_modules_interactions", "local_notemyprogress"), - "modules_viewed" => get_string("fml_modules_viewed", "local_notemyprogress"), - "modules_no_viewed" => get_string("fml_modules_no_viewed", "local_notemyprogress"), - "modules_complete" => get_string("fml_modules_complete", "local_notemyprogress"), - "close_button" => get_string("fml_close_button", "local_notemyprogress"), - "modules_access_chart_title" => get_string("fml_modules_access_chart_title", "local_notemyprogress"), - "modules_access_chart_series_total" => get_string("fml_modules_access_chart_series_total", "local_notemyprogress"), - "modules_access_chart_series_complete" => get_string("fml_modules_access_chart_series_complete", "local_notemyprogress"), - "modules_access_chart_series_viewed" => get_string("fml_modules_access_chart_series_viewed", "local_notemyprogress"), - "sessions_evolution_chart_title" => get_string("fml_sessions_evolution_chart_title", "local_notemyprogress"), - "sessions_evolution_chart_xaxis1" => get_string("fml_sessions_evolution_chart_xaxis1", "local_notemyprogress"), - "sessions_evolution_chart_xaxis2" => get_string("fml_sessions_evolution_chart_xaxis2", "local_notemyprogress"), - "sessions_evolution_chart_legend1" => get_string("fml_sessions_evolution_chart_legend1", "local_notemyprogress"), - "sessions_evolution_chart_legend2" => get_string("fml_sessions_evolution_chart_legend2", "local_notemyprogress"), - "user_grades_chart_title" => get_string("fml_user_grades_chart_title", "local_notemyprogress"), - "user_grades_chart_yaxis" => get_string("fml_user_grades_chart_yaxis", "local_notemyprogress"), - "user_grades_chart_xaxis" => get_string("fml_user_grades_chart_xaxis", "local_notemyprogress"), - "user_grades_chart_legend" => get_string("fml_user_grades_chart_legend", "local_notemyprogress"), - "user_grades_chart_tooltip_no_graded" => get_string("fml_user_grades_chart_tooltip_no_graded", "local_notemyprogress"), - "user_grades_chart_view_activity" => get_string("fml_user_grades_chart_view_activity", "local_notemyprogress"), - "weeks_sessions_title" => get_string("fml_weeks_sessions_title", "local_notemyprogress"), + "student_grade_title" => get_string("nmp_dropout_student_grade_title", "local_notemyprogress"), + "modules_access_chart_title" => get_string("nmp_modules_access_chart_title", "local_notemyprogress"), + "modules_amount" => get_string("nmp_modules_amount", "local_notemyprogress"), + "modules_details" => get_string("nmp_modules_details", "local_notemyprogress"), + "modules_interaction" => get_string("nmp_modules_interaction", "local_notemyprogress"), + "modules_interactions" => get_string("nmp_modules_interactions", "local_notemyprogress"), + "modules_viewed" => get_string("nmp_modules_viewed", "local_notemyprogress"), + "modules_no_viewed" => get_string("nmp_modules_no_viewed", "local_notemyprogress"), + "modules_complete" => get_string("nmp_modules_complete", "local_notemyprogress"), + "close_button" => get_string("nmp_close_button", "local_notemyprogress"), + "modules_access_chart_title" => get_string("nmp_modules_access_chart_title", "local_notemyprogress"), + "modules_access_chart_series_total" => get_string("nmp_modules_access_chart_series_total", "local_notemyprogress"), + "modules_access_chart_series_complete" => get_string("nmp_modules_access_chart_series_complete", "local_notemyprogress"), + "modules_access_chart_series_viewed" => get_string("nmp_modules_access_chart_series_viewed", "local_notemyprogress"), + "sessions_evolution_chart_title" => get_string("nmp_sessions_evolution_chart_title", "local_notemyprogress"), + "sessions_evolution_chart_xaxis1" => get_string("nmp_sessions_evolution_chart_xaxis1", "local_notemyprogress"), + "sessions_evolution_chart_xaxis2" => get_string("nmp_sessions_evolution_chart_xaxis2", "local_notemyprogress"), + "sessions_evolution_chart_legend1" => get_string("nmp_sessions_evolution_chart_legend1", "local_notemyprogress"), + "sessions_evolution_chart_legend2" => get_string("nmp_sessions_evolution_chart_legend2", "local_notemyprogress"), + "user_grades_chart_title" => get_string("nmp_user_grades_chart_title", "local_notemyprogress"), + "user_grades_chart_yaxis" => get_string("nmp_user_grades_chart_yaxis", "local_notemyprogress"), + "user_grades_chart_xaxis" => get_string("nmp_user_grades_chart_xaxis", "local_notemyprogress"), + "user_grades_chart_legend" => get_string("nmp_user_grades_chart_legend", "local_notemyprogress"), + "user_grades_chart_tooltip_no_graded" => get_string("nmp_user_grades_chart_tooltip_no_graded", "local_notemyprogress"), + "user_grades_chart_view_activity" => get_string("nmp_user_grades_chart_view_activity", "local_notemyprogress"), + "weeks_sessions_title" => get_string("nmp_weeks_sessions_title", "local_notemyprogress"), ], 'modules_access_colors' => array('#FFD166', '#06D6A0', '#118AB2'), 'sessions_evolution_colors' => array('#118AB2', '#073B4C'), diff --git a/notemyprogress/student_gamification.php b/notemyprogress/student_gamification.php new file mode 100644 index 0000000000000000000000000000000000000000..cbdf5159391176d6d031400911396b7187b5b6d1 --- /dev/null +++ b/notemyprogress/student_gamification.php @@ -0,0 +1,109 @@ +<?php +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see <http://www.gnu.org/licenses/>. + +/** + * local notemyprogress + * + * @package local_notemyprogress + * @copyright 2020 Edisson Sigua <edissonf.sigua@gmail.com>, Bryan Aguilar <bryan.aguilar6174@gmail.com> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +require_once('locallib.php'); +global $DB, $COURSE, $USER, $PAGE, $OUTPUT; + +$courseid = required_param('courseid', PARAM_INT); +$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST); +$context = context_course::instance($course->id); + +$url = '/local/notemyprogress/student_gamification.php'; +local_notemyprogress_set_page($course, $url); + +require_capability('local/notemyprogress:usepluggin', $context); +require_capability('local/notemyprogress:student_gamification', $context); + +$configgamification = new \local_notemyprogress\configgamification($COURSE, $USER); +$es = new \local_notemyprogress\event_strategy($COURSE, $USER); + +$userid=$es->get_user_info()->uid; + +$selectRankable = "SELECT rankable from {notemyprogress_xp} where courseid=? AND userid=? "; +$rankable = $DB->get_record_sql($selectRankable, array("courseid="=>($courseid),"timecreated="=>$userid)); +if($rankable->rankable =='1'){ + $rankableSend = "true"; +} +$content = [ + 'strings' =>[ + 'title' => get_string('tg_section_title', 'local_notemyprogress'), + 'help_title' => get_string('tg_section_help_title', 'local_notemyprogress'), + 'help_description' => get_string('tg_section_help_description', 'local_notemyprogress'), + 'helplabel' => get_string("helplabel","local_notemyprogress"), + 'error_network' => get_string('nmp_api_error_network', 'local_notemyprogress'), + 'save_successful' => get_string('nmp_api_save_successful', 'local_notemyprogress'), + 'cancel_action' => get_string('nmp_api_cancel_action', 'local_notemyprogress'), + 'save_warning_title' => get_string('tg_save_warning_title', 'local_notemyprogress'), + 'save_warning_content' => get_string('tg_save_warning_content', 'local_notemyprogress'), + 'confirm_ok' => get_string('tg_confirm_ok', 'local_notemyprogress'), + 'confirm_cancel' => get_string('tg_confirm_cancel', 'local_notemyprogress'), + 'exitbutton' => get_string("exitbutton","local_notemyprogress"), + 'save' => get_string("tg_save","local_notemyprogress"), + 'experience' => get_string("tg_section_experience","local_notemyprogress"), + 'information' => get_string("tg_section_information","local_notemyprogress"), + 'ranking' => get_string("tg_section_ranking","local_notemyprogress"), + 'points' => get_string("tg_section_points","local_notemyprogress"), + 'no_description' => get_string("tg_section_no_description","local_notemyprogress"), + 'description' => get_string("tg_section_description","local_notemyprogress"), + 'to_next_level' => get_string("tg_section_preview_next_level","local_notemyprogress"), + 'ranking_text' => get_string("tg_section_ranking_ranking_text","local_notemyprogress"), + 'level' => get_string("tg_section_ranking_level","local_notemyprogress"), + 'student' => get_string("tg_section_ranking_student","local_notemyprogress"), + 'total' => get_string("tg_section_ranking_total","local_notemyprogress"), + 'progress' => get_string("tg_section_ranking_progress","local_notemyprogress"), + 'rankable'=> $rankableSend, + 'studentRanking1'=>get_string("studentRanking1","local_notemyprogress"), + 'studentRanking2'=>get_string("studentRanking2","local_notemyprogress"), + 'studentRanking3'=>get_string("studentRanking3","local_notemyprogress"), + 'overview'=>get_string("overview","local_notemyprogress"), + ], + 'levels_data' => $configgamification->get_levels_data(), + 'indicators' => $es->get_user_info(), + 'ranking' => $es->get_ranking(1), + +]; + +$templatecontext = [ + 'image' => $OUTPUT->image_url('badge', 'local_notemyprogress'), + 'rankImage' => $OUTPUT->image_url('rankImage', 'local_notemyprogress') +]; + +$maxTimeSql = "SELECT MAX(timecreated) as maximum from {notemyprogress_gamification} where courseid=? "; +$timecrated = $DB->get_record_sql($maxTimeSql, array("courseid="=>($courseid))); + +$sql = "SELECT enablegamification from {notemyprogress_gamification} where courseid=? AND timecreated=? "; +$value = $DB->get_record_sql($sql, array("courseid="=>($courseid),"timecreated="=>$timecrated->maximum)); + +$PAGE->requires->js_call_amd('local_notemyprogress/student_gamification','init', ['content' => $content]); +echo $OUTPUT->header(); +if ($value->enablegamification == 0){ + // echo " non available gamification value : "; + // echo $value->enablegamification; + // echo " timecrated :"; + // echo $timecrated->maximum; + echo get_string("gamification_denied","local_notemyprogress"); +}else{ + echo $OUTPUT->render_from_template('local_notemyprogress/student_gamification', $templatecontext); +} + +echo $OUTPUT->footer(); \ No newline at end of file diff --git a/notemyprogress/student_planning.php b/notemyprogress/student_planning.php deleted file mode 100644 index 3f9addeac3ed4e775eeec62f44cf192fb078bd65..0000000000000000000000000000000000000000 --- a/notemyprogress/student_planning.php +++ /dev/null @@ -1,198 +0,0 @@ -<?php - -// This file is part of Moodle - http://moodle.org/ -// -// Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Moodle is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Moodle. If not, see <http://www.gnu.org/licenses/>. - -/** - * local notemyprogress - * - * @package local_notemyprogress - * @copyright 2020 Edisson Sigua <edissonf.sigua@gmail.com>, Bryan Aguilar <bryan.aguilar6174@gmail.com> - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -require_once('locallib.php'); -global $COURSE, $USER; - -$courseid = required_param('courseid', PARAM_INT); -$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST); -$context = context_course::instance($course->id); - -$url = '/local/notemyprogress/student_sessions.php'; -local_notemyprogress_set_page($course, $url); - -require_capability('local/notemyprogress:usepluggin', $context); -require_capability('local/notemyprogress:view_as_student', $context); -require_capability('local/notemyprogress:student_sessions', $context); - -if (is_siteadmin()) { - print_error(get_string("only_student", "local_notemyprogress")); -} - -$actualLink = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; - -$logs = new \local_notemyprogress\logs($COURSE->id, $USER->id); -$logs->addLogsNMP("viewed", "section", "STUDENT_STUDY_SESSIONS", "student_study_sessions", $actualLink, "Section where you can consult various indicators on the study sessions carried out by the student"); - -$reports = new \local_notemyprogress\student($COURSE->id, $USER->id); - -$configweeks = new \local_notemyprogress\configweeks($COURSE, $USER); -if (!$configweeks->is_set()) { - $message = get_string("weeks_not_config", "local_notemyprogress"); - print_error($message); -} - -$content = [ - 'strings' => [ - "section_help_title" => get_string("ss_section_help_title", "local_notemyprogress"), - "section_help_description" => get_string("ss_section_help_description", "local_notemyprogress"), - "inverted_time_help_title" => get_string("ss_inverted_time_help_title", "local_notemyprogress"), - "inverted_time_help_description_p1" => get_string("ss_inverted_time_help_description_p1", "local_notemyprogress"), - "inverted_time_help_description_p2" => get_string("ss_inverted_time_help_description_p2", "local_notemyprogress"), - "hours_session_help_title" => get_string("ss_hours_session_help_title", "local_notemyprogress"), - "hours_session_help_description_p1" => get_string("ss_hours_session_help_description_p1", "local_notemyprogress"), - "hours_session_help_description_p2" => get_string("ss_hours_session_help_description_p2", "local_notemyprogress"), - "resources_access_help_title" => get_string("ss_resources_access_help_title", "local_notemyprogress"), - "resources_access_help_description_p1" => get_string("ss_resources_access_help_description_p1", "local_notemyprogress"), - "resources_access_help_description_p2" => get_string("ss_resources_access_help_description_p2", "local_notemyprogress"), - "resources_access_help_description_p3" => get_string("ss_resources_access_help_description_p3", "local_notemyprogress"), - - "title" => get_string("fml_title", "local_notemyprogress"), - "chart" => $reports->get_chart_langs(), - "days" => array( - get_string("fml_mon_short", "local_notemyprogress"), - get_string("fml_tue_short", "local_notemyprogress"), - get_string("fml_wed_short", "local_notemyprogress"), - get_string("fml_thu_short", "local_notemyprogress"), - get_string("fml_fri_short", "local_notemyprogress"), - get_string("fml_sat_short", "local_notemyprogress"), - get_string("fml_sun_short", "local_notemyprogress"), - ), - "hours" => array( - get_string("fml_00", "local_notemyprogress"), - get_string("fml_01", "local_notemyprogress"), - get_string("fml_02", "local_notemyprogress"), - get_string("fml_03", "local_notemyprogress"), - get_string("fml_04", "local_notemyprogress"), - get_string("fml_05", "local_notemyprogress"), - get_string("fml_06", "local_notemyprogress"), - get_string("fml_07", "local_notemyprogress"), - get_string("fml_08", "local_notemyprogress"), - get_string("fml_09", "local_notemyprogress"), - get_string("fml_10", "local_notemyprogress"), - get_string("fml_11", "local_notemyprogress"), - get_string("fml_12", "local_notemyprogress"), - get_string("fml_13", "local_notemyprogress"), - get_string("fml_14", "local_notemyprogress"), - get_string("fml_15", "local_notemyprogress"), - get_string("fml_16", "local_notemyprogress"), - get_string("fml_17", "local_notemyprogress"), - get_string("fml_18", "local_notemyprogress"), - get_string("fml_19", "local_notemyprogress"), - get_string("fml_20", "local_notemyprogress"), - get_string("fml_21", "local_notemyprogress"), - get_string("fml_22", "local_notemyprogress"), - get_string("fml_23", "local_notemyprogress"), - ), - "modules_names" => array( - "assign" => get_string("fml_assign", "local_notemyprogress"), - "assignment" => get_string("fml_assignment", "local_notemyprogress"), - "attendance" => get_string("fml_attendance", "local_notemyprogress"), - "book" => get_string("fml_book", "local_notemyprogress"), - "chat" => get_string("fml_chat", "local_notemyprogress"), - "choice" => get_string("fml_choice", "local_notemyprogress"), - "data" => get_string("fml_data", "local_notemyprogress"), - "feedback" => get_string("fml_feedback", "local_notemyprogress"), - "folder" => get_string("fml_folder", "local_notemyprogress"), - "forum" => get_string("fml_forum", "local_notemyprogress"), - "glossary" => get_string("fml_glossary", "local_notemyprogress"), - "h5pactivity" => get_string("fml_h5pactivity", "local_notemyprogress"), - "imscp" => get_string("fml_imscp", "local_notemyprogress"), - "label" => get_string("fml_label", "local_notemyprogress"), - "lesson" => get_string("fml_lesson", "local_notemyprogress"), - "lti" => get_string("fml_lti", "local_notemyprogress"), - "page" => get_string("fml_page", "local_notemyprogress"), - "quiz" => get_string("fml_quiz", "local_notemyprogress"), - "resource" => get_string("fml_resource", "local_notemyprogress"), - "scorm" => get_string("fml_scorm", "local_notemyprogress"), - "survey" => get_string("fml_survey", "local_notemyprogress"), - "url" => get_string("fml_url", "local_notemyprogress"), - "wiki" => get_string("fml_wiki", "local_notemyprogress"), - "workshop" => get_string("fml_workshop", "local_notemyprogress"), - ), - "modules_strings" => array( - "title" => get_string("fml_modules_access_chart_title", "local_notemyprogress"), - "modules_no_viewed" => get_string("fml_modules_no_viewed", "local_notemyprogress"), - "modules_viewed" => get_string("fml_modules_viewed", "local_notemyprogress"), - "modules_complete" => get_string("fml_modules_complete", "local_notemyprogress"), - "close_button" => get_string("fml_close_button", "local_notemyprogress"), - "modules_interaction" => get_string("fml_modules_interaction", "local_notemyprogress"), - "modules_interactions" => get_string("fml_modules_interactions", "local_notemyprogress"), - ), - "no_data" => get_string("no_data", "local_notemyprogress"), - "pagination" => get_string("pagination", "local_notemyprogress"), - "ss_change_timezone" => get_string("ss_change_timezone", "local_notemyprogress"), - "graph_generating" => get_string("graph_generating", "local_notemyprogress"), - "api_error_network" => get_string("api_error_network", "local_notemyprogress"), - "pagination_name" => get_string("pagination_component_name", "local_notemyprogress"), - "pagination_separator" => get_string("pagination_component_to", "local_notemyprogress"), - "pagination_title" => get_string("pagination_title", "local_notemyprogress"), - "helplabel" => get_string("helplabel", "local_notemyprogress"), - "exitbutton" => get_string("exitbutton", "local_notemyprogress"), - "about" => get_string("fml_about", "local_notemyprogress"), - - "inverted_time_chart_title" => get_string("fml_student_time_inverted_title", "local_notemyprogress"), - "inverted_time_chart_x_axis" => get_string("fml_student_time_inverted_x_axis", "local_notemyprogress"), - "inverted_time" => get_string("fml_student_inverted_time", "local_notemyprogress"), - "expected_time" => get_string("fml_student_expected_time", "local_notemyprogress"), - - "resource_access_title" => get_string("fml_resource_access_title", "local_notemyprogress"), - "resource_access_x_axis" => get_string("fml_resource_access_x_axis", "local_notemyprogress"), - "resource_access_y_axis" => get_string("fml_resource_access_y_axis", "local_notemyprogress"), - "resource_access_legend1" => get_string("fml_resource_access_legend1", "local_notemyprogress"), - "resource_access_legend2" => get_string("fml_resource_access_legend2", "local_notemyprogress"), - - "hours_sessions_title" => get_string("fml_hours_sessions_title", "local_notemyprogress"), - "week_progress_title" => get_string("fml_week_progress_title", "local_notemyprogress"), - - "session_text" => get_string("fml_session_text", "local_notemyprogress"), - "sessions_text" => get_string("fml_sessions_text", "local_notemyprogress"), - "modules_details" => get_string("fml_modules_details", "local_notemyprogress"), - - "hours_short" => get_string("fml_hours_short", "local_notemyprogress"), - "minutes_short" => get_string("fml_minutes_short", "local_notemyprogress"), - "seconds_short" => get_string("fml_seconds_short", "local_notemyprogress"), - - "modules_access_chart_title" => get_string("fml_modules_access_chart_title", "local_notemyprogress"), - "modules_viewed" => get_string("fml_modules_viewed", "local_notemyprogress"), - "modules_no_viewed" => get_string("fml_modules_no_viewed", "local_notemyprogress"), - "modules_complete" => get_string("fml_modules_complete", "local_notemyprogress"), - "modules_interaction" => get_string("fml_modules_interaction", "local_notemyprogress"), - "modules_interactions" => get_string("fml_modules_interactions", "local_notemyprogress"), - "close_button" => get_string("fml_close_button", "local_notemyprogress"), - ], - 'resources_access_colors' => array('#06D6A0', '#FFD166', '#EF476F'), - 'inverted_time_colors' => array('#118AB2', '#06D6A0'), - 'courseid' => $COURSE->id, - 'userid' => $USER->id, - 'indicators' => $reports->get_sessions(), - 'pages' => $configweeks->get_weeks_paginator(), - 'profile_render' => $reports->render_has(), - 'timezone' => $reports->timezone, -]; - -$PAGE->requires->js_call_amd('local_notemyprogress/student_planning', 'init', ['content' => $content]); -echo $OUTPUT->header(); -echo $OUTPUT->render_from_template('local_notemyprogress/student_planning', ['content' => $content]); -echo $OUTPUT->footer(); diff --git a/notemyprogress/student_sessions.php b/notemyprogress/student_sessions.php index 454a1028f8a9b3c09b9070d500ce152e8eac2779..7d0fe28389f9ff8e3e91aad443a206fd2e29ac3c 100644 --- a/notemyprogress/student_sessions.php +++ b/notemyprogress/student_sessions.php @@ -68,77 +68,77 @@ $content = [ "resources_access_help_description_p2" => get_string("ss_resources_access_help_description_p2", "local_notemyprogress"), "resources_access_help_description_p3" => get_string("ss_resources_access_help_description_p3", "local_notemyprogress"), - "title" => get_string("fml_title", "local_notemyprogress"), + "title" => get_string("nmp_title", "local_notemyprogress"), "chart" => $reports->get_chart_langs(), "days" => array( - get_string("fml_mon_short", "local_notemyprogress"), - get_string("fml_tue_short", "local_notemyprogress"), - get_string("fml_wed_short", "local_notemyprogress"), - get_string("fml_thu_short", "local_notemyprogress"), - get_string("fml_fri_short", "local_notemyprogress"), - get_string("fml_sat_short", "local_notemyprogress"), - get_string("fml_sun_short", "local_notemyprogress"), + get_string("nmp_mon_short", "local_notemyprogress"), + get_string("nmp_tue_short", "local_notemyprogress"), + get_string("nmp_wed_short", "local_notemyprogress"), + get_string("nmp_thu_short", "local_notemyprogress"), + get_string("nmp_fri_short", "local_notemyprogress"), + get_string("nmp_sat_short", "local_notemyprogress"), + get_string("nmp_sun_short", "local_notemyprogress"), ), "hours" => array( - get_string("fml_00", "local_notemyprogress"), - get_string("fml_01", "local_notemyprogress"), - get_string("fml_02", "local_notemyprogress"), - get_string("fml_03", "local_notemyprogress"), - get_string("fml_04", "local_notemyprogress"), - get_string("fml_05", "local_notemyprogress"), - get_string("fml_06", "local_notemyprogress"), - get_string("fml_07", "local_notemyprogress"), - get_string("fml_08", "local_notemyprogress"), - get_string("fml_09", "local_notemyprogress"), - get_string("fml_10", "local_notemyprogress"), - get_string("fml_11", "local_notemyprogress"), - get_string("fml_12", "local_notemyprogress"), - get_string("fml_13", "local_notemyprogress"), - get_string("fml_14", "local_notemyprogress"), - get_string("fml_15", "local_notemyprogress"), - get_string("fml_16", "local_notemyprogress"), - get_string("fml_17", "local_notemyprogress"), - get_string("fml_18", "local_notemyprogress"), - get_string("fml_19", "local_notemyprogress"), - get_string("fml_20", "local_notemyprogress"), - get_string("fml_21", "local_notemyprogress"), - get_string("fml_22", "local_notemyprogress"), - get_string("fml_23", "local_notemyprogress"), + get_string("nmp_00", "local_notemyprogress"), + get_string("nmp_01", "local_notemyprogress"), + get_string("nmp_02", "local_notemyprogress"), + get_string("nmp_03", "local_notemyprogress"), + get_string("nmp_04", "local_notemyprogress"), + get_string("nmp_05", "local_notemyprogress"), + get_string("nmp_06", "local_notemyprogress"), + get_string("nmp_07", "local_notemyprogress"), + get_string("nmp_08", "local_notemyprogress"), + get_string("nmp_09", "local_notemyprogress"), + get_string("nmp_10", "local_notemyprogress"), + get_string("nmp_11", "local_notemyprogress"), + get_string("nmp_12", "local_notemyprogress"), + get_string("nmp_13", "local_notemyprogress"), + get_string("nmp_14", "local_notemyprogress"), + get_string("nmp_15", "local_notemyprogress"), + get_string("nmp_16", "local_notemyprogress"), + get_string("nmp_17", "local_notemyprogress"), + get_string("nmp_18", "local_notemyprogress"), + get_string("nmp_19", "local_notemyprogress"), + get_string("nmp_20", "local_notemyprogress"), + get_string("nmp_21", "local_notemyprogress"), + get_string("nmp_22", "local_notemyprogress"), + get_string("nmp_23", "local_notemyprogress"), ), "modules_names" => array( - "assign" => get_string("fml_assign", "local_notemyprogress"), - "assignment" => get_string("fml_assignment", "local_notemyprogress"), - "attendance" => get_string("fml_attendance", "local_notemyprogress"), - "book" => get_string("fml_book", "local_notemyprogress"), - "chat" => get_string("fml_chat", "local_notemyprogress"), - "choice" => get_string("fml_choice", "local_notemyprogress"), - "data" => get_string("fml_data", "local_notemyprogress"), - "feedback" => get_string("fml_feedback", "local_notemyprogress"), - "folder" => get_string("fml_folder", "local_notemyprogress"), - "forum" => get_string("fml_forum", "local_notemyprogress"), - "glossary" => get_string("fml_glossary", "local_notemyprogress"), - "h5pactivity" => get_string("fml_h5pactivity", "local_notemyprogress"), - "imscp" => get_string("fml_imscp", "local_notemyprogress"), - "label" => get_string("fml_label", "local_notemyprogress"), - "lesson" => get_string("fml_lesson", "local_notemyprogress"), - "lti" => get_string("fml_lti", "local_notemyprogress"), - "page" => get_string("fml_page", "local_notemyprogress"), - "quiz" => get_string("fml_quiz", "local_notemyprogress"), - "resource" => get_string("fml_resource", "local_notemyprogress"), - "scorm" => get_string("fml_scorm", "local_notemyprogress"), - "survey" => get_string("fml_survey", "local_notemyprogress"), - "url" => get_string("fml_url", "local_notemyprogress"), - "wiki" => get_string("fml_wiki", "local_notemyprogress"), - "workshop" => get_string("fml_workshop", "local_notemyprogress"), + "assign" => get_string("nmp_assign", "local_notemyprogress"), + "assignment" => get_string("nmp_assignment", "local_notemyprogress"), + "attendance" => get_string("nmp_attendance", "local_notemyprogress"), + "book" => get_string("nmp_book", "local_notemyprogress"), + "chat" => get_string("nmp_chat", "local_notemyprogress"), + "choice" => get_string("nmp_choice", "local_notemyprogress"), + "data" => get_string("nmp_data", "local_notemyprogress"), + "feedback" => get_string("nmp_feedback", "local_notemyprogress"), + "folder" => get_string("nmp_folder", "local_notemyprogress"), + "forum" => get_string("nmp_forum", "local_notemyprogress"), + "glossary" => get_string("nmp_glossary", "local_notemyprogress"), + "h5pactivity" => get_string("nmp_h5pactivity", "local_notemyprogress"), + "imscp" => get_string("nmp_imscp", "local_notemyprogress"), + "label" => get_string("nmp_label", "local_notemyprogress"), + "lesson" => get_string("nmp_lesson", "local_notemyprogress"), + "lti" => get_string("nmp_lti", "local_notemyprogress"), + "page" => get_string("nmp_page", "local_notemyprogress"), + "quiz" => get_string("nmp_quiz", "local_notemyprogress"), + "resource" => get_string("nmp_resource", "local_notemyprogress"), + "scorm" => get_string("nmp_scorm", "local_notemyprogress"), + "survey" => get_string("nmp_survey", "local_notemyprogress"), + "url" => get_string("nmp_url", "local_notemyprogress"), + "wiki" => get_string("nmp_wiki", "local_notemyprogress"), + "workshop" => get_string("nmp_workshop", "local_notemyprogress"), ), "modules_strings" => array( - "title" => get_string("fml_modules_access_chart_title","local_notemyprogress"), - "modules_no_viewed" => get_string("fml_modules_no_viewed","local_notemyprogress"), - "modules_viewed" => get_string("fml_modules_viewed","local_notemyprogress"), - "modules_complete" => get_string("fml_modules_complete","local_notemyprogress"), - "close_button" => get_string("fml_close_button","local_notemyprogress"), - "modules_interaction" => get_string("fml_modules_interaction","local_notemyprogress"), - "modules_interactions" => get_string("fml_modules_interactions","local_notemyprogress"), + "title" => get_string("nmp_modules_access_chart_title","local_notemyprogress"), + "modules_no_viewed" => get_string("nmp_modules_no_viewed","local_notemyprogress"), + "modules_viewed" => get_string("nmp_modules_viewed","local_notemyprogress"), + "modules_complete" => get_string("nmp_modules_complete","local_notemyprogress"), + "close_button" => get_string("nmp_close_button","local_notemyprogress"), + "modules_interaction" => get_string("nmp_modules_interaction","local_notemyprogress"), + "modules_interactions" => get_string("nmp_modules_interactions","local_notemyprogress"), ), "no_data" => get_string("no_data", "local_notemyprogress"), "pagination" => get_string("pagination", "local_notemyprogress"), @@ -150,37 +150,37 @@ $content = [ "pagination_title" => get_string("pagination_title","local_notemyprogress"), "helplabel" => get_string("helplabel","local_notemyprogress"), "exitbutton" => get_string("exitbutton","local_notemyprogress"), - "about" => get_string("fml_about", "local_notemyprogress"), - - "inverted_time_chart_title" => get_string("fml_student_time_inverted_title","local_notemyprogress"), - "inverted_time_chart_x_axis" => get_string("fml_student_time_inverted_x_axis","local_notemyprogress"), - "inverted_time" => get_string("fml_student_inverted_time","local_notemyprogress"), - "expected_time" => get_string("fml_student_expected_time","local_notemyprogress"), - - "resource_access_title" => get_string("fml_resource_access_title", "local_notemyprogress"), - "resource_access_x_axis" => get_string("fml_resource_access_x_axis", "local_notemyprogress"), - "resource_access_y_axis" => get_string("fml_resource_access_y_axis", "local_notemyprogress"), - "resource_access_legend1" => get_string("fml_resource_access_legend1", "local_notemyprogress"), - "resource_access_legend2" => get_string("fml_resource_access_legend2", "local_notemyprogress"), - - "hours_sessions_title" => get_string("fml_hours_sessions_title", "local_notemyprogress"), - "week_progress_title" => get_string("fml_week_progress_title", "local_notemyprogress"), - - "session_text" => get_string("fml_session_text","local_notemyprogress"), - "sessions_text" => get_string("fml_sessions_text","local_notemyprogress"), - "modules_details" => get_string("fml_modules_details", "local_notemyprogress"), - - "hours_short" => get_string("fml_hours_short", "local_notemyprogress"), - "minutes_short" => get_string("fml_minutes_short", "local_notemyprogress"), - "seconds_short" => get_string("fml_seconds_short", "local_notemyprogress"), - - "modules_access_chart_title" => get_string("fml_modules_access_chart_title", "local_notemyprogress"), - "modules_viewed" => get_string("fml_modules_viewed", "local_notemyprogress"), - "modules_no_viewed" => get_string("fml_modules_no_viewed", "local_notemyprogress"), - "modules_complete" => get_string("fml_modules_complete", "local_notemyprogress"), - "modules_interaction" => get_string("fml_modules_interaction", "local_notemyprogress"), - "modules_interactions" => get_string("fml_modules_interactions", "local_notemyprogress"), - "close_button" => get_string("fml_close_button", "local_notemyprogress"), + "about" => get_string("nmp_about", "local_notemyprogress"), + + "inverted_time_chart_title" => get_string("nmp_student_time_inverted_title","local_notemyprogress"), + "inverted_time_chart_x_axis" => get_string("nmp_student_time_inverted_x_axis","local_notemyprogress"), + "inverted_time" => get_string("nmp_student_inverted_time","local_notemyprogress"), + "expected_time" => get_string("nmp_student_expected_time","local_notemyprogress"), + + "resource_access_title" => get_string("nmp_resource_access_title", "local_notemyprogress"), + "resource_access_x_axis" => get_string("nmp_resource_access_x_axis", "local_notemyprogress"), + "resource_access_y_axis" => get_string("nmp_resource_access_y_axis", "local_notemyprogress"), + "resource_access_legend1" => get_string("nmp_resource_access_legend1", "local_notemyprogress"), + "resource_access_legend2" => get_string("nmp_resource_access_legend2", "local_notemyprogress"), + + "hours_sessions_title" => get_string("nmp_hours_sessions_title", "local_notemyprogress"), + "week_progress_title" => get_string("nmp_week_progress_title", "local_notemyprogress"), + + "session_text" => get_string("nmp_session_text","local_notemyprogress"), + "sessions_text" => get_string("nmp_sessions_text","local_notemyprogress"), + "modules_details" => get_string("nmp_modules_details", "local_notemyprogress"), + + "hours_short" => get_string("nmp_hours_short", "local_notemyprogress"), + "minutes_short" => get_string("nmp_minutes_short", "local_notemyprogress"), + "seconds_short" => get_string("nmp_seconds_short", "local_notemyprogress"), + + "modules_access_chart_title" => get_string("nmp_modules_access_chart_title", "local_notemyprogress"), + "modules_viewed" => get_string("nmp_modules_viewed", "local_notemyprogress"), + "modules_no_viewed" => get_string("nmp_modules_no_viewed", "local_notemyprogress"), + "modules_complete" => get_string("nmp_modules_complete", "local_notemyprogress"), + "modules_interaction" => get_string("nmp_modules_interaction", "local_notemyprogress"), + "modules_interactions" => get_string("nmp_modules_interactions", "local_notemyprogress"), + "close_button" => get_string("nmp_close_button", "local_notemyprogress"), ], 'resources_access_colors' => array('#06D6A0', '#FFD166', '#EF476F'), 'inverted_time_colors' => array('#118AB2', '#06D6A0'), diff --git a/notemyprogress/styles.css b/notemyprogress/styles.css index dff445470043bf21a1010973403e0d7db4baace6..f0f7e48a1d6fa6e5d645568c407d1c0005c518f8 100644 --- a/notemyprogress/styles.css +++ b/notemyprogress/styles.css @@ -9,7 +9,7 @@ font-family: poppins, sans-serif !important; } -#fmllogs{ +#nmplogs{ display: none; } @@ -302,11 +302,11 @@ a.notemyprogress-navbar-menu-item .badge { padding: .7rem; } -.fml-btn-primary:hover, .fml-btn-secondary:hover, .ajs-button:hover{ +.nmp-btn-primary:hover, .nmp-btn-secondary:hover, .ajs-button:hover{ opacity: .75; } -.fml-btn-primary, .ajs-button{ +.nmp-btn-primary, .ajs-button{ font-size: .8rem !important; height: 35px !important; align-items: center !important; @@ -531,32 +531,32 @@ a.notemyprogress-navbar-menu-item .badge { } /* Header */ -#fml-group-selector{ +#nmp-group-selector{ flex-grow: 0; } -#fml-group-selector * { +#nmp-group-selector * { margin-top: 0 !important; margin-bottom: 0 !important; } -#fml-group-selector , #fml-group-selector i, #fml-group-selector .v-select__selections{ +#nmp-group-selector , #nmp-group-selector i, #nmp-group-selector .v-select__selections{ color: white !important; border-color: white !important; } -#fml-group-selector .v-select__selections{ +#nmp-group-selector .v-select__selections{ font-size: .8rem; font-weight: 400; min-width: 100%; justify-content: center; } -#fml-group-selector .theme--light.v-text-field>.v-input__control>.v-input__slot:before{ +#nmp-group-selector .theme--light.v-text-field>.v-input__control>.v-input__slot:before{ border-color: transparent !important; } -#fml-group-selector input, #fml-group-selector .v-messages{ +#nmp-group-selector input, #nmp-group-selector .v-messages{ display: none !important; } @@ -578,7 +578,7 @@ a.notemyprogress-navbar-menu-item .badge { background: #f5f5f5 !important; } -.help-dialog-footer .fml-btn-secondary{ +.help-dialog-footer .nmp-btn-secondary{ background: white !important; } diff --git a/notemyprogress/teacher.php b/notemyprogress/teacher.php index edaceb5b276039aff00f3725288fce6adcf7a4d5..546f1781915b0ecffd686db88c8ee08d690e7d85 100644 --- a/notemyprogress/teacher.php +++ b/notemyprogress/teacher.php @@ -63,14 +63,14 @@ $content = [ "progress_table_help_title" => get_string("tg_progress_table_help_title", "local_notemyprogress"), "progress_table_help_description" => get_string("tg_progress_table_help_description", "local_notemyprogress"), - "title" => get_string("fml_teacher_indicators_title", "local_notemyprogress"), + "title" => get_string("nmp_teacher_indicators_title", "local_notemyprogress"), "chart" => $reports->get_chart_langs(), "helplabel" => get_string("helplabel","local_notemyprogress"), "exitbutton" => get_string("exitbutton","local_notemyprogress"), "ss_change_timezone" => get_string("ss_change_timezone", "local_notemyprogress"), "graph_generating" => get_string("graph_generating", "local_notemyprogress"), - "about" => get_string("fml_about", "local_notemyprogress"), - "about_table" => get_string("fml_about_table", "local_notemyprogress"), + "about" => get_string("nmp_about", "local_notemyprogress"), + "about_table" => get_string("nmp_about_table", "local_notemyprogress"), "table_title" => get_string("table_title", "local_notemyprogress"), "thead_name" => get_string("thead_name", "local_notemyprogress"), @@ -79,33 +79,33 @@ $content = [ "thead_progress" => get_string("thead_progress", "local_notemyprogress"), "thead_sessions" => get_string("thead_sessions", "local_notemyprogress"), "thead_time" => get_string("thead_time", "local_notemyprogress"), - "of_conector" => get_string("fml_of_conector", "local_notemyprogress"), - - "teacher_indicators_students" => get_string("fml_teacher_indicators_students", "local_notemyprogress"), - "teacher_indicators_weeks" => get_string("fml_teacher_indicators_weeks", "local_notemyprogress"), - "teacher_indicators_modules" => get_string("fml_modules_label", "local_notemyprogress"), - "teacher_indicators_grademax" => get_string("fml_teacher_indicators_grademax", "local_notemyprogress"), - "teacher_indicators_course_start" => get_string("fml_teacher_indicators_course_start", "local_notemyprogress"), - "teacher_indicators_course_end" => get_string("fml_teacher_indicators_course_end", "local_notemyprogress"), - "teacher_indicators_course_format" => get_string("fml_teacher_indicators_course_format", "local_notemyprogress"), - "teacher_indicators_course_completion" => get_string("fml_teacher_indicators_course_completion", "local_notemyprogress"), - "teacher_indicators_finalized" => get_string("fml_finished_label", "local_notemyprogress"), - "teacher_indicators_finished" => get_string("fml_finisheds_label", "local_notemyprogress"), - "teacher_indicators_session" => get_string("fml_session_text","local_notemyprogress"), - "teacher_indicators_sessions" => get_string("fml_sessions_text","local_notemyprogress"), - "teacher_indicators_student_progress" => get_string("fml_teacher_indicators_student_progress", "local_notemyprogress"), - - "teacher_indicators_week_resources_chart_title" => get_string("fml_teacher_indicators_week_resources_chart_title", "local_notemyprogress"), - "teacher_indicators_week_resources_yaxis_title" => get_string("fml_teacher_indicators_week_resources_yaxis_title", "local_notemyprogress"), - - "weeks_sessions_title" => get_string("fml_weeks_sessions_title", "local_notemyprogress"), + "of_conector" => get_string("nmp_of_conector", "local_notemyprogress"), + + "teacher_indicators_students" => get_string("nmp_teacher_indicators_students", "local_notemyprogress"), + "teacher_indicators_weeks" => get_string("nmp_teacher_indicators_weeks", "local_notemyprogress"), + "teacher_indicators_modules" => get_string("nmp_modules_label", "local_notemyprogress"), + "teacher_indicators_grademax" => get_string("nmp_teacher_indicators_grademax", "local_notemyprogress"), + "teacher_indicators_course_start" => get_string("nmp_teacher_indicators_course_start", "local_notemyprogress"), + "teacher_indicators_course_end" => get_string("nmp_teacher_indicators_course_end", "local_notemyprogress"), + "teacher_indicators_course_format" => get_string("nmp_teacher_indicators_course_format", "local_notemyprogress"), + "teacher_indicators_course_completion" => get_string("nmp_teacher_indicators_course_completion", "local_notemyprogress"), + "teacher_indicators_finalized" => get_string("nmp_finished_label", "local_notemyprogress"), + "teacher_indicators_finished" => get_string("nmp_finisheds_label", "local_notemyprogress"), + "teacher_indicators_session" => get_string("nmp_session_text","local_notemyprogress"), + "teacher_indicators_sessions" => get_string("nmp_sessions_text","local_notemyprogress"), + "teacher_indicators_student_progress" => get_string("nmp_teacher_indicators_student_progress", "local_notemyprogress"), + + "teacher_indicators_week_resources_chart_title" => get_string("nmp_teacher_indicators_week_resources_chart_title", "local_notemyprogress"), + "teacher_indicators_week_resources_yaxis_title" => get_string("nmp_teacher_indicators_week_resources_yaxis_title", "local_notemyprogress"), + + "weeks_sessions_title" => get_string("nmp_weeks_sessions_title", "local_notemyprogress"), "weeks" => array( - get_string("fml_week1", "local_notemyprogress"), - get_string("fml_week2", "local_notemyprogress"), - get_string("fml_week3", "local_notemyprogress"), - get_string("fml_week4", "local_notemyprogress"), - get_string("fml_week5", "local_notemyprogress"), - get_string("fml_week6", "local_notemyprogress"), + get_string("nmp_week1", "local_notemyprogress"), + get_string("nmp_week2", "local_notemyprogress"), + get_string("nmp_week3", "local_notemyprogress"), + get_string("nmp_week4", "local_notemyprogress"), + get_string("nmp_week5", "local_notemyprogress"), + get_string("nmp_week6", "local_notemyprogress"), ), ], 'week_resources_colors' => array('#118AB2'), diff --git a/notemyprogress/templates/gamification.mustache b/notemyprogress/templates/gamification.mustache new file mode 100644 index 0000000000000000000000000000000000000000..da85c84fce866f04f705a2d0b10c88f44435ba57 --- /dev/null +++ b/notemyprogress/templates/gamification.mustache @@ -0,0 +1,258 @@ +<v-app id="gamification" class="notemyprogress"> + <v-main> + <pageheader :pagetitle="strings.title" + :helptitle="strings.helplabel" + :exitbutton="strings.exitbutton" + :helpcontents="get_help_content()" + :token="token" + @open_help_section_modal="openHelpSectionModalEvent"> + </pageheader> + <template> + <v-container pa-8> + <!-- Server message --> + <v-row class="justify-center" v-if="notifications.length > 0"> + <v-col cols="8"> + <v-alert v-for="(value, index, key) in notifications" + :type="value.type" + class="text-center" dense text dismissible> + <span v-text="value.message"></span> + </v-alert> + </v-col> + </v-row> + <v-card + class="align-center text-center flex" + height="100" + elevation ="1"> + <h4 v-text="strings.enable"><h4> + <v-switch + v-model ="swDisableEnable" + inset + color="red darken-3" + class="pt-800 px-800 justify-center" + @Change = disableEnable(swDisableEnable); + ></v-switch> + </v-card> + <v-row> + <v-col> + <v-tabs v-model="tab" background-color="transparent"> + <v-tab v-text="strings.settings_level"></v-tab> + <v-tab v-text="strings.preview"></v-tab> + <v-tab v-text="strings.settings"></v-tab> + </v-tabs> + <v-tabs-items v-model="tab"> + <v-tab-item> <!-- Level and settings --> + <v-row class="pt-8 px-8 justify-center"> + <v-row> + <v-col cols="6" sm="4" md="3" lg="5"> + <v-text-field + type="number" + readonly + :label="strings.quantity" + v-model="levelsData.length" + append-outer-icon="mdi-plus-circle" + prepend-icon="mdi-minus-circle" + @click:append-outer="addLevel()" + @click:prepend="removeLevel()" + ></v-text-field> + </v-col> + <v-col cols="6" sm="4" md="3" lg="2"> + <v-text-field :label="strings.base_points" v-model="pointsBase" type="number"> + </v-text-field> + </v-col> + <v-col cols="12" sm="4" md="4" lg="3"> + <v-btn-toggle v-model="setPointsOption" tile group> + <v-btn value="calculated" v-text="strings.calculated"></v-btn> + <v-btn value="manually" v-text="strings.manually"></v-btn> + </v-btn-toggle> + </v-col> + </v-row> + </v-row> + <v-row class="pb-5 px-8"> + <v-row v-for="(level, index) in levelsData" cols="12" sm="6" md="4" lg="3"> + <v-card class="pt-5 align-center text-center"> + <v-col :content="level.lvl" bottom offset-x="20" offset-y="20"> + <v-avatar size="100"> + <v-img src="{{{image}}}"></v-img> + </v-avatar> + </v-col> + <v-card-text class="text--primary text-center"> + <v-text-field :label="strings.name" :rules="[v => !!v || strings.nameError]" required v-model="level.nam" type="text"> + </v-text-field> + <v-text-field :label="strings.description" v-model="level.des" type="text"> + </v-text-field> + <v-text-field :disabled="setPointsOption === 'calculated'" :label="strings.levels_required" v-model="calculatePoints(index)" type="number"> + </v-text-field> + </v-card-text> + </v-card> + </v-row> + </v-row> + <v-row class="pb-10 justify-center"> + <v-btn @click="save_changes('levelsEdit')" v-text="strings.save" class="white--text" color="#118AB2"></v-btn> + </v-row> + </v-tab-item> + <v-tab-item> <!-- Student preview tab --> + <v-row class="justify-center"> + <v-col cols="12" sm="11" md="7" lg="6" class="d-flex py-10"> + <v-card class="align-center text-center flex"> + <h4 class="py-5" v-text="settings.tit"></h4> + <p v-if="levelsData[0].nam" v-text="levelsData[0].nam"></p> + <v-badge + :content="levelsData[0].lvl" + bottom + offset-x="20" + offset-y="20" + > + <v-avatar size="100"> + <v-img src="{{{image}}}"></v-img> + </v-avatar> + </v-badge> + <v-card-text class="py-5"> + <small class="d-inline" v-text="levelsData[1].points"></small> + <sup>xp</sup> + <small v-text="strings.to_next_level"></small> + <v-progress-linear + color="#118AB2" + :value="0" + height="8" + > + </v-progress-linear> + <p v-if="levelsData[0].des" class="pt-5" v-text="levelsData[0].des"></p> + <h3 :class="[ !levelsData[0].des ? 'pt-5' : 'pt-0']" + v-text="levelsData[0].points +' '+strings.points"></h3> + </v-card-text> + <v-card-actions> + <p class="py-0 px-2" v-text="settings.des"></p> + </v-card-actions> + </v-card> + </v-col> + </v-row> <!-- Change the preview --> + <v-row class="pt-5 px-8 justify-center"> + <v-col cols="12" md="12"> + <h4 v-text="strings.appearance"></h4> + </v-col> + <v-col cols="12" md="12" class=""> + <v-row class="justify-center"> + <v-col cols="12" xs="10" md="6"> + <v-text-field :label="strings.appearance_title" v-model="settings.tit"></v-text-field> + </v-col> + </v-row> + <v-row class="justify-center"> + <v-col cols="12" xs="10" md="6"> + <v-textarea :label="strings.description" auto-grow v-model="settings.des"></v-textarea> + </v-col> + </v-row> + </v-col> + </v-row> + <v-row class="pb-10 justify-center"> + <v-btn @click="save_changes('studentSideEdit')" v-text="strings.save" class="white--text" color="#118AB2"></v-btn> + </v-row> + </v-tab-item> + <v-tab-item> + <v-row class="pt-5 px-8 justify-center justify-sm-space-between "> + <v-col cols="12" sm="6" md="5" lg="5"> + <h4 v-text="strings.rules"></h4> + </v-col> + <v-col cols="6" sm="5" md="4" lg="4"> + <v-btn + block v-text="strings.add_rule" + @click="addRule()" + class="white--text" + color="#118AB2"> + </v-btn> + </v-col> + </v-row> + <v-row class="pt-5 pb-5 px-8"> + <v-col v-for="(rule, index) in rulesData" cols="12" md="12"> + <v-card class="align-center text-center"> + <v-card-text class="text--primary text-center"> + <v-row class="align-center justify-space-around"> + <v-col cols="12" sm="4" md="3"> + <v-text-field + v-model="rule.points" + :label="strings.earn" + :rules="[v => !!v || strings.pointError]" + :suffix="strings.points" + type="number"> + </v-text-field> + </v-col> + <v-col cols="12" sm="6" md="7"> + <v-select + v-model="rule.rule" + attach + :menu-props="{ top: true, offsetY: true }" + :items="events" + item-text='name' + item-value='event' + :label="strings.select_event" + :rules="[v => !!v || strings.eventError]" + required> + </v-select> + </v-col> + <v-col cols="12" sm="2" md="1"> + <v-btn :disabled="rulesData.length < 3" icon @click="removeRule(index)"> + <v-icon>mdi-delete</v-icon> + </v-btn> + </v-col> + </v-row> + </v-card-text> + </v-card> + </v-col> + + </v-row> + <v-row class="pb-10 justify-center"> + <v-btn @click="save_changes('rulesEdit')" v-text="strings.save" class="white--text" color="#118AB2"></v-btn> + </v-row> + </v-tab-item> + </v-tabs-items> + </v-col> + + <v-col> + <v-row class="py-5 px-8"> + <v-col cols="12" md="12"> + <v-data-table + :headers="table_headers()" + :items="ranking" + item-key="id" + :items-per-page="7" + > + <template v-slot:item.level="{ item }"> + <v-badge + inline + bordered + :content="item.level" + > + <v-avatar size="30"> + <img src="{{{image}}}"> + </v-avatar> + </v-badge> + </template> + <template v-slot:item.progress_percentage="{ item }"> + <v-progress-linear + color="#118AB2" + :value="item.progress_percentage" + height="8" + > + </v-progress-linear> + </template> + <template v-slot:item.total="{ item }"> + <p class="d-inline" v-text="item.total"></p> + <sup>xp</sup> + </template> + </v-data-table> + </v-col> + </v-row> + <v-row> + <v-card elevation = 2 id="SpreadChart"> + <chart + :container="'week_resourcess'" + :chart="chart_spread()" + :lang="strings.chart" + ></chart> + </v-row> + </v-col> + </v-row> + + </v-container> + </template> + </v-main> +</v-app> \ No newline at end of file diff --git a/notemyprogress/templates/metareflexion.mustache b/notemyprogress/templates/metareflexion.mustache index ba0f40ffd052cc667e3c7005061b21613e55ef4a..c40bb2bf8cb74f20ce8ca775cf8a9d9cb1a54937 100644 --- a/notemyprogress/templates/metareflexion.mustache +++ b/notemyprogress/templates/metareflexion.mustache @@ -24,7 +24,7 @@ <span class="ml-2 d-flex" v-text="strings.title_hours_plan"></span> <v-card-text> <span class="ml-2 d-flex" v-text="strings.currentweek_dialog_hoursdedicate"></span> - <v-text-field :disabled="disabled_form" class="max_width_input" type="number" min="0" max="24" v-model="current_week[0].weekly_schedules_hours.horas_planificadas" outlined placeholder="0"></v-text-field> + <v-text-field :disabled="disabled_form" class="max_width_input" type="number" min="0" max="24" v-model="current_week[0].weekly_schedules_hours.hours_planned" outlined placeholder="0"></v-text-field> </v-card-text> <v-divider></v-divider> @@ -35,7 +35,7 @@ <v-row v-for="(goal,index,key) in current_week[0].goals_categories" :key="key"> <v-col sm="8" offset-sm="2" class="pa-0"> <v-layout column> - <v-checkbox :input-value="get_goal(goal.id)" :label="goal.description" @change="update_goal(goal.id,$event)"></v-checkbox> + <v-checkbox :input-value="get_goal(goal.id)" :label="strings[goal.description]" @change="update_goal(goal.id,$event)"></v-checkbox> </v-layout> </v-col> </v-row> @@ -48,7 +48,7 @@ <span class="ml-2 d-flex" v-text="strings.currentweek_dialog_daysdedicate"></span> <v-row cols="12" md="6"> <v-layout> - <template> + <template v-if="current_week[0].weekly_cm[0]"> <v-simple-table class="resource_list_week"> <template v-slot:default> <thead> @@ -78,6 +78,11 @@ </template> </v-simple-table> </template> + <template v-else> + <v-row cols="12" class="justify-center"> + <span class="justify-center" v-text="strings.no_modules_in_section"></span> + </v-row> + </template> </v-row> </v-card-text> diff --git a/notemyprogress/templates/setweeks.mustache b/notemyprogress/templates/setweeks.mustache index 7e8ca3837d888443f87a57aaec2b229621666e61..c496251ca3002ffe1b72f09495afa8e6639ec637 100644 --- a/notemyprogress/templates/setweeks.mustache +++ b/notemyprogress/templates/setweeks.mustache @@ -48,7 +48,7 @@ <v-col cols="12" md="6" > <v-layout class="justify-space-between align-center mb-4"> <span class="notemyprogress-sub-title" v-text="strings.weeks_of_course"></span> - <v-btn class="fml-btn-secondary ma-0" small @click="add_week()" v-text="strings.add_new_week"></v-btn> + <v-btn class="nmp-btn-secondary ma-0" small @click="add_week()" v-text="strings.add_new_week"></v-btn> </v-layout> <v-container :class="[{scroll_box : scroll_mode}, 'weeks-container', 'pa-2']"> diff --git a/notemyprogress/templates/student_gamification.mustache b/notemyprogress/templates/student_gamification.mustache new file mode 100644 index 0000000000000000000000000000000000000000..e464216de1cc646ed7a5d23197bbb90db37e66a2 --- /dev/null +++ b/notemyprogress/templates/student_gamification.mustache @@ -0,0 +1,161 @@ +<v-app id="student_gamification" class="notemyprogress"> + <v-main> + <pageheader :pagetitle="strings.title" + :helptitle="strings.helplabel" + :exitbutton="strings.exitbutton" + :helpcontents="get_help_content()" + :token="token" + @open_help_section_modal="openHelpSectionModalEvent"> + </pageheader> + <template> + <v-card> + <v-row> + <v-col cols=12 lg="6"> + <v-row class="justify-center"> + <v-col cols="12" sm="11" md="7" lg="6" class="d-flex py-10"> + <v-card class="align-center text-center flex"> + <h4 class="py-5" v-text="settings.tit"></h4> + <p v-if="levelInfo.nam" v-text="levelInfo.nam"></p> + <v-badge + :content="indicators.level" + bottom + offset-x="20" + offset-y="20"> + <v-avatar size="100"> + <v-img src="{{{image}}}"></v-img> + </v-avatar> + </v-badge> + <v-card-text> + <small class="d-inline" v-text="indicators.pointsToNext"></small> + <sup>xp</sup> + <small v-text="strings.to_next_level"></small> + <v-progress-linear + color="#118AB2" + :value="indicators.progress" + height="8" + > + </v-progress-linear> + <p v-if="levelInfo.des" class="pt-5" v-text="levelInfo.des"></p> + <h3 :class="[ !levelInfo.des ? 'pt-5' : 'pt-0']" + v-text="indicators.points +' '+strings.points"></h3> + <v-row class="justify-center text-left" v-for="action in activity" > + <v-col cols="5"> + <small v-text="action.description"></small> + </v-col> + <v-col cols="3"> + <small v-text="action.timeago"></small> + </v-col> + <v-col cols="3" sm="2"> + <small v-text="action.points + ' '+strings.points"></small> + </v-col> + </v-row> + </v-card-text> + <v-card-actions> + <p class="py-0 px-2" v-text="settings.des"></p> + </v-card-actions> + </v-card> + </v-col> + </v-row> + <v-col> + <h4 v-text=strings.overview></h4> + <v-row class="py-5 px-8"> + <v-col v-for="(level, index) in levelsData" cols="12" sm="6" md="3" class="d-flex"> + <v-card class="pt-5 align-center text-center flex"> + <v-badge + :content="level.lvl" + bottom + offset-x="20" + offset-y="20" + > + <v-avatar size="100"> + <v-img src="{{{image}}}"></v-img> + </v-avatar> + </v-badge> + <v-card-text class="text--primary text-center"> + <h6 v-if="level.nam" v-text="level.nam"></h6> + <p v-if="level.des" class="pt-4 text-left" v-text="level.des"></p> + <p class="mb-0 pb-0" v-text="level.points+' '+strings.points"></p> + </v-card-text> + </v-card> + </v-col> + </v-row> + </v-col> + </v-col> + <v-col cols=12 lg="6"> + <v-row v-if="strings.rankable"class="py-5 px-8"> + <v-col cols="12" md="12"> + <v-data-table + :headers="table_headers()" + :items="ranking" + item-key="id" + :items-per-page="7" + > + <template v-slot:item.level="{ item }"> + <v-badge + inline + bordered + :content="item.level" + > + <v-avatar size="30"> + <v-img src="{{{image}}}"></v-img> + </v-avatar> + </v-badge> + </template> + <template v-slot:item.progress_percentage="{ item }"> + <v-progress-linear + color="#118AB2" + :value="item.progress_percentage" + height="8" + > + </v-progress-linear> + </template> + <template v-slot:item.total="{ item }"> + <p class="d-inline" v-text="item.total"></p> + <sup>xp</sup> + </template> + </v-data-table> + + + + </v-col> + </v-row> + <v-row v-else> + <v-card + class="mx-auto" + max-width="90%" + outlined + > + <v-list-item three-line> + <v-list-item-content> + <v-list-item-title class="text-h5 mb-1" v-text=strings.studentRanking1> + </v-list-item-title> + <v-list-item-subtitle v-text=strings.studentRanking2></v-list-item-subtitle> + </v-list-item-content> + + <v-list-item-avatar + tile + size="80" + color="red" + + ><v-img src="{{{rankImage}}}"></v-img></v-list-item-avatar> + </v-list-item> + + <v-card-actions> + <v-btn + outlined + rounded + text + @click=activateRanking() + v-text=strings.studentRanking3 + > + </v-btn> + </v-card-actions> + </v-card> + </v-row> + </v-col> + </v-row> + </v-card> + + </template> + </v-main> +</v-app> \ No newline at end of file