@trintel/zooy 1.13.2 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/attributes-D6kBA8su.js +1 -0
- package/dist/chunks/attributes-DLvrzXzz.js +159 -0
- package/dist/chunks/component-library-registry-BZI0_XM_.js +1 -0
- package/dist/chunks/{register-9ABlBJaU.js → register-B53HY61t.js} +1 -1
- package/dist/chunks/{register-BQwcQb3J.js → register-BYYPJoHC.js} +1 -1
- package/dist/chunks/register-Cvf7s1Ds.js +1 -0
- package/dist/chunks/{register-BToVLXl9.js → register-Kldh2rNG.js} +1 -1
- package/dist/chunks/{tree-utils-DVtSIiGp.js → tree-utils-C5v92nx9.js} +21 -20
- package/dist/chunks/{tree-utils-Dzrq9O-e.js → tree-utils-CExeKLzH.js} +1 -1
- package/dist/zooy.cjs.js +68 -5
- package/dist/zooy.es.js +641 -368
- package/package.json +11 -10
- package/dist/chunks/component-library-registry-DS_liKzL.js +0 -1
- package/dist/chunks/register-aC3Bk1C3.js +0 -1
- package/dist/chunks/zoo-B9S5MBHV.js +0 -436
- package/dist/chunks/zoo-bQS5G6fe.js +0 -64
package/dist/zooy.es.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import { identity as
|
|
5
|
-
import { mergeRight as
|
|
6
|
-
|
|
1
|
+
import { n as J, t as I } from "./chunks/component-library-registry-BXnJ4Oqa.js";
|
|
2
|
+
import { a as Ie, c as Ae, d as L, f as se, i as Re, l as Pe, m as Ne, n as ke, o as ze, p as he, s as w, t as xe, u as ie } from "./chunks/tree-utils-C5v92nx9.js";
|
|
3
|
+
import { n as Ve, r as de, t as Ue } from "./chunks/attributes-DLvrzXzz.js";
|
|
4
|
+
import { identity as D, isDef as B, isDefAndNotNull as H, isNumber as re, isUndefined as $e, randomId as v, stripLeadingChar as ue, toNumber as ne, whatType as Fe } from "badu";
|
|
5
|
+
import { mergeRight as Be } from "ramda";
|
|
6
|
+
import { LitElement as pe, css as me, html as P } from "lit";
|
|
7
|
+
var M = class extends EventTarget {
|
|
7
8
|
#e = !1;
|
|
8
9
|
#t = !1;
|
|
9
10
|
#s = /* @__PURE__ */ new Map();
|
|
@@ -44,14 +45,14 @@ var L = class extends EventTarget {
|
|
|
44
45
|
listen(e, t, s, i = !1) {
|
|
45
46
|
e.addEventListener(t, s, i);
|
|
46
47
|
const r = this.listeningTo.get(e) || {};
|
|
47
|
-
r[t] = () => e.removeEventListener(t, s, i), this.listeningTo.set(e, r),
|
|
48
|
+
r[t] = () => e.removeEventListener(t, s, i), this.listeningTo.set(e, r), B(e.isListenedToBy) && e.isListenedToBy(this);
|
|
48
49
|
}
|
|
49
50
|
stopBeingListenedTo() {
|
|
50
51
|
for (const e of this.isObservedBy)
|
|
51
52
|
e.stopListeningTo(this), this.isObservedBy.delete(e);
|
|
52
53
|
}
|
|
53
54
|
stopListeningTo(e, t) {
|
|
54
|
-
e && this.listeningTo.has(e) && (
|
|
55
|
+
e && this.listeningTo.has(e) && (B(e.isObservedBy) && e.isObservedBy.delete(this), B(t) ? (Object.entries(this.listeningTo.get(e)).forEach(([s, i]) => {
|
|
55
56
|
s === t && i();
|
|
56
57
|
}), Object.keys(this.listeningTo.get(e)).length || this.listeningTo.delete(e)) : (Object.values(this.listeningTo.get(e)).forEach((s) => s()), this.listeningTo.delete(e)));
|
|
57
58
|
}
|
|
@@ -72,7 +73,7 @@ var L = class extends EventTarget {
|
|
|
72
73
|
dispose() {
|
|
73
74
|
this.disposeInternal();
|
|
74
75
|
}
|
|
75
|
-
},
|
|
76
|
+
}, V = class {
|
|
76
77
|
constructor(e, t) {
|
|
77
78
|
this.value_ = e, this.data_ = t || {};
|
|
78
79
|
}
|
|
@@ -83,22 +84,22 @@ var L = class extends EventTarget {
|
|
|
83
84
|
return this.data_;
|
|
84
85
|
}
|
|
85
86
|
}, d = {
|
|
86
|
-
COMP:
|
|
87
|
-
COMP_DRAG_START:
|
|
88
|
-
COMP_DRAG_MOVE:
|
|
89
|
-
COMP_DRAG_END:
|
|
90
|
-
PANEL:
|
|
91
|
-
VIEW:
|
|
92
|
-
SPLIT:
|
|
93
|
-
SPLIT_WILL_OPEN:
|
|
94
|
-
SPLIT_DID_OPEN:
|
|
95
|
-
SPLIT_WILL_CLOSE:
|
|
96
|
-
SPLIT_DID_CLOSE:
|
|
97
|
-
SPLIT_TRANSITION_END:
|
|
98
|
-
READY:
|
|
99
|
-
PANEL_MINIMIZE:
|
|
100
|
-
FORM_SUBMIT_SUCCESS:
|
|
101
|
-
},
|
|
87
|
+
COMP: v(),
|
|
88
|
+
COMP_DRAG_START: v(),
|
|
89
|
+
COMP_DRAG_MOVE: v(),
|
|
90
|
+
COMP_DRAG_END: v(),
|
|
91
|
+
PANEL: v(),
|
|
92
|
+
VIEW: v(),
|
|
93
|
+
SPLIT: v(),
|
|
94
|
+
SPLIT_WILL_OPEN: v(),
|
|
95
|
+
SPLIT_DID_OPEN: v(),
|
|
96
|
+
SPLIT_WILL_CLOSE: v(),
|
|
97
|
+
SPLIT_DID_CLOSE: v(),
|
|
98
|
+
SPLIT_TRANSITION_END: v(),
|
|
99
|
+
READY: v(),
|
|
100
|
+
PANEL_MINIMIZE: v(),
|
|
101
|
+
FORM_SUBMIT_SUCCESS: v()
|
|
102
|
+
}, k = {
|
|
102
103
|
NOT_SUPPORTED: "Method not supported",
|
|
103
104
|
DECORATE_INVALID: "Invalid element to decorate",
|
|
104
105
|
ALREADY_RENDERED: "Component already rendered",
|
|
@@ -108,7 +109,7 @@ var L = class extends EventTarget {
|
|
|
108
109
|
NOT_OUR_CHILD: "Child is not in parent component",
|
|
109
110
|
NOT_IN_DOCUMENT: "Operation not supported while component is not in document",
|
|
110
111
|
STATE_INVALID: "Invalid component state"
|
|
111
|
-
},
|
|
112
|
+
}, A = class extends M {
|
|
112
113
|
static compEventCode() {
|
|
113
114
|
return d.COMP;
|
|
114
115
|
}
|
|
@@ -116,7 +117,7 @@ var L = class extends EventTarget {
|
|
|
116
117
|
return d.READY;
|
|
117
118
|
}
|
|
118
119
|
static compErrors() {
|
|
119
|
-
return
|
|
120
|
+
return k;
|
|
120
121
|
}
|
|
121
122
|
#e;
|
|
122
123
|
#t;
|
|
@@ -164,17 +165,17 @@ var L = class extends EventTarget {
|
|
|
164
165
|
this.#s = this.#e();
|
|
165
166
|
}
|
|
166
167
|
assertCanRenderAsync() {
|
|
167
|
-
if (this.disposed) throw new Error(
|
|
168
|
+
if (this.disposed) throw new Error(k.ALREADY_DISPOSED);
|
|
168
169
|
}
|
|
169
170
|
render(e) {
|
|
170
171
|
this.render_(e);
|
|
171
172
|
}
|
|
172
173
|
render_(e) {
|
|
173
|
-
if (this.disposed) throw new Error(
|
|
174
|
-
if (this.isInDocument) throw new Error(
|
|
174
|
+
if (this.disposed) throw new Error(k.ALREADY_DISPOSED);
|
|
175
|
+
if (this.isInDocument) throw new Error(k.ALREADY_RENDERED);
|
|
175
176
|
this.#s || this.createDom();
|
|
176
177
|
const t = this.#s;
|
|
177
|
-
e && (this.#r = e), this.placeholderDom &&
|
|
178
|
+
e && (this.#r = e), this.placeholderDom && L(this.placeholderDom), this.#r ? ie(t) || this.#r.insertBefore(t, null) : ie(t) || document.body.appendChild(t), (!this.#n || this.#n.isInDocument) && this.enterDocument();
|
|
178
179
|
}
|
|
179
180
|
hoist(e, t = void 0) {
|
|
180
181
|
t || (t = document.querySelector("body")), t.appendChild(e), this.outOfTreeElements.push(e);
|
|
@@ -183,23 +184,23 @@ var L = class extends EventTarget {
|
|
|
183
184
|
this.#a();
|
|
184
185
|
}
|
|
185
186
|
enterDocument() {
|
|
186
|
-
this.disposed ?
|
|
187
|
+
this.disposed ? L(this.getElement()) : (this.isInDocument = !0, [...this.#o.values()].forEach((e) => {
|
|
187
188
|
!e.isInDocument && e.getElement() && e.enterDocument();
|
|
188
189
|
}), this.executeBeforeReady(), this.dispatchCompEvent(d.READY));
|
|
189
190
|
}
|
|
190
191
|
exitDocument() {
|
|
191
192
|
[...this.#o.values()].forEach((e) => {
|
|
192
193
|
e.isInDocument && e.exitDocument();
|
|
193
|
-
}), this.stopBeingListenedTo(), this.removeAllListener(), this.isInDocument = !1,
|
|
194
|
+
}), this.stopBeingListenedTo(), this.removeAllListener(), this.isInDocument = !1, L(this.getElement()), this.placeholderDom && L(this.placeholderDom);
|
|
194
195
|
}
|
|
195
196
|
disposeInternal() {
|
|
196
|
-
this.isInDocument && this.exitDocument(), this.#o && [...this.#o.values()].forEach((e) => e.disposeInternal()), this.outOfTreeElements.forEach(
|
|
197
|
+
this.isInDocument && this.exitDocument(), this.#o && [...this.#o.values()].forEach((e) => e.disposeInternal()), this.outOfTreeElements.forEach(L), this.#s && L(this.#s), this.placeholderDom && L(this.placeholderDom), this.#o = null, this.#s = void 0, this.#i = null, this.#n = null, super.disposeInternal();
|
|
197
198
|
}
|
|
198
199
|
dispose() {
|
|
199
200
|
this.abortController && this.abortController.abort();
|
|
200
201
|
const e = this.getElement();
|
|
201
|
-
if (e) for (const t of
|
|
202
|
-
const s =
|
|
202
|
+
if (e) for (const t of I.getRegisteredLibraries()) try {
|
|
203
|
+
const s = I.get(t);
|
|
203
204
|
s.dispose && s.dispose(e);
|
|
204
205
|
} catch (s) {
|
|
205
206
|
console.debug(`[${t}] Cleanup error during component disposal (non-critical):`, s);
|
|
@@ -207,10 +208,10 @@ var L = class extends EventTarget {
|
|
|
207
208
|
super.dispose();
|
|
208
209
|
}
|
|
209
210
|
dispatchCompEvent(e, t) {
|
|
210
|
-
const s = new
|
|
211
|
+
const s = new V(e, t), i = M.makeEvent(d.COMP, s);
|
|
211
212
|
return this.dispatchEvent(i);
|
|
212
213
|
}
|
|
213
|
-
},
|
|
214
|
+
}, h = {
|
|
214
215
|
CLICK: "click",
|
|
215
216
|
RIGHTCLICK: "rightclick",
|
|
216
217
|
DBLCLICK: "dblclick",
|
|
@@ -238,35 +239,35 @@ var L = class extends EventTarget {
|
|
|
238
239
|
DROP: "drop",
|
|
239
240
|
TRANSITIONEND: "transitionend",
|
|
240
241
|
ANIMATIONEND: "animationend"
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
],
|
|
242
|
+
}, qe = [
|
|
243
|
+
h.TOUCHMOVE,
|
|
244
|
+
h.TOUCHSTART,
|
|
245
|
+
h.TOUCHEND
|
|
246
|
+
], je = (e) => qe.includes(e.type), U = (e) => (je(e) && (e.clientX = e.targetTouches[0].clientX, e.clientY = e.targetTouches[0].clientY), e), He = (e, t, s, i) => (r) => {
|
|
246
247
|
r.preventDefault();
|
|
247
|
-
const
|
|
248
|
-
let u =
|
|
249
|
-
["x", "ew"].includes(i) ? u =
|
|
250
|
-
let
|
|
251
|
-
const g = (
|
|
252
|
-
|
|
253
|
-
}, _ = (
|
|
254
|
-
document.removeEventListener(
|
|
248
|
+
const n = U(r), l = n.currentTarget, [p, E] = Ae(l), m = n.clientX - p, S = n.clientY - E, o = e(p, E, m, S, l), a = s(p, E, m, S, l), c = t(p, E, m, S, l);
|
|
249
|
+
let u = We(c, l, m, S);
|
|
250
|
+
["x", "ew"].includes(i) ? u = Je(c, l, m, S) : ["y", "ns"].includes(i) && (u = Ge(c, l, m, S));
|
|
251
|
+
let f = !1;
|
|
252
|
+
const g = (b) => {
|
|
253
|
+
f = !0, u(b);
|
|
254
|
+
}, _ = (b) => {
|
|
255
|
+
document.removeEventListener(h.MOUSEMOVE, g, !0), document.removeEventListener(h.TOUCHMOVE, g, !0), document.removeEventListener(h.MOUSEUP, _, !0), document.removeEventListener(h.TOUCHEND, _, !0), f && a(b);
|
|
255
256
|
};
|
|
256
|
-
return document.addEventListener(
|
|
257
|
-
},
|
|
257
|
+
return document.addEventListener(h.MOUSEUP, _, !0), document.addEventListener(h.TOUCHEND, _, !0), document.addEventListener(h.MOUSEMOVE, g, !0), document.addEventListener(h.TOUCHMOVE, g, !0), o(r), _;
|
|
258
|
+
}, We = (e, t, s, i) => (r) => {
|
|
258
259
|
r.preventDefault();
|
|
259
|
-
const
|
|
260
|
-
t.style.left = `${
|
|
261
|
-
},
|
|
260
|
+
const n = U(r);
|
|
261
|
+
t.style.left = `${n.clientX - s}px`, t.style.top = `${n.clientY - i}px`, e(n);
|
|
262
|
+
}, Je = (e, t, s, i) => (r) => {
|
|
262
263
|
r.preventDefault();
|
|
263
|
-
const
|
|
264
|
-
t.style.left = `${
|
|
265
|
-
},
|
|
264
|
+
const n = U(r);
|
|
265
|
+
t.style.left = `${n.clientX - s}px`, e(n);
|
|
266
|
+
}, Ge = (e, t, s, i) => (r) => {
|
|
266
267
|
r.preventDefault();
|
|
267
|
-
const
|
|
268
|
-
t.style.top = `${
|
|
269
|
-
},
|
|
268
|
+
const n = U(r);
|
|
269
|
+
t.style.top = `${n.clientY - i}px`, e(n);
|
|
270
|
+
}, q = (e, t) => (s, i, r, n, l) => (p) => {
|
|
270
271
|
e.dispatchCompEvent(t, {
|
|
271
272
|
component: e,
|
|
272
273
|
browserEvent: p,
|
|
@@ -275,12 +276,12 @@ var L = class extends EventTarget {
|
|
|
275
276
|
clientX: p.clientX,
|
|
276
277
|
clientY: p.clientY,
|
|
277
278
|
xOrg: r,
|
|
278
|
-
yOrg:
|
|
279
|
+
yOrg: n,
|
|
279
280
|
deltaX: p.clientX - r - s,
|
|
280
|
-
deltaY: p.clientY -
|
|
281
|
-
target:
|
|
281
|
+
deltaY: p.clientY - n - i,
|
|
282
|
+
target: l
|
|
282
283
|
});
|
|
283
|
-
},
|
|
284
|
+
}, W = class extends A {
|
|
284
285
|
#e;
|
|
285
286
|
#t;
|
|
286
287
|
#s;
|
|
@@ -311,19 +312,19 @@ var L = class extends EventTarget {
|
|
|
311
312
|
this.#i = t(s);
|
|
312
313
|
};
|
|
313
314
|
if (this.isInDocument && this.#s) {
|
|
314
|
-
const t =
|
|
315
|
-
this.#s = !1, this.#t = this.#t || this.getElement(), this.listen(this.#t,
|
|
315
|
+
const t = q(this, d.COMP_DRAG_MOVE), s = q(this, d.COMP_DRAG_START), i = q(this, d.COMP_DRAG_END), r = He(s, t, i, this.#e);
|
|
316
|
+
this.#s = !1, this.#t = this.#t || this.getElement(), this.listen(this.#t, h.MOUSEDOWN, e(r)), this.listen(this.#t, h.TOUCHSTART, r), this.#t.classList.remove("locked");
|
|
316
317
|
}
|
|
317
318
|
}
|
|
318
319
|
lock() {
|
|
319
|
-
this.stopListeningTo(this.#t,
|
|
320
|
+
this.stopListeningTo(this.#t, h.MOUSEDOWN), this.stopListeningTo(this.#t, h.TOUCHSTART), this.#s = !0, this.#t.classList.add("locked");
|
|
320
321
|
}
|
|
321
|
-
},
|
|
322
|
-
getPath: () =>
|
|
322
|
+
}, Ye = /* @__PURE__ */ J({
|
|
323
|
+
getPath: () => G,
|
|
323
324
|
getQueryData: () => Ee,
|
|
324
|
-
objectToUrlParms: () =>
|
|
325
|
-
queryDataToMap: () =>
|
|
326
|
-
}),
|
|
325
|
+
objectToUrlParms: () => _e,
|
|
326
|
+
queryDataToMap: () => Se
|
|
327
|
+
}), Xe = /* @__PURE__ */ new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$"), fe = {
|
|
327
328
|
SCHEME: 1,
|
|
328
329
|
USER_INFO: 2,
|
|
329
330
|
DOMAIN: 3,
|
|
@@ -331,53 +332,53 @@ var L = class extends EventTarget {
|
|
|
331
332
|
PATH: 5,
|
|
332
333
|
QUERY_DATA: 6,
|
|
333
334
|
FRAGMENT: 7
|
|
334
|
-
},
|
|
335
|
+
}, ge = (e) => e.match(Xe), ve = (e, t) => e ? t ? decodeURI(e.replace(/%25/g, "%2525")) : decodeURIComponent(e) : "", G = (e) => ve(ge(e)[fe.PATH], !0), Ee = (e) => ve(ge(e)[fe.QUERY_DATA], !0), _e = (e) => Object.entries(e).map((t) => `${t[0]}=${t[1]}`).join("&"), oe = (e) => e != null && e !== "", Se = (e) => e.split("&").reduce((t, s) => {
|
|
335
336
|
const [i, r] = s.split("=");
|
|
336
|
-
return
|
|
337
|
-
}, /* @__PURE__ */ new Map()),
|
|
337
|
+
return oe(i) && oe(r) && t.set(i, r), t;
|
|
338
|
+
}, /* @__PURE__ */ new Map()), Ke = ue(" "), Qe = ue("/"), Ze = (e) => document.cookie.split(";").map((t) => t.split("=")).reduce((t, s) => t.set(Ke(s[0]), s[1]), /* @__PURE__ */ new Map()).get(e), et = (e) => {
|
|
338
339
|
let t = 0, s;
|
|
339
340
|
const i = (r) => {
|
|
340
|
-
const
|
|
341
|
-
return
|
|
341
|
+
const n = r > 0;
|
|
342
|
+
return n ? t += 1 : t -= 1, n ? t === 1 : t === 0;
|
|
342
343
|
};
|
|
343
344
|
return (r) => {
|
|
344
345
|
s = s || document.getElementById(e), s && i(r) && s.classList.toggle("viz", t > 0);
|
|
345
346
|
};
|
|
346
|
-
},
|
|
347
|
+
}, Te = et("the_loader"), j = () => Promise.resolve(Te(1)), x = (e) => (Te(0), Promise.resolve(e)), O = (e) => e.ok ? Promise.resolve(e) : Promise.reject(/* @__PURE__ */ new Error(`${e.url} ${e.status} (${e.statusText})`)), tt = (e) => (t) => {
|
|
347
348
|
if (t.type === "opaqueredirect" || t.redirected) {
|
|
348
|
-
const s =
|
|
349
|
+
const s = Qe(G(t.url));
|
|
349
350
|
e.setIsRedirected(!0, s), console.log("Redirect detected", s);
|
|
350
351
|
}
|
|
351
|
-
return
|
|
352
|
-
},
|
|
352
|
+
return O(t);
|
|
353
|
+
}, N = (e) => e.json(), Y = (e) => e.text().then((t) => Promise.resolve(t), (t) => Promise.reject(/* @__PURE__ */ new Error(`Could not get text from response: ${t}`))), st = (e) => e.headers.get("Content-Type") === "application/json" ? N(e) : Y(e), z = (e, t, s = "POST", i = void 0) => {
|
|
353
354
|
const r = new Headers();
|
|
354
355
|
r.append("Content-type", "application/json"), r.append("X-Requested-With", "XMLHttpRequest"), e && e !== "" && r.append("Authorization", `Bearer ${e}`);
|
|
355
|
-
const
|
|
356
|
+
const n = {
|
|
356
357
|
cache: "no-cache",
|
|
357
358
|
method: s,
|
|
358
359
|
headers: r,
|
|
359
360
|
credentials: "include",
|
|
360
361
|
body: JSON.stringify(t)
|
|
361
362
|
};
|
|
362
|
-
return i && (
|
|
363
|
-
},
|
|
363
|
+
return i && (n.signal = i), n;
|
|
364
|
+
}, De = (e, t, s = !1, i = void 0) => {
|
|
364
365
|
const r = new Headers();
|
|
365
366
|
if (t && t !== "" && r.append("Authorization", `Bearer ${t}`), r.append("X-Requested-With", "XMLHttpRequest"), s) {
|
|
366
|
-
const
|
|
367
|
-
|
|
367
|
+
const l = Ze("csrftoken");
|
|
368
|
+
l && s && r.append("X-CSRFToken", l);
|
|
368
369
|
}
|
|
369
|
-
const
|
|
370
|
+
const n = {
|
|
370
371
|
cache: "no-cache",
|
|
371
372
|
method: e,
|
|
372
373
|
headers: r,
|
|
373
374
|
redirect: "follow",
|
|
374
375
|
credentials: "include"
|
|
375
376
|
};
|
|
376
|
-
return i && (
|
|
377
|
-
},
|
|
378
|
-
const i =
|
|
377
|
+
return i && (n.signal = i), n;
|
|
378
|
+
}, it = (e, t, s = void 0) => {
|
|
379
|
+
const i = De("POST", e, !1, s);
|
|
379
380
|
return i.body = new FormData(t.formEl), i;
|
|
380
|
-
},
|
|
381
|
+
}, ae = (e, t = void 0) => {
|
|
381
382
|
const s = new Headers();
|
|
382
383
|
s.append("Authorization", `Bearer ${e}`), s.append("X-Requested-With", "XMLHttpRequest");
|
|
383
384
|
const i = {
|
|
@@ -386,10 +387,10 @@ var L = class extends EventTarget {
|
|
|
386
387
|
credentials: "include"
|
|
387
388
|
};
|
|
388
389
|
return t && (i.signal = t), i;
|
|
389
|
-
},
|
|
390
|
+
}, rt = (e, t) => {
|
|
390
391
|
const s = new Request(e);
|
|
391
|
-
return fetch(s, t).then(
|
|
392
|
-
},
|
|
392
|
+
return fetch(s, t).then(O).then(Y);
|
|
393
|
+
}, y = (e, t = void 0) => (s) => (x("").then(D), s.name === "AbortError" ? console.info(e, "ABORTED!") : console.error(e, s), t), $ = class {
|
|
393
394
|
constructor(e) {
|
|
394
395
|
this.user_ = {}, this.jwt = "", e && this.updateProfileFromJwt(e).then(() => {
|
|
395
396
|
});
|
|
@@ -418,49 +419,49 @@ var L = class extends EventTarget {
|
|
|
418
419
|
return t && (e = e + " " + t), e;
|
|
419
420
|
}
|
|
420
421
|
formSubmit(e) {
|
|
421
|
-
const t = new Request(e.uri.toString()), s = e.processSubmitReply.bind(e), i =
|
|
422
|
-
return
|
|
422
|
+
const t = new Request(e.uri.toString()), s = e.processSubmitReply.bind(e), i = y("Form submit error");
|
|
423
|
+
return j().then(() => fetch(t, it(this.jwt, e, e.abortController.signal))).then(tt(e)).then(x).then(st).then(s).catch(i);
|
|
423
424
|
}
|
|
424
425
|
putNoBody(e, t = void 0, s = !1) {
|
|
425
|
-
const i =
|
|
426
|
-
return
|
|
426
|
+
const i = y("putNobody error"), r = De("PUT", this.jwt, s, t);
|
|
427
|
+
return rt(e, r).catch(i);
|
|
427
428
|
}
|
|
428
429
|
fetch(e, t = void 0) {
|
|
429
|
-
const s = new Request(e.toString()), i =
|
|
430
|
-
return
|
|
430
|
+
const s = new Request(e.toString()), i = y(`UMan Text GET Fetch: ${e}`);
|
|
431
|
+
return j().then(() => fetch(s, ae(this.jwt, t))).then(O).then(x).then(Y).catch(i);
|
|
431
432
|
}
|
|
432
433
|
fetchAndSplit(e, t = void 0) {
|
|
433
|
-
const s =
|
|
434
|
-
return this.fetch(e, t).then(
|
|
434
|
+
const s = y(`fetchAndSplit: ${e}`);
|
|
435
|
+
return this.fetch(e, t).then(Pe).catch(s);
|
|
435
436
|
}
|
|
436
437
|
async fetchJson(e, t = void 0, s = void 0) {
|
|
437
|
-
const i = new Request(e.toString()), r =
|
|
438
|
-
await
|
|
439
|
-
let
|
|
438
|
+
const i = new Request(e.toString()), r = y(`fetchJson: ${e}`, s), n = ae(this.jwt, t);
|
|
439
|
+
await j();
|
|
440
|
+
let l;
|
|
440
441
|
try {
|
|
441
|
-
|
|
442
|
+
l = await (await fetch(i, n)).json();
|
|
442
443
|
} catch (p) {
|
|
443
444
|
return r(p);
|
|
444
445
|
}
|
|
445
|
-
return await
|
|
446
|
+
return await x(), l;
|
|
446
447
|
}
|
|
447
448
|
patchJson(e, t, s = void 0) {
|
|
448
|
-
const i = new Request(e.toString()), r =
|
|
449
|
-
return fetch(i,
|
|
449
|
+
const i = new Request(e.toString()), r = y(`patchJson: ${e}`), n = z(this.jwt, t, "PATCH", s);
|
|
450
|
+
return fetch(i, n).then(O).then(N).catch(r);
|
|
450
451
|
}
|
|
451
452
|
postJson(e, t, s = void 0) {
|
|
452
|
-
const i = new Request(e.toString()), r =
|
|
453
|
-
return fetch(i,
|
|
453
|
+
const i = new Request(e.toString()), r = y(`postJson: ${e}`), n = z(this.jwt, t, "POST", s);
|
|
454
|
+
return fetch(i, n).then(O).then(N).catch(r);
|
|
454
455
|
}
|
|
455
456
|
putJson(e, t, s = void 0) {
|
|
456
|
-
const i = new Request(e.toString()), r =
|
|
457
|
-
return fetch(i,
|
|
457
|
+
const i = new Request(e.toString()), r = y(`putJson: ${e}`), n = z(this.jwt, t, "PUT", s);
|
|
458
|
+
return fetch(i, n).then(O).then(N).catch(r);
|
|
458
459
|
}
|
|
459
460
|
delJson(e, t, s = void 0) {
|
|
460
|
-
const i = new Request(e.toString()), r =
|
|
461
|
-
return fetch(i,
|
|
461
|
+
const i = new Request(e.toString()), r = y(`delJson: ${e}`), n = z(this.jwt, t, "DELETE", s);
|
|
462
|
+
return fetch(i, n).then(O).then(N).catch(r);
|
|
462
463
|
}
|
|
463
|
-
},
|
|
464
|
+
}, X = class extends A {
|
|
464
465
|
static panelEventCode() {
|
|
465
466
|
return d.PANEL;
|
|
466
467
|
}
|
|
@@ -468,7 +469,7 @@ var L = class extends EventTarget {
|
|
|
468
469
|
return d.READY;
|
|
469
470
|
}
|
|
470
471
|
constructor(e) {
|
|
471
|
-
super(), this.qParamMap_ = /* @__PURE__ */ new Map(), this.uri_ = "", e && this.parseUri(e), this.evalScripts =
|
|
472
|
+
super(), this.qParamMap_ = /* @__PURE__ */ new Map(), this.uri_ = "", e && this.parseUri(e), this.evalScripts = Ie(this), this.evalModules = Re(this), this.redirected = !1, this.responseObject = {
|
|
472
473
|
html: null,
|
|
473
474
|
scripts: null
|
|
474
475
|
}, this.user_ = void 0, "AbortController" in window ? this.abortController = new AbortController() : this.abortController = {
|
|
@@ -478,17 +479,17 @@ var L = class extends EventTarget {
|
|
|
478
479
|
}, this.listMap = /* @__PURE__ */ new Map();
|
|
479
480
|
}
|
|
480
481
|
get uri() {
|
|
481
|
-
const e = this.qParamMap_.size > 0 ? "?" +
|
|
482
|
+
const e = this.qParamMap_.size > 0 ? "?" + _e(Object.fromEntries(this.qParamMap_)) : "";
|
|
482
483
|
return this.uri_ + e;
|
|
483
484
|
}
|
|
484
485
|
set user(e) {
|
|
485
486
|
this.user_ = e;
|
|
486
487
|
}
|
|
487
488
|
get user() {
|
|
488
|
-
return this.user_ || (this.user_ = new
|
|
489
|
+
return this.user_ || (this.user_ = new $()), this.user_;
|
|
489
490
|
}
|
|
490
491
|
parseUri(e) {
|
|
491
|
-
this.uri_ =
|
|
492
|
+
this.uri_ = G(e), this.qParamMap_ = Se(Ee(e));
|
|
492
493
|
}
|
|
493
494
|
addToQParams(e, t) {
|
|
494
495
|
this.qParamMap_.set(e, t);
|
|
@@ -515,30 +516,30 @@ var L = class extends EventTarget {
|
|
|
515
516
|
renderWithTemplate(e) {
|
|
516
517
|
const t = this.user;
|
|
517
518
|
return t ? t.fetch(this.uri, this.abortController.signal).then((s) => (this.assertCanRenderAsync(), e && e(this), this.onRenderWithTemplateReply(s).catch((i) => {
|
|
518
|
-
i.message !==
|
|
519
|
+
i.message !== A.compErrors().ALREADY_DISPOSED && console.error("RenderWithTemplate Err:", i);
|
|
519
520
|
}), this)).catch((s) => {
|
|
520
521
|
throw console.error("Panel.renderWithTemplate fetch failed:", s), s;
|
|
521
522
|
}) : Promise.reject(/* @__PURE__ */ new Error("No UserManager instance available for Panel.renderWithTemplate()"));
|
|
522
523
|
}
|
|
523
524
|
onRenderWithTemplateReply(e) {
|
|
524
|
-
return this.responseObject =
|
|
525
|
+
return this.responseObject = he(e), this.domFunc = () => this.responseObject.html, this.render(), Promise.resolve(this);
|
|
525
526
|
}
|
|
526
527
|
onReplacePartialDom(e, t) {
|
|
527
528
|
const s = this.getElement();
|
|
528
|
-
if (
|
|
529
|
+
if ($e(s)) return;
|
|
529
530
|
const i = e.html;
|
|
530
|
-
if (t.startsWith(".")) [...s.querySelectorAll(t)].filter((r) =>
|
|
531
|
-
r.parentNode.replaceChild(
|
|
531
|
+
if (t.startsWith(".")) [...s.querySelectorAll(t)].filter((r) => H(r.id)).map((r) => [r, i.querySelector(`#${r.id}`)]).filter(([r, n]) => H(n)).forEach(([r, n]) => {
|
|
532
|
+
r.parentNode.replaceChild(n, r), this.parseContent(n);
|
|
532
533
|
});
|
|
533
534
|
else if (t.startsWith("#")) {
|
|
534
|
-
const r = i.querySelector(t),
|
|
535
|
-
|
|
535
|
+
const r = i.querySelector(t), n = s.querySelector(t);
|
|
536
|
+
n.parentNode.replaceChild(r, n), this.parseContent(r);
|
|
536
537
|
}
|
|
537
538
|
this.evalScripts(e.scripts), this.evalModules(e.modules);
|
|
538
539
|
}
|
|
539
540
|
renderWithJSON(e) {
|
|
540
541
|
return this.user ? this.user.fetchJson(this.uri_, this.abortController.signal).then((t) => {
|
|
541
|
-
this.assertCanRenderAsync(), e && e(t, this), this.onRenderWithJSON(t).then(
|
|
542
|
+
this.assertCanRenderAsync(), e && e(t, this), this.onRenderWithJSON(t).then(D);
|
|
542
543
|
}).catch((t) => {
|
|
543
544
|
throw console.error("Panel.renderWithJSON fetch failed:", t), t;
|
|
544
545
|
}) : Promise.reject(/* @__PURE__ */ new Error("No UserManager instance available for Panel.renderWithJSON()"));
|
|
@@ -553,110 +554,110 @@ var L = class extends EventTarget {
|
|
|
553
554
|
onViewDataBroadcast(e) {
|
|
554
555
|
}
|
|
555
556
|
parseContent(e) {
|
|
556
|
-
if (this.debugMe("Enable interactions. Panel:", e), typeof window.customElements < "u" &&
|
|
557
|
-
const
|
|
558
|
-
|
|
557
|
+
if (this.debugMe("Enable interactions. Panel:", e), typeof window.customElements < "u" && I.has("carbon")) {
|
|
558
|
+
const o = I.get("carbon");
|
|
559
|
+
o.render.call(this, e, o.cache).catch((a) => console.error("[Zooy] Carbon initialization failed:", a));
|
|
559
560
|
}
|
|
560
|
-
if (
|
|
561
|
-
const
|
|
562
|
-
|
|
561
|
+
if (I.has("mdc")) {
|
|
562
|
+
const o = I.get("mdc");
|
|
563
|
+
o.render.call(this, e, o.cache);
|
|
563
564
|
}
|
|
564
|
-
e.classList.contains("zoo__modal-base") && e.classList.contains("close_on_click") && this.listen(e,
|
|
565
|
-
|
|
566
|
-
}), [...e.querySelectorAll(".zoo__button:not(.external):not(.mdc-data-table__row)")].forEach((
|
|
567
|
-
this.listen(
|
|
565
|
+
e.classList.contains("zoo__modal-base") && e.classList.contains("close_on_click") && this.listen(e, h.CLICK, (o) => {
|
|
566
|
+
o.target === e && this.dispatchPanelEvent("destroy_me");
|
|
567
|
+
}), [...e.querySelectorAll(".zoo__button:not(.external):not(.mdc-data-table__row)")].forEach((o) => {
|
|
568
|
+
this.listen(o, h.CLICK, (a) => {
|
|
568
569
|
a.stopPropagation();
|
|
569
|
-
const
|
|
570
|
+
const c = a.currentTarget, u = w(c);
|
|
570
571
|
this.dispatchPanelEvent(u.zv, Object.assign({
|
|
571
572
|
orgEvt: a,
|
|
572
|
-
trigger:
|
|
573
|
-
href:
|
|
573
|
+
trigger: c,
|
|
574
|
+
href: c.href || u.href
|
|
574
575
|
}, u));
|
|
575
576
|
});
|
|
576
|
-
}), [...e.querySelectorAll("[href]:not(.external):not([event])")].forEach((
|
|
577
|
-
this.listen(
|
|
578
|
-
const
|
|
577
|
+
}), [...e.querySelectorAll("[href]:not(.external):not([event])")].forEach((o) => {
|
|
578
|
+
this.listen(o, h.CLICK, (a) => {
|
|
579
|
+
const c = a.currentTarget;
|
|
579
580
|
a.preventDefault(), a.stopPropagation();
|
|
580
|
-
const u = w(
|
|
581
|
-
this.dispatchPanelEvent(
|
|
581
|
+
const u = w(c), f = u.zv || "href";
|
|
582
|
+
this.dispatchPanelEvent(f, Object.assign({
|
|
582
583
|
orgEvt: a,
|
|
583
584
|
trigger: a.target,
|
|
584
|
-
href:
|
|
585
|
+
href: c.href || u.href
|
|
585
586
|
}, u));
|
|
586
587
|
});
|
|
587
|
-
}), [...e.querySelectorAll("form.intercept_submit")].forEach((
|
|
588
|
-
|
|
588
|
+
}), [...e.querySelectorAll("form.intercept_submit")].forEach((o) => {
|
|
589
|
+
o.noValidate = !0, this.listen(o, h.SUBMIT, (a) => {
|
|
589
590
|
a.preventDefault(), a.stopPropagation();
|
|
590
|
-
const
|
|
591
|
-
this.dispatchPanelEvent(
|
|
591
|
+
const c = w(o), u = ze(o.elements);
|
|
592
|
+
this.dispatchPanelEvent(c.zv, Object.assign({
|
|
592
593
|
orgEvt: a,
|
|
593
594
|
trigger: a.target,
|
|
594
595
|
formData: u,
|
|
595
|
-
href:
|
|
596
|
-
},
|
|
596
|
+
href: c.href
|
|
597
|
+
}, c));
|
|
597
598
|
});
|
|
598
|
-
}), [...e.querySelectorAll(".zoo__toggle_class_driver")].forEach((
|
|
599
|
-
const a = w(
|
|
600
|
-
|
|
601
|
-
g.stopPropagation(),
|
|
599
|
+
}), [...e.querySelectorAll(".zoo__toggle_class_driver")].forEach((o) => {
|
|
600
|
+
const a = w(o), c = a.toggle_class_target_id, u = a.toggle_class, f = e.querySelector(`#${c}`);
|
|
601
|
+
f && u && o.addEventListener(h.CLICK, (g) => {
|
|
602
|
+
g.stopPropagation(), f.classList.toggle(u);
|
|
602
603
|
});
|
|
603
604
|
});
|
|
604
|
-
const t = Array.from(e.querySelectorAll(".folder_drop_zone")), s = Array.from(e.querySelectorAll("[draggable]")), i = (
|
|
605
|
-
|
|
606
|
-
}, r = (
|
|
607
|
-
|
|
608
|
-
},
|
|
609
|
-
|
|
610
|
-
},
|
|
611
|
-
|
|
612
|
-
}, p = (
|
|
613
|
-
|
|
614
|
-
},
|
|
615
|
-
|
|
616
|
-
const a = w(
|
|
617
|
-
|
|
618
|
-
}, m = (
|
|
619
|
-
|
|
620
|
-
}, S = (
|
|
621
|
-
p(
|
|
622
|
-
const a = JSON.parse(
|
|
605
|
+
const t = Array.from(e.querySelectorAll(".folder_drop_zone")), s = Array.from(e.querySelectorAll("[draggable]")), i = (o) => {
|
|
606
|
+
o.preventDefault(), o.target.classList.add("drag_over");
|
|
607
|
+
}, r = (o) => {
|
|
608
|
+
o.preventDefault();
|
|
609
|
+
}, n = (o) => {
|
|
610
|
+
o.preventDefault(), o.target.classList.remove("drag_over");
|
|
611
|
+
}, l = (o) => {
|
|
612
|
+
o.preventDefault(), o.target.classList.remove("drag_over");
|
|
613
|
+
}, p = (o) => {
|
|
614
|
+
o.preventDefault(), o.target.classList.remove("drag_over");
|
|
615
|
+
}, E = (o) => {
|
|
616
|
+
o.dataTransfer.dropEffect = "move";
|
|
617
|
+
const a = w(o.target);
|
|
618
|
+
o.dataTransfer.setData("text/plain", JSON.stringify(a)), o.target.classList.add("drag_in_progress");
|
|
619
|
+
}, m = (o) => {
|
|
620
|
+
o.target.classList.remove("drag_in_progress");
|
|
621
|
+
}, S = (o) => {
|
|
622
|
+
p(o), o.stopPropagation();
|
|
623
|
+
const a = JSON.parse(o.dataTransfer.getData("text/plain")), c = w(o.target);
|
|
623
624
|
return this.dispatchPanelEvent("drop_on", { custom: {
|
|
624
|
-
on:
|
|
625
|
+
on: c,
|
|
625
626
|
from: a
|
|
626
627
|
} }), !1;
|
|
627
628
|
};
|
|
628
|
-
t.forEach((
|
|
629
|
-
this.listen(
|
|
630
|
-
}), s.forEach((
|
|
631
|
-
this.listen(
|
|
632
|
-
}), [...e.querySelectorAll(".zoo_async_json")].forEach((
|
|
633
|
-
const a = w(
|
|
634
|
-
this.user.fetchJson(
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
this.user.fetchJson(
|
|
629
|
+
t.forEach((o) => {
|
|
630
|
+
this.listen(o, h.DRAGOVER, r), this.listen(o, h.DRAGENTER, i), this.listen(o, h.DRAGEXIT, l), this.listen(o, h.DRAGLEAVE, n), this.listen(o, h.DROP, S);
|
|
631
|
+
}), s.forEach((o) => {
|
|
632
|
+
this.listen(o, h.DRAGSTART, E), this.listen(o, h.DRAGEND, m);
|
|
633
|
+
}), [...e.querySelectorAll(".zoo_async_json")].forEach((o) => {
|
|
634
|
+
const a = w(o), c = a.href, u = this.onAsyncJsonReply.bind(this, o, a);
|
|
635
|
+
this.user.fetchJson(c, this.abortController.signal).then(u);
|
|
636
|
+
const f = a.z_json_reusable;
|
|
637
|
+
f && (this.jsonCallFuncs = this.jsonCallFuncs || {}, this.jsonCallFuncs[f] = () => {
|
|
638
|
+
this.user.fetchJson(c, this.abortController.signal).then(u);
|
|
638
639
|
});
|
|
639
|
-
const g =
|
|
640
|
-
|
|
641
|
-
this.user.fetchJson(
|
|
640
|
+
const g = ne(a.z_interval);
|
|
641
|
+
re(g) && this.doOnBeat(() => {
|
|
642
|
+
this.user.fetchJson(c, this.abortController.signal).then(u);
|
|
642
643
|
}, g * 60 * 1e3);
|
|
643
|
-
}), [...e.querySelectorAll(".zoo_async_html")].forEach((
|
|
644
|
-
const a = w(
|
|
645
|
-
this.user.fetchAndSplit(
|
|
646
|
-
|
|
644
|
+
}), [...e.querySelectorAll(".zoo_async_html")].forEach((o) => {
|
|
645
|
+
const a = w(o), c = a.href;
|
|
646
|
+
this.user.fetchAndSplit(c, this.abortController.signal).then((f) => {
|
|
647
|
+
o.appendChild(f.html), this.parseContent(o), this.evalScripts(f.scripts), this.evalModules(f.modules), this.onAsyncHtmlReply(o, a);
|
|
647
648
|
});
|
|
648
|
-
const u =
|
|
649
|
-
|
|
650
|
-
this.user.fetchAndSplit(
|
|
651
|
-
|
|
649
|
+
const u = ne(a.z_interval);
|
|
650
|
+
re(u) && this.doOnBeat(() => {
|
|
651
|
+
this.user.fetchAndSplit(c, this.abortController.signal).then((f) => {
|
|
652
|
+
o.replaceChildren(f.html), this.parseContent(o), this.evalScripts(f.scripts), this.evalModules(f.modules);
|
|
652
653
|
});
|
|
653
654
|
}, u * 60 * 1e3);
|
|
654
|
-
}), [...e.querySelectorAll("[zoo-url-api]")].forEach((
|
|
655
|
-
if (
|
|
656
|
-
const a =
|
|
657
|
-
if (!a || !
|
|
658
|
-
const
|
|
659
|
-
|
|
655
|
+
}), [...e.querySelectorAll("[zoo-url-api]")].forEach((o) => {
|
|
656
|
+
if (o.tagName === "CDS-TABLE" || o.classList.contains("zoo_async_json") || o.dataBinder) return;
|
|
657
|
+
const a = o.getAttribute("zoo-url-api");
|
|
658
|
+
if (!a || !o.querySelector("[zoo-bind], [zoo-bind-attr], [zoo-template]")) return;
|
|
659
|
+
const c = new de(this, a, o);
|
|
660
|
+
o.dataBinder = c, c.fetchData().catch((u) => {
|
|
660
661
|
console.error("[Panel] zoo-url-api auto-bind fetch failed:", u);
|
|
661
662
|
});
|
|
662
663
|
});
|
|
@@ -672,12 +673,12 @@ var L = class extends EventTarget {
|
|
|
672
673
|
this.redirected = e, this.redirected && t && (this.uri_ = t);
|
|
673
674
|
}
|
|
674
675
|
dispatchPanelEvent(e, t) {
|
|
675
|
-
const s = new
|
|
676
|
+
const s = new V(e, t), i = M.makeEvent(d.PANEL, s);
|
|
676
677
|
return this.debugMe(`PANEL EVENT FIRED:
|
|
677
678
|
value:${e}
|
|
678
679
|
data:${t}`), this.dispatchEvent(i);
|
|
679
680
|
}
|
|
680
|
-
},
|
|
681
|
+
}, nt = class extends X {
|
|
681
682
|
#e = null;
|
|
682
683
|
#t = /* @__PURE__ */ new Map();
|
|
683
684
|
#s = !0;
|
|
@@ -698,11 +699,11 @@ var L = class extends EventTarget {
|
|
|
698
699
|
return e && (s = document.getElementById(e) || s), s && s.tagName.toLowerCase() === "form" && (t = s), t;
|
|
699
700
|
}
|
|
700
701
|
#i() {
|
|
701
|
-
this.#e && (this.listen(this.#e,
|
|
702
|
+
this.#e && (this.listen(this.#e, h.CHANGE, (e) => {
|
|
702
703
|
this.#o(e);
|
|
703
|
-
}, { passive: !0 }), this.listen(this.#e,
|
|
704
|
+
}, { passive: !0 }), this.listen(this.#e, h.INPUT, (e) => {
|
|
704
705
|
this.clearAllValidationErrors(), this.#o(e);
|
|
705
|
-
}), this.listen(this.#e,
|
|
706
|
+
}), this.listen(this.#e, h.INVALID, (e) => {
|
|
706
707
|
e.preventDefault();
|
|
707
708
|
const t = e.target;
|
|
708
709
|
this.#n(t), this.displayFieldError(t);
|
|
@@ -744,7 +745,7 @@ var L = class extends EventTarget {
|
|
|
744
745
|
if (e && this.#s) {
|
|
745
746
|
e.noValidate = !0;
|
|
746
747
|
const t = this.user;
|
|
747
|
-
this.listen(e,
|
|
748
|
+
this.listen(e, h.SUBMIT, (s) => {
|
|
748
749
|
s.preventDefault(), this.debugMe("Intercepted from SUBMIT"), this.checkAllFields() && t && t.formSubmit(this);
|
|
749
750
|
});
|
|
750
751
|
}
|
|
@@ -754,16 +755,16 @@ var L = class extends EventTarget {
|
|
|
754
755
|
this.onSubmitSucFunc = e;
|
|
755
756
|
}
|
|
756
757
|
replaceForm(e) {
|
|
757
|
-
if (this.responseObject =
|
|
758
|
+
if (this.responseObject = he(e), this.responseObject.html) {
|
|
758
759
|
if (this.redirected) {
|
|
759
760
|
this.removeAllListener();
|
|
760
761
|
const t = this.getElement(), s = t.parentNode;
|
|
761
762
|
this.setElementInternal_(this.responseObject.html), s.replaceChild(this.getElement(), t);
|
|
762
763
|
} else {
|
|
763
764
|
const t = this.responseObject.html.querySelector("form");
|
|
764
|
-
t &&
|
|
765
|
+
t && se(t, this.#e);
|
|
765
766
|
const s = this.responseObject.html.querySelector('[type="submit"]'), i = this.getElement().querySelector('[type="submit"]');
|
|
766
|
-
s && i &&
|
|
767
|
+
s && i && se(s, i);
|
|
767
768
|
}
|
|
768
769
|
this.enterDocument();
|
|
769
770
|
}
|
|
@@ -775,7 +776,7 @@ var L = class extends EventTarget {
|
|
|
775
776
|
processSubmitReply(e) {
|
|
776
777
|
this.clearAllValidationErrors();
|
|
777
778
|
let t = !1;
|
|
778
|
-
if (
|
|
779
|
+
if (Fe(e) === "object" && e.success) return Promise.resolve(this).then(() => {
|
|
779
780
|
this.onSubmitSucFunc(this, e), this.dispatchCompEvent(d.FORM_SUBMIT_SUCCESS);
|
|
780
781
|
});
|
|
781
782
|
if (e === "success" ? (this.debugMe(`
|
|
@@ -799,7 +800,7 @@ var L = class extends EventTarget {
|
|
|
799
800
|
6.REDIRECTED: ${this.redirected}
|
|
800
801
|
SUCCESS: ${t}`);
|
|
801
802
|
}
|
|
802
|
-
},
|
|
803
|
+
}, ot = class extends A {
|
|
803
804
|
static splitEventCode() {
|
|
804
805
|
return d.SPLIT;
|
|
805
806
|
}
|
|
@@ -815,10 +816,10 @@ var L = class extends EventTarget {
|
|
|
815
816
|
get nestNames() {
|
|
816
817
|
return [...this.nestMap_.entries()].filter(([e, t]) => !this.splitNests_.has(t)).map(([e]) => e);
|
|
817
818
|
}
|
|
818
|
-
closeAndLockAll(e =
|
|
819
|
+
closeAndLockAll(e = D, t = !1) {
|
|
819
820
|
this.nestNames.forEach((s) => this.closeAndLock(s, e, t));
|
|
820
821
|
}
|
|
821
|
-
openAndUnlockAll(e =
|
|
822
|
+
openAndUnlockAll(e = D, t = !1) {
|
|
822
823
|
this.nestNames.forEach((s) => this.openAndUnlock(s, e, t));
|
|
823
824
|
}
|
|
824
825
|
lock(e) {
|
|
@@ -829,120 +830,120 @@ var L = class extends EventTarget {
|
|
|
829
830
|
const { dragEl: t } = this.nestMap_.get(e);
|
|
830
831
|
t.classList.remove("locked");
|
|
831
832
|
}
|
|
832
|
-
resize(e, t, s =
|
|
833
|
-
const { sizeNow: r, nestEl:
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
}),
|
|
833
|
+
resize(e, t, s = D, i = !1) {
|
|
834
|
+
const { sizeNow: r, nestEl: n, canResize: l } = this.nestMap_.get(e);
|
|
835
|
+
l && (i || r === t ? (n.classList.remove("animated"), n.style.flexBasis = `${t}px`, this.nestMap_.get(e).sizeNow = t, s()) : (n.classList.add("animated"), this.nestCallbackMap_.set(e, () => {
|
|
836
|
+
n.classList.remove("animated"), this.nestMap_.get(e).sizeNow = t, s();
|
|
837
|
+
}), n.style.flexBasis = `${t}px`));
|
|
837
838
|
}
|
|
838
|
-
closeAndLock(e, t =
|
|
839
|
-
const { nestEl: i, dragEl: r, canResize:
|
|
840
|
-
if (!
|
|
841
|
-
const
|
|
839
|
+
closeAndLock(e, t = D, s = !1) {
|
|
840
|
+
const { nestEl: i, dragEl: r, canResize: n } = this.nestMap_.get(e);
|
|
841
|
+
if (!n) return;
|
|
842
|
+
const l = () => {
|
|
842
843
|
r.classList.add("locked", "closed"), i.classList.add("closed"), t();
|
|
843
844
|
};
|
|
844
|
-
this.resize(e, 0,
|
|
845
|
+
this.resize(e, 0, l, s);
|
|
845
846
|
}
|
|
846
|
-
closeAndUnlock(e, t =
|
|
847
|
-
const { nestEl: i, dragEl: r, canResize:
|
|
848
|
-
if (!
|
|
849
|
-
const
|
|
847
|
+
closeAndUnlock(e, t = D, s = !1) {
|
|
848
|
+
const { nestEl: i, dragEl: r, canResize: n } = this.nestMap_.get(e);
|
|
849
|
+
if (!n) return;
|
|
850
|
+
const l = () => {
|
|
850
851
|
i.classList.remove("closed"), r.classList.remove("closed", "locked"), r.classList.add("collapsed"), t();
|
|
851
852
|
};
|
|
852
|
-
this.resize(e, 0,
|
|
853
|
+
this.resize(e, 0, l, s);
|
|
853
854
|
}
|
|
854
855
|
openAndUnlock(e, t, s, i = !1) {
|
|
855
|
-
const { nestEl: r, dragEl:
|
|
856
|
-
if (!
|
|
857
|
-
const m = t || p ||
|
|
858
|
-
r.classList.remove("closed"),
|
|
856
|
+
const { nestEl: r, dragEl: n, defSize: l, lastSize: p, canResize: E } = this.nestMap_.get(e);
|
|
857
|
+
if (!E) return;
|
|
858
|
+
const m = t || p || l;
|
|
859
|
+
r.classList.remove("closed"), n.classList.remove("closed", "locked", "collapsed"), setTimeout(() => {
|
|
859
860
|
this.resize(e, m, s, i);
|
|
860
861
|
}, 50);
|
|
861
862
|
}
|
|
862
863
|
openAndLock(e, t, s, i = !1) {
|
|
863
|
-
const { nestEl: r, dragEl:
|
|
864
|
-
if (!
|
|
865
|
-
const m = t || p ||
|
|
866
|
-
r.classList.remove("closed"),
|
|
864
|
+
const { nestEl: r, dragEl: n, defSize: l, lastSize: p, canResize: E } = this.nestMap_.get(e);
|
|
865
|
+
if (!E) return;
|
|
866
|
+
const m = t || p || l;
|
|
867
|
+
r.classList.remove("closed"), n.classList.remove("closed", "collapsed"), setTimeout(() => {
|
|
867
868
|
this.resize(e, m, s, i);
|
|
868
869
|
}, 50);
|
|
869
870
|
}
|
|
870
|
-
close(e, t =
|
|
871
|
-
const { dragEl: i, canResize: r, nestEl:
|
|
871
|
+
close(e, t = D, s = !1) {
|
|
872
|
+
const { dragEl: i, canResize: r, nestEl: n } = this.nestMap_.get(e);
|
|
872
873
|
if (!r) return;
|
|
873
874
|
this.dispatchSplitEvent(d.SPLIT_WILL_CLOSE, {
|
|
874
875
|
nestName: e,
|
|
875
|
-
nestEl:
|
|
876
|
+
nestEl: n
|
|
876
877
|
});
|
|
877
|
-
const
|
|
878
|
+
const l = () => {
|
|
878
879
|
i.classList.add("collapsed"), this.dispatchSplitEvent(d.SPLIT_DID_CLOSE, {
|
|
879
880
|
nestName: e,
|
|
880
|
-
nestEl:
|
|
881
|
+
nestEl: n
|
|
881
882
|
}), t();
|
|
882
883
|
};
|
|
883
|
-
this.resize(e, 0,
|
|
884
|
+
this.resize(e, 0, l, s);
|
|
884
885
|
}
|
|
885
|
-
open(e, t =
|
|
886
|
-
const { defSize: i, lastSize: r, dragEl:
|
|
887
|
-
if (!
|
|
886
|
+
open(e, t = D, s = !1) {
|
|
887
|
+
const { defSize: i, lastSize: r, dragEl: n, canResize: l, nestEl: p } = this.nestMap_.get(e);
|
|
888
|
+
if (!l) return;
|
|
888
889
|
this.dispatchSplitEvent(d.SPLIT_WILL_OPEN, {
|
|
889
890
|
nestName: e,
|
|
890
891
|
nestEl: p
|
|
891
|
-
}),
|
|
892
|
-
const
|
|
892
|
+
}), n.classList.remove("collapsed", "closed");
|
|
893
|
+
const E = r || i, m = () => {
|
|
893
894
|
this.dispatchSplitEvent(d.SPLIT_DID_OPEN, {
|
|
894
895
|
nestName: e,
|
|
895
896
|
nestEl: p
|
|
896
897
|
}), t();
|
|
897
898
|
};
|
|
898
|
-
this.resize(e,
|
|
899
|
+
this.resize(e, E, m, s);
|
|
899
900
|
}
|
|
900
901
|
toggle(e, t, s = !1) {
|
|
901
902
|
this.nestMap_.get(e).sizeNow === 0 ? this.open(e, t, s) : this.close(e, t, s);
|
|
902
903
|
}
|
|
903
|
-
addSplit(e = void 0, t = "EW", s = 100, i = 100, r = [],
|
|
904
|
+
addSplit(e = void 0, t = "EW", s = 100, i = 100, r = [], n = [], l = [], p = [], E = []) {
|
|
904
905
|
const m = e || this.getElement();
|
|
905
906
|
if (this.splitNests_.has(m)) return ["Already used!", m];
|
|
906
|
-
|
|
907
|
+
at(m, t), this.splitNests_.add(m);
|
|
907
908
|
let S = "";
|
|
908
909
|
if (e) {
|
|
909
|
-
const
|
|
910
|
-
if (
|
|
910
|
+
const T = [...this.nestMap_.entries()].find(([C, { nestEl: R }]) => R === e);
|
|
911
|
+
if (T) S = T[0];
|
|
911
912
|
else return ["Element not managed by this component", e];
|
|
912
913
|
}
|
|
913
|
-
const
|
|
914
|
+
const o = `${S}A`, a = le(s, [
|
|
914
915
|
"zoo_nest__A",
|
|
915
|
-
|
|
916
|
+
o,
|
|
916
917
|
...r
|
|
917
|
-
]),
|
|
918
|
-
|
|
918
|
+
]), c = new W(t);
|
|
919
|
+
c.domFunc = ce([`zoo_drag_${o}`, ...p], E), c.render(m), this.nestMap_.set(o, {
|
|
919
920
|
side: "A",
|
|
920
921
|
nestEl: a,
|
|
921
|
-
dragger:
|
|
922
|
-
dragEl:
|
|
922
|
+
dragger: c,
|
|
923
|
+
dragEl: c.getElement(),
|
|
923
924
|
defSize: s,
|
|
924
925
|
sizeNow: -1,
|
|
925
926
|
canResize: !0
|
|
926
927
|
});
|
|
927
|
-
const u = `${S}B`,
|
|
928
|
+
const u = `${S}B`, f = lt([
|
|
928
929
|
"zoo_nest__B",
|
|
929
930
|
u,
|
|
930
|
-
...
|
|
931
|
+
...n
|
|
931
932
|
]);
|
|
932
933
|
this.nestMap_.set(u, {
|
|
933
|
-
nestEl:
|
|
934
|
+
nestEl: f,
|
|
934
935
|
canResize: !1
|
|
935
936
|
});
|
|
936
|
-
const g = `${S}C`, _ = new
|
|
937
|
-
_.domFunc =
|
|
938
|
-
const
|
|
937
|
+
const g = `${S}C`, _ = new W(t);
|
|
938
|
+
_.domFunc = ce([`zoo_drag_${g}`, ...p], E), _.render(m);
|
|
939
|
+
const b = le(i, [
|
|
939
940
|
"zoo_nest__C",
|
|
940
941
|
g,
|
|
941
|
-
...
|
|
942
|
+
...l
|
|
942
943
|
]);
|
|
943
944
|
this.nestMap_.set(g, {
|
|
944
945
|
side: "C",
|
|
945
|
-
nestEl:
|
|
946
|
+
nestEl: b,
|
|
946
947
|
dragger: _,
|
|
947
948
|
dragEl: _.getElement(),
|
|
948
949
|
defSize: i,
|
|
@@ -950,82 +951,79 @@ var L = class extends EventTarget {
|
|
|
950
951
|
canResize: !0
|
|
951
952
|
}), [
|
|
952
953
|
a,
|
|
953
|
-
|
|
954
|
-
|
|
954
|
+
c.getElement(),
|
|
955
|
+
f,
|
|
955
956
|
_.getElement(),
|
|
956
|
-
|
|
957
|
-
].forEach((
|
|
958
|
-
let
|
|
959
|
-
const
|
|
960
|
-
let
|
|
961
|
-
const
|
|
962
|
-
return (
|
|
963
|
-
switch (
|
|
957
|
+
b
|
|
958
|
+
].forEach((T) => m.appendChild(T));
|
|
959
|
+
let K = 0;
|
|
960
|
+
const Q = (T, C, R, Le) => {
|
|
961
|
+
let F;
|
|
962
|
+
const Z = T === "NS" ? "height" : "width", Oe = T === "NS" ? "deltaY" : "deltaX";
|
|
963
|
+
return (ee) => {
|
|
964
|
+
switch (ee.detail.value_) {
|
|
964
965
|
case d.COMP_DRAG_START:
|
|
965
|
-
|
|
966
|
+
F = C.getBoundingClientRect()[Z], K = f.getBoundingClientRect()[Z] + F, this.nestMap_.get(R).dragEl.classList.remove("collapsed");
|
|
966
967
|
break;
|
|
967
968
|
case d.COMP_DRAG_MOVE: {
|
|
968
|
-
const
|
|
969
|
-
this.nestMap_.get(
|
|
969
|
+
const te = Math.min(K, F + Le * ee.detail.data_[Oe]);
|
|
970
|
+
this.nestMap_.get(R).lastSize = te, C.style.flexBasis = te + "px";
|
|
970
971
|
break;
|
|
971
972
|
}
|
|
972
973
|
case d.COMP_DRAG_END:
|
|
973
|
-
this.dispatchSplitEvent(d.COMP_DRAG_END, this.nestMap_.get(
|
|
974
|
-
break;
|
|
975
|
-
default:
|
|
976
|
-
break;
|
|
974
|
+
this.dispatchSplitEvent(d.COMP_DRAG_END, this.nestMap_.get(R));
|
|
977
975
|
}
|
|
978
976
|
};
|
|
979
977
|
};
|
|
980
|
-
this.listen(
|
|
981
|
-
if (
|
|
982
|
-
const
|
|
983
|
-
this.nestCallbackMap_.delete(
|
|
978
|
+
this.listen(c, A.compEventCode(), Q(t, a, o, 1)), this.listen(_, A.compEventCode(), Q(t, b, g, -1)), this.listen(c.getElement(), h.DBLCLICK, () => this.toggle(o)), this.listen(_.getElement(), h.DBLCLICK, () => this.toggle(g)), this.listen(c.getElement().querySelector(".zoo_grabber"), h.CLICK, () => this.toggle(o)), this.listen(_.getElement().querySelector(".zoo_grabber"), h.CLICK, () => this.toggle(g)), this.listen(a, h.TRANSITIONEND, (T) => {
|
|
979
|
+
if (T.propertyName === "flex-basis" && T.target === a) {
|
|
980
|
+
const C = this.nestCallbackMap_.get(o);
|
|
981
|
+
this.nestCallbackMap_.delete(o), C && C(), this.dispatchSplitEvent(d.SPLIT_TRANSITION_END, this.nestMap_.get(o));
|
|
984
982
|
}
|
|
985
|
-
}), this.listen(
|
|
986
|
-
if (
|
|
987
|
-
const
|
|
988
|
-
this.nestCallbackMap_.delete(g),
|
|
983
|
+
}), this.listen(b, h.TRANSITIONEND, (T) => {
|
|
984
|
+
if (T.propertyName === "flex-basis" && T.target === b) {
|
|
985
|
+
const C = this.nestCallbackMap_.get(g);
|
|
986
|
+
this.nestCallbackMap_.delete(g), C && C(), this.dispatchSplitEvent(d.SPLIT_TRANSITION_END, this.nestMap_.get(g));
|
|
989
987
|
}
|
|
990
988
|
});
|
|
991
989
|
}
|
|
992
990
|
dispatchSplitEvent(e, t) {
|
|
993
|
-
const s = new
|
|
991
|
+
const s = new V(e, t), i = M.makeEvent(d.SPLIT, s);
|
|
994
992
|
return this.dispatchEvent(i);
|
|
995
993
|
}
|
|
996
|
-
},
|
|
994
|
+
}, at = (e, t) => (e.classList.add("zoo_split", `zoo_split__${t.toLowerCase()}`), e), le = (e, t = []) => {
|
|
997
995
|
const s = document.createElement("div");
|
|
998
|
-
return s.setAttribute("id",
|
|
999
|
-
},
|
|
996
|
+
return s.setAttribute("id", v(7)), s.classList.add("zoo_nest", "zoo_nest__outer", ...t), s.style.flexBasis = e + "px", s;
|
|
997
|
+
}, lt = (e = []) => {
|
|
1000
998
|
const t = document.createElement("div");
|
|
1001
|
-
return t.setAttribute("id",
|
|
1002
|
-
},
|
|
999
|
+
return t.setAttribute("id", v(7)), t.classList.add("zoo_nest", "zoo_nest__inner", ...e), t;
|
|
1000
|
+
}, ce = (e = [], t = []) => () => {
|
|
1003
1001
|
const s = document.createElement("div");
|
|
1004
|
-
s.setAttribute("id",
|
|
1002
|
+
s.setAttribute("id", v(7)), s.classList.add("zoo_dragger", ...e);
|
|
1005
1003
|
const i = document.createElement("div");
|
|
1006
1004
|
return i.classList.add("zoo_grabber", ...t), s.appendChild(i), s;
|
|
1007
|
-
},
|
|
1005
|
+
}, ct = {
|
|
1008
1006
|
toggle_tree: function(e, t) {
|
|
1009
|
-
|
|
1007
|
+
xe(e, t);
|
|
1010
1008
|
},
|
|
1011
1009
|
"tree_toggle-children": function(e, t) {
|
|
1012
|
-
|
|
1010
|
+
ke(t, e);
|
|
1013
1011
|
}
|
|
1014
|
-
},
|
|
1012
|
+
}, be = {
|
|
1015
1013
|
search: function(e, t) {
|
|
1016
1014
|
let s = `${e.href}`;
|
|
1017
1015
|
const i = e.formData.q, r = e.targetval;
|
|
1018
1016
|
if (i !== "" && (s = `${s}?q=${i}`), r !== "") {
|
|
1019
|
-
let
|
|
1020
|
-
r.includes("page=") && (
|
|
1017
|
+
let n = r;
|
|
1018
|
+
r.includes("page=") && (n = r.split("&").filter((l) => !l.includes("page=")).join("&")), s = i !== "" ? `${s}&${n}` : `${s}?${n}`;
|
|
1021
1019
|
}
|
|
1022
|
-
this.user.fetchAndSplit(s, t.abortController.signal).then((
|
|
1020
|
+
this.user.fetchAndSplit(s, t.abortController.signal).then((n) => t.onReplacePartialDom(n, e.zvptarget));
|
|
1023
1021
|
},
|
|
1024
1022
|
reset_search: function(e, t) {
|
|
1025
1023
|
const s = e.trigger.closest("form");
|
|
1026
1024
|
t.removeFromQParams("q"), s.elements.q.value = "", s.dispatchEvent(new Event("submit"));
|
|
1027
1025
|
}
|
|
1028
|
-
},
|
|
1026
|
+
}, Ce = {
|
|
1029
1027
|
paginate: function(e, t) {
|
|
1030
1028
|
const s = `${e.href}?${e.targetval}`;
|
|
1031
1029
|
this.user.fetchAndSplit(s, t.abortController.signal).then((i) => t.onReplacePartialDom(i, e.zvptarget));
|
|
@@ -1034,11 +1032,11 @@ var L = class extends EventTarget {
|
|
|
1034
1032
|
const s = `${e.href}?${e.targetval}`;
|
|
1035
1033
|
this.user.fetchAndSplit(s, t.abortController.signal).then((i) => t.onReplacePartialDom(i, e.zvptarget));
|
|
1036
1034
|
}
|
|
1037
|
-
},
|
|
1038
|
-
MdcTreeHandlers: () =>
|
|
1039
|
-
QueryParamHandlers: () =>
|
|
1040
|
-
SearchHandlers: () =>
|
|
1041
|
-
}),
|
|
1035
|
+
}, ht = /* @__PURE__ */ J({
|
|
1036
|
+
MdcTreeHandlers: () => ct,
|
|
1037
|
+
QueryParamHandlers: () => Ce,
|
|
1038
|
+
SearchHandlers: () => be
|
|
1039
|
+
}), ye = class extends M {
|
|
1042
1040
|
#e = void 0;
|
|
1043
1041
|
#t = void 0;
|
|
1044
1042
|
#s = {};
|
|
@@ -1085,7 +1083,7 @@ var L = class extends EventTarget {
|
|
|
1085
1083
|
case d.SPLIT_TRANSITION_END:
|
|
1086
1084
|
break;
|
|
1087
1085
|
default:
|
|
1088
|
-
|
|
1086
|
+
D();
|
|
1089
1087
|
}
|
|
1090
1088
|
});
|
|
1091
1089
|
}
|
|
@@ -1097,7 +1095,7 @@ var L = class extends EventTarget {
|
|
|
1097
1095
|
this.user_ = e, this.panelMap.forEach((t) => t.user = e);
|
|
1098
1096
|
}
|
|
1099
1097
|
get user() {
|
|
1100
|
-
return this.user_ || (this.user_ = new
|
|
1098
|
+
return this.user_ || (this.user_ = new $()), this.user_;
|
|
1101
1099
|
}
|
|
1102
1100
|
render() {
|
|
1103
1101
|
this.initPanelEvents(), this.preRender(), this.configurePanels(), this.displayPanels(), this.postRender();
|
|
@@ -1116,7 +1114,7 @@ var L = class extends EventTarget {
|
|
|
1116
1114
|
[...this.panelMap.values()].forEach((e) => e.dispose()), super.dispose();
|
|
1117
1115
|
}
|
|
1118
1116
|
addPanelToView(e, t) {
|
|
1119
|
-
t.user = this.user, this.removePanelByName(e), this.panelMap.set(e, t), this.listen(t,
|
|
1117
|
+
t.user = this.user, this.removePanelByName(e), this.panelMap.set(e, t), this.listen(t, X.panelEventCode(), this.onPanelEvent.bind(this));
|
|
1120
1118
|
}
|
|
1121
1119
|
removePanelByName(e) {
|
|
1122
1120
|
this.panelMap.has(e) && this.panelMap.get(e).dispose();
|
|
@@ -1140,8 +1138,8 @@ var L = class extends EventTarget {
|
|
|
1140
1138
|
const i = t.view;
|
|
1141
1139
|
this.switchViewMap_.has(i) ? this.switchViewMap_.get(i)(t, s) : this.debugMe("NO VIEW FOUND FOR:", i, this.switchViewMap_);
|
|
1142
1140
|
}), Object.entries({
|
|
1143
|
-
...
|
|
1144
|
-
...
|
|
1141
|
+
...be,
|
|
1142
|
+
...Ce
|
|
1145
1143
|
}).forEach(([t, s]) => {
|
|
1146
1144
|
e.set(t, s.bind(this));
|
|
1147
1145
|
}), e;
|
|
@@ -1154,7 +1152,7 @@ var L = class extends EventTarget {
|
|
|
1154
1152
|
}
|
|
1155
1153
|
onPanelEvent(e) {
|
|
1156
1154
|
let t = e.detail.getValue();
|
|
1157
|
-
if (this.debugMe(`PanelEvent Value: ${t}`), !
|
|
1155
|
+
if (this.debugMe(`PanelEvent Value: ${t}`), !H(t)) {
|
|
1158
1156
|
this.debugMe(`The panel received an event without a value.
|
|
1159
1157
|
There is nothing we can do with that.`);
|
|
1160
1158
|
return;
|
|
@@ -1180,7 +1178,7 @@ var L = class extends EventTarget {
|
|
|
1180
1178
|
onSplitDidOpen(e) {
|
|
1181
1179
|
}
|
|
1182
1180
|
dispatchViewEvent(e, t) {
|
|
1183
|
-
const s = new
|
|
1181
|
+
const s = new V(e, t), i = M.makeEvent(d.VIEW, s);
|
|
1184
1182
|
return this.dispatchEvent(i);
|
|
1185
1183
|
}
|
|
1186
1184
|
get metaData() {
|
|
@@ -1195,7 +1193,7 @@ var L = class extends EventTarget {
|
|
|
1195
1193
|
hasMetaData(e) {
|
|
1196
1194
|
return this.metaData_.has(e);
|
|
1197
1195
|
}
|
|
1198
|
-
},
|
|
1196
|
+
}, dt = class extends M {
|
|
1199
1197
|
#e = /* @__PURE__ */ new Map();
|
|
1200
1198
|
#t = null;
|
|
1201
1199
|
#s = void 0;
|
|
@@ -1220,13 +1218,13 @@ var L = class extends EventTarget {
|
|
|
1220
1218
|
this.#s = e, this.#t && (this.#t.user = this.user);
|
|
1221
1219
|
}
|
|
1222
1220
|
get user() {
|
|
1223
|
-
return this.#s || (this.#s = new
|
|
1221
|
+
return this.#s || (this.#s = new $()), this.#s;
|
|
1224
1222
|
}
|
|
1225
1223
|
get utils() {
|
|
1226
1224
|
return this.#n;
|
|
1227
1225
|
}
|
|
1228
1226
|
registerUtil(e) {
|
|
1229
|
-
this.#n =
|
|
1227
|
+
this.#n = Be(this.#n, e);
|
|
1230
1228
|
}
|
|
1231
1229
|
#o() {
|
|
1232
1230
|
return (/* @__PURE__ */ new Map()).set("switch_view", (e, t) => {
|
|
@@ -1250,7 +1248,7 @@ var L = class extends EventTarget {
|
|
|
1250
1248
|
this.#t && (this.stopListeningTo(this.#t), this.#t.dispose(), this.#t = null), this.#t = e, this.#t.render();
|
|
1251
1249
|
}
|
|
1252
1250
|
initView(e) {
|
|
1253
|
-
return e.user = this.user, e.split = this.split, e.utils = this.utils, e.recordHistory = this.recordHistory.bind(this), e.registerViewConstructor = this.registerViewConstructor.bind(this), this.listen(e,
|
|
1251
|
+
return e.user = this.user, e.split = this.split, e.utils = this.utils, e.recordHistory = this.recordHistory.bind(this), e.registerViewConstructor = this.registerViewConstructor.bind(this), this.listen(e, ye.viewEventCode(), this.onViewEvent.bind(this)), e;
|
|
1254
1252
|
}
|
|
1255
1253
|
switchView(e) {
|
|
1256
1254
|
this.setActiveView(this.initView(e));
|
|
@@ -1268,53 +1266,328 @@ var L = class extends EventTarget {
|
|
|
1268
1266
|
this.debugMe("NAV:NEW:VIEW", e), this.switchView(i);
|
|
1269
1267
|
}
|
|
1270
1268
|
};
|
|
1269
|
+
}, we = class extends pe {
|
|
1270
|
+
static properties = {
|
|
1271
|
+
token: { type: String },
|
|
1272
|
+
prefix: { type: String },
|
|
1273
|
+
postfix: { type: String }
|
|
1274
|
+
};
|
|
1275
|
+
static styles = me`
|
|
1276
|
+
:host {
|
|
1277
|
+
display: inline-block;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
.tag {
|
|
1281
|
+
text-align: center;
|
|
1282
|
+
display: inline-flex;
|
|
1283
|
+
align-items: center;
|
|
1284
|
+
justify-content: center;
|
|
1285
|
+
line-height: initial;
|
|
1286
|
+
width: max-content;
|
|
1287
|
+
padding: 0.2em 1em;
|
|
1288
|
+
border-radius: 1em;
|
|
1289
|
+
font-size: var(--zoo-theme-chips-font-size, 0.75rem);
|
|
1290
|
+
white-space: nowrap;
|
|
1291
|
+
word-break: break-word;
|
|
1292
|
+
box-sizing: border-box;
|
|
1293
|
+
}
|
|
1294
|
+
`;
|
|
1295
|
+
render() {
|
|
1296
|
+
const e = `${this.prefix ?? ""}${this.token ?? "default"}${this.postfix ?? ""}`;
|
|
1297
|
+
return P`
|
|
1298
|
+
<span
|
|
1299
|
+
class="tag"
|
|
1300
|
+
style="
|
|
1301
|
+
background-color: var(--zoo-tag-${e}-bg, var(--zoo-tag-default-bg, #9e9e9e));
|
|
1302
|
+
color: var(--zoo-tag-${e}-fg, var(--zoo-tag-default-fg, #ffffff));
|
|
1303
|
+
"
|
|
1304
|
+
>
|
|
1305
|
+
<slot></slot>
|
|
1306
|
+
</span>
|
|
1307
|
+
`;
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
customElements.get("zoo-tag") || customElements.define("zoo-tag", we);
|
|
1311
|
+
var ut = (e) => {
|
|
1312
|
+
const t = Math.floor((/* @__PURE__ */ new Date() - e) / 1e3), s = [
|
|
1313
|
+
{
|
|
1314
|
+
name: "year",
|
|
1315
|
+
seconds: 31536e3
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
name: "month",
|
|
1319
|
+
seconds: 2592e3
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
name: "week",
|
|
1323
|
+
seconds: 604800
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
name: "day",
|
|
1327
|
+
seconds: 86400
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
name: "hour",
|
|
1331
|
+
seconds: 3600
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
name: "minute",
|
|
1335
|
+
seconds: 60
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
name: "second",
|
|
1339
|
+
seconds: 1
|
|
1340
|
+
}
|
|
1341
|
+
];
|
|
1342
|
+
if (t < 0) {
|
|
1343
|
+
const i = Math.abs(t);
|
|
1344
|
+
for (const r of s) {
|
|
1345
|
+
const n = Math.floor(i / r.seconds);
|
|
1346
|
+
if (n >= 1) return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(n, r.name);
|
|
1347
|
+
}
|
|
1348
|
+
return "just now";
|
|
1349
|
+
}
|
|
1350
|
+
for (const i of s) {
|
|
1351
|
+
const r = Math.floor(t / i.seconds);
|
|
1352
|
+
if (r >= 1) return new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-r, i.name);
|
|
1353
|
+
}
|
|
1354
|
+
return "just now";
|
|
1355
|
+
}, pt = (e) => {
|
|
1356
|
+
const [{ value: t }, , { value: s }, , { value: i }, , { value: r }, , { value: n }, , { value: l }] = new Intl.DateTimeFormat("en", {
|
|
1357
|
+
day: "2-digit",
|
|
1358
|
+
month: "short",
|
|
1359
|
+
year: "2-digit",
|
|
1360
|
+
hour: "2-digit",
|
|
1361
|
+
minute: "2-digit",
|
|
1362
|
+
second: "2-digit",
|
|
1363
|
+
hourCycle: "h23"
|
|
1364
|
+
}).formatToParts(e);
|
|
1365
|
+
return `${s} ${t} ${i} ${r}:${n}:${l}`;
|
|
1366
|
+
}, mt = (e) => {
|
|
1367
|
+
const [{ value: t }, , { value: s }, , { value: i }] = new Intl.DateTimeFormat("en", {
|
|
1368
|
+
day: "2-digit",
|
|
1369
|
+
month: "short",
|
|
1370
|
+
year: "2-digit"
|
|
1371
|
+
}).formatToParts(e);
|
|
1372
|
+
return `${s} ${t} ${i}`;
|
|
1373
|
+
}, Me = class extends pe {
|
|
1374
|
+
static properties = {
|
|
1375
|
+
timestamp: { type: Number },
|
|
1376
|
+
kind: { type: String },
|
|
1377
|
+
concat: { type: String }
|
|
1378
|
+
};
|
|
1379
|
+
static styles = me`
|
|
1380
|
+
:host {
|
|
1381
|
+
display: inline;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
.relative {
|
|
1385
|
+
color: var(--zoo-timestamp-relative-color, inherit);
|
|
1386
|
+
font-weight: var(--zoo-timestamp-relative-weight, inherit);
|
|
1387
|
+
font-size: var(--zoo-timestamp-relative-size, inherit);
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
.static {
|
|
1391
|
+
color: var(--zoo-timestamp-static-color, inherit);
|
|
1392
|
+
font-weight: var(--zoo-timestamp-static-weight, inherit);
|
|
1393
|
+
font-size: var(--zoo-timestamp-static-size, inherit);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
.separator {
|
|
1397
|
+
color: var(--zoo-timestamp-separator-color, inherit);
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
:host([kind="stack"]) {
|
|
1401
|
+
display: inline-block;
|
|
1402
|
+
vertical-align: middle;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
:host([kind="stack"]) time {
|
|
1406
|
+
display: flex;
|
|
1407
|
+
flex-direction: column;
|
|
1408
|
+
gap: var(--zoo-timestamp-stack-gap, 0);
|
|
1409
|
+
align-items: var(--zoo-timestamp-stack-align, stretch);
|
|
1410
|
+
}
|
|
1411
|
+
`;
|
|
1412
|
+
constructor() {
|
|
1413
|
+
super(), this.timestamp = Date.now(), this.kind = "both", this.concat = "r (s)", this._boundTickHandler = this._onTimeTick.bind(this), this._isListening = !1;
|
|
1414
|
+
}
|
|
1415
|
+
_shouldListenToTicks() {
|
|
1416
|
+
return this.kind === "relative" || this.kind === "both" || this.kind === "stack";
|
|
1417
|
+
}
|
|
1418
|
+
connectedCallback() {
|
|
1419
|
+
super.connectedCallback(), this._updateTickListener();
|
|
1420
|
+
}
|
|
1421
|
+
disconnectedCallback() {
|
|
1422
|
+
this._removeTickListener(), super.disconnectedCallback();
|
|
1423
|
+
}
|
|
1424
|
+
updated(e) {
|
|
1425
|
+
super.updated(e), e.has("kind") && this._updateTickListener();
|
|
1426
|
+
}
|
|
1427
|
+
_updateTickListener() {
|
|
1428
|
+
const e = this._shouldListenToTicks();
|
|
1429
|
+
e && !this._isListening ? (document.addEventListener("zoo-tick-60", this._boundTickHandler), this._isListening = !0) : !e && this._isListening && this._removeTickListener();
|
|
1430
|
+
}
|
|
1431
|
+
_removeTickListener() {
|
|
1432
|
+
this._isListening && (document.removeEventListener("zoo-tick-60", this._boundTickHandler), this._isListening = !1);
|
|
1433
|
+
}
|
|
1434
|
+
_onTimeTick() {
|
|
1435
|
+
this.requestUpdate();
|
|
1436
|
+
}
|
|
1437
|
+
_parseTemplate(e) {
|
|
1438
|
+
const t = [];
|
|
1439
|
+
let s = e;
|
|
1440
|
+
for (; s.length > 0; ) {
|
|
1441
|
+
const i = s.indexOf("r"), r = s.indexOf("s"), n = [
|
|
1442
|
+
i,
|
|
1443
|
+
r,
|
|
1444
|
+
s.indexOf("d")
|
|
1445
|
+
].filter((l) => l !== -1).sort((l, p) => l - p)[0];
|
|
1446
|
+
if (n === void 0) {
|
|
1447
|
+
s.length > 0 && t.push({
|
|
1448
|
+
type: "text",
|
|
1449
|
+
value: s
|
|
1450
|
+
});
|
|
1451
|
+
break;
|
|
1452
|
+
}
|
|
1453
|
+
n > 0 && t.push({
|
|
1454
|
+
type: "text",
|
|
1455
|
+
value: s.substring(0, n)
|
|
1456
|
+
}), n === i ? t.push({
|
|
1457
|
+
type: "relative",
|
|
1458
|
+
value: ""
|
|
1459
|
+
}) : n === r ? t.push({
|
|
1460
|
+
type: "static",
|
|
1461
|
+
value: ""
|
|
1462
|
+
}) : t.push({
|
|
1463
|
+
type: "dateOnly",
|
|
1464
|
+
value: ""
|
|
1465
|
+
}), s = s.substring(n + 1);
|
|
1466
|
+
}
|
|
1467
|
+
return t;
|
|
1468
|
+
}
|
|
1469
|
+
_parseStackOrder(e) {
|
|
1470
|
+
const t = e.indexOf("r"), s = e.indexOf("s"), i = e.indexOf("d");
|
|
1471
|
+
let r = -1, n = null;
|
|
1472
|
+
return s !== -1 && (i === -1 || s < i) ? (r = s, n = "static") : i !== -1 && (r = i, n = "dateOnly"), t !== -1 && r !== -1 ? t < r ? ["relative", n] : [n, "relative"] : t !== -1 ? ["relative"] : r !== -1 ? [n] : ["relative", "static"];
|
|
1473
|
+
}
|
|
1474
|
+
_getFormattedParts() {
|
|
1475
|
+
let e = this.timestamp;
|
|
1476
|
+
e < 9466848e5 && (e = e * 1e3);
|
|
1477
|
+
const t = new Date(e), s = ut(t), i = pt(t), r = mt(t);
|
|
1478
|
+
switch (this.kind) {
|
|
1479
|
+
case "relative":
|
|
1480
|
+
return [{
|
|
1481
|
+
type: "relative",
|
|
1482
|
+
value: s
|
|
1483
|
+
}];
|
|
1484
|
+
case "datetime":
|
|
1485
|
+
return [{
|
|
1486
|
+
type: "static",
|
|
1487
|
+
value: i
|
|
1488
|
+
}];
|
|
1489
|
+
case "date":
|
|
1490
|
+
return [{
|
|
1491
|
+
type: "static",
|
|
1492
|
+
value: r
|
|
1493
|
+
}];
|
|
1494
|
+
case "both":
|
|
1495
|
+
return this._parseTemplate(this.concat).map((n) => n.type === "relative" ? {
|
|
1496
|
+
type: "relative",
|
|
1497
|
+
value: s
|
|
1498
|
+
} : n.type === "static" ? {
|
|
1499
|
+
type: "static",
|
|
1500
|
+
value: i
|
|
1501
|
+
} : n.type === "dateOnly" ? {
|
|
1502
|
+
type: "static",
|
|
1503
|
+
value: r
|
|
1504
|
+
} : n);
|
|
1505
|
+
case "stack":
|
|
1506
|
+
return this._parseStackOrder(this.concat).map((n) => n === "relative" ? {
|
|
1507
|
+
type: "relative",
|
|
1508
|
+
value: s
|
|
1509
|
+
} : n === "dateOnly" ? {
|
|
1510
|
+
type: "static",
|
|
1511
|
+
value: r
|
|
1512
|
+
} : {
|
|
1513
|
+
type: "static",
|
|
1514
|
+
value: i
|
|
1515
|
+
});
|
|
1516
|
+
default:
|
|
1517
|
+
return this._parseTemplate(this.concat).map((n) => n.type === "relative" ? {
|
|
1518
|
+
type: "relative",
|
|
1519
|
+
value: s
|
|
1520
|
+
} : n.type === "static" ? {
|
|
1521
|
+
type: "static",
|
|
1522
|
+
value: i
|
|
1523
|
+
} : n.type === "dateOnly" ? {
|
|
1524
|
+
type: "static",
|
|
1525
|
+
value: r
|
|
1526
|
+
} : n);
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
render() {
|
|
1530
|
+
let e = this.timestamp;
|
|
1531
|
+
e < 9466848e5 && (e = e * 1e3);
|
|
1532
|
+
const t = new Date(e), s = this._getFormattedParts();
|
|
1533
|
+
return P`<time datetime="${t.toISOString()}">
|
|
1534
|
+
${s.map((i) => i.type === "relative" ? P`<span class="relative">${i.value}</span>` : i.type === "static" ? P`<span class="static">${i.value}</span>` : P`<span class="separator">${i.value}</span>`)}
|
|
1535
|
+
</time>`;
|
|
1536
|
+
}
|
|
1271
1537
|
};
|
|
1272
|
-
|
|
1273
|
-
|
|
1538
|
+
customElements.get("zoo-timestamp") || customElements.define("zoo-timestamp", Me);
|
|
1539
|
+
var ft = /* @__PURE__ */ J({
|
|
1540
|
+
ZooTag: () => we,
|
|
1541
|
+
ZooTimestamp: () => Me,
|
|
1542
|
+
getEventAttribute: () => Ue,
|
|
1543
|
+
getSemanticAttributes: () => Ve
|
|
1544
|
+
});
|
|
1545
|
+
async function gt(e = {}) {
|
|
1546
|
+
const { registerCarbonLibrary: t } = await import("./chunks/register-B53HY61t.js");
|
|
1274
1547
|
return t(e);
|
|
1275
1548
|
}
|
|
1276
|
-
async function
|
|
1277
|
-
const { registerMdcLibrary: e } = await import("./chunks/register-
|
|
1549
|
+
async function vt() {
|
|
1550
|
+
const { registerMdcLibrary: e } = await import("./chunks/register-BYYPJoHC.js");
|
|
1278
1551
|
return e();
|
|
1279
1552
|
}
|
|
1280
|
-
var
|
|
1281
|
-
Evt:
|
|
1282
|
-
Component:
|
|
1283
|
-
Dragger:
|
|
1284
|
-
Panel:
|
|
1285
|
-
FormPanel:
|
|
1286
|
-
Split:
|
|
1287
|
-
UserManager:
|
|
1288
|
-
View:
|
|
1289
|
-
Conductor:
|
|
1290
|
-
DataBinder:
|
|
1553
|
+
var Ct = {
|
|
1554
|
+
Evt: M,
|
|
1555
|
+
Component: A,
|
|
1556
|
+
Dragger: W,
|
|
1557
|
+
Panel: X,
|
|
1558
|
+
FormPanel: nt,
|
|
1559
|
+
Split: ot,
|
|
1560
|
+
UserManager: $,
|
|
1561
|
+
View: ye,
|
|
1562
|
+
Conductor: dt,
|
|
1563
|
+
DataBinder: de,
|
|
1291
1564
|
UiEventType: d,
|
|
1292
|
-
domUtils:
|
|
1293
|
-
uriUtils:
|
|
1294
|
-
registerCarbonLibrary:
|
|
1295
|
-
registerMdcLibrary:
|
|
1296
|
-
ComponentLibraryRegistry:
|
|
1297
|
-
handlers:
|
|
1298
|
-
zoo:
|
|
1565
|
+
domUtils: Ne,
|
|
1566
|
+
uriUtils: Ye,
|
|
1567
|
+
registerCarbonLibrary: gt,
|
|
1568
|
+
registerMdcLibrary: vt,
|
|
1569
|
+
ComponentLibraryRegistry: I,
|
|
1570
|
+
handlers: ht,
|
|
1571
|
+
zoo: ft
|
|
1299
1572
|
};
|
|
1300
1573
|
export {
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1574
|
+
de as Binder,
|
|
1575
|
+
A as Component,
|
|
1576
|
+
I as ComponentLibraryRegistry,
|
|
1577
|
+
dt as Conductor,
|
|
1578
|
+
W as Dragger,
|
|
1579
|
+
M as Evt,
|
|
1580
|
+
nt as FormPanel,
|
|
1581
|
+
X as Panel,
|
|
1582
|
+
ot as Split,
|
|
1310
1583
|
d as UiEventType,
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1584
|
+
$ as UserManager,
|
|
1585
|
+
ye as View,
|
|
1586
|
+
Ct as default,
|
|
1587
|
+
Ne as domUtils,
|
|
1588
|
+
ht as handlers,
|
|
1589
|
+
gt as registerCarbonLibrary,
|
|
1590
|
+
vt as registerMdcLibrary,
|
|
1591
|
+
Ye as uriUtils,
|
|
1592
|
+
ft as zoo
|
|
1320
1593
|
};
|