@bbn/bbn 1.0.35 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +827 -1109
- package/dist/fn/_addLoader.js +5 -5
- package/dist/fn/_compareValues.js +2 -3
- package/dist/fn/_deleteLoader.js +11 -13
- package/dist/fn/abort.js +2 -2
- package/dist/fn/abortURL.js +2 -2
- package/dist/fn/addColors.js +12 -12
- package/dist/fn/addInputs.js +10 -12
- package/dist/fn/addStyle.js +2 -2
- package/dist/fn/adjustHeight.js +2 -2
- package/dist/fn/adjustSize.js +6 -6
- package/dist/fn/adjustWidth.js +2 -2
- package/dist/fn/ajax.js +21 -21
- package/dist/fn/analyzeFunction.js +28 -28
- package/dist/fn/animateCss.js +5 -6
- package/dist/fn/arrayBuffer2String.js +1 -1
- package/dist/fn/arrayFromProp.js +3 -3
- package/dist/fn/autoExtend.js +1 -1
- package/dist/fn/baseName.js +4 -4
- package/dist/fn/br2nl.js +1 -1
- package/dist/fn/calendar.js +2 -2
- package/dist/fn/callback.js +7 -11
- package/dist/fn/camelToCss.js +1 -1
- package/dist/fn/camelize.js +1 -1
- package/dist/fn/canvasToImage.js +2 -2
- package/dist/fn/center.js +2 -2
- package/dist/fn/checkProps.js +1 -2
- package/dist/fn/checkPropsDetails.js +8 -9
- package/dist/fn/checkPropsOrDie.js +2 -3
- package/dist/fn/checkType.js +6 -11
- package/dist/fn/chrono.js +8 -8
- package/dist/fn/circularReplacer.js +3 -3
- package/dist/fn/clone.js +3 -3
- package/dist/fn/colorToHex.js +2 -2
- package/dist/fn/compare.js +1 -1
- package/dist/fn/compareConditions.js +7 -7
- package/dist/fn/copy.js +6 -8
- package/dist/fn/correctCase.js +2 -2
- package/dist/fn/count.js +1 -3
- package/dist/fn/crc32.js +8 -8
- package/dist/fn/createObject.js +3 -16
- package/dist/fn/cssExists.js +6 -6
- package/dist/fn/date.js +2 -2
- package/dist/fn/dateSQL.js +2 -2
- package/dist/fn/daysInMonth.js +2 -2
- package/dist/fn/deepPath.js +6 -7
- package/dist/fn/defaultAjaxAbortFunction.js +1 -2
- package/dist/fn/defaultAjaxErrorFunction.js +1 -1
- package/dist/fn/defaultAlertFunction.js +1 -1
- package/dist/fn/defaultConfirmFunction.js +2 -2
- package/dist/fn/defaultEndLoadingFunction.js +1 -1
- package/dist/fn/defaultErrorFunction.js +1 -1
- package/dist/fn/defaultHistoryFunction.js +1 -1
- package/dist/fn/defaultLinkFunction.js +1 -1
- package/dist/fn/defaultPostLinkFunction.js +1 -1
- package/dist/fn/defaultPreLinkFunction.js +1 -1
- package/dist/fn/defaultResizeFunction.js +1 -1
- package/dist/fn/defaultStartLoadingFunction.js +1 -2
- package/dist/fn/deleteProp.js +1 -1
- package/dist/fn/diffObj.js +11 -13
- package/dist/fn/dirName.js +2 -2
- package/dist/fn/download.js +6 -6
- package/dist/fn/downloadContent.js +5 -5
- package/dist/fn/each.js +3 -3
- package/dist/fn/eraseCookie.js +1 -1
- package/dist/fn/error.js +3 -3
- package/dist/fn/escapeDquotes.js +1 -1
- package/dist/fn/escapeRegExp.js +1 -1
- package/dist/fn/escapeSquotes.js +1 -1
- package/dist/fn/escapeTicks.js +1 -1
- package/dist/fn/escapeUrl.js +7 -7
- package/dist/fn/extend.js +9 -13
- package/dist/fn/extendOut.js +4 -9
- package/dist/fn/fdate.js +2 -2
- package/dist/fn/fdatetime.js +2 -2
- package/dist/fn/fieldValue.js +2 -2
- package/dist/fn/fileExt.js +2 -2
- package/dist/fn/filter.js +6 -8
- package/dist/fn/filterToConditions.js +6 -7
- package/dist/fn/findAll.js +4 -5
- package/dist/fn/fori.js +3 -5
- package/dist/fn/forir.js +3 -5
- package/dist/fn/format.js +5 -5
- package/dist/fn/formatBytes.js +2 -3
- package/dist/fn/formatDate.js +1 -1
- package/dist/fn/formatSize.js +1 -1
- package/dist/fn/formdata.js +25 -25
- package/dist/fn/fromXml.js +8 -14
- package/dist/fn/ftime.js +2 -2
- package/dist/fn/getAllTags.js +2 -2
- package/dist/fn/getAncestors.js +2 -2
- package/dist/fn/getAttributes.js +3 -3
- package/dist/fn/getBrowserName.js +2 -2
- package/dist/fn/getBrowserVersion.js +2 -2
- package/dist/fn/getCookie.js +6 -6
- package/dist/fn/getCssVar.js +1 -1
- package/dist/fn/getDay.js +4 -4
- package/dist/fn/getDeviceType.js +2 -2
- package/dist/fn/getEventData.js +31 -31
- package/dist/fn/getField.js +2 -5
- package/dist/fn/getFieldValues.js +3 -3
- package/dist/fn/getHTMLOfSelection.js +5 -5
- package/dist/fn/getHtml.js +2 -3
- package/dist/fn/getLoader.js +2 -2
- package/dist/fn/getPath.js +16 -23
- package/dist/fn/getProp.js +1 -1
- package/dist/fn/getProperty.js +2 -2
- package/dist/fn/getRequestId.js +3 -3
- package/dist/fn/getRow.js +1 -3
- package/dist/fn/getScrollBarSize.js +6 -6
- package/dist/fn/getText.js +1 -1
- package/dist/fn/getTimeoff.js +1 -1
- package/dist/fn/happy.js +1 -5
- package/dist/fn/hash.js +4 -4
- package/dist/fn/hex2rgb.js +1 -1
- package/dist/fn/history.js +1 -1
- package/dist/fn/html2text.js +2 -2
- package/dist/fn/imageToCanvas.js +2 -2
- package/dist/fn/imgToBase64.js +2 -3
- package/dist/fn/info.js +1 -5
- package/dist/fn/init.js +17 -17
- package/dist/fn/isActiveInterface.js +2 -3
- package/dist/fn/isArray.js +2 -7
- package/dist/fn/isBlob.js +2 -7
- package/dist/fn/isBoolean.js +2 -7
- package/dist/fn/isCanvas.js +2 -7
- package/dist/fn/isColor.js +2 -7
- package/dist/fn/isComment.js +2 -7
- package/dist/fn/isCp.js +3 -8
- package/dist/fn/isDate.js +2 -7
- package/dist/fn/isDesktopDevice.js +1 -1
- package/dist/fn/isDimension.js +2 -7
- package/dist/fn/isDom.js +2 -7
- package/dist/fn/isEmail.js +3 -8
- package/dist/fn/isEmpty.js +1 -1
- package/dist/fn/isEvent.js +2 -7
- package/dist/fn/isFocused.js +1 -1
- package/dist/fn/isFunction.js +2 -7
- package/dist/fn/isHostname.js +2 -7
- package/dist/fn/isIP.js +2 -7
- package/dist/fn/isInside.js +6 -6
- package/dist/fn/isInt.js +2 -7
- package/dist/fn/isIterable.js +1 -1
- package/dist/fn/isMobile.js +1 -1
- package/dist/fn/isMobileDevice.js +1 -1
- package/dist/fn/isNull.js +2 -7
- package/dist/fn/isNumber.js +2 -7
- package/dist/fn/isObject.js +2 -7
- package/dist/fn/isPercent.js +2 -7
- package/dist/fn/isPrimitive.js +2 -7
- package/dist/fn/isPromise.js +2 -7
- package/dist/fn/isPropSize.js +3 -3
- package/dist/fn/isSQLDate.js +2 -7
- package/dist/fn/isSame.js +7 -7
- package/dist/fn/isString.js +2 -7
- package/dist/fn/isSymbol.js +2 -7
- package/dist/fn/isTabletDevice.js +1 -1
- package/dist/fn/isURL.js +2 -7
- package/dist/fn/isValidDimension.js +3 -3
- package/dist/fn/isValidName.js +2 -7
- package/dist/fn/isValue.js +2 -7
- package/dist/fn/isVue.js +4 -11
- package/dist/fn/iterate.js +3 -5
- package/dist/fn/lightenDarkenHex.js +3 -3
- package/dist/fn/link.js +7 -11
- package/dist/fn/log.js +6 -10
- package/dist/fn/makeReactive.js +24 -28
- package/dist/fn/map.js +2 -3
- package/dist/fn/md5.js +1 -1
- package/dist/fn/money.js +5 -5
- package/dist/fn/move.js +2 -2
- package/dist/fn/multiorder.js +6 -7
- package/dist/fn/nl2br.js +1 -1
- package/dist/fn/numProperties.js +1 -1
- package/dist/fn/objectToFormData.js +5 -7
- package/dist/fn/order.js +1 -2
- package/dist/fn/outerHeight.js +3 -3
- package/dist/fn/outerWidth.js +3 -3
- package/dist/fn/percent.js +1 -1
- package/dist/fn/pickValue.js +1 -1
- package/dist/fn/post.js +3 -7
- package/dist/fn/postOut.js +2 -2
- package/dist/fn/printf.js +1 -1
- package/dist/fn/quotes2html.js +1 -1
- package/dist/fn/randomInt.js +1 -1
- package/dist/fn/randomString.js +6 -6
- package/dist/fn/removeAccents.js +1 -1
- package/dist/fn/removeEmpty.js +3 -3
- package/dist/fn/removeExtraSpaces.js +1 -1
- package/dist/fn/removeHtmlComments.js +1 -1
- package/dist/fn/removePrivateProp.js +2 -3
- package/dist/fn/removeTrailingChars.js +1 -1
- package/dist/fn/repeat.js +1 -1
- package/dist/fn/replaceAll.js +1 -2
- package/dist/fn/replaceSelection.js +6 -6
- package/dist/fn/resize.js +15 -15
- package/dist/fn/rgb2hex.js +1 -1
- package/dist/fn/riterate.js +1 -1
- package/dist/fn/roundDecimal.js +1 -1
- package/dist/fn/sanitize.js +6 -7
- package/dist/fn/search.js +6 -9
- package/dist/fn/selectElementText.js +4 -4
- package/dist/fn/selector.js +1 -1
- package/dist/fn/setCookie.js +4 -4
- package/dist/fn/setCssVar.js +1 -1
- package/dist/fn/setNavigationVars.js +5 -5
- package/dist/fn/setProp.js +1 -3
- package/dist/fn/setProperty.js +9 -9
- package/dist/fn/shorten.js +1 -1
- package/dist/fn/shortenObj.js +3 -4
- package/dist/fn/shuffle.js +3 -4
- package/dist/fn/simpleHash.js +3 -3
- package/dist/fn/simpleHash1.js +4 -4
- package/dist/fn/simpleHash2.js +4 -4
- package/dist/fn/stat.js +1 -1
- package/dist/fn/string2ArrayBuffer.js +1 -1
- package/dist/fn/submit.js +3 -3
- package/dist/fn/substr.js +1 -1
- package/dist/fn/sum.js +4 -4
- package/dist/fn/timestamp.js +1 -1
- package/dist/fn/toCSV.js +7 -10
- package/dist/fn/toggleFullScreen.js +1 -1
- package/dist/fn/translate.js +3 -3
- package/dist/fn/treatAjaxArguments.js +4 -4
- package/dist/fn/trim.js +1 -2
- package/dist/fn/uniqString.js +7 -14
- package/dist/fn/unique.js +1 -1
- package/dist/fn/upload.js +6 -6
- package/dist/fn/warning.js +3 -3
- package/dist/index.js +237 -241
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -1,36 +1,22 @@
|
|
|
1
|
-
(
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
(() => {
|
|
2
|
+
const defines = {};
|
|
3
|
+
const entry = [null];
|
|
4
4
|
function define(name, dependencies, factory) {
|
|
5
|
-
defines[name] = { dependencies
|
|
5
|
+
defines[name] = { dependencies, factory };
|
|
6
6
|
entry[0] = name;
|
|
7
7
|
}
|
|
8
|
-
define("require", ["exports"],
|
|
8
|
+
define("require", ["exports"], (exports) => {
|
|
9
9
|
Object.defineProperty(exports, "__cjsModule", { value: true });
|
|
10
|
-
Object.defineProperty(exports, "default", { value:
|
|
10
|
+
Object.defineProperty(exports, "default", { value: (name) => resolve(name) });
|
|
11
11
|
});
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
12
|
define("fn/isString", ["require", "exports"], function (require, exports) {
|
|
22
13
|
"use strict";
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.isString = void 0;
|
|
25
|
-
|
|
26
|
-
var args = [];
|
|
27
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
28
|
-
args[_i] = arguments[_i];
|
|
29
|
-
}
|
|
16
|
+
const isString = function (...args) {
|
|
30
17
|
if (!args.length)
|
|
31
18
|
return false;
|
|
32
|
-
for (
|
|
33
|
-
var a = args_1[_a];
|
|
19
|
+
for (let a of args) {
|
|
34
20
|
if ({}.toString.apply(a) !== '[object String]') {
|
|
35
21
|
return false;
|
|
36
22
|
}
|
|
@@ -43,15 +29,10 @@
|
|
|
43
29
|
"use strict";
|
|
44
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
31
|
exports.isInt = void 0;
|
|
46
|
-
|
|
47
|
-
var args = [];
|
|
48
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
49
|
-
args[_i] = arguments[_i];
|
|
50
|
-
}
|
|
32
|
+
const isInt = function (...args) {
|
|
51
33
|
if (!args.length)
|
|
52
34
|
return false;
|
|
53
|
-
for (
|
|
54
|
-
var a = args_2[_a];
|
|
35
|
+
for (let a of args) {
|
|
55
36
|
if (!Number.isInteger(a)) {
|
|
56
37
|
return false;
|
|
57
38
|
}
|
|
@@ -64,15 +45,10 @@
|
|
|
64
45
|
"use strict";
|
|
65
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
47
|
exports.isFunction = void 0;
|
|
67
|
-
|
|
68
|
-
var args = [];
|
|
69
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
70
|
-
args[_i] = arguments[_i];
|
|
71
|
-
}
|
|
48
|
+
const isFunction = function (...args) {
|
|
72
49
|
if (!args.length)
|
|
73
50
|
return false;
|
|
74
|
-
for (
|
|
75
|
-
var obj = args_3[_a];
|
|
51
|
+
for (let obj of args) {
|
|
76
52
|
if (!(obj && obj.constructor && obj.call && obj.apply)) {
|
|
77
53
|
return false;
|
|
78
54
|
}
|
|
@@ -85,15 +61,11 @@
|
|
|
85
61
|
"use strict";
|
|
86
62
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
87
63
|
exports.log = void 0;
|
|
88
|
-
|
|
89
|
-
var args = [];
|
|
90
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
91
|
-
args[_i] = arguments[_i];
|
|
92
|
-
}
|
|
64
|
+
const log = function (...args) {
|
|
93
65
|
if (window.console !== undefined) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
66
|
+
let cfg;
|
|
67
|
+
let level = 5;
|
|
68
|
+
let fn = 'log';
|
|
97
69
|
if (args[0] && typeof args[0] === 'object' && args[0]._bbn_console_style) {
|
|
98
70
|
if (args[0]._bbn_console_mode && (0, isFunction_1.isFunction)(console[args[0]._bbn_console_mode])) {
|
|
99
71
|
fn = args[0]._bbn_console_mode;
|
|
@@ -105,9 +77,9 @@
|
|
|
105
77
|
args.shift();
|
|
106
78
|
}
|
|
107
79
|
if (bbn.env.loggingLevel >= level) {
|
|
108
|
-
|
|
80
|
+
let i = 0;
|
|
109
81
|
while (i < args.length) {
|
|
110
|
-
|
|
82
|
+
let t = typeof args[i];
|
|
111
83
|
if (t === 'string' || t === 'number') {
|
|
112
84
|
window.console[fn]('%c %s ', cfg, args[i]);
|
|
113
85
|
}
|
|
@@ -126,7 +98,7 @@
|
|
|
126
98
|
"use strict";
|
|
127
99
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
128
100
|
exports.substr = void 0;
|
|
129
|
-
|
|
101
|
+
const substr = function (str, from, length) {
|
|
130
102
|
if (!(0, isString_1.isString)(str) || !(0, isInt_1.isInt)(from)) {
|
|
131
103
|
(0, log_1.log)(arguments);
|
|
132
104
|
throw new Error(bbn._('The substr function should be applied to a string and at least a `from` argument should be given'));
|
|
@@ -145,13 +117,13 @@
|
|
|
145
117
|
"use strict";
|
|
146
118
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
147
119
|
exports._addLoader = void 0;
|
|
148
|
-
|
|
120
|
+
const _addLoader = function (requestId, prom, source) {
|
|
149
121
|
/** @var {Number} tst Current timestamp */
|
|
150
|
-
|
|
122
|
+
let tst = (new Date()).getTime();
|
|
151
123
|
/** @var {String} url The original URL (part of requestId before : and md5) */
|
|
152
|
-
|
|
124
|
+
let url = (0, substr_1.substr)(requestId, 0, requestId.length - 33);
|
|
153
125
|
/** @var {Object} loader The loader object */
|
|
154
|
-
|
|
126
|
+
let loader = {
|
|
155
127
|
key: requestId,
|
|
156
128
|
url: url,
|
|
157
129
|
loader: prom,
|
|
@@ -168,7 +140,7 @@
|
|
|
168
140
|
// Adding an object with this loader info in bbn.env.loadersHistory
|
|
169
141
|
bbn.env.loadersHistory.unshift(loader);
|
|
170
142
|
/** @var {Number} idx A pointer starting at the end of array loadersHistory */
|
|
171
|
-
|
|
143
|
+
let idx = bbn.env.loadersHistory.length;
|
|
172
144
|
// Removing elements from the loadersHistory object if their number is higher
|
|
173
145
|
// than bbn.env.maxLoadersHistory
|
|
174
146
|
while (idx && (bbn.env.loadersHistory.length > bbn.env.maxLoadersHistory)) {
|
|
@@ -186,9 +158,9 @@
|
|
|
186
158
|
"use strict";
|
|
187
159
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
188
160
|
exports.getProperty = void 0;
|
|
189
|
-
|
|
161
|
+
const getProperty = function (obj, prop) {
|
|
190
162
|
if (typeof obj === 'object' && typeof prop === 'string') {
|
|
191
|
-
return prop.split('.').reduce(
|
|
163
|
+
return prop.split('.').reduce((o, i) => {
|
|
192
164
|
if (o) {
|
|
193
165
|
return o[i];
|
|
194
166
|
}
|
|
@@ -202,7 +174,7 @@
|
|
|
202
174
|
"use strict";
|
|
203
175
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
204
176
|
exports.removeAccents = void 0;
|
|
205
|
-
|
|
177
|
+
const removeAccents = function (st) {
|
|
206
178
|
if (!(0, isString_2.isString)(st)) {
|
|
207
179
|
if (st.toString) {
|
|
208
180
|
st = st.toString();
|
|
@@ -220,15 +192,10 @@
|
|
|
220
192
|
"use strict";
|
|
221
193
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
222
194
|
exports.isDate = void 0;
|
|
223
|
-
|
|
224
|
-
var args = [];
|
|
225
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
226
|
-
args[_i] = arguments[_i];
|
|
227
|
-
}
|
|
195
|
+
const isDate = function (...args) {
|
|
228
196
|
if (!args.length)
|
|
229
197
|
return false;
|
|
230
|
-
for (
|
|
231
|
-
var a = args_4[_a];
|
|
198
|
+
for (let a of args) {
|
|
232
199
|
if ({}.toString.apply(a) !== '[object Date]') {
|
|
233
200
|
return false;
|
|
234
201
|
}
|
|
@@ -241,9 +208,8 @@
|
|
|
241
208
|
"use strict";
|
|
242
209
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
243
210
|
exports._compareValues = void 0;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
var va = (0, getProperty_1.getProperty)(a, prop), vb = (0, getProperty_1.getProperty)(b, prop), ta = (typeof (va)).toLowerCase(), tb = (typeof (vb)).toLowerCase();
|
|
211
|
+
const _compareValues = function (a, b, prop, dir = 'asc') {
|
|
212
|
+
let va = (0, getProperty_1.getProperty)(a, prop), vb = (0, getProperty_1.getProperty)(b, prop), ta = (typeof (va)).toLowerCase(), tb = (typeof (vb)).toLowerCase();
|
|
247
213
|
if ((dir !== 'asc') && (0, isString_3.isString)(dir) && (dir.toLowerCase() === 'desc')) {
|
|
248
214
|
dir = 'desc';
|
|
249
215
|
}
|
|
@@ -283,7 +249,7 @@
|
|
|
283
249
|
"use strict";
|
|
284
250
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
285
251
|
exports.isIterable = void 0;
|
|
286
|
-
|
|
252
|
+
const isIterable = function (v) {
|
|
287
253
|
return v && typeof v === 'object' && Symbol.iterator in Object(v);
|
|
288
254
|
};
|
|
289
255
|
exports.isIterable = isIterable;
|
|
@@ -292,15 +258,10 @@
|
|
|
292
258
|
"use strict";
|
|
293
259
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
294
260
|
exports.isArray = void 0;
|
|
295
|
-
|
|
296
|
-
var args = [];
|
|
297
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
298
|
-
args[_i] = arguments[_i];
|
|
299
|
-
}
|
|
261
|
+
const isArray = function (...args) {
|
|
300
262
|
if (!args.length)
|
|
301
263
|
return false;
|
|
302
|
-
for (
|
|
303
|
-
var a = args_5[_a];
|
|
264
|
+
for (let a of args) {
|
|
304
265
|
if (!Array.isArray(a)) {
|
|
305
266
|
return false;
|
|
306
267
|
}
|
|
@@ -313,15 +274,10 @@
|
|
|
313
274
|
"use strict";
|
|
314
275
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
315
276
|
exports.isNumber = void 0;
|
|
316
|
-
|
|
317
|
-
var args = [];
|
|
318
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
319
|
-
args[_i] = arguments[_i];
|
|
320
|
-
}
|
|
277
|
+
const isNumber = function (...args) {
|
|
321
278
|
if (!args.length)
|
|
322
279
|
return false;
|
|
323
|
-
for (
|
|
324
|
-
var a = args_6[_a];
|
|
280
|
+
for (let a of args) {
|
|
325
281
|
if (['boolean', 'object', 'symbol'].includes(typeof a) || a === '' || isNaN(a)) {
|
|
326
282
|
return false;
|
|
327
283
|
}
|
|
@@ -334,9 +290,8 @@
|
|
|
334
290
|
"use strict";
|
|
335
291
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
336
292
|
exports.removePrivateProp = void 0;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
var r = null;
|
|
293
|
+
const removePrivateProp = function (obj, deep = false) {
|
|
294
|
+
let r = null;
|
|
340
295
|
if (typeof obj === 'object') {
|
|
341
296
|
r = {};
|
|
342
297
|
for (var n in obj) {
|
|
@@ -358,15 +313,13 @@
|
|
|
358
313
|
"use strict";
|
|
359
314
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
360
315
|
exports.iterate = void 0;
|
|
361
|
-
|
|
362
|
-
if (noPrivate === void 0) { noPrivate = false; }
|
|
363
|
-
if (reverse === void 0) { reverse = false; }
|
|
316
|
+
const iterate = function (obj, fn, noPrivate = false, reverse = false) {
|
|
364
317
|
if (obj !== null && typeof obj === 'object') {
|
|
365
|
-
|
|
318
|
+
let iter = Object.keys(noPrivate ? (0, removePrivateProp_1.removePrivateProp)(obj) : obj);
|
|
366
319
|
if (reverse) {
|
|
367
320
|
iter.reverse();
|
|
368
321
|
}
|
|
369
|
-
(0, each_1.each)(iter,
|
|
322
|
+
(0, each_1.each)(iter, (prop) => {
|
|
370
323
|
if (fn(obj[prop], prop) === false) {
|
|
371
324
|
return false;
|
|
372
325
|
}
|
|
@@ -380,9 +333,9 @@
|
|
|
380
333
|
"use strict";
|
|
381
334
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
382
335
|
exports.each = void 0;
|
|
383
|
-
|
|
336
|
+
const each = function (arr, fn) {
|
|
384
337
|
if ((0, isNumber_1.isNumber)(arr) && arr > 0) {
|
|
385
|
-
for (
|
|
338
|
+
for (let i = 0; i < arr; i++) {
|
|
386
339
|
if (fn(i, i) === false) {
|
|
387
340
|
return;
|
|
388
341
|
}
|
|
@@ -390,7 +343,7 @@
|
|
|
390
343
|
return;
|
|
391
344
|
}
|
|
392
345
|
if ((0, isIterable_1.isIterable)(arr)) {
|
|
393
|
-
for (
|
|
346
|
+
for (let i = 0; i < arr.length; i++) {
|
|
394
347
|
if (fn(arr[i], i) === false) {
|
|
395
348
|
return;
|
|
396
349
|
}
|
|
@@ -405,7 +358,7 @@
|
|
|
405
358
|
"use strict";
|
|
406
359
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
407
360
|
exports.numProperties = void 0;
|
|
408
|
-
|
|
361
|
+
const numProperties = function (obj) {
|
|
409
362
|
if (!obj || typeof obj !== 'object') {
|
|
410
363
|
return 0;
|
|
411
364
|
}
|
|
@@ -417,7 +370,7 @@
|
|
|
417
370
|
"use strict";
|
|
418
371
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
419
372
|
exports.isEmpty = void 0;
|
|
420
|
-
|
|
373
|
+
const isEmpty = function (obj) {
|
|
421
374
|
if (!obj) {
|
|
422
375
|
return true;
|
|
423
376
|
}
|
|
@@ -438,15 +391,10 @@
|
|
|
438
391
|
"use strict";
|
|
439
392
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
440
393
|
exports.isNull = void 0;
|
|
441
|
-
|
|
442
|
-
var args = [];
|
|
443
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
444
|
-
args[_i] = arguments[_i];
|
|
445
|
-
}
|
|
394
|
+
const isNull = function (...args) {
|
|
446
395
|
if (!args.length)
|
|
447
396
|
return false;
|
|
448
|
-
for (
|
|
449
|
-
var a = args_7[_a];
|
|
397
|
+
for (let a of args) {
|
|
450
398
|
if ({}.toString.apply(a) !== '[object Null]') {
|
|
451
399
|
return false;
|
|
452
400
|
}
|
|
@@ -459,15 +407,10 @@
|
|
|
459
407
|
"use strict";
|
|
460
408
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
461
409
|
exports.isObject = void 0;
|
|
462
|
-
|
|
463
|
-
var args = [];
|
|
464
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
465
|
-
args[_i] = arguments[_i];
|
|
466
|
-
}
|
|
410
|
+
const isObject = function (...args) {
|
|
467
411
|
if (!args.length)
|
|
468
412
|
return false;
|
|
469
|
-
for (
|
|
470
|
-
var a = args_8[_a];
|
|
413
|
+
for (let a of args) {
|
|
471
414
|
if ({}.toString.apply(a) !== '[object Object]') {
|
|
472
415
|
return false;
|
|
473
416
|
}
|
|
@@ -480,15 +423,10 @@
|
|
|
480
423
|
"use strict";
|
|
481
424
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
482
425
|
exports.isDom = void 0;
|
|
483
|
-
|
|
484
|
-
var args = [];
|
|
485
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
486
|
-
args[_i] = arguments[_i];
|
|
487
|
-
}
|
|
426
|
+
const isDom = function (...args) {
|
|
488
427
|
if (!args.length)
|
|
489
428
|
return false;
|
|
490
|
-
for (
|
|
491
|
-
var a = args_9[_a];
|
|
429
|
+
for (let a of args) {
|
|
492
430
|
if (!(a instanceof HTMLElement)) {
|
|
493
431
|
return false;
|
|
494
432
|
}
|
|
@@ -501,18 +439,13 @@
|
|
|
501
439
|
"use strict";
|
|
502
440
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
503
441
|
exports.isCp = void 0;
|
|
504
|
-
|
|
505
|
-
var args = [];
|
|
506
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
507
|
-
args[_i] = arguments[_i];
|
|
508
|
-
}
|
|
442
|
+
const isCp = function (...args) {
|
|
509
443
|
if (!args.length) {
|
|
510
444
|
return false;
|
|
511
445
|
}
|
|
512
446
|
if ('cp' in bbn && 'isComponent' in bbn['cp'] && (typeof bbn['cp'].isComponent === 'function')) {
|
|
513
|
-
for (
|
|
514
|
-
|
|
515
|
-
var res = bbn.cp.isComponent(a);
|
|
447
|
+
for (let a of args) {
|
|
448
|
+
let res = bbn.cp.isComponent(a);
|
|
516
449
|
if (!res || (0, isDom_1.isDom)(res) || !res.$el) {
|
|
517
450
|
return false;
|
|
518
451
|
}
|
|
@@ -527,9 +460,9 @@
|
|
|
527
460
|
"use strict";
|
|
528
461
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
529
462
|
exports.circularReplacer = void 0;
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
return
|
|
463
|
+
const circularReplacer = function () {
|
|
464
|
+
const visited = new WeakSet();
|
|
465
|
+
return (key, value) => {
|
|
533
466
|
if (typeof value === 'object' && value !== null) {
|
|
534
467
|
if (visited.has(value)) {
|
|
535
468
|
return;
|
|
@@ -562,10 +495,10 @@
|
|
|
562
495
|
"use strict";
|
|
563
496
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
564
497
|
exports.simpleHash1 = void 0;
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
for (
|
|
568
|
-
|
|
498
|
+
const simpleHash1 = function (str) {
|
|
499
|
+
let hash = 0;
|
|
500
|
+
for (let i = 0; i < str.length; i++) {
|
|
501
|
+
const char = str.charCodeAt(i);
|
|
569
502
|
hash = (hash << 5) - hash + char;
|
|
570
503
|
hash |= 0; // Convert to 32-bit integer
|
|
571
504
|
}
|
|
@@ -577,10 +510,10 @@
|
|
|
577
510
|
"use strict";
|
|
578
511
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
579
512
|
exports.simpleHash2 = void 0;
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
for (
|
|
583
|
-
|
|
513
|
+
const simpleHash2 = function (str) {
|
|
514
|
+
let hash = 0;
|
|
515
|
+
for (let i = 0; i < str.length; i++) {
|
|
516
|
+
const char = str.charCodeAt(i);
|
|
584
517
|
hash = char + (hash << 6) + (hash << 16) - hash;
|
|
585
518
|
hash |= 0; // Convert to 32-bit integer
|
|
586
519
|
}
|
|
@@ -592,9 +525,9 @@
|
|
|
592
525
|
"use strict";
|
|
593
526
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
594
527
|
exports.simpleHash = void 0;
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
528
|
+
const simpleHash = function (str) {
|
|
529
|
+
const part1 = (0, simpleHash1_1.simpleHash1)(str).toString(16).padStart(8, '0');
|
|
530
|
+
const part2 = (0, simpleHash2_1.simpleHash2)(str).toString(16).padStart(8, '0');
|
|
598
531
|
return part1 + part2;
|
|
599
532
|
};
|
|
600
533
|
exports.simpleHash = simpleHash;
|
|
@@ -603,12 +536,12 @@
|
|
|
603
536
|
"use strict";
|
|
604
537
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
605
538
|
exports.hash = void 0;
|
|
606
|
-
|
|
539
|
+
const hash = function (obj) {
|
|
607
540
|
//log(obj);
|
|
608
|
-
|
|
609
|
-
for (
|
|
541
|
+
let st = '__bbn__';
|
|
542
|
+
for (let i in arguments) {
|
|
610
543
|
if (arguments[i]) {
|
|
611
|
-
|
|
544
|
+
let value = arguments[i];
|
|
612
545
|
if ((0, isDom_3.isDom)(value)) {
|
|
613
546
|
if (value.bbnId) {
|
|
614
547
|
st += '__BBN_DOM__' + value.tagName + '/' + value.bbnId + value.bbnHash;
|
|
@@ -639,7 +572,7 @@
|
|
|
639
572
|
"use strict";
|
|
640
573
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
641
574
|
exports.isSame = void 0;
|
|
642
|
-
|
|
575
|
+
const isSame = function (obj1, obj2, done) {
|
|
643
576
|
if (!done) {
|
|
644
577
|
done = [];
|
|
645
578
|
}
|
|
@@ -647,25 +580,25 @@
|
|
|
647
580
|
return true;
|
|
648
581
|
}
|
|
649
582
|
if (obj1 && obj2 && typeof obj1 === 'object' && typeof obj2 === 'object') {
|
|
650
|
-
|
|
583
|
+
let tmp1 = Object.keys(obj1).sort(), tmp2 = Object.keys(obj2).sort();
|
|
651
584
|
// Case where the keys are different
|
|
652
585
|
if ((0, hash_1.hash)(tmp1) !== (0, hash_1.hash)(tmp2)) {
|
|
653
586
|
return false;
|
|
654
587
|
}
|
|
655
|
-
|
|
588
|
+
let ok = true;
|
|
656
589
|
if (obj1 && typeof obj1 === 'object') {
|
|
657
590
|
if (done.includes(obj1)) {
|
|
658
|
-
return
|
|
591
|
+
return ok;
|
|
659
592
|
}
|
|
660
593
|
done.push(obj1);
|
|
661
594
|
}
|
|
662
|
-
(0, each_2.each)(tmp1,
|
|
595
|
+
(0, each_2.each)(tmp1, (a) => {
|
|
663
596
|
if (!isSame(obj1[a], obj2[a])) {
|
|
664
|
-
|
|
597
|
+
ok = false;
|
|
665
598
|
return false;
|
|
666
599
|
}
|
|
667
600
|
});
|
|
668
|
-
return
|
|
601
|
+
return ok;
|
|
669
602
|
}
|
|
670
603
|
return false;
|
|
671
604
|
};
|
|
@@ -675,7 +608,7 @@
|
|
|
675
608
|
"use strict";
|
|
676
609
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
677
610
|
exports.compare = void 0;
|
|
678
|
-
|
|
611
|
+
const compare = function (v1, v2, operator) {
|
|
679
612
|
switch (operator) {
|
|
680
613
|
case '===':
|
|
681
614
|
case '=':
|
|
@@ -774,23 +707,23 @@
|
|
|
774
707
|
"use strict";
|
|
775
708
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
776
709
|
exports.compareConditions = void 0;
|
|
777
|
-
|
|
710
|
+
const compareConditions = function (data, filter) {
|
|
778
711
|
if (!filter.conditions || !filter.logic || !(0, isArray_2.isArray)(filter.conditions)) {
|
|
779
712
|
throw new Error('Error in compareConditions: the filter should an abject with conditions and logic properties and conditions should be an array of objects');
|
|
780
713
|
}
|
|
781
|
-
|
|
782
|
-
(0, each_3.each)(filter.conditions,
|
|
783
|
-
|
|
714
|
+
let ok = filter.logic === 'AND' ? true : false;
|
|
715
|
+
(0, each_3.each)(filter.conditions, (a) => {
|
|
716
|
+
let compare;
|
|
784
717
|
if (a.conditions && (0, isArray_2.isArray)(a.conditions)) {
|
|
785
718
|
compare = compareConditions(data, a);
|
|
786
719
|
}
|
|
787
720
|
else {
|
|
788
721
|
compare = compare((0, getProperty_2.getProperty)(data, a.field), a.value, a.operator);
|
|
789
722
|
if (compare) {
|
|
790
|
-
|
|
791
|
-
|
|
723
|
+
let bits = a.field.split('.');
|
|
724
|
+
let prop = bits.pop();
|
|
792
725
|
if (bits.length) {
|
|
793
|
-
(0, each_3.each)(bits,
|
|
726
|
+
(0, each_3.each)(bits, (b) => (data = data[b]));
|
|
794
727
|
}
|
|
795
728
|
// Case where both are undefined: value and prop which doesn't exist; they are not the same!
|
|
796
729
|
if ((0, getProperty_2.getProperty)(data, prop) === undefined && a.value !== undefined) {
|
|
@@ -817,19 +750,18 @@
|
|
|
817
750
|
"use strict";
|
|
818
751
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
819
752
|
exports.filterToConditions = void 0;
|
|
820
|
-
|
|
821
|
-
if (operator === void 0) { operator = '='; }
|
|
753
|
+
const filterToConditions = function (filter, operator = '=') {
|
|
822
754
|
if (!(0, isObject_2.isObject)(filter)) {
|
|
823
755
|
throw new Error('Error in filterToCondition: filter must be an object');
|
|
824
756
|
}
|
|
825
757
|
if (!filter.conditions || !(0, isArray_3.isArray)(filter.conditions)) {
|
|
826
|
-
|
|
827
|
-
(0, iterate_2.iterate)(filter,
|
|
758
|
+
let tmp = [];
|
|
759
|
+
(0, iterate_2.iterate)(filter, (a, n) => {
|
|
828
760
|
if ((0, isObject_2.isObject)(a) && typeof a.conditions === 'object') {
|
|
829
|
-
|
|
761
|
+
tmp.push(filterToConditions(a));
|
|
830
762
|
}
|
|
831
763
|
else {
|
|
832
|
-
|
|
764
|
+
tmp.push({
|
|
833
765
|
field: n,
|
|
834
766
|
operator: operator,
|
|
835
767
|
value: a,
|
|
@@ -837,7 +769,7 @@
|
|
|
837
769
|
}
|
|
838
770
|
});
|
|
839
771
|
filter = {
|
|
840
|
-
conditions:
|
|
772
|
+
conditions: tmp,
|
|
841
773
|
};
|
|
842
774
|
}
|
|
843
775
|
if (!filter.logic) {
|
|
@@ -851,18 +783,15 @@
|
|
|
851
783
|
"use strict";
|
|
852
784
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
853
785
|
exports.search = void 0;
|
|
854
|
-
|
|
855
|
-
if (val === void 0) { val = null; }
|
|
856
|
-
if (operator === void 0) { operator = '='; }
|
|
857
|
-
if (startFrom === void 0) { startFrom = 0; }
|
|
786
|
+
const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
|
|
858
787
|
if (!(0, isIterable_2.isIterable)(arr)) {
|
|
859
788
|
throw new Error(bbn._('The first argument for a search should be iterable') + ' ' + typeof arr + ' ' + bbn._('given'));
|
|
860
789
|
}
|
|
861
790
|
if (!arr.length) {
|
|
862
791
|
return -1;
|
|
863
792
|
}
|
|
864
|
-
|
|
865
|
-
|
|
793
|
+
let filter;
|
|
794
|
+
let isFn = false;
|
|
866
795
|
if (typeof prop === 'string') {
|
|
867
796
|
filter = {
|
|
868
797
|
conditions: [
|
|
@@ -876,7 +805,7 @@
|
|
|
876
805
|
}
|
|
877
806
|
else if (!prop) {
|
|
878
807
|
isFn = true;
|
|
879
|
-
filter =
|
|
808
|
+
filter = a => {
|
|
880
809
|
return (0, compareConditions_1.compareConditions)({ value: a }, (0, filterToConditions_1.filterToConditions)({
|
|
881
810
|
logic: 'AND',
|
|
882
811
|
conditions: [
|
|
@@ -909,7 +838,7 @@
|
|
|
909
838
|
startFrom = 0;
|
|
910
839
|
}
|
|
911
840
|
if (typeof filter === 'function') {
|
|
912
|
-
for (
|
|
841
|
+
for (let i = startFrom; i < arr.length; i++) {
|
|
913
842
|
if (filter(arr[i])) {
|
|
914
843
|
return i;
|
|
915
844
|
}
|
|
@@ -917,7 +846,7 @@
|
|
|
917
846
|
}
|
|
918
847
|
else {
|
|
919
848
|
filter = (0, filterToConditions_1.filterToConditions)(filter);
|
|
920
|
-
for (
|
|
849
|
+
for (let i = startFrom; i < arr.length; i++) {
|
|
921
850
|
if ((0, compareConditions_1.compareConditions)(arr[i], filter)) {
|
|
922
851
|
return i;
|
|
923
852
|
}
|
|
@@ -932,9 +861,7 @@
|
|
|
932
861
|
"use strict";
|
|
933
862
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
934
863
|
exports.getRow = void 0;
|
|
935
|
-
|
|
936
|
-
if (val === void 0) { val = null; }
|
|
937
|
-
if (operator === void 0) { operator = '='; }
|
|
864
|
+
const getRow = function (arr, prop, val = null, operator = '=') {
|
|
938
865
|
var idx = (0, search_1.search)(arr, prop, val, operator);
|
|
939
866
|
if (idx > -1) {
|
|
940
867
|
return arr[idx];
|
|
@@ -947,23 +874,21 @@
|
|
|
947
874
|
"use strict";
|
|
948
875
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
949
876
|
exports._deleteLoader = void 0;
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
if (isAbort === void 0) { isAbort = false; }
|
|
953
|
-
var idx = (0, search_2.search)(bbn.env.loaders, { key: requestId });
|
|
877
|
+
const _deleteLoader = function (requestId, res = null, isAbort = false) {
|
|
878
|
+
let idx = (0, search_2.search)(bbn.env.loaders, { key: requestId });
|
|
954
879
|
if (idx > -1) {
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
if (
|
|
958
|
-
|
|
959
|
-
|
|
880
|
+
let loader = bbn.env.loaders.splice(idx, 1)[0];
|
|
881
|
+
let history = (0, getRow_1.getRow)(bbn.env.loadersHistory, { key: requestId, start: loader.start });
|
|
882
|
+
if (history) {
|
|
883
|
+
history.loading = false;
|
|
884
|
+
history.duration = new Date().getTime() - loader.start;
|
|
960
885
|
if (typeof res === 'string') {
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
886
|
+
history.errorMessage = res;
|
|
887
|
+
history.error = !isAbort;
|
|
888
|
+
history.abort = isAbort;
|
|
964
889
|
}
|
|
965
890
|
else if ((0, isObject_4.isObject)(res)) {
|
|
966
|
-
|
|
891
|
+
history.success = true;
|
|
967
892
|
}
|
|
968
893
|
}
|
|
969
894
|
return true;
|
|
@@ -976,8 +901,8 @@
|
|
|
976
901
|
"use strict";
|
|
977
902
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
978
903
|
exports.getLoader = void 0;
|
|
979
|
-
|
|
980
|
-
|
|
904
|
+
const getLoader = function (requestId) {
|
|
905
|
+
let idx = (0, search_3.search)(bbn.env.loaders, { key: requestId });
|
|
981
906
|
if (idx > -1) {
|
|
982
907
|
return bbn.env.loaders[idx];
|
|
983
908
|
}
|
|
@@ -989,8 +914,8 @@
|
|
|
989
914
|
"use strict";
|
|
990
915
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
991
916
|
exports.abort = void 0;
|
|
992
|
-
|
|
993
|
-
|
|
917
|
+
const abort = function (requestId) {
|
|
918
|
+
let loader = (0, getLoader_1.getLoader)(requestId);
|
|
994
919
|
if (loader && loader.source) {
|
|
995
920
|
//this._deleteLoader(requestId);
|
|
996
921
|
loader.source.cancel('Operation canceled by the user.');
|
|
@@ -1007,15 +932,13 @@
|
|
|
1007
932
|
"use strict";
|
|
1008
933
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1009
934
|
exports.filter = void 0;
|
|
1010
|
-
|
|
1011
|
-
if (val === void 0) { val = null; }
|
|
1012
|
-
if (operator === void 0) { operator = '='; }
|
|
935
|
+
const filter = function (arr, prop, val = null, operator = '=') {
|
|
1013
936
|
if (!(0, isArray_4.isArray)(arr)) {
|
|
1014
937
|
throw new Error('Error in filter: The first argument must be an array');
|
|
1015
938
|
}
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
939
|
+
let cfg = {};
|
|
940
|
+
const res = [];
|
|
941
|
+
const isFn = (0, isFunction_2.isFunction)(prop);
|
|
1019
942
|
if (!prop || !arr.length) {
|
|
1020
943
|
return arr;
|
|
1021
944
|
}
|
|
@@ -1031,7 +954,7 @@
|
|
|
1031
954
|
throw new Error('Search function error: The prop argument should be a string or an object');
|
|
1032
955
|
}
|
|
1033
956
|
if (isFn) {
|
|
1034
|
-
(0, each_4.each)(arr,
|
|
957
|
+
(0, each_4.each)(arr, (a, i) => {
|
|
1035
958
|
if (filter(a, prop)) {
|
|
1036
959
|
res.push(a);
|
|
1037
960
|
}
|
|
@@ -1040,7 +963,7 @@
|
|
|
1040
963
|
else {
|
|
1041
964
|
cfg = (0, filterToConditions_2.filterToConditions)(cfg, operator);
|
|
1042
965
|
if (cfg.conditions && cfg.logic) {
|
|
1043
|
-
(0, each_4.each)(arr,
|
|
966
|
+
(0, each_4.each)(arr, (a) => {
|
|
1044
967
|
if ((0, compareConditions_2.compareConditions)(a, filter)) {
|
|
1045
968
|
res.push(a);
|
|
1046
969
|
}
|
|
@@ -1056,8 +979,8 @@
|
|
|
1056
979
|
"use strict";
|
|
1057
980
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1058
981
|
exports.abortURL = void 0;
|
|
1059
|
-
|
|
1060
|
-
(0, each_5.each)((0, filter_1.filter)(bbn.env.loaders, { url: url }),
|
|
982
|
+
const abortURL = function (url) {
|
|
983
|
+
(0, each_5.each)((0, filter_1.filter)(bbn.env.loaders, { url: url }), (a) => {
|
|
1061
984
|
if (a && a.source) {
|
|
1062
985
|
a.source.cancel('Operation canceled by the user.');
|
|
1063
986
|
}
|
|
@@ -1072,20 +995,20 @@
|
|
|
1072
995
|
"use strict";
|
|
1073
996
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1074
997
|
exports.addColors = void 0;
|
|
1075
|
-
|
|
998
|
+
const addColors = function (colors) {
|
|
1076
999
|
if ((0, numProperties_3.numProperties)(colors)) {
|
|
1077
1000
|
if (!bbn.vars.colors) {
|
|
1078
1001
|
bbn.vars.colors = {};
|
|
1079
1002
|
}
|
|
1080
|
-
|
|
1003
|
+
let element = document.createElement('style');
|
|
1081
1004
|
document.head.appendChild(element);
|
|
1082
|
-
|
|
1005
|
+
let sheet = element.sheet;
|
|
1083
1006
|
// Append style element to head
|
|
1084
|
-
|
|
1085
|
-
(0, iterate_3.iterate)(colors,
|
|
1007
|
+
let i = 0;
|
|
1008
|
+
(0, iterate_3.iterate)(colors, (v, n) => {
|
|
1086
1009
|
bbn.vars.colors[n] = v;
|
|
1087
|
-
|
|
1088
|
-
|
|
1010
|
+
sheet.insertRule('.bbn-' + n + ', .bbn-color-text-' + n + ' {color: ' + v + ' !important;}', i);
|
|
1011
|
+
sheet.insertRule('svg.bbn-' +
|
|
1089
1012
|
n +
|
|
1090
1013
|
', .bbn-' +
|
|
1091
1014
|
n +
|
|
@@ -1095,8 +1018,8 @@
|
|
|
1095
1018
|
n +
|
|
1096
1019
|
' svg {fill: ' +
|
|
1097
1020
|
v +
|
|
1098
|
-
';}',
|
|
1099
|
-
|
|
1021
|
+
';}', i);
|
|
1022
|
+
sheet.insertRule('.bbn-bg-' +
|
|
1100
1023
|
n +
|
|
1101
1024
|
', .bbn-color-bg-' +
|
|
1102
1025
|
n +
|
|
@@ -1104,9 +1027,9 @@
|
|
|
1104
1027
|
n +
|
|
1105
1028
|
' {background-color: ' +
|
|
1106
1029
|
v +
|
|
1107
|
-
' !important;}',
|
|
1108
|
-
|
|
1109
|
-
|
|
1030
|
+
' !important;}', i);
|
|
1031
|
+
sheet.insertRule('.bbn-border-' + n + ', .bbn-color-border-' + n + ' {border-color: ' + v + ' !important;}', i);
|
|
1032
|
+
sheet.insertRule('.bbn-color-' + n + ' {border-color: ' + v + '; background-color: ' + v + '; color: ' + v + ';}', i);
|
|
1110
1033
|
});
|
|
1111
1034
|
}
|
|
1112
1035
|
};
|
|
@@ -1116,12 +1039,10 @@
|
|
|
1116
1039
|
"use strict";
|
|
1117
1040
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1118
1041
|
exports.addInputs = void 0;
|
|
1119
|
-
|
|
1120
|
-
if (params === void 0) { params = null; }
|
|
1121
|
-
if (prefix === void 0) { prefix = ''; }
|
|
1042
|
+
const addInputs = function (form, params = null, prefix = '') {
|
|
1122
1043
|
if (form && form.tagName === 'FORM') {
|
|
1123
|
-
|
|
1124
|
-
|
|
1044
|
+
let appendToForm = (name, val) => {
|
|
1045
|
+
let input = document.createElement('input');
|
|
1125
1046
|
input.setAttribute('type', 'hidden');
|
|
1126
1047
|
input.setAttribute('name', name);
|
|
1127
1048
|
input.setAttribute('value', val);
|
|
@@ -1130,19 +1051,19 @@
|
|
|
1130
1051
|
params = JSON.parse(JSON.stringify(params || {}));
|
|
1131
1052
|
prefix = prefix || '';
|
|
1132
1053
|
if (params) {
|
|
1133
|
-
(0, iterate_4.iterate)(params,
|
|
1134
|
-
|
|
1054
|
+
(0, iterate_4.iterate)(params, (param, key) => {
|
|
1055
|
+
let name = prefix ? `${prefix}[${key}]` : key;
|
|
1135
1056
|
if (param instanceof Date) {
|
|
1136
|
-
|
|
1057
|
+
appendToForm(name, param.toISOString());
|
|
1137
1058
|
}
|
|
1138
1059
|
else if (param instanceof Array) {
|
|
1139
|
-
param.forEach(
|
|
1140
|
-
|
|
1060
|
+
param.forEach((e, i) => {
|
|
1061
|
+
const tempName = `${name}[${i}]`;
|
|
1141
1062
|
if (typeof e === 'object') {
|
|
1142
1063
|
addInputs(form, e, tempName);
|
|
1143
1064
|
}
|
|
1144
1065
|
else {
|
|
1145
|
-
|
|
1066
|
+
appendToForm(tempName, e.toString());
|
|
1146
1067
|
}
|
|
1147
1068
|
});
|
|
1148
1069
|
}
|
|
@@ -1150,7 +1071,7 @@
|
|
|
1150
1071
|
addInputs(form, param, name);
|
|
1151
1072
|
}
|
|
1152
1073
|
else {
|
|
1153
|
-
|
|
1074
|
+
appendToForm(name, param.toString());
|
|
1154
1075
|
}
|
|
1155
1076
|
});
|
|
1156
1077
|
}
|
|
@@ -1162,9 +1083,9 @@
|
|
|
1162
1083
|
"use strict";
|
|
1163
1084
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1164
1085
|
exports.addStyle = void 0;
|
|
1165
|
-
|
|
1086
|
+
const addStyle = function (ele, o) {
|
|
1166
1087
|
if ((0, isObject_5.isObject)(o)) {
|
|
1167
|
-
(0, iterate_5.iterate)(o,
|
|
1088
|
+
(0, iterate_5.iterate)(o, (v, k) => {
|
|
1168
1089
|
ele.style[k] = v;
|
|
1169
1090
|
});
|
|
1170
1091
|
}
|
|
@@ -1175,20 +1096,20 @@
|
|
|
1175
1096
|
"use strict";
|
|
1176
1097
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1177
1098
|
exports.adjustSize = void 0;
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
(0, each_6.each)(eles,
|
|
1099
|
+
const adjustSize = function (type, eles) {
|
|
1100
|
+
let max = 0, idx;
|
|
1101
|
+
(0, each_6.each)(eles, (el) => {
|
|
1181
1102
|
el.style[type] = 'auto';
|
|
1182
1103
|
});
|
|
1183
|
-
(0, each_6.each)(eles,
|
|
1184
|
-
|
|
1104
|
+
(0, each_6.each)(eles, (el, i) => {
|
|
1105
|
+
let rect = el.getBoundingClientRect(), s = rect[type] % 1 ? rect[type] - (rect[type] % 1) + 1 : rect[type];
|
|
1185
1106
|
//s = rect[type];
|
|
1186
1107
|
if (s > max) {
|
|
1187
1108
|
max = s;
|
|
1188
1109
|
idx = i;
|
|
1189
1110
|
}
|
|
1190
1111
|
});
|
|
1191
|
-
(0, each_6.each)(eles,
|
|
1112
|
+
(0, each_6.each)(eles, (el, i) => {
|
|
1192
1113
|
if (max) {
|
|
1193
1114
|
el.style[type] = max + 'px';
|
|
1194
1115
|
}
|
|
@@ -1200,8 +1121,8 @@
|
|
|
1200
1121
|
"use strict";
|
|
1201
1122
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1202
1123
|
exports.adjustHeight = void 0;
|
|
1203
|
-
|
|
1204
|
-
|
|
1124
|
+
const adjustHeight = function () {
|
|
1125
|
+
let args = arguments;
|
|
1205
1126
|
if (args.length === 1 && (0, isIterable_3.isIterable)(args[0])) {
|
|
1206
1127
|
args = args[0];
|
|
1207
1128
|
}
|
|
@@ -1213,8 +1134,8 @@
|
|
|
1213
1134
|
"use strict";
|
|
1214
1135
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1215
1136
|
exports.adjustWidth = void 0;
|
|
1216
|
-
|
|
1217
|
-
|
|
1137
|
+
const adjustWidth = function () {
|
|
1138
|
+
let args = arguments;
|
|
1218
1139
|
if (args.length === 1 && (0, isIterable_4.isIterable)(args[0])) {
|
|
1219
1140
|
args = args[0];
|
|
1220
1141
|
}
|
|
@@ -1226,7 +1147,7 @@
|
|
|
1226
1147
|
"use strict";
|
|
1227
1148
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1228
1149
|
exports.escapeRegExp = void 0;
|
|
1229
|
-
|
|
1150
|
+
const escapeRegExp = function (str) {
|
|
1230
1151
|
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
|
|
1231
1152
|
};
|
|
1232
1153
|
exports.escapeRegExp = escapeRegExp;
|
|
@@ -1235,8 +1156,7 @@
|
|
|
1235
1156
|
"use strict";
|
|
1236
1157
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1237
1158
|
exports.replaceAll = void 0;
|
|
1238
|
-
|
|
1239
|
-
if (flags === void 0) { flags = ''; }
|
|
1159
|
+
const replaceAll = function (find, replace, str, flags = '') {
|
|
1240
1160
|
return str.toString().replace((0, isObject_6.isObject)(find) ? find : new RegExp((0, escapeRegExp_1.escapeRegExp)(find), 'g' + flags), replace);
|
|
1241
1161
|
};
|
|
1242
1162
|
exports.replaceAll = replaceAll;
|
|
@@ -1245,7 +1165,7 @@
|
|
|
1245
1165
|
"use strict";
|
|
1246
1166
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1247
1167
|
exports.md5 = void 0;
|
|
1248
|
-
|
|
1168
|
+
const md5 = function (st) {
|
|
1249
1169
|
var hc = '0123456789abcdef';
|
|
1250
1170
|
function rh(n) {
|
|
1251
1171
|
var j, s = '';
|
|
@@ -1371,10 +1291,10 @@
|
|
|
1371
1291
|
"use strict";
|
|
1372
1292
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1373
1293
|
exports.getRequestId = void 0;
|
|
1374
|
-
|
|
1375
|
-
|
|
1294
|
+
const getRequestId = function (url, data, datatype) {
|
|
1295
|
+
let d = {};
|
|
1376
1296
|
if (data) {
|
|
1377
|
-
(0, iterate_6.iterate)(data,
|
|
1297
|
+
(0, iterate_6.iterate)(data, (a, n) => {
|
|
1378
1298
|
if (n.indexOf('_bbn') === -1) {
|
|
1379
1299
|
d[n] = a;
|
|
1380
1300
|
}
|
|
@@ -1388,14 +1308,10 @@
|
|
|
1388
1308
|
"use strict";
|
|
1389
1309
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1390
1310
|
exports.extend = void 0;
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
}
|
|
1396
|
-
var deep = false;
|
|
1397
|
-
var args = [];
|
|
1398
|
-
for (var i = 0; i < originalArgs.length; i++) {
|
|
1311
|
+
const extend = function (...originalArgs) {
|
|
1312
|
+
let deep = false;
|
|
1313
|
+
let args = [];
|
|
1314
|
+
for (let i = 0; i < originalArgs.length; i++) {
|
|
1399
1315
|
if (originalArgs[i] === true) {
|
|
1400
1316
|
deep = true;
|
|
1401
1317
|
}
|
|
@@ -1412,15 +1328,15 @@
|
|
|
1412
1328
|
if (!args.length) {
|
|
1413
1329
|
throw new Error('No argument given');
|
|
1414
1330
|
}
|
|
1415
|
-
|
|
1416
|
-
for (
|
|
1417
|
-
(0, iterate_7.iterate)(args[i],
|
|
1331
|
+
let out = args[0];
|
|
1332
|
+
for (let i = 1; i < args.length; i++) {
|
|
1333
|
+
(0, iterate_7.iterate)(args[i], (a, key) => {
|
|
1418
1334
|
if (deep) {
|
|
1419
1335
|
if ((0, isArray_5.isArray)(a)) {
|
|
1420
1336
|
out[key] = (0, isArray_5.isArray)(out[key]) ? out[key] : [];
|
|
1421
|
-
(0, each_7.each)(a,
|
|
1337
|
+
(0, each_7.each)(a, (b, i) => {
|
|
1422
1338
|
if (b && typeof b === 'object') {
|
|
1423
|
-
|
|
1339
|
+
let tmp = out[key][i];
|
|
1424
1340
|
if ((0, isArray_5.isArray)(b)) {
|
|
1425
1341
|
if (!(0, isArray_5.isArray)(tmp)) {
|
|
1426
1342
|
tmp = [];
|
|
@@ -1464,7 +1380,7 @@
|
|
|
1464
1380
|
"use strict";
|
|
1465
1381
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1466
1382
|
exports.defaultEndLoadingFunction = void 0;
|
|
1467
|
-
|
|
1383
|
+
const defaultEndLoadingFunction = function (url, timestamp, data, res) {
|
|
1468
1384
|
return true;
|
|
1469
1385
|
};
|
|
1470
1386
|
exports.defaultEndLoadingFunction = defaultEndLoadingFunction;
|
|
@@ -1473,7 +1389,7 @@
|
|
|
1473
1389
|
"use strict";
|
|
1474
1390
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1475
1391
|
exports.defaultAjaxErrorFunction = void 0;
|
|
1476
|
-
|
|
1392
|
+
const defaultAjaxErrorFunction = function (jqXHR, textStatus, errorThrown) {
|
|
1477
1393
|
return false;
|
|
1478
1394
|
};
|
|
1479
1395
|
exports.defaultAjaxErrorFunction = defaultAjaxErrorFunction;
|
|
@@ -1482,8 +1398,7 @@
|
|
|
1482
1398
|
"use strict";
|
|
1483
1399
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1484
1400
|
exports.defaultAjaxAbortFunction = void 0;
|
|
1485
|
-
|
|
1486
|
-
if (url === void 0) { url = ''; }
|
|
1401
|
+
const defaultAjaxAbortFunction = function (message, url = '') {
|
|
1487
1402
|
(0, log_5.log)(message);
|
|
1488
1403
|
};
|
|
1489
1404
|
exports.defaultAjaxAbortFunction = defaultAjaxAbortFunction;
|
|
@@ -1492,8 +1407,7 @@
|
|
|
1492
1407
|
"use strict";
|
|
1493
1408
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1494
1409
|
exports.defaultStartLoadingFunction = void 0;
|
|
1495
|
-
|
|
1496
|
-
if (requestId === void 0) { requestId = null; }
|
|
1410
|
+
const defaultStartLoadingFunction = function (url, tst, data, requestId = null) {
|
|
1497
1411
|
return true;
|
|
1498
1412
|
};
|
|
1499
1413
|
exports.defaultStartLoadingFunction = defaultStartLoadingFunction;
|
|
@@ -1502,7 +1416,7 @@
|
|
|
1502
1416
|
"use strict";
|
|
1503
1417
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1504
1418
|
exports.ajax = void 0;
|
|
1505
|
-
|
|
1419
|
+
const ajax = function (url, datatype, data, success, failure, abort) {
|
|
1506
1420
|
if (arguments.length === 1 && url && typeof url === 'object' && url.url) {
|
|
1507
1421
|
if (url.abort) {
|
|
1508
1422
|
abort = url.abort;
|
|
@@ -1532,8 +1446,8 @@
|
|
|
1532
1446
|
if (!datatype) {
|
|
1533
1447
|
datatype = 'json';
|
|
1534
1448
|
}
|
|
1535
|
-
|
|
1536
|
-
|
|
1449
|
+
let requestId = (0, getRequestId_1.getRequestId)(url, data, datatype);
|
|
1450
|
+
let loaderObj = (0, getLoader_2.getLoader)(requestId);
|
|
1537
1451
|
//log("IN AJAX", loaderObj? loaderObj.loader : "NO LOADER")
|
|
1538
1452
|
if (loaderObj && loaderObj.loader) {
|
|
1539
1453
|
return loaderObj.loader;
|
|
@@ -1541,9 +1455,9 @@
|
|
|
1541
1455
|
if (bbn.env.token) {
|
|
1542
1456
|
(0, extend_1.extend)(data || {}, { _bbn_token: bbn.env.token });
|
|
1543
1457
|
}
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1458
|
+
let cancelToken = axios.CancelToken;
|
|
1459
|
+
let source = cancelToken.source();
|
|
1460
|
+
let options = {
|
|
1547
1461
|
responseType: datatype,
|
|
1548
1462
|
cancelToken: source.token,
|
|
1549
1463
|
};
|
|
@@ -1553,16 +1467,16 @@
|
|
|
1553
1467
|
'Content-Type': 'text/javascript',
|
|
1554
1468
|
};
|
|
1555
1469
|
}
|
|
1556
|
-
|
|
1470
|
+
let args = [url];
|
|
1557
1471
|
if ((0, isObject_8.isObject)(data) && (0, numProperties_4.numProperties)(data) > 0) {
|
|
1558
1472
|
args.push(data);
|
|
1559
1473
|
}
|
|
1560
1474
|
args.push(options);
|
|
1561
|
-
|
|
1475
|
+
let loader = axios[args.length === 2 ? 'get' : 'post']
|
|
1562
1476
|
.apply(axios, args)
|
|
1563
|
-
.then(
|
|
1564
|
-
(0, _deleteLoader_1._deleteLoader)(
|
|
1565
|
-
(0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url,
|
|
1477
|
+
.then((res) => {
|
|
1478
|
+
(0, _deleteLoader_1._deleteLoader)(requestId, res);
|
|
1479
|
+
(0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url, tst, data, res);
|
|
1566
1480
|
switch (res.status) {
|
|
1567
1481
|
case 200:
|
|
1568
1482
|
if ((0, isFunction_3.isFunction)(success)) {
|
|
@@ -1570,16 +1484,16 @@
|
|
|
1570
1484
|
}
|
|
1571
1485
|
break;
|
|
1572
1486
|
default:
|
|
1573
|
-
(0, defaultAjaxErrorFunction_1.defaultAjaxErrorFunction)(
|
|
1487
|
+
(0, defaultAjaxErrorFunction_1.defaultAjaxErrorFunction)(loader, res);
|
|
1574
1488
|
}
|
|
1575
1489
|
return res;
|
|
1576
1490
|
})
|
|
1577
|
-
.catch(
|
|
1578
|
-
|
|
1579
|
-
(0, _deleteLoader_1._deleteLoader)(
|
|
1580
|
-
(0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url,
|
|
1491
|
+
.catch((err) => {
|
|
1492
|
+
let isAbort = axios.isCancel(err);
|
|
1493
|
+
(0, _deleteLoader_1._deleteLoader)(requestId, err.message || err.response.data, isAbort);
|
|
1494
|
+
(0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url, tst, data, err);
|
|
1581
1495
|
if (isAbort) {
|
|
1582
|
-
|
|
1496
|
+
let ok = 1;
|
|
1583
1497
|
if ((0, isFunction_3.isFunction)(abort)) {
|
|
1584
1498
|
ok = abort(err.message, url);
|
|
1585
1499
|
}
|
|
@@ -1588,7 +1502,7 @@
|
|
|
1588
1502
|
}
|
|
1589
1503
|
}
|
|
1590
1504
|
else {
|
|
1591
|
-
|
|
1505
|
+
let ok = 1;
|
|
1592
1506
|
if ((0, isFunction_3.isFunction)(failure)) {
|
|
1593
1507
|
ok = failure(err.request, err);
|
|
1594
1508
|
}
|
|
@@ -1597,9 +1511,9 @@
|
|
|
1597
1511
|
}
|
|
1598
1512
|
}
|
|
1599
1513
|
});
|
|
1600
|
-
|
|
1601
|
-
(0, defaultStartLoadingFunction_1.defaultStartLoadingFunction)(url,
|
|
1602
|
-
return
|
|
1514
|
+
let tst = (0, _addLoader_1._addLoader)(requestId, loader, source);
|
|
1515
|
+
(0, defaultStartLoadingFunction_1.defaultStartLoadingFunction)(url, tst, data, requestId);
|
|
1516
|
+
return loader;
|
|
1603
1517
|
}
|
|
1604
1518
|
};
|
|
1605
1519
|
exports.ajax = ajax;
|
|
@@ -1608,24 +1522,24 @@
|
|
|
1608
1522
|
"use strict";
|
|
1609
1523
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1610
1524
|
exports.analyzeFunction = void 0;
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
for (
|
|
1525
|
+
const analyzeFunction = function (fn) {
|
|
1526
|
+
const functionString = fn.toString();
|
|
1527
|
+
let all = functionString.split('');
|
|
1528
|
+
let exp = '';
|
|
1529
|
+
let isArrow = false;
|
|
1530
|
+
let isAsync = false;
|
|
1531
|
+
let hasFunction = false;
|
|
1532
|
+
let name = null;
|
|
1533
|
+
let parOpened = 0;
|
|
1534
|
+
let parClosed = 0;
|
|
1535
|
+
let args = [];
|
|
1536
|
+
let currentArg = {};
|
|
1537
|
+
let body;
|
|
1538
|
+
let currentQuote = '';
|
|
1539
|
+
let escapable = ['"', "'", '`'];
|
|
1540
|
+
let isEscaped = false;
|
|
1541
|
+
let settingDefault = false;
|
|
1542
|
+
for (let i = 0; i < all.length; i++) {
|
|
1629
1543
|
if (all[i] === currentQuote && !isEscaped && currentQuote) {
|
|
1630
1544
|
currentQuote = '';
|
|
1631
1545
|
exp += all[i];
|
|
@@ -1734,17 +1648,17 @@
|
|
|
1734
1648
|
throw Error('Unexpected end of function while parsing function');
|
|
1735
1649
|
}
|
|
1736
1650
|
}
|
|
1737
|
-
|
|
1738
|
-
|
|
1651
|
+
const argString = args.map((arg) => arg.name + (arg.default ? ' = ' + arg.default : '')).join(', ');
|
|
1652
|
+
const hash = (0, md5_2.md5)(body + (name ? '-' + name : '') + (argString ? '-' + argString : ''));
|
|
1739
1653
|
return {
|
|
1740
|
-
body
|
|
1741
|
-
args
|
|
1742
|
-
argString
|
|
1743
|
-
isArrow
|
|
1744
|
-
hasFunction
|
|
1745
|
-
name
|
|
1746
|
-
isAsync
|
|
1747
|
-
hash
|
|
1654
|
+
body,
|
|
1655
|
+
args,
|
|
1656
|
+
argString,
|
|
1657
|
+
isArrow,
|
|
1658
|
+
hasFunction,
|
|
1659
|
+
name,
|
|
1660
|
+
isAsync,
|
|
1661
|
+
hash,
|
|
1748
1662
|
};
|
|
1749
1663
|
};
|
|
1750
1664
|
exports.analyzeFunction = analyzeFunction;
|
|
@@ -1753,9 +1667,8 @@
|
|
|
1753
1667
|
"use strict";
|
|
1754
1668
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1755
1669
|
exports.animateCss = void 0;
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
|
|
1670
|
+
const animateCss = function (ele, animationName, callback) {
|
|
1671
|
+
let animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
|
|
1759
1672
|
/*$(ele).addClass('animated ' + animationName).one(animationEnd, function(){
|
|
1760
1673
|
if ( typeof callback == 'function' ){ // make sure the callback is a function
|
|
1761
1674
|
callback.call(this); // brings the scope to the callback
|
|
@@ -1764,13 +1677,13 @@
|
|
|
1764
1677
|
})*/
|
|
1765
1678
|
ele.classList.add('animated');
|
|
1766
1679
|
ele.classList.add(animationName);
|
|
1767
|
-
ele.addEventListener(animationEnd,
|
|
1680
|
+
ele.addEventListener(animationEnd, (e) => {
|
|
1768
1681
|
e.target.removeEventListener(e.type, arguments.callee);
|
|
1769
1682
|
if (typeof callback == 'function') {
|
|
1770
1683
|
// make sure the callback is a function
|
|
1771
|
-
callback.call(
|
|
1684
|
+
callback.call(this); // brings the scope to the callback
|
|
1772
1685
|
}
|
|
1773
|
-
|
|
1686
|
+
this.classList.remove(animationName);
|
|
1774
1687
|
});
|
|
1775
1688
|
};
|
|
1776
1689
|
exports.animateCss = animateCss;
|
|
@@ -1779,7 +1692,7 @@
|
|
|
1779
1692
|
"use strict";
|
|
1780
1693
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1781
1694
|
exports.arrayBuffer2String = void 0;
|
|
1782
|
-
|
|
1695
|
+
const arrayBuffer2String = function (buf) {
|
|
1783
1696
|
return String.fromCharCode.apply(null, new Uint16Array(buf));
|
|
1784
1697
|
};
|
|
1785
1698
|
exports.arrayBuffer2String = arrayBuffer2String;
|
|
@@ -1788,9 +1701,9 @@
|
|
|
1788
1701
|
"use strict";
|
|
1789
1702
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1790
1703
|
exports.arrayFromProp = void 0;
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
(0, each_8.each)(arr,
|
|
1704
|
+
const arrayFromProp = function (arr, prop) {
|
|
1705
|
+
let r = [];
|
|
1706
|
+
(0, each_8.each)(arr, (a, i) => {
|
|
1794
1707
|
r.push((0, getProperty_3.getProperty)(a, prop));
|
|
1795
1708
|
});
|
|
1796
1709
|
return r;
|
|
@@ -1801,7 +1714,7 @@
|
|
|
1801
1714
|
"use strict";
|
|
1802
1715
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1803
1716
|
exports.autoExtend = void 0;
|
|
1804
|
-
|
|
1717
|
+
const autoExtend = function (namespace, obj) {
|
|
1805
1718
|
if (!bbn[namespace]) {
|
|
1806
1719
|
bbn[namespace] = {};
|
|
1807
1720
|
//$.extend(true, bbn[namespace], obj);
|
|
@@ -1818,14 +1731,14 @@
|
|
|
1818
1731
|
"use strict";
|
|
1819
1732
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1820
1733
|
exports.baseName = void 0;
|
|
1821
|
-
|
|
1734
|
+
const baseName = function (path, suffix) {
|
|
1822
1735
|
if (path && (0, isString_4.isString)(path)) {
|
|
1823
|
-
|
|
1824
|
-
|
|
1736
|
+
let bits = path.split('/');
|
|
1737
|
+
let res = bits.pop();
|
|
1825
1738
|
if (!suffix) {
|
|
1826
1739
|
return res;
|
|
1827
1740
|
}
|
|
1828
|
-
|
|
1741
|
+
let len = suffix.length;
|
|
1829
1742
|
if (res && (0, substr_3.substr)(res, -len) === suffix) {
|
|
1830
1743
|
return (0, substr_3.substr)(res, 0, res.length - len);
|
|
1831
1744
|
}
|
|
@@ -1838,7 +1751,7 @@
|
|
|
1838
1751
|
"use strict";
|
|
1839
1752
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1840
1753
|
exports.br2nl = void 0;
|
|
1841
|
-
|
|
1754
|
+
const br2nl = function (st) {
|
|
1842
1755
|
return (0, replaceAll_2.replaceAll)('<br />', '\n', (0, replaceAll_2.replaceAll)('<br/>', '\n', (0, replaceAll_2.replaceAll)('<br>', '\n', st)));
|
|
1843
1756
|
};
|
|
1844
1757
|
exports.br2nl = br2nl;
|
|
@@ -1847,8 +1760,8 @@
|
|
|
1847
1760
|
"use strict";
|
|
1848
1761
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1849
1762
|
exports.date = void 0;
|
|
1850
|
-
|
|
1851
|
-
|
|
1763
|
+
const date = function (v) {
|
|
1764
|
+
let d = false, t = typeof v;
|
|
1852
1765
|
if (v === undefined) {
|
|
1853
1766
|
return new Date();
|
|
1854
1767
|
}
|
|
@@ -1877,8 +1790,8 @@
|
|
|
1877
1790
|
"use strict";
|
|
1878
1791
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1879
1792
|
exports.fdatetime = void 0;
|
|
1880
|
-
|
|
1881
|
-
|
|
1793
|
+
const fdatetime = function (d, wrong_result) {
|
|
1794
|
+
let r = (0, date_1.date)(d);
|
|
1882
1795
|
if (!(0, isDate_3.isDate)(r)) {
|
|
1883
1796
|
return wrong_result && (0, isString_5.isString)(wrong_result) ? wrong_result : '';
|
|
1884
1797
|
}
|
|
@@ -1902,12 +1815,12 @@
|
|
|
1902
1815
|
"use strict";
|
|
1903
1816
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1904
1817
|
exports.fdate = void 0;
|
|
1905
|
-
|
|
1818
|
+
const fdate = function (d, wrong_result) {
|
|
1906
1819
|
// Retro compatibility
|
|
1907
1820
|
if (wrong_result === true) {
|
|
1908
1821
|
return (0, fdatetime_1.fdatetime)(d);
|
|
1909
1822
|
}
|
|
1910
|
-
|
|
1823
|
+
let r = (0, date_2.date)(d);
|
|
1911
1824
|
if (!(0, isDate_4.isDate)(r)) {
|
|
1912
1825
|
return wrong_result && (0, isString_6.isString)(wrong_result) ? wrong_result : '';
|
|
1913
1826
|
}
|
|
@@ -1923,11 +1836,11 @@
|
|
|
1923
1836
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1924
1837
|
exports.calendar = void 0;
|
|
1925
1838
|
dayjs.extend(window['dayjs_plugin_calendar']);
|
|
1926
|
-
|
|
1839
|
+
const calendar = function (d, wrong_result) {
|
|
1927
1840
|
if (undefined === dayjs) {
|
|
1928
1841
|
return (0, fdate_1.fdate)(d, wrong_result);
|
|
1929
1842
|
}
|
|
1930
|
-
|
|
1843
|
+
let r = (0, date_3.date)(d);
|
|
1931
1844
|
if (!(0, isDate_5.isDate)(r)) {
|
|
1932
1845
|
return wrong_result && (0, isString_7.isString)(wrong_result) ? wrong_result : '';
|
|
1933
1846
|
}
|
|
@@ -1946,10 +1859,10 @@
|
|
|
1946
1859
|
"use strict";
|
|
1947
1860
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1948
1861
|
exports.error = void 0;
|
|
1949
|
-
|
|
1862
|
+
const error = function (errorMsg) {
|
|
1950
1863
|
if (arguments.length > 1) {
|
|
1951
|
-
|
|
1952
|
-
for (
|
|
1864
|
+
const args = [];
|
|
1865
|
+
for (let i = 1; i < arguments.length; i++) {
|
|
1953
1866
|
args.push(arguments[i]);
|
|
1954
1867
|
}
|
|
1955
1868
|
args.unshift({
|
|
@@ -1967,7 +1880,7 @@
|
|
|
1967
1880
|
"use strict";
|
|
1968
1881
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1969
1882
|
exports.defaultLinkFunction = void 0;
|
|
1970
|
-
|
|
1883
|
+
const defaultLinkFunction = function (responseObj, ele) {
|
|
1971
1884
|
return true;
|
|
1972
1885
|
};
|
|
1973
1886
|
exports.defaultLinkFunction = defaultLinkFunction;
|
|
@@ -1976,7 +1889,7 @@
|
|
|
1976
1889
|
"use strict";
|
|
1977
1890
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1978
1891
|
exports.defaultPostLinkFunction = void 0;
|
|
1979
|
-
|
|
1892
|
+
const defaultPostLinkFunction = function (r, ele) {
|
|
1980
1893
|
return true;
|
|
1981
1894
|
};
|
|
1982
1895
|
exports.defaultPostLinkFunction = defaultPostLinkFunction;
|
|
@@ -1985,7 +1898,7 @@
|
|
|
1985
1898
|
"use strict";
|
|
1986
1899
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1987
1900
|
exports.defaultAlertFunction = void 0;
|
|
1988
|
-
|
|
1901
|
+
const defaultAlertFunction = function (msg, title) {
|
|
1989
1902
|
/** @todo */
|
|
1990
1903
|
alert(msg);
|
|
1991
1904
|
};
|
|
@@ -1995,17 +1908,13 @@
|
|
|
1995
1908
|
"use strict";
|
|
1996
1909
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1997
1910
|
exports.callback = void 0;
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
if (fn === void 0) { fn = null; }
|
|
2001
|
-
if (fn2 === void 0) { fn2 = null; }
|
|
2002
|
-
if (ele === void 0) { ele = null; }
|
|
2003
|
-
var tmp = false;
|
|
1911
|
+
const callback = function (url, res = null, fn = null, fn2 = null, ele = null) {
|
|
1912
|
+
let tmp = false;
|
|
2004
1913
|
if (res) {
|
|
2005
1914
|
tmp = true;
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
1915
|
+
let t = typeof res;
|
|
1916
|
+
let isObj = t.toLowerCase() === 'object';
|
|
1917
|
+
let errTitle;
|
|
2009
1918
|
if (isObj && res.prescript) {
|
|
2010
1919
|
/* var ok can be changed to false in prescript execution */
|
|
2011
1920
|
try {
|
|
@@ -2038,8 +1947,8 @@
|
|
|
2038
1947
|
tmp = res.script(res.data ? res.data : {}, ele || null);
|
|
2039
1948
|
}
|
|
2040
1949
|
else {
|
|
2041
|
-
tmp = (
|
|
2042
|
-
|
|
1950
|
+
tmp = ((data, ele) => {
|
|
1951
|
+
let r = null;
|
|
2043
1952
|
try {
|
|
2044
1953
|
r = eval(res.script);
|
|
2045
1954
|
if ((0, isFunction_4.isFunction)(r)) {
|
|
@@ -2080,7 +1989,7 @@
|
|
|
2080
1989
|
"use strict";
|
|
2081
1990
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2082
1991
|
exports.camelize = void 0;
|
|
2083
|
-
|
|
1992
|
+
const camelize = function (str) {
|
|
2084
1993
|
return str.replace(/^([A-Z])|[\s-](\w)/g, function (match, p1, p2, offset) {
|
|
2085
1994
|
if (p2) {
|
|
2086
1995
|
return p2.toUpperCase();
|
|
@@ -2094,7 +2003,7 @@
|
|
|
2094
2003
|
"use strict";
|
|
2095
2004
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2096
2005
|
exports.camelToCss = void 0;
|
|
2097
|
-
|
|
2006
|
+
const camelToCss = function (str) {
|
|
2098
2007
|
return str
|
|
2099
2008
|
.replace(/([A-Z])/g, function (st) {
|
|
2100
2009
|
return '-' + st.toLowerCase();
|
|
@@ -2109,8 +2018,8 @@
|
|
|
2109
2018
|
"use strict";
|
|
2110
2019
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2111
2020
|
exports.canvasToImage = void 0;
|
|
2112
|
-
|
|
2113
|
-
|
|
2021
|
+
const canvasToImage = function (canvas) {
|
|
2022
|
+
let img = new Image();
|
|
2114
2023
|
img.src = canvas.toDataURL('image/png');
|
|
2115
2024
|
return img;
|
|
2116
2025
|
};
|
|
@@ -2120,9 +2029,9 @@
|
|
|
2120
2029
|
"use strict";
|
|
2121
2030
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2122
2031
|
exports.center = void 0;
|
|
2123
|
-
|
|
2032
|
+
const center = function (ele) {
|
|
2124
2033
|
//ele = $(ele);
|
|
2125
|
-
|
|
2034
|
+
let parent = ele.parentNode,
|
|
2126
2035
|
//w = parent.width(),
|
|
2127
2036
|
w = parent.clientWidth,
|
|
2128
2037
|
//h = parent.height();
|
|
@@ -2149,9 +2058,8 @@
|
|
|
2149
2058
|
"use strict";
|
|
2150
2059
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2151
2060
|
exports.checkPropsDetails = void 0;
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
var res = {
|
|
2061
|
+
const checkPropsDetails = function (obj, props, checkEmpty = false) {
|
|
2062
|
+
let res = {
|
|
2155
2063
|
error: false,
|
|
2156
2064
|
result: true,
|
|
2157
2065
|
};
|
|
@@ -2165,20 +2073,20 @@
|
|
|
2165
2073
|
res.error = bbn._('checkProps must receive an object as obj argument');
|
|
2166
2074
|
}
|
|
2167
2075
|
if (!res.error) {
|
|
2168
|
-
|
|
2169
|
-
(0, each_9.each)(props,
|
|
2076
|
+
let check;
|
|
2077
|
+
(0, each_9.each)(props, (varName) => {
|
|
2170
2078
|
varName = varName.trim().split(':');
|
|
2171
|
-
|
|
2079
|
+
let type = varName[1] || false;
|
|
2172
2080
|
varName = varName[0];
|
|
2173
2081
|
if (obj[varName] === undefined) {
|
|
2174
2082
|
res.error = varName + ' ' + bbn._('is not defined');
|
|
2175
2083
|
}
|
|
2176
2084
|
else if (type) {
|
|
2177
|
-
|
|
2178
|
-
if (bbn.fn[
|
|
2085
|
+
check = 'is' + (0, substr_5.substr)(type, 0, 1).toUpperCase() + (0, substr_5.substr)(type, 1).toLowerCase();
|
|
2086
|
+
if (bbn.fn[check] === undefined) {
|
|
2179
2087
|
res.error = type + ' ' + bbn._('is not a valid type');
|
|
2180
2088
|
}
|
|
2181
|
-
else if (!bbn.fn[
|
|
2089
|
+
else if (!bbn.fn[check](obj[varName])) {
|
|
2182
2090
|
res.error = varName + ' ' + bbn._('is not a') + ' ' + type;
|
|
2183
2091
|
}
|
|
2184
2092
|
}
|
|
@@ -2201,8 +2109,7 @@
|
|
|
2201
2109
|
"use strict";
|
|
2202
2110
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2203
2111
|
exports.checkProps = void 0;
|
|
2204
|
-
|
|
2205
|
-
if (checkEmpty === void 0) { checkEmpty = false; }
|
|
2112
|
+
const checkProps = function (obj, props, checkEmpty = false) {
|
|
2206
2113
|
return (0, checkPropsDetails_1.checkPropsDetails)(obj, props, checkEmpty).result;
|
|
2207
2114
|
};
|
|
2208
2115
|
exports.checkProps = checkProps;
|
|
@@ -2211,9 +2118,8 @@
|
|
|
2211
2118
|
"use strict";
|
|
2212
2119
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2213
2120
|
exports.checkPropsOrDie = void 0;
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
var res = (0, checkPropsDetails_2.checkPropsDetails)(obj, props, checkEmpty);
|
|
2121
|
+
const checkPropsOrDie = function (obj, props, checkEmpty = false) {
|
|
2122
|
+
let res = (0, checkPropsDetails_2.checkPropsDetails)(obj, props, checkEmpty);
|
|
2217
2123
|
if (res.error) {
|
|
2218
2124
|
throw new Error(res.error);
|
|
2219
2125
|
}
|
|
@@ -2225,8 +2131,8 @@
|
|
|
2225
2131
|
"use strict";
|
|
2226
2132
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2227
2133
|
exports.correctCase = void 0;
|
|
2228
|
-
|
|
2229
|
-
return str.replace(/[A-z]{1}/,
|
|
2134
|
+
const correctCase = function (str) {
|
|
2135
|
+
return str.replace(/[A-z]{1}/, (c) => c.toUpperCase());
|
|
2230
2136
|
};
|
|
2231
2137
|
exports.correctCase = correctCase;
|
|
2232
2138
|
});
|
|
@@ -2234,18 +2140,13 @@
|
|
|
2234
2140
|
"use strict";
|
|
2235
2141
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2236
2142
|
exports.checkType = void 0;
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
for (var _i = 3; _i < arguments.length; _i++) {
|
|
2240
|
-
logs[_i - 3] = arguments[_i];
|
|
2241
|
-
}
|
|
2242
|
-
var ok = false;
|
|
2143
|
+
const checkType = function (value, type, msg, ...logs) {
|
|
2144
|
+
let ok = false;
|
|
2243
2145
|
if (!(0, isArray_7.isArray)(type)) {
|
|
2244
2146
|
type = [type];
|
|
2245
2147
|
}
|
|
2246
|
-
|
|
2247
|
-
(0, each_10.each)(type,
|
|
2248
|
-
var _a;
|
|
2148
|
+
const typesList = [];
|
|
2149
|
+
(0, each_10.each)(type, (t) => {
|
|
2249
2150
|
if (t === String) {
|
|
2250
2151
|
t = 'string';
|
|
2251
2152
|
}
|
|
@@ -2265,14 +2166,14 @@
|
|
|
2265
2166
|
t = 'function';
|
|
2266
2167
|
}
|
|
2267
2168
|
if ((0, isFunction_5.isFunction)(t)) {
|
|
2268
|
-
typesList.push(t.name ||
|
|
2169
|
+
typesList.push(t.name || t.constructor?.name || t.toString());
|
|
2269
2170
|
if (value instanceof t) {
|
|
2270
2171
|
ok = true;
|
|
2271
2172
|
return false;
|
|
2272
2173
|
}
|
|
2273
2174
|
}
|
|
2274
2175
|
else if (!(0, isString_8.isString)(t) || !(0, isFunction_5.isFunction)(bbn.fn['is' + (0, correctCase_1.correctCase)(t)])) {
|
|
2275
|
-
(0, error_2.error)(
|
|
2176
|
+
(0, error_2.error)(`The type ${t} is not recognized`);
|
|
2276
2177
|
}
|
|
2277
2178
|
else if (bbn.fn['is' + (0, correctCase_1.correctCase)(t)](value)) {
|
|
2278
2179
|
ok = true;
|
|
@@ -2296,14 +2197,14 @@
|
|
|
2296
2197
|
"use strict";
|
|
2297
2198
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2298
2199
|
exports.clone = void 0;
|
|
2299
|
-
|
|
2200
|
+
const clone = function (obj) {
|
|
2300
2201
|
if ((0, isArray_8.isArray)(obj)) {
|
|
2301
|
-
return obj.slice().map(
|
|
2202
|
+
return obj.slice().map((a) => {
|
|
2302
2203
|
return typeof a === 'object' ? clone(a) : a;
|
|
2303
2204
|
});
|
|
2304
2205
|
}
|
|
2305
2206
|
if ((0, isObject_10.isObject)(obj)) {
|
|
2306
|
-
|
|
2207
|
+
const o = Object.create(Object.getPrototypeOf(obj));
|
|
2307
2208
|
return (0, extend_3.extend)(true, o, obj);
|
|
2308
2209
|
}
|
|
2309
2210
|
return obj;
|
|
@@ -2314,8 +2215,8 @@
|
|
|
2314
2215
|
"use strict";
|
|
2315
2216
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2316
2217
|
exports.colorToHex = void 0;
|
|
2317
|
-
|
|
2318
|
-
|
|
2218
|
+
const colorToHex = function (color) {
|
|
2219
|
+
let canvas = document.createElement('canvas').getContext('2d');
|
|
2319
2220
|
canvas.fillStyle = color;
|
|
2320
2221
|
return canvas.fillStyle;
|
|
2321
2222
|
};
|
|
@@ -2325,20 +2226,18 @@
|
|
|
2325
2226
|
"use strict";
|
|
2326
2227
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2327
2228
|
exports.copy = void 0;
|
|
2328
|
-
|
|
2329
|
-
return new Promise(
|
|
2330
|
-
var _a;
|
|
2229
|
+
const copy = function (st) {
|
|
2230
|
+
return new Promise((resolve) => {
|
|
2331
2231
|
if (st) {
|
|
2332
2232
|
if (navigator && navigator.clipboard) {
|
|
2333
2233
|
if (st instanceof Blob) {
|
|
2334
|
-
navigator.clipboard.write([new ClipboardItem(
|
|
2234
|
+
navigator.clipboard.write([new ClipboardItem({ [st.type.toString()]: st })]).then(() => {
|
|
2335
2235
|
resolve(true);
|
|
2336
2236
|
});
|
|
2337
2237
|
}
|
|
2338
2238
|
else if ((0, isObject_11.isObject)(st) && (0, isFunction_6.isFunction)(st.toBlob)) {
|
|
2339
|
-
st.toBlob(
|
|
2340
|
-
|
|
2341
|
-
navigator.clipboard.write([new ClipboardItem((_a = {}, _a[blob.type.toString()] = blob, _a))]).then(function () {
|
|
2239
|
+
st.toBlob((blob) => {
|
|
2240
|
+
navigator.clipboard.write([new ClipboardItem({ [blob.type.toString()]: blob })]).then(() => {
|
|
2342
2241
|
resolve(true);
|
|
2343
2242
|
});
|
|
2344
2243
|
});
|
|
@@ -2349,7 +2248,7 @@
|
|
|
2349
2248
|
}
|
|
2350
2249
|
return;
|
|
2351
2250
|
}
|
|
2352
|
-
|
|
2251
|
+
let input = document.createElement('textarea');
|
|
2353
2252
|
input.style.opacity = '0';
|
|
2354
2253
|
input.value = st;
|
|
2355
2254
|
document.body.appendChild(input);
|
|
@@ -2367,9 +2266,7 @@
|
|
|
2367
2266
|
"use strict";
|
|
2368
2267
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2369
2268
|
exports.count = void 0;
|
|
2370
|
-
|
|
2371
|
-
if (val === void 0) { val = null; }
|
|
2372
|
-
if (operator === void 0) { operator = '='; }
|
|
2269
|
+
const count = function (arr, prop, val = null, operator = '=') {
|
|
2373
2270
|
return (0, filter_2.filter)(arr, prop, val, operator).length || 0;
|
|
2374
2271
|
};
|
|
2375
2272
|
exports.count = count;
|
|
@@ -2379,18 +2276,18 @@
|
|
|
2379
2276
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2380
2277
|
exports.crc32 = void 0;
|
|
2381
2278
|
// this is a test
|
|
2382
|
-
|
|
2383
|
-
for (
|
|
2384
|
-
|
|
2385
|
-
for (
|
|
2279
|
+
const crc32Table = [];
|
|
2280
|
+
for (let i = 0; i < 256; i++) {
|
|
2281
|
+
let c = i;
|
|
2282
|
+
for (let j = 0; j < 8; j++) {
|
|
2386
2283
|
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
2387
2284
|
}
|
|
2388
2285
|
crc32Table.push(c);
|
|
2389
2286
|
}
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
for (
|
|
2393
|
-
|
|
2287
|
+
const crc32 = function (str) {
|
|
2288
|
+
let crc = 0 ^ -1;
|
|
2289
|
+
for (let i = 0; i < str.length; i++) {
|
|
2290
|
+
const charCode = str.charCodeAt(i);
|
|
2394
2291
|
crc = (crc >>> 8) ^ crc32Table[(crc ^ charCode) & 0xff];
|
|
2395
2292
|
}
|
|
2396
2293
|
return (crc ^ -1) >>> 0; // Make sure the result is a 32-bit positive integer
|
|
@@ -2401,14 +2298,10 @@
|
|
|
2401
2298
|
"use strict";
|
|
2402
2299
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2403
2300
|
exports.createObject = void 0;
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2407
|
-
args[_i] = arguments[_i];
|
|
2408
|
-
}
|
|
2409
|
-
var obj = Object.create(null);
|
|
2301
|
+
const createObject = function (...args) {
|
|
2302
|
+
const obj = Object.create(null);
|
|
2410
2303
|
if (args.length) {
|
|
2411
|
-
|
|
2304
|
+
(0, extend_4.extend)(obj, ...args);
|
|
2412
2305
|
}
|
|
2413
2306
|
return obj;
|
|
2414
2307
|
};
|
|
@@ -2418,11 +2311,11 @@
|
|
|
2418
2311
|
"use strict";
|
|
2419
2312
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2420
2313
|
exports.cssExists = void 0;
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
for (
|
|
2314
|
+
const cssExists = function (f) {
|
|
2315
|
+
let ok;
|
|
2316
|
+
let rules;
|
|
2317
|
+
let css = document.styleSheets;
|
|
2318
|
+
for (let sx = 0; sx < css.length; sx++) {
|
|
2426
2319
|
ok = 1;
|
|
2427
2320
|
try {
|
|
2428
2321
|
rules = css[sx].rules || css[sx].cssRules;
|
|
@@ -2435,7 +2328,7 @@
|
|
|
2435
2328
|
}
|
|
2436
2329
|
if (ok) {
|
|
2437
2330
|
//log(rules);
|
|
2438
|
-
for (
|
|
2331
|
+
for (let cx = 0; cx < rules.length; cx++) {
|
|
2439
2332
|
//log(rules[cx].selectorText);
|
|
2440
2333
|
if (new RegExp('(^|\\s)' + (0, escapeRegExp_2.escapeRegExp)(f) + '(\\{|\\s)', 'g').test(rules[cx].selectorText)) {
|
|
2441
2334
|
return true;
|
|
@@ -2451,8 +2344,8 @@
|
|
|
2451
2344
|
"use strict";
|
|
2452
2345
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2453
2346
|
exports.dateSQL = void 0;
|
|
2454
|
-
|
|
2455
|
-
|
|
2347
|
+
const dateSQL = function (v, dayOnly) {
|
|
2348
|
+
let value = (0, date_4.date)(v);
|
|
2456
2349
|
if (value) {
|
|
2457
2350
|
return dayjs(value).format('YYYY-MM-DD' + (dayOnly ? '' : ' HH:mm:ss'));
|
|
2458
2351
|
}
|
|
@@ -2463,8 +2356,8 @@
|
|
|
2463
2356
|
"use strict";
|
|
2464
2357
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2465
2358
|
exports.daysInMonth = void 0;
|
|
2466
|
-
|
|
2467
|
-
|
|
2359
|
+
const daysInMonth = function (v) {
|
|
2360
|
+
let d = (0, date_5.date)(v);
|
|
2468
2361
|
if (d) {
|
|
2469
2362
|
return dayjs(d).daysInMonth();
|
|
2470
2363
|
}
|
|
@@ -2476,19 +2369,18 @@
|
|
|
2476
2369
|
"use strict";
|
|
2477
2370
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2478
2371
|
exports.deepPath = void 0;
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
var start = 0;
|
|
2372
|
+
const deepPath = function (arr, filter, deepProperty, res = []) {
|
|
2373
|
+
let idx;
|
|
2374
|
+
let start = 0;
|
|
2483
2375
|
if ((idx = (0, search_4.search)(arr, filter, start)) > -1) {
|
|
2484
2376
|
res.push(idx);
|
|
2485
2377
|
return res;
|
|
2486
2378
|
}
|
|
2487
|
-
(0, each_11.each)(arr,
|
|
2379
|
+
(0, each_11.each)(arr, (it, i) => {
|
|
2488
2380
|
if ((0, isArray_9.isArray)(it[deepProperty])) {
|
|
2489
|
-
|
|
2381
|
+
let r = res.slice();
|
|
2490
2382
|
r.push(i);
|
|
2491
|
-
|
|
2383
|
+
let tmp = deepPath(it[deepProperty], filter, deepProperty, r);
|
|
2492
2384
|
if (tmp !== false) {
|
|
2493
2385
|
return tmp;
|
|
2494
2386
|
}
|
|
@@ -2502,8 +2394,8 @@
|
|
|
2502
2394
|
"use strict";
|
|
2503
2395
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2504
2396
|
exports.defaultConfirmFunction = void 0;
|
|
2505
|
-
|
|
2506
|
-
|
|
2397
|
+
const defaultConfirmFunction = function (text, yesFn, noFn) {
|
|
2398
|
+
let ok = 0;
|
|
2507
2399
|
if (confirm(text)) {
|
|
2508
2400
|
if ((0, isFunction_7.isFunction)(yesFn)) {
|
|
2509
2401
|
yesFn();
|
|
@@ -2520,7 +2412,7 @@
|
|
|
2520
2412
|
"use strict";
|
|
2521
2413
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2522
2414
|
exports.defaultErrorFunction = void 0;
|
|
2523
|
-
|
|
2415
|
+
const defaultErrorFunction = function (message) {
|
|
2524
2416
|
(0, log_9.log)(message);
|
|
2525
2417
|
};
|
|
2526
2418
|
exports.defaultErrorFunction = defaultErrorFunction;
|
|
@@ -2529,7 +2421,7 @@
|
|
|
2529
2421
|
"use strict";
|
|
2530
2422
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2531
2423
|
exports.defaultHistoryFunction = void 0;
|
|
2532
|
-
|
|
2424
|
+
const defaultHistoryFunction = function (obj) {
|
|
2533
2425
|
return true;
|
|
2534
2426
|
};
|
|
2535
2427
|
exports.defaultHistoryFunction = defaultHistoryFunction;
|
|
@@ -2538,7 +2430,7 @@
|
|
|
2538
2430
|
"use strict";
|
|
2539
2431
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2540
2432
|
exports.defaultPreLinkFunction = void 0;
|
|
2541
|
-
|
|
2433
|
+
const defaultPreLinkFunction = function (url, force, ele) {
|
|
2542
2434
|
return url;
|
|
2543
2435
|
};
|
|
2544
2436
|
exports.defaultPreLinkFunction = defaultPreLinkFunction;
|
|
@@ -2547,7 +2439,7 @@
|
|
|
2547
2439
|
"use strict";
|
|
2548
2440
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2549
2441
|
exports.defaultResizeFunction = void 0;
|
|
2550
|
-
|
|
2442
|
+
const defaultResizeFunction = function () {
|
|
2551
2443
|
return true;
|
|
2552
2444
|
};
|
|
2553
2445
|
exports.defaultResizeFunction = defaultResizeFunction;
|
|
@@ -2556,7 +2448,7 @@
|
|
|
2556
2448
|
"use strict";
|
|
2557
2449
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2558
2450
|
exports.deleteProp = void 0;
|
|
2559
|
-
|
|
2451
|
+
const deleteProp = function (obj, prop) {
|
|
2560
2452
|
(0, checkType_1.checkType)(obj, 'object', bbn._('The obj must be an object in setProp'));
|
|
2561
2453
|
(0, checkType_1.checkType)(prop, 'string', bbn._('The prop must be a string in setProp'));
|
|
2562
2454
|
delete obj[prop];
|
|
@@ -2567,15 +2459,10 @@
|
|
|
2567
2459
|
"use strict";
|
|
2568
2460
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2569
2461
|
exports.isValue = void 0;
|
|
2570
|
-
|
|
2571
|
-
var args = [];
|
|
2572
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2573
|
-
args[_i] = arguments[_i];
|
|
2574
|
-
}
|
|
2462
|
+
const isValue = function (...args) {
|
|
2575
2463
|
if (!args.length)
|
|
2576
2464
|
return false;
|
|
2577
|
-
for (
|
|
2578
|
-
var a = args_11[_a];
|
|
2465
|
+
for (let a of args) {
|
|
2579
2466
|
if (typeof a === 'object' && !(0, isNull_2.isNull)(a)) {
|
|
2580
2467
|
return false;
|
|
2581
2468
|
}
|
|
@@ -2588,14 +2475,12 @@
|
|
|
2588
2475
|
"use strict";
|
|
2589
2476
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2590
2477
|
exports.diffObj = void 0;
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
if (unchanged === void 0) { unchanged = false; }
|
|
2594
|
-
if (notRoot === void 0) { notRoot = false; }
|
|
2478
|
+
let diffObjProcessed = [];
|
|
2479
|
+
const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
|
|
2595
2480
|
if (!notRoot) {
|
|
2596
2481
|
diffObjProcessed = [];
|
|
2597
2482
|
}
|
|
2598
|
-
|
|
2483
|
+
let VALUE_CREATED = 'created', VALUE_UPDATED = 'updated', VALUE_DELETED = 'deleted', VALUE_UNCHANGED = 'unchanged', _compareValues = function (value1, value2) {
|
|
2599
2484
|
if (value1 === value2) {
|
|
2600
2485
|
return VALUE_UNCHANGED;
|
|
2601
2486
|
}
|
|
@@ -2613,12 +2498,12 @@
|
|
|
2613
2498
|
if (notRoot === undefined) {
|
|
2614
2499
|
notRoot = false;
|
|
2615
2500
|
}
|
|
2616
|
-
|
|
2501
|
+
let diff = (0, createObject_1.createObject)();
|
|
2617
2502
|
if (!(0, isFunction_8.isFunction)(obj1) && !(0, isFunction_8.isFunction)(obj2)) {
|
|
2618
2503
|
if ((0, isValue_1.isValue)(obj1) || (0, isValue_1.isValue)(obj2)) {
|
|
2619
|
-
|
|
2504
|
+
let res = _compareValues(obj1, obj2);
|
|
2620
2505
|
if (unchanged || res !== VALUE_UNCHANGED) {
|
|
2621
|
-
|
|
2506
|
+
let ret = (0, createObject_1.createObject)();
|
|
2622
2507
|
Object.defineProperty(ret, 'type', {
|
|
2623
2508
|
value: res,
|
|
2624
2509
|
enumerable: false,
|
|
@@ -2649,24 +2534,24 @@
|
|
|
2649
2534
|
return false;
|
|
2650
2535
|
}
|
|
2651
2536
|
diffObjProcessed.push(obj1, obj2);
|
|
2652
|
-
for (
|
|
2537
|
+
for (let key in obj1) {
|
|
2653
2538
|
if ((0, isFunction_8.isFunction)(obj1[key])) {
|
|
2654
2539
|
continue;
|
|
2655
2540
|
}
|
|
2656
|
-
|
|
2541
|
+
let value2 = undefined;
|
|
2657
2542
|
if ('undefined' != typeof obj2[key]) {
|
|
2658
2543
|
value2 = obj2[key];
|
|
2659
2544
|
}
|
|
2660
|
-
|
|
2545
|
+
let res = diffObj(obj1[key], value2, unchanged, true);
|
|
2661
2546
|
if (res) {
|
|
2662
2547
|
diff[key] = res;
|
|
2663
2548
|
}
|
|
2664
2549
|
}
|
|
2665
|
-
for (
|
|
2550
|
+
for (let key in obj2) {
|
|
2666
2551
|
if ((0, isFunction_8.isFunction)(obj2[key]) || 'undefined' != typeof obj1[key]) {
|
|
2667
2552
|
continue;
|
|
2668
2553
|
}
|
|
2669
|
-
|
|
2554
|
+
let res = diffObj(undefined, obj2[key], unchanged, true);
|
|
2670
2555
|
if (res) {
|
|
2671
2556
|
diff[key] = res;
|
|
2672
2557
|
}
|
|
@@ -2680,12 +2565,12 @@
|
|
|
2680
2565
|
"use strict";
|
|
2681
2566
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2682
2567
|
exports.dirName = void 0;
|
|
2683
|
-
|
|
2568
|
+
const dirName = function (path) {
|
|
2684
2569
|
if ((0, isString_9.isString)(path) && path) {
|
|
2685
2570
|
while ((0, substr_6.substr)(path, path.length - 1) === '/') {
|
|
2686
2571
|
path = (0, substr_6.substr)(path, 0, path.length - 1);
|
|
2687
2572
|
}
|
|
2688
|
-
|
|
2573
|
+
let pos = path.lastIndexOf('/');
|
|
2689
2574
|
if (pos > 0) {
|
|
2690
2575
|
return (0, substr_6.substr)(path, 0, pos);
|
|
2691
2576
|
}
|
|
@@ -2701,15 +2586,10 @@
|
|
|
2701
2586
|
"use strict";
|
|
2702
2587
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2703
2588
|
exports.isBlob = void 0;
|
|
2704
|
-
|
|
2705
|
-
var args = [];
|
|
2706
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2707
|
-
args[_i] = arguments[_i];
|
|
2708
|
-
}
|
|
2589
|
+
const isBlob = function (...args) {
|
|
2709
2590
|
if (!args.length)
|
|
2710
2591
|
return false;
|
|
2711
|
-
for (
|
|
2712
|
-
var a = args_12[_a];
|
|
2592
|
+
for (let a of args) {
|
|
2713
2593
|
if ({}.toString.apply(a) !== '[object Blob]') {
|
|
2714
2594
|
return false;
|
|
2715
2595
|
}
|
|
@@ -2722,9 +2602,9 @@
|
|
|
2722
2602
|
"use strict";
|
|
2723
2603
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2724
2604
|
exports.fileExt = void 0;
|
|
2725
|
-
|
|
2605
|
+
const fileExt = function (filename) {
|
|
2726
2606
|
if (filename && (0, isString_10.isString)(filename)) {
|
|
2727
|
-
|
|
2607
|
+
let bits = filename.split('.');
|
|
2728
2608
|
if (bits[0] && bits.length > 1) {
|
|
2729
2609
|
return bits[bits.length - 1].toLowerCase();
|
|
2730
2610
|
}
|
|
@@ -2737,15 +2617,10 @@
|
|
|
2737
2617
|
"use strict";
|
|
2738
2618
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2739
2619
|
exports.isCanvas = void 0;
|
|
2740
|
-
|
|
2741
|
-
var args = [];
|
|
2742
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2743
|
-
args[_i] = arguments[_i];
|
|
2744
|
-
}
|
|
2620
|
+
const isCanvas = function (...args) {
|
|
2745
2621
|
if (!args.length)
|
|
2746
2622
|
return false;
|
|
2747
|
-
for (
|
|
2748
|
-
var a = args_13[_a];
|
|
2623
|
+
for (let a of args) {
|
|
2749
2624
|
if (!(a instanceof HTMLCanvasElement)) {
|
|
2750
2625
|
return false;
|
|
2751
2626
|
}
|
|
@@ -2758,11 +2633,11 @@
|
|
|
2758
2633
|
"use strict";
|
|
2759
2634
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2760
2635
|
exports.downloadContent = void 0;
|
|
2761
|
-
|
|
2636
|
+
const downloadContent = function (filename, content, type) {
|
|
2762
2637
|
if ((0, isCanvas_1.isCanvas)(content)) {
|
|
2763
|
-
content.toBlob(
|
|
2638
|
+
content.toBlob((blob) => {
|
|
2764
2639
|
// blob ready, download it
|
|
2765
|
-
|
|
2640
|
+
let a = document.createElement('a');
|
|
2766
2641
|
a.download = filename;
|
|
2767
2642
|
a.href = window.URL.createObjectURL(blob);
|
|
2768
2643
|
a.className = 'bbn-no';
|
|
@@ -2778,9 +2653,9 @@
|
|
|
2778
2653
|
else if (type.indexOf('/') === -1) {
|
|
2779
2654
|
type = 'text/' + type;
|
|
2780
2655
|
}
|
|
2781
|
-
|
|
2656
|
+
let a = window.document.createElement('a');
|
|
2782
2657
|
a.className = 'bbn-no';
|
|
2783
|
-
|
|
2658
|
+
let src = null;
|
|
2784
2659
|
if ((0, isString_11.isString)(content)) {
|
|
2785
2660
|
src = new Blob([content], { type: type });
|
|
2786
2661
|
}
|
|
@@ -2807,15 +2682,15 @@
|
|
|
2807
2682
|
"use strict";
|
|
2808
2683
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2809
2684
|
exports.download = void 0;
|
|
2810
|
-
|
|
2685
|
+
const download = function (url, filename, params) {
|
|
2811
2686
|
// We can intervert the arguments
|
|
2812
2687
|
if (filename && (typeof (filename) === 'object')) {
|
|
2813
2688
|
params = filename;
|
|
2814
2689
|
filename = null;
|
|
2815
2690
|
}
|
|
2816
|
-
return (0, ajax_1.ajax)(url, 'blob', params || { _bbn_download: 1 },
|
|
2691
|
+
return (0, ajax_1.ajax)(url, 'blob', params || { _bbn_download: 1 }, (d, headers) => {
|
|
2817
2692
|
if (!filename) {
|
|
2818
|
-
|
|
2693
|
+
let cd = 'attachment; filename=';
|
|
2819
2694
|
if (headers && headers['content-disposition'] && headers['content-disposition'].indexOf(cd) === 0) {
|
|
2820
2695
|
filename = (0, substr_7.substr)(headers['content-disposition'], cd.length + 1, headers['content-disposition'].length - cd.length - 2);
|
|
2821
2696
|
}
|
|
@@ -2824,14 +2699,14 @@
|
|
|
2824
2699
|
}
|
|
2825
2700
|
}
|
|
2826
2701
|
if ((0, isBlob_1.isBlob)(d)) {
|
|
2827
|
-
|
|
2828
|
-
|
|
2702
|
+
let extension = (0, fileExt_1.fileExt)(filename);
|
|
2703
|
+
let htmlExtensions = ['php', 'html'];
|
|
2829
2704
|
if ((typeof filename === 'string') && ((('type' in d) && (d.type !== 'text/html')) || htmlExtensions.includes(extension))) {
|
|
2830
2705
|
(0, downloadContent_1.downloadContent)(filename, d);
|
|
2831
2706
|
return;
|
|
2832
2707
|
}
|
|
2833
2708
|
}
|
|
2834
|
-
},
|
|
2709
|
+
}, e => {
|
|
2835
2710
|
(0, defaultAjaxErrorFunction_2.defaultAjaxErrorFunction)(e);
|
|
2836
2711
|
});
|
|
2837
2712
|
};
|
|
@@ -2841,7 +2716,7 @@
|
|
|
2841
2716
|
"use strict";
|
|
2842
2717
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2843
2718
|
exports.eraseCookie = void 0;
|
|
2844
|
-
|
|
2719
|
+
const eraseCookie = function (name) {
|
|
2845
2720
|
document.cookie = name + '=; Max-Age=-99999999;';
|
|
2846
2721
|
};
|
|
2847
2722
|
exports.eraseCookie = eraseCookie;
|
|
@@ -2850,7 +2725,7 @@
|
|
|
2850
2725
|
"use strict";
|
|
2851
2726
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2852
2727
|
exports.escapeDquotes = void 0;
|
|
2853
|
-
|
|
2728
|
+
const escapeDquotes = function (str) {
|
|
2854
2729
|
if (!(0, isString_12.isString)(str)) {
|
|
2855
2730
|
return str;
|
|
2856
2731
|
}
|
|
@@ -2862,7 +2737,7 @@
|
|
|
2862
2737
|
"use strict";
|
|
2863
2738
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2864
2739
|
exports.escapeSquotes = void 0;
|
|
2865
|
-
|
|
2740
|
+
const escapeSquotes = function (str) {
|
|
2866
2741
|
if (!(0, isString_13.isString)(str)) {
|
|
2867
2742
|
return str;
|
|
2868
2743
|
}
|
|
@@ -2874,7 +2749,7 @@
|
|
|
2874
2749
|
"use strict";
|
|
2875
2750
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2876
2751
|
exports.escapeTicks = void 0;
|
|
2877
|
-
|
|
2752
|
+
const escapeTicks = function (str) {
|
|
2878
2753
|
if (!(0, isString_14.isString)(str)) {
|
|
2879
2754
|
return str;
|
|
2880
2755
|
}
|
|
@@ -2886,8 +2761,8 @@
|
|
|
2886
2761
|
"use strict";
|
|
2887
2762
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2888
2763
|
exports.escapeUrl = void 0;
|
|
2889
|
-
|
|
2890
|
-
|
|
2764
|
+
const escapeUrl = function (url, params) {
|
|
2765
|
+
let st = '';
|
|
2891
2766
|
if (url.match('^(http|https)://')) {
|
|
2892
2767
|
st += 'http';
|
|
2893
2768
|
url = url.substring(4);
|
|
@@ -2898,14 +2773,14 @@
|
|
|
2898
2773
|
st += '://';
|
|
2899
2774
|
url = url.substring(3);
|
|
2900
2775
|
}
|
|
2901
|
-
(0, each_12.each)((0, dirName_1.dirName)(url).split('/'),
|
|
2776
|
+
(0, each_12.each)((0, dirName_1.dirName)(url).split('/'), (a) => {
|
|
2902
2777
|
st += encodeURIComponent(a) + '/';
|
|
2903
2778
|
});
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2779
|
+
let base = (0, baseName_2.baseName)(url);
|
|
2780
|
+
let sep = '?';
|
|
2781
|
+
let existingParams = '';
|
|
2907
2782
|
if (base.indexOf(sep)) {
|
|
2908
|
-
|
|
2783
|
+
let tmp = base.split('?');
|
|
2909
2784
|
sep = '&';
|
|
2910
2785
|
existingParams = '?' + tmp[1];
|
|
2911
2786
|
base = tmp[0];
|
|
@@ -2927,14 +2802,9 @@
|
|
|
2927
2802
|
"use strict";
|
|
2928
2803
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2929
2804
|
exports.extendOut = void 0;
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
for (
|
|
2933
|
-
args[_i] = arguments[_i];
|
|
2934
|
-
}
|
|
2935
|
-
var r = null;
|
|
2936
|
-
for (var _a = 0, args_14 = args; _a < args_14.length; _a++) {
|
|
2937
|
-
var a = args_14[_a];
|
|
2805
|
+
const extendOut = function (...args) {
|
|
2806
|
+
let r = null;
|
|
2807
|
+
for (let a of args) {
|
|
2938
2808
|
if (!(0, isObject_13.isObject)(a)) {
|
|
2939
2809
|
throw new Error('Each argument for extendOut must be an object, ' + typeof a + ' given');
|
|
2940
2810
|
}
|
|
@@ -2942,7 +2812,7 @@
|
|
|
2942
2812
|
r = a;
|
|
2943
2813
|
}
|
|
2944
2814
|
else {
|
|
2945
|
-
for (
|
|
2815
|
+
for (let n in a) {
|
|
2946
2816
|
if ((0, isObject_13.isObject)(r[n], a[n])) {
|
|
2947
2817
|
extendOut(r[n], a[n]);
|
|
2948
2818
|
}
|
|
@@ -2960,8 +2830,8 @@
|
|
|
2960
2830
|
"use strict";
|
|
2961
2831
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2962
2832
|
exports.fieldValue = void 0;
|
|
2963
|
-
|
|
2964
|
-
|
|
2833
|
+
const fieldValue = function (field) {
|
|
2834
|
+
let v;
|
|
2965
2835
|
if (field.type === 'checkbox') {
|
|
2966
2836
|
if (field.checked) {
|
|
2967
2837
|
v = field.value;
|
|
@@ -2989,15 +2859,14 @@
|
|
|
2989
2859
|
"use strict";
|
|
2990
2860
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2991
2861
|
exports.findAll = void 0;
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
var start = 0;
|
|
2862
|
+
const findAll = function (arr, filter, deepProperty, res = []) {
|
|
2863
|
+
let idx;
|
|
2864
|
+
let start = 0;
|
|
2996
2865
|
while ((idx = (0, search_5.search)(arr, filter, start)) > -1) {
|
|
2997
2866
|
res.push(arr[idx]);
|
|
2998
2867
|
start = idx + 1;
|
|
2999
2868
|
}
|
|
3000
|
-
(0, each_13.each)(arr,
|
|
2869
|
+
(0, each_13.each)(arr, (it) => {
|
|
3001
2870
|
if ((0, isArray_10.isArray)(it[deepProperty])) {
|
|
3002
2871
|
findAll(it[deepProperty], filter, deepProperty, res);
|
|
3003
2872
|
}
|
|
@@ -3010,18 +2879,16 @@
|
|
|
3010
2879
|
"use strict";
|
|
3011
2880
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3012
2881
|
exports.fori = void 0;
|
|
3013
|
-
|
|
3014
|
-
if (max === void 0) { max = arr.length - 1; }
|
|
3015
|
-
if (min === void 0) { min = 0; }
|
|
2882
|
+
const fori = function (arr, fn, max = arr.length - 1, min = 0) {
|
|
3016
2883
|
if ((0, isArray_11.isArray)(arr)) {
|
|
3017
|
-
|
|
2884
|
+
let realMax = arr.length - 1;
|
|
3018
2885
|
if (!(0, isNumber_4.isNumber)(max) || !((0 < max) && (max <= realMax))) {
|
|
3019
2886
|
max = realMax;
|
|
3020
2887
|
}
|
|
3021
2888
|
if (!(0, isNumber_4.isNumber)(min) || !((0 <= min) && (min < realMax)) || (min > max)) {
|
|
3022
2889
|
min = 0;
|
|
3023
2890
|
}
|
|
3024
|
-
for (
|
|
2891
|
+
for (let i = min; i <= max; i++) {
|
|
3025
2892
|
if (fn(arr[i], i) === false) {
|
|
3026
2893
|
return;
|
|
3027
2894
|
}
|
|
@@ -3034,18 +2901,16 @@
|
|
|
3034
2901
|
"use strict";
|
|
3035
2902
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3036
2903
|
exports.forir = void 0;
|
|
3037
|
-
|
|
3038
|
-
if (max === void 0) { max = arr.length - 1; }
|
|
3039
|
-
if (min === void 0) { min = 0; }
|
|
2904
|
+
const forir = function (arr, fn, max = arr.length - 1, min = 0) {
|
|
3040
2905
|
if ((0, isArray_12.isArray)(arr)) {
|
|
3041
|
-
|
|
2906
|
+
let realMax = arr.length - 1;
|
|
3042
2907
|
if (!(0, isNumber_5.isNumber)(max) || !((0 < max) && (max <= realMax))) {
|
|
3043
2908
|
max = realMax;
|
|
3044
2909
|
}
|
|
3045
2910
|
if (!(0, isNumber_5.isNumber)(min) || !((0 <= min) && (min < realMax)) || (min > max)) {
|
|
3046
2911
|
min = 0;
|
|
3047
2912
|
}
|
|
3048
|
-
for (
|
|
2913
|
+
for (let i = max; i >= min; i--) {
|
|
3049
2914
|
if (fn(arr[i], i) === false) {
|
|
3050
2915
|
return;
|
|
3051
2916
|
}
|
|
@@ -3058,12 +2923,12 @@
|
|
|
3058
2923
|
"use strict";
|
|
3059
2924
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3060
2925
|
exports.format = void 0;
|
|
3061
|
-
|
|
3062
|
-
|
|
2926
|
+
const format = function (str) {
|
|
2927
|
+
let args = Array.prototype.slice.call(arguments, 1);
|
|
3063
2928
|
if (args.length) {
|
|
3064
|
-
|
|
3065
|
-
return str.replace(/\%([d|s])/g,
|
|
3066
|
-
|
|
2929
|
+
let i = 0;
|
|
2930
|
+
return str.replace(/\%([d|s])/g, (match, type) => {
|
|
2931
|
+
let tmp = args[i++];
|
|
3067
2932
|
(0, checkType_2.checkType)(tmp, type === 'd' ? 'number' : 'string', bbn._("The value doesn't correspond to the format"));
|
|
3068
2933
|
return tmp;
|
|
3069
2934
|
});
|
|
@@ -3076,12 +2941,11 @@
|
|
|
3076
2941
|
"use strict";
|
|
3077
2942
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3078
2943
|
exports.formatBytes = void 0;
|
|
3079
|
-
|
|
3080
|
-
if (decimals === void 0) { decimals = 2; }
|
|
2944
|
+
const formatBytes = function (bytes, decimals = 2) {
|
|
3081
2945
|
if (!bytes) {
|
|
3082
2946
|
return '0 B';
|
|
3083
2947
|
}
|
|
3084
|
-
|
|
2948
|
+
const k = 1024, s = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
3085
2949
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(decimals < 0 ? 0 : decimals)) + ' ' + s[i];
|
|
3086
2950
|
};
|
|
3087
2951
|
exports.formatBytes = formatBytes;
|
|
@@ -3090,7 +2954,7 @@
|
|
|
3090
2954
|
"use strict";
|
|
3091
2955
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3092
2956
|
exports.formatDate = void 0;
|
|
3093
|
-
|
|
2957
|
+
const formatDate = function (date, format) {
|
|
3094
2958
|
return dayjs(date).format(format);
|
|
3095
2959
|
};
|
|
3096
2960
|
exports.formatDate = formatDate;
|
|
@@ -3099,7 +2963,7 @@
|
|
|
3099
2963
|
"use strict";
|
|
3100
2964
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3101
2965
|
exports.formatSize = void 0;
|
|
3102
|
-
|
|
2966
|
+
const formatSize = function (st, noValid) {
|
|
3103
2967
|
if ((0, isNumber_6.isNumber)(st)) {
|
|
3104
2968
|
return st + 'px';
|
|
3105
2969
|
}
|
|
@@ -3114,47 +2978,47 @@
|
|
|
3114
2978
|
"use strict";
|
|
3115
2979
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3116
2980
|
exports.formdata = void 0;
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
(0, each_14.each)($inputs,
|
|
2981
|
+
const formdata = function (form) {
|
|
2982
|
+
let $inputs = form.querySelectorAll('input[name],select[name],textarea[name],button[name]');
|
|
2983
|
+
let res = {};
|
|
2984
|
+
let n;
|
|
2985
|
+
let v;
|
|
2986
|
+
(0, each_14.each)($inputs, (input, i) => {
|
|
3123
2987
|
v = (0, fieldValue_1.fieldValue)(input);
|
|
3124
2988
|
if (v !== undefined && !input.disabled) {
|
|
3125
|
-
|
|
3126
|
-
if (
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
}
|
|
3134
|
-
if (
|
|
3135
|
-
n = (0, substr_8.substr)(
|
|
2989
|
+
let name = input.name;
|
|
2990
|
+
if (name.indexOf('[]') === -1 &&
|
|
2991
|
+
name.indexOf('[') > -1 &&
|
|
2992
|
+
name.indexOf(']') > -1 &&
|
|
2993
|
+
name.lastIndexOf(']') === name.length - 1) {
|
|
2994
|
+
name = (0, replaceAll_3.replaceAll)('][', '.', name);
|
|
2995
|
+
name = (0, replaceAll_3.replaceAll)('[', '.', name);
|
|
2996
|
+
name = (0, replaceAll_3.replaceAll)(']', '', name);
|
|
2997
|
+
}
|
|
2998
|
+
if (name.length > 2 && name.indexOf('[]') === name.length - 2) {
|
|
2999
|
+
n = (0, substr_8.substr)(name, 0, name.length - 2);
|
|
3136
3000
|
if (res[n] === undefined) {
|
|
3137
3001
|
res[n] = [];
|
|
3138
3002
|
}
|
|
3139
3003
|
res[n].push(v);
|
|
3140
3004
|
}
|
|
3141
|
-
else if (
|
|
3142
|
-
|
|
3005
|
+
else if (name.indexOf('.') > -1) {
|
|
3006
|
+
let tmp, parts = name.split('.');
|
|
3143
3007
|
tmp = res;
|
|
3144
|
-
for (
|
|
3145
|
-
if (res[parts[
|
|
3146
|
-
if (
|
|
3147
|
-
tmp[parts[
|
|
3008
|
+
for (let i = 0; i < parts.length; i++) {
|
|
3009
|
+
if (res[parts[i]] === undefined) {
|
|
3010
|
+
if (i < parts.length - 1) {
|
|
3011
|
+
tmp[parts[i]] = {};
|
|
3148
3012
|
}
|
|
3149
3013
|
else {
|
|
3150
|
-
tmp[parts[
|
|
3014
|
+
tmp[parts[i]] = v;
|
|
3151
3015
|
}
|
|
3152
3016
|
}
|
|
3153
|
-
tmp = tmp[parts[
|
|
3017
|
+
tmp = tmp[parts[i]];
|
|
3154
3018
|
}
|
|
3155
3019
|
}
|
|
3156
3020
|
else {
|
|
3157
|
-
res[
|
|
3021
|
+
res[name] = v;
|
|
3158
3022
|
}
|
|
3159
3023
|
}
|
|
3160
3024
|
});
|
|
@@ -3167,8 +3031,8 @@
|
|
|
3167
3031
|
"use strict";
|
|
3168
3032
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3169
3033
|
exports.fromXml = void 0;
|
|
3170
|
-
|
|
3171
|
-
|
|
3034
|
+
const fromXml = function (xml, arrayTags) {
|
|
3035
|
+
let dom = null;
|
|
3172
3036
|
if (window.DOMParser)
|
|
3173
3037
|
dom = new DOMParser().parseFromString(xml, 'text/xml');
|
|
3174
3038
|
else if (window['ActiveXObject']) {
|
|
@@ -3181,12 +3045,12 @@
|
|
|
3181
3045
|
throw new Error('cannot parse xml string!');
|
|
3182
3046
|
function parseNode(xmlNode, result) {
|
|
3183
3047
|
if (xmlNode.nodeName == '#text') {
|
|
3184
|
-
|
|
3048
|
+
let v = xmlNode.nodeValue;
|
|
3185
3049
|
if (v.trim())
|
|
3186
3050
|
result['#text'] = v;
|
|
3187
3051
|
return;
|
|
3188
3052
|
}
|
|
3189
|
-
|
|
3053
|
+
let jsonNode = {}, existing = result[xmlNode.nodeName];
|
|
3190
3054
|
if (existing) {
|
|
3191
3055
|
if (!Array.isArray(existing))
|
|
3192
3056
|
result[xmlNode.nodeName] = [existing, jsonNode];
|
|
@@ -3200,20 +3064,14 @@
|
|
|
3200
3064
|
result[xmlNode.nodeName] = jsonNode;
|
|
3201
3065
|
}
|
|
3202
3066
|
if (xmlNode.attributes)
|
|
3203
|
-
for (
|
|
3204
|
-
var attribute = _a[_i];
|
|
3067
|
+
for (let attribute of xmlNode.attributes)
|
|
3205
3068
|
jsonNode[attribute.nodeName] = attribute.nodeValue;
|
|
3206
|
-
|
|
3207
|
-
for (var _b = 0, _c = xmlNode.childNodes; _b < _c.length; _b++) {
|
|
3208
|
-
var node = _c[_b];
|
|
3069
|
+
for (let node of xmlNode.childNodes)
|
|
3209
3070
|
parseNode(node, jsonNode);
|
|
3210
|
-
}
|
|
3211
3071
|
}
|
|
3212
|
-
|
|
3213
|
-
for (
|
|
3214
|
-
var node = _a[_i];
|
|
3072
|
+
let result = {};
|
|
3073
|
+
for (let node of dom.childNodes)
|
|
3215
3074
|
parseNode(node, result);
|
|
3216
|
-
}
|
|
3217
3075
|
return result;
|
|
3218
3076
|
};
|
|
3219
3077
|
exports.fromXml = fromXml;
|
|
@@ -3223,8 +3081,8 @@
|
|
|
3223
3081
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3224
3082
|
exports.ftime = void 0;
|
|
3225
3083
|
dayjs.extend(window['dayjs_plugin_calendar']);
|
|
3226
|
-
|
|
3227
|
-
|
|
3084
|
+
const ftime = function (d, wrong_result) {
|
|
3085
|
+
let r = (0, date_6.date)(d);
|
|
3228
3086
|
if (!(0, isDate_7.isDate)(r)) {
|
|
3229
3087
|
return wrong_result && (0, isString_17.isString)(wrong_result) ? wrong_result : '';
|
|
3230
3088
|
}
|
|
@@ -3239,7 +3097,7 @@
|
|
|
3239
3097
|
"use strict";
|
|
3240
3098
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3241
3099
|
exports.unique = void 0;
|
|
3242
|
-
|
|
3100
|
+
const unique = function (arr) {
|
|
3243
3101
|
return arr.filter(function (el, index, ar) {
|
|
3244
3102
|
return index === ar.indexOf(el);
|
|
3245
3103
|
});
|
|
@@ -3250,8 +3108,8 @@
|
|
|
3250
3108
|
"use strict";
|
|
3251
3109
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3252
3110
|
exports.getAllTags = void 0;
|
|
3253
|
-
|
|
3254
|
-
return (0, unique_1.unique)(Array.prototype.map.apply(document.all, [
|
|
3111
|
+
const getAllTags = function () {
|
|
3112
|
+
return (0, unique_1.unique)(Array.prototype.map.apply(document.all, [(a) => a.tagName.toLowerCase()]));
|
|
3255
3113
|
};
|
|
3256
3114
|
exports.getAllTags = getAllTags;
|
|
3257
3115
|
});
|
|
@@ -3259,8 +3117,8 @@
|
|
|
3259
3117
|
"use strict";
|
|
3260
3118
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3261
3119
|
exports.getAncestors = void 0;
|
|
3262
|
-
|
|
3263
|
-
|
|
3120
|
+
const getAncestors = function (ele, selector) {
|
|
3121
|
+
let r = [];
|
|
3264
3122
|
if (typeof ele === 'string') {
|
|
3265
3123
|
ele = document.querySelector(ele);
|
|
3266
3124
|
}
|
|
@@ -3289,12 +3147,12 @@
|
|
|
3289
3147
|
"use strict";
|
|
3290
3148
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3291
3149
|
exports.getAttributes = void 0;
|
|
3292
|
-
|
|
3150
|
+
const getAttributes = function (ele) {
|
|
3293
3151
|
if (!ele.getAttributeNames) {
|
|
3294
3152
|
(0, error_3.error)('The element is not a proper HTML Element');
|
|
3295
3153
|
}
|
|
3296
|
-
|
|
3297
|
-
ele.getAttributeNames().forEach(
|
|
3154
|
+
let res = Object.create(null);
|
|
3155
|
+
ele.getAttributeNames().forEach((name) => {
|
|
3298
3156
|
res[name] = ele.getAttribute(name);
|
|
3299
3157
|
});
|
|
3300
3158
|
return res;
|
|
@@ -3305,8 +3163,8 @@
|
|
|
3305
3163
|
"use strict";
|
|
3306
3164
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3307
3165
|
exports.getBrowserName = void 0;
|
|
3308
|
-
|
|
3309
|
-
|
|
3166
|
+
const getBrowserName = function () {
|
|
3167
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
3310
3168
|
switch (true) {
|
|
3311
3169
|
case userAgent.includes('edge'):
|
|
3312
3170
|
case userAgent.includes('edg/'):
|
|
@@ -3331,8 +3189,8 @@
|
|
|
3331
3189
|
"use strict";
|
|
3332
3190
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3333
3191
|
exports.getBrowserVersion = void 0;
|
|
3334
|
-
|
|
3335
|
-
|
|
3192
|
+
const getBrowserVersion = function () {
|
|
3193
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
3336
3194
|
switch (true) {
|
|
3337
3195
|
case userAgent.includes('edge/'):
|
|
3338
3196
|
return userAgent.split('edge/')[1].split(' ')[0];
|
|
@@ -3358,16 +3216,16 @@
|
|
|
3358
3216
|
"use strict";
|
|
3359
3217
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3360
3218
|
exports.getCookie = void 0;
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
for (
|
|
3365
|
-
|
|
3219
|
+
const getCookie = function (name) {
|
|
3220
|
+
let nameEqual = name + '=';
|
|
3221
|
+
let ca = document.cookie.split(';');
|
|
3222
|
+
for (let i = 0; i < ca.length; i++) {
|
|
3223
|
+
let c = ca[i];
|
|
3366
3224
|
while (c.charAt(0) == ' ') {
|
|
3367
3225
|
c = c.substring(1, c.length);
|
|
3368
3226
|
}
|
|
3369
3227
|
if (c.indexOf(nameEqual) == 0) {
|
|
3370
|
-
|
|
3228
|
+
let st = c.substring(nameEqual.length, c.length);
|
|
3371
3229
|
if (st) {
|
|
3372
3230
|
return JSON.parse(unescape(st)).value;
|
|
3373
3231
|
}
|
|
@@ -3381,7 +3239,7 @@
|
|
|
3381
3239
|
"use strict";
|
|
3382
3240
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3383
3241
|
exports.getCssVar = void 0;
|
|
3384
|
-
|
|
3242
|
+
const getCssVar = function (varname) {
|
|
3385
3243
|
if (varname.indexOf('--') !== 0) {
|
|
3386
3244
|
varname = '--' + varname;
|
|
3387
3245
|
}
|
|
@@ -3393,11 +3251,11 @@
|
|
|
3393
3251
|
"use strict";
|
|
3394
3252
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3395
3253
|
exports.getDay = void 0;
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3254
|
+
const getDay = function (v) {
|
|
3255
|
+
const biss = 1972;
|
|
3256
|
+
let d = (0, date_7.date)(v);
|
|
3399
3257
|
if (d) {
|
|
3400
|
-
|
|
3258
|
+
let t = d.getTime(), y = d.getYear(), m = d.getMonth(), days = (y - 1970) * 365;
|
|
3401
3259
|
if (m < 2) {
|
|
3402
3260
|
y--;
|
|
3403
3261
|
}
|
|
@@ -3414,8 +3272,8 @@
|
|
|
3414
3272
|
"use strict";
|
|
3415
3273
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3416
3274
|
exports.getDeviceType = void 0;
|
|
3417
|
-
|
|
3418
|
-
|
|
3275
|
+
const getDeviceType = function () {
|
|
3276
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
3419
3277
|
if (/iPhone|Android/i.test(navigator.userAgent)) {
|
|
3420
3278
|
return 'mobile';
|
|
3421
3279
|
}
|
|
@@ -3430,15 +3288,15 @@
|
|
|
3430
3288
|
"use strict";
|
|
3431
3289
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3432
3290
|
exports.getHTMLOfSelection = void 0;
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3291
|
+
const getHTMLOfSelection = function () {
|
|
3292
|
+
let range;
|
|
3293
|
+
let selection = window.getSelection();
|
|
3436
3294
|
if (selection.rangeCount > 0) {
|
|
3437
3295
|
range = selection.getRangeAt(0);
|
|
3438
3296
|
(0, log_11.log)('RANGE', range);
|
|
3439
|
-
|
|
3297
|
+
let clonedSelection = range.cloneContents();
|
|
3440
3298
|
(0, log_11.log)('clonedSelection', clonedSelection);
|
|
3441
|
-
|
|
3299
|
+
let div = document.createElement('div');
|
|
3442
3300
|
div.appendChild(clonedSelection);
|
|
3443
3301
|
return div.innerHTML;
|
|
3444
3302
|
}
|
|
@@ -3452,16 +3310,16 @@
|
|
|
3452
3310
|
"use strict";
|
|
3453
3311
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3454
3312
|
exports.getEventData = void 0;
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3313
|
+
const getEventData = function (e) {
|
|
3314
|
+
let dt = e.dataTransfer || e.clipboardData;
|
|
3315
|
+
let t = dt.getData('Text');
|
|
3316
|
+
let res = { raw: t, files: [], str: [] };
|
|
3317
|
+
let p = new Promise((ok, err) => {
|
|
3318
|
+
let done = !(dt instanceof DataTransfer);
|
|
3461
3319
|
if (!t && e.type === 'copy') {
|
|
3462
|
-
|
|
3320
|
+
let sel = window.getSelection();
|
|
3463
3321
|
res.raw = sel.toString();
|
|
3464
|
-
|
|
3322
|
+
let html = (0, getHTMLOfSelection_1.getHTMLOfSelection)();
|
|
3465
3323
|
res.str.push({
|
|
3466
3324
|
type: 'text/plain',
|
|
3467
3325
|
data: res.raw,
|
|
@@ -3484,57 +3342,57 @@
|
|
|
3484
3342
|
ok(res);
|
|
3485
3343
|
}
|
|
3486
3344
|
if (!done) {
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
(0, each_15.each)(dt.items,
|
|
3490
|
-
|
|
3491
|
-
|
|
3345
|
+
let strings = [];
|
|
3346
|
+
let num = dt.items.length;
|
|
3347
|
+
(0, each_15.each)(dt.items, (item, idx) => {
|
|
3348
|
+
let kind = item.kind;
|
|
3349
|
+
let type = item.type;
|
|
3492
3350
|
if (kind === 'file') {
|
|
3493
|
-
|
|
3351
|
+
let cp = dt.files[idx];
|
|
3494
3352
|
if (!type && cp.name) {
|
|
3495
|
-
|
|
3353
|
+
let bits = cp.name.split('.');
|
|
3496
3354
|
type = bits[bits.length - 1];
|
|
3497
3355
|
}
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3356
|
+
let name = cp ? cp.name : bbn._('untitled');
|
|
3357
|
+
let size = cp ? cp.size : null;
|
|
3358
|
+
let lastModified = cp ? cp.lastModified : null;
|
|
3359
|
+
let blob = item.getAsFile();
|
|
3502
3360
|
if (blob) {
|
|
3503
3361
|
done = true;
|
|
3504
|
-
|
|
3362
|
+
num--;
|
|
3505
3363
|
res.files.push({
|
|
3506
3364
|
type: type,
|
|
3507
3365
|
data: blob,
|
|
3508
|
-
name:
|
|
3366
|
+
name: name,
|
|
3509
3367
|
size: size,
|
|
3510
3368
|
mdate: lastModified,
|
|
3511
3369
|
});
|
|
3512
|
-
|
|
3513
|
-
if (!
|
|
3370
|
+
strings.push(name);
|
|
3371
|
+
if (!num) {
|
|
3514
3372
|
if (!res.raw) {
|
|
3515
|
-
res.raw =
|
|
3373
|
+
res.raw = strings.join(', ');
|
|
3516
3374
|
}
|
|
3517
3375
|
ok(res);
|
|
3518
3376
|
}
|
|
3519
3377
|
}
|
|
3520
3378
|
else {
|
|
3521
|
-
(0, defaultErrorFunction_1.defaultErrorFunction)(bbn._('Impossible to read the file') + ' ' +
|
|
3379
|
+
(0, defaultErrorFunction_1.defaultErrorFunction)(bbn._('Impossible to read the file') + ' ' + name);
|
|
3522
3380
|
}
|
|
3523
3381
|
}
|
|
3524
3382
|
else {
|
|
3525
3383
|
done = true;
|
|
3526
|
-
item.getAsString(
|
|
3527
|
-
|
|
3384
|
+
item.getAsString((data) => {
|
|
3385
|
+
num--;
|
|
3528
3386
|
res.str.push({
|
|
3529
3387
|
type: type,
|
|
3530
3388
|
data: data,
|
|
3531
3389
|
});
|
|
3532
3390
|
if (type === 'text/plain') {
|
|
3533
|
-
|
|
3391
|
+
strings.push(name);
|
|
3534
3392
|
}
|
|
3535
|
-
if (!
|
|
3393
|
+
if (!num) {
|
|
3536
3394
|
if (!res.raw) {
|
|
3537
|
-
res.raw =
|
|
3395
|
+
res.raw = strings.join(', ');
|
|
3538
3396
|
}
|
|
3539
3397
|
ok(res);
|
|
3540
3398
|
}
|
|
@@ -3543,7 +3401,7 @@
|
|
|
3543
3401
|
});
|
|
3544
3402
|
}
|
|
3545
3403
|
if (!done) {
|
|
3546
|
-
setTimeout(
|
|
3404
|
+
setTimeout(() => {
|
|
3547
3405
|
ok(res);
|
|
3548
3406
|
});
|
|
3549
3407
|
}
|
|
@@ -3556,11 +3414,8 @@
|
|
|
3556
3414
|
"use strict";
|
|
3557
3415
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3558
3416
|
exports.getField = void 0;
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
if (val === void 0) { val = null; }
|
|
3562
|
-
if (operator === void 0) { operator = '='; }
|
|
3563
|
-
var r;
|
|
3417
|
+
const getField = function (arr, field, prop = '', val = null, operator = '=') {
|
|
3418
|
+
let r;
|
|
3564
3419
|
if (field && (r = (0, getRow_2.getRow)(arr, prop, val, operator))) {
|
|
3565
3420
|
return r[field];
|
|
3566
3421
|
}
|
|
@@ -3572,13 +3427,13 @@
|
|
|
3572
3427
|
"use strict";
|
|
3573
3428
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3574
3429
|
exports.getFieldValues = void 0;
|
|
3575
|
-
|
|
3430
|
+
const getFieldValues = function (arr, field, prop, val, operator) {
|
|
3576
3431
|
(0, checkType_3.checkType)(field, 'string');
|
|
3577
3432
|
if (prop) {
|
|
3578
3433
|
arr = (0, filter_3.filter)(arr, prop, val, operator);
|
|
3579
3434
|
}
|
|
3580
|
-
|
|
3581
|
-
(0, each_16.each)(arr,
|
|
3435
|
+
let res = [];
|
|
3436
|
+
(0, each_16.each)(arr, (a) => (res.indexOf(a[field]) === -1 ? res.push(a[field]) : null));
|
|
3582
3437
|
return res;
|
|
3583
3438
|
};
|
|
3584
3439
|
exports.getFieldValues = getFieldValues;
|
|
@@ -3587,7 +3442,7 @@
|
|
|
3587
3442
|
"use strict";
|
|
3588
3443
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3589
3444
|
exports.removeHtmlComments = void 0;
|
|
3590
|
-
|
|
3445
|
+
const removeHtmlComments = function (str) {
|
|
3591
3446
|
if (!(0, isString_18.isString)(str)) {
|
|
3592
3447
|
return str;
|
|
3593
3448
|
}
|
|
@@ -3599,9 +3454,8 @@
|
|
|
3599
3454
|
"use strict";
|
|
3600
3455
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3601
3456
|
exports.getHtml = void 0;
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
var st = ele.innerHTML();
|
|
3457
|
+
const getHtml = function (ele, stripComments = false) {
|
|
3458
|
+
let st = ele.innerHTML();
|
|
3605
3459
|
if (stripComments) {
|
|
3606
3460
|
st = (0, removeHtmlComments_1.removeHtmlComments)(st);
|
|
3607
3461
|
}
|
|
@@ -3613,50 +3467,43 @@
|
|
|
3613
3467
|
"use strict";
|
|
3614
3468
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3615
3469
|
exports.getPath = void 0;
|
|
3616
|
-
|
|
3617
|
-
|
|
3470
|
+
const getPath = function (element) {
|
|
3471
|
+
let path,
|
|
3618
3472
|
//node = $(element),
|
|
3619
3473
|
node = element, done = 0;
|
|
3620
|
-
|
|
3474
|
+
while (node.length) {
|
|
3621
3475
|
//let realNode = node[0],
|
|
3622
|
-
|
|
3623
|
-
if (!
|
|
3624
|
-
|
|
3476
|
+
let realNode = node, name = realNode.localName;
|
|
3477
|
+
if (!name)
|
|
3478
|
+
break;
|
|
3625
3479
|
if (realNode === document.body)
|
|
3626
|
-
|
|
3480
|
+
break;
|
|
3627
3481
|
if (realNode.id) {
|
|
3628
|
-
return
|
|
3482
|
+
return '#' + realNode.id;
|
|
3629
3483
|
}
|
|
3630
3484
|
if (!done) {
|
|
3631
3485
|
if (realNode.className && realNode.className !== ' ') {
|
|
3632
|
-
|
|
3486
|
+
name += '.' + (0, replaceAll_4.replaceAll)(' ', '.', (0, replaceAll_4.replaceAll)(' ', ' ', realNode.className));
|
|
3633
3487
|
}
|
|
3634
3488
|
done = 1;
|
|
3635
3489
|
}
|
|
3636
3490
|
//var parent = node.parent(),
|
|
3637
|
-
|
|
3491
|
+
let parent = node.parentNode,
|
|
3638
3492
|
//sameTagSiblings = parent.children(name);
|
|
3639
|
-
sameTagSiblings =
|
|
3640
|
-
return val.tagName ===
|
|
3493
|
+
sameTagSiblings = parent.children.filter((val) => {
|
|
3494
|
+
return val.tagName === name;
|
|
3641
3495
|
});
|
|
3642
3496
|
if (sameTagSiblings.length > 1) {
|
|
3643
3497
|
//var allSiblings = parent.children(),
|
|
3644
|
-
|
|
3498
|
+
let allSiblings = parent.children,
|
|
3645
3499
|
//index = allSiblings.index(realNode) + 1;
|
|
3646
3500
|
index = allSiblings.indexOf(realNode) + 1;
|
|
3647
3501
|
if (index > 1) {
|
|
3648
|
-
|
|
3502
|
+
name += ':nth-child(' + index + ')';
|
|
3649
3503
|
}
|
|
3650
3504
|
}
|
|
3651
|
-
path =
|
|
3652
|
-
node =
|
|
3653
|
-
};
|
|
3654
|
-
while (node.length) {
|
|
3655
|
-
var state_1 = _loop_1();
|
|
3656
|
-
if (typeof state_1 === "object")
|
|
3657
|
-
return state_1.value;
|
|
3658
|
-
if (state_1 === "break")
|
|
3659
|
-
break;
|
|
3505
|
+
path = name + (path ? '>' + path : '');
|
|
3506
|
+
node = parent;
|
|
3660
3507
|
}
|
|
3661
3508
|
return path;
|
|
3662
3509
|
};
|
|
@@ -3666,7 +3513,7 @@
|
|
|
3666
3513
|
"use strict";
|
|
3667
3514
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3668
3515
|
exports.getProp = void 0;
|
|
3669
|
-
|
|
3516
|
+
const getProp = function (obj, prop) {
|
|
3670
3517
|
(0, checkType_4.checkType)(obj, 'object', bbn._('The obj must be an object in setProp'));
|
|
3671
3518
|
(0, checkType_4.checkType)(prop, 'string', bbn._('The prop must be a string in setProp'));
|
|
3672
3519
|
return obj[prop];
|
|
@@ -3677,26 +3524,26 @@
|
|
|
3677
3524
|
"use strict";
|
|
3678
3525
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3679
3526
|
exports.getScrollBarSize = void 0;
|
|
3680
|
-
|
|
3527
|
+
const getScrollBarSize = function () {
|
|
3681
3528
|
if (bbn.env.scrollBarSize === undefined) {
|
|
3682
|
-
|
|
3529
|
+
let outer = document.createElement('div');
|
|
3683
3530
|
outer.style.visibility = 'hidden';
|
|
3684
3531
|
outer.style.width = '100px';
|
|
3685
3532
|
if ('msOverflowStyle' in outer.style) {
|
|
3686
3533
|
outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps
|
|
3687
3534
|
}
|
|
3688
3535
|
document.body.appendChild(outer);
|
|
3689
|
-
|
|
3536
|
+
let widthNoScroll = outer.offsetWidth;
|
|
3690
3537
|
// force scrollbars
|
|
3691
3538
|
outer.style.overflow = 'scroll';
|
|
3692
3539
|
// add innerdiv
|
|
3693
|
-
|
|
3540
|
+
let inner = document.createElement('div');
|
|
3694
3541
|
inner.style.width = '100%';
|
|
3695
3542
|
outer.appendChild(inner);
|
|
3696
|
-
|
|
3543
|
+
let widthWithScroll = inner.offsetWidth;
|
|
3697
3544
|
// remove divs
|
|
3698
3545
|
outer.parentNode.removeChild(outer);
|
|
3699
|
-
|
|
3546
|
+
let sz = widthNoScroll - widthWithScroll;
|
|
3700
3547
|
bbn.env.scrollBarSize = sz ? sz + 1 : 0;
|
|
3701
3548
|
}
|
|
3702
3549
|
return bbn.env.scrollBarSize;
|
|
@@ -3707,7 +3554,7 @@
|
|
|
3707
3554
|
"use strict";
|
|
3708
3555
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3709
3556
|
exports.getText = void 0;
|
|
3710
|
-
|
|
3557
|
+
const getText = function (ele) {
|
|
3711
3558
|
return ele.innerText().trim();
|
|
3712
3559
|
};
|
|
3713
3560
|
exports.getText = getText;
|
|
@@ -3716,7 +3563,7 @@
|
|
|
3716
3563
|
"use strict";
|
|
3717
3564
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3718
3565
|
exports.getTimeoff = void 0;
|
|
3719
|
-
|
|
3566
|
+
const getTimeoff = function () {
|
|
3720
3567
|
if (!bbn.env.isFocused) {
|
|
3721
3568
|
return Math.round(new Date().getTime() / 1000 - bbn.env.timeoff);
|
|
3722
3569
|
}
|
|
@@ -3728,11 +3575,7 @@
|
|
|
3728
3575
|
"use strict";
|
|
3729
3576
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3730
3577
|
exports.happy = void 0;
|
|
3731
|
-
|
|
3732
|
-
var args = [];
|
|
3733
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3734
|
-
args[_i] = arguments[_i];
|
|
3735
|
-
}
|
|
3578
|
+
const happy = function (...args) {
|
|
3736
3579
|
args.unshift({
|
|
3737
3580
|
_bbn_console_level: 3,
|
|
3738
3581
|
_bbn_console_style: 'color: white; background: green; font-size: 18px;',
|
|
@@ -3746,7 +3589,7 @@
|
|
|
3746
3589
|
"use strict";
|
|
3747
3590
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3748
3591
|
exports.hex2rgb = void 0;
|
|
3749
|
-
|
|
3592
|
+
const hex2rgb = function (hex) {
|
|
3750
3593
|
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
3751
3594
|
return result
|
|
3752
3595
|
? {
|
|
@@ -3762,7 +3605,7 @@
|
|
|
3762
3605
|
"use strict";
|
|
3763
3606
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3764
3607
|
exports.history = void 0;
|
|
3765
|
-
|
|
3608
|
+
const history = function () {
|
|
3766
3609
|
return window.history || false;
|
|
3767
3610
|
};
|
|
3768
3611
|
exports.history = history;
|
|
@@ -3771,8 +3614,8 @@
|
|
|
3771
3614
|
"use strict";
|
|
3772
3615
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3773
3616
|
exports.html2text = void 0;
|
|
3774
|
-
|
|
3775
|
-
|
|
3617
|
+
const html2text = function (st) {
|
|
3618
|
+
let $test = document.createElement('div');
|
|
3776
3619
|
$test.innerHTML = st;
|
|
3777
3620
|
st = $test.innerText;
|
|
3778
3621
|
return st;
|
|
@@ -3783,8 +3626,8 @@
|
|
|
3783
3626
|
"use strict";
|
|
3784
3627
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3785
3628
|
exports.imageToCanvas = void 0;
|
|
3786
|
-
|
|
3787
|
-
|
|
3629
|
+
const imageToCanvas = function (img) {
|
|
3630
|
+
let canvas = document.createElement('canvas');
|
|
3788
3631
|
canvas.width = img.width;
|
|
3789
3632
|
canvas.height = img.height;
|
|
3790
3633
|
canvas.getContext('2d').drawImage(img, 0, 0);
|
|
@@ -3796,9 +3639,8 @@
|
|
|
3796
3639
|
"use strict";
|
|
3797
3640
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3798
3641
|
exports.imgToBase64 = void 0;
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
var canvas = (0, imageToCanvas_1.imageToCanvas)(img);
|
|
3642
|
+
const imgToBase64 = function (img, type = 'image/png') {
|
|
3643
|
+
let canvas = (0, imageToCanvas_1.imageToCanvas)(img);
|
|
3802
3644
|
//return canvasToImage(canvas);
|
|
3803
3645
|
return canvas.toDataURL(type);
|
|
3804
3646
|
};
|
|
@@ -3808,11 +3650,7 @@
|
|
|
3808
3650
|
"use strict";
|
|
3809
3651
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3810
3652
|
exports.info = void 0;
|
|
3811
|
-
|
|
3812
|
-
var args = [];
|
|
3813
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3814
|
-
args[_i] = arguments[_i];
|
|
3815
|
-
}
|
|
3653
|
+
const info = function (...args) {
|
|
3816
3654
|
args.unshift({
|
|
3817
3655
|
//_bbn_console_mode: "info",
|
|
3818
3656
|
_bbn_console_level: 4,
|
|
@@ -3827,10 +3665,10 @@
|
|
|
3827
3665
|
"use strict";
|
|
3828
3666
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3829
3667
|
exports.treatAjaxArguments = void 0;
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3668
|
+
const treatAjaxArguments = function (args) {
|
|
3669
|
+
let cfg = {};
|
|
3670
|
+
let t;
|
|
3671
|
+
let i;
|
|
3834
3672
|
if ((0, isObject_14.isObject)(args[0]) && args.length === 1) {
|
|
3835
3673
|
return args[0];
|
|
3836
3674
|
}
|
|
@@ -3904,7 +3742,7 @@
|
|
|
3904
3742
|
"use strict";
|
|
3905
3743
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3906
3744
|
exports.setNavigationVars = void 0;
|
|
3907
|
-
|
|
3745
|
+
const setNavigationVars = function (url, title, data, repl) {
|
|
3908
3746
|
// Current path becomes old path
|
|
3909
3747
|
bbn.env.old_path = bbn.env.path;
|
|
3910
3748
|
// URL includes the domain
|
|
@@ -3912,16 +3750,16 @@
|
|
|
3912
3750
|
// Path does not
|
|
3913
3751
|
bbn.env.path = (0, substr_10.substr)(bbn.env.url, bbn.env.root.length);
|
|
3914
3752
|
// Params will include each part of the URL
|
|
3915
|
-
bbn.env.params = (0, filter_4.filter)(bbn.env.path.split('/'),
|
|
3753
|
+
bbn.env.params = (0, filter_4.filter)(bbn.env.path.split('/'), (v) => {
|
|
3916
3754
|
return v !== '';
|
|
3917
3755
|
});
|
|
3918
3756
|
// Managing history
|
|
3919
|
-
|
|
3757
|
+
let h = window.history;
|
|
3920
3758
|
if (h) {
|
|
3921
3759
|
// Current state
|
|
3922
|
-
|
|
3760
|
+
let state = h.state;
|
|
3923
3761
|
// Future state
|
|
3924
|
-
|
|
3762
|
+
let obj = {
|
|
3925
3763
|
url: bbn.env.path,
|
|
3926
3764
|
old_path: bbn.env.old_path || null,
|
|
3927
3765
|
data: data || {},
|
|
@@ -3962,13 +3800,9 @@
|
|
|
3962
3800
|
"use strict";
|
|
3963
3801
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3964
3802
|
exports.link = void 0;
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
args[_i] = arguments[_i];
|
|
3969
|
-
}
|
|
3970
|
-
var cfg = (0, treatAjaxArguments_1.treatAjaxArguments)(args);
|
|
3971
|
-
var ok = true;
|
|
3803
|
+
const link = function (...args) {
|
|
3804
|
+
let cfg = (0, treatAjaxArguments_1.treatAjaxArguments)(args);
|
|
3805
|
+
let ok = true;
|
|
3972
3806
|
/* If we can't find a correct link we load the current URL */
|
|
3973
3807
|
if (!cfg) {
|
|
3974
3808
|
return link(window.location.href);
|
|
@@ -3996,7 +3830,7 @@
|
|
|
3996
3830
|
/* Mail link */
|
|
3997
3831
|
bbn.env.ignoreUnload = true;
|
|
3998
3832
|
window.location.href = cfg.url;
|
|
3999
|
-
setTimeout(
|
|
3833
|
+
setTimeout(() => {
|
|
4000
3834
|
bbn.env.ignoreUnload = false;
|
|
4001
3835
|
}, 0);
|
|
4002
3836
|
return false;
|
|
@@ -4033,15 +3867,15 @@
|
|
|
4033
3867
|
cfg.url = ok;
|
|
4034
3868
|
}
|
|
4035
3869
|
/** todo Do we keep obj in the unique string or do we make that only one concurrent connection to the same address can occur at the same time? */
|
|
4036
|
-
|
|
3870
|
+
let errSt = bbn._('The Ajax call to') + ' ' + cfg.url + ' ';
|
|
4037
3871
|
return (0, ajax_2.ajax)(cfg.url, cfg.datatype, cfg.obj, function (res) {
|
|
4038
3872
|
if (!res) {
|
|
4039
|
-
(0, log_14.log)(
|
|
3873
|
+
(0, log_14.log)(errSt + bbn._('returned no answer'));
|
|
4040
3874
|
}
|
|
4041
3875
|
if ((0, isObject_15.isObject)(res)) {
|
|
4042
3876
|
// If there's nothing in the result, just an empty object, the callback stops here and the URL is not changed
|
|
4043
3877
|
if (Object.keys(res).length === 0) {
|
|
4044
|
-
(0, log_14.log)(
|
|
3878
|
+
(0, log_14.log)(errSt + bbn._('returned an empty object'));
|
|
4045
3879
|
}
|
|
4046
3880
|
if (res.new_url) {
|
|
4047
3881
|
res.old_path = cfg.url;
|
|
@@ -4068,14 +3902,10 @@
|
|
|
4068
3902
|
"use strict";
|
|
4069
3903
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4070
3904
|
exports.post = void 0;
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4074
|
-
args[_i] = arguments[_i];
|
|
4075
|
-
}
|
|
4076
|
-
var cfg = (0, treatAjaxArguments_2.treatAjaxArguments)(args);
|
|
3905
|
+
const post = function (...args) {
|
|
3906
|
+
let cfg = (0, treatAjaxArguments_2.treatAjaxArguments)(args);
|
|
4077
3907
|
if (cfg.url) {
|
|
4078
|
-
return (0, ajax_3.ajax)(cfg.url, cfg.datatype, cfg.obj,
|
|
3908
|
+
return (0, ajax_3.ajax)(cfg.url, cfg.datatype, cfg.obj, (res) => {
|
|
4079
3909
|
(0, callback_2.callback)(cfg.url, res, cfg.successFn, null, cfg.ele);
|
|
4080
3910
|
}, cfg.errorFn, cfg.abortFn);
|
|
4081
3911
|
}
|
|
@@ -4086,9 +3916,9 @@
|
|
|
4086
3916
|
"use strict";
|
|
4087
3917
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4088
3918
|
exports.submit = void 0;
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
3919
|
+
const submit = function (form, e, fn) {
|
|
3920
|
+
let url = form.getAttribute('action') || bbn.env.path;
|
|
3921
|
+
let data;
|
|
4092
3922
|
if (url === '') {
|
|
4093
3923
|
url = '.';
|
|
4094
3924
|
}
|
|
@@ -4122,9 +3952,9 @@
|
|
|
4122
3952
|
"use strict";
|
|
4123
3953
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4124
3954
|
exports.resize = void 0;
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
3955
|
+
const resize = function () {
|
|
3956
|
+
let diffW = bbn.env.width !== window.innerWidth;
|
|
3957
|
+
let diffH = bbn.env.height !== window.innerHeight;
|
|
4128
3958
|
if (diffW || diffH) {
|
|
4129
3959
|
if (diffW) {
|
|
4130
3960
|
bbn.env.width =
|
|
@@ -4136,24 +3966,24 @@
|
|
|
4136
3966
|
window.innerHeight || window.document.documentElement.clientHeight || window.document.body.clientHeight;
|
|
4137
3967
|
document.documentElement.style.setProperty('--vh', bbn.env.height * 0.01 + 'px');
|
|
4138
3968
|
}
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
(0, each_17.each)(
|
|
4144
|
-
|
|
3969
|
+
let smallWidth = parseInt((0, getCssVar_1.getCssVar)('mobile-limit')) || 650;
|
|
3970
|
+
let newCls = 'bbn-screen-' + (bbn.env.width < smallWidth ? 'small' : 'regular');
|
|
3971
|
+
let classes = (document.body.className || '').split(' ');
|
|
3972
|
+
let done = false;
|
|
3973
|
+
(0, each_17.each)(classes, (cls, idx) => {
|
|
3974
|
+
let bits = cls.split('-');
|
|
4145
3975
|
if (bits.length === 3 && cls.indexOf('bbn-screen-') === 0) {
|
|
4146
|
-
|
|
4147
|
-
if (cls !==
|
|
4148
|
-
|
|
3976
|
+
done = true;
|
|
3977
|
+
if (cls !== newCls) {
|
|
3978
|
+
classes.splice(idx, 1, newCls);
|
|
4149
3979
|
}
|
|
4150
3980
|
return false;
|
|
4151
3981
|
}
|
|
4152
3982
|
});
|
|
4153
|
-
if (!
|
|
4154
|
-
|
|
3983
|
+
if (!done) {
|
|
3984
|
+
classes.push(newCls);
|
|
4155
3985
|
}
|
|
4156
|
-
document.body.className =
|
|
3986
|
+
document.body.className = classes.join(' ');
|
|
4157
3987
|
(0, defaultResizeFunction_1.defaultResizeFunction)();
|
|
4158
3988
|
}
|
|
4159
3989
|
};
|
|
@@ -4163,7 +3993,7 @@
|
|
|
4163
3993
|
"use strict";
|
|
4164
3994
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4165
3995
|
exports.isMobileDevice = void 0;
|
|
4166
|
-
|
|
3996
|
+
const isMobileDevice = function () {
|
|
4167
3997
|
return this.getDeviceType() === 'mobile';
|
|
4168
3998
|
};
|
|
4169
3999
|
exports.isMobileDevice = isMobileDevice;
|
|
@@ -4172,7 +4002,7 @@
|
|
|
4172
4002
|
"use strict";
|
|
4173
4003
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4174
4004
|
exports.isTabletDevice = void 0;
|
|
4175
|
-
|
|
4005
|
+
const isTabletDevice = function () {
|
|
4176
4006
|
return this.getDeviceType() === 'tablet';
|
|
4177
4007
|
};
|
|
4178
4008
|
exports.isTabletDevice = isTabletDevice;
|
|
@@ -4181,7 +4011,7 @@
|
|
|
4181
4011
|
"use strict";
|
|
4182
4012
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4183
4013
|
exports.isMobile = void 0;
|
|
4184
|
-
|
|
4014
|
+
const isMobile = function () {
|
|
4185
4015
|
return (0, isMobileDevice_1.isMobileDevice)() || (0, isTabletDevice_1.isTabletDevice)();
|
|
4186
4016
|
};
|
|
4187
4017
|
exports.isMobile = isMobile;
|
|
@@ -4190,8 +4020,8 @@
|
|
|
4190
4020
|
"use strict";
|
|
4191
4021
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4192
4022
|
exports.init = void 0;
|
|
4193
|
-
|
|
4194
|
-
|
|
4023
|
+
const init = function (cfg, force) {
|
|
4024
|
+
let parts;
|
|
4195
4025
|
if (!bbn.env.isInit || force) {
|
|
4196
4026
|
bbn.env.root = document.baseURI.length > 0 ? document.baseURI : bbn.env.host;
|
|
4197
4027
|
if (bbn.env.root.length && (0, substr_11.substr)(bbn.env.root, -1) !== '/') {
|
|
@@ -4232,7 +4062,7 @@
|
|
|
4232
4062
|
'weekOfYear',
|
|
4233
4063
|
'weekYear',
|
|
4234
4064
|
'weekday',
|
|
4235
|
-
],
|
|
4065
|
+
], (plugin) => {
|
|
4236
4066
|
if (window['dayjs_plugin_' + plugin]) {
|
|
4237
4067
|
dayjs.extend(window['dayjs_plugin_' + plugin]);
|
|
4238
4068
|
}
|
|
@@ -4245,7 +4075,7 @@
|
|
|
4245
4075
|
bbn.env.path = (0, substr_11.substr)(bbn.env.url, bbn.env.root.length);
|
|
4246
4076
|
parts = bbn.env.path.split('/');
|
|
4247
4077
|
//$.each(parts, function(i, v){
|
|
4248
|
-
(0, each_18.each)(parts,
|
|
4078
|
+
(0, each_18.each)(parts, (v, i) => {
|
|
4249
4079
|
v = decodeURI(v.trim());
|
|
4250
4080
|
if (v !== '') {
|
|
4251
4081
|
bbn.env.params.push(v);
|
|
@@ -4257,27 +4087,27 @@
|
|
|
4257
4087
|
if (bbn.env.lang && undefined !== dayjs) {
|
|
4258
4088
|
dayjs.locale(bbn.env.lang);
|
|
4259
4089
|
}
|
|
4260
|
-
window.onfocus =
|
|
4090
|
+
window.onfocus = () => {
|
|
4261
4091
|
bbn.env.isFocused = true;
|
|
4262
4092
|
};
|
|
4263
|
-
window.onblur =
|
|
4093
|
+
window.onblur = () => {
|
|
4264
4094
|
bbn.env.isFocused = false;
|
|
4265
4095
|
bbn.env.timeoff = Math.round(new Date().getTime() / 1000);
|
|
4266
4096
|
};
|
|
4267
|
-
document.addEventListener('focusin',
|
|
4097
|
+
document.addEventListener('focusin', (e) => {
|
|
4268
4098
|
if (e.target instanceof HTMLElement && !e.target.classList.contains('bbn-no')) {
|
|
4269
4099
|
bbn.env.focused = e.target;
|
|
4270
4100
|
}
|
|
4271
4101
|
bbn.env.last_focus = new Date().getTime();
|
|
4272
4102
|
});
|
|
4273
|
-
document.addEventListener('click',
|
|
4103
|
+
document.addEventListener('click', (e) => {
|
|
4274
4104
|
bbn.env.last_focus = new Date().getTime();
|
|
4275
4105
|
if (bbn.env.nav !== 'ajax') {
|
|
4276
4106
|
return;
|
|
4277
4107
|
}
|
|
4278
|
-
|
|
4108
|
+
let target = e.target;
|
|
4279
4109
|
if (target instanceof HTMLElement && (target.tagName !== 'A')) {
|
|
4280
|
-
|
|
4110
|
+
let p = target;
|
|
4281
4111
|
while (p && p.tagName !== 'A') {
|
|
4282
4112
|
if (p.tagName === 'BODY') {
|
|
4283
4113
|
break;
|
|
@@ -4298,18 +4128,18 @@
|
|
|
4298
4128
|
return false;
|
|
4299
4129
|
}
|
|
4300
4130
|
});
|
|
4301
|
-
(0, each_18.each)(document.querySelectorAll('form:not(.bbn-no), form:not(.bbn-form)'),
|
|
4302
|
-
ele.addEventListener('submit',
|
|
4131
|
+
(0, each_18.each)(document.querySelectorAll('form:not(.bbn-no), form:not(.bbn-form)'), (ele) => {
|
|
4132
|
+
ele.addEventListener('submit', (e) => {
|
|
4303
4133
|
(0, submit_1.submit)(ele, e);
|
|
4304
4134
|
});
|
|
4305
4135
|
});
|
|
4306
|
-
window.addEventListener('hashchange',
|
|
4136
|
+
window.addEventListener('hashchange', () => {
|
|
4307
4137
|
bbn.env.hashChanged = new Date().getTime();
|
|
4308
4138
|
}, false);
|
|
4309
|
-
window.addEventListener('resize',
|
|
4139
|
+
window.addEventListener('resize', () => {
|
|
4310
4140
|
(0, resize_1.resize)();
|
|
4311
4141
|
});
|
|
4312
|
-
window.addEventListener('orientationchange',
|
|
4142
|
+
window.addEventListener('orientationchange', () => {
|
|
4313
4143
|
(0, resize_1.resize)();
|
|
4314
4144
|
});
|
|
4315
4145
|
(0, resize_1.resize)();
|
|
@@ -4321,10 +4151,10 @@
|
|
|
4321
4151
|
}
|
|
4322
4152
|
if (window.history) {
|
|
4323
4153
|
window.onpopstate = function (e) {
|
|
4324
|
-
|
|
4154
|
+
let h = window.history;
|
|
4325
4155
|
if (!bbn.env.historyDisabled && h) {
|
|
4326
4156
|
//e.preventDefault();
|
|
4327
|
-
|
|
4157
|
+
let state = h.state;
|
|
4328
4158
|
if (state) {
|
|
4329
4159
|
if ((0, defaultHistoryFunction_1.defaultHistoryFunction)(state)) {
|
|
4330
4160
|
//link(substr(state.url, bbn.env.root.length), $.extend({title: state.title}, state.data));
|
|
@@ -4350,12 +4180,11 @@
|
|
|
4350
4180
|
"use strict";
|
|
4351
4181
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4352
4182
|
exports.isActiveInterface = void 0;
|
|
4353
|
-
|
|
4354
|
-
if (secs === void 0) { secs = 600; }
|
|
4183
|
+
const isActiveInterface = function (secs = 600) {
|
|
4355
4184
|
if (!bbn.env.last_focus) {
|
|
4356
4185
|
return false;
|
|
4357
4186
|
}
|
|
4358
|
-
|
|
4187
|
+
let t = new Date().getTime();
|
|
4359
4188
|
return t - bbn.env.last_focus < secs * 1000;
|
|
4360
4189
|
};
|
|
4361
4190
|
exports.isActiveInterface = isActiveInterface;
|
|
@@ -4364,15 +4193,10 @@
|
|
|
4364
4193
|
"use strict";
|
|
4365
4194
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4366
4195
|
exports.isBoolean = void 0;
|
|
4367
|
-
|
|
4368
|
-
var args = [];
|
|
4369
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4370
|
-
args[_i] = arguments[_i];
|
|
4371
|
-
}
|
|
4196
|
+
const isBoolean = function (...args) {
|
|
4372
4197
|
if (!args.length)
|
|
4373
4198
|
return false;
|
|
4374
|
-
for (
|
|
4375
|
-
var a = args_15[_a];
|
|
4199
|
+
for (let a of args) {
|
|
4376
4200
|
if (![true, false].includes(a)) {
|
|
4377
4201
|
return false;
|
|
4378
4202
|
}
|
|
@@ -4385,16 +4209,11 @@
|
|
|
4385
4209
|
"use strict";
|
|
4386
4210
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4387
4211
|
exports.isColor = void 0;
|
|
4388
|
-
|
|
4389
|
-
var args = [];
|
|
4390
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4391
|
-
args[_i] = arguments[_i];
|
|
4392
|
-
}
|
|
4212
|
+
const isColor = function (...args) {
|
|
4393
4213
|
if (!args.length)
|
|
4394
4214
|
return false;
|
|
4395
4215
|
var reg = new RegExp('^(#[a-f0-9]{6}|#[a-f0-9]{3}|rgb *( *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *)|rgba *( *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *)|black|green|silver|gray|olive|white|yellow|maroon|navy|red|blue|purple|teal|fuchsia|aqua)$', 'i');
|
|
4396
|
-
for (
|
|
4397
|
-
var st = args_16[_a];
|
|
4216
|
+
for (let st of args) {
|
|
4398
4217
|
if (!(0, isString_19.isString)(st)) {
|
|
4399
4218
|
return false;
|
|
4400
4219
|
}
|
|
@@ -4410,15 +4229,10 @@
|
|
|
4410
4229
|
"use strict";
|
|
4411
4230
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4412
4231
|
exports.isComment = void 0;
|
|
4413
|
-
|
|
4414
|
-
var args = [];
|
|
4415
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4416
|
-
args[_i] = arguments[_i];
|
|
4417
|
-
}
|
|
4232
|
+
const isComment = function (...args) {
|
|
4418
4233
|
if (!args.length)
|
|
4419
4234
|
return false;
|
|
4420
|
-
for (
|
|
4421
|
-
var a = args_17[_a];
|
|
4235
|
+
for (let a of args) {
|
|
4422
4236
|
if (!(a instanceof Comment)) {
|
|
4423
4237
|
return false;
|
|
4424
4238
|
}
|
|
@@ -4431,7 +4245,7 @@
|
|
|
4431
4245
|
"use strict";
|
|
4432
4246
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4433
4247
|
exports.isDesktopDevice = void 0;
|
|
4434
|
-
|
|
4248
|
+
const isDesktopDevice = function () {
|
|
4435
4249
|
return this.getDeviceType() === 'desktop';
|
|
4436
4250
|
};
|
|
4437
4251
|
exports.isDesktopDevice = isDesktopDevice;
|
|
@@ -4440,11 +4254,11 @@
|
|
|
4440
4254
|
"use strict";
|
|
4441
4255
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4442
4256
|
exports.isValidDimension = void 0;
|
|
4443
|
-
|
|
4257
|
+
const isValidDimension = function (st) {
|
|
4444
4258
|
if (typeof st === 'string' && (st.length > 0) && ((st.indexOf('calc') === 0) || (0, isNumber_7.isNumber)((0, substr_12.substr)(st, 0, 1)))) {
|
|
4445
|
-
|
|
4259
|
+
let el = document.createElement('div');
|
|
4446
4260
|
el.style.width = st;
|
|
4447
|
-
|
|
4261
|
+
let res = !!el.style.width.length;
|
|
4448
4262
|
el.remove();
|
|
4449
4263
|
return res;
|
|
4450
4264
|
}
|
|
@@ -4456,15 +4270,10 @@
|
|
|
4456
4270
|
"use strict";
|
|
4457
4271
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4458
4272
|
exports.isDimension = void 0;
|
|
4459
|
-
|
|
4460
|
-
var args = [];
|
|
4461
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4462
|
-
args[_i] = arguments[_i];
|
|
4463
|
-
}
|
|
4273
|
+
const isDimension = function (...args) {
|
|
4464
4274
|
if (!args.length)
|
|
4465
4275
|
return false;
|
|
4466
|
-
for (
|
|
4467
|
-
var st = args_18[_a];
|
|
4276
|
+
for (let st of args) {
|
|
4468
4277
|
if ((typeof st !== 'number') || (st < 0)) {
|
|
4469
4278
|
return false;
|
|
4470
4279
|
}
|
|
@@ -4480,16 +4289,11 @@
|
|
|
4480
4289
|
"use strict";
|
|
4481
4290
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4482
4291
|
exports.isEmail = void 0;
|
|
4483
|
-
|
|
4484
|
-
var args = [];
|
|
4485
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4486
|
-
args[_i] = arguments[_i];
|
|
4487
|
-
}
|
|
4292
|
+
const isEmail = function (...args) {
|
|
4488
4293
|
if (!args.length)
|
|
4489
4294
|
return false;
|
|
4490
|
-
|
|
4491
|
-
for (
|
|
4492
|
-
var st = args_19[_a];
|
|
4295
|
+
let regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
|
4296
|
+
for (let st of args) {
|
|
4493
4297
|
if (!(0, isString_20.isString)(st)) {
|
|
4494
4298
|
return false;
|
|
4495
4299
|
}
|
|
@@ -4505,15 +4309,10 @@
|
|
|
4505
4309
|
"use strict";
|
|
4506
4310
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4507
4311
|
exports.isEvent = void 0;
|
|
4508
|
-
|
|
4509
|
-
var args = [];
|
|
4510
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4511
|
-
args[_i] = arguments[_i];
|
|
4512
|
-
}
|
|
4312
|
+
const isEvent = function (...args) {
|
|
4513
4313
|
if (!args.length)
|
|
4514
4314
|
return false;
|
|
4515
|
-
for (
|
|
4516
|
-
var a = args_20[_a];
|
|
4315
|
+
for (let a of args) {
|
|
4517
4316
|
if (!(a instanceof Event)) {
|
|
4518
4317
|
return false;
|
|
4519
4318
|
}
|
|
@@ -4526,7 +4325,7 @@
|
|
|
4526
4325
|
"use strict";
|
|
4527
4326
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4528
4327
|
exports.isFocused = void 0;
|
|
4529
|
-
|
|
4328
|
+
const isFocused = function (ele, contain) {
|
|
4530
4329
|
return ele === document.activeElement || (contain && ele.contains && ele.contains(document.activeElement));
|
|
4531
4330
|
};
|
|
4532
4331
|
exports.isFocused = isFocused;
|
|
@@ -4535,15 +4334,10 @@
|
|
|
4535
4334
|
"use strict";
|
|
4536
4335
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4537
4336
|
exports.isIP = void 0;
|
|
4538
|
-
|
|
4539
|
-
var args = [];
|
|
4540
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4541
|
-
args[_i] = arguments[_i];
|
|
4542
|
-
}
|
|
4337
|
+
const isIP = function (...args) {
|
|
4543
4338
|
if (!args.length)
|
|
4544
4339
|
return false;
|
|
4545
|
-
for (
|
|
4546
|
-
var st = args_21[_a];
|
|
4340
|
+
for (let st of args) {
|
|
4547
4341
|
if (!(0, isString_21.isString)(st) || !bbn.vars.regexp.ip.test(st)) {
|
|
4548
4342
|
return false;
|
|
4549
4343
|
}
|
|
@@ -4556,15 +4350,10 @@
|
|
|
4556
4350
|
"use strict";
|
|
4557
4351
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4558
4352
|
exports.isHostname = void 0;
|
|
4559
|
-
|
|
4560
|
-
var args = [];
|
|
4561
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4562
|
-
args[_i] = arguments[_i];
|
|
4563
|
-
}
|
|
4353
|
+
const isHostname = function (...args) {
|
|
4564
4354
|
if (!args.length)
|
|
4565
4355
|
return false;
|
|
4566
|
-
for (
|
|
4567
|
-
var st = args_22[_a];
|
|
4356
|
+
for (let st of args) {
|
|
4568
4357
|
if (!(0, isString_22.isString)(st)) {
|
|
4569
4358
|
return false;
|
|
4570
4359
|
}
|
|
@@ -4580,18 +4369,18 @@
|
|
|
4580
4369
|
"use strict";
|
|
4581
4370
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4582
4371
|
exports.isInside = void 0;
|
|
4583
|
-
|
|
4584
|
-
|
|
4372
|
+
const isInside = function (ele, ancestor) {
|
|
4373
|
+
let ancestors = (0, getAncestors_1.getAncestors)(ele);
|
|
4585
4374
|
if (ancestors.length) {
|
|
4586
4375
|
if ((0, isString_23.isString)(ancestor)) {
|
|
4587
|
-
|
|
4588
|
-
(0, each_19.each)(ancestors,
|
|
4376
|
+
let ok = false;
|
|
4377
|
+
(0, each_19.each)(ancestors, (a) => {
|
|
4589
4378
|
if (a.matches && a.matches(ancestor)) {
|
|
4590
|
-
|
|
4379
|
+
ok = true;
|
|
4591
4380
|
return false;
|
|
4592
4381
|
}
|
|
4593
4382
|
});
|
|
4594
|
-
return
|
|
4383
|
+
return ok;
|
|
4595
4384
|
}
|
|
4596
4385
|
if (ancestor instanceof HTMLElement) {
|
|
4597
4386
|
return ancestors.indexOf(ancestor) > -1;
|
|
@@ -4605,15 +4394,10 @@
|
|
|
4605
4394
|
"use strict";
|
|
4606
4395
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4607
4396
|
exports.isPercent = void 0;
|
|
4608
|
-
|
|
4609
|
-
var args = [];
|
|
4610
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4611
|
-
args[_i] = arguments[_i];
|
|
4612
|
-
}
|
|
4397
|
+
const isPercent = function (...args) {
|
|
4613
4398
|
if (!args.length)
|
|
4614
4399
|
return false;
|
|
4615
|
-
for (
|
|
4616
|
-
var a = args_23[_a];
|
|
4400
|
+
for (let a of args) {
|
|
4617
4401
|
if (typeof a !== 'string' || !a.match(/^\d+(?:\.\d+)?%$/)) {
|
|
4618
4402
|
return false;
|
|
4619
4403
|
}
|
|
@@ -4626,15 +4410,10 @@
|
|
|
4626
4410
|
"use strict";
|
|
4627
4411
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4628
4412
|
exports.isPrimitive = void 0;
|
|
4629
|
-
|
|
4630
|
-
var args = [];
|
|
4631
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4632
|
-
args[_i] = arguments[_i];
|
|
4633
|
-
}
|
|
4413
|
+
const isPrimitive = function (...args) {
|
|
4634
4414
|
if (!args.length)
|
|
4635
4415
|
return false;
|
|
4636
|
-
for (
|
|
4637
|
-
var a = args_24[_a];
|
|
4416
|
+
for (let a of args) {
|
|
4638
4417
|
if (a !== null && (typeof a == 'object' || typeof a == 'function')) {
|
|
4639
4418
|
return false;
|
|
4640
4419
|
}
|
|
@@ -4647,15 +4426,10 @@
|
|
|
4647
4426
|
"use strict";
|
|
4648
4427
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4649
4428
|
exports.isPromise = void 0;
|
|
4650
|
-
|
|
4651
|
-
var args = [];
|
|
4652
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4653
|
-
args[_i] = arguments[_i];
|
|
4654
|
-
}
|
|
4429
|
+
const isPromise = function (...args) {
|
|
4655
4430
|
if (!args.length)
|
|
4656
4431
|
return false;
|
|
4657
|
-
for (
|
|
4658
|
-
var a = args_25[_a];
|
|
4432
|
+
for (let a of args) {
|
|
4659
4433
|
if ({}.toString.apply(a) !== '[object Promise]') {
|
|
4660
4434
|
return false;
|
|
4661
4435
|
}
|
|
@@ -4668,9 +4442,9 @@
|
|
|
4668
4442
|
"use strict";
|
|
4669
4443
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4670
4444
|
exports.isPropSize = void 0;
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
(0, each_20.each)(['width', 'height', 'gap', 'margin', 'padding', 'top', 'left', 'right', 'bottom'],
|
|
4445
|
+
const isPropSize = function (name) {
|
|
4446
|
+
let isTrue = false;
|
|
4447
|
+
(0, each_20.each)(['width', 'height', 'gap', 'margin', 'padding', 'top', 'left', 'right', 'bottom'], (a) => {
|
|
4674
4448
|
if (name.indexOf(a) !== -1) {
|
|
4675
4449
|
isTrue = true;
|
|
4676
4450
|
return false;
|
|
@@ -4684,15 +4458,10 @@
|
|
|
4684
4458
|
"use strict";
|
|
4685
4459
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4686
4460
|
exports.isSQLDate = void 0;
|
|
4687
|
-
|
|
4688
|
-
var args = [];
|
|
4689
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4690
|
-
args[_i] = arguments[_i];
|
|
4691
|
-
}
|
|
4461
|
+
const isSQLDate = function (...args) {
|
|
4692
4462
|
if (!args.length)
|
|
4693
4463
|
return false;
|
|
4694
|
-
for (
|
|
4695
|
-
var a = args_26[_a];
|
|
4464
|
+
for (let a of args) {
|
|
4696
4465
|
if (typeof a !== 'string' ||
|
|
4697
4466
|
!a.match(/^([1-2]\d{3})-((0[0-9])|(1[12]))-(([0-2][0-9])|(3[01]))(?:( [0-2][0-9]):([0-5][0-9]):([0-5][0-9]))?$/)) {
|
|
4698
4467
|
return false;
|
|
@@ -4706,15 +4475,10 @@
|
|
|
4706
4475
|
"use strict";
|
|
4707
4476
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4708
4477
|
exports.isSymbol = void 0;
|
|
4709
|
-
|
|
4710
|
-
var args = [];
|
|
4711
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4712
|
-
args[_i] = arguments[_i];
|
|
4713
|
-
}
|
|
4478
|
+
const isSymbol = function (...args) {
|
|
4714
4479
|
if (!args.length)
|
|
4715
4480
|
return false;
|
|
4716
|
-
for (
|
|
4717
|
-
var a = args_27[_a];
|
|
4481
|
+
for (let a of args) {
|
|
4718
4482
|
if ({}.toString.apply(a) !== '[object Symbol]') {
|
|
4719
4483
|
return false;
|
|
4720
4484
|
}
|
|
@@ -4727,15 +4491,10 @@
|
|
|
4727
4491
|
"use strict";
|
|
4728
4492
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4729
4493
|
exports.isURL = void 0;
|
|
4730
|
-
|
|
4731
|
-
var args = [];
|
|
4732
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4733
|
-
args[_i] = arguments[_i];
|
|
4734
|
-
}
|
|
4494
|
+
const isURL = function (...args) {
|
|
4735
4495
|
if (!args.length)
|
|
4736
4496
|
return false;
|
|
4737
|
-
for (
|
|
4738
|
-
var str = args_28[_a];
|
|
4497
|
+
for (let str of args) {
|
|
4739
4498
|
if (!bbn.vars.regexp.url.test(str)) {
|
|
4740
4499
|
return false;
|
|
4741
4500
|
}
|
|
@@ -4748,16 +4507,11 @@
|
|
|
4748
4507
|
"use strict";
|
|
4749
4508
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4750
4509
|
exports.isValidName = void 0;
|
|
4751
|
-
|
|
4752
|
-
var args = [];
|
|
4753
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4754
|
-
args[_i] = arguments[_i];
|
|
4755
|
-
}
|
|
4510
|
+
const isValidName = function (...args) {
|
|
4756
4511
|
if (!args.length) {
|
|
4757
4512
|
return false;
|
|
4758
4513
|
}
|
|
4759
|
-
for (
|
|
4760
|
-
var arg = args_29[_a];
|
|
4514
|
+
for (let arg of args) {
|
|
4761
4515
|
if (!(0, isString_24.isString)(arg) || !/^[$A-Z_][0-9A-Z_$]*$/i.test(arg)) {
|
|
4762
4516
|
return false;
|
|
4763
4517
|
}
|
|
@@ -4770,27 +4524,20 @@
|
|
|
4770
4524
|
"use strict";
|
|
4771
4525
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4772
4526
|
exports.isVue = void 0;
|
|
4773
|
-
|
|
4774
|
-
var _a;
|
|
4775
|
-
var args = [];
|
|
4776
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4777
|
-
args[_i] = arguments[_i];
|
|
4778
|
-
}
|
|
4527
|
+
const isVue = function (...args) {
|
|
4779
4528
|
if (!args.length) {
|
|
4780
4529
|
return false;
|
|
4781
4530
|
}
|
|
4782
4531
|
if ('vue' in bbn && window['Vue']) {
|
|
4783
4532
|
if ('app' in bbn.vue) {
|
|
4784
|
-
for (
|
|
4785
|
-
var a = args_30[_b];
|
|
4533
|
+
for (let a of args) {
|
|
4786
4534
|
if (!a || typeof a.render !== 'function') {
|
|
4787
4535
|
return false;
|
|
4788
4536
|
}
|
|
4789
4537
|
}
|
|
4790
4538
|
}
|
|
4791
4539
|
else {
|
|
4792
|
-
for (
|
|
4793
|
-
var a = args_31[_c];
|
|
4540
|
+
for (let a of args) {
|
|
4794
4541
|
if (!(a instanceof window['Vue'])) {
|
|
4795
4542
|
return false;
|
|
4796
4543
|
}
|
|
@@ -4798,7 +4545,7 @@
|
|
|
4798
4545
|
}
|
|
4799
4546
|
}
|
|
4800
4547
|
if ('cp' in bbn && 'isComponent' in bbn['cp'] && (typeof bbn['cp'].isComponent === 'function')) {
|
|
4801
|
-
return
|
|
4548
|
+
return bbn.cp.isComponent(...args);
|
|
4802
4549
|
}
|
|
4803
4550
|
return true;
|
|
4804
4551
|
};
|
|
@@ -4808,11 +4555,11 @@
|
|
|
4808
4555
|
"use strict";
|
|
4809
4556
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4810
4557
|
exports.lightenDarkenHex = void 0;
|
|
4811
|
-
|
|
4558
|
+
const lightenDarkenHex = function (hex, amt) {
|
|
4812
4559
|
if (hex && amt) {
|
|
4813
|
-
|
|
4560
|
+
let ht = hex[0] === '#';
|
|
4814
4561
|
hex = ht ? hex.slice(1) : hex;
|
|
4815
|
-
|
|
4562
|
+
let num = parseInt(hex, 16), r = (num >> 16) + amt, b = ((num >> 8) & 0x00ff) + amt, g = (num & 0x0000ff) + amt;
|
|
4816
4563
|
if (r > 255) {
|
|
4817
4564
|
r = 255;
|
|
4818
4565
|
}
|
|
@@ -4840,9 +4587,9 @@
|
|
|
4840
4587
|
"use strict";
|
|
4841
4588
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4842
4589
|
exports.warning = void 0;
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4590
|
+
const warning = function (message) {
|
|
4591
|
+
const args = ['BBN: ' + message];
|
|
4592
|
+
const obj = {
|
|
4846
4593
|
_bbn_console_mode: 'warn',
|
|
4847
4594
|
_bbn_console_level: 2,
|
|
4848
4595
|
_bbn_console_style: 'color: #E64141; background: #F7E195; font-size: 14px',
|
|
@@ -4856,9 +4603,9 @@
|
|
|
4856
4603
|
"use strict";
|
|
4857
4604
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4858
4605
|
exports.makeReactive = void 0;
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4606
|
+
const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
4607
|
+
const parentString = parent?.$cid || '';
|
|
4608
|
+
const prefix = '__bbn_' + (parentString ? parentString + '_' : '');
|
|
4862
4609
|
if (obj && typeof obj === 'object' && [undefined, Object, Array].includes(obj.constructor)) {
|
|
4863
4610
|
if (obj.__bbnIsProxy && obj.__bbnParent === parent) {
|
|
4864
4611
|
return obj;
|
|
@@ -4874,23 +4621,19 @@
|
|
|
4874
4621
|
enumerable: false,
|
|
4875
4622
|
});
|
|
4876
4623
|
}
|
|
4877
|
-
|
|
4878
|
-
get
|
|
4879
|
-
|
|
4880
|
-
|
|
4624
|
+
const handler = {
|
|
4625
|
+
get(target, key) {
|
|
4626
|
+
const realValue = Reflect.get(target, key);
|
|
4627
|
+
const realTarget = target.__bbnRoot || target;
|
|
4881
4628
|
if ((0, isSymbol_1.isSymbol)(key)) {
|
|
4882
4629
|
return Reflect.get(realTarget, key);
|
|
4883
4630
|
}
|
|
4884
|
-
|
|
4885
|
-
|
|
4631
|
+
const propName = parentProp ? parentProp + '.' + key : key;
|
|
4632
|
+
const hiddenKey = prefix + ((0, isNumber_8.isNumber)(key) ? key.toString() : key);
|
|
4886
4633
|
if (['fill', 'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'].includes(key) &&
|
|
4887
4634
|
(0, isArray_13.isArray)(target)) {
|
|
4888
|
-
return function () {
|
|
4889
|
-
|
|
4890
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4891
|
-
args[_i] = arguments[_i];
|
|
4892
|
-
}
|
|
4893
|
-
var res = realTarget[key].apply(realTarget, args);
|
|
4635
|
+
return function (...args) {
|
|
4636
|
+
let res = realTarget[key](...args);
|
|
4894
4637
|
(0, warning_1.warning)('DOING ARRAY STUFF');
|
|
4895
4638
|
(0, log_17.log)(target.__bbnParent);
|
|
4896
4639
|
onSet(target, 'length', parent);
|
|
@@ -4901,8 +4644,8 @@
|
|
|
4901
4644
|
return realValue;
|
|
4902
4645
|
}
|
|
4903
4646
|
if (key === '__bbnRoot') {
|
|
4904
|
-
|
|
4905
|
-
while (root &&
|
|
4647
|
+
let root = obj;
|
|
4648
|
+
while (root && root?.__bbnTarget) {
|
|
4906
4649
|
root = root.__bbnTarget;
|
|
4907
4650
|
}
|
|
4908
4651
|
return root;
|
|
@@ -4949,12 +4692,12 @@
|
|
|
4949
4692
|
}
|
|
4950
4693
|
return realValue;
|
|
4951
4694
|
},
|
|
4952
|
-
set
|
|
4695
|
+
set(target, key, value) {
|
|
4953
4696
|
if ((0, isSymbol_1.isSymbol)(key)) {
|
|
4954
4697
|
return Reflect.get(target, key, value);
|
|
4955
4698
|
}
|
|
4956
|
-
|
|
4957
|
-
|
|
4699
|
+
const realTarget = target.__bbnRoot || target;
|
|
4700
|
+
const propName = parentProp ? parentProp + '.' + key : key;
|
|
4958
4701
|
if ((0, isSymbol_1.isSymbol)(key)) {
|
|
4959
4702
|
return Reflect.get(target, key);
|
|
4960
4703
|
}
|
|
@@ -4974,7 +4717,7 @@
|
|
|
4974
4717
|
if (value &&
|
|
4975
4718
|
typeof value === 'object' &&
|
|
4976
4719
|
[undefined, Object, Array].includes(value.constructor)) {
|
|
4977
|
-
|
|
4720
|
+
const hiddenKey = prefix + ((0, isNumber_8.isNumber)(key) ? key.toString() : key);
|
|
4978
4721
|
Reflect.defineProperty(realTarget, hiddenKey, {
|
|
4979
4722
|
value: makeReactive(value, onSet, parent, propName),
|
|
4980
4723
|
writable: true,
|
|
@@ -5001,14 +4744,14 @@
|
|
|
5001
4744
|
}
|
|
5002
4745
|
return true;
|
|
5003
4746
|
},
|
|
5004
|
-
defineProperty
|
|
5005
|
-
|
|
5006
|
-
|
|
4747
|
+
defineProperty(target, key, description) {
|
|
4748
|
+
const realTarget = target;
|
|
4749
|
+
const propName = parentProp ? parentProp + '.' + key : key;
|
|
5007
4750
|
if (key === '__bbnWatchers' || (0, isSymbol_1.isSymbol)(key) || key.indexOf('__bbn_') === 0) {
|
|
5008
4751
|
Reflect.defineProperty(realTarget, key, description);
|
|
5009
4752
|
}
|
|
5010
4753
|
else {
|
|
5011
|
-
|
|
4754
|
+
const hiddenKey = prefix + ((0, isNumber_8.isNumber)(key) ? key.toString() : key);
|
|
5012
4755
|
Reflect.defineProperty(realTarget, hiddenKey, {
|
|
5013
4756
|
value: makeReactive(description.value, onSet, parent, propName),
|
|
5014
4757
|
writable: true,
|
|
@@ -5019,13 +4762,13 @@
|
|
|
5019
4762
|
onSet(target, key, parent);
|
|
5020
4763
|
return true;
|
|
5021
4764
|
},
|
|
5022
|
-
deleteProperty
|
|
5023
|
-
|
|
4765
|
+
deleteProperty(target, key) {
|
|
4766
|
+
const realTarget = target;
|
|
5024
4767
|
if (key.indexOf('__bbn_') === 0) {
|
|
5025
4768
|
Reflect.deleteProperty(realTarget, key);
|
|
5026
4769
|
}
|
|
5027
4770
|
else {
|
|
5028
|
-
|
|
4771
|
+
const hiddenKey = prefix + ((0, isNumber_8.isNumber)(key) ? key.toString() : key);
|
|
5029
4772
|
Reflect.deleteProperty(realTarget, hiddenKey);
|
|
5030
4773
|
Reflect.deleteProperty(target, key);
|
|
5031
4774
|
}
|
|
@@ -5042,9 +4785,8 @@
|
|
|
5042
4785
|
"use strict";
|
|
5043
4786
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5044
4787
|
exports.map = void 0;
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
return arr.map(function (a, i) {
|
|
4788
|
+
const map = function (arr, fn, deepProp, level = 0) {
|
|
4789
|
+
return arr.map((a, i) => {
|
|
5048
4790
|
a = fn(a, i, level);
|
|
5049
4791
|
if (deepProp && a[deepProp] && (0, isArray_14.isArray)(a[deepProp])) {
|
|
5050
4792
|
a[deepProp] = map(a[deepProp], fn, deepProp, level + 1);
|
|
@@ -5058,7 +4800,7 @@
|
|
|
5058
4800
|
"use strict";
|
|
5059
4801
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5060
4802
|
exports.money = void 0;
|
|
5061
|
-
|
|
4803
|
+
const money = function (val, kilo, currency, novalue, decimal, thousands, precision) {
|
|
5062
4804
|
/*
|
|
5063
4805
|
money(val, kilo){
|
|
5064
4806
|
let decimal = ',',
|
|
@@ -5120,7 +4862,7 @@
|
|
|
5120
4862
|
precision = kilo ? 3 : 0;
|
|
5121
4863
|
}
|
|
5122
4864
|
if ((val === 0) && (typeof precision === 'number') && (precision > 0)) {
|
|
5123
|
-
|
|
4865
|
+
let res = val.toFixed(precision).replace('.', decimal);
|
|
5124
4866
|
if (currency) {
|
|
5125
4867
|
res += ' ' + (kilo ? 'K' + currency : currency);
|
|
5126
4868
|
}
|
|
@@ -5138,9 +4880,9 @@
|
|
|
5138
4880
|
currency = 'K' + currency;
|
|
5139
4881
|
}
|
|
5140
4882
|
}
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
4883
|
+
let v = val.toFixed(precision);
|
|
4884
|
+
let decimalPosition = 0;
|
|
4885
|
+
let decimalIdx = 10000;
|
|
5144
4886
|
if (v) {
|
|
5145
4887
|
decimalIdx = v.indexOf('.');
|
|
5146
4888
|
if (decimalIdx <= 0) {
|
|
@@ -5163,9 +4905,9 @@
|
|
|
5163
4905
|
"use strict";
|
|
5164
4906
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5165
4907
|
exports.move = void 0;
|
|
5166
|
-
|
|
4908
|
+
const move = function (arr, fromIndex, toIndex) {
|
|
5167
4909
|
if (toIndex >= arr.length) {
|
|
5168
|
-
|
|
4910
|
+
let k = toIndex - arr.length;
|
|
5169
4911
|
while (k-- + 1) {
|
|
5170
4912
|
arr.push(undefined);
|
|
5171
4913
|
}
|
|
@@ -5179,19 +4921,18 @@
|
|
|
5179
4921
|
"use strict";
|
|
5180
4922
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5181
4923
|
exports.multiorder = void 0;
|
|
5182
|
-
|
|
5183
|
-
|
|
4924
|
+
const multiorder = function (arr, orders) {
|
|
4925
|
+
let currentOrders;
|
|
5184
4926
|
if (!Array.isArray(orders) && typeof orders === 'object') {
|
|
5185
4927
|
currentOrders = [];
|
|
5186
4928
|
for (var n in orders) {
|
|
5187
4929
|
currentOrders.push({ field: n, dir: orders[n] });
|
|
5188
4930
|
}
|
|
5189
4931
|
}
|
|
5190
|
-
|
|
5191
|
-
return r.sort(
|
|
5192
|
-
|
|
5193
|
-
for (
|
|
5194
|
-
var order = currentOrders_1[_i];
|
|
4932
|
+
let r = arr.slice();
|
|
4933
|
+
return r.sort((a, b) => {
|
|
4934
|
+
let res;
|
|
4935
|
+
for (let order of currentOrders) {
|
|
5195
4936
|
res = (0, _compareValues_1._compareValues)(a, b, order.field, order.dir);
|
|
5196
4937
|
if (res !== 0) {
|
|
5197
4938
|
return res;
|
|
@@ -5206,7 +4947,7 @@
|
|
|
5206
4947
|
"use strict";
|
|
5207
4948
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5208
4949
|
exports.nl2br = void 0;
|
|
5209
|
-
|
|
4950
|
+
const nl2br = function (st, keepNl) {
|
|
5210
4951
|
return (0, replaceAll_5.replaceAll)('\n', '<br>' + (keepNl ? '\n' : ''), st);
|
|
5211
4952
|
};
|
|
5212
4953
|
exports.nl2br = nl2br;
|
|
@@ -5215,22 +4956,20 @@
|
|
|
5215
4956
|
"use strict";
|
|
5216
4957
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5217
4958
|
exports.objectToFormData = void 0;
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
var appendFormData = function (data, key) {
|
|
5222
|
-
if (key === void 0) { key = ''; }
|
|
4959
|
+
const objectToFormData = function (obj, key = '', ignoreList) {
|
|
4960
|
+
let formData = new FormData();
|
|
4961
|
+
let appendFormData = (data, key = '') => {
|
|
5223
4962
|
if (!ignoreList || ((0, isArray_15.isArray)(ignoreList) && !ignoreList.includes(key))) {
|
|
5224
4963
|
if (data instanceof File) {
|
|
5225
4964
|
formData.append(key, data);
|
|
5226
4965
|
}
|
|
5227
4966
|
else if ((0, isArray_15.isArray)(data)) {
|
|
5228
|
-
(0, each_21.each)(data,
|
|
4967
|
+
(0, each_21.each)(data, (v, i) => {
|
|
5229
4968
|
appendFormData(v, key + '[' + i + ']');
|
|
5230
4969
|
});
|
|
5231
4970
|
}
|
|
5232
4971
|
else if ((0, isObject_16.isObject)(data) && Object.keys(data).length) {
|
|
5233
|
-
(0, iterate_8.iterate)(data,
|
|
4972
|
+
(0, iterate_8.iterate)(data, (v, i) => {
|
|
5234
4973
|
if (i in data) {
|
|
5235
4974
|
appendFormData(v, !key ? i : key + '[' + i + ']');
|
|
5236
4975
|
}
|
|
@@ -5252,8 +4991,7 @@
|
|
|
5252
4991
|
"use strict";
|
|
5253
4992
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5254
4993
|
exports.order = void 0;
|
|
5255
|
-
|
|
5256
|
-
if (dir === void 0) { dir = 'asc'; }
|
|
4994
|
+
const order = function (arr, prop, dir = 'asc') {
|
|
5257
4995
|
if (arr) {
|
|
5258
4996
|
return arr.sort(function (a, b) {
|
|
5259
4997
|
return (0, _compareValues_2._compareValues)(a, b, prop, dir);
|
|
@@ -5267,7 +5005,7 @@
|
|
|
5267
5005
|
"use strict";
|
|
5268
5006
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5269
5007
|
exports.selector = void 0;
|
|
5270
|
-
|
|
5008
|
+
const selector = function (ele) {
|
|
5271
5009
|
return typeof ele === 'string' ? document.querySelector(ele) : ele;
|
|
5272
5010
|
};
|
|
5273
5011
|
exports.selector = selector;
|
|
@@ -5276,11 +5014,11 @@
|
|
|
5276
5014
|
"use strict";
|
|
5277
5015
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5278
5016
|
exports.outerHeight = void 0;
|
|
5279
|
-
|
|
5017
|
+
const outerHeight = function (ele) {
|
|
5280
5018
|
ele = (0, selector_1.selector)(ele);
|
|
5281
5019
|
if (ele && ('offsetHeight' in ele)) {
|
|
5282
|
-
|
|
5283
|
-
|
|
5020
|
+
let styles = window.getComputedStyle(ele);
|
|
5021
|
+
let margin = parseFloat(styles['marginTop']) + parseFloat(styles['marginBottom']);
|
|
5284
5022
|
return Math.ceil(ele.offsetHeight + margin);
|
|
5285
5023
|
}
|
|
5286
5024
|
};
|
|
@@ -5290,10 +5028,10 @@
|
|
|
5290
5028
|
"use strict";
|
|
5291
5029
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5292
5030
|
exports.outerWidth = void 0;
|
|
5293
|
-
|
|
5031
|
+
const outerWidth = function (ele) {
|
|
5294
5032
|
ele = (0, selector_2.selector)(ele);
|
|
5295
|
-
|
|
5296
|
-
|
|
5033
|
+
let styles = window.getComputedStyle(ele);
|
|
5034
|
+
let margin = parseFloat(styles['marginLeft']) + parseFloat(styles['marginRight']);
|
|
5297
5035
|
return Math.ceil(ele.offsetWidth + margin);
|
|
5298
5036
|
};
|
|
5299
5037
|
exports.outerWidth = outerWidth;
|
|
@@ -5302,7 +5040,7 @@
|
|
|
5302
5040
|
"use strict";
|
|
5303
5041
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5304
5042
|
exports.percent = void 0;
|
|
5305
|
-
|
|
5043
|
+
const percent = function (percent, cent) {
|
|
5306
5044
|
return (cent / 100) * percent;
|
|
5307
5045
|
};
|
|
5308
5046
|
exports.percent = percent;
|
|
@@ -5311,7 +5049,7 @@
|
|
|
5311
5049
|
"use strict";
|
|
5312
5050
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5313
5051
|
exports.pickValue = void 0;
|
|
5314
|
-
|
|
5052
|
+
const pickValue = function (arr) {
|
|
5315
5053
|
if (Array.isArray(arr) && arr.length) {
|
|
5316
5054
|
return arr[Math.floor(Math.random() * arr.length)];
|
|
5317
5055
|
}
|
|
@@ -5322,8 +5060,8 @@
|
|
|
5322
5060
|
"use strict";
|
|
5323
5061
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5324
5062
|
exports.postOut = void 0;
|
|
5325
|
-
|
|
5326
|
-
|
|
5063
|
+
const postOut = function (url, data, success, target) {
|
|
5064
|
+
let form = document.body.querySelector('form#bbn-form_out');
|
|
5327
5065
|
if (!form) {
|
|
5328
5066
|
form = document.createElement('form');
|
|
5329
5067
|
form.classList.add('bbn-no');
|
|
@@ -5355,7 +5093,7 @@
|
|
|
5355
5093
|
"use strict";
|
|
5356
5094
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5357
5095
|
exports.printf = void 0;
|
|
5358
|
-
|
|
5096
|
+
const printf = function (format) {
|
|
5359
5097
|
var args = Array.prototype.slice.call(arguments, 1);
|
|
5360
5098
|
return format.replace(/{(\d+)}/g, function (match, number) {
|
|
5361
5099
|
return typeof args[number] != 'undefined' ? args[number] : match;
|
|
@@ -5367,7 +5105,7 @@
|
|
|
5367
5105
|
"use strict";
|
|
5368
5106
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5369
5107
|
exports.quotes2html = void 0;
|
|
5370
|
-
|
|
5108
|
+
const quotes2html = function (st, type) {
|
|
5371
5109
|
if (!type || type.toLowerCase().indexOf('s') === 0) {
|
|
5372
5110
|
st = (0, replaceAll_6.replaceAll)("'", ''', st);
|
|
5373
5111
|
}
|
|
@@ -5382,7 +5120,7 @@
|
|
|
5382
5120
|
"use strict";
|
|
5383
5121
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5384
5122
|
exports.randomInt = void 0;
|
|
5385
|
-
|
|
5123
|
+
const randomInt = function (min, max) {
|
|
5386
5124
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
5387
5125
|
};
|
|
5388
5126
|
exports.randomInt = randomInt;
|
|
@@ -5391,10 +5129,10 @@
|
|
|
5391
5129
|
"use strict";
|
|
5392
5130
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5393
5131
|
exports.randomString = void 0;
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5132
|
+
const randomString = function (min, max, types) {
|
|
5133
|
+
let length;
|
|
5134
|
+
let type;
|
|
5135
|
+
let chars = {
|
|
5398
5136
|
n: '0123456789',
|
|
5399
5137
|
l: 'abcdefghijklmnopqrstuvwxyz',
|
|
5400
5138
|
u: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
@@ -5420,8 +5158,8 @@
|
|
|
5420
5158
|
else if (min) {
|
|
5421
5159
|
length = min;
|
|
5422
5160
|
}
|
|
5423
|
-
|
|
5424
|
-
for (
|
|
5161
|
+
let result = '';
|
|
5162
|
+
for (let i = 0; i < length; i++) {
|
|
5425
5163
|
// Not a number for the first char
|
|
5426
5164
|
if (i === 0) {
|
|
5427
5165
|
if (types !== 'n') {
|
|
@@ -5441,11 +5179,11 @@
|
|
|
5441
5179
|
"use strict";
|
|
5442
5180
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5443
5181
|
exports.removeEmpty = void 0;
|
|
5444
|
-
|
|
5182
|
+
const removeEmpty = function (arr) {
|
|
5445
5183
|
var tmp = [];
|
|
5446
5184
|
if ((0, isArray_16.isArray)(arr)) {
|
|
5447
|
-
for (
|
|
5448
|
-
|
|
5185
|
+
for (let i = 0; i < arr.length; i++) {
|
|
5186
|
+
let ok = false;
|
|
5449
5187
|
if (arr[i]) {
|
|
5450
5188
|
if ((0, isArray_16.isArray)(arr[i])) {
|
|
5451
5189
|
if (arr[i].length) {
|
|
@@ -5474,7 +5212,7 @@
|
|
|
5474
5212
|
"use strict";
|
|
5475
5213
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5476
5214
|
exports.removeExtraSpaces = void 0;
|
|
5477
|
-
|
|
5215
|
+
const removeExtraSpaces = function (str) {
|
|
5478
5216
|
return str.replace(/\s+/g, ' ').trim();
|
|
5479
5217
|
};
|
|
5480
5218
|
exports.removeExtraSpaces = removeExtraSpaces;
|
|
@@ -5483,7 +5221,7 @@
|
|
|
5483
5221
|
"use strict";
|
|
5484
5222
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5485
5223
|
exports.removeTrailingChars = void 0;
|
|
5486
|
-
|
|
5224
|
+
const removeTrailingChars = function (st, char) {
|
|
5487
5225
|
if (!char) {
|
|
5488
5226
|
char = ' ';
|
|
5489
5227
|
}
|
|
@@ -5503,7 +5241,7 @@
|
|
|
5503
5241
|
"use strict";
|
|
5504
5242
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5505
5243
|
exports.repeat = void 0;
|
|
5506
|
-
|
|
5244
|
+
const repeat = function (st, num) {
|
|
5507
5245
|
return st.repeat(num);
|
|
5508
5246
|
};
|
|
5509
5247
|
exports.repeat = repeat;
|
|
@@ -5512,8 +5250,8 @@
|
|
|
5512
5250
|
"use strict";
|
|
5513
5251
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5514
5252
|
exports.replaceSelection = void 0;
|
|
5515
|
-
|
|
5516
|
-
|
|
5253
|
+
const replaceSelection = function (html, selectInserted) {
|
|
5254
|
+
let sel, range, fragment;
|
|
5517
5255
|
sel = window.getSelection();
|
|
5518
5256
|
// Test that the Selection object contains at least one Range
|
|
5519
5257
|
if (sel.getRangeAt && sel.rangeCount) {
|
|
@@ -5528,16 +5266,16 @@
|
|
|
5528
5266
|
}
|
|
5529
5267
|
else {
|
|
5530
5268
|
// In IE 9 we need to use innerHTML of a temporary element
|
|
5531
|
-
|
|
5532
|
-
|
|
5269
|
+
const div = document.createElement('div');
|
|
5270
|
+
let child;
|
|
5533
5271
|
div.innerHTML = html;
|
|
5534
5272
|
fragment = document.createDocumentFragment();
|
|
5535
5273
|
while ((child = div.firstChild)) {
|
|
5536
5274
|
fragment.appendChild(child);
|
|
5537
5275
|
}
|
|
5538
5276
|
}
|
|
5539
|
-
|
|
5540
|
-
|
|
5277
|
+
const firstInsertedNode = fragment.firstChild;
|
|
5278
|
+
const lastInsertedNode = fragment.lastChild;
|
|
5541
5279
|
range.insertNode(fragment);
|
|
5542
5280
|
sel.removeAllRanges();
|
|
5543
5281
|
if (selectInserted) {
|
|
@@ -5559,7 +5297,7 @@
|
|
|
5559
5297
|
"use strict";
|
|
5560
5298
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5561
5299
|
exports.rgb2hex = void 0;
|
|
5562
|
-
|
|
5300
|
+
const rgb2hex = function (rgb) {
|
|
5563
5301
|
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
|
5564
5302
|
return rgb && rgb.length === 4
|
|
5565
5303
|
? '#' +
|
|
@@ -5574,7 +5312,7 @@
|
|
|
5574
5312
|
"use strict";
|
|
5575
5313
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5576
5314
|
exports.riterate = void 0;
|
|
5577
|
-
|
|
5315
|
+
const riterate = function (obj, fn, noPrivate) {
|
|
5578
5316
|
return (0, iterate_9.iterate)(obj, fn, noPrivate, true);
|
|
5579
5317
|
};
|
|
5580
5318
|
exports.riterate = riterate;
|
|
@@ -5583,7 +5321,7 @@
|
|
|
5583
5321
|
"use strict";
|
|
5584
5322
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5585
5323
|
exports.roundDecimal = void 0;
|
|
5586
|
-
|
|
5324
|
+
const roundDecimal = function (value, decimals) {
|
|
5587
5325
|
return Math.round(Math.pow(Math.pow(value, decimals), -decimals));
|
|
5588
5326
|
};
|
|
5589
5327
|
exports.roundDecimal = roundDecimal;
|
|
@@ -5592,8 +5330,7 @@
|
|
|
5592
5330
|
"use strict";
|
|
5593
5331
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5594
5332
|
exports.trim = void 0;
|
|
5595
|
-
|
|
5596
|
-
if (hair === void 0) { hair = ' '; }
|
|
5333
|
+
const trim = function (str, hair = ' ') {
|
|
5597
5334
|
if (hair === ' ') {
|
|
5598
5335
|
return str.trim();
|
|
5599
5336
|
}
|
|
@@ -5617,19 +5354,18 @@
|
|
|
5617
5354
|
"use strict";
|
|
5618
5355
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5619
5356
|
exports.sanitize = void 0;
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
for (var i = 0; i < separator.length; i++) {
|
|
5357
|
+
const sanitize = function (str, separator = '_') {
|
|
5358
|
+
let escaped = ['[', ']', '{', '}', '(', ')', '-', '+', '*', '/'];
|
|
5359
|
+
let exp = '[';
|
|
5360
|
+
for (let i = 0; i < separator.length; i++) {
|
|
5625
5361
|
if (escaped.includes(separator[i])) {
|
|
5626
5362
|
exp += '\\';
|
|
5627
5363
|
}
|
|
5628
5364
|
exp += separator[i];
|
|
5629
5365
|
}
|
|
5630
5366
|
exp += ']+';
|
|
5631
|
-
|
|
5632
|
-
|
|
5367
|
+
let re = new RegExp(exp, 'g');
|
|
5368
|
+
let res = (0, removeAccents_3.removeAccents)(str)
|
|
5633
5369
|
.replace(/[^a-z0-9]/gi, separator)
|
|
5634
5370
|
.replace(re, separator);
|
|
5635
5371
|
return (0, trim_1.trim)(res, separator);
|
|
@@ -5640,15 +5376,15 @@
|
|
|
5640
5376
|
"use strict";
|
|
5641
5377
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5642
5378
|
exports.selectElementText = void 0;
|
|
5643
|
-
|
|
5379
|
+
const selectElementText = function (ele, win) {
|
|
5644
5380
|
win = win || window;
|
|
5645
5381
|
if (ele instanceof HTMLInputElement) {
|
|
5646
5382
|
ele.select();
|
|
5647
5383
|
return;
|
|
5648
5384
|
}
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5385
|
+
let doc = win.document;
|
|
5386
|
+
let sel;
|
|
5387
|
+
let range;
|
|
5652
5388
|
if (win.getSelection && doc.createRange) {
|
|
5653
5389
|
sel = win.getSelection();
|
|
5654
5390
|
range = doc.createRange();
|
|
@@ -5668,14 +5404,14 @@
|
|
|
5668
5404
|
"use strict";
|
|
5669
5405
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5670
5406
|
exports.setCookie = void 0;
|
|
5671
|
-
|
|
5672
|
-
|
|
5407
|
+
const setCookie = function (name, value, days) {
|
|
5408
|
+
let expires = '';
|
|
5673
5409
|
if (days) {
|
|
5674
|
-
|
|
5410
|
+
let date = new Date();
|
|
5675
5411
|
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
5676
5412
|
expires = '; expires=' + date.toUTCString();
|
|
5677
5413
|
}
|
|
5678
|
-
|
|
5414
|
+
let st = escape(JSON.stringify({ value: value }));
|
|
5679
5415
|
document.cookie = name + '=' + st + expires + '; path=/';
|
|
5680
5416
|
};
|
|
5681
5417
|
exports.setCookie = setCookie;
|
|
@@ -5684,7 +5420,7 @@
|
|
|
5684
5420
|
"use strict";
|
|
5685
5421
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5686
5422
|
exports.setCssVar = void 0;
|
|
5687
|
-
|
|
5423
|
+
const setCssVar = function (varname, value) {
|
|
5688
5424
|
if (varname.indexOf('--') !== 0) {
|
|
5689
5425
|
varname = '--' + varname;
|
|
5690
5426
|
}
|
|
@@ -5697,9 +5433,7 @@
|
|
|
5697
5433
|
"use strict";
|
|
5698
5434
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5699
5435
|
exports.setProp = void 0;
|
|
5700
|
-
|
|
5701
|
-
if (writable === void 0) { writable = true; }
|
|
5702
|
-
if (configurable === void 0) { configurable = true; }
|
|
5436
|
+
const setProp = function (obj, prop, value, writable = true, configurable = true) {
|
|
5703
5437
|
Object.defineProperty(obj, prop, {
|
|
5704
5438
|
value: value,
|
|
5705
5439
|
writable: writable,
|
|
@@ -5712,22 +5446,22 @@
|
|
|
5712
5446
|
"use strict";
|
|
5713
5447
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5714
5448
|
exports.setProperty = void 0;
|
|
5715
|
-
|
|
5449
|
+
const setProperty = function (obj, prop, value, force) {
|
|
5716
5450
|
if (typeof obj === 'object' && typeof prop === 'string') {
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
(0, each_22.each)(
|
|
5720
|
-
if (!
|
|
5451
|
+
let o = obj;
|
|
5452
|
+
const bits = prop.split('.');
|
|
5453
|
+
(0, each_22.each)(bits, (v, i) => {
|
|
5454
|
+
if (!o) {
|
|
5721
5455
|
if (!force) {
|
|
5722
5456
|
throw new Error(bbn._('The object is invalid'));
|
|
5723
5457
|
}
|
|
5724
|
-
|
|
5458
|
+
o = {};
|
|
5725
5459
|
}
|
|
5726
|
-
if (
|
|
5727
|
-
|
|
5460
|
+
if (bits.length - 1 === i) {
|
|
5461
|
+
o[v] = value;
|
|
5728
5462
|
}
|
|
5729
5463
|
else {
|
|
5730
|
-
|
|
5464
|
+
o = o[v];
|
|
5731
5465
|
}
|
|
5732
5466
|
});
|
|
5733
5467
|
}
|
|
@@ -5738,7 +5472,7 @@
|
|
|
5738
5472
|
"use strict";
|
|
5739
5473
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5740
5474
|
exports.shorten = void 0;
|
|
5741
|
-
|
|
5475
|
+
const shorten = function (st, len, adj) {
|
|
5742
5476
|
if (typeof st.toLowerCase() === 'string') {
|
|
5743
5477
|
if (!len) {
|
|
5744
5478
|
len = bbn.vars.shortenLen;
|
|
@@ -5758,10 +5492,9 @@
|
|
|
5758
5492
|
"use strict";
|
|
5759
5493
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5760
5494
|
exports.shortenObj = void 0;
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
(0, each_23.each)(o, function (a, n) {
|
|
5495
|
+
const shortenObj = function (obj, max = 100) {
|
|
5496
|
+
let o = (0, clone_1.clone)(obj);
|
|
5497
|
+
(0, each_23.each)(o, (a, n) => {
|
|
5765
5498
|
if ((0, isString_26.isString)(a) && a.length > max) {
|
|
5766
5499
|
o[n] = (0, shorten_1.shorten)(a, max);
|
|
5767
5500
|
}
|
|
@@ -5777,16 +5510,15 @@
|
|
|
5777
5510
|
"use strict";
|
|
5778
5511
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5779
5512
|
exports.shuffle = void 0;
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
var currentIndex = array.length, randomIndex;
|
|
5513
|
+
const shuffle = function (array) {
|
|
5514
|
+
let currentIndex = array.length, randomIndex;
|
|
5783
5515
|
// While there remain elements to shuffle.
|
|
5784
5516
|
while (currentIndex != 0) {
|
|
5785
5517
|
// Pick a remaining element.
|
|
5786
5518
|
randomIndex = Math.floor(Math.random() * currentIndex);
|
|
5787
5519
|
currentIndex--;
|
|
5788
5520
|
// And swap it with the current element.
|
|
5789
|
-
|
|
5521
|
+
[array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]];
|
|
5790
5522
|
}
|
|
5791
5523
|
return array;
|
|
5792
5524
|
};
|
|
@@ -5796,12 +5528,12 @@
|
|
|
5796
5528
|
"use strict";
|
|
5797
5529
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5798
5530
|
exports.stopChrono = exports.startChrono = void 0;
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5531
|
+
const _private = [];
|
|
5532
|
+
const startChrono = function (name) {
|
|
5533
|
+
let now = new Date().getTime();
|
|
5534
|
+
let h1 = 3600 * 1000;
|
|
5803
5535
|
if (_private.length) {
|
|
5804
|
-
(0, each_24.each)(_private,
|
|
5536
|
+
(0, each_24.each)(_private, (t, n) => {
|
|
5805
5537
|
if (now - t > h1) {
|
|
5806
5538
|
delete _private[n];
|
|
5807
5539
|
}
|
|
@@ -5811,10 +5543,10 @@
|
|
|
5811
5543
|
_private[name] = now;
|
|
5812
5544
|
};
|
|
5813
5545
|
exports.startChrono = startChrono;
|
|
5814
|
-
|
|
5546
|
+
const stopChrono = function (name) {
|
|
5815
5547
|
if (_private[name]) {
|
|
5816
|
-
|
|
5817
|
-
|
|
5548
|
+
let now = new Date().getTime();
|
|
5549
|
+
let diff = now - _private[name];
|
|
5818
5550
|
return diff;
|
|
5819
5551
|
}
|
|
5820
5552
|
};
|
|
@@ -5824,7 +5556,7 @@
|
|
|
5824
5556
|
"use strict";
|
|
5825
5557
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5826
5558
|
exports.stat = void 0;
|
|
5827
|
-
|
|
5559
|
+
const stat = function (returnStat) {
|
|
5828
5560
|
return;
|
|
5829
5561
|
/*
|
|
5830
5562
|
if (bbn.env.logging) {
|
|
@@ -5878,7 +5610,7 @@
|
|
|
5878
5610
|
"use strict";
|
|
5879
5611
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5880
5612
|
exports.string2ArrayBuffer = void 0;
|
|
5881
|
-
|
|
5613
|
+
const string2ArrayBuffer = function (str) {
|
|
5882
5614
|
var buf = new ArrayBuffer(str.length * 2); // 2 bytes for each char
|
|
5883
5615
|
var bufView = new Uint16Array(buf);
|
|
5884
5616
|
for (var i = 0, strLen = str.length; i < strLen; i++) {
|
|
@@ -5892,10 +5624,10 @@
|
|
|
5892
5624
|
"use strict";
|
|
5893
5625
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5894
5626
|
exports.sum = void 0;
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
(0, each_25.each)((0, filter_5.filter)(arr, prop, val, operator),
|
|
5898
|
-
|
|
5627
|
+
const sum = function (arr, numberProp, prop, val, operator) {
|
|
5628
|
+
let r = 0;
|
|
5629
|
+
(0, each_25.each)((0, filter_5.filter)(arr, prop, val, operator), (a) => {
|
|
5630
|
+
let tmp = typeof numberProp === 'function' ? numberProp(a) : a[numberProp];
|
|
5899
5631
|
if (tmp) {
|
|
5900
5632
|
r += parseFloat(tmp) || 0;
|
|
5901
5633
|
}
|
|
@@ -5908,7 +5640,7 @@
|
|
|
5908
5640
|
"use strict";
|
|
5909
5641
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5910
5642
|
exports.timestamp = void 0;
|
|
5911
|
-
|
|
5643
|
+
const timestamp = function (seconds) {
|
|
5912
5644
|
var r = new Date().getTime();
|
|
5913
5645
|
return seconds ? Math.round(r / 1000) : r;
|
|
5914
5646
|
};
|
|
@@ -5918,22 +5650,19 @@
|
|
|
5918
5650
|
"use strict";
|
|
5919
5651
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5920
5652
|
exports.toCSV = void 0;
|
|
5921
|
-
|
|
5922
|
-
if (valSep === void 0) { valSep = ','; }
|
|
5923
|
-
if (rowSep === void 0) { rowSep = ''; }
|
|
5924
|
-
if (valEsc === void 0) { valEsc = '"'; }
|
|
5653
|
+
const toCSV = function (arr, valSep = ',', rowSep = '', valEsc = '"') {
|
|
5925
5654
|
if (!valSep) {
|
|
5926
5655
|
valSep = ',';
|
|
5927
5656
|
}
|
|
5928
5657
|
if (!valEsc) {
|
|
5929
5658
|
valEsc = '"';
|
|
5930
5659
|
}
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
(0, each_26.each)(arr,
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
(0, each_26.each)(a,
|
|
5660
|
+
let csvContent = '';
|
|
5661
|
+
let total = arr.length;
|
|
5662
|
+
(0, each_26.each)(arr, (a, i) => {
|
|
5663
|
+
let num = (0, isArray_17.isArray)(a) ? a.length : Object.values(a).length;
|
|
5664
|
+
let j = 0;
|
|
5665
|
+
(0, each_26.each)(a, (b) => {
|
|
5937
5666
|
if (typeof b === 'string') {
|
|
5938
5667
|
csvContent += valEsc + (0, replaceAll_7.replaceAll)(valEsc, '\\' + valEsc, b) + valEsc;
|
|
5939
5668
|
}
|
|
@@ -5963,7 +5692,7 @@
|
|
|
5963
5692
|
"use strict";
|
|
5964
5693
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5965
5694
|
exports.toggleFullScreen = void 0;
|
|
5966
|
-
|
|
5695
|
+
const toggleFullScreen = function () {
|
|
5967
5696
|
if ('mozRequestFullScreen' in window.document.documentElement) {
|
|
5968
5697
|
if (window.document['mozFullScreen']) {
|
|
5969
5698
|
window.document['mozCancelFullScreen']();
|
|
@@ -6006,9 +5735,9 @@
|
|
|
6006
5735
|
"use strict";
|
|
6007
5736
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6008
5737
|
exports.translate = void 0;
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
(0, iterate_10.iterate)(o,
|
|
5738
|
+
const translate = function (o, namespace) {
|
|
5739
|
+
let lng = namespace ? bbn.lng[namespace.indexOf('_') === 0 ? namespace : '_' + namespace] : bbn.lng;
|
|
5740
|
+
(0, iterate_10.iterate)(o, (v, k) => {
|
|
6012
5741
|
lng[k] = v;
|
|
6013
5742
|
});
|
|
6014
5743
|
};
|
|
@@ -6018,13 +5747,9 @@
|
|
|
6018
5747
|
"use strict";
|
|
6019
5748
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6020
5749
|
exports.uniqString = void 0;
|
|
6021
|
-
|
|
6022
|
-
var args = [];
|
|
6023
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6024
|
-
args[_i] = arguments[_i];
|
|
6025
|
-
}
|
|
5750
|
+
const uniqString = function (...args) {
|
|
6026
5751
|
var st = '';
|
|
6027
|
-
var
|
|
5752
|
+
for (var i = 0; i < args.length; i++) {
|
|
6028
5753
|
if (!args[i]) {
|
|
6029
5754
|
st += '__bbn_empty__';
|
|
6030
5755
|
}
|
|
@@ -6034,12 +5759,12 @@
|
|
|
6034
5759
|
}
|
|
6035
5760
|
else {
|
|
6036
5761
|
// An object with the same properties, even in different order, should produce the same answer
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
(0, each_27.each)(ks,
|
|
6040
|
-
|
|
5762
|
+
let tmp = {};
|
|
5763
|
+
let ks = Object.keys(args[i]).sort();
|
|
5764
|
+
(0, each_27.each)(ks, (k) => {
|
|
5765
|
+
tmp[k] = args[i][k];
|
|
6041
5766
|
});
|
|
6042
|
-
st += JSON.stringify(
|
|
5767
|
+
st += JSON.stringify(tmp);
|
|
6043
5768
|
}
|
|
6044
5769
|
}
|
|
6045
5770
|
else if (typeof args[i] !== 'string') {
|
|
@@ -6048,9 +5773,6 @@
|
|
|
6048
5773
|
else {
|
|
6049
5774
|
st += args[i];
|
|
6050
5775
|
}
|
|
6051
|
-
};
|
|
6052
|
-
for (var i = 0; i < args.length; i++) {
|
|
6053
|
-
_loop_2();
|
|
6054
5776
|
}
|
|
6055
5777
|
return (0, md5_3.md5)(st);
|
|
6056
5778
|
};
|
|
@@ -6060,15 +5782,15 @@
|
|
|
6060
5782
|
"use strict";
|
|
6061
5783
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6062
5784
|
exports.upload = void 0;
|
|
6063
|
-
|
|
6064
|
-
|
|
5785
|
+
const upload = function (url, file, success, failure, progress) {
|
|
5786
|
+
let fn = () => {
|
|
6065
5787
|
return axios.post(url || bbn.env.path, (0, objectToFormData_1.objectToFormData)(file), {
|
|
6066
5788
|
headers: {
|
|
6067
5789
|
'Content-Type': 'multipart/form-data',
|
|
6068
5790
|
},
|
|
6069
|
-
onUploadProgress
|
|
5791
|
+
onUploadProgress(progressEvent) {
|
|
6070
5792
|
if (progress) {
|
|
6071
|
-
|
|
5793
|
+
let percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
|
|
6072
5794
|
progress(percentCompleted, progressEvent.loaded, progressEvent.total);
|
|
6073
5795
|
}
|
|
6074
5796
|
},
|
|
@@ -6079,13 +5801,13 @@
|
|
|
6079
5801
|
}
|
|
6080
5802
|
else {
|
|
6081
5803
|
return fn()
|
|
6082
|
-
.then(
|
|
5804
|
+
.then((res) => {
|
|
6083
5805
|
if (success) {
|
|
6084
5806
|
(0, log_18.log)('SUCCESS', res);
|
|
6085
5807
|
success(res);
|
|
6086
5808
|
}
|
|
6087
5809
|
})
|
|
6088
|
-
.catch(
|
|
5810
|
+
.catch((err) => {
|
|
6089
5811
|
if (failure) {
|
|
6090
5812
|
(0, log_18.log)('ERROR', err);
|
|
6091
5813
|
failure(err);
|
|
@@ -6095,11 +5817,11 @@
|
|
|
6095
5817
|
};
|
|
6096
5818
|
exports.upload = upload;
|
|
6097
5819
|
});
|
|
6098
|
-
define("index", ["require", "exports", "fn/_addLoader", "fn/_compareValues", "fn/_deleteLoader", "fn/abort", "fn/abortURL", "fn/addColors", "fn/addInputs", "fn/addStyle", "fn/adjustHeight", "fn/adjustSize", "fn/adjustWidth", "fn/ajax", "fn/analyzeFunction", "fn/animateCss", "fn/arrayBuffer2String", "fn/arrayFromProp", "fn/autoExtend", "fn/baseName", "fn/br2nl", "fn/calendar", "fn/callback", "fn/camelize", "fn/camelToCss", "fn/canvasToImage", "fn/center", "fn/checkProps", "fn/checkPropsDetails", "fn/checkPropsOrDie", "fn/checkType", "fn/circularReplacer", "fn/clone", "fn/colorToHex", "fn/compare", "fn/compareConditions", "fn/copy", "fn/correctCase", "fn/count", "fn/crc32", "fn/createObject", "fn/cssExists", "fn/date", "fn/dateSQL", "fn/daysInMonth", "fn/deepPath", "fn/defaultAjaxAbortFunction", "fn/defaultAjaxErrorFunction", "fn/defaultAlertFunction", "fn/defaultConfirmFunction", "fn/defaultEndLoadingFunction", "fn/defaultErrorFunction", "fn/defaultHistoryFunction", "fn/defaultLinkFunction", "fn/defaultPostLinkFunction", "fn/defaultPreLinkFunction", "fn/defaultResizeFunction", "fn/defaultStartLoadingFunction", "fn/deleteProp", "fn/diffObj", "fn/dirName", "fn/download", "fn/downloadContent", "fn/each", "fn/eraseCookie", "fn/error", "fn/escapeDquotes", "fn/escapeRegExp", "fn/escapeSquotes", "fn/escapeTicks", "fn/escapeUrl", "fn/extend", "fn/extendOut", "fn/fdate", "fn/fdatetime", "fn/fieldValue", "fn/fileExt", "fn/filter", "fn/filterToConditions", "fn/findAll", "fn/fori", "fn/forir", "fn/format", "fn/formatBytes", "fn/formatDate", "fn/formatSize", "fn/formdata", "fn/fromXml", "fn/ftime", "fn/getAllTags", "fn/getAncestors", "fn/getAttributes", "fn/getBrowserName", "fn/getBrowserVersion", "fn/getCookie", "fn/getCssVar", "fn/getDay", "fn/getDeviceType", "fn/getEventData", "fn/getField", "fn/getFieldValues", "fn/getHtml", "fn/getHTMLOfSelection", "fn/getLoader", "fn/getPath", "fn/getProp", "fn/getProperty", "fn/getRequestId", "fn/getRow", "fn/getScrollBarSize", "fn/getText", "fn/getTimeoff", "fn/happy", "fn/hash", "fn/hex2rgb", "fn/history", "fn/html2text", "fn/imageToCanvas", "fn/imgToBase64", "fn/info", "fn/init", "fn/isActiveInterface", "fn/isArray", "fn/isBlob", "fn/isBoolean", "fn/isCanvas", "fn/isColor", "fn/isComment", "fn/isCp", "fn/isDate", "fn/isDesktopDevice", "fn/isDimension", "fn/isDom", "fn/isEmail", "fn/isEmpty", "fn/isEvent", "fn/isFocused", "fn/isFunction", "fn/isHostname", "fn/isInside", "fn/isInt", "fn/isIP", "fn/isIterable", "fn/isMobile", "fn/isMobileDevice", "fn/isNull", "fn/isNumber", "fn/isObject", "fn/isPercent", "fn/isPrimitive", "fn/isPromise", "fn/isPropSize", "fn/isSame", "fn/isSQLDate", "fn/isString", "fn/isSymbol", "fn/isTabletDevice", "fn/isURL", "fn/isValidDimension", "fn/isValidName", "fn/isValue", "fn/isVue", "fn/iterate", "fn/lightenDarkenHex", "fn/link", "fn/log", "fn/makeReactive", "fn/map", "fn/md5", "fn/money", "fn/move", "fn/multiorder", "fn/nl2br", "fn/numProperties", "fn/objectToFormData", "fn/order", "fn/outerHeight", "fn/outerWidth", "fn/percent", "fn/pickValue", "fn/post", "fn/postOut", "fn/printf", "fn/quotes2html", "fn/randomInt", "fn/randomString", "fn/removeAccents", "fn/removeEmpty", "fn/removeExtraSpaces", "fn/removeHtmlComments", "fn/removePrivateProp", "fn/removeTrailingChars", "fn/repeat", "fn/replaceAll", "fn/replaceSelection", "fn/resize", "fn/rgb2hex", "fn/riterate", "fn/roundDecimal", "fn/sanitize", "fn/search", "fn/selectElementText", "fn/selector", "fn/setCookie", "fn/setCssVar", "fn/setNavigationVars", "fn/setProp", "fn/setProperty", "fn/shorten", "fn/shortenObj", "fn/shuffle", "fn/simpleHash", "fn/simpleHash1", "fn/simpleHash2", "fn/chrono", "fn/stat", "fn/string2ArrayBuffer", "fn/submit", "fn/substr", "fn/sum", "fn/timestamp", "fn/toCSV", "fn/toggleFullScreen", "fn/translate", "fn/treatAjaxArguments", "fn/trim", "fn/uniqString", "fn/unique", "fn/upload", "fn/warning"], function (require, exports, _addLoader_2, _compareValues_3, _deleteLoader_2, abort_1, abortURL_1, addColors_2, addInputs_2, addStyle_1, adjustHeight_1, adjustSize_3, adjustWidth_1, ajax_4, analyzeFunction_1, animateCss_1, arrayBuffer2String_1, arrayFromProp_1, autoExtend_1, baseName_3, br2nl_1, calendar_1, callback_3, camelize_1, camelToCss_1, canvasToImage_1, center_1, checkProps_1, checkPropsDetails_3, checkPropsOrDie_1, checkType_5, circularReplacer_2, clone_2, colorToHex_1, compare_1, compareConditions_3, copy_1, correctCase_2, count_1, crc32_1, createObject_4, cssExists_1, date_8, dateSQL_1, daysInMonth_1, deepPath_1, defaultAjaxAbortFunction_2, defaultAjaxErrorFunction_3, defaultAlertFunction_2, defaultConfirmFunction_1, defaultEndLoadingFunction_2, defaultErrorFunction_2, defaultHistoryFunction_2, defaultLinkFunction_2, defaultPostLinkFunction_2, defaultPreLinkFunction_2, defaultResizeFunction_2, defaultStartLoadingFunction_2, deleteProp_1, diffObj_1, dirName_2, download_1, downloadContent_2, each_28, eraseCookie_1, error_4, escapeDquotes_1, escapeRegExp_3, escapeSquotes_1, escapeTicks_1, escapeUrl_1, extend_7, extendOut_1, fdate_2, fdatetime_2, fieldValue_2, fileExt_2, filter_6, filterToConditions_3, findAll_1, fori_1, forir_1, format_1, formatBytes_1, formatDate_1, formatSize_1, formdata_2, fromXml_1, ftime_1, getAllTags_1, getAncestors_2, getAttributes_1, getBrowserName_1, getBrowserVersion_1, getCookie_1, getCssVar_2, getDay_1, getDeviceType_1, getEventData_1, getField_1, getFieldValues_1, getHtml_1, getHTMLOfSelection_2, getLoader_4, getPath_1, getProp_1, getProperty_4, getRequestId_2, getRow_3, getScrollBarSize_1, getText_1, getTimeoff_1, happy_1, hash_2, hex2rgb_1,
|
|
5820
|
+
define("index", ["require", "exports", "fn/_addLoader", "fn/_compareValues", "fn/_deleteLoader", "fn/abort", "fn/abortURL", "fn/addColors", "fn/addInputs", "fn/addStyle", "fn/adjustHeight", "fn/adjustSize", "fn/adjustWidth", "fn/ajax", "fn/analyzeFunction", "fn/animateCss", "fn/arrayBuffer2String", "fn/arrayFromProp", "fn/autoExtend", "fn/baseName", "fn/br2nl", "fn/calendar", "fn/callback", "fn/camelize", "fn/camelToCss", "fn/canvasToImage", "fn/center", "fn/checkProps", "fn/checkPropsDetails", "fn/checkPropsOrDie", "fn/checkType", "fn/circularReplacer", "fn/clone", "fn/colorToHex", "fn/compare", "fn/compareConditions", "fn/copy", "fn/correctCase", "fn/count", "fn/crc32", "fn/createObject", "fn/cssExists", "fn/date", "fn/dateSQL", "fn/daysInMonth", "fn/deepPath", "fn/defaultAjaxAbortFunction", "fn/defaultAjaxErrorFunction", "fn/defaultAlertFunction", "fn/defaultConfirmFunction", "fn/defaultEndLoadingFunction", "fn/defaultErrorFunction", "fn/defaultHistoryFunction", "fn/defaultLinkFunction", "fn/defaultPostLinkFunction", "fn/defaultPreLinkFunction", "fn/defaultResizeFunction", "fn/defaultStartLoadingFunction", "fn/deleteProp", "fn/diffObj", "fn/dirName", "fn/download", "fn/downloadContent", "fn/each", "fn/eraseCookie", "fn/error", "fn/escapeDquotes", "fn/escapeRegExp", "fn/escapeSquotes", "fn/escapeTicks", "fn/escapeUrl", "fn/extend", "fn/extendOut", "fn/fdate", "fn/fdatetime", "fn/fieldValue", "fn/fileExt", "fn/filter", "fn/filterToConditions", "fn/findAll", "fn/fori", "fn/forir", "fn/format", "fn/formatBytes", "fn/formatDate", "fn/formatSize", "fn/formdata", "fn/fromXml", "fn/ftime", "fn/getAllTags", "fn/getAncestors", "fn/getAttributes", "fn/getBrowserName", "fn/getBrowserVersion", "fn/getCookie", "fn/getCssVar", "fn/getDay", "fn/getDeviceType", "fn/getEventData", "fn/getField", "fn/getFieldValues", "fn/getHtml", "fn/getHTMLOfSelection", "fn/getLoader", "fn/getPath", "fn/getProp", "fn/getProperty", "fn/getRequestId", "fn/getRow", "fn/getScrollBarSize", "fn/getText", "fn/getTimeoff", "fn/happy", "fn/hash", "fn/hex2rgb", "fn/history", "fn/html2text", "fn/imageToCanvas", "fn/imgToBase64", "fn/info", "fn/init", "fn/isActiveInterface", "fn/isArray", "fn/isBlob", "fn/isBoolean", "fn/isCanvas", "fn/isColor", "fn/isComment", "fn/isCp", "fn/isDate", "fn/isDesktopDevice", "fn/isDimension", "fn/isDom", "fn/isEmail", "fn/isEmpty", "fn/isEvent", "fn/isFocused", "fn/isFunction", "fn/isHostname", "fn/isInside", "fn/isInt", "fn/isIP", "fn/isIterable", "fn/isMobile", "fn/isMobileDevice", "fn/isNull", "fn/isNumber", "fn/isObject", "fn/isPercent", "fn/isPrimitive", "fn/isPromise", "fn/isPropSize", "fn/isSame", "fn/isSQLDate", "fn/isString", "fn/isSymbol", "fn/isTabletDevice", "fn/isURL", "fn/isValidDimension", "fn/isValidName", "fn/isValue", "fn/isVue", "fn/iterate", "fn/lightenDarkenHex", "fn/link", "fn/log", "fn/makeReactive", "fn/map", "fn/md5", "fn/money", "fn/move", "fn/multiorder", "fn/nl2br", "fn/numProperties", "fn/objectToFormData", "fn/order", "fn/outerHeight", "fn/outerWidth", "fn/percent", "fn/pickValue", "fn/post", "fn/postOut", "fn/printf", "fn/quotes2html", "fn/randomInt", "fn/randomString", "fn/removeAccents", "fn/removeEmpty", "fn/removeExtraSpaces", "fn/removeHtmlComments", "fn/removePrivateProp", "fn/removeTrailingChars", "fn/repeat", "fn/replaceAll", "fn/replaceSelection", "fn/resize", "fn/rgb2hex", "fn/riterate", "fn/roundDecimal", "fn/sanitize", "fn/search", "fn/selectElementText", "fn/selector", "fn/setCookie", "fn/setCssVar", "fn/setNavigationVars", "fn/setProp", "fn/setProperty", "fn/shorten", "fn/shortenObj", "fn/shuffle", "fn/simpleHash", "fn/simpleHash1", "fn/simpleHash2", "fn/chrono", "fn/stat", "fn/string2ArrayBuffer", "fn/submit", "fn/substr", "fn/sum", "fn/timestamp", "fn/toCSV", "fn/toggleFullScreen", "fn/translate", "fn/treatAjaxArguments", "fn/trim", "fn/uniqString", "fn/unique", "fn/upload", "fn/warning"], function (require, exports, _addLoader_2, _compareValues_3, _deleteLoader_2, abort_1, abortURL_1, addColors_2, addInputs_2, addStyle_1, adjustHeight_1, adjustSize_3, adjustWidth_1, ajax_4, analyzeFunction_1, animateCss_1, arrayBuffer2String_1, arrayFromProp_1, autoExtend_1, baseName_3, br2nl_1, calendar_1, callback_3, camelize_1, camelToCss_1, canvasToImage_1, center_1, checkProps_1, checkPropsDetails_3, checkPropsOrDie_1, checkType_5, circularReplacer_2, clone_2, colorToHex_1, compare_1, compareConditions_3, copy_1, correctCase_2, count_1, crc32_1, createObject_4, cssExists_1, date_8, dateSQL_1, daysInMonth_1, deepPath_1, defaultAjaxAbortFunction_2, defaultAjaxErrorFunction_3, defaultAlertFunction_2, defaultConfirmFunction_1, defaultEndLoadingFunction_2, defaultErrorFunction_2, defaultHistoryFunction_2, defaultLinkFunction_2, defaultPostLinkFunction_2, defaultPreLinkFunction_2, defaultResizeFunction_2, defaultStartLoadingFunction_2, deleteProp_1, diffObj_1, dirName_2, download_1, downloadContent_2, each_28, eraseCookie_1, error_4, escapeDquotes_1, escapeRegExp_3, escapeSquotes_1, escapeTicks_1, escapeUrl_1, extend_7, extendOut_1, fdate_2, fdatetime_2, fieldValue_2, fileExt_2, filter_6, filterToConditions_3, findAll_1, fori_1, forir_1, format_1, formatBytes_1, formatDate_1, formatSize_1, formdata_2, fromXml_1, ftime_1, getAllTags_1, getAncestors_2, getAttributes_1, getBrowserName_1, getBrowserVersion_1, getCookie_1, getCssVar_2, getDay_1, getDeviceType_1, getEventData_1, getField_1, getFieldValues_1, getHtml_1, getHTMLOfSelection_2, getLoader_4, getPath_1, getProp_1, getProperty_4, getRequestId_2, getRow_3, getScrollBarSize_1, getText_1, getTimeoff_1, happy_1, hash_2, hex2rgb_1, history_1, html2text_2, imageToCanvas_2, imgToBase64_1, info_1, init_1, isActiveInterface_1, isArray_19, isBlob_2, isBoolean_1, isCanvas_2, isColor_1, isComment_1, isCp_3, isDate_8, isDesktopDevice_1, isDimension_1, isDom_5, isEmail_1, isEmpty_2, isEvent_1, isFocused_1, isFunction_12, isHostname_1, isInside_1, isInt_2, isIP_2, isIterable_5, isMobile_2, isMobileDevice_2, isNull_4, isNumber_10, isObject_18, isPercent_1, isPrimitive_1, isPromise_1, isPropSize_1, isSame_3, isSQLDate_1, isString_27, isSymbol_2, isTabletDevice_3, isURL_1, isValidDimension_2, isValidName_1, isValue_2, isVue_1, iterate_11, lightenDarkenHex_1, link_2, log_19, makeReactive_1, map_1, md5_4, money_1, move_1, multiorder_1, nl2br_1, numProperties_8, objectToFormData_2, order_1, outerHeight_1, outerWidth_1, percent_1, pickValue_1, post_2, postOut_1, printf_1, quotes2html_1, randomInt_2, randomString_1, removeAccents_4, removeEmpty_1, removeExtraSpaces_1, removeHtmlComments_2, removePrivateProp_2, removeTrailingChars_1, repeat_1, replaceAll_8, replaceSelection_1, resize_3, rgb2hex_1, riterate_1, roundDecimal_1, sanitize_1, search_6, selectElementText_1, selector_3, setCookie_1, setCssVar_1, setNavigationVars_2, setProp_1, setProperty_1, shorten_2, shortenObj_1, shuffle_1, simpleHash_2, simpleHash1_2, simpleHash2_2, chrono_1, stat_1, string2ArrayBuffer_1, submit_2, substr_16, sum_1, timestamp_1, toCSV_1, toggleFullScreen_1, translate_1, treatAjaxArguments_3, trim_2, uniqString_1, unique_2, upload_1, warning_2) {
|
|
6099
5821
|
"use strict";
|
|
6100
5822
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6101
5823
|
exports.bbn = void 0;
|
|
6102
|
-
|
|
5824
|
+
const bbn = {
|
|
6103
5825
|
version: "1.0.1",
|
|
6104
5826
|
opt: {
|
|
6105
5827
|
_cat: {}
|
|
@@ -6110,17 +5832,13 @@
|
|
|
6110
5832
|
* @param {String} st
|
|
6111
5833
|
* @returns {String}
|
|
6112
5834
|
*/
|
|
6113
|
-
_:
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
args[_i] = arguments[_i];
|
|
6117
|
-
}
|
|
6118
|
-
var st = args.shift();
|
|
6119
|
-
var res = bbn.lng[st] || st;
|
|
5835
|
+
_: (...args) => {
|
|
5836
|
+
let st = args.shift();
|
|
5837
|
+
let res = bbn.lng[st] || st;
|
|
6120
5838
|
if (args.length) {
|
|
6121
|
-
|
|
6122
|
-
return res.replace(/\%([d|s])/g,
|
|
6123
|
-
|
|
5839
|
+
let i = 0;
|
|
5840
|
+
return res.replace(/\%([d|s])/g, (match, type) => {
|
|
5841
|
+
let tmp = args[i++];
|
|
6124
5842
|
if (!tmp) {
|
|
6125
5843
|
tmp = type === 'd' ? 0 : '';
|
|
6126
5844
|
}
|
|
@@ -6130,7 +5848,7 @@
|
|
|
6130
5848
|
}
|
|
6131
5849
|
return res;
|
|
6132
5850
|
},
|
|
6133
|
-
$:
|
|
5851
|
+
$: (selector, context) => {
|
|
6134
5852
|
if (context && context.querySelectorAll) {
|
|
6135
5853
|
return context.querySelectorAll(selector);
|
|
6136
5854
|
}
|
|
@@ -6384,7 +6102,7 @@
|
|
|
6384
6102
|
happy: happy_1.happy,
|
|
6385
6103
|
hash: hash_2.hash,
|
|
6386
6104
|
hex2rgb: hex2rgb_1.hex2rgb,
|
|
6387
|
-
history:
|
|
6105
|
+
history: history_1.history,
|
|
6388
6106
|
html2text: html2text_2.html2text,
|
|
6389
6107
|
imageToCanvas: imageToCanvas_2.imageToCanvas,
|
|
6390
6108
|
imgToBase64: imgToBase64_1.imgToBase64,
|
|
@@ -6516,20 +6234,20 @@
|
|
|
6516
6234
|
return defines[name + '/index'];
|
|
6517
6235
|
}
|
|
6518
6236
|
else {
|
|
6519
|
-
|
|
6520
|
-
|
|
6237
|
+
const dependencies = ['exports'];
|
|
6238
|
+
const factory = (exports) => {
|
|
6521
6239
|
try {
|
|
6522
6240
|
Object.defineProperty(exports, "__cjsModule", { value: true });
|
|
6523
6241
|
Object.defineProperty(exports, "default", { value: require(name) });
|
|
6524
6242
|
}
|
|
6525
|
-
catch
|
|
6243
|
+
catch {
|
|
6526
6244
|
throw Error(['module "', name, '" not found.'].join(''));
|
|
6527
6245
|
}
|
|
6528
6246
|
};
|
|
6529
|
-
return { dependencies
|
|
6247
|
+
return { dependencies, factory };
|
|
6530
6248
|
}
|
|
6531
6249
|
}
|
|
6532
|
-
|
|
6250
|
+
const instances = {};
|
|
6533
6251
|
function resolve(name) {
|
|
6534
6252
|
if (instances[name]) {
|
|
6535
6253
|
return instances[name];
|
|
@@ -6537,14 +6255,14 @@
|
|
|
6537
6255
|
if (name === 'exports') {
|
|
6538
6256
|
return {};
|
|
6539
6257
|
}
|
|
6540
|
-
|
|
6258
|
+
const define = get_define(name);
|
|
6541
6259
|
if (typeof define.factory !== 'function') {
|
|
6542
6260
|
return define.factory;
|
|
6543
6261
|
}
|
|
6544
6262
|
instances[name] = {};
|
|
6545
|
-
|
|
6546
|
-
define.factory
|
|
6547
|
-
|
|
6263
|
+
const dependencies = define.dependencies.map(name => resolve(name));
|
|
6264
|
+
define.factory(...dependencies);
|
|
6265
|
+
const exports = dependencies[define.dependencies.indexOf('exports')];
|
|
6548
6266
|
instances[name] = (exports['__cjsModule']) ? exports.default : exports;
|
|
6549
6267
|
return instances[name];
|
|
6550
6268
|
}
|