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.js CHANGED
@@ -1,34 +1,34 @@
1
- const et = (e, t) => t.createElement(e),
2
- st = (e, t) => {
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 r = t[s].toString()
5
+ const n = t[s].toString()
6
6
  if (s === 'value') {
7
- const n = e
8
- n.value !== r && (n.value = r)
9
- } else e.setAttribute(s, r)
7
+ const r = e
8
+ r.value !== n && (r.value = n)
9
+ } else e.setAttribute(s, n)
10
10
  }
11
11
  },
12
- rt = (e, t, s) => {
13
- const r = {}
14
- for (const n in t) {
15
- const o = t[n],
16
- a = (h) => s(o, h)
17
- e.addEventListener(n, a),
18
- (r[n] = {
19
- domEvent: n,
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 = r
24
+ e.eventMaps = n
25
25
  },
26
- nt = (e, t, s, r) => {
27
- const n = et(e, r.document)
28
- return st(n, t), rt(n, s, r.publish), n
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
- E = 'http://www.w3.org/2000/svg',
31
- ot = {
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
- it = (e, t) => !!(ot[e] || (e === 'a' && t === E)),
96
- ut = (e, t, s) => {
97
- const r = s.createElementNS(E, e)
98
- for (const n in t)
99
- n === '__self' ||
100
- n === 'xmlns' ||
101
- r.setAttributeNS(null, n, t[n].toString())
102
- return r
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
- at = (e) => e.namespaceURI === E,
105
- ct = (e, t) => t.createTextNode(e)
106
- class ht {
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 = ct(this.value, t.document)
111
+ const s = ut(this.value, t.document)
112
112
  return (s.__jsx = 'TextNode'), [s]
113
113
  }
114
114
  }
115
- const lt = (e) => typeof e == 'string' || typeof e == 'number',
116
- dt = (e) => new ht(e),
117
- pt = (e) => (lt(e) ? dt(e) : e),
118
- mt = (e) => ft(e).map(pt).flat(),
119
- ft = (e) => (Array.isArray(e) ? e.flat() : e ? [e] : []),
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
- bt = (e, t = '') => {
121
+ mt = (e, t = '') => {
122
122
  const s = {},
123
- r = {}
124
- for (const n in e) {
125
- const o = e[n]
126
- if (n.match(/^on.+/i)) {
127
- const a = n.slice(2).toLowerCase()
128
- r[a] = o ? o.toString() : ''
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
- n === '__source' ? (s.__source = e.__source) : (s[n] = vt(n, o, t))
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: r,
136
+ events: n,
137
137
  }
138
138
  },
139
- vt = (e, t, s = '') => (t == null ? s : t.toString()),
140
- gt = (e, t) => {
139
+ ft = (e, t, s = '') => (t == null ? s : t.toString()),
140
+ bt = (e, t) => {
141
141
  const s = e || {},
142
- r = j(t, s)
143
- return (s.children = s.children || r), s
142
+ n = j(t, s)
143
+ return (s.children = s.children || n), s
144
144
  },
145
- O = (e, t, s, r = []) => e.reduce(yt(t, s), r).flat(),
146
- yt = (e, t) => (s, r) =>
147
- r
148
- ? Array.isArray(r)
149
- ? O(r, e, t, s)
150
- : (r.render(e, t).forEach((n) => s.push(n)), s)
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 k {
152
+ class M {
153
153
  constructor(t) {
154
- this.collection = mt(t)
154
+ this.collection = dt(t)
155
155
  }
156
156
  render(t, s) {
157
157
  this.parentElement = s
158
- const r = this.generateDom(t)
159
- return this.attachToParent(r), r
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((r) => s.appendChild(r))
167
+ t.forEach((n) => s.appendChild(n))
168
168
  }
169
169
  }
170
- class Et {
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: r,
184
+ columnNumber: n,
185
185
  } = this.attributes.__source
186
- return `${t}:${s}:${r}`
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
- r = this.attributes.name ? `[name=${this.attributes.name}]` : ''
193
- return `${this.type}${t}${s}${r}`
192
+ n = this.attributes.name ? `[name=${this.attributes.name}]` : ''
193
+ return `${this.type}${t}${s}${n}`
194
194
  }
195
195
  }
196
- class xt {
197
- constructor(t, s, r = []) {
196
+ class yt {
197
+ constructor(t, s, n = []) {
198
198
  this.type = t
199
- const { events: n, attributes: o } = bt(s)
200
- ;(this.events = n),
199
+ const { events: r, attributes: o } = mt(s)
200
+ ;(this.events = r),
201
201
  (this.attributes = o),
202
- (this.isSvg = it(this.type, this.attributes.xmlns)),
203
- (this.children = new k(r))
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 = nt(this.type, this.attributes, this.events, t)
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 = ut(this.type, this.attributes, t.document)
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 Et(this.type, this.attributes).generate()
221
+ return new gt(this.type, this.attributes).generate()
222
222
  }
223
223
  }
224
- const wt = (e, t, ...s) =>
225
- typeof e == 'string' ? new xt(e, t, s) : e(gt(t, s))
226
- wt.fragment = (e, t) => {
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 k(s)
228
+ return new M(s)
229
229
  }
230
- class At {
231
- constructor(t, s, r) {
230
+ class xt {
231
+ constructor(t, s, n) {
232
232
  ;(this.template = t),
233
233
  (this.selector = s),
234
- (this.renderKit = r),
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 _t = (e, t, s) => {
256
- const r = new At(e, t, s)
257
- return r.renderAndAttach(s), r
255
+ const At = (e, t, s) => {
256
+ const n = new xt(e, t, s)
257
+ return n.renderAndAttach(s), n
258
258
  },
259
- M = 'go-to-href',
259
+ k = 'go-to-href',
260
+ T = 'go-to',
260
261
  m = 'navigation:location-change',
261
- T = 'navigation:route-change',
262
- St = /* @__PURE__ */ Object.freeze(
262
+ $ = 'navigation:route-change',
263
+ _t = /* @__PURE__ */ Object.freeze(
263
264
  /* @__PURE__ */ Object.defineProperty(
264
265
  {
265
266
  __proto__: null,
266
- linkNavigationEvent: M,
267
+ linkNavigationEvent: k,
267
268
  locationChangeEvent: m,
268
- routeChangeEvent: T,
269
+ navigationEvent: T,
270
+ routeChangeEvent: $,
269
271
  },
270
272
  Symbol.toStringTag,
271
273
  { value: 'Module' },
272
274
  ),
273
275
  ),
274
- $ = (e) => {
275
- e.createRecord('route', {
276
+ D = (e) => {
277
+ e.create('route', {
276
278
  host: '',
277
279
  path: '',
278
280
  query: {},
279
281
  })
280
282
  },
281
- F = (e) => {
283
+ P = (e) => {
282
284
  const t = e.closest('[href]')
283
285
  return (t && t.getAttribute('href')) || ''
284
286
  },
285
- D = (e, { publish: t, window: s }) => {
287
+ E = (e, { publish: t, window: s }) => {
286
288
  s.history.pushState(null, '', e), t(m, null)
287
289
  },
288
- P = (e, t) => {
290
+ F = (e, t) => {
289
291
  if (!e || !e.target) return
290
292
  e.preventDefault()
291
- const s = F(e.target)
292
- D(s, t)
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 r = s.split('=')
301
- return (t[r[0]] = r[1]), 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: r, window: n } = t,
305
- { host: o, pathname: a, search: h } = n.location,
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(h),
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), r(T, c)
315
+ s.store('route').update(c), n($, c)
314
316
  },
315
317
  B = (e) => {
316
318
  const { subscribe: t } = e
317
- t(M, P)
318
- },
319
- U = (e) => {
320
- const { publish: t, subscribe: s, state: r, window: n } = e
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
- setTimeout(() => e.publish(m, null), 0)
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
- U(e), B(e), V(e)
329
+ setTimeout(() => e.publish(m, null), 0)
330
+ },
331
+ R = (e) => {
332
+ V(e), B(e), K(e)
328
333
  },
329
- Nt = /* @__PURE__ */ Object.freeze(
334
+ wt = /* @__PURE__ */ Object.freeze(
330
335
  /* @__PURE__ */ Object.defineProperty(
331
336
  {
332
337
  __proto__: null,
333
- publishLocation: V,
334
- startNavigation: K,
335
- subscribeToHistoryChange: U,
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 R {
347
+ class U {
343
348
  constructor({
344
349
  window: t,
345
350
  document: s,
346
- publish: r,
347
- subscribe: n,
351
+ publish: n,
352
+ subscribe: r,
348
353
  bus: o,
349
354
  state: a,
350
- renderKit: h,
355
+ renderKit: l,
351
356
  }) {
352
357
  ;(this.window = t),
353
358
  (this.document = s),
354
- (this.publish = r),
355
- (this.subscribe = n),
359
+ (this.publish = n),
360
+ (this.subscribe = r),
356
361
  (this.bus = o),
357
362
  (this.state = a),
358
- (this.renderKit = h),
363
+ (this.renderKit = l),
359
364
  (this.roots = [])
360
365
  }
361
366
  render(t, s) {
362
- const r = _t(t, s, this.renderKit)
363
- return this.roots.push(r), r
367
+ const n = At(t, s, this.renderKit)
368
+ return this.roots.push(n), n
364
369
  }
365
370
  startNavigation() {
366
- K(this)
371
+ R(this)
367
372
  }
368
373
  }
369
- const _e = /* @__PURE__ */ Object.freeze(
374
+ const Me = /* @__PURE__ */ Object.freeze(
370
375
  /* @__PURE__ */ Object.defineProperty(
371
376
  {
372
377
  __proto__: null,
373
- App: R,
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, r) {
388
+ add(t, s, n) {
384
389
  this.ensureArrayFor(t)
385
- const n = {
390
+ const r = {
386
391
  listener: s,
387
- index: r,
392
+ index: n,
388
393
  matcher: t,
389
394
  }
390
- return this.lookup[t].push(n), () => this.remove(n)
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, r) => (r !== t && s.push(r), 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, r) {
411
- const n = {
415
+ add(t, s, n) {
416
+ const r = {
412
417
  listener: s,
413
- index: r,
418
+ index: n,
414
419
  matcher: t,
415
420
  }
416
- return this.lookup.push(n), () => this.remove(n)
421
+ return this.lookup.push(r), () => this.remove(r)
417
422
  }
418
423
  remove(t) {
419
- this.lookup = this.lookup.reduce((s, r) => (r !== t && s.push(r), 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 r
437
+ let n
433
438
  return (
434
439
  typeof t == 'string'
435
- ? (r = this.exactSubscriptions.add(t, s, this.currentIndex))
436
- : (r = this.fuzzySubscriptions.add(t, s, this.currentIndex)),
440
+ ? (n = this.exactSubscriptions.add(t, s, this.currentIndex))
441
+ : (n = this.fuzzySubscriptions.add(t, s, this.currentIndex)),
437
442
  (this.currentIndex += 1),
438
- r
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((n, o) => n.index - o.index)
447
- .forEach((n) => {
448
- n.listener(s, this.listenerOptions(t))
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: (r, n) => e.publish(r, n),
467
- subscribe: (r, n) => e.subscribe(r, n),
471
+ publish: (n, r) => e.publish(n, r),
472
+ subscribe: (n, r) => e.subscribe(n, r),
468
473
  }
469
474
  },
470
- Se = /* @__PURE__ */ Object.freeze(
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
- g = (e) => e !== null && !f(e) && typeof e == 'object',
485
- jt = (e, t) => e === t,
486
- Ot = (e, t) => Object.keys(e).length === Object.keys(t).length,
487
- kt = (e, t) =>
488
- !(g(e) && g(t)) || !Ot(e, t)
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 r = e[s],
492
- n = t[s]
493
- return x(r, n)
496
+ const n = e[s],
497
+ r = t[s]
498
+ return x(n, r)
494
499
  }),
495
- Mt = (e, t) =>
500
+ Ot = (e, t) =>
496
501
  !(f(e) && f(t)) || e.length !== t.length
497
502
  ? !1
498
- : e.every((s, r) => {
499
- const n = t[r]
500
- return x(s, n)
503
+ : e.every((s, n) => {
504
+ const r = t[n]
505
+ return x(s, r)
501
506
  }),
502
- x = (e, t) => (g(e) ? kt(e, t) : f(e) ? Mt(e, t) : jt(e, t))
503
- class b {
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.initialState)
545
+ this.store.update(this.store.initialValue)
512
546
  }
513
547
  get value() {
514
548
  return this.store.value
515
549
  }
516
- addUpdaterFunction(t, s) {
517
- this.constructor.prototype[t] = (...r) => {
518
- const n = s(this.value, ...r)
519
- this.update(n)
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
- addUpdaterFunctions(t) {
523
- for (const s in t) this.addUpdaterFunction(s, t[s])
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
- class w extends b {
527
- addUpdaterFunction(t, s) {
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 r = [...this.value]
562
- r.splice(t, 0, s), this.update(r)
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
- addUpdaters(t) {
592
- this.updater.addUpdaterFunctions(t)
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
- addSorter(t, s) {
598
- this.updater instanceof w && this.updater.addSorter(t, s)
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
- class G extends b {
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 A = 'state'
632
- class Q {
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 = A),
628
+ (this.eventNamePrefix = _),
637
629
  (this.notifications = /* @__PURE__ */ new Set()),
638
630
  (this.inTransaction = !1)
639
631
  }
640
632
  create(t, s) {
641
- const r = new y({
633
+ const n = new g({
642
634
  name: t,
643
635
  parent: this,
644
636
  value: s,
645
637
  })
646
- return (this.stores[t] = r), r
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 y({
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, r) => ((s[r] = this.get(r)), 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 W = (e) => new Q(e),
705
- Ne = /* @__PURE__ */ Object.freeze(
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: Q,
710
- Store: y,
711
- StoreUpdaterBoolean: G,
712
- StoreUpdaterList: w,
713
- StoreUpdaterObject: C,
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 Tt {
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 R({
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: r } = H()
751
- ;(this.publish = t), (this.subscribe = s), (this.bus = r)
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 = W(this.publish)
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 je = (e = {}) => {
774
- const s = new Tt(e).setup()
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 Oe = /* @__PURE__ */ Object.freeze(
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
- $t = (e, t) => ({
779
+ zt = (e, t) => ({
802
780
  source: e,
803
781
  target: t,
804
782
  type: i.changeText,
805
783
  data: {},
806
784
  }),
807
- Ft = (e, t) => ({
785
+ Bt = (e, t) => ({
808
786
  source: e,
809
787
  target: t,
810
788
  type: i.replaceNode,
811
789
  data: {},
812
790
  }),
813
- Dt = (e, t, s) => ({
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
- Pt = (e, t, s) => ({
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
- Lt = (e, t, s) => ({
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
- zt = (e, t, s) => ({
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
- Bt = (e, t, s) => ({
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
- Ut = (e, t, s) => ({
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
- _ = (e) => ({
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
- v = (e, t) => ({
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
- Vt = (e, t, s) => ({
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
- Kt = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
870
- S = { index: -1 }
871
- class Rt {
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, r) => {
877
- const n = s.__jsx
878
- n &&
879
- ((this.map[n] = this.map[n] || []),
880
- this.map[n].push({
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: r,
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) ? S : this.map[s].shift()
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 r = this.map[s]
894
- this.map[s] = r.reduce((n, o) => (o.element !== t && n.push(o), n), [])
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 N = (e) => {
905
- const t = new Rt()
882
+ const S = (e) => {
883
+ const t = new Gt()
906
884
  return t.populate(e), t
907
885
  },
908
- X = (e, t, s = !1) => {
909
- const r = [],
910
- n = e.attributes,
911
- o = n.length,
886
+ Q = (e, t, s = !1) => {
887
+ const n = [],
888
+ r = e.attributes,
889
+ o = r.length,
912
890
  a = t.attributes,
913
- h = a.length
891
+ l = a.length
914
892
  let u, d, c
915
893
  for (u = 0; u < o; u++) {
916
894
  c = null
917
- const l = n.item(u)
918
- if (l) {
919
- for (d = 0; d < h; 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 && l.name == p.name) {
899
+ if (p && h.name == p.name) {
922
900
  c = p
923
901
  break
924
902
  }
925
903
  }
926
904
  c
927
- ? l.value !== c.value &&
928
- r.push(
929
- Lt(e, t, {
930
- name: l.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
- : r.push(Dt(e, t, { name: l.name, isSvg: s }))
913
+ : n.push(Vt(e, t, { name: h.name, isSvg: s }))
936
914
  }
937
915
  }
938
- for (u = 0; u < h; u++) {
916
+ for (u = 0; u < l; u++) {
939
917
  c = null
940
- const l = a.item(u)
941
- if (l) {
918
+ const h = a.item(u)
919
+ if (h) {
942
920
  for (d = 0; d < o; d++) {
943
- const p = n.item(d)
944
- if (p && p.name == l.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
- r.push(
951
- Pt(e, t, {
952
- name: l.name,
953
- value: l.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 r
937
+ return n
960
938
  },
961
- qt = (e, t) => {
939
+ Ct = (e, t) => {
962
940
  const s = [],
963
- r = e.eventMaps,
964
- n = t.eventMaps,
965
- o = Object.keys(r),
966
- a = Object.keys(n)
941
+ n = e.eventMaps,
942
+ r = t.eventMaps,
943
+ o = Object.keys(n),
944
+ a = Object.keys(r)
967
945
  return (
968
- o.forEach((h) => {
969
- const u = r[h],
970
- d = n[h]
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
- Ut(e, t, {
975
- name: h,
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
- zt(e, t, {
959
+ Ut(e, t, {
982
960
  name: u.domEvent,
983
961
  value: u.listener,
984
962
  }),
985
963
  )
986
964
  }),
987
- a.forEach((h) => {
988
- const u = r[h],
989
- d = n[h]
965
+ a.forEach((l) => {
966
+ const u = n[l],
967
+ d = r[l]
990
968
  u ||
991
969
  s.push(
992
- Bt(e, t, {
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
- It = (e) => e.tagName !== 'INPUT',
1002
- Jt = (e, t) => e.value === t.value,
1003
- Ht = (e, t) => {
1004
- if (It(e) || Jt(e, t)) return []
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
- r = t
1007
- return [Vt(s, r, { name: 'value', value: r.value })]
984
+ n = t
985
+ return [Jt(s, n, { name: 'value', value: n.value })]
1008
986
  },
1009
- Gt = (e, t) => {
1010
- const s = X(e, t),
1011
- r = qt(e, t),
1012
- n = Ht(e, t)
1013
- return s.concat(r).concat(n)
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
- Ct = (e, t) => X(e, t, !0),
1016
- Qt = (e, t) => (e.textContent !== t.textContent ? [$t(e, t)] : []),
1017
- Wt = (e, t, s) => {
1018
- let r = []
1019
- if (e.nodeType === 1 && at(e)) {
1020
- const n = e,
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 = Ct(n, o),
1023
- h = s(n.childNodes, o.childNodes, n)
1024
- r = a.concat(h)
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 n = e,
1004
+ const r = e,
1027
1005
  o = t,
1028
- a = Gt(n, o),
1029
- h = s(n.childNodes, o.childNodes, n)
1030
- r = a.concat(h)
1031
- } else e.nodeType === 3 && (r = Qt(e, t))
1032
- return r
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
- Y = (e, t, s) => {
1035
- const r = [],
1036
- n = Xt(e, t),
1037
- o = N(e),
1038
- a = N(t),
1039
- h = []
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 < n; u++) {
1019
+ for (; u < r; u++) {
1042
1020
  const c = e[u],
1043
- l = t[u]
1044
- if (l && a.check(l)) {
1045
- const p = o.pullMatch(l)
1046
- a.clear(l),
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
- r.push(
1050
- v(p.element, {
1027
+ n.push(
1028
+ b(p.element, {
1051
1029
  parent: s,
1052
1030
  index: u,
1053
1031
  }),
1054
1032
  ),
1055
- h.push({
1033
+ l.push({
1056
1034
  source: p.element,
1057
- target: l,
1035
+ target: h,
1058
1036
  }))
1059
1037
  : c
1060
1038
  ? a.check(c)
1061
- ? r.push(v(l, { parent: s, index: u }))
1062
- : (o.clear(c), r.push(Ft(c, l)))
1063
- : r.push(v(l, { parent: s, index: u }))
1064
- } else c && o.pullMatch(c).element && r.push(_(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))
1065
1043
  }
1066
1044
  o.remaining().forEach(({ element: c }) => {
1067
- r.push(_(c))
1045
+ n.push(w(c))
1068
1046
  })
1069
- const d = h.reduce(
1070
- (c, { source: l, target: p }) => c.concat(Wt(l, p, Y)),
1047
+ const d = l.reduce(
1048
+ (c, { source: h, target: p }) => c.concat(ee(h, p, W)),
1071
1049
  [],
1072
1050
  )
1073
- return r.concat(d).sort(Kt)
1051
+ return n.concat(d).sort(Ht)
1074
1052
  },
1075
- Xt = (e, t) => {
1053
+ se = (e, t) => {
1076
1054
  const s = e.length,
1077
- r = t.length
1078
- return s > r ? s : r
1055
+ n = t.length
1056
+ return s > n ? s : n
1079
1057
  },
1080
- Yt = (e, t, s) => {
1081
- const r = Y(e, t, s)
1058
+ ne = (e, t, s) => {
1059
+ const n = W(e, t, s)
1082
1060
  return (
1083
- r.forEach((n) => {
1084
- Zt(n)
1061
+ n.forEach((r) => {
1062
+ re(r)
1085
1063
  }),
1086
- r
1064
+ n
1087
1065
  )
1088
1066
  },
1089
- Zt = (e) => {
1090
- ;(le[e.type] || te)(e)
1067
+ re = (e) => {
1068
+ ;(be[e.type] || oe)(e)
1091
1069
  },
1092
- te = (e) => {},
1093
- ee = (e) => {
1070
+ oe = (e) => {},
1071
+ ie = (e) => {
1094
1072
  const { source: t, target: s } = e
1095
1073
  t.nodeValue = s.textContent
1096
1074
  },
1097
- se = (e) => {
1075
+ ue = (e) => {
1098
1076
  const { source: t } = e
1099
1077
  t.remove()
1100
1078
  },
1101
- re = (e) => {
1079
+ ae = (e) => {
1102
1080
  const { target: t, data: s } = e,
1103
- { parent: r, index: n } = s,
1104
- o = r.childNodes[n]
1105
- o ? o && o !== t && r.insertBefore(t, o) : r.appendChild(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
- ne = (e) => {
1085
+ ce = (e) => {
1108
1086
  const { source: t, target: s } = e
1109
1087
  t.replaceWith(s)
1110
1088
  },
1111
- oe = (e) => {
1089
+ le = (e) => {
1112
1090
  const { source: t, data: s } = e,
1113
- { name: r, isSvg: n } = s
1114
- n ? t.removeAttributeNS(null, r) : t.removeAttribute(r)
1091
+ { name: n, isSvg: r } = s
1092
+ r ? t.removeAttributeNS(null, n) : t.removeAttribute(n)
1115
1093
  },
1116
- Z = (e) => {
1094
+ X = (e) => {
1117
1095
  const { source: t, data: s } = e,
1118
- { name: r, value: n, isSvg: o } = s
1119
- o ? t.setAttributeNS(null, r, n) : t.setAttribute(r, n)
1096
+ { name: n, value: r, isSvg: o } = s
1097
+ o ? t.setAttributeNS(null, n, r) : t.setAttribute(n, r)
1120
1098
  },
1121
- ie = (e) => {
1122
- Z(e)
1099
+ he = (e) => {
1100
+ X(e)
1123
1101
  },
1124
- ue = (e) => {
1102
+ de = (e) => {
1125
1103
  const t = e.data,
1126
1104
  s = e.source,
1127
- { name: r, value: n } = t
1128
- s.removeEventListener(r, n)
1105
+ { name: n, value: r } = t
1106
+ s.removeEventListener(n, r)
1129
1107
  },
1130
- ae = (e) => {
1108
+ pe = (e) => {
1131
1109
  const t = e.data,
1132
1110
  s = e.source,
1133
- { name: r, value: n } = t
1134
- s.addEventListener(r, n)
1111
+ { name: n, value: r } = t
1112
+ s.addEventListener(n, r)
1135
1113
  },
1136
- ce = (e) => {
1114
+ me = (e) => {
1137
1115
  const t = e.data,
1138
1116
  s = e.source,
1139
- { name: r, sourceValue: n, targetValue: o } = t
1140
- s.removeEventListener(r, n), s.addEventListener(r, o)
1117
+ { name: n, sourceValue: r, targetValue: o } = t
1118
+ s.removeEventListener(n, r), s.addEventListener(n, o)
1141
1119
  },
1142
- he = (e) => {
1120
+ fe = (e) => {
1143
1121
  const t = e.data,
1144
1122
  s = e.source,
1145
- { value: r } = t
1146
- s.value = r
1123
+ { value: n } = t
1124
+ s.value = n
1147
1125
  },
1148
- le = {
1149
- [i.changeText]: ee,
1150
- [i.removeNode]: se,
1151
- [i.insertNode]: re,
1152
- [i.replaceNode]: ne,
1153
- [i.removeAttribute]: oe,
1154
- [i.addAttribute]: Z,
1155
- [i.updateAttribute]: ie,
1156
- [i.removeEvent]: ue,
1157
- [i.addEvent]: ae,
1158
- [i.updateEvent]: ce,
1159
- [i.changeValue]: he,
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
- de = (e, t, s) => {
1162
- const r = [...t]
1139
+ ve = (e, t, s) => {
1140
+ const n = [...t]
1163
1141
  return (
1164
- e.forEach((n) => {
1165
- pe(n, r, s)
1142
+ e.forEach((r) => {
1143
+ ge(r, n, s)
1166
1144
  }),
1167
- r
1145
+ n
1168
1146
  )
1169
1147
  },
1170
- pe = (e, t, s) => {
1171
- const r = ve[e.type]
1172
- r && r(e, t, s)
1148
+ ge = (e, t, s) => {
1149
+ const n = Ae[e.type]
1150
+ n && n(e, t, s)
1173
1151
  },
1174
- me = (e, t) => {
1152
+ ye = (e, t) => {
1175
1153
  const { source: s } = e,
1176
- r = t.indexOf(s)
1177
- r >= 0 && t.splice(r, 1)
1154
+ n = t.indexOf(s)
1155
+ n >= 0 && t.splice(n, 1)
1178
1156
  },
1179
- fe = (e, t, s) => {
1180
- const { target: r } = e,
1181
- n = e.data,
1182
- { index: o, parent: a } = n
1183
- s === a && t.splice(o, 0, r)
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
- be = (e, t) => {
1186
- const { target: s, source: r } = e,
1187
- n = t.indexOf(r)
1188
- n >= 0 && (t[n] = s)
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
- ve = {
1191
- [i.removeNode]: me,
1192
- [i.insertNode]: fe,
1193
- [i.replaceNode]: be,
1168
+ Ae = {
1169
+ [i.removeNode]: ye,
1170
+ [i.insertNode]: Ee,
1171
+ [i.replaceNode]: xe,
1194
1172
  }
1195
- class ge {
1196
- constructor({ Template: t, subscriptions: s, attributes: r, viewModel: n }) {
1173
+ class _e {
1174
+ constructor({ Template: t, subscriptions: s, attributes: n, viewModel: r }) {
1197
1175
  ;(this.Template = t),
1198
- (this.viewModel = n),
1199
- (this.attributes = r),
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
- r = this.Template(s)
1219
- return r ? r.render(t) : []
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 r = this.dom[0].parentElement
1224
- this.parentElement = r
1201
+ const n = this.dom[0].parentElement
1202
+ this.parentElement = n
1225
1203
  }
1226
1204
  const t = this.generateDom(this.renderKit),
1227
- s = Yt(this.dom, t, this.parentElement)
1228
- this.dom = de(s, this.dom, this.parentElement)
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 `${A}:${t}`
1215
+ return `${_}:${t}`
1238
1216
  }
1239
1217
  }
1240
- const ye = (e) => e,
1241
- Ee = ({ Template: e, viewModel: t, subscriptions: s }) => (
1218
+ const we = (e) => e,
1219
+ Ne = ({ Template: e, viewModel: t, subscriptions: s }) => (
1242
1220
  (s = s || []),
1243
- (t = t || ye),
1244
- (r) =>
1245
- new ge({ Template: e, viewModel: t, subscriptions: s, attributes: r })
1221
+ (t = t || we),
1222
+ (n) =>
1223
+ new _e({ Template: e, viewModel: t, subscriptions: s, attributes: n })
1246
1224
  ),
1247
- ke = /* @__PURE__ */ Object.freeze(
1225
+ Pe = /* @__PURE__ */ Object.freeze(
1248
1226
  /* @__PURE__ */ Object.defineProperty(
1249
1227
  {
1250
1228
  __proto__: null,
1251
- createRouteState: $,
1252
- events: St,
1229
+ createRouteState: D,
1230
+ events: _t,
1253
1231
  extractQueryParams: L,
1254
- findHref: F,
1255
- navigate: D,
1256
- onLinkClick: P,
1232
+ findHref: P,
1233
+ navigate: E,
1234
+ onLinkClick: F,
1257
1235
  onLocationChange: z,
1258
- start: Nt,
1236
+ start: wt,
1259
1237
  },
1260
1238
  Symbol.toStringTag,
1261
1239
  { value: 'Module' },
1262
1240
  ),
1263
1241
  ),
1264
- xe =
1242
+ Se =
1265
1243
  (e) =>
1266
1244
  ({ path: t }) =>
1267
1245
  t === e,
1268
- we = () => !0,
1269
- tt =
1246
+ je = () => !0,
1247
+ Y =
1270
1248
  (e) =>
1271
1249
  ({ route: t }) => {
1272
- const s = e.find((r) => r.match(t))
1250
+ const s = e.find((n) => n.match(t))
1273
1251
  return s && s.Partial
1274
1252
  },
1275
- Me = /* @__PURE__ */ Object.freeze(
1253
+ Fe = /* @__PURE__ */ Object.freeze(
1276
1254
  /* @__PURE__ */ Object.defineProperty(
1277
1255
  {
1278
1256
  __proto__: null,
1279
- buildRouter: tt,
1280
- catchAll: we,
1281
- exactPathMatch: xe,
1257
+ buildRouter: Y,
1258
+ catchAll: je,
1259
+ exactPathMatch: Se,
1282
1260
  },
1283
1261
  Symbol.toStringTag,
1284
1262
  { value: 'Module' },
1285
1263
  ),
1286
1264
  ),
1287
- Ae = () => ({
1265
+ Oe = () => ({
1288
1266
  render: (e, t) => [],
1289
1267
  }),
1290
- Te = (e) => {
1291
- const t = tt(e)
1292
- return Ee({
1293
- Template: ({ route: r }) => (t({ route: r }) || Ae)(),
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
- Oe as JaxsTypes,
1299
- _e as appBuilding,
1300
- Ee as bind,
1301
- je as createApp,
1302
- wt as jsx,
1303
- Se as messageBus,
1304
- ke as navigation,
1305
- Te as routedView,
1306
- Me as routing,
1307
- Ne as state,
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
  }