PageSourceSearch

https://www.u-skill.com/wp-content/plugins/tutor-pro/addons/course-bundle/assets/js/common.js?ver=4.1.0

js u-skill.com collected 2026-10-02 22:26:22 UTC 4,706 bytes, 68 lines download raw bytes

1(()=>{"use strict";var t={};// The module cache
2var r={};// The require function
3function e(n){// Check if module is in cache
4var o=r[n];if(o!==undefined){return o.exports}// Create a new module (and put it into the cache)
5var a=r[n]={exports:{}};// Execute the module function
6t[n](a,a.exports,e);// Return the exports of the module
7return a.exports}// webpack/runtime/rspack_version
8(()=>{e.rv=()=>"1.6.5"})();// webpack/runtime/rspack_unique_id
9(()=>{e.ruid="[email protected]"})();// CONCATENATED MODULE: ./node_modules/.pnpm/@[email protected]/node_modules/@swc/helpers/esm/_async_to_generator.js
10function n(t,r,e,n,o,a,u){try{var i=t[a](u);var d=i.value}catch(t){e(t);return}if(i.done)r(d);else Promise.resolve(d).then(n,o)}function o(t){return function(){var r=this,e=arguments;return new Promise(function(o,a){var u=t.apply(r,e);function i(t){n(u,o,a,i,d,"next",t)}function d(t){n(u,o,a,i,d,"throw",t)}i(undefined)})}};// CONCATENATED MODULE: ./assets/src/js/utils.js
11/**
12 * Converts a local date to GMT (Greenwich Mean Time).
13 * 
14 * @param {Date} date - The local date to convert to GMT
15 * @param {string} [dateFormat='yyyy-MM-dd HH:mm:ss'] - The format string for the output date
16 * @returns {string} The formatted GMT date string
17 * 
18 * @since v3.8.0
19 */var a=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"yyyy-MM-dd HH:mm:ss";var e=t.getTimezoneOffset();var n=addMinutes(t,e);return format(n,r)};/**
20 * Converts a GMT date to local date based on the user's timezone.
21 * 
22 * @param {string|Date} date - The GMT date to convert to local time
23 * @returns {Date} The converted local date object
24 * 
25 * @since v3.8.0
26 */var u=t=>{var r=new Date(t);var e=r.getTimezoneOffset();return addMinutes(r,-e)};/**
27 * Validates if a string is a valid email address format.
28 * 
29 * @param {string} email - The email string to validate
30 * @returns {boolean} True if the email format is valid, false otherwise
31 * 
32 * @since v3.8.1
33 */var i=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t);/**
34 * Creates a FormData object from a data object and automatically adds security nonce.
35 * 
36 * @param {Object} [data={}] - The data object to convert to FormData
37 * @returns {FormData} A FormData object with the provided data and security nonce
38 * 
39 * @example
40 * const formData = tutorFormData({
41 *   action: 'save_lesson_note',
42 *   lesson_id: 123,
43 *   note_text: 'My note content'
44 * });
45 * 
46 * @since v3.9.0
47 */function d(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var r=new FormData;Object.keys(t).forEach(e=>r.set(e,t[e]));r.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);return r}/**
48 * Handles AJAX requests to the WordPress admin-ajax.php endpoint.
49 * 
50 * @param {FormData} formData - The FormData object containing the request data
51 * @returns {Promise<Response|undefined>} The fetch Response object, or undefined if an error occurs
52 * 
53 * @example
54 * const formData = tutorFormData({ action: 'get_lesson_data', lesson_id: 123 });
55 * const response = await ajaxHandler(formData);
56 * const data = await response.json();
57 * 
58 * @since v3.9.0
59 */function s(t){return o(function*(){try{var r=yield fetch(window._tutorobject.ajaxurl,{method:"POST",body:t});return r}catch(t){tutor_toast(__("Operation failed","tutor-pro"),t,"error")}})()}var c=(t,r)=>{var{__:e}=wp.i18n;var{data:n={}}=t||{};var{message:o=r||e("Something Went Wrong!","tutor-pro")}=n;return o};// CONCATENATED MODULE: ./addons/course-bundle/assets/src/js/common.js
60/**
61 * Course bundle builder
62 *
63 * @since 2.2.0
64 */document.addEventListener("DOMContentLoaded",function(){return o(function*(){var{__}=wp.i18n;var t=__("Something went wrong, please try again after refreshing page","tutor-pro");/** 
65    * Create new draft course bundle
66    * 
67    * @since 3.2.0
68    */var r=document.querySelectorAll("a.tutor-add-new-course-bundle,button.tutor-add-new-course-bundle,li.tutor-add-new-course-bundle a");if(r){r.forEach(r=>{r.addEventListener("click",function(e){return o(function*(){e.preventDefault();var n=document.querySelector("body.tutor-frontend");var o={action:"tutor_create_course_bundle",source:n?"frontend":"backend"};var a=d(o);try{if(e.target.classList.contains("ab-item")){e.target.innerHTML="Creating..."}r.classList.add("is-loading","tutor-btn-loading");r.setAttribute("disabled","disabled");var u=yield s(a);var i=yield u.json();if(i.status_code===200){window.location.href=i.data}else{tutor_toast(__("Failed","tutor-pro"),i.message||__("Bundle creation failed","tutor-pro"),"error")}}catch(r){tutor_toast(__("Failed","tutor-pro"),t,"error")}finally{r.classList.remove("is-loading","tutor-btn-loading");r.removeAttribute("disabled")}})()})})}})()})})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.