This commit is contained in:
Iliyan Angelov
2025-09-14 23:24:25 +03:00
commit c67067a2a4
71311 changed files with 6800714 additions and 0 deletions

135
frontend/node_modules/unload/dist/browserify.js generated vendored Normal file
View File

@@ -0,0 +1,135 @@
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
/* global WorkerGlobalScope */
function add(fn) {
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {// this is run inside of a webworker
} else {
/**
* if we are on react-native, there is no window.addEventListener
* @link https://github.com/pubkey/unload/issues/6
*/
if (typeof window.addEventListener !== 'function') return;
/**
* for normal browser-windows, we use the beforeunload-event
*/
window.addEventListener('beforeunload', function () {
fn();
}, true);
/**
* for iframes, we have to use the unload-event
* @link https://stackoverflow.com/q/47533670/3443137
*/
window.addEventListener('unload', function () {
fn();
}, true);
}
/**
* TODO add fallback for safari-mobile
* @link https://stackoverflow.com/a/26193516/3443137
*/
}
var _default = {
add: add
};
exports["default"] = _default;
},{}],2:[function(require,module,exports){
"use strict";
var unload = require('./index.js');
window['unload'] = unload;
},{"./index.js":3}],3:[function(require,module,exports){
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.add = add;
exports.runAll = runAll;
exports.removeAll = removeAll;
exports.getSize = getSize;
exports["default"] = void 0;
var _detectNode = _interopRequireDefault(require("detect-node"));
var _browser = _interopRequireDefault(require("./browser.js"));
var _node = _interopRequireDefault(require("./node.js"));
var USE_METHOD = _detectNode["default"] ? _node["default"] : _browser["default"];
var LISTENERS = new Set();
var startedListening = false;
function startListening() {
if (startedListening) return;
startedListening = true;
USE_METHOD.add(runAll);
}
function add(fn) {
startListening();
if (typeof fn !== 'function') throw new Error('Listener is no function');
LISTENERS.add(fn);
var addReturn = {
remove: function remove() {
return LISTENERS["delete"](fn);
},
run: function run() {
LISTENERS["delete"](fn);
return fn();
}
};
return addReturn;
}
function runAll() {
var promises = [];
LISTENERS.forEach(function (fn) {
promises.push(fn());
LISTENERS["delete"](fn);
});
return Promise.all(promises);
}
function removeAll() {
LISTENERS.clear();
}
function getSize() {
return LISTENERS.size;
}
var _default = {
add: add,
runAll: runAll,
removeAll: removeAll,
getSize: getSize
};
exports["default"] = _default;
},{"./browser.js":1,"./node.js":5,"@babel/runtime/helpers/interopRequireDefault":4,"detect-node":6}],4:[function(require,module,exports){
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault;
},{}],5:[function(require,module,exports){
},{}],6:[function(require,module,exports){
module.exports = false;
},{}]},{},[2]);

35
frontend/node_modules/unload/dist/es/browser.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
/* global WorkerGlobalScope */
function add(fn) {
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {// this is run inside of a webworker
} else {
/**
* if we are on react-native, there is no window.addEventListener
* @link https://github.com/pubkey/unload/issues/6
*/
if (typeof window.addEventListener !== 'function') return;
/**
* for normal browser-windows, we use the beforeunload-event
*/
window.addEventListener('beforeunload', function () {
fn();
}, true);
/**
* for iframes, we have to use the unload-event
* @link https://stackoverflow.com/q/47533670/3443137
*/
window.addEventListener('unload', function () {
fn();
}, true);
}
/**
* TODO add fallback for safari-mobile
* @link https://stackoverflow.com/a/26193516/3443137
*/
}
export default {
add: add
};

View File

@@ -0,0 +1,3 @@
var unload = require('./index.js');
window['unload'] = unload;

48
frontend/node_modules/unload/dist/es/index.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
import isNode from 'detect-node';
import BrowserMethod from './browser.js';
import NodeMethod from './node.js';
var USE_METHOD = isNode ? NodeMethod : BrowserMethod;
var LISTENERS = new Set();
var startedListening = false;
function startListening() {
if (startedListening) return;
startedListening = true;
USE_METHOD.add(runAll);
}
export function add(fn) {
startListening();
if (typeof fn !== 'function') throw new Error('Listener is no function');
LISTENERS.add(fn);
var addReturn = {
remove: function remove() {
return LISTENERS["delete"](fn);
},
run: function run() {
LISTENERS["delete"](fn);
return fn();
}
};
return addReturn;
}
export function runAll() {
var promises = [];
LISTENERS.forEach(function (fn) {
promises.push(fn());
LISTENERS["delete"](fn);
});
return Promise.all(promises);
}
export function removeAll() {
LISTENERS.clear();
}
export function getSize() {
return LISTENERS.size;
}
export default {
add: add,
runAll: runAll,
removeAll: removeAll,
getSize: getSize
};

