jaxs 0.7.1 → 0.7.3

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