PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.3
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.3
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / assets / js / dist / frontend / single-course.js

single-course.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.3, at assets/js/dist/frontend/single-course.js

2,872 lines 99.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "./assets/src/apps/js/frontend/material.js"
5 /*!*************************************************!*\
6 !*** ./assets/src/apps/js/frontend/material.js ***!
7 \*************************************************/
8 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9
10 "use strict";
11 __webpack_require__.r(__webpack_exports__);
12 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 /* harmony export */ "default": () => (/* binding */ lpMaterialsLoad)
14 /* harmony export */ });
15 /* harmony import */ var _js_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../js/utils.js */ "./assets/src/js/utils.js");
16
17 function lpMaterialsLoad() {
18 document.addEventListener('click', function (e) {
19 const target = e.target;
20 if (target.classList.contains('lp-loadmore-material')) {
21 const loadMoreButton = target;
22 const lpTarget = target.closest('.lp-target');
23 const dataSend = window.lpAJAXG.getDataSetCurrent(lpTarget);
24 dataSend.args.paged++;
25 _js_utils_js__WEBPACK_IMPORTED_MODULE_0__.lpSetLoadingEl(loadMoreButton, 1);
26 const callBack = {
27 success: response => {
28 const {
29 status,
30 message,
31 data
32 } = response;
33 if (status === 'success') {
34 const tableBody = lpTarget.querySelector('table.course-material-table tbody');
35 tableBody.insertAdjacentHTML('beforeend', data.content);
36 if (data.paged === data.total_pages) {
37 loadMoreButton.remove();
38 }
39 window.lpAJAXG.setDataSetCurrent(lpTarget, dataSend);
40 } else {
41 console.error(message);
42 }
43 },
44 error: error => {
45 console.error(error);
46 },
47 completed: () => {
48 _js_utils_js__WEBPACK_IMPORTED_MODULE_0__.lpSetLoadingEl(loadMoreButton, 0);
49 }
50 };
51 window.lpAJAXG.fetchAJAX(dataSend, callBack);
52 }
53 });
54 }
55
56 /***/ },
57
58 /***/ "./assets/src/apps/js/frontend/show-lp-overlay-complete-item.js"
59 /*!**********************************************************************!*\
60 !*** ./assets/src/apps/js/frontend/show-lp-overlay-complete-item.js ***!
61 \**********************************************************************/
62 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
63
64 "use strict";
65 __webpack_require__.r(__webpack_exports__);
66 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
67 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
68 /* harmony export */ });
69 /* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/lp-modal-overlay */ "./assets/src/apps/js/utils/lp-modal-overlay.js");
70
71 const lpModalOverlayCompleteItem = {
72 elBtnFinishCourse: null,
73 elBtnCompleteItem: null,
74 init() {
75 if (!_utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].init()) {
76 return;
77 }
78 if (undefined === lpGlobalSettings || 'yes' !== lpGlobalSettings.option_enable_popup_confirm_finish) {
79 return;
80 }
81 this.elBtnFinishCourse = document.querySelectorAll('.lp-btn-finish-course');
82 this.elBtnCompleteItem = document.querySelector('.lp-btn-complete-item');
83 if (this.elBtnCompleteItem) {
84 this.elBtnCompleteItem.addEventListener('click', e => {
85 e.preventDefault();
86 const form = e.target.closest('form');
87 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
88 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(form.dataset.title);
89 // ESC html
90 const div = document.createElement('div');
91 div.appendChild(document.createTextNode(form.dataset.confirm));
92 const contentModal = div.innerHTML;
93 // End ESC html
94 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal('<div class="pd-2em">' + contentModal + '</div>');
95 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].callBackYes = () => {
96 form.submit();
97 };
98 });
99 }
100 if (this.elBtnFinishCourse) {
101 this.elBtnFinishCourse.forEach(element => element.addEventListener('click', e => {
102 e.preventDefault();
103 const form = e.target.closest('form');
104 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].elLPOverlay.show();
105 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setTitleModal(form.dataset.title);
106 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].setContentModal('<div class="pd-2em">' + form.dataset.confirm + '</div>');
107 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__["default"].callBackYes = () => {
108 form.submit();
109 };
110 }));
111 }
112 }
113 };
114 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (lpModalOverlayCompleteItem);
115
116 /***/ },
117
118 /***/ "./assets/src/apps/js/frontend/single-course/index.js"
119 /*!************************************************************!*\
120 !*** ./assets/src/apps/js/frontend/single-course/index.js ***!
121 \************************************************************/
122 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
123
124 "use strict";
125 __webpack_require__.r(__webpack_exports__);
126 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
127 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
128 /* harmony export */ });
129 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
130 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
131 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
132 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
133 /* harmony import */ var _learnpress_quiz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @learnpress/quiz */ "@learnpress/quiz");
134 /* harmony import */ var _learnpress_quiz__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_learnpress_quiz__WEBPACK_IMPORTED_MODULE_2__);
135 /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./store */ "./assets/src/apps/js/frontend/single-course/store/index.js");
136 /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_store__WEBPACK_IMPORTED_MODULE_3__);
137 /* harmony import */ var _single_curriculum_components_sidebar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../single-curriculum/components/sidebar */ "./assets/src/apps/js/frontend/single-curriculum/components/sidebar.js");
138
139
140
141
142 // Use toggle in Curriculum tab.
143
144 class SingleCourse extends _wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Component {
145 render() {
146 return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null);
147 }
148 }
149 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SingleCourse);
150 function run() {
151 (0,_single_curriculum_components_sidebar__WEBPACK_IMPORTED_MODULE_4__.Sidebar)();
152 }
153 document.addEventListener('DOMContentLoaded', () => {
154 run();
155 });
156
157 /***/ },
158
159 /***/ "./assets/src/apps/js/frontend/single-course/store/index.js"
160 /*!******************************************************************!*\
161 !*** ./assets/src/apps/js/frontend/single-course/store/index.js ***!
162 \******************************************************************/
163 () {
164
165 /**
166 * Created by tu on 9/19/19.
167 */
168
169 /***/ },
170
171 /***/ "./assets/src/apps/js/frontend/single-curriculum/components/search.js"
172 /*!****************************************************************************!*\
173 !*** ./assets/src/apps/js/frontend/single-curriculum/components/search.js ***!
174 \****************************************************************************/
175 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
176
177 "use strict";
178 __webpack_require__.r(__webpack_exports__);
179 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
180 /* harmony export */ searchCourseContent: () => (/* binding */ searchCourseContent)
181 /* harmony export */ });
182 const searchCourseContent = () => {
183 const popup = document.querySelector('#popup-course');
184 const list = document.querySelector('#learn-press-course-curriculum');
185 if (popup && list) {
186 const items = list.querySelector('.curriculum-sections');
187 const form = popup.querySelector('.search-course');
188 const search = popup.querySelector('.search-course input[type="text"]');
189 if (!search || !items || !form) {
190 return;
191 }
192 const sections = items.querySelectorAll('li.section');
193 const dataItems = items.querySelectorAll('li.course-item');
194 const dataSearch = [];
195 dataItems.forEach(item => {
196 const itemID = item.dataset.id;
197 const name = item.querySelector('.item-name');
198 dataSearch.push({
199 id: itemID,
200 name: name ? name.textContent.toLowerCase() : ''
201 });
202 });
203 const submit = event => {
204 event.preventDefault();
205 const inputVal = search.value;
206 form.classList.add('searching');
207 if (!inputVal) {
208 form.classList.remove('searching');
209 }
210 const outputs = [];
211 dataSearch.forEach(i => {
212 if (!inputVal || i.name.match(inputVal.toLowerCase())) {
213 outputs.push(i.id);
214 dataItems.forEach(c => {
215 if (outputs.indexOf(c.dataset.id) !== -1) {
216 c.classList.remove('hide-if-js');
217 } else {
218 c.classList.add('hide-if-js');
219 }
220 });
221 }
222 });
223 sections.forEach(section => {
224 const listItem = section.querySelectorAll('.course-item');
225 const isTrue = [];
226 listItem.forEach(a => {
227 if (outputs.includes(a.dataset.id)) {
228 isTrue.push(a.dataset.id);
229 }
230 });
231 if (isTrue.length === 0) {
232 section.classList.add('hide-if-js');
233 } else {
234 section.classList.remove('hide-if-js');
235 }
236 });
237 };
238 const clear = form.querySelector('.clear');
239 if (clear) {
240 clear.addEventListener('click', e => {
241 e.preventDefault();
242 search.value = '';
243 submit(e);
244 });
245 }
246 form.addEventListener('submit', submit);
247 search.addEventListener('keyup', submit);
248 }
249 };
250
251 /***/ },
252
253 /***/ "./assets/src/apps/js/frontend/single-curriculum/components/sidebar.js"
254 /*!*****************************************************************************!*\
255 !*** ./assets/src/apps/js/frontend/single-curriculum/components/sidebar.js ***!
256 \*****************************************************************************/
257 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
258
259 "use strict";
260 __webpack_require__.r(__webpack_exports__);
261 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
262 /* harmony export */ Sidebar: () => (/* binding */ Sidebar)
263 /* harmony export */ });
264 const $ = jQuery;
265 const {
266 throttle
267 } = lodash;
268 const Sidebar = () => {
269 // Tungnx - Show/hide sidebar curriculumn
270 const elSidebarToggle = document.querySelector('#sidebar-toggle');
271
272 // For style of theme
273 const toggleSidebar = toggle => {
274 $('body').removeClass('lp-sidebar-toggle__open');
275 $('body').removeClass('lp-sidebar-toggle__close');
276 if (toggle) {
277 $('body').addClass('lp-sidebar-toggle__close');
278 } else {
279 $('body').addClass('lp-sidebar-toggle__open');
280 }
281 };
282
283 // For lp and theme
284 if (elSidebarToggle) {
285 if ($(window).innerWidth() <= 768) {
286 elSidebarToggle.setAttribute('checked', 'checked');
287 } else if (LP.Cookies.get('sidebar-toggle')) {
288 elSidebarToggle.setAttribute('checked', 'checked');
289 } else {
290 elSidebarToggle.removeAttribute('checked');
291 }
292 }
293 // End editor by tungnx
294
295 // Code for old curriculum
296 /*const $curriculum = $( '#learn-press-course-curriculum' );
297 $curriculum.find( '.section-desc' ).each( ( i, el ) => {
298 const a = $( '<span class="show-desc"></span>' ).on( 'click', () => {
299 b.toggleClass( 'c' );
300 } );
301 const b = $( el ).siblings( '.section-title' ).append( a );
302 } );*/
303
304 // Code for old curriculum
305 /*$( '.section' ).each( function() {
306 const $section = $( this ),
307 $toggle = $section.find( '.section-left' );
308 $toggle.on( 'click', function() {
309 const isClose = $section.toggleClass( 'closed' ).hasClass( 'closed' );
310 const sections = LP.Cookies.get( 'closed-section-' + lpGlobalSettings.post_id ) || [];
311 const sectionId = parseInt( $section.data( 'section-id' ) );
312 const at = sections.findIndex( ( id ) => {
313 return id == sectionId;
314 } );
315 if ( isClose ) {
316 sections.push( parseInt( $section.data( 'section-id' ) ) );
317 } else {
318 sections.splice( at, 1 );
319 }
320 LP.Cookies.remove( 'closed-section-(.*)' );
321 LP.Cookies.set( 'closed-section-' + lpGlobalSettings.post_id, [ ...new Set( sections ) ] );
322 } );
323 } );*/
324
325 document.addEventListener('click', e => {
326 if (e.target.id === 'sidebar-toggle') {
327 LP.Cookies.set('sidebar-toggle', e.target.checked ? true : false);
328 toggleSidebar(LP.Cookies.get('sidebar-toggle'));
329 }
330 });
331 };
332
333 /***/ },
334
335 /***/ "./assets/src/apps/js/frontend/single-curriculum/scrolltoitem.js"
336 /*!***********************************************************************!*\
337 !*** ./assets/src/apps/js/frontend/single-curriculum/scrolltoitem.js ***!
338 \***********************************************************************/
339 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
340
341 "use strict";
342 __webpack_require__.r(__webpack_exports__);
343 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
344 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
345 /* harmony export */ });
346 /* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/lp-modal-overlay */ "./assets/src/apps/js/utils/lp-modal-overlay.js");
347
348 const $ = jQuery;
349 const scrollToItemCurrent = {
350 init() {
351 this.scrollToItemViewing = function () {
352 const elItemViewing = $('.viewing-course-item');
353 if (elItemViewing.length) {
354 const elCourseCurriculumn = $('#learn-press-course-curriculum');
355 const heightCourseItemContentHeader = $('#popup-sidebar').outerHeight();
356 const heightSectionTitle = $('.section-title').outerHeight();
357 const heightSectionHeader = $('.section-header').outerHeight();
358 const regex = new RegExp('^viewing-course-item-([0-9].*)');
359 const classList = elItemViewing.attr('class');
360 const classArr = classList.split(/\s+/);
361 let idItem = 0;
362 $.each(classArr, function (i, className) {
363 const compare = regex.exec(className);
364 if (compare) {
365 idItem = compare[1];
366 return false;
367 }
368 });
369 if (0 === idItem) {
370 return;
371 }
372 const elItemCurrent = $('.course-item-' + idItem);
373 elItemCurrent.addClass('current');
374 const offSetTop = elItemCurrent.offset().top;
375 const offset = elItemCurrent.offset().top - elCourseCurriculumn.offset().top + elCourseCurriculumn.scrollTop();
376 elCourseCurriculumn.animate({
377 scrollTop: LP.Hook.applyFilters('scroll-item-current', offset - heightSectionHeader)
378 }, 800);
379 }
380 };
381 this.scrollToItemViewing();
382 }
383 };
384 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (scrollToItemCurrent);
385
386 /***/ },
387
388 /***/ "./assets/src/apps/js/frontend/single-curriculum/skeleton.js"
389 /*!*******************************************************************!*\
390 !*** ./assets/src/apps/js/frontend/single-curriculum/skeleton.js ***!
391 \*******************************************************************/
392 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
393
394 "use strict";
395 __webpack_require__.r(__webpack_exports__);
396 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
397 /* harmony export */ "default": () => (/* binding */ courseCurriculumSkeleton)
398 /* harmony export */ });
399 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
400 /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__);
401 /* harmony import */ var _scrolltoitem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scrolltoitem */ "./assets/src/apps/js/frontend/single-curriculum/scrolltoitem.js");
402 /* harmony import */ var _components_search__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/search */ "./assets/src/apps/js/frontend/single-curriculum/components/search.js");
403 // Rest API load content in Tab Curriculum - Nhamdv.
404
405 //import apiFetch from '@wordpress/api-fetch';
406
407
408 function courseCurriculumSkeleton(courseID = '') {
409 let idItemViewing = 0;
410 const elItemViewing = document.querySelector('.viewing-course-item');
411 if (elItemViewing) {
412 const regex = new RegExp('^viewing-course-item-([0-9].*)');
413 const classList = elItemViewing.classList;
414 classList.forEach(function (className) {
415 const compare = regex.exec(className);
416 if (compare) {
417 idItemViewing = compare[1];
418 return false;
419 }
420 });
421 }
422 let isLoadingItems = false;
423 let isLoadingSections = false;
424 const Sekeleton = () => {
425 const elementCurriculum = document.querySelector('.learnpress-course-curriculum');
426 if (!elementCurriculum) {
427 return;
428 }
429 getResponse(elementCurriculum);
430 };
431 const getResponse = async ele => {
432 const skeleton = ele.querySelector('.lp-skeleton-animation');
433 const itemID = ele.dataset.id;
434 const sectionID = ele.dataset.section;
435 try {
436 const page = 1;
437 let url = lpData.lp_rest_url + 'lp/v1/lazy-load/course-curriculum/';
438 url = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)(url, {
439 courseId: courseID || lpGlobalSettings.post_id || '',
440 page,
441 sectionID: sectionID || '',
442 idItemViewing
443 });
444 let paramsFetch = {};
445 if (0 !== parseInt(lpData.user_id)) {
446 paramsFetch = {
447 headers: {
448 'X-WP-Nonce': lpData.nonce
449 }
450 };
451 }
452 let response = await fetch(url, {
453 method: 'GET',
454 ...paramsFetch
455 });
456 response = await response.json();
457 const {
458 data,
459 status,
460 message
461 } = response;
462 const section_ids = data.section_ids;
463 if (status === 'error') {
464 throw new Error(message || 'Error');
465 }
466 const returnData = data.content;
467 if (sectionID) {
468 if (section_ids && !section_ids.includes(sectionID)) {
469 const response2 = await getResponsive('', page + 1, sectionID);
470 if (response2) {
471 const {
472 data2,
473 pages2,
474 page2
475 } = response2;
476 await parseContentItems({
477 ele,
478 returnData,
479 sectionID,
480 itemID,
481 data2,
482 pages2,
483 page2
484 });
485 }
486 } else {
487 await parseContentItems({
488 ele,
489 returnData,
490 sectionID,
491 itemID
492 });
493 }
494 } else {
495 returnData && ele.insertAdjacentHTML('beforeend', returnData);
496 }
497 } catch (error) {
498 ele.insertAdjacentHTML('beforeend', `<div class="lp-ajax-message error" style="display:block">${error.message || 'Error: Query lp/v1/lazy-load/course-curriculum'}</div>`);
499 }
500 skeleton && skeleton.remove();
501 (0,_components_search__WEBPACK_IMPORTED_MODULE_2__.searchCourseContent)();
502 };
503 const parseContentItems = async ({
504 ele,
505 returnData,
506 sectionID,
507 itemID,
508 data2,
509 pages2,
510 page2
511 }) => {
512 const parser = new DOMParser();
513 const doc = parser.parseFromString(returnData, 'text/html');
514 if (data2) {
515 const sections = doc.querySelector('.curriculum-sections');
516 const loadMoreBtn = doc.querySelector('.curriculum-more__button');
517 if (loadMoreBtn) {
518 if (pages2 <= page2) {
519 loadMoreBtn.remove();
520 } else {
521 loadMoreBtn.dataset.page = page2;
522 }
523 }
524 sections.insertAdjacentHTML('beforeend', data2);
525 }
526 const section = doc.querySelector(`[data-section-id="${sectionID}"]`);
527 if (section) {
528 const items = section.querySelectorAll('.course-item');
529 const item_ids = [...items].map(item => item.dataset.id);
530 const sectionContent = section.querySelector('.section-content');
531 const itemLoadMore = section.querySelector('.section-item__loadmore');
532 if (itemID && !item_ids.includes(itemID)) {
533 const responseItem = await getResponsiveItem('', 2, sectionID, itemID);
534 const {
535 data3,
536 pages3,
537 paged3,
538 page
539 } = responseItem;
540 if (pages3 <= paged3 || pages3 <= page) {
541 itemLoadMore.remove();
542 } else {
543 itemLoadMore.dataset.page = page;
544 }
545 if (data3 && sectionContent) {
546 sectionContent.insertAdjacentHTML('beforeend', data3);
547 }
548 }
549 }
550 ele.insertAdjacentHTML('beforeend', doc.body.innerHTML);
551 _scrolltoitem__WEBPACK_IMPORTED_MODULE_1__["default"].init();
552 };
553 const getResponsiveItem = async (returnData, paged, sectionID, itemID) => {
554 let url = lpData.lp_rest_url + 'lp/v1/lazy-load/course-curriculum-items/';
555 url = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)(url, {
556 sectionId: sectionID || '',
557 page: paged
558 });
559 let paramsFetch = {};
560 if (0 !== parseInt(lpData.user_id)) {
561 paramsFetch = {
562 headers: {
563 'X-WP-Nonce': lpData.nonce
564 }
565 };
566 }
567 let response = await fetch(url, {
568 method: 'GET',
569 ...paramsFetch
570 });
571 response = await response.json();
572 const {
573 data,
574 status,
575 pages,
576 message
577 } = response;
578 const {
579 page
580 } = data;
581 let item_ids;
582 if (status === 'success') {
583 const dataTmp = data.content;
584 item_ids = data.item_ids;
585 returnData += dataTmp;
586 if (sectionID && item_ids && itemID && !item_ids.includes(itemID)) {
587 return getResponsiveItem(returnData, paged + 1, sectionID, itemID);
588 }
589 }
590 isLoadingItems = false;
591 return {
592 data3: returnData,
593 pages3: pages || data.pages,
594 status3: status,
595 message3: message,
596 page: page || 0
597 };
598 };
599 const getResponsive = async (returnData, page, sectionID) => {
600 let url = lpData.lp_rest_url + 'lp/v1/lazy-load/course-curriculum/';
601 url = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)(url, {
602 courseId: courseID || lpGlobalSettings.post_id || '',
603 page,
604 sectionID: sectionID || '',
605 loadMore: true
606 });
607 let paramsFetch = {};
608 if (0 !== parseInt(lpData.user_id)) {
609 paramsFetch = {
610 headers: {
611 'X-WP-Nonce': lpData.nonce
612 }
613 };
614 }
615 let response = await fetch(url, {
616 method: 'GET',
617 ...paramsFetch
618 });
619 response = await response.json();
620 const {
621 data,
622 status,
623 message
624 } = response;
625 const returnDataTmp = data.content;
626 const section_ids = data.section_ids;
627 const pages = data.pages;
628 if (status === 'success') {
629 returnData += returnDataTmp;
630 if (sectionID && section_ids && section_ids.length > 0 && !section_ids.includes(sectionID)) {
631 return getResponsive(returnData, page + 1, sectionID);
632 }
633 }
634 isLoadingSections = false;
635 return {
636 data2: returnData,
637 pages2: pages || data.pages,
638 page2: page,
639 status2: status,
640 message2: message
641 };
642 };
643 Sekeleton();
644 document.addEventListener('click', e => {
645 const sectionBtns = document.querySelectorAll('.section-item__loadmore');
646 [...sectionBtns].map(async sectionBtn => {
647 if (sectionBtn.contains(e.target) && !isLoadingItems) {
648 isLoadingItems = true;
649 const sectionItem = sectionBtn.parentNode;
650 const sectionId = sectionItem.getAttribute('data-section-id');
651 const sectionContent = sectionItem.querySelector('.section-content');
652 const paged = parseInt(sectionBtn.dataset.page);
653 sectionBtn.classList.add('loading');
654 try {
655 const response = await getResponsiveItem('', paged + 1, sectionId, '');
656 const {
657 data3,
658 pages3,
659 status3,
660 message3
661 } = response;
662 if (status3 === 'error') {
663 throw new Error(message3 || 'Error');
664 }
665 if (pages3 <= paged + 1) {
666 sectionBtn.remove();
667 } else {
668 sectionBtn.dataset.page = paged + 1;
669 }
670 sectionContent.insertAdjacentHTML('beforeend', data3);
671 } catch (e) {
672 sectionContent.insertAdjacentHTML('beforeend', `<div class="lp-ajax-message error" style="display:block">${e.message || 'Error: Query lp/v1/lazy-load/course-curriculum'}</div>`);
673 }
674 sectionBtn.classList.remove('loading');
675 (0,_components_search__WEBPACK_IMPORTED_MODULE_2__.searchCourseContent)();
676 }
677 });
678
679 // Load more Sections
680 const moreSections = document.querySelectorAll('.curriculum-more__button');
681 [...moreSections].map(async moreSection => {
682 if (moreSection.contains(e.target) && !isLoadingSections) {
683 isLoadingSections = true;
684 const paged = parseInt(moreSection.dataset.page);
685 const sections = moreSection.parentNode.parentNode.querySelector('.curriculum-sections');
686 if (paged && sections) {
687 moreSection.classList.add('loading');
688 try {
689 const response2 = await getResponsive('', paged + 1, '');
690 const {
691 data2,
692 pages2,
693 status2,
694 message2
695 } = response2;
696 if (status2 === 'error') {
697 throw new Error(message2 || 'Error');
698 }
699 if (pages2 <= paged + 1) {
700 moreSection.remove();
701 } else {
702 moreSection.dataset.page = paged + 1;
703 }
704 sections.insertAdjacentHTML('beforeend', data2);
705 } catch (e) {
706 sections.insertAdjacentHTML('beforeend', `<div class="lp-ajax-message error" style="display:block">${e.message || 'Error: Query lp/v1/lazy-load/course-curriculum'}</div>`);
707 }
708 moreSection.classList.remove('loading');
709 (0,_components_search__WEBPACK_IMPORTED_MODULE_2__.searchCourseContent)();
710 }
711 }
712 });
713
714 // Show/Hide accordion
715 if (document.querySelector('.learnpress-course-curriculum')) {
716 const sections = document.querySelectorAll('.section');
717 [...sections].map(section => {
718 if (section.contains(e.target)) {
719 const toggle = section.querySelector('.section-left');
720 toggle.contains(e.target) && section.classList.toggle('closed');
721 }
722 });
723 }
724 });
725 }
726
727 /***/ },
728
729 /***/ "./assets/src/apps/js/frontend/tabs-scroll.js"
730 /*!****************************************************!*\
731 !*** ./assets/src/apps/js/frontend/tabs-scroll.js ***!
732 \****************************************************/
733 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
734
735 "use strict";
736 __webpack_require__.r(__webpack_exports__);
737 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
738 /* harmony export */ "default": () => (/* binding */ TabsDragScroll)
739 /* harmony export */ });
740 function TabsDragScroll() {
741 // Selectors and DOM elements
742 const TabsDragScroll = document.querySelector('.TabsDragScroll');
743 if (!TabsDragScroll) return;
744 const tabMenu = TabsDragScroll.querySelector('ul');
745
746 // Dragging functionality
747 let activeDrag = false;
748 tabMenu.addEventListener('mousemove', event => {
749 if (!activeDrag) return;
750 tabMenu.scrollLeft -= event.movementX;
751 // iconVisibility();
752 tabMenu.classList.add('dragging');
753 });
754 document.addEventListener('mouseup', () => {
755 activeDrag = false;
756 tabMenu.classList.remove('dragging');
757 });
758 tabMenu.addEventListener('mousedown', () => {
759 activeDrag = true;
760 });
761
762 // Scroll to <li> on click
763 const scrollToLi = li => {
764 const liLeft = li.offsetLeft;
765 const liWidth = li.offsetWidth;
766 const tabCenter = tabMenu.clientWidth / 2 - liWidth / 2;
767 tabMenu.scrollTo({
768 left: liLeft - tabCenter,
769 behavior: 'smooth'
770 });
771 };
772
773 // Add click event listeners to all <li> elements
774 tabMenu.querySelectorAll('li').forEach(li => {
775 li.addEventListener('click', () => scrollToLi(li));
776 });
777 }
778
779 /***/ },
780
781 /***/ "./assets/src/apps/js/utils/lp-modal-overlay.js"
782 /*!******************************************************!*\
783 !*** ./assets/src/apps/js/utils/lp-modal-overlay.js ***!
784 \******************************************************/
785 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
786
787 "use strict";
788 __webpack_require__.r(__webpack_exports__);
789 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
790 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
791 /* harmony export */ });
792 const $ = jQuery;
793 let elLPOverlay = null;
794 const lpModalOverlay = {
795 elLPOverlay: null,
796 elMainContent: null,
797 elTitle: null,
798 elBtnYes: null,
799 elBtnNo: null,
800 elFooter: null,
801 elCalledModal: null,
802 callBackYes: null,
803 instance: null,
804 init() {
805 if (this.instance) {
806 return true;
807 }
808 this.elLPOverlay = $('.lp-overlay');
809 if (!this.elLPOverlay.length) {
810 return false;
811 }
812 elLPOverlay = this.elLPOverlay;
813 this.elMainContent = elLPOverlay.find('.main-content');
814 this.elTitle = elLPOverlay.find('.modal-title');
815 this.elBtnYes = elLPOverlay.find('.btn-yes');
816 this.elBtnNo = elLPOverlay.find('.btn-no');
817 this.elFooter = elLPOverlay.find('.lp-modal-footer');
818 $(document).on('click', '.close, .btn-no', function () {
819 elLPOverlay.hide();
820 });
821 $(document).on('click', '.btn-yes', function (e) {
822 e.preventDefault();
823 e.stopPropagation();
824 if ('function' === typeof lpModalOverlay.callBackYes) {
825 lpModalOverlay.callBackYes(e);
826 }
827 });
828 this.instance = this;
829 return true;
830 },
831 setElCalledModal(elCalledModal) {
832 this.elCalledModal = elCalledModal;
833 },
834 setContentModal(content, event) {
835 this.elMainContent.html(content);
836 if ('function' === typeof event) {
837 event();
838 }
839 },
840 setTitleModal(content) {
841 this.elTitle.html(content);
842 }
843 };
844 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (lpModalOverlay);
845
846 /***/ },
847
848 /***/ "./assets/src/js/frontend/copy-to-clipboard.js"
849 /*!*****************************************************!*\
850 !*** ./assets/src/js/frontend/copy-to-clipboard.js ***!
851 \*****************************************************/
852 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
853
854 "use strict";
855 __webpack_require__.r(__webpack_exports__);
856 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
857 /* harmony export */ "default": () => (/* binding */ CopyToClipboard)
858 /* harmony export */ });
859 function LPClick(element, iconBtn, inner) {
860 const wrappers = document.querySelectorAll(element);
861 if (!wrappers.length) {
862 return;
863 }
864 wrappers.forEach(wrapper => {
865 const clickBtn = wrapper.querySelector(iconBtn);
866 const class_open = element.replace('.', '') + '__open';
867 const closeElement = wrapper.querySelector(element + '__close');
868 const isOpenElement = () => wrapper.classList.contains(class_open);
869 const showElement = () => {
870 if (!isOpenElement()) {
871 wrapper.classList.add(class_open);
872 }
873 };
874 const hideElement = () => {
875 if (isOpenElement()) {
876 wrapper.classList.remove(class_open);
877 }
878 };
879 const toggleElement = () => {
880 if (isOpenElement()) {
881 hideElement();
882 } else {
883 showElement();
884 }
885 };
886 const onKeyDown = e => {
887 if (e.keyCode === 27) {
888 hideElement();
889 }
890 };
891 if (clickBtn) {
892 clickBtn.onclick = function (e) {
893 e.preventDefault();
894 toggleElement();
895 };
896 }
897 document.addEventListener('click', e => {
898 if (!isOpenElement()) {
899 return;
900 }
901 const target = e.target;
902 if (target.closest(inner) || target.closest(iconBtn)) {
903 return;
904 }
905 hideElement();
906 });
907 if (closeElement) {
908 closeElement.addEventListener('click', e => {
909 e.preventDefault();
910 hideElement();
911 });
912 }
913 document.addEventListener('keydown', onKeyDown, false);
914 });
915 }
916 function CopyToClipboard() {
917 LPClick('.social-share-toggle', '.share-toggle-icon', '.content-widget-social-share');
918 var copyTextareaBtn = document.querySelector('.btn-clipboard');
919 if (copyTextareaBtn) {
920 copyTextareaBtn.addEventListener('click', function (event) {
921 var copyTextarea = document.querySelector('.clipboard-value');
922 copyTextarea.focus();
923 copyTextarea.select();
924 try {
925 var successful = document.execCommand('copy');
926 var msg = copyTextareaBtn.getAttribute('data-copied');
927 copyTextareaBtn.innerHTML = msg + '<span class="tooltip">' + msg + '</span>';
928 } catch (err) {}
929 });
930 }
931 }
932
933 /***/ },
934
935 /***/ "./assets/src/js/utils.js"
936 /*!********************************!*\
937 !*** ./assets/src/js/utils.js ***!
938 \********************************/
939 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
940
941 "use strict";
942 __webpack_require__.r(__webpack_exports__);
943 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
944 /* harmony export */ debounce: () => (/* binding */ debounce),
945 /* harmony export */ eventHandlers: () => (/* binding */ eventHandlers),
946 /* harmony export */ getDataOfForm: () => (/* binding */ getDataOfForm),
947 /* harmony export */ getFieldKeysOfForm: () => (/* binding */ getFieldKeysOfForm),
948 /* harmony export */ listenElementCreated: () => (/* binding */ listenElementCreated),
949 /* harmony export */ listenElementViewed: () => (/* binding */ listenElementViewed),
950 /* harmony export */ lpAddQueryArgs: () => (/* binding */ lpAddQueryArgs),
951 /* harmony export */ lpAjaxParseJsonOld: () => (/* binding */ lpAjaxParseJsonOld),
952 /* harmony export */ lpClassName: () => (/* binding */ lpClassName),
953 /* harmony export */ lpFetchAPI: () => (/* binding */ lpFetchAPI),
954 /* harmony export */ lpGetCurrentURLNoParam: () => (/* binding */ lpGetCurrentURLNoParam),
955 /* harmony export */ lpOnElementReady: () => (/* binding */ lpOnElementReady),
956 /* harmony export */ lpSetLoadingEl: () => (/* binding */ lpSetLoadingEl),
957 /* harmony export */ lpShowHideEl: () => (/* binding */ lpShowHideEl),
958 /* harmony export */ mergeDataWithDatForm: () => (/* binding */ mergeDataWithDatForm),
959 /* harmony export */ toggleCollapse: () => (/* binding */ toggleCollapse)
960 /* harmony export */ });
961 /**
962 * Utils functions
963 *
964 * @param url
965 * @param data
966 * @param functions
967 * @since 4.2.5.1
968 * @version 1.0.6
969 */
970 const lpClassName = {
971 hidden: 'lp-hidden',
972 loading: 'loading',
973 elCollapse: 'lp-collapse',
974 elSectionToggle: '.lp-section-toggle',
975 elTriggerToggle: '.lp-trigger-toggle'
976 };
977 const lpFetchAPI = (url, data = {}, functions = {}) => {
978 if ('function' === typeof functions.before) {
979 functions.before();
980 }
981 fetch(url, {
982 method: 'GET',
983 ...data
984 }).then(response => response.json()).then(response => {
985 if ('function' === typeof functions.success) {
986 functions.success(response);
987 }
988 }).catch(err => {
989 if ('function' === typeof functions.error) {
990 functions.error(err);
991 }
992 }).finally(() => {
993 if ('function' === typeof functions.completed) {
994 functions.completed();
995 }
996 });
997 };
998
999 /**
1000 * Get current URL without params.
1001 *
1002 * @since 4.2.5.1
1003 */
1004 const lpGetCurrentURLNoParam = () => {
1005 let currentUrl = window.location.href;
1006 const hasParams = currentUrl.includes('?');
1007 if (hasParams) {
1008 currentUrl = currentUrl.split('?')[0];
1009 }
1010 return currentUrl;
1011 };
1012 const lpAddQueryArgs = (endpoint, args) => {
1013 const url = new URL(endpoint);
1014 Object.keys(args).forEach(arg => {
1015 url.searchParams.set(arg, args[arg]);
1016 });
1017 return url;
1018 };
1019
1020 /**
1021 * Listen element viewed.
1022 *
1023 * @param el
1024 * @param callback
1025 * @since 4.2.5.8
1026 */
1027 const listenElementViewed = (el, callback) => {
1028 const observerSeeItem = new IntersectionObserver(function (entries) {
1029 for (const entry of entries) {
1030 if (entry.isIntersecting) {
1031 callback(entry);
1032 }
1033 }
1034 });
1035 observerSeeItem.observe(el);
1036 };
1037
1038 /**
1039 * Listen element created.
1040 *
1041 * @param callback
1042 * @since 4.2.5.8
1043 */
1044 const listenElementCreated = callback => {
1045 const observerCreateItem = new MutationObserver(function (mutations) {
1046 mutations.forEach(function (mutation) {
1047 if (mutation.addedNodes) {
1048 mutation.addedNodes.forEach(function (node) {
1049 if (node.nodeType === 1) {
1050 callback(node);
1051 }
1052 });
1053 }
1054 });
1055 });
1056 observerCreateItem.observe(document, {
1057 childList: true,
1058 subtree: true
1059 });
1060 // End.
1061 };
1062
1063 /**
1064 * Listen element created.
1065 *
1066 * @param selector
1067 * @param callback
1068 * @since 4.2.7.1
1069 */
1070 const lpOnElementReady = (selector, callback) => {
1071 const element = document.querySelector(selector);
1072 if (element) {
1073 callback(element);
1074 return;
1075 }
1076 const observer = new MutationObserver((mutations, obs) => {
1077 const element = document.querySelector(selector);
1078 if (element) {
1079 obs.disconnect();
1080 callback(element);
1081 }
1082 });
1083 observer.observe(document.documentElement, {
1084 childList: true,
1085 subtree: true
1086 });
1087 };
1088
1089 // Parse JSON from string with content include LP_AJAX_START.
1090 const lpAjaxParseJsonOld = data => {
1091 if (typeof data !== 'string') {
1092 return data;
1093 }
1094 const m = String.raw({
1095 raw: data
1096 }).match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/s);
1097 try {
1098 if (m) {
1099 data = JSON.parse(m[1].replace(/(?:\r\n|\r|\n)/g, ''));
1100 } else {
1101 data = JSON.parse(data);
1102 }
1103 } catch (e) {
1104 data = {};
1105 }
1106 return data;
1107 };
1108
1109 // status 0: hide, 1: show
1110 const lpShowHideEl = (el, status = 0) => {
1111 if (!el) {
1112 return;
1113 }
1114 if (!status) {
1115 el.classList.add(lpClassName.hidden);
1116 } else {
1117 el.classList.remove(lpClassName.hidden);
1118 }
1119 };
1120
1121 // status 0: hide, 1: show
1122 const lpSetLoadingEl = (el, status) => {
1123 if (!el) {
1124 return;
1125 }
1126 if (!status) {
1127 el.classList.remove(lpClassName.loading);
1128 } else {
1129 el.classList.add(lpClassName.loading);
1130 }
1131 };
1132
1133 // Toggle collapse section
1134 const toggleCollapse = (e, target, elTriggerClassName = '', elsExclude = [], callback) => {
1135 if (!elTriggerClassName) {
1136 elTriggerClassName = lpClassName.elTriggerToggle;
1137 }
1138
1139 // Exclude elements, which should not trigger the collapse toggle
1140 if (elsExclude && elsExclude.length > 0) {
1141 for (const elExclude of elsExclude) {
1142 if (target.closest(elExclude)) {
1143 return;
1144 }
1145 }
1146 }
1147 const elTrigger = target.closest(elTriggerClassName);
1148 if (!elTrigger) {
1149 return;
1150 }
1151
1152 //console.log( 'elTrigger', elTrigger );
1153
1154 const elSectionToggle = elTrigger.closest(`${lpClassName.elSectionToggle}`);
1155 if (!elSectionToggle) {
1156 return;
1157 }
1158 elSectionToggle.classList.toggle(`${lpClassName.elCollapse}`);
1159 if ('function' === typeof callback) {
1160 callback(elSectionToggle);
1161 }
1162 };
1163
1164 // Get data of form
1165 const getDataOfForm = form => {
1166 const dataSend = {};
1167 const formData = new FormData(form);
1168 for (const pair of formData.entries()) {
1169 const key = pair[0];
1170 const value = formData.getAll(key);
1171 if (!dataSend.hasOwnProperty(key)) {
1172 // Convert value array to string.
1173 dataSend[key] = value.join(',');
1174 }
1175 }
1176 return dataSend;
1177 };
1178
1179 // Get field keys of form
1180 const getFieldKeysOfForm = form => {
1181 const keys = [];
1182 const elements = form.elements;
1183 for (let i = 0; i < elements.length; i++) {
1184 const name = elements[i].name;
1185 if (name && !keys.includes(name)) {
1186 keys.push(name);
1187 }
1188 }
1189 return keys;
1190 };
1191
1192 // Merge data handle with data form.
1193 const mergeDataWithDatForm = (elForm, dataHandle) => {
1194 const dataForm = getDataOfForm(elForm);
1195 const keys = getFieldKeysOfForm(elForm);
1196 keys.forEach(key => {
1197 if (!dataForm.hasOwnProperty(key)) {
1198 delete dataHandle[key];
1199 } else if (dataForm[key][0] === '') {
1200 delete dataForm[key];
1201 delete dataHandle[key];
1202 }
1203 });
1204 dataHandle = {
1205 ...dataHandle,
1206 ...dataForm
1207 };
1208 return dataHandle;
1209 };
1210
1211 /**
1212 * Event trigger
1213 * For each list of event handlers, listen event on document.
1214 *
1215 * eventName: 'click', 'change', ...
1216 * eventHandlers = [ { selector: '.lp-button', callBack: function(){}, class: object } ]
1217 *
1218 * @param eventName
1219 * @param eventHandlers
1220 */
1221 const eventHandlers = (eventName, eventHandlers) => {
1222 document.addEventListener(eventName, e => {
1223 const target = e.target;
1224 let args = {
1225 e,
1226 target
1227 };
1228 eventHandlers.forEach(eventHandler => {
1229 args = {
1230 ...args,
1231 ...eventHandler
1232 };
1233
1234 //console.log( args );
1235
1236 // Check condition before call back
1237 if (eventHandler.conditionBeforeCallBack) {
1238 if (eventHandler.conditionBeforeCallBack(args) !== true) {
1239 return;
1240 }
1241 }
1242
1243 // Special check for keydown event with checkIsEventEnter = true
1244 if (eventName === 'keydown' && eventHandler.checkIsEventEnter) {
1245 if (e.key !== 'Enter') {
1246 return;
1247 }
1248 }
1249 if (target.closest(eventHandler.selector)) {
1250 if (eventHandler.class) {
1251 // Call method of class, function callBack will understand exactly {this} is class object.
1252 eventHandler.class[eventHandler.callBack](args);
1253 } else {
1254 // For send args is objected, {this} is eventHandler object, not class object.
1255 eventHandler.callBack(args);
1256 }
1257 }
1258 });
1259 });
1260 };
1261
1262 /**
1263 * Debounce - delays function execution until after `wait` ms of inactivity.
1264 *
1265 * Each call resets the timer. Only the last call in a burst executes.
1266 *
1267 * USE CASES:
1268 * - Search inputs, form validation, window resize
1269 * - Multiple elements need independent timers
1270 * - When you need to call with different arguments
1271 *
1272 * EXAMPLES:
1273 * const debouncedSearch = debounce( (query) => fetchResults(query), 300 );
1274 * searchInput.addEventListener('input', (e) => debouncedSearch(e.target.value));
1275 *
1276 * const debouncedResize = debounce( recalculateLayout, 250 );
1277 * window.addEventListener('resize', debouncedResize);
1278 *
1279 * ⚠️ Create ONCE outside event handlers, not inside.
1280 *
1281 * @param {Function} func - Function to debounce (can be anonymous)
1282 * @param {number} wait - Milliseconds to wait (default: 500)
1283 * @return {Function} Debounced wrapper function
1284 * @since 4.3.7
1285 * @version 1.0.0
1286 */
1287 const debounce = (func, wait = 500) => {
1288 let timer;
1289 return args => {
1290 clearTimeout(timer);
1291 timer = setTimeout(() => func(args), wait);
1292 };
1293 };
1294
1295 /***/ },
1296
1297 /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css"
1298 /*!*****************************************************************************************!*\
1299 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css ***!
1300 \*****************************************************************************************/
1301 (module, __webpack_exports__, __webpack_require__) {
1302
1303 "use strict";
1304 __webpack_require__.r(__webpack_exports__);
1305 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1306 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1307 /* harmony export */ });
1308 /* harmony import */ var _css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
1309 /* harmony import */ var _css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
1310 /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
1311 /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
1312 // Imports
1313
1314
1315 var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
1316 // Module
1317 ___CSS_LOADER_EXPORT___.push([module.id, `/*!
1318 * Toastify js 1.12.0
1319 * https://github.com/apvarun/toastify-js
1320 * @license MIT licensed
1321 *
1322 * Copyright (C) 2018 Varun A P
1323 */
1324
1325 .toastify {
1326 padding: 12px 20px;
1327 color: #ffffff;
1328 display: inline-block;
1329 box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3);
1330 background: -webkit-linear-gradient(315deg, #73a5ff, #5477f5);
1331 background: linear-gradient(135deg, #73a5ff, #5477f5);
1332 position: fixed;
1333 opacity: 0;
1334 transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
1335 border-radius: 2px;
1336 cursor: pointer;
1337 text-decoration: none;
1338 max-width: calc(50% - 20px);
1339 z-index: 2147483647;
1340 }
1341
1342 .toastify.on {
1343 opacity: 1;
1344 }
1345
1346 .toast-close {
1347 background: transparent;
1348 border: 0;
1349 color: white;
1350 cursor: pointer;
1351 font-family: inherit;
1352 font-size: 1em;
1353 opacity: 0.4;
1354 padding: 0 5px;
1355 }
1356
1357 .toastify-right {
1358 right: 15px;
1359 }
1360
1361 .toastify-left {
1362 left: 15px;
1363 }
1364
1365 .toastify-top {
1366 top: -150px;
1367 }
1368
1369 .toastify-bottom {
1370 bottom: -150px;
1371 }
1372
1373 .toastify-rounded {
1374 border-radius: 25px;
1375 }
1376
1377 .toastify-avatar {
1378 width: 1.5em;
1379 height: 1.5em;
1380 margin: -7px 5px;
1381 border-radius: 2px;
1382 }
1383
1384 .toastify-center {
1385 margin-left: auto;
1386 margin-right: auto;
1387 left: 0;
1388 right: 0;
1389 max-width: fit-content;
1390 max-width: -moz-fit-content;
1391 }
1392
1393 @media only screen and (max-width: 360px) {
1394 .toastify-right, .toastify-left {
1395 margin-left: auto;
1396 margin-right: auto;
1397 left: 0;
1398 right: 0;
1399 max-width: fit-content;
1400 }
1401 }
1402 `, "",{"version":3,"sources":["webpack://./node_modules/toastify-js/src/toastify.css"],"names":[],"mappings":"AAAA;;;;;;EAME;;AAEF;IACI,kBAAkB;IAClB,cAAc;IACd,qBAAqB;IACrB,uFAAuF;IACvF,6DAA6D;IAC7D,qDAAqD;IACrD,eAAe;IACf,UAAU;IACV,wDAAwD;IACxD,kBAAkB;IAClB,eAAe;IACf,qBAAqB;IACrB,2BAA2B;IAC3B,mBAAmB;AACvB;;AAEA;IACI,UAAU;AACd;;AAEA;IACI,uBAAuB;IACvB,SAAS;IACT,YAAY;IACZ,eAAe;IACf,oBAAoB;IACpB,cAAc;IACd,YAAY;IACZ,cAAc;AAClB;;AAEA;IACI,WAAW;AACf;;AAEA;IACI,UAAU;AACd;;AAEA;IACI,WAAW;AACf;;AAEA;IACI,cAAc;AAClB;;AAEA;IACI,mBAAmB;AACvB;;AAEA;IACI,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,kBAAkB;AACtB;;AAEA;IACI,iBAAiB;IACjB,kBAAkB;IAClB,OAAO;IACP,QAAQ;IACR,sBAAsB;IACtB,2BAA2B;AAC/B;;AAEA;IACI;QACI,iBAAiB;QACjB,kBAAkB;QAClB,OAAO;QACP,QAAQ;QACR,sBAAsB;IAC1B;AACJ","sourcesContent":["/*!\n * Toastify js 1.12.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n\n.toastify {\n padding: 12px 20px;\n color: #ffffff;\n display: inline-block;\n box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3);\n background: -webkit-linear-gradient(315deg, #73a5ff, #5477f5);\n background: linear-gradient(135deg, #73a5ff, #5477f5);\n position: fixed;\n opacity: 0;\n transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);\n border-radius: 2px;\n cursor: pointer;\n text-decoration: none;\n max-width: calc(50% - 20px);\n z-index: 2147483647;\n}\n\n.toastify.on {\n opacity: 1;\n}\n\n.toast-close {\n background: transparent;\n border: 0;\n color: white;\n cursor: pointer;\n font-family: inherit;\n font-size: 1em;\n opacity: 0.4;\n padding: 0 5px;\n}\n\n.toastify-right {\n right: 15px;\n}\n\n.toastify-left {\n left: 15px;\n}\n\n.toastify-top {\n top: -150px;\n}\n\n.toastify-bottom {\n bottom: -150px;\n}\n\n.toastify-rounded {\n border-radius: 25px;\n}\n\n.toastify-avatar {\n width: 1.5em;\n height: 1.5em;\n margin: -7px 5px;\n border-radius: 2px;\n}\n\n.toastify-center {\n margin-left: auto;\n margin-right: auto;\n left: 0;\n right: 0;\n max-width: fit-content;\n max-width: -moz-fit-content;\n}\n\n@media only screen and (max-width: 360px) {\n .toastify-right, .toastify-left {\n margin-left: auto;\n margin-right: auto;\n left: 0;\n right: 0;\n max-width: fit-content;\n }\n}\n"],"sourceRoot":""}]);
1403 // Exports
1404 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
1405
1406
1407 /***/ },
1408
1409 /***/ "./node_modules/css-loader/dist/runtime/api.js"
1410 /*!*****************************************************!*\
1411 !*** ./node_modules/css-loader/dist/runtime/api.js ***!
1412 \*****************************************************/
1413 (module) {
1414
1415 "use strict";
1416
1417
1418 /*
1419 MIT License http://www.opensource.org/licenses/mit-license.php
1420 Author Tobias Koppers @sokra
1421 */
1422 module.exports = function (cssWithMappingToString) {
1423 var list = [];
1424
1425 // return the list of modules as css string
1426 list.toString = function toString() {
1427 return this.map(function (item) {
1428 var content = "";
1429 var needLayer = typeof item[5] !== "undefined";
1430 if (item[4]) {
1431 content += "@supports (".concat(item[4], ") {");
1432 }
1433 if (item[2]) {
1434 content += "@media ".concat(item[2], " {");
1435 }
1436 if (needLayer) {
1437 content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
1438 }
1439 content += cssWithMappingToString(item);
1440 if (needLayer) {
1441 content += "}";
1442 }
1443 if (item[2]) {
1444 content += "}";
1445 }
1446 if (item[4]) {
1447 content += "}";
1448 }
1449 return content;
1450 }).join("");
1451 };
1452
1453 // import a list of modules into the list
1454 list.i = function i(modules, media, dedupe, supports, layer) {
1455 if (typeof modules === "string") {
1456 modules = [[null, modules, undefined]];
1457 }
1458 var alreadyImportedModules = {};
1459 if (dedupe) {
1460 for (var k = 0; k < this.length; k++) {
1461 var id = this[k][0];
1462 if (id != null) {
1463 alreadyImportedModules[id] = true;
1464 }
1465 }
1466 }
1467 for (var _k = 0; _k < modules.length; _k++) {
1468 var item = [].concat(modules[_k]);
1469 if (dedupe && alreadyImportedModules[item[0]]) {
1470 continue;
1471 }
1472 if (typeof layer !== "undefined") {
1473 if (typeof item[5] === "undefined") {
1474 item[5] = layer;
1475 } else {
1476 item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
1477 item[5] = layer;
1478 }
1479 }
1480 if (media) {
1481 if (!item[2]) {
1482 item[2] = media;
1483 } else {
1484 item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
1485 item[2] = media;
1486 }
1487 }
1488 if (supports) {
1489 if (!item[4]) {
1490 item[4] = "".concat(supports);
1491 } else {
1492 item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
1493 item[4] = supports;
1494 }
1495 }
1496 list.push(item);
1497 }
1498 };
1499 return list;
1500 };
1501
1502 /***/ },
1503
1504 /***/ "./node_modules/css-loader/dist/runtime/sourceMaps.js"
1505 /*!************************************************************!*\
1506 !*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***!
1507 \************************************************************/
1508 (module) {
1509
1510 "use strict";
1511
1512
1513 module.exports = function (item) {
1514 var content = item[1];
1515 var cssMapping = item[3];
1516 if (!cssMapping) {
1517 return content;
1518 }
1519 if (typeof btoa === "function") {
1520 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
1521 var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
1522 var sourceMapping = "/*# ".concat(data, " */");
1523 return [content].concat([sourceMapping]).join("\n");
1524 }
1525 return [content].join("\n");
1526 };
1527
1528 /***/ },
1529
1530 /***/ "./node_modules/toastify-js/src/toastify.css"
1531 /*!***************************************************!*\
1532 !*** ./node_modules/toastify-js/src/toastify.css ***!
1533 \***************************************************/
1534 (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1535
1536 "use strict";
1537 __webpack_require__.r(__webpack_exports__);
1538 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1539 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1540 /* harmony export */ });
1541 /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
1542 /* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
1543 /* harmony import */ var _style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
1544 /* harmony import */ var _style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
1545 /* harmony import */ var _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
1546 /* harmony import */ var _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
1547 /* harmony import */ var _style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
1548 /* harmony import */ var _style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
1549 /* harmony import */ var _style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
1550 /* harmony import */ var _style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
1551 /* harmony import */ var _style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
1552 /* harmony import */ var _style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
1553 /* harmony import */ var _css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../css-loader/dist/cjs.js!./toastify.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css");
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565 var options = {};
1566
1567 options.styleTagTransform = (_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
1568 options.setAttributes = (_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
1569
1570 options.insert = _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
1571
1572 options.domAPI = (_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
1573 options.insertStyleElement = (_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
1574
1575 var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);
1576
1577
1578
1579
1580 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _css_loader_dist_cjs_js_toastify_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
1581
1582
1583 /***/ },
1584
1585 /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"
1586 /*!****************************************************************************!*\
1587 !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
1588 \****************************************************************************/
1589 (module) {
1590
1591 "use strict";
1592
1593
1594 var stylesInDOM = [];
1595 function getIndexByIdentifier(identifier) {
1596 var result = -1;
1597 for (var i = 0; i < stylesInDOM.length; i++) {
1598 if (stylesInDOM[i].identifier === identifier) {
1599 result = i;
1600 break;
1601 }
1602 }
1603 return result;
1604 }
1605 function modulesToDom(list, options) {
1606 var idCountMap = {};
1607 var identifiers = [];
1608 for (var i = 0; i < list.length; i++) {
1609 var item = list[i];
1610 var id = options.base ? item[0] + options.base : item[0];
1611 var count = idCountMap[id] || 0;
1612 var identifier = "".concat(id, " ").concat(count);
1613 idCountMap[id] = count + 1;
1614 var indexByIdentifier = getIndexByIdentifier(identifier);
1615 var obj = {
1616 css: item[1],
1617 media: item[2],
1618 sourceMap: item[3],
1619 supports: item[4],
1620 layer: item[5]
1621 };
1622 if (indexByIdentifier !== -1) {
1623 stylesInDOM[indexByIdentifier].references++;
1624 stylesInDOM[indexByIdentifier].updater(obj);
1625 } else {
1626 var updater = addElementStyle(obj, options);
1627 options.byIndex = i;
1628 stylesInDOM.splice(i, 0, {
1629 identifier: identifier,
1630 updater: updater,
1631 references: 1
1632 });
1633 }
1634 identifiers.push(identifier);
1635 }
1636 return identifiers;
1637 }
1638 function addElementStyle(obj, options) {
1639 var api = options.domAPI(options);
1640 api.update(obj);
1641 var updater = function updater(newObj) {
1642 if (newObj) {
1643 if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
1644 return;
1645 }
1646 api.update(obj = newObj);
1647 } else {
1648 api.remove();
1649 }
1650 };
1651 return updater;
1652 }
1653 module.exports = function (list, options) {
1654 options = options || {};
1655 list = list || [];
1656 var lastIdentifiers = modulesToDom(list, options);
1657 return function update(newList) {
1658 newList = newList || [];
1659 for (var i = 0; i < lastIdentifiers.length; i++) {
1660 var identifier = lastIdentifiers[i];
1661 var index = getIndexByIdentifier(identifier);
1662 stylesInDOM[index].references--;
1663 }
1664 var newLastIdentifiers = modulesToDom(newList, options);
1665 for (var _i = 0; _i < lastIdentifiers.length; _i++) {
1666 var _identifier = lastIdentifiers[_i];
1667 var _index = getIndexByIdentifier(_identifier);
1668 if (stylesInDOM[_index].references === 0) {
1669 stylesInDOM[_index].updater();
1670 stylesInDOM.splice(_index, 1);
1671 }
1672 }
1673 lastIdentifiers = newLastIdentifiers;
1674 };
1675 };
1676
1677 /***/ },
1678
1679 /***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js"
1680 /*!********************************************************************!*\
1681 !*** ./node_modules/style-loader/dist/runtime/insertBySelector.js ***!
1682 \********************************************************************/
1683 (module) {
1684
1685 "use strict";
1686
1687
1688 var memo = {};
1689
1690 /* istanbul ignore next */
1691 function getTarget(target) {
1692 if (typeof memo[target] === "undefined") {
1693 var styleTarget = document.querySelector(target);
1694
1695 // Special case to return head of iframe instead of iframe itself
1696 if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
1697 try {
1698 // This will throw an exception if access to iframe is blocked
1699 // due to cross-origin restrictions
1700 styleTarget = styleTarget.contentDocument.head;
1701 } catch (e) {
1702 // istanbul ignore next
1703 styleTarget = null;
1704 }
1705 }
1706 memo[target] = styleTarget;
1707 }
1708 return memo[target];
1709 }
1710
1711 /* istanbul ignore next */
1712 function insertBySelector(insert, style) {
1713 var target = getTarget(insert);
1714 if (!target) {
1715 throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
1716 }
1717 target.appendChild(style);
1718 }
1719 module.exports = insertBySelector;
1720
1721 /***/ },
1722
1723 /***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js"
1724 /*!**********************************************************************!*\
1725 !*** ./node_modules/style-loader/dist/runtime/insertStyleElement.js ***!
1726 \**********************************************************************/
1727 (module) {
1728
1729 "use strict";
1730
1731
1732 /* istanbul ignore next */
1733 function insertStyleElement(options) {
1734 var element = document.createElement("style");
1735 options.setAttributes(element, options.attributes);
1736 options.insert(element, options.options);
1737 return element;
1738 }
1739 module.exports = insertStyleElement;
1740
1741 /***/ },
1742
1743 /***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"
1744 /*!**********************************************************************************!*\
1745 !*** ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***!
1746 \**********************************************************************************/
1747 (module, __unused_webpack_exports, __webpack_require__) {
1748
1749 "use strict";
1750
1751
1752 /* istanbul ignore next */
1753 function setAttributesWithoutAttributes(styleElement) {
1754 var nonce = true ? __webpack_require__.nc : 0;
1755 if (nonce) {
1756 styleElement.setAttribute("nonce", nonce);
1757 }
1758 }
1759 module.exports = setAttributesWithoutAttributes;
1760
1761 /***/ },
1762
1763 /***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js"
1764 /*!***************************************************************!*\
1765 !*** ./node_modules/style-loader/dist/runtime/styleDomAPI.js ***!
1766 \***************************************************************/
1767 (module) {
1768
1769 "use strict";
1770
1771
1772 /* istanbul ignore next */
1773 function apply(styleElement, options, obj) {
1774 var css = "";
1775 if (obj.supports) {
1776 css += "@supports (".concat(obj.supports, ") {");
1777 }
1778 if (obj.media) {
1779 css += "@media ".concat(obj.media, " {");
1780 }
1781 var needLayer = typeof obj.layer !== "undefined";
1782 if (needLayer) {
1783 css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
1784 }
1785 css += obj.css;
1786 if (needLayer) {
1787 css += "}";
1788 }
1789 if (obj.media) {
1790 css += "}";
1791 }
1792 if (obj.supports) {
1793 css += "}";
1794 }
1795 var sourceMap = obj.sourceMap;
1796 if (sourceMap && typeof btoa !== "undefined") {
1797 css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
1798 }
1799
1800 // For old IE
1801 /* istanbul ignore if */
1802 options.styleTagTransform(css, styleElement, options.options);
1803 }
1804 function removeStyleElement(styleElement) {
1805 // istanbul ignore if
1806 if (styleElement.parentNode === null) {
1807 return false;
1808 }
1809 styleElement.parentNode.removeChild(styleElement);
1810 }
1811
1812 /* istanbul ignore next */
1813 function domAPI(options) {
1814 if (typeof document === "undefined") {
1815 return {
1816 update: function update() {},
1817 remove: function remove() {}
1818 };
1819 }
1820 var styleElement = options.insertStyleElement(options);
1821 return {
1822 update: function update(obj) {
1823 apply(styleElement, options, obj);
1824 },
1825 remove: function remove() {
1826 removeStyleElement(styleElement);
1827 }
1828 };
1829 }
1830 module.exports = domAPI;
1831
1832 /***/ },
1833
1834 /***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js"
1835 /*!*********************************************************************!*\
1836 !*** ./node_modules/style-loader/dist/runtime/styleTagTransform.js ***!
1837 \*********************************************************************/
1838 (module) {
1839
1840 "use strict";
1841
1842
1843 /* istanbul ignore next */
1844 function styleTagTransform(css, styleElement) {
1845 if (styleElement.styleSheet) {
1846 styleElement.styleSheet.cssText = css;
1847 } else {
1848 while (styleElement.firstChild) {
1849 styleElement.removeChild(styleElement.firstChild);
1850 }
1851 styleElement.appendChild(document.createTextNode(css));
1852 }
1853 }
1854 module.exports = styleTagTransform;
1855
1856 /***/ },
1857
1858 /***/ "./node_modules/toastify-js/src/toastify.js"
1859 /*!**************************************************!*\
1860 !*** ./node_modules/toastify-js/src/toastify.js ***!
1861 \**************************************************/
1862 (module) {
1863
1864 /*!
1865 * Toastify js 1.12.0
1866 * https://github.com/apvarun/toastify-js
1867 * @license MIT licensed
1868 *
1869 * Copyright (C) 2018 Varun A P
1870 */
1871 (function(root, factory) {
1872 if ( true && module.exports) {
1873 module.exports = factory();
1874 } else {
1875 root.Toastify = factory();
1876 }
1877 })(this, function(global) {
1878 // Object initialization
1879 var Toastify = function(options) {
1880 // Returning a new init object
1881 return new Toastify.lib.init(options);
1882 },
1883 // Library version
1884 version = "1.12.0";
1885
1886 // Set the default global options
1887 Toastify.defaults = {
1888 oldestFirst: true,
1889 text: "Toastify is awesome!",
1890 node: undefined,
1891 duration: 3000,
1892 selector: undefined,
1893 callback: function () {
1894 },
1895 destination: undefined,
1896 newWindow: false,
1897 close: false,
1898 gravity: "toastify-top",
1899 positionLeft: false,
1900 position: '',
1901 backgroundColor: '',
1902 avatar: "",
1903 className: "",
1904 stopOnFocus: true,
1905 onClick: function () {
1906 },
1907 offset: {x: 0, y: 0},
1908 escapeMarkup: true,
1909 ariaLive: 'polite',
1910 style: {background: ''}
1911 };
1912
1913 // Defining the prototype of the object
1914 Toastify.lib = Toastify.prototype = {
1915 toastify: version,
1916
1917 constructor: Toastify,
1918
1919 // Initializing the object with required parameters
1920 init: function(options) {
1921 // Verifying and validating the input object
1922 if (!options) {
1923 options = {};
1924 }
1925
1926 // Creating the options object
1927 this.options = {};
1928
1929 this.toastElement = null;
1930
1931 // Validating the options
1932 this.options.text = options.text || Toastify.defaults.text; // Display message
1933 this.options.node = options.node || Toastify.defaults.node; // Display content as node
1934 this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration
1935 this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector
1936 this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display
1937 this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination
1938 this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window
1939 this.options.close = options.close || Toastify.defaults.close; // Show toast close icon
1940 this.options.gravity = options.gravity === "bottom" ? "toastify-bottom" : Toastify.defaults.gravity; // toast position - top or bottom
1941 this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right
1942 this.options.position = options.position || Toastify.defaults.position; // toast position - left or right
1943 this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color
1944 this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path
1945 this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast
1946 this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus
1947 this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click
1948 this.options.offset = options.offset || Toastify.defaults.offset; // toast offset
1949 this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;
1950 this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;
1951 this.options.style = options.style || Toastify.defaults.style;
1952 if(options.backgroundColor) {
1953 this.options.style.background = options.backgroundColor;
1954 }
1955
1956 // Returning the current object for chaining functions
1957 return this;
1958 },
1959
1960 // Building the DOM element
1961 buildToast: function() {
1962 // Validating if the options are defined
1963 if (!this.options) {
1964 throw "Toastify is not initialized";
1965 }
1966
1967 // Creating the DOM object
1968 var divElement = document.createElement("div");
1969 divElement.className = "toastify on " + this.options.className;
1970
1971 // Positioning toast to left or right or center
1972 if (!!this.options.position) {
1973 divElement.className += " toastify-" + this.options.position;
1974 } else {
1975 // To be depreciated in further versions
1976 if (this.options.positionLeft === true) {
1977 divElement.className += " toastify-left";
1978 console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.')
1979 } else {
1980 // Default position
1981 divElement.className += " toastify-right";
1982 }
1983 }
1984
1985 // Assigning gravity of element
1986 divElement.className += " " + this.options.gravity;
1987
1988 if (this.options.backgroundColor) {
1989 // This is being deprecated in favor of using the style HTML DOM property
1990 console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');
1991 }
1992
1993 // Loop through our style object and apply styles to divElement
1994 for (var property in this.options.style) {
1995 divElement.style[property] = this.options.style[property];
1996 }
1997
1998 // Announce the toast to screen readers
1999 if (this.options.ariaLive) {
2000 divElement.setAttribute('aria-live', this.options.ariaLive)
2001 }
2002
2003 // Adding the toast message/node
2004 if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {
2005 // If we have a valid node, we insert it
2006 divElement.appendChild(this.options.node)
2007 } else {
2008 if (this.options.escapeMarkup) {
2009 divElement.innerText = this.options.text;
2010 } else {
2011 divElement.innerHTML = this.options.text;
2012 }
2013
2014 if (this.options.avatar !== "") {
2015 var avatarElement = document.createElement("img");
2016 avatarElement.src = this.options.avatar;
2017
2018 avatarElement.className = "toastify-avatar";
2019
2020 if (this.options.position == "left" || this.options.positionLeft === true) {
2021 // Adding close icon on the left of content
2022 divElement.appendChild(avatarElement);
2023 } else {
2024 // Adding close icon on the right of content
2025 divElement.insertAdjacentElement("afterbegin", avatarElement);
2026 }
2027 }
2028 }
2029
2030 // Adding a close icon to the toast
2031 if (this.options.close === true) {
2032 // Create a span for close element
2033 var closeElement = document.createElement("button");
2034 closeElement.type = "button";
2035 closeElement.setAttribute("aria-label", "Close");
2036 closeElement.className = "toast-close";
2037 closeElement.innerHTML = "&#10006;";
2038
2039 // Triggering the removal of toast from DOM on close click
2040 closeElement.addEventListener(
2041 "click",
2042 function(event) {
2043 event.stopPropagation();
2044 this.removeElement(this.toastElement);
2045 window.clearTimeout(this.toastElement.timeOutValue);
2046 }.bind(this)
2047 );
2048
2049 //Calculating screen width
2050 var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
2051
2052 // Adding the close icon to the toast element
2053 // Display on the right if screen width is less than or equal to 360px
2054 if ((this.options.position == "left" || this.options.positionLeft === true) && width > 360) {
2055 // Adding close icon on the left of content
2056 divElement.insertAdjacentElement("afterbegin", closeElement);
2057 } else {
2058 // Adding close icon on the right of content
2059 divElement.appendChild(closeElement);
2060 }
2061 }
2062
2063 // Clear timeout while toast is focused
2064 if (this.options.stopOnFocus && this.options.duration > 0) {
2065 var self = this;
2066 // stop countdown
2067 divElement.addEventListener(
2068 "mouseover",
2069 function(event) {
2070 window.clearTimeout(divElement.timeOutValue);
2071 }
2072 )
2073 // add back the timeout
2074 divElement.addEventListener(
2075 "mouseleave",
2076 function() {
2077 divElement.timeOutValue = window.setTimeout(
2078 function() {
2079 // Remove the toast from DOM
2080 self.removeElement(divElement);
2081 },
2082 self.options.duration
2083 )
2084 }
2085 )
2086 }
2087
2088 // Adding an on-click destination path
2089 if (typeof this.options.destination !== "undefined") {
2090 divElement.addEventListener(
2091 "click",
2092 function(event) {
2093 event.stopPropagation();
2094 if (this.options.newWindow === true) {
2095 window.open(this.options.destination, "_blank");
2096 } else {
2097 window.location = this.options.destination;
2098 }
2099 }.bind(this)
2100 );
2101 }
2102
2103 if (typeof this.options.onClick === "function" && typeof this.options.destination === "undefined") {
2104 divElement.addEventListener(
2105 "click",
2106 function(event) {
2107 event.stopPropagation();
2108 this.options.onClick();
2109 }.bind(this)
2110 );
2111 }
2112
2113 // Adding offset
2114 if(typeof this.options.offset === "object") {
2115
2116 var x = getAxisOffsetAValue("x", this.options);
2117 var y = getAxisOffsetAValue("y", this.options);
2118
2119 var xOffset = this.options.position == "left" ? x : "-" + x;
2120 var yOffset = this.options.gravity == "toastify-top" ? y : "-" + y;
2121
2122 divElement.style.transform = "translate(" + xOffset + "," + yOffset + ")";
2123
2124 }
2125
2126 // Returning the generated element
2127 return divElement;
2128 },
2129
2130 // Displaying the toast
2131 showToast: function() {
2132 // Creating the DOM object for the toast
2133 this.toastElement = this.buildToast();
2134
2135 // Getting the root element to with the toast needs to be added
2136 var rootElement;
2137 if (typeof this.options.selector === "string") {
2138 rootElement = document.getElementById(this.options.selector);
2139 } else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) {
2140 rootElement = this.options.selector;
2141 } else {
2142 rootElement = document.body;
2143 }
2144
2145 // Validating if root element is present in DOM
2146 if (!rootElement) {
2147 throw "Root element is not defined";
2148 }
2149
2150 // Adding the DOM element
2151 var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;
2152 rootElement.insertBefore(this.toastElement, elementToInsert);
2153
2154 // Repositioning the toasts in case multiple toasts are present
2155 Toastify.reposition();
2156
2157 if (this.options.duration > 0) {
2158 this.toastElement.timeOutValue = window.setTimeout(
2159 function() {
2160 // Remove the toast from DOM
2161 this.removeElement(this.toastElement);
2162 }.bind(this),
2163 this.options.duration
2164 ); // Binding `this` for function invocation
2165 }
2166
2167 // Supporting function chaining
2168 return this;
2169 },
2170
2171 hideToast: function() {
2172 if (this.toastElement.timeOutValue) {
2173 clearTimeout(this.toastElement.timeOutValue);
2174 }
2175 this.removeElement(this.toastElement);
2176 },
2177
2178 // Removing the element from the DOM
2179 removeElement: function(toastElement) {
2180 // Hiding the element
2181 // toastElement.classList.remove("on");
2182 toastElement.className = toastElement.className.replace(" on", "");
2183
2184 // Removing the element from DOM after transition end
2185 window.setTimeout(
2186 function() {
2187 // remove options node if any
2188 if (this.options.node && this.options.node.parentNode) {
2189 this.options.node.parentNode.removeChild(this.options.node);
2190 }
2191
2192 // Remove the element from the DOM, only when the parent node was not removed before.
2193 if (toastElement.parentNode) {
2194 toastElement.parentNode.removeChild(toastElement);
2195 }
2196
2197 // Calling the callback function
2198 this.options.callback.call(toastElement);
2199
2200 // Repositioning the toasts again
2201 Toastify.reposition();
2202 }.bind(this),
2203 400
2204 ); // Binding `this` for function invocation
2205 },
2206 };
2207
2208 // Positioning the toasts on the DOM
2209 Toastify.reposition = function() {
2210
2211 // Top margins with gravity
2212 var topLeftOffsetSize = {
2213 top: 15,
2214 bottom: 15,
2215 };
2216 var topRightOffsetSize = {
2217 top: 15,
2218 bottom: 15,
2219 };
2220 var offsetSize = {
2221 top: 15,
2222 bottom: 15,
2223 };
2224
2225 // Get all toast messages on the DOM
2226 var allToasts = document.getElementsByClassName("toastify");
2227
2228 var classUsed;
2229
2230 // Modifying the position of each toast element
2231 for (var i = 0; i < allToasts.length; i++) {
2232 // Getting the applied gravity
2233 if (containsClass(allToasts[i], "toastify-top") === true) {
2234 classUsed = "toastify-top";
2235 } else {
2236 classUsed = "toastify-bottom";
2237 }
2238
2239 var height = allToasts[i].offsetHeight;
2240 classUsed = classUsed.substr(9, classUsed.length-1)
2241 // Spacing between toasts
2242 var offset = 15;
2243
2244 var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
2245
2246 // Show toast in center if screen with less than or equal to 360px
2247 if (width <= 360) {
2248 // Setting the position
2249 allToasts[i].style[classUsed] = offsetSize[classUsed] + "px";
2250
2251 offsetSize[classUsed] += height + offset;
2252 } else {
2253 if (containsClass(allToasts[i], "toastify-left") === true) {
2254 // Setting the position
2255 allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + "px";
2256
2257 topLeftOffsetSize[classUsed] += height + offset;
2258 } else {
2259 // Setting the position
2260 allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + "px";
2261
2262 topRightOffsetSize[classUsed] += height + offset;
2263 }
2264 }
2265 }
2266
2267 // Supporting function chaining
2268 return this;
2269 };
2270
2271 // Helper function to get offset.
2272 function getAxisOffsetAValue(axis, options) {
2273
2274 if(options.offset[axis]) {
2275 if(isNaN(options.offset[axis])) {
2276 return options.offset[axis];
2277 }
2278 else {
2279 return options.offset[axis] + 'px';
2280 }
2281 }
2282
2283 return '0px';
2284
2285 }
2286
2287 function containsClass(elem, yourClass) {
2288 if (!elem || typeof yourClass !== "string") {
2289 return false;
2290 } else if (
2291 elem.className &&
2292 elem.className
2293 .trim()
2294 .split(/\s+/gi)
2295 .indexOf(yourClass) > -1
2296 ) {
2297 return true;
2298 } else {
2299 return false;
2300 }
2301 }
2302
2303 // Setting up the prototype for the init object
2304 Toastify.lib.init.prototype = Toastify.lib;
2305
2306 // Returning the Toastify function to be assigned to the window object/module
2307 return Toastify;
2308 });
2309
2310
2311 /***/ },
2312
2313 /***/ "react"
2314 /*!************************!*\
2315 !*** external "React" ***!
2316 \************************/
2317 (module) {
2318
2319 "use strict";
2320 module.exports = window["React"];
2321
2322 /***/ },
2323
2324 /***/ "@learnpress/quiz"
2325 /*!******************************!*\
2326 !*** external ["LP","quiz"] ***!
2327 \******************************/
2328 (module) {
2329
2330 "use strict";
2331 module.exports = window["LP"]["quiz"];
2332
2333 /***/ },
2334
2335 /***/ "@wordpress/element"
2336 /*!*********************************!*\
2337 !*** external ["wp","element"] ***!
2338 \*********************************/
2339 (module) {
2340
2341 "use strict";
2342 module.exports = window["wp"]["element"];
2343
2344 /***/ },
2345
2346 /***/ "@wordpress/url"
2347 /*!*****************************!*\
2348 !*** external ["wp","url"] ***!
2349 \*****************************/
2350 (module) {
2351
2352 "use strict";
2353 module.exports = window["wp"]["url"];
2354
2355 /***/ }
2356
2357 /******/ });
2358 /************************************************************************/
2359 /******/ // The module cache
2360 /******/ var __webpack_module_cache__ = {};
2361 /******/
2362 /******/ // The require function
2363 /******/ function __webpack_require__(moduleId) {
2364 /******/ // Check if module is in cache
2365 /******/ var cachedModule = __webpack_module_cache__[moduleId];
2366 /******/ if (cachedModule !== undefined) {
2367 /******/ return cachedModule.exports;
2368 /******/ }
2369 /******/ // Create a new module (and put it into the cache)
2370 /******/ var module = __webpack_module_cache__[moduleId] = {
2371 /******/ id: moduleId,
2372 /******/ // no module.loaded needed
2373 /******/ exports: {}
2374 /******/ };
2375 /******/
2376 /******/ // Execute the module function
2377 /******/ if (!(moduleId in __webpack_modules__)) {
2378 /******/ delete __webpack_module_cache__[moduleId];
2379 /******/ var e = new Error("Cannot find module '" + moduleId + "'");
2380 /******/ e.code = 'MODULE_NOT_FOUND';
2381 /******/ throw e;
2382 /******/ }
2383 /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
2384 /******/
2385 /******/ // Return the exports of the module
2386 /******/ return module.exports;
2387 /******/ }
2388 /******/
2389 /************************************************************************/
2390 /******/ /* webpack/runtime/compat get default export */
2391 /******/ (() => {
2392 /******/ // getDefaultExport function for compatibility with non-harmony modules
2393 /******/ __webpack_require__.n = (module) => {
2394 /******/ var getter = module && module.__esModule ?
2395 /******/ () => (module['default']) :
2396 /******/ () => (module);
2397 /******/ __webpack_require__.d(getter, { a: getter });
2398 /******/ return getter;
2399 /******/ };
2400 /******/ })();
2401 /******/
2402 /******/ /* webpack/runtime/define property getters */
2403 /******/ (() => {
2404 /******/ // define getter functions for harmony exports
2405 /******/ __webpack_require__.d = (exports, definition) => {
2406 /******/ for(var key in definition) {
2407 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
2408 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
2409 /******/ }
2410 /******/ }
2411 /******/ };
2412 /******/ })();
2413 /******/
2414 /******/ /* webpack/runtime/hasOwnProperty shorthand */
2415 /******/ (() => {
2416 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
2417 /******/ })();
2418 /******/
2419 /******/ /* webpack/runtime/make namespace object */
2420 /******/ (() => {
2421 /******/ // define __esModule on exports
2422 /******/ __webpack_require__.r = (exports) => {
2423 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2424 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2425 /******/ }
2426 /******/ Object.defineProperty(exports, '__esModule', { value: true });
2427 /******/ };
2428 /******/ })();
2429 /******/
2430 /******/ /* webpack/runtime/nonce */
2431 /******/ (() => {
2432 /******/ __webpack_require__.nc = undefined;
2433 /******/ })();
2434 /******/
2435 /************************************************************************/
2436 var __webpack_exports__ = {};
2437 // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
2438 (() => {
2439 "use strict";
2440 /*!******************************************************!*\
2441 !*** ./assets/src/apps/js/frontend/single-course.js ***!
2442 \******************************************************/
2443 __webpack_require__.r(__webpack_exports__);
2444 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2445 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
2446 /* harmony export */ enrollCourse: () => (/* binding */ enrollCourse),
2447 /* harmony export */ init: () => (/* binding */ init),
2448 /* harmony export */ initCourseSidebar: () => (/* binding */ initCourseSidebar),
2449 /* harmony export */ initCourseTabs: () => (/* binding */ initCourseTabs)
2450 /* harmony export */ });
2451 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2452 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2453 /* harmony import */ var _single_course_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./single-course/index */ "./assets/src/apps/js/frontend/single-course/index.js");
2454 /* harmony import */ var _show_lp_overlay_complete_item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./show-lp-overlay-complete-item */ "./assets/src/apps/js/frontend/show-lp-overlay-complete-item.js");
2455 /* harmony import */ var _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/lp-modal-overlay */ "./assets/src/apps/js/utils/lp-modal-overlay.js");
2456 /* harmony import */ var _single_curriculum_skeleton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./single-curriculum/skeleton */ "./assets/src/apps/js/frontend/single-curriculum/skeleton.js");
2457 /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./material */ "./assets/src/apps/js/frontend/material.js");
2458 /* harmony import */ var _tabs_scroll__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tabs-scroll */ "./assets/src/apps/js/frontend/tabs-scroll.js");
2459 /* harmony import */ var _js_utils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../js/utils.js */ "./assets/src/js/utils.js");
2460 /* harmony import */ var toastify_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! toastify-js */ "./node_modules/toastify-js/src/toastify.js");
2461 /* harmony import */ var toastify_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(toastify_js__WEBPACK_IMPORTED_MODULE_8__);
2462 /* harmony import */ var toastify_js_src_toastify_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! toastify-js/src/toastify.css */ "./node_modules/toastify-js/src/toastify.css");
2463 /* harmony import */ var _js_frontend_copy_to_clipboard_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../js/frontend/copy-to-clipboard.js */ "./assets/src/js/frontend/copy-to-clipboard.js");
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_single_course_index__WEBPACK_IMPORTED_MODULE_1__["default"]);
2476 const init = () => {
2477 wp.element.render((0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_single_course_index__WEBPACK_IMPORTED_MODULE_1__["default"], null));
2478 };
2479 const $ = jQuery;
2480 const initCourseTabs = function () {
2481 $('#learn-press-course-tabs').on('change', 'input[name="learn-press-course-tab-radio"]', function (e) {
2482 const selectedTab = $('input[name="learn-press-course-tab-radio"]:checked').val();
2483 LP.Cookies.set('course-tab', selectedTab);
2484 $('label[for="' + $(e.target).attr('id') + '"]').closest('li').addClass('active').siblings().removeClass('active');
2485 });
2486 };
2487 const initCourseSidebar = function initCourseSidebar() {
2488 const $sidebar = $('.course-summary-sidebar');
2489 if (!$sidebar.length) {
2490 return;
2491 }
2492 const $window = $(window);
2493 const $scrollable = $sidebar.children();
2494 const offset = $sidebar.offset();
2495 let scrollTop = 0;
2496 const maxHeight = $sidebar.height();
2497 const scrollHeight = $scrollable.height();
2498 const options = {
2499 offsetTop: 32
2500 };
2501 const onScroll = function () {
2502 scrollTop = $window.scrollTop();
2503 const top = scrollTop - offset.top + options.offsetTop;
2504 if (top < 0) {
2505 $sidebar.removeClass('slide-top slide-down');
2506 $scrollable.css('top', '');
2507 return;
2508 }
2509 if (top > maxHeight - scrollHeight) {
2510 $sidebar.removeClass('slide-down').addClass('slide-top');
2511 $scrollable.css('top', maxHeight - scrollHeight);
2512 } else {
2513 $sidebar.removeClass('slide-top').addClass('slide-down');
2514 $scrollable.css('top', options.offsetTop);
2515 }
2516 };
2517 $window.on('scroll.fixed-course-sidebar', onScroll).trigger('scroll.fixed-course-sidebar');
2518 };
2519
2520 // Rest API Enroll course - Nhamdv.
2521 const enrollCourse = () => {
2522 const formEnrolls = document.querySelectorAll('form.enroll-course');
2523 if (formEnrolls.length > 0) {
2524 formEnrolls.forEach(formEnroll => {
2525 const submit = async (id, btnEnroll) => {
2526 const status = 'error';
2527 try {
2528 const response = await wp.apiFetch({
2529 path: 'lp/v1/courses/enroll-course',
2530 method: 'POST',
2531 data: {
2532 id
2533 }
2534 });
2535 const {
2536 status,
2537 data: {
2538 redirect
2539 },
2540 message
2541 } = response;
2542 if (status === 'success') {
2543 btnEnroll.remove();
2544 } else {
2545 (0,_js_utils_js__WEBPACK_IMPORTED_MODULE_7__.lpSetLoadingEl)(btnEnroll, 0);
2546 throw new Error(message);
2547 }
2548 if (message && status) {
2549 formEnroll.innerHTML += `<div class="learn-press-message ${status}">${message}</div>`;
2550 if (redirect) {
2551 window.location.href = redirect;
2552 }
2553 }
2554 } catch (error) {
2555 toastify_js__WEBPACK_IMPORTED_MODULE_8___default()({
2556 text: error.message,
2557 gravity: lpData.toast.gravity,
2558 // `top` or `bottom`
2559 position: lpData.toast.position,
2560 // `left`, `center` or `right`
2561 className: `${lpData.toast.classPrefix} ${status}`,
2562 close: lpData.toast.close == 1,
2563 stopOnFocus: lpData.toast.stopOnFocus == 1,
2564 duration: lpData.toast.duration
2565 }).showToast();
2566 }
2567 };
2568 formEnroll.addEventListener('submit', event => {
2569 event.preventDefault();
2570 const id = formEnroll.querySelector('input[name=enroll-course]').value;
2571 const btnEnroll = formEnroll.querySelector('button.button-enroll-course');
2572 (0,_js_utils_js__WEBPACK_IMPORTED_MODULE_7__.lpSetLoadingEl)(btnEnroll, 1);
2573 submit(id, btnEnroll);
2574 });
2575 });
2576 }
2577
2578 // Reload when press back button in chrome.
2579 if (document.querySelector('.course-detail-info') !== null) {
2580 window.addEventListener('pageshow', event => {
2581 const hasCache = event.persisted || typeof window.performance != 'undefined' && String(window.performance.getEntriesByType('navigation')[0].type) == 'back_forward';
2582 if (hasCache) {
2583 location.reload();
2584 }
2585 });
2586 }
2587 };
2588
2589 // Rest API purchase course - Nhamdv.
2590 const purchaseCourse = () => {
2591 const forms = document.querySelectorAll('form.purchase-course');
2592 if (forms.length > 0) {
2593 forms.forEach(form => {
2594 // Allow Repurchase.
2595 const allowRepurchase = () => {
2596 const continueRepurchases = document.querySelectorAll('.lp_allow_repurchase_select');
2597 continueRepurchases.forEach(repurchase => {
2598 const radios = repurchase.querySelectorAll('[name=_lp_allow_repurchase_type]');
2599 for (let i = 0, length = radios.length; i < length; i++) {
2600 if (radios[i].checked) {
2601 const repurchaseType = radios[i].value;
2602 const id = form.querySelector('input[name=purchase-course]').value;
2603 const btnBuyNow = form.querySelector('button.button-purchase-course');
2604 (0,_js_utils_js__WEBPACK_IMPORTED_MODULE_7__.lpSetLoadingEl)(btnBuyNow, 1);
2605 submit(id, btnBuyNow, repurchaseType);
2606 break;
2607 }
2608 }
2609 });
2610 };
2611 const submit = async (id, btn, repurchaseType = false) => {
2612 const status = 'error';
2613 try {
2614 const formData = new FormData(form);
2615 const dataSend = Object.fromEntries(Array.from(formData.keys(), key => {
2616 const val = formData.getAll(key);
2617 return [key, val.length > 1 ? val : val.pop()];
2618 }));
2619 dataSend.id = id;
2620 dataSend.repurchaseType = repurchaseType;
2621 const response = await wp.apiFetch({
2622 path: 'lp/v1/courses/purchase-course',
2623 method: 'POST',
2624 data: dataSend
2625 });
2626 const {
2627 status,
2628 data: {
2629 redirect,
2630 type,
2631 html,
2632 titlePopup
2633 },
2634 message
2635 } = response;
2636 if (status === 'success') {
2637 if (type === 'allow_repurchase') {
2638 (0,_js_utils_js__WEBPACK_IMPORTED_MODULE_7__.lpSetLoadingEl)(btn, 0);
2639 } else {
2640 btn.remove();
2641 }
2642 } else {
2643 (0,_js_utils_js__WEBPACK_IMPORTED_MODULE_7__.lpSetLoadingEl)(btn, 0);
2644 throw new Error(message);
2645 }
2646 if (type === 'allow_repurchase' && status === 'success') {
2647 if (!form.querySelector('.lp_allow_repurchase_select')) {
2648 if (!_utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_3__["default"].init()) {
2649 return;
2650 }
2651 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_3__["default"].elLPOverlay.show();
2652 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_3__["default"].setTitleModal(titlePopup || '');
2653 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_3__["default"].setContentModal(html);
2654 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_3__["default"].callBackYes = () => {
2655 _utils_lp_modal_overlay__WEBPACK_IMPORTED_MODULE_3__["default"].elLPOverlay.hide();
2656 allowRepurchase();
2657 };
2658 }
2659 } else if (message && status) {
2660 form.innerHTML += `<div class="learn-press-message ${status}">${message}</div>`;
2661 if ('success' === status && redirect) {
2662 window.location.href = redirect;
2663 }
2664 }
2665 } catch (error) {
2666 toastify_js__WEBPACK_IMPORTED_MODULE_8___default()({
2667 text: error.message,
2668 gravity: lpData.toast.gravity,
2669 // `top` or `bottom`
2670 position: lpData.toast.position,
2671 // `left`, `center` or `right`
2672 className: `${lpData.toast.classPrefix} ${status}`,
2673 close: lpData.toast.close == 1,
2674 stopOnFocus: lpData.toast.stopOnFocus == 1,
2675 duration: lpData.toast.duration
2676 }).showToast();
2677 }
2678 };
2679 form.addEventListener('submit', event => {
2680 event.preventDefault();
2681 const id = form.querySelector('input[name=purchase-course]').value;
2682 const btn = form.querySelector('button.button-purchase-course');
2683 (0,_js_utils_js__WEBPACK_IMPORTED_MODULE_7__.lpSetLoadingEl)(btn, 1);
2684 submit(id, btn);
2685 });
2686 });
2687 }
2688 };
2689 const retakeCourse = () => {
2690 const elFormRetakeCourses = document.querySelectorAll('.lp-form-retake-course');
2691 if (!elFormRetakeCourses.length) {
2692 return;
2693 }
2694 elFormRetakeCourses.forEach(elFormRetakeCourse => {
2695 const elButtonRetakeCourses = elFormRetakeCourse.querySelector('.button-retake-course');
2696 const elCourseId = elFormRetakeCourse.querySelector('[name=retake-course]').value;
2697 const elAjaxMessage = elFormRetakeCourse.querySelector('.lp-ajax-message');
2698 const submit = elButtonRetakeCourse => {
2699 wp.apiFetch({
2700 path: '/lp/v1/courses/retake-course',
2701 method: 'POST',
2702 data: {
2703 id: elCourseId
2704 }
2705 }).then(res => {
2706 const {
2707 status,
2708 message,
2709 data
2710 } = res;
2711 elAjaxMessage.innerHTML = message;
2712 if (undefined != status && status === 'success') {
2713 elButtonRetakeCourse.style.display = 'none';
2714 setTimeout(() => {
2715 window.location.replace(data.url_redirect);
2716 }, 1000);
2717 } else {
2718 elAjaxMessage.classList.add('error');
2719 }
2720 }).catch(err => {
2721 elAjaxMessage.classList.add('error');
2722 elAjaxMessage.innerHTML = 'error: ' + err.message;
2723 }).then(() => {
2724 elButtonRetakeCourse.classList.remove('loading');
2725 elButtonRetakeCourse.disabled = false;
2726 elAjaxMessage.style.display = 'block';
2727 });
2728 };
2729 elFormRetakeCourse.addEventListener('submit', e => {
2730 e.preventDefault();
2731 });
2732 elButtonRetakeCourses.addEventListener('click', e => {
2733 e.preventDefault();
2734 elButtonRetakeCourses.classList.add('loading');
2735 elButtonRetakeCourses.disabled = true;
2736 submit(elButtonRetakeCourses);
2737 });
2738 });
2739 };
2740
2741 // Rest API load content course progress - Nhamdv.
2742 /*const courseProgress = () => {
2743 const elements = document.querySelectorAll( '.lp-course-progress-wrapper' );
2744
2745 if ( ! elements.length ) {
2746 return;
2747 }
2748
2749 if ( 'IntersectionObserver' in window ) {
2750 const eleObserver = new IntersectionObserver( ( entries, observer ) => {
2751 entries.forEach( ( entry ) => {
2752 if ( entry.isIntersecting ) {
2753 const ele = entry.target;
2754
2755 setTimeout( function() {
2756 getResponse( ele );
2757 }, 600 );
2758
2759 eleObserver.unobserve( ele );
2760 }
2761 } );
2762 } );
2763
2764 [ ...elements ].map( ( ele ) => eleObserver.observe( ele ) );
2765 }
2766
2767 const getResponse = async ( ele ) => {
2768 let url = 'lp/v1/lazy-load/course-progress';
2769 if ( lpData.urlParams.hasOwnProperty( 'lang' ) ) {
2770 url += '?lang=' + lpData.urlParams.lang;
2771 }
2772
2773 const response = await wp.apiFetch( {
2774 path: url,
2775 method: 'POST',
2776 data: {
2777 courseId: lpGlobalSettings.post_id || '',
2778 userId: lpData.user_id || '',
2779 },
2780 } );
2781
2782 const { data } = response;
2783
2784 ele.innerHTML = data;
2785 };
2786 };*/
2787
2788 const accordionExtraTab = () => {
2789 const elements = document.querySelectorAll('.course-extra-box');
2790 [...elements].map(ele => {
2791 const title = ele.querySelector('.course-extra-box__title');
2792 ele.classList.remove('active');
2793 const content = ele.querySelector('.course-extra-box__content');
2794 content.style.height = '0';
2795 title.addEventListener('click', () => {
2796 const isActive = ele.classList.contains('active');
2797 [...elements].forEach(otherEle => {
2798 if (otherEle !== ele) {
2799 otherEle.classList.remove('active');
2800 otherEle.querySelector('.course-extra-box__content').style.height = '0';
2801 }
2802 });
2803 if (isActive) {
2804 ele.classList.remove('active');
2805 content.style.height = '0';
2806 } else {
2807 ele.classList.add('active');
2808 content.style.height = content.scrollHeight + 'px';
2809 }
2810 });
2811 });
2812 };
2813 const courseContinue = () => {
2814 const formContinue = document.querySelectorAll('form.continue-course');
2815 if (formContinue.length && lpData.user_id > 0) {
2816 const getResponse = async ele => {
2817 const response = await wp.apiFetch({
2818 path: 'lp/v1/courses/continue-course',
2819 method: 'POST',
2820 data: {
2821 courseId: lpGlobalSettings.post_id || '',
2822 userId: lpGlobalSettings.user_id || ''
2823 }
2824 });
2825 return response;
2826 };
2827 getResponse(formContinue).then(function (result) {
2828 if (result.status === 'success') {
2829 formContinue.forEach(form => {
2830 form.style.display = 'inline-block';
2831 form.action = result.data;
2832 });
2833 }
2834 });
2835 }
2836 };
2837
2838 document.addEventListener('DOMContentLoaded', function () {
2839 const $popup = $('#popup-course');
2840 let timerClearScroll;
2841 const $curriculum = $('#learn-press-course-curriculum');
2842 accordionExtraTab();
2843 initCourseTabs();
2844 initCourseSidebar();
2845 enrollCourse();
2846 purchaseCourse();
2847 retakeCourse();
2848 //courseProgress();
2849 courseContinue();
2850 _show_lp_overlay_complete_item__WEBPACK_IMPORTED_MODULE_2__["default"].init();
2851 (0,_material__WEBPACK_IMPORTED_MODULE_5__["default"])();
2852 //courseCurriculumSkeleton();
2853 (0,_tabs_scroll__WEBPACK_IMPORTED_MODULE_6__["default"])();
2854 (0,_js_frontend_copy_to_clipboard_js__WEBPACK_IMPORTED_MODULE_10__["default"])();
2855 });
2856 const detectedElCurriculum = setInterval(function () {
2857 const elementCurriculum = document.querySelector('.learnpress-course-curriculum');
2858 if (elementCurriculum) {
2859 (0,_single_curriculum_skeleton__WEBPACK_IMPORTED_MODULE_4__["default"])();
2860 clearInterval(detectedElCurriculum);
2861 }
2862 }, 1);
2863
2864 // Add callback for Thimkits
2865 LP.Hook.addAction('lp_course_curriculum_skeleton', function (id) {
2866 (0,_single_curriculum_skeleton__WEBPACK_IMPORTED_MODULE_4__["default"])(id);
2867 });
2868 })();
2869
2870 /******/ })()
2871 ;
2872 //# sourceMappingURL=single-course.js.map