dynamic-html-helpers 1.3.0 → 1.3.2
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/Bundle/htmlhelpers.min.js +15 -15
- package/Bundle/htmlhelpers.script.js +1176 -1046
- package/Bundle/htmlhelpers.script.min.js +15 -15
- package/README.md +5 -5
- package/index.js +6 -2
- package/package.json +3 -3
|
@@ -22,481 +22,516 @@ var HTMLHelpers = (() => {
|
|
|
22
22
|
// ../index.js
|
|
23
23
|
var index_exports = {};
|
|
24
24
|
__export(index_exports, {
|
|
25
|
-
$: () =>
|
|
25
|
+
$: () => mn,
|
|
26
26
|
$D: () => m,
|
|
27
27
|
logFactory: () => logFactory,
|
|
28
28
|
regexhelper: () => RegexpCreator_default,
|
|
29
|
-
|
|
29
|
+
splatModule: () => splatModule
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
// ../node_modules/jqx-es/Bundle/jqx.min.js
|
|
33
|
-
var { IS:
|
|
34
|
-
function
|
|
35
|
-
let { useSymbolicExtensions: e } = t, { shouldbeIsSingleObject: r, ISOneOf: n,
|
|
36
|
-
return
|
|
37
|
-
function
|
|
38
|
-
let
|
|
33
|
+
var { IS: u, maybe: A, $Wrap: pr, isNothing: it, xProxy: yr, addSymbolicExtensions: br } = st({ useSymbolicExtensions: false });
|
|
34
|
+
function st(t = {}) {
|
|
35
|
+
let { useSymbolicExtensions: e } = t, { shouldbeIsSingleObject: r, ISOneOf: n, isExcept: i, verifyNothingness: a, xProxy: f2, determineType: S, addSymbolicExtensions: y2, maybe: x2, $Wrap: d } = at(b2, e);
|
|
36
|
+
return e && y2(), { IS: b2, maybe: x2, $Wrap: d, isNothing: a, xProxy: f2, addSymbolicExtensions: y2 };
|
|
37
|
+
function b2(m2, ...h) {
|
|
38
|
+
let g2 = typeof m2 == "symbol" ? Symbol.isSymbol : m2;
|
|
39
39
|
switch (true) {
|
|
40
|
-
case !!
|
|
41
|
-
return r(
|
|
40
|
+
case !!x2({ trial: (c) => "isTypes" in (h?.[0] ?? {}) }):
|
|
41
|
+
return r(m2, h[0]);
|
|
42
42
|
default:
|
|
43
|
-
return
|
|
43
|
+
return h.length > 1 ? n(g2, ...h) : S(m2, ...h);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
let { SymbolAndCustomProxyFactory: r, maybeFactory: n, WrapAnyFactory:
|
|
49
|
-
return Object.freeze({ shouldbeIsSingleObject:
|
|
50
|
-
function
|
|
51
|
-
return
|
|
47
|
+
function at(t, e) {
|
|
48
|
+
let { SymbolAndCustomProxyFactory: r, maybeFactory: n, WrapAnyFactory: i, verifyNothingness: a, determineType: f2 } = lt(t, b2), { xProxy: S, addSymbolicExtensions: y2 } = r(t, b2, e), [x2, d] = [n(), i(t, b2)];
|
|
49
|
+
return Object.freeze({ shouldbeIsSingleObject: m2, ISOneOf: h, isExcept: c, verifyNothingness: a, xProxy: S, determineType: f2, addSymbolicExtensions: y2, maybe: x2, $Wrap: d });
|
|
50
|
+
function b2(o) {
|
|
51
|
+
return o?.[Symbol.proxy] ?? t(o);
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function m2(o, s) {
|
|
54
54
|
switch (true) {
|
|
55
|
-
case "defaultValue" in
|
|
56
|
-
return g2(
|
|
57
|
-
case "notTypes" in
|
|
58
|
-
return c(
|
|
55
|
+
case "defaultValue" in s:
|
|
56
|
+
return g2(o, s);
|
|
57
|
+
case "notTypes" in s:
|
|
58
|
+
return c(o, s);
|
|
59
59
|
default:
|
|
60
|
-
return t(
|
|
60
|
+
return t(o, ...[s.isTypes].flat());
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return
|
|
63
|
+
function h(o, ...s) {
|
|
64
|
+
return s.some((l) => t(o, l));
|
|
65
65
|
}
|
|
66
|
-
function g2(
|
|
67
|
-
return
|
|
66
|
+
function g2(o, { defaultValue: s, isTypes: l = [void 0], notTypes: p } = {}) {
|
|
67
|
+
return l = l?.constructor !== Array ? [l] : l, p = p && p?.constructor !== Array ? [p] : [], p.length < 1 ? t(o, ...l) ? o : s : c(o, { isTypes: l, notTypes: p }) ? o : s;
|
|
68
68
|
}
|
|
69
|
-
function c(
|
|
70
|
-
return
|
|
69
|
+
function c(o, { isTypes: s = [void 0], notTypes: l = [void 0] } = {}) {
|
|
70
|
+
return s = s?.constructor !== Array ? [s] : s, l = l?.constructor !== Array ? [l] : l, t(o, ...s) && !t(o, ...l);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function lt() {
|
|
74
74
|
let t = { IS: "toa.is", TYPE: "toa.type", IS_SYMBOL: "toa.isASymbol", PROXY: "toa.proxy" }, e = { NAN: "NaN", INFINITY: "Infinity", BOOLEAN: "Boolean", OBJECT: "Object", PROXY_PREFIX: "Proxy (" };
|
|
75
|
-
return Object.freeze({ SymbolAndCustomProxyFactory: n, maybeFactory: g2, WrapAnyFactory:
|
|
76
|
-
function r(
|
|
75
|
+
return Object.freeze({ SymbolAndCustomProxyFactory: n, maybeFactory: g2, WrapAnyFactory: h, verifyNothingness: c, determineType: y2 });
|
|
76
|
+
function r(o, s) {
|
|
77
77
|
Symbol.is || (Symbol.is = Symbol.for(t.IS), Symbol.type = Symbol.for(t.TYPE), Object.defineProperties(Object.prototype, { [Symbol.type]: { get() {
|
|
78
|
-
return
|
|
79
|
-
}, enumerable: false, configurable: false }, [Symbol.is]: { value: function(...
|
|
80
|
-
return
|
|
81
|
-
}, enumerable: false, configurable: false } }), Object.defineProperties(Object, { [Symbol.type]: { value(
|
|
82
|
-
return
|
|
83
|
-
}, enumerable: false, configurable: false }, [Symbol.is]: { value: function(
|
|
84
|
-
return
|
|
78
|
+
return s(this);
|
|
79
|
+
}, enumerable: false, configurable: false }, [Symbol.is]: { value: function(...l) {
|
|
80
|
+
return o(this, ...l);
|
|
81
|
+
}, enumerable: false, configurable: false } }), Object.defineProperties(Object, { [Symbol.type]: { value(l) {
|
|
82
|
+
return s(l);
|
|
83
|
+
}, enumerable: false, configurable: false }, [Symbol.is]: { value: function(l, ...p) {
|
|
84
|
+
return o(l, ...p);
|
|
85
85
|
}, enumerable: false, configurable: false } }));
|
|
86
86
|
}
|
|
87
|
-
function n(
|
|
88
|
-
return Symbol.isSymbol || (Symbol.isSymbol = Symbol.for(t.IS_SYMBOL)), { xProxy: f2(), addSymbolicExtensions: () => r(
|
|
87
|
+
function n(o, s, l) {
|
|
88
|
+
return Symbol.isSymbol || (Symbol.isSymbol = Symbol.for(t.IS_SYMBOL)), { xProxy: f2(), addSymbolicExtensions: () => r(o, s) };
|
|
89
89
|
}
|
|
90
|
-
function o
|
|
91
|
-
return Object.getPrototypeOf(
|
|
90
|
+
function i(o) {
|
|
91
|
+
return (it(o, true) ? { name: "unknown" } : Object.getPrototypeOf(o)?.constructor).name;
|
|
92
92
|
}
|
|
93
|
-
function s
|
|
94
|
-
return Proxy = new
|
|
95
|
-
let
|
|
96
|
-
return
|
|
93
|
+
function a(o, s) {
|
|
94
|
+
return Proxy = new o(o, { construct(l, p) {
|
|
95
|
+
let v2 = new l(...p);
|
|
96
|
+
return Object.defineProperty(v2, s, { value: `${e.PROXY_PREFIX}${i(p[0])})` }), v2;
|
|
97
97
|
} }), Proxy;
|
|
98
98
|
}
|
|
99
99
|
function f2() {
|
|
100
100
|
Symbol.proxy || (Symbol.proxy = Symbol.for(t.PROXY));
|
|
101
|
-
let
|
|
101
|
+
let o = Proxy;
|
|
102
102
|
return { native() {
|
|
103
|
-
Proxy =
|
|
103
|
+
Proxy = o;
|
|
104
104
|
}, custom() {
|
|
105
|
-
Proxy =
|
|
105
|
+
Proxy = a(o, Symbol.proxy);
|
|
106
106
|
} };
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
let
|
|
110
|
-
return { noInput:
|
|
111
|
-
}
|
|
112
|
-
function
|
|
113
|
-
let { noInput:
|
|
114
|
-
switch (
|
|
115
|
-
case
|
|
116
|
-
return String(
|
|
117
|
-
case (
|
|
118
|
-
return
|
|
119
|
-
case
|
|
120
|
-
return
|
|
121
|
-
case
|
|
122
|
-
return
|
|
123
|
-
case
|
|
124
|
-
return
|
|
125
|
-
case
|
|
126
|
-
return
|
|
108
|
+
function S(o, ...s) {
|
|
109
|
+
let l = s.length < 1, p = o == null;
|
|
110
|
+
return { noInput: p, noShouldbe: l, compareTo: !l && s[0], inputCTOR: !p && (o?.constructor || Object.getPrototypeOf(o)?.constructor), isNaN: Number.isNaN(o) || A({ trial: (v2) => String(o) === e.NAN }), isInfinity: A({ trial: (v2) => String(o) }) === e.INFINITY, shouldBeFirstElementIsNothing: !l && c(s[0]) };
|
|
111
|
+
}
|
|
112
|
+
function y2(o, ...s) {
|
|
113
|
+
let { noInput: l, noShouldbe: p, compareTo: v2, inputCTOR: F, isNaN: me2, isInfinity: ge2, shouldBeFirstElementIsNothing: pe2 } = S(o, ...s);
|
|
114
|
+
switch (s = s.length && s[0], true) {
|
|
115
|
+
case pe2:
|
|
116
|
+
return String(o) === String(v2);
|
|
117
|
+
case (o?.[Symbol.proxy] && p):
|
|
118
|
+
return o[Symbol.proxy];
|
|
119
|
+
case me2:
|
|
120
|
+
return p ? e.NAN : String(v2) === String(o);
|
|
121
|
+
case ge2:
|
|
122
|
+
return p ? e.INFINITY : String(v2) === String(o);
|
|
123
|
+
case l:
|
|
124
|
+
return p ? String(o) : String(v2) === String(o);
|
|
125
|
+
case F === Boolean:
|
|
126
|
+
return p ? e.BOOLEAN : F === s;
|
|
127
127
|
default:
|
|
128
|
-
return d(
|
|
128
|
+
return d(o, s, p, x2(o, F));
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function x2(o, s) {
|
|
132
132
|
switch (true) {
|
|
133
|
-
case
|
|
133
|
+
case o === 0:
|
|
134
134
|
return Number;
|
|
135
|
-
case
|
|
135
|
+
case o === "":
|
|
136
136
|
return String;
|
|
137
|
-
case !
|
|
138
|
-
return { name: String(
|
|
137
|
+
case !o:
|
|
138
|
+
return { name: String(o) };
|
|
139
139
|
default:
|
|
140
|
-
return
|
|
140
|
+
return s;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
function d(
|
|
143
|
+
function d(o, s, l, p) {
|
|
144
144
|
switch (true) {
|
|
145
|
-
case (!
|
|
145
|
+
case (!l && s === o || o?.[Symbol.proxy] && s === Proxy):
|
|
146
146
|
return true;
|
|
147
|
-
case String(
|
|
148
|
-
return String(
|
|
149
|
-
case (
|
|
150
|
-
return String(
|
|
147
|
+
case String(s) === e.NAN:
|
|
148
|
+
return String(o) === e.NAN;
|
|
149
|
+
case (o?.[Symbol.toStringTag] && typeof s == "string"):
|
|
150
|
+
return String(s) === o[Symbol.toStringTag];
|
|
151
151
|
default:
|
|
152
|
-
return
|
|
152
|
+
return s ? m2(o, s, p) : b2(o, p);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
return (
|
|
155
|
+
function b2(o, s) {
|
|
156
|
+
return (o?.[Symbol.toStringTag] ?? o?.prototype?.[Symbol.toStringTag]) || s?.name || String(s);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
return
|
|
158
|
+
function m2(o, s, l) {
|
|
159
|
+
return A({ trial: (p) => o instanceof s }) || s === l || s === Object.getPrototypeOf(l) || `${s?.name}` === l?.name;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
return function(
|
|
163
|
-
let
|
|
164
|
-
return
|
|
165
|
-
}, is(...
|
|
166
|
-
return
|
|
161
|
+
function h(o, s) {
|
|
162
|
+
return function(l) {
|
|
163
|
+
let p = { get value() {
|
|
164
|
+
return l;
|
|
165
|
+
}, is(...v2) {
|
|
166
|
+
return o(l, ...v2);
|
|
167
167
|
}, get type() {
|
|
168
|
-
return
|
|
168
|
+
return s(l);
|
|
169
169
|
} };
|
|
170
|
-
return Object[Symbol.type] && Object.defineProperties(
|
|
171
|
-
return
|
|
172
|
-
} }, [Symbol.is]: { value(...
|
|
173
|
-
return
|
|
174
|
-
} } }), Object.freeze(
|
|
170
|
+
return Object[Symbol.type] && Object.defineProperties(p, { [Symbol.type]: { get() {
|
|
171
|
+
return s(l);
|
|
172
|
+
} }, [Symbol.is]: { value(...v2) {
|
|
173
|
+
return o(l, ...v2);
|
|
174
|
+
} } }), Object.freeze(p);
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
function g2() {
|
|
178
|
-
let
|
|
178
|
+
let o = (s) => {
|
|
179
179
|
};
|
|
180
|
-
return function({ trial:
|
|
180
|
+
return function({ trial: s, whenError: l = o } = {}) {
|
|
181
181
|
try {
|
|
182
|
-
return
|
|
183
|
-
} catch (
|
|
184
|
-
return
|
|
182
|
+
return s();
|
|
183
|
+
} catch (p) {
|
|
184
|
+
return l(p);
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
function c(
|
|
189
|
-
let
|
|
190
|
-
return
|
|
188
|
+
function c(o, s = false) {
|
|
189
|
+
let l = o == null;
|
|
190
|
+
return l = s ? l || u(o, 1 / 0) || u(o, NaN) : l, l;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
var
|
|
194
|
-
var
|
|
195
|
-
var
|
|
196
|
-
function
|
|
193
|
+
var He = ft();
|
|
194
|
+
var R = ut();
|
|
195
|
+
var J = ct();
|
|
196
|
+
function ut() {
|
|
197
197
|
return { html: Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")), svg: Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(",")) };
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function ct() {
|
|
200
200
|
return { a: true, area: true, audio: false, br: true, base: true, body: true, button: true, canvas: true, comment: true, dl: true, data: true, datalist: true, div: true, em: true, embed: false, fieldset: true, font: true, footer: true, form: false, hr: true, head: true, header: true, output: true, iframe: false, frameset: false, img: true, input: true, li: true, label: true, legend: true, link: true, map: true, mark: true, menu: true, media: true, meta: true, nav: true, meter: true, ol: true, object: false, optgroup: true, option: true, p: true, param: true, picture: true, pre: true, progress: false, quote: true, script: false, select: true, source: true, span: true, style: true, caption: true, td: true, col: true, table: true, tr: true, template: false, textarea: true, time: true, title: true, track: true, details: true, ul: true, video: true, del: true, ins: true, slot: true, blockquote: true, svg: true, dialog: true, summary: true, main: true, address: true, colgroup: true, tbody: true, tfoot: true, thead: true, th: true, dd: true, dt: true, figcaption: true, figure: true, i: true, b: true, code: true, h1: true, h2: true, h3: true, h4: true, abbr: true, bdo: true, dfn: true, kbd: true, q: true, rb: true, rp: true, rt: true, ruby: true, s: true, strike: true, samp: true, small: true, strong: true, sup: true, sub: true, u: true, var: true, wbr: true, nobr: true, tt: true, noscript: true };
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function ft() {
|
|
203
203
|
return ["::backdrop{background-color:grey;opacity:0.2;}", `#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url("data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}`, "@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}", "@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}", "@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}", "@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"];
|
|
204
204
|
}
|
|
205
|
-
var
|
|
206
|
-
var
|
|
207
|
-
function
|
|
205
|
+
var Me = { html: "innerHTML", text: "textContent", class: "className" };
|
|
206
|
+
var U = dt();
|
|
207
|
+
function dt() {
|
|
208
208
|
let t = { get(e, r) {
|
|
209
209
|
let n = String(r)?.toLowerCase();
|
|
210
210
|
switch (true) {
|
|
211
211
|
case n in e:
|
|
212
212
|
return e[n];
|
|
213
|
-
case
|
|
214
|
-
return
|
|
213
|
+
case vt(n):
|
|
214
|
+
return Ie(e, n, r);
|
|
215
215
|
default:
|
|
216
|
-
return
|
|
216
|
+
return Ie(e, n, r, true);
|
|
217
217
|
}
|
|
218
218
|
}, enumerable: false, configurable: false };
|
|
219
219
|
return new Proxy({}, t);
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function Ie(t, e, r, n = false) {
|
|
222
222
|
return Object.defineProperty(t, e, { get() {
|
|
223
|
-
return n ? (
|
|
223
|
+
return n ? (i) => St(r) : Et(e);
|
|
224
224
|
} }), t[e];
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
return e = e?.isJQx && e.first() || e,
|
|
226
|
+
function mt(t, e, r) {
|
|
227
|
+
return e = e?.isJQx && e.first() || e, A({ trial: (n) => xt(e) ? t.append(e) : Re(e) ? t.insertAdjacentHTML("beforeend", e) : t.append(e), whenError: (n) => console.info(`${r} (for root ${t}) not created, reason
|
|
228
228
|
`, n) });
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
let n =
|
|
232
|
-
return r?.forEach((
|
|
230
|
+
function gt(t, e, ...r) {
|
|
231
|
+
let n = pt(e, t);
|
|
232
|
+
return r?.forEach((i) => mt(n, i, t)), n;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
switch (t =
|
|
236
|
-
case
|
|
237
|
-
return
|
|
238
|
-
case
|
|
239
|
-
return
|
|
234
|
+
function pt(t, e) {
|
|
235
|
+
switch (t = ye(e) ? ht(t) : t?.isJQx ? t.first() : t, true) {
|
|
236
|
+
case u(t, String):
|
|
237
|
+
return k(e, Re(t, e) ? { html: t } : { text: t });
|
|
238
|
+
case u(t, Node):
|
|
239
|
+
return bt(e, t);
|
|
240
240
|
default:
|
|
241
|
-
return
|
|
241
|
+
return k(e, t);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function yt(t) {
|
|
245
245
|
return delete t.data, Object.keys(t).length < 1 || Object.keys(t).forEach((e) => {
|
|
246
246
|
let r = e.toLowerCase();
|
|
247
|
-
r in
|
|
247
|
+
r in Me && (t[Me[r]] = t[e], delete t[e]);
|
|
248
248
|
}), t;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
let r =
|
|
250
|
+
function bt(t, e) {
|
|
251
|
+
let r = k(t);
|
|
252
252
|
return r.append(e), r;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
e =
|
|
256
|
-
let r = Object.entries(e.data ?? {}), n = Object.assign(
|
|
257
|
-
return r.length && r.forEach(([
|
|
254
|
+
function k(t, e = {}) {
|
|
255
|
+
e = De(e, {});
|
|
256
|
+
let r = Object.entries(e.data ?? {}), n = Object.assign(ye(t) ? new Comment(e?.text) : document.createElement(t), yt(e));
|
|
257
|
+
return r.length && r.forEach(([i, a]) => n.dataset[i] = String(a)), n;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
260
|
-
return e ?
|
|
259
|
+
function De(t, e) {
|
|
260
|
+
return e ? u(t, { isTypes: Object, notTypes: [Array, null, NaN, Proxy], defaultValue: e }) : u(t, { isTypes: Object, notTypes: [Array, null, NaN, Proxy] });
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
return
|
|
262
|
+
function ht(t) {
|
|
263
|
+
return De(t) ? t?.text ?? t?.textContent ?? "" : String(t);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
return
|
|
265
|
+
function St(t) {
|
|
266
|
+
return k("b", { style: "color:red", text: `'${t}' is not a valid HTML-tag` });
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
return !
|
|
268
|
+
function Re(t, e) {
|
|
269
|
+
return !ye(e) && u(t, String) && /<.*>|&[#|0-9a-z]+[^;];/i.test(t);
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function xt(t) {
|
|
272
272
|
return t?.constructor === Comment || t?.constructor === CharacterData;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function ye(t) {
|
|
275
275
|
return t?.constructor === Comment || /comment/i.test(t);
|
|
276
276
|
}
|
|
277
|
+
function vt(t) {
|
|
278
|
+
return !u(k(t), HTMLUnknownElement);
|
|
279
|
+
}
|
|
277
280
|
function Et(t) {
|
|
278
|
-
return
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
if (t({ trial: (w2) => "isTypes" in (m2?.[0] ?? {}) })) {
|
|
290
|
-
let w2 = m2[0];
|
|
291
|
-
return "defaultValue" in w2 ? S(l, w2) : "notTypes" in w2 ? g2(l, w2) : n(l, ...[w2.isTypes].flat());
|
|
292
|
-
}
|
|
293
|
-
let x2 = typeof l == "symbol" ? Symbol.isSymbol : l;
|
|
294
|
-
return m2.length > 1 ? E2(x2, ...m2) : s(l, ...m2);
|
|
295
|
-
}
|
|
296
|
-
function o(l) {
|
|
297
|
-
return l?.[Symbol.proxy] ?? n(l);
|
|
298
|
-
}
|
|
299
|
-
function s(l, ...m2) {
|
|
300
|
-
let { noInput: x2, noShouldbe: w2, compareTo: F, inputCTOR: D2, isNaN: ye2, isInfinity: be2, shouldBeFirstElementIsNothing: he2 } = v2(l, ...m2);
|
|
301
|
-
switch (m2 = m2.length && m2[0], true) {
|
|
302
|
-
case he2:
|
|
303
|
-
return String(l) === String(F);
|
|
304
|
-
case (l?.[Symbol.proxy] && w2):
|
|
305
|
-
return l[Symbol.proxy];
|
|
306
|
-
case ye2:
|
|
307
|
-
return w2 ? "NaN" : t({ trial: (Se2) => String(F) }) === String(l);
|
|
308
|
-
case be2:
|
|
309
|
-
return w2 ? "Infinity" : t({ trial: (Se2) => String(F) }) === String(l);
|
|
310
|
-
case x2:
|
|
311
|
-
return w2 ? String(l) : String(F) === String(l);
|
|
312
|
-
case D2 === Boolean:
|
|
313
|
-
return m2 ? D2 === m2 : "Boolean";
|
|
281
|
+
return (e, ...r) => gt(t, e, ...r);
|
|
282
|
+
}
|
|
283
|
+
var { IS: j, maybe: be, $Wrap: Er, isNothing: wt, xProxy: wr, addSymbolicExtensions: Tr } = Tt({ useSymbolicExtensions: false });
|
|
284
|
+
function Tt(t = {}) {
|
|
285
|
+
let { useSymbolicExtensions: e } = t, { shouldbeIsSingleObject: r, ISOneOf: n, isExcept: i, verifyNothingness: a, xProxy: f2, determineType: S, addSymbolicExtensions: y2, maybe: x2, $Wrap: d } = Lt(b2, e);
|
|
286
|
+
return e && y2(), { IS: b2, maybe: x2, $Wrap: d, isNothing: a, xProxy: f2, addSymbolicExtensions: y2 };
|
|
287
|
+
function b2(m2, ...h) {
|
|
288
|
+
let g2 = typeof m2 == "symbol" ? Symbol.isSymbol : m2;
|
|
289
|
+
switch (true) {
|
|
290
|
+
case !!x2({ trial: (c) => "isTypes" in (h?.[0] ?? {}) }):
|
|
291
|
+
return r(m2, h[0]);
|
|
314
292
|
default:
|
|
315
|
-
return
|
|
293
|
+
return h.length > 1 ? n(g2, ...h) : S(m2, ...h);
|
|
316
294
|
}
|
|
317
295
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
return
|
|
296
|
+
}
|
|
297
|
+
function Lt(t, e) {
|
|
298
|
+
let { SymbolAndCustomProxyFactory: r, maybeFactory: n, WrapAnyFactory: i, verifyNothingness: a, determineType: f2 } = Ct(t, b2), { xProxy: S, addSymbolicExtensions: y2 } = r(t, b2, e), [x2, d] = [n(), i(t, b2)];
|
|
299
|
+
return Object.freeze({ shouldbeIsSingleObject: m2, ISOneOf: h, isExcept: c, verifyNothingness: a, xProxy: S, determineType: f2, addSymbolicExtensions: y2, maybe: x2, $Wrap: d });
|
|
300
|
+
function b2(o) {
|
|
301
|
+
return o?.[Symbol.proxy] ?? t(o);
|
|
324
302
|
}
|
|
325
|
-
function
|
|
303
|
+
function m2(o, s) {
|
|
326
304
|
switch (true) {
|
|
327
|
-
case
|
|
328
|
-
return
|
|
329
|
-
case
|
|
330
|
-
return
|
|
331
|
-
case (l?.[Symbol.toStringTag] && n(m2, String)):
|
|
332
|
-
return String(m2) === l[Symbol.toStringTag];
|
|
305
|
+
case "defaultValue" in s:
|
|
306
|
+
return g2(o, s);
|
|
307
|
+
case "notTypes" in s:
|
|
308
|
+
return c(o, s);
|
|
333
309
|
default:
|
|
334
|
-
return
|
|
310
|
+
return t(o, ...[s.isTypes].flat());
|
|
335
311
|
}
|
|
336
312
|
}
|
|
337
|
-
function
|
|
338
|
-
return
|
|
339
|
-
}
|
|
340
|
-
function d(l, m2 = false) {
|
|
341
|
-
let x2 = l == null;
|
|
342
|
-
return x2 = m2 ? x2 || n(l, 1 / 0) || n(l, NaN) : x2, x2;
|
|
343
|
-
}
|
|
344
|
-
function h() {
|
|
345
|
-
let l = (m2, x2) => m2?.constructor === Function ? m2(x2) : void 0;
|
|
346
|
-
return function({ trial: m2, whenError: x2 = () => {
|
|
347
|
-
} } = {}) {
|
|
348
|
-
try {
|
|
349
|
-
return l(m2);
|
|
350
|
-
} catch (w2) {
|
|
351
|
-
return l(x2, w2);
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
function p() {
|
|
356
|
-
return function(l) {
|
|
357
|
-
return Object.freeze({ get value() {
|
|
358
|
-
return l;
|
|
359
|
-
}, get [Symbol.type]() {
|
|
360
|
-
return o(l);
|
|
361
|
-
}, get type() {
|
|
362
|
-
return o(l);
|
|
363
|
-
}, [Symbol.is](...m2) {
|
|
364
|
-
return n(l, ...m2);
|
|
365
|
-
}, is(...m2) {
|
|
366
|
-
return n(l, ...m2);
|
|
367
|
-
} });
|
|
368
|
-
};
|
|
313
|
+
function h(o, ...s) {
|
|
314
|
+
return s.some((l) => t(o, l));
|
|
369
315
|
}
|
|
370
|
-
function
|
|
371
|
-
return
|
|
316
|
+
function g2(o, { defaultValue: s, isTypes: l = [void 0], notTypes: p } = {}) {
|
|
317
|
+
return l = l?.constructor !== Array ? [l] : l, p = p && p?.constructor !== Array ? [p] : [], p.length < 1 ? t(o, ...l) ? o : s : c(o, { isTypes: l, notTypes: p }) ? o : s;
|
|
372
318
|
}
|
|
373
|
-
function
|
|
374
|
-
return
|
|
319
|
+
function c(o, { isTypes: s = [void 0], notTypes: l = [void 0] } = {}) {
|
|
320
|
+
return s = s?.constructor !== Array ? [s] : s, l = l?.constructor !== Array ? [l] : l, t(o, ...s) && !t(o, ...l);
|
|
375
321
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
322
|
+
}
|
|
323
|
+
function Ct() {
|
|
324
|
+
let t = { IS: "toa.is", TYPE: "toa.type", IS_SYMBOL: "toa.isASymbol", PROXY: "toa.proxy" }, e = { NAN: "NaN", INFINITY: "Infinity", BOOLEAN: "Boolean", OBJECT: "Object", PROXY_PREFIX: "Proxy (" };
|
|
325
|
+
return Object.freeze({ SymbolAndCustomProxyFactory: n, maybeFactory: g2, WrapAnyFactory: h, verifyNothingness: c, determineType: y2 });
|
|
326
|
+
function r(o, s) {
|
|
327
|
+
Symbol.is || (Symbol.is = Symbol.for(t.IS), Symbol.type = Symbol.for(t.TYPE), Object.defineProperties(Object.prototype, { [Symbol.type]: { get() {
|
|
328
|
+
return s(this);
|
|
379
329
|
}, enumerable: false, configurable: false }, [Symbol.is]: { value: function(...l) {
|
|
380
|
-
return
|
|
330
|
+
return o(this, ...l);
|
|
381
331
|
}, enumerable: false, configurable: false } }), Object.defineProperties(Object, { [Symbol.type]: { value(l) {
|
|
382
|
-
return
|
|
383
|
-
}, enumerable: false, configurable: false }, [Symbol.is]: { value: function(l, ...
|
|
384
|
-
return
|
|
332
|
+
return s(l);
|
|
333
|
+
}, enumerable: false, configurable: false }, [Symbol.is]: { value: function(l, ...p) {
|
|
334
|
+
return o(l, ...p);
|
|
385
335
|
}, enumerable: false, configurable: false } }));
|
|
386
336
|
}
|
|
387
|
-
function
|
|
388
|
-
|
|
389
|
-
return m2.slice(m2.indexOf("ion") + 3, m2.indexOf("(")).trim();
|
|
337
|
+
function n(o, s, l) {
|
|
338
|
+
return Symbol.isSymbol || (Symbol.isSymbol = Symbol.for(t.IS_SYMBOL)), { xProxy: f2(), addSymbolicExtensions: () => r(o, s) };
|
|
390
339
|
}
|
|
391
|
-
function
|
|
392
|
-
|
|
393
|
-
return l.set = (x2, w2, F) => w2 === Symbol.proxy ? x2[w2] = F : m2(x2, w2, F), l;
|
|
340
|
+
function i(o) {
|
|
341
|
+
return (wt(o, true) ? { name: "unknown" } : Object.getPrototypeOf(o)?.constructor).name;
|
|
394
342
|
}
|
|
395
|
-
function
|
|
396
|
-
|
|
343
|
+
function a(o, s) {
|
|
344
|
+
return Proxy = new o(o, { construct(l, p) {
|
|
345
|
+
let v2 = new l(...p);
|
|
346
|
+
return Object.defineProperty(v2, s, { value: `${e.PROXY_PREFIX}${i(p[0])})` }), v2;
|
|
347
|
+
} }), Proxy;
|
|
348
|
+
}
|
|
349
|
+
function f2() {
|
|
350
|
+
Symbol.proxy || (Symbol.proxy = Symbol.for(t.PROXY));
|
|
351
|
+
let o = Proxy;
|
|
397
352
|
return { native() {
|
|
398
|
-
Proxy =
|
|
353
|
+
Proxy = o;
|
|
399
354
|
}, custom() {
|
|
400
|
-
Proxy =
|
|
401
|
-
for (let F of x2) F.set && (F = u(F));
|
|
402
|
-
let w2 = new m2(...x2);
|
|
403
|
-
return w2[Symbol.proxy] = `Proxy (${i(x2[0])})`, w2;
|
|
404
|
-
} });
|
|
355
|
+
Proxy = a(o, Symbol.proxy);
|
|
405
356
|
} };
|
|
406
357
|
}
|
|
358
|
+
function S(o, ...s) {
|
|
359
|
+
let l = s.length < 1, p = o == null;
|
|
360
|
+
return { noInput: p, noShouldbe: l, compareTo: !l && s[0], inputCTOR: !p && (o?.constructor || Object.getPrototypeOf(o)?.constructor), isNaN: Number.isNaN(o) || be({ trial: (v2) => String(o) === e.NAN }), isInfinity: be({ trial: (v2) => String(o) }) === e.INFINITY, shouldBeFirstElementIsNothing: !l && c(s[0]) };
|
|
361
|
+
}
|
|
362
|
+
function y2(o, ...s) {
|
|
363
|
+
let { noInput: l, noShouldbe: p, compareTo: v2, inputCTOR: F, isNaN: me2, isInfinity: ge2, shouldBeFirstElementIsNothing: pe2 } = S(o, ...s);
|
|
364
|
+
switch (s = s.length && s[0], true) {
|
|
365
|
+
case pe2:
|
|
366
|
+
return String(o) === String(v2);
|
|
367
|
+
case (o?.[Symbol.proxy] && p):
|
|
368
|
+
return o[Symbol.proxy];
|
|
369
|
+
case me2:
|
|
370
|
+
return p ? e.NAN : String(v2) === String(o);
|
|
371
|
+
case ge2:
|
|
372
|
+
return p ? e.INFINITY : String(v2) === String(o);
|
|
373
|
+
case l:
|
|
374
|
+
return p ? String(o) : String(v2) === String(o);
|
|
375
|
+
case F === Boolean:
|
|
376
|
+
return p ? e.BOOLEAN : F === s;
|
|
377
|
+
default:
|
|
378
|
+
return d(o, s, p, x2(o, F));
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function x2(o, s) {
|
|
382
|
+
switch (true) {
|
|
383
|
+
case o === 0:
|
|
384
|
+
return Number;
|
|
385
|
+
case o === "":
|
|
386
|
+
return String;
|
|
387
|
+
case !o:
|
|
388
|
+
return { name: String(o) };
|
|
389
|
+
default:
|
|
390
|
+
return s;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
function d(o, s, l, p) {
|
|
394
|
+
switch (true) {
|
|
395
|
+
case (!l && s === o || o?.[Symbol.proxy] && s === Proxy):
|
|
396
|
+
return true;
|
|
397
|
+
case String(s) === e.NAN:
|
|
398
|
+
return String(o) === e.NAN;
|
|
399
|
+
case (o?.[Symbol.toStringTag] && typeof s == "string"):
|
|
400
|
+
return String(s) === o[Symbol.toStringTag];
|
|
401
|
+
default:
|
|
402
|
+
return s ? m2(o, s, p) : b2(o, p);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function b2(o, s) {
|
|
406
|
+
return (o?.[Symbol.toStringTag] ?? o?.prototype?.[Symbol.toStringTag]) || s?.name || String(s);
|
|
407
|
+
}
|
|
408
|
+
function m2(o, s, l) {
|
|
409
|
+
return be({ trial: (p) => o instanceof s }) || s === l || s === Object.getPrototypeOf(l) || `${s?.name}` === l?.name;
|
|
410
|
+
}
|
|
411
|
+
function h(o, s) {
|
|
412
|
+
return function(l) {
|
|
413
|
+
let p = { get value() {
|
|
414
|
+
return l;
|
|
415
|
+
}, is(...v2) {
|
|
416
|
+
return o(l, ...v2);
|
|
417
|
+
}, get type() {
|
|
418
|
+
return s(l);
|
|
419
|
+
} };
|
|
420
|
+
return Object[Symbol.type] && Object.defineProperties(p, { [Symbol.type]: { get() {
|
|
421
|
+
return s(l);
|
|
422
|
+
} }, [Symbol.is]: { value(...v2) {
|
|
423
|
+
return o(l, ...v2);
|
|
424
|
+
} } }), Object.freeze(p);
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
function g2() {
|
|
428
|
+
let o = (s) => {
|
|
429
|
+
};
|
|
430
|
+
return function({ trial: s, whenError: l = o } = {}) {
|
|
431
|
+
try {
|
|
432
|
+
return s();
|
|
433
|
+
} catch (p) {
|
|
434
|
+
return l(p);
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
function c(o, s = false) {
|
|
439
|
+
let l = o == null;
|
|
440
|
+
return l = s ? l || j(o, 1 / 0) || j(o, NaN) : l, l;
|
|
441
|
+
}
|
|
407
442
|
}
|
|
408
|
-
var
|
|
409
|
-
function
|
|
410
|
-
let { tryParseAtOrNestedRules: r, ruleExists: n, checkParams:
|
|
411
|
-
function
|
|
443
|
+
var Q = Nt;
|
|
444
|
+
function Nt({ styleSheet: t, createWithId: e } = {}) {
|
|
445
|
+
let { tryParseAtOrNestedRules: r, ruleExists: n, checkParams: i, sheet: a, removeRules: f2, consider: S, currentSheetID: y2 } = Ft({ styleSheet: t, createWithId: e });
|
|
446
|
+
function x2(g2, c) {
|
|
412
447
|
if (g2 && c.removeProperties) {
|
|
413
|
-
Object.keys(c.removeProperties).forEach((
|
|
448
|
+
Object.keys(c.removeProperties).forEach((o) => g2.style.removeProperty(je(o)));
|
|
414
449
|
return;
|
|
415
450
|
}
|
|
416
|
-
Object.entries(c).forEach(([
|
|
417
|
-
|
|
418
|
-
let
|
|
419
|
-
if (/!important/.test(
|
|
420
|
-
|
|
451
|
+
Object.entries(c).forEach(([o, s]) => {
|
|
452
|
+
o = je(o.trim()), s = s.trim();
|
|
453
|
+
let l;
|
|
454
|
+
if (/!important/.test(s) && (s = s.slice(0, s.indexOf("!important")).trim(), l = "important"), !CSS.supports(o, s)) return console.error(`StylingFactory ${y2} error: '${o}' with value '${s}' not supported (yet)`);
|
|
455
|
+
Je(() => g2.style.setProperty(o, s, l), `StylingFactory ${y2} (setRule4Selector) failed`);
|
|
421
456
|
});
|
|
422
457
|
}
|
|
423
|
-
function d(g2, c,
|
|
424
|
-
if (g2 = g2?.trim?.(), !
|
|
458
|
+
function d(g2, c, o = a) {
|
|
459
|
+
if (g2 = g2?.trim?.(), !j(g2, String) || !g2.length || /[;,]$/g.test(g2)) return console.error(`StylingFactory ${y2} (setRules): [${g2 || "[no selector given]"}] is not a valid selector`);
|
|
425
460
|
if (c.removeRule) return f2(g2);
|
|
426
|
-
let
|
|
427
|
-
return
|
|
461
|
+
let s = n(g2, true), l = s || o.cssRules[o.insertRule(`${g2} {}`, o.cssRules.length || 0)];
|
|
462
|
+
return S(() => x2(l, c), g2, s);
|
|
428
463
|
}
|
|
429
|
-
function
|
|
430
|
-
let c = g2.trim().split(/{/, 2),
|
|
431
|
-
if (!
|
|
432
|
-
let
|
|
433
|
-
return
|
|
464
|
+
function b2(g2) {
|
|
465
|
+
let c = g2.trim().split(/{/, 2), o = c.shift().trim();
|
|
466
|
+
if (!j(o, String) || !o?.trim()?.length) return console.error(`StylingFactory ${y2} (doParse): no (valid) selector could be extracted from rule ${he(g2)}`);
|
|
467
|
+
let s = It(c.shift());
|
|
468
|
+
return Je(() => d(o, s), `StylingFactory ${y2} (setRules) failed`);
|
|
434
469
|
}
|
|
435
|
-
function
|
|
470
|
+
function m2(g2) {
|
|
436
471
|
let c = r(g2);
|
|
437
|
-
return c.done ? c.existing :
|
|
472
|
+
return c.done ? c.existing : b2(g2);
|
|
438
473
|
}
|
|
439
|
-
function
|
|
440
|
-
return g2.trim().startsWith("@media") ?
|
|
474
|
+
function h(g2, c) {
|
|
475
|
+
return g2.trim().startsWith("@media") ? m2(At(g2, c)) : d(g2, c);
|
|
441
476
|
}
|
|
442
477
|
return function(g2, c = {}) {
|
|
443
|
-
return
|
|
478
|
+
return i(g2, c) && (Object.keys(c).length ? h(g2, c) : m2(g2));
|
|
444
479
|
};
|
|
445
480
|
}
|
|
446
481
|
function Ft({ styleSheet: t, createWithId: e }) {
|
|
447
482
|
let r = "Note: The rule or some of its properties may not be supported by your browser (yet)", n = `for style#${e}`;
|
|
448
|
-
t = e ?
|
|
449
|
-
function
|
|
450
|
-
let
|
|
451
|
-
if (
|
|
452
|
-
let g2 = Object.assign(document.createElement("style"), { id:
|
|
483
|
+
t = e ? i(e) : t;
|
|
484
|
+
function i(m2) {
|
|
485
|
+
let h = document.querySelector(`#${m2}`)?.sheet;
|
|
486
|
+
if (h) return h;
|
|
487
|
+
let g2 = Object.assign(document.createElement("style"), { id: m2 });
|
|
453
488
|
return document.head.insertAdjacentElement("beforeend", g2), g2.sheet;
|
|
454
489
|
}
|
|
455
|
-
function
|
|
456
|
-
return console.error(`StylingFactory ${n} [rule: ${
|
|
490
|
+
function a(m2) {
|
|
491
|
+
return console.error(`StylingFactory ${n} [rule: ${m2}]
|
|
457
492
|
=> @charset, @namespace and @import are not supported here`), { done: true };
|
|
458
493
|
}
|
|
459
|
-
function f2(
|
|
460
|
-
return [...t.rules].find((g2) =>
|
|
494
|
+
function f2(m2, h) {
|
|
495
|
+
return [...t.rules].find((g2) => h ? ke(g2.selectorText || "", m2) : Ot`${Pt(m2)}${[..."gim"]}`.test(g2.cssText));
|
|
461
496
|
}
|
|
462
|
-
function
|
|
463
|
-
return /^@charset|@import|namespace/i.test(
|
|
497
|
+
function S(m2) {
|
|
498
|
+
return /^@charset|@import|namespace/i.test(m2.trim()) ? a(m2) : m2.match(/}/g)?.length > 1 ? { existing: d(m2, 1), done: true } : { done: false };
|
|
464
499
|
}
|
|
465
|
-
function
|
|
466
|
-
let
|
|
467
|
-
return
|
|
500
|
+
function y2(m2) {
|
|
501
|
+
let h = [...t.cssRules].reduce((c, o, s) => ke(o.selectorText || "", m2) && c.concat(s) || c, []), g2 = h.length;
|
|
502
|
+
return h.forEach((c) => t.deleteRule(c)), g2 > 0 ? console.info(`\u2714 Removed ${g2} instance${g2 > 1 ? "s" : ""} of selector ${m2} from ${n.slice(4)}`) : console.info(`\u2714 Remove rule: selector ${m2} does not exist in ${n.slice(4)}`);
|
|
468
503
|
}
|
|
469
|
-
function
|
|
470
|
-
return
|
|
504
|
+
function x2(m2, h) {
|
|
505
|
+
return m2 && j(m2, String) && m2.trim().length > 0 && j(h, Object) || (console.error(`StylingFactory ${n} called with invalid parameters`), false);
|
|
471
506
|
}
|
|
472
|
-
function d(
|
|
473
|
-
|
|
474
|
-
let
|
|
507
|
+
function d(m2) {
|
|
508
|
+
m2 = m2.trim();
|
|
509
|
+
let h = m2.slice(0, m2.indexOf("{")).trim(), g2 = !!f2(h);
|
|
475
510
|
try {
|
|
476
|
-
return t.insertRule(`${
|
|
511
|
+
return t.insertRule(`${m2}`, t.cssRules.length), g2;
|
|
477
512
|
} catch (c) {
|
|
478
513
|
return console.error(`StylingFactory ${n} (tryParse) ${c.name} Error:
|
|
479
514
|
${c.message}
|
|
480
|
-
Rule: ${
|
|
515
|
+
Rule: ${he(m2)}
|
|
481
516
|
${r}`), g2;
|
|
482
517
|
}
|
|
483
518
|
}
|
|
484
|
-
function
|
|
519
|
+
function b2(m2, h, g2) {
|
|
485
520
|
try {
|
|
486
|
-
return
|
|
521
|
+
return m2(), g2;
|
|
487
522
|
} catch (c) {
|
|
488
523
|
return console.error(`StylingFactory ${n} (tryAddOrModify) ${c.name} Error:
|
|
489
524
|
${c.message}
|
|
490
|
-
Rule: ${
|
|
525
|
+
Rule: ${he(h)}
|
|
491
526
|
${r}`), g2;
|
|
492
527
|
}
|
|
493
528
|
}
|
|
494
|
-
return { sheet: t, removeRules:
|
|
529
|
+
return { sheet: t, removeRules: y2, tryParseAtOrNestedRules: S, ruleExists: f2, checkParams: x2, tryParse: d, consider: b2, currentSheetID: n };
|
|
495
530
|
}
|
|
496
531
|
function At(t, e) {
|
|
497
532
|
return `${t.trim()} ${Object.entries(e).map(([r, n]) => `${r}: { ${$t(n)}`)}`;
|
|
498
533
|
}
|
|
499
|
-
function
|
|
534
|
+
function he(t) {
|
|
500
535
|
let e = (t || "NO RULE").trim().slice(0, 50).replace(/\n/g, "\\n").replace(/\s{2,}/g, " ");
|
|
501
536
|
return t.length > e.length ? `${e.trim()}...truncated` : e;
|
|
502
537
|
}
|
|
@@ -504,188 +539,188 @@ ${r}`), g2;
|
|
|
504
539
|
return Object.entries(t).map(([e, r]) => `${e}: ${r.trim()}`).join(`;
|
|
505
540
|
`);
|
|
506
541
|
}
|
|
507
|
-
function
|
|
542
|
+
function Pt(t) {
|
|
508
543
|
return t.replace(/([*\[\]()-+{}.$?\\])/g, (e) => `\\${e}`);
|
|
509
544
|
}
|
|
510
|
-
function
|
|
545
|
+
function Ot(t, ...e) {
|
|
511
546
|
let r = e.length && Array.isArray(e.slice(-1)) ? e.pop().join("") : "";
|
|
512
|
-
return new RegExp((e.length && t.raw.reduce((n,
|
|
547
|
+
return new RegExp((e.length && t.raw.reduce((n, i, a) => n.concat(e[a - 1] || "").concat(i), "") || t.raw.join("")).split(`
|
|
513
548
|
`).map((n) => n.replace(/\s|\/\/.*$/g, "").trim().replace(/(@s!)/g, " ")).join(""), r);
|
|
514
549
|
}
|
|
515
|
-
function
|
|
550
|
+
function je(t) {
|
|
516
551
|
return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`).replace(/[^--]^-|-$/, "");
|
|
517
552
|
}
|
|
518
|
-
function
|
|
553
|
+
function Je(t, e) {
|
|
519
554
|
try {
|
|
520
555
|
return t();
|
|
521
556
|
} catch (r) {
|
|
522
557
|
console.error(`${e || "an error occured"}: ${r.message}`);
|
|
523
558
|
}
|
|
524
559
|
}
|
|
525
|
-
function
|
|
560
|
+
function Ht(t) {
|
|
526
561
|
return t.replace(/\/\*.+?\*\//gm, "").replace(/[}{\r\n]/g, "").replace(/(data:.+?);/g, (e, r) => `${r}\\3b`).split(";").map((e) => e.trim()).join(`;
|
|
527
562
|
`).replaceAll("\\3b", ";").split(`
|
|
528
563
|
`);
|
|
529
564
|
}
|
|
530
|
-
function
|
|
565
|
+
function Mt(t) {
|
|
531
566
|
return t.reduce((e, r) => {
|
|
532
|
-
let [n,
|
|
533
|
-
return n &&
|
|
567
|
+
let [n, i] = [r.slice(0, r.indexOf(":")).trim(), r.slice(r.indexOf(":") + 1).trim().replace(/;$|;.+(?=\/*).+\/$/, "")];
|
|
568
|
+
return n && i ? { ...e, [n]: i } : e;
|
|
534
569
|
}, {});
|
|
535
570
|
}
|
|
536
|
-
function
|
|
537
|
-
return
|
|
571
|
+
function It(t) {
|
|
572
|
+
return Mt(Ht(t));
|
|
538
573
|
}
|
|
539
|
-
function
|
|
574
|
+
function ke(t, e) {
|
|
540
575
|
return t?.replace("::", ":") === e?.replace("::", ":");
|
|
541
576
|
}
|
|
542
|
-
var
|
|
543
|
-
var Dt = { on: () =>
|
|
544
|
-
var
|
|
545
|
-
if (
|
|
546
|
-
let e =
|
|
547
|
-
return e === "#text" || !!
|
|
548
|
-
}, allowTag: (t) =>
|
|
549
|
-
var
|
|
550
|
-
var
|
|
551
|
-
function
|
|
552
|
-
if (
|
|
553
|
-
let e = Object.entries(t.removed).reduce((r, [n,
|
|
554
|
-
|
|
577
|
+
var Se = false;
|
|
578
|
+
var Dt = { on: () => Se = true, off: () => Se = false };
|
|
579
|
+
var P = { tagsRaw: J, allowUnknownHtmlTags: Dt, isAllowed(t) {
|
|
580
|
+
if (Se) return true;
|
|
581
|
+
let e = u(t, String) ? t.toLowerCase() : t?.nodeName.toLowerCase() || "none";
|
|
582
|
+
return e === "#text" || !!J[e];
|
|
583
|
+
}, allowTag: (t) => J[t.toLowerCase()] = true, prohibitTag: (t) => J[t.toLowerCase()] = false };
|
|
584
|
+
var Rt = true;
|
|
585
|
+
var X = { data: /data-[\-\w.\p{L}]/ui, validURL: /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i, whiteSpace: /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g, notAllowedValues: /^javascript|injected|noreferrer|alert|DataURL/gi };
|
|
586
|
+
function jt(t) {
|
|
587
|
+
if (Rt && Object.keys(t.removed).length) {
|
|
588
|
+
let e = Object.entries(t.removed).reduce((r, [n, i]) => [...r, `${H(n)} => ${i}`], []).join("\\000A");
|
|
589
|
+
w.error(`JQx: HTML creation error(s): ${e}`);
|
|
555
590
|
}
|
|
556
591
|
}
|
|
557
|
-
function
|
|
592
|
+
function Jt(t) {
|
|
558
593
|
let e = t.nodeName.toLowerCase(), r = ["annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph"];
|
|
559
|
-
return /-/.test(e) && !r.find((n) => n === e) ||
|
|
594
|
+
return /-/.test(e) && !r.find((n) => n === e) || P.isAllowed(e);
|
|
560
595
|
}
|
|
561
|
-
function
|
|
596
|
+
function I(t) {
|
|
562
597
|
let e = { rawHTML: t?.parentElement?.getHTML() ?? "no html", removed: {} };
|
|
563
|
-
return
|
|
564
|
-
if (r?.children?.length &&
|
|
565
|
-
let
|
|
566
|
-
[...(r ?? { attributes: [] }).attributes].forEach((
|
|
567
|
-
let f2 =
|
|
568
|
-
if (
|
|
569
|
-
let d =
|
|
570
|
-
d += d.length === 60 ? "..." : "", e.removed[`${
|
|
598
|
+
return u(t, HTMLElement) && [...t.childNodes].forEach((r) => {
|
|
599
|
+
if (r?.children?.length && I(r), r?.attributes) {
|
|
600
|
+
let i = u(r, SVGElement) ? R.svg : R.html;
|
|
601
|
+
[...(r ?? { attributes: [] }).attributes].forEach((a) => {
|
|
602
|
+
let f2 = a.name.trim().toLowerCase(), S = a.value.trim().toLowerCase().replace(X.whiteSpace, ""), y2 = f2 === "href" ? !X.validURL.test(S) : X.notAllowedValues.test(S), x2 = f2.startsWith("data") ? !X.data.test(f2) : !!i[f2];
|
|
603
|
+
if (y2 || x2) {
|
|
604
|
+
let d = G(a.value || "none", 60);
|
|
605
|
+
d += d.length === 60 ? "..." : "", e.removed[`${a.name}`] = `attribute/property/value not allowed, removed. Value: ${d}`, r.removeAttribute(a.name);
|
|
571
606
|
}
|
|
572
607
|
});
|
|
573
608
|
}
|
|
574
|
-
if (!(
|
|
575
|
-
let
|
|
576
|
-
|
|
609
|
+
if (!(Jt(r) || r.constructor === CharacterData || r.constructor === Comment)) {
|
|
610
|
+
let i = (r?.outerHTML || r?.textContent).trim(), a = G(i, 60) ?? "EMPTY";
|
|
611
|
+
a += a.length === 60 ? "..." : "", e.removed[`<${r.nodeName?.toLowerCase()}>`] = `not allowed, not rendered. Value: ${a}`, r.remove();
|
|
577
612
|
}
|
|
578
|
-
}),
|
|
613
|
+
}), jt(e), t;
|
|
579
614
|
}
|
|
580
|
-
function
|
|
615
|
+
function kt(t) {
|
|
581
616
|
let e = document.createElement("div");
|
|
582
|
-
return e.insertAdjacentHTML(
|
|
617
|
+
return e.insertAdjacentHTML(L.end, t), e.childNodes.length ? I(e) : void 0;
|
|
583
618
|
}
|
|
584
619
|
function Qt(t, e, r) {
|
|
585
620
|
switch (true) {
|
|
586
|
-
case
|
|
621
|
+
case u(t, Comment):
|
|
587
622
|
return e.insertAdjacentHTML(r, `<!--${t.data}-->`);
|
|
588
|
-
case
|
|
623
|
+
case u(t, Text):
|
|
589
624
|
return e.insertAdjacentText(r, t.data || t.textContent);
|
|
590
625
|
default:
|
|
591
626
|
return;
|
|
592
627
|
}
|
|
593
628
|
}
|
|
594
|
-
function
|
|
595
|
-
return r = r ||
|
|
596
|
-
let
|
|
597
|
-
return
|
|
629
|
+
function D(t = [], e = document.body, r = L.BeforeEnd) {
|
|
630
|
+
return r = r || L.BeforeEnd, e = e?.isJQx ? e.node : e || document.body, t.reduce((n, i) => {
|
|
631
|
+
let a = O(i) && Bt(i, e, r);
|
|
632
|
+
return a ? [...n, a] : n;
|
|
598
633
|
}, []);
|
|
599
634
|
}
|
|
600
|
-
function
|
|
601
|
-
return r = r ||
|
|
635
|
+
function Bt(t, e = document.body, r = L.BeforeEnd) {
|
|
636
|
+
return r = r || L.BeforeEnd, e = e?.isJQx ? e?.[0] : e, u(t, Comment, Text) ? Qt(t, e, r) : u(t, HTMLElement) ? e.insertAdjacentElement(r, t) : void 0;
|
|
602
637
|
}
|
|
603
|
-
function
|
|
604
|
-
if (
|
|
638
|
+
function C(t) {
|
|
639
|
+
if (u(t, Text, Comment)) return t;
|
|
605
640
|
let e = t?.trim(), r = e?.split(/<text>|<\/text>/i) ?? [];
|
|
606
|
-
if (r?.length && (r = r.length > 1 ? r.filter((
|
|
607
|
-
if (r ||
|
|
608
|
-
let n =
|
|
609
|
-
return n.childNodes.length < 1 ?
|
|
641
|
+
if (r?.length && (r = r.length > 1 ? r.filter((i) => i.length).shift() : void 0), e.startsWith("<!--") && e.endsWith("-->")) return document.createComment(t.replace(/<!--|-->$/g, ""));
|
|
642
|
+
if (r || u(e, String) && !/^<(.+)[^>]+>/m.test(e)) return document.createTextNode(r ?? e);
|
|
643
|
+
let n = kt(t);
|
|
644
|
+
return n.childNodes.length < 1 ? C(`<span data-jqxcreationerror="1">${Z(t, 60)}</span>`) : n.children[0];
|
|
610
645
|
}
|
|
611
|
-
function
|
|
646
|
+
function K(t) {
|
|
612
647
|
if (t.node("#jqxPopup")) return;
|
|
613
|
-
t.logger.log("JQx: [JQx].Popup first call. Dialog element created."), t.dialog({ id: "jqxPopup" }, t.div({ id: "jqxPopupContent" })).render, t.editCssRules(...
|
|
614
|
-
let e = [], [r, n] = [t("#jqxPopupContent"), t.node("#jqxPopup")],
|
|
615
|
-
return t.handle({ type: "click, cancel", handlers:
|
|
616
|
-
function
|
|
648
|
+
t.logger.log("JQx: [JQx].Popup first call. Dialog element created."), t.dialog({ id: "jqxPopup" }, t.div({ id: "jqxPopupContent" })).render, t.editCssRules(...He);
|
|
649
|
+
let e = [], [r, n] = [t("#jqxPopupContent"), t.node("#jqxPopup")], i = {};
|
|
650
|
+
return t.handle({ type: "click, cancel", handlers: m2, name: "genericPopupCloseHandler", capture: true, about: "A generic handler for JQx popups" }), Object.freeze({ show: a, remove: f2, removeModal: b2 });
|
|
651
|
+
function a(c) {
|
|
617
652
|
if (n.open) switch (true) {
|
|
618
|
-
case
|
|
653
|
+
case S(c):
|
|
619
654
|
return;
|
|
620
655
|
default:
|
|
621
|
-
return f2(), setTimeout(() =>
|
|
656
|
+
return f2(), setTimeout(() => a(c), 200);
|
|
622
657
|
}
|
|
623
|
-
|
|
624
|
-
let { content:
|
|
625
|
-
return t.IS(
|
|
658
|
+
i = { ...c };
|
|
659
|
+
let { content: o } = i;
|
|
660
|
+
return t.IS(o, String, HTMLElement) || o?.isJQx ? y2() : true;
|
|
626
661
|
}
|
|
627
662
|
function f2() {
|
|
628
|
-
return
|
|
663
|
+
return i.modal ? g2(i.warnMessage) : x2();
|
|
629
664
|
}
|
|
630
|
-
function
|
|
631
|
-
for (let [
|
|
665
|
+
function S(c) {
|
|
666
|
+
for (let [o, s] of Object.entries(i)) if (s !== c[o]) return false;
|
|
632
667
|
return true;
|
|
633
668
|
}
|
|
634
|
-
function
|
|
669
|
+
function y2() {
|
|
635
670
|
r.clear();
|
|
636
|
-
let { content: c, modal:
|
|
637
|
-
|
|
638
|
-
let
|
|
639
|
-
r.append(
|
|
671
|
+
let { content: c, modal: o, closeAfter: s } = i;
|
|
672
|
+
o = t.IS(o, Boolean) ? o : false;
|
|
673
|
+
let l = o ? "" : t.div({ id: "closeHandleIcon" });
|
|
674
|
+
r.append(l, t.IS(c, String) ? t.div(c) : c), n.showModal(), !o && t.IS(s, Number) && h(f2, s);
|
|
640
675
|
}
|
|
641
|
-
function
|
|
642
|
-
if (n.close(
|
|
643
|
-
|
|
676
|
+
function x2() {
|
|
677
|
+
if (n.close(i.returnValue), d(), t.IS(i.callback, Function)) return e.push(setTimeout(() => i.callback(i.returnValue), 200));
|
|
678
|
+
i = {};
|
|
644
679
|
}
|
|
645
680
|
function d() {
|
|
646
681
|
e.forEach((c) => clearTimeout(c)), e = [];
|
|
647
682
|
}
|
|
648
|
-
function
|
|
649
|
-
|
|
683
|
+
function b2({ callback: c, value: o } = {}) {
|
|
684
|
+
i.returnValue = o, i.modal = false, i.callback = c || i.callback, f2();
|
|
650
685
|
}
|
|
651
|
-
function
|
|
652
|
-
if (!(Object.keys(
|
|
686
|
+
function m2({ evt: c }) {
|
|
687
|
+
if (!(Object.keys(i).length < 1 || !n.open) && (c.type === "cancel" && i.modal && c.preventDefault(), c.target.closest("#closeHandleIcon") || !c.target.closest("#jqxPopupContent"))) return i.activeTimer && clearTimeout(i.activeTimer), f2();
|
|
653
688
|
}
|
|
654
|
-
function
|
|
655
|
-
t.IS(c, Function) && t.IS(
|
|
689
|
+
function h(c, o) {
|
|
690
|
+
t.IS(c, Function) && t.IS(o, Number) && o > 0 && (d(), e.push(setTimeout(c, o * 1e3)));
|
|
656
691
|
}
|
|
657
692
|
function g2(c) {
|
|
658
693
|
if (!t.IS(c, String, HTMLElement, Proxy)) return;
|
|
659
|
-
let
|
|
694
|
+
let o = r.find$(".warn");
|
|
660
695
|
switch (true) {
|
|
661
|
-
case
|
|
662
|
-
|
|
696
|
+
case o.is.empty:
|
|
697
|
+
o = t.div({ class: "warn" }, c);
|
|
663
698
|
default:
|
|
664
|
-
r.append(
|
|
699
|
+
r.append(o.addClass("active")), h(() => r.find$(".warn").removeClass("active"), 2);
|
|
665
700
|
}
|
|
666
701
|
}
|
|
667
702
|
}
|
|
668
|
-
function
|
|
703
|
+
function q(t) {
|
|
669
704
|
let e = {}, r = "anonymous_";
|
|
670
705
|
function n(d) {
|
|
671
706
|
if (d) {
|
|
672
|
-
let { handler:
|
|
673
|
-
document.addEventListener(
|
|
707
|
+
let { handler: b2, capture: m2, type: h } = d;
|
|
708
|
+
document.addEventListener(h, b2, { capture: m2 });
|
|
674
709
|
}
|
|
675
710
|
}
|
|
676
|
-
function
|
|
711
|
+
function i(d) {
|
|
677
712
|
if (d) {
|
|
678
|
-
let { type:
|
|
679
|
-
document.removeEventListener(
|
|
713
|
+
let { type: b2, handler: m2, capture: h } = d;
|
|
714
|
+
document.removeEventListener(b2, m2, { capture: h });
|
|
680
715
|
}
|
|
681
716
|
}
|
|
682
|
-
function
|
|
717
|
+
function a(d, b2, m2, h) {
|
|
683
718
|
return function(g2) {
|
|
684
|
-
if (!T(
|
|
685
|
-
let c = g2.target.closest(
|
|
719
|
+
if (!T(b2)) return d({ evt: g2 });
|
|
720
|
+
let c = g2.target.closest(b2);
|
|
686
721
|
if (c) {
|
|
687
|
-
let
|
|
688
|
-
d({ self:
|
|
722
|
+
let o = t(c);
|
|
723
|
+
d({ self: o, me: o, evt: g2 }), m2 && y2(g2.type, h);
|
|
689
724
|
}
|
|
690
725
|
return true;
|
|
691
726
|
};
|
|
@@ -693,109 +728,109 @@ ${r}`), g2;
|
|
|
693
728
|
function f2(d) {
|
|
694
729
|
return e[d] = e[d] || {}, e[d];
|
|
695
730
|
}
|
|
696
|
-
function
|
|
697
|
-
return Object.entries(f2(d)).find(([
|
|
731
|
+
function S(d, b2) {
|
|
732
|
+
return Object.entries(f2(d)).find(([m2]) => m2 === b2);
|
|
698
733
|
}
|
|
699
|
-
function
|
|
700
|
-
let
|
|
701
|
-
|
|
734
|
+
function y2(d, b2) {
|
|
735
|
+
let m2 = S(d, b2);
|
|
736
|
+
m2 && (i(m2[1]), delete e[d][b2], delete ee[b2], w.warn(`Removed listener [${b2}] for event type [${d}].`));
|
|
702
737
|
}
|
|
703
|
-
function
|
|
704
|
-
let { type:
|
|
705
|
-
e[
|
|
706
|
-
let
|
|
707
|
-
if (
|
|
708
|
-
let
|
|
709
|
-
|
|
738
|
+
function x2(d) {
|
|
739
|
+
let { type: b2, handler: m2, name: h, capture: g2, once: c, selector: o, node: s, about: l } = d;
|
|
740
|
+
e[b2] = e[b2] || {};
|
|
741
|
+
let p = xe(h || m2.name), v2 = m2;
|
|
742
|
+
if (s instanceof HTMLElement) {
|
|
743
|
+
let F = s.dataset.hid || p;
|
|
744
|
+
s.dataset.hid = F, o = `[data-hid=${F}]`;
|
|
710
745
|
}
|
|
711
746
|
switch (true) {
|
|
712
|
-
case !e[
|
|
713
|
-
return
|
|
714
|
-
b2
|
|
715
|
-
} }, e[
|
|
747
|
+
case !e[b2][p]:
|
|
748
|
+
return w.log(`JQx: created listener for event type ${b2}, with handler name ${p}`), e[b2][p] = { name: p, handler: a(m2, o, c, p), capture: Qe(b2, g2), once: !!c, type: b2, initialHandler: v2, selector: !!o && o || false, about: !!l && l || false, unListen() {
|
|
749
|
+
y2(b2, p);
|
|
750
|
+
} }, e[b2][p];
|
|
716
751
|
default:
|
|
717
|
-
return console.warn(`The listener [${
|
|
752
|
+
return console.warn(`The listener [${p}] for [${b2}] exists, it is not re-assigned.`);
|
|
718
753
|
}
|
|
719
754
|
}
|
|
720
755
|
return { remove(...d) {
|
|
721
|
-
return
|
|
756
|
+
return y2(...d);
|
|
722
757
|
}, listen: function(d) {
|
|
723
|
-
let { type:
|
|
724
|
-
if (!T(
|
|
725
|
-
let
|
|
726
|
-
if (
|
|
727
|
-
b2
|
|
758
|
+
let { type: b2, handler: m2 } = d;
|
|
759
|
+
if (!T(b2) || !u(m2, Function)) return;
|
|
760
|
+
let h = x2(d);
|
|
761
|
+
if (h) return n(h), { type: b2, name: h.name, unListen() {
|
|
762
|
+
y2(b2, h.name);
|
|
728
763
|
} };
|
|
729
764
|
}, get ListenerStore() {
|
|
730
765
|
return Object.freeze({ ...e });
|
|
731
766
|
} };
|
|
732
767
|
}
|
|
733
|
-
var
|
|
734
|
-
var
|
|
735
|
-
var
|
|
768
|
+
var w = Yt();
|
|
769
|
+
var Wt = ["load", "unload", "scroll", "focus", "blur", "DOMNodeRemovedFromDocument", "DOMNodeInsertedIntoDocument", "loadstart", "progress", "error", "abort", "load", "loadend", "pointerenter", "pointerleave", "readystatechange"];
|
|
770
|
+
var L = Object.freeze(new Proxy({ start: "afterbegin", afterbegin: "afterbegin", end: "beforeend", beforeend: "beforeend", before: "beforebegin", beforebegin: "beforebegin", after: "afterend", afterend: "afterend" }, { get(t, e) {
|
|
736
771
|
return t[String(e).toLowerCase()] ?? t[e];
|
|
737
772
|
} }));
|
|
738
|
-
var
|
|
739
|
-
var
|
|
740
|
-
return t[
|
|
773
|
+
var zt = [...Array(26)].map((t, e) => String.fromCharCode(e + 65)).concat([...Array(26)].map((t, e) => String.fromCharCode(e + 97))).concat([...Array(10)].map((t, e) => `${e}`));
|
|
774
|
+
var Ee = Object.freeze({ get(t, e) {
|
|
775
|
+
return t[z(e)] || t[e];
|
|
741
776
|
}, enumerable: false, configurable: false });
|
|
742
|
-
var
|
|
743
|
-
function
|
|
777
|
+
var ee = {};
|
|
778
|
+
function we() {
|
|
744
779
|
let t = setTimeout(() => {
|
|
745
780
|
});
|
|
746
781
|
for (; t >= 0; ) clearTimeout(t--);
|
|
747
782
|
}
|
|
748
|
-
function
|
|
749
|
-
return T(t) && !/^handler|handlers$/gi.test(t.trim()) ? t.trim() :
|
|
783
|
+
function xe(t) {
|
|
784
|
+
return T(t) && !/^handler|handlers$/gi.test(t.trim()) ? t.trim() : Be();
|
|
750
785
|
}
|
|
751
|
-
function
|
|
752
|
-
let e = !!t.node && !
|
|
786
|
+
function Te(t) {
|
|
787
|
+
let e = !!t.node && !u(t, Text, Comment);
|
|
753
788
|
switch (true) {
|
|
754
789
|
case e:
|
|
755
|
-
let r = t.node.dataset ? Object.keys(t.node.dataset).map((
|
|
756
|
-
return
|
|
790
|
+
let r = t.node.dataset ? Object.keys(t.node.dataset).map((a) => `[data-${a}]`) : [], i = [t.attr("id") && `#${t?.attr("id")}` || void 0, t.attr("class") && t?.attr("class").split(" ").map((a) => `.${a}`).join(", ") || void 0, r.length > 0 && r.join(", ") || void 0].filter((a) => !!a).join(", ") || [];
|
|
791
|
+
return i.length ? `(${i})` : "";
|
|
757
792
|
default:
|
|
758
793
|
return "";
|
|
759
794
|
}
|
|
760
795
|
}
|
|
761
|
-
function
|
|
796
|
+
function Be(t) {
|
|
762
797
|
let e = `anonymous_${Math.random().toString(36).slice(2)}`;
|
|
763
|
-
return
|
|
798
|
+
return ee[e] ? Be() : (ee[e] = e, e);
|
|
764
799
|
}
|
|
765
|
-
function
|
|
766
|
-
return !!
|
|
800
|
+
function Qe(t, e) {
|
|
801
|
+
return !!Wt.find((r) => r === t) || !!e;
|
|
767
802
|
}
|
|
768
|
-
function
|
|
769
|
-
return t.startsWith("data") ||
|
|
803
|
+
function ne(t) {
|
|
804
|
+
return t.startsWith("data") || R.html.find((e) => t.toLowerCase() === e);
|
|
770
805
|
}
|
|
771
|
-
function
|
|
806
|
+
function oe(t) {
|
|
772
807
|
return t && (t.textContent = "");
|
|
773
808
|
}
|
|
774
|
-
function
|
|
775
|
-
return t = t?.parentElement, e += t ? t[r ? "scrollTop" : "scrollLeft"] : 0, t ?
|
|
809
|
+
function B(t, e = 0, r = true) {
|
|
810
|
+
return t = t?.parentElement, e += t ? t[r ? "scrollTop" : "scrollLeft"] : 0, t ? B(t, e, r) : e;
|
|
776
811
|
}
|
|
777
812
|
function T(t, e = 1) {
|
|
778
|
-
return e =
|
|
813
|
+
return e = u(e, Number) && e || 1, u(t, String) && t.length >= e;
|
|
779
814
|
}
|
|
780
|
-
function
|
|
781
|
-
return
|
|
815
|
+
function G(t, e = 120) {
|
|
816
|
+
return Z(t, e).replace(/</g, "<");
|
|
782
817
|
}
|
|
783
|
-
function
|
|
818
|
+
function Z(t, e = 120) {
|
|
784
819
|
return `${t}`.trim().slice(0, e).replace(/>\s+</g, "><").replace(/</g, "<").replace(/\s{2,}/g, " ").replace(/\n/g, "\\n") + (t.length > e ? " …" : "").trim();
|
|
785
820
|
}
|
|
786
|
-
function
|
|
821
|
+
function H(t) {
|
|
787
822
|
switch (true) {
|
|
788
|
-
case
|
|
823
|
+
case u(t, String):
|
|
789
824
|
let e = document.createElement("div");
|
|
790
825
|
return e.append(t), e.innerHTML;
|
|
791
826
|
default:
|
|
792
827
|
return t;
|
|
793
828
|
}
|
|
794
829
|
}
|
|
795
|
-
function
|
|
796
|
-
return
|
|
830
|
+
function ve(t) {
|
|
831
|
+
return u(t, String) && Object.assign(document.createElement("textarea"), { innerHTML: t }).textContent || t;
|
|
797
832
|
}
|
|
798
|
-
function
|
|
833
|
+
function Yt() {
|
|
799
834
|
let [t, e] = [false, true], r = [], n = { get on() {
|
|
800
835
|
return t = true, n;
|
|
801
836
|
}, get off() {
|
|
@@ -807,22 +842,22 @@ ${r}`), g2;
|
|
|
807
842
|
}, get backLog() {
|
|
808
843
|
return r;
|
|
809
844
|
} };
|
|
810
|
-
function
|
|
845
|
+
function i() {
|
|
811
846
|
e = true;
|
|
812
847
|
}
|
|
813
|
-
function
|
|
848
|
+
function a() {
|
|
814
849
|
e = false;
|
|
815
850
|
}
|
|
816
|
-
function f2(...
|
|
817
|
-
return r.unshift(...
|
|
851
|
+
function f2(...x2) {
|
|
852
|
+
return r.unshift(...x2.map((d) => `${re()} \u2A3B ${ve(d)}`)), console.error(r.slice(0, x2.length).join(`
|
|
818
853
|
`)), n;
|
|
819
854
|
}
|
|
820
|
-
function
|
|
821
|
-
return r.unshift(...
|
|
855
|
+
function S(...x2) {
|
|
856
|
+
return r.unshift(...x2.map((d) => `${re()} \u26A0 ${ve(d)}`)), console.warn(r.slice(0, x2.length).join(`
|
|
822
857
|
`)), n;
|
|
823
858
|
}
|
|
824
|
-
function
|
|
825
|
-
let d =
|
|
859
|
+
function y2(...x2) {
|
|
860
|
+
let d = x2.map((b2) => `${re()} \u2714 ${ve(b2)}`);
|
|
826
861
|
switch (!e && r.unshift(...d), t) {
|
|
827
862
|
case true:
|
|
828
863
|
console.log(d.join(`
|
|
@@ -831,66 +866,66 @@ ${r}`), g2;
|
|
|
831
866
|
return n;
|
|
832
867
|
}
|
|
833
868
|
}
|
|
834
|
-
return Object.defineProperties(n, { log: { value:
|
|
869
|
+
return Object.defineProperties(n, { log: { value: y2, enumerable: false }, error: { value: f2, enumerable: false }, warn: { value: S, enumerable: false } }), Object.freeze(n);
|
|
835
870
|
}
|
|
836
|
-
function
|
|
837
|
-
return ((t) => `[${
|
|
871
|
+
function re() {
|
|
872
|
+
return ((t) => `[${te(t.getHours())}:${te(t.getMinutes())}:${te(t.getSeconds())}.${te(t.getMilliseconds(), 3)}]`)(/* @__PURE__ */ new Date());
|
|
838
873
|
}
|
|
839
|
-
function
|
|
874
|
+
function Le(t, e) {
|
|
840
875
|
if (t) for (let [r, n] of Object.entries(e)) {
|
|
841
|
-
if (r =
|
|
842
|
-
|
|
876
|
+
if (r = N(r), r.startsWith("data")) return ie(t, n);
|
|
877
|
+
u(n, String) && ne(r) && t.setAttribute(r, n.split(/[, ]/)?.join(" "));
|
|
843
878
|
}
|
|
844
879
|
}
|
|
845
|
-
function
|
|
846
|
-
if (t &&
|
|
880
|
+
function ie(t, e) {
|
|
881
|
+
if (t && u(e, Object)) for (let [r, n] of Object.entries(e)) t.setAttribute(`data-${N(r)}`, n);
|
|
847
882
|
}
|
|
848
|
-
function
|
|
849
|
-
return t ?
|
|
883
|
+
function se(t) {
|
|
884
|
+
return t ? u(t, Proxy) ? [t.EL] : u(t, NodeList) ? [...t] : O(t) ? [t] : _(t) ? t : t.isJQx ? t.collection : void 0 : [];
|
|
850
885
|
}
|
|
851
|
-
function
|
|
886
|
+
function ae(t, e) {
|
|
852
887
|
return t.andThen(e);
|
|
853
888
|
}
|
|
854
|
-
function
|
|
889
|
+
function le(t, e) {
|
|
855
890
|
return t.andThen(e, true);
|
|
856
891
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
892
|
+
function O(t) {
|
|
893
|
+
return u(t, Text, HTMLElement, Comment);
|
|
859
894
|
}
|
|
860
|
-
function
|
|
861
|
-
if (
|
|
862
|
-
let
|
|
863
|
-
/!important/i.test(n) && (n = n.slice(0, n.indexOf("!")).trim(),
|
|
895
|
+
function W(t, e) {
|
|
896
|
+
if (u(e, Object)) for (let [r, n] of Object.entries(e)) {
|
|
897
|
+
let i;
|
|
898
|
+
/!important/i.test(n) && (n = n.slice(0, n.indexOf("!")).trim(), i = "important"), t.style.setProperty(N(r), n, i);
|
|
864
899
|
}
|
|
865
900
|
}
|
|
866
|
-
function
|
|
901
|
+
function M(t) {
|
|
867
902
|
let e = t.cloneNode(true);
|
|
868
903
|
return e.removeAttribute && e.removeAttribute("id"), t.isConnected ? t.remove() : t = null, e;
|
|
869
904
|
}
|
|
870
|
-
function
|
|
871
|
-
if (!
|
|
872
|
-
let e = t.style, r = getComputedStyle(t), n = !![e.visibility, r.visibility].includes("hidden"),
|
|
873
|
-
return !(
|
|
905
|
+
function We(t) {
|
|
906
|
+
if (!u(t, HTMLElement)) return;
|
|
907
|
+
let e = t.style, r = getComputedStyle(t), n = !![e.visibility, r.visibility].includes("hidden"), i = !![e.display, r.display].includes("none"), a = !!t.hidden, f2 = parseInt(r.height) < 1 || parseInt(r.width) < 1, S = t.offsetTop < 0 || t.offsetLeft + t.offsetWidth < 0 || t.offsetLeft > document.body.offsetWidth, y2 = +r.opacity == 0 || +(e.opacity || 1) == 0;
|
|
908
|
+
return !(a || S || y2 || i || n || f2);
|
|
874
909
|
}
|
|
875
|
-
function
|
|
910
|
+
function ze(t) {
|
|
876
911
|
return t?.isConnected ? !![...document.querySelectorAll(":is(:read-write)")].find((e) => e === t) : false;
|
|
877
912
|
}
|
|
878
913
|
function Ye(t) {
|
|
879
|
-
return t?.filter((e) => e).reduce((e, r) => e.concat(
|
|
914
|
+
return t?.filter((e) => e).reduce((e, r) => e.concat(Fe(r) ? `<!--${r.data}-->` : ce(r) ? r.textContent : r.outerHTML), "");
|
|
880
915
|
}
|
|
881
|
-
function
|
|
916
|
+
function te(t, e = 2) {
|
|
882
917
|
return `${t}`.padStart(e, "0");
|
|
883
918
|
}
|
|
884
|
-
function
|
|
919
|
+
function _e(t, e = 0) {
|
|
885
920
|
return [t, e] = [Math.floor(t), Math.ceil(e)], Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift() / 2 ** 32 * (t - e + 1) + e);
|
|
886
921
|
}
|
|
887
|
-
function
|
|
888
|
-
return `_${
|
|
922
|
+
function ue() {
|
|
923
|
+
return `_${_t(zt).slice(0, 8).join("")}`;
|
|
889
924
|
}
|
|
890
|
-
function
|
|
891
|
-
return t =
|
|
925
|
+
function Ce(t) {
|
|
926
|
+
return t = u(t, String) && /,/.test(t) ? t.split(",").map((e) => e.trim().toLowerCase()).filter((e) => e.length > 0) : t, u(t, Array) ? t : u(t, String) && t?.trim().toLowerCase() || "";
|
|
892
927
|
}
|
|
893
|
-
function
|
|
928
|
+
function Ve(t) {
|
|
894
929
|
return t?.isConnected ? !![...document.querySelectorAll(":is(:modal)")].find((e) => e === t) : false;
|
|
895
930
|
}
|
|
896
931
|
function Ne(t, e) {
|
|
@@ -903,74 +938,74 @@ ${r}`), g2;
|
|
|
903
938
|
return e;
|
|
904
939
|
}
|
|
905
940
|
}
|
|
906
|
-
function
|
|
941
|
+
function _t(t) {
|
|
907
942
|
let e = t.length;
|
|
908
943
|
for (; e--; ) {
|
|
909
|
-
let r =
|
|
944
|
+
let r = _e(e);
|
|
910
945
|
[t[e], t[r]] = [t[r], t[e]];
|
|
911
946
|
}
|
|
912
947
|
return t;
|
|
913
948
|
}
|
|
914
|
-
function
|
|
915
|
-
return
|
|
949
|
+
function z(t) {
|
|
950
|
+
return u(t, String) ? t.toLowerCase().split("-").map((e, r) => r && `${Vt(e)}` || e).join("") : t;
|
|
916
951
|
}
|
|
917
|
-
function
|
|
952
|
+
function N(t) {
|
|
918
953
|
return t.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`).replace(/^-|-$/, "");
|
|
919
954
|
}
|
|
920
|
-
function
|
|
955
|
+
function Vt([t, ...e]) {
|
|
921
956
|
return `${t.toUpperCase()}${e.join("")}`;
|
|
922
957
|
}
|
|
923
|
-
function
|
|
924
|
-
return
|
|
925
|
-
}
|
|
926
|
-
function He(t) {
|
|
927
|
-
a(t, Comment);
|
|
958
|
+
function ce(t) {
|
|
959
|
+
return u(t, Comment, Text);
|
|
928
960
|
}
|
|
929
|
-
function
|
|
930
|
-
|
|
961
|
+
function Fe(t) {
|
|
962
|
+
u(t, Comment);
|
|
931
963
|
}
|
|
932
|
-
function
|
|
933
|
-
return
|
|
964
|
+
function Ue(t) {
|
|
965
|
+
return u(t, Text);
|
|
934
966
|
}
|
|
935
967
|
function Y(t) {
|
|
936
|
-
return
|
|
968
|
+
return u(t, String) && /^<|>$/.test(`${t}`.trim());
|
|
937
969
|
}
|
|
938
|
-
function
|
|
939
|
-
return
|
|
970
|
+
function _(t) {
|
|
971
|
+
return u(t, Array) && !t?.find((e) => !O(e));
|
|
972
|
+
}
|
|
973
|
+
function fe(t) {
|
|
974
|
+
return u(t, Array) && !t?.find((e) => !Y(e));
|
|
940
975
|
}
|
|
941
|
-
function
|
|
942
|
-
let r = t.collection.filter((n) => !
|
|
976
|
+
function E(t, e) {
|
|
977
|
+
let r = t.collection.filter((n) => !ce(n));
|
|
943
978
|
for (let n = 0; n < r.length; n += 1) e(r[n], n);
|
|
944
979
|
return t;
|
|
945
980
|
}
|
|
946
|
-
function
|
|
947
|
-
return t.node ?
|
|
981
|
+
function Xe(t) {
|
|
982
|
+
return t.node ? u(t.node, Comment) ? `<!--${t.node.textContent}-->` : t.HTML.get(1).split(">")[0] + ">..." : "";
|
|
948
983
|
}
|
|
949
|
-
function
|
|
950
|
-
let n = e !== document.body &&
|
|
984
|
+
function Ae(t, e, r) {
|
|
985
|
+
let n = e !== document.body && u(t, String) && t.toLowerCase() !== "body" ? e : document;
|
|
951
986
|
try {
|
|
952
987
|
r.collection = [...n.querySelectorAll(t)];
|
|
953
988
|
} catch {
|
|
954
|
-
|
|
989
|
+
w.warn(`JQx: Invalid CSS querySelector. [${u(t, String) ? t : "Not a string!"}]`);
|
|
955
990
|
}
|
|
956
991
|
}
|
|
957
|
-
function
|
|
958
|
-
return { isCommentOrTextNode:
|
|
992
|
+
function Ge() {
|
|
993
|
+
return { isCommentOrTextNode: ce, isNode: O, isComment: Fe, isText: Ue, isHtmlString: Y, isArrayOfHtmlElements: _, isArrayOfHtmlStrings: fe, ElemArray2HtmlString: Ye, input2Collection: se, setCollectionFromCssSelector: Ae, cssRuleEdit: Q({ createWithId: "JQxStylesheet" }) };
|
|
959
994
|
}
|
|
960
|
-
function
|
|
995
|
+
function Ze() {
|
|
961
996
|
let e = Object.freeze({ notInDOM: "n/a", writable: "n/a", modal: "n/a", empty: true, open: "n/a", visible: "n/a" });
|
|
962
997
|
return (r) => {
|
|
963
998
|
let n = r.node;
|
|
964
|
-
return
|
|
965
|
-
return
|
|
999
|
+
return u(n, Node) ? Object.freeze({ get writable() {
|
|
1000
|
+
return ze(n);
|
|
966
1001
|
}, get modal() {
|
|
967
|
-
return
|
|
1002
|
+
return Ve(n);
|
|
968
1003
|
}, get inDOM() {
|
|
969
1004
|
return n.isConnected;
|
|
970
1005
|
}, get open() {
|
|
971
1006
|
return n.open ?? false;
|
|
972
1007
|
}, get visible() {
|
|
973
|
-
return
|
|
1008
|
+
return We(n);
|
|
974
1009
|
}, get disabled() {
|
|
975
1010
|
return n.hasAttribute("readonly") || n.hasAttribute("disabled");
|
|
976
1011
|
}, get empty() {
|
|
@@ -980,51 +1015,51 @@ ${r}`), g2;
|
|
|
980
1015
|
} }) : e;
|
|
981
1016
|
};
|
|
982
1017
|
}
|
|
983
|
-
function
|
|
984
|
-
r &&
|
|
985
|
-
let
|
|
986
|
-
e.className && (
|
|
1018
|
+
function Ke(t, e, r, n) {
|
|
1019
|
+
r && u(e, String) && (e = { [e]: r === "-" ? "" : r });
|
|
1020
|
+
let i;
|
|
1021
|
+
e.className && (i = e.className, delete e.className), i = [...t.classList].find((f2) => f2.startsWith("JQxClass-") || i && f2 === i) || i || `JQxClass-${ue().slice(1)}`, n.editCssRule(`.${i}`, e), t.classList.add(i);
|
|
987
1022
|
}
|
|
988
|
-
var Ut =
|
|
989
|
-
function
|
|
990
|
-
return { factoryExtensions:
|
|
1023
|
+
var Ut = Ze();
|
|
1024
|
+
function qe(t) {
|
|
1025
|
+
return { factoryExtensions: Xt(t), instanceExtensions: Gt(t) };
|
|
991
1026
|
}
|
|
992
|
-
function
|
|
1027
|
+
function Xt(t) {
|
|
993
1028
|
return { data(e) {
|
|
994
1029
|
return { get all() {
|
|
995
|
-
return new Proxy(e[0]?.dataset ?? {},
|
|
1030
|
+
return new Proxy(e[0]?.dataset ?? {}, Ee);
|
|
996
1031
|
}, set(r = {}) {
|
|
997
|
-
if (!e.is.empty &&
|
|
1032
|
+
if (!e.is.empty && u(r, Object)) for (let [n, i] of Object.entries(r)) e.setData({ [n]: i });
|
|
998
1033
|
return e;
|
|
999
1034
|
}, get(r, n) {
|
|
1000
1035
|
return e.data.all[r] ?? n;
|
|
1001
1036
|
}, add(r = {}) {
|
|
1002
|
-
if (!e.is.empty &&
|
|
1037
|
+
if (!e.is.empty && u(r, Object)) for (let [n, i] of Object.entries(r)) e.setData({ [n]: i });
|
|
1003
1038
|
return e;
|
|
1004
1039
|
}, remove(r) {
|
|
1005
|
-
return e[0]?.removeAttribute(`data-${
|
|
1040
|
+
return e[0]?.removeAttribute(`data-${N(r)}`), e;
|
|
1006
1041
|
} };
|
|
1007
1042
|
}, dimensions(e) {
|
|
1008
|
-
if (e.is.empty) return
|
|
1043
|
+
if (e.is.empty) return w.error("[JQx instance].dimensions called on empty instance"), { error: "[JQx instance].dimensions: NO ELEMENTS" };
|
|
1009
1044
|
let { node: r } = e, n = r.getBoundingClientRect().toJSON();
|
|
1010
|
-
return n.scrollTopDistance =
|
|
1045
|
+
return n.scrollTopDistance = B(r, 0), n.scrollLeftDistance = B(r, 0, false), n;
|
|
1011
1046
|
}, node(e) {
|
|
1012
1047
|
return e[0];
|
|
1013
1048
|
}, HTML(e) {
|
|
1014
1049
|
return { get(r, n) {
|
|
1015
1050
|
if (e.is.empty) return "NO ELEMENTS IN COLLECTION";
|
|
1016
|
-
let
|
|
1017
|
-
return n ?
|
|
1018
|
-
}, set(r, n = false,
|
|
1051
|
+
let i = r ? e.outerHtml : e.html();
|
|
1052
|
+
return n ? H(i) : i;
|
|
1053
|
+
}, set(r, n = false, i = false) {
|
|
1019
1054
|
r = r.isJQx ? r.HTML.get(1) : r;
|
|
1020
|
-
let
|
|
1021
|
-
return r =
|
|
1055
|
+
let a = u(r, String);
|
|
1056
|
+
return r = a && i ? H(r) : r, a && (r || "").trim().length && e.html(r, n), e;
|
|
1022
1057
|
}, replace(r, n = false) {
|
|
1023
1058
|
return e.HTML.set(r, false, n);
|
|
1024
1059
|
}, append(r, n = false) {
|
|
1025
|
-
return r =
|
|
1060
|
+
return r = u(r, HTMLElement) ? t(r).HTML.get(1) : r.isJQx ? r.HTML.get(1) : r, e.HTML.set(r, true, n);
|
|
1026
1061
|
}, insert(r, n = false) {
|
|
1027
|
-
return r =
|
|
1062
|
+
return r = u(r, HTMLElement) ? t(r).HTML.get(1) : r.isJQx ? r.HTML.get(1) : r, e.HTML.set(r + e.HTML.get(), false, n);
|
|
1028
1063
|
} };
|
|
1029
1064
|
}, is(e) {
|
|
1030
1065
|
return Ut(e);
|
|
@@ -1050,55 +1085,55 @@ ${r}`), g2;
|
|
|
1050
1085
|
}, inSheet(r) {
|
|
1051
1086
|
return e.css(r);
|
|
1052
1087
|
}, valueOf(r) {
|
|
1053
|
-
return e.is.empty ? void 0 : getComputedStyle(e[0])[
|
|
1088
|
+
return e.is.empty ? void 0 : getComputedStyle(e[0])[N(r)];
|
|
1054
1089
|
}, nwRule(r) {
|
|
1055
1090
|
return e.Style.byRule({ rules: r });
|
|
1056
1091
|
}, byRule({ classes2Apply: r = [], rules: n = [] } = {}) {
|
|
1057
|
-
let
|
|
1058
|
-
if (n = n &&
|
|
1059
|
-
return
|
|
1092
|
+
let a = u(n, String) && !r.length ? n.split("{")[0].trim() : "";
|
|
1093
|
+
if (n = n && u(n, String) ? [n] : n, r = r && u(r, String) ? [r] : r, (n?.length || r?.length) && (n?.length && t.editCssRules(...n), r)) for (let f2 of r) e.addClass(f2);
|
|
1094
|
+
return a?.startsWith(".") && e.addClass(a.slice(1)), a?.startsWith("#") && !e.attr("id") && e.prop({ id: a.slice(1) }), e;
|
|
1060
1095
|
} };
|
|
1061
1096
|
} };
|
|
1062
1097
|
}
|
|
1063
1098
|
function Gt(t) {
|
|
1064
1099
|
return { addClass(e, ...r) {
|
|
1065
|
-
return
|
|
1066
|
-
}, after:
|
|
1067
|
-
if (!r || !
|
|
1068
|
-
r = r?.isJQx ? r :
|
|
1069
|
-
let [
|
|
1070
|
-
return e[
|
|
1100
|
+
return E(e, (n) => n && r.forEach((i) => n.classList.add(i)));
|
|
1101
|
+
}, after: ae, afterMe: ae, andThen(e, r, n = false) {
|
|
1102
|
+
if (!r || !u(r, String, Node, Proxy)) return w.log("[JQx instance].[before(Me) | after(Me) | andThen]: invalid/-sufficient input."), e;
|
|
1103
|
+
r = r?.isJQx ? r : u(r, Node) ? t.virtual(r) : t.virtual(C(r));
|
|
1104
|
+
let [i, a, f2] = n ? [0, "before", r.collection.concat(e.collection)] : [e.collection.length - 1, "after", e.collection.concat(r.collection)];
|
|
1105
|
+
return e[i][a](...r.collection), e.collection = f2, e;
|
|
1071
1106
|
}, append(e, ...r) {
|
|
1072
1107
|
if (e.is.empty || r.length < 1) return e;
|
|
1073
1108
|
let n = e.length === 1;
|
|
1074
|
-
for (let
|
|
1075
|
-
if (!
|
|
1076
|
-
let
|
|
1077
|
-
|
|
1109
|
+
for (let i of r) {
|
|
1110
|
+
if (!i.isJQx && T(i)) {
|
|
1111
|
+
let a = i.trim(), S = !/^<(.+)[^>]+>$/m.test(a) ? t.text(i) : C(i);
|
|
1112
|
+
E(e, (y2) => y2.append(n ? S : M(S)));
|
|
1078
1113
|
}
|
|
1079
|
-
|
|
1114
|
+
O(i) && E(e, (a) => a.append(n ? i : M(i))), i.isJQx && !i.is.empty && E(e, (a) => i.collection.forEach((f2) => a.append(n ? f2 : M(f2))));
|
|
1080
1115
|
}
|
|
1081
1116
|
return e;
|
|
1082
1117
|
}, appendTo(e, r) {
|
|
1083
1118
|
switch (true) {
|
|
1084
|
-
case (!r.isJQx && !
|
|
1119
|
+
case (!r.isJQx && !u(r, HTMLElement)):
|
|
1085
1120
|
return $.warn("[JQx instance].appendTo: invalid input"), e;
|
|
1086
1121
|
default:
|
|
1087
1122
|
return (r.isJQx ? r : t(r)).append(e), e;
|
|
1088
1123
|
}
|
|
1089
1124
|
}, attr(e, r, n) {
|
|
1090
|
-
if (!e.node ||
|
|
1091
|
-
if (!n && T(r)) return r =
|
|
1092
|
-
if (T(r) && n) switch (r =
|
|
1125
|
+
if (!e.node || u(e.node, Text, Comment)) return e;
|
|
1126
|
+
if (!n && T(r)) return r = N(r), r === "class" ? [...e.node.classList].join(" ") : e.node.getAttribute(r);
|
|
1127
|
+
if (T(r) && n) switch (r = N(r), true) {
|
|
1093
1128
|
case r.startsWith("data-"):
|
|
1094
1129
|
r = { data: { [r.replace("data-", "")]: n } };
|
|
1095
1130
|
break;
|
|
1096
1131
|
default:
|
|
1097
1132
|
r = { [r]: n };
|
|
1098
1133
|
}
|
|
1099
|
-
return
|
|
1100
|
-
}, before:
|
|
1101
|
-
return
|
|
1134
|
+
return u(r, Object) && !e.is.empty && Le(e.node, r), e;
|
|
1135
|
+
}, before: le, beforeMe: le, clear(e) {
|
|
1136
|
+
return E(e, oe);
|
|
1102
1137
|
}, closest(e, r) {
|
|
1103
1138
|
let n = T(r) ? e.node?.closest(r) : void 0;
|
|
1104
1139
|
return n ? t(n) : e;
|
|
@@ -1106,21 +1141,21 @@ ${r}`), g2;
|
|
|
1106
1141
|
let { node: n } = e;
|
|
1107
1142
|
return n && getComputedStyle(n)[r];
|
|
1108
1143
|
}, css(e, r, n) {
|
|
1109
|
-
return
|
|
1144
|
+
return E(e, (i) => Ke(i, r, n, t));
|
|
1110
1145
|
}, duplicate(e, r = false, n = document.body) {
|
|
1111
1146
|
switch (true) {
|
|
1112
1147
|
case e.is.empty:
|
|
1113
|
-
return
|
|
1148
|
+
return w.error("Duplicating an empty JQx instance is not possible"), e;
|
|
1114
1149
|
default:
|
|
1115
|
-
let
|
|
1116
|
-
return
|
|
1117
|
-
|
|
1118
|
-
}), r ? t(
|
|
1150
|
+
let i = e.collection[0].cloneNode(true);
|
|
1151
|
+
return i.childNodes.forEach((a) => {
|
|
1152
|
+
a.removeAttribute && a?.removeAttribute("id");
|
|
1153
|
+
}), r ? t(i).toDOM(n) : t.virtual(i);
|
|
1119
1154
|
}
|
|
1120
1155
|
}, each(e, r) {
|
|
1121
|
-
return
|
|
1156
|
+
return E(e, r);
|
|
1122
1157
|
}, empty(e) {
|
|
1123
|
-
return
|
|
1158
|
+
return E(e, oe);
|
|
1124
1159
|
}, find(e, r) {
|
|
1125
1160
|
return e.collection.length > 0 ? [...e.first()?.querySelectorAll(r)] : [];
|
|
1126
1161
|
}, find$(e, r) {
|
|
@@ -1134,7 +1169,7 @@ ${r}`), g2;
|
|
|
1134
1169
|
}, hasClass(e, ...r) {
|
|
1135
1170
|
return e.is.empty || !e.node.classList.length ? false : r.find((n) => e.node.classList.contains(n)) && true || false;
|
|
1136
1171
|
}, hide(e) {
|
|
1137
|
-
return
|
|
1172
|
+
return E(e, (r) => W(r, { display: "none !important" }));
|
|
1138
1173
|
}, html(e, r, n) {
|
|
1139
1174
|
switch (true) {
|
|
1140
1175
|
case (e.is.empty && !T(r)):
|
|
@@ -1142,16 +1177,16 @@ ${r}`), g2;
|
|
|
1142
1177
|
case !T(r):
|
|
1143
1178
|
return e.node?.getHTML() ?? "";
|
|
1144
1179
|
default:
|
|
1145
|
-
let
|
|
1146
|
-
return
|
|
1180
|
+
let i = C(`<div>${r.isJQx ? r.HTML.get(true) : r}</div>`);
|
|
1181
|
+
return E(e, (f2) => (f2.textContent = n ? f2.textContent : "", f2.insertAdjacentHTML(t.at.end, i.getHTML())));
|
|
1147
1182
|
}
|
|
1148
|
-
}, htmlFor(e, r, n = "",
|
|
1183
|
+
}, htmlFor(e, r, n = "", i = false) {
|
|
1149
1184
|
if (e.is.empty || !T(r) || !T(n)) return e;
|
|
1150
|
-
let
|
|
1151
|
-
if (
|
|
1152
|
-
let f2 =
|
|
1153
|
-
return
|
|
1154
|
-
|
|
1185
|
+
let a = e.find$(r);
|
|
1186
|
+
if (a.length < 1) return e;
|
|
1187
|
+
let f2 = C(`<span>${n}</span>`);
|
|
1188
|
+
return a.each((S) => {
|
|
1189
|
+
i || (S.textContent = ""), S.insertAdjacentHTML(t.at.end, f2?.getHTML());
|
|
1155
1190
|
}), e;
|
|
1156
1191
|
}, isEmpty(e) {
|
|
1157
1192
|
return !e.node;
|
|
@@ -1159,14 +1194,14 @@ ${r}`), g2;
|
|
|
1159
1194
|
return e.single(r);
|
|
1160
1195
|
}, on(e, r, ...n) {
|
|
1161
1196
|
switch (true) {
|
|
1162
|
-
case (e.is.empty || !
|
|
1197
|
+
case (e.is.empty || !u(r, String, Array) || !T(r) || n.length < 1):
|
|
1163
1198
|
return e;
|
|
1164
1199
|
default:
|
|
1165
1200
|
return t.handle({ type: r, node: e.node, handler: n }), e;
|
|
1166
1201
|
}
|
|
1167
1202
|
}, once(e, r, ...n) {
|
|
1168
1203
|
switch (true) {
|
|
1169
|
-
case (e.is.empty || !
|
|
1204
|
+
case (e.is.empty || !u(r, String, Array) || !T(r) || n.length < 1):
|
|
1170
1205
|
return e;
|
|
1171
1206
|
default:
|
|
1172
1207
|
return t.handle({ type: r, once: true, node: e.node, handler: n }), e;
|
|
@@ -1174,67 +1209,67 @@ ${r}`), g2;
|
|
|
1174
1209
|
}, prepend(e, ...r) {
|
|
1175
1210
|
if (e.is.empty || !r) return;
|
|
1176
1211
|
let n = e.length === 1;
|
|
1177
|
-
for (let
|
|
1178
|
-
if (T(
|
|
1179
|
-
|
|
1180
|
-
let f2 = !/^<(.+)[^>]+>$/m.test(
|
|
1181
|
-
f2 = n ? f2 :
|
|
1212
|
+
for (let i of r) {
|
|
1213
|
+
if (T(i)) {
|
|
1214
|
+
i = i.trim();
|
|
1215
|
+
let f2 = !/^<(.+)[^>]+>$/m.test(i) ? t.text(i) : C(i);
|
|
1216
|
+
f2 = n ? f2 : M(f2), E(e, (S) => S.prepend(f2.cloneNode(true)));
|
|
1182
1217
|
}
|
|
1183
|
-
|
|
1218
|
+
O(i) && E(e, (a) => a.prepend(n ? i : M(i))), i.isJQx && !i.is.empty && (i.collection.length > 1 && i.collection.reverse(), E(e, (a) => E(i, (f2) => a.prepend(n ? f2 : M(f2)))), i.collection.reverse());
|
|
1184
1219
|
}
|
|
1185
1220
|
return e;
|
|
1186
1221
|
}, prependTo(e, r) {
|
|
1187
1222
|
return r.isJQx || (r = t.virtual(r)), r.prepend(e), e;
|
|
1188
1223
|
}, prop(e, r, n) {
|
|
1189
|
-
if (
|
|
1190
|
-
let
|
|
1191
|
-
for (let [
|
|
1192
|
-
if (
|
|
1193
|
-
if (
|
|
1194
|
-
|
|
1195
|
-
if (
|
|
1196
|
-
|
|
1224
|
+
if (u(r, String) && !n) return r.startsWith("data") ? e[0]?.dataset[r.slice(r.indexOf("-") + 1)] : e[0]?.[r];
|
|
1225
|
+
let i = u(r, Object) ? r : { [r]: n };
|
|
1226
|
+
for (let [a, f2] of Object.entries(i)) {
|
|
1227
|
+
if (a = a.trim(), f2 && !ne(a) || !f2) return false;
|
|
1228
|
+
if (a.toLowerCase() === "id") return e[0].id = f2;
|
|
1229
|
+
E(e, (y2) => {
|
|
1230
|
+
if (a.startsWith("data")) return y2.dataset[a.slice(a.indexOf("-") + 1)] = f2;
|
|
1231
|
+
y2[a] = f2;
|
|
1197
1232
|
});
|
|
1198
1233
|
}
|
|
1199
1234
|
return e;
|
|
1200
1235
|
}, remove(e, r) {
|
|
1201
|
-
let n = (
|
|
1236
|
+
let n = (a) => a.remove(), i = () => e.collection = e.collection.filter((a) => document.documentElement.contains(a));
|
|
1202
1237
|
if (r) {
|
|
1203
|
-
let
|
|
1204
|
-
return
|
|
1238
|
+
let a = e.find$(r);
|
|
1239
|
+
return a.is.empty || (E(a, n), i()), e;
|
|
1205
1240
|
}
|
|
1206
|
-
return
|
|
1241
|
+
return E(e, n), i(), e;
|
|
1207
1242
|
}, rmAttr(e, ...r) {
|
|
1208
1243
|
for (let n of r) e.node.removeAttribute(n);
|
|
1209
1244
|
return e;
|
|
1210
1245
|
}, removeClass(e, ...r) {
|
|
1211
|
-
return
|
|
1212
|
-
if (n) for (let
|
|
1246
|
+
return E(e, (n) => {
|
|
1247
|
+
if (n) for (let i of r) n.classList.remove(i);
|
|
1213
1248
|
});
|
|
1214
1249
|
}, renderTo(e, r, n) {
|
|
1215
|
-
return r =
|
|
1250
|
+
return r = u(r, HTMLElement) || r.isJQx ? r : document.body, n = u(n, String) && t.at[n] ? n : t.at.end, e.first$().toDOM(r, n), e;
|
|
1216
1251
|
}, replace(e, r, n) {
|
|
1217
|
-
let
|
|
1218
|
-
return !r || !
|
|
1252
|
+
let i = e.node;
|
|
1253
|
+
return !r || !u(n, HTMLElement) && !n?.isJQx ? (t.logger.error("JQx replace: invalid replacement value"), e) : ((n.isJQx || u(n, NodeList)) && (n = n[0]), i && r && (r = u(r, String) ? i.querySelectorAll(r) : r.isJQx ? r.collection : r, u(r, HTMLElement, NodeList, Array) && u(n, HTMLElement) && (u(r, HTMLElement) ? [r] : [...r]).forEach((a) => a.replaceWith(n.cloneNode(true)))), e);
|
|
1219
1254
|
}, replaceClass(e, r, ...n) {
|
|
1220
|
-
return
|
|
1221
|
-
|
|
1222
|
-
for (let
|
|
1255
|
+
return E(e, (i) => {
|
|
1256
|
+
i.classList.remove(r);
|
|
1257
|
+
for (let a of n) i.classList.add(a);
|
|
1223
1258
|
});
|
|
1224
1259
|
}, replaceMe(e, r) {
|
|
1225
1260
|
return e.replaceWith(r);
|
|
1226
1261
|
}, replaceWith(e, r) {
|
|
1227
|
-
return r =
|
|
1262
|
+
return r = u(r, Element) ? r : r.isJQx ? r[0] : void 0, r && (e[0].replaceWith(r), e = t.virtual(r)), e;
|
|
1228
1263
|
}, setData(e, r) {
|
|
1229
|
-
return
|
|
1264
|
+
return E(e, (n) => ie(n, r));
|
|
1230
1265
|
}, show(e) {
|
|
1231
|
-
return
|
|
1266
|
+
return E(e, (r) => W(r, { display: "revert-layer !important" }));
|
|
1232
1267
|
}, single(e, r) {
|
|
1233
1268
|
let n = e.collection.length > 0;
|
|
1234
1269
|
switch (r = r ?? 0, true) {
|
|
1235
|
-
case (n &&
|
|
1270
|
+
case (n && u(r, String)):
|
|
1236
1271
|
return e.find$(r);
|
|
1237
|
-
case (n &&
|
|
1272
|
+
case (n && u(r, Number)):
|
|
1238
1273
|
return t(e.collection[r]);
|
|
1239
1274
|
case n:
|
|
1240
1275
|
return e.collection[0];
|
|
@@ -1242,262 +1277,262 @@ ${r}`), g2;
|
|
|
1242
1277
|
return e;
|
|
1243
1278
|
}
|
|
1244
1279
|
}, style(e, r, n) {
|
|
1245
|
-
return
|
|
1246
|
-
n &&
|
|
1280
|
+
return E(e, (a) => {
|
|
1281
|
+
n && u(r, String) && (r = { [r]: n || "none" }), W(a, r);
|
|
1247
1282
|
});
|
|
1248
1283
|
}, text(e, r, n = false) {
|
|
1249
1284
|
switch (true) {
|
|
1250
1285
|
case e.isEmpty():
|
|
1251
1286
|
return e;
|
|
1252
|
-
case !
|
|
1287
|
+
case !u(r, String):
|
|
1253
1288
|
return e.node.textContent;
|
|
1254
1289
|
default:
|
|
1255
|
-
return
|
|
1290
|
+
return E(e, (i) => i.textContent = n ? i.textContent + r : r);
|
|
1256
1291
|
}
|
|
1257
|
-
}, toDOM(e, r = document.body, n =
|
|
1258
|
-
return e.isVirtual = false,
|
|
1292
|
+
}, toDOM(e, r = document.body, n = L.BeforeEnd) {
|
|
1293
|
+
return e.isVirtual = false, D(e.collection, r, n), e;
|
|
1259
1294
|
}, toggleClass(e, r) {
|
|
1260
|
-
return
|
|
1295
|
+
return E(e, (n) => n.classList.toggle(r));
|
|
1261
1296
|
}, toNodeList(e) {
|
|
1262
1297
|
return [...e.collection].map((r) => document.importNode(r, true));
|
|
1263
|
-
}, trigger(e, r, n,
|
|
1264
|
-
n =
|
|
1265
|
-
let
|
|
1266
|
-
return e.is.empty || e.each((f2) => f2.dispatchEvent(
|
|
1298
|
+
}, trigger(e, r, n, i) {
|
|
1299
|
+
n = u(n, Function) ? n : Event, i = u(i, Object) ? { ...i, bubbles: i.bubbles ?? true } : { bubbles: true };
|
|
1300
|
+
let a = new n(r, i);
|
|
1301
|
+
return e.is.empty || e.each((f2) => f2.dispatchEvent(a)), e;
|
|
1267
1302
|
}, val(e, r) {
|
|
1268
1303
|
switch (true) {
|
|
1269
|
-
case (e.is.empty || !
|
|
1304
|
+
case (e.is.empty || !u(e.node, HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement)):
|
|
1270
1305
|
return e;
|
|
1271
|
-
case !
|
|
1306
|
+
case !u(r, String):
|
|
1272
1307
|
return e.node.value;
|
|
1273
1308
|
default:
|
|
1274
|
-
return e.node.value =
|
|
1309
|
+
return e.node.value = u(r, String) ? r : "", e;
|
|
1275
1310
|
}
|
|
1276
1311
|
} };
|
|
1277
1312
|
}
|
|
1278
|
-
var
|
|
1279
|
-
var
|
|
1280
|
-
var { isComment:
|
|
1281
|
-
function
|
|
1282
|
-
return { ...
|
|
1313
|
+
var $e;
|
|
1314
|
+
var de;
|
|
1315
|
+
var { isComment: tn, isText: rn, isHtmlString: nn, isArrayOfHtmlElements: on, isArrayOfHtmlStrings: sn, ElemArray2HtmlString: an, cssRuleEdit: Pe, addFn: Zt } = Kt();
|
|
1316
|
+
function Kt() {
|
|
1317
|
+
return { ...Ge(), addFn: qt };
|
|
1283
1318
|
}
|
|
1284
|
-
function
|
|
1285
|
-
return t = t?.trim(), !T(t) || !
|
|
1319
|
+
function qt(t, e) {
|
|
1320
|
+
return t = t?.trim(), !T(t) || !u(e, Function) ? w.error("JQx.fn: method invalid parameter(s)") : de[t] = (r, ...n) => e(r, ...n);
|
|
1286
1321
|
}
|
|
1287
|
-
function
|
|
1322
|
+
function er(t) {
|
|
1288
1323
|
return function(e, r, n) {
|
|
1289
|
-
if (e = e?.trim(), !T(e) || !
|
|
1290
|
-
let
|
|
1324
|
+
if (e = e?.trim(), !T(e) || !u(r, Function)) return t.error("JQx.staticFn: invalid parameter(s)");
|
|
1325
|
+
let i = n ? { get() {
|
|
1291
1326
|
return r();
|
|
1292
|
-
} } : { value(...
|
|
1293
|
-
return r(...
|
|
1327
|
+
} } : { value(...a) {
|
|
1328
|
+
return r(...a);
|
|
1294
1329
|
} };
|
|
1295
1330
|
try {
|
|
1296
|
-
Object.defineProperty(t, e,
|
|
1331
|
+
Object.defineProperty(t, e, i);
|
|
1297
1332
|
} catch {
|
|
1298
1333
|
return t.warn(`JQx.staticFn: extension [${e}] already exists`);
|
|
1299
1334
|
}
|
|
1300
|
-
return
|
|
1335
|
+
return w.log(`JQx: added static extension function [${e}]`);
|
|
1301
1336
|
};
|
|
1302
1337
|
}
|
|
1303
|
-
function
|
|
1304
|
-
return new Proxy(t, Object.freeze({ get: (e, r) =>
|
|
1338
|
+
function V(t) {
|
|
1339
|
+
return new Proxy(t, Object.freeze({ get: (e, r) => tr(e, r, t) }));
|
|
1305
1340
|
}
|
|
1306
|
-
function
|
|
1307
|
-
return (...r) =>
|
|
1341
|
+
function et(t, e) {
|
|
1342
|
+
return (...r) => u(t, Function) && t(V(e), ...r);
|
|
1308
1343
|
}
|
|
1309
|
-
function
|
|
1344
|
+
function tr(t, e, r) {
|
|
1310
1345
|
switch (true) {
|
|
1311
|
-
case
|
|
1312
|
-
return
|
|
1313
|
-
case
|
|
1346
|
+
case u(e, Symbol):
|
|
1347
|
+
return A({ trial: () => t[e], whenError: () => t });
|
|
1348
|
+
case u(+e, Number):
|
|
1314
1349
|
return t.collection?.[e] || void 0;
|
|
1315
|
-
case e in
|
|
1316
|
-
return
|
|
1317
|
-
case e in
|
|
1318
|
-
return
|
|
1350
|
+
case e in $e:
|
|
1351
|
+
return et($e[e], r)();
|
|
1352
|
+
case e in de:
|
|
1353
|
+
return et(de[e], r);
|
|
1319
1354
|
default:
|
|
1320
1355
|
return t[e];
|
|
1321
1356
|
}
|
|
1322
1357
|
}
|
|
1323
|
-
function
|
|
1324
|
-
let e =
|
|
1358
|
+
function nt(t) {
|
|
1359
|
+
let e = sr(t);
|
|
1325
1360
|
for (let [r, n] of Object.entries(Object.getOwnPropertyDescriptors(e))) Object.defineProperty(t, r, n);
|
|
1326
1361
|
return t;
|
|
1327
1362
|
}
|
|
1328
|
-
function
|
|
1363
|
+
function rr(t) {
|
|
1329
1364
|
return { allow(e) {
|
|
1330
1365
|
let r = /-/.test(e), n = r && e;
|
|
1331
|
-
e = r ?
|
|
1366
|
+
e = r ? z(e) : e.toLowerCase(), P.allowTag(e), Object.defineProperties(t, Oe(e, true, t, n));
|
|
1332
1367
|
}, prohibit(e) {
|
|
1333
|
-
e = e.toLowerCase(),
|
|
1368
|
+
e = e.toLowerCase(), P.prohibitTag(e), Object.defineProperties(t, Oe(e, false, t));
|
|
1334
1369
|
} };
|
|
1335
1370
|
}
|
|
1336
|
-
function
|
|
1371
|
+
function tt(...t) {
|
|
1337
1372
|
if (t.length === 1) {
|
|
1338
1373
|
let e = String(t.shift().trim());
|
|
1339
1374
|
t = e.startsWith("!") ? [e.slice(1, -1)] : e.split(",").map((r) => r.trim());
|
|
1340
1375
|
}
|
|
1341
|
-
for (let e of t.map((r) => r.startsWith("!") ? r.slice(1, -1) : r))
|
|
1376
|
+
for (let e of t.map((r) => r.startsWith("!") ? r.slice(1, -1) : r)) Pe(e, { removeRule: 1 });
|
|
1342
1377
|
}
|
|
1343
|
-
function
|
|
1378
|
+
function nr(t) {
|
|
1344
1379
|
return function(e, r, n) {
|
|
1345
|
-
r = r?.isJQx ? r?.[0] : r, n = n && Object.values(
|
|
1346
|
-
let
|
|
1347
|
-
if (r && !
|
|
1348
|
-
return
|
|
1380
|
+
r = r?.isJQx ? r?.[0] : r, n = n && Object.values(L).find((a) => n === a);
|
|
1381
|
+
let i = t(e, document.createElement("br"));
|
|
1382
|
+
if (r && !u(r, HTMLBRElement)) for (let a of i.collection) n ? r.insertAdjacentElement(n, a) : r.append(a);
|
|
1383
|
+
return i;
|
|
1349
1384
|
};
|
|
1350
1385
|
}
|
|
1351
|
-
function
|
|
1386
|
+
function or(...t) {
|
|
1352
1387
|
let e = {};
|
|
1353
1388
|
for (let r of t) {
|
|
1354
1389
|
let n = Object.getOwnPropertyDescriptors(r);
|
|
1355
|
-
for (let [
|
|
1390
|
+
for (let [i, a] of Object.entries(n)) !(i in e) && Object.defineProperty(e, i, { ...a, enumerable: false });
|
|
1356
1391
|
}
|
|
1357
1392
|
return e;
|
|
1358
1393
|
}
|
|
1359
|
-
function
|
|
1360
|
-
return t =
|
|
1361
|
-
return (...
|
|
1362
|
-
let
|
|
1363
|
-
return
|
|
1394
|
+
function ir(t, e, r, n) {
|
|
1395
|
+
return t = N(n || t.toLowerCase()), { get() {
|
|
1396
|
+
return (...i) => {
|
|
1397
|
+
let a = e && r.virtual(I(U[t](...i))) || void 0, S = !u(a?.node, Comment, Text, void 0) ? Te(a) : "";
|
|
1398
|
+
return w.log(e ? `JQx: created (virtual) instance from [JQx].${t} ${S}` : `JQx: ${t.toUpperCase()} is prohibited. Use [JQx].allowTag if necessary.`), a;
|
|
1364
1399
|
};
|
|
1365
1400
|
}, enumerable: false, configurable: true };
|
|
1366
1401
|
}
|
|
1367
|
-
function
|
|
1402
|
+
function Oe(t, e, r, n) {
|
|
1368
1403
|
t = t.toLowerCase();
|
|
1369
|
-
let
|
|
1370
|
-
return n ? { [n]:
|
|
1371
|
-
}
|
|
1372
|
-
function ir(t) {
|
|
1373
|
-
return nr(Object.entries(O.tagsRaw).reduce(sr(t), {}), dr(t));
|
|
1404
|
+
let i = ir(t, e, r, n);
|
|
1405
|
+
return n ? { [n]: i, [z(n)]: i } : { [t]: i, [t.toUpperCase()]: i };
|
|
1374
1406
|
}
|
|
1375
1407
|
function sr(t) {
|
|
1408
|
+
return or(Object.entries(P.tagsRaw).reduce(ar(t), {}), mr(t));
|
|
1409
|
+
}
|
|
1410
|
+
function ar(t) {
|
|
1376
1411
|
return function(e, [r, n]) {
|
|
1377
|
-
return Object.defineProperties(e,
|
|
1412
|
+
return Object.defineProperties(e, Oe(r, n, t)), e;
|
|
1378
1413
|
};
|
|
1379
1414
|
}
|
|
1380
1415
|
function lr(t) {
|
|
1381
1416
|
return function(e, r, ...n) {
|
|
1382
|
-
|
|
1417
|
+
u(r, Function) && (n.push(r), r = void 0), t({ type: e, selector: r, handlers: n });
|
|
1383
1418
|
};
|
|
1384
1419
|
}
|
|
1385
|
-
function
|
|
1420
|
+
function ur(t) {
|
|
1386
1421
|
return function(e) {
|
|
1387
|
-
let { type: r, types: n, origin:
|
|
1388
|
-
f2 =
|
|
1389
|
-
let
|
|
1390
|
-
f2 =
|
|
1391
|
-
let c = { type:
|
|
1422
|
+
let { type: r, types: n, origin: i, selector: a, handler: f2, handlers: S, node: y2, name: x2, capture: d, once: b2, about: m2 } = e;
|
|
1423
|
+
f2 = S || f2, r = n || r, a = i || a;
|
|
1424
|
+
let h = Ce(r), g2 = x2;
|
|
1425
|
+
f2 = u(f2, Function) ? [f2] : f2;
|
|
1426
|
+
let c = { type: h, selector: a || i, capture: d, name: g2, once: b2, node: y2, about: m2 };
|
|
1392
1427
|
switch (true) {
|
|
1393
|
-
case (
|
|
1394
|
-
for (let
|
|
1428
|
+
case (u(h, Array) && h.length > 0):
|
|
1429
|
+
for (let o of h) c.type = o, rt(f2, c, t);
|
|
1395
1430
|
break;
|
|
1396
1431
|
default:
|
|
1397
|
-
return
|
|
1432
|
+
return rt(f2, c, t);
|
|
1398
1433
|
}
|
|
1399
1434
|
};
|
|
1400
1435
|
}
|
|
1401
|
-
function
|
|
1436
|
+
function rt(t, e, r) {
|
|
1402
1437
|
for (let n of t) r.listen({ ...e, handler: n });
|
|
1403
1438
|
}
|
|
1404
|
-
function
|
|
1439
|
+
function cr(t) {
|
|
1405
1440
|
return function(e, r) {
|
|
1406
1441
|
return r = T(r) && r, e = T(e) && e, r && e && t.listenerStore[e][r];
|
|
1407
1442
|
};
|
|
1408
1443
|
}
|
|
1409
|
-
function cr(t) {
|
|
1410
|
-
return t.activePopup || Object.defineProperty(t, "activePopup", { value: te(t), enumerable: false }), t.activePopup;
|
|
1411
|
-
}
|
|
1412
1444
|
function fr(t) {
|
|
1413
|
-
|
|
1414
|
-
return W({ createWithId: d || `jqx${de()}` });
|
|
1415
|
-
}, n = function(...d) {
|
|
1416
|
-
for (let h of d) Me(h);
|
|
1417
|
-
}, o = tr(t), s = re(t), f2 = ar(s);
|
|
1418
|
-
return { editCssRule: e, createStyle: r, editCssRules: n, allowProhibit: o, handle: f2, capturedHandling: f2, log: (...d) => L.on.log(...d).off, warn: (...d) => L.on.warn(...d).off, error: (...d) => L.on.error(...d).off, handlerWrapper: s };
|
|
1445
|
+
return t.activePopup || Object.defineProperty(t, "activePopup", { value: K(t), enumerable: false }), t.activePopup;
|
|
1419
1446
|
}
|
|
1420
1447
|
function dr(t) {
|
|
1421
|
-
let
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1448
|
+
let e = (d, b2) => Pe(d, b2), r = function(d) {
|
|
1449
|
+
return Q({ createWithId: d || `jqx${ue()}` });
|
|
1450
|
+
}, n = function(...d) {
|
|
1451
|
+
for (let b2 of d) Pe(b2);
|
|
1452
|
+
}, i = rr(t), a = q(t), f2 = ur(a);
|
|
1453
|
+
return { editCssRule: e, createStyle: r, editCssRules: n, allowProhibit: i, handle: f2, capturedHandling: f2, log: (...d) => w.on.log(...d).off, warn: (...d) => w.on.warn(...d).off, error: (...d) => w.on.error(...d).off, handlerWrapper: a };
|
|
1454
|
+
}
|
|
1455
|
+
function mr(t) {
|
|
1456
|
+
let { factoryExtensions: e, instanceExtensions: r } = qe(t);
|
|
1457
|
+
$e = e, de = r;
|
|
1458
|
+
let { editCssRule: n, createStyle: i, editCssRules: a, allowProhibit: f2, handle: S, capturedHandling: y2, log: x2, warn: d, error: b2, handlerWrapper: m2 } = dr(t), h = cr(t), g2 = er(t);
|
|
1459
|
+
return { log: x2, warn: d, error: b2, editCssRules: a, createStyle: i, editStylesheet: i, editCssRule: n, escHtml: H, logger: w, text(c, o = false) {
|
|
1460
|
+
return o ? t.comment(c) : document.createTextNode(c);
|
|
1461
|
+
}, node(c, o = document) {
|
|
1462
|
+
return o.querySelector(c, o);
|
|
1463
|
+
}, nodes(c, o = document) {
|
|
1464
|
+
return [...o.querySelectorAll(c, o)];
|
|
1465
|
+
}, clearAllTimers: we, get staticFn() {
|
|
1466
|
+
return function(c, o, s) {
|
|
1467
|
+
return g2(c, o, s);
|
|
1433
1468
|
};
|
|
1434
1469
|
}, get toBool() {
|
|
1435
1470
|
return Ne;
|
|
1436
1471
|
}, get getNamedListener() {
|
|
1437
|
-
return
|
|
1472
|
+
return h;
|
|
1438
1473
|
}, get virtual() {
|
|
1439
|
-
return
|
|
1474
|
+
return nr(t);
|
|
1440
1475
|
}, get allowTag() {
|
|
1441
1476
|
return f2.allow;
|
|
1442
1477
|
}, get prohibitTag() {
|
|
1443
1478
|
return f2.prohibit;
|
|
1444
1479
|
}, get removeCssRule() {
|
|
1445
|
-
return
|
|
1480
|
+
return tt;
|
|
1446
1481
|
}, get removeCssRules() {
|
|
1447
|
-
return
|
|
1482
|
+
return tt;
|
|
1448
1483
|
}, get delegate() {
|
|
1449
|
-
return lr(
|
|
1484
|
+
return lr(y2);
|
|
1450
1485
|
}, get delegateCaptured() {
|
|
1451
|
-
return
|
|
1486
|
+
return y2;
|
|
1452
1487
|
}, get handle() {
|
|
1453
|
-
return
|
|
1488
|
+
return y2;
|
|
1454
1489
|
}, get listen() {
|
|
1455
|
-
return
|
|
1490
|
+
return m2.listen;
|
|
1456
1491
|
}, get at() {
|
|
1457
|
-
return
|
|
1492
|
+
return L;
|
|
1458
1493
|
}, get setStyle() {
|
|
1459
1494
|
return n;
|
|
1460
1495
|
}, get fn() {
|
|
1461
|
-
return
|
|
1496
|
+
return Zt;
|
|
1462
1497
|
}, get lenient() {
|
|
1463
|
-
return
|
|
1498
|
+
return P.allowUnknownHtmlTags;
|
|
1464
1499
|
}, get IS() {
|
|
1465
|
-
return
|
|
1500
|
+
return u;
|
|
1466
1501
|
}, get Popup() {
|
|
1467
|
-
return
|
|
1502
|
+
return fr(t);
|
|
1468
1503
|
}, get listenerStore() {
|
|
1469
|
-
return
|
|
1504
|
+
return m2.ListenerStore;
|
|
1470
1505
|
} };
|
|
1471
1506
|
}
|
|
1472
|
-
var
|
|
1473
|
-
function
|
|
1474
|
-
return function(e, r, n =
|
|
1507
|
+
var ot = nt(gr());
|
|
1508
|
+
function gr() {
|
|
1509
|
+
return function(e, r, n = L.BeforeEnd) {
|
|
1475
1510
|
if (e?.isJQx) return e;
|
|
1476
|
-
let
|
|
1477
|
-
r = (!
|
|
1478
|
-
let
|
|
1479
|
-
if (
|
|
1480
|
-
r.contains(d) ||
|
|
1481
|
-
}),
|
|
1482
|
-
if (
|
|
1483
|
-
if ([e].flat().forEach((d) =>
|
|
1484
|
-
let d =
|
|
1485
|
-
|
|
1486
|
-
let
|
|
1487
|
-
|
|
1488
|
-
let
|
|
1489
|
-
|
|
1511
|
+
let i = u(r, HTMLBRElement);
|
|
1512
|
+
r = (!i && r && r.isJQx ? r[0] : r) || document.body, n = n && Object.values(L).find((d) => n === d) ? n : void 0;
|
|
1513
|
+
let a = Y(e), S = !a && fe(e) || a, y2 = { collection: se(e) ?? [], isVirtual: i, isJQx: true }, x2 = _(y2.collection);
|
|
1514
|
+
if (y2.collection.length && x2) return i || y2.collection.forEach((d) => {
|
|
1515
|
+
r.contains(d) || D([d], r, n);
|
|
1516
|
+
}), V(y2);
|
|
1517
|
+
if (S) {
|
|
1518
|
+
if ([e].flat().forEach((d) => y2.collection.push(C(d))), y2.collection.length > 0) {
|
|
1519
|
+
let d = y2.collection.filter((g2) => g2?.dataset?.jqxcreationerror);
|
|
1520
|
+
y2.collection = y2.collection.filter((g2) => !g2?.dataset?.jqxcreationerror);
|
|
1521
|
+
let m2 = y2.collection.map((g2) => `${String(g2.constructor).split(/function|\(/)[1].trim()}`).length > 1;
|
|
1522
|
+
y2 = V(y2);
|
|
1523
|
+
let h = y2.collection.length > 0 ? Xe(y2) : "sanitized: no elements remaining";
|
|
1524
|
+
w.log(`JQx: created ${y2.isVirtual ? "(virtual)" : ""} instance from ${m2 ? "array of " : ""}HTML string${m2 ? "s" : ""} ${h}`), y2.isVirtual || D(y2.collection, r, n);
|
|
1490
1525
|
}
|
|
1491
|
-
return
|
|
1526
|
+
return y2;
|
|
1492
1527
|
}
|
|
1493
|
-
return
|
|
1528
|
+
return Ae(e, r, y2), V(y2);
|
|
1494
1529
|
};
|
|
1495
1530
|
}
|
|
1496
|
-
var
|
|
1531
|
+
var mn = ot;
|
|
1497
1532
|
|
|
1498
1533
|
// ../node_modules/ticktock-es/Bundle/index.min.js
|
|
1499
|
-
var [Z2,
|
|
1500
|
-
var C2 = { fixed: { MM: { month: q2 }, M: { month: H2 }, m: { month:
|
|
1534
|
+
var [Z2, w2, q2, H2] = ["2-digit", "numeric", "long", "short"];
|
|
1535
|
+
var C2 = { fixed: { MM: { month: q2 }, M: { month: H2 }, m: { month: w2 }, mm: { month: Z2 }, yyyy: { year: w2 }, yy: { year: Z2 }, WD: { weekday: q2 }, wd: { weekday: H2 }, d: { day: w2 }, dd: { day: Z2 }, h: { hour: w2 }, hh: { hour: Z2 }, mi: { minute: w2 }, mmi: { minute: Z2 }, s: { second: w2 }, ss: { second: Z2 }, ms: { fractionalSecondDigits: 3 }, tz: { timeZoneName: "shortOffset" }, dl: { locale: "default" }, h12: { hour12: false }, yn: { yearName: "" }, ry: { relatedYear: true }, msp: { fractionalSecond: true } }, dynamic: { tzn: (e) => ({ timeZoneName: e.slice(4) }), hrc: (e) => ({ hourCycle: `h${e.slice(4)}` }), ds: (e) => ({ dateStyle: e.slice(3) }), ts: (e) => ({ timeStyle: e.slice(3) }), tz: (e) => ({ timeZone: e.slice(3) }), e: (e) => ({ era: e.slice(2) }), l: (e) => ({ locale: e.slice(2) }) } };
|
|
1501
1536
|
var b = { ...C2, retrieveDynamic(e) {
|
|
1502
1537
|
let r = e?.slice(0, e?.indexOf(":"));
|
|
1503
1538
|
return C2.dynamic[r] && C2.dynamic[r](e);
|
|
@@ -1506,9 +1541,9 @@ ${r}`), g2;
|
|
|
1506
1541
|
} };
|
|
1507
1542
|
var v = xe2;
|
|
1508
1543
|
function xe2(e, r, n = "l:default") {
|
|
1509
|
-
return /ds:|ts:/.test(n) ? Pe2(e,
|
|
1544
|
+
return /ds:|ts:/.test(n) ? Pe2(e, me(void 0), n) : Ee2(e, me(r || void 0), n);
|
|
1510
1545
|
}
|
|
1511
|
-
function
|
|
1546
|
+
function me(e = "dtf") {
|
|
1512
1547
|
let r = ` ${e.replace(/[{}]/g, "").trim()} `, n = e.match(/(?<=\{)(.+?)(?=})/g) || [];
|
|
1513
1548
|
return { set formatStr(t) {
|
|
1514
1549
|
r = t;
|
|
@@ -1516,23 +1551,23 @@ ${r}`), g2;
|
|
|
1516
1551
|
return r;
|
|
1517
1552
|
}, get units() {
|
|
1518
1553
|
return r.match(b.re) || [];
|
|
1519
|
-
}, finalize(t = "",
|
|
1520
|
-
return r.replace(/~([\d+]?)/g, "$1").replace(/dtf/, t).replace(/era/, o).replace(/dp\b|~dp\b/,
|
|
1554
|
+
}, finalize(t = "", a = "", o = "", s = "") {
|
|
1555
|
+
return r.replace(/~([\d+]?)/g, "$1").replace(/dtf/, t).replace(/era/, o).replace(/dp\b|~dp\b/, a).replace(/yn\b/, s).replace(/\[(\d+?)]/g, (u2, l) => n[l].trim()).trim();
|
|
1521
1556
|
} };
|
|
1522
1557
|
}
|
|
1523
1558
|
function fe2(...e) {
|
|
1524
1559
|
return e?.reduce((r, n) => ({ ...r, ...b.retrieveDynamic(n) || b.fixed[n] }), b.fixed.dl);
|
|
1525
1560
|
}
|
|
1526
1561
|
function Pe2(e, r, n) {
|
|
1527
|
-
let t = fe2(...de2(n).split(",")),
|
|
1528
|
-
return r.finalize(
|
|
1562
|
+
let t = fe2(...de2(n).split(",")), a = Intl.DateTimeFormat(t.locale, t).format(e);
|
|
1563
|
+
return r.finalize(a);
|
|
1529
1564
|
}
|
|
1530
1565
|
function Ye2(e, r) {
|
|
1531
1566
|
return e === "numeric" && r.startsWith("0") ? r.slice(1) : r;
|
|
1532
1567
|
}
|
|
1533
1568
|
function Ee2(e, r, n) {
|
|
1534
|
-
let t = fe2(...r.units.concat(de2(n).split(",")).flat()),
|
|
1535
|
-
return
|
|
1569
|
+
let t = fe2(...r.units.concat(de2(n).split(",")).flat()), a = { ...b.fixed }, o = Intl.DateTimeFormat(t.locale, t).formatToParts(e).reduce((s, u2) => u2.type === "literal" && /[ ,/-]/.test(u2.value) ? s : { ...s, [u2.type]: Ye2(t[u2.type], u2.value) }, {});
|
|
1570
|
+
return a.ms = t.fractionalSecondDigits ? a.msp : a.ms, a.yyyy = o.relatedYear ? a.ry : a.yyyy, r.formatStr = r.formatStr.replace(b.re, (s) => /^(M|MM)$/.test(s) ? Ve2(e, t.locale, t.timeZone, /^M$/.test(s)) : o[Object.keys(a[s]).shift()] || s), r.finalize(void 0, o.dayPeriod, o.era, o.yearName);
|
|
1536
1571
|
}
|
|
1537
1572
|
function Ve2(e, r, n, t) {
|
|
1538
1573
|
return e.toLocaleString(r, { timeZone: n, month: t ? H2 : q2 });
|
|
@@ -1540,74 +1575,74 @@ ${r}`), g2;
|
|
|
1540
1575
|
function de2(e) {
|
|
1541
1576
|
return e.replace(/\s+/g, "");
|
|
1542
1577
|
}
|
|
1543
|
-
var
|
|
1578
|
+
var ge = qe2;
|
|
1544
1579
|
function qe2() {
|
|
1545
|
-
let e = (t,
|
|
1546
|
-
let o = isNaN(new Date(t)), s = isNaN(new Date(
|
|
1580
|
+
let e = (t, a) => {
|
|
1581
|
+
let o = isNaN(new Date(t)), s = isNaN(new Date(a));
|
|
1547
1582
|
if (s) {
|
|
1548
|
-
let [
|
|
1549
|
-
return { error: true, message:
|
|
1583
|
+
let [u2, l, i] = Array(3).fill("end date not valid");
|
|
1584
|
+
return { error: true, message: u2, full: l, clean: i };
|
|
1550
1585
|
}
|
|
1551
1586
|
if (o) {
|
|
1552
|
-
let [
|
|
1553
|
-
return { error: true, message:
|
|
1587
|
+
let [u2, l, i] = Array(3).fill("start date not valid");
|
|
1588
|
+
return { error: true, message: u2, full: l, clean: i };
|
|
1554
1589
|
}
|
|
1555
1590
|
if (o && !s) {
|
|
1556
|
-
let [
|
|
1557
|
-
return { error: true, message:
|
|
1591
|
+
let [u2, l, i] = Array(3).fill("start- and/or end date are not valid");
|
|
1592
|
+
return { error: true, message: u2, full: l, clean: i };
|
|
1558
1593
|
}
|
|
1559
1594
|
return { error: false };
|
|
1560
1595
|
}, r = n();
|
|
1561
|
-
return function({ start: t, end:
|
|
1562
|
-
let s = e(t,
|
|
1596
|
+
return function({ start: t, end: a, diffs: o = {} } = {}) {
|
|
1597
|
+
let s = e(t, a), u2 = a > t ? "+" : "-";
|
|
1563
1598
|
if (s.error) return s;
|
|
1564
|
-
let l = Math.abs(t -
|
|
1565
|
-
o = { ...o, fromUTC: t, toUTC:
|
|
1599
|
+
let l = Math.abs(t - a), i = new Date(l), c = i.getUTCFullYear() - 1970, d = i.getUTCMonth(), h = i.getUTCDate() - 1, F = h % 7, le2 = Math.floor(h / 7), p = i.getUTCHours(), $2 = i.getUTCMinutes(), S = i.getUTCSeconds(), Le2 = i.getUTCMilliseconds(), je2 = Math.floor(l / 864e5);
|
|
1600
|
+
o = { ...o, fromUTC: t, toUTC: a, sign: "", years: c, months: d, days: h, hours: p, minutes: $2, seconds: S, milliseconds: Le2, diffInDays: je2 }, o.full = r({ values: o, full: true }), o.clean = r({ values: o }), o.equalDates = o.clean === "Dates are equal";
|
|
1566
1601
|
let ce2 = p + $2 + S > 0 ? "T" : "";
|
|
1567
|
-
return o.clean !== "Dates are equal" && (o.sign =
|
|
1602
|
+
return o.clean !== "Dates are equal" && (o.sign = u2, o.jsPeriod = `${u2}P${c > 0 ? `${c}Y` : ""}${d > 0 ? `${d}M` : ""}${le2 > 0 ? `${le2}W` : ""}${F > 0 ? `${F}D` : ""}${ce2}${p > 0 ? `${p}H` : ""}${$2 > 0 ? `${$2}M` : ""}${S > 0 ? `${S}S` : ""}`, o.ISOPeriod = `P${c > 0 ? `${c}Y` : ""}${d > 0 ? `${d}M` : ""}${h > 0 ? `${h}D` : ""}${ce2}${p > 0 ? `${p}H` : ""}${$2 > 0 ? `${$2}M` : ""}${S > 0 ? `${S}S` : ""}`), o;
|
|
1568
1603
|
};
|
|
1569
1604
|
function n() {
|
|
1570
|
-
let t = (...i) => (c) => i.reduce((d, h) => h(d), c),
|
|
1571
|
-
return t(({ values: i, full: c }) => [Object.entries(i).filter(([d]) => /^(years|month|days|hours|minutes|seconds)/i.test(d)), c], ([i, c]) => c ? i : i.filter(([, d]) => c ? +d : d > 0), (i) => i.reduce((c, [d, h]) => [...c, `${h} ${
|
|
1605
|
+
let t = (...i) => (c) => i.reduce((d, h) => h(d), c), a = (i, c) => i === 1 ? c.slice(0, -1) : c;
|
|
1606
|
+
return t(({ values: i, full: c }) => [Object.entries(i).filter(([d]) => /^(years|month|days|hours|minutes|seconds)/i.test(d)), c], ([i, c]) => c ? i : i.filter(([, d]) => c ? +d : d > 0), (i) => i.reduce((c, [d, h]) => [...c, `${h} ${a(h, d)}`], []), (i) => i.length < 1 ? "Dates are equal" : `${i.slice(0, -1).join(", ")}${i.length > 1 ? " and " : ""}${i.slice(-1).shift()}`);
|
|
1572
1607
|
}
|
|
1573
1608
|
}
|
|
1574
|
-
var
|
|
1609
|
+
var ye2 = He2;
|
|
1575
1610
|
function He2() {
|
|
1576
|
-
let e = Object.entries({ year: "FullYear", month: "Month", date: "Date", day: "Date", hour: "Hours", minute: "Minutes", second: "Seconds", millisecond: "Milliseconds" }).reduce((t, [
|
|
1577
|
-
let
|
|
1578
|
-
return r = t[0].trim().startsWith("subtract,"), r && (t =
|
|
1611
|
+
let e = Object.entries({ year: "FullYear", month: "Month", date: "Date", day: "Date", hour: "Hours", minute: "Minutes", second: "Seconds", millisecond: "Milliseconds" }).reduce((t, [a, o]) => ({ ...t, [a]: o, [`${a}s`]: o }), {}), r = false, n = function(...t) {
|
|
1612
|
+
let a = t.length === 1;
|
|
1613
|
+
return r = t[0].trim().startsWith("subtract,"), r && (t = a ? t[0].trim().replace(/^subtract,/i, "").split(",").map((o) => o.trim()) : t.filter((o) => !o.startsWith("subtract"))), a && !r && (t = t[0].split(",").map((o) => o.trim())), t.map(function(o) {
|
|
1579
1614
|
if (!o) return false;
|
|
1580
1615
|
let s = o.toLowerCase().split(/ {1,}/);
|
|
1581
|
-
return s.length < 2 ? false : s.map((
|
|
1582
|
-
|
|
1583
|
-
let l = parseInt(
|
|
1584
|
-
return Number.isNaN(l) ?
|
|
1616
|
+
return s.length < 2 ? false : s.map((u2) => {
|
|
1617
|
+
u2 = `${u2}`.trim().replace(/[^a-z0-9-+]/g, "");
|
|
1618
|
+
let l = parseInt(u2, 10);
|
|
1619
|
+
return Number.isNaN(l) ? u2 : r ? -l : +l;
|
|
1585
1620
|
});
|
|
1586
1621
|
}).filter((o) => o);
|
|
1587
1622
|
};
|
|
1588
|
-
return function(t, ...
|
|
1589
|
-
if (
|
|
1590
|
-
let o = n(...
|
|
1591
|
-
return o.length && o.forEach(([s,
|
|
1592
|
-
|
|
1623
|
+
return function(t, ...a) {
|
|
1624
|
+
if (a.length < 1) return t;
|
|
1625
|
+
let o = n(...a);
|
|
1626
|
+
return o.length && o.forEach(([s, u2]) => {
|
|
1627
|
+
u2 = u2, u2 = e[u2], s && u2 && t[`set${u2}`](t[`get${u2}`]() + s);
|
|
1593
1628
|
}), t;
|
|
1594
1629
|
};
|
|
1595
1630
|
}
|
|
1596
|
-
var $e2 =
|
|
1597
|
-
var
|
|
1598
|
-
var
|
|
1631
|
+
var $e2 = ge();
|
|
1632
|
+
var Se2 = Re2();
|
|
1633
|
+
var D2 = ye2();
|
|
1599
1634
|
var Ge2 = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
|
1600
1635
|
var Ze2 = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
|
|
1601
1636
|
function G2(e, ...r) {
|
|
1602
|
-
return
|
|
1637
|
+
return D2(e, ...r), e;
|
|
1603
1638
|
}
|
|
1604
1639
|
function we2(e, r = false) {
|
|
1605
1640
|
let n = R2(e.clone, { sunday: r }), t = [n];
|
|
1606
|
-
return { weekStart: n.format("WD", "l:en-GB"), inputDate: e, dates: t.concat([...Array(6)].map((
|
|
1641
|
+
return { weekStart: n.format("WD", "l:en-GB"), inputDate: e, dates: t.concat([...Array(6)].map((a, o) => n.clone.addDays(o + 1))) };
|
|
1607
1642
|
}
|
|
1608
|
-
function W2(e, { start: r, end: n, future: t, past:
|
|
1643
|
+
function W2(e, { start: r, end: n, future: t, past: a, include: o = { start: false, end: false } } = {}) {
|
|
1609
1644
|
let s = e.clone.UTC;
|
|
1610
|
-
return r = r?.value || r?.constructor === Date ? m(r?.value || r).UTC : m.now.UTC, n = n && n?.value || n?.constructor === Date ? m(n?.value || n).UTC : m.now.UTC, s.milliseconds = 0, r.milliseconds = 0, n.milliseconds = 0, t ? r > n :
|
|
1645
|
+
return r = r?.value || r?.constructor === Date ? m(r?.value || r).UTC : m.now.UTC, n = n && n?.value || n?.constructor === Date ? m(n?.value || n).UTC : m.now.UTC, s.milliseconds = 0, r.milliseconds = 0, n.milliseconds = 0, t ? r > n : a ? r < n : (o.start ? +s >= +r : +s > +r) && (o.end ? +s <= +n : +s < +n);
|
|
1611
1646
|
}
|
|
1612
1647
|
function _2(e, { zoneTime: r = false, formatStr: n, moreOptions: t } = {}) {
|
|
1613
1648
|
return t = r ? e.localeInfo.formatOptions + (t ? `,${t}` : "") : f.formatOptions + (t ? `,${t}` : ""), r ? (e.localeInfo || (e.localeInfo = f), v(e, n, t)) : _e2(e, n, t);
|
|
@@ -1616,27 +1651,27 @@ ${r}`), g2;
|
|
|
1616
1651
|
let t = e.clone.relocate(f);
|
|
1617
1652
|
return n = (n || "").startsWith("+") ? `${t.localeInfo.formatOptions},${n.slice(1)}` : n || t.localeInfo.formatOptions, v(t, r, n);
|
|
1618
1653
|
}
|
|
1619
|
-
function
|
|
1654
|
+
function be2(e, r) {
|
|
1620
1655
|
let n = $e2({ start: e, end: r || e });
|
|
1621
1656
|
return parseInt(`${n.sign}${n.diffInDays}`);
|
|
1622
1657
|
}
|
|
1623
1658
|
function B2(e, r = false) {
|
|
1624
|
-
let { locale: n, timeZone: t } = r ? e.localeInfo : f,
|
|
1659
|
+
let { locale: n, timeZone: t } = r ? e.localeInfo : f, a = ue2(n, t), o = e.format("MM|WD", a).split("|");
|
|
1625
1660
|
return { locale: n, timeZone: t, monthName: o[0], dayName: o[1], dayNames: se2(n), monthNames: Y2(n) };
|
|
1626
1661
|
}
|
|
1627
1662
|
function J2(e, r = false) {
|
|
1628
|
-
let [n, t,
|
|
1629
|
-
return Object.freeze(
|
|
1663
|
+
let [n, t, a, o] = U2(e, r), u2 = { values4Timezone: r ? f.timeZone : e.timeZone, hours: n, minutes: t, seconds: a, milliseconds: o };
|
|
1664
|
+
return Object.freeze(u2);
|
|
1630
1665
|
}
|
|
1631
1666
|
function U2(e, r = false) {
|
|
1632
1667
|
let t = `l:en-CA,${r ? `tz:${f.timeZone}` : `tz:${e.timeZone}`},hrc:23,ts:medium`;
|
|
1633
1668
|
return e.format("", t).split(/:/).map(Number).concat(e.getMilliseconds());
|
|
1634
1669
|
}
|
|
1635
1670
|
function K2(e, r) {
|
|
1636
|
-
let n = r ? `tz:${f.timeZone}` : `,tz:${e.timeZone}`, [t,
|
|
1637
|
-
|
|
1671
|
+
let n = r ? `tz:${f.timeZone}` : `,tz:${e.timeZone}`, [t, a, o] = e.format("yyyy-mm-dd", n).split(/-/).map(Number);
|
|
1672
|
+
a -= 1;
|
|
1638
1673
|
let s = r ? f.timeZone : e.timeZone;
|
|
1639
|
-
return Object.freeze({ values4Timezone: s, year: t, month:
|
|
1674
|
+
return Object.freeze({ values4Timezone: s, year: t, month: a, date: o });
|
|
1640
1675
|
}
|
|
1641
1676
|
function Q2(e, r = true) {
|
|
1642
1677
|
if (r) return [e.getFullYear(), e.getMonth(), e.getDate()];
|
|
@@ -1653,19 +1688,19 @@ ${r}`), g2;
|
|
|
1653
1688
|
}
|
|
1654
1689
|
function Je2(e, r) {
|
|
1655
1690
|
let n = e.toString().match(/GMT([+-])\d+/)?.[0]?.slice(3) ?? "+0000", t = r.toString().match(/GMT([+-])\d+/)?.[0]?.slice(3) ?? "+0000";
|
|
1656
|
-
return n = A2(n.slice(0, 3) + ":" + n.slice(-2), true), t = A2(t.slice(0, 3) + ":" + t.slice(-2), true), [-n[0] + t[0], -n[1] + t[1]].map((
|
|
1691
|
+
return n = A2(n.slice(0, 3) + ":" + n.slice(-2), true), t = A2(t.slice(0, 3) + ":" + t.slice(-2), true), [-n[0] + t[0], -n[1] + t[1]].map((a) => n[0] < 0 ? -a : a);
|
|
1657
1692
|
}
|
|
1658
1693
|
function X2({ start: e, end: r } = {}) {
|
|
1659
1694
|
r || (r = e.clone), r?.clone || (r = m(r, { timeZone: e.timeZone })), e = m(Te2(e, e.timeZone), { timeZone: e.timeZone }), r = m(Te2(r, r.timeZone), { timeZone: r.timeZone });
|
|
1660
|
-
let n = $e2({ start: e, end: r, diffs: { timeZoneStart: e.timeZone, timeZoneEnd: r.timeZone } }), t = Je2(r, e),
|
|
1661
|
-
return n.timeZonesOffsetDifference = n.sign.length < 1 || o + s === 0 ? `Offsets of ${e.timeZone} and ${r.timeZone} are equal` : `${e.timeZone} is ${
|
|
1695
|
+
let n = $e2({ start: e, end: r, diffs: { timeZoneStart: e.timeZone, timeZoneEnd: r.timeZone } }), t = Je2(r, e), a = n.sign.startsWith("-") ? "ahead of" : "behind", [o, s] = t.map((i) => Math.abs(i)), [u2, l] = [`${o} ${k2(o, "hour")}`, `${s} ${k2(s, "minute")}`];
|
|
1696
|
+
return n.timeZonesOffsetDifference = n.sign.length < 1 || o + s === 0 ? `Offsets of ${e.timeZone} and ${r.timeZone} are equal` : `${e.timeZone} is ${u2}${s > 0 ? ` and ${l}` : ""} ${a} ${r.timeZone}`, n;
|
|
1662
1697
|
}
|
|
1663
1698
|
function ee2(e, r) {
|
|
1664
1699
|
r = String(r).toLowerCase() === "utc" || r.timeZone === "UTC" ? e.clone.relocate({ timeZone: "UTC" }) : m(e.value, { timeZone: r.timeZone || f.timeZone });
|
|
1665
|
-
let t = X2({ start: e.clone, end: r }), o = `${t.sign}${
|
|
1700
|
+
let t = X2({ start: e.clone, end: r }), o = `${t.sign}${he2(t.hours)}:${he2(t.minutes)}`;
|
|
1666
1701
|
return { fromTZ: e.timeZone, toTZ: r.timeZone, offset: o, offsetText: `${r.timeZone} ${Ke2(o)} ${e.timeZone}` };
|
|
1667
1702
|
}
|
|
1668
|
-
function
|
|
1703
|
+
function he2(e, r = 2) {
|
|
1669
1704
|
return `${e}`.padStart(r, "0");
|
|
1670
1705
|
}
|
|
1671
1706
|
function k2(e, r) {
|
|
@@ -1673,24 +1708,24 @@ ${r}`), g2;
|
|
|
1673
1708
|
}
|
|
1674
1709
|
function Ke2(e) {
|
|
1675
1710
|
if (/00:00/.test(e)) return "no time diffence to";
|
|
1676
|
-
let r = e.slice(1).split(":").map(Number), [n, t] = r,
|
|
1677
|
-
return t > 0 ? `${n} ${
|
|
1711
|
+
let r = e.slice(1).split(":").map(Number), [n, t] = r, a = k2(n, "hour"), o = k2(t, "minute"), s = e.startsWith("+");
|
|
1712
|
+
return t > 0 ? `${n} ${a} and ${t} ${o} ${s ? "ahead of" : "behind"}` : `${n} ${a} ${s ? "ahead of" : "behind"}`;
|
|
1678
1713
|
}
|
|
1679
1714
|
function De2(e, r, n) {
|
|
1680
1715
|
return e.clone.format(r, n || e.localeInfo.formatOptions);
|
|
1681
1716
|
}
|
|
1682
1717
|
function ve2(e, { withFormat: r, withFormatOptions: n, local: t = false } = {}) {
|
|
1683
1718
|
if (r) return t ? De2(e, r, $D.localeInformation.formatOptions) : De2(e, r, n);
|
|
1684
|
-
let
|
|
1685
|
-
return
|
|
1719
|
+
let a = e.clone.relocate({ locale: "en" }), o = t ? f.formatOptions : a.localeInfo.formatOptions, u2 = `wd M dd yyyy hh:mmi:ss ${a.format("tz", o + ",tzn:longOffset").replace(":", "")} (tz)`;
|
|
1720
|
+
return a.format(u2, o + ",tzn:long, hrc:23");
|
|
1686
1721
|
}
|
|
1687
1722
|
function te2(e, r = false) {
|
|
1688
1723
|
let n = Intl.DateTimeFormat("en", { timeZone: r ? e.timeZone : f.timeZone, weekday: "short" });
|
|
1689
|
-
return
|
|
1724
|
+
return Se2(n.format(e));
|
|
1690
1725
|
}
|
|
1691
1726
|
function Ne2(e) {
|
|
1692
|
-
let r = f, n = e.localeInfo, t = e.clone.relocate({ locale: r.locale, timeZone: r.timeZone }),
|
|
1693
|
-
return n.timeZone !== r.timeZone && (c.locales.remote = { locale:
|
|
1727
|
+
let r = f, n = e.localeInfo, t = e.clone.relocate({ locale: r.locale, timeZone: r.timeZone }), a = e.offsetFrom(t), o = t.offsetFrom(e), s = r, u2 = n, l = e.format("hh:mmi:ss dp", `hrc:12,tz:${e.timeZone}`), i = t.format("hh:mmi:ss dp", `hrc:12,tz:${t.timeZone}`), c = { note: "'user' are values for your locale/timeZone, 'remote' (if applicable) idem for the instance", locales: { user: { locale: s.locale, timeZone: s.timeZone } }, dateTime: { user: { ...e.dateTime, monthName: t.monthName, weekdayNr: t.day, weekdayName: t.dayName, dayPeriodTime: i, hasDST: t.hasDST, DSTActive: t.DSTActive, offsetFromRemote: a.offset, string: t.toString() } }, offset: { fromUTC: e.UTC.offsetFrom(e).offsetText } };
|
|
1728
|
+
return n.timeZone !== r.timeZone && (c.locales.remote = { locale: u2.locale, timeZone: u2.timeZone }, c.dateTime.remote = { ...e.zoneDateTime, monthName: e.zoneNames.monthName, weekdayNr: te2(e, true), weekdayName: e.zoneNames.dayName, dayPeriodTime: l, hasDST: e.hasDST, DSTActive: e.DSTActive, offsetFromUser: o.offset, string: e.toString() }, c.offset.fromUserTime = o.offsetText), c;
|
|
1694
1729
|
}
|
|
1695
1730
|
function z2(e, r = true) {
|
|
1696
1731
|
if (r) return [e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()];
|
|
@@ -1703,29 +1738,29 @@ ${r}`), g2;
|
|
|
1703
1738
|
function L2(e, r) {
|
|
1704
1739
|
r = g({ locale: r || e.localeInfo.locale }).locale;
|
|
1705
1740
|
let n = e.clone.relocate({ locale: r });
|
|
1706
|
-
return n.date = { date: 1 }, [n].concat([...Array(re2(n) - 1)].map((t,
|
|
1741
|
+
return n.date = { date: 1 }, [n].concat([...Array(re2(n) - 1)].map((t, a) => n.clone.add(`${a + 1} days`)));
|
|
1707
1742
|
}
|
|
1708
1743
|
function j2(e, { day: r, next: n = false, preserveTodayWhenEqual: t = false } = {}) {
|
|
1709
1744
|
r = r?.toLowerCase() || "-";
|
|
1710
|
-
let
|
|
1711
|
-
if (
|
|
1745
|
+
let a = Se2(r);
|
|
1746
|
+
if (a < 0) return console.error(`[TickTock instance].next/previous invalid day value ${r}`), e.clone;
|
|
1712
1747
|
let o = n ? 1 : -1, s = m(new Date(...e.dateTimeValues), e.localeInfo);
|
|
1713
|
-
return t &&
|
|
1748
|
+
return t && a === s.day ? s : Qe2(s.addDays(n ? 1 : -1), a, o);
|
|
1714
1749
|
}
|
|
1715
1750
|
function Qe2(e, r, n) {
|
|
1716
|
-
function t(
|
|
1751
|
+
function t(a) {
|
|
1717
1752
|
switch (true) {
|
|
1718
|
-
case
|
|
1719
|
-
return
|
|
1753
|
+
case a.day === r:
|
|
1754
|
+
return a;
|
|
1720
1755
|
default:
|
|
1721
|
-
return t(
|
|
1756
|
+
return t(a.add(`${n} days`));
|
|
1722
1757
|
}
|
|
1723
1758
|
}
|
|
1724
1759
|
return t(e);
|
|
1725
1760
|
}
|
|
1726
1761
|
function O2(e, { dateOnly: r = false, timeOnly: n = false } = {}) {
|
|
1727
|
-
let { locale: t, timeZone:
|
|
1728
|
-
return r ? new Date(e).toLocaleDateString(t, { timeZone:
|
|
1762
|
+
let { locale: t, timeZone: a } = e.localeInfo;
|
|
1763
|
+
return r ? new Date(e).toLocaleDateString(t, { timeZone: a }) : n ? new Date(e).toLocaleTimeString(t, { timeZone: a }) : new Date(e).toLocaleString(t, { timeZone: a });
|
|
1729
1764
|
}
|
|
1730
1765
|
function Te2(e, r) {
|
|
1731
1766
|
let n = { timeZone: r, hourCycle: "h23" };
|
|
@@ -1734,8 +1769,8 @@ ${r}`), g2;
|
|
|
1734
1769
|
function N2(e, { year: r, month: n, date: t } = {}) {
|
|
1735
1770
|
return y(r) && e.setFullYear(parseInt(r)), y(t) && e.setDate(parseInt(t)), y(n) && e.setMonth(parseInt(n)), e;
|
|
1736
1771
|
}
|
|
1737
|
-
function T2(e, { hours: r, minutes: n, seconds: t, milliseconds:
|
|
1738
|
-
return y(r) && e.setHours(parseInt(r)), y(n) && e.setMinutes(parseInt(n)), y(t) && e.setSeconds(parseInt(t)), y(
|
|
1772
|
+
function T2(e, { hours: r, minutes: n, seconds: t, milliseconds: a } = {}) {
|
|
1773
|
+
return y(r) && e.setHours(parseInt(r)), y(n) && e.setMinutes(parseInt(n)), y(t) && e.setSeconds(parseInt(t)), y(a) && e.setMilliseconds(parseInt(a)), e;
|
|
1739
1774
|
}
|
|
1740
1775
|
function Ie2(e) {
|
|
1741
1776
|
return e?.constructor === Date || e?.value;
|
|
@@ -1757,19 +1792,19 @@ ${r}`), g2;
|
|
|
1757
1792
|
function ze2(e) {
|
|
1758
1793
|
return e.time = { hours: 0, minutes: 0, seconds: 0, milliseconds: 0 }, e;
|
|
1759
1794
|
}
|
|
1760
|
-
function
|
|
1795
|
+
function pe(e, r) {
|
|
1761
1796
|
return Intl.DateTimeFormat("en-CA", { timeZone: r, timeZoneName: "long" }).format(e).split(/,/)[1].trim();
|
|
1762
1797
|
}
|
|
1763
1798
|
function x(e, r) {
|
|
1764
1799
|
r = r || e?.timeZone || f.timeZone, e = e?.value ? e : e?.constructor === Date ? m(e, { timeZone: r }) : m({ timeZone: r });
|
|
1765
|
-
let n = e.year || e.getFullYear(), t =
|
|
1766
|
-
return t !==
|
|
1800
|
+
let n = e.year || e.getFullYear(), t = pe(new Date(n, 0, 1), r), a = pe(new Date(n, 5, 1), r);
|
|
1801
|
+
return t !== a;
|
|
1767
1802
|
}
|
|
1768
1803
|
function P2(e, r) {
|
|
1769
1804
|
return r = r || e?.timeZone || f.timeZone, e = e?.hasDST ? e : e?.constructor === Date ? m(e, { timeZone: r }) : m({ timeZone: r }), e.hasDST ? !/standard/i.test(e.toString()) : false;
|
|
1770
1805
|
}
|
|
1771
|
-
function Oe2(e, { locale: r, timeZone: n, l: t, tz:
|
|
1772
|
-
return e.localeInfo = g({ locale: t || r || e.l || e.locale, timeZone:
|
|
1806
|
+
function Oe2(e, { locale: r, timeZone: n, l: t, tz: a } = {}) {
|
|
1807
|
+
return e.localeInfo = g({ locale: t || r || e.l || e.locale, timeZone: a || n || e.tz || e.timeZone }), e;
|
|
1773
1808
|
}
|
|
1774
1809
|
function Me2(e, r) {
|
|
1775
1810
|
return Ie2(r) && (e = m(r.value || r, r.localeInfo || e.localeInfo)), e;
|
|
@@ -1799,16 +1834,16 @@ ${r}`), g2;
|
|
|
1799
1834
|
let t = r.valueOf();
|
|
1800
1835
|
return r.setMonth(0, 1), r.getDay() !== 4 && r.setMonth(0, 1 + (4 - r.getDay() + 7) % 7), 1 + Math.ceil((t - r) / 6048e5);
|
|
1801
1836
|
}
|
|
1802
|
-
var
|
|
1837
|
+
var E2 = Xe2;
|
|
1803
1838
|
function Xe2({ localeInfo: e, customMethods: r, dateValue: n } = {}) {
|
|
1804
|
-
let t,
|
|
1839
|
+
let t, a = { add(...o) {
|
|
1805
1840
|
return G2(t, ...o);
|
|
1806
|
-
}, between({ start: o, end: s, include:
|
|
1807
|
-
return W2(t, { start: o, end: s, include:
|
|
1841
|
+
}, between({ start: o, end: s, include: u2 } = {}) {
|
|
1842
|
+
return W2(t, { start: o, end: s, include: u2 });
|
|
1808
1843
|
}, cloneWith(o) {
|
|
1809
1844
|
return ne2(t, o);
|
|
1810
1845
|
}, daysUntil(o) {
|
|
1811
|
-
return
|
|
1846
|
+
return be2(t, o);
|
|
1812
1847
|
}, differenceTo(o) {
|
|
1813
1848
|
return X2({ start: t, end: o });
|
|
1814
1849
|
}, differenceUntil(o) {
|
|
@@ -1831,32 +1866,32 @@ ${r}`), g2;
|
|
|
1831
1866
|
return ee2(t, o);
|
|
1832
1867
|
}, previous(o, s) {
|
|
1833
1868
|
return j2(t, { day: o, next: false, preserveTodayWhenEqual: !!s });
|
|
1834
|
-
}, relocate({ locale: o, timeZone: s, l:
|
|
1835
|
-
return Oe2(t, { locale: o, timeZone: s, l:
|
|
1869
|
+
}, relocate({ locale: o, timeZone: s, l: u2, tz: l } = {}) {
|
|
1870
|
+
return Oe2(t, { locale: o, timeZone: s, l: u2, tz: l });
|
|
1836
1871
|
}, revalue(o) {
|
|
1837
1872
|
return t = Me2(t, o), t;
|
|
1838
|
-
}, setDateValues({ year: o, month: s, date:
|
|
1839
|
-
return N2(t, { year: o, month: s, date:
|
|
1840
|
-
}, setTimeValues({ hours: o, minutes: s, seconds:
|
|
1841
|
-
return T2(t, { hours: o, minutes: s, seconds:
|
|
1873
|
+
}, setDateValues({ year: o, month: s, date: u2 } = {}) {
|
|
1874
|
+
return N2(t, { year: o, month: s, date: u2 });
|
|
1875
|
+
}, setTimeValues({ hours: o, minutes: s, seconds: u2, milliseconds: l } = {}) {
|
|
1876
|
+
return T2(t, { hours: o, minutes: s, seconds: u2, milliseconds: l });
|
|
1842
1877
|
}, subtract(...o) {
|
|
1843
1878
|
return G2(t, "subtract," + o.join(","));
|
|
1844
1879
|
}, toArray(o = false) {
|
|
1845
1880
|
return z2(t, o);
|
|
1846
|
-
}, toString({ template: o, formatOptions: s, local:
|
|
1847
|
-
return ve2(t, { withFormat: o, withFormatOptions: s, local:
|
|
1881
|
+
}, toString({ template: o, formatOptions: s, local: u2 } = {}) {
|
|
1882
|
+
return ve2(t, { withFormat: o, withFormatOptions: s, local: u2 });
|
|
1848
1883
|
}, values(o = false) {
|
|
1849
1884
|
return o ? t.dateTime : t.zoneDateTime;
|
|
1850
1885
|
}, zoneFormat(o, s) {
|
|
1851
1886
|
return _2(t, { zoneTime: true, formatStr: o, moreOptions: s });
|
|
1852
|
-
}, set date({ year: o, month: s, date:
|
|
1853
|
-
N2(t, { year: o, month: s, date:
|
|
1887
|
+
}, set date({ year: o, month: s, date: u2 }) {
|
|
1888
|
+
N2(t, { year: o, month: s, date: u2 });
|
|
1854
1889
|
}, set dateNr(o) {
|
|
1855
1890
|
N2(t, { date: o });
|
|
1856
1891
|
}, set hours(o) {
|
|
1857
1892
|
T2(t, { hours: o });
|
|
1858
|
-
}, set localeInfo({ locale: o, timeZone: s, l:
|
|
1859
|
-
e = I2({ locale: o, timeZone: s, l:
|
|
1893
|
+
}, set localeInfo({ locale: o, timeZone: s, l: u2, tz: l }) {
|
|
1894
|
+
e = I2({ locale: o, timeZone: s, l: u2, tz: l });
|
|
1860
1895
|
}, set milliseconds(o) {
|
|
1861
1896
|
T2(t, { milliseconds: `${o}` });
|
|
1862
1897
|
}, set minutes(o) {
|
|
@@ -1865,8 +1900,8 @@ ${r}`), g2;
|
|
|
1865
1900
|
N2(t, { month: o });
|
|
1866
1901
|
}, set seconds(o) {
|
|
1867
1902
|
T2(t, { seconds: o });
|
|
1868
|
-
}, set time({ hours: o, minutes: s, seconds:
|
|
1869
|
-
T2(t, { hours: o, minutes: s, seconds:
|
|
1903
|
+
}, set time({ hours: o, minutes: s, seconds: u2, milliseconds: l }) {
|
|
1904
|
+
T2(t, { hours: o, minutes: s, seconds: u2, milliseconds: l });
|
|
1870
1905
|
}, set year(o) {
|
|
1871
1906
|
N2(t, { year: o });
|
|
1872
1907
|
}, get age() {
|
|
@@ -1992,7 +2027,7 @@ ${r}`), g2;
|
|
|
1992
2027
|
}, get zoneArray() {
|
|
1993
2028
|
return z2(t, false);
|
|
1994
2029
|
} };
|
|
1995
|
-
return !e && !n ?
|
|
2030
|
+
return !e && !n ? a : (a.localeInfo = e || I2(), t = new Proxy(n, et2(a)), Object.entries(Object.getOwnPropertyDescriptors(ie2(t, r))).forEach(([o, s]) => Object.defineProperty(a, o, s)), Object.freeze(t));
|
|
1996
2031
|
}
|
|
1997
2032
|
function et2(e) {
|
|
1998
2033
|
return { get(r, n) {
|
|
@@ -2011,10 +2046,10 @@ ${r}`), g2;
|
|
|
2011
2046
|
}
|
|
2012
2047
|
function rt2({ year: e, locale: r } = {}) {
|
|
2013
2048
|
e = y(e) ? parseInt(e) : (/* @__PURE__ */ new Date()).getFullYear();
|
|
2014
|
-
let n = { year: e, calendar: {} }, t = Y2().long.map((
|
|
2015
|
-
for (let
|
|
2016
|
-
let o = m.from(e,
|
|
2017
|
-
n.calendar[t[
|
|
2049
|
+
let n = { year: e, calendar: {} }, t = Y2().long.map((a) => a.toLowerCase());
|
|
2050
|
+
for (let a = 0; a < 12; a += 1) {
|
|
2051
|
+
let o = m.from(e, a, 1);
|
|
2052
|
+
n.calendar[t[a]] = L2(o, r);
|
|
2018
2053
|
}
|
|
2019
2054
|
return n;
|
|
2020
2055
|
}
|
|
@@ -2069,14 +2104,14 @@ ${r}`), g2;
|
|
|
2069
2104
|
}
|
|
2070
2105
|
}
|
|
2071
2106
|
function ot2({ timeZoneDate: e, timeZoneID: r, userTimeZoneID: n } = {}) {
|
|
2072
|
-
let t = { timeZone: g({ timeZone: r }).timeZone },
|
|
2073
|
-
return { remoteTimezone: t.timeZone, userTimezone:
|
|
2107
|
+
let t = { timeZone: g({ timeZone: r }).timeZone }, a = { timeZone: g({ timeZone: n || "" }).timeZone }, o = m(e, t), s = m(e, a), u2 = s.differenceTo(o), l = o.offsetFrom(s).offset, [i, c] = A2(l, true), d = s.clone.add(`${i} hours, ${c} minutes`), F = u2.equalDates ? "No difference" : `Time offset ${l}: ${a.timeZone} is ${u2.clean} ${i < 0 ? "behind" : "ahead of"} ${t.timeZone}`;
|
|
2108
|
+
return { remoteTimezone: t.timeZone, userTimezone: a.timeZone, timeDifference: F, result: { [t.timeZone.replace(/\//, "_")]: m(e).toString({ template: "yyyy/mm/dd hh:mmi:ss", formatOptions: "hrc:23" }), [a.timeZone.replace(/\//, "_")]: d.toString({ template: "yyyy/mm/dd hh:mmi:ss", formatOptions: "hrc:23" }) } };
|
|
2074
2109
|
}
|
|
2075
2110
|
function y(e) {
|
|
2076
2111
|
return !Number.isNaN(parseInt(e));
|
|
2077
2112
|
}
|
|
2078
2113
|
function V2(e, r, n) {
|
|
2079
|
-
return e?.constructor === Number ?
|
|
2114
|
+
return e?.constructor === Number ? D2(r, `${e} ${n}`) : r;
|
|
2080
2115
|
}
|
|
2081
2116
|
function at2(e) {
|
|
2082
2117
|
let r = { addYears(n = 1) {
|
|
@@ -2088,21 +2123,21 @@ ${r}`), g2;
|
|
|
2088
2123
|
}, addDays(n = 1) {
|
|
2089
2124
|
return V2(n, e, "days");
|
|
2090
2125
|
}, get nextYear() {
|
|
2091
|
-
return
|
|
2126
|
+
return D2(e, "1 year");
|
|
2092
2127
|
}, get nextWeek() {
|
|
2093
|
-
return
|
|
2128
|
+
return D2(e, "7 days");
|
|
2094
2129
|
}, get previousWeek() {
|
|
2095
|
-
return
|
|
2130
|
+
return D2(e, "-7 days");
|
|
2096
2131
|
}, get previousYear() {
|
|
2097
|
-
return
|
|
2132
|
+
return D2(e, "-1 year");
|
|
2098
2133
|
}, get nextMonth() {
|
|
2099
|
-
return
|
|
2134
|
+
return D2(e, "1 month");
|
|
2100
2135
|
}, get previousMonth() {
|
|
2101
|
-
return
|
|
2136
|
+
return D2(e, "-1 month");
|
|
2102
2137
|
}, get tomorrow() {
|
|
2103
|
-
return
|
|
2138
|
+
return D2(e, "1 day");
|
|
2104
2139
|
}, get yesterday() {
|
|
2105
|
-
return
|
|
2140
|
+
return D2(e, "-1 day");
|
|
2106
2141
|
} };
|
|
2107
2142
|
for (let n of tt2) r[n.syn] = function(...t) {
|
|
2108
2143
|
return e[n.native](...t), e;
|
|
@@ -2111,11 +2146,11 @@ ${r}`), g2;
|
|
|
2111
2146
|
}
|
|
2112
2147
|
function ie2(e, r) {
|
|
2113
2148
|
let n = at2(e);
|
|
2114
|
-
for (let [t,
|
|
2115
|
-
let o =
|
|
2116
|
-
return
|
|
2117
|
-
}, enumerable: o } : { value(...
|
|
2118
|
-
return
|
|
2149
|
+
for (let [t, a] of Object.entries(r || {})) {
|
|
2150
|
+
let o = a.enumerable, s = a.isGetter ? { get() {
|
|
2151
|
+
return a.method(e);
|
|
2152
|
+
}, enumerable: o } : { value(...u2) {
|
|
2153
|
+
return a.method(e, ...u2);
|
|
2119
2154
|
}, enumerable: o };
|
|
2120
2155
|
Object.defineProperty(n, t, s);
|
|
2121
2156
|
}
|
|
@@ -2136,27 +2171,27 @@ ${r}`), g2;
|
|
|
2136
2171
|
return e(n);
|
|
2137
2172
|
} }, fromUxTS: { value(n, t) {
|
|
2138
2173
|
n = y(n) ? parseInt(n) * 1e3 : void 0;
|
|
2139
|
-
let
|
|
2140
|
-
return m(
|
|
2174
|
+
let a = n ? new Date(n) : /* @__PURE__ */ new Date();
|
|
2175
|
+
return m(a, t || f);
|
|
2141
2176
|
} }, hasDST: { value({ date: n, timeZone: t } = {}) {
|
|
2142
2177
|
return x(n, t);
|
|
2143
2178
|
} }, DSTActive: { value({ date: n, timeZone: t } = {}) {
|
|
2144
2179
|
return P2(n, t);
|
|
2145
2180
|
} }, values: { value({ date: n, timeZone: t } = {}) {
|
|
2146
2181
|
n = n || n?.value || /* @__PURE__ */ new Date();
|
|
2147
|
-
let
|
|
2148
|
-
return
|
|
2149
|
-
} }, format: { value({ date: n, template: t, timeZone:
|
|
2182
|
+
let a = v(n, "yyyy-m-d-h-mi-s", g({ timeZone: t }).formatOptions.concat(",hrc:23")).split("-").map(Number).concat(n.getMilliseconds());
|
|
2183
|
+
return a[1] -= 1, a;
|
|
2184
|
+
} }, format: { value({ date: n, template: t, timeZone: a, locale: o, opts: s } = {}) {
|
|
2150
2185
|
n = n || n?.value || /* @__PURE__ */ new Date(), t = t?.constructor === String ? t : "yyyy/mm/dd hh:mmi:ss dp";
|
|
2151
|
-
let
|
|
2152
|
-
return
|
|
2153
|
-
} }, addCustom: { value({ name: n, method: t, enumerable:
|
|
2154
|
-
n?.constructor === String && t?.constructor === Function && t.length > 0 && (r[n] = { method: t, enumerable:
|
|
2186
|
+
let u2 = g({ timeZone: a, locale: o }).formatOptions;
|
|
2187
|
+
return u2 += s ? `,${s}` : "", v(n, t, u2);
|
|
2188
|
+
} }, addCustom: { value({ name: n, method: t, enumerable: a = false, isGetter: o = false } = {}) {
|
|
2189
|
+
n?.constructor === String && t?.constructor === Function && t.length > 0 && (r[n] = { method: t, enumerable: a, isGetter: o });
|
|
2155
2190
|
} }, validateLocaleInformation: { value: g }, timeAcrossZones: { value: ot2 }, weeksInYear: { value(n) {
|
|
2156
2191
|
return M2(n, 31);
|
|
2157
2192
|
} }, keys: { get() {
|
|
2158
|
-
let n = Object.fromEntries(Object.entries(r).filter(([
|
|
2159
|
-
return [...Object.keys(
|
|
2193
|
+
let n = Object.fromEntries(Object.entries(r).filter(([a, o]) => o.enumerable === true));
|
|
2194
|
+
return [...Object.keys(E2()), ...Object.keys(ie2()), ...Object.keys(n)].sort((a, o) => a.localeCompare(o));
|
|
2160
2195
|
} } }), e;
|
|
2161
2196
|
}
|
|
2162
2197
|
var Ue2 = {};
|
|
@@ -2164,7 +2199,7 @@ ${r}`), g2;
|
|
|
2164
2199
|
function st2(e, r) {
|
|
2165
2200
|
if (e?.localeInfo) return e.clone;
|
|
2166
2201
|
let n = e?.locale || e?.timeZone || e?.tz || e?.l;
|
|
2167
|
-
return
|
|
2202
|
+
return E2({ localeInfo: g(n ? e : r), dateValue: new Date(n ? Date.now() : Ae2(e)), customMethods: Ue2 });
|
|
2168
2203
|
}
|
|
2169
2204
|
|
|
2170
2205
|
// ../node_modules/jsregexphelper/RegexpCreator.js
|
|
@@ -2176,7 +2211,7 @@ ${r}`), g2;
|
|
|
2176
2211
|
);
|
|
2177
2212
|
}
|
|
2178
2213
|
function createRegExpStringFromInput(regExStr, ...cleanedArgs) {
|
|
2179
|
-
return !hasLength(cleanedArgs) ? regExStr.raw.join(``) : regExStr.raw.reduce((
|
|
2214
|
+
return !hasLength(cleanedArgs) ? regExStr.raw.join(``) : regExStr.raw.reduce((a, v2, i) => a.concat(cleanedArgs[i - 1] || ``).concat(v2), ``);
|
|
2180
2215
|
}
|
|
2181
2216
|
function maybeFlags(...args) {
|
|
2182
2217
|
const flags = cleanupFlags(getFlags(args.at(-1)));
|
|
@@ -2257,129 +2292,79 @@ ${r}`), g2;
|
|
|
2257
2292
|
case !!RegExp.escape:
|
|
2258
2293
|
return RegExp.escape(string2Escape);
|
|
2259
2294
|
default:
|
|
2260
|
-
return (`\\x${string2Escape.at(0)}` + string2Escape.slice(1).replace(/\p{S}|\p{P}/gu, (
|
|
2295
|
+
return (`\\x${string2Escape.at(0)}` + string2Escape.slice(1).replace(/\p{S}|\p{P}/gu, (a) => `\\${a}`)).replace(/ |\\x /g, `\\x20`);
|
|
2261
2296
|
}
|
|
2262
2297
|
}
|
|
2263
2298
|
function cleanup(str) {
|
|
2264
|
-
return str.replace(/\/\*(?:[^*]|\*+[^*\/])*\*+\/|(?<!:|\\\|')\/\/.*/gm, ``).replace(/\s/g, ``).trim().replace(/<!([^>]\d+)>/g, (
|
|
2299
|
+
return str.replace(/\/\*(?:[^*]|\*+[^*\/])*\*+\/|(?<!:|\\\|')\/\/.*/gm, ``).replace(/\s/g, ``).trim().replace(/<!([^>]\d+)>/g, (a, b2) => String.fromCharCode(+b2) ?? a);
|
|
2265
2300
|
}
|
|
2266
2301
|
|
|
2267
|
-
// ../node_modules/splat-es/
|
|
2268
|
-
var { IS } = TOAFactory();
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2302
|
+
// ../node_modules/splat-es/Resource/toaModule.js
|
|
2303
|
+
var { IS, maybe, $Wrap, isNothing, xProxy, addSymbolicExtensions } = TOAFactory({ useSymbolicExtensions: false });
|
|
2304
|
+
function TOAFactory(specs = {}) {
|
|
2305
|
+
const { useSymbolicExtensions } = specs;
|
|
2306
|
+
const {
|
|
2307
|
+
shouldbeIsSingleObject,
|
|
2308
|
+
ISOneOf,
|
|
2309
|
+
isExcept,
|
|
2310
|
+
verifyNothingness,
|
|
2311
|
+
xProxy: xProxy2,
|
|
2312
|
+
determineType,
|
|
2313
|
+
addSymbolicExtensions: addSymbolicExtensions2,
|
|
2314
|
+
maybe: maybe2,
|
|
2315
|
+
$Wrap: $Wrap2
|
|
2316
|
+
} = TOAHelpers(IS2, useSymbolicExtensions);
|
|
2317
|
+
if (!!useSymbolicExtensions) {
|
|
2318
|
+
addSymbolicExtensions2();
|
|
2319
|
+
}
|
|
2320
|
+
return { IS: IS2, maybe: maybe2, $Wrap: $Wrap2, isNothing: verifyNothingness, xProxy: xProxy2, addSymbolicExtensions: addSymbolicExtensions2 };
|
|
2280
2321
|
function IS2(anything, ...shouldBe) {
|
|
2281
|
-
if (maybe({ trial: (_3) => `isTypes` in (shouldBe?.[0] ?? {}) })) {
|
|
2282
|
-
const isTypeObj = shouldBe[0];
|
|
2283
|
-
return `defaultValue` in isTypeObj ? isOrDefault(anything, isTypeObj) : `notTypes` in isTypeObj ? isExcept(anything, isTypeObj) : IS2(anything, ...[isTypeObj.isTypes].flat());
|
|
2284
|
-
}
|
|
2285
2322
|
const input = typeof anything === `symbol` ? Symbol.isSymbol : anything;
|
|
2286
|
-
return shouldBe.length > 1 ? ISOneOf(input, ...shouldBe) : determineType(anything, ...shouldBe);
|
|
2287
|
-
}
|
|
2288
|
-
function typeOf(anything) {
|
|
2289
|
-
return anything?.[Symbol.proxy] ?? IS2(anything);
|
|
2290
|
-
}
|
|
2291
|
-
function determineType(input, ...shouldBe) {
|
|
2292
|
-
let {
|
|
2293
|
-
noInput,
|
|
2294
|
-
noShouldbe,
|
|
2295
|
-
compareTo,
|
|
2296
|
-
inputCTOR,
|
|
2297
|
-
isNaN: isNaN2,
|
|
2298
|
-
isInfinity,
|
|
2299
|
-
shouldBeFirstElementIsNothing
|
|
2300
|
-
} = processInput(input, ...shouldBe);
|
|
2301
|
-
shouldBe = shouldBe.length && shouldBe[0];
|
|
2302
2323
|
switch (true) {
|
|
2303
|
-
case
|
|
2304
|
-
return
|
|
2305
|
-
case (input?.[Symbol.proxy] && noShouldbe):
|
|
2306
|
-
return input[Symbol.proxy];
|
|
2307
|
-
case isNaN2:
|
|
2308
|
-
return noShouldbe ? `NaN` : maybe({ trial: (_3) => String(compareTo) }) === String(input);
|
|
2309
|
-
case isInfinity:
|
|
2310
|
-
return noShouldbe ? `Infinity` : maybe({ trial: (_3) => String(compareTo) }) === String(input);
|
|
2311
|
-
case noInput:
|
|
2312
|
-
return noShouldbe ? String(input) : String(compareTo) === String(input);
|
|
2313
|
-
case inputCTOR === Boolean:
|
|
2314
|
-
return !shouldBe ? `Boolean` : inputCTOR === shouldBe;
|
|
2324
|
+
case !!maybe2({ trial: (_3) => `isTypes` in (shouldBe?.[0] ?? {}) }):
|
|
2325
|
+
return shouldbeIsSingleObject(anything, shouldBe[0]);
|
|
2315
2326
|
default:
|
|
2316
|
-
return
|
|
2327
|
+
return shouldBe.length > 1 ? ISOneOf(input, ...shouldBe) : determineType(anything, ...shouldBe);
|
|
2317
2328
|
}
|
|
2318
2329
|
}
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2330
|
+
}
|
|
2331
|
+
function TOAHelpers(IS2, useSymbolicExtensions) {
|
|
2332
|
+
const {
|
|
2333
|
+
SymbolAndCustomProxyFactory,
|
|
2334
|
+
maybeFactory,
|
|
2335
|
+
WrapAnyFactory,
|
|
2336
|
+
verifyNothingness,
|
|
2337
|
+
determineType
|
|
2338
|
+
} = AUXHelperFactory(IS2, typeOf);
|
|
2339
|
+
const { xProxy: xProxy2, addSymbolicExtensions: addSymbolicExtensions2 } = SymbolAndCustomProxyFactory(IS2, typeOf, useSymbolicExtensions);
|
|
2340
|
+
const [maybe2, $Wrap2] = [maybeFactory(), WrapAnyFactory(IS2, typeOf)];
|
|
2341
|
+
return Object.freeze({
|
|
2342
|
+
shouldbeIsSingleObject,
|
|
2343
|
+
ISOneOf,
|
|
2344
|
+
isExcept,
|
|
2345
|
+
verifyNothingness,
|
|
2346
|
+
xProxy: xProxy2,
|
|
2347
|
+
determineType,
|
|
2348
|
+
addSymbolicExtensions: addSymbolicExtensions2,
|
|
2349
|
+
maybe: maybe2,
|
|
2350
|
+
$Wrap: $Wrap2
|
|
2351
|
+
});
|
|
2352
|
+
function typeOf(anything) {
|
|
2353
|
+
return anything?.[Symbol.proxy] ?? IS2(anything);
|
|
2331
2354
|
}
|
|
2332
|
-
function
|
|
2355
|
+
function shouldbeIsSingleObject(anything, isTypeObj) {
|
|
2333
2356
|
switch (true) {
|
|
2334
|
-
case
|
|
2335
|
-
return
|
|
2336
|
-
case
|
|
2337
|
-
return
|
|
2338
|
-
case (input?.[Symbol.toStringTag] && IS2(compareWith, String)):
|
|
2339
|
-
return String(compareWith) === input[Symbol.toStringTag];
|
|
2357
|
+
case `defaultValue` in isTypeObj:
|
|
2358
|
+
return isOrDefault(anything, isTypeObj);
|
|
2359
|
+
case `notTypes` in isTypeObj:
|
|
2360
|
+
return isExcept(anything, isTypeObj);
|
|
2340
2361
|
default:
|
|
2341
|
-
return
|
|
2362
|
+
return IS2(anything, ...[isTypeObj.isTypes].flat());
|
|
2342
2363
|
}
|
|
2343
2364
|
}
|
|
2344
2365
|
function ISOneOf(obj, ...params) {
|
|
2345
2366
|
return params.some((param) => IS2(obj, param));
|
|
2346
2367
|
}
|
|
2347
|
-
function isNothing(maybeNothing, all = false) {
|
|
2348
|
-
let nada = maybeNothing === null || maybeNothing === void 0;
|
|
2349
|
-
nada = all ? nada || IS2(maybeNothing, Infinity) || IS2(maybeNothing, NaN) : nada;
|
|
2350
|
-
return nada;
|
|
2351
|
-
}
|
|
2352
|
-
function maybeFactory() {
|
|
2353
|
-
const tryFn = (maybeFn, maybeError) => maybeFn?.constructor === Function ? maybeFn(maybeError) : void 0;
|
|
2354
|
-
return function({ trial, whenError = () => void 0 } = {}) {
|
|
2355
|
-
try {
|
|
2356
|
-
return tryFn(trial);
|
|
2357
|
-
} catch (err) {
|
|
2358
|
-
return tryFn(whenError, err);
|
|
2359
|
-
}
|
|
2360
|
-
};
|
|
2361
|
-
}
|
|
2362
|
-
function WrapAnyFactory() {
|
|
2363
|
-
return function(someObj) {
|
|
2364
|
-
return Object.freeze({
|
|
2365
|
-
get value() {
|
|
2366
|
-
return someObj;
|
|
2367
|
-
},
|
|
2368
|
-
get [Symbol.type]() {
|
|
2369
|
-
return typeOf(someObj);
|
|
2370
|
-
},
|
|
2371
|
-
get type() {
|
|
2372
|
-
return typeOf(someObj);
|
|
2373
|
-
},
|
|
2374
|
-
[Symbol.is](...args) {
|
|
2375
|
-
return IS2(someObj, ...args);
|
|
2376
|
-
},
|
|
2377
|
-
is(...args) {
|
|
2378
|
-
return IS2(someObj, ...args);
|
|
2379
|
-
}
|
|
2380
|
-
});
|
|
2381
|
-
};
|
|
2382
|
-
}
|
|
2383
2368
|
function isOrDefault(input, { defaultValue, isTypes = [void 0], notTypes } = {}) {
|
|
2384
2369
|
isTypes = isTypes?.constructor !== Array ? [isTypes] : isTypes;
|
|
2385
2370
|
notTypes = notTypes && notTypes?.constructor !== Array ? [notTypes] : [];
|
|
@@ -2390,8 +2375,34 @@ ${r}`), g2;
|
|
|
2390
2375
|
notTypes = notTypes?.constructor !== Array ? [notTypes] : notTypes;
|
|
2391
2376
|
return IS2(input, ...isTypes) && !IS2(input, ...notTypes);
|
|
2392
2377
|
}
|
|
2393
|
-
|
|
2394
|
-
|
|
2378
|
+
}
|
|
2379
|
+
function AUXHelperFactory() {
|
|
2380
|
+
const SYMBOL_KEYS = {
|
|
2381
|
+
IS: "toa.is",
|
|
2382
|
+
TYPE: "toa.type",
|
|
2383
|
+
IS_SYMBOL: "toa.isASymbol",
|
|
2384
|
+
PROXY: "toa.proxy"
|
|
2385
|
+
};
|
|
2386
|
+
const TYPE_STRINGS = {
|
|
2387
|
+
NAN: "NaN",
|
|
2388
|
+
INFINITY: "Infinity",
|
|
2389
|
+
BOOLEAN: "Boolean",
|
|
2390
|
+
OBJECT: "Object",
|
|
2391
|
+
PROXY_PREFIX: "Proxy ("
|
|
2392
|
+
};
|
|
2393
|
+
return Object.freeze(
|
|
2394
|
+
{
|
|
2395
|
+
SymbolAndCustomProxyFactory,
|
|
2396
|
+
maybeFactory,
|
|
2397
|
+
WrapAnyFactory,
|
|
2398
|
+
verifyNothingness,
|
|
2399
|
+
determineType
|
|
2400
|
+
}
|
|
2401
|
+
);
|
|
2402
|
+
function addSymbols2Anything(IS2, typeOf) {
|
|
2403
|
+
if (!Symbol.is) {
|
|
2404
|
+
Symbol.is = Symbol.for(SYMBOL_KEYS.IS);
|
|
2405
|
+
Symbol.type = Symbol.for(SYMBOL_KEYS.TYPE);
|
|
2395
2406
|
Object.defineProperties(Object.prototype, {
|
|
2396
2407
|
[Symbol.type]: { get() {
|
|
2397
2408
|
return typeOf(this);
|
|
@@ -2410,73 +2421,174 @@ ${r}`), g2;
|
|
|
2410
2421
|
});
|
|
2411
2422
|
}
|
|
2412
2423
|
}
|
|
2413
|
-
function
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2424
|
+
function SymbolAndCustomProxyFactory(IS2, typeOf, useSymbolicExtension) {
|
|
2425
|
+
if (!Symbol.isSymbol) {
|
|
2426
|
+
Symbol.isSymbol = Symbol.for(SYMBOL_KEYS.IS_SYMBOL);
|
|
2427
|
+
}
|
|
2428
|
+
return { xProxy: setCustomOrDefaultProxyFactory(), addSymbolicExtensions: () => addSymbols2Anything(IS2, typeOf) };
|
|
2429
|
+
}
|
|
2430
|
+
function constructor2String(obj) {
|
|
2431
|
+
const ctor = !isNothing(obj, true) ? Object.getPrototypeOf(obj)?.constructor : { name: `unknown` };
|
|
2432
|
+
return ctor.name;
|
|
2433
|
+
}
|
|
2434
|
+
function createCustomProxy(nativeProxy, proxySymbol) {
|
|
2435
|
+
Proxy = new nativeProxy(nativeProxy, {
|
|
2436
|
+
construct(target, args) {
|
|
2437
|
+
const wrappedProxy = new target(...args);
|
|
2438
|
+
Object.defineProperty(wrappedProxy, proxySymbol, {
|
|
2439
|
+
value: `${TYPE_STRINGS.PROXY_PREFIX}${constructor2String(args[0])})`
|
|
2440
|
+
});
|
|
2441
|
+
return wrappedProxy;
|
|
2422
2442
|
}
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
return setterMethod2Modify;
|
|
2443
|
+
});
|
|
2444
|
+
return Proxy;
|
|
2426
2445
|
}
|
|
2427
|
-
function
|
|
2446
|
+
function setCustomOrDefaultProxyFactory() {
|
|
2447
|
+
if (!Symbol.proxy) {
|
|
2448
|
+
Symbol.proxy = Symbol.for(SYMBOL_KEYS.PROXY);
|
|
2449
|
+
}
|
|
2428
2450
|
const nativeProxy = Proxy;
|
|
2429
2451
|
return {
|
|
2430
2452
|
native() {
|
|
2431
2453
|
Proxy = nativeProxy;
|
|
2432
2454
|
},
|
|
2433
2455
|
custom() {
|
|
2434
|
-
Proxy =
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2456
|
+
Proxy = createCustomProxy(nativeProxy, Symbol.proxy);
|
|
2457
|
+
}
|
|
2458
|
+
};
|
|
2459
|
+
}
|
|
2460
|
+
function processInput(input, ...shouldBe) {
|
|
2461
|
+
const noShouldbe = shouldBe.length < 1;
|
|
2462
|
+
const noInput = input === void 0 || input === null;
|
|
2463
|
+
return {
|
|
2464
|
+
noInput,
|
|
2465
|
+
noShouldbe,
|
|
2466
|
+
compareTo: !noShouldbe && shouldBe[0],
|
|
2467
|
+
inputCTOR: !noInput && (input?.constructor || Object.getPrototypeOf(input)?.constructor),
|
|
2468
|
+
isNaN: Number.isNaN(input) || maybe({ trial: (_3) => String(input) === TYPE_STRINGS.NAN }),
|
|
2469
|
+
isInfinity: maybe({ trial: (_3) => String(input) }) === TYPE_STRINGS.INFINITY,
|
|
2470
|
+
shouldBeFirstElementIsNothing: !noShouldbe && verifyNothingness(shouldBe[0])
|
|
2471
|
+
};
|
|
2472
|
+
}
|
|
2473
|
+
function determineType(input, ...shouldBe) {
|
|
2474
|
+
let { noInput, noShouldbe, compareTo, inputCTOR, isNaN: isNaN2, isInfinity, shouldBeFirstElementIsNothing } = processInput(input, ...shouldBe);
|
|
2475
|
+
shouldBe = shouldBe.length && shouldBe[0];
|
|
2476
|
+
switch (true) {
|
|
2477
|
+
case shouldBeFirstElementIsNothing:
|
|
2478
|
+
return String(input) === String(compareTo);
|
|
2479
|
+
case (input?.[Symbol.proxy] && noShouldbe):
|
|
2480
|
+
return input[Symbol.proxy];
|
|
2481
|
+
case isNaN2:
|
|
2482
|
+
return noShouldbe ? TYPE_STRINGS.NAN : String(compareTo) === String(input);
|
|
2483
|
+
case isInfinity:
|
|
2484
|
+
return noShouldbe ? TYPE_STRINGS.INFINITY : String(compareTo) === String(input);
|
|
2485
|
+
case noInput:
|
|
2486
|
+
return noShouldbe ? String(input) : String(compareTo) === String(input);
|
|
2487
|
+
case inputCTOR === Boolean:
|
|
2488
|
+
return noShouldbe ? TYPE_STRINGS.BOOLEAN : inputCTOR === shouldBe;
|
|
2489
|
+
default:
|
|
2490
|
+
return getResult(input, shouldBe, noShouldbe, finalInputResolver(input, inputCTOR));
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
function finalInputResolver(input, inputCTOR) {
|
|
2494
|
+
switch (true) {
|
|
2495
|
+
case input === 0:
|
|
2496
|
+
return Number;
|
|
2497
|
+
case input === ``:
|
|
2498
|
+
return String;
|
|
2499
|
+
case !input:
|
|
2500
|
+
return { name: String(input) };
|
|
2501
|
+
default:
|
|
2502
|
+
return inputCTOR;
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
function getResult(input, compareWith, noShouldbe, maybeResult) {
|
|
2506
|
+
switch (true) {
|
|
2507
|
+
case (!noShouldbe && compareWith === input || input?.[Symbol.proxy] && compareWith === Proxy):
|
|
2508
|
+
return true;
|
|
2509
|
+
case String(compareWith) === TYPE_STRINGS.NAN:
|
|
2510
|
+
return String(input) === TYPE_STRINGS.NAN;
|
|
2511
|
+
case (input?.[Symbol.toStringTag] && typeof compareWith === `string`):
|
|
2512
|
+
return String(compareWith) === input[Symbol.toStringTag];
|
|
2513
|
+
default:
|
|
2514
|
+
return compareWith ? resultWithComparison(input, compareWith, maybeResult) : resultWithoutComparison(input, maybeResult);
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
function resultWithoutComparison(input, maybeResult) {
|
|
2518
|
+
const toStringTag = input?.[Symbol.toStringTag] ?? input?.prototype?.[Symbol.toStringTag];
|
|
2519
|
+
return toStringTag || maybeResult?.name || String(maybeResult);
|
|
2520
|
+
}
|
|
2521
|
+
function resultWithComparison(input, compareWith, maybeResult) {
|
|
2522
|
+
return maybe({ trial: (_3) => input instanceof compareWith }) || compareWith === maybeResult || compareWith === Object.getPrototypeOf(maybeResult) || `${compareWith?.name}` === maybeResult?.name;
|
|
2523
|
+
}
|
|
2524
|
+
function WrapAnyFactory(IS2, typeOf) {
|
|
2525
|
+
return function(someObj) {
|
|
2526
|
+
const wrapper = {
|
|
2527
|
+
get value() {
|
|
2528
|
+
return someObj;
|
|
2529
|
+
},
|
|
2530
|
+
is(...args) {
|
|
2531
|
+
return IS2(someObj, ...args);
|
|
2532
|
+
},
|
|
2533
|
+
get type() {
|
|
2534
|
+
return typeOf(someObj);
|
|
2535
|
+
}
|
|
2536
|
+
};
|
|
2537
|
+
if (Object[Symbol.type]) {
|
|
2538
|
+
Object.defineProperties(wrapper, {
|
|
2539
|
+
[Symbol.type]: { get() {
|
|
2540
|
+
return typeOf(someObj);
|
|
2541
|
+
} },
|
|
2542
|
+
[Symbol.is]: { value(...args) {
|
|
2543
|
+
return IS2(someObj, ...args);
|
|
2544
|
+
} }
|
|
2445
2545
|
});
|
|
2446
2546
|
}
|
|
2547
|
+
return Object.freeze(wrapper);
|
|
2548
|
+
};
|
|
2549
|
+
}
|
|
2550
|
+
function maybeFactory() {
|
|
2551
|
+
const errFn = (err) => void 0;
|
|
2552
|
+
return function({ trial, whenError = errFn } = {}) {
|
|
2553
|
+
try {
|
|
2554
|
+
return trial();
|
|
2555
|
+
} catch (err) {
|
|
2556
|
+
return whenError(err);
|
|
2557
|
+
}
|
|
2447
2558
|
};
|
|
2448
2559
|
}
|
|
2560
|
+
function verifyNothingness(maybeNothing, all = false) {
|
|
2561
|
+
let nada = maybeNothing === null || maybeNothing === void 0;
|
|
2562
|
+
nada = all ? nada || IS(maybeNothing, Infinity) || IS(maybeNothing, NaN) : nada;
|
|
2563
|
+
return nada;
|
|
2564
|
+
}
|
|
2449
2565
|
}
|
|
2450
2566
|
|
|
2451
2567
|
// ../node_modules/splat-es/index.js
|
|
2452
|
-
var interpolateDefault = interpolateFactory(
|
|
2568
|
+
var interpolateDefault = interpolateFactory();
|
|
2453
2569
|
var interpolateClear = interpolateFactory("");
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
} }
|
|
2461
|
-
});
|
|
2462
|
-
function interpolateFactory(defaultReplacer) {
|
|
2463
|
-
defaultReplacer = toaFactory_default(defaultReplacer, String, Number) ? String(defaultReplacer) : void 0;
|
|
2570
|
+
function interpolateFactory(defaultReplacer, specs = {}) {
|
|
2571
|
+
const { useSymbolicExtensions } = specs;
|
|
2572
|
+
defaultReplacer = IS(defaultReplacer, String, Number) ? String(defaultReplacer) : void 0;
|
|
2573
|
+
if (!!useSymbolicExtensions) {
|
|
2574
|
+
addSymbolicStringExtensions();
|
|
2575
|
+
}
|
|
2464
2576
|
return function(str, ...tokens) {
|
|
2465
2577
|
return interpolate(str, processTokens(tokens));
|
|
2466
2578
|
};
|
|
2467
2579
|
function invalidate(key, keyExists) {
|
|
2468
|
-
if (keyExists &&
|
|
2580
|
+
if (keyExists && IS(defaultReplacer, String, Number)) {
|
|
2469
2581
|
return String(defaultReplacer);
|
|
2470
2582
|
}
|
|
2471
2583
|
return `{${key}}`;
|
|
2472
2584
|
}
|
|
2473
2585
|
function replacement(key, token) {
|
|
2474
2586
|
const isValid = key in token;
|
|
2475
|
-
return isValid &&
|
|
2587
|
+
return isValid && IS(token[key], String, Number) ? String(token[key]) : invalidate(key, isValid);
|
|
2476
2588
|
}
|
|
2477
2589
|
function getReplacerLambda(token) {
|
|
2478
2590
|
return (...args) => {
|
|
2479
|
-
const replacementObject = args.find((
|
|
2591
|
+
const replacementObject = args.find((a) => a.key);
|
|
2480
2592
|
return replacement(replacementObject ? replacementObject.key : `_`, token);
|
|
2481
2593
|
};
|
|
2482
2594
|
}
|
|
@@ -2497,14 +2609,32 @@ ${r}`), g2;
|
|
|
2497
2609
|
return isMultiLineWithArrays(tokens) ? convertTokensFromArrayValues(tokens[0]) : tokens;
|
|
2498
2610
|
}
|
|
2499
2611
|
function interpolate(str, tokens) {
|
|
2500
|
-
const injected = !tokens?.length ? str : tokens.filter((token) =>
|
|
2501
|
-
return
|
|
2612
|
+
const injected = !tokens?.length ? str : tokens.filter((token) => IS(token, Object)).map((token, i) => replace(str, { ...token, index: i + 1 })).join(``);
|
|
2613
|
+
return IS(defaultReplacer, void 0) ? injected : injected.replace(/\{[a-z_\d].+\}/gim, String(defaultReplacer));
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
function addSymbolicStringExtensions() {
|
|
2617
|
+
if (!String.prototype[Symbol.for(`interpolate`)]) {
|
|
2618
|
+
Object.defineProperties(String.prototype, {
|
|
2619
|
+
[Symbol.for(`interpolate`)]: {
|
|
2620
|
+
value(...args) {
|
|
2621
|
+
return interpolateDefault(this, ...args);
|
|
2622
|
+
}
|
|
2623
|
+
},
|
|
2624
|
+
[Symbol.for(`interpolate$`)]: {
|
|
2625
|
+
value(...args) {
|
|
2626
|
+
return interpolateClear(this, ...args);
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
});
|
|
2502
2630
|
}
|
|
2631
|
+
return [Symbol.for("interpolate"), Symbol.for(`interpolate$`)];
|
|
2503
2632
|
}
|
|
2504
2633
|
|
|
2505
2634
|
// ../index.js
|
|
2506
2635
|
setDefaultStyling();
|
|
2507
2636
|
fixSBLinks2TopProblem();
|
|
2637
|
+
var splatModule = { interpolate: interpolateDefault, interpolateClear, addSymbolicStringExtensions };
|
|
2508
2638
|
function fixSBLinks2TopProblem() {
|
|
2509
2639
|
/stackblitz/i.test(location.href) && console.info(`\u2714 Stackblitz rewrites links to _top. The 'stackblitzhelpers' module fixed it.`);
|
|
2510
2640
|
document.addEventListener(`click`, (evt) => {
|
|
@@ -2518,20 +2648,20 @@ ${r}`), g2;
|
|
|
2518
2648
|
});
|
|
2519
2649
|
}
|
|
2520
2650
|
function logFactory(formatJSON = true) {
|
|
2521
|
-
const logContainer =
|
|
2651
|
+
const logContainer = mn(`<ul id="log2screen">`).first();
|
|
2522
2652
|
function logItem(top2 = false) {
|
|
2523
|
-
const where2PutIt = top2 ?
|
|
2653
|
+
const where2PutIt = top2 ? mn.at.start : mn.at.end;
|
|
2524
2654
|
return (content) => {
|
|
2525
2655
|
if (content?.isJQx) {
|
|
2526
|
-
return
|
|
2656
|
+
return mn.li(
|
|
2527
2657
|
content.data.get(`header`) ? { class: `head` } : ``,
|
|
2528
2658
|
content
|
|
2529
2659
|
).renderTo(logContainer, where2PutIt);
|
|
2530
2660
|
}
|
|
2531
|
-
content = !
|
|
2661
|
+
content = !mn.IS(content, String, Number, Symbol) ? tryJSON(content, formatJSON) : String(content);
|
|
2532
2662
|
const isHead = content.startsWith(`!!`);
|
|
2533
2663
|
content = isHead ? content.slice(2) : content;
|
|
2534
|
-
|
|
2664
|
+
mn.li(isHead ? { class: `head` } : ``, content).renderTo(logContainer, where2PutIt);
|
|
2535
2665
|
};
|
|
2536
2666
|
}
|
|
2537
2667
|
const [logLamda, logTopLambda] = [logItem(), logItem(true)];
|
|
@@ -2548,7 +2678,7 @@ ${r}`), g2;
|
|
|
2548
2678
|
}
|
|
2549
2679
|
}
|
|
2550
2680
|
function setDefaultStyling() {
|
|
2551
|
-
|
|
2681
|
+
mn.editCssRules(`body{font:normal 14px/17px system-ui,sans-serif;margin:1rem;}`, `li::marker{vertical-align:top;}`, `code{color:green;background-color:#eee;padding:2px;font-family:monospace;}`, `code.codeblock{display:block;padding:6px;border:1px solid #999;margin:0.5rem 0;background-color:#eee;white-space:pre-wrap;}`, `h3{marginTop:1.5rem;}`, `.thickBorder{border:5px solid green;borderWidth:5px;padding:0.5rem;display:inline-block;}`, `a.ExternalLink{text-decoration:none;color:rgb(0,0,238);background-color:#EEE;padding:3px;font-weight:bold;}`, `.cmmt{color:#888;}`, `.hidden{display:none;}`, `.attention{color:red; font-size:1.2em; font-weight:bold;}`, `#log2screen li{listStyle:'\\2713';paddingLeft:6px;margin:0.5rem 0 0 -1.2rem;font-family:monospace}`, `#log2screen li.head{list-style-type:none;font-weight:bold;margin-top:0.8rem;margin-bottom:-0.2rem;font-family:revert;}`, `.err{fontStyle:italic; color:red; }`, `a{text-decoration:none; font-weight:bold;}`, `a:hover{text-decoration:underline;}`, `a[target]:before,a.internalLink:before,a.externalLink:before{color:rgba(0,0,238,0.7);font-size:1.1rem;padding-right:2px;vertical-align:baseline;}`, `a[target="_blank"]:before,a.externalLink:before{content:'\\2197';}`, `a[data-top]:before,a.internalLink:before,a[target="_top"]:before{content:'\\21BA';}`);
|
|
2552
2682
|
}
|
|
2553
2683
|
return __toCommonJS(index_exports);
|
|
2554
2684
|
})();
|