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