PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
4.4.9 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 All 140 releases
learnpress / assets / js / dist / admin / admin-order-list.js

admin-order-list.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.9, at assets/js/dist/admin/admin-order-list.js

1,562 lines 52.9 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/js/admin/order-list/export_orders.js":
5 /*!*********************************************************!*\
6 !*** ./assets/src/js/admin/order-list/export_orders.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": () => (__WEBPACK_DEFAULT_EXPORT__)
14 /* harmony export */ });
15 /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../utils.js */ "./assets/src/js/utils.js");
16 /* harmony import */ var lpAssetsJsPath_lpToastify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lpAssetsJsPath/lpToastify */ "./assets/src/js/lpToastify.js");
17
18
19 const exportOrders = () => {
20 const handleExport = args => {
21 const {
22 e,
23 target
24 } = args;
25 e.preventDefault();
26 _utils_js__WEBPACK_IMPORTED_MODULE_0__.lpSetLoadingEl(target, true);
27 let dataSend = JSON.parse(target.dataset.send);
28 const callBack = {
29 success: response => {
30 const {
31 message,
32 status,
33 data
34 } = response;
35 lpAssetsJsPath_lpToastify__WEBPACK_IMPORTED_MODULE_1__.show(message, status);
36 if (status === 'success') {
37 const maxPage = data?.max_page;
38 const nextPage = data?.next_page;
39 const done = data?.done;
40 const downloadUrl = data?.download_url;
41 if (!!maxPage && !!nextPage && nextPage <= maxPage) {
42 dataSend = {
43 ...dataSend,
44 paged: nextPage
45 };
46 window.lpAJAXG.fetchAJAX(dataSend, callBack);
47 } else if (!!done) {
48 const link = document.createElement('a');
49 link.href = downloadUrl;
50 link.target = '_self';
51 document.body.appendChild(link);
52 link.click();
53 document.body.removeChild(link);
54 }
55 }
56 },
57 error: error => {
58 lpAssetsJsPath_lpToastify__WEBPACK_IMPORTED_MODULE_1__.show(error, 'error');
59 },
60 completed: () => {
61 _utils_js__WEBPACK_IMPORTED_MODULE_0__.lpSetLoadingEl(target, false);
62 }
63 };
64 window.lpAJAXG.fetchAJAX(dataSend, callBack);
65 };
66 _utils_js__WEBPACK_IMPORTED_MODULE_0__.eventHandlers('click', [{
67 selector: 'button.export',
68 class: undefined,
69 callBack: handleExport
70 }]);
71 };
72 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (exportOrders);
73
74 /***/ }),
75
76 /***/ "./assets/src/js/lpToastify.js":
77 /*!*************************************!*\
78 !*** ./assets/src/js/lpToastify.js ***!
79 \*************************************/
80 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
81
82 "use strict";
83 __webpack_require__.r(__webpack_exports__);
84 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
85 /* harmony export */ show: () => (/* binding */ show)
86 /* harmony export */ });
87 /* harmony import */ var toastify_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! toastify-js */ "./node_modules/toastify-js/src/toastify.js");
88 /* harmony import */ var toastify_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(toastify_js__WEBPACK_IMPORTED_MODULE_0__);
89 /* harmony import */ var toastify_js_src_toastify_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! toastify-js/src/toastify.css */ "./node_modules/toastify-js/src/toastify.css");
90 /**
91 * Utils functions
92 *
93 * @param url
94 * @param data
95 * @param functions
96 * @since 4.3.0
97 * @version 1.0.0
98 */
99
100
101 const argsToastify = {
102 text: '',
103 gravity: lpData.toast.gravity,
104 // `top` or `bottom`
105 position: lpData.toast.position,
106 // `left`, `center` or `right`
107 className: `${lpData.toast.classPrefix}`,
108 close: lpData.toast.close == 1,
109 stopOnFocus: lpData.toast.stopOnFocus == 1,
110 duration: lpData.toast.duration
111 };
112 const show = (message, status = 'success', argsCustom) => {
113 let args = argsToastify;
114 if (argsCustom) {
115 args = {
116 ...args,
117 ...argsCustom
118 };
119 }
120 const toastify = new (toastify_js__WEBPACK_IMPORTED_MODULE_0___default())({
121 ...args,
122 text: message,
123 className: `${lpData.toast.classPrefix} ${status}`
124 });
125 toastify.showToast();
126 };
127
128 /***/ }),
129
130 /***/ "./assets/src/js/utils.js":
131 /*!********************************!*\
132 !*** ./assets/src/js/utils.js ***!
133 \********************************/
134 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
135
136 "use strict";
137 __webpack_require__.r(__webpack_exports__);
138 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
139 /* harmony export */ eventHandlers: () => (/* binding */ eventHandlers),
140 /* harmony export */ getDataOfForm: () => (/* binding */ getDataOfForm),
141 /* harmony export */ getFieldKeysOfForm: () => (/* binding */ getFieldKeysOfForm),
142 /* harmony export */ listenElementCreated: () => (/* binding */ listenElementCreated),
143 /* harmony export */ listenElementViewed: () => (/* binding */ listenElementViewed),
144 /* harmony export */ lpAddQueryArgs: () => (/* binding */ lpAddQueryArgs),
145 /* harmony export */ lpAjaxParseJsonOld: () => (/* binding */ lpAjaxParseJsonOld),
146 /* harmony export */ lpClassName: () => (/* binding */ lpClassName),
147 /* harmony export */ lpFetchAPI: () => (/* binding */ lpFetchAPI),
148 /* harmony export */ lpGetCurrentURLNoParam: () => (/* binding */ lpGetCurrentURLNoParam),
149 /* harmony export */ lpOnElementReady: () => (/* binding */ lpOnElementReady),
150 /* harmony export */ lpSetLoadingEl: () => (/* binding */ lpSetLoadingEl),
151 /* harmony export */ lpShowHideEl: () => (/* binding */ lpShowHideEl),
152 /* harmony export */ mergeDataWithDatForm: () => (/* binding */ mergeDataWithDatForm),
153 /* harmony export */ toggleCollapse: () => (/* binding */ toggleCollapse)
154 /* harmony export */ });
155 /**
156 * Utils functions
157 *
158 * @param url
159 * @param data
160 * @param functions
161 * @since 4.2.5.1
162 * @version 1.0.5
163 */
164 const lpClassName = {
165 hidden: 'lp-hidden',
166 loading: 'loading',
167 elCollapse: 'lp-collapse',
168 elSectionToggle: '.lp-section-toggle',
169 elTriggerToggle: '.lp-trigger-toggle'
170 };
171 const lpFetchAPI = (url, data = {}, functions = {}) => {
172 if ('function' === typeof functions.before) {
173 functions.before();
174 }
175 fetch(url, {
176 method: 'GET',
177 ...data
178 }).then(response => response.json()).then(response => {
179 if ('function' === typeof functions.success) {
180 functions.success(response);
181 }
182 }).catch(err => {
183 if ('function' === typeof functions.error) {
184 functions.error(err);
185 }
186 }).finally(() => {
187 if ('function' === typeof functions.completed) {
188 functions.completed();
189 }
190 });
191 };
192
193 /**
194 * Get current URL without params.
195 *
196 * @since 4.2.5.1
197 */
198 const lpGetCurrentURLNoParam = () => {
199 let currentUrl = window.location.href;
200 const hasParams = currentUrl.includes('?');
201 if (hasParams) {
202 currentUrl = currentUrl.split('?')[0];
203 }
204 return currentUrl;
205 };
206 const lpAddQueryArgs = (endpoint, args) => {
207 const url = new URL(endpoint);
208 Object.keys(args).forEach(arg => {
209 url.searchParams.set(arg, args[arg]);
210 });
211 return url;
212 };
213
214 /**
215 * Listen element viewed.
216 *
217 * @param el
218 * @param callback
219 * @since 4.2.5.8
220 */
221 const listenElementViewed = (el, callback) => {
222 const observerSeeItem = new IntersectionObserver(function (entries) {
223 for (const entry of entries) {
224 if (entry.isIntersecting) {
225 callback(entry);
226 }
227 }
228 });
229 observerSeeItem.observe(el);
230 };
231
232 /**
233 * Listen element created.
234 *
235 * @param callback
236 * @since 4.2.5.8
237 */
238 const listenElementCreated = callback => {
239 const observerCreateItem = new MutationObserver(function (mutations) {
240 mutations.forEach(function (mutation) {
241 if (mutation.addedNodes) {
242 mutation.addedNodes.forEach(function (node) {
243 if (node.nodeType === 1) {
244 callback(node);
245 }
246 });
247 }
248 });
249 });
250 observerCreateItem.observe(document, {
251 childList: true,
252 subtree: true
253 });
254 // End.
255 };
256
257 /**
258 * Listen element created.
259 *
260 * @param selector
261 * @param callback
262 * @since 4.2.7.1
263 */
264 const lpOnElementReady = (selector, callback) => {
265 const element = document.querySelector(selector);
266 if (element) {
267 callback(element);
268 return;
269 }
270 const observer = new MutationObserver((mutations, obs) => {
271 const element = document.querySelector(selector);
272 if (element) {
273 obs.disconnect();
274 callback(element);
275 }
276 });
277 observer.observe(document.documentElement, {
278 childList: true,
279 subtree: true
280 });
281 };
282
283 // Parse JSON from string with content include LP_AJAX_START.
284 const lpAjaxParseJsonOld = data => {
285 if (typeof data !== 'string') {
286 return data;
287 }
288 const m = String.raw({
289 raw: data
290 }).match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/s);
291 try {
292 if (m) {
293 data = JSON.parse(m[1].replace(/(?:\r\n|\r|\n)/g, ''));
294 } else {
295 data = JSON.parse(data);
296 }
297 } catch (e) {
298 data = {};
299 }
300 return data;
301 };
302
303 // status 0: hide, 1: show
304 const lpShowHideEl = (el, status = 0) => {
305 if (!el) {
306 return;
307 }
308 if (!status) {
309 el.classList.add(lpClassName.hidden);
310 } else {
311 el.classList.remove(lpClassName.hidden);
312 }
313 };
314
315 // status 0: hide, 1: show
316 const lpSetLoadingEl = (el, status) => {
317 if (!el) {
318 return;
319 }
320 if (!status) {
321 el.classList.remove(lpClassName.loading);
322 } else {
323 el.classList.add(lpClassName.loading);
324 }
325 };
326
327 // Toggle collapse section
328 const toggleCollapse = (e, target, elTriggerClassName = '', elsExclude = [], callback) => {
329 if (!elTriggerClassName) {
330 elTriggerClassName = lpClassName.elTriggerToggle;
331 }
332
333 // Exclude elements, which should not trigger the collapse toggle
334 if (elsExclude && elsExclude.length > 0) {
335 for (const elExclude of elsExclude) {
336 if (target.closest(elExclude)) {
337 return;
338 }
339 }
340 }
341 const elTrigger = target.closest(elTriggerClassName);
342 if (!elTrigger) {
343 return;
344 }
345
346 //console.log( 'elTrigger', elTrigger );
347
348 const elSectionToggle = elTrigger.closest(`${lpClassName.elSectionToggle}`);
349 if (!elSectionToggle) {
350 return;
351 }
352 elSectionToggle.classList.toggle(`${lpClassName.elCollapse}`);
353 if ('function' === typeof callback) {
354 callback(elSectionToggle);
355 }
356 };
357
358 // Get data of form
359 const getDataOfForm = form => {
360 const dataSend = {};
361 const formData = new FormData(form);
362 for (const pair of formData.entries()) {
363 const key = pair[0];
364 const value = formData.getAll(key);
365 if (!dataSend.hasOwnProperty(key)) {
366 // Convert value array to string.
367 dataSend[key] = value.join(',');
368 }
369 }
370 return dataSend;
371 };
372
373 // Get field keys of form
374 const getFieldKeysOfForm = form => {
375 const keys = [];
376 const elements = form.elements;
377 for (let i = 0; i < elements.length; i++) {
378 const name = elements[i].name;
379 if (name && !keys.includes(name)) {
380 keys.push(name);
381 }
382 }
383 return keys;
384 };
385
386 // Merge data handle with data form.
387 const mergeDataWithDatForm = (elForm, dataHandle) => {
388 const dataForm = getDataOfForm(elForm);
389 const keys = getFieldKeysOfForm(elForm);
390 keys.forEach(key => {
391 if (!dataForm.hasOwnProperty(key)) {
392 delete dataHandle[key];
393 } else if (dataForm[key][0] === '') {
394 delete dataForm[key];
395 delete dataHandle[key];
396 }
397 });
398 dataHandle = {
399 ...dataHandle,
400 ...dataForm
401 };
402 return dataHandle;
403 };
404
405 /**
406 * Event trigger
407 * For each list of event handlers, listen event on document.
408 *
409 * eventName: 'click', 'change', ...
410 * eventHandlers = [ { selector: '.lp-button', callBack: function(){}, class: object } ]
411 *
412 * @param eventName
413 * @param eventHandlers
414 */
415 const eventHandlers = (eventName, eventHandlers) => {
416 document.addEventListener(eventName, e => {
417 const target = e.target;
418 let args = {
419 e,
420 target
421 };
422 eventHandlers.forEach(eventHandler => {
423 args = {
424 ...args,
425 ...eventHandler
426 };
427
428 //console.log( args );
429
430 // Check condition before call back
431 if (eventHandler.conditionBeforeCallBack) {
432 if (eventHandler.conditionBeforeCallBack(args) !== true) {
433 return;
434 }
435 }
436
437 // Special check for keydown event with checkIsEventEnter = true
438 if (eventName === 'keydown' && eventHandler.checkIsEventEnter) {
439 if (e.key !== 'Enter') {
440 return;
441 }
442 }
443 if (target.closest(eventHandler.selector)) {
444 if (eventHandler.class) {
445 // Call method of class, function callBack will understand exactly {this} is class object.
446 eventHandler.class[eventHandler.callBack](args);
447 } else {
448 // For send args is objected, {this} is eventHandler object, not class object.
449 eventHandler.callBack(args);
450 }
451 }
452 });
453 });
454 };
455
456 /***/ }),
457
458 /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css":
459 /*!*****************************************************************************************!*\
460 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/toastify-js/src/toastify.css ***!
461 \*****************************************************************************************/
462 /***/ ((module, __webpack_exports__, __webpack_require__) => {
463
464 "use strict";
465 __webpack_require__.r(__webpack_exports__);
466 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
467 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
468 /* harmony export */ });
469 /* 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");
470 /* 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__);
471 /* 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");
472 /* 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__);
473 // Imports
474
475
476 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()));
477 // Module
478 ___CSS_LOADER_EXPORT___.push([module.id, `/*!
479 * Toastify js 1.12.0
480 * https://github.com/apvarun/toastify-js
481 * @license MIT licensed
482 *
483 * Copyright (C) 2018 Varun A P
484 */
485
486 .toastify {
487 padding: 12px 20px;
488 color: #ffffff;
489 display: inline-block;
490 box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3);
491 background: -webkit-linear-gradient(315deg, #73a5ff, #5477f5);
492 background: linear-gradient(135deg, #73a5ff, #5477f5);
493 position: fixed;
494 opacity: 0;
495 transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
496 border-radius: 2px;
497 cursor: pointer;
498 text-decoration: none;
499 max-width: calc(50% - 20px);
500 z-index: 2147483647;
501 }
502
503 .toastify.on {
504 opacity: 1;
505 }
506
507 .toast-close {
508 background: transparent;
509 border: 0;
510 color: white;
511 cursor: pointer;
512 font-family: inherit;
513 font-size: 1em;
514 opacity: 0.4;
515 padding: 0 5px;
516 }
517
518 .toastify-right {
519 right: 15px;
520 }
521
522 .toastify-left {
523 left: 15px;
524 }
525
526 .toastify-top {
527 top: -150px;
528 }
529
530 .toastify-bottom {
531 bottom: -150px;
532 }
533
534 .toastify-rounded {
535 border-radius: 25px;
536 }
537
538 .toastify-avatar {
539 width: 1.5em;
540 height: 1.5em;
541 margin: -7px 5px;
542 border-radius: 2px;
543 }
544
545 .toastify-center {
546 margin-left: auto;
547 margin-right: auto;
548 left: 0;
549 right: 0;
550 max-width: fit-content;
551 max-width: -moz-fit-content;
552 }
553
554 @media only screen and (max-width: 360px) {
555 .toastify-right, .toastify-left {
556 margin-left: auto;
557 margin-right: auto;
558 left: 0;
559 right: 0;
560 max-width: fit-content;
561 }
562 }
563 `, "",{"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":""}]);
564 // Exports
565 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
566
567
568 /***/ }),
569
570 /***/ "./node_modules/css-loader/dist/runtime/api.js":
571 /*!*****************************************************!*\
572 !*** ./node_modules/css-loader/dist/runtime/api.js ***!
573 \*****************************************************/
574 /***/ ((module) => {
575
576 "use strict";
577
578
579 /*
580 MIT License http://www.opensource.org/licenses/mit-license.php
581 Author Tobias Koppers @sokra
582 */
583 module.exports = function (cssWithMappingToString) {
584 var list = [];
585
586 // return the list of modules as css string
587 list.toString = function toString() {
588 return this.map(function (item) {
589 var content = "";
590 var needLayer = typeof item[5] !== "undefined";
591 if (item[4]) {
592 content += "@supports (".concat(item[4], ") {");
593 }
594 if (item[2]) {
595 content += "@media ".concat(item[2], " {");
596 }
597 if (needLayer) {
598 content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
599 }
600 content += cssWithMappingToString(item);
601 if (needLayer) {
602 content += "}";
603 }
604 if (item[2]) {
605 content += "}";
606 }
607 if (item[4]) {
608 content += "}";
609 }
610 return content;
611 }).join("");
612 };
613
614 // import a list of modules into the list
615 list.i = function i(modules, media, dedupe, supports, layer) {
616 if (typeof modules === "string") {
617 modules = [[null, modules, undefined]];
618 }
619 var alreadyImportedModules = {};
620 if (dedupe) {
621 for (var k = 0; k < this.length; k++) {
622 var id = this[k][0];
623 if (id != null) {
624 alreadyImportedModules[id] = true;
625 }
626 }
627 }
628 for (var _k = 0; _k < modules.length; _k++) {
629 var item = [].concat(modules[_k]);
630 if (dedupe && alreadyImportedModules[item[0]]) {
631 continue;
632 }
633 if (typeof layer !== "undefined") {
634 if (typeof item[5] === "undefined") {
635 item[5] = layer;
636 } else {
637 item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
638 item[5] = layer;
639 }
640 }
641 if (media) {
642 if (!item[2]) {
643 item[2] = media;
644 } else {
645 item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
646 item[2] = media;
647 }
648 }
649 if (supports) {
650 if (!item[4]) {
651 item[4] = "".concat(supports);
652 } else {
653 item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
654 item[4] = supports;
655 }
656 }
657 list.push(item);
658 }
659 };
660 return list;
661 };
662
663 /***/ }),
664
665 /***/ "./node_modules/css-loader/dist/runtime/sourceMaps.js":
666 /*!************************************************************!*\
667 !*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***!
668 \************************************************************/
669 /***/ ((module) => {
670
671 "use strict";
672
673
674 module.exports = function (item) {
675 var content = item[1];
676 var cssMapping = item[3];
677 if (!cssMapping) {
678 return content;
679 }
680 if (typeof btoa === "function") {
681 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
682 var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
683 var sourceMapping = "/*# ".concat(data, " */");
684 return [content].concat([sourceMapping]).join("\n");
685 }
686 return [content].join("\n");
687 };
688
689 /***/ }),
690
691 /***/ "./node_modules/toastify-js/src/toastify.css":
692 /*!***************************************************!*\
693 !*** ./node_modules/toastify-js/src/toastify.css ***!
694 \***************************************************/
695 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
696
697 "use strict";
698 __webpack_require__.r(__webpack_exports__);
699 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
700 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
701 /* harmony export */ });
702 /* 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");
703 /* 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__);
704 /* 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");
705 /* 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__);
706 /* 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");
707 /* 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__);
708 /* 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");
709 /* 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__);
710 /* 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");
711 /* 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__);
712 /* 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");
713 /* 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__);
714 /* 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");
715
716
717
718
719
720
721
722
723
724
725
726 var options = {};
727
728 options.styleTagTransform = (_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
729 options.setAttributes = (_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
730
731 options.insert = _style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
732
733 options.domAPI = (_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
734 options.insertStyleElement = (_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
735
736 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);
737
738
739
740
741 /* 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);
742
743
744 /***/ }),
745
746 /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
747 /*!****************************************************************************!*\
748 !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
749 \****************************************************************************/
750 /***/ ((module) => {
751
752 "use strict";
753
754
755 var stylesInDOM = [];
756 function getIndexByIdentifier(identifier) {
757 var result = -1;
758 for (var i = 0; i < stylesInDOM.length; i++) {
759 if (stylesInDOM[i].identifier === identifier) {
760 result = i;
761 break;
762 }
763 }
764 return result;
765 }
766 function modulesToDom(list, options) {
767 var idCountMap = {};
768 var identifiers = [];
769 for (var i = 0; i < list.length; i++) {
770 var item = list[i];
771 var id = options.base ? item[0] + options.base : item[0];
772 var count = idCountMap[id] || 0;
773 var identifier = "".concat(id, " ").concat(count);
774 idCountMap[id] = count + 1;
775 var indexByIdentifier = getIndexByIdentifier(identifier);
776 var obj = {
777 css: item[1],
778 media: item[2],
779 sourceMap: item[3],
780 supports: item[4],
781 layer: item[5]
782 };
783 if (indexByIdentifier !== -1) {
784 stylesInDOM[indexByIdentifier].references++;
785 stylesInDOM[indexByIdentifier].updater(obj);
786 } else {
787 var updater = addElementStyle(obj, options);
788 options.byIndex = i;
789 stylesInDOM.splice(i, 0, {
790 identifier: identifier,
791 updater: updater,
792 references: 1
793 });
794 }
795 identifiers.push(identifier);
796 }
797 return identifiers;
798 }
799 function addElementStyle(obj, options) {
800 var api = options.domAPI(options);
801 api.update(obj);
802 var updater = function updater(newObj) {
803 if (newObj) {
804 if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
805 return;
806 }
807 api.update(obj = newObj);
808 } else {
809 api.remove();
810 }
811 };
812 return updater;
813 }
814 module.exports = function (list, options) {
815 options = options || {};
816 list = list || [];
817 var lastIdentifiers = modulesToDom(list, options);
818 return function update(newList) {
819 newList = newList || [];
820 for (var i = 0; i < lastIdentifiers.length; i++) {
821 var identifier = lastIdentifiers[i];
822 var index = getIndexByIdentifier(identifier);
823 stylesInDOM[index].references--;
824 }
825 var newLastIdentifiers = modulesToDom(newList, options);
826 for (var _i = 0; _i < lastIdentifiers.length; _i++) {
827 var _identifier = lastIdentifiers[_i];
828 var _index = getIndexByIdentifier(_identifier);
829 if (stylesInDOM[_index].references === 0) {
830 stylesInDOM[_index].updater();
831 stylesInDOM.splice(_index, 1);
832 }
833 }
834 lastIdentifiers = newLastIdentifiers;
835 };
836 };
837
838 /***/ }),
839
840 /***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js":
841 /*!********************************************************************!*\
842 !*** ./node_modules/style-loader/dist/runtime/insertBySelector.js ***!
843 \********************************************************************/
844 /***/ ((module) => {
845
846 "use strict";
847
848
849 var memo = {};
850
851 /* istanbul ignore next */
852 function getTarget(target) {
853 if (typeof memo[target] === "undefined") {
854 var styleTarget = document.querySelector(target);
855
856 // Special case to return head of iframe instead of iframe itself
857 if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
858 try {
859 // This will throw an exception if access to iframe is blocked
860 // due to cross-origin restrictions
861 styleTarget = styleTarget.contentDocument.head;
862 } catch (e) {
863 // istanbul ignore next
864 styleTarget = null;
865 }
866 }
867 memo[target] = styleTarget;
868 }
869 return memo[target];
870 }
871
872 /* istanbul ignore next */
873 function insertBySelector(insert, style) {
874 var target = getTarget(insert);
875 if (!target) {
876 throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
877 }
878 target.appendChild(style);
879 }
880 module.exports = insertBySelector;
881
882 /***/ }),
883
884 /***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js":
885 /*!**********************************************************************!*\
886 !*** ./node_modules/style-loader/dist/runtime/insertStyleElement.js ***!
887 \**********************************************************************/
888 /***/ ((module) => {
889
890 "use strict";
891
892
893 /* istanbul ignore next */
894 function insertStyleElement(options) {
895 var element = document.createElement("style");
896 options.setAttributes(element, options.attributes);
897 options.insert(element, options.options);
898 return element;
899 }
900 module.exports = insertStyleElement;
901
902 /***/ }),
903
904 /***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":
905 /*!**********************************************************************************!*\
906 !*** ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***!
907 \**********************************************************************************/
908 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
909
910 "use strict";
911
912
913 /* istanbul ignore next */
914 function setAttributesWithoutAttributes(styleElement) {
915 var nonce = true ? __webpack_require__.nc : 0;
916 if (nonce) {
917 styleElement.setAttribute("nonce", nonce);
918 }
919 }
920 module.exports = setAttributesWithoutAttributes;
921
922 /***/ }),
923
924 /***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js":
925 /*!***************************************************************!*\
926 !*** ./node_modules/style-loader/dist/runtime/styleDomAPI.js ***!
927 \***************************************************************/
928 /***/ ((module) => {
929
930 "use strict";
931
932
933 /* istanbul ignore next */
934 function apply(styleElement, options, obj) {
935 var css = "";
936 if (obj.supports) {
937 css += "@supports (".concat(obj.supports, ") {");
938 }
939 if (obj.media) {
940 css += "@media ".concat(obj.media, " {");
941 }
942 var needLayer = typeof obj.layer !== "undefined";
943 if (needLayer) {
944 css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
945 }
946 css += obj.css;
947 if (needLayer) {
948 css += "}";
949 }
950 if (obj.media) {
951 css += "}";
952 }
953 if (obj.supports) {
954 css += "}";
955 }
956 var sourceMap = obj.sourceMap;
957 if (sourceMap && typeof btoa !== "undefined") {
958 css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
959 }
960
961 // For old IE
962 /* istanbul ignore if */
963 options.styleTagTransform(css, styleElement, options.options);
964 }
965 function removeStyleElement(styleElement) {
966 // istanbul ignore if
967 if (styleElement.parentNode === null) {
968 return false;
969 }
970 styleElement.parentNode.removeChild(styleElement);
971 }
972
973 /* istanbul ignore next */
974 function domAPI(options) {
975 if (typeof document === "undefined") {
976 return {
977 update: function update() {},
978 remove: function remove() {}
979 };
980 }
981 var styleElement = options.insertStyleElement(options);
982 return {
983 update: function update(obj) {
984 apply(styleElement, options, obj);
985 },
986 remove: function remove() {
987 removeStyleElement(styleElement);
988 }
989 };
990 }
991 module.exports = domAPI;
992
993 /***/ }),
994
995 /***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js":
996 /*!*********************************************************************!*\
997 !*** ./node_modules/style-loader/dist/runtime/styleTagTransform.js ***!
998 \*********************************************************************/
999 /***/ ((module) => {
1000
1001 "use strict";
1002
1003
1004 /* istanbul ignore next */
1005 function styleTagTransform(css, styleElement) {
1006 if (styleElement.styleSheet) {
1007 styleElement.styleSheet.cssText = css;
1008 } else {
1009 while (styleElement.firstChild) {
1010 styleElement.removeChild(styleElement.firstChild);
1011 }
1012 styleElement.appendChild(document.createTextNode(css));
1013 }
1014 }
1015 module.exports = styleTagTransform;
1016
1017 /***/ }),
1018
1019 /***/ "./node_modules/toastify-js/src/toastify.js":
1020 /*!**************************************************!*\
1021 !*** ./node_modules/toastify-js/src/toastify.js ***!
1022 \**************************************************/
1023 /***/ (function(module) {
1024
1025 /*!
1026 * Toastify js 1.12.0
1027 * https://github.com/apvarun/toastify-js
1028 * @license MIT licensed
1029 *
1030 * Copyright (C) 2018 Varun A P
1031 */
1032 (function(root, factory) {
1033 if ( true && module.exports) {
1034 module.exports = factory();
1035 } else {
1036 root.Toastify = factory();
1037 }
1038 })(this, function(global) {
1039 // Object initialization
1040 var Toastify = function(options) {
1041 // Returning a new init object
1042 return new Toastify.lib.init(options);
1043 },
1044 // Library version
1045 version = "1.12.0";
1046
1047 // Set the default global options
1048 Toastify.defaults = {
1049 oldestFirst: true,
1050 text: "Toastify is awesome!",
1051 node: undefined,
1052 duration: 3000,
1053 selector: undefined,
1054 callback: function () {
1055 },
1056 destination: undefined,
1057 newWindow: false,
1058 close: false,
1059 gravity: "toastify-top",
1060 positionLeft: false,
1061 position: '',
1062 backgroundColor: '',
1063 avatar: "",
1064 className: "",
1065 stopOnFocus: true,
1066 onClick: function () {
1067 },
1068 offset: {x: 0, y: 0},
1069 escapeMarkup: true,
1070 ariaLive: 'polite',
1071 style: {background: ''}
1072 };
1073
1074 // Defining the prototype of the object
1075 Toastify.lib = Toastify.prototype = {
1076 toastify: version,
1077
1078 constructor: Toastify,
1079
1080 // Initializing the object with required parameters
1081 init: function(options) {
1082 // Verifying and validating the input object
1083 if (!options) {
1084 options = {};
1085 }
1086
1087 // Creating the options object
1088 this.options = {};
1089
1090 this.toastElement = null;
1091
1092 // Validating the options
1093 this.options.text = options.text || Toastify.defaults.text; // Display message
1094 this.options.node = options.node || Toastify.defaults.node; // Display content as node
1095 this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration
1096 this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector
1097 this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display
1098 this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination
1099 this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window
1100 this.options.close = options.close || Toastify.defaults.close; // Show toast close icon
1101 this.options.gravity = options.gravity === "bottom" ? "toastify-bottom" : Toastify.defaults.gravity; // toast position - top or bottom
1102 this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right
1103 this.options.position = options.position || Toastify.defaults.position; // toast position - left or right
1104 this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color
1105 this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path
1106 this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast
1107 this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus
1108 this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click
1109 this.options.offset = options.offset || Toastify.defaults.offset; // toast offset
1110 this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;
1111 this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;
1112 this.options.style = options.style || Toastify.defaults.style;
1113 if(options.backgroundColor) {
1114 this.options.style.background = options.backgroundColor;
1115 }
1116
1117 // Returning the current object for chaining functions
1118 return this;
1119 },
1120
1121 // Building the DOM element
1122 buildToast: function() {
1123 // Validating if the options are defined
1124 if (!this.options) {
1125 throw "Toastify is not initialized";
1126 }
1127
1128 // Creating the DOM object
1129 var divElement = document.createElement("div");
1130 divElement.className = "toastify on " + this.options.className;
1131
1132 // Positioning toast to left or right or center
1133 if (!!this.options.position) {
1134 divElement.className += " toastify-" + this.options.position;
1135 } else {
1136 // To be depreciated in further versions
1137 if (this.options.positionLeft === true) {
1138 divElement.className += " toastify-left";
1139 console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.')
1140 } else {
1141 // Default position
1142 divElement.className += " toastify-right";
1143 }
1144 }
1145
1146 // Assigning gravity of element
1147 divElement.className += " " + this.options.gravity;
1148
1149 if (this.options.backgroundColor) {
1150 // This is being deprecated in favor of using the style HTML DOM property
1151 console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');
1152 }
1153
1154 // Loop through our style object and apply styles to divElement
1155 for (var property in this.options.style) {
1156 divElement.style[property] = this.options.style[property];
1157 }
1158
1159 // Announce the toast to screen readers
1160 if (this.options.ariaLive) {
1161 divElement.setAttribute('aria-live', this.options.ariaLive)
1162 }
1163
1164 // Adding the toast message/node
1165 if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {
1166 // If we have a valid node, we insert it
1167 divElement.appendChild(this.options.node)
1168 } else {
1169 if (this.options.escapeMarkup) {
1170 divElement.innerText = this.options.text;
1171 } else {
1172 divElement.innerHTML = this.options.text;
1173 }
1174
1175 if (this.options.avatar !== "") {
1176 var avatarElement = document.createElement("img");
1177 avatarElement.src = this.options.avatar;
1178
1179 avatarElement.className = "toastify-avatar";
1180
1181 if (this.options.position == "left" || this.options.positionLeft === true) {
1182 // Adding close icon on the left of content
1183 divElement.appendChild(avatarElement);
1184 } else {
1185 // Adding close icon on the right of content
1186 divElement.insertAdjacentElement("afterbegin", avatarElement);
1187 }
1188 }
1189 }
1190
1191 // Adding a close icon to the toast
1192 if (this.options.close === true) {
1193 // Create a span for close element
1194 var closeElement = document.createElement("button");
1195 closeElement.type = "button";
1196 closeElement.setAttribute("aria-label", "Close");
1197 closeElement.className = "toast-close";
1198 closeElement.innerHTML = "&#10006;";
1199
1200 // Triggering the removal of toast from DOM on close click
1201 closeElement.addEventListener(
1202 "click",
1203 function(event) {
1204 event.stopPropagation();
1205 this.removeElement(this.toastElement);
1206 window.clearTimeout(this.toastElement.timeOutValue);
1207 }.bind(this)
1208 );
1209
1210 //Calculating screen width
1211 var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
1212
1213 // Adding the close icon to the toast element
1214 // Display on the right if screen width is less than or equal to 360px
1215 if ((this.options.position == "left" || this.options.positionLeft === true) && width > 360) {
1216 // Adding close icon on the left of content
1217 divElement.insertAdjacentElement("afterbegin", closeElement);
1218 } else {
1219 // Adding close icon on the right of content
1220 divElement.appendChild(closeElement);
1221 }
1222 }
1223
1224 // Clear timeout while toast is focused
1225 if (this.options.stopOnFocus && this.options.duration > 0) {
1226 var self = this;
1227 // stop countdown
1228 divElement.addEventListener(
1229 "mouseover",
1230 function(event) {
1231 window.clearTimeout(divElement.timeOutValue);
1232 }
1233 )
1234 // add back the timeout
1235 divElement.addEventListener(
1236 "mouseleave",
1237 function() {
1238 divElement.timeOutValue = window.setTimeout(
1239 function() {
1240 // Remove the toast from DOM
1241 self.removeElement(divElement);
1242 },
1243 self.options.duration
1244 )
1245 }
1246 )
1247 }
1248
1249 // Adding an on-click destination path
1250 if (typeof this.options.destination !== "undefined") {
1251 divElement.addEventListener(
1252 "click",
1253 function(event) {
1254 event.stopPropagation();
1255 if (this.options.newWindow === true) {
1256 window.open(this.options.destination, "_blank");
1257 } else {
1258 window.location = this.options.destination;
1259 }
1260 }.bind(this)
1261 );
1262 }
1263
1264 if (typeof this.options.onClick === "function" && typeof this.options.destination === "undefined") {
1265 divElement.addEventListener(
1266 "click",
1267 function(event) {
1268 event.stopPropagation();
1269 this.options.onClick();
1270 }.bind(this)
1271 );
1272 }
1273
1274 // Adding offset
1275 if(typeof this.options.offset === "object") {
1276
1277 var x = getAxisOffsetAValue("x", this.options);
1278 var y = getAxisOffsetAValue("y", this.options);
1279
1280 var xOffset = this.options.position == "left" ? x : "-" + x;
1281 var yOffset = this.options.gravity == "toastify-top" ? y : "-" + y;
1282
1283 divElement.style.transform = "translate(" + xOffset + "," + yOffset + ")";
1284
1285 }
1286
1287 // Returning the generated element
1288 return divElement;
1289 },
1290
1291 // Displaying the toast
1292 showToast: function() {
1293 // Creating the DOM object for the toast
1294 this.toastElement = this.buildToast();
1295
1296 // Getting the root element to with the toast needs to be added
1297 var rootElement;
1298 if (typeof this.options.selector === "string") {
1299 rootElement = document.getElementById(this.options.selector);
1300 } else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) {
1301 rootElement = this.options.selector;
1302 } else {
1303 rootElement = document.body;
1304 }
1305
1306 // Validating if root element is present in DOM
1307 if (!rootElement) {
1308 throw "Root element is not defined";
1309 }
1310
1311 // Adding the DOM element
1312 var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;
1313 rootElement.insertBefore(this.toastElement, elementToInsert);
1314
1315 // Repositioning the toasts in case multiple toasts are present
1316 Toastify.reposition();
1317
1318 if (this.options.duration > 0) {
1319 this.toastElement.timeOutValue = window.setTimeout(
1320 function() {
1321 // Remove the toast from DOM
1322 this.removeElement(this.toastElement);
1323 }.bind(this),
1324 this.options.duration
1325 ); // Binding `this` for function invocation
1326 }
1327
1328 // Supporting function chaining
1329 return this;
1330 },
1331
1332 hideToast: function() {
1333 if (this.toastElement.timeOutValue) {
1334 clearTimeout(this.toastElement.timeOutValue);
1335 }
1336 this.removeElement(this.toastElement);
1337 },
1338
1339 // Removing the element from the DOM
1340 removeElement: function(toastElement) {
1341 // Hiding the element
1342 // toastElement.classList.remove("on");
1343 toastElement.className = toastElement.className.replace(" on", "");
1344
1345 // Removing the element from DOM after transition end
1346 window.setTimeout(
1347 function() {
1348 // remove options node if any
1349 if (this.options.node && this.options.node.parentNode) {
1350 this.options.node.parentNode.removeChild(this.options.node);
1351 }
1352
1353 // Remove the element from the DOM, only when the parent node was not removed before.
1354 if (toastElement.parentNode) {
1355 toastElement.parentNode.removeChild(toastElement);
1356 }
1357
1358 // Calling the callback function
1359 this.options.callback.call(toastElement);
1360
1361 // Repositioning the toasts again
1362 Toastify.reposition();
1363 }.bind(this),
1364 400
1365 ); // Binding `this` for function invocation
1366 },
1367 };
1368
1369 // Positioning the toasts on the DOM
1370 Toastify.reposition = function() {
1371
1372 // Top margins with gravity
1373 var topLeftOffsetSize = {
1374 top: 15,
1375 bottom: 15,
1376 };
1377 var topRightOffsetSize = {
1378 top: 15,
1379 bottom: 15,
1380 };
1381 var offsetSize = {
1382 top: 15,
1383 bottom: 15,
1384 };
1385
1386 // Get all toast messages on the DOM
1387 var allToasts = document.getElementsByClassName("toastify");
1388
1389 var classUsed;
1390
1391 // Modifying the position of each toast element
1392 for (var i = 0; i < allToasts.length; i++) {
1393 // Getting the applied gravity
1394 if (containsClass(allToasts[i], "toastify-top") === true) {
1395 classUsed = "toastify-top";
1396 } else {
1397 classUsed = "toastify-bottom";
1398 }
1399
1400 var height = allToasts[i].offsetHeight;
1401 classUsed = classUsed.substr(9, classUsed.length-1)
1402 // Spacing between toasts
1403 var offset = 15;
1404
1405 var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
1406
1407 // Show toast in center if screen with less than or equal to 360px
1408 if (width <= 360) {
1409 // Setting the position
1410 allToasts[i].style[classUsed] = offsetSize[classUsed] + "px";
1411
1412 offsetSize[classUsed] += height + offset;
1413 } else {
1414 if (containsClass(allToasts[i], "toastify-left") === true) {
1415 // Setting the position
1416 allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + "px";
1417
1418 topLeftOffsetSize[classUsed] += height + offset;
1419 } else {
1420 // Setting the position
1421 allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + "px";
1422
1423 topRightOffsetSize[classUsed] += height + offset;
1424 }
1425 }
1426 }
1427
1428 // Supporting function chaining
1429 return this;
1430 };
1431
1432 // Helper function to get offset.
1433 function getAxisOffsetAValue(axis, options) {
1434
1435 if(options.offset[axis]) {
1436 if(isNaN(options.offset[axis])) {
1437 return options.offset[axis];
1438 }
1439 else {
1440 return options.offset[axis] + 'px';
1441 }
1442 }
1443
1444 return '0px';
1445
1446 }
1447
1448 function containsClass(elem, yourClass) {
1449 if (!elem || typeof yourClass !== "string") {
1450 return false;
1451 } else if (
1452 elem.className &&
1453 elem.className
1454 .trim()
1455 .split(/\s+/gi)
1456 .indexOf(yourClass) > -1
1457 ) {
1458 return true;
1459 } else {
1460 return false;
1461 }
1462 }
1463
1464 // Setting up the prototype for the init object
1465 Toastify.lib.init.prototype = Toastify.lib;
1466
1467 // Returning the Toastify function to be assigned to the window object/module
1468 return Toastify;
1469 });
1470
1471
1472 /***/ })
1473
1474 /******/ });
1475 /************************************************************************/
1476 /******/ // The module cache
1477 /******/ var __webpack_module_cache__ = {};
1478 /******/
1479 /******/ // The require function
1480 /******/ function __webpack_require__(moduleId) {
1481 /******/ // Check if module is in cache
1482 /******/ var cachedModule = __webpack_module_cache__[moduleId];
1483 /******/ if (cachedModule !== undefined) {
1484 /******/ return cachedModule.exports;
1485 /******/ }
1486 /******/ // Create a new module (and put it into the cache)
1487 /******/ var module = __webpack_module_cache__[moduleId] = {
1488 /******/ id: moduleId,
1489 /******/ // no module.loaded needed
1490 /******/ exports: {}
1491 /******/ };
1492 /******/
1493 /******/ // Execute the module function
1494 /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1495 /******/
1496 /******/ // Return the exports of the module
1497 /******/ return module.exports;
1498 /******/ }
1499 /******/
1500 /************************************************************************/
1501 /******/ /* webpack/runtime/compat get default export */
1502 /******/ (() => {
1503 /******/ // getDefaultExport function for compatibility with non-harmony modules
1504 /******/ __webpack_require__.n = (module) => {
1505 /******/ var getter = module && module.__esModule ?
1506 /******/ () => (module['default']) :
1507 /******/ () => (module);
1508 /******/ __webpack_require__.d(getter, { a: getter });
1509 /******/ return getter;
1510 /******/ };
1511 /******/ })();
1512 /******/
1513 /******/ /* webpack/runtime/define property getters */
1514 /******/ (() => {
1515 /******/ // define getter functions for harmony exports
1516 /******/ __webpack_require__.d = (exports, definition) => {
1517 /******/ for(var key in definition) {
1518 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1519 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1520 /******/ }
1521 /******/ }
1522 /******/ };
1523 /******/ })();
1524 /******/
1525 /******/ /* webpack/runtime/hasOwnProperty shorthand */
1526 /******/ (() => {
1527 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1528 /******/ })();
1529 /******/
1530 /******/ /* webpack/runtime/make namespace object */
1531 /******/ (() => {
1532 /******/ // define __esModule on exports
1533 /******/ __webpack_require__.r = (exports) => {
1534 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1535 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1536 /******/ }
1537 /******/ Object.defineProperty(exports, '__esModule', { value: true });
1538 /******/ };
1539 /******/ })();
1540 /******/
1541 /******/ /* webpack/runtime/nonce */
1542 /******/ (() => {
1543 /******/ __webpack_require__.nc = undefined;
1544 /******/ })();
1545 /******/
1546 /************************************************************************/
1547 var __webpack_exports__ = {};
1548 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
1549 (() => {
1550 "use strict";
1551 /*!*************************************************!*\
1552 !*** ./assets/src/js/admin/admin-order-list.js ***!
1553 \*************************************************/
1554 __webpack_require__.r(__webpack_exports__);
1555 /* harmony import */ var _order_list_export_orders__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./order-list/export_orders */ "./assets/src/js/admin/order-list/export_orders.js");
1556
1557 (0,_order_list_export_orders__WEBPACK_IMPORTED_MODULE_0__["default"])();
1558 })();
1559
1560 /******/ })()
1561 ;
1562 //# sourceMappingURL=admin-order-list.js.map