jaxs 0.5.0 → 0.6.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/dist/jaxs.d.ts +53 -75
- package/dist/jaxs.js +477 -499
- package/dist/jaxs.umd.cjs +297 -324
- package/package.json +1 -1
package/dist/jaxs.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const Z = (e, t) => t.createElement(e),
|
|
2
|
+
tt = (e, t) => {
|
|
3
3
|
for (const s in t) {
|
|
4
4
|
if (s === '__self') continue
|
|
5
|
-
const
|
|
5
|
+
const n = t[s].toString()
|
|
6
6
|
if (s === 'value') {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
} else e.setAttribute(s,
|
|
7
|
+
const r = e
|
|
8
|
+
r.value !== n && (r.value = n)
|
|
9
|
+
} else e.setAttribute(s, n)
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
for (const
|
|
15
|
-
const o = t[
|
|
16
|
-
a = (
|
|
17
|
-
e.addEventListener(
|
|
18
|
-
(r
|
|
19
|
-
domEvent:
|
|
12
|
+
et = (e, t, s) => {
|
|
13
|
+
const n = {}
|
|
14
|
+
for (const r in t) {
|
|
15
|
+
const o = t[r],
|
|
16
|
+
a = (l) => s(o, l)
|
|
17
|
+
e.addEventListener(r, a),
|
|
18
|
+
(n[r] = {
|
|
19
|
+
domEvent: r,
|
|
20
20
|
busEvent: o,
|
|
21
21
|
listener: a,
|
|
22
22
|
})
|
|
23
23
|
}
|
|
24
|
-
e.eventMaps =
|
|
24
|
+
e.eventMaps = n
|
|
25
25
|
},
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
return
|
|
26
|
+
st = (e, t, s, n) => {
|
|
27
|
+
const r = Z(e, n.document)
|
|
28
|
+
return tt(r, t), et(r, s, n.publish), r
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
y = 'http://www.w3.org/2000/svg',
|
|
31
|
+
nt = {
|
|
32
32
|
animate: !0,
|
|
33
33
|
animateMotion: !0,
|
|
34
34
|
animateTransform: !0,
|
|
@@ -92,71 +92,71 @@ const et = (e, t) => t.createElement(e),
|
|
|
92
92
|
use: !0,
|
|
93
93
|
view: !0,
|
|
94
94
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
for (const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return
|
|
95
|
+
rt = (e, t) => !!(nt[e] || (e === 'a' && t === y)),
|
|
96
|
+
ot = (e, t, s) => {
|
|
97
|
+
const n = s.createElementNS(y, e)
|
|
98
|
+
for (const r in t)
|
|
99
|
+
r === '__self' ||
|
|
100
|
+
r === 'xmlns' ||
|
|
101
|
+
n.setAttributeNS(null, r, t[r].toString())
|
|
102
|
+
return n
|
|
103
103
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
class
|
|
104
|
+
it = (e) => e.namespaceURI === y,
|
|
105
|
+
ut = (e, t) => t.createTextNode(e)
|
|
106
|
+
class at {
|
|
107
107
|
constructor(t) {
|
|
108
108
|
this.value = t.toString()
|
|
109
109
|
}
|
|
110
110
|
render(t) {
|
|
111
|
-
const s =
|
|
111
|
+
const s = ut(this.value, t.document)
|
|
112
112
|
return (s.__jsx = 'TextNode'), [s]
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
const ct = (e) => typeof e == 'string' || typeof e == 'number',
|
|
116
|
+
lt = (e) => new at(e),
|
|
117
|
+
ht = (e) => (ct(e) ? lt(e) : e),
|
|
118
|
+
dt = (e) => pt(e).map(ht).flat(),
|
|
119
|
+
pt = (e) => (Array.isArray(e) ? e.flat() : e ? [e] : []),
|
|
120
120
|
j = (e, t = {}) => e || t.children || [],
|
|
121
|
-
|
|
121
|
+
mt = (e, t = '') => {
|
|
122
122
|
const s = {},
|
|
123
|
-
|
|
124
|
-
for (const
|
|
125
|
-
const o = e[
|
|
126
|
-
if (
|
|
127
|
-
const a =
|
|
128
|
-
|
|
123
|
+
n = {}
|
|
124
|
+
for (const r in e) {
|
|
125
|
+
const o = e[r]
|
|
126
|
+
if (r.match(/^on.+/i)) {
|
|
127
|
+
const a = r.slice(2).toLowerCase()
|
|
128
|
+
n[a] = o ? o.toString() : ''
|
|
129
129
|
} else {
|
|
130
130
|
if (o === !1) continue
|
|
131
|
-
|
|
131
|
+
r === '__source' ? (s.__source = e.__source) : (s[r] = ft(r, o, t))
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
return {
|
|
135
135
|
attributes: s,
|
|
136
|
-
events:
|
|
136
|
+
events: n,
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
ft = (e, t, s = '') => (t == null ? s : t.toString()),
|
|
140
|
+
bt = (e, t) => {
|
|
141
141
|
const s = e || {},
|
|
142
|
-
|
|
143
|
-
return (s.children = s.children ||
|
|
142
|
+
n = j(t, s)
|
|
143
|
+
return (s.children = s.children || n), s
|
|
144
144
|
},
|
|
145
|
-
O = (e, t, s,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
? Array.isArray(
|
|
149
|
-
? O(
|
|
150
|
-
: (
|
|
145
|
+
O = (e, t, s, n = []) => e.reduce(vt(t, s), n).flat(),
|
|
146
|
+
vt = (e, t) => (s, n) =>
|
|
147
|
+
n
|
|
148
|
+
? Array.isArray(n)
|
|
149
|
+
? O(n, e, t, s)
|
|
150
|
+
: (n.render(e, t).forEach((r) => s.push(r)), s)
|
|
151
151
|
: s
|
|
152
|
-
class
|
|
152
|
+
class M {
|
|
153
153
|
constructor(t) {
|
|
154
|
-
this.collection =
|
|
154
|
+
this.collection = dt(t)
|
|
155
155
|
}
|
|
156
156
|
render(t, s) {
|
|
157
157
|
this.parentElement = s
|
|
158
|
-
const
|
|
159
|
-
return this.attachToParent(
|
|
158
|
+
const n = this.generateDom(t)
|
|
159
|
+
return this.attachToParent(n), n
|
|
160
160
|
}
|
|
161
161
|
generateDom(t) {
|
|
162
162
|
return O(this.collection, t, this.parentElement)
|
|
@@ -164,10 +164,10 @@ class k {
|
|
|
164
164
|
attachToParent(t) {
|
|
165
165
|
if (this.parentElement === void 0) return
|
|
166
166
|
const s = this.parentElement
|
|
167
|
-
t.forEach((
|
|
167
|
+
t.forEach((n) => s.appendChild(n))
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
class
|
|
170
|
+
class gt {
|
|
171
171
|
constructor(t, s) {
|
|
172
172
|
;(this.type = t), (this.attributes = s)
|
|
173
173
|
}
|
|
@@ -181,26 +181,26 @@ class Et {
|
|
|
181
181
|
const {
|
|
182
182
|
fileName: t,
|
|
183
183
|
lineNumber: s,
|
|
184
|
-
columnNumber:
|
|
184
|
+
columnNumber: n,
|
|
185
185
|
} = this.attributes.__source
|
|
186
|
-
return `${t}:${s}:${
|
|
186
|
+
return `${t}:${s}:${n}`
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
createKeyFromAttributes() {
|
|
190
190
|
const t = this.attributes.id ? `#${this.attributes.id}` : '',
|
|
191
191
|
s = this.attributes.type ? `[type=${this.attributes.type}]` : '',
|
|
192
|
-
|
|
193
|
-
return `${this.type}${t}${s}${
|
|
192
|
+
n = this.attributes.name ? `[name=${this.attributes.name}]` : ''
|
|
193
|
+
return `${this.type}${t}${s}${n}`
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
class
|
|
197
|
-
constructor(t, s,
|
|
196
|
+
class yt {
|
|
197
|
+
constructor(t, s, n = []) {
|
|
198
198
|
this.type = t
|
|
199
|
-
const { events:
|
|
200
|
-
;(this.events =
|
|
199
|
+
const { events: r, attributes: o } = mt(s)
|
|
200
|
+
;(this.events = r),
|
|
201
201
|
(this.attributes = o),
|
|
202
|
-
(this.isSvg =
|
|
203
|
-
(this.children = new
|
|
202
|
+
(this.isSvg = rt(this.type, this.attributes.xmlns)),
|
|
203
|
+
(this.children = new M(n))
|
|
204
204
|
}
|
|
205
205
|
render(t) {
|
|
206
206
|
const s = this.generateDom(t)
|
|
@@ -210,28 +210,28 @@ class xt {
|
|
|
210
210
|
return this.isSvg ? this.generateSvgDom(t) : this.generateHtmlDom(t)
|
|
211
211
|
}
|
|
212
212
|
generateHtmlDom(t) {
|
|
213
|
-
const s =
|
|
213
|
+
const s = st(this.type, this.attributes, this.events, t)
|
|
214
214
|
return (s.__jsx = this.jsxKey()), s
|
|
215
215
|
}
|
|
216
216
|
generateSvgDom(t) {
|
|
217
|
-
const s =
|
|
217
|
+
const s = ot(this.type, this.attributes, t.document)
|
|
218
218
|
return (s.__jsx = this.jsxKey()), s
|
|
219
219
|
}
|
|
220
220
|
jsxKey() {
|
|
221
|
-
return new
|
|
221
|
+
return new gt(this.type, this.attributes).generate()
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
const
|
|
225
|
-
typeof e == 'string' ? new
|
|
226
|
-
|
|
224
|
+
const Et = (e, t, ...s) =>
|
|
225
|
+
typeof e == 'string' ? new yt(e, t, s) : e(bt(t, s))
|
|
226
|
+
Et.fragment = (e, t) => {
|
|
227
227
|
const s = j(t, e)
|
|
228
|
-
return new
|
|
228
|
+
return new M(s)
|
|
229
229
|
}
|
|
230
|
-
class
|
|
231
|
-
constructor(t, s,
|
|
230
|
+
class xt {
|
|
231
|
+
constructor(t, s, n) {
|
|
232
232
|
;(this.template = t),
|
|
233
233
|
(this.selector = s),
|
|
234
|
-
(this.renderKit =
|
|
234
|
+
(this.renderKit = n),
|
|
235
235
|
(this.dom = [])
|
|
236
236
|
}
|
|
237
237
|
renderAndAttach(t) {
|
|
@@ -252,44 +252,46 @@ class At {
|
|
|
252
252
|
return this.renderKit.document.querySelector(this.selector)
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
const
|
|
256
|
-
const
|
|
257
|
-
return
|
|
255
|
+
const At = (e, t, s) => {
|
|
256
|
+
const n = new xt(e, t, s)
|
|
257
|
+
return n.renderAndAttach(s), n
|
|
258
258
|
},
|
|
259
|
-
|
|
259
|
+
k = 'go-to-href',
|
|
260
|
+
T = 'go-to',
|
|
260
261
|
m = 'navigation:location-change',
|
|
261
|
-
|
|
262
|
-
|
|
262
|
+
$ = 'navigation:route-change',
|
|
263
|
+
_t = /* @__PURE__ */ Object.freeze(
|
|
263
264
|
/* @__PURE__ */ Object.defineProperty(
|
|
264
265
|
{
|
|
265
266
|
__proto__: null,
|
|
266
|
-
linkNavigationEvent:
|
|
267
|
+
linkNavigationEvent: k,
|
|
267
268
|
locationChangeEvent: m,
|
|
268
|
-
|
|
269
|
+
navigationEvent: T,
|
|
270
|
+
routeChangeEvent: $,
|
|
269
271
|
},
|
|
270
272
|
Symbol.toStringTag,
|
|
271
273
|
{ value: 'Module' },
|
|
272
274
|
),
|
|
273
275
|
),
|
|
274
|
-
|
|
275
|
-
e.
|
|
276
|
+
D = (e) => {
|
|
277
|
+
e.create('route', {
|
|
276
278
|
host: '',
|
|
277
279
|
path: '',
|
|
278
280
|
query: {},
|
|
279
281
|
})
|
|
280
282
|
},
|
|
281
|
-
|
|
283
|
+
P = (e) => {
|
|
282
284
|
const t = e.closest('[href]')
|
|
283
285
|
return (t && t.getAttribute('href')) || ''
|
|
284
286
|
},
|
|
285
|
-
|
|
287
|
+
E = (e, { publish: t, window: s }) => {
|
|
286
288
|
s.history.pushState(null, '', e), t(m, null)
|
|
287
289
|
},
|
|
288
|
-
|
|
290
|
+
F = (e, t) => {
|
|
289
291
|
if (!e || !e.target) return
|
|
290
292
|
e.preventDefault()
|
|
291
|
-
const s =
|
|
292
|
-
|
|
293
|
+
const s = P(e.target)
|
|
294
|
+
E(s, t)
|
|
293
295
|
},
|
|
294
296
|
L = (e) =>
|
|
295
297
|
e
|
|
@@ -297,80 +299,83 @@ const _t = (e, t, s) => {
|
|
|
297
299
|
.split('&')
|
|
298
300
|
.reduce((t, s) => {
|
|
299
301
|
if (!s) return t
|
|
300
|
-
const
|
|
301
|
-
return (t[
|
|
302
|
+
const n = s.split('=')
|
|
303
|
+
return (t[n[0]] = n[1]), t
|
|
302
304
|
}, {}),
|
|
303
305
|
z = (e, t) => {
|
|
304
|
-
const { state: s, publish:
|
|
305
|
-
{ host: o, pathname: a, search:
|
|
306
|
+
const { state: s, publish: n, window: r } = t,
|
|
307
|
+
{ host: o, pathname: a, search: l } = r.location,
|
|
306
308
|
u = a,
|
|
307
|
-
d = L(
|
|
309
|
+
d = L(l),
|
|
308
310
|
c = {
|
|
309
311
|
host: o,
|
|
310
312
|
path: u,
|
|
311
313
|
query: d,
|
|
312
314
|
}
|
|
313
|
-
s.store('route').update(c),
|
|
315
|
+
s.store('route').update(c), n($, c)
|
|
314
316
|
},
|
|
315
317
|
B = (e) => {
|
|
316
318
|
const { subscribe: t } = e
|
|
317
|
-
t(
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
$(r), n.addEventListener('popstate', () => t(m, null)), s(m, z)
|
|
319
|
+
t(k, F),
|
|
320
|
+
t(T, (s, n) => {
|
|
321
|
+
E(s, n)
|
|
322
|
+
})
|
|
322
323
|
},
|
|
323
324
|
V = (e) => {
|
|
324
|
-
|
|
325
|
+
const { publish: t, subscribe: s, state: n, window: r } = e
|
|
326
|
+
D(n), r.addEventListener('popstate', () => t(m, null)), s(m, z)
|
|
325
327
|
},
|
|
326
328
|
K = (e) => {
|
|
327
|
-
|
|
329
|
+
setTimeout(() => e.publish(m, null), 0)
|
|
330
|
+
},
|
|
331
|
+
R = (e) => {
|
|
332
|
+
V(e), B(e), K(e)
|
|
328
333
|
},
|
|
329
|
-
|
|
334
|
+
wt = /* @__PURE__ */ Object.freeze(
|
|
330
335
|
/* @__PURE__ */ Object.defineProperty(
|
|
331
336
|
{
|
|
332
337
|
__proto__: null,
|
|
333
|
-
publishLocation:
|
|
334
|
-
startNavigation:
|
|
335
|
-
subscribeToHistoryChange:
|
|
338
|
+
publishLocation: K,
|
|
339
|
+
startNavigation: R,
|
|
340
|
+
subscribeToHistoryChange: V,
|
|
336
341
|
subscribeToNavigation: B,
|
|
337
342
|
},
|
|
338
343
|
Symbol.toStringTag,
|
|
339
344
|
{ value: 'Module' },
|
|
340
345
|
),
|
|
341
346
|
)
|
|
342
|
-
class
|
|
347
|
+
class U {
|
|
343
348
|
constructor({
|
|
344
349
|
window: t,
|
|
345
350
|
document: s,
|
|
346
|
-
publish:
|
|
347
|
-
subscribe:
|
|
351
|
+
publish: n,
|
|
352
|
+
subscribe: r,
|
|
348
353
|
bus: o,
|
|
349
354
|
state: a,
|
|
350
|
-
renderKit:
|
|
355
|
+
renderKit: l,
|
|
351
356
|
}) {
|
|
352
357
|
;(this.window = t),
|
|
353
358
|
(this.document = s),
|
|
354
|
-
(this.publish =
|
|
355
|
-
(this.subscribe =
|
|
359
|
+
(this.publish = n),
|
|
360
|
+
(this.subscribe = r),
|
|
356
361
|
(this.bus = o),
|
|
357
362
|
(this.state = a),
|
|
358
|
-
(this.renderKit =
|
|
363
|
+
(this.renderKit = l),
|
|
359
364
|
(this.roots = [])
|
|
360
365
|
}
|
|
361
366
|
render(t, s) {
|
|
362
|
-
const
|
|
363
|
-
return this.roots.push(
|
|
367
|
+
const n = At(t, s, this.renderKit)
|
|
368
|
+
return this.roots.push(n), n
|
|
364
369
|
}
|
|
365
370
|
startNavigation() {
|
|
366
|
-
|
|
371
|
+
R(this)
|
|
367
372
|
}
|
|
368
373
|
}
|
|
369
|
-
const
|
|
374
|
+
const Me = /* @__PURE__ */ Object.freeze(
|
|
370
375
|
/* @__PURE__ */ Object.defineProperty(
|
|
371
376
|
{
|
|
372
377
|
__proto__: null,
|
|
373
|
-
App:
|
|
378
|
+
App: U,
|
|
374
379
|
},
|
|
375
380
|
Symbol.toStringTag,
|
|
376
381
|
{ value: 'Module' },
|
|
@@ -380,19 +385,19 @@ class q {
|
|
|
380
385
|
constructor() {
|
|
381
386
|
this.lookup = {}
|
|
382
387
|
}
|
|
383
|
-
add(t, s,
|
|
388
|
+
add(t, s, n) {
|
|
384
389
|
this.ensureArrayFor(t)
|
|
385
|
-
const
|
|
390
|
+
const r = {
|
|
386
391
|
listener: s,
|
|
387
|
-
index:
|
|
392
|
+
index: n,
|
|
388
393
|
matcher: t,
|
|
389
394
|
}
|
|
390
|
-
return this.lookup[t].push(
|
|
395
|
+
return this.lookup[t].push(r), () => this.remove(r)
|
|
391
396
|
}
|
|
392
397
|
remove(t) {
|
|
393
398
|
this.lookup[t.matcher] &&
|
|
394
399
|
(this.lookup[t.matcher] = this.lookup[t.matcher].reduce(
|
|
395
|
-
(s,
|
|
400
|
+
(s, n) => (n !== t && s.push(n), s),
|
|
396
401
|
[],
|
|
397
402
|
))
|
|
398
403
|
}
|
|
@@ -407,16 +412,16 @@ class I {
|
|
|
407
412
|
constructor() {
|
|
408
413
|
this.lookup = []
|
|
409
414
|
}
|
|
410
|
-
add(t, s,
|
|
411
|
-
const
|
|
415
|
+
add(t, s, n) {
|
|
416
|
+
const r = {
|
|
412
417
|
listener: s,
|
|
413
|
-
index:
|
|
418
|
+
index: n,
|
|
414
419
|
matcher: t,
|
|
415
420
|
}
|
|
416
|
-
return this.lookup.push(
|
|
421
|
+
return this.lookup.push(r), () => this.remove(r)
|
|
417
422
|
}
|
|
418
423
|
remove(t) {
|
|
419
|
-
this.lookup = this.lookup.reduce((s,
|
|
424
|
+
this.lookup = this.lookup.reduce((s, n) => (n !== t && s.push(n), s), [])
|
|
420
425
|
}
|
|
421
426
|
matches(t) {
|
|
422
427
|
return this.lookup.filter((s) => s.matcher.test(t))
|
|
@@ -429,13 +434,13 @@ class J {
|
|
|
429
434
|
(this.currentIndex = 0)
|
|
430
435
|
}
|
|
431
436
|
subscribe(t, s) {
|
|
432
|
-
let
|
|
437
|
+
let n
|
|
433
438
|
return (
|
|
434
439
|
typeof t == 'string'
|
|
435
|
-
? (
|
|
436
|
-
: (
|
|
440
|
+
? (n = this.exactSubscriptions.add(t, s, this.currentIndex))
|
|
441
|
+
: (n = this.fuzzySubscriptions.add(t, s, this.currentIndex)),
|
|
437
442
|
(this.currentIndex += 1),
|
|
438
|
-
|
|
443
|
+
n
|
|
439
444
|
)
|
|
440
445
|
}
|
|
441
446
|
publish(t, s) {
|
|
@@ -443,9 +448,9 @@ class J {
|
|
|
443
448
|
...this.exactSubscriptions.matches(t),
|
|
444
449
|
...this.fuzzySubscriptions.matches(t),
|
|
445
450
|
]
|
|
446
|
-
.sort((
|
|
447
|
-
.forEach((
|
|
448
|
-
|
|
451
|
+
.sort((r, o) => r.index - o.index)
|
|
452
|
+
.forEach((r) => {
|
|
453
|
+
r.listener(s, this.listenerOptions(t))
|
|
449
454
|
})
|
|
450
455
|
}
|
|
451
456
|
addListenerOptions(t) {
|
|
@@ -463,11 +468,11 @@ const H = () => {
|
|
|
463
468
|
const e = new J()
|
|
464
469
|
return {
|
|
465
470
|
bus: e,
|
|
466
|
-
publish: (
|
|
467
|
-
subscribe: (
|
|
471
|
+
publish: (n, r) => e.publish(n, r),
|
|
472
|
+
subscribe: (n, r) => e.subscribe(n, r),
|
|
468
473
|
}
|
|
469
474
|
},
|
|
470
|
-
|
|
475
|
+
ke = /* @__PURE__ */ Object.freeze(
|
|
471
476
|
/* @__PURE__ */ Object.defineProperty(
|
|
472
477
|
{
|
|
473
478
|
__proto__: null,
|
|
@@ -481,26 +486,55 @@ const H = () => {
|
|
|
481
486
|
),
|
|
482
487
|
),
|
|
483
488
|
f = (e) => Array.isArray(e),
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
!(
|
|
489
|
+
v = (e) => e !== null && !f(e) && typeof e == 'object',
|
|
490
|
+
Nt = (e, t) => e === t,
|
|
491
|
+
St = (e, t) => Object.keys(e).length === Object.keys(t).length,
|
|
492
|
+
jt = (e, t) =>
|
|
493
|
+
!(v(e) && v(t)) || !St(e, t)
|
|
489
494
|
? !1
|
|
490
495
|
: Object.keys(e).every((s) => {
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
return x(
|
|
496
|
+
const n = e[s],
|
|
497
|
+
r = t[s]
|
|
498
|
+
return x(n, r)
|
|
494
499
|
}),
|
|
495
|
-
|
|
500
|
+
Ot = (e, t) =>
|
|
496
501
|
!(f(e) && f(t)) || e.length !== t.length
|
|
497
502
|
? !1
|
|
498
|
-
: e.every((s,
|
|
499
|
-
const
|
|
500
|
-
return x(s,
|
|
503
|
+
: e.every((s, n) => {
|
|
504
|
+
const r = t[n]
|
|
505
|
+
return x(s, r)
|
|
501
506
|
}),
|
|
502
|
-
x = (e, t) => (
|
|
503
|
-
class
|
|
507
|
+
x = (e, t) => (v(e) ? jt(e, t) : f(e) ? Ot(e, t) : Nt(e, t))
|
|
508
|
+
class g {
|
|
509
|
+
constructor(t) {
|
|
510
|
+
;(this.name = t.name),
|
|
511
|
+
(this.parent = t.parent),
|
|
512
|
+
(this._value = t.value),
|
|
513
|
+
(this.initialValue = structuredClone(t.value))
|
|
514
|
+
}
|
|
515
|
+
get value() {
|
|
516
|
+
return this._value
|
|
517
|
+
}
|
|
518
|
+
set value(t) {
|
|
519
|
+
throw new Error('Cannot set value directly. Use an updater!')
|
|
520
|
+
}
|
|
521
|
+
reset() {
|
|
522
|
+
this._value = this.initialValue
|
|
523
|
+
}
|
|
524
|
+
update(t) {
|
|
525
|
+
if (typeof t == 'function') {
|
|
526
|
+
const s = this.getUpdatedValue(t)
|
|
527
|
+
this.updateValue(s)
|
|
528
|
+
} else this.updateValue(t)
|
|
529
|
+
}
|
|
530
|
+
updateValue(t) {
|
|
531
|
+
x(this._value, t) || ((this._value = t), this.parent.notify(this.name))
|
|
532
|
+
}
|
|
533
|
+
getUpdatedValue(t) {
|
|
534
|
+
return t(this.value)
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
class A {
|
|
504
538
|
constructor(t) {
|
|
505
539
|
this.store = t
|
|
506
540
|
}
|
|
@@ -508,28 +542,25 @@ class b {
|
|
|
508
542
|
this.store.update(t)
|
|
509
543
|
}
|
|
510
544
|
reset() {
|
|
511
|
-
this.store.update(this.store.
|
|
545
|
+
this.store.update(this.store.initialValue)
|
|
512
546
|
}
|
|
513
547
|
get value() {
|
|
514
548
|
return this.store.value
|
|
515
549
|
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
550
|
+
}
|
|
551
|
+
class Mt extends A {
|
|
552
|
+
updateAttribute(t, s) {
|
|
553
|
+
const n = { ...this.value }
|
|
554
|
+
;(n[t] = s), this.update(n)
|
|
521
555
|
}
|
|
522
|
-
|
|
523
|
-
|
|
556
|
+
resetAttribute(t) {
|
|
557
|
+
const s = { ...this.value },
|
|
558
|
+
n = this.store.initialValue[t]
|
|
559
|
+
;(s[t] = n), this.update(s)
|
|
524
560
|
}
|
|
525
561
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
this.constructor.prototype[t] = (...r) => {
|
|
529
|
-
const n = s(this.value, ...r)
|
|
530
|
-
this.update(n)
|
|
531
|
-
}
|
|
532
|
-
}
|
|
562
|
+
const kt = (e) => new Mt(e)
|
|
563
|
+
class Tt extends A {
|
|
533
564
|
push(t) {
|
|
534
565
|
const s = [...this.value, t]
|
|
535
566
|
this.update(s)
|
|
@@ -558,47 +589,20 @@ class w extends b {
|
|
|
558
589
|
s.sort(t), this.update(s)
|
|
559
590
|
}
|
|
560
591
|
insertAt(t, s) {
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
class y {
|
|
566
|
-
constructor(t) {
|
|
567
|
-
;(this.name = t.name),
|
|
568
|
-
(this.parent = t.parent),
|
|
569
|
-
(this._value = t.value),
|
|
570
|
-
(this.initialState = structuredClone(t.value)),
|
|
571
|
-
(this.updater = new b(this))
|
|
572
|
-
}
|
|
573
|
-
get value() {
|
|
574
|
-
return this._value
|
|
575
|
-
}
|
|
576
|
-
set value(t) {
|
|
577
|
-
throw new Error('Cannot set value directly. Use an updater!')
|
|
578
|
-
}
|
|
579
|
-
update(t) {
|
|
580
|
-
if (typeof t == 'function') {
|
|
581
|
-
const s = this.getUpdatedValue(t)
|
|
582
|
-
this.updateValue(s)
|
|
583
|
-
} else this.updateValue(t)
|
|
584
|
-
}
|
|
585
|
-
updateValue(t) {
|
|
586
|
-
x(this._value, t) || ((this._value = t), this.parent.notify(this.name))
|
|
587
|
-
}
|
|
588
|
-
getUpdatedValue(t) {
|
|
589
|
-
return t(this.value)
|
|
592
|
+
const n = [...this.value]
|
|
593
|
+
n.splice(t, 0, s), this.update(n)
|
|
590
594
|
}
|
|
591
|
-
|
|
592
|
-
this.
|
|
593
|
-
|
|
594
|
-
addUpdater(t, s) {
|
|
595
|
-
this.updater.addUpdaterFunction(t, s)
|
|
595
|
+
remove(t) {
|
|
596
|
+
const s = this.value.reduce((n, r) => (r !== t && n.push(r), n), [])
|
|
597
|
+
this.update(s)
|
|
596
598
|
}
|
|
597
|
-
|
|
598
|
-
this.
|
|
599
|
+
removeBy(t) {
|
|
600
|
+
const s = this.value.reduce((n, r) => (t(r) || n.push(r), n), [])
|
|
601
|
+
this.update(s)
|
|
599
602
|
}
|
|
600
603
|
}
|
|
601
|
-
|
|
604
|
+
const $t = (e) => new Tt(e)
|
|
605
|
+
class Dt extends A {
|
|
602
606
|
toggle() {
|
|
603
607
|
const t = !this.value
|
|
604
608
|
this.update(t)
|
|
@@ -609,58 +613,34 @@ class G extends b {
|
|
|
609
613
|
setFalse() {
|
|
610
614
|
this.update(!1)
|
|
611
615
|
}
|
|
612
|
-
addUpdaterFunction(t, s) {
|
|
613
|
-
this.constructor.prototype[t] = (...r) => {
|
|
614
|
-
const n = s(this.value, ...r)
|
|
615
|
-
this.update(n)
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
class C extends b {
|
|
620
|
-
addUpdaterFunction(t, s) {
|
|
621
|
-
this.constructor.prototype[t] = (...r) => {
|
|
622
|
-
const n = s(this.value, ...r)
|
|
623
|
-
this.update(n)
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
updateAttribute(t, s) {
|
|
627
|
-
const r = { ...this.value }
|
|
628
|
-
;(r[t] = s), this.update(r)
|
|
629
|
-
}
|
|
630
616
|
}
|
|
631
|
-
const
|
|
632
|
-
|
|
617
|
+
const Pt = (e) => new Dt(e),
|
|
618
|
+
Ft = {
|
|
619
|
+
object: kt,
|
|
620
|
+
list: $t,
|
|
621
|
+
boolean: Pt,
|
|
622
|
+
},
|
|
623
|
+
_ = 'state'
|
|
624
|
+
class G {
|
|
633
625
|
constructor(t) {
|
|
634
626
|
;(this.publisher = t),
|
|
635
627
|
(this.stores = {}),
|
|
636
|
-
(this.eventNamePrefix =
|
|
628
|
+
(this.eventNamePrefix = _),
|
|
637
629
|
(this.notifications = /* @__PURE__ */ new Set()),
|
|
638
630
|
(this.inTransaction = !1)
|
|
639
631
|
}
|
|
640
632
|
create(t, s) {
|
|
641
|
-
const
|
|
633
|
+
const n = new g({
|
|
642
634
|
name: t,
|
|
643
635
|
parent: this,
|
|
644
636
|
value: s,
|
|
645
637
|
})
|
|
646
|
-
return (this.stores[t] =
|
|
647
|
-
}
|
|
648
|
-
createBoolean(t, s) {
|
|
649
|
-
const r = this.create(t, s)
|
|
650
|
-
return (r.updater = new G(r)), r
|
|
651
|
-
}
|
|
652
|
-
createRecord(t, s) {
|
|
653
|
-
const r = this.create(t, s)
|
|
654
|
-
return (r.updater = new C(r)), r
|
|
655
|
-
}
|
|
656
|
-
createList(t, s) {
|
|
657
|
-
const r = this.create(t, s)
|
|
658
|
-
return (r.updater = new w(r)), r
|
|
638
|
+
return (this.stores[t] = n), n
|
|
659
639
|
}
|
|
660
640
|
store(t) {
|
|
661
641
|
return (
|
|
662
642
|
this.stores[t] ||
|
|
663
|
-
new
|
|
643
|
+
new g({
|
|
664
644
|
name: t,
|
|
665
645
|
parent: this,
|
|
666
646
|
value: void 0,
|
|
@@ -671,7 +651,7 @@ class Q {
|
|
|
671
651
|
return this.store(t).value
|
|
672
652
|
}
|
|
673
653
|
getAll(t) {
|
|
674
|
-
return t.reduce((s,
|
|
654
|
+
return t.reduce((s, n) => ((s[n] = this.get(n)), s), {})
|
|
675
655
|
}
|
|
676
656
|
notify(t) {
|
|
677
657
|
this.inTransaction ? this.notifications.add(t) : this.publish(t)
|
|
@@ -701,24 +681,22 @@ class Q {
|
|
|
701
681
|
return `${this.eventNamePrefix}:${t}`
|
|
702
682
|
}
|
|
703
683
|
}
|
|
704
|
-
const
|
|
705
|
-
|
|
684
|
+
const C = (e) => new G(e),
|
|
685
|
+
Te = /* @__PURE__ */ Object.freeze(
|
|
706
686
|
/* @__PURE__ */ Object.defineProperty(
|
|
707
687
|
{
|
|
708
688
|
__proto__: null,
|
|
709
|
-
State:
|
|
710
|
-
Store:
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
createState: W,
|
|
715
|
-
eventName: A,
|
|
689
|
+
State: G,
|
|
690
|
+
Store: g,
|
|
691
|
+
createState: C,
|
|
692
|
+
eventName: _,
|
|
693
|
+
updaters: Ft,
|
|
716
694
|
},
|
|
717
695
|
Symbol.toStringTag,
|
|
718
696
|
{ value: 'Module' },
|
|
719
697
|
),
|
|
720
698
|
)
|
|
721
|
-
class
|
|
699
|
+
class Lt {
|
|
722
700
|
constructor(t) {
|
|
723
701
|
this.setupDomEnvironment(t)
|
|
724
702
|
}
|
|
@@ -728,7 +706,7 @@ class Tt {
|
|
|
728
706
|
this.setupState(),
|
|
729
707
|
this.addBusOptions(),
|
|
730
708
|
this.setRenderKit(),
|
|
731
|
-
new
|
|
709
|
+
new U({
|
|
732
710
|
window: this.window,
|
|
733
711
|
document: this.document,
|
|
734
712
|
publish: this.publish,
|
|
@@ -747,11 +725,11 @@ class Tt {
|
|
|
747
725
|
: ((this.window = window), (this.document = document))
|
|
748
726
|
}
|
|
749
727
|
setupBus() {
|
|
750
|
-
const { publish: t, subscribe: s, bus:
|
|
751
|
-
;(this.publish = t), (this.subscribe = s), (this.bus =
|
|
728
|
+
const { publish: t, subscribe: s, bus: n } = H()
|
|
729
|
+
;(this.publish = t), (this.subscribe = s), (this.bus = n)
|
|
752
730
|
}
|
|
753
731
|
setupState() {
|
|
754
|
-
this.state =
|
|
732
|
+
this.state = C(this.publish)
|
|
755
733
|
}
|
|
756
734
|
addBusOptions() {
|
|
757
735
|
this.bus.addListenerOptions({
|
|
@@ -770,8 +748,8 @@ class Tt {
|
|
|
770
748
|
}
|
|
771
749
|
}
|
|
772
750
|
}
|
|
773
|
-
const
|
|
774
|
-
const s = new
|
|
751
|
+
const $e = (e = {}) => {
|
|
752
|
+
const s = new Lt(e).setup()
|
|
775
753
|
return s.startNavigation(), s
|
|
776
754
|
}
|
|
777
755
|
var i = /* @__PURE__ */ ((e) => (
|
|
@@ -788,7 +766,7 @@ var i = /* @__PURE__ */ ((e) => (
|
|
|
788
766
|
(e[(e.changeText = 10)] = 'changeText'),
|
|
789
767
|
e
|
|
790
768
|
))(i || {})
|
|
791
|
-
const
|
|
769
|
+
const De = /* @__PURE__ */ Object.freeze(
|
|
792
770
|
/* @__PURE__ */ Object.defineProperty(
|
|
793
771
|
{
|
|
794
772
|
__proto__: null,
|
|
@@ -798,100 +776,100 @@ const Oe = /* @__PURE__ */ Object.freeze(
|
|
|
798
776
|
{ value: 'Module' },
|
|
799
777
|
),
|
|
800
778
|
),
|
|
801
|
-
|
|
779
|
+
zt = (e, t) => ({
|
|
802
780
|
source: e,
|
|
803
781
|
target: t,
|
|
804
782
|
type: i.changeText,
|
|
805
783
|
data: {},
|
|
806
784
|
}),
|
|
807
|
-
|
|
785
|
+
Bt = (e, t) => ({
|
|
808
786
|
source: e,
|
|
809
787
|
target: t,
|
|
810
788
|
type: i.replaceNode,
|
|
811
789
|
data: {},
|
|
812
790
|
}),
|
|
813
|
-
|
|
791
|
+
Vt = (e, t, s) => ({
|
|
814
792
|
source: e,
|
|
815
793
|
target: t,
|
|
816
794
|
data: s,
|
|
817
795
|
type: i.removeAttribute,
|
|
818
796
|
}),
|
|
819
|
-
|
|
797
|
+
Kt = (e, t, s) => ({
|
|
820
798
|
source: e,
|
|
821
799
|
target: t,
|
|
822
800
|
data: s,
|
|
823
801
|
type: i.addAttribute,
|
|
824
802
|
}),
|
|
825
|
-
|
|
803
|
+
Rt = (e, t, s) => ({
|
|
826
804
|
source: e,
|
|
827
805
|
target: t,
|
|
828
806
|
data: s,
|
|
829
807
|
type: i.updateAttribute,
|
|
830
808
|
}),
|
|
831
|
-
|
|
809
|
+
Ut = (e, t, s) => ({
|
|
832
810
|
source: e,
|
|
833
811
|
target: t,
|
|
834
812
|
data: s,
|
|
835
813
|
type: i.removeEvent,
|
|
836
814
|
}),
|
|
837
|
-
|
|
815
|
+
qt = (e, t, s) => ({
|
|
838
816
|
source: e,
|
|
839
817
|
target: t,
|
|
840
818
|
data: s,
|
|
841
819
|
type: i.addEvent,
|
|
842
820
|
}),
|
|
843
|
-
|
|
821
|
+
It = (e, t, s) => ({
|
|
844
822
|
source: e,
|
|
845
823
|
target: t,
|
|
846
824
|
data: s,
|
|
847
825
|
type: i.updateEvent,
|
|
848
826
|
}),
|
|
849
|
-
|
|
827
|
+
w = (e) => ({
|
|
850
828
|
source: e,
|
|
851
829
|
target: e,
|
|
852
830
|
// for type crap only
|
|
853
831
|
type: i.removeNode,
|
|
854
832
|
data: {},
|
|
855
833
|
}),
|
|
856
|
-
|
|
834
|
+
b = (e, t) => ({
|
|
857
835
|
target: e,
|
|
858
836
|
source: e,
|
|
859
837
|
// for type crap only
|
|
860
838
|
type: i.insertNode,
|
|
861
839
|
data: t,
|
|
862
840
|
}),
|
|
863
|
-
|
|
841
|
+
Jt = (e, t, s) => ({
|
|
864
842
|
source: e,
|
|
865
843
|
target: t,
|
|
866
844
|
type: i.changeValue,
|
|
867
845
|
data: s,
|
|
868
846
|
}),
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
class
|
|
847
|
+
Ht = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
|
|
848
|
+
N = { index: -1 }
|
|
849
|
+
class Gt {
|
|
872
850
|
constructor() {
|
|
873
851
|
this.map = {}
|
|
874
852
|
}
|
|
875
853
|
populate(t) {
|
|
876
|
-
t.forEach((s,
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
((this.map[
|
|
880
|
-
this.map[
|
|
854
|
+
t.forEach((s, n) => {
|
|
855
|
+
const r = s.__jsx
|
|
856
|
+
r &&
|
|
857
|
+
((this.map[r] = this.map[r] || []),
|
|
858
|
+
this.map[r].push({
|
|
881
859
|
element: s,
|
|
882
|
-
index:
|
|
860
|
+
index: n,
|
|
883
861
|
}))
|
|
884
862
|
})
|
|
885
863
|
}
|
|
886
864
|
pullMatch(t) {
|
|
887
865
|
const s = t && t.__jsx
|
|
888
|
-
return !s || !(this.map[s] && this.map[s].length) ?
|
|
866
|
+
return !s || !(this.map[s] && this.map[s].length) ? N : this.map[s].shift()
|
|
889
867
|
}
|
|
890
868
|
clear(t) {
|
|
891
869
|
const s = t && t.__jsx
|
|
892
870
|
if (!(s && this.map[s] && this.map[s].length)) return
|
|
893
|
-
const
|
|
894
|
-
this.map[s] =
|
|
871
|
+
const n = this.map[s]
|
|
872
|
+
this.map[s] = n.reduce((r, o) => (o.element !== t && r.push(o), r), [])
|
|
895
873
|
}
|
|
896
874
|
check(t) {
|
|
897
875
|
const s = t && t.__jsx
|
|
@@ -901,95 +879,95 @@ class Rt {
|
|
|
901
879
|
return Object.values(this.map).flat()
|
|
902
880
|
}
|
|
903
881
|
}
|
|
904
|
-
const
|
|
905
|
-
const t = new
|
|
882
|
+
const S = (e) => {
|
|
883
|
+
const t = new Gt()
|
|
906
884
|
return t.populate(e), t
|
|
907
885
|
},
|
|
908
|
-
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
o =
|
|
886
|
+
Q = (e, t, s = !1) => {
|
|
887
|
+
const n = [],
|
|
888
|
+
r = e.attributes,
|
|
889
|
+
o = r.length,
|
|
912
890
|
a = t.attributes,
|
|
913
|
-
|
|
891
|
+
l = a.length
|
|
914
892
|
let u, d, c
|
|
915
893
|
for (u = 0; u < o; u++) {
|
|
916
894
|
c = null
|
|
917
|
-
const
|
|
918
|
-
if (
|
|
919
|
-
for (d = 0; d <
|
|
895
|
+
const h = r.item(u)
|
|
896
|
+
if (h) {
|
|
897
|
+
for (d = 0; d < l; d++) {
|
|
920
898
|
const p = a.item(d)
|
|
921
|
-
if (p &&
|
|
899
|
+
if (p && h.name == p.name) {
|
|
922
900
|
c = p
|
|
923
901
|
break
|
|
924
902
|
}
|
|
925
903
|
}
|
|
926
904
|
c
|
|
927
|
-
?
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
name:
|
|
905
|
+
? h.value !== c.value &&
|
|
906
|
+
n.push(
|
|
907
|
+
Rt(e, t, {
|
|
908
|
+
name: h.name,
|
|
931
909
|
value: c.value,
|
|
932
910
|
isSvg: s,
|
|
933
911
|
}),
|
|
934
912
|
)
|
|
935
|
-
:
|
|
913
|
+
: n.push(Vt(e, t, { name: h.name, isSvg: s }))
|
|
936
914
|
}
|
|
937
915
|
}
|
|
938
|
-
for (u = 0; u <
|
|
916
|
+
for (u = 0; u < l; u++) {
|
|
939
917
|
c = null
|
|
940
|
-
const
|
|
941
|
-
if (
|
|
918
|
+
const h = a.item(u)
|
|
919
|
+
if (h) {
|
|
942
920
|
for (d = 0; d < o; d++) {
|
|
943
|
-
const p =
|
|
944
|
-
if (p && p.name ==
|
|
921
|
+
const p = r.item(d)
|
|
922
|
+
if (p && p.name == h.name) {
|
|
945
923
|
c = p
|
|
946
924
|
break
|
|
947
925
|
}
|
|
948
926
|
}
|
|
949
927
|
c ||
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
name:
|
|
953
|
-
value:
|
|
928
|
+
n.push(
|
|
929
|
+
Kt(e, t, {
|
|
930
|
+
name: h.name,
|
|
931
|
+
value: h.value,
|
|
954
932
|
isSvg: s,
|
|
955
933
|
}),
|
|
956
934
|
)
|
|
957
935
|
}
|
|
958
936
|
}
|
|
959
|
-
return
|
|
937
|
+
return n
|
|
960
938
|
},
|
|
961
|
-
|
|
939
|
+
Ct = (e, t) => {
|
|
962
940
|
const s = [],
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
o = Object.keys(
|
|
966
|
-
a = Object.keys(
|
|
941
|
+
n = e.eventMaps,
|
|
942
|
+
r = t.eventMaps,
|
|
943
|
+
o = Object.keys(n),
|
|
944
|
+
a = Object.keys(r)
|
|
967
945
|
return (
|
|
968
|
-
o.forEach((
|
|
969
|
-
const u =
|
|
970
|
-
d =
|
|
946
|
+
o.forEach((l) => {
|
|
947
|
+
const u = n[l],
|
|
948
|
+
d = r[l]
|
|
971
949
|
d
|
|
972
950
|
? d.busEvent !== u.busEvent &&
|
|
973
951
|
s.push(
|
|
974
|
-
|
|
975
|
-
name:
|
|
952
|
+
It(e, t, {
|
|
953
|
+
name: l,
|
|
976
954
|
targetValue: d.listener,
|
|
977
955
|
sourceValue: u.listener,
|
|
978
956
|
}),
|
|
979
957
|
)
|
|
980
958
|
: s.push(
|
|
981
|
-
|
|
959
|
+
Ut(e, t, {
|
|
982
960
|
name: u.domEvent,
|
|
983
961
|
value: u.listener,
|
|
984
962
|
}),
|
|
985
963
|
)
|
|
986
964
|
}),
|
|
987
|
-
a.forEach((
|
|
988
|
-
const u =
|
|
989
|
-
d =
|
|
965
|
+
a.forEach((l) => {
|
|
966
|
+
const u = n[l],
|
|
967
|
+
d = r[l]
|
|
990
968
|
u ||
|
|
991
969
|
s.push(
|
|
992
|
-
|
|
970
|
+
qt(e, t, {
|
|
993
971
|
name: d.domEvent,
|
|
994
972
|
value: d.listener,
|
|
995
973
|
}),
|
|
@@ -998,205 +976,205 @@ const N = (e) => {
|
|
|
998
976
|
s
|
|
999
977
|
)
|
|
1000
978
|
},
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
if (
|
|
979
|
+
Qt = (e) => e.tagName !== 'INPUT',
|
|
980
|
+
Wt = (e, t) => e.value === t.value,
|
|
981
|
+
Xt = (e, t) => {
|
|
982
|
+
if (Qt(e) || Wt(e, t)) return []
|
|
1005
983
|
const s = e,
|
|
1006
|
-
|
|
1007
|
-
return [
|
|
984
|
+
n = t
|
|
985
|
+
return [Jt(s, n, { name: 'value', value: n.value })]
|
|
1008
986
|
},
|
|
1009
|
-
|
|
1010
|
-
const s =
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
return s.concat(
|
|
987
|
+
Yt = (e, t) => {
|
|
988
|
+
const s = Q(e, t),
|
|
989
|
+
n = Ct(e, t),
|
|
990
|
+
r = Xt(e, t)
|
|
991
|
+
return s.concat(n).concat(r)
|
|
1014
992
|
},
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
let
|
|
1019
|
-
if (e.nodeType === 1 &&
|
|
1020
|
-
const
|
|
993
|
+
Zt = (e, t) => Q(e, t, !0),
|
|
994
|
+
te = (e, t) => (e.textContent !== t.textContent ? [zt(e, t)] : []),
|
|
995
|
+
ee = (e, t, s) => {
|
|
996
|
+
let n = []
|
|
997
|
+
if (e.nodeType === 1 && it(e)) {
|
|
998
|
+
const r = e,
|
|
1021
999
|
o = t,
|
|
1022
|
-
a =
|
|
1023
|
-
|
|
1024
|
-
|
|
1000
|
+
a = Zt(r, o),
|
|
1001
|
+
l = s(r.childNodes, o.childNodes, r)
|
|
1002
|
+
n = a.concat(l)
|
|
1025
1003
|
} else if (e.nodeType === 1) {
|
|
1026
|
-
const
|
|
1004
|
+
const r = e,
|
|
1027
1005
|
o = t,
|
|
1028
|
-
a =
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
} else e.nodeType === 3 && (
|
|
1032
|
-
return
|
|
1006
|
+
a = Yt(r, o),
|
|
1007
|
+
l = s(r.childNodes, o.childNodes, r)
|
|
1008
|
+
n = a.concat(l)
|
|
1009
|
+
} else e.nodeType === 3 && (n = te(e, t))
|
|
1010
|
+
return n
|
|
1033
1011
|
},
|
|
1034
|
-
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1037
|
-
o =
|
|
1038
|
-
a =
|
|
1039
|
-
|
|
1012
|
+
W = (e, t, s) => {
|
|
1013
|
+
const n = [],
|
|
1014
|
+
r = se(e, t),
|
|
1015
|
+
o = S(e),
|
|
1016
|
+
a = S(t),
|
|
1017
|
+
l = []
|
|
1040
1018
|
let u = 0
|
|
1041
|
-
for (; u <
|
|
1019
|
+
for (; u < r; u++) {
|
|
1042
1020
|
const c = e[u],
|
|
1043
|
-
|
|
1044
|
-
if (
|
|
1045
|
-
const p = o.pullMatch(
|
|
1046
|
-
a.clear(
|
|
1021
|
+
h = t[u]
|
|
1022
|
+
if (h && a.check(h)) {
|
|
1023
|
+
const p = o.pullMatch(h)
|
|
1024
|
+
a.clear(h),
|
|
1047
1025
|
p.element
|
|
1048
1026
|
? (p.index !== u &&
|
|
1049
|
-
|
|
1050
|
-
|
|
1027
|
+
n.push(
|
|
1028
|
+
b(p.element, {
|
|
1051
1029
|
parent: s,
|
|
1052
1030
|
index: u,
|
|
1053
1031
|
}),
|
|
1054
1032
|
),
|
|
1055
|
-
|
|
1033
|
+
l.push({
|
|
1056
1034
|
source: p.element,
|
|
1057
|
-
target:
|
|
1035
|
+
target: h,
|
|
1058
1036
|
}))
|
|
1059
1037
|
: c
|
|
1060
1038
|
? a.check(c)
|
|
1061
|
-
?
|
|
1062
|
-
: (o.clear(c),
|
|
1063
|
-
:
|
|
1064
|
-
} else c && o.pullMatch(c).element &&
|
|
1039
|
+
? n.push(b(h, { parent: s, index: u }))
|
|
1040
|
+
: (o.clear(c), n.push(Bt(c, h)))
|
|
1041
|
+
: n.push(b(h, { parent: s, index: u }))
|
|
1042
|
+
} else c && o.pullMatch(c).element && n.push(w(c))
|
|
1065
1043
|
}
|
|
1066
1044
|
o.remaining().forEach(({ element: c }) => {
|
|
1067
|
-
|
|
1045
|
+
n.push(w(c))
|
|
1068
1046
|
})
|
|
1069
|
-
const d =
|
|
1070
|
-
(c, { source:
|
|
1047
|
+
const d = l.reduce(
|
|
1048
|
+
(c, { source: h, target: p }) => c.concat(ee(h, p, W)),
|
|
1071
1049
|
[],
|
|
1072
1050
|
)
|
|
1073
|
-
return
|
|
1051
|
+
return n.concat(d).sort(Ht)
|
|
1074
1052
|
},
|
|
1075
|
-
|
|
1053
|
+
se = (e, t) => {
|
|
1076
1054
|
const s = e.length,
|
|
1077
|
-
|
|
1078
|
-
return s >
|
|
1055
|
+
n = t.length
|
|
1056
|
+
return s > n ? s : n
|
|
1079
1057
|
},
|
|
1080
|
-
|
|
1081
|
-
const
|
|
1058
|
+
ne = (e, t, s) => {
|
|
1059
|
+
const n = W(e, t, s)
|
|
1082
1060
|
return (
|
|
1083
|
-
|
|
1084
|
-
|
|
1061
|
+
n.forEach((r) => {
|
|
1062
|
+
re(r)
|
|
1085
1063
|
}),
|
|
1086
|
-
|
|
1064
|
+
n
|
|
1087
1065
|
)
|
|
1088
1066
|
},
|
|
1089
|
-
|
|
1090
|
-
;(
|
|
1067
|
+
re = (e) => {
|
|
1068
|
+
;(be[e.type] || oe)(e)
|
|
1091
1069
|
},
|
|
1092
|
-
|
|
1093
|
-
|
|
1070
|
+
oe = (e) => {},
|
|
1071
|
+
ie = (e) => {
|
|
1094
1072
|
const { source: t, target: s } = e
|
|
1095
1073
|
t.nodeValue = s.textContent
|
|
1096
1074
|
},
|
|
1097
|
-
|
|
1075
|
+
ue = (e) => {
|
|
1098
1076
|
const { source: t } = e
|
|
1099
1077
|
t.remove()
|
|
1100
1078
|
},
|
|
1101
|
-
|
|
1079
|
+
ae = (e) => {
|
|
1102
1080
|
const { target: t, data: s } = e,
|
|
1103
|
-
{ parent:
|
|
1104
|
-
o =
|
|
1105
|
-
o ? o && o !== t &&
|
|
1081
|
+
{ parent: n, index: r } = s,
|
|
1082
|
+
o = n.childNodes[r]
|
|
1083
|
+
o ? o && o !== t && n.insertBefore(t, o) : n.appendChild(t)
|
|
1106
1084
|
},
|
|
1107
|
-
|
|
1085
|
+
ce = (e) => {
|
|
1108
1086
|
const { source: t, target: s } = e
|
|
1109
1087
|
t.replaceWith(s)
|
|
1110
1088
|
},
|
|
1111
|
-
|
|
1089
|
+
le = (e) => {
|
|
1112
1090
|
const { source: t, data: s } = e,
|
|
1113
|
-
{ name:
|
|
1114
|
-
|
|
1091
|
+
{ name: n, isSvg: r } = s
|
|
1092
|
+
r ? t.removeAttributeNS(null, n) : t.removeAttribute(n)
|
|
1115
1093
|
},
|
|
1116
|
-
|
|
1094
|
+
X = (e) => {
|
|
1117
1095
|
const { source: t, data: s } = e,
|
|
1118
|
-
{ name:
|
|
1119
|
-
o ? t.setAttributeNS(null,
|
|
1096
|
+
{ name: n, value: r, isSvg: o } = s
|
|
1097
|
+
o ? t.setAttributeNS(null, n, r) : t.setAttribute(n, r)
|
|
1120
1098
|
},
|
|
1121
|
-
|
|
1122
|
-
|
|
1099
|
+
he = (e) => {
|
|
1100
|
+
X(e)
|
|
1123
1101
|
},
|
|
1124
|
-
|
|
1102
|
+
de = (e) => {
|
|
1125
1103
|
const t = e.data,
|
|
1126
1104
|
s = e.source,
|
|
1127
|
-
{ name:
|
|
1128
|
-
s.removeEventListener(
|
|
1105
|
+
{ name: n, value: r } = t
|
|
1106
|
+
s.removeEventListener(n, r)
|
|
1129
1107
|
},
|
|
1130
|
-
|
|
1108
|
+
pe = (e) => {
|
|
1131
1109
|
const t = e.data,
|
|
1132
1110
|
s = e.source,
|
|
1133
|
-
{ name:
|
|
1134
|
-
s.addEventListener(
|
|
1111
|
+
{ name: n, value: r } = t
|
|
1112
|
+
s.addEventListener(n, r)
|
|
1135
1113
|
},
|
|
1136
|
-
|
|
1114
|
+
me = (e) => {
|
|
1137
1115
|
const t = e.data,
|
|
1138
1116
|
s = e.source,
|
|
1139
|
-
{ name:
|
|
1140
|
-
s.removeEventListener(
|
|
1117
|
+
{ name: n, sourceValue: r, targetValue: o } = t
|
|
1118
|
+
s.removeEventListener(n, r), s.addEventListener(n, o)
|
|
1141
1119
|
},
|
|
1142
|
-
|
|
1120
|
+
fe = (e) => {
|
|
1143
1121
|
const t = e.data,
|
|
1144
1122
|
s = e.source,
|
|
1145
|
-
{ value:
|
|
1146
|
-
s.value =
|
|
1123
|
+
{ value: n } = t
|
|
1124
|
+
s.value = n
|
|
1147
1125
|
},
|
|
1148
|
-
|
|
1149
|
-
[i.changeText]:
|
|
1150
|
-
[i.removeNode]:
|
|
1151
|
-
[i.insertNode]:
|
|
1152
|
-
[i.replaceNode]:
|
|
1153
|
-
[i.removeAttribute]:
|
|
1154
|
-
[i.addAttribute]:
|
|
1155
|
-
[i.updateAttribute]:
|
|
1156
|
-
[i.removeEvent]:
|
|
1157
|
-
[i.addEvent]:
|
|
1158
|
-
[i.updateEvent]:
|
|
1159
|
-
[i.changeValue]:
|
|
1126
|
+
be = {
|
|
1127
|
+
[i.changeText]: ie,
|
|
1128
|
+
[i.removeNode]: ue,
|
|
1129
|
+
[i.insertNode]: ae,
|
|
1130
|
+
[i.replaceNode]: ce,
|
|
1131
|
+
[i.removeAttribute]: le,
|
|
1132
|
+
[i.addAttribute]: X,
|
|
1133
|
+
[i.updateAttribute]: he,
|
|
1134
|
+
[i.removeEvent]: de,
|
|
1135
|
+
[i.addEvent]: pe,
|
|
1136
|
+
[i.updateEvent]: me,
|
|
1137
|
+
[i.changeValue]: fe,
|
|
1160
1138
|
},
|
|
1161
|
-
|
|
1162
|
-
const
|
|
1139
|
+
ve = (e, t, s) => {
|
|
1140
|
+
const n = [...t]
|
|
1163
1141
|
return (
|
|
1164
|
-
e.forEach((
|
|
1165
|
-
|
|
1142
|
+
e.forEach((r) => {
|
|
1143
|
+
ge(r, n, s)
|
|
1166
1144
|
}),
|
|
1167
|
-
|
|
1145
|
+
n
|
|
1168
1146
|
)
|
|
1169
1147
|
},
|
|
1170
|
-
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1148
|
+
ge = (e, t, s) => {
|
|
1149
|
+
const n = Ae[e.type]
|
|
1150
|
+
n && n(e, t, s)
|
|
1173
1151
|
},
|
|
1174
|
-
|
|
1152
|
+
ye = (e, t) => {
|
|
1175
1153
|
const { source: s } = e,
|
|
1176
|
-
|
|
1177
|
-
|
|
1154
|
+
n = t.indexOf(s)
|
|
1155
|
+
n >= 0 && t.splice(n, 1)
|
|
1178
1156
|
},
|
|
1179
|
-
|
|
1180
|
-
const { target:
|
|
1181
|
-
|
|
1182
|
-
{ index: o, parent: a } =
|
|
1183
|
-
s === a && t.splice(o, 0,
|
|
1157
|
+
Ee = (e, t, s) => {
|
|
1158
|
+
const { target: n } = e,
|
|
1159
|
+
r = e.data,
|
|
1160
|
+
{ index: o, parent: a } = r
|
|
1161
|
+
s === a && t.splice(o, 0, n)
|
|
1184
1162
|
},
|
|
1185
|
-
|
|
1186
|
-
const { target: s, source:
|
|
1187
|
-
|
|
1188
|
-
|
|
1163
|
+
xe = (e, t) => {
|
|
1164
|
+
const { target: s, source: n } = e,
|
|
1165
|
+
r = t.indexOf(n)
|
|
1166
|
+
r >= 0 && (t[r] = s)
|
|
1189
1167
|
},
|
|
1190
|
-
|
|
1191
|
-
[i.removeNode]:
|
|
1192
|
-
[i.insertNode]:
|
|
1193
|
-
[i.replaceNode]:
|
|
1168
|
+
Ae = {
|
|
1169
|
+
[i.removeNode]: ye,
|
|
1170
|
+
[i.insertNode]: Ee,
|
|
1171
|
+
[i.replaceNode]: xe,
|
|
1194
1172
|
}
|
|
1195
|
-
class
|
|
1196
|
-
constructor({ Template: t, subscriptions: s, attributes:
|
|
1173
|
+
class _e {
|
|
1174
|
+
constructor({ Template: t, subscriptions: s, attributes: n, viewModel: r }) {
|
|
1197
1175
|
;(this.Template = t),
|
|
1198
|
-
(this.viewModel =
|
|
1199
|
-
(this.attributes =
|
|
1176
|
+
(this.viewModel = r),
|
|
1177
|
+
(this.attributes = n),
|
|
1200
1178
|
(this.subscriptions = s),
|
|
1201
1179
|
(this.dom = []),
|
|
1202
1180
|
(this.parentElement = null)
|
|
@@ -1215,17 +1193,17 @@ class ge {
|
|
|
1215
1193
|
...this.attributes,
|
|
1216
1194
|
...this.viewModel(t.state.getAll(this.subscriptions)),
|
|
1217
1195
|
},
|
|
1218
|
-
|
|
1219
|
-
return
|
|
1196
|
+
n = this.Template(s)
|
|
1197
|
+
return n ? n.render(t) : []
|
|
1220
1198
|
}
|
|
1221
1199
|
rerender() {
|
|
1222
1200
|
if (!this.parentElement && this.dom[0]) {
|
|
1223
|
-
const
|
|
1224
|
-
this.parentElement =
|
|
1201
|
+
const n = this.dom[0].parentElement
|
|
1202
|
+
this.parentElement = n
|
|
1225
1203
|
}
|
|
1226
1204
|
const t = this.generateDom(this.renderKit),
|
|
1227
|
-
s =
|
|
1228
|
-
this.dom =
|
|
1205
|
+
s = ne(this.dom, t, this.parentElement)
|
|
1206
|
+
this.dom = ve(s, this.dom, this.parentElement)
|
|
1229
1207
|
}
|
|
1230
1208
|
subscribeForRerender() {
|
|
1231
1209
|
const { subscribe: t } = this.renderKit
|
|
@@ -1234,75 +1212,75 @@ class ge {
|
|
|
1234
1212
|
})
|
|
1235
1213
|
}
|
|
1236
1214
|
eventName(t) {
|
|
1237
|
-
return `${
|
|
1215
|
+
return `${_}:${t}`
|
|
1238
1216
|
}
|
|
1239
1217
|
}
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1218
|
+
const we = (e) => e,
|
|
1219
|
+
Ne = ({ Template: e, viewModel: t, subscriptions: s }) => (
|
|
1242
1220
|
(s = s || []),
|
|
1243
|
-
(t = t ||
|
|
1244
|
-
(
|
|
1245
|
-
new
|
|
1221
|
+
(t = t || we),
|
|
1222
|
+
(n) =>
|
|
1223
|
+
new _e({ Template: e, viewModel: t, subscriptions: s, attributes: n })
|
|
1246
1224
|
),
|
|
1247
|
-
|
|
1225
|
+
Pe = /* @__PURE__ */ Object.freeze(
|
|
1248
1226
|
/* @__PURE__ */ Object.defineProperty(
|
|
1249
1227
|
{
|
|
1250
1228
|
__proto__: null,
|
|
1251
|
-
createRouteState:
|
|
1252
|
-
events:
|
|
1229
|
+
createRouteState: D,
|
|
1230
|
+
events: _t,
|
|
1253
1231
|
extractQueryParams: L,
|
|
1254
|
-
findHref:
|
|
1255
|
-
navigate:
|
|
1256
|
-
onLinkClick:
|
|
1232
|
+
findHref: P,
|
|
1233
|
+
navigate: E,
|
|
1234
|
+
onLinkClick: F,
|
|
1257
1235
|
onLocationChange: z,
|
|
1258
|
-
start:
|
|
1236
|
+
start: wt,
|
|
1259
1237
|
},
|
|
1260
1238
|
Symbol.toStringTag,
|
|
1261
1239
|
{ value: 'Module' },
|
|
1262
1240
|
),
|
|
1263
1241
|
),
|
|
1264
|
-
|
|
1242
|
+
Se =
|
|
1265
1243
|
(e) =>
|
|
1266
1244
|
({ path: t }) =>
|
|
1267
1245
|
t === e,
|
|
1268
|
-
|
|
1269
|
-
|
|
1246
|
+
je = () => !0,
|
|
1247
|
+
Y =
|
|
1270
1248
|
(e) =>
|
|
1271
1249
|
({ route: t }) => {
|
|
1272
|
-
const s = e.find((
|
|
1250
|
+
const s = e.find((n) => n.match(t))
|
|
1273
1251
|
return s && s.Partial
|
|
1274
1252
|
},
|
|
1275
|
-
|
|
1253
|
+
Fe = /* @__PURE__ */ Object.freeze(
|
|
1276
1254
|
/* @__PURE__ */ Object.defineProperty(
|
|
1277
1255
|
{
|
|
1278
1256
|
__proto__: null,
|
|
1279
|
-
buildRouter:
|
|
1280
|
-
catchAll:
|
|
1281
|
-
exactPathMatch:
|
|
1257
|
+
buildRouter: Y,
|
|
1258
|
+
catchAll: je,
|
|
1259
|
+
exactPathMatch: Se,
|
|
1282
1260
|
},
|
|
1283
1261
|
Symbol.toStringTag,
|
|
1284
1262
|
{ value: 'Module' },
|
|
1285
1263
|
),
|
|
1286
1264
|
),
|
|
1287
|
-
|
|
1265
|
+
Oe = () => ({
|
|
1288
1266
|
render: (e, t) => [],
|
|
1289
1267
|
}),
|
|
1290
|
-
|
|
1291
|
-
const t =
|
|
1292
|
-
return
|
|
1293
|
-
Template: ({ route:
|
|
1268
|
+
Le = (e) => {
|
|
1269
|
+
const t = Y(e)
|
|
1270
|
+
return Ne({
|
|
1271
|
+
Template: ({ route: n }) => (t({ route: n }) || Oe)(),
|
|
1294
1272
|
subscriptions: ['route'],
|
|
1295
1273
|
})
|
|
1296
1274
|
}
|
|
1297
1275
|
export {
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1276
|
+
De as JaxsTypes,
|
|
1277
|
+
Me as appBuilding,
|
|
1278
|
+
Ne as bind,
|
|
1279
|
+
$e as createApp,
|
|
1280
|
+
Et as jsx,
|
|
1281
|
+
ke as messageBus,
|
|
1282
|
+
Pe as navigation,
|
|
1283
|
+
Le as routedView,
|
|
1284
|
+
Fe as routing,
|
|
1285
|
+
Te as state,
|
|
1308
1286
|
}
|