tekivex-ui 2.5.14 → 2.5.15
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/index.cjs +12 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +795 -202
- package/dist/src/components/TkxMarkdown.d.ts +29 -0
- package/dist/src/components/TkxMarkdown.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/TkxMarkdown.tsx +855 -0
- package/src/components/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -12946,20 +12946,613 @@ function Ga({ blocks: e, className: t, style: n }) {
|
|
|
12946
12946
|
});
|
|
12947
12947
|
}
|
|
12948
12948
|
//#endregion
|
|
12949
|
+
//#region src/components/TkxMarkdown.tsx
|
|
12950
|
+
function Ka(e) {
|
|
12951
|
+
let t = [], n = 0, r = "", i = () => {
|
|
12952
|
+
r &&= (t.push({
|
|
12953
|
+
kind: "text",
|
|
12954
|
+
value: r
|
|
12955
|
+
}), "");
|
|
12956
|
+
};
|
|
12957
|
+
for (; n < e.length;) {
|
|
12958
|
+
let a = e[n];
|
|
12959
|
+
if (a === "\\" && n + 1 < e.length) {
|
|
12960
|
+
r += e[n + 1], n += 2;
|
|
12961
|
+
continue;
|
|
12962
|
+
}
|
|
12963
|
+
if (a === "!" && e[n + 1] === "[") {
|
|
12964
|
+
let r = e.indexOf("]", n + 2);
|
|
12965
|
+
if (r !== -1 && e[r + 1] === "(") {
|
|
12966
|
+
let a = e.indexOf(")", r + 2);
|
|
12967
|
+
if (a !== -1) {
|
|
12968
|
+
i(), t.push({
|
|
12969
|
+
kind: "image",
|
|
12970
|
+
alt: e.slice(n + 2, r),
|
|
12971
|
+
src: e.slice(r + 2, a)
|
|
12972
|
+
}), n = a + 1;
|
|
12973
|
+
continue;
|
|
12974
|
+
}
|
|
12975
|
+
}
|
|
12976
|
+
}
|
|
12977
|
+
if (a === "[") {
|
|
12978
|
+
let r = qa(e, n, "[", "]");
|
|
12979
|
+
if (r !== -1 && e[r + 1] === "(") {
|
|
12980
|
+
let a = e.indexOf(")", r + 2);
|
|
12981
|
+
if (a !== -1) {
|
|
12982
|
+
i(), t.push({
|
|
12983
|
+
kind: "link",
|
|
12984
|
+
href: e.slice(r + 2, a).trim(),
|
|
12985
|
+
children: Ka(e.slice(n + 1, r))
|
|
12986
|
+
}), n = a + 1;
|
|
12987
|
+
continue;
|
|
12988
|
+
}
|
|
12989
|
+
}
|
|
12990
|
+
}
|
|
12991
|
+
if (a === "<") {
|
|
12992
|
+
let r = e.indexOf(">", n + 1);
|
|
12993
|
+
if (r !== -1) {
|
|
12994
|
+
let a = e.slice(n + 1, r);
|
|
12995
|
+
if (/^(https?:\/\/|mailto:)/i.test(a) || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a)) {
|
|
12996
|
+
i();
|
|
12997
|
+
let e = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a) ? `mailto:${a}` : a;
|
|
12998
|
+
t.push({
|
|
12999
|
+
kind: "link",
|
|
13000
|
+
href: e,
|
|
13001
|
+
children: [{
|
|
13002
|
+
kind: "text",
|
|
13003
|
+
value: a
|
|
13004
|
+
}]
|
|
13005
|
+
}), n = r + 1;
|
|
13006
|
+
continue;
|
|
13007
|
+
}
|
|
13008
|
+
}
|
|
13009
|
+
}
|
|
13010
|
+
if (a === "`") {
|
|
13011
|
+
let r = e.indexOf("`", n + 1);
|
|
13012
|
+
if (r !== -1) {
|
|
13013
|
+
i(), t.push({
|
|
13014
|
+
kind: "code",
|
|
13015
|
+
value: e.slice(n + 1, r)
|
|
13016
|
+
}), n = r + 1;
|
|
13017
|
+
continue;
|
|
13018
|
+
}
|
|
13019
|
+
}
|
|
13020
|
+
if (a === "~" && e[n + 1] === "~") {
|
|
13021
|
+
let r = e.indexOf("~~", n + 2);
|
|
13022
|
+
if (r !== -1) {
|
|
13023
|
+
i(), t.push({
|
|
13024
|
+
kind: "strike",
|
|
13025
|
+
children: Ka(e.slice(n + 2, r))
|
|
13026
|
+
}), n = r + 2;
|
|
13027
|
+
continue;
|
|
13028
|
+
}
|
|
13029
|
+
}
|
|
13030
|
+
if (a === "*" && e[n + 1] === "*" || a === "_" && e[n + 1] === "_") {
|
|
13031
|
+
let r = a + a, o = e.indexOf(r, n + 2);
|
|
13032
|
+
if (o !== -1) {
|
|
13033
|
+
i(), t.push({
|
|
13034
|
+
kind: "bold",
|
|
13035
|
+
children: Ka(e.slice(n + 2, o))
|
|
13036
|
+
}), n = o + 2;
|
|
13037
|
+
continue;
|
|
13038
|
+
}
|
|
13039
|
+
}
|
|
13040
|
+
if ((a === "*" || a === "_") && e[n + 1] !== a) {
|
|
13041
|
+
let r = e.indexOf(a, n + 1);
|
|
13042
|
+
if (r !== -1 && e.slice(n + 1, r).trim().length > 0) {
|
|
13043
|
+
i(), t.push({
|
|
13044
|
+
kind: "italic",
|
|
13045
|
+
children: Ka(e.slice(n + 1, r))
|
|
13046
|
+
}), n = r + 1;
|
|
13047
|
+
continue;
|
|
13048
|
+
}
|
|
13049
|
+
}
|
|
13050
|
+
r += a, n++;
|
|
13051
|
+
}
|
|
13052
|
+
return i(), t;
|
|
13053
|
+
}
|
|
13054
|
+
function qa(e, t, n, r) {
|
|
13055
|
+
let i = 0;
|
|
13056
|
+
for (let a = t; a < e.length; a++) {
|
|
13057
|
+
if (e[a] === "\\") {
|
|
13058
|
+
a++;
|
|
13059
|
+
continue;
|
|
13060
|
+
}
|
|
13061
|
+
if (e[a] === n) i++;
|
|
13062
|
+
else if (e[a] === r && (i--, i === 0)) return a;
|
|
13063
|
+
}
|
|
13064
|
+
return -1;
|
|
13065
|
+
}
|
|
13066
|
+
function Ja(e) {
|
|
13067
|
+
let t = e.replace(/^\uFEFF/, "").replace(/\r\n?/g, "\n").split("\n"), n = [], r = 0;
|
|
13068
|
+
for (; r < t.length;) {
|
|
13069
|
+
let e = t[r];
|
|
13070
|
+
if (/^\s*$/.test(e)) {
|
|
13071
|
+
r++;
|
|
13072
|
+
continue;
|
|
13073
|
+
}
|
|
13074
|
+
let i = e.match(/^\s*```(.*)$/);
|
|
13075
|
+
if (i) {
|
|
13076
|
+
let e = i[1].trim();
|
|
13077
|
+
r++;
|
|
13078
|
+
let a = [];
|
|
13079
|
+
for (; r < t.length && !/^\s*```\s*$/.test(t[r]);) a.push(t[r]), r++;
|
|
13080
|
+
r < t.length && r++, n.push({
|
|
13081
|
+
kind: "code",
|
|
13082
|
+
language: e,
|
|
13083
|
+
value: a.join("\n")
|
|
13084
|
+
});
|
|
13085
|
+
continue;
|
|
13086
|
+
}
|
|
13087
|
+
let a = e.match(/^(#{1,6})\s+(.*?)\s*#*\s*$/);
|
|
13088
|
+
if (a) {
|
|
13089
|
+
n.push({
|
|
13090
|
+
kind: "heading",
|
|
13091
|
+
level: a[1].length,
|
|
13092
|
+
inline: Ka(a[2])
|
|
13093
|
+
}), r++;
|
|
13094
|
+
continue;
|
|
13095
|
+
}
|
|
13096
|
+
if (/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(e)) {
|
|
13097
|
+
n.push({ kind: "hr" }), r++;
|
|
13098
|
+
continue;
|
|
13099
|
+
}
|
|
13100
|
+
if (Za(e) && r + 1 < t.length && Qa(t[r + 1])) {
|
|
13101
|
+
let i = $a(e).map(Ka), a = eo(t[r + 1]);
|
|
13102
|
+
r += 2;
|
|
13103
|
+
let o = [];
|
|
13104
|
+
for (; r < t.length && Za(t[r]);) o.push($a(t[r]).map(Ka)), r++;
|
|
13105
|
+
n.push({
|
|
13106
|
+
kind: "table",
|
|
13107
|
+
headers: i,
|
|
13108
|
+
rows: o,
|
|
13109
|
+
align: a
|
|
13110
|
+
});
|
|
13111
|
+
continue;
|
|
13112
|
+
}
|
|
13113
|
+
if (/^\s*>/.test(e)) {
|
|
13114
|
+
let e = [];
|
|
13115
|
+
for (; r < t.length && /^\s*>/.test(t[r]);) e.push(t[r].replace(/^\s*>\s?/, "")), r++;
|
|
13116
|
+
n.push({
|
|
13117
|
+
kind: "blockquote",
|
|
13118
|
+
children: Ja(e.join("\n"))
|
|
13119
|
+
});
|
|
13120
|
+
continue;
|
|
13121
|
+
}
|
|
13122
|
+
if (Ya(e)) {
|
|
13123
|
+
let [e, i] = Xa(t, r);
|
|
13124
|
+
n.push(e), r = i;
|
|
13125
|
+
continue;
|
|
13126
|
+
}
|
|
13127
|
+
let o = [e];
|
|
13128
|
+
for (r++; r < t.length && !/^\s*$/.test(t[r]) && !/^#{1,6}\s/.test(t[r]) && !/^\s*```/.test(t[r]) && !/^\s*>/.test(t[r]) && !Ya(t[r]) && !/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(t[r]);) o.push(t[r]), r++;
|
|
13129
|
+
n.push({
|
|
13130
|
+
kind: "paragraph",
|
|
13131
|
+
inline: Ka(o.join(" "))
|
|
13132
|
+
});
|
|
13133
|
+
}
|
|
13134
|
+
return n;
|
|
13135
|
+
}
|
|
13136
|
+
function Ya(e) {
|
|
13137
|
+
return /^(\s*)([-*+]|\d+[.)])\s+/.test(e);
|
|
13138
|
+
}
|
|
13139
|
+
function Xa(e, t) {
|
|
13140
|
+
let n = e[t].match(/^(\s*)([-*+]|\d+[.)])\s+/), r = n[1].length, i = /\d/.test(n[2]), a = [], o = t;
|
|
13141
|
+
for (; o < e.length;) {
|
|
13142
|
+
let t = e[o].match(/^(\s*)([-*+]|\d+[.)])\s+(.*)$/);
|
|
13143
|
+
if (!t || t[1].length !== r) break;
|
|
13144
|
+
let n = t[3], i = null, s = n, c = n.match(/^\[([ xX])\]\s+(.*)$/);
|
|
13145
|
+
c && (i = c[1].toLowerCase() === "x" ? "checked" : "unchecked", s = c[2]);
|
|
13146
|
+
let l = [s];
|
|
13147
|
+
for (o++; o < e.length;) {
|
|
13148
|
+
if (/^\s*$/.test(e[o])) {
|
|
13149
|
+
if (o + 1 < e.length && /^\s+\S/.test(e[o + 1])) {
|
|
13150
|
+
l.push(""), o++;
|
|
13151
|
+
continue;
|
|
13152
|
+
}
|
|
13153
|
+
break;
|
|
13154
|
+
}
|
|
13155
|
+
let t = e[o].match(/^(\s*)(\S)/);
|
|
13156
|
+
if (t && t[1].length > r) {
|
|
13157
|
+
l.push(e[o].slice(r + 2)), o++;
|
|
13158
|
+
continue;
|
|
13159
|
+
}
|
|
13160
|
+
break;
|
|
13161
|
+
}
|
|
13162
|
+
a.push({
|
|
13163
|
+
blocks: Ja(l.join("\n")),
|
|
13164
|
+
task: i
|
|
13165
|
+
});
|
|
13166
|
+
}
|
|
13167
|
+
return [{
|
|
13168
|
+
kind: "list",
|
|
13169
|
+
ordered: i,
|
|
13170
|
+
items: a
|
|
13171
|
+
}, o];
|
|
13172
|
+
}
|
|
13173
|
+
function Za(e) {
|
|
13174
|
+
return /^\s*\|.+\|\s*$/.test(e.trim()) || e.includes("|") && e.trim().startsWith("|");
|
|
13175
|
+
}
|
|
13176
|
+
function Qa(e) {
|
|
13177
|
+
return /^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(e);
|
|
13178
|
+
}
|
|
13179
|
+
function $a(e) {
|
|
13180
|
+
return e.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((e) => e.trim());
|
|
13181
|
+
}
|
|
13182
|
+
function eo(e) {
|
|
13183
|
+
return $a(e).map((e) => {
|
|
13184
|
+
let t = e.startsWith(":"), n = e.endsWith(":");
|
|
13185
|
+
return t && n ? "center" : n ? "right" : t ? "left" : null;
|
|
13186
|
+
});
|
|
13187
|
+
}
|
|
13188
|
+
function to(e, t, n = "i") {
|
|
13189
|
+
return e.map((e, r) => {
|
|
13190
|
+
let i = `${n}-${r}`;
|
|
13191
|
+
switch (e.kind) {
|
|
13192
|
+
case "text": return /* @__PURE__ */ Q("span", { children: B(e.value) }, i);
|
|
13193
|
+
case "bold": return /* @__PURE__ */ Q("strong", { children: to(e.children, t, i) }, i);
|
|
13194
|
+
case "italic": return /* @__PURE__ */ Q("em", { children: to(e.children, t, i) }, i);
|
|
13195
|
+
case "strike": return /* @__PURE__ */ Q("s", { children: to(e.children, t, i) }, i);
|
|
13196
|
+
case "code": return /* @__PURE__ */ Q("code", {
|
|
13197
|
+
style: {
|
|
13198
|
+
background: t.theme.surfaceAlt,
|
|
13199
|
+
border: `1px solid ${t.theme.border}`,
|
|
13200
|
+
borderRadius: 4,
|
|
13201
|
+
padding: "0.15em 0.4em",
|
|
13202
|
+
fontSize: "0.9em",
|
|
13203
|
+
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
|
|
13204
|
+
wordBreak: "break-word"
|
|
13205
|
+
},
|
|
13206
|
+
children: B(e.value)
|
|
13207
|
+
}, i);
|
|
13208
|
+
case "link": {
|
|
13209
|
+
let n = no(e.href);
|
|
13210
|
+
if (!n) return /* @__PURE__ */ Q("span", { children: to(e.children, t, i) }, i);
|
|
13211
|
+
let r = /^(https?:)?\/\//i.test(n) || n.startsWith("mailto:");
|
|
13212
|
+
return /* @__PURE__ */ Q("a", {
|
|
13213
|
+
href: n,
|
|
13214
|
+
target: r ? t.externalLinkTarget : void 0,
|
|
13215
|
+
rel: r ? t.externalLinkRel : void 0,
|
|
13216
|
+
onClick: (e) => {
|
|
13217
|
+
t.onLinkClick?.(n, e) === !1 && e.preventDefault();
|
|
13218
|
+
},
|
|
13219
|
+
style: {
|
|
13220
|
+
color: t.theme.primary,
|
|
13221
|
+
textDecoration: "underline",
|
|
13222
|
+
wordBreak: "break-word"
|
|
13223
|
+
},
|
|
13224
|
+
children: to(e.children, t, i)
|
|
13225
|
+
}, i);
|
|
13226
|
+
}
|
|
13227
|
+
case "image": return /* @__PURE__ */ Q("img", {
|
|
13228
|
+
src: no(e.src) || "",
|
|
13229
|
+
alt: B(e.alt),
|
|
13230
|
+
loading: "lazy",
|
|
13231
|
+
decoding: "async",
|
|
13232
|
+
style: {
|
|
13233
|
+
maxWidth: "100%",
|
|
13234
|
+
height: "auto",
|
|
13235
|
+
borderRadius: 6,
|
|
13236
|
+
display: "inline-block"
|
|
13237
|
+
}
|
|
13238
|
+
}, i);
|
|
13239
|
+
}
|
|
13240
|
+
});
|
|
13241
|
+
}
|
|
13242
|
+
function no(e) {
|
|
13243
|
+
let t = e.trim();
|
|
13244
|
+
return !t || /^javascript:/i.test(t) || /^data:/i.test(t) && !/^data:image\//i.test(t) || /^vbscript:/i.test(t) ? null : t;
|
|
13245
|
+
}
|
|
13246
|
+
function ro({ text: e, theme: t }) {
|
|
13247
|
+
let [n, r] = Z(!1);
|
|
13248
|
+
return /* @__PURE__ */ Q("button", {
|
|
13249
|
+
type: "button",
|
|
13250
|
+
onClick: () => {
|
|
13251
|
+
typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(e).then(() => {
|
|
13252
|
+
r(!0), setTimeout(() => r(!1), 1500);
|
|
13253
|
+
});
|
|
13254
|
+
},
|
|
13255
|
+
"aria-label": n ? "Copied to clipboard" : "Copy code",
|
|
13256
|
+
style: {
|
|
13257
|
+
position: "absolute",
|
|
13258
|
+
top: 6,
|
|
13259
|
+
right: 6,
|
|
13260
|
+
padding: "2px 8px",
|
|
13261
|
+
fontSize: 11,
|
|
13262
|
+
background: t.surface,
|
|
13263
|
+
color: n ? t.success : t.textMuted,
|
|
13264
|
+
border: `1px solid ${t.border}`,
|
|
13265
|
+
borderRadius: 4,
|
|
13266
|
+
cursor: "pointer",
|
|
13267
|
+
fontFamily: "inherit",
|
|
13268
|
+
transition: "color 120ms"
|
|
13269
|
+
},
|
|
13270
|
+
children: n ? "Copied" : "Copy"
|
|
13271
|
+
});
|
|
13272
|
+
}
|
|
13273
|
+
function io(e, t, n = "b") {
|
|
13274
|
+
return e.map((e, r) => {
|
|
13275
|
+
let i = `${n}-${r}`;
|
|
13276
|
+
switch (e.kind) {
|
|
13277
|
+
case "heading": {
|
|
13278
|
+
let n = `h${e.level}`, r = {
|
|
13279
|
+
1: {
|
|
13280
|
+
fs: t.compact ? "1.75rem" : "2rem",
|
|
13281
|
+
lh: "1.2",
|
|
13282
|
+
mt: "0.6em",
|
|
13283
|
+
mb: "0.5em",
|
|
13284
|
+
fw: 700
|
|
13285
|
+
},
|
|
13286
|
+
2: {
|
|
13287
|
+
fs: t.compact ? "1.4rem" : "1.6rem",
|
|
13288
|
+
lh: "1.25",
|
|
13289
|
+
mt: "1em",
|
|
13290
|
+
mb: "0.5em",
|
|
13291
|
+
fw: 700
|
|
13292
|
+
},
|
|
13293
|
+
3: {
|
|
13294
|
+
fs: t.compact ? "1.2rem" : "1.3rem",
|
|
13295
|
+
lh: "1.3",
|
|
13296
|
+
mt: "1em",
|
|
13297
|
+
mb: "0.4em",
|
|
13298
|
+
fw: 600
|
|
13299
|
+
},
|
|
13300
|
+
4: {
|
|
13301
|
+
fs: "1.1rem",
|
|
13302
|
+
lh: "1.35",
|
|
13303
|
+
mt: "1em",
|
|
13304
|
+
mb: "0.4em",
|
|
13305
|
+
fw: 600
|
|
13306
|
+
},
|
|
13307
|
+
5: {
|
|
13308
|
+
fs: "1rem",
|
|
13309
|
+
lh: "1.4",
|
|
13310
|
+
mt: "1em",
|
|
13311
|
+
mb: "0.3em",
|
|
13312
|
+
fw: 600
|
|
13313
|
+
},
|
|
13314
|
+
6: {
|
|
13315
|
+
fs: "0.9rem",
|
|
13316
|
+
lh: "1.4",
|
|
13317
|
+
mt: "1em",
|
|
13318
|
+
mb: "0.3em",
|
|
13319
|
+
fw: 600
|
|
13320
|
+
}
|
|
13321
|
+
}[e.level];
|
|
13322
|
+
return /* @__PURE__ */ Q(n, {
|
|
13323
|
+
style: {
|
|
13324
|
+
fontSize: r.fs,
|
|
13325
|
+
lineHeight: r.lh,
|
|
13326
|
+
marginTop: r.mt,
|
|
13327
|
+
marginBottom: r.mb,
|
|
13328
|
+
fontWeight: r.fw,
|
|
13329
|
+
color: t.theme.text,
|
|
13330
|
+
scrollMarginTop: "1em"
|
|
13331
|
+
},
|
|
13332
|
+
children: to(e.inline, t, i)
|
|
13333
|
+
}, i);
|
|
13334
|
+
}
|
|
13335
|
+
case "paragraph": return /* @__PURE__ */ Q("p", {
|
|
13336
|
+
style: {
|
|
13337
|
+
margin: `0 0 ${t.compact ? "0.7em" : "1em"}`,
|
|
13338
|
+
lineHeight: 1.65,
|
|
13339
|
+
color: t.theme.text,
|
|
13340
|
+
wordBreak: "break-word"
|
|
13341
|
+
},
|
|
13342
|
+
children: to(e.inline, t, i)
|
|
13343
|
+
}, i);
|
|
13344
|
+
case "blockquote": return /* @__PURE__ */ Q("blockquote", {
|
|
13345
|
+
style: {
|
|
13346
|
+
margin: "0 0 1em",
|
|
13347
|
+
padding: "0.5em 1em",
|
|
13348
|
+
borderLeft: `4px solid ${t.theme.primary}`,
|
|
13349
|
+
background: `${t.theme.surfaceAlt}`,
|
|
13350
|
+
color: t.theme.textMuted,
|
|
13351
|
+
borderRadius: "0 6px 6px 0"
|
|
13352
|
+
},
|
|
13353
|
+
children: io(e.children, t, i)
|
|
13354
|
+
}, i);
|
|
13355
|
+
case "code": {
|
|
13356
|
+
let n = e.value;
|
|
13357
|
+
return /* @__PURE__ */ $("div", {
|
|
13358
|
+
style: {
|
|
13359
|
+
position: "relative",
|
|
13360
|
+
margin: "0 0 1em",
|
|
13361
|
+
border: `1px solid ${t.theme.border}`,
|
|
13362
|
+
borderRadius: 8,
|
|
13363
|
+
background: t.theme.surfaceAlt,
|
|
13364
|
+
overflow: "hidden"
|
|
13365
|
+
},
|
|
13366
|
+
children: [
|
|
13367
|
+
e.language && /* @__PURE__ */ Q("div", {
|
|
13368
|
+
style: {
|
|
13369
|
+
padding: "4px 10px",
|
|
13370
|
+
fontSize: 11,
|
|
13371
|
+
color: t.theme.textMuted,
|
|
13372
|
+
borderBottom: `1px solid ${t.theme.border}`,
|
|
13373
|
+
textTransform: "uppercase",
|
|
13374
|
+
letterSpacing: "0.05em"
|
|
13375
|
+
},
|
|
13376
|
+
children: B(e.language)
|
|
13377
|
+
}),
|
|
13378
|
+
t.copyableCode && /* @__PURE__ */ Q(ro, {
|
|
13379
|
+
text: n,
|
|
13380
|
+
theme: t.theme
|
|
13381
|
+
}),
|
|
13382
|
+
/* @__PURE__ */ Q("pre", {
|
|
13383
|
+
style: {
|
|
13384
|
+
margin: 0,
|
|
13385
|
+
padding: 12,
|
|
13386
|
+
overflowX: "auto",
|
|
13387
|
+
fontSize: 13,
|
|
13388
|
+
lineHeight: 1.55,
|
|
13389
|
+
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
|
|
13390
|
+
color: t.theme.text,
|
|
13391
|
+
whiteSpace: "pre"
|
|
13392
|
+
},
|
|
13393
|
+
children: /* @__PURE__ */ Q("code", { children: B(n) })
|
|
13394
|
+
})
|
|
13395
|
+
]
|
|
13396
|
+
}, i);
|
|
13397
|
+
}
|
|
13398
|
+
case "list": return /* @__PURE__ */ Q(e.ordered ? "ol" : "ul", {
|
|
13399
|
+
style: {
|
|
13400
|
+
margin: "0 0 1em",
|
|
13401
|
+
paddingLeft: "1.5em",
|
|
13402
|
+
color: t.theme.text,
|
|
13403
|
+
lineHeight: 1.65
|
|
13404
|
+
},
|
|
13405
|
+
children: e.items.map((e, n) => /* @__PURE__ */ $("li", {
|
|
13406
|
+
style: {
|
|
13407
|
+
listStyle: e.task === null ? void 0 : "none",
|
|
13408
|
+
marginLeft: e.task === null ? void 0 : "-1.25em"
|
|
13409
|
+
},
|
|
13410
|
+
children: [e.task !== null && /* @__PURE__ */ Q("input", {
|
|
13411
|
+
type: "checkbox",
|
|
13412
|
+
disabled: !0,
|
|
13413
|
+
checked: e.task === "checked",
|
|
13414
|
+
readOnly: !0,
|
|
13415
|
+
style: {
|
|
13416
|
+
marginRight: 6,
|
|
13417
|
+
verticalAlign: "middle"
|
|
13418
|
+
},
|
|
13419
|
+
"aria-label": e.task === "checked" ? "Completed task" : "Uncompleted task"
|
|
13420
|
+
}), io(e.blocks, t, `${i}-${n}`)]
|
|
13421
|
+
}, `${i}-${n}`))
|
|
13422
|
+
}, i);
|
|
13423
|
+
case "hr": return /* @__PURE__ */ Q("hr", { style: {
|
|
13424
|
+
border: "none",
|
|
13425
|
+
borderTop: `1px solid ${t.theme.border}`,
|
|
13426
|
+
margin: "1.5em 0"
|
|
13427
|
+
} }, i);
|
|
13428
|
+
case "table": return /* @__PURE__ */ Q("div", {
|
|
13429
|
+
style: {
|
|
13430
|
+
overflowX: "auto",
|
|
13431
|
+
margin: "0 0 1em",
|
|
13432
|
+
border: `1px solid ${t.theme.border}`,
|
|
13433
|
+
borderRadius: 6,
|
|
13434
|
+
WebkitOverflowScrolling: "touch"
|
|
13435
|
+
},
|
|
13436
|
+
children: /* @__PURE__ */ $("table", {
|
|
13437
|
+
style: {
|
|
13438
|
+
width: "100%",
|
|
13439
|
+
borderCollapse: "collapse",
|
|
13440
|
+
fontSize: 14,
|
|
13441
|
+
color: t.theme.text
|
|
13442
|
+
},
|
|
13443
|
+
children: [/* @__PURE__ */ Q("thead", { children: /* @__PURE__ */ Q("tr", { children: e.headers.map((n, r) => /* @__PURE__ */ Q("th", {
|
|
13444
|
+
style: {
|
|
13445
|
+
padding: "8px 12px",
|
|
13446
|
+
textAlign: e.align[r] ?? "left",
|
|
13447
|
+
borderBottom: `2px solid ${t.theme.border}`,
|
|
13448
|
+
background: t.theme.surfaceAlt,
|
|
13449
|
+
fontWeight: 600
|
|
13450
|
+
},
|
|
13451
|
+
children: to(n, t, `${i}-h-${r}`)
|
|
13452
|
+
}, r)) }) }), /* @__PURE__ */ Q("tbody", { children: e.rows.map((n, r) => /* @__PURE__ */ Q("tr", { children: n.map((n, a) => /* @__PURE__ */ Q("td", {
|
|
13453
|
+
style: {
|
|
13454
|
+
padding: "8px 12px",
|
|
13455
|
+
textAlign: e.align[a] ?? "left",
|
|
13456
|
+
borderBottom: `1px solid ${t.theme.border}`
|
|
13457
|
+
},
|
|
13458
|
+
children: to(n, t, `${i}-r-${r}-${a}`)
|
|
13459
|
+
}, a)) }, r)) })]
|
|
13460
|
+
})
|
|
13461
|
+
}, i);
|
|
13462
|
+
}
|
|
13463
|
+
});
|
|
13464
|
+
}
|
|
13465
|
+
function ao({ source: e, src: t, maxWidth: n = "100%", compact: r = !1, copyableCode: i = !0, onLinkClick: a, externalLinkRel: o = "noopener noreferrer", externalLinkTarget: s = "_blank", loadingFallback: c, errorFallback: l, className: u, style: d }) {
|
|
13466
|
+
let f = v(), [p, m] = Z({
|
|
13467
|
+
text: null,
|
|
13468
|
+
error: null,
|
|
13469
|
+
loading: !!t && e === void 0
|
|
13470
|
+
}), h = X(null);
|
|
13471
|
+
Y(() => {
|
|
13472
|
+
if (e !== void 0 || !t) return;
|
|
13473
|
+
h.current?.abort();
|
|
13474
|
+
let n = new AbortController();
|
|
13475
|
+
return h.current = n, m({
|
|
13476
|
+
text: null,
|
|
13477
|
+
error: null,
|
|
13478
|
+
loading: !0
|
|
13479
|
+
}), fetch(t, { signal: n.signal }).then(async (e) => {
|
|
13480
|
+
if (!e.ok) throw Error(`Failed to load markdown (HTTP ${e.status})`);
|
|
13481
|
+
m({
|
|
13482
|
+
text: await e.text(),
|
|
13483
|
+
error: null,
|
|
13484
|
+
loading: !1
|
|
13485
|
+
});
|
|
13486
|
+
}).catch((e) => {
|
|
13487
|
+
e.name !== "AbortError" && m({
|
|
13488
|
+
text: null,
|
|
13489
|
+
error: e.message,
|
|
13490
|
+
loading: !1
|
|
13491
|
+
});
|
|
13492
|
+
}), () => n.abort();
|
|
13493
|
+
}, [t, e]);
|
|
13494
|
+
let g = e ?? p.text ?? "", _ = Ee(() => g ? Ja(g) : [], [g]), y = {
|
|
13495
|
+
theme: f,
|
|
13496
|
+
compact: r,
|
|
13497
|
+
copyableCode: i,
|
|
13498
|
+
externalLinkRel: o,
|
|
13499
|
+
externalLinkTarget: s,
|
|
13500
|
+
onLinkClick: a
|
|
13501
|
+
}, b = {
|
|
13502
|
+
maxWidth: n,
|
|
13503
|
+
width: "100%",
|
|
13504
|
+
color: f.text,
|
|
13505
|
+
fontFamily: "inherit",
|
|
13506
|
+
fontSize: r ? 14 : 15,
|
|
13507
|
+
lineHeight: 1.65,
|
|
13508
|
+
wordBreak: "break-word",
|
|
13509
|
+
overflowWrap: "anywhere",
|
|
13510
|
+
boxSizing: "border-box",
|
|
13511
|
+
...d
|
|
13512
|
+
};
|
|
13513
|
+
if (e === void 0 && t) {
|
|
13514
|
+
if (p.loading) return /* @__PURE__ */ Q("div", {
|
|
13515
|
+
className: u,
|
|
13516
|
+
style: b,
|
|
13517
|
+
"aria-busy": "true",
|
|
13518
|
+
"aria-live": "polite",
|
|
13519
|
+
children: c ?? /* @__PURE__ */ Q("span", {
|
|
13520
|
+
style: { color: f.textMuted },
|
|
13521
|
+
children: "Loading…"
|
|
13522
|
+
})
|
|
13523
|
+
});
|
|
13524
|
+
if (p.error) return /* @__PURE__ */ Q("div", {
|
|
13525
|
+
className: u,
|
|
13526
|
+
style: b,
|
|
13527
|
+
role: "alert",
|
|
13528
|
+
children: l ? l(p.error) : /* @__PURE__ */ Q("span", {
|
|
13529
|
+
style: { color: f.danger },
|
|
13530
|
+
children: B(p.error)
|
|
13531
|
+
})
|
|
13532
|
+
});
|
|
13533
|
+
}
|
|
13534
|
+
return /* @__PURE__ */ Q("div", {
|
|
13535
|
+
className: u,
|
|
13536
|
+
style: b,
|
|
13537
|
+
children: io(_, y)
|
|
13538
|
+
});
|
|
13539
|
+
}
|
|
13540
|
+
ao.displayName = "TkxMarkdown";
|
|
13541
|
+
//#endregion
|
|
12949
13542
|
//#region src/components/TkxLayout.tsx
|
|
12950
|
-
var
|
|
13543
|
+
var oo = {
|
|
12951
13544
|
sm: 576,
|
|
12952
13545
|
md: 768,
|
|
12953
13546
|
lg: 992,
|
|
12954
13547
|
xl: 1200
|
|
12955
13548
|
};
|
|
12956
|
-
function
|
|
13549
|
+
function so(e) {
|
|
12957
13550
|
return typeof e == "number" ? `${e}px` : e;
|
|
12958
13551
|
}
|
|
12959
|
-
var
|
|
13552
|
+
var co = Se({
|
|
12960
13553
|
h: 0,
|
|
12961
13554
|
v: 0
|
|
12962
|
-
}),
|
|
13555
|
+
}), lo = Ce(({ children: e, hasSider: t = !1, className: n, style: r, ...i }, a) => {
|
|
12963
13556
|
let o = v(), s = F("flex min-h-0 w-full font-sans"), c = t ? { flexDirection: "row" } : { flexDirection: "column" };
|
|
12964
13557
|
return /* @__PURE__ */ Q("section", {
|
|
12965
13558
|
ref: a,
|
|
@@ -12975,9 +13568,9 @@ var Ja = Se({
|
|
|
12975
13568
|
children: e
|
|
12976
13569
|
});
|
|
12977
13570
|
});
|
|
12978
|
-
|
|
12979
|
-
var
|
|
12980
|
-
let s = v(), c =
|
|
13571
|
+
lo.displayName = "TkxLayout";
|
|
13572
|
+
var uo = Ce(({ children: e, height: t = 64, fixed: n = !1, className: r, style: i, ...a }, o) => {
|
|
13573
|
+
let s = v(), c = so(t), l = F("flex items-center px-6 shrink-0 w-full"), u = n ? {
|
|
12981
13574
|
position: "fixed",
|
|
12982
13575
|
top: 0,
|
|
12983
13576
|
left: 0,
|
|
@@ -12999,8 +13592,8 @@ var Xa = Ce(({ children: e, height: t = 64, fixed: n = !1, className: r, style:
|
|
|
12999
13592
|
children: e
|
|
13000
13593
|
});
|
|
13001
13594
|
});
|
|
13002
|
-
|
|
13003
|
-
function
|
|
13595
|
+
uo.displayName = "TkxHeader";
|
|
13596
|
+
function fo({ collapsed: e, onClick: t, color: n }) {
|
|
13004
13597
|
let r = G();
|
|
13005
13598
|
return /* @__PURE__ */ Q("button", {
|
|
13006
13599
|
type: "button",
|
|
@@ -13028,20 +13621,20 @@ function Za({ collapsed: e, onClick: t, color: n }) {
|
|
|
13028
13621
|
})
|
|
13029
13622
|
});
|
|
13030
13623
|
}
|
|
13031
|
-
var
|
|
13624
|
+
var po = Ce(({ children: e, width: t = 240, collapsedWidth: n = 64, collapsed: r, onCollapse: i, collapsible: a = !1, breakpoint: o, trigger: s, className: c, style: l, ...u }, d) => {
|
|
13032
13625
|
let f = v(), p = G(), [m, h] = Z(!1), g = r ?? m, _ = J((e) => {
|
|
13033
13626
|
r === void 0 && h(e), i?.(e);
|
|
13034
13627
|
}, [r, i]);
|
|
13035
13628
|
Y(() => {
|
|
13036
13629
|
if (!o) return;
|
|
13037
|
-
let e =
|
|
13630
|
+
let e = oo[o];
|
|
13038
13631
|
if (!e) return;
|
|
13039
13632
|
let t = window.matchMedia(`(max-width: ${e - 1}px)`), n = (e) => {
|
|
13040
13633
|
_(e.matches);
|
|
13041
13634
|
};
|
|
13042
13635
|
return _(t.matches), t.addEventListener("change", n), () => t.removeEventListener("change", n);
|
|
13043
13636
|
}, [o, _]);
|
|
13044
|
-
let y =
|
|
13637
|
+
let y = so(t), b = g ? `${n}px` : y, x = a && s !== null, S = p ? "none" : "width 200ms ease, min-width 200ms ease, max-width 200ms ease";
|
|
13045
13638
|
return /* @__PURE__ */ $("aside", {
|
|
13046
13639
|
ref: d,
|
|
13047
13640
|
className: U("tkx-layout-sider", F("shrink-0 overflow-hidden flex flex-col"), c),
|
|
@@ -13065,7 +13658,7 @@ var Qa = Ce(({ children: e, width: t = 240, collapsedWidth: n = 64, collapsed: r
|
|
|
13065
13658
|
}), x && /* @__PURE__ */ Q("div", {
|
|
13066
13659
|
className: F("shrink-0"),
|
|
13067
13660
|
style: { borderTop: `1px solid ${f.border}` },
|
|
13068
|
-
children: s === void 0 ? /* @__PURE__ */ Q(
|
|
13661
|
+
children: s === void 0 ? /* @__PURE__ */ Q(fo, {
|
|
13069
13662
|
collapsed: g,
|
|
13070
13663
|
onClick: () => _(!g),
|
|
13071
13664
|
color: f.textMuted
|
|
@@ -13073,8 +13666,8 @@ var Qa = Ce(({ children: e, width: t = 240, collapsedWidth: n = 64, collapsed: r
|
|
|
13073
13666
|
})]
|
|
13074
13667
|
});
|
|
13075
13668
|
});
|
|
13076
|
-
|
|
13077
|
-
var
|
|
13669
|
+
po.displayName = "TkxSider";
|
|
13670
|
+
var mo = Ce(({ children: e, className: t, style: n, ...r }, i) => {
|
|
13078
13671
|
let a = v();
|
|
13079
13672
|
return /* @__PURE__ */ Q("main", {
|
|
13080
13673
|
ref: i,
|
|
@@ -13088,8 +13681,8 @@ var $a = Ce(({ children: e, className: t, style: n, ...r }, i) => {
|
|
|
13088
13681
|
children: e
|
|
13089
13682
|
});
|
|
13090
13683
|
});
|
|
13091
|
-
|
|
13092
|
-
var
|
|
13684
|
+
mo.displayName = "TkxContent";
|
|
13685
|
+
var ho = Ce(({ children: e, className: t, style: n, ...r }, i) => {
|
|
13093
13686
|
let a = v();
|
|
13094
13687
|
return /* @__PURE__ */ Q("footer", {
|
|
13095
13688
|
ref: i,
|
|
@@ -13104,20 +13697,20 @@ var eo = Ce(({ children: e, className: t, style: n, ...r }, i) => {
|
|
|
13104
13697
|
children: e
|
|
13105
13698
|
});
|
|
13106
13699
|
});
|
|
13107
|
-
|
|
13108
|
-
var
|
|
13700
|
+
ho.displayName = "TkxFooter";
|
|
13701
|
+
var go = {
|
|
13109
13702
|
start: "flex-start",
|
|
13110
13703
|
center: "center",
|
|
13111
13704
|
end: "flex-end",
|
|
13112
13705
|
"space-between": "space-between",
|
|
13113
13706
|
"space-around": "space-around",
|
|
13114
13707
|
"space-evenly": "space-evenly"
|
|
13115
|
-
},
|
|
13708
|
+
}, _o = {
|
|
13116
13709
|
top: "flex-start",
|
|
13117
13710
|
middle: "center",
|
|
13118
13711
|
bottom: "flex-end",
|
|
13119
13712
|
stretch: "stretch"
|
|
13120
|
-
},
|
|
13713
|
+
}, vo = Ce(({ children: e, gutter: t, justify: n = "start", align: r = "top", wrap: i = !0, className: a, style: o, ...s }, c) => {
|
|
13121
13714
|
let [l, u] = Array.isArray(t) ? t : [t ?? 0, 0], d = l / 2, f = u / 2, p = l || u ? {
|
|
13122
13715
|
marginLeft: -d,
|
|
13123
13716
|
marginRight: -d,
|
|
@@ -13127,15 +13720,15 @@ var to = {
|
|
|
13127
13720
|
h: d,
|
|
13128
13721
|
v: f
|
|
13129
13722
|
};
|
|
13130
|
-
return /* @__PURE__ */ Q(
|
|
13723
|
+
return /* @__PURE__ */ Q(co.Provider, {
|
|
13131
13724
|
value: m,
|
|
13132
13725
|
children: /* @__PURE__ */ Q("div", {
|
|
13133
13726
|
ref: c,
|
|
13134
13727
|
className: U("tkx-row", F("flex w-full"), a),
|
|
13135
13728
|
style: {
|
|
13136
13729
|
flexWrap: i ? "wrap" : "nowrap",
|
|
13137
|
-
justifyContent:
|
|
13138
|
-
alignItems:
|
|
13730
|
+
justifyContent: go[n] ?? "flex-start",
|
|
13731
|
+
alignItems: _o[r] ?? "flex-start",
|
|
13139
13732
|
...p,
|
|
13140
13733
|
...o
|
|
13141
13734
|
},
|
|
@@ -13144,13 +13737,13 @@ var to = {
|
|
|
13144
13737
|
})
|
|
13145
13738
|
});
|
|
13146
13739
|
});
|
|
13147
|
-
|
|
13148
|
-
var
|
|
13149
|
-
function
|
|
13150
|
-
if (
|
|
13151
|
-
|
|
13740
|
+
vo.displayName = "TkxRow";
|
|
13741
|
+
var yo = !1;
|
|
13742
|
+
function bo() {
|
|
13743
|
+
if (yo || typeof document > "u") return;
|
|
13744
|
+
yo = !0;
|
|
13152
13745
|
let e = [];
|
|
13153
|
-
for (let [t, n] of Object.entries(
|
|
13746
|
+
for (let [t, n] of Object.entries(oo)) {
|
|
13154
13747
|
for (let r = 1; r <= 24; r++) {
|
|
13155
13748
|
let i = `${r / 24 * 100}%`;
|
|
13156
13749
|
e.push(`@media (min-width: ${n}px) { .tkx-col-${t}-${r} { flex: 0 0 ${i} !important; max-width: ${i} !important; } }`);
|
|
@@ -13163,21 +13756,21 @@ function ao() {
|
|
|
13163
13756
|
let t = document.createElement("style");
|
|
13164
13757
|
t.id = "tkx-col-responsive", t.textContent = e.join("\n"), document.head.appendChild(t);
|
|
13165
13758
|
}
|
|
13166
|
-
function
|
|
13759
|
+
function xo(e) {
|
|
13167
13760
|
if (e !== void 0) return typeof e == "number" ? { span: e } : e;
|
|
13168
13761
|
}
|
|
13169
|
-
var
|
|
13762
|
+
var So = Ce(({ children: e, span: t, offset: n = 0, push: r, pull: i, order: a, sm: o, md: s, lg: c, xl: l, className: u, style: d, ...f }, p) => {
|
|
13170
13763
|
Y(() => {
|
|
13171
|
-
|
|
13764
|
+
bo();
|
|
13172
13765
|
}, []);
|
|
13173
|
-
let m = we(
|
|
13766
|
+
let m = we(co), h = t === void 0 ? void 0 : `${t / 24 * 100}%`, g = n ? `${n / 24 * 100}%` : void 0, _ = [], v = [
|
|
13174
13767
|
["sm", o],
|
|
13175
13768
|
["md", s],
|
|
13176
13769
|
["lg", c],
|
|
13177
13770
|
["xl", l]
|
|
13178
13771
|
];
|
|
13179
13772
|
for (let [e, t] of v) {
|
|
13180
|
-
let n =
|
|
13773
|
+
let n = xo(t);
|
|
13181
13774
|
n && (_.push(`tkx-col-${e}-${n.span}`), n.offset !== void 0 && n.offset > 0 && _.push(`tkx-col-${e}-offset-${n.offset}`));
|
|
13182
13775
|
}
|
|
13183
13776
|
let y = {};
|
|
@@ -13199,10 +13792,10 @@ var so = Ce(({ children: e, span: t, offset: n = 0, push: r, pull: i, order: a,
|
|
|
13199
13792
|
children: e
|
|
13200
13793
|
});
|
|
13201
13794
|
});
|
|
13202
|
-
|
|
13795
|
+
So.displayName = "TkxCol";
|
|
13203
13796
|
//#endregion
|
|
13204
13797
|
//#region src/components/TkxConfigProvider.tsx
|
|
13205
|
-
var
|
|
13798
|
+
var Co = Se({
|
|
13206
13799
|
locale: "en-US",
|
|
13207
13800
|
direction: "ltr",
|
|
13208
13801
|
componentDefaults: {
|
|
@@ -13219,8 +13812,8 @@ var co = Se({
|
|
|
13219
13812
|
getAnimation: () => !0,
|
|
13220
13813
|
getBordered: () => !0
|
|
13221
13814
|
});
|
|
13222
|
-
function
|
|
13223
|
-
let o = we(
|
|
13815
|
+
function wo({ children: e, locale: t, direction: n, componentDefaults: r, componentOverrides: i, prefixCls: a }) {
|
|
13816
|
+
let o = we(Co), s = Ee(() => ({
|
|
13224
13817
|
size: r?.size ?? o.componentDefaults.size,
|
|
13225
13818
|
variant: r?.variant ?? o.componentDefaults.variant,
|
|
13226
13819
|
animation: r?.animation ?? o.componentDefaults.animation,
|
|
@@ -13281,7 +13874,7 @@ function lo({ children: e, locale: t, direction: n, componentDefaults: r, compon
|
|
|
13281
13874
|
m,
|
|
13282
13875
|
h
|
|
13283
13876
|
]);
|
|
13284
|
-
return /* @__PURE__ */ Q(
|
|
13877
|
+
return /* @__PURE__ */ Q(Co.Provider, {
|
|
13285
13878
|
value: g,
|
|
13286
13879
|
children: /* @__PURE__ */ Q("div", {
|
|
13287
13880
|
dir: u,
|
|
@@ -13292,49 +13885,49 @@ function lo({ children: e, locale: t, direction: n, componentDefaults: r, compon
|
|
|
13292
13885
|
})
|
|
13293
13886
|
});
|
|
13294
13887
|
}
|
|
13295
|
-
|
|
13296
|
-
function
|
|
13297
|
-
return we(
|
|
13888
|
+
wo.displayName = "TkxConfigProvider";
|
|
13889
|
+
function To() {
|
|
13890
|
+
return we(Co);
|
|
13298
13891
|
}
|
|
13299
|
-
function
|
|
13300
|
-
let { prefixCls: n } =
|
|
13892
|
+
function Eo(e, t) {
|
|
13893
|
+
let { prefixCls: n } = To();
|
|
13301
13894
|
return `${t ?? n}-${e}`;
|
|
13302
13895
|
}
|
|
13303
|
-
function
|
|
13304
|
-
let { getSize: n } =
|
|
13896
|
+
function Do(e, t) {
|
|
13897
|
+
let { getSize: n } = To();
|
|
13305
13898
|
return n(e, t);
|
|
13306
13899
|
}
|
|
13307
|
-
var
|
|
13900
|
+
var Oo = {
|
|
13308
13901
|
sm: 32,
|
|
13309
13902
|
md: 40,
|
|
13310
13903
|
lg: 48
|
|
13311
|
-
},
|
|
13904
|
+
}, ko = {
|
|
13312
13905
|
sm: "0.75rem",
|
|
13313
13906
|
md: "0.875rem",
|
|
13314
13907
|
lg: "1rem"
|
|
13315
|
-
},
|
|
13908
|
+
}, Ao = {
|
|
13316
13909
|
sm: 8,
|
|
13317
13910
|
md: 12,
|
|
13318
13911
|
lg: 16
|
|
13319
|
-
},
|
|
13912
|
+
}, jo = {
|
|
13320
13913
|
sm: 4,
|
|
13321
13914
|
md: 8,
|
|
13322
13915
|
lg: 12
|
|
13323
|
-
},
|
|
13916
|
+
}, Mo = {
|
|
13324
13917
|
sm: 4,
|
|
13325
13918
|
md: 6,
|
|
13326
13919
|
lg: 8
|
|
13327
|
-
},
|
|
13920
|
+
}, No = {
|
|
13328
13921
|
sm: 14,
|
|
13329
13922
|
md: 16,
|
|
13330
13923
|
lg: 20
|
|
13331
13924
|
};
|
|
13332
|
-
function
|
|
13333
|
-
let { direction: e } =
|
|
13925
|
+
function Po() {
|
|
13926
|
+
let { direction: e } = To();
|
|
13334
13927
|
if (e === "rtl") return { transform: "scaleX(-1)" };
|
|
13335
13928
|
}
|
|
13336
|
-
function
|
|
13337
|
-
let { direction: n } =
|
|
13929
|
+
function Fo(e, t = 0) {
|
|
13930
|
+
let { direction: n } = To(), r = typeof e == "number" ? `${e}px` : e, i = typeof t == "number" ? `${t}px` : t;
|
|
13338
13931
|
return n === "rtl" ? {
|
|
13339
13932
|
marginRight: r,
|
|
13340
13933
|
marginLeft: i
|
|
@@ -13343,7 +13936,7 @@ function xo(e, t = 0) {
|
|
|
13343
13936
|
marginRight: i
|
|
13344
13937
|
};
|
|
13345
13938
|
}
|
|
13346
|
-
var
|
|
13939
|
+
var Io = {
|
|
13347
13940
|
"en-US": "English (US)",
|
|
13348
13941
|
"en-GB": "English (UK)",
|
|
13349
13942
|
"es-ES": "Spanish",
|
|
@@ -13364,7 +13957,7 @@ var So = {
|
|
|
13364
13957
|
"tr-TR": "Turkish",
|
|
13365
13958
|
"th-TH": "Thai",
|
|
13366
13959
|
"vi-VN": "Vietnamese"
|
|
13367
|
-
},
|
|
13960
|
+
}, Lo = new Set([
|
|
13368
13961
|
"ar",
|
|
13369
13962
|
"ar-SA",
|
|
13370
13963
|
"ar-EG",
|
|
@@ -13378,11 +13971,11 @@ var So = {
|
|
|
13378
13971
|
"ps",
|
|
13379
13972
|
"ps-AF"
|
|
13380
13973
|
]);
|
|
13381
|
-
function
|
|
13382
|
-
return
|
|
13974
|
+
function Ro(e) {
|
|
13975
|
+
return Lo.has(e) || Lo.has(e.split("-")[0]);
|
|
13383
13976
|
}
|
|
13384
|
-
function
|
|
13385
|
-
if (
|
|
13977
|
+
function zo(e) {
|
|
13978
|
+
if (Io[e]) return Io[e];
|
|
13386
13979
|
if (typeof Intl < "u" && Intl.DisplayNames) try {
|
|
13387
13980
|
return new Intl.DisplayNames(["en"], { type: "language" }).of(e) ?? e;
|
|
13388
13981
|
} catch {
|
|
@@ -13392,10 +13985,10 @@ function To(e) {
|
|
|
13392
13985
|
}
|
|
13393
13986
|
//#endregion
|
|
13394
13987
|
//#region src/components/TkxTypography.tsx
|
|
13395
|
-
function
|
|
13396
|
-
return typeof e == "string" ? e : typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(
|
|
13988
|
+
function Bo(e) {
|
|
13989
|
+
return typeof e == "string" ? e : typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(Bo).join("") : e && typeof e == "object" && "props" in e ? Bo(e.props.children) : "";
|
|
13397
13990
|
}
|
|
13398
|
-
function
|
|
13991
|
+
function Vo({ text: e }) {
|
|
13399
13992
|
let t = v(), [n, r] = Z(!1);
|
|
13400
13993
|
return q("button", {
|
|
13401
13994
|
type: "button",
|
|
@@ -13420,7 +14013,7 @@ function Do({ text: e }) {
|
|
|
13420
14013
|
}
|
|
13421
14014
|
}, n ? "Copied!" : "⎘");
|
|
13422
14015
|
}
|
|
13423
|
-
function
|
|
14016
|
+
function Ho(e = "default") {
|
|
13424
14017
|
let t = v();
|
|
13425
14018
|
return {
|
|
13426
14019
|
default: t.text,
|
|
@@ -13430,7 +14023,7 @@ function Oo(e = "default") {
|
|
|
13430
14023
|
danger: t.danger
|
|
13431
14024
|
}[e];
|
|
13432
14025
|
}
|
|
13433
|
-
var
|
|
14026
|
+
var Uo = {
|
|
13434
14027
|
1: {
|
|
13435
14028
|
fontSize: "2.25rem",
|
|
13436
14029
|
lineHeight: "1.2",
|
|
@@ -13457,10 +14050,10 @@ var ko = {
|
|
|
13457
14050
|
fontWeight: 600
|
|
13458
14051
|
}
|
|
13459
14052
|
};
|
|
13460
|
-
function
|
|
13461
|
-
let a =
|
|
14053
|
+
function Wo({ level: e = 1, children: t, copyable: n = !1, type: r = "default", style: i }) {
|
|
14054
|
+
let a = Ho(r);
|
|
13462
14055
|
v();
|
|
13463
|
-
let o =
|
|
14056
|
+
let o = Uo[e], s = `h${e}`, c = typeof t == "string" ? B(t) : t, l = Bo(t);
|
|
13464
14057
|
return q(s, { style: {
|
|
13465
14058
|
color: a,
|
|
13466
14059
|
fontSize: o.fontSize,
|
|
@@ -13469,10 +14062,10 @@ function Ao({ level: e = 1, children: t, copyable: n = !1, type: r = "default",
|
|
|
13469
14062
|
margin: "0 0 0.5em 0",
|
|
13470
14063
|
fontFamily: "inherit",
|
|
13471
14064
|
...i
|
|
13472
|
-
} }, c, n && q(
|
|
14065
|
+
} }, c, n && q(Vo, { text: l }));
|
|
13473
14066
|
}
|
|
13474
|
-
function
|
|
13475
|
-
let u =
|
|
14067
|
+
function Go({ children: e, type: t = "default", strong: n = !1, italic: r = !1, underline: i = !1, delete: a = !1, code: o = !1, mark: s = !1, copyable: c = !1, style: l }) {
|
|
14068
|
+
let u = Ho(t), d = v(), f = Bo(e), p = typeof e == "string" ? B(e) : e, m = [];
|
|
13476
14069
|
i && m.push("underline"), a && m.push("line-through");
|
|
13477
14070
|
let h = p;
|
|
13478
14071
|
return o && (h = q("code", { style: {
|
|
@@ -13492,10 +14085,10 @@ function jo({ children: e, type: t = "default", strong: n = !1, italic: r = !1,
|
|
|
13492
14085
|
fontStyle: r ? "italic" : "normal",
|
|
13493
14086
|
textDecoration: m.length > 0 ? m.join(" ") : "none",
|
|
13494
14087
|
...l
|
|
13495
|
-
} }, h, c && q(
|
|
14088
|
+
} }, h, c && q(Vo, { text: f }));
|
|
13496
14089
|
}
|
|
13497
|
-
function
|
|
13498
|
-
let a = v(), o = t === "secondary" ? a.textMuted : a.text, s =
|
|
14090
|
+
function Ko({ children: e, type: t = "default", copyable: n = !1, ellipsis: r = !1, style: i }) {
|
|
14091
|
+
let a = v(), o = t === "secondary" ? a.textMuted : a.text, s = Bo(e), c = typeof e == "string" ? B(e) : e, l = {};
|
|
13499
14092
|
if (r) {
|
|
13500
14093
|
let e = typeof r == "object" ? r.rows ?? 3 : 3;
|
|
13501
14094
|
l.display = "-webkit-box", l.WebkitLineClamp = e, l.WebkitBoxOrient = "vertical", l.overflow = "hidden";
|
|
@@ -13507,11 +14100,11 @@ function Mo({ children: e, type: t = "default", copyable: n = !1, ellipsis: r =
|
|
|
13507
14100
|
margin: "0 0 1em 0",
|
|
13508
14101
|
...l,
|
|
13509
14102
|
...i
|
|
13510
|
-
} }, c, n && q(
|
|
14103
|
+
} }, c, n && q(Vo, { text: s }));
|
|
13511
14104
|
}
|
|
13512
14105
|
//#endregion
|
|
13513
14106
|
//#region src/components/TkxSpin.tsx
|
|
13514
|
-
var
|
|
14107
|
+
var qo = {
|
|
13515
14108
|
sm: {
|
|
13516
14109
|
dimension: 20,
|
|
13517
14110
|
borderWidth: 2,
|
|
@@ -13527,14 +14120,14 @@ var No = {
|
|
|
13527
14120
|
borderWidth: 4,
|
|
13528
14121
|
fontSize: "1rem"
|
|
13529
14122
|
}
|
|
13530
|
-
},
|
|
13531
|
-
function
|
|
13532
|
-
if (
|
|
13533
|
-
|
|
14123
|
+
}, Jo = !1;
|
|
14124
|
+
function Yo() {
|
|
14125
|
+
if (Jo || typeof document > "u") return;
|
|
14126
|
+
Jo = !0;
|
|
13534
14127
|
let e = document.createElement("style");
|
|
13535
14128
|
e.id = "tkx-spin-styles", e.textContent = "\n @keyframes tkx-spin-rotate {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ", document.head.appendChild(e);
|
|
13536
14129
|
}
|
|
13537
|
-
function
|
|
14130
|
+
function Xo({ size: e, color: t }) {
|
|
13538
14131
|
return q("svg", {
|
|
13539
14132
|
width: e,
|
|
13540
14133
|
height: e,
|
|
@@ -13557,11 +14150,11 @@ function Io({ size: e, color: t }) {
|
|
|
13557
14150
|
fill: "none"
|
|
13558
14151
|
}));
|
|
13559
14152
|
}
|
|
13560
|
-
function
|
|
13561
|
-
return r ? q(
|
|
14153
|
+
function Zo({ size: e, borderWidth: t, color: n, reducedMotion: r }) {
|
|
14154
|
+
return r ? q(Xo, {
|
|
13562
14155
|
size: e,
|
|
13563
14156
|
color: n
|
|
13564
|
-
}) : (
|
|
14157
|
+
}) : (Yo(), q("div", {
|
|
13565
14158
|
role: "img",
|
|
13566
14159
|
"aria-label": "Loading",
|
|
13567
14160
|
style: {
|
|
@@ -13575,12 +14168,12 @@ function Lo({ size: e, borderWidth: t, color: n, reducedMotion: r }) {
|
|
|
13575
14168
|
}
|
|
13576
14169
|
}));
|
|
13577
14170
|
}
|
|
13578
|
-
function
|
|
14171
|
+
function Qo({ spinning: e = !0, size: t = "md", tip: n, indicator: r, children: i, fullscreen: a = !1, delay: o = 0, style: s }) {
|
|
13579
14172
|
let c = v(), l = G(), [u, d] = Z(o === 0 && e), f = X(null);
|
|
13580
14173
|
if (Y(() => (e && o > 0 ? f.current = setTimeout(() => d(!0), o) : d(e), () => {
|
|
13581
14174
|
f.current !== null && clearTimeout(f.current);
|
|
13582
14175
|
}), [e, o]), !u) return i ? q("div", { style: s }, i) : null;
|
|
13583
|
-
let p =
|
|
14176
|
+
let p = qo[t], m = n ? B(n) : void 0, h = q("div", {
|
|
13584
14177
|
role: "status",
|
|
13585
14178
|
"aria-live": "polite",
|
|
13586
14179
|
"aria-label": m ?? "Loading",
|
|
@@ -13591,7 +14184,7 @@ function Ro({ spinning: e = !0, size: t = "md", tip: n, indicator: r, children:
|
|
|
13591
14184
|
justifyContent: "center",
|
|
13592
14185
|
gap: "8px"
|
|
13593
14186
|
}
|
|
13594
|
-
}, r ?? q(
|
|
14187
|
+
}, r ?? q(Zo, {
|
|
13595
14188
|
size: p.dimension,
|
|
13596
14189
|
borderWidth: p.borderWidth,
|
|
13597
14190
|
color: c.primary,
|
|
@@ -13636,7 +14229,7 @@ function Ro({ spinning: e = !0, size: t = "md", tip: n, indicator: r, children:
|
|
|
13636
14229
|
}
|
|
13637
14230
|
//#endregion
|
|
13638
14231
|
//#region src/components/TkxEmpty.tsx
|
|
13639
|
-
function
|
|
14232
|
+
function $o({ color: e, mutedColor: t }) {
|
|
13640
14233
|
return q("svg", {
|
|
13641
14234
|
width: 120,
|
|
13642
14235
|
height: 100,
|
|
@@ -13677,7 +14270,7 @@ function zo({ color: e, mutedColor: t }) {
|
|
|
13677
14270
|
strokeDasharray: "3 2"
|
|
13678
14271
|
}));
|
|
13679
14272
|
}
|
|
13680
|
-
function
|
|
14273
|
+
function es({ mutedColor: e }) {
|
|
13681
14274
|
return q("svg", {
|
|
13682
14275
|
width: 64,
|
|
13683
14276
|
height: 64,
|
|
@@ -13734,12 +14327,12 @@ function Bo({ mutedColor: e }) {
|
|
|
13734
14327
|
strokeLinecap: "round"
|
|
13735
14328
|
}));
|
|
13736
14329
|
}
|
|
13737
|
-
function
|
|
14330
|
+
function ts({ image: e = "default", description: t = "No data", children: n, style: r }) {
|
|
13738
14331
|
let i = v(), a = typeof t == "string" ? B(t) : t, o;
|
|
13739
|
-
return o = e === "default" ? q(
|
|
14332
|
+
return o = e === "default" ? q($o, {
|
|
13740
14333
|
color: i.primary,
|
|
13741
14334
|
mutedColor: i.textMuted
|
|
13742
|
-
}) : e === "simple" ? q(
|
|
14335
|
+
}) : e === "simple" ? q(es, { mutedColor: i.textMuted }) : e, q("div", {
|
|
13743
14336
|
role: "status",
|
|
13744
14337
|
style: {
|
|
13745
14338
|
display: "flex",
|
|
@@ -13762,17 +14355,17 @@ function Vo({ image: e = "default", description: t = "No data", children: n, sty
|
|
|
13762
14355
|
}
|
|
13763
14356
|
//#endregion
|
|
13764
14357
|
//#region src/components/TkxStatistic.tsx
|
|
13765
|
-
function
|
|
14358
|
+
function ns(e, t, n = ",") {
|
|
13766
14359
|
if (typeof e == "string") return e;
|
|
13767
14360
|
let [r, i] = (t === void 0 ? String(e) : e.toFixed(t)).split("."), a = r.replace(/\B(?=(\d{3})+(?!\d))/g, n);
|
|
13768
14361
|
return i === void 0 ? a : `${a}.${i}`;
|
|
13769
14362
|
}
|
|
13770
|
-
function
|
|
14363
|
+
function rs(e, t) {
|
|
13771
14364
|
if (e <= 0) return t.replace(/DD?/g, "0").replace(/HH?/g, "00").replace(/mm?/g, "00").replace(/ss?/g, "00");
|
|
13772
14365
|
let n = Math.floor(e / 1e3), r = Math.floor(n / 86400), i = Math.floor(n % 86400 / 3600), a = Math.floor(n % 3600 / 60), o = n % 60, s = (e) => String(e).padStart(2, "0");
|
|
13773
14366
|
return t.replace(/DD/g, s(r)).replace(/D/g, String(r)).replace(/HH/g, s(i)).replace(/H/g, String(i)).replace(/mm/g, s(a)).replace(/m/g, String(a)).replace(/ss/g, s(o)).replace(/s/g, String(o));
|
|
13774
14367
|
}
|
|
13775
|
-
function
|
|
14368
|
+
function is({ direction: e, color: t }) {
|
|
13776
14369
|
return q("svg", {
|
|
13777
14370
|
width: 16,
|
|
13778
14371
|
height: 14,
|
|
@@ -13792,15 +14385,15 @@ function Wo({ direction: e, color: t }) {
|
|
|
13792
14385
|
fill: "none"
|
|
13793
14386
|
}));
|
|
13794
14387
|
}
|
|
13795
|
-
var
|
|
13796
|
-
function
|
|
13797
|
-
if (
|
|
13798
|
-
|
|
14388
|
+
var as = !1;
|
|
14389
|
+
function os() {
|
|
14390
|
+
if (as || typeof document > "u") return;
|
|
14391
|
+
as = !0;
|
|
13799
14392
|
let e = document.createElement("style");
|
|
13800
14393
|
e.id = "tkx-statistic-skeleton", e.textContent = "@keyframes tkx-stat-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}", document.head.appendChild(e);
|
|
13801
14394
|
}
|
|
13802
|
-
function
|
|
13803
|
-
return i ||
|
|
14395
|
+
function ss({ w: e, h: t, alt: n, bdr: r, rm: i }) {
|
|
14396
|
+
return i || os(), q("div", {
|
|
13804
14397
|
"aria-hidden": "true",
|
|
13805
14398
|
style: {
|
|
13806
14399
|
width: e,
|
|
@@ -13812,7 +14405,7 @@ function qo({ w: e, h: t, alt: n, bdr: r, rm: i }) {
|
|
|
13812
14405
|
}
|
|
13813
14406
|
});
|
|
13814
14407
|
}
|
|
13815
|
-
function
|
|
14408
|
+
function cs({ title: e, value: t, prefix: n, suffix: r, precision: i, groupSeparator: a = ",", valueStyle: o, loading: s = !1, trend: c, trendValue: l, style: u }) {
|
|
13816
14409
|
let d = v(), f = G(), p = B(e), m = l ? B(l) : void 0, h = c === "up" ? d.success : c === "down" ? d.danger : void 0;
|
|
13817
14410
|
return q("div", { style: {
|
|
13818
14411
|
display: "flex",
|
|
@@ -13823,7 +14416,7 @@ function Jo({ title: e, value: t, prefix: n, suffix: r, precision: i, groupSepar
|
|
|
13823
14416
|
color: d.textMuted,
|
|
13824
14417
|
fontSize: "0.875rem",
|
|
13825
14418
|
lineHeight: "1.4"
|
|
13826
|
-
} }, p), s ? q(
|
|
14419
|
+
} }, p), s ? q(ss, {
|
|
13827
14420
|
w: "120px",
|
|
13828
14421
|
h: "32px",
|
|
13829
14422
|
alt: d.surfaceAlt,
|
|
@@ -13842,7 +14435,7 @@ function Jo({ title: e, value: t, prefix: n, suffix: r, precision: i, groupSepar
|
|
|
13842
14435
|
} }, n && q("span", { style: {
|
|
13843
14436
|
fontSize: "0.75em",
|
|
13844
14437
|
fontWeight: 400
|
|
13845
|
-
} }, n), q("span", null,
|
|
14438
|
+
} }, n), q("span", null, ns(t, i, a)), r && q("span", { style: {
|
|
13846
14439
|
fontSize: "0.6em",
|
|
13847
14440
|
fontWeight: 400,
|
|
13848
14441
|
color: d.textMuted
|
|
@@ -13853,12 +14446,12 @@ function Jo({ title: e, value: t, prefix: n, suffix: r, precision: i, groupSepar
|
|
|
13853
14446
|
fontSize: "0.8125rem",
|
|
13854
14447
|
color: h,
|
|
13855
14448
|
marginTop: "2px"
|
|
13856
|
-
} }, q(
|
|
14449
|
+
} }, q(is, {
|
|
13857
14450
|
direction: c,
|
|
13858
14451
|
color: h
|
|
13859
14452
|
}), m && q("span", null, m)));
|
|
13860
14453
|
}
|
|
13861
|
-
function
|
|
14454
|
+
function ls({ title: e, value: t, format: n = "HH:mm:ss", onFinish: r, prefix: i, suffix: a, style: o }) {
|
|
13862
14455
|
let s = v(), c = B(e), l = X(r);
|
|
13863
14456
|
l.current = r;
|
|
13864
14457
|
let u = X(!1), [d, f] = Z(() => Math.max(0, t - Date.now()));
|
|
@@ -13872,7 +14465,7 @@ function Yo({ title: e, value: t, format: n = "HH:mm:ss", onFinish: r, prefix: i
|
|
|
13872
14465
|
let n = setInterval(e, 1e3);
|
|
13873
14466
|
return () => clearInterval(n);
|
|
13874
14467
|
}, [t]);
|
|
13875
|
-
let p =
|
|
14468
|
+
let p = rs(d, n);
|
|
13876
14469
|
return q("div", { style: {
|
|
13877
14470
|
display: "flex",
|
|
13878
14471
|
flexDirection: "column",
|
|
@@ -13902,7 +14495,7 @@ function Yo({ title: e, value: t, format: n = "HH:mm:ss", onFinish: r, prefix: i
|
|
|
13902
14495
|
}
|
|
13903
14496
|
//#endregion
|
|
13904
14497
|
//#region src/components/TkxSegmented.tsx
|
|
13905
|
-
var
|
|
14498
|
+
var us = {
|
|
13906
14499
|
sm: {
|
|
13907
14500
|
height: 28,
|
|
13908
14501
|
fontSize: 12,
|
|
@@ -13919,8 +14512,8 @@ var Xo = {
|
|
|
13919
14512
|
px: 20
|
|
13920
14513
|
}
|
|
13921
14514
|
};
|
|
13922
|
-
function
|
|
13923
|
-
let a = v(), o = G(), s = X(null), [c, l] = Z(() => Math.max(0, e.findIndex((e) => e.value === t))), [u, d] = Z({}), f =
|
|
14515
|
+
function ds({ options: e, value: t, onChange: n, size: r = "md", block: i = !1 }) {
|
|
14516
|
+
let a = v(), o = G(), s = X(null), [c, l] = Z(() => Math.max(0, e.findIndex((e) => e.value === t))), [u, d] = Z({}), f = us[r];
|
|
13924
14517
|
Y(() => {
|
|
13925
14518
|
let n = e.findIndex((e) => e.value === t);
|
|
13926
14519
|
n >= 0 && l(n);
|
|
@@ -14005,7 +14598,7 @@ function Zo({ options: e, value: t, onChange: n, size: r = "md", block: i = !1 }
|
|
|
14005
14598
|
}
|
|
14006
14599
|
//#endregion
|
|
14007
14600
|
//#region src/components/TkxMentions.tsx
|
|
14008
|
-
function
|
|
14601
|
+
function fs({ options: e, value: t = "", onChange: n, trigger: r = "@", placeholder: i, label: a }) {
|
|
14009
14602
|
let o = v(), s = G(), c = X(null), l = X(null), [u, d] = Z(t), [f, p] = Z(!1), [m, h] = Z(""), [g, _] = Z(0), [y, b] = Z(-1);
|
|
14010
14603
|
Y(() => {
|
|
14011
14604
|
t !== void 0 && d(t);
|
|
@@ -14128,23 +14721,23 @@ function Qo({ options: e, value: t = "", onChange: n, trigger: r = "@", placehol
|
|
|
14128
14721
|
}
|
|
14129
14722
|
//#endregion
|
|
14130
14723
|
//#region src/components/TkxQRCode.tsx
|
|
14131
|
-
function
|
|
14724
|
+
function ps(e) {
|
|
14132
14725
|
let t = 5381;
|
|
14133
14726
|
for (let n = 0; n < e.length; n++) t = (t << 5) + t + e.charCodeAt(n) | 0;
|
|
14134
14727
|
return Math.abs(t);
|
|
14135
14728
|
}
|
|
14136
|
-
function
|
|
14729
|
+
function ms(e) {
|
|
14137
14730
|
let t = e;
|
|
14138
14731
|
return () => (t = t * 1664525 + 1013904223 | 0, (t >>> 0) / 4294967295);
|
|
14139
14732
|
}
|
|
14140
|
-
var
|
|
14733
|
+
var hs = {
|
|
14141
14734
|
L: .38,
|
|
14142
14735
|
M: .42,
|
|
14143
14736
|
Q: .48,
|
|
14144
14737
|
H: .55
|
|
14145
14738
|
};
|
|
14146
|
-
function
|
|
14147
|
-
let r =
|
|
14739
|
+
function gs(e, t, n) {
|
|
14740
|
+
let r = ms(ps(e)), i = hs[n] ?? .42, a = Array.from({ length: t }, () => Array.from({ length: t }, () => !1)), o = (e, t) => {
|
|
14148
14741
|
for (let n = 0; n < 7; n++) for (let r = 0; r < 7; r++) {
|
|
14149
14742
|
let i = n === 0 || n === 6 || r === 0 || r === 6, o = n >= 2 && n <= 4 && r >= 2 && r <= 4;
|
|
14150
14743
|
a[e + n][t + r] = i || o;
|
|
@@ -14155,8 +14748,8 @@ function ns(e, t, n) {
|
|
|
14155
14748
|
for (let e = 0; e < t; e++) for (let n = 0; n < t; n++) e < 8 && n < 8 || e < 8 && n >= t - 8 || e >= t - 8 && n < 8 || e === 6 || n === 6 || (a[e][n] = r() < i);
|
|
14156
14749
|
return a;
|
|
14157
14750
|
}
|
|
14158
|
-
function
|
|
14159
|
-
let s = v(), c = G(), l = X(null), u = B(e), d = n ?? s.text, f = r ?? s.surface, p = Ee(() =>
|
|
14751
|
+
function _s({ value: e, size: t = 160, color: n, bgColor: r, errorLevel: i = "M", icon: a, bordered: o = !0 }) {
|
|
14752
|
+
let s = v(), c = G(), l = X(null), u = B(e), d = n ?? s.text, f = r ?? s.surface, p = Ee(() => gs(u, 25, i), [u, i]);
|
|
14160
14753
|
return Y(() => {
|
|
14161
14754
|
let e = l.current;
|
|
14162
14755
|
if (!e) return;
|
|
@@ -14205,7 +14798,7 @@ function rs({ value: e, size: t = 160, color: n, bgColor: r, errorLevel: i = "M"
|
|
|
14205
14798
|
}
|
|
14206
14799
|
//#endregion
|
|
14207
14800
|
//#region src/components/TkxResult.tsx
|
|
14208
|
-
var
|
|
14801
|
+
var vs = {
|
|
14209
14802
|
success: (e) => /* @__PURE__ */ $("svg", {
|
|
14210
14803
|
width: "72",
|
|
14211
14804
|
height: "72",
|
|
@@ -14379,7 +14972,7 @@ var is = {
|
|
|
14379
14972
|
})]
|
|
14380
14973
|
})
|
|
14381
14974
|
};
|
|
14382
|
-
function
|
|
14975
|
+
function ys(e, t) {
|
|
14383
14976
|
switch (e) {
|
|
14384
14977
|
case "success": return t.success;
|
|
14385
14978
|
case "error":
|
|
@@ -14390,8 +14983,8 @@ function as(e, t) {
|
|
|
14390
14983
|
case "403": return t.textMuted;
|
|
14391
14984
|
}
|
|
14392
14985
|
}
|
|
14393
|
-
function
|
|
14394
|
-
let a = v(), o = G(), s =
|
|
14986
|
+
function bs({ status: e, title: t, subTitle: n, icon: r, extra: i }) {
|
|
14987
|
+
let a = v(), o = G(), s = ys(e, a), c = B(t), l = n ? B(n) : void 0;
|
|
14395
14988
|
return /* @__PURE__ */ $("div", {
|
|
14396
14989
|
role: "status",
|
|
14397
14990
|
"aria-live": "polite",
|
|
@@ -14400,7 +14993,7 @@ function os({ status: e, title: t, subTitle: n, icon: r, extra: i }) {
|
|
|
14400
14993
|
children: [
|
|
14401
14994
|
/* @__PURE__ */ Q("div", {
|
|
14402
14995
|
className: F("mb-6"),
|
|
14403
|
-
children: r ??
|
|
14996
|
+
children: r ?? vs[e](s)
|
|
14404
14997
|
}),
|
|
14405
14998
|
/* @__PURE__ */ Q("h2", {
|
|
14406
14999
|
className: F("text-xl font-semibold m-0 mb-2"),
|
|
@@ -14421,11 +15014,11 @@ function os({ status: e, title: t, subTitle: n, icon: r, extra: i }) {
|
|
|
14421
15014
|
}
|
|
14422
15015
|
//#endregion
|
|
14423
15016
|
//#region src/components/TkxTour.tsx
|
|
14424
|
-
function
|
|
15017
|
+
function xs(e) {
|
|
14425
15018
|
let t = document.querySelector(e);
|
|
14426
15019
|
return t ? t.getBoundingClientRect() : null;
|
|
14427
15020
|
}
|
|
14428
|
-
function
|
|
15021
|
+
function Ss(e, t, n, r) {
|
|
14429
15022
|
switch (t) {
|
|
14430
15023
|
case "top": return {
|
|
14431
15024
|
top: e.top - r - 12 + window.scrollY,
|
|
@@ -14449,16 +15042,16 @@ function cs(e, t, n, r) {
|
|
|
14449
15042
|
};
|
|
14450
15043
|
}
|
|
14451
15044
|
}
|
|
14452
|
-
function
|
|
15045
|
+
function Cs({ steps: e, isOpen: t = !1, onClose: n, current: r, onChange: i }) {
|
|
14453
15046
|
let a = v(), o = G(), [s, c] = Z(0), l = r ?? s, u = X(null), [d, f] = Z({
|
|
14454
15047
|
top: 0,
|
|
14455
15048
|
left: 0
|
|
14456
15049
|
}), [p, m] = Z(null), h = e[l], g = J(() => {
|
|
14457
15050
|
if (!h) return;
|
|
14458
|
-
let e =
|
|
15051
|
+
let e = xs(h.target);
|
|
14459
15052
|
if (m(e), e && u.current) {
|
|
14460
15053
|
let t = u.current.offsetWidth, n = u.current.offsetHeight;
|
|
14461
|
-
f(
|
|
15054
|
+
f(Ss(e, h.placement ?? "bottom", t, n));
|
|
14462
15055
|
}
|
|
14463
15056
|
}, [h]);
|
|
14464
15057
|
Y(() => {
|
|
@@ -14586,7 +15179,7 @@ function ls({ steps: e, isOpen: t = !1, onClose: n, current: r, onChange: i }) {
|
|
|
14586
15179
|
}
|
|
14587
15180
|
//#endregion
|
|
14588
15181
|
//#region src/components/TkxWatermark.tsx
|
|
14589
|
-
function
|
|
15182
|
+
function ws(e, t, n, r, i) {
|
|
14590
15183
|
let a = document.createElement("canvas"), o = a.getContext("2d");
|
|
14591
15184
|
if (!o) return "";
|
|
14592
15185
|
let s = r * 1.5, c = e.length * s, l = Math.max(...e.map((e) => e.length)) * r * .6, u = n[0] + l, d = n[1] + c;
|
|
@@ -14595,8 +15188,8 @@ function us(e, t, n, r, i) {
|
|
|
14595
15188
|
o.fillText(t, 0, r);
|
|
14596
15189
|
}), a.toDataURL();
|
|
14597
15190
|
}
|
|
14598
|
-
function
|
|
14599
|
-
let s = v(), c = G(), l = X(null), [u, d] = Z(""), f = Ee(() => (Array.isArray(e) ? e : [e]).map((e) => B(e)), [e]), p = a ?? `${s.textMuted}22`, m = J(() =>
|
|
15191
|
+
function Ts({ text: e, children: t, rotate: n = -22, gap: r = [100, 100], fontSize: i = 14, color: a, zIndex: o = 10 }) {
|
|
15192
|
+
let s = v(), c = G(), l = X(null), [u, d] = Z(""), f = Ee(() => (Array.isArray(e) ? e : [e]).map((e) => B(e)), [e]), p = a ?? `${s.textMuted}22`, m = J(() => ws(f, n, r, i, p), [
|
|
14600
15193
|
f,
|
|
14601
15194
|
n,
|
|
14602
15195
|
r,
|
|
@@ -14636,7 +15229,7 @@ function ds({ text: e, children: t, rotate: n = -22, gap: r = [100, 100], fontSi
|
|
|
14636
15229
|
}
|
|
14637
15230
|
//#endregion
|
|
14638
15231
|
//#region src/components/TkxAffix.tsx
|
|
14639
|
-
function
|
|
15232
|
+
function Es(e) {
|
|
14640
15233
|
if (e) try {
|
|
14641
15234
|
return e();
|
|
14642
15235
|
} catch {
|
|
@@ -14644,7 +15237,7 @@ function fs(e) {
|
|
|
14644
15237
|
}
|
|
14645
15238
|
return window;
|
|
14646
15239
|
}
|
|
14647
|
-
function
|
|
15240
|
+
function Ds(e) {
|
|
14648
15241
|
if (e instanceof Window) return {
|
|
14649
15242
|
top: 0,
|
|
14650
15243
|
bottom: e.innerHeight
|
|
@@ -14655,14 +15248,14 @@ function ps(e) {
|
|
|
14655
15248
|
bottom: t.bottom
|
|
14656
15249
|
};
|
|
14657
15250
|
}
|
|
14658
|
-
function
|
|
15251
|
+
function Os({ children: e, offsetTop: t, offsetBottom: n, onChange: r, target: i }) {
|
|
14659
15252
|
let a = v(), o = G(), s = X(null), c = X(null), [l, u] = Z(!1), [d, f] = Z({
|
|
14660
15253
|
width: 0,
|
|
14661
15254
|
height: 0
|
|
14662
15255
|
}), p = X(!1), m = Ee(() => B("Sticky content"), []), h = J(() => {
|
|
14663
15256
|
let e = s.current;
|
|
14664
15257
|
if (!e) return;
|
|
14665
|
-
let a = e.getBoundingClientRect(), o =
|
|
15258
|
+
let a = e.getBoundingClientRect(), o = Ds(Es(i)), c = !1;
|
|
14666
15259
|
t === void 0 ? n !== void 0 && (c = o.bottom - a.bottom <= n) : c = a.top - o.top <= t, c !== p.current && (p.current = c, u(c), f({
|
|
14667
15260
|
width: a.width,
|
|
14668
15261
|
height: a.height
|
|
@@ -14674,7 +15267,7 @@ function ms({ children: e, offsetTop: t, offsetBottom: n, onChange: r, target: i
|
|
|
14674
15267
|
i
|
|
14675
15268
|
]);
|
|
14676
15269
|
Y(() => {
|
|
14677
|
-
let e =
|
|
15270
|
+
let e = Es(i);
|
|
14678
15271
|
return h(), e.addEventListener("scroll", h, { passive: !0 }), window.addEventListener("resize", h), () => {
|
|
14679
15272
|
e.removeEventListener("scroll", h), window.removeEventListener("resize", h);
|
|
14680
15273
|
};
|
|
@@ -14706,15 +15299,15 @@ function ms({ children: e, offsetTop: t, offsetBottom: n, onChange: r, target: i
|
|
|
14706
15299
|
}
|
|
14707
15300
|
//#endregion
|
|
14708
15301
|
//#region src/components/TkxAnchor.tsx
|
|
14709
|
-
function
|
|
15302
|
+
function ks(e) {
|
|
14710
15303
|
let t = [];
|
|
14711
|
-
for (let n of e) t.push(n), n.children && t.push(...
|
|
15304
|
+
for (let n of e) t.push(n), n.children && t.push(...ks(n.children));
|
|
14712
15305
|
return t;
|
|
14713
15306
|
}
|
|
14714
|
-
function
|
|
15307
|
+
function As(e) {
|
|
14715
15308
|
return e.startsWith("#") ? e.slice(1) : e;
|
|
14716
15309
|
}
|
|
14717
|
-
function
|
|
15310
|
+
function js({ item: e, activeKey: t, depth: n, onClick: r, theme: i, reducedMotion: a }) {
|
|
14718
15311
|
let o = e.key === t, s = B(e.title);
|
|
14719
15312
|
return /* @__PURE__ */ $("li", {
|
|
14720
15313
|
role: "none",
|
|
@@ -14741,7 +15334,7 @@ function _s({ item: e, activeKey: t, depth: n, onClick: r, theme: i, reducedMoti
|
|
|
14741
15334
|
margin: 0,
|
|
14742
15335
|
padding: 0
|
|
14743
15336
|
},
|
|
14744
|
-
children: e.children.map((e) => /* @__PURE__ */ Q(
|
|
15337
|
+
children: e.children.map((e) => /* @__PURE__ */ Q(js, {
|
|
14745
15338
|
item: e,
|
|
14746
15339
|
activeKey: t,
|
|
14747
15340
|
depth: n + 1,
|
|
@@ -14752,12 +15345,12 @@ function _s({ item: e, activeKey: t, depth: n, onClick: r, theme: i, reducedMoti
|
|
|
14752
15345
|
})]
|
|
14753
15346
|
});
|
|
14754
15347
|
}
|
|
14755
|
-
function
|
|
14756
|
-
let i = v(), a = G(), [o, s] = Z(e[0]?.key ?? ""), c = X(!1), l =
|
|
15348
|
+
function Ms({ items: e, offsetTop: t = 0, getCurrentAnchor: n, onChange: r }) {
|
|
15349
|
+
let i = v(), a = G(), [o, s] = Z(e[0]?.key ?? ""), c = X(!1), l = ks(e), u = J(() => {
|
|
14757
15350
|
if (c.current) return;
|
|
14758
15351
|
let e = l[0]?.key ?? "";
|
|
14759
15352
|
for (let n of l) {
|
|
14760
|
-
let r =
|
|
15353
|
+
let r = As(n.href), i = document.getElementById(r);
|
|
14761
15354
|
i && i.getBoundingClientRect().top <= t + 10 && (e = n.key);
|
|
14762
15355
|
}
|
|
14763
15356
|
n && (e = n(e)), e !== o && (s(e), r?.(e));
|
|
@@ -14770,7 +15363,7 @@ function vs({ items: e, offsetTop: t = 0, getCurrentAnchor: n, onChange: r }) {
|
|
|
14770
15363
|
]);
|
|
14771
15364
|
Y(() => (window.addEventListener("scroll", u, { passive: !0 }), u(), () => window.removeEventListener("scroll", u)), [u]);
|
|
14772
15365
|
let d = J((e) => {
|
|
14773
|
-
let n =
|
|
15366
|
+
let n = As(e), i = document.getElementById(n);
|
|
14774
15367
|
if (!i) return;
|
|
14775
15368
|
c.current = !0;
|
|
14776
15369
|
let o = i.getBoundingClientRect().top + window.scrollY - t;
|
|
@@ -14802,7 +15395,7 @@ function vs({ items: e, offsetTop: t = 0, getCurrentAnchor: n, onChange: r }) {
|
|
|
14802
15395
|
margin: 0,
|
|
14803
15396
|
padding: 0
|
|
14804
15397
|
},
|
|
14805
|
-
children: e.map((e) => /* @__PURE__ */ Q(
|
|
15398
|
+
children: e.map((e) => /* @__PURE__ */ Q(js, {
|
|
14806
15399
|
item: e,
|
|
14807
15400
|
activeKey: o,
|
|
14808
15401
|
depth: 0,
|
|
@@ -14815,7 +15408,7 @@ function vs({ items: e, offsetTop: t = 0, getCurrentAnchor: n, onChange: r }) {
|
|
|
14815
15408
|
}
|
|
14816
15409
|
//#endregion
|
|
14817
15410
|
//#region src/components/TkxCascader.tsx
|
|
14818
|
-
function
|
|
15411
|
+
function Ns(e, t) {
|
|
14819
15412
|
let n = [e], r = e;
|
|
14820
15413
|
for (let e of t) {
|
|
14821
15414
|
let t = r.find((t) => t.value === e);
|
|
@@ -14824,7 +15417,7 @@ function ys(e, t) {
|
|
|
14824
15417
|
}
|
|
14825
15418
|
return n;
|
|
14826
15419
|
}
|
|
14827
|
-
function
|
|
15420
|
+
function Ps(e, t) {
|
|
14828
15421
|
let n = [], r = e;
|
|
14829
15422
|
for (let e of t) {
|
|
14830
15423
|
let t = r.find((t) => t.value === e);
|
|
@@ -14833,15 +15426,15 @@ function bs(e, t) {
|
|
|
14833
15426
|
}
|
|
14834
15427
|
return n;
|
|
14835
15428
|
}
|
|
14836
|
-
function
|
|
14837
|
-
return
|
|
15429
|
+
function Fs(e, t) {
|
|
15430
|
+
return Ps(e, t).map((e) => B(e.label)).join(" / ");
|
|
14838
15431
|
}
|
|
14839
|
-
function
|
|
15432
|
+
function Is({ options: e, value: t = [], onChange: n, placeholder: r = "Select...", label: i, multiple: a = !1 }) {
|
|
14840
15433
|
let o = v(), s = G(), c = X(null), l = X(null), [u, d] = Z(!1), [f, p] = Z(t), [m, h] = Z({
|
|
14841
15434
|
top: 0,
|
|
14842
15435
|
left: 0,
|
|
14843
15436
|
width: 0
|
|
14844
|
-
}), g = i ? B(i) : void 0, _ = B(r), y = t.length > 0 ?
|
|
15437
|
+
}), g = i ? B(i) : void 0, _ = B(r), y = t.length > 0 ? Fs(e, t) : "";
|
|
14845
15438
|
Y(() => {
|
|
14846
15439
|
if (!u || !c.current) return;
|
|
14847
15440
|
let e = c.current.getBoundingClientRect();
|
|
@@ -14861,7 +15454,7 @@ function Ss({ options: e, value: t = [], onChange: n, placeholder: r = "Select..
|
|
|
14861
15454
|
if (r.disabled) return;
|
|
14862
15455
|
let i = [...f.slice(0, t), r.value];
|
|
14863
15456
|
if (p(i), !r.children?.length) {
|
|
14864
|
-
let t =
|
|
15457
|
+
let t = Ps(e, i);
|
|
14865
15458
|
n?.(i, t), a || d(!1);
|
|
14866
15459
|
}
|
|
14867
15460
|
}, [
|
|
@@ -14871,7 +15464,7 @@ function Ss({ options: e, value: t = [], onChange: n, placeholder: r = "Select..
|
|
|
14871
15464
|
a
|
|
14872
15465
|
]), x = J((e) => {
|
|
14873
15466
|
e.key === "Escape" ? (d(!1), c.current?.focus()) : (e.key === "Enter" || e.key === " ") && (u || (e.preventDefault(), d(!0)));
|
|
14874
|
-
}, [u]), S =
|
|
15467
|
+
}, [u]), S = Ns(e, f), C = u ? ke(/* @__PURE__ */ Q("div", {
|
|
14875
15468
|
ref: l,
|
|
14876
15469
|
role: "tree",
|
|
14877
15470
|
"aria-label": g ?? "Cascader options",
|
|
@@ -14979,12 +15572,12 @@ function Ss({ options: e, value: t = [], onChange: n, placeholder: r = "Select..
|
|
|
14979
15572
|
}
|
|
14980
15573
|
//#endregion
|
|
14981
15574
|
//#region src/components/TkxList.tsx
|
|
14982
|
-
var
|
|
15575
|
+
var Ls = {
|
|
14983
15576
|
sm: "8px 12px",
|
|
14984
15577
|
md: "12px 16px",
|
|
14985
15578
|
lg: "16px 20px"
|
|
14986
15579
|
};
|
|
14987
|
-
function
|
|
15580
|
+
function Rs({ theme: e, reducedMotion: t }) {
|
|
14988
15581
|
return /* @__PURE__ */ $("div", {
|
|
14989
15582
|
className: F("flex items-center gap-3 px-4 py-3"),
|
|
14990
15583
|
"aria-hidden": "true",
|
|
@@ -15013,8 +15606,8 @@ function ws({ theme: e, reducedMotion: t }) {
|
|
|
15013
15606
|
})]
|
|
15014
15607
|
});
|
|
15015
15608
|
}
|
|
15016
|
-
function
|
|
15017
|
-
let c = v(), l = G(), u = B(o), d =
|
|
15609
|
+
function zs({ items: e, header: t, footer: n, bordered: r = !0, size: i = "md", loading: a = !1, emptyText: o = "No data", grid: s }) {
|
|
15610
|
+
let c = v(), l = G(), u = B(o), d = Ls[i], f = !!s, p = s?.column ?? 1, m = s?.gutter ?? 16;
|
|
15018
15611
|
return /* @__PURE__ */ $("div", {
|
|
15019
15612
|
role: "list",
|
|
15020
15613
|
"aria-label": "List",
|
|
@@ -15035,7 +15628,7 @@ function Ts({ items: e, header: t, footer: n, bordered: r = !0, size: i = "md",
|
|
|
15035
15628
|
},
|
|
15036
15629
|
children: t
|
|
15037
15630
|
}),
|
|
15038
|
-
a && /* @__PURE__ */ Q("div", { children: Array.from({ length: 3 }).map((e, t) => /* @__PURE__ */ Q(
|
|
15631
|
+
a && /* @__PURE__ */ Q("div", { children: Array.from({ length: 3 }).map((e, t) => /* @__PURE__ */ Q(Rs, {
|
|
15039
15632
|
theme: c,
|
|
15040
15633
|
reducedMotion: l
|
|
15041
15634
|
}, t)) }),
|
|
@@ -15113,7 +15706,7 @@ function Ts({ items: e, header: t, footer: n, bordered: r = !0, size: i = "md",
|
|
|
15113
15706
|
}
|
|
15114
15707
|
//#endregion
|
|
15115
15708
|
//#region src/i18n/I18nProvider.tsx
|
|
15116
|
-
function
|
|
15709
|
+
function Bs({ locale: e = "en-US", direction: t, strings: n, children: r }) {
|
|
15117
15710
|
let i = Ee(() => {
|
|
15118
15711
|
let r = me[e] ?? he, i = n ? {
|
|
15119
15712
|
...r,
|
|
@@ -15143,14 +15736,14 @@ function Es({ locale: e = "en-US", direction: t, strings: n, children: r }) {
|
|
|
15143
15736
|
}
|
|
15144
15737
|
//#endregion
|
|
15145
15738
|
//#region src/a11y/index.tsx
|
|
15146
|
-
function
|
|
15739
|
+
function Vs({ contentId: e = "tkx-main-content", label: t = "Skip to main content" }) {
|
|
15147
15740
|
return /* @__PURE__ */ Q("a", {
|
|
15148
15741
|
href: `#${e}`,
|
|
15149
15742
|
className: "tkx-skip-nav",
|
|
15150
15743
|
children: t
|
|
15151
15744
|
});
|
|
15152
15745
|
}
|
|
15153
|
-
function
|
|
15746
|
+
function Hs({ politeness: e = "polite", children: t, atomic: n = !0 }) {
|
|
15154
15747
|
return /* @__PURE__ */ Q("div", {
|
|
15155
15748
|
role: "status",
|
|
15156
15749
|
"aria-live": e,
|
|
@@ -15159,13 +15752,13 @@ function Os({ politeness: e = "polite", children: t, atomic: n = !0 }) {
|
|
|
15159
15752
|
children: t
|
|
15160
15753
|
});
|
|
15161
15754
|
}
|
|
15162
|
-
function
|
|
15755
|
+
function Us({ active: e, children: t, as: n = "div" }) {
|
|
15163
15756
|
return /* @__PURE__ */ Q(n, {
|
|
15164
15757
|
ref: se(e),
|
|
15165
15758
|
children: t
|
|
15166
15759
|
});
|
|
15167
15760
|
}
|
|
15168
|
-
function
|
|
15761
|
+
function Ws({ as: e, children: t, ...n }) {
|
|
15169
15762
|
return /* @__PURE__ */ Q(e ?? "span", {
|
|
15170
15763
|
className: "tkx-sr-only",
|
|
15171
15764
|
...n,
|
|
@@ -15174,7 +15767,7 @@ function As({ as: e, children: t, ...n }) {
|
|
|
15174
15767
|
}
|
|
15175
15768
|
//#endregion
|
|
15176
15769
|
//#region src/components/TkxDropdown.tsx
|
|
15177
|
-
function
|
|
15770
|
+
function Gs(e, t, n, r) {
|
|
15178
15771
|
let i = e.getBoundingClientRect(), a = t ? t.offsetHeight : 320, o = t ? t.offsetWidth : 200, s = window.innerWidth, c = window.innerHeight, l = window.scrollX, u = window.scrollY, d = 0, f = 0;
|
|
15179
15772
|
switch (n) {
|
|
15180
15773
|
case "bottom-start":
|
|
@@ -15203,7 +15796,7 @@ function js(e, t, n, r) {
|
|
|
15203
15796
|
minWidth: i.width
|
|
15204
15797
|
};
|
|
15205
15798
|
}
|
|
15206
|
-
function
|
|
15799
|
+
function Ks(e, t) {
|
|
15207
15800
|
if (!t) return e;
|
|
15208
15801
|
let n = e.toLowerCase().indexOf(t.toLowerCase());
|
|
15209
15802
|
return n === -1 ? e : /* @__PURE__ */ $(Oe, { children: [
|
|
@@ -15219,16 +15812,16 @@ function Ms(e, t) {
|
|
|
15219
15812
|
e.slice(n + t.length)
|
|
15220
15813
|
] });
|
|
15221
15814
|
}
|
|
15222
|
-
function
|
|
15815
|
+
function qs(e, t) {
|
|
15223
15816
|
let n = [];
|
|
15224
15817
|
for (let r of e) for (let e of r.items) e.disabled || (!t || e.label.toLowerCase().includes(t.toLowerCase())) && n.push(e);
|
|
15225
15818
|
return n;
|
|
15226
15819
|
}
|
|
15227
|
-
function
|
|
15820
|
+
function Js({ groups: e, position: t, maxHeight: n, minWidth: r, selectedKeys: i, multiSelect: a, searchable: o, searchPlaceholder: s, onSelect: c, onClose: l, renderItem: u, menuRef: d, isPortal: f, menuId: p }) {
|
|
15228
15821
|
let m = v(), [h, g] = Z(""), [_, y] = Z(0), [b, x] = Z(null), [S, C] = Z(0), w = X(null), T = X([]), E = X([]), D = h ? e.map((e) => ({
|
|
15229
15822
|
...e,
|
|
15230
15823
|
items: e.items.filter((e) => e.label.toLowerCase().includes(h.toLowerCase()) || e.description?.toLowerCase().includes(h.toLowerCase()) || e.children?.some((e) => e.label.toLowerCase().includes(h.toLowerCase())))
|
|
15231
|
-
})).filter((e) => e.items.length > 0) : e, O =
|
|
15824
|
+
})).filter((e) => e.items.length > 0) : e, O = qs(D, h);
|
|
15232
15825
|
Y(() => {
|
|
15233
15826
|
o && w.current ? w.current.focus() : T.current[0]?.focus(), y(0);
|
|
15234
15827
|
}, [o]), Y(() => {
|
|
@@ -15362,7 +15955,7 @@ function Ps({ groups: e, position: t, maxHeight: n, minWidth: r, selectedKeys: i
|
|
|
15362
15955
|
}), e.items.map((e) => {
|
|
15363
15956
|
let t = j;
|
|
15364
15957
|
e.disabled || j++;
|
|
15365
|
-
let n = i.includes(e.key), r = t === _ && !e.disabled, o = !!e.children?.length, s = b === e.key, l = u ? u(e, n) : /* @__PURE__ */ Q(
|
|
15958
|
+
let n = i.includes(e.key), r = t === _ && !e.disabled, o = !!e.children?.length, s = b === e.key, l = u ? u(e, n) : /* @__PURE__ */ Q(Ys, {
|
|
15366
15959
|
item: e,
|
|
15367
15960
|
isSelected: n,
|
|
15368
15961
|
isFocused: r,
|
|
@@ -15435,7 +16028,7 @@ function Ps({ groups: e, position: t, maxHeight: n, minWidth: r, selectedKeys: i
|
|
|
15435
16028
|
t.stopPropagation(), e.disabled || c(e.key, e);
|
|
15436
16029
|
},
|
|
15437
16030
|
onMouseEnter: () => C(t),
|
|
15438
|
-
children: /* @__PURE__ */ Q(
|
|
16031
|
+
children: /* @__PURE__ */ Q(Ys, {
|
|
15439
16032
|
item: e,
|
|
15440
16033
|
isSelected: n,
|
|
15441
16034
|
isFocused: r,
|
|
@@ -15453,7 +16046,7 @@ function Ps({ groups: e, position: t, maxHeight: n, minWidth: r, selectedKeys: i
|
|
|
15453
16046
|
]
|
|
15454
16047
|
});
|
|
15455
16048
|
}
|
|
15456
|
-
function
|
|
16049
|
+
function Ys({ item: e, isSelected: t, isFocused: n, multiSelect: r, query: i, theme: a, hasSubmenu: o }) {
|
|
15457
16050
|
return /* @__PURE__ */ $("div", {
|
|
15458
16051
|
style: {
|
|
15459
16052
|
display: "flex",
|
|
@@ -15510,14 +16103,14 @@ function Fs({ item: e, isSelected: t, isFocused: n, multiSelect: r, query: i, th
|
|
|
15510
16103
|
},
|
|
15511
16104
|
children: [/* @__PURE__ */ Q("div", {
|
|
15512
16105
|
style: { fontWeight: t && !r ? 600 : 400 },
|
|
15513
|
-
children:
|
|
16106
|
+
children: Ks(e.label, i)
|
|
15514
16107
|
}), e.description && /* @__PURE__ */ Q("div", {
|
|
15515
16108
|
style: {
|
|
15516
16109
|
fontSize: 12,
|
|
15517
16110
|
color: a.textMuted,
|
|
15518
16111
|
marginTop: 1
|
|
15519
16112
|
},
|
|
15520
|
-
children:
|
|
16113
|
+
children: Ks(e.description, i)
|
|
15521
16114
|
})]
|
|
15522
16115
|
}),
|
|
15523
16116
|
e.badge !== void 0 && /* @__PURE__ */ Q("span", {
|
|
@@ -15571,7 +16164,7 @@ function Fs({ item: e, isSelected: t, isFocused: n, multiSelect: r, query: i, th
|
|
|
15571
16164
|
]
|
|
15572
16165
|
});
|
|
15573
16166
|
}
|
|
15574
|
-
function
|
|
16167
|
+
function Xs({ trigger: e, items: t, groups: n, placement: r = "bottom-start", onSelect: i, selectedKeys: a, multiSelect: o = !1, searchable: s = !1, searchPlaceholder: c = "Search…", closeOnSelect: l, disabled: u = !1, maxHeight: d = 320, minWidth: f = 200, open: p, onOpenChange: m, portal: h = !0, offset: g = 6, renderItem: _ }) {
|
|
15575
16168
|
let [v, y] = Z(!1), [b, x] = Z([]), [S, C] = Z({
|
|
15576
16169
|
top: 0,
|
|
15577
16170
|
left: 0,
|
|
@@ -15588,13 +16181,13 @@ function Is({ trigger: e, items: t, groups: n, placement: r = "bottom-start", on
|
|
|
15588
16181
|
j
|
|
15589
16182
|
]), N = J(() => j(!1), [j]);
|
|
15590
16183
|
Y(() => {
|
|
15591
|
-
D && w.current && C(
|
|
16184
|
+
D && w.current && C(Gs(w.current, T.current, r, g));
|
|
15592
16185
|
}, [
|
|
15593
16186
|
D,
|
|
15594
16187
|
r,
|
|
15595
16188
|
g
|
|
15596
16189
|
]), Y(() => {
|
|
15597
|
-
D && w.current && T.current && C(
|
|
16190
|
+
D && w.current && T.current && C(Gs(w.current, T.current, r, g));
|
|
15598
16191
|
}, [
|
|
15599
16192
|
D,
|
|
15600
16193
|
r,
|
|
@@ -15609,7 +16202,7 @@ function Is({ trigger: e, items: t, groups: n, placement: r = "bottom-start", on
|
|
|
15609
16202
|
}, [D, j]);
|
|
15610
16203
|
let P = () => {
|
|
15611
16204
|
u || j(!D);
|
|
15612
|
-
}, F = D ? /* @__PURE__ */ Q(
|
|
16205
|
+
}, F = D ? /* @__PURE__ */ Q(Js, {
|
|
15613
16206
|
groups: A,
|
|
15614
16207
|
position: S,
|
|
15615
16208
|
maxHeight: d,
|
|
@@ -15648,16 +16241,16 @@ function Is({ trigger: e, items: t, groups: n, placement: r = "bottom-start", on
|
|
|
15648
16241
|
}
|
|
15649
16242
|
//#endregion
|
|
15650
16243
|
//#region src/components/TkxAIConfidenceBar.tsx
|
|
15651
|
-
var
|
|
16244
|
+
var Zs = {
|
|
15652
16245
|
sm: 4,
|
|
15653
16246
|
md: 8,
|
|
15654
16247
|
lg: 12
|
|
15655
16248
|
};
|
|
15656
|
-
function
|
|
16249
|
+
function Qs(e, t) {
|
|
15657
16250
|
return e >= 80 ? "#10b981" : e >= 55 ? t : e >= 30 ? "#f59e0b" : "#ef4444";
|
|
15658
16251
|
}
|
|
15659
|
-
function
|
|
15660
|
-
let s = v(), c = X(null), l = Math.max(0, Math.min(100, e)), u =
|
|
16252
|
+
function $s({ value: e, label: t, showLabel: n = !0, size: r = "md", animate: i = !0, className: a, style: o }) {
|
|
16253
|
+
let s = v(), c = X(null), l = Math.max(0, Math.min(100, e)), u = Qs(l, s.primary), d = Zs[r];
|
|
15661
16254
|
Y(() => {
|
|
15662
16255
|
if (!i || !c.current) return;
|
|
15663
16256
|
let e = c.current;
|
|
@@ -15753,10 +16346,10 @@ function zs({ value: e, label: t, showLabel: n = !0, size: r = "md", animate: i
|
|
|
15753
16346
|
}
|
|
15754
16347
|
//#endregion
|
|
15755
16348
|
//#region src/components/TkxAIChatBubble.tsx
|
|
15756
|
-
function
|
|
16349
|
+
function ec(e, t) {
|
|
15757
16350
|
return e >= 80 ? "#10b981" : e >= 55 ? t : e >= 30 ? "#f59e0b" : "#ef4444";
|
|
15758
16351
|
}
|
|
15759
|
-
function
|
|
16352
|
+
function tc({ src: e, name: t, size: n = 32 }) {
|
|
15760
16353
|
let r = v(), i = t ? t.split(" ").map((e) => e[0]).join("").slice(0, 2).toUpperCase() : "?";
|
|
15761
16354
|
return e ? /* @__PURE__ */ Q("img", {
|
|
15762
16355
|
src: e,
|
|
@@ -15786,7 +16379,7 @@ function Vs({ src: e, name: t, size: n = 32 }) {
|
|
|
15786
16379
|
children: i
|
|
15787
16380
|
});
|
|
15788
16381
|
}
|
|
15789
|
-
function
|
|
16382
|
+
function nc({ role: e, content: t, avatar: n, name: r, timestamp: i, streaming: a = !1, confidence: o, copyable: s = !1, className: c, style: l }) {
|
|
15790
16383
|
let u = v(), d = e === "user", f = e === "system", p = typeof t == "string" ? B(t) : "", [m, h] = Z(a ? "" : p), [g, _] = Z(!1), [y, b] = Z(a ? "" : p), x = X(0), S = X(null);
|
|
15791
16384
|
Y(() => {
|
|
15792
16385
|
if (!a || typeof t != "string") {
|
|
@@ -15849,7 +16442,7 @@ function Hs({ role: e, content: t, avatar: n, name: r, timestamp: i, streaming:
|
|
|
15849
16442
|
...l
|
|
15850
16443
|
},
|
|
15851
16444
|
children: [
|
|
15852
|
-
/* @__PURE__ */ Q(
|
|
16445
|
+
/* @__PURE__ */ Q(tc, {
|
|
15853
16446
|
src: n,
|
|
15854
16447
|
name: r ?? (d ? "You" : "AI")
|
|
15855
16448
|
}),
|
|
@@ -15962,7 +16555,7 @@ function Hs({ role: e, content: t, avatar: n, name: r, timestamp: i, streaming:
|
|
|
15962
16555
|
children: /* @__PURE__ */ Q("div", { style: {
|
|
15963
16556
|
height: "100%",
|
|
15964
16557
|
width: `${o}%`,
|
|
15965
|
-
background:
|
|
16558
|
+
background: ec(o, u.primary),
|
|
15966
16559
|
borderRadius: 3,
|
|
15967
16560
|
transition: "width 0.8s ease"
|
|
15968
16561
|
} })
|
|
@@ -15984,7 +16577,7 @@ function Hs({ role: e, content: t, avatar: n, name: r, timestamp: i, streaming:
|
|
|
15984
16577
|
}
|
|
15985
16578
|
//#endregion
|
|
15986
16579
|
//#region src/components/TkxAIThinking.tsx
|
|
15987
|
-
function
|
|
16580
|
+
function rc({ color: e }) {
|
|
15988
16581
|
return /* @__PURE__ */ Q("div", {
|
|
15989
16582
|
style: {
|
|
15990
16583
|
display: "flex",
|
|
@@ -16004,7 +16597,7 @@ function Us({ color: e }) {
|
|
|
16004
16597
|
} }, t))
|
|
16005
16598
|
});
|
|
16006
16599
|
}
|
|
16007
|
-
function
|
|
16600
|
+
function ic({ color: e }) {
|
|
16008
16601
|
return /* @__PURE__ */ $("div", {
|
|
16009
16602
|
style: {
|
|
16010
16603
|
position: "relative",
|
|
@@ -16037,7 +16630,7 @@ function Ws({ color: e }) {
|
|
|
16037
16630
|
]
|
|
16038
16631
|
});
|
|
16039
16632
|
}
|
|
16040
|
-
function
|
|
16633
|
+
function ac({ color: e }) {
|
|
16041
16634
|
return /* @__PURE__ */ Q("div", {
|
|
16042
16635
|
style: {
|
|
16043
16636
|
display: "flex",
|
|
@@ -16059,7 +16652,7 @@ function Gs({ color: e }) {
|
|
|
16059
16652
|
} }, t))
|
|
16060
16653
|
});
|
|
16061
16654
|
}
|
|
16062
|
-
function
|
|
16655
|
+
function oc({ color: e }) {
|
|
16063
16656
|
return /* @__PURE__ */ $("div", {
|
|
16064
16657
|
style: {
|
|
16065
16658
|
position: "relative",
|
|
@@ -16091,12 +16684,12 @@ function Ks({ color: e }) {
|
|
|
16091
16684
|
]
|
|
16092
16685
|
});
|
|
16093
16686
|
}
|
|
16094
|
-
var
|
|
16687
|
+
var sc = {
|
|
16095
16688
|
sm: 12,
|
|
16096
16689
|
md: 14,
|
|
16097
16690
|
lg: 16
|
|
16098
16691
|
};
|
|
16099
|
-
function
|
|
16692
|
+
function cc({ label: e = "Thinking…", steps: t, size: n = "md", variant: r = "dots", active: i = !0, className: a, style: o }) {
|
|
16100
16693
|
let s = v(), [c, l] = Z(0);
|
|
16101
16694
|
Y(() => {
|
|
16102
16695
|
if (!t?.length || !i) return;
|
|
@@ -16105,11 +16698,11 @@ function Js({ label: e = "Thinking…", steps: t, size: n = "md", variant: r = "
|
|
|
16105
16698
|
}, 1800);
|
|
16106
16699
|
return () => clearInterval(e);
|
|
16107
16700
|
}, [t, i]);
|
|
16108
|
-
let u = s.primary, d =
|
|
16109
|
-
dots: /* @__PURE__ */ Q(
|
|
16110
|
-
pulse: /* @__PURE__ */ Q(
|
|
16111
|
-
wave: /* @__PURE__ */ Q(
|
|
16112
|
-
orbit: /* @__PURE__ */ Q(
|
|
16701
|
+
let u = s.primary, d = sc[n], f = {
|
|
16702
|
+
dots: /* @__PURE__ */ Q(rc, { color: u }),
|
|
16703
|
+
pulse: /* @__PURE__ */ Q(ic, { color: u }),
|
|
16704
|
+
wave: /* @__PURE__ */ Q(ac, { color: u }),
|
|
16705
|
+
orbit: /* @__PURE__ */ Q(oc, { color: u })
|
|
16113
16706
|
}[r];
|
|
16114
16707
|
return /* @__PURE__ */ $("div", {
|
|
16115
16708
|
className: U(F("inline-flex flex-col gap-2"), a),
|
|
@@ -16190,4 +16783,4 @@ function Js({ label: e = "Thinking…", steps: t, size: n = "md", variant: r = "
|
|
|
16190
16783
|
});
|
|
16191
16784
|
}
|
|
16192
16785
|
//#endregion
|
|
16193
|
-
export {
|
|
16786
|
+
export { Us as FocusTrap, pe as I18nContext, Bs as I18nProvider, c as LRUCache, Hs as LiveRegion, u as Quantum, Mo as SIZE_BORDER_RADIUS, ko as SIZE_FONT, Oo as SIZE_HEIGHT, No as SIZE_ICON, Ao as SIZE_PADDING_X, jo as SIZE_PADDING_Y, oe as Shield, Vs as SkipNav, M as TKX, k as ThemeContext, w as ThemeProvider, nc as TkxAIChatBubble, $s as TkxAIConfidenceBar, cc as TkxAIThinking, Zt as TkxAccordion, Os as TkxAffix, Ze as TkxAlert, Ms as TkxAnchor, oa as TkxAppBar, Pi as TkxAutocomplete, gt as TkxAvatar, We as TkxBadge, da as TkxBottomNav, Ti as TkxBreadcrumb, Fe as TkxButton, Le as TkxCard, ze as TkxCardBody, Be as TkxCardFooter, Re as TkxCardHeader, Si as TkxCarousel, Is as TkxCascader, rr as TkxChat, nr as TkxChatBubble, Et as TkxCheckbox, Pr as TkxClock, So as TkxCol, ni as TkxColorPicker, bi as TkxCommand, wo as TkxConfigProvider, mo as TkxContent, ls as TkxCountdown, Da as TkxDataGrid, Cn as TkxDatePicker, yt as TkxDivider, on as TkxDrawer, Xs as TkxDropdown, ts as TkxEmpty, Vn as TkxFileUpload, ho as TkxFooter, K as TkxForm, de as TkxFormField, uo as TkxHeader, In as TkxImage, Ve as TkxInput, lo as TkxLayout, zs as TkxList, ao as TkxMarkdown, Na as TkxMasonry, fs as TkxMentions, kr as TkxMenu, nt as TkxModal, ci as TkxNumberInput, fi as TkxOTP, Mn as TkxPagination, Ko as TkxParagraph, ki as TkxPopover, qe as TkxProgress, _s as TkxQRCode, At as TkxRadio, jt as TkxRadioGroup, Xn as TkxRating, bs as TkxResult, Ga as TkxRichTextDisplay, vo as TkxRow, ds as TkxSegmented, wt as TkxSelect, po as TkxSider, pt as TkxSkeleton, kn as TkxSlider, _a as TkxSnackbar, ta as TkxSpeedDial, Qo as TkxSpin, cs as TkxStatistic, Gr as TkxStepper, st as TkxTab, ot as TkxTabList, lt as TkxTabPanel, ct as TkxTabPanels, vt as TkxTable, at as TkxTabs, lr as TkxTag, ur as TkxTagInput, Go as TkxText, tr as TkxThinkingIndicator, vr as TkxTimeline, Wo as TkxTitle, qt as TkxToastProvider, Ye as TkxToggle, Vi as TkxToolbar, dt as TkxTooltip, Cs as TkxTour, qi as TkxTransferList, zi as TkxTreeView, zr as TkxVideoPlayer, Ts as TkxWatermark, Ws as VisuallyHidden, C as WCAGEngine, I as audit, D as auroraLight, i as batchUpdate, b as breakpoints, y as contrastRatio, p as createFocusTrap, m as createTheme, f as css, r as cssVar, U as cx, V as extractAtomicCSS, n as extractCSS, a as fnv1aHash, l as fromObject, T as generatePalette, j as getAccessibleForeground, L as getAuditLog, zo as getLocaleDisplayName, x as injectStyles, ge as isRTL, Ro as isRtlLocale, e as keyframes, h as meetsAA, N as meetsAAA, o as memoize, d as prefersHighContrast, t as prefersReducedMotion, O as quantumDark, g as radii, ie as resetAtomicCSS, te as resolvePluginUtility, s as responsive, re as sanitizeProps, B as sanitizeString, S as shadows, A as spacing, F as tkx, H as tkxListPlugins, ae as tkxPlugin, ee as tkxRemovePlugin, ne as tx, _ as typography, ue as useAnnounce, ce as useClickOutside, Do as useComponentSize, To as useConfig, _e as useDirection, le as useEscapeKey, se as useFocusTrap, W as useHighContrast, ve as useI18n, ye as useLocale, Fo as useLogicalSpacing, Eo as usePrefixCls, G as useReducedMotion, Po as useRtlFlip, v as useTheme, hi as useTkxCommand, fe as useTkxForm, Ht as useToast, z as validateProps, R as verifyAuditIntegrity, E as zIndex };
|