41
frontend/node_modules/unload/dist/es/node.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
// set to true to log events
var DEBUG = false;
function add(fn) {
process.on('exit', function () {
DEBUG && console.log('node: exit');
return fn();
});
/**
* on the following events,
* the process will not end if there are
* event-handlers attached,
* therefore we have to call process.exit()
*/
process.on('beforeExit', function () {
DEBUG && console.log('node: beforeExit');
return fn().then(function () {
return process.exit();
});
}); // catches ctrl+c event
process.on('SIGINT', function () {
DEBUG && console.log('node: SIGNINT');
return fn().then(function () {
return process.exit();
});
}); // catches uncaught exceptions
process.on('uncaughtException', function (err) {
DEBUG && console.log('node: uncaughtException');
return fn().then(function () {
console.trace(err);
process.exit(1);
});
});
}
export default {
add: add
};

43
frontend/node_modules/unload/dist/lib/browser.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
/* global WorkerGlobalScope */
function add(fn) {
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {// this is run inside of a webworker
} else {
/**
* if we are on react-native, there is no window.addEventListener
* @link https://github.com/pubkey/unload/issues/6
*/
if (typeof window.addEventListener !== 'function') return;
/**
* for normal browser-windows, we use the beforeunload-event
*/
window.addEventListener('beforeunload', function () {
fn();
}, true);
/**
* for iframes, we have to use the unload-event
* @link https://stackoverflow.com/q/47533670/3443137
*/
window.addEventListener('unload', function () {
fn();
}, true);
}
/**
* TODO add fallback for safari-mobile
* @link https://stackoverflow.com/a/26193516/3443137
*/
}
var _default = {
add: add
};
exports["default"] = _default;

View File

@@ -0,0 +1,5 @@
"use strict";
var unload = require('./index.js');
window['unload'] = unload;

69
frontend/node_modules/unload/dist/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,69 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.add = add;
exports.runAll = runAll;
exports.removeAll = removeAll;
exports.getSize = getSize;
exports["default"] = void 0;
var _detectNode = _interopRequireDefault(require("detect-node"));
var _browser = _interopRequireDefault(require("./browser.js"));
var _node = _interopRequireDefault(require("./node.js"));
var USE_METHOD = _detectNode["default"] ? _node["default"] : _browser["default"];
var LISTENERS = new Set();
var startedListening = false;
function startListening() {
if (startedListening) return;
startedListening = true;
USE_METHOD.add(runAll);
}
function add(fn) {
startListening();
if (typeof fn !== 'function') throw new Error('Listener is no function');
LISTENERS.add(fn);
var addReturn = {
remove: function remove() {
return LISTENERS["delete"](fn);
},
run: function run() {
LISTENERS["delete"](fn);
return fn();
}
};
return addReturn;
}
function runAll() {
var promises = [];
LISTENERS.forEach(function (fn) {
promises.push(fn());
LISTENERS["delete"](fn);
});
return Promise.all(promises);
}
function removeAll() {
LISTENERS.clear();
}
function getSize() {
return LISTENERS.size;
}
var _default = {
add: add,
runAll: runAll,
removeAll: removeAll,
getSize: getSize
};
exports["default"] = _default;

48
frontend/node_modules/unload/dist/lib/node.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
// set to true to log events
var DEBUG = false;
function add(fn) {
process.on('exit', function () {
DEBUG && console.log('node: exit');
return fn();
});
/**
* on the following events,
* the process will not end if there are
* event-handlers attached,
* therefore we have to call process.exit()
*/
process.on('beforeExit', function () {
DEBUG && console.log('node: beforeExit');
return fn().then(function () {
return process.exit();
});
}); // catches ctrl+c event
process.on('SIGINT', function () {
DEBUG && console.log('node: SIGNINT');
return fn().then(function () {
return process.exit();
});
}); // catches uncaught exceptions
process.on('uncaughtException', function (err) {
DEBUG && console.log('node: uncaughtException');
return fn().then(function () {
console.trace(err);
process.exit(1);
});
});
}
var _default = {
add: add
};
exports["default"] = _default;