@yoyaflow/yoya-ui 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/yoya.ssr.js CHANGED
@@ -1,16 +1,63 @@
1
1
  //#region src/core/node.js
2
- function e(e) {
2
+ var e = /* @__PURE__ */ new Set([
3
+ "checked",
4
+ "disabled",
5
+ "readonly",
6
+ "selected"
7
+ ]), t = /* @__PURE__ */ new Set([
8
+ "area",
9
+ "base",
10
+ "br",
11
+ "col",
12
+ "embed",
13
+ "hr",
14
+ "img",
15
+ "input",
16
+ "link",
17
+ "meta",
18
+ "param",
19
+ "source",
20
+ "track",
21
+ "wbr"
22
+ ]);
23
+ function n(e) {
3
24
  return typeof e == "string" ? document.querySelector(e) : e;
4
25
  }
5
- function t(e) {
26
+ function r(e) {
6
27
  return String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
7
28
  }
8
- var n = class t {
29
+ function i(t) {
30
+ return e.has(t);
31
+ }
32
+ function a(e, t, n) {
33
+ if (n == null || n === !1) {
34
+ if (e.removeAttribute(t), t in e) try {
35
+ e[t] = !1;
36
+ } catch {}
37
+ return;
38
+ }
39
+ if (n === !0 || i(t)) {
40
+ if (e.setAttribute(t, t), t in e) try {
41
+ e[t] = !0;
42
+ } catch {}
43
+ return;
44
+ }
45
+ if (e.setAttribute(t, String(n)), t in e) try {
46
+ e[t] = n;
47
+ } catch {}
48
+ }
49
+ function o(e) {
50
+ return Object.entries(e).filter(([, e]) => e != null && e !== "").map(([e, t]) => `${s(e)}:${r(t)}`).join("; ");
51
+ }
52
+ function s(e) {
53
+ return String(e).replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
54
+ }
55
+ var c = class e {
9
56
  constructor(e = null) {
10
57
  this._children = [], this._events = /* @__PURE__ */ new Map(), this._cleanup = [], this._states = {}, this._stateTypes = {}, this._stateHandlers = /* @__PURE__ */ new Map(), this._pendingRemovals = /* @__PURE__ */ new Set(), this._childrenDirty = !1, this._deleted = !1, e !== null && this.setup(e);
11
58
  }
12
- setup(e) {
13
- return typeof e == "function" ? e(this) : e instanceof t ? this.child(e) : typeof e == "string" || typeof e == "number" ? this.text(e) : e && typeof e == "object" && this._setupObject(e), this;
59
+ setup(t) {
60
+ return typeof t == "function" ? t(this) : t instanceof e ? this.child(t) : typeof t == "string" || typeof t == "number" ? this.text(t) : t && typeof t == "object" && this._setupObject(t), this;
14
61
  }
15
62
  _setupObject(e) {
16
63
  e.children && this.child(e.children);
@@ -26,12 +73,12 @@ var n = class t {
26
73
  child(...e) {
27
74
  return e.flat(Infinity).forEach((e) => {
28
75
  if (e == null) return;
29
- let t = a(e);
76
+ let t = f(e);
30
77
  this._pendingRemovals.delete(t), this._children.push(t), this._childrenDirty = !0;
31
78
  }), this;
32
79
  }
33
80
  text(e) {
34
- return this.child(new r(e));
81
+ return this.child(new l(e));
35
82
  }
36
83
  on(e, t, n) {
37
84
  return this._events.has(e) || this._events.set(e, []), this._events.get(e).push({
@@ -79,9 +126,9 @@ var n = class t {
79
126
  _commitChildren() {
80
127
  this._pendingRemovals.forEach((e) => e.destroy()), this._pendingRemovals.clear(), this._childrenDirty = !1;
81
128
  }
82
- bindTo(t) {
83
- let n = e(t), r = this.renderDom();
84
- return n && r && n.appendChild(r), this;
129
+ bindTo(e) {
130
+ let t = n(e), r = this.renderDom();
131
+ return t && r && t.appendChild(r), this;
85
132
  }
86
133
  destroy() {
87
134
  return this._deleted = !0, this._cleanup.forEach((e) => e()), this._cleanup = [], this._children.forEach((e) => e.destroy()), this._pendingRemovals.forEach((e) => e.destroy()), this._pendingRemovals.clear(), this._children = [], this._el?.parentNode && this._el.parentNode.removeChild(this._el), this;
@@ -92,7 +139,7 @@ var n = class t {
92
139
  hydrateSnapshot() {
93
140
  return this;
94
141
  }
95
- }, r = class extends n {
142
+ }, l = class extends c {
96
143
  constructor(e = "") {
97
144
  super(null), this._content = String(e), this._textNode = null;
98
145
  }
@@ -103,16 +150,16 @@ var n = class t {
103
150
  return this._deleted ? null : (this._textNode || (this._textNode = document.createTextNode(this._content), this._el = this._textNode), this._textNode);
104
151
  }
105
152
  toHTML() {
106
- return this._deleted ? "" : t(this._content);
153
+ return this._deleted ? "" : r(this._content);
107
154
  }
108
- }, i = class extends n {
155
+ }, u = class extends c {
109
156
  constructor(e) {
110
157
  super(null), this._component = e, this._resolved = null;
111
158
  }
112
159
  _resolve() {
113
160
  if (this._resolved) return this._resolved;
114
161
  let e = typeof this._component == "function" ? this._component() : this._component.render();
115
- if (!(e instanceof n)) throw TypeError("Component render must return a ViewNode");
162
+ if (!(e instanceof c)) throw TypeError("Component render must return a ViewNode");
116
163
  return this._resolved = e, e;
117
164
  }
118
165
  children() {
@@ -134,36 +181,1242 @@ var n = class t {
134
181
  return this._resolved && this._resolved.destroy(), super.destroy();
135
182
  }
136
183
  };
137
- function a(e) {
138
- if (e instanceof n) return e;
139
- if (typeof e == "function" || e && typeof e == "object" && typeof e.render == "function") return new i(e);
140
- if (typeof e == "string" || typeof e == "number") return new r(e);
184
+ function d(e = "") {
185
+ return new l(e);
186
+ }
187
+ function f(e) {
188
+ if (e instanceof c) return e;
189
+ if (typeof e == "function" || e && typeof e == "object" && typeof e.render == "function") return new u(e);
190
+ if (typeof e == "string" || typeof e == "number") return new l(e);
141
191
  throw TypeError("ViewNode child must be a ViewNode, component, string, or number");
142
192
  }
193
+ function p(e = null, t = null, n = null) {
194
+ return typeof t == "function" && n == null ? {
195
+ first: e,
196
+ options: null,
197
+ callback: t
198
+ } : {
199
+ first: e,
200
+ options: t,
201
+ callback: n
202
+ };
203
+ }
204
+ function m(e, t) {
205
+ return !t || typeof t != "object" || Array.isArray(t) ? e : (t.attrs && typeof e.attr == "function" && e.attr(t.attrs), t.style && typeof e.styles == "function" && e.styles(t.style), e);
206
+ }
207
+ var h = class extends c {
208
+ constructor(e, t = null) {
209
+ super(null), this._tagName = e, this._attrs = {}, this._styles = {}, this._classes = /* @__PURE__ */ new Set(), this._el = null, t !== null && this.setup(t);
210
+ }
211
+ _setupObject(e) {
212
+ Object.entries(e).forEach(([e, t]) => {
213
+ if (e === "class" || e === "className") {
214
+ this.className(t);
215
+ return;
216
+ }
217
+ if (e === "attrs") {
218
+ this.attr(t);
219
+ return;
220
+ }
221
+ if (e === "style") {
222
+ this.styles(t);
223
+ return;
224
+ }
225
+ if (e === "children") {
226
+ this.child(t);
227
+ return;
228
+ }
229
+ if (e.startsWith("on") && typeof t == "function") {
230
+ this.on(e.slice(2).toLowerCase(), t);
231
+ return;
232
+ }
233
+ if (typeof this[e] == "function") {
234
+ this[e](t);
235
+ return;
236
+ }
237
+ typeof t != "function" && this.attr(e, t);
238
+ });
239
+ }
240
+ tagName() {
241
+ return this._tagName;
242
+ }
243
+ textContent() {
244
+ return this._children.map((e) => typeof e.textContent == "function" ? e.textContent() : "").join("");
245
+ }
246
+ attr(e, t) {
247
+ return t === void 0 && typeof e == "string" ? this._attrs[e] : e && typeof e == "object" ? (Object.entries(e).forEach(([e, t]) => this.attr(e, t)), this) : (t == null || t === !1 ? delete this._attrs[e] : this._attrs[e] = t, this._el && a(this._el, e, t), this);
248
+ }
249
+ id(e) {
250
+ return e === void 0 ? this.attr("id") : this.attr("id", e);
251
+ }
252
+ name(e) {
253
+ return e === void 0 ? this.attr("name") : this.attr("name", e);
254
+ }
255
+ className(...e) {
256
+ return e.length === 0 ? [...this._classes].join(" ") : (e.flat(Infinity).forEach((e) => {
257
+ e && String(e).split(/\s+/).filter(Boolean).forEach((e) => this._classes.add(e));
258
+ }), this._syncClassName(), this);
259
+ }
260
+ class(...e) {
261
+ return this.className(...e);
262
+ }
263
+ replaceClassName(e, t, n = !1) {
264
+ return !e || !t || e === t ? this : this._classes.has(e) ? (this._classes.delete(e), this.className(t)) : n ? this.className(t) : this;
265
+ }
266
+ style(e, t) {
267
+ return t === void 0 && typeof e == "string" ? this._styles[e] : e && typeof e == "object" ? this.styles(e) : (t == null || t === "" ? delete this._styles[e] : this._styles[e] = t, this._el && (this._el.style[e] = t || ""), this);
268
+ }
269
+ styles(e) {
270
+ return Object.entries(e || {}).forEach(([e, t]) => this.style(e, t)), this;
271
+ }
272
+ child(...e) {
273
+ return e.flat(Infinity).forEach((e) => {
274
+ if (e == null) return;
275
+ let t = f(e);
276
+ if (this._pendingRemovals.delete(t), this._children.push(t), this._childrenDirty = !0, this._el) {
277
+ let e = t.renderDom();
278
+ e && e.parentNode !== this._el && this._el.appendChild(e);
279
+ }
280
+ }), this;
281
+ }
282
+ renderDom() {
283
+ return this._deleted ? null : (this._el || (this._el = document.createElement(this._tagName), this._applySnapshotToElement()), this._commitChildren(), this._children.forEach((e) => {
284
+ let t = e.renderDom();
285
+ t && t.parentNode !== this._el && this._el.appendChild(t);
286
+ }), this._el);
287
+ }
288
+ toHTML() {
289
+ if (this._deleted) return "";
290
+ let e = this._serializeAttributes(), n = e ? `<${this._tagName} ${e}>` : `<${this._tagName}>`;
291
+ return t.has(this._tagName) ? n : `${n}${this._children.map((e) => e.toHTML()).join("")}</${this._tagName}>`;
292
+ }
293
+ _applyBindingsToElement() {
294
+ Object.entries(this._attrs).forEach(([e, t]) => a(this._el, e, t)), this._syncClassName(), Object.entries(this._styles).forEach(([e, t]) => {
295
+ this._el.style[e] = t;
296
+ }), this._events.forEach((e, t) => {
297
+ e.forEach(({ handler: e, options: n }) => {
298
+ this._el.addEventListener(t, e, n), this._cleanup.push(() => this._el.removeEventListener(t, e, n));
299
+ });
300
+ });
301
+ }
302
+ _applySnapshotToElement() {
303
+ this._applyBindingsToElement(), this._children.forEach((e) => {
304
+ let t = e.renderDom();
305
+ t && this._el.appendChild(t);
306
+ });
307
+ }
308
+ _syncClassName() {
309
+ let e = [...this._classes].join(" ");
310
+ e ? this._attrs.class = e : delete this._attrs.class, this._el && (e ? this._el.className = e : this._el.removeAttribute("class"));
311
+ }
312
+ _serializeAttributes() {
313
+ let e = { ...this._attrs }, t = this._serializeStyles();
314
+ return t && (e.style = e.style ? `${e.style}; ${t}` : t), Object.entries(e).filter(([, e]) => e != null && e !== !1).map(([e, t]) => t === !0 || i(e) ? `${e}="${e}"` : `${e}="${r(t)}"`).join(" ");
315
+ }
316
+ _serializeStyles() {
317
+ return o(this._styles);
318
+ }
319
+ };
320
+ function g(e, t = h) {
321
+ return function(n = null, r = null, i = null) {
322
+ let a = p(n, r, i), o = new t(e, a.first);
323
+ return m(o, a.options), typeof a.callback == "function" && a.callback(o), o;
324
+ };
325
+ }
326
+ function _(e, t, n = {}) {
327
+ let { override: r = !1 } = n;
328
+ Object.entries(t).forEach(([t, n]) => {
329
+ !r && e.prototype[t] || (e.prototype[t] = function(...e) {
330
+ return this.child(n(...e));
331
+ });
332
+ });
333
+ }
143
334
  //#endregion
144
- //#region src/core/id.js
145
- var o = null;
146
- function s() {
147
- let e = 0;
148
- return { next() {
149
- return e += 1, e;
150
- } };
335
+ //#region src/html/index.js
336
+ var v = class extends h {}, y = [
337
+ "a",
338
+ "abbr",
339
+ "address",
340
+ "area",
341
+ "article",
342
+ "aside",
343
+ "audio",
344
+ "b",
345
+ "base",
346
+ "bdi",
347
+ "bdo",
348
+ "blockquote",
349
+ "body",
350
+ "br",
351
+ "button",
352
+ "canvas",
353
+ "caption",
354
+ "cite",
355
+ "code",
356
+ "col",
357
+ "colgroup",
358
+ "data",
359
+ "datalist",
360
+ "dd",
361
+ "del",
362
+ "details",
363
+ "dfn",
364
+ "dialog",
365
+ "div",
366
+ "dl",
367
+ "dt",
368
+ "em",
369
+ "embed",
370
+ "fieldset",
371
+ "figcaption",
372
+ "figure",
373
+ "footer",
374
+ "form",
375
+ "h1",
376
+ "h2",
377
+ "h3",
378
+ "h4",
379
+ "h5",
380
+ "h6",
381
+ "head",
382
+ "header",
383
+ "hgroup",
384
+ "hr",
385
+ "html",
386
+ "i",
387
+ "iframe",
388
+ "img",
389
+ "input",
390
+ "ins",
391
+ "kbd",
392
+ "label",
393
+ "legend",
394
+ "li",
395
+ "link",
396
+ "main",
397
+ "map",
398
+ "mark",
399
+ "menu",
400
+ "meta",
401
+ "meter",
402
+ "nav",
403
+ "noscript",
404
+ "object",
405
+ "ol",
406
+ "optgroup",
407
+ "option",
408
+ "output",
409
+ "p",
410
+ "picture",
411
+ "pre",
412
+ "progress",
413
+ "q",
414
+ "rp",
415
+ "rt",
416
+ "ruby",
417
+ "s",
418
+ "samp",
419
+ "script",
420
+ "search",
421
+ "section",
422
+ "select",
423
+ "selectedcontent",
424
+ "slot",
425
+ "small",
426
+ "source",
427
+ "span",
428
+ "strong",
429
+ {
430
+ name: "style",
431
+ tagName: "style",
432
+ aliases: ["styleTag"]
433
+ },
434
+ "sub",
435
+ "summary",
436
+ "sup",
437
+ "table",
438
+ "tbody",
439
+ "td",
440
+ "template",
441
+ "textarea",
442
+ "tfoot",
443
+ "th",
444
+ "thead",
445
+ "time",
446
+ "title",
447
+ "tr",
448
+ "track",
449
+ "u",
450
+ "ul",
451
+ {
452
+ name: "varTag",
453
+ tagName: "var"
454
+ },
455
+ "video",
456
+ "wbr"
457
+ ];
458
+ function b() {
459
+ return y.reduce((e, t) => {
460
+ let { aliases: n = [], name: r, tagName: i } = en(t), a = g(i, v);
461
+ return e[r] = a, n.forEach((t) => {
462
+ e[t] = a;
463
+ }), e;
464
+ }, {});
151
465
  }
152
- function c(e, t) {
153
- let n = o;
154
- o = e;
155
- try {
156
- return t();
157
- } finally {
158
- o = n;
466
+ var x = b();
467
+ _(v, x);
468
+ var { a: S, abbr: ee, address: te, area: C, article: w, aside: T, audio: E, b: D, base: ne, bdi: re, bdo: ie, blockquote: ae, body: oe, br: se, button: ce, canvas: le, caption: ue, cite: de, code: fe, col: pe, colgroup: me, data: he, datalist: ge, dd: _e, del: ve, details: ye, dfn: be, dialog: xe, div: Se, dl: Ce, dt: we, em: Te, embed: Ee, fieldset: De, figcaption: Oe, figure: ke, footer: Ae, form: je, h1: Me, h2: Ne, h3: Pe, h4: Fe, h5: Ie, h6: Le, head: Re, header: ze, hgroup: Be, hr: Ve, html: He, i: Ue, iframe: We, img: Ge, input: Ke, ins: qe, kbd: Je, label: Ye, legend: Xe, li: Ze, link: Qe, main: $e, map: et, mark: tt, menu: nt, meta: rt, meter: it, nav: at, noscript: ot, object: st, ol: ct, optgroup: lt, option: ut, output: dt, p: ft, picture: pt, pre: mt, progress: ht, q: gt, rp: _t, rt: vt, ruby: yt, s: bt, samp: xt, script: St, search: Ct, section: wt, select: Tt, selectedcontent: Et, slot: Dt, small: Ot, source: kt, span: At, strong: jt, style: Mt, styleTag: Nt, sub: Pt, summary: Ft, sup: It, table: Lt, tbody: Rt, td: zt, template: Bt, textarea: Vt, tfoot: Ht, th: Ut, thead: Wt, time: Gt, title: Kt, tr: qt, track: Jt, u: Yt, ul: Xt, varTag: Zt, video: Qt, wbr: $t } = x;
469
+ function en(e) {
470
+ return typeof e == "string" ? {
471
+ name: e,
472
+ tagName: e
473
+ } : e;
474
+ }
475
+ //#endregion
476
+ //#region src/svg/index.js
477
+ var tn = "http://www.w3.org/2000/svg", nn = /* @__PURE__ */ new Set([
478
+ "desc",
479
+ "metadata",
480
+ "text",
481
+ "textPath",
482
+ "title",
483
+ "tspan"
484
+ ]), rn = class e extends h {
485
+ setup(e) {
486
+ return typeof e == "string" || typeof e == "number" ? this.child(e) : super.setup(e);
487
+ }
488
+ text(...e) {
489
+ if (nn.has(this._tagName)) {
490
+ let [t, n] = e;
491
+ return e.length > 0 && this.child(t), n != null && this.setup(n), this;
492
+ }
493
+ return this._svgChild("text", ...e);
494
+ }
495
+ style(...e) {
496
+ let [t, n] = e;
497
+ return this._tagName === "style" && e.length <= 1 ? (e.length === 1 && this.child(t), this) : e.length <= 1 && an(t) ? this._svgChild("style", t) : super.style(t, n);
498
+ }
499
+ renderDom() {
500
+ return this._deleted ? null : (this._el || (this._el = document.createElementNS(tn, this._tagName), this._applySnapshotToElement()), this._el);
501
+ }
502
+ _syncClassName() {
503
+ let e = [...this._classes].join(" ");
504
+ e ? this._attrs.class = e : delete this._attrs.class, this._el && (e ? this._el.setAttribute("class", e) : this._el.removeAttribute("class"));
505
+ }
506
+ _svgChild(t, ...n) {
507
+ let r = new e(t);
508
+ return n.forEach((e) => {
509
+ e != null && r.setup(e);
510
+ }), this.child(r);
511
+ }
512
+ };
513
+ function an(e) {
514
+ return e == null || typeof e == "function" || typeof e == "string" || typeof e == "number" || Array.isArray(e);
515
+ }
516
+ var on = /* @__PURE__ */ "animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.a.script.style.switch.text.title.symbol.textPath.tspan.use.view".split(".");
517
+ function sn(e) {
518
+ return function(...t) {
519
+ let n = new rn(e);
520
+ return e === "svg" && n.style("display", "block"), t.forEach((e) => {
521
+ e != null && n.setup(e);
522
+ }), n;
523
+ };
524
+ }
525
+ function cn() {
526
+ return on.reduce((e, t) => {
527
+ let { aliases: n = [], name: r, tagName: i } = dn(t), a = sn(i);
528
+ return e[r] = a, n.forEach((t) => {
529
+ e[t] = a;
530
+ }), e;
531
+ }, {});
532
+ }
533
+ var ln = sn("svg"), un = cn();
534
+ _(v, { svg: ln }), _(rn, {
535
+ svg: ln,
536
+ ...un
537
+ });
538
+ function dn(e) {
539
+ return typeof e == "string" ? {
540
+ name: e,
541
+ tagName: e
542
+ } : e;
543
+ }
544
+ //#endregion
545
+ //#region src/svg/icons.js
546
+ function fn() {
547
+ return ln((e) => {
548
+ e.className("yoya-icon").attr({
549
+ "aria-hidden": "true",
550
+ fill: "none",
551
+ stroke: "currentColor",
552
+ "stroke-linecap": "round",
553
+ "stroke-linejoin": "round",
554
+ "stroke-width": "2",
555
+ viewBox: "0 0 24 24"
556
+ }).styles({
557
+ height: "24px",
558
+ width: "24px"
559
+ }), e.path({ d: "M4 6h16" }), e.path({ d: "M4 12h16" }), e.path({ d: "M4 18h16" });
560
+ });
561
+ }
562
+ //#endregion
563
+ //#region src/components/shared.js
564
+ var pn = "yoya-component";
565
+ function O(e, t) {
566
+ return `var(--yoya-${e}, ${t})`;
567
+ }
568
+ function k(e, t, n = "1px") {
569
+ return `${n} solid ${O(e, t)}`;
570
+ }
571
+ function A(e = null, t = null, n = null) {
572
+ return p(e, t, n);
573
+ }
574
+ function mn(e, t) {
575
+ return typeof e.attr == "function" || typeof e.styles == "function" ? m(e, t) : (typeof e.render == "function" && m(e.render(), t), e);
576
+ }
577
+ function j(e, t = null, n = null) {
578
+ return mn(e, t), typeof n == "function" && n(e), e;
579
+ }
580
+ function hn(e, t = null, n = null, r = null) {
581
+ let { first: i, options: a, callback: o } = A(t, n, r);
582
+ return j(i instanceof e ? i : new e(i), a, o);
583
+ }
584
+ function gn(e, t) {
585
+ return t == null ? e : typeof t == "function" ? (t(e), e) : t instanceof c || Array.isArray(t) || typeof t == "string" || typeof t == "number" ? (e.child(t), e) : (vn(t) && e.setup(t), e);
586
+ }
587
+ function _n(e) {
588
+ return e == null ? [] : Array.isArray(e) ? e : [e];
589
+ }
590
+ function M(e, t) {
591
+ return e.children().forEach((e) => e.destroy()), e._children = [], e._el && e._el.replaceChildren(), t.length > 0 && e.child(t), e;
592
+ }
593
+ function vn(e) {
594
+ if (Object.prototype.toString.call(e) !== "[object Object]") return !1;
595
+ let t = Object.getPrototypeOf(e);
596
+ return t === Object.prototype || t === null;
597
+ }
598
+ //#endregion
599
+ //#region src/layout/split-panel.js
600
+ var yn = class extends v {
601
+ constructor(e = null, t = null, n = null) {
602
+ super("div", null), this.className(pn, "yoya-vsplit-panel"), this.styles({
603
+ boxSizing: "border-box",
604
+ display: "flex",
605
+ minHeight: "0",
606
+ minWidth: "0",
607
+ overflow: "hidden",
608
+ width: "100%"
609
+ }), this._direction = "horizontal", this._firstSize = "50%", this._minSize = 40, this._drag = null, this._dragMove = null, this._dragUp = null, this._first = new v("div").className("yoya-vsplit-panel-first").attr("data-vsplit-first", "true").styles({
610
+ boxSizing: "border-box",
611
+ minHeight: "0",
612
+ minWidth: "0",
613
+ overflow: "auto"
614
+ }), this._second = new v("div").className("yoya-vsplit-panel-second").attr("data-vsplit-second", "true").styles({
615
+ boxSizing: "border-box",
616
+ flex: "1 1 auto",
617
+ minHeight: "0",
618
+ minWidth: "0",
619
+ overflow: "auto"
620
+ }), this._divider = new v("div").className("yoya-vsplit-panel-divider").attr({
621
+ "aria-orientation": "horizontal",
622
+ "data-vsplit-divider": "true",
623
+ role: "separator",
624
+ tabindex: "0",
625
+ title: "拖拽调整面板大小,双击恢复 50%"
626
+ }).styles({
627
+ background: "transparent",
628
+ boxSizing: "border-box",
629
+ flex: "0 0 auto"
630
+ }).on("mousedown", (e) => this._startDrag(e)).on("dblclick", () => this.reset()).on("keydown", (e) => this._handleKeydown(e)).on("mouseenter", () => this._hoverDivider(!0)).on("mouseleave", () => this._hoverDivider(!1)), this.child(this._first, this._divider, this._second), this._sync(), this._setupSplitPanel(e), j(this, t, n);
631
+ }
632
+ direction(e) {
633
+ return e === void 0 ? this._direction : (this._direction = e === "vertical" ? "vertical" : "horizontal", this._sync(), this);
634
+ }
635
+ size(e) {
636
+ return e === void 0 ? this._firstSize : (this._firstSize = xn(e), this._sync(), this);
637
+ }
638
+ minSize(e) {
639
+ if (e === void 0) return this._minSize;
640
+ let t = Number(e);
641
+ return this._minSize = Number.isFinite(t) ? Math.max(0, t) : this._minSize, this;
642
+ }
643
+ reset() {
644
+ return this.size("50%");
645
+ }
646
+ first(e) {
647
+ return M(this._first, []), typeof e == "function" ? e(this._first) : M(this._first, _n(e)), this;
648
+ }
649
+ second(e) {
650
+ return M(this._second, []), typeof e == "function" ? e(this._second) : M(this._second, _n(e)), this;
651
+ }
652
+ destroy() {
653
+ return this._endDrag(), super.destroy();
654
+ }
655
+ _sync() {
656
+ let e = this._direction === "horizontal";
657
+ return this.style("flexDirection", e ? "row" : "column"), this._first.styles({
658
+ flex: "0 0 auto",
659
+ height: e ? "100%" : this._firstSize,
660
+ width: e ? this._firstSize : "100%"
661
+ }), this._divider.styles(e ? {
662
+ cursor: "col-resize",
663
+ height: "100%",
664
+ width: "6px"
665
+ } : {
666
+ cursor: "row-resize",
667
+ height: "6px",
668
+ width: "100%"
669
+ }), this._divider.attr("aria-orientation", e ? "horizontal" : "vertical"), this;
670
+ }
671
+ _hoverDivider(e) {
672
+ this._divider.style("background", e ? O("color-primary-subtle", "#eff6ff") : "var(--yoya-color-border-faint, #efefef)");
673
+ }
674
+ _startDrag(e) {
675
+ if (e.button !== 0 || !this._el) return;
676
+ e.preventDefault();
677
+ let t = this._direction === "horizontal", n = this._first._el.getBoundingClientRect(), r = t ? e.clientX : e.clientY, i = t ? n.width : n.height, a = t ? this._el.offsetWidth : this._el.offsetHeight;
678
+ this._drag = {
679
+ containerSize: a,
680
+ start: r,
681
+ startSize: i
682
+ }, this._dragMove = (e) => this._onDrag(e), this._dragUp = () => this._endDrag(), document.addEventListener("mousemove", this._dragMove), document.addEventListener("mouseup", this._dragUp);
683
+ }
684
+ _onDrag(e) {
685
+ if (!this._drag) return;
686
+ let t = (this._direction === "horizontal" ? e.clientX : e.clientY) - this._drag.start, n = Sn(this._drag.startSize + t, this._minSize, this._drag.containerSize - this._minSize);
687
+ this._firstSize = `${Math.round(n)}px`, this._sync();
688
+ }
689
+ _handleKeydown(e) {
690
+ let t = e.key === "ArrowLeft" || e.key === "ArrowUp" ? -16 : e.key === "ArrowRight" || e.key === "ArrowDown" ? 16 : 0;
691
+ if (!t || !this._el) return;
692
+ e.preventDefault();
693
+ let n = this._direction === "horizontal" ? this._el.offsetWidth : this._el.offsetHeight, r = Sn((Number.parseFloat(this._firstSize) || 0) + t, this._minSize, n - this._minSize);
694
+ this._firstSize = `${Math.round(r)}px`, this._sync();
695
+ }
696
+ _endDrag() {
697
+ this._dragMove &&= (document.removeEventListener("mousemove", this._dragMove), null), this._dragUp &&= (document.removeEventListener("mouseup", this._dragUp), null), this._drag = null;
698
+ }
699
+ _setupSplitPanel(e) {
700
+ if (e != null) {
701
+ if (typeof e == "function") {
702
+ e(this);
703
+ return;
704
+ }
705
+ if (vn(e)) {
706
+ let { direction: t, first: n, minSize: r, second: i, size: a, ...o } = e;
707
+ Object.keys(o).length > 0 && this.setup(o), t !== void 0 && this.direction(t), a !== void 0 && this.size(a), r !== void 0 && this.minSize(r), n !== void 0 && this.first(n), i !== void 0 && this.second(i);
708
+ return;
709
+ }
710
+ this.first(e);
711
+ }
712
+ }
713
+ };
714
+ function bn(e = null, t = null, n = null) {
715
+ return hn(yn, e, t, n);
716
+ }
717
+ _(v, { vSplitPanel: bn });
718
+ function xn(e) {
719
+ return typeof e == "number" ? `${e}px` : e;
720
+ }
721
+ function Sn(e, t, n) {
722
+ return Number.isNaN(e) ? t : Math.min(Math.max(e, t), Math.max(n, t));
723
+ }
724
+ //#endregion
725
+ //#region src/layout/masonry.js
726
+ var Cn = class extends v {
727
+ constructor(e = null) {
728
+ super("div", null), this._columns = 3, this._gap = 16, this._minColumnWidth = null, this.className(pn, "yoya-vmasonry"), this.attr({ "data-columns": "3" }), this.styles({
729
+ boxSizing: "border-box",
730
+ columnCount: "3",
731
+ columnGap: "16px",
732
+ width: "100%"
733
+ }), this._setupMasonry(e), this._syncLayout();
734
+ }
735
+ columns(e) {
736
+ if (e === void 0) return this._columns;
737
+ let t = Math.floor(Number(e));
738
+ return this._columns = Number.isFinite(t) && t >= 1 ? t : 3, this.attr("data-columns", String(this._columns)), this._syncLayout(), this;
739
+ }
740
+ gap(e) {
741
+ if (e === void 0) return this._gap;
742
+ let t = Number(e);
743
+ return this._gap = Number.isFinite(t) && t >= 0 ? t : 16, this._syncLayout(), this;
744
+ }
745
+ minColumnWidth(e) {
746
+ if (e === void 0) return this._minColumnWidth;
747
+ let t = Number(e);
748
+ return this._minColumnWidth = Number.isFinite(t) && t > 0 ? t : null, this._syncLayout(), this;
749
+ }
750
+ _syncLayout() {
751
+ this._minColumnWidth ? (this.style("columnCount", "auto"), this.style("columnWidth", `${this._minColumnWidth}px`), this.attr("data-column-mode", "responsive")) : (this.style("columnCount", String(this._columns)), this.style("columnWidth", "auto"), this.attr("data-column-mode", null)), this.style("columnGap", `${this._gap}px`), this.style("--yoya-masonry-gap", `${this._gap}px`);
752
+ }
753
+ _setupMasonry(e) {
754
+ if (e != null) {
755
+ if (typeof e == "function") {
756
+ e(this);
757
+ return;
758
+ }
759
+ if (vn(e)) {
760
+ let { columns: t, gap: n, minColumnWidth: r, ...i } = e;
761
+ Object.keys(i).length > 0 && this.setup(i), t !== void 0 && this.columns(t), n !== void 0 && this.gap(n), r !== void 0 && this.minColumnWidth(r);
762
+ }
763
+ }
764
+ }
765
+ };
766
+ function wn(e = null, t = null, n = null) {
767
+ return hn(Cn, e, t, n);
768
+ }
769
+ //#endregion
770
+ //#region src/layout/theme-shell.js
771
+ var Tn = class extends v {
772
+ constructor(e = null) {
773
+ super("div", null), this.className("yoya-component", "yoya-vtheme-shell"), this.styles({
774
+ background: O("color-surface", "#ffffff"),
775
+ border: `1px solid ${O("color-border", "#d8dee8")}`,
776
+ borderRadius: O("radius-md", "6px"),
777
+ boxSizing: "border-box",
778
+ color: O("color-text", "#172033"),
779
+ minWidth: "0"
780
+ }), gn(this, e);
781
+ }
782
+ _requireSingleShellChild() {
783
+ let e = this.children();
784
+ if (e.length !== 1) throw TypeError("vThemeShell virtual mode requires exactly one child");
785
+ return e[0];
786
+ }
787
+ _virtualTarget() {
788
+ let e = this._requireSingleShellChild();
789
+ return typeof e._resolve == "function" ? e._resolve() : e;
790
+ }
791
+ _syncShellStyles(e) {
792
+ !e || typeof e.styles != "function" || e.styles({
793
+ background: this._styles.background,
794
+ border: this._styles.border,
795
+ borderColor: this._styles.borderColor,
796
+ borderRadius: this._styles.borderRadius,
797
+ boxSizing: this._styles.boxSizing,
798
+ color: this._styles.color,
799
+ minWidth: this._styles.minWidth,
800
+ overflow: this._styles.overflow
801
+ });
802
+ }
803
+ virtual(e = !0) {
804
+ return this._virtualMode = !!e, this;
805
+ }
806
+ renderDom() {
807
+ if (this._deleted) return null;
808
+ if (this._virtualMode) {
809
+ let e = this._requireSingleShellChild(), t = this._virtualTarget();
810
+ return this._syncShellStyles(t), e.renderDom();
811
+ }
812
+ return super.renderDom();
813
+ }
814
+ toHTML() {
815
+ return this._deleted ? "" : this._virtualMode ? this._requireSingleShellChild().toHTML() : super.toHTML();
816
+ }
817
+ background(e) {
818
+ return e === void 0 ? this._styles.background : e === null ? this : (this._styles.background = String(e), this._el && (this._el.style.background = String(e)), this);
819
+ }
820
+ backgroundOpacity(e) {
821
+ let t = this.background() || O("color-surface", "#ffffff"), n = Math.max(0, Math.min(1, Number(e) || 0));
822
+ return this.background(`color-mix(in srgb, ${t} ${Math.round(n * 100)}%, transparent)`);
823
+ }
824
+ radius(e) {
825
+ return e === void 0 ? this._styles.borderRadius : this.styles({ borderRadius: e === null ? void 0 : String(e) });
826
+ }
827
+ border(e) {
828
+ return e === void 0 ? this._styles.border : this.styles({ border: e === null ? void 0 : String(e) });
829
+ }
830
+ borderColor(e) {
831
+ return e === void 0 ? this._styles.borderColor : this.styles({ borderColor: e === null ? void 0 : String(e) });
832
+ }
833
+ scrollable(e = !0) {
834
+ return this.styles({ overflow: e ? "auto" : "visible" });
835
+ }
836
+ };
837
+ function En(e = null, t = null, n = null) {
838
+ return hn(Tn, e, t, n);
839
+ }
840
+ _(h, { vThemeShell: En });
841
+ //#endregion
842
+ //#region src/layout/index.js
843
+ var Dn = /* @__PURE__ */ new Set(/* @__PURE__ */ "align.areas.asideWidth.autoFlow.breakpoint.columns.direction.drawer.gutter.offset.pull.push.span.xs.sm.md.lg.xl.gap.justify.maxWidth.minColumnWidth.mobileDirection.mobileGap.orientation.padding.paddingInline.rows.safeArea.size.breakpoints.viewport.wrap".split(".")), On = /* @__PURE__ */ new Set(["height", "width"]);
844
+ function kn(e = null, t = null, n = null) {
845
+ return N("flex", { display: "flex" }, e, F, t, n);
846
+ }
847
+ function An(e = null, t = null, n = null) {
848
+ return N("stack", {
849
+ display: "flex",
850
+ flexDirection: "column"
851
+ }, e, F, t, n);
852
+ }
853
+ function jn(e = null, t = null, n = null) {
854
+ return N("vstack", {
855
+ display: "flex",
856
+ flexDirection: "column"
857
+ }, e, F, t, n);
858
+ }
859
+ function Mn(e = null, t = null, n = null) {
860
+ return N("hstack", {
861
+ display: "flex",
862
+ flexDirection: "row"
863
+ }, e, F, t, n);
864
+ }
865
+ function Nn(e = null, t = null, n = null) {
866
+ return N("center", {
867
+ display: "flex",
868
+ alignItems: "center",
869
+ justifyContent: "center"
870
+ }, e, F, t, n);
871
+ }
872
+ function Pn(e = null, t = null, n = null) {
873
+ let r = A(e, t, n), i = new v("div");
874
+ i.className("yoya-layout", "yoya-vrow"), i.styles({
875
+ boxSizing: "border-box",
876
+ display: "flex",
877
+ flexWrap: "wrap",
878
+ width: "100%"
879
+ }), i._gutter = null, i.gutter = (e) => e === void 0 ? i._gutter : (i._gutter = z(e), ar(i), i), i.justify = (e) => e === void 0 ? i.style("justifyContent") : (i.style("justifyContent", e), i), i.align = (e) => e === void 0 ? i.style("alignItems") : (i.style("alignItems", e), i), i.wrap = (e) => e === void 0 ? i.style("flexWrap") : (i.style("flexWrap", e === !1 ? "nowrap" : B(e ?? !0)), i);
880
+ let a = i.child.bind(i);
881
+ return i.child = (...e) => (a(...e), ar(i), i), P(i, r.first, or), ar(i), j(i, r.options, r.callback);
882
+ }
883
+ function Fn(e = null, t = null, n = null) {
884
+ let r = A(e, t, n), i = new v("div");
885
+ return i.className("yoya-layout", "yoya-vcol"), i.styles({
886
+ boxSizing: "border-box",
887
+ minWidth: "0"
888
+ }), i._baseCol = I({}), i._responsiveCols = [], i._gutter = null, i.refresh = i._refreshCol = () => {
889
+ let e = typeof window > "u" ? null : window.innerWidth, t = (e === null ? null : i._responsiveCols.filter((t) => e >= t.minWidth).at(-1))?.props ?? i._baseCol;
890
+ return i.style("boxSizing", "border-box"), i.style("flex", "0 0 auto"), i.style("left", t.push ? `${R(t.push)}%` : null), i.style("marginLeft", t.offset ? `${R(t.offset)}%` : null), i.style("paddingLeft", i._gutter ? dr(i._gutter) : null), i.style("paddingRight", i._gutter ? dr(i._gutter) : null), i.style("position", t.push || t.pull ? "relative" : null), i.style("right", t.pull ? `${R(t.pull)}%` : null), i.style("width", `${R(t.span)}%`), i;
891
+ }, i.span = (e) => e === void 0 ? i._baseCol.span : (i._baseCol.span = L(e), i._refreshCol(), i), i.offset = (e) => e === void 0 ? i._baseCol.offset : (i._baseCol.offset = L(e), i._refreshCol(), i), i.push = (e) => e === void 0 ? i._baseCol.push : (i._baseCol.push = L(e), i._refreshCol(), i), i.pull = (e) => e === void 0 ? i._baseCol.pull : (i._baseCol.pull = L(e), i._refreshCol(), i), i.gutter = (e) => e === void 0 ? i._gutter : (i._gutter = z(e), i._refreshCol(), i), P(i, r.first, sr), i._refreshCol(), i._responsiveCols.length && typeof window < "u" && (i._colResize = () => i._refreshCol(), window.addEventListener("resize", i._colResize), fr(i)), j(i, r.options, r.callback);
892
+ }
893
+ function In(e = null, t = null, n = null) {
894
+ return N("grid", { display: "grid" }, e, $n, t, n);
895
+ }
896
+ function Ln(e = null, t = null, n = null) {
897
+ let r = A(e, t, n), i = N("responsive-grid", { display: "grid" }, r.first, er, r.options, r.callback), a = H(r.first) ? r.first : {};
898
+ return i._responsiveGridBreakpoints = Tr(a.breakpoints), i._responsiveGridMinColumnWidth = wr(a.minColumnWidth), i._responsiveGridRefresh = () => {
899
+ let e = typeof window > "u" ? null : window.innerWidth, t = e === null ? null : i._responsiveGridBreakpoints.filter((t) => e >= t.minWidth).at(-1);
900
+ return i.style("gridTemplateColumns", t ? `repeat(${t.columns}, minmax(0, 1fr))` : `repeat(auto-fit, minmax(${i._responsiveGridMinColumnWidth}, 1fr))`), i;
901
+ }, i.refresh = i._responsiveGridRefresh, i.minColumnWidth = (e) => e === void 0 ? i._responsiveGridMinColumnWidth : (i._responsiveGridMinColumnWidth = wr(e), i._responsiveGridRefresh(), i), i.breakpoints = (e) => e === void 0 ? i._responsiveGridBreakpoints : (i._responsiveGridBreakpoints = Tr(e), i._responsiveGridBreakpoints.length && !i._responsiveGridResize && typeof window < "u" && (i._responsiveGridResize = () => i._responsiveGridRefresh(), window.addEventListener("resize", i._responsiveGridResize), Bn(i)), i._responsiveGridRefresh(), i), i._responsiveGridRefresh(), i._responsiveGridBreakpoints.length && typeof window < "u" && (i._responsiveGridResize = () => i._responsiveGridRefresh(), window.addEventListener("resize", i._responsiveGridResize), Bn(i)), i;
902
+ }
903
+ function Rn(e = null, t = null, n = null) {
904
+ let r = A(e, t, n), i = new v("div"), a = new v("div").className("yoya-vbody-content"), o = i.child.bind(i);
905
+ return i.className("yoya-layout", "yoya-vbody"), i.attr("data-page-body", "true"), i.styles({
906
+ background: O("color-bg", "#f9f9f9"),
907
+ boxSizing: "border-box",
908
+ color: O("color-text", "#0d0d0d"),
909
+ fontFamily: O("font-family", "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif"),
910
+ fontSize: O("font-size", "14px"),
911
+ lineHeight: O("line-height", "1.5"),
912
+ minHeight: "100%",
913
+ padding: "clamp(16px, 3vw, 32px)",
914
+ width: "100%"
915
+ }), a.styles({
916
+ display: "grid",
917
+ gap: "24px",
918
+ marginLeft: "auto",
919
+ marginRight: "auto",
920
+ maxWidth: "1120px",
921
+ width: "100%"
922
+ }), o(a), i.background = (e) => e === void 0 ? i.style("background") : (i.style("background", e), i), i.maxWidth = (e) => e === void 0 ? a.style("maxWidth") : (a.style("maxWidth", z(e)), i), i.padding = (e) => e === void 0 ? i.style("padding") : (i.style("padding", z(e)), i), i.gap = (e) => e === void 0 ? a.style("gap") : (a.style("gap", z(e)), i), i.minHeight = (e) => e === void 0 ? i.style("minHeight") : (i.style("minHeight", z(e)), i), i.content = (e) => e === void 0 ? a : (typeof e == "function" ? e(a) : a.child(e), i), i.child = (...e) => (a.child(...e), i), tr(i, r.first), j(i, r.options, r.callback);
923
+ }
924
+ function zn(e = null, t = null) {
925
+ let n = Rn(e);
926
+ return typeof document < "u" && n.bindTo(t || document.body), n;
927
+ }
928
+ function Bn(e) {
929
+ if (e._responsiveGridDestroyWrapped) return;
930
+ e._responsiveGridDestroyWrapped = !0;
931
+ let t = e.destroy.bind(e);
932
+ e.destroy = () => (e._responsiveGridResize && window.removeEventListener("resize", e._responsiveGridResize), t());
933
+ }
934
+ function Vn(e = null, t = null, n = null) {
935
+ return N("container", {
936
+ width: "100%",
937
+ maxWidth: "1120px",
938
+ marginLeft: "auto",
939
+ marginRight: "auto",
940
+ paddingLeft: "16px",
941
+ paddingRight: "16px"
942
+ }, e, nr, t, n);
943
+ }
944
+ function Hn(e = null, t = null, n = null) {
945
+ let r = A(e, t, n), i = new v("div");
946
+ i.className("yoya-layout", "yoya-vcontainer"), i.styles({
947
+ boxSizing: "border-box",
948
+ display: "flex",
949
+ minWidth: "0",
950
+ width: "100%"
951
+ }), i._direction = null, i._viewport = !1, i._fill = !1, i._scrollable = !1, i.viewport = (e = !0) => e === void 0 ? i._viewport : (i._viewport = !!e, i.styles({
952
+ height: i._viewport ? "100dvh" : null,
953
+ minHeight: i._viewport ? "100vh" : null,
954
+ overflow: i._viewport ? "hidden" : null
955
+ }), i), i.fill = (e = !0) => e === void 0 ? i._fill : (i._fill = !!e, i.styles({
956
+ flex: i._fill ? "1 1 auto" : null,
957
+ height: i._fill ? "auto" : null,
958
+ minHeight: i._fill ? "0" : null,
959
+ minWidth: i._fill ? "0" : null,
960
+ overflow: i._fill ? "hidden" : null
961
+ }), i), i.scrollable = (e = !0) => e === void 0 ? i._scrollable : (i._scrollable = !!e, i.styles({
962
+ height: i._scrollable ? "100%" : null,
963
+ minHeight: i._scrollable ? "0" : null,
964
+ overflow: i._scrollable ? "auto" : null,
965
+ overscrollBehavior: i._scrollable ? "contain" : null
966
+ }), i), i._autoDirection = () => i.children().some((e) => _r(e)) ? "column" : "row", i._syncContainerDirection = () => (i.style("flexDirection", i._direction || i._autoDirection()), i), i.direction = (e) => e === void 0 ? i._direction || i._autoDirection() : (i._direction = e, i._syncContainerDirection(), i);
967
+ let a = i.child.bind(i);
968
+ return i.child = (...e) => (a(...e), i._syncContainerDirection(), i), P(i, r.first, vr), i._syncContainerDirection(), j(i, r.options, r.callback);
969
+ }
970
+ function Un(e = null, t = null, n = null) {
971
+ let r = A(e, t, n), i = new v("div");
972
+ i.className("yoya-layout", "yoya-mobile-layout", "yoya-vmobile-layout"), i.attr("data-mobile-layout", "false"), i.styles({
973
+ boxSizing: "border-box",
974
+ display: "flex",
975
+ minWidth: "0",
976
+ width: "100%"
977
+ }), i._breakpoint = 768, i._desktopDirection = "row", i._mobileDirection = "column", i._desktopGap = 0, i._mobileGap = 12, i._asideWidth = 280, i._safeArea = !1, i._safeAreaApplied = !1, i._viewport = !1, i._mobile = !1, i._drawerEnabled = !0, i._asideOpen = !1, i._asideBackdrop = new v("div").className("yoya-vmobile-layout-backdrop").attr("aria-hidden", "true").style("display", "none").on("click", () => i.closeAside()), i._asideToggle = new v("button").className("yoya-vmobile-layout-toggle").attr({
978
+ type: "button",
979
+ "aria-label": "打开导航",
980
+ "aria-expanded": "false"
981
+ }).style("display", "none").child(fn().styles({
982
+ height: "18px",
983
+ width: "18px"
984
+ })).on("click", () => i.toggleAside()), i._refreshMobileLayout = () => {
985
+ let e = typeof window > "u" ? null : window.innerWidth, t = e !== null && e <= i._breakpoint;
986
+ return i._mobile = t, t || (i._asideOpen = !1), i.attr("data-mobile-layout", t ? "true" : "false"), i.attr("data-aside-open", t && i._asideOpen ? "true" : null), i.styles({
987
+ flexDirection: t ? i._mobileDirection : i._desktopDirection,
988
+ gap: t ? i._mobileGap : i._desktopGap,
989
+ height: i._viewport ? "100dvh" : null,
990
+ minHeight: i._viewport ? "100vh" : null,
991
+ overflow: i._viewport ? "hidden" : null
992
+ }), i._safeArea ? (i._safeAreaApplied = !0, i.style("paddingLeft", t ? "max(env(safe-area-inset-left), 0px)" : null), i.style("paddingRight", t ? "max(env(safe-area-inset-right), 0px)" : null), i.style("paddingTop", t ? "max(env(safe-area-inset-top), 0px)" : null), i.style("paddingBottom", t ? "max(env(safe-area-inset-bottom), 0px)" : null)) : i._safeAreaApplied && (i._safeAreaApplied = !1, i.style("paddingLeft", null), i.style("paddingRight", null), i.style("paddingTop", null), i.style("paddingBottom", null)), i.children().forEach((e) => mr(i, e)), hr(i), i;
993
+ }, i.refresh = i._refreshMobileLayout, i.breakpoint = (e) => e === void 0 ? i._breakpoint : (i._breakpoint = Number(e), (!Number.isFinite(i._breakpoint) || i._breakpoint <= 0) && (i._breakpoint = 768), i._refreshMobileLayout(), i), i.direction = (e, t) => e === void 0 ? i._desktopDirection : (i._desktopDirection = e || "row", t !== void 0 && (i._mobileDirection = t || "column"), i._refreshMobileLayout(), i), i.mobileDirection = (e) => e === void 0 ? i._mobileDirection : (i._mobileDirection = e || "column", i._refreshMobileLayout(), i), i.gap = (e, t) => e === void 0 ? i._desktopGap : (i._desktopGap = z(e), t !== void 0 && (i._mobileGap = z(t)), i._refreshMobileLayout(), i), i.mobileGap = (e) => e === void 0 ? i._mobileGap : (i._mobileGap = z(e), i._refreshMobileLayout(), i), i.asideWidth = (e) => e === void 0 ? i._asideWidth : (i._asideWidth = z(e), i._refreshMobileLayout(), i), i.viewport = (e = !0) => e === void 0 ? i._viewport : (i._viewport = !!e, i._refreshMobileLayout(), i), i.safeArea = (e = !0) => e === void 0 ? i._safeArea : (i._safeArea = !!e, i._refreshMobileLayout(), i), i.drawer = (e = !0) => e === void 0 ? i._drawerEnabled : (i._drawerEnabled = !!e, i._drawerEnabled || (i._asideOpen = !1), i._refreshMobileLayout(), i), i.asideOpen = (e) => e === void 0 ? i._asideOpen : (i._asideOpen = !!e, i._refreshMobileLayout(), i), i.openAside = () => i.asideOpen(!0), i.closeAside = () => i.asideOpen(!1), i.toggleAside = () => i.asideOpen(!i._asideOpen), i.mobile = () => i._mobile;
994
+ let a = i.child.bind(i);
995
+ return i.child = (...e) => (a(...e), i._refreshMobileLayout(), i), P(i, r.first, yr), i.child(i._asideBackdrop, i._asideToggle), typeof window < "u" && (i._mobileLayoutResize = () => i._refreshMobileLayout(), window.addEventListener("resize", i._mobileLayoutResize), pr(i)), i._refreshMobileLayout(), j(i, r.options, r.callback);
996
+ }
997
+ var Wn = Un;
998
+ function Gn(e = null, t = null, n = null) {
999
+ return N("vheader", {
1000
+ boxSizing: "border-box",
1001
+ flex: "0 0 auto",
1002
+ height: "60px",
1003
+ width: "100%"
1004
+ }, e, br, t, n, "header", On, Zn);
1005
+ }
1006
+ function Kn(e = null, t = null, n = null) {
1007
+ return N("vaside", {
1008
+ boxSizing: "border-box",
1009
+ flex: "0 0 auto",
1010
+ minWidth: "0",
1011
+ width: "300px"
1012
+ }, e, xr, t, n, "aside", On, Qn);
1013
+ }
1014
+ function qn(e = null, t = null, n = null) {
1015
+ return N("vmain", {
1016
+ boxSizing: "border-box",
1017
+ flex: "1 1 auto",
1018
+ minHeight: "0",
1019
+ minWidth: "0",
1020
+ overflow: "auto"
1021
+ }, e, Sr, t, n, "main", On, Qn);
1022
+ }
1023
+ function Jn(e = null, t = null, n = null) {
1024
+ return N("vfooter", {
1025
+ boxSizing: "border-box",
1026
+ flex: "0 0 auto",
1027
+ height: "60px",
1028
+ width: "100%"
1029
+ }, e, br, t, n, "footer", On, Zn);
1030
+ }
1031
+ function Yn(e = null, t = null, n = null) {
1032
+ let r = N("spacer", {
1033
+ flexGrow: 1,
1034
+ minWidth: 0,
1035
+ minHeight: 0
1036
+ }, e, rr, t, n);
1037
+ return r.attr("aria-hidden", "true"), r;
1038
+ }
1039
+ function Xn(e = null, t = null, n = null) {
1040
+ let r = N("divider", {}, e, ir, t, n);
1041
+ return r.attr("role", "separator"), r.attr("aria-orientation") || r.attr("aria-orientation", "horizontal"), r;
1042
+ }
1043
+ _(v, {
1044
+ vAside: Kn,
1045
+ vCol: Fn,
1046
+ vContainer: Hn,
1047
+ vFooter: Jn,
1048
+ vHeader: Gn,
1049
+ vMain: qn,
1050
+ vMasonry: wn,
1051
+ vRow: Pn,
1052
+ vSplitPanel: bn,
1053
+ center: Nn,
1054
+ container: Vn,
1055
+ divider: Xn,
1056
+ flex: kn,
1057
+ grid: In,
1058
+ mobileLayout: Un,
1059
+ responsiveGrid: Ln,
1060
+ vMobileLayout: Wn,
1061
+ vBody: Rn,
1062
+ hstack: Mn,
1063
+ spacer: Yn,
1064
+ stack: An,
1065
+ vstack: jn
1066
+ });
1067
+ function N(e, t, n, r, i, a, o = "div", s = null, c = null) {
1068
+ let l = A(n, i, a), u = new v(o);
1069
+ return u.className("yoya-layout", `yoya-${e}`), u.styles(t), c && c(u), P(u, l.first, r, s), j(u, l.options, l.callback);
1070
+ }
1071
+ function Zn(e) {
1072
+ e.sticky = (t = !0) => {
1073
+ if (t === void 0) return e.style("position") === "sticky";
1074
+ let n = !!t;
1075
+ return e.styles({
1076
+ position: n ? "sticky" : null,
1077
+ top: n ? "0" : null,
1078
+ zIndex: n ? "20" : null
1079
+ }), e;
1080
+ };
1081
+ }
1082
+ function Qn(e) {
1083
+ e.scrollable = (t = !0) => {
1084
+ if (t === void 0) return e.style("overflow") === "auto";
1085
+ let n = !!t;
1086
+ return e.styles({
1087
+ height: n ? "100%" : null,
1088
+ minHeight: n ? "0" : null,
1089
+ overflow: n ? "auto" : null,
1090
+ overscrollBehavior: n ? "contain" : null
1091
+ }), e;
1092
+ };
1093
+ }
1094
+ function P(e, t, n, r = null) {
1095
+ if (t == null) return n(e, {}), e;
1096
+ if (!H(t)) return n(e, {}), e.setup(t);
1097
+ n(e, t);
1098
+ let i = Er(t, r);
1099
+ return Object.keys(i).length > 0 && e.setup(i), e;
1100
+ }
1101
+ function F(e, t) {
1102
+ e.styles(V({
1103
+ alignItems: t.align,
1104
+ flexDirection: t.direction,
1105
+ flexWrap: B(t.wrap),
1106
+ gap: t.gap,
1107
+ justifyContent: t.justify
1108
+ }));
1109
+ }
1110
+ function $n(e, t) {
1111
+ e.styles(V({
1112
+ gap: t.gap,
1113
+ gridAutoFlow: t.autoFlow,
1114
+ gridTemplateAreas: t.areas,
1115
+ gridTemplateColumns: Cr(t.columns),
1116
+ gridTemplateRows: Cr(t.rows)
1117
+ }));
1118
+ }
1119
+ function er(e, t) {
1120
+ e.style("gap", t.gap), e.style("gridTemplateColumns", `repeat(auto-fit, minmax(${wr(t.minColumnWidth)}, 1fr))`);
1121
+ }
1122
+ function tr(e, t) {
1123
+ if (t == null) return e;
1124
+ if (typeof t == "function") return t(e), e;
1125
+ if (!H(t)) return e.child(t), e;
1126
+ let { background: n, children: r, content: i, gap: a, maxWidth: o, minHeight: s, padding: c, ...l } = t;
1127
+ Object.keys(l).length && e.setup(l), n !== void 0 && e.background(n), o !== void 0 && e.maxWidth(o), c !== void 0 && e.padding(c), a !== void 0 && e.gap(a), s !== void 0 && e.minHeight(s);
1128
+ let u = i ?? r;
1129
+ return u !== void 0 && e.content(u), e;
1130
+ }
1131
+ function nr(e, t) {
1132
+ let n = t.paddingInline ?? t.padding;
1133
+ e.styles(V({
1134
+ maxWidth: t.maxWidth,
1135
+ paddingLeft: n,
1136
+ paddingRight: n
1137
+ }));
1138
+ }
1139
+ function rr(e, t) {
1140
+ e.styles(V({
1141
+ flexBasis: t.size,
1142
+ height: t.orientation === "vertical" ? t.size : void 0,
1143
+ width: t.orientation === "horizontal" ? t.size : void 0
1144
+ }));
1145
+ }
1146
+ function ir(e, t) {
1147
+ let n = t.orientation === "vertical" ? "vertical" : "horizontal";
1148
+ if (e.attr("aria-orientation", n), n === "vertical") {
1149
+ e.styles({
1150
+ alignSelf: "stretch",
1151
+ background: "currentColor",
1152
+ opacity: .2,
1153
+ width: "1px"
1154
+ });
1155
+ return;
1156
+ }
1157
+ e.styles({
1158
+ background: "currentColor",
1159
+ height: "1px",
1160
+ opacity: .2,
1161
+ width: "100%"
1162
+ });
1163
+ }
1164
+ function ar(e) {
1165
+ e.children().forEach((t) => {
1166
+ let n = t?._resolved ?? t?._resolve?.() ?? t;
1167
+ n && typeof n.gutter == "function" && n.gutter(e._gutter);
1168
+ });
1169
+ }
1170
+ function or(e, t) {
1171
+ t.gutter !== void 0 && e.gutter(t.gutter), e.styles(V({
1172
+ alignItems: t.align,
1173
+ flexWrap: t.wrap === void 0 || t.wrap === null ? "wrap" : t.wrap === !1 ? "nowrap" : B(t.wrap),
1174
+ justifyContent: t.justify
1175
+ }));
1176
+ }
1177
+ function sr(e, t) {
1178
+ e._baseCol = I(t), e._responsiveCols = lr(t), t.gutter !== void 0 && e.gutter(t.gutter);
1179
+ }
1180
+ var cr = [
1181
+ ["xs", 0],
1182
+ ["sm", 768],
1183
+ ["md", 992],
1184
+ ["lg", 1200],
1185
+ ["xl", 1920]
1186
+ ];
1187
+ function I(e = {}) {
1188
+ return {
1189
+ span: L(e.span ?? 24),
1190
+ offset: L(e.offset ?? 0),
1191
+ push: L(e.push ?? 0),
1192
+ pull: L(e.pull ?? 0)
1193
+ };
1194
+ }
1195
+ function lr(e = {}) {
1196
+ return cr.filter(([t]) => e[t] !== void 0).map(([t, n]) => ({
1197
+ minWidth: n,
1198
+ props: ur(e[t])
1199
+ }));
1200
+ }
1201
+ function ur(e) {
1202
+ return typeof e == "number" ? I({ span: e }) : H(e) ? I(e) : I({});
1203
+ }
1204
+ function L(e) {
1205
+ let t = Number(e);
1206
+ return Number.isFinite(t) ? Math.min(24, Math.max(0, Math.round(t))) : 0;
1207
+ }
1208
+ function R(e) {
1209
+ return e / 24 * 100;
1210
+ }
1211
+ function dr(e) {
1212
+ if (typeof e == "number") return `${e / 2}px`;
1213
+ let t = String(e).match(/^(-?(?:\d+\.?\d*|\.\d+))([a-z%]+)$/i);
1214
+ return t ? `${Number(t[1]) / 2}${t[2]}` : `calc(${e} * 0.5)`;
1215
+ }
1216
+ function fr(e) {
1217
+ if (e._colDestroyWrapped) return;
1218
+ e._colDestroyWrapped = !0;
1219
+ let t = e.destroy.bind(e);
1220
+ e.destroy = () => (e._colResize && window.removeEventListener("resize", e._colResize), t());
1221
+ }
1222
+ function pr(e) {
1223
+ if (e._mobileLayoutDestroyWrapped) return;
1224
+ e._mobileLayoutDestroyWrapped = !0;
1225
+ let t = e.destroy.bind(e);
1226
+ e.destroy = () => (e._mobileLayoutResize && window.removeEventListener("resize", e._mobileLayoutResize), t());
1227
+ }
1228
+ function mr(e, t) {
1229
+ let n = t?._resolved ?? t?._resolve?.() ?? t;
1230
+ if (!n || typeof n.styles != "function") return;
1231
+ let r = n._classes;
1232
+ if (r?.has("yoya-vaside") && e._mobile && e._drawerEnabled) {
1233
+ n.styles({
1234
+ bottom: "0",
1235
+ boxShadow: e._asideOpen ? "0 12px 36px rgba(15, 23, 42, 0.28)" : "none",
1236
+ display: "flex",
1237
+ flexDirection: "column",
1238
+ height: "100dvh",
1239
+ left: "0",
1240
+ maxWidth: "84vw",
1241
+ minHeight: "100vh",
1242
+ minWidth: "0",
1243
+ pointerEvents: e._asideOpen ? "auto" : "none",
1244
+ position: "fixed",
1245
+ top: "0",
1246
+ transform: e._asideOpen ? "translateX(0)" : "translateX(-100%)",
1247
+ transition: "transform 180ms ease, box-shadow 180ms ease, visibility 180ms ease",
1248
+ visibility: e._asideOpen ? "visible" : "hidden",
1249
+ width: "320px",
1250
+ zIndex: "40"
1251
+ }), n.attr("aria-hidden", e._asideOpen ? null : "true"), n._mobileDrawerAriaHiddenApplied = !0, n._mobileDrawerStylesApplied = !0, n._mobileDrawerClickBound || (n._mobileDrawerClickBound = !0, n.on("click", (t) => {
1252
+ t.target?.closest?.(".yoya-vmenu-item") && !t.target.closest?.(".yoya-vsubmenu-trigger") && e.closeAside();
1253
+ }));
1254
+ return;
1255
+ }
1256
+ if (r?.has("yoya-vaside")) {
1257
+ n._mobileDrawerStylesApplied && (n._mobileDrawerStylesApplied = !1, n.styles({
1258
+ bottom: null,
1259
+ boxShadow: null,
1260
+ display: null,
1261
+ height: null,
1262
+ left: null,
1263
+ minHeight: null,
1264
+ minWidth: null,
1265
+ pointerEvents: null,
1266
+ position: null,
1267
+ top: null,
1268
+ transform: null,
1269
+ transition: null,
1270
+ visibility: null,
1271
+ zIndex: null
1272
+ })), n._mobileDrawerAriaHiddenApplied && (n._mobileDrawerAriaHiddenApplied = !1, n.attr("aria-hidden", null));
1273
+ let t = e._mobile ? "100%" : z(e._asideWidth);
1274
+ n.styles({
1275
+ flex: "0 0 auto",
1276
+ maxWidth: t,
1277
+ width: t
1278
+ });
1279
+ return;
1280
+ }
1281
+ r?.has("yoya-vmain") && (n.styles({
1282
+ flex: "1 1 auto",
1283
+ minHeight: "0",
1284
+ minWidth: "0"
1285
+ }), e._mobile && e._drawerEnabled ? (n.styles({
1286
+ maxWidth: "100%",
1287
+ width: "100%"
1288
+ }), n._mobileDrawerMainStylesApplied = !0) : n._mobileDrawerMainStylesApplied && (n._mobileDrawerMainStylesApplied = !1, n.styles({
1289
+ maxWidth: null,
1290
+ width: null
1291
+ })));
1292
+ }
1293
+ function hr(e) {
1294
+ let t = e._mobile && e._drawerEnabled && gr(e), n = t && e._asideOpen, r = e._asideBackdrop, i = e._asideToggle;
1295
+ i && i.attr("aria-expanded", n ? "true" : "false").attr("aria-label", n ? "关闭导航" : "打开导航").styles({
1296
+ alignItems: "center",
1297
+ background: "var(--yoya-color-surface, #ffffff)",
1298
+ border: "0",
1299
+ borderRadius: "10px",
1300
+ boxShadow: t ? "0 2px 10px rgba(15, 23, 42, 0.18)" : "none",
1301
+ color: "#172033",
1302
+ cursor: "pointer",
1303
+ display: t ? "inline-flex" : "none",
1304
+ height: "38px",
1305
+ justifyContent: "center",
1306
+ left: "12px",
1307
+ padding: "0",
1308
+ position: "fixed",
1309
+ top: "max(env(safe-area-inset-top), 10px)",
1310
+ width: "38px",
1311
+ zIndex: "45"
1312
+ }), r && r.styles({
1313
+ background: n ? "rgba(15, 23, 42, 0.42)" : null,
1314
+ display: n ? "block" : "none",
1315
+ inset: "0",
1316
+ position: "fixed",
1317
+ zIndex: n ? "35" : null
1318
+ });
1319
+ }
1320
+ function gr(e) {
1321
+ return e.children().some((e) => !!(e?._resolved ?? e?._resolve?.() ?? e)?._classes?.has("yoya-vaside"));
1322
+ }
1323
+ function _r(e) {
1324
+ let t = (e?._resolved ?? e?._resolve?.() ?? e)?._classes;
1325
+ return !!(t?.has("yoya-vheader") || t?.has("yoya-vfooter"));
1326
+ }
1327
+ function vr(e, t) {
1328
+ t.direction !== void 0 && e.direction(t.direction), e.styles(V({ gap: t.gap }));
1329
+ }
1330
+ function yr(e, t) {
1331
+ e.styles(V({
1332
+ alignItems: t.align,
1333
+ flexWrap: B(t.wrap),
1334
+ justifyContent: t.justify
1335
+ })), t.direction === void 0 ? t.mobileDirection !== void 0 && e.mobileDirection(t.mobileDirection) : e.direction(t.direction, t.mobileDirection), t.gap === void 0 ? t.mobileGap !== void 0 && e.mobileGap(t.mobileGap) : e.gap(t.gap, t.mobileGap), t.breakpoint !== void 0 && e.breakpoint(t.breakpoint), t.asideWidth !== void 0 && e.asideWidth(t.asideWidth), t.drawer !== void 0 && e.drawer(t.drawer), t.viewport !== void 0 && e.viewport(t.viewport), t.safeArea !== void 0 && e.safeArea(t.safeArea);
1336
+ }
1337
+ function br(e, t) {
1338
+ e.style("height", z(t.height ?? t.size ?? 60)), e.style("width", "100%");
1339
+ }
1340
+ function xr(e, t) {
1341
+ e.style("width", z(t.width ?? t.size ?? 300));
1342
+ }
1343
+ function Sr(e, t = {}) {
1344
+ t.height !== void 0 && e.style("height", z(t.height));
1345
+ }
1346
+ function Cr(e) {
1347
+ if (e != null && e !== !1) return typeof e == "number" ? `repeat(${e}, minmax(0, 1fr))` : String(e);
1348
+ }
1349
+ function wr(e) {
1350
+ return typeof e == "number" ? `${e}px` : e || "240px";
1351
+ }
1352
+ function z(e) {
1353
+ return typeof e == "number" ? `${e}px` : e;
1354
+ }
1355
+ function Tr(e) {
1356
+ return e ? (Array.isArray(e) ? e : Object.entries(e).map(([e, t]) => ({
1357
+ minWidth: e,
1358
+ columns: t
1359
+ }))).map((e) => ({
1360
+ columns: Number(e.columns),
1361
+ minWidth: Number.parseInt(e.minWidth, 10)
1362
+ })).filter(({ columns: e, minWidth: t }) => Number.isFinite(t) && e > 0).sort((e, t) => e.minWidth - t.minWidth) : [];
1363
+ }
1364
+ function B(e) {
1365
+ if (e === !0) return "wrap";
1366
+ if (e !== !1 && e != null) return String(e);
1367
+ }
1368
+ function Er(e, t = null) {
1369
+ let n = t || Dn;
1370
+ return Object.fromEntries(Object.entries(e).filter(([e]) => !n.has(e)));
1371
+ }
1372
+ function V(e) {
1373
+ return Object.fromEntries(Object.entries(e).filter(([, e]) => e != null && e !== !1));
1374
+ }
1375
+ function H(e) {
1376
+ return Object.prototype.toString.call(e) === "[object Object]";
1377
+ }
1378
+ //#endregion
1379
+ //#region src/core/client-only.js
1380
+ var Dr = class extends c {
1381
+ constructor(e) {
1382
+ super(null), this._loader = e, this._resolved = null;
1383
+ }
1384
+ _resolve() {
1385
+ return this._resolved ||= kr(this._loader), this._resolved;
1386
+ }
1387
+ toHTML() {
1388
+ return this._deleted ? "" : "<div class=\"yoya-client-only\" data-client-only=\"true\"></div>";
1389
+ }
1390
+ renderDom() {
1391
+ if (this._deleted) return null;
1392
+ let e = this._resolve().renderDom();
1393
+ return this._el && this._el !== e && this._el.parentNode && this._el.parentNode.replaceChild(e, this._el), this._el = e, e;
1394
+ }
1395
+ children() {
1396
+ return this._resolved ? this._resolved.children() : [];
159
1397
  }
1398
+ textContent() {
1399
+ return this._resolved && typeof this._resolved.textContent == "function" ? this._resolved.textContent() : "";
1400
+ }
1401
+ destroy() {
1402
+ return this._resolved && this._resolved.destroy(), super.destroy();
1403
+ }
1404
+ };
1405
+ function Or(e) {
1406
+ return new Dr(e);
1407
+ }
1408
+ function kr(e) {
1409
+ if (e instanceof c) return e;
1410
+ if (typeof e == "function") return kr(e());
1411
+ if (e && typeof e.render == "function") return kr(e.render());
1412
+ throw TypeError("vClientOnly loader must return a ViewNode or a component object");
160
1413
  }
161
1414
  //#endregion
162
1415
  //#region src/core/i18n.js
163
- var l = "yoya-ui:i18n", u = /* @__PURE__ */ new Map(), d = class {
1416
+ var Ar = "yoya-ui:i18n", U = /* @__PURE__ */ new Map(), jr = class {
164
1417
  constructor(e = {}) {
165
1418
  let t = e.language || "zh-CN";
166
- this._key = e.key || null, this._storage = k(e.storage), this._storageKey = e.storageKey || null, this._sharedStorageKey = this._key ? l : null, this._fallbackLanguage = e.fallbackLanguage || t, this._language = this._readStoredLanguage(t), this._messages = {}, this._listeners = /* @__PURE__ */ new Set(), this.registerMessages(e.messages || {}), this._key && y(this);
1419
+ this._key = e.key || null, this._storage = Zr(e.storage), this._storageKey = e.storageKey || null, this._sharedStorageKey = this._key ? Ar : null, this._fallbackLanguage = e.fallbackLanguage || t, this._language = this._readStoredLanguage(t), this._messages = {}, this._listeners = /* @__PURE__ */ new Set(), this.registerMessages(e.messages || {}), this._key && Rr(this);
167
1420
  }
168
1421
  key() {
169
1422
  return this._key;
@@ -183,8 +1436,8 @@ var l = "yoya-ui:i18n", u = /* @__PURE__ */ new Map(), d = class {
183
1436
  clearPersistedLanguage() {
184
1437
  if (!this._storageKey) {
185
1438
  if (!this._sharedStorageKey) return this;
186
- let e = x(this._storage, this._sharedStorageKey);
187
- return delete e[this._key], S(this._storage, this._sharedStorageKey, e), this;
1439
+ let e = Ur(this._storage, this._sharedStorageKey);
1440
+ return delete e[this._key], Wr(this._storage, this._sharedStorageKey, e), this;
188
1441
  }
189
1442
  try {
190
1443
  this._storage.removeItem(this._storageKey);
@@ -192,12 +1445,12 @@ var l = "yoya-ui:i18n", u = /* @__PURE__ */ new Map(), d = class {
192
1445
  return this;
193
1446
  }
194
1447
  register(e, t = {}) {
195
- return e ? (O(t).forEach((t) => {
196
- this._messages[e] = T(this._messages[e] || {}, t);
1448
+ return e ? (Xr(t).forEach((t) => {
1449
+ this._messages[e] = qr(this._messages[e] || {}, t);
197
1450
  }), this._notify(), this) : this;
198
1451
  }
199
1452
  registerMessages(e = {}) {
200
- return D(e).forEach((e) => {
1453
+ return Yr(e).forEach((e) => {
201
1454
  if (e.language) {
202
1455
  this.register(e.language, e.messages || {});
203
1456
  return;
@@ -208,11 +1461,11 @@ var l = "yoya-ui:i18n", u = /* @__PURE__ */ new Map(), d = class {
208
1461
  }), this;
209
1462
  }
210
1463
  t(e, t = {}, n = void 0) {
211
- let r = C(this._messages[this._language], e) ?? C(this._messages[this._fallbackLanguage], e) ?? n ?? e;
212
- return w(typeof r == "function" ? r(t, this) : r, t);
1464
+ let r = Gr(this._messages[this._language], e) ?? Gr(this._messages[this._fallbackLanguage], e) ?? n ?? e;
1465
+ return Kr(typeof r == "function" ? r(t, this) : r, t);
213
1466
  }
214
1467
  text(e, t = {}, n = void 0) {
215
- return new f(this, e, t, n);
1468
+ return new Mr(this, e, t, n);
216
1469
  }
217
1470
  subscribe(e) {
218
1471
  return this._listeners.add(e), () => {
@@ -225,7 +1478,7 @@ var l = "yoya-ui:i18n", u = /* @__PURE__ */ new Map(), d = class {
225
1478
  } catch {
226
1479
  return e;
227
1480
  }
228
- return this._sharedStorageKey && x(this._storage, this._sharedStorageKey)[this._key] || e;
1481
+ return this._sharedStorageKey && Ur(this._storage, this._sharedStorageKey)[this._key] || e;
229
1482
  }
230
1483
  _persistLanguage() {
231
1484
  if (this._storageKey) {
@@ -235,14 +1488,14 @@ var l = "yoya-ui:i18n", u = /* @__PURE__ */ new Map(), d = class {
235
1488
  return;
236
1489
  }
237
1490
  if (this._sharedStorageKey) {
238
- let e = x(this._storage, this._sharedStorageKey);
239
- e[this._key] = this._language, S(this._storage, this._sharedStorageKey, e);
1491
+ let e = Ur(this._storage, this._sharedStorageKey);
1492
+ e[this._key] = this._language, Wr(this._storage, this._sharedStorageKey, e);
240
1493
  }
241
1494
  }
242
1495
  _notify() {
243
1496
  this._listeners.forEach((e) => e(this));
244
1497
  }
245
- }, f = class extends r {
1498
+ }, Mr = class extends l {
246
1499
  constructor(e, t, n = {}, r = void 0) {
247
1500
  super(e.t(t, n, r)), this._i18n = e, this._key = t, this._params = n || {}, this._defaultValue = r, this._unsubscribe = e.subscribe(() => this.refresh());
248
1501
  }
@@ -262,12 +1515,16 @@ var l = "yoya-ui:i18n", u = /* @__PURE__ */ new Map(), d = class {
262
1515
  return this._unsubscribe &&= (this._unsubscribe(), null), super.destroy();
263
1516
  }
264
1517
  };
265
- function p(e = {}) {
266
- return new d(e);
1518
+ function Nr(e = {}) {
1519
+ return new jr(e);
1520
+ }
1521
+ var W = Nr();
1522
+ function Pr(e, t = {}) {
1523
+ return W.text(e, t);
267
1524
  }
268
- var m = p(), h = m;
269
- function g(e = m) {
270
- return h = e, String.prototype._yoyaUiStringShortcutInstalled ? e : (Object.defineProperty(String.prototype, "_yoyaUiStringShortcutInstalled", {
1525
+ var G = W;
1526
+ function Fr(e = W) {
1527
+ return G = e, String.prototype._yoyaUiStringShortcutInstalled ? e : (Object.defineProperty(String.prototype, "_yoyaUiStringShortcutInstalled", {
271
1528
  configurable: !0,
272
1529
  enumerable: !1,
273
1530
  value: !0
@@ -275,33 +1532,43 @@ function g(e = m) {
275
1532
  configurable: !0,
276
1533
  enumerable: !1,
277
1534
  value: function(e, t, n) {
278
- let r = String(this), i = {}, a = h;
279
- return v(t) ? a = t : typeof t == "string" ? a = b(t) || h : (i = t || {}, v(n) ? a = n : typeof n == "string" && (a = b(n) || h)), a.text(e || r, i, r);
1535
+ let r = String(this), i = {}, a = G;
1536
+ return Lr(t) ? a = t : typeof t == "string" ? a = Br(t) || G : (i = t || {}, Lr(n) ? a = n : typeof n == "string" && (a = Br(n) || G)), a.text(e || r, i, r);
280
1537
  }
281
1538
  }), e);
282
1539
  }
283
- function _(e, t) {
284
- let n = h;
285
- h = e || n;
1540
+ function Ir(e, t) {
1541
+ let n = G;
1542
+ G = e || n;
286
1543
  try {
287
1544
  return t();
288
1545
  } finally {
289
- h = n;
1546
+ G = n;
290
1547
  }
291
1548
  }
292
- function v(e) {
1549
+ function Lr(e) {
293
1550
  return !!(e && typeof e.text == "function");
294
1551
  }
295
- function y(e) {
1552
+ function Rr(e) {
296
1553
  let t = e?.key?.();
297
- return t ? (u.set(t, e), () => {
298
- u.get(t) === e && u.delete(t);
1554
+ return t ? (U.set(t, e), () => {
1555
+ U.get(t) === e && U.delete(t);
299
1556
  }) : () => {};
300
1557
  }
301
- function b(e) {
302
- return e && u.get(e) || null;
1558
+ function zr(e) {
1559
+ let t = typeof e == "string" ? e : e?.key?.();
1560
+ return t && U.delete(t), t;
303
1561
  }
304
- function x(e, t) {
1562
+ function Br(e) {
1563
+ return e && U.get(e) || null;
1564
+ }
1565
+ function Vr() {
1566
+ return new Map(U);
1567
+ }
1568
+ function Hr(e) {
1569
+ return Ur(e || Zr(), Ar);
1570
+ }
1571
+ function Ur(e, t) {
305
1572
  if (!e) return {};
306
1573
  try {
307
1574
  let n = e.getItem(t);
@@ -312,66 +1579,1036 @@ function x(e, t) {
312
1579
  return {};
313
1580
  }
314
1581
  }
315
- function S(e, t, n) {
1582
+ function Wr(e, t, n) {
316
1583
  if (e) try {
317
1584
  e.setItem(t, JSON.stringify(n));
318
1585
  } catch {}
319
1586
  }
320
- g(m);
321
- function C(e, t) {
1587
+ Fr(W);
1588
+ function Gr(e, t) {
322
1589
  if (!(!e || !t)) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : String(t).split(".").reduce((e, t) => {
323
1590
  if (e && typeof e == "object" && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
324
1591
  }, e);
325
1592
  }
326
- function w(e, t) {
1593
+ function Kr(e, t) {
327
1594
  return String(e).replace(/\{([^{}]+)\}/g, (e, n) => {
328
1595
  let r = t?.[n.trim()];
329
1596
  return r == null ? e : String(r);
330
1597
  });
331
1598
  }
332
- function T(e, t) {
1599
+ function qr(e, t) {
333
1600
  let n = { ...e };
334
1601
  return Object.entries(t || {}).forEach(([e, t]) => {
335
- E(t) && E(n[e]) ? n[e] = T(n[e], t) : n[e] = t;
1602
+ Jr(t) && Jr(n[e]) ? n[e] = qr(n[e], t) : n[e] = t;
336
1603
  }), n;
337
1604
  }
338
- function E(e) {
1605
+ function Jr(e) {
339
1606
  return Object.prototype.toString.call(e) === "[object Object]";
340
1607
  }
341
- function D(e) {
342
- return Array.isArray(e) ? e.flatMap((e) => D(e)) : [e || {}];
1608
+ function Yr(e) {
1609
+ return Array.isArray(e) ? e.flatMap((e) => Yr(e)) : [e || {}];
343
1610
  }
344
- function O(e) {
345
- return Array.isArray(e) ? e.flatMap((e) => O(e)) : [e || {}];
1611
+ function Xr(e) {
1612
+ return Array.isArray(e) ? e.flatMap((e) => Xr(e)) : [e || {}];
346
1613
  }
347
- function k(e) {
1614
+ function Zr(e) {
348
1615
  if (e) return e;
349
1616
  try {
350
1617
  if (typeof globalThis < "u" && globalThis.localStorage) return globalThis.localStorage;
351
1618
  } catch {}
352
- return j();
1619
+ return $r();
353
1620
  }
354
- var A = /* @__PURE__ */ new Map();
355
- function j() {
1621
+ var Qr = /* @__PURE__ */ new Map();
1622
+ function $r() {
356
1623
  return {
357
1624
  getItem(e) {
358
- return A.has(e) ? A.get(e) : null;
1625
+ return Qr.has(e) ? Qr.get(e) : null;
359
1626
  },
360
1627
  setItem(e, t) {
361
- A.set(e, String(t));
1628
+ Qr.set(e, String(t));
362
1629
  },
363
1630
  removeItem(e) {
364
- A.delete(e);
1631
+ Qr.delete(e);
365
1632
  }
366
1633
  };
367
1634
  }
368
1635
  //#endregion
1636
+ //#region src/core/state-node.js
1637
+ var ei = /* @__PURE__ */ new Set([
1638
+ "state",
1639
+ "render",
1640
+ "update"
1641
+ ]), ti = /* @__PURE__ */ new Set([
1642
+ "destroy",
1643
+ "getState",
1644
+ "setState",
1645
+ "subscribe"
1646
+ ]);
1647
+ function ni(e = {}) {
1648
+ if (typeof e.render != "function") throw TypeError("vStateNode requires a render function");
1649
+ let t = typeof e.state == "function" ? e.state() : { ...e.state || {} }, n = /* @__PURE__ */ new Set(), r = !1, i = null, a = {
1650
+ destroy() {
1651
+ return r ? a : (r = !0, n.clear(), i && i.destroy(), a);
1652
+ },
1653
+ getState() {
1654
+ return a.state();
1655
+ },
1656
+ render() {
1657
+ if (r) return i;
1658
+ if (!i) {
1659
+ i = new h("div");
1660
+ let e = i.destroy.bind(i);
1661
+ i.destroy = () => (n.clear(), e()), o();
1662
+ }
1663
+ return i;
1664
+ },
1665
+ setState(e) {
1666
+ if (r || e == null) return a;
1667
+ let o = typeof e == "function" ? e({ ...t }) : e;
1668
+ if (!o || typeof o != "object") return a;
1669
+ let c = /* @__PURE__ */ new Set();
1670
+ return Object.entries(o).forEach(([e, n]) => {
1671
+ t[e] !== n && (t[e] = n, c.add(e));
1672
+ }), c.size > 0 && (i && s(c), n.forEach((e) => e(t, a))), a;
1673
+ },
1674
+ state() {
1675
+ return { ...t };
1676
+ },
1677
+ subscribe(e) {
1678
+ if (typeof e != "function") throw TypeError("vStateNode subscriber must be a function");
1679
+ return n.add(e), () => n.delete(e);
1680
+ }
1681
+ };
1682
+ for (let t of Object.keys(e)) if (!(ei.has(t) || typeof e[t] != "function")) {
1683
+ if (ti.has(t)) throw TypeError(`vStateNode config key "${t}" conflicts with the built-in API`);
1684
+ a[t] = e[t];
1685
+ }
1686
+ return a;
1687
+ function o() {
1688
+ let n = e.render.call(a, t, a);
1689
+ i.clearChildren().child(n), i._el && i.commit();
1690
+ }
1691
+ function s(n) {
1692
+ if (typeof e.update == "function") {
1693
+ e.update.call(a, t, a, n) === !0 && o();
1694
+ return;
1695
+ }
1696
+ o();
1697
+ }
1698
+ }
1699
+ _(h, { vStateNode: ni });
1700
+ //#endregion
1701
+ //#region src/core/theme.js
1702
+ var ri = [
1703
+ "light",
1704
+ "dark",
1705
+ "system"
1706
+ ], ii = "yoya-theme-mode", ai = "yoya-theme-name";
1707
+ function oi() {
1708
+ return typeof document > "u" ? null : document.documentElement;
1709
+ }
1710
+ function K() {
1711
+ try {
1712
+ return typeof localStorage < "u" && localStorage !== null;
1713
+ } catch {
1714
+ return !1;
1715
+ }
1716
+ }
1717
+ function si(e = "light", t = {}) {
1718
+ let n = ri.includes(e) ? e : "light", r = oi();
1719
+ if (r && (r.dataset.yoyaMode = n), t.persist && K()) try {
1720
+ localStorage.setItem(ii, n);
1721
+ } catch {}
1722
+ return n;
1723
+ }
1724
+ function ci() {
1725
+ let e = oi(), t = e && e.dataset.yoyaMode;
1726
+ return ri.includes(t) ? t : "light";
1727
+ }
1728
+ function li() {
1729
+ let e = ci();
1730
+ return e === "system" ? typeof window > "u" || typeof window.matchMedia != "function" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : e;
1731
+ }
1732
+ function ui(e = "", t = {}) {
1733
+ let n = oi();
1734
+ if (!e) {
1735
+ if (n && delete n.dataset.yoyaTheme, t.persist && K()) try {
1736
+ localStorage.removeItem(ai);
1737
+ } catch {}
1738
+ return "";
1739
+ }
1740
+ if (n && (n.dataset.yoyaTheme = e), t.persist && K()) try {
1741
+ localStorage.setItem(ai, e);
1742
+ } catch {}
1743
+ return e;
1744
+ }
1745
+ function di() {
1746
+ let e = oi();
1747
+ return e && e.dataset.yoyaTheme || "";
1748
+ }
1749
+ function fi(e = {}) {
1750
+ let t = e.mode, n = e.theme;
1751
+ if (t === void 0 && K()) {
1752
+ let e = localStorage.getItem(ii);
1753
+ ri.includes(e) && (t = e);
1754
+ }
1755
+ return n === void 0 && K() && (n = localStorage.getItem(ai) || ""), t !== void 0 && si(t, { persist: e.persist }), n !== void 0 && ui(n, { persist: e.persist }), {
1756
+ mode: ci(),
1757
+ theme: di()
1758
+ };
1759
+ }
1760
+ //#endregion
1761
+ //#region src/router/router.js
1762
+ var q = 8, J = null;
1763
+ function pi() {
1764
+ typeof document > "u" || J || (J = document.createElement("style"), J.setAttribute("data-yoya-vrouter-views-popup-style", ""), J.textContent = ".yoya-vrouter-views-titlebar,\n.yoya-vrouter-views-popup {\n -ms-overflow-style: none;\n scrollbar-width: none;\n}\n.yoya-vrouter-views-titlebar::-webkit-scrollbar,\n.yoya-vrouter-views-popup::-webkit-scrollbar {\n display: none;\n height: 0;\n width: 0;\n}\n.yoya-vrouter-views-popup-item:hover {\n background: var(--yoya-color-surface-hover, #eef3f9);\n}\n.yoya-vrouter-views-popup-item[aria-current='true'] {\n background: var(--yoya-color-primary-subtle, #e8f0fe);\n color: var(--yoya-color-primary, #1f6feb);\n}\n.yoya-vrouter-views-popup-close {\n color: var(--yoya-color-text-secondary, #57606a);\n opacity: 0.65;\n}\n.yoya-vrouter-views-popup-item:hover .yoya-vrouter-views-popup-close,\n.yoya-vrouter-views-popup-close:hover {\n color: var(--yoya-color-text-danger, #b91c1c);\n opacity: 1;\n}\n.yoya-vrouter-views-context-item:hover {\n background: var(--yoya-color-surface-hover, #f6f8fa);\n}\n.yoya-vrouter-views-context-separator {\n background: var(--yoya-color-border, #d0d7de);\n height: 1px;\n margin: 4px 6px;\n}", document.head?.appendChild(J));
1765
+ }
1766
+ function mi(e) {
1767
+ let t = [e._defaultPath || "/", e._routes.map((e) => e.pattern).join("|")].join("::"), n = 0;
1768
+ for (let e = 0; e < t.length; e += 1) n = n * 31 + t.charCodeAt(e) | 0;
1769
+ return `yoya-ui:router-views:${(n >>> 0).toString(36)}`;
1770
+ }
1771
+ function hi(e) {
1772
+ if (typeof localStorage > "u") return null;
1773
+ try {
1774
+ let t = JSON.parse(localStorage.getItem(e) || "null");
1775
+ return Array.isArray(t?.paths) ? t : null;
1776
+ } catch {
1777
+ return null;
1778
+ }
1779
+ }
1780
+ var gi = class extends h {
1781
+ constructor(e = null) {
1782
+ super("div"), this._routes = [], this._defaultPath = null, this._notFoundView = null, this._beforeEach = null, this._currentPath = "/", this._currentParams = {}, this._currentQuery = {}, this._currentRoute = null, this._currentView = null, this._loadingView = null, this._errorView = null, this._navigationGeneration = 0, this._outlet = this, this._subscribers = /* @__PURE__ */ new Set(), this._ignoreNextHashPath = null, this._mode = "hash", this._started = !1, this._onHashChange = () => this._handleHashChange(), this._onPopState = () => this._handlePopState(), this.attr("data-yoya-router", ""), e !== null && this.setup(e);
1783
+ }
1784
+ setup(e) {
1785
+ return typeof e == "function" ? (e(this), this) : super.setup(e);
1786
+ }
1787
+ default(e) {
1788
+ return this._defaultPath = Z(e), this;
1789
+ }
1790
+ mode(e) {
1791
+ if (e === void 0) return this._mode;
1792
+ let t = e === "history" ? "history" : "hash";
1793
+ if (t === this._mode) return this;
1794
+ let n = this._started;
1795
+ return n && this.stop(), this._mode = t, n && this.start(), this;
1796
+ }
1797
+ route(e, t) {
1798
+ let n = wi(e, t);
1799
+ return this._routes.push(n), this;
1800
+ }
1801
+ notFound(e) {
1802
+ return this._notFoundView = e, this;
1803
+ }
1804
+ loading(e) {
1805
+ return this._loadingView = e, this;
1806
+ }
1807
+ error(e) {
1808
+ return this._errorView = e, this;
1809
+ }
1810
+ beforeEach(e) {
1811
+ return this._beforeEach = e, this;
1812
+ }
1813
+ start() {
1814
+ !this._started && typeof window < "u" && (this._mode === "history" ? window.addEventListener("popstate", this._onPopState) : window.addEventListener("hashchange", this._onHashChange), this._started = !0);
1815
+ let e = Bi(this._mode);
1816
+ return (this._mode === "history" ? e === "/" || e === "/index.html" : !window.location.hash) && this._defaultPath ? this.navigate(this._defaultPath, { replace: !0 }) : this.refresh();
1817
+ }
1818
+ stop() {
1819
+ return this._started && typeof window < "u" && (this._mode === "history" ? window.removeEventListener("popstate", this._onPopState) : window.removeEventListener("hashchange", this._onHashChange), this._started = !1), this;
1820
+ }
1821
+ navigate(e, t = {}) {
1822
+ let n = Z(e), r = this._resolve(n);
1823
+ return this._canEnter(r.context) ? (Hi(n, t, this._mode) && !t.replace && this._mode === "hash" && (this._ignoreNextHashPath = n), this._renderResolved(r), this) : this;
1824
+ }
1825
+ refresh() {
1826
+ let e = Bi(this._mode), t = this._resolve(e);
1827
+ return this._canEnter(t.context) && this._renderResolved(t), this;
1828
+ }
1829
+ renderPath(e) {
1830
+ let t = this._resolve(e);
1831
+ return this._canEnter(t.context) && this._renderResolved(t), this;
1832
+ }
1833
+ currentPath() {
1834
+ return this._currentPath;
1835
+ }
1836
+ currentParams() {
1837
+ return { ...this._currentParams };
1838
+ }
1839
+ currentQuery() {
1840
+ return { ...this._currentQuery };
1841
+ }
1842
+ currentRoute() {
1843
+ return this._currentRoute;
1844
+ }
1845
+ currentView() {
1846
+ return this._currentView;
1847
+ }
1848
+ outlet(e) {
1849
+ if (e === void 0) return this._outlet;
1850
+ if (!(e instanceof h)) throw TypeError("Router outlet must be an ElementNode");
1851
+ return this._outlet = e, this;
1852
+ }
1853
+ subscribe(e) {
1854
+ if (typeof e != "function") throw TypeError("Router subscriber must be a function");
1855
+ return this._subscribers.add(e), () => this._subscribers.delete(e);
1856
+ }
1857
+ go(e) {
1858
+ return window.history.go(e), this;
1859
+ }
1860
+ back() {
1861
+ return this.go(-1);
1862
+ }
1863
+ forward() {
1864
+ return this.go(1);
1865
+ }
1866
+ destroy() {
1867
+ return this.stop(), this._navigationGeneration += 1, this._destroyCurrentView(), this._subscribers.clear(), super.destroy();
1868
+ }
1869
+ _resolve(e) {
1870
+ let t = this._routes.map((t) => ({
1871
+ route: t,
1872
+ match: Li(t.pattern, e)
1873
+ })).find(({ match: e }) => e);
1874
+ if (t) return {
1875
+ context: Ri(this, e, t.route, t.match),
1876
+ route: t.route,
1877
+ view: t.route.view
1878
+ };
1879
+ let n = Q(e);
1880
+ return {
1881
+ context: Ri(this, e, null, {
1882
+ params: {},
1883
+ pathname: n.pathname,
1884
+ query: n.query
1885
+ }),
1886
+ route: null,
1887
+ view: this._notFoundView
1888
+ };
1889
+ }
1890
+ _handleHashChange() {
1891
+ let e = zi();
1892
+ return this._ignoreNextHashPath === e ? (this._ignoreNextHashPath = null, this) : (this._ignoreNextHashPath = null, e === this._currentPath ? this : this.refresh());
1893
+ }
1894
+ _handlePopState() {
1895
+ return this._ignoreNextHashPath = null, this.refresh();
1896
+ }
1897
+ _canEnter(e) {
1898
+ let t = {
1899
+ params: this.currentParams(),
1900
+ path: this._currentPath,
1901
+ query: this.currentQuery(),
1902
+ route: this._currentRoute
1903
+ };
1904
+ return !(this._beforeEach && this._beforeEach(e, t, this) === !1 || e.route?.beforeEnter && e.route.beforeEnter(e, t, this) === !1);
1905
+ }
1906
+ _renderResolved(e) {
1907
+ let { context: t, route: n, view: r } = e, i = typeof r == "function" ? r(t) : r;
1908
+ if (this._navigationGeneration += 1, !Fi(i)) {
1909
+ this._commitView(e, X(i, t));
1910
+ return;
1911
+ }
1912
+ let a = this._navigationGeneration;
1913
+ this._commitView(e, this._buildLoadingView(n, t)), Promise.resolve(i).then((r) => {
1914
+ if (a !== this._navigationGeneration || this._deleted) return r;
1915
+ let i;
1916
+ try {
1917
+ i = X(r, t);
1918
+ } catch (i) {
1919
+ return this._commitView(e, this._buildErrorView(n, t, i)), r;
1920
+ }
1921
+ return this._commitView(e, i), r;
1922
+ }, (r) => (a !== this._navigationGeneration || this._deleted || this._commitView(e, this._buildErrorView(n, t, r)), r));
1923
+ }
1924
+ _commitView(e, t) {
1925
+ let { context: n, route: r } = e, i = this._outlet;
1926
+ this._destroyCurrentView(), i._children = [], i._el && i._el.replaceChildren(), i.child(t), this._currentPath = n.path, this._currentParams = n.params, this._currentQuery = n.query, this._currentRoute = r, this._currentView = t, this._subscribers.forEach((e) => e(n, this));
1927
+ }
1928
+ _buildLoadingView(e, t) {
1929
+ return Ii(e?.loading ?? this._loadingView ?? Ni, [t]);
1930
+ }
1931
+ _buildErrorView(e, t, n) {
1932
+ return Ii(e?.error ?? this._errorView ?? Pi, [n, t]);
1933
+ }
1934
+ _destroyCurrentView() {
1935
+ this._currentView?.destroy && this._currentView.destroy(), this._currentView = null;
1936
+ }
1937
+ };
1938
+ function _i(e = null, t = null, n = null) {
1939
+ let r = p(e, t, n), i = new gi(r.first);
1940
+ return m(i, r.options), typeof r.callback == "function" && r.callback(i), i;
1941
+ }
1942
+ var vi = _i;
1943
+ function yi(e, t) {
1944
+ return {
1945
+ config: t,
1946
+ pattern: e
1947
+ };
1948
+ }
1949
+ function bi(e = null, t = null, n = null) {
1950
+ let r = p(e, t, n), i = new gi();
1951
+ return i.vRoute = (e, t) => (i.route(e, t), i), Di(i, r.first), m(i, r.options), typeof r.callback == "function" && r.callback(i), i;
1952
+ }
1953
+ function xi(e, t = null, n = null) {
1954
+ Ti(e);
1955
+ let r = new h("a"), i = {
1956
+ exact: !0,
1957
+ label: null,
1958
+ params: {},
1959
+ query: {},
1960
+ replace: !1,
1961
+ to: "/"
1962
+ }, a = new h("span").className("yoya-vlink-label");
1963
+ r.className("yoya-vlink"), r.attr("data-router-link", "true"), r.child(a), r.to = (e) => Y(r, i, "to", e), r.params = (e) => Y(r, i, "params", e || {}), r.query = (e) => Y(r, i, "query", e || {}), r.replace = (e) => Y(r, i, "replace", !!e), r.exact = (e) => Y(r, i, "exact", !!e), r.label = (e) => e === void 0 ? i.label : (i.label = e, M(a, _n(e)), r), Oi(r, i, t), ki(r, i, e), r.on("click", (t) => {
1964
+ Mi(t, r) && (t.preventDefault(), e.navigate(Ai(i.to, i.params, i.query), { replace: i.replace }));
1965
+ });
1966
+ let o = e.subscribe(() => ki(r, i, e)), s = r.destroy.bind(r);
1967
+ return r.destroy = () => (o(), s()), typeof n == "function" && n(r), r;
1968
+ }
1969
+ function Si(e, t = null, n = null) {
1970
+ Ti(e);
1971
+ let r = new h("div");
1972
+ r.className("yoya-vrouter-view"), r.attr("data-router-view", "true"), typeof t == "function" ? t(r) : t && r.setup(t), e.outlet(r);
1973
+ let i = r.destroy.bind(r);
1974
+ return r.destroy = () => (e.outlet() === r && e.outlet(e), i()), typeof n == "function" && n(r), r;
1975
+ }
1976
+ function Ci(e, t = null, n = null) {
1977
+ Ti(e);
1978
+ let r = new h("div"), i = new h("header").className("yoya-vrouter-views-titlebar").attr({
1979
+ role: "tablist",
1980
+ "aria-label": "已打开页面"
1981
+ }), a = new h("div").className("yoya-vrouter-views-content"), o = d("⋯"), s = new h("button").className("yoya-vrouter-views-expand").attr({
1982
+ type: "button",
1983
+ "aria-expanded": "false",
1984
+ "aria-label": "展开全部标签"
1985
+ }).styles({
1986
+ alignItems: "center",
1987
+ background: "transparent",
1988
+ border: "0",
1989
+ color: O("color-text-secondary", "#57606a"),
1990
+ cursor: "pointer",
1991
+ display: "none",
1992
+ flexShrink: "0",
1993
+ font: "inherit",
1994
+ gap: "6px",
1995
+ height: "24px",
1996
+ justifyContent: "center",
1997
+ lineHeight: "1",
1998
+ marginBottom: "0",
1999
+ marginLeft: "auto",
2000
+ minWidth: "24px",
2001
+ padding: "0",
2002
+ position: "sticky",
2003
+ right: "8px",
2004
+ zIndex: "2"
2005
+ }).child(o), c = new h("div").className("yoya-vrouter-views-popup").attr({
2006
+ role: "menu",
2007
+ "aria-label": "已打开页面"
2008
+ }).styles({
2009
+ background: O("color-surface", "#ffffff"),
2010
+ border: k("color-border", "#d0d7de"),
2011
+ borderRadius: "8px",
2012
+ boxShadow: "0 12px 28px rgba(15, 23, 42, 0.18)",
2013
+ display: "none",
2014
+ maxHeight: "280px",
2015
+ maxWidth: "260px",
2016
+ minWidth: "180px",
2017
+ msOverflowStyle: "none",
2018
+ overflowY: "auto",
2019
+ padding: "6px",
2020
+ position: "fixed",
2021
+ scrollbarWidth: "none",
2022
+ zIndex: "100"
2023
+ }), l = {
2024
+ lockTitle: !1,
2025
+ overflow: !1,
2026
+ persist: !0,
2027
+ popupOpen: !1,
2028
+ storageKey: mi(e),
2029
+ suppressPersist: !1,
2030
+ tabs: /* @__PURE__ */ new Map(),
2031
+ title: "工作区",
2032
+ titleResolver: null,
2033
+ titlePosition: "top"
2034
+ };
2035
+ r.className("yoya-vrouter-views"), r.styles({
2036
+ border: k("color-border", "#d0d7de"),
2037
+ borderRadius: "8px",
2038
+ overflow: "hidden"
2039
+ }), i.styles({
2040
+ background: O("color-surface-hover", "#f6f8fa"),
2041
+ borderBottom: k("color-border", "#d0d7de"),
2042
+ boxSizing: "border-box",
2043
+ color: O("color-text-secondary", "#57606a"),
2044
+ display: "flex",
2045
+ flexWrap: "nowrap",
2046
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
2047
+ fontSize: "13px",
2048
+ gap: "4px",
2049
+ msOverflowStyle: "none",
2050
+ overflowX: "auto",
2051
+ overflowY: "hidden",
2052
+ padding: "0px 0px",
2053
+ scrollbarWidth: "none",
2054
+ width: "100%"
2055
+ }), a.className("yoya-vrouter-views-content"), a.styles({
2056
+ minHeight: "120px",
2057
+ padding: "16px"
2058
+ }), r.child(i, a, c);
2059
+ let u = () => {
2060
+ let e = l.titlePosition !== "top";
2061
+ if (l.lockTitle) {
2062
+ r.styles({
2063
+ display: "flex",
2064
+ flexDirection: e ? "row" : "column",
2065
+ height: "100%",
2066
+ minHeight: "0",
2067
+ overflow: "hidden"
2068
+ }), i.style("flex", "0 0 auto"), a.styles({
2069
+ flex: "1 1 auto",
2070
+ minHeight: "0",
2071
+ minWidth: "0",
2072
+ overflow: "auto"
2073
+ });
2074
+ return;
2075
+ }
2076
+ r.styles({
2077
+ flexDirection: null,
2078
+ height: null,
2079
+ minHeight: null,
2080
+ overflow: "hidden"
2081
+ }), i.style("flex", null), a.styles({
2082
+ flex: e ? "1 1 auto" : null,
2083
+ minHeight: "120px",
2084
+ minWidth: e ? "0" : null,
2085
+ overflow: null
2086
+ });
2087
+ }, f = (e) => {
2088
+ let t = e !== "top";
2089
+ r.styles({
2090
+ alignItems: t ? "stretch" : null,
2091
+ display: t ? "flex" : null
2092
+ }), i.styles({
2093
+ background: O("color-surface-hover", "#f6f8fa"),
2094
+ borderBottom: t ? null : k("color-border", "#d0d7de"),
2095
+ borderLeft: e === "right" ? "1px solid" : null,
2096
+ borderLeftColor: e === "right" ? O("color-border", "#d0d7de") : null,
2097
+ borderLeftStyle: e === "right" ? "solid" : null,
2098
+ borderLeftWidth: e === "right" ? "1px" : null,
2099
+ borderRight: e === "left" ? "1px solid" : null,
2100
+ borderRightColor: e === "left" ? O("color-border", "#d0d7de") : null,
2101
+ borderRightStyle: e === "left" ? "solid" : null,
2102
+ borderRightWidth: e === "left" ? "1px" : null,
2103
+ boxSizing: "border-box",
2104
+ color: O("color-text-secondary", "#57606a"),
2105
+ display: "flex",
2106
+ flexDirection: t ? "column" : "row",
2107
+ flexShrink: t ? "0" : null,
2108
+ flexWrap: "nowrap",
2109
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
2110
+ fontSize: "13px",
2111
+ gap: "4px",
2112
+ msOverflowStyle: "none",
2113
+ overflowX: t ? "hidden" : "auto",
2114
+ overflowY: t ? "auto" : "hidden",
2115
+ padding: t ? "10px 8px" : "0px 0px",
2116
+ scrollbarWidth: "none",
2117
+ width: t ? null : "100%"
2118
+ }), a.styles({
2119
+ flex: t ? "1 1 auto" : null,
2120
+ minWidth: t ? "0" : null
2121
+ });
2122
+ let n = e === "right" ? [
2123
+ a,
2124
+ i,
2125
+ c
2126
+ ] : [
2127
+ i,
2128
+ a,
2129
+ c
2130
+ ];
2131
+ r.clearChildren().child(n), r._el && n.forEach((e) => {
2132
+ let t = e.renderDom();
2133
+ t && r._el.appendChild(t);
2134
+ }), u();
2135
+ }, p = (e = {}) => {
2136
+ let t = l.title, n = e.route?.title;
2137
+ if (n !== void 0 && (t = typeof n == "function" ? n(e) : n), l.titleResolver) {
2138
+ let n = l.titleResolver(e);
2139
+ n != null && (t = typeof n == "function" ? n(e) : n);
2140
+ }
2141
+ return t ?? "";
2142
+ }, m = (e, t) => {
2143
+ let n = l.titlePosition, r = n !== "top";
2144
+ e.renderDom().querySelector(".yoya-vrouter-views-label")?.setAttribute("aria-selected", String(t)), e.styles({
2145
+ background: t ? O("color-surface", "#ffffff") : O("color-surface-active", "#eaeef2"),
2146
+ border: k("color-border", "#d0d7de"),
2147
+ borderBottomColor: n === "top" && t ? O("color-surface", "#ffffff") : O("color-border", "#d0d7de"),
2148
+ borderLeftColor: n === "right" && t ? O("color-surface", "#ffffff") : O("color-border", "#d0d7de"),
2149
+ borderRadius: n === "left" ? "6px 0 0 6px" : n === "right" ? "0 6px 6px 0" : "6px 6px 0 0",
2150
+ borderRightColor: n === "left" && t ? O("color-surface", "#ffffff") : O("color-border", "#d0d7de"),
2151
+ color: t ? O("color-text", "#24292f") : O("color-text-secondary", "#57606a"),
2152
+ fontWeight: t ? "600" : "400",
2153
+ marginBottom: n === "top" ? "-9px" : "0",
2154
+ marginLeft: n === "right" ? "-9px" : "0",
2155
+ marginRight: n === "left" ? "-9px" : "0",
2156
+ padding: r ? "8px 10px" : "7px 14px 8px"
2157
+ });
2158
+ }, g = (e) => {
2159
+ l.overflow = !!e, r.attr("data-title-overflow", l.overflow ? "true" : null), s.style("display", l.overflow ? "inline-flex" : "none");
2160
+ }, _ = () => {
2161
+ if (l.titlePosition !== "top" || l.tabs.size <= q) {
2162
+ g(!1);
2163
+ return;
2164
+ }
2165
+ g(!0);
2166
+ }, v = () => {
2167
+ let e = Array.from(l.tabs.entries()), t = e.slice(0, q).map(([, e]) => e.tab).filter((e) => e !== s);
2168
+ if (!(e.length > q && l.titlePosition === "top")) {
2169
+ l.popupOpen && x(), i._children = t, i._childrenDirty = !0, i._el ? i._el.replaceChildren(...t.map((e) => e.renderDom()).filter(Boolean)) : s._el?.remove(), g(!1);
2170
+ return;
2171
+ }
2172
+ if (i._children = [...t, s], i._childrenDirty = !0, i._el) {
2173
+ let e = t.map((e) => e.renderDom()).filter(Boolean);
2174
+ i._el.replaceChildren(...e, s.renderDom());
2175
+ }
2176
+ _();
2177
+ }, y = () => {
2178
+ if (!(!l.persist || l.suppressPersist || typeof localStorage > "u")) try {
2179
+ localStorage.setItem(l.storageKey, JSON.stringify({
2180
+ activePath: e.currentPath(),
2181
+ paths: Array.from(l.tabs.keys())
2182
+ }));
2183
+ } catch {}
2184
+ }, b = null, x = () => {
2185
+ l.popupOpen = !1, r.attr("data-title-popup", null), s.attr("aria-expanded", "false"), c.style("display", "none"), b &&= (b(), null);
2186
+ }, S = () => {
2187
+ c.clearChildren(), c._el && c._el.replaceChildren(), Array.from(l.tabs.entries()).slice(q).forEach(([t, n]) => {
2188
+ let r = n.text.textContent(), i = new h("div").className("yoya-vrouter-views-popup-item").attr({
2189
+ role: "menuitem",
2190
+ tabIndex: "0",
2191
+ "data-router-view-path": t
2192
+ }).styles({
2193
+ alignItems: "center",
2194
+ borderRadius: "6px",
2195
+ color: O("color-text", "#24292f"),
2196
+ cursor: "pointer",
2197
+ display: "flex",
2198
+ fontSize: "13px",
2199
+ gap: "8px",
2200
+ padding: "7px 8px",
2201
+ width: "100%"
2202
+ }), a = new h("span").className("yoya-vrouter-views-popup-title").styles({
2203
+ flex: "1",
2204
+ minWidth: "0",
2205
+ overflow: "hidden",
2206
+ textOverflow: "ellipsis",
2207
+ whiteSpace: "nowrap"
2208
+ }).text(r), o = new h("button").className("yoya-vrouter-views-popup-close").attr({
2209
+ type: "button",
2210
+ "aria-label": `关闭 ${r}`
2211
+ }).styles({
2212
+ background: "transparent",
2213
+ border: "0",
2214
+ color: "inherit",
2215
+ cursor: "pointer",
2216
+ flexShrink: "0",
2217
+ font: "inherit",
2218
+ lineHeight: "1",
2219
+ padding: "2px 4px"
2220
+ }).text("×");
2221
+ t === e.currentPath() && (i.attr("aria-current", "true"), i.styles({
2222
+ background: O("color-primary-subtle", "#e8f0fe"),
2223
+ color: O("color-primary", "#1f6feb")
2224
+ }));
2225
+ let s = () => {
2226
+ x(), e.navigate(t);
2227
+ };
2228
+ i.on("click", s), i.on("keydown", (e) => {
2229
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), s());
2230
+ }), o.on("click", (e) => {
2231
+ e.stopPropagation(), C(t, e), l.popupOpen && S();
2232
+ }), i.child(a, o), c.child(i);
2233
+ });
2234
+ }, ee = () => {
2235
+ if (l.tabs.size === 0) return;
2236
+ pi(), S(), l.popupOpen = !0, r.attr("data-title-popup", "true"), s.attr("aria-expanded", "true"), c.styles({ display: "block" }), a();
2237
+ let e = (e) => {
2238
+ !c._el?.contains(e.target) && !s._el?.contains(e.target) && x();
2239
+ }, t = (e) => {
2240
+ e.key === "Escape" && x();
2241
+ }, n = () => a(), i = () => a();
2242
+ document.addEventListener("click", e), document.addEventListener("keydown", t), window.addEventListener("scroll", n, !0), window.addEventListener("resize", i), b = () => {
2243
+ document.removeEventListener("click", e), document.removeEventListener("keydown", t), window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", i);
2244
+ };
2245
+ function a() {
2246
+ let e = s._el?.getBoundingClientRect(), t = c._el?.getBoundingClientRect();
2247
+ if (!e || !t) return;
2248
+ let n = window.innerWidth || document.documentElement?.clientWidth || 0, r = window.innerHeight || document.documentElement?.clientHeight || 0, i = e.right - t.width;
2249
+ i = Math.max(8, Math.min(i, n - t.width - 8));
2250
+ let a = e.bottom + 4;
2251
+ a + t.height + 8 > r && (a = Math.max(8, e.top - t.height - 4)), c.styles({
2252
+ left: `${i}px`,
2253
+ top: `${a}px`
2254
+ });
2255
+ }
2256
+ };
2257
+ s.on("click", () => {
2258
+ l.popupOpen ? x() : ee();
2259
+ });
2260
+ let te = r.renderDom.bind(r);
2261
+ r.renderDom = () => {
2262
+ pi();
2263
+ let e = te();
2264
+ return _(), e;
2265
+ }, r.updateOverflow = _, r.titlePosition = (t) => {
2266
+ if (t === void 0) return l.titlePosition;
2267
+ let n = Ei(t);
2268
+ return l.titlePosition = n, n !== "top" && l.popupOpen && x(), r.attr("data-title-position", l.titlePosition), i.attr("aria-orientation", l.titlePosition === "top" ? "horizontal" : "vertical"), f(l.titlePosition), v(), l.tabs.forEach(({ tab: t }, n) => {
2269
+ m(t, n === e.currentPath());
2270
+ }), _(), r;
2271
+ }, r.titlePosition(l.titlePosition), r.lockTitle = (e = !0) => e === void 0 ? l.lockTitle : (l.lockTitle = !!e, r.attr("data-title-locked", l.lockTitle ? "true" : null), f(l.titlePosition), _(), r), r.titleLocked = r.lockTitle;
2272
+ let C = (t, n = null) => {
2273
+ n && n.stopPropagation();
2274
+ let r = Array.from(l.tabs.entries()).findIndex(([e]) => e === t), o = l.tabs.get(t);
2275
+ if (!o) return;
2276
+ let s = o.tab.renderDom().querySelector(".yoya-vrouter-views-label").getAttribute("aria-selected") === "true";
2277
+ if (l.tabs.delete(t), i._children = i.children().filter((e) => e !== o.tab), i._childrenDirty = !0, o.tab.destroy(), v(), y(), !s) return;
2278
+ let c = Array.from(l.tabs.keys());
2279
+ if (c.length > 0) {
2280
+ let t = c[Math.min(r, c.length - 1)];
2281
+ e.navigate(t, { replace: !0 });
2282
+ return;
2283
+ }
2284
+ a.clearChildren().commit(), e._navigationGeneration += 1, e._currentView = null;
2285
+ }, w = new h("div").className("yoya-vrouter-views-context").attr({
2286
+ role: "menu",
2287
+ "aria-label": "标签页操作"
2288
+ }).styles({
2289
+ background: O("color-surface", "#ffffff"),
2290
+ border: k("color-border", "#d0d7de"),
2291
+ borderRadius: "8px",
2292
+ boxShadow: "0 12px 28px rgba(15, 23, 42, 0.18)",
2293
+ display: "none",
2294
+ minWidth: "180px",
2295
+ padding: "6px",
2296
+ position: "fixed",
2297
+ zIndex: "100"
2298
+ }), T = null, E = () => {
2299
+ w.styles({ display: "none" }), w.clearChildren(), w._el?.remove(), T &&= (T(), null);
2300
+ }, D = (t, n = null) => {
2301
+ let r = new Set(t), o = Array.from(l.tabs.entries()), s = o.findIndex(([e]) => r.has(e));
2302
+ if (o.forEach(([e, t]) => {
2303
+ r.has(e) && (l.tabs.delete(e), i._children = i.children().filter((e) => e !== t.tab), i._childrenDirty = !0, t.tab.destroy());
2304
+ }), v(), y(), l.popupOpen && S(), !r.has(e.currentPath())) return;
2305
+ let c = Array.from(l.tabs.keys());
2306
+ if (c.length === 0) {
2307
+ a.clearChildren().commit(), e._navigationGeneration += 1, e._currentView = null;
2308
+ return;
2309
+ }
2310
+ let u = n && l.tabs.has(n) ? n : c[Math.min(Math.max(s, 0), c.length - 1)];
2311
+ e.navigate(u, { replace: !0 });
2312
+ }, ne = (t) => {
2313
+ if (typeof navigator > "u" || !navigator.clipboard) return;
2314
+ let n = typeof window > "u" ? "" : window.location.origin, r = typeof window > "u" ? "" : window.location.pathname, i = e.mode() === "history" ? `${n}${r}${t}` : `${n}${r}#${t}`;
2315
+ navigator.clipboard.writeText(i).catch(() => {});
2316
+ }, re = (t, n) => {
2317
+ l.popupOpen && x(), E();
2318
+ let r = Array.from(l.tabs.entries()), i = r.findIndex(([e]) => e === t), a = () => D(r.filter(([e]) => e !== t).map(([e]) => e), t), o = () => D(r.slice(0, i).map(([e]) => e), t), s = () => D(r.slice(i + 1).map(([e]) => e), t), c = () => D(r.map(([e]) => e)), u = (e, t, n = !1, r = !1) => {
2319
+ let i = new h("div").className("yoya-vrouter-views-context-item").attr({
2320
+ role: "menuitem",
2321
+ tabIndex: "0"
2322
+ }).text(e).styles({
2323
+ alignItems: "center",
2324
+ borderRadius: "6px",
2325
+ color: n ? O("color-text-danger", "#b91c1c") : O("color-text", "#24292f"),
2326
+ cursor: r ? "default" : "pointer",
2327
+ display: "flex",
2328
+ fontSize: "13px",
2329
+ gap: "8px",
2330
+ padding: "7px 10px",
2331
+ width: "100%"
2332
+ });
2333
+ return r ? (i.attr("aria-disabled", "true"), i.styles({ opacity: "0.4" })) : i.on("click", () => {
2334
+ E(), t();
2335
+ }), w.child(i), i;
2336
+ }, d = () => w.child(new h("div").className("yoya-vrouter-views-context-separator"));
2337
+ u("刷新", () => e.navigate(t, { replace: !0 })), u("复制链接", () => ne(t)), d(), u("关闭", () => C(t), !0), u("关闭其他", a, !1, r.length <= 1), u("关闭左侧", o, !1, i <= 0), u("关闭右侧", s, !1, i === r.length - 1), d(), u("关闭全部", c, !0, r.length === 0), document.body.appendChild(w.renderDom()), w.styles({ display: "block" });
2338
+ let f = w._el.getBoundingClientRect(), p = typeof window > "u" ? 0 : window.innerWidth || 0, m = typeof window > "u" ? 0 : window.innerHeight || 0, g = Math.max(8, Math.min(n.clientX || 0, p - f.width - 8)), _ = Math.max(8, Math.min(n.clientY || 0, m - f.height - 8));
2339
+ w.styles({
2340
+ left: `${g}px`,
2341
+ top: `${_}px`
2342
+ });
2343
+ let v = (e) => {
2344
+ w._el?.contains(e.target) || E();
2345
+ }, y = (e) => {
2346
+ e.key === "Escape" && E();
2347
+ }, b = () => E();
2348
+ document.addEventListener("mousedown", v), document.addEventListener("keydown", y), window.addEventListener("scroll", b, !0), window.addEventListener("resize", b), T = () => {
2349
+ document.removeEventListener("mousedown", v), document.removeEventListener("keydown", y), window.removeEventListener("scroll", b, !0), window.removeEventListener("resize", b);
2350
+ };
2351
+ }, ie = (t = {}) => {
2352
+ let n = t.path || e.currentPath(), r = new Set(l.titlePosition === "top" ? Array.from(l.tabs.keys()).slice(0, q) : Array.from(l.tabs.keys())), a = l.tabs.get(n);
2353
+ if (a) {
2354
+ let e = p(t);
2355
+ a.text.textContent(e), a.closeButton.attr("aria-label", `关闭 ${e}`);
2356
+ } else {
2357
+ let r = new h("div").className("yoya-vrouter-views-title"), o = d(p(t)), s = new h("button").className("yoya-vrouter-views-label").child(o), c = new h("button").className("yoya-vrouter-views-close");
2358
+ r.attr({ "data-router-view-path": n }), r.styles({
2359
+ alignItems: "center",
2360
+ cursor: "pointer",
2361
+ display: "inline-flex",
2362
+ font: "inherit",
2363
+ gap: "8px",
2364
+ whiteSpace: "nowrap"
2365
+ }), s.attr({
2366
+ role: "tab",
2367
+ type: "button"
2368
+ }), s.styles({
2369
+ background: "transparent",
2370
+ border: "0",
2371
+ color: "inherit",
2372
+ cursor: "pointer",
2373
+ font: "inherit",
2374
+ padding: "0"
2375
+ }), s.on("click", () => e.navigate(n)), c.attr({
2376
+ type: "button",
2377
+ "aria-label": `关闭 ${p(t)}`
2378
+ }), c.styles({
2379
+ background: "transparent",
2380
+ border: "0",
2381
+ color: "inherit",
2382
+ cursor: "pointer",
2383
+ font: "inherit",
2384
+ lineHeight: "1",
2385
+ padding: "0"
2386
+ }), c.text("×"), c.on("click", (e) => C(n, e)), r.on("contextmenu", (e) => {
2387
+ e.preventDefault(), e.stopPropagation(), re(n, e);
2388
+ }), r.child(s, c), i.child(r), m(r, !1), a = {
2389
+ closeButton: c,
2390
+ tab: r,
2391
+ text: o
2392
+ }, l.tabs.set(n, a);
2393
+ }
2394
+ r.has(n) || (l.tabs.delete(n), l.tabs = new Map([[n, a], ...l.tabs])), l.tabs.forEach(({ tab: e }, t) => m(e, t === n)), v(), l.popupOpen && S(), y();
2395
+ }, ae = () => {
2396
+ if (!l.persist) return;
2397
+ let t = hi(l.storageKey);
2398
+ if (t) {
2399
+ l.suppressPersist = !0;
2400
+ try {
2401
+ t.paths.slice().reverse().forEach((t) => {
2402
+ let n = e._resolve(t);
2403
+ ie({
2404
+ ...n.context,
2405
+ path: t
2406
+ });
2407
+ });
2408
+ } finally {
2409
+ l.suppressPersist = !1, y();
2410
+ }
2411
+ }
2412
+ };
2413
+ if (typeof t == "function") t(r);
2414
+ else if (t && typeof t == "object") {
2415
+ let { persist: e, storageKey: n, title: i, titlePosition: a, titleResolver: o, ...s } = t;
2416
+ i !== void 0 && (l.title = i), e !== void 0 && (l.persist = !!e), n !== void 0 && (l.storageKey = n), a !== void 0 && r.titlePosition(a), typeof o == "function" && (l.titleResolver = o), Object.keys(s).length > 0 && r.setup(s);
2417
+ }
2418
+ e.outlet(a), ae(), (e.currentRoute() || e.currentPath() !== "/") && ie({
2419
+ params: e.currentParams(),
2420
+ path: e.currentPath(),
2421
+ query: e.currentQuery(),
2422
+ route: e.currentRoute(),
2423
+ router: e
2424
+ });
2425
+ let oe = e.subscribe((e) => ie(e)), se = () => _();
2426
+ typeof window < "u" && window.addEventListener("resize", se);
2427
+ let ce = r.destroy.bind(r);
2428
+ return r.destroy = () => (l.popupOpen && x(), E(), typeof window < "u" && window.removeEventListener("resize", se), oe(), e.outlet() === a && e.outlet(e), ce()), typeof n == "function" && n(r), r;
2429
+ }
2430
+ _(h, {
2431
+ vLink: xi,
2432
+ vRouter: bi,
2433
+ vRouterView: Si,
2434
+ vRouterViews: Ci
2435
+ });
2436
+ function wi(e, t) {
2437
+ let n = {
2438
+ beforeEnter: null,
2439
+ error: null,
2440
+ loading: null,
2441
+ pattern: Ui(e),
2442
+ title: null,
2443
+ view: null
2444
+ };
2445
+ return typeof t == "function" || t instanceof c || Gi(t) ? (n.view = t, n) : (t && typeof t == "object" && (n.beforeEnter = t.beforeEnter || null, n.error = t.error ?? null, n.loading = t.loading ?? null, n.title = t.title ?? null, n.view = t.view || t.component || null), n);
2446
+ }
2447
+ function Ti(e) {
2448
+ if (!(e instanceof gi)) throw TypeError("vLink and vRouterView require a Router instance");
2449
+ }
2450
+ function Ei(e) {
2451
+ return e === "left" || e === "right" ? e : "top";
2452
+ }
2453
+ function Di(e, t) {
2454
+ if (typeof t == "function") return t(e), e;
2455
+ if (!t || typeof t != "object") return e;
2456
+ let { beforeEach: n, default: r, error: i, loading: a, notFound: o, routes: s = [], ...c } = t;
2457
+ return Object.keys(c).length && e.setup(c), r !== void 0 && e.default(r), n && e.beforeEach(n), a !== void 0 && e.loading(a), i !== void 0 && e.error(i), s.forEach((t) => {
2458
+ t?.pattern !== void 0 && e.vRoute(t.pattern, t.config);
2459
+ }), o !== void 0 && e.notFound(o), e;
2460
+ }
2461
+ function Oi(e, t, n) {
2462
+ if (typeof n == "function") {
2463
+ n(e);
2464
+ return;
2465
+ }
2466
+ if (typeof n == "string") {
2467
+ e.to(n), e.label(n);
2468
+ return;
2469
+ }
2470
+ if (!n) return;
2471
+ let { exact: r, label: i, params: a, query: o, replace: s, to: c, ...l } = n;
2472
+ Object.keys(l).length && e.setup(l), c !== void 0 && (t.to = c), a !== void 0 && (t.params = a || {}), o !== void 0 && (t.query = o || {}), s !== void 0 && (t.replace = !!s), r !== void 0 && (t.exact = !!r), t.label = i ?? t.to, e.label(t.label);
2473
+ }
2474
+ function Y(e, t, n, r) {
2475
+ if (r === void 0) return t[n];
2476
+ t[n] = r, n === "to" && t.label === null && M(e.children()[0], _n(r));
2477
+ let i = e._routerInstance;
2478
+ return i && ki(e, t, i), e;
2479
+ }
2480
+ function ki(e, t, n) {
2481
+ e._routerInstance = n;
2482
+ let r = Ai(t.to, t.params, t.query), i = ji(n.currentPath(), r, t.exact), a = new Set(String(e.attr("class") || "").split(/\s+/).filter(Boolean));
2483
+ return a.add("yoya-vlink"), i ? a.add("is-active") : a.delete("is-active"), e.attr({
2484
+ "aria-current": i ? "page" : null,
2485
+ class: [...a].join(" "),
2486
+ href: n.mode() === "history" ? r : `#${r}`
2487
+ }), e;
2488
+ }
2489
+ function Ai(e, t, n) {
2490
+ let [r, i = ""] = Z(e).split("?"), a = r.replace(/:([A-Za-z0-9_]+)/g, (e, n) => t[n] === void 0 ? e : encodeURIComponent(t[n])), o = new URLSearchParams(i);
2491
+ Object.entries(n || {}).forEach(([e, t]) => {
2492
+ o.delete(e), Array.isArray(t) ? t.forEach((t) => o.append(e, t)) : t != null && o.set(e, t);
2493
+ });
2494
+ let s = o.toString();
2495
+ return s ? `${a}?${s}` : a;
2496
+ }
2497
+ function ji(e, t, n) {
2498
+ let r = Z(e), i = Z(t);
2499
+ if (n) return r === i;
2500
+ let a = Q(r).pathname, o = Q(i).pathname;
2501
+ return a === o || a.startsWith(`${o}/`);
2502
+ }
2503
+ function Mi(e, t) {
2504
+ return !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey && (!t.attr("target") || t.attr("target") === "_self");
2505
+ }
2506
+ function X(e, t) {
2507
+ if (e instanceof c) return e;
2508
+ if (e == null) return d("");
2509
+ if (Gi(e)) return d(e);
2510
+ if (typeof e == "object" && e && e.default !== void 0 && typeof e.render != "function") return X(e.default, t);
2511
+ if (typeof e == "function") return X(e(t), t);
2512
+ if (typeof e == "object" && typeof e.render == "function") return X(e.render(), t);
2513
+ throw TypeError("Router route view must be a ViewNode, string, number, null, undefined, a render() component object, a factory returning one, or a module with a default export");
2514
+ }
2515
+ var Ni = () => "加载中…", Pi = (e) => `加载失败:${e?.message ?? String(e)}`;
2516
+ function Fi(e) {
2517
+ return e !== null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
2518
+ }
2519
+ function Ii(e, t) {
2520
+ return X(typeof e == "function" ? e(...t) : e, t[t.length - 1]);
2521
+ }
2522
+ function Li(e, t) {
2523
+ let n = Q(e), r = Q(t), i = Wi(n.pathname), a = Wi(r.pathname);
2524
+ if (i.length !== a.length) return null;
2525
+ let o = {};
2526
+ for (let e = 0; e < i.length; e += 1) {
2527
+ let t = i[e], n = a[e];
2528
+ if (t.startsWith(":")) {
2529
+ o[t.slice(1)] = decodeURIComponent(n);
2530
+ continue;
2531
+ }
2532
+ if (t !== n) return null;
2533
+ }
2534
+ return {
2535
+ params: o,
2536
+ pathname: r.pathname,
2537
+ query: r.query
2538
+ };
2539
+ }
2540
+ function Ri(e, t, n, r) {
2541
+ return {
2542
+ params: { ...r.params },
2543
+ path: t,
2544
+ pathname: r.pathname,
2545
+ query: { ...r.query },
2546
+ route: n,
2547
+ router: e
2548
+ };
2549
+ }
2550
+ function zi() {
2551
+ return typeof window > "u" ? "/" : Z(window.location.hash.replace(/^#/, "") || "/");
2552
+ }
2553
+ function Bi(e = "hash") {
2554
+ return typeof window > "u" ? "/" : e === "history" ? Z(`${window.location.pathname}${window.location.search}`) : zi();
2555
+ }
2556
+ function Vi(e, t = {}) {
2557
+ if (typeof window > "u") return !1;
2558
+ let n = `#${e}`;
2559
+ return t.replace ? (window.history.replaceState(null, "", n), !0) : window.location.hash !== n && (window.location.hash = n, !0);
2560
+ }
2561
+ function Hi(e, t = {}, n = "hash") {
2562
+ if (typeof window > "u") return !1;
2563
+ if (n !== "history") return Vi(e, t);
2564
+ let r = Z(e), i = Bi("history");
2565
+ return !t.replace && i === r ? !1 : (t.replace ? window.history.replaceState(null, "", r) : window.history.pushState(null, "", r), !0);
2566
+ }
2567
+ function Ui(e) {
2568
+ return Z(e).split("?")[0] || "/";
2569
+ }
2570
+ function Z(e) {
2571
+ let [t, n = ""] = String(e || "/").replace(/^#/, "").split("?"), r = t.startsWith("/") ? t : `/${t}`, i = r.length > 1 ? r.replace(/\/+$/, "") : r;
2572
+ return n ? `${i}?${n}` : i;
2573
+ }
2574
+ function Q(e) {
2575
+ let [t, n = ""] = Z(e).split("?");
2576
+ return {
2577
+ pathname: t,
2578
+ query: Object.fromEntries(new URLSearchParams(n))
2579
+ };
2580
+ }
2581
+ function Wi(e) {
2582
+ return e.split("/").filter(Boolean);
2583
+ }
2584
+ function Gi(e) {
2585
+ return typeof e == "string" || typeof e == "number";
2586
+ }
2587
+ //#endregion
2588
+ //#region src/core/id.js
2589
+ var Ki = null;
2590
+ function qi() {
2591
+ let e = 0;
2592
+ return { next() {
2593
+ return e += 1, e;
2594
+ } };
2595
+ }
2596
+ function Ji(e, t) {
2597
+ let n = Ki;
2598
+ Ki = e;
2599
+ try {
2600
+ return t();
2601
+ } finally {
2602
+ Ki = n;
2603
+ }
2604
+ }
2605
+ //#endregion
369
2606
  //#region src/core/ssr.js
370
- function M(e = {}, t = {}) {
2607
+ function Yi(e = {}, t = {}) {
371
2608
  let { cookie: n = "", url: r = "", acceptLanguage: i = "" } = e || {}, { cookieKey: a = "yoya-lang", queryKey: o = "locale", defaultLanguage: s = "zh-CN" } = t;
372
- return N(n, a) || P(r, o) || F(i) || s;
2609
+ return Xi(n, a) || Zi(r, o) || Qi(i) || s;
373
2610
  }
374
- function N(e, t) {
2611
+ function Xi(e, t) {
375
2612
  if (!e || !t) return null;
376
2613
  for (let n of String(e).split(";")) {
377
2614
  let e = n.indexOf("=");
@@ -386,37 +2623,37 @@ function N(e, t) {
386
2623
  }
387
2624
  return null;
388
2625
  }
389
- function P(e, t) {
2626
+ function Zi(e, t) {
390
2627
  if (!e || !t) return null;
391
2628
  let n = String(e).indexOf("?");
392
2629
  return n === -1 ? null : new URLSearchParams(String(e).slice(n + 1)).get(t) || null;
393
2630
  }
394
- function F(e) {
2631
+ function Qi(e) {
395
2632
  if (!e) return null;
396
2633
  let t = String(e).split(",")[0];
397
2634
  return t && t.split(";")[0].trim() || null;
398
2635
  }
399
- function I(e, t, n) {
400
- return e ? _(typeof e == "function" ? e(t) : e, n) : n();
2636
+ function $i(e, t, n) {
2637
+ return e ? Ir(typeof e == "function" ? e(t) : e, n) : n();
401
2638
  }
402
- function L(e, t = null) {
403
- if (e instanceof n) return e;
404
- if (typeof e == "function") return L(e(t), t);
405
- if (e && typeof e.render == "function") return L(e.render(), t);
2639
+ function $(e, t = null) {
2640
+ if (e instanceof c) return e;
2641
+ if (typeof e == "function") return $(e(t), t);
2642
+ if (e && typeof e.render == "function") return $(e.render(), t);
406
2643
  throw TypeError("renderToString/mount requires a ViewNode, a component object with render(), or a factory function");
407
2644
  }
408
- function R(e) {
2645
+ function ea(e) {
409
2646
  let t = 1;
410
2647
  return typeof e.children == "function" && e.children().forEach((e) => {
411
- t += R(e instanceof i ? e._resolve() : e);
2648
+ t += ea(e instanceof u ? e._resolve() : e);
412
2649
  }), t;
413
2650
  }
414
- function z(e, t = {}) {
415
- let { maxNodes: n = Infinity, state: r = null, i18n: i = null } = t || {}, a = B(r);
416
- return c(s(), () => I(i, r, () => {
417
- let t = typeof e == "function", i = L(e, r), o;
2651
+ function ta(e, t = {}) {
2652
+ let { maxNodes: n = Infinity, state: r = null, i18n: i = null } = t || {}, a = oa(r);
2653
+ return Ji(qi(), () => $i(i, r, () => {
2654
+ let t = typeof e == "function", i = $(e, r), o;
418
2655
  try {
419
- o = R(i) > n ? {
2656
+ o = ea(i) > n ? {
420
2657
  exceeded: !0,
421
2658
  html: "",
422
2659
  state: a
@@ -431,61 +2668,112 @@ function z(e, t = {}) {
431
2668
  return o;
432
2669
  }));
433
2670
  }
434
- function B(e) {
2671
+ var na = class extends v {
2672
+ constructor() {
2673
+ super("html", null), this._headCallback = null, this._bodyCallback = null;
2674
+ }
2675
+ head(e) {
2676
+ return this._headCallback = typeof e == "function" ? e : null, this;
2677
+ }
2678
+ body(e) {
2679
+ return this._bodyCallback = typeof e == "function" ? e : null, this;
2680
+ }
2681
+ vBody(...e) {
2682
+ return this.body((t) => t.vBody(...e));
2683
+ }
2684
+ };
2685
+ function ra(e) {
2686
+ return String(e ?? "").replace(/&/g, "&amp;").replace(/"/g, "&quot;");
2687
+ }
2688
+ function ia(e, t = {}, n = {}) {
2689
+ let { client: r = "/client.js", containerId: i = "app", i18n: a = null, maxNodes: o = Infinity, messages: s, stateId: c = "__YOYA_DATA__" } = n || {}, l = t || {};
2690
+ if (!e || typeof e.page != "function") throw TypeError("renderPage requires { page: (page, state) => {} }");
2691
+ let u = a || (s ? () => Nr({
2692
+ language: l.lang || "zh-CN",
2693
+ messages: s
2694
+ }) : null), d = oa(l);
2695
+ return Ji(qi(), () => $i(u, l, () => {
2696
+ let t = new na();
2697
+ e.page(t, l);
2698
+ let n = new v("head");
2699
+ t._headCallback && t._headCallback(n, l);
2700
+ let a = new v("body");
2701
+ t._bodyCallback && t._bodyCallback(a, l);
2702
+ let s = ea(a) > o, u = n.toHTML(), f = `<div id="${ra(i)}">`, p = s ? `${f}</div>` : `${f}${a.toHTML()}</div>`, m = `<script type="application/json" id="${ra(c)}">${d}<\/script>`, h = `<script type="module" src="${ra(r)}"><\/script>`;
2703
+ return n.destroy(), a.destroy(), `<!doctype html>
2704
+ <html lang="${ra(l.lang || "zh-CN")}">
2705
+ ${u}
2706
+ <body>
2707
+ ${p}
2708
+ ${m}
2709
+ ${h}
2710
+ </body>
2711
+ </html>`;
2712
+ }));
2713
+ }
2714
+ function aa(e, t = {}) {
2715
+ if (typeof document > "u") return null;
2716
+ let { messages: r, i18n: i = null, stateId: a = "__YOYA_DATA__", target: o = "#app" } = t || {}, s = document.getElementById(a), c = sa(s ? s.textContent : ""), l = i || (r ? () => Nr({
2717
+ language: c?.lang || "zh-CN",
2718
+ messages: r
2719
+ }) : null), u = n(o);
2720
+ return u && u.firstElementChild ? la(e, o, c, { i18n: l }) : ca(e, o, c, { i18n: l });
2721
+ }
2722
+ function oa(e) {
435
2723
  return e == null ? null : JSON.stringify(e).replace(/</g, "\\u003c");
436
2724
  }
437
- function V(e) {
2725
+ function sa(e) {
438
2726
  return e == null || e === "" ? null : JSON.parse(e);
439
2727
  }
440
- function H(t, n, r = null, i = {}) {
441
- return c(s(), () => I(i.i18n, r, () => {
442
- let i = L(t, r), a = e(n);
2728
+ function ca(e, t, r = null, i = {}) {
2729
+ return Ji(qi(), () => $i(i.i18n, r, () => {
2730
+ let i = $(e, r), a = n(t);
443
2731
  return a && (a.replaceChildren(), a.appendChild(i.renderDom())), i;
444
2732
  }));
445
2733
  }
446
- function U(t, n, r = null, i = {}) {
447
- return c(s(), () => I(i.i18n, r, () => {
448
- let i = L(t, r), a = e(n);
2734
+ function la(e, t, r = null, i = {}) {
2735
+ return Ji(qi(), () => $i(i.i18n, r, () => {
2736
+ let i = $(e, r), a = n(t);
449
2737
  if (a) {
450
2738
  let e = a.firstElementChild;
451
- e ? (W(i, e), K(i), G(i), i.renderDom()) : a.appendChild(i.renderDom());
2739
+ e ? (ua(i, e), fa(i), da(i), i.renderDom()) : a.appendChild(i.renderDom());
452
2740
  }
453
2741
  return i;
454
2742
  }));
455
2743
  }
456
- function W(e, t) {
457
- if (e instanceof i) {
458
- W(e._resolve(), t);
2744
+ function ua(e, t) {
2745
+ if (e instanceof u) {
2746
+ ua(e._resolve(), t);
459
2747
  return;
460
2748
  }
461
- if (e instanceof r) {
462
- t && t.nodeType === 3 ? (e._textNode = t, e._el = t, t.textContent !== e._content && (t.textContent = e._content)) : q(t, e.renderDom());
2749
+ if (e instanceof l) {
2750
+ t && t.nodeType === 3 ? (e._textNode = t, e._el = t, t.textContent !== e._content && (t.textContent = e._content)) : pa(t, e.renderDom());
463
2751
  return;
464
2752
  }
465
2753
  if (t && t.nodeType === 1 && t.tagName.toLowerCase() === e._tagName) {
466
2754
  e._el = t, e._hydrated = !0;
467
2755
  let n = Array.from(t.childNodes);
468
- e.children().forEach((e, t) => W(e, n[t]));
2756
+ e.children().forEach((e, t) => ua(e, n[t]));
469
2757
  return;
470
2758
  }
471
- q(t, e.renderDom());
2759
+ pa(t, e.renderDom());
472
2760
  }
473
- function G(e) {
474
- if (e instanceof i) {
475
- G(e._resolve());
2761
+ function da(e) {
2762
+ if (e instanceof u) {
2763
+ da(e._resolve());
476
2764
  return;
477
2765
  }
478
- e instanceof r || (e._el && e._hydrated && e._applyBindingsToElement(), e.children().forEach(G));
2766
+ e instanceof l || (e._el && e._hydrated && e._applyBindingsToElement(), e.children().forEach(da));
479
2767
  }
480
- function K(e) {
481
- if (e instanceof i) {
482
- K(e._resolve());
2768
+ function fa(e) {
2769
+ if (e instanceof u) {
2770
+ fa(e._resolve());
483
2771
  return;
484
2772
  }
485
- e instanceof r || (e.children().forEach(K), typeof e.hydrateSnapshot == "function" && e.hydrateSnapshot());
2773
+ e instanceof l || (e.children().forEach(fa), typeof e.hydrateSnapshot == "function" && e.hydrateSnapshot());
486
2774
  }
487
- function q(e, t) {
2775
+ function pa(e, t) {
488
2776
  e && e.parentNode && e.parentNode.replaceChild(t, e);
489
2777
  }
490
2778
  //#endregion
491
- export { U as hydrate, H as mount, V as parseState, z as renderToString, M as resolveLocale, B as serializeState };
2779
+ export { Dr as ClientOnlyNode, u as ComponentNode, h as ElementNode, v as HtmlElementNode, jr as I18n, Mr as I18nTextNode, na as PageDocumentNode, gi as Router, l as TextNode, l as VTextNode, l as ViewTextNode, Cn as VMasonry, yn as VSplitPanel, Tn as VThemeShell, c as ViewNode, S as a, ee as abbr, te as address, m as applyElementOptions, C as area, w as article, T as aside, E as audio, D as b, ne as base, re as bdi, ie as bdo, ae as blockquote, oe as body, se as br, ce as button, le as canvas, ue as caption, Nn as center, de as cite, fe as code, pe as col, me as colgroup, Vn as container, g as createElementFactory, b as createHtmlFactories, Nr as createI18n, _i as createRouter, zn as createVBodyPage, he as data, ge as datalist, _e as dd, ve as del, ye as details, be as dfn, xe as dialog, Se as div, Xn as divider, Ce as dl, we as dt, Te as em, Ee as embed, r as escapeHtml, De as fieldset, Oe as figcaption, ke as figure, kn as flex, Ae as footer, je as form, Br as getI18n, Hr as getPersistedI18nLocales, ci as getYoyaMode, di as getYoyaTheme, In as grid, Me as h1, Ne as h2, Pe as h3, Fe as h4, Ie as h5, Le as h6, Re as head, ze as header, Be as hgroup, Ve as hr, Mn as hstack, He as html, la as hydrate, aa as hydrateOrMount, Ue as i, W as i18n, Pr as i18nText, We as iframe, Ge as img, fi as initYoyaTheme, Ke as input, qe as ins, Fr as installI18nStringShortcut, Je as kbd, Ye as label, Xe as legend, Ze as li, Qe as link, Vr as listI18n, $e as main, et as map, tt as mark, nt as menu, rt as meta, it as meter, Un as mobileLayout, ca as mount, at as nav, f as normalizeChild, p as normalizeSetupArguments, ot as noscript, st as object, ct as ol, lt as optgroup, ut as option, dt as output, ft as p, sa as parseState, pt as picture, mt as pre, ht as progress, gt as q, _ as registerChildFactories, Rr as registerI18n, ia as renderPage, ta as renderToString, Yi as resolveLocale, n as resolveTarget, li as resolveYoyaMode, Ln as responsiveGrid, vi as router, _t as rp, vt as rt, yt as ruby, bt as s, xt as samp, St as script, Ct as search, wt as section, Tt as select, Et as selectedcontent, oa as serializeState, si as setYoyaMode, ui as setYoyaTheme, Dt as slot, Ot as small, kt as source, Yn as spacer, At as span, An as stack, jt as strong, Mt as style, Nt as styleTag, Pt as sub, Ft as summary, It as sup, Lt as table, Rt as tbody, zt as td, Bt as template, d as text, d as vText, Vt as textarea, Ht as tfoot, Ut as th, Wt as thead, Gt as time, Kt as title, qt as tr, Jt as track, Yt as u, Xt as ul, zr as unregisterI18n, Kn as vAside, Rn as vBody, Or as vClientOnly, Fn as vCol, Hn as vContainer, Jn as vFooter, Gn as vHeader, xi as vLink, qn as vMain, wn as vMasonry, Wn as vMobileLayout, yi as vRoute, bi as vRouter, Si as vRouterView, Ci as vRouterViews, Pn as vRow, bn as vSplitPanel, ni as vStateNode, En as vThemeShell, Zt as varTag, Qt as video, jn as vstack, $t as wbr, Ir as withI18nStringShortcut };