duckfn-docs-kit 0.2.1 → 0.4.0
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/AGENTS.md +294 -224
- package/README.md +10 -6
- package/bin/sql-verify.mjs +12 -12
- package/dist/IconButton.d.ts +22 -0
- package/dist/codemirror.d.ts +29 -0
- package/dist/index.d.ts +28 -7
- package/dist/index.js +2 -2
- package/dist/mermaid/DfkMermaid.d.ts +7 -0
- package/dist/mermaid/config.d.ts +48 -0
- package/dist/mermaid/remark.d.ts +40 -0
- package/dist/mermaid/remark.js +32 -0
- package/dist/mermaid/render.d.ts +94 -0
- package/dist/mermaid/styles.d.ts +6 -0
- package/dist/mermaid/title.d.ts +23 -0
- package/dist/{register-DKLiYs-F.js → register-Dev_kc3Z.js} +921 -579
- package/dist/remark.d.ts +1 -1
- package/dist/sql/browserRunner.d.ts +41 -0
- package/dist/sql/browserRunner.js +186 -0
- package/dist/sql/client.js +1 -1
- package/dist/sql/harness.d.ts +59 -0
- package/dist/sql/harness.js +8328 -0
- package/dist/sql/remark.d.ts +6 -1
- package/dist/sql/renderers.d.ts +2 -0
- package/dist/sql/runtime.d.ts +20 -0
- package/dist/sql/verify.d.ts +4 -5
- package/dist/sql/verify.js +36 -49
- package/package.json +6 -2
- package/src/IconButton.ts +50 -0
- package/src/codemirror.ts +88 -0
- package/src/index.ts +31 -7
- package/src/mermaid/DfkMermaid.css +289 -0
- package/src/mermaid/DfkMermaid.ts +557 -0
- package/src/mermaid/config.ts +74 -0
- package/src/mermaid/remark.ts +98 -0
- package/src/mermaid/render.ts +178 -0
- package/src/mermaid/styles.ts +24 -0
- package/src/mermaid/title.ts +127 -0
- package/src/register.ts +3 -0
- package/src/remark.ts +1 -1
- package/src/sql/DfkSql.css +13 -10
- package/src/sql/DfkSql.ts +11 -46
- package/src/sql/browserRunner.ts +402 -0
- package/src/sql/harness.ts +134 -0
- package/src/sql/remark.ts +6 -1
- package/src/sql/renderers.ts +24 -3
- package/src/sql/runtime.ts +44 -0
- package/src/sql/sql.css +13 -11
- package/src/sql/verify.ts +23 -41
- package/dist/sql/editor.d.ts +0 -16
- package/dist/sql/nodeRunner.d.ts +0 -51
- package/dist/sql/nodeRunner.js +0 -115
- package/src/sql/editor.ts +0 -75
- package/src/sql/nodeRunner.ts +0 -298
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./runtimeConfig-Bokbb8VH.js";
|
|
2
|
+
import c from "filenamify";
|
|
2
3
|
//#region src/dom.ts
|
|
3
|
-
var
|
|
4
|
-
function
|
|
4
|
+
var l = typeof HTMLElement < "u" ? HTMLElement : class {};
|
|
5
|
+
function u(e, t, n) {
|
|
5
6
|
let r = document.createElement(e), i = typeof t == "function" ? t : n;
|
|
6
7
|
if (typeof t != "function" && t) {
|
|
7
8
|
let { class: e, text: n, attrs: i, ...a } = t;
|
|
@@ -13,22 +14,22 @@ function l(e, t, n) {
|
|
|
13
14
|
}
|
|
14
15
|
//#endregion
|
|
15
16
|
//#region src/home/home.css?inline
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
return
|
|
17
|
+
var d = ":host{display:block}*,:before,:after{box-sizing:border-box}.dfk-hero{isolation:isolate;text-align:center;padding:4.5rem 1.5rem 4rem;position:relative;overflow-x:clip}.dfk-hero:before,.dfk-hero:after{content:\"\";z-index:-1;pointer-events:none;border-radius:50%;position:absolute}.dfk-hero:before{background:radial-gradient(circle, var(--duckfn-glow), transparent 70%);width:52rem;height:52rem;top:-18rem;left:50%;transform:translate(-50%)}.dfk-hero:after{background:radial-gradient(circle, var(--duckfn-glow-warm), transparent 70%);width:34rem;height:34rem;bottom:-14rem;right:-10rem}.dfk-hero-inner{max-width:46rem;margin:0 auto}.dfk-logo-stage{line-height:0;display:inline-block}.dfk-logo{width:clamp(7rem,16vw,10rem);height:auto;filter:drop-shadow(0 14px 28px var(--duckfn-glow));display:block}.dfk-title{letter-spacing:-.02em;color:var(--duckfn-blue);margin:1.5rem 0 0;font-size:clamp(2.25rem,5vw,3.25rem);font-weight:700;line-height:1.1}@supports ((-webkit-background-clip:text) or (background-clip:text)){.dfk-title{background-image:linear-gradient(120deg, var(--duckfn-blue-deep), var(--duckfn-blue-bright));color:#0000;-webkit-background-clip:text;background-clip:text;padding-bottom:.06em}}.dfk-title:after{content:\"\";background-color:var(--duckfn-yellow);border-radius:999px;width:3rem;height:.25rem;margin:1rem auto 0;display:block}.dfk-tagline{max-width:34rem;color:var(--ifm-color-emphasis-700);margin:1.25rem auto 0;font-size:clamp(1.05rem,2.2vw,1.25rem);line-height:1.65}.dfk-actions{flex-wrap:wrap;justify-content:center;gap:.75rem 1rem;margin-top:2.25rem;display:flex}.dfk-button-primary,.dfk-button-secondary{transition:background-color .2s var(--ifm-transition-timing-default), border-color .2s var(--ifm-transition-timing-default), color .2s var(--ifm-transition-timing-default), box-shadow .2s var(--ifm-transition-timing-default);border:1px solid #0000;border-radius:999px;justify-content:center;align-items:center;gap:.5rem;padding:.7rem 1.6rem;font-size:1rem;font-weight:600;line-height:1.4;text-decoration:none;display:inline-flex}.dfk-button-primary{background-color:var(--duckfn-btn-bg);border-color:var(--duckfn-btn-bg);color:var(--duckfn-btn-fg)}.dfk-button-primary:hover,.dfk-button-primary:focus-visible{background-color:var(--duckfn-btn-bg-hover);border-color:var(--duckfn-btn-bg-hover);color:var(--duckfn-btn-fg);box-shadow:var(--duckfn-shadow);text-decoration:none}.dfk-button-secondary{border-color:var(--duckfn-outline-border);color:var(--duckfn-blue);background-color:#0000}.dfk-button-secondary:hover,.dfk-button-secondary:focus-visible{background-color:var(--duckfn-blue-soft);border-color:var(--duckfn-blue);color:var(--duckfn-blue);text-decoration:none}.dfk-button-icon{font-size:1.125rem}.dfk-badges{flex-wrap:wrap;justify-content:center;align-items:center;gap:.5rem;margin-top:2rem;display:flex}.dfk-badge{display:inline-flex}.dfk-badge-image{width:auto;height:20px;display:block}.dfk-section{padding:4.5rem 0}.dfk-section-inner{max-width:72rem;margin:0 auto;padding:0 1.5rem}.dfk-section-title{text-align:center;letter-spacing:-.01em;margin-bottom:0;font-size:clamp(1.5rem,3vw,2rem)}.dfk-feature-grid{grid-template-columns:repeat(auto-fit,minmax(min(17rem,100%),1fr));gap:1.25rem;margin-top:2.75rem;display:grid}.dfk-feature-card{border:1px solid var(--duckfn-card-border);background-color:var(--duckfn-card-bg);transition:border-color .2s var(--ifm-transition-timing-default), box-shadow .2s var(--ifm-transition-timing-default);border-radius:1rem;flex-direction:column;padding:1.5rem;display:flex}.dfk-feature-card:hover{border-color:var(--duckfn-blue);box-shadow:var(--duckfn-shadow)}.dfk-feature-icon-chip{background-color:var(--duckfn-blue-soft);width:2.5rem;height:2.5rem;color:var(--duckfn-blue);border-radius:.75rem;justify-content:center;align-items:center;margin-bottom:1rem;display:inline-flex}.dfk-feature-icon{font-size:1.375rem}.dfk-feature-title{margin-bottom:.5rem;font-size:1.0625rem;font-weight:600}.dfk-feature-details{color:var(--ifm-color-emphasis-700);margin-bottom:0;font-size:.9375rem;line-height:1.7}.dfk-next-grid{grid-template-columns:repeat(auto-fit,minmax(min(20rem,100%),1fr));gap:1rem;max-width:54rem;margin:2.75rem auto 0;display:grid}.dfk-next-card{border:1px solid var(--duckfn-card-border);background-color:var(--duckfn-card-bg);color:inherit;transition:border-color .2s var(--ifm-transition-timing-default), box-shadow .2s var(--ifm-transition-timing-default);border-radius:.875rem;align-items:center;gap:1rem;padding:1.25rem 1.375rem;text-decoration:none;display:flex}.dfk-next-card:hover,.dfk-next-card:focus-visible{border-color:var(--duckfn-blue);box-shadow:var(--duckfn-shadow);color:inherit;text-decoration:none}.dfk-next-card-body{flex-direction:column;flex:1;gap:.25rem;min-width:0;display:flex}.dfk-next-card-title{color:var(--duckfn-blue);font-size:1rem;font-weight:600}.dfk-next-card-details{color:var(--ifm-color-emphasis-700);font-size:.9rem;line-height:1.6}.dfk-next-card-arrow{color:var(--ifm-color-emphasis-500);transition:color .2s var(--ifm-transition-timing-default);flex-shrink:0;font-size:1.25rem}.dfk-next-card:hover .dfk-next-card-arrow,.dfk-next-card:focus-visible .dfk-next-card-arrow{color:var(--duckfn-blue)}@media (prefers-reduced-motion:no-preference){.dfk-logo-stage,.dfk-title,.dfk-tagline,.dfk-actions,.dfk-badges{animation:dfk-rise .6s var(--ifm-transition-timing-default) backwards}.dfk-title{animation-delay:60ms}.dfk-tagline{animation-delay:.12s}.dfk-actions{animation-delay:.18s}.dfk-badges{animation-delay:.24s}.dfk-logo{will-change:transform;animation:7s ease-in-out infinite dfk-float}.dfk-feature-card,.dfk-next-card{animation:dfk-rise .5s var(--ifm-transition-timing-default) backwards}.dfk-feature-card:nth-child(2),.dfk-next-card:nth-child(2){animation-delay:60ms}.dfk-feature-card:nth-child(3),.dfk-next-card:nth-child(3){animation-delay:.12s}.dfk-feature-card:nth-child(4),.dfk-next-card:nth-child(4){animation-delay:.18s}.dfk-feature-card:nth-child(5){animation-delay:.24s}.dfk-feature-card:nth-child(6){animation-delay:.3s}.dfk-feature-card,.dfk-next-card,.dfk-next-card-arrow{transition:transform .2s var(--ifm-transition-timing-default), border-color .2s var(--ifm-transition-timing-default), box-shadow .2s var(--ifm-transition-timing-default), color .2s var(--ifm-transition-timing-default)}.dfk-feature-card:hover{transform:translateY(-4px)}.dfk-next-card:hover{transform:translateY(-2px)}.dfk-next-card:hover .dfk-next-card-arrow{transform:translate(4px)}}@keyframes dfk-rise{0%{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}@keyframes dfk-float{0%,to{transform:translateY(-4px)}50%{transform:translateY(4px)}}@media screen and (max-width:996px){.dfk-hero{padding:3rem 1.5rem}.dfk-section{padding:3.5rem 0}}@media screen and (max-width:576px){.dfk-section-inner{padding:0 1rem}.dfk-actions{flex-direction:column;align-items:stretch}}", f = null;
|
|
18
|
+
function p() {
|
|
19
|
+
return f || (f = new CSSStyleSheet(), f.replaceSync(d)), f;
|
|
19
20
|
}
|
|
20
21
|
//#endregion
|
|
21
22
|
//#region src/home/DfkFeatures.ts
|
|
22
|
-
var
|
|
23
|
-
#e =
|
|
24
|
-
#t =
|
|
25
|
-
#n =
|
|
26
|
-
#r =
|
|
23
|
+
var m = class extends l {
|
|
24
|
+
#e = u("section", { class: "dfk-section" });
|
|
25
|
+
#t = u("div", { class: "dfk-section-inner" });
|
|
26
|
+
#n = u("h2", { class: "dfk-section-title" });
|
|
27
|
+
#r = u("div", { class: "dfk-feature-grid" });
|
|
27
28
|
#i = [];
|
|
28
29
|
constructor() {
|
|
29
30
|
super(), this.#t.append(this.#n, this.#r), this.#e.appendChild(this.#t);
|
|
30
31
|
let e = this.attachShadow({ mode: "open" });
|
|
31
|
-
e.adoptedStyleSheets = [
|
|
32
|
+
e.adoptedStyleSheets = [p()], e.appendChild(this.#e);
|
|
32
33
|
}
|
|
33
34
|
setSectionTitle(e) {
|
|
34
35
|
this.#n.textContent = e;
|
|
@@ -36,52 +37,52 @@ var p = class extends c {
|
|
|
36
37
|
setFeatures(e) {
|
|
37
38
|
for (; this.#i.length > e.length;) this.#i.pop()?.root.remove();
|
|
38
39
|
for (; this.#i.length < e.length;) {
|
|
39
|
-
let e = new
|
|
40
|
+
let e = new ee();
|
|
40
41
|
this.#i.push(e), this.#r.appendChild(e.root);
|
|
41
42
|
}
|
|
42
43
|
e.forEach((e, t) => this.#i[t].setFeature(e));
|
|
43
44
|
}
|
|
44
|
-
},
|
|
45
|
-
root =
|
|
46
|
-
#e =
|
|
45
|
+
}, ee = class {
|
|
46
|
+
root = u("article", { class: "dfk-feature-card" });
|
|
47
|
+
#e = u("iconify-icon", {
|
|
47
48
|
class: "dfk-feature-icon",
|
|
48
49
|
attrs: { "aria-hidden": "true" }
|
|
49
50
|
});
|
|
50
|
-
#t =
|
|
51
|
-
#n =
|
|
51
|
+
#t = u("h3", { class: "dfk-feature-title" });
|
|
52
|
+
#n = u("p", { class: "dfk-feature-details" });
|
|
52
53
|
constructor() {
|
|
53
|
-
this.root.append(
|
|
54
|
+
this.root.append(u("span", { class: "dfk-feature-icon-chip" }, (e) => e.appendChild(this.#e)), this.#t, this.#n);
|
|
54
55
|
}
|
|
55
56
|
setFeature(e) {
|
|
56
57
|
this.#e.setAttribute("icon", e.icon), this.#t.textContent = e.title, this.#n.textContent = e.details;
|
|
57
58
|
}
|
|
58
|
-
},
|
|
59
|
-
#e =
|
|
60
|
-
#t =
|
|
61
|
-
#n =
|
|
62
|
-
#r =
|
|
59
|
+
}, te = class extends l {
|
|
60
|
+
#e = u("section", { class: "dfk-hero" });
|
|
61
|
+
#t = u("div", { class: "dfk-hero-inner" });
|
|
62
|
+
#n = u("span", { class: "dfk-logo-stage" });
|
|
63
|
+
#r = u("img", {
|
|
63
64
|
class: "dfk-logo",
|
|
64
65
|
alt: "",
|
|
65
66
|
width: 480,
|
|
66
67
|
height: 480
|
|
67
68
|
});
|
|
68
|
-
#i =
|
|
69
|
-
#a =
|
|
70
|
-
#o =
|
|
71
|
-
#s =
|
|
72
|
-
#c =
|
|
73
|
-
#l =
|
|
74
|
-
#u =
|
|
69
|
+
#i = u("h1", { class: "dfk-title" });
|
|
70
|
+
#a = u("p", { class: "dfk-tagline" });
|
|
71
|
+
#o = u("div", { class: "dfk-actions" });
|
|
72
|
+
#s = u("a", { class: "dfk-button-primary" });
|
|
73
|
+
#c = u("span");
|
|
74
|
+
#l = u("a", { class: "dfk-button-secondary" });
|
|
75
|
+
#u = u("iconify-icon", {
|
|
75
76
|
class: "dfk-button-icon",
|
|
76
77
|
attrs: { "aria-hidden": "true" }
|
|
77
78
|
});
|
|
78
|
-
#d =
|
|
79
|
-
#f =
|
|
79
|
+
#d = u("span");
|
|
80
|
+
#f = u("div", { class: "dfk-badges" });
|
|
80
81
|
#p = [];
|
|
81
82
|
constructor() {
|
|
82
83
|
super(), this.#n.appendChild(this.#r), this.#s.appendChild(this.#c), this.#l.append(this.#u, this.#d), this.#o.append(this.#s, this.#l), this.#t.append(this.#n, this.#i, this.#a, this.#o, this.#f), this.#e.appendChild(this.#t);
|
|
83
84
|
let e = this.attachShadow({ mode: "open" });
|
|
84
|
-
e.adoptedStyleSheets = [
|
|
85
|
+
e.adoptedStyleSheets = [p()], e.appendChild(this.#e);
|
|
85
86
|
}
|
|
86
87
|
setLogo(e) {
|
|
87
88
|
this.#r.src = e;
|
|
@@ -101,12 +102,12 @@ var p = class extends c {
|
|
|
101
102
|
setBadges(e) {
|
|
102
103
|
for (; this.#p.length > e.length;) this.#p.pop()?.remove();
|
|
103
104
|
for (; this.#p.length < e.length;) {
|
|
104
|
-
let e =
|
|
105
|
+
let e = u("a", {
|
|
105
106
|
class: "dfk-badge",
|
|
106
107
|
target: "_blank",
|
|
107
108
|
rel: "noopener noreferrer"
|
|
108
109
|
});
|
|
109
|
-
e.appendChild(
|
|
110
|
+
e.appendChild(u("img", { class: "dfk-badge-image" })), this.#p.push(e), this.#f.appendChild(e);
|
|
110
111
|
}
|
|
111
112
|
e.forEach((e, t) => {
|
|
112
113
|
let n = this.#p[t];
|
|
@@ -118,16 +119,398 @@ var p = class extends c {
|
|
|
118
119
|
#m(e, t, n, r) {
|
|
119
120
|
e.href = n.href, t.textContent = n.label, r ? (e.target = "_blank", e.rel = "noopener noreferrer") : (e.removeAttribute("target"), e.removeAttribute("rel"));
|
|
120
121
|
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
};
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/codemirror.ts
|
|
125
|
+
async function ne(e, t, n, r = {}) {
|
|
126
|
+
let [{ basicSetup: i }, { EditorView: a, keymap: o }, { defaultKeymap: s, historyKeymap: c }, { Compartment: l }] = await Promise.all([
|
|
127
|
+
import("codemirror"),
|
|
128
|
+
import("@codemirror/view"),
|
|
129
|
+
import("@codemirror/commands"),
|
|
130
|
+
import("@codemirror/state")
|
|
131
|
+
]), u = r.language === "sql" ? [(await import("@codemirror/lang-sql")).sql()] : [], d = new l(), f = new a({
|
|
132
|
+
doc: t,
|
|
133
|
+
extensions: [
|
|
134
|
+
i,
|
|
135
|
+
...u,
|
|
136
|
+
o.of([...s, ...c]),
|
|
137
|
+
d.of([]),
|
|
138
|
+
a.updateListener.of((e) => {
|
|
139
|
+
e.docChanged && n(e.state.doc.toString());
|
|
140
|
+
})
|
|
141
|
+
],
|
|
142
|
+
parent: e
|
|
143
|
+
});
|
|
144
|
+
return {
|
|
145
|
+
getValue: () => f.state.doc.toString(),
|
|
146
|
+
setValue: (e) => f.dispatch({ changes: {
|
|
147
|
+
from: 0,
|
|
148
|
+
to: f.state.doc.length,
|
|
149
|
+
insert: e
|
|
150
|
+
} }),
|
|
151
|
+
setWrap: (e) => f.dispatch({ effects: d.reconfigure(e ? a.lineWrapping : []) }),
|
|
152
|
+
destroy: () => f.destroy()
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/IconButton.ts
|
|
157
|
+
var h = class {
|
|
158
|
+
root = u("button", {
|
|
159
|
+
class: "dfk-icon-button",
|
|
160
|
+
type: "button"
|
|
161
|
+
});
|
|
162
|
+
#e = u("iconify-icon", {
|
|
163
|
+
class: "dfk-icon",
|
|
164
|
+
attrs: { "aria-hidden": "true" }
|
|
165
|
+
});
|
|
166
|
+
constructor(e, t) {
|
|
167
|
+
this.root.appendChild(this.#e), this.root.addEventListener("click", t), this.setIcon(e);
|
|
168
|
+
}
|
|
169
|
+
setIcon(e) {
|
|
170
|
+
this.#e.setAttribute("icon", e);
|
|
171
|
+
}
|
|
172
|
+
setLabel(e) {
|
|
173
|
+
this.root.setAttribute("data-tip", e), this.root.setAttribute("aria-label", e);
|
|
174
|
+
}
|
|
175
|
+
setOn(e) {
|
|
176
|
+
this.root.classList.toggle("dfk-icon-on", e);
|
|
177
|
+
}
|
|
178
|
+
setDisabled(e) {
|
|
179
|
+
e ? this.root.setAttribute("disabled", "") : this.root.removeAttribute("disabled");
|
|
180
|
+
}
|
|
181
|
+
}, g = {
|
|
182
|
+
theme: {
|
|
183
|
+
light: "redux-color",
|
|
184
|
+
dark: "redux-dark-color"
|
|
185
|
+
},
|
|
186
|
+
options: { look: "neo" }
|
|
187
|
+
};
|
|
188
|
+
function _(e) {
|
|
189
|
+
return {
|
|
190
|
+
theme: {
|
|
191
|
+
light: e?.theme?.light ?? g.theme.light,
|
|
192
|
+
dark: e?.theme?.dark ?? g.theme.dark
|
|
193
|
+
},
|
|
194
|
+
options: {
|
|
195
|
+
...g.options,
|
|
196
|
+
...e?.options
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function v(e) {
|
|
201
|
+
if (!e) return _();
|
|
202
|
+
try {
|
|
203
|
+
return _(JSON.parse(e));
|
|
204
|
+
} catch {
|
|
205
|
+
return _();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/mermaid/render.ts
|
|
210
|
+
var re = Promise.resolve();
|
|
211
|
+
function ie(e) {
|
|
212
|
+
let t = re.then(e, e);
|
|
213
|
+
return re = t.catch(() => void 0), t;
|
|
214
|
+
}
|
|
215
|
+
var ae = null;
|
|
216
|
+
function oe() {
|
|
217
|
+
return ae ??= import("mermaid").then((e) => e.default), ae;
|
|
218
|
+
}
|
|
219
|
+
var se = 0;
|
|
220
|
+
function ce({ source: e, config: t, colorMode: n }) {
|
|
221
|
+
let r = `dfk-mermaid-svg-${se += 1}`;
|
|
222
|
+
return ie(async () => {
|
|
223
|
+
let i = await oe(), a = {
|
|
224
|
+
startOnLoad: !1,
|
|
225
|
+
...t.options,
|
|
226
|
+
theme: t.theme[n]
|
|
227
|
+
};
|
|
228
|
+
i.initialize(a);
|
|
229
|
+
try {
|
|
230
|
+
let t = await i.render(r, e);
|
|
231
|
+
return {
|
|
232
|
+
svg: t.svg,
|
|
233
|
+
bind: t.bindFunctions
|
|
234
|
+
};
|
|
235
|
+
} catch (e) {
|
|
236
|
+
throw document.querySelector(`#d${r}`)?.remove(), e;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function le() {
|
|
241
|
+
return document.documentElement.getAttribute("data-theme") === "dark" ? "dark" : "light";
|
|
242
|
+
}
|
|
243
|
+
function ue(e) {
|
|
244
|
+
let t = new MutationObserver(e);
|
|
245
|
+
return t.observe(document.documentElement, { attributeFilter: ["data-theme"] }), () => t.disconnect();
|
|
246
|
+
}
|
|
247
|
+
function de(e, t) {
|
|
248
|
+
let n = new DOMParser().parseFromString(t, "text/html").body.querySelector("svg");
|
|
249
|
+
return n ? e.importNode(n, !0) : null;
|
|
250
|
+
}
|
|
251
|
+
async function fe() {
|
|
252
|
+
return (await import("@panzoom/panzoom")).default;
|
|
253
|
+
}
|
|
254
|
+
function pe(e) {
|
|
255
|
+
return new XMLSerializer().serializeToString(e);
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/mermaid/DfkMermaid.css?inline
|
|
259
|
+
var me = "*,:before,:after{box-sizing:border-box}:host{margin:1rem 0;display:block}.dfk-mermaid-canvas{position:relative}.dfk-mermaid-viewport{border:1px solid var(--ifm-global-border-color,#e0e0e0);border-radius:var(--ifm-global-radius,.4rem);background:var(--ifm-background-surface-color,#fff);padding:.75rem;overflow:hidden}.dfk-mermaid-content>svg{max-width:100%;height:auto;margin:0 auto;display:block}.dfk-mermaid-canvas.dfk-mermaid-zoomed{cursor:grab}.dfk-mermaid-canvas.dfk-mermaid-zoomed.dfk-mermaid-grabbing{cursor:grabbing}.dfk-mermaid-message{color:var(--ifm-color-emphasis-700,#666);margin:.5rem 0 0;font-size:.8rem}.dfk-mermaid-message:empty{display:none}.dfk-mermaid-message-error{border-radius:var(--ifm-global-radius,.25rem);color:var(--ifm-color-danger-contrast,#fff);background:var(--ifm-color-danger,#d32f2f);font-family:var(--ifm-font-family-monospace,ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--ifm-code-font-size,95%);white-space:pre-wrap;word-break:break-word;padding:.5rem .75rem}.dfk-mermaid-canvas[hidden],.dfk-mermaid-message[hidden]{display:none}.dfk-mermaid-actions{z-index:2;border-radius:var(--ifm-global-radius,.3rem);background:var(--ifm-color-emphasis-100,#f5f5f5);opacity:0;pointer-events:none;align-items:center;gap:.15rem;padding:.1rem .2rem;transition:opacity .12s;display:flex;position:absolute;top:.25rem;right:.25rem}.dfk-mermaid-canvas:hover .dfk-mermaid-actions,.dfk-mermaid-canvas:focus-within .dfk-mermaid-actions{opacity:1;pointer-events:auto}.dfk-icon-button{border-radius:var(--ifm-global-radius,.25rem);width:1.6rem;height:1.6rem;color:var(--ifm-color-emphasis-700,#666);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;transition:background .12s,color .12s;display:inline-flex;position:relative}.dfk-icon-button:hover:not(:disabled),.dfk-icon-button:focus-visible{background:var(--ifm-color-emphasis-200,#e6e6e6);color:var(--ifm-color-primary,#14459b)}.dfk-icon-button:disabled{opacity:.45;cursor:progress}.dfk-icon-button[hidden]{display:none}.dfk-icon{font-size:1rem}[data-tip]:after{content:attr(data-tip);z-index:2;border-radius:var(--ifm-global-radius,.25rem);background:var(--ifm-color-emphasis-800,#333);color:var(--ifm-color-emphasis-0,#fff);white-space:nowrap;opacity:0;pointer-events:none;padding:.15rem .4rem;font-size:.7rem;line-height:1.4;transition:opacity .12s;position:absolute;top:calc(100% + .3rem);right:0}[data-tip]:hover:after,[data-tip]:focus-visible:after{opacity:1}.dfk-mermaid-expanded{z-index:2147483000;background:var(--ifm-background-surface-color,#fff);flex-direction:column;display:flex;position:fixed;inset:0}.dfk-mermaid-expanded .dfk-mermaid-viewport{border:none;border-radius:0;flex:1}.dfk-mermaid-dialog{border:1px solid var(--ifm-global-border-color,#e0e0e0);border-radius:var(--ifm-global-radius,.4rem);background:var(--ifm-background-surface-color,#fff);width:min(56rem,92vw);max-width:none;color:var(--ifm-font-color-base,#181818);padding:0}.dfk-mermaid-dialog::backdrop{background:#00000073}.dfk-mermaid-dialog-body{flex-direction:column;gap:.5rem;padding:.75rem;display:flex}.dfk-mermaid-dialog-title{margin:0;font-size:.95rem;font-weight:600}.dfk-mermaid-dialog-editor{border:1px solid var(--ifm-global-border-color,#e0e0e0);border-radius:var(--ifm-global-radius,.4rem);background:var(--ifm-background-surface-color,#fff);font-size:var(--ifm-code-font-size,95%);overflow:hidden}.dfk-mermaid-dialog-editor .cm-editor{outline:none}.dfk-mermaid-dialog-editor .cm-scroller{max-height:55vh;font-family:var(--ifm-font-family-monospace,ui-monospace, SFMono-Regular, Menlo, monospace);line-height:1.6}.dfk-mermaid-dialog-footer{justify-content:flex-end;gap:.5rem;display:flex}.dfk-mermaid-dialog-button{border:1px solid var(--ifm-global-border-color,#e0e0e0);border-radius:var(--ifm-global-radius,.25rem);background:var(--ifm-background-surface-color,#fff);color:var(--ifm-font-color-base,#181818);cursor:pointer;padding:.3rem .9rem;font-family:inherit;font-size:.85rem}.dfk-mermaid-dialog-button:hover{border-color:var(--ifm-color-primary,#14459b);color:var(--ifm-color-primary,#14459b)}.dfk-mermaid-dialog-apply{border-color:var(--ifm-color-primary,#14459b);background:var(--ifm-color-primary,#14459b);color:var(--ifm-button-color,#fff)}.dfk-mermaid-dialog-apply:hover{color:var(--ifm-button-color,#fff);filter:brightness(1.1)}", y = null;
|
|
260
|
+
function he() {
|
|
261
|
+
return y || (y = new CSSStyleSheet(), y.replaceSync(me)), y;
|
|
262
|
+
}
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/mermaid/title.ts
|
|
265
|
+
var ge = "mermaid-diagram.svg", _e = 80, ve = "-", ye = /^[\s\p{Cf}]+|[\s\p{Cf}]+$/gu;
|
|
266
|
+
function be(e) {
|
|
267
|
+
return e === void 0 ? "" : e.replace(ye, "");
|
|
268
|
+
}
|
|
269
|
+
function xe(e, t) {
|
|
270
|
+
let n = [
|
|
271
|
+
Se(e),
|
|
272
|
+
we(t),
|
|
273
|
+
t.ownerDocument.title
|
|
274
|
+
].map(be).find((e) => e !== "");
|
|
275
|
+
return n === void 0 ? ge : `${c(n, {
|
|
276
|
+
replacement: ve,
|
|
277
|
+
maxLength: _e
|
|
278
|
+
})}.svg`;
|
|
279
|
+
}
|
|
280
|
+
function Se(e) {
|
|
281
|
+
let t = /^---\r?\n([\s\S]*?)\r?\n---/.exec(e.trimStart())?.[1];
|
|
282
|
+
if (t === void 0) return;
|
|
283
|
+
let n = /^title\s*:\s*(.+)$/m.exec(t)?.[1];
|
|
284
|
+
return n === void 0 ? void 0 : Ce(n.trim());
|
|
285
|
+
}
|
|
286
|
+
function Ce(e) {
|
|
287
|
+
let t = e[0];
|
|
288
|
+
return (t === "\"" || t === "'") && e.endsWith(t) ? e.slice(1, -1) : e;
|
|
289
|
+
}
|
|
290
|
+
function we(e) {
|
|
291
|
+
let t = e.closest("article") ?? e.ownerDocument, n;
|
|
292
|
+
for (let r of t.querySelectorAll("h1, h2, h3, h4, h5, h6")) {
|
|
293
|
+
if (!(r.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING)) break;
|
|
294
|
+
let t = r.textContent?.trim();
|
|
295
|
+
t && (n = t);
|
|
296
|
+
}
|
|
297
|
+
return n;
|
|
298
|
+
}
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region src/mermaid/DfkMermaid.ts
|
|
301
|
+
var b = {
|
|
302
|
+
en: {
|
|
303
|
+
reset: "Reset zoom",
|
|
304
|
+
fullscreen: "Fullscreen",
|
|
305
|
+
exitFullscreen: "Exit fullscreen",
|
|
306
|
+
edit: "Edit diagram source",
|
|
307
|
+
download: "Download SVG",
|
|
308
|
+
apply: "Apply",
|
|
309
|
+
cancel: "Cancel",
|
|
310
|
+
editTitle: "Mermaid source",
|
|
311
|
+
rendering: "Rendering diagram…",
|
|
312
|
+
renderFailed: "Could not render the diagram"
|
|
313
|
+
},
|
|
314
|
+
"zh-hans": {
|
|
315
|
+
reset: "还原缩放",
|
|
316
|
+
fullscreen: "全屏",
|
|
317
|
+
exitFullscreen: "退出全屏",
|
|
318
|
+
edit: "编辑图表源码",
|
|
319
|
+
download: "下载 SVG",
|
|
320
|
+
apply: "应用",
|
|
321
|
+
cancel: "取消",
|
|
322
|
+
editTitle: "Mermaid 源码",
|
|
323
|
+
rendering: "正在渲染图表…",
|
|
324
|
+
renderFailed: "图表渲染失败"
|
|
325
|
+
}
|
|
326
|
+
}, x = 1, Te = 8, Ee = .25, De = class extends l {
|
|
327
|
+
#e = u("div", {
|
|
328
|
+
class: "dfk-mermaid-canvas",
|
|
329
|
+
hidden: !0
|
|
330
|
+
});
|
|
331
|
+
#t = u("div", { class: "dfk-mermaid-viewport" });
|
|
332
|
+
#n = u("div", { class: "dfk-mermaid-content" });
|
|
333
|
+
#r = u("div", { class: "dfk-mermaid-actions" });
|
|
334
|
+
#i = u("p", {
|
|
335
|
+
class: "dfk-mermaid-message",
|
|
336
|
+
attrs: { "aria-live": "polite" },
|
|
337
|
+
hidden: !0
|
|
338
|
+
});
|
|
339
|
+
#a;
|
|
340
|
+
#o;
|
|
341
|
+
#s;
|
|
342
|
+
#c;
|
|
343
|
+
#l = u("dialog", { class: "dfk-mermaid-dialog" });
|
|
344
|
+
#u = u("h2", { class: "dfk-mermaid-dialog-title" });
|
|
345
|
+
#d = u("div", { class: "dfk-mermaid-dialog-editor" });
|
|
346
|
+
#f = u("button", {
|
|
347
|
+
class: "dfk-mermaid-dialog-button dfk-mermaid-dialog-apply",
|
|
348
|
+
type: "button"
|
|
349
|
+
});
|
|
350
|
+
#p = u("button", {
|
|
351
|
+
class: "dfk-mermaid-dialog-button",
|
|
352
|
+
type: "button"
|
|
353
|
+
});
|
|
354
|
+
#m = b.en;
|
|
355
|
+
#h = v(null);
|
|
356
|
+
#g = "";
|
|
357
|
+
#_ = null;
|
|
358
|
+
#v = null;
|
|
359
|
+
#y = !1;
|
|
360
|
+
#b = !1;
|
|
361
|
+
#x = !1;
|
|
362
|
+
#S = 0;
|
|
363
|
+
#C = null;
|
|
364
|
+
#w = !1;
|
|
365
|
+
#T = null;
|
|
366
|
+
#E = !1;
|
|
367
|
+
#D = null;
|
|
368
|
+
#O = (e) => {
|
|
369
|
+
e.key === "Escape" && this.#b && !this.#l.open && this.#H(!1);
|
|
370
|
+
};
|
|
371
|
+
#k = (e) => {
|
|
372
|
+
this.#C?.zoomWithWheel(e);
|
|
373
|
+
};
|
|
374
|
+
#A = () => {
|
|
375
|
+
this.#e.classList.toggle("dfk-mermaid-zoomed", this.#B());
|
|
376
|
+
};
|
|
377
|
+
#j = () => {
|
|
378
|
+
this.#e.classList.remove("dfk-mermaid-grabbing");
|
|
379
|
+
};
|
|
380
|
+
#M = () => {
|
|
381
|
+
this.#e.classList.toggle("dfk-mermaid-grabbing", this.#B());
|
|
382
|
+
};
|
|
383
|
+
#N = () => {
|
|
384
|
+
le() !== this.#v && this.#I();
|
|
385
|
+
};
|
|
386
|
+
constructor() {
|
|
387
|
+
super(), this.#a = new h("lucide:rotate-ccw", () => this.#V()), this.#o = new h("lucide:pencil", () => this.#W()), this.#s = new h("lucide:download", () => this.#U()), this.#c = new h("lucide:maximize", () => this.#H(!this.#b)), this.#r.append(this.#a.root, this.#o.root, this.#s.root, this.#c.root), this.#t.appendChild(this.#n), this.#e.append(this.#t, this.#r), this.#n.addEventListener("panzoomchange", this.#A), this.#n.addEventListener("panzoomstart", this.#M), this.#n.addEventListener("panzoomend", this.#j), this.#f.addEventListener("click", () => this.#K()), this.#p.addEventListener("click", () => this.#l.close()), this.#l.append(u("div", { class: "dfk-mermaid-dialog-body" }, (e) => e.append(this.#u, this.#d, u("div", { class: "dfk-mermaid-dialog-footer" }, (e) => e.append(this.#p, this.#f)))));
|
|
388
|
+
let e = this.attachShadow({ mode: "open" });
|
|
389
|
+
e.adoptedStyleSheets = [he()], e.append(this.#e, this.#i, this.#l), this.#F();
|
|
390
|
+
}
|
|
391
|
+
connectedCallback() {
|
|
392
|
+
this.#y ||= (this.#P(), !0), this.#D ??= ue(this.#N), this.#z(), this.#g && !this.#n.hasChildNodes() && this.#I();
|
|
393
|
+
}
|
|
394
|
+
disconnectedCallback() {
|
|
395
|
+
this.#H(!1), this.#D?.(), this.#D = null, this.#t.removeEventListener("wheel", this.#k), this.#C?.destroy(), this.#C = null, this.#e.classList.remove("dfk-mermaid-zoomed", "dfk-mermaid-grabbing"), this.#S += 1, this.#T?.destroy(), this.#T = null, this.#l.open && this.#l.close();
|
|
396
|
+
}
|
|
397
|
+
#P() {
|
|
398
|
+
this.#m = b[(document.documentElement.getAttribute("lang") ?? "en").toLowerCase()] ?? b.en;
|
|
399
|
+
let e = this.getAttribute("source");
|
|
400
|
+
e !== null && (this.#g = e), this.#h = v(this.getAttribute("config")), this.#F();
|
|
401
|
+
}
|
|
402
|
+
#F() {
|
|
403
|
+
this.#a.setLabel(this.#m.reset), this.#o.setLabel(this.#m.edit), this.#s.setLabel(this.#m.download), this.#c.setLabel(this.#b ? this.#m.exitFullscreen : this.#m.fullscreen), this.#u.textContent = this.#m.editTitle, this.#p.textContent = this.#m.cancel, this.#f.textContent = this.#m.apply;
|
|
404
|
+
}
|
|
405
|
+
async #I() {
|
|
406
|
+
if (!this.#g) return;
|
|
407
|
+
let e = this.#S += 1, t = le();
|
|
408
|
+
this.#v = t, this.#_ === null && this.#L(this.#m.rendering, !1);
|
|
409
|
+
try {
|
|
410
|
+
let n = await ce({
|
|
411
|
+
source: this.#g,
|
|
412
|
+
config: this.#h,
|
|
413
|
+
colorMode: t
|
|
414
|
+
});
|
|
415
|
+
if (e !== this.#S || !this.isConnected) return;
|
|
416
|
+
let r = de(this.ownerDocument, n.svg);
|
|
417
|
+
if (!r) throw Error(this.#m.renderFailed);
|
|
418
|
+
this.#_ = r, this.#n.replaceChildren(r), n.bind?.(this.#n), this.#e.hidden = !1, this.#L("", !1), this.#R(!0), this.#V();
|
|
419
|
+
} catch (t) {
|
|
420
|
+
if (e !== this.#S || !this.isConnected) return;
|
|
421
|
+
this.#_ = null, this.#n.replaceChildren(), this.#e.hidden = !0, this.#R(!1), this.#L(`${this.#m.renderFailed}: ${Oe(t)}`, !0);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
#L(e, t) {
|
|
425
|
+
this.#i.textContent = e, this.#i.hidden = e === "", this.#i.classList.toggle("dfk-mermaid-message-error", t);
|
|
426
|
+
}
|
|
427
|
+
#R(e) {
|
|
428
|
+
this.#a.root.hidden = !e, this.#s.root.hidden = !e;
|
|
429
|
+
}
|
|
430
|
+
async #z() {
|
|
431
|
+
if (!(this.#C !== null || this.#w)) {
|
|
432
|
+
this.#w = !0;
|
|
433
|
+
try {
|
|
434
|
+
let e = await fe();
|
|
435
|
+
if (!this.isConnected) return;
|
|
436
|
+
this.#t.addEventListener("wheel", this.#k, { passive: !1 }), this.#C = e(this.#n, {
|
|
437
|
+
maxScale: Te,
|
|
438
|
+
minScale: x,
|
|
439
|
+
step: Ee,
|
|
440
|
+
panOnlyWhenZoomed: !0,
|
|
441
|
+
touchAction: "pan-y",
|
|
442
|
+
cursor: "",
|
|
443
|
+
handleStartEvent: (e) => {
|
|
444
|
+
this.#B() && (e.preventDefault(), e.stopPropagation());
|
|
445
|
+
}
|
|
446
|
+
}), this.#n.style.userSelect = "", this.#t.style.userSelect = "";
|
|
447
|
+
} catch {} finally {
|
|
448
|
+
this.#w = !1;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
#B() {
|
|
453
|
+
return (this.#C?.getScale() ?? x) > x;
|
|
454
|
+
}
|
|
455
|
+
#V() {
|
|
456
|
+
this.#C?.reset({ animate: !ke() });
|
|
457
|
+
}
|
|
458
|
+
#H(e) {
|
|
459
|
+
this.#b = e, this.#e.classList.toggle("dfk-mermaid-expanded", e), this.#c.setIcon(e ? "lucide:minimize" : "lucide:maximize"), this.#F(), e !== this.#x && (e ? document.addEventListener("keydown", this.#O) : document.removeEventListener("keydown", this.#O), this.#x = e);
|
|
460
|
+
}
|
|
461
|
+
#U() {
|
|
462
|
+
if (this.#_ === null) return;
|
|
463
|
+
let e = pe(this.#_), t = new Blob([e], { type: "image/svg+xml;charset=utf-8" }), n = URL.createObjectURL(t), r = u("a", {
|
|
464
|
+
href: n,
|
|
465
|
+
download: xe(this.#g, this)
|
|
466
|
+
});
|
|
467
|
+
this.shadowRoot?.appendChild(r), r.click(), r.remove(), window.setTimeout(() => URL.revokeObjectURL(n), 0);
|
|
468
|
+
}
|
|
469
|
+
#W() {
|
|
470
|
+
if (this.#l.showModal(), this.#T) {
|
|
471
|
+
this.#T.setValue(this.#g);
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
this.#G();
|
|
475
|
+
}
|
|
476
|
+
async #G() {
|
|
477
|
+
if (!this.#E) {
|
|
478
|
+
this.#E = !0;
|
|
479
|
+
try {
|
|
480
|
+
let e = await ne(this.#d, this.#g, () => void 0);
|
|
481
|
+
if (!this.isConnected || !this.#l.open) {
|
|
482
|
+
e.destroy();
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
e.setWrap(!0), this.#T = e;
|
|
486
|
+
} catch {} finally {
|
|
487
|
+
this.#E = !1;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
#K() {
|
|
492
|
+
let e = this.#T?.getValue();
|
|
493
|
+
this.#l.close(), e !== void 0 && e !== this.#g && (this.#g = e, this.#I());
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
function Oe(e) {
|
|
497
|
+
return e instanceof Error ? e.message : String(e);
|
|
498
|
+
}
|
|
499
|
+
function ke() {
|
|
500
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/home/DfkNextSteps.ts
|
|
504
|
+
var Ae = class extends l {
|
|
505
|
+
#e = u("section", { class: "dfk-section" });
|
|
506
|
+
#t = u("div", { class: "dfk-section-inner" });
|
|
507
|
+
#n = u("h2", { class: "dfk-section-title" });
|
|
508
|
+
#r = u("div", { class: "dfk-next-grid" });
|
|
126
509
|
#i = [];
|
|
127
510
|
constructor() {
|
|
128
511
|
super(), this.#t.append(this.#n, this.#r), this.#e.appendChild(this.#t);
|
|
129
512
|
let e = this.attachShadow({ mode: "open" });
|
|
130
|
-
e.adoptedStyleSheets = [
|
|
513
|
+
e.adoptedStyleSheets = [p()], e.appendChild(this.#e);
|
|
131
514
|
}
|
|
132
515
|
setSectionTitle(e) {
|
|
133
516
|
this.#n.textContent = e;
|
|
@@ -135,16 +518,16 @@ var p = class extends c {
|
|
|
135
518
|
setSteps(e) {
|
|
136
519
|
for (; this.#i.length > e.length;) this.#i.pop()?.root.remove();
|
|
137
520
|
for (; this.#i.length < e.length;) {
|
|
138
|
-
let e = new
|
|
521
|
+
let e = new je();
|
|
139
522
|
this.#i.push(e), this.#r.appendChild(e.root);
|
|
140
523
|
}
|
|
141
524
|
e.forEach((e, t) => this.#i[t].setStep(e));
|
|
142
525
|
}
|
|
143
|
-
},
|
|
144
|
-
root =
|
|
145
|
-
#e =
|
|
146
|
-
#t =
|
|
147
|
-
#n =
|
|
526
|
+
}, je = class {
|
|
527
|
+
root = u("a", { class: "dfk-next-card" });
|
|
528
|
+
#e = u("span", { class: "dfk-next-card-title" });
|
|
529
|
+
#t = u("span", { class: "dfk-next-card-details" });
|
|
530
|
+
#n = u("iconify-icon", {
|
|
148
531
|
class: "dfk-next-card-arrow",
|
|
149
532
|
attrs: {
|
|
150
533
|
icon: "lucide:arrow-right",
|
|
@@ -152,14 +535,14 @@ var p = class extends c {
|
|
|
152
535
|
}
|
|
153
536
|
});
|
|
154
537
|
constructor() {
|
|
155
|
-
this.root.append(
|
|
538
|
+
this.root.append(u("span", { class: "dfk-next-card-body" }, (e) => e.append(this.#e, this.#t)), this.#n);
|
|
156
539
|
}
|
|
157
540
|
setStep(e) {
|
|
158
541
|
this.root.href = e.href, this.#e.textContent = e.title, this.#t.textContent = e.details;
|
|
159
542
|
}
|
|
160
|
-
},
|
|
543
|
+
}, Me = null, S = class e {
|
|
161
544
|
static getInstance() {
|
|
162
|
-
return
|
|
545
|
+
return Me ??= new e(), Me;
|
|
163
546
|
}
|
|
164
547
|
#e = "idle";
|
|
165
548
|
#t = "";
|
|
@@ -168,7 +551,8 @@ var p = class extends c {
|
|
|
168
551
|
#i = null;
|
|
169
552
|
#a = !1;
|
|
170
553
|
#o = null;
|
|
171
|
-
#s =
|
|
554
|
+
#s = null;
|
|
555
|
+
#c = /* @__PURE__ */ new Map();
|
|
172
556
|
get state() {
|
|
173
557
|
return this.#e;
|
|
174
558
|
}
|
|
@@ -176,24 +560,32 @@ var p = class extends c {
|
|
|
176
560
|
return this.#t;
|
|
177
561
|
}
|
|
178
562
|
init(e = {}) {
|
|
179
|
-
if (e.allowUnsignedExtensions && (this.#a = !0), this.#e === "ready") return Promise.resolve();
|
|
563
|
+
if (e.allowUnsignedExtensions && (this.#a = !0), e.bundle && (this.#o = e.bundle), this.#e === "ready") return Promise.resolve();
|
|
180
564
|
if (this.#n) return this.#n;
|
|
181
|
-
let t = this.#
|
|
182
|
-
return t.allowUnsignedExtensions && (this.#a = !0), this.#e = "loading", this.#n = this.#
|
|
183
|
-
throw this.#e = "error", this.#t =
|
|
565
|
+
let t = this.#l();
|
|
566
|
+
return t.allowUnsignedExtensions && (this.#a = !0), this.#e = "loading", this.#n = this.#u(t.preload).catch((e) => {
|
|
567
|
+
throw this.#e = "error", this.#t = C(e), this.#n = null, e;
|
|
184
568
|
}), this.#n;
|
|
185
569
|
}
|
|
186
|
-
#
|
|
187
|
-
return this.#
|
|
570
|
+
#l() {
|
|
571
|
+
return this.#s ??= Fe(), this.#s;
|
|
188
572
|
}
|
|
189
|
-
async #
|
|
190
|
-
let t = await import("@duckdb/duckdb-wasm")
|
|
573
|
+
async #u(e) {
|
|
574
|
+
let t = await import("@duckdb/duckdb-wasm");
|
|
575
|
+
if (this.#o) {
|
|
576
|
+
let n = new Worker(this.#o.mainWorker);
|
|
577
|
+
this.#r = new t.AsyncDuckDB(new t.ConsoleLogger(), n), await this.#r.instantiate(this.#o.mainModule, this.#o.pthreadWorker ?? null), await this.#r.open({ allowUnsignedExtensions: this.#a }), this.#i = await this.#r.connect();
|
|
578
|
+
for (let t of e) await this.#d(t);
|
|
579
|
+
this.#e = "ready", this.#t = "";
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
let n = await t.selectBundle(t.getJsDelivrBundles());
|
|
191
583
|
if (!n.mainWorker) throw Error("The selected DuckDB-Wasm bundle has no worker script");
|
|
192
584
|
let r = URL.createObjectURL(new Blob([`importScripts("${n.mainWorker}");`], { type: "text/javascript" })), i = new Worker(r);
|
|
193
585
|
URL.revokeObjectURL(r);
|
|
194
586
|
let a = new t.ConsoleLogger();
|
|
195
587
|
this.#r = new t.AsyncDuckDB(a, i), await this.#r.instantiate(n.mainModule, n.pthreadWorker), await this.#r.open({ allowUnsignedExtensions: this.#a }), this.#i = await this.#r.connect();
|
|
196
|
-
for (let t of e) await this.#
|
|
588
|
+
for (let t of e) await this.#d(t);
|
|
197
589
|
this.#e = "ready", this.#t = "";
|
|
198
590
|
}
|
|
199
591
|
async execute(e) {
|
|
@@ -214,75 +606,75 @@ var p = class extends c {
|
|
|
214
606
|
return {
|
|
215
607
|
columns: [],
|
|
216
608
|
rows: [],
|
|
217
|
-
error:
|
|
609
|
+
error: C(e)
|
|
218
610
|
};
|
|
219
611
|
}
|
|
220
612
|
}
|
|
221
613
|
async loadExtension(e, t = {}) {
|
|
222
|
-
return await this.init(), this.#
|
|
614
|
+
return await this.init(), this.#d({
|
|
223
615
|
name: e,
|
|
224
616
|
repository: t.repository
|
|
225
617
|
});
|
|
226
618
|
}
|
|
227
|
-
#
|
|
619
|
+
#d(e) {
|
|
228
620
|
let t = o(e);
|
|
229
|
-
if (typeof t == "string") return this.#
|
|
621
|
+
if (typeof t == "string") return this.#f(`\u0000${t}`, () => this.#p(t));
|
|
230
622
|
if ("name" in t) {
|
|
231
623
|
let { name: e, repository: n } = t;
|
|
232
|
-
return this.#
|
|
624
|
+
return this.#f(`${n ?? ""}\u0000${e}`, () => this.#p(e, n));
|
|
233
625
|
}
|
|
234
626
|
let { url: n } = t;
|
|
235
|
-
return this.#
|
|
627
|
+
return this.#f(`url\u0000${n}`, () => this.#m(n));
|
|
236
628
|
}
|
|
237
|
-
#
|
|
238
|
-
let n = this.#
|
|
629
|
+
#f(e, t) {
|
|
630
|
+
let n = this.#c.get(e);
|
|
239
631
|
if (n) return n;
|
|
240
632
|
let r = t().catch((t) => {
|
|
241
|
-
throw this.#
|
|
633
|
+
throw this.#c.delete(e), t;
|
|
242
634
|
});
|
|
243
|
-
return this.#
|
|
635
|
+
return this.#c.set(e, r), r;
|
|
244
636
|
}
|
|
245
|
-
async #
|
|
637
|
+
async #p(e, t) {
|
|
246
638
|
if (!r.test(e)) throw Error(`Not a valid extension name: ${e}`);
|
|
247
|
-
let n = this.#
|
|
248
|
-
t !== void 0 && await n.query(`INSTALL ${e} FROM ${
|
|
639
|
+
let n = this.#h();
|
|
640
|
+
t !== void 0 && await n.query(`INSTALL ${e} FROM ${Ne(t)}`), await n.query(`LOAD ${e}`);
|
|
249
641
|
}
|
|
250
|
-
async #
|
|
251
|
-
await this.#
|
|
642
|
+
async #m(e) {
|
|
643
|
+
await this.#h().query(`LOAD '${Pe(e)}'`);
|
|
252
644
|
}
|
|
253
|
-
#
|
|
645
|
+
#h() {
|
|
254
646
|
let e = this.#i;
|
|
255
647
|
if (!e) throw Error(this.#t || "DuckDB unavailable");
|
|
256
648
|
return e;
|
|
257
649
|
}
|
|
258
650
|
};
|
|
259
|
-
function
|
|
651
|
+
function Ne(e) {
|
|
260
652
|
let t = e.toLowerCase();
|
|
261
653
|
if (a.has(t)) return t;
|
|
262
654
|
if (!n.test(e)) throw Error(`Not a valid extension repository: ${e}`);
|
|
263
655
|
return `'${e}'`;
|
|
264
656
|
}
|
|
265
|
-
function
|
|
657
|
+
function Pe(t) {
|
|
266
658
|
let n = i(t) ? t : new URL(t, window.location.origin).href;
|
|
267
659
|
if (!r.test(e(n))) throw Error(`An extension file must be named <extension>.duckdb_extension.wasm — the base name before the first dot is the entry symbol: ${n}`);
|
|
268
660
|
return n;
|
|
269
661
|
}
|
|
270
|
-
function
|
|
662
|
+
function Fe() {
|
|
271
663
|
if (typeof document > "u") return { preload: [] };
|
|
272
664
|
let e = document.getElementById(s)?.textContent?.trim();
|
|
273
665
|
if (!e) return { preload: [] };
|
|
274
666
|
try {
|
|
275
667
|
return t(JSON.parse(e));
|
|
276
668
|
} catch (e) {
|
|
277
|
-
throw Error(`Invalid <script id="${s}"> config: ${
|
|
669
|
+
throw Error(`Invalid <script id="${s}"> config: ${C(e)}`);
|
|
278
670
|
}
|
|
279
671
|
}
|
|
280
|
-
function
|
|
672
|
+
function C(e) {
|
|
281
673
|
return e instanceof Error ? e.message : String(e);
|
|
282
674
|
}
|
|
283
675
|
//#endregion
|
|
284
676
|
//#region src/sql/PreviewTabs.ts
|
|
285
|
-
var
|
|
677
|
+
var Ie = 0, w = class {
|
|
286
678
|
#e = [];
|
|
287
679
|
#t = [];
|
|
288
680
|
#n = [];
|
|
@@ -292,11 +684,11 @@ var ie = 0, b = class {
|
|
|
292
684
|
#o = !1;
|
|
293
685
|
constructor(e, t, n, r, i) {
|
|
294
686
|
this.#i = r;
|
|
295
|
-
let a = `dfk-sql-tabs-${
|
|
687
|
+
let a = `dfk-sql-tabs-${Ie += 1}`, o = u("div", { class: "dfk-sql-tabs" }), s = u("div", {
|
|
296
688
|
class: "dfk-sql-tab-list",
|
|
297
689
|
attrs: { role: "tablist" }
|
|
298
|
-
}), c =
|
|
299
|
-
let n = this.#e.length, r =
|
|
690
|
+
}), c = u("div", { class: "dfk-sql-panels" }), l = (e, t) => {
|
|
691
|
+
let n = this.#e.length, r = u("div", {
|
|
300
692
|
class: "dfk-sql-panel",
|
|
301
693
|
hidden: !0,
|
|
302
694
|
attrs: {
|
|
@@ -304,7 +696,7 @@ var ie = 0, b = class {
|
|
|
304
696
|
id: `${a}-panel-${n}`,
|
|
305
697
|
"aria-labelledby": `${a}-tab-${n}`
|
|
306
698
|
}
|
|
307
|
-
}), i =
|
|
699
|
+
}), i = u("button", {
|
|
308
700
|
class: "dfk-sql-tab",
|
|
309
701
|
type: "button",
|
|
310
702
|
text: e,
|
|
@@ -318,8 +710,8 @@ var ie = 0, b = class {
|
|
|
318
710
|
});
|
|
319
711
|
i.addEventListener("click", () => this.#s(n)), i.addEventListener("keydown", (e) => this.#l(e, n)), this.#e.push(i), this.#t.push(r), this.#n.push(t), this.#r.push(!1), s.appendChild(i), c.appendChild(r);
|
|
320
712
|
};
|
|
321
|
-
for (let e of t)
|
|
322
|
-
|
|
713
|
+
for (let e of t) l(e.label, e);
|
|
714
|
+
l(n, null), o.appendChild(s), i && o.appendChild(i), e.replaceChildren(o, c), this.#s(0);
|
|
323
715
|
}
|
|
324
716
|
dispose() {
|
|
325
717
|
this.#o = !0, this.#a?.dispose(), this.#a = null;
|
|
@@ -350,7 +742,7 @@ var ie = 0, b = class {
|
|
|
350
742
|
let r = (t + n + this.#e.length) % this.#e.length;
|
|
351
743
|
this.#s(r), this.#e[r].focus();
|
|
352
744
|
}
|
|
353
|
-
},
|
|
745
|
+
}, Le = "allow-scripts", T = 30, Re = 32, E = {
|
|
354
746
|
copyCell: "dfk-copy-cell",
|
|
355
747
|
copyAll: "dfk-copy-all",
|
|
356
748
|
wrap: "dfk-wrap",
|
|
@@ -361,40 +753,40 @@ var ie = 0, b = class {
|
|
|
361
753
|
widthAdaptive: "dfk-width-adaptive",
|
|
362
754
|
widthStandard: "dfk-width-standard",
|
|
363
755
|
widthFill: "dfk-width-fill"
|
|
364
|
-
},
|
|
756
|
+
}, ze = [
|
|
365
757
|
{
|
|
366
|
-
menuKey:
|
|
758
|
+
menuKey: E.widthAdaptive,
|
|
367
759
|
label: "widthAdaptive",
|
|
368
760
|
widthMode: "adaptive",
|
|
369
761
|
autoFillWidth: !1,
|
|
370
762
|
fallback: "Fill the width"
|
|
371
763
|
},
|
|
372
764
|
{
|
|
373
|
-
menuKey:
|
|
765
|
+
menuKey: E.widthStandard,
|
|
374
766
|
label: "widthStandard",
|
|
375
767
|
widthMode: "standard",
|
|
376
768
|
autoFillWidth: !1,
|
|
377
769
|
fallback: "Content widths, scroll sideways"
|
|
378
770
|
},
|
|
379
771
|
{
|
|
380
|
-
menuKey:
|
|
772
|
+
menuKey: E.widthFill,
|
|
381
773
|
label: "widthFill",
|
|
382
774
|
widthMode: "standard",
|
|
383
775
|
autoFillWidth: !0,
|
|
384
776
|
fallback: "Content first, fill when it fits"
|
|
385
777
|
}
|
|
386
778
|
];
|
|
387
|
-
function
|
|
388
|
-
return
|
|
779
|
+
function Be(e) {
|
|
780
|
+
return ze.find((t) => t.menuKey === e) ?? ze[0];
|
|
389
781
|
}
|
|
390
|
-
var
|
|
391
|
-
function
|
|
392
|
-
return
|
|
782
|
+
var Ve;
|
|
783
|
+
function He(e, t) {
|
|
784
|
+
return Ve ??= new Intl.Collator(void 0, {
|
|
393
785
|
numeric: !0,
|
|
394
786
|
sensitivity: "base"
|
|
395
|
-
}),
|
|
787
|
+
}), Ve.compare(e, t);
|
|
396
788
|
}
|
|
397
|
-
function
|
|
789
|
+
function Ue(e) {
|
|
398
790
|
if (typeof e == "number") return Number.isNaN(e) ? null : e;
|
|
399
791
|
if (typeof e == "bigint") return Number(e);
|
|
400
792
|
if (e instanceof Date) {
|
|
@@ -403,26 +795,26 @@ function de(e) {
|
|
|
403
795
|
}
|
|
404
796
|
return typeof e == "boolean" ? +!!e : null;
|
|
405
797
|
}
|
|
406
|
-
function
|
|
798
|
+
function We(e, t, n) {
|
|
407
799
|
let r = e == null, i = t == null;
|
|
408
800
|
if (r || i) return r && i ? 0 : r ? 1 : -1;
|
|
409
|
-
let a =
|
|
410
|
-
s = a !== null && o !== null ? a === o ? 0 : a < o ? -1 : 1 :
|
|
801
|
+
let a = Ue(e), o = Ue(t), s;
|
|
802
|
+
s = a !== null && o !== null ? a === o ? 0 : a < o ? -1 : 1 : He(A(e), A(t));
|
|
411
803
|
let c = s === 0 ? 0 : s < 0 ? -1 : 1;
|
|
412
804
|
return c === 0 ? 0 : String(n).toLowerCase() === "desc" ? -c : c;
|
|
413
805
|
}
|
|
414
|
-
var
|
|
415
|
-
function
|
|
806
|
+
var Ge = "http://www.w3.org/2000/svg";
|
|
807
|
+
function Ke(e) {
|
|
416
808
|
return e instanceof Error ? e.message : String(e);
|
|
417
809
|
}
|
|
418
|
-
function
|
|
810
|
+
function qe(e, t) {
|
|
419
811
|
let n = e.createElement("pre");
|
|
420
812
|
return n.className = "dfk-sql-error", n.textContent = t, n;
|
|
421
813
|
}
|
|
422
|
-
function
|
|
814
|
+
function D(e, t) {
|
|
423
815
|
return `${e.error ?? "Error"}: ${t}`;
|
|
424
816
|
}
|
|
425
|
-
var
|
|
817
|
+
var Je = class {
|
|
426
818
|
#e;
|
|
427
819
|
#t;
|
|
428
820
|
#n;
|
|
@@ -432,7 +824,7 @@ var _e = class {
|
|
|
432
824
|
#o = 0;
|
|
433
825
|
#s = 0;
|
|
434
826
|
#c;
|
|
435
|
-
#l =
|
|
827
|
+
#l = E.widthAdaptive;
|
|
436
828
|
#u;
|
|
437
829
|
#d;
|
|
438
830
|
constructor(e, t, n, r) {
|
|
@@ -448,7 +840,7 @@ var _e = class {
|
|
|
448
840
|
return e.map((e) => ({
|
|
449
841
|
field: e,
|
|
450
842
|
title: e,
|
|
451
|
-
sort:
|
|
843
|
+
sort: We,
|
|
452
844
|
style: { autoWrapText: this.#a.has(e) }
|
|
453
845
|
}));
|
|
454
846
|
}
|
|
@@ -480,7 +872,7 @@ var _e = class {
|
|
|
480
872
|
return typeof t == "number" ? t : 12;
|
|
481
873
|
}
|
|
482
874
|
#y() {
|
|
483
|
-
let e =
|
|
875
|
+
let e = Be(this.#l);
|
|
484
876
|
return {
|
|
485
877
|
container: this.#t,
|
|
486
878
|
records: this.#n.rows,
|
|
@@ -488,8 +880,8 @@ var _e = class {
|
|
|
488
880
|
theme: this.#m(),
|
|
489
881
|
widthMode: e.widthMode,
|
|
490
882
|
autoFillWidth: e.autoFillWidth,
|
|
491
|
-
defaultRowHeight: this.#a.size > 0 ? "auto" :
|
|
492
|
-
defaultHeaderRowHeight:
|
|
883
|
+
defaultRowHeight: this.#a.size > 0 ? "auto" : T,
|
|
884
|
+
defaultHeaderRowHeight: Re,
|
|
493
885
|
columnResizeMode: "all",
|
|
494
886
|
rowResizeMode: "all",
|
|
495
887
|
dragHeaderMode: "column",
|
|
@@ -516,10 +908,10 @@ var _e = class {
|
|
|
516
908
|
#b(e) {
|
|
517
909
|
let t = this.#r, n = this.#a.has(e), r = this.#o > 0 ? {
|
|
518
910
|
text: t.unfreezeColumns ?? "Unfreeze columns",
|
|
519
|
-
menuKey:
|
|
911
|
+
menuKey: E.unfreeze
|
|
520
912
|
} : {
|
|
521
913
|
text: t.freezeColumn ?? "Freeze up to here",
|
|
522
|
-
menuKey:
|
|
914
|
+
menuKey: E.freeze
|
|
523
915
|
};
|
|
524
916
|
return [
|
|
525
917
|
{
|
|
@@ -529,15 +921,15 @@ var _e = class {
|
|
|
529
921
|
{ type: "split" },
|
|
530
922
|
{
|
|
531
923
|
text: t.copy ?? "Copy cell",
|
|
532
|
-
menuKey:
|
|
924
|
+
menuKey: E.copyCell
|
|
533
925
|
},
|
|
534
926
|
{
|
|
535
927
|
text: t.copyAll ?? "Copy table",
|
|
536
|
-
menuKey:
|
|
928
|
+
menuKey: E.copyAll
|
|
537
929
|
},
|
|
538
930
|
{
|
|
539
931
|
text: n ? t.unwrapColumn ?? "Stop wrapping column" : t.wrapColumn ?? "Wrap column",
|
|
540
|
-
menuKey: n ?
|
|
932
|
+
menuKey: n ? E.unwrap : E.wrap
|
|
541
933
|
},
|
|
542
934
|
r,
|
|
543
935
|
{ type: "split" },
|
|
@@ -547,12 +939,12 @@ var _e = class {
|
|
|
547
939
|
},
|
|
548
940
|
{
|
|
549
941
|
text: t.resetView ?? "Reset view",
|
|
550
|
-
menuKey:
|
|
942
|
+
menuKey: E.reset
|
|
551
943
|
}
|
|
552
944
|
];
|
|
553
945
|
}
|
|
554
946
|
#x() {
|
|
555
|
-
return
|
|
947
|
+
return ze.map((e) => ({
|
|
556
948
|
text: `${e.menuKey === this.#l ? "✓ " : ""}${this.#r[e.label] ?? e.fallback}`,
|
|
557
949
|
menuKey: e.menuKey
|
|
558
950
|
}));
|
|
@@ -562,37 +954,37 @@ var _e = class {
|
|
|
562
954
|
if (!r) return;
|
|
563
955
|
let i = t >= 0 && n >= 0 ? this.#e.getCellInfo(t, n) : void 0, a = i?.field === void 0 ? "" : String(i.field);
|
|
564
956
|
switch (r) {
|
|
565
|
-
case
|
|
957
|
+
case E.copyCell:
|
|
566
958
|
this.#k(this.#C(t, n));
|
|
567
959
|
break;
|
|
568
|
-
case
|
|
960
|
+
case E.copyAll:
|
|
569
961
|
this.#k(this.#O());
|
|
570
962
|
break;
|
|
571
|
-
case
|
|
963
|
+
case E.wrap:
|
|
572
964
|
a && this.#w(a, !0);
|
|
573
965
|
break;
|
|
574
|
-
case
|
|
966
|
+
case E.unwrap:
|
|
575
967
|
a && this.#w(a, !1);
|
|
576
968
|
break;
|
|
577
|
-
case
|
|
969
|
+
case E.freeze:
|
|
578
970
|
this.#T(t);
|
|
579
971
|
break;
|
|
580
|
-
case
|
|
972
|
+
case E.unfreeze:
|
|
581
973
|
this.#T(-1);
|
|
582
974
|
break;
|
|
583
|
-
case
|
|
584
|
-
case
|
|
585
|
-
case
|
|
586
|
-
this.#E(
|
|
975
|
+
case E.widthAdaptive:
|
|
976
|
+
case E.widthStandard:
|
|
977
|
+
case E.widthFill:
|
|
978
|
+
this.#E(Be(r));
|
|
587
979
|
break;
|
|
588
|
-
case
|
|
980
|
+
case E.reset: this.#D();
|
|
589
981
|
}
|
|
590
982
|
}
|
|
591
983
|
#C(e, t) {
|
|
592
|
-
return e < 0 || t < 0 ? "" :
|
|
984
|
+
return e < 0 || t < 0 ? "" : A(this.#e.getCellRawValue(e, t));
|
|
593
985
|
}
|
|
594
986
|
#w(e, t) {
|
|
595
|
-
t ? this.#a.add(e) : this.#a.delete(e), this.#e.defaultRowHeight = this.#a.size > 0 ? "auto" :
|
|
987
|
+
t ? this.#a.add(e) : this.#a.delete(e), this.#e.defaultRowHeight = this.#a.size > 0 ? "auto" : T, this.#e.updateColumns(this.#f(this.#p()), {
|
|
596
988
|
clearColWidthCache: !1,
|
|
597
989
|
clearRowHeightCache: !0
|
|
598
990
|
});
|
|
@@ -607,7 +999,7 @@ var _e = class {
|
|
|
607
999
|
}));
|
|
608
1000
|
}
|
|
609
1001
|
#D() {
|
|
610
|
-
this.#a.clear(), this.#o = 0, this.#l =
|
|
1002
|
+
this.#a.clear(), this.#o = 0, this.#l = E.widthAdaptive, this.#e.updateOption(this.#y(), {
|
|
611
1003
|
clearColWidthCache: !0,
|
|
612
1004
|
clearRowHeightCache: !0
|
|
613
1005
|
});
|
|
@@ -616,7 +1008,7 @@ var _e = class {
|
|
|
616
1008
|
let e = this.#e, t = [this.#n.columns.join(" ")];
|
|
617
1009
|
for (let n = e.columnHeaderLevelCount; n < e.rowCount; n += 1) {
|
|
618
1010
|
let r = [];
|
|
619
|
-
for (let t = 0; t < e.colCount; t += 1) r.push(
|
|
1011
|
+
for (let t = 0; t < e.colCount; t += 1) r.push(A(e.getCellRawValue(t, n)));
|
|
620
1012
|
t.push(r.join(" "));
|
|
621
1013
|
}
|
|
622
1014
|
return t.join("\n");
|
|
@@ -629,56 +1021,56 @@ var _e = class {
|
|
|
629
1021
|
dispose() {
|
|
630
1022
|
cancelAnimationFrame(this.#s), this.#u?.disconnect(), this.#d?.disconnect(), this.#e.release();
|
|
631
1023
|
}
|
|
632
|
-
},
|
|
633
|
-
function
|
|
634
|
-
let e =
|
|
635
|
-
e.style.setProperty("--dfk-sql-skeleton-row-height", `${
|
|
636
|
-
for (let t = 0; t <
|
|
637
|
-
for (let t = 0; t <
|
|
1024
|
+
}, Ye = 2, Xe = 4;
|
|
1025
|
+
function Ze() {
|
|
1026
|
+
let e = u("div", { class: "dfk-sql-table-skeleton" });
|
|
1027
|
+
e.style.setProperty("--dfk-sql-skeleton-row-height", `${T}px`);
|
|
1028
|
+
for (let t = 0; t < Ye; t += 1) e.appendChild(u("div", { class: "dfk-sql-table-skeleton-row" }, (e) => {
|
|
1029
|
+
for (let t = 0; t < Xe; t += 1) e.appendChild(u("span", { class: "dfk-sql-table-skeleton-cell" }));
|
|
638
1030
|
}));
|
|
639
1031
|
return e;
|
|
640
1032
|
}
|
|
641
|
-
async function
|
|
642
|
-
let r = e.ownerDocument, i =
|
|
643
|
-
i.style.setProperty("--dfk-sql-table-height", `${Math.min(360, 36 + t.rows.length *
|
|
644
|
-
let a =
|
|
1033
|
+
async function O(e, t, n) {
|
|
1034
|
+
let r = e.ownerDocument, i = u("div", { class: "dfk-sql-table" });
|
|
1035
|
+
i.style.setProperty("--dfk-sql-table-height", `${Math.min(360, 36 + t.rows.length * T)}px`);
|
|
1036
|
+
let a = Ze();
|
|
645
1037
|
i.appendChild(a), e.appendChild(i);
|
|
646
1038
|
try {
|
|
647
|
-
let e = new
|
|
1039
|
+
let e = new Je(await import("@visactor/vtable"), i, t, n);
|
|
648
1040
|
return a.remove(), { dispose: () => e.dispose() };
|
|
649
1041
|
} catch (e) {
|
|
650
|
-
return a.remove(), i.appendChild(
|
|
1042
|
+
return a.remove(), i.appendChild(qe(r, D(n, Ke(e)))), { dispose: () => {} };
|
|
651
1043
|
}
|
|
652
1044
|
}
|
|
653
|
-
var
|
|
654
|
-
let i = new
|
|
1045
|
+
var Qe = async ({ host: e, labels: t, fullscreenButton: n }, r) => {
|
|
1046
|
+
let i = new w(e, [], t.table ?? "Table", (e) => O(e, r, t), n);
|
|
655
1047
|
return () => i.dispose();
|
|
656
1048
|
};
|
|
657
|
-
function
|
|
1049
|
+
function $e(e, t) {
|
|
658
1050
|
let n = e.createElement("pre");
|
|
659
1051
|
n.className = "dfk-sql-text";
|
|
660
1052
|
let r = [t.columns.join(" ")];
|
|
661
|
-
for (let e of t.rows) r.push(t.columns.map((t) =>
|
|
1053
|
+
for (let e of t.rows) r.push(t.columns.map((t) => A(e[t])).join(" "));
|
|
662
1054
|
return n.textContent = r.join("\n"), n;
|
|
663
1055
|
}
|
|
664
|
-
var
|
|
665
|
-
let i = new
|
|
1056
|
+
var et = async ({ host: e, labels: t, fullscreenButton: n }, r) => {
|
|
1057
|
+
let i = new w(e, [{
|
|
666
1058
|
label: t.text ?? "Text",
|
|
667
|
-
mount: (e) => e.appendChild(
|
|
668
|
-
}], t.table ?? "Table", (e) =>
|
|
1059
|
+
mount: (e) => e.appendChild($e(e.ownerDocument, r))
|
|
1060
|
+
}], t.table ?? "Table", (e) => O(e, r, t), n);
|
|
669
1061
|
return () => i.dispose();
|
|
670
|
-
},
|
|
671
|
-
e.replaceChildren(
|
|
1062
|
+
}, tt = async ({ host: e, labels: t }, n) => {
|
|
1063
|
+
e.replaceChildren(qe(e.ownerDocument, D(t, n.error ?? "unknown")));
|
|
672
1064
|
};
|
|
673
|
-
function
|
|
1065
|
+
function nt(e, t) {
|
|
674
1066
|
return e.field ? e.field : t.columns.length === 1 ? t.columns[0] : null;
|
|
675
1067
|
}
|
|
676
|
-
function
|
|
1068
|
+
function rt(e, t) {
|
|
677
1069
|
if (!t.trim()) return null;
|
|
678
1070
|
let n = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
|
|
679
|
-
return !n || n.localName === "parsererror" || n.namespaceURI !==
|
|
1071
|
+
return !n || n.localName === "parsererror" || n.namespaceURI !== Ge ? null : (it(n), e.importNode(n, !0));
|
|
680
1072
|
}
|
|
681
|
-
function
|
|
1073
|
+
function it(e) {
|
|
682
1074
|
for (let t of e.querySelectorAll("script, foreignObject")) t.remove();
|
|
683
1075
|
let t = (e) => {
|
|
684
1076
|
for (let t of [...e.attributes]) {
|
|
@@ -689,109 +1081,81 @@ function De(e) {
|
|
|
689
1081
|
};
|
|
690
1082
|
t(e);
|
|
691
1083
|
}
|
|
692
|
-
function
|
|
1084
|
+
function at(e, t) {
|
|
693
1085
|
let { width: n, height: r } = t.option ?? {};
|
|
694
1086
|
n && e.style.setProperty("--dfk-sql-preview-width", n), r && e.style.setProperty("--dfk-sql-preview-height", r);
|
|
695
1087
|
}
|
|
696
|
-
function
|
|
1088
|
+
function ot(e, t, n, r, i) {
|
|
697
1089
|
let a = n == null ? "" : String(n);
|
|
698
1090
|
if (e === "iframe") {
|
|
699
|
-
let e =
|
|
1091
|
+
let e = u("iframe", {
|
|
700
1092
|
class: "dfk-sql-frame",
|
|
701
1093
|
srcdoc: a,
|
|
702
1094
|
attrs: {
|
|
703
|
-
sandbox: i.option?.sandbox ??
|
|
1095
|
+
sandbox: i.option?.sandbox ?? Le,
|
|
704
1096
|
loading: "lazy",
|
|
705
1097
|
referrerpolicy: "no-referrer",
|
|
706
1098
|
title: r
|
|
707
1099
|
}
|
|
708
1100
|
});
|
|
709
|
-
|
|
1101
|
+
at(e, i), t.appendChild(e);
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
if (e === "mermaid") {
|
|
1105
|
+
t.appendChild(u("dfk-mermaid", { attrs: { source: a } }));
|
|
710
1106
|
return;
|
|
711
1107
|
}
|
|
712
|
-
let o =
|
|
1108
|
+
let o = rt(t.ownerDocument, a);
|
|
713
1109
|
if (!o) {
|
|
714
|
-
t.appendChild(
|
|
1110
|
+
t.appendChild(u("pre", {
|
|
715
1111
|
class: "dfk-sql-text",
|
|
716
1112
|
text: a
|
|
717
1113
|
}));
|
|
718
1114
|
return;
|
|
719
1115
|
}
|
|
720
|
-
let s =
|
|
721
|
-
s.appendChild(o),
|
|
1116
|
+
let s = u("div", { class: "dfk-sql-svg" });
|
|
1117
|
+
s.appendChild(o), at(s, i), t.appendChild(s);
|
|
722
1118
|
}
|
|
723
|
-
function
|
|
1119
|
+
function k(e) {
|
|
724
1120
|
return async ({ host: t, config: n, labels: r, fullscreenButton: i }, a) => {
|
|
725
|
-
let o =
|
|
1121
|
+
let o = nt(n, a);
|
|
726
1122
|
if (!o) {
|
|
727
|
-
t.replaceChildren(
|
|
1123
|
+
t.replaceChildren(qe(t.ownerDocument, D(r, r.noField ?? "this result has no markup column; set `field`")));
|
|
728
1124
|
return;
|
|
729
1125
|
}
|
|
730
|
-
let s = n.tab_name, c = new
|
|
1126
|
+
let s = n.tab_name, c = new w(t, a.rows.map((t, i) => {
|
|
731
1127
|
let a = s ? t[s] : void 0;
|
|
732
1128
|
return {
|
|
733
|
-
label: a == null ? `${r.row ?? "Row"} ${i + 1}` :
|
|
734
|
-
mount: (r) =>
|
|
1129
|
+
label: a == null ? `${r.row ?? "Row"} ${i + 1}` : A(a),
|
|
1130
|
+
mount: (r) => ot(e, r, t[o], "", n)
|
|
735
1131
|
};
|
|
736
|
-
}), r.table ?? "Table", (e) =>
|
|
1132
|
+
}), r.table ?? "Table", (e) => O(e, a, r), i);
|
|
737
1133
|
return () => c.dispose();
|
|
738
1134
|
};
|
|
739
1135
|
}
|
|
740
|
-
function
|
|
1136
|
+
function A(e) {
|
|
741
1137
|
return e == null ? "NULL" : e instanceof Date ? e.toLocaleString() : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
742
1138
|
}
|
|
743
|
-
var
|
|
744
|
-
table:
|
|
745
|
-
text:
|
|
746
|
-
iframe:
|
|
747
|
-
html:
|
|
748
|
-
svg:
|
|
1139
|
+
var st = {
|
|
1140
|
+
table: Qe,
|
|
1141
|
+
text: et,
|
|
1142
|
+
iframe: k("iframe"),
|
|
1143
|
+
html: k("iframe"),
|
|
1144
|
+
svg: k("svg"),
|
|
1145
|
+
mermaid: k("mermaid")
|
|
749
1146
|
};
|
|
750
|
-
function
|
|
751
|
-
return t.error ?
|
|
752
|
-
}
|
|
753
|
-
//#endregion
|
|
754
|
-
//#region src/sql/editor.ts
|
|
755
|
-
async function Me(e, t, n) {
|
|
756
|
-
let [{ basicSetup: r }, { sql: i }, { EditorView: a, keymap: o }, { defaultKeymap: s, historyKeymap: c }, { Compartment: l }] = await Promise.all([
|
|
757
|
-
import("codemirror"),
|
|
758
|
-
import("@codemirror/lang-sql"),
|
|
759
|
-
import("@codemirror/view"),
|
|
760
|
-
import("@codemirror/commands"),
|
|
761
|
-
import("@codemirror/state")
|
|
762
|
-
]), u = new l(), d = new a({
|
|
763
|
-
doc: t,
|
|
764
|
-
extensions: [
|
|
765
|
-
r,
|
|
766
|
-
i(),
|
|
767
|
-
o.of([...s, ...c]),
|
|
768
|
-
u.of([]),
|
|
769
|
-
a.updateListener.of((e) => {
|
|
770
|
-
e.docChanged && n(e.state.doc.toString());
|
|
771
|
-
})
|
|
772
|
-
],
|
|
773
|
-
parent: e
|
|
774
|
-
});
|
|
775
|
-
return {
|
|
776
|
-
getValue: () => d.state.doc.toString(),
|
|
777
|
-
setValue: (e) => d.dispatch({ changes: {
|
|
778
|
-
from: 0,
|
|
779
|
-
to: d.state.doc.length,
|
|
780
|
-
insert: e
|
|
781
|
-
} }),
|
|
782
|
-
setWrap: (e) => d.dispatch({ effects: u.reconfigure(e ? a.lineWrapping : []) }),
|
|
783
|
-
destroy: () => d.destroy()
|
|
784
|
-
};
|
|
1147
|
+
function ct(e, t) {
|
|
1148
|
+
return t.error ? tt : st[e.show ?? (t.columns.length === 1 && t.rows.length === 1 ? "text" : "table")] ?? Qe;
|
|
785
1149
|
}
|
|
786
1150
|
//#endregion
|
|
787
1151
|
//#region src/sql/DfkSql.css?inline
|
|
788
|
-
var
|
|
789
|
-
function
|
|
790
|
-
return
|
|
1152
|
+
var lt = "*,:before,:after{box-sizing:border-box}:host{margin:1rem 0;display:block}.dfk-sql-code{position:relative}.dfk-sql-editor{border:1px solid var(--ifm-global-border-color,#e0e0e0);border-radius:var(--ifm-global-radius,.4rem);background:var(--ifm-background-surface-color,#fff);font-size:var(--ifm-code-font-size,95%);overflow:hidden}.dfk-sql-editor .cm-editor{outline:none}.dfk-sql-editor-skeleton{padding:4px .75rem}.dfk-sql-editor-skeleton-line{align-items:center;height:1.6em;display:flex}.dfk-sql-editor-skeleton-line:before{content:\"\";background-color:var(--ifm-color-emphasis-200,#e6e6e6);background-image:linear-gradient(90deg, transparent 0%, var(--ifm-color-emphasis-100,#f5f5f5) 50%, transparent 100%);background-size:200% 100%;border-radius:.25em;flex:1;height:.75em;animation:1.6s linear infinite dfk-sql-shimmer}@keyframes dfk-sql-shimmer{0%{background-position:0 0}to{background-position:100% 0}}@media (prefers-reduced-motion:reduce){.dfk-sql-editor-skeleton-line{animation:none}}.dfk-sql-editor .cm-scroller{font-family:var(--ifm-font-family-monospace,ui-monospace, SFMono-Regular, Menlo, monospace);line-height:1.6}.dfk-sql-actions{z-index:1;border-radius:var(--ifm-global-radius,.3rem);background:var(--ifm-color-emphasis-100,#f5f5f5);opacity:0;pointer-events:none;align-items:center;gap:.15rem;padding:.1rem .2rem;transition:opacity .12s;display:flex;position:absolute;top:.25rem;right:.25rem}.dfk-sql-code:hover .dfk-sql-actions,.dfk-sql-code:focus-within .dfk-sql-actions,.dfk-sql-actions-busy{opacity:1;pointer-events:auto}.dfk-sql-status{color:var(--ifm-color-emphasis-700,#666);white-space:nowrap;padding:0 .25rem;font-size:.72rem}.dfk-sql-status:empty{display:none}.dfk-icon-button{border-radius:var(--ifm-global-radius,.25rem);width:1.6rem;height:1.6rem;color:var(--ifm-color-emphasis-700,#666);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;transition:background .12s,color .12s;display:inline-flex;position:relative}.dfk-icon-button:hover:not(:disabled),.dfk-icon-button:focus-visible{background:var(--ifm-color-emphasis-200,#e6e6e6);color:var(--ifm-color-primary,#14459b)}.dfk-icon-button:disabled{opacity:.45;cursor:progress}.dfk-icon-button[hidden]{display:none}.dfk-icon-on{color:var(--ifm-color-primary,#14459b)}.dfk-icon{font-size:1rem}[data-tip]:after{content:attr(data-tip);z-index:2;border-radius:var(--ifm-global-radius,.25rem);background:var(--ifm-color-emphasis-800,#333);color:var(--ifm-color-emphasis-0,#fff);white-space:nowrap;opacity:0;pointer-events:none;padding:.15rem .4rem;font-size:.7rem;line-height:1.4;transition:opacity .12s;position:absolute;top:calc(100% + .3rem);right:0}[data-tip]:hover:after,[data-tip]:focus-visible:after{opacity:1}", j = null;
|
|
1153
|
+
function ut() {
|
|
1154
|
+
return j || (j = new CSSStyleSheet(), j.replaceSync(lt)), j;
|
|
791
1155
|
}
|
|
792
1156
|
//#endregion
|
|
793
1157
|
//#region src/sql/DfkSql.ts
|
|
794
|
-
var
|
|
1158
|
+
var dt = {
|
|
795
1159
|
en: {
|
|
796
1160
|
run: "Run",
|
|
797
1161
|
format: "Format SQL",
|
|
@@ -856,17 +1220,17 @@ var D = {
|
|
|
856
1220
|
row: "行",
|
|
857
1221
|
noField: "该结果没有可展示的标记列,请设置 `field`"
|
|
858
1222
|
}
|
|
859
|
-
},
|
|
860
|
-
function
|
|
861
|
-
return
|
|
1223
|
+
}, ft = 1600, pt = null;
|
|
1224
|
+
function mt() {
|
|
1225
|
+
return pt ??= import("sql-formatter"), pt;
|
|
862
1226
|
}
|
|
863
|
-
var
|
|
864
|
-
#e =
|
|
865
|
-
#t =
|
|
1227
|
+
var ht = class extends l {
|
|
1228
|
+
#e = u("div", { class: "dfk-sql-editor" });
|
|
1229
|
+
#t = u("div", { class: "dfk-sql-editor-skeleton" });
|
|
866
1230
|
#n = [];
|
|
867
|
-
#r =
|
|
868
|
-
#i =
|
|
869
|
-
#a =
|
|
1231
|
+
#r = u("div", { class: "dfk-sql-code" });
|
|
1232
|
+
#i = u("div", { class: "dfk-sql-actions" });
|
|
1233
|
+
#a = u("span", {
|
|
870
1234
|
class: "dfk-sql-status",
|
|
871
1235
|
attrs: { "aria-live": "polite" }
|
|
872
1236
|
});
|
|
@@ -876,7 +1240,7 @@ var Re = class extends c {
|
|
|
876
1240
|
#l;
|
|
877
1241
|
#u;
|
|
878
1242
|
#d;
|
|
879
|
-
#f =
|
|
1243
|
+
#f = dt.en;
|
|
880
1244
|
#p = { type: "duckfn" };
|
|
881
1245
|
#m = "";
|
|
882
1246
|
#h = "";
|
|
@@ -895,9 +1259,9 @@ var Re = class extends c {
|
|
|
895
1259
|
#E = null;
|
|
896
1260
|
#D = null;
|
|
897
1261
|
constructor() {
|
|
898
|
-
super(), this.#o = new
|
|
1262
|
+
super(), this.#o = new h("lucide:play", () => void this.#z()), this.#s = new h("lucide:wand-sparkles", () => void this.#P()), this.#c = new h("lucide:rotate-ccw", () => this.#N()), this.#l = new h("lucide:wrap-text", () => this.#F()), this.#u = new h("lucide:copy", () => void this.#I()), this.#d = new h("lucide:maximize", () => this.#L(!this.#x)), this.#i.append(this.#a, this.#o.root, this.#s.root, this.#c.root, this.#l.root, this.#u.root), this.#A(!0), this.#r.append(this.#e, this.#i);
|
|
899
1263
|
let e = this.attachShadow({ mode: "open" });
|
|
900
|
-
e.adoptedStyleSheets = [
|
|
1264
|
+
e.adoptedStyleSheets = [ut()], e.append(this.#r, u("slot", { attrs: { name: "dfk-result" } })), this.#k();
|
|
901
1265
|
}
|
|
902
1266
|
connectedCallback() {
|
|
903
1267
|
this.#y ||= (this.#O(), !0), this.#R(), this.#M();
|
|
@@ -906,7 +1270,7 @@ var Re = class extends c {
|
|
|
906
1270
|
this.#L(!1), this.#D?.(), this.#D = null, this.#E?.destroy(), this.#E = null, this.#C !== 0 && (window.clearTimeout(this.#C), this.#C = 0);
|
|
907
1271
|
}
|
|
908
1272
|
#O() {
|
|
909
|
-
this.#f =
|
|
1273
|
+
this.#f = dt[(document.documentElement.getAttribute("lang") ?? "en").toLowerCase()] ?? dt.en;
|
|
910
1274
|
let e = this.getAttribute("config");
|
|
911
1275
|
if (e) try {
|
|
912
1276
|
this.#p = JSON.parse(e);
|
|
@@ -927,7 +1291,7 @@ var Re = class extends c {
|
|
|
927
1291
|
let e = Math.max(1, this.#h.split("\n").length);
|
|
928
1292
|
for (; this.#n.length > e;) this.#n.pop()?.remove();
|
|
929
1293
|
for (; this.#n.length < e;) {
|
|
930
|
-
let e =
|
|
1294
|
+
let e = u("span", { class: "dfk-sql-editor-skeleton-line" });
|
|
931
1295
|
this.#n.push(e), this.#t.appendChild(e);
|
|
932
1296
|
}
|
|
933
1297
|
}
|
|
@@ -935,16 +1299,16 @@ var Re = class extends c {
|
|
|
935
1299
|
if (!(this.#E || this.#b)) {
|
|
936
1300
|
this.#b = !0, this.#A(!0);
|
|
937
1301
|
try {
|
|
938
|
-
let e = await
|
|
1302
|
+
let e = await ne(this.#e, this.#h, (e) => {
|
|
939
1303
|
this.#h = e;
|
|
940
|
-
});
|
|
1304
|
+
}, { language: "sql" });
|
|
941
1305
|
if (!this.isConnected) {
|
|
942
1306
|
e.destroy();
|
|
943
1307
|
return;
|
|
944
1308
|
}
|
|
945
1309
|
e.setWrap(this.#g), this.#E = e, this.#A(!1);
|
|
946
1310
|
} catch (e) {
|
|
947
|
-
this.#A(!1), this.#V(
|
|
1311
|
+
this.#A(!1), this.#V(gt(e));
|
|
948
1312
|
} finally {
|
|
949
1313
|
this.#b = !1;
|
|
950
1314
|
}
|
|
@@ -957,7 +1321,7 @@ var Re = class extends c {
|
|
|
957
1321
|
if (!this.#v) {
|
|
958
1322
|
this.#v = !0, this.#s.setDisabled(!0);
|
|
959
1323
|
try {
|
|
960
|
-
let { format: e } = await
|
|
1324
|
+
let { format: e } = await mt(), t = e(this.#h, { language: "duckdb" });
|
|
961
1325
|
this.#h = t, this.#E?.setValue(t);
|
|
962
1326
|
} catch {
|
|
963
1327
|
this.#V(this.#f.formatFailed);
|
|
@@ -977,18 +1341,18 @@ var Re = class extends c {
|
|
|
977
1341
|
}
|
|
978
1342
|
this.#u.setIcon("lucide:check"), this.#u.setLabel(this.#f.copied), this.#C !== 0 && window.clearTimeout(this.#C), this.#C = window.setTimeout(() => {
|
|
979
1343
|
this.#C = 0, this.#u.setIcon("lucide:copy"), this.#u.setLabel(this.#f.copy);
|
|
980
|
-
},
|
|
1344
|
+
}, ft);
|
|
981
1345
|
}
|
|
982
1346
|
#L(e) {
|
|
983
1347
|
this.#x = e, this.#T?.classList.toggle("dfk-sql-result-expanded", e), this.#d.setIcon(e ? "lucide:minimize" : "lucide:maximize"), this.#k(), e !== this.#S && (e ? document.addEventListener("keydown", this.#w) : document.removeEventListener("keydown", this.#w), this.#S = e);
|
|
984
1348
|
}
|
|
985
1349
|
#R() {
|
|
986
|
-
|
|
1350
|
+
S.getInstance().init({ allowUnsignedExtensions: this.#p.allowUnsignedExtensions === !0 }).catch(() => void 0);
|
|
987
1351
|
}
|
|
988
1352
|
async #z() {
|
|
989
1353
|
if (this.#_) return;
|
|
990
1354
|
this.#_ = !0, this.#B(!0);
|
|
991
|
-
let e =
|
|
1355
|
+
let e = S.getInstance();
|
|
992
1356
|
try {
|
|
993
1357
|
e.state !== "ready" && this.#V(this.#f.initializing);
|
|
994
1358
|
try {
|
|
@@ -1003,7 +1367,7 @@ var Re = class extends c {
|
|
|
1003
1367
|
try {
|
|
1004
1368
|
for (let n of t) await e.loadExtension(n, { repository: this.#p.repository });
|
|
1005
1369
|
} catch (e) {
|
|
1006
|
-
this.#G(
|
|
1370
|
+
this.#G(_t(this.#f, gt(e)));
|
|
1007
1371
|
return;
|
|
1008
1372
|
}
|
|
1009
1373
|
}
|
|
@@ -1021,11 +1385,11 @@ var Re = class extends c {
|
|
|
1021
1385
|
this.#a.textContent = e;
|
|
1022
1386
|
}
|
|
1023
1387
|
#H() {
|
|
1024
|
-
let e =
|
|
1388
|
+
let e = S.getInstance().message;
|
|
1025
1389
|
this.#G(this.#f.initFailed + (e ? `: ${e}` : ""));
|
|
1026
1390
|
}
|
|
1027
1391
|
#U() {
|
|
1028
|
-
return this.#T || (this.#T =
|
|
1392
|
+
return this.#T || (this.#T = u("div", { class: "dfk-sql-result" }), this.#T.slot = "dfk-result", this.appendChild(this.#T)), this.#T.hidden = !1, this.#T;
|
|
1029
1393
|
}
|
|
1030
1394
|
#W(e) {
|
|
1031
1395
|
this.#D?.(), this.#D = null, e.error && this.#L(!1);
|
|
@@ -1035,7 +1399,7 @@ var Re = class extends c {
|
|
|
1035
1399
|
labels: this.#f,
|
|
1036
1400
|
fullscreenButton: this.#d.root
|
|
1037
1401
|
};
|
|
1038
|
-
|
|
1402
|
+
ct(this.#p, e)(t, e).then((e) => {
|
|
1039
1403
|
this.#D = e ?? null;
|
|
1040
1404
|
});
|
|
1041
1405
|
}
|
|
@@ -1047,63 +1411,39 @@ var Re = class extends c {
|
|
|
1047
1411
|
#K() {
|
|
1048
1412
|
this.#L(!1), this.#D?.(), this.#D = null, this.#T && (this.#T.replaceChildren(), this.#T.hidden = !0);
|
|
1049
1413
|
}
|
|
1050
|
-
}, O = class {
|
|
1051
|
-
root = l("button", {
|
|
1052
|
-
class: "dfk-sql-icon-button",
|
|
1053
|
-
type: "button"
|
|
1054
|
-
});
|
|
1055
|
-
#e = l("iconify-icon", {
|
|
1056
|
-
class: "dfk-sql-icon",
|
|
1057
|
-
attrs: { "aria-hidden": "true" }
|
|
1058
|
-
});
|
|
1059
|
-
constructor(e, t) {
|
|
1060
|
-
this.root.appendChild(this.#e), this.root.addEventListener("click", t), this.setIcon(e);
|
|
1061
|
-
}
|
|
1062
|
-
setIcon(e) {
|
|
1063
|
-
this.#e.setAttribute("icon", e);
|
|
1064
|
-
}
|
|
1065
|
-
setLabel(e) {
|
|
1066
|
-
this.root.setAttribute("data-tip", e), this.root.setAttribute("aria-label", e);
|
|
1067
|
-
}
|
|
1068
|
-
setOn(e) {
|
|
1069
|
-
this.root.classList.toggle("dfk-sql-icon-on", e);
|
|
1070
|
-
}
|
|
1071
|
-
setDisabled(e) {
|
|
1072
|
-
e ? this.root.setAttribute("disabled", "") : this.root.removeAttribute("disabled");
|
|
1073
|
-
}
|
|
1074
1414
|
};
|
|
1075
|
-
function
|
|
1415
|
+
function gt(e) {
|
|
1076
1416
|
return e instanceof Error ? e.message : String(e);
|
|
1077
1417
|
}
|
|
1078
|
-
function
|
|
1418
|
+
function _t(e, t) {
|
|
1079
1419
|
return `${e.error}: ${t}`;
|
|
1080
1420
|
}
|
|
1081
1421
|
//#endregion
|
|
1082
1422
|
//#region ../node_modules/iconify-icon/dist/iconify-icon.mjs
|
|
1083
|
-
var
|
|
1423
|
+
var vt = Object.freeze({
|
|
1084
1424
|
left: 0,
|
|
1085
1425
|
top: 0,
|
|
1086
1426
|
width: 16,
|
|
1087
1427
|
height: 16
|
|
1088
|
-
}),
|
|
1428
|
+
}), M = Object.freeze({
|
|
1089
1429
|
rotate: 0,
|
|
1090
1430
|
vFlip: !1,
|
|
1091
1431
|
hFlip: !1
|
|
1092
|
-
}),
|
|
1093
|
-
...
|
|
1094
|
-
...
|
|
1095
|
-
}),
|
|
1096
|
-
...
|
|
1432
|
+
}), N = Object.freeze({
|
|
1433
|
+
...vt,
|
|
1434
|
+
...M
|
|
1435
|
+
}), P = Object.freeze({
|
|
1436
|
+
...N,
|
|
1097
1437
|
body: "",
|
|
1098
1438
|
hidden: !1
|
|
1099
|
-
}),
|
|
1439
|
+
}), yt = Object.freeze({
|
|
1100
1440
|
width: null,
|
|
1101
1441
|
height: null
|
|
1102
|
-
}),
|
|
1103
|
-
...
|
|
1104
|
-
...
|
|
1442
|
+
}), bt = Object.freeze({
|
|
1443
|
+
...yt,
|
|
1444
|
+
...M
|
|
1105
1445
|
});
|
|
1106
|
-
function
|
|
1446
|
+
function xt(e, t = 0) {
|
|
1107
1447
|
let n = e.replace(/^-?[0-9.]*/, "");
|
|
1108
1448
|
function r(e) {
|
|
1109
1449
|
for (; e < 0;) e += 4;
|
|
@@ -1128,9 +1468,9 @@ function Ge(e, t = 0) {
|
|
|
1128
1468
|
}
|
|
1129
1469
|
return t;
|
|
1130
1470
|
}
|
|
1131
|
-
var
|
|
1132
|
-
function
|
|
1133
|
-
t.split(
|
|
1471
|
+
var St = /[\s,]+/;
|
|
1472
|
+
function Ct(e, t) {
|
|
1473
|
+
t.split(St).forEach((t) => {
|
|
1134
1474
|
switch (t.trim()) {
|
|
1135
1475
|
case "horizontal":
|
|
1136
1476
|
e.hFlip = !0;
|
|
@@ -1139,19 +1479,19 @@ function qe(e, t) {
|
|
|
1139
1479
|
}
|
|
1140
1480
|
});
|
|
1141
1481
|
}
|
|
1142
|
-
var
|
|
1143
|
-
...
|
|
1482
|
+
var wt = {
|
|
1483
|
+
...bt,
|
|
1144
1484
|
preserveAspectRatio: ""
|
|
1145
1485
|
};
|
|
1146
|
-
function
|
|
1147
|
-
let t = { ...
|
|
1148
|
-
return t.width = n("width", null), t.height = n("height", null), t.rotate =
|
|
1486
|
+
function Tt(e) {
|
|
1487
|
+
let t = { ...wt }, n = (t, n) => e.getAttribute(t) || n;
|
|
1488
|
+
return t.width = n("width", null), t.height = n("height", null), t.rotate = xt(n("rotate", "")), Ct(t, n("flip", "")), t.preserveAspectRatio = n("preserveAspectRatio", n("preserveaspectratio", "")), t;
|
|
1149
1489
|
}
|
|
1150
|
-
function
|
|
1151
|
-
for (let n in
|
|
1490
|
+
function Et(e, t) {
|
|
1491
|
+
for (let n in wt) if (e[n] !== t[n]) return !0;
|
|
1152
1492
|
return !1;
|
|
1153
1493
|
}
|
|
1154
|
-
var
|
|
1494
|
+
var Dt = /^[a-z0-9]+(-[a-z0-9]+)*$/, F = (e, t, n, r = "") => {
|
|
1155
1495
|
let i = e.split(":");
|
|
1156
1496
|
if (e.slice(0, 1) === "@") {
|
|
1157
1497
|
if (i.length < 2 || i.length > 3) return null;
|
|
@@ -1164,7 +1504,7 @@ var Ze = /^[a-z0-9]+(-[a-z0-9]+)*$/, j = (e, t, n, r = "") => {
|
|
|
1164
1504
|
prefix: n,
|
|
1165
1505
|
name: e
|
|
1166
1506
|
};
|
|
1167
|
-
return t && !
|
|
1507
|
+
return t && !I(a) ? null : a;
|
|
1168
1508
|
}
|
|
1169
1509
|
let a = i[0], o = a.split("-");
|
|
1170
1510
|
if (o.length > 1) {
|
|
@@ -1173,7 +1513,7 @@ var Ze = /^[a-z0-9]+(-[a-z0-9]+)*$/, j = (e, t, n, r = "") => {
|
|
|
1173
1513
|
prefix: o.shift(),
|
|
1174
1514
|
name: o.join("-")
|
|
1175
1515
|
};
|
|
1176
|
-
return t && !
|
|
1516
|
+
return t && !I(e) ? null : e;
|
|
1177
1517
|
}
|
|
1178
1518
|
if (n && r === "") {
|
|
1179
1519
|
let e = {
|
|
@@ -1181,11 +1521,11 @@ var Ze = /^[a-z0-9]+(-[a-z0-9]+)*$/, j = (e, t, n, r = "") => {
|
|
|
1181
1521
|
prefix: "",
|
|
1182
1522
|
name: a
|
|
1183
1523
|
};
|
|
1184
|
-
return t && !
|
|
1524
|
+
return t && !I(e, n) ? null : e;
|
|
1185
1525
|
}
|
|
1186
1526
|
return null;
|
|
1187
|
-
},
|
|
1188
|
-
function
|
|
1527
|
+
}, I = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
|
|
1528
|
+
function Ot(e, t) {
|
|
1189
1529
|
let n = e.icons, r = e.aliases || Object.create(null), i = Object.create(null);
|
|
1190
1530
|
function a(e) {
|
|
1191
1531
|
if (n[e]) return i[e] = [];
|
|
@@ -1198,65 +1538,65 @@ function Qe(e, t) {
|
|
|
1198
1538
|
}
|
|
1199
1539
|
return Object.keys(n).concat(Object.keys(r)).forEach(a), i;
|
|
1200
1540
|
}
|
|
1201
|
-
function
|
|
1541
|
+
function kt(e, t) {
|
|
1202
1542
|
let n = {};
|
|
1203
1543
|
!e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
|
|
1204
1544
|
let r = ((e.rotate || 0) + (t.rotate || 0)) % 4;
|
|
1205
1545
|
return r && (n.rotate = r), n;
|
|
1206
1546
|
}
|
|
1207
|
-
function
|
|
1208
|
-
let n =
|
|
1209
|
-
for (let r in
|
|
1547
|
+
function At(e, t) {
|
|
1548
|
+
let n = kt(e, t);
|
|
1549
|
+
for (let r in P) r in M ? r in e && !(r in n) && (n[r] = M[r]) : r in t ? n[r] = t[r] : r in e && (n[r] = e[r]);
|
|
1210
1550
|
return n;
|
|
1211
1551
|
}
|
|
1212
|
-
function
|
|
1552
|
+
function jt(e, t, n) {
|
|
1213
1553
|
let r = e.icons, i = e.aliases || Object.create(null), a = {};
|
|
1214
1554
|
function o(e) {
|
|
1215
|
-
a =
|
|
1555
|
+
a = At(r[e] || i[e], a);
|
|
1216
1556
|
}
|
|
1217
|
-
return o(t), n.forEach(o),
|
|
1557
|
+
return o(t), n.forEach(o), At(e, a);
|
|
1218
1558
|
}
|
|
1219
|
-
function
|
|
1559
|
+
function Mt(e, t) {
|
|
1220
1560
|
let n = [];
|
|
1221
1561
|
if (typeof e != "object" || typeof e.icons != "object") return n;
|
|
1222
1562
|
e.not_found instanceof Array && e.not_found.forEach((e) => {
|
|
1223
1563
|
t(e, null), n.push(e);
|
|
1224
1564
|
});
|
|
1225
|
-
let r =
|
|
1565
|
+
let r = Ot(e);
|
|
1226
1566
|
for (let i in r) {
|
|
1227
1567
|
let a = r[i];
|
|
1228
|
-
a && (t(i,
|
|
1568
|
+
a && (t(i, jt(e, i, a)), n.push(i));
|
|
1229
1569
|
}
|
|
1230
1570
|
return n;
|
|
1231
1571
|
}
|
|
1232
|
-
var
|
|
1572
|
+
var Nt = {
|
|
1233
1573
|
provider: "",
|
|
1234
1574
|
aliases: {},
|
|
1235
1575
|
not_found: {},
|
|
1236
|
-
...
|
|
1576
|
+
...vt
|
|
1237
1577
|
};
|
|
1238
|
-
function
|
|
1578
|
+
function Pt(e, t) {
|
|
1239
1579
|
for (let n in t) if (n in e && typeof e[n] != typeof t[n]) return !1;
|
|
1240
1580
|
return !0;
|
|
1241
1581
|
}
|
|
1242
|
-
function
|
|
1582
|
+
function Ft(e) {
|
|
1243
1583
|
if (typeof e != "object" || !e) return null;
|
|
1244
1584
|
let t = e;
|
|
1245
|
-
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !
|
|
1585
|
+
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !Pt(e, Nt)) return null;
|
|
1246
1586
|
let n = t.icons;
|
|
1247
1587
|
for (let e in n) {
|
|
1248
1588
|
let t = n[e];
|
|
1249
|
-
if (!e || typeof t.body != "string" || !
|
|
1589
|
+
if (!e || typeof t.body != "string" || !Pt(t, P)) return null;
|
|
1250
1590
|
}
|
|
1251
1591
|
let r = t.aliases || Object.create(null);
|
|
1252
1592
|
for (let e in r) {
|
|
1253
1593
|
let t = r[e], i = t.parent;
|
|
1254
|
-
if (!e || typeof i != "string" || !n[i] && !r[i] || !
|
|
1594
|
+
if (!e || typeof i != "string" || !n[i] && !r[i] || !Pt(t, P)) return null;
|
|
1255
1595
|
}
|
|
1256
1596
|
return t;
|
|
1257
1597
|
}
|
|
1258
|
-
var
|
|
1259
|
-
function
|
|
1598
|
+
var L = Object.create(null);
|
|
1599
|
+
function It(e, t) {
|
|
1260
1600
|
return {
|
|
1261
1601
|
provider: e,
|
|
1262
1602
|
prefix: t,
|
|
@@ -1264,78 +1604,78 @@ function at(e, t) {
|
|
|
1264
1604
|
missing: /* @__PURE__ */ new Set()
|
|
1265
1605
|
};
|
|
1266
1606
|
}
|
|
1267
|
-
function
|
|
1268
|
-
let n =
|
|
1269
|
-
return n[t] || (n[t] =
|
|
1607
|
+
function R(e, t) {
|
|
1608
|
+
let n = L[e] || (L[e] = Object.create(null));
|
|
1609
|
+
return n[t] || (n[t] = It(e, t));
|
|
1270
1610
|
}
|
|
1271
|
-
function
|
|
1272
|
-
return
|
|
1611
|
+
function Lt(e, t) {
|
|
1612
|
+
return Ft(t) ? Mt(t, (t, n) => {
|
|
1273
1613
|
n ? e.icons[t] = n : e.missing.add(t);
|
|
1274
1614
|
}) : [];
|
|
1275
1615
|
}
|
|
1276
|
-
function
|
|
1616
|
+
function Rt(e, t, n) {
|
|
1277
1617
|
try {
|
|
1278
1618
|
if (typeof n.body == "string") return e.icons[t] = { ...n }, !0;
|
|
1279
1619
|
} catch {}
|
|
1280
1620
|
return !1;
|
|
1281
1621
|
}
|
|
1282
|
-
function
|
|
1622
|
+
function zt(e, t) {
|
|
1283
1623
|
let n = [];
|
|
1284
|
-
return (typeof e == "string" ? [e] : Object.keys(
|
|
1285
|
-
(typeof e == "string" && typeof t == "string" ? [t] : Object.keys(
|
|
1286
|
-
let r =
|
|
1624
|
+
return (typeof e == "string" ? [e] : Object.keys(L)).forEach((e) => {
|
|
1625
|
+
(typeof e == "string" && typeof t == "string" ? [t] : Object.keys(L[e] || {})).forEach((t) => {
|
|
1626
|
+
let r = R(e, t);
|
|
1287
1627
|
n = n.concat(Object.keys(r.icons).map((n) => (e === "" ? "" : "@" + e + ":") + t + ":" + n));
|
|
1288
1628
|
});
|
|
1289
1629
|
}), n;
|
|
1290
1630
|
}
|
|
1291
|
-
var
|
|
1292
|
-
function
|
|
1293
|
-
return typeof e == "boolean" && (
|
|
1631
|
+
var z = !1;
|
|
1632
|
+
function Bt(e) {
|
|
1633
|
+
return typeof e == "boolean" && (z = e), z;
|
|
1294
1634
|
}
|
|
1295
|
-
function
|
|
1296
|
-
let t = typeof e == "string" ?
|
|
1635
|
+
function B(e) {
|
|
1636
|
+
let t = typeof e == "string" ? F(e, !0, z) : e;
|
|
1297
1637
|
if (t) {
|
|
1298
|
-
let e =
|
|
1638
|
+
let e = R(t.provider, t.prefix), n = t.name;
|
|
1299
1639
|
return e.icons[n] || (e.missing.has(n) ? null : void 0);
|
|
1300
1640
|
}
|
|
1301
1641
|
}
|
|
1302
|
-
function
|
|
1303
|
-
let n =
|
|
1642
|
+
function Vt(e, t) {
|
|
1643
|
+
let n = F(e, !0, z);
|
|
1304
1644
|
if (!n) return !1;
|
|
1305
|
-
let r =
|
|
1306
|
-
return t ?
|
|
1645
|
+
let r = R(n.provider, n.prefix);
|
|
1646
|
+
return t ? Rt(r, n.name, t) : (r.missing.add(n.name), !0);
|
|
1307
1647
|
}
|
|
1308
|
-
function
|
|
1648
|
+
function Ht(e, t) {
|
|
1309
1649
|
if (typeof e != "object") return !1;
|
|
1310
|
-
if (typeof t != "string" && (t = e.provider || ""),
|
|
1650
|
+
if (typeof t != "string" && (t = e.provider || ""), z && !t && !e.prefix) {
|
|
1311
1651
|
let t = !1;
|
|
1312
|
-
return
|
|
1313
|
-
|
|
1652
|
+
return Ft(e) && (e.prefix = "", Mt(e, (e, n) => {
|
|
1653
|
+
Vt(e, n) && (t = !0);
|
|
1314
1654
|
})), t;
|
|
1315
1655
|
}
|
|
1316
1656
|
let n = e.prefix;
|
|
1317
|
-
return
|
|
1657
|
+
return I({
|
|
1318
1658
|
prefix: n,
|
|
1319
1659
|
name: "a"
|
|
1320
|
-
}) ? !!
|
|
1660
|
+
}) ? !!Lt(R(t, n), e) : !1;
|
|
1321
1661
|
}
|
|
1322
|
-
function
|
|
1323
|
-
return !!
|
|
1662
|
+
function Ut(e) {
|
|
1663
|
+
return !!B(e);
|
|
1324
1664
|
}
|
|
1325
|
-
function
|
|
1326
|
-
let t =
|
|
1665
|
+
function Wt(e) {
|
|
1666
|
+
let t = B(e);
|
|
1327
1667
|
return t && {
|
|
1328
|
-
...
|
|
1668
|
+
...N,
|
|
1329
1669
|
...t
|
|
1330
1670
|
};
|
|
1331
1671
|
}
|
|
1332
|
-
function
|
|
1672
|
+
function Gt(e, t) {
|
|
1333
1673
|
e.forEach((e) => {
|
|
1334
1674
|
let n = e.loaderCallbacks;
|
|
1335
1675
|
n && (e.loaderCallbacks = n.filter((e) => e.id !== t));
|
|
1336
1676
|
});
|
|
1337
1677
|
}
|
|
1338
|
-
function
|
|
1678
|
+
function Kt(e) {
|
|
1339
1679
|
e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
|
|
1340
1680
|
e.pendingCallbacksFlag = !1;
|
|
1341
1681
|
let t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
|
|
@@ -1358,13 +1698,13 @@ function ht(e) {
|
|
|
1358
1698
|
});
|
|
1359
1699
|
else return n = !0, !0;
|
|
1360
1700
|
return !1;
|
|
1361
|
-
}), a.pending.length !== o && (n ||
|
|
1701
|
+
}), a.pending.length !== o && (n || Gt([e], t.id), t.callback(a.loaded.slice(0), a.missing.slice(0), a.pending.slice(0), t.abort));
|
|
1362
1702
|
});
|
|
1363
1703
|
}));
|
|
1364
1704
|
}
|
|
1365
|
-
var
|
|
1366
|
-
function
|
|
1367
|
-
let r =
|
|
1705
|
+
var qt = 0;
|
|
1706
|
+
function Jt(e, t, n) {
|
|
1707
|
+
let r = qt++, i = Gt.bind(null, n, r);
|
|
1368
1708
|
if (!t.pending.length) return i;
|
|
1369
1709
|
let a = {
|
|
1370
1710
|
id: r,
|
|
@@ -1376,7 +1716,7 @@ function _t(e, t, n) {
|
|
|
1376
1716
|
(e.loaderCallbacks ||= []).push(a);
|
|
1377
1717
|
}), i;
|
|
1378
1718
|
}
|
|
1379
|
-
function
|
|
1719
|
+
function Yt(e) {
|
|
1380
1720
|
let t = {
|
|
1381
1721
|
loaded: [],
|
|
1382
1722
|
missing: [],
|
|
@@ -1391,7 +1731,7 @@ function vt(e) {
|
|
|
1391
1731
|
return e.forEach((e) => {
|
|
1392
1732
|
if (r.name === e.name && r.prefix === e.prefix && r.provider === e.provider) return;
|
|
1393
1733
|
r = e;
|
|
1394
|
-
let i = e.provider, a = e.prefix, o = e.name, s = n[i] || (n[i] = Object.create(null)), c = s[a] || (s[a] =
|
|
1734
|
+
let i = e.provider, a = e.prefix, o = e.name, s = n[i] || (n[i] = Object.create(null)), c = s[a] || (s[a] = R(i, a)), l;
|
|
1395
1735
|
l = o in c.icons ? t.loaded : a === "" || c.missing.has(o) ? t.missing : t.pending;
|
|
1396
1736
|
let u = {
|
|
1397
1737
|
provider: i,
|
|
@@ -1401,21 +1741,21 @@ function vt(e) {
|
|
|
1401
1741
|
l.push(u);
|
|
1402
1742
|
}), t;
|
|
1403
1743
|
}
|
|
1404
|
-
var
|
|
1405
|
-
function
|
|
1406
|
-
|
|
1744
|
+
var V = Object.create(null);
|
|
1745
|
+
function Xt(e, t) {
|
|
1746
|
+
V[e] = t;
|
|
1407
1747
|
}
|
|
1408
|
-
function
|
|
1409
|
-
return
|
|
1748
|
+
function H(e) {
|
|
1749
|
+
return V[e] || V[""];
|
|
1410
1750
|
}
|
|
1411
|
-
function
|
|
1751
|
+
function Zt(e, t = !0, n = !1) {
|
|
1412
1752
|
let r = [];
|
|
1413
1753
|
return e.forEach((e) => {
|
|
1414
|
-
let i = typeof e == "string" ?
|
|
1754
|
+
let i = typeof e == "string" ? F(e, t, n) : e;
|
|
1415
1755
|
i && r.push(i);
|
|
1416
1756
|
}), r;
|
|
1417
1757
|
}
|
|
1418
|
-
function
|
|
1758
|
+
function U(e) {
|
|
1419
1759
|
let t;
|
|
1420
1760
|
if (typeof e.resources == "string") t = [e.resources];
|
|
1421
1761
|
else if (t = e.resources, !(t instanceof Array) || !t.length) return null;
|
|
@@ -1430,19 +1770,19 @@ function B(e) {
|
|
|
1430
1770
|
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
1431
1771
|
};
|
|
1432
1772
|
}
|
|
1433
|
-
for (var
|
|
1434
|
-
|
|
1435
|
-
function
|
|
1436
|
-
let n =
|
|
1437
|
-
return n !== null && (
|
|
1773
|
+
for (var W = Object.create(null), G = ["https://api.simplesvg.com", "https://api.unisvg.com"], K = []; G.length > 0;) G.length === 1 || Math.random() > .5 ? K.push(G.shift()) : K.push(G.pop());
|
|
1774
|
+
W[""] = U({ resources: ["https://api.iconify.design"].concat(K) });
|
|
1775
|
+
function Qt(e, t) {
|
|
1776
|
+
let n = U(t);
|
|
1777
|
+
return n !== null && (W[e] = n, !0);
|
|
1438
1778
|
}
|
|
1439
|
-
function
|
|
1440
|
-
return
|
|
1779
|
+
function q(e) {
|
|
1780
|
+
return W[e];
|
|
1441
1781
|
}
|
|
1442
|
-
function
|
|
1443
|
-
return Object.keys(
|
|
1782
|
+
function $t() {
|
|
1783
|
+
return Object.keys(W);
|
|
1444
1784
|
}
|
|
1445
|
-
var
|
|
1785
|
+
var en = {
|
|
1446
1786
|
resources: [],
|
|
1447
1787
|
index: 0,
|
|
1448
1788
|
timeout: 2e3,
|
|
@@ -1450,7 +1790,7 @@ var Ct = {
|
|
|
1450
1790
|
random: !1,
|
|
1451
1791
|
dataAfterTimeout: !1
|
|
1452
1792
|
};
|
|
1453
|
-
function
|
|
1793
|
+
function tn(e, t, n, r) {
|
|
1454
1794
|
let i = e.resources.length, a = e.random ? Math.floor(Math.random() * i) : e.index, o;
|
|
1455
1795
|
if (e.random) {
|
|
1456
1796
|
let t = e.resources.slice(0);
|
|
@@ -1465,36 +1805,36 @@ function wt(e, t, n, r) {
|
|
|
1465
1805
|
function m() {
|
|
1466
1806
|
d &&= (clearTimeout(d), null);
|
|
1467
1807
|
}
|
|
1468
|
-
function
|
|
1808
|
+
function ee() {
|
|
1469
1809
|
c === "pending" && (c = "aborted"), m(), f.forEach((e) => {
|
|
1470
1810
|
e.status === "pending" && (e.status = "aborted");
|
|
1471
1811
|
}), f = [];
|
|
1472
1812
|
}
|
|
1473
|
-
function
|
|
1813
|
+
function te(e, t) {
|
|
1474
1814
|
t && (p = []), typeof e == "function" && p.push(e);
|
|
1475
1815
|
}
|
|
1476
|
-
function
|
|
1816
|
+
function ne() {
|
|
1477
1817
|
return {
|
|
1478
1818
|
startTime: s,
|
|
1479
1819
|
payload: t,
|
|
1480
1820
|
status: c,
|
|
1481
1821
|
queriesSent: l,
|
|
1482
1822
|
queriesPending: f.length,
|
|
1483
|
-
subscribe:
|
|
1484
|
-
abort:
|
|
1823
|
+
subscribe: te,
|
|
1824
|
+
abort: ee
|
|
1485
1825
|
};
|
|
1486
1826
|
}
|
|
1487
|
-
function
|
|
1827
|
+
function h() {
|
|
1488
1828
|
c = "failed", p.forEach((e) => {
|
|
1489
1829
|
e(void 0, u);
|
|
1490
1830
|
});
|
|
1491
1831
|
}
|
|
1492
|
-
function
|
|
1832
|
+
function g() {
|
|
1493
1833
|
f.forEach((e) => {
|
|
1494
1834
|
e.status === "pending" && (e.status = "aborted");
|
|
1495
1835
|
}), f = [];
|
|
1496
1836
|
}
|
|
1497
|
-
function
|
|
1837
|
+
function _(t, n, r) {
|
|
1498
1838
|
let i = n !== "success";
|
|
1499
1839
|
switch (f = f.filter((e) => e !== t), c) {
|
|
1500
1840
|
case "pending": break;
|
|
@@ -1504,14 +1844,14 @@ function wt(e, t, n, r) {
|
|
|
1504
1844
|
default: return;
|
|
1505
1845
|
}
|
|
1506
1846
|
if (n === "abort") {
|
|
1507
|
-
u = r,
|
|
1847
|
+
u = r, h();
|
|
1508
1848
|
return;
|
|
1509
1849
|
}
|
|
1510
1850
|
if (i) {
|
|
1511
|
-
u = r, f.length || (o.length ? v() :
|
|
1851
|
+
u = r, f.length || (o.length ? v() : h());
|
|
1512
1852
|
return;
|
|
1513
1853
|
}
|
|
1514
|
-
if (m(),
|
|
1854
|
+
if (m(), g(), !e.random) {
|
|
1515
1855
|
let n = e.resources.indexOf(t.resource);
|
|
1516
1856
|
n !== -1 && n !== e.index && (e.index = n);
|
|
1517
1857
|
}
|
|
@@ -1526,34 +1866,34 @@ function wt(e, t, n, r) {
|
|
|
1526
1866
|
if (r === void 0) {
|
|
1527
1867
|
if (f.length) {
|
|
1528
1868
|
d = setTimeout(() => {
|
|
1529
|
-
m(), c === "pending" && (
|
|
1869
|
+
m(), c === "pending" && (g(), h());
|
|
1530
1870
|
}, e.timeout);
|
|
1531
1871
|
return;
|
|
1532
1872
|
}
|
|
1533
|
-
|
|
1873
|
+
h();
|
|
1534
1874
|
return;
|
|
1535
1875
|
}
|
|
1536
1876
|
let i = {
|
|
1537
1877
|
status: "pending",
|
|
1538
1878
|
resource: r,
|
|
1539
1879
|
callback: (e, t) => {
|
|
1540
|
-
|
|
1880
|
+
_(i, e, t);
|
|
1541
1881
|
}
|
|
1542
1882
|
};
|
|
1543
1883
|
f.push(i), l++, d = setTimeout(v, e.rotate), n(r, t, i.callback);
|
|
1544
1884
|
}
|
|
1545
|
-
return setTimeout(v),
|
|
1885
|
+
return setTimeout(v), ne;
|
|
1546
1886
|
}
|
|
1547
|
-
function
|
|
1887
|
+
function nn(e) {
|
|
1548
1888
|
let t = {
|
|
1549
|
-
...
|
|
1889
|
+
...en,
|
|
1550
1890
|
...e
|
|
1551
1891
|
}, n = [];
|
|
1552
1892
|
function r() {
|
|
1553
1893
|
n = n.filter((e) => e().status === "pending");
|
|
1554
1894
|
}
|
|
1555
1895
|
function i(e, i, a) {
|
|
1556
|
-
let o =
|
|
1896
|
+
let o = tn(t, e, i, (e, t) => {
|
|
1557
1897
|
r(), a && a(e, t);
|
|
1558
1898
|
});
|
|
1559
1899
|
return n.push(o), o;
|
|
@@ -1571,53 +1911,53 @@ function Tt(e) {
|
|
|
1571
1911
|
cleanup: r
|
|
1572
1912
|
};
|
|
1573
1913
|
}
|
|
1574
|
-
function
|
|
1575
|
-
var
|
|
1576
|
-
function
|
|
1577
|
-
if (!
|
|
1578
|
-
let t =
|
|
1914
|
+
function rn() {}
|
|
1915
|
+
var an = Object.create(null);
|
|
1916
|
+
function on(e) {
|
|
1917
|
+
if (!an[e]) {
|
|
1918
|
+
let t = q(e);
|
|
1579
1919
|
if (!t) return;
|
|
1580
|
-
|
|
1920
|
+
an[e] = {
|
|
1581
1921
|
config: t,
|
|
1582
|
-
redundancy:
|
|
1922
|
+
redundancy: nn(t)
|
|
1583
1923
|
};
|
|
1584
1924
|
}
|
|
1585
|
-
return
|
|
1925
|
+
return an[e];
|
|
1586
1926
|
}
|
|
1587
|
-
function
|
|
1927
|
+
function sn(e, t, n) {
|
|
1588
1928
|
let r, i;
|
|
1589
1929
|
if (typeof e == "string") {
|
|
1590
|
-
let t =
|
|
1591
|
-
if (!t) return n(void 0, 424),
|
|
1930
|
+
let t = H(e);
|
|
1931
|
+
if (!t) return n(void 0, 424), rn;
|
|
1592
1932
|
i = t.send;
|
|
1593
|
-
let a =
|
|
1933
|
+
let a = on(e);
|
|
1594
1934
|
a && (r = a.redundancy);
|
|
1595
1935
|
} else {
|
|
1596
|
-
let t =
|
|
1936
|
+
let t = U(e);
|
|
1597
1937
|
if (t) {
|
|
1598
|
-
r =
|
|
1599
|
-
let n =
|
|
1938
|
+
r = nn(t);
|
|
1939
|
+
let n = H(e.resources ? e.resources[0] : "");
|
|
1600
1940
|
n && (i = n.send);
|
|
1601
1941
|
}
|
|
1602
1942
|
}
|
|
1603
|
-
return !r || !i ? (n(void 0, 424),
|
|
1943
|
+
return !r || !i ? (n(void 0, 424), rn) : r.query(t, i, n)().abort;
|
|
1604
1944
|
}
|
|
1605
|
-
function
|
|
1606
|
-
function
|
|
1945
|
+
function cn() {}
|
|
1946
|
+
function ln(e) {
|
|
1607
1947
|
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
|
1608
|
-
e.iconsLoaderFlag = !1,
|
|
1948
|
+
e.iconsLoaderFlag = !1, Kt(e);
|
|
1609
1949
|
}));
|
|
1610
1950
|
}
|
|
1611
|
-
function
|
|
1951
|
+
function un(e) {
|
|
1612
1952
|
let t = [], n = [];
|
|
1613
1953
|
return e.forEach((e) => {
|
|
1614
|
-
(e.match(
|
|
1954
|
+
(e.match(Dt) ? t : n).push(e);
|
|
1615
1955
|
}), {
|
|
1616
1956
|
valid: t,
|
|
1617
1957
|
invalid: n
|
|
1618
1958
|
};
|
|
1619
1959
|
}
|
|
1620
|
-
function
|
|
1960
|
+
function J(e, t, n) {
|
|
1621
1961
|
function r() {
|
|
1622
1962
|
let n = e.pendingIcons;
|
|
1623
1963
|
t.forEach((t) => {
|
|
@@ -1625,38 +1965,38 @@ function K(e, t, n) {
|
|
|
1625
1965
|
});
|
|
1626
1966
|
}
|
|
1627
1967
|
if (n && typeof n == "object") try {
|
|
1628
|
-
if (!
|
|
1968
|
+
if (!Lt(e, n).length) {
|
|
1629
1969
|
r();
|
|
1630
1970
|
return;
|
|
1631
1971
|
}
|
|
1632
1972
|
} catch (e) {
|
|
1633
1973
|
console.error(e);
|
|
1634
1974
|
}
|
|
1635
|
-
r(),
|
|
1975
|
+
r(), ln(e);
|
|
1636
1976
|
}
|
|
1637
|
-
function
|
|
1977
|
+
function dn(e, t) {
|
|
1638
1978
|
e instanceof Promise ? e.then((e) => {
|
|
1639
1979
|
t(e);
|
|
1640
1980
|
}).catch(() => {
|
|
1641
1981
|
t(null);
|
|
1642
1982
|
}) : t(e);
|
|
1643
1983
|
}
|
|
1644
|
-
function
|
|
1984
|
+
function fn(e, t) {
|
|
1645
1985
|
e.iconsToLoad = e.iconsToLoad ? e.iconsToLoad.concat(t).sort() : t, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
|
|
1646
1986
|
e.iconsQueueFlag = !1;
|
|
1647
1987
|
let { provider: t, prefix: n } = e, r = e.iconsToLoad;
|
|
1648
1988
|
if (delete e.iconsToLoad, !r || !r.length) return;
|
|
1649
1989
|
let i = e.loadIcon;
|
|
1650
1990
|
if (e.loadIcons && (r.length > 1 || !i)) {
|
|
1651
|
-
|
|
1652
|
-
|
|
1991
|
+
dn(e.loadIcons(r, n, t), (t) => {
|
|
1992
|
+
J(e, r, t);
|
|
1653
1993
|
});
|
|
1654
1994
|
return;
|
|
1655
1995
|
}
|
|
1656
1996
|
if (i) {
|
|
1657
1997
|
r.forEach((r) => {
|
|
1658
|
-
|
|
1659
|
-
|
|
1998
|
+
dn(i(r, n, t), (t) => {
|
|
1999
|
+
J(e, [r], t ? {
|
|
1660
2000
|
prefix: n,
|
|
1661
2001
|
icons: { [r]: t }
|
|
1662
2002
|
} : null);
|
|
@@ -1664,26 +2004,26 @@ function Nt(e, t) {
|
|
|
1664
2004
|
});
|
|
1665
2005
|
return;
|
|
1666
2006
|
}
|
|
1667
|
-
let { valid: a, invalid: o } =
|
|
1668
|
-
if (o.length &&
|
|
1669
|
-
let s = n.match(
|
|
2007
|
+
let { valid: a, invalid: o } = un(r);
|
|
2008
|
+
if (o.length && J(e, o, null), !a.length) return;
|
|
2009
|
+
let s = n.match(Dt) ? H(t) : null;
|
|
1670
2010
|
if (!s) {
|
|
1671
|
-
|
|
2011
|
+
J(e, a, null);
|
|
1672
2012
|
return;
|
|
1673
2013
|
}
|
|
1674
2014
|
s.prepare(t, n, a).forEach((n) => {
|
|
1675
|
-
|
|
1676
|
-
|
|
2015
|
+
sn(t, n, (t) => {
|
|
2016
|
+
J(e, n.icons, t);
|
|
1677
2017
|
});
|
|
1678
2018
|
});
|
|
1679
2019
|
}));
|
|
1680
2020
|
}
|
|
1681
|
-
var
|
|
1682
|
-
let n =
|
|
2021
|
+
var pn = (e, t) => {
|
|
2022
|
+
let n = Yt(Zt(e, !0, Bt()));
|
|
1683
2023
|
if (!n.pending.length) {
|
|
1684
2024
|
let e = !0;
|
|
1685
2025
|
return t && setTimeout(() => {
|
|
1686
|
-
e && t(n.loaded, n.missing, n.pending,
|
|
2026
|
+
e && t(n.loaded, n.missing, n.pending, cn);
|
|
1687
2027
|
}), () => {
|
|
1688
2028
|
e = !1;
|
|
1689
2029
|
};
|
|
@@ -1692,28 +2032,28 @@ var q = (e, t) => {
|
|
|
1692
2032
|
return n.pending.forEach((e) => {
|
|
1693
2033
|
let { provider: t, prefix: n } = e;
|
|
1694
2034
|
if (n === o && t === a) return;
|
|
1695
|
-
a = t, o = n, i.push(
|
|
2035
|
+
a = t, o = n, i.push(R(t, n));
|
|
1696
2036
|
let s = r[t] || (r[t] = Object.create(null));
|
|
1697
2037
|
s[n] || (s[n] = []);
|
|
1698
2038
|
}), n.pending.forEach((e) => {
|
|
1699
|
-
let { provider: t, prefix: n, name: i } = e, a =
|
|
2039
|
+
let { provider: t, prefix: n, name: i } = e, a = R(t, n), o = a.pendingIcons ||= /* @__PURE__ */ new Set();
|
|
1700
2040
|
o.has(i) || (o.add(i), r[t][n].push(i));
|
|
1701
2041
|
}), i.forEach((e) => {
|
|
1702
2042
|
let t = r[e.provider][e.prefix];
|
|
1703
|
-
t.length &&
|
|
1704
|
-
}), t ?
|
|
1705
|
-
},
|
|
1706
|
-
let r = typeof e == "string" ?
|
|
2043
|
+
t.length && fn(e, t);
|
|
2044
|
+
}), t ? Jt(t, n, i) : cn;
|
|
2045
|
+
}, mn = (e) => new Promise((t, n) => {
|
|
2046
|
+
let r = typeof e == "string" ? F(e, !0) : e;
|
|
1707
2047
|
if (!r) {
|
|
1708
2048
|
n(e);
|
|
1709
2049
|
return;
|
|
1710
2050
|
}
|
|
1711
|
-
|
|
2051
|
+
pn([r || e], (i) => {
|
|
1712
2052
|
if (i.length && r) {
|
|
1713
|
-
let e =
|
|
2053
|
+
let e = B(r);
|
|
1714
2054
|
if (e) {
|
|
1715
2055
|
t({
|
|
1716
|
-
...
|
|
2056
|
+
...N,
|
|
1717
2057
|
...e
|
|
1718
2058
|
});
|
|
1719
2059
|
return;
|
|
@@ -1722,28 +2062,28 @@ var q = (e, t) => {
|
|
|
1722
2062
|
n(e);
|
|
1723
2063
|
});
|
|
1724
2064
|
});
|
|
1725
|
-
function
|
|
2065
|
+
function hn(e) {
|
|
1726
2066
|
try {
|
|
1727
2067
|
let t = typeof e == "string" ? JSON.parse(e) : e;
|
|
1728
2068
|
if (typeof t.body == "string") return { ...t };
|
|
1729
2069
|
} catch {}
|
|
1730
2070
|
}
|
|
1731
|
-
function
|
|
2071
|
+
function gn(e, t) {
|
|
1732
2072
|
if (typeof e == "object") return {
|
|
1733
|
-
data:
|
|
2073
|
+
data: hn(e),
|
|
1734
2074
|
value: e
|
|
1735
2075
|
};
|
|
1736
2076
|
if (typeof e != "string") return { value: e };
|
|
1737
2077
|
if (e.includes("{")) {
|
|
1738
|
-
let t =
|
|
2078
|
+
let t = hn(e);
|
|
1739
2079
|
if (t) return {
|
|
1740
2080
|
data: t,
|
|
1741
2081
|
value: e
|
|
1742
2082
|
};
|
|
1743
2083
|
}
|
|
1744
|
-
let n =
|
|
2084
|
+
let n = F(e, !0, !0);
|
|
1745
2085
|
if (!n) return { value: e };
|
|
1746
|
-
let r =
|
|
2086
|
+
let r = B(n);
|
|
1747
2087
|
return r !== void 0 || !n.prefix ? {
|
|
1748
2088
|
value: e,
|
|
1749
2089
|
name: n,
|
|
@@ -1751,29 +2091,29 @@ function It(e, t) {
|
|
|
1751
2091
|
} : {
|
|
1752
2092
|
value: e,
|
|
1753
2093
|
name: n,
|
|
1754
|
-
loading:
|
|
2094
|
+
loading: pn([n], () => t(e, n, B(n)))
|
|
1755
2095
|
};
|
|
1756
2096
|
}
|
|
1757
|
-
var
|
|
2097
|
+
var _n = !1;
|
|
1758
2098
|
try {
|
|
1759
|
-
|
|
2099
|
+
_n = navigator.vendor.indexOf("Apple") === 0;
|
|
1760
2100
|
} catch {}
|
|
1761
|
-
function
|
|
2101
|
+
function vn(e, t) {
|
|
1762
2102
|
switch (t) {
|
|
1763
2103
|
case "svg":
|
|
1764
2104
|
case "bg":
|
|
1765
2105
|
case "mask": return t;
|
|
1766
2106
|
}
|
|
1767
|
-
return t !== "style" && (
|
|
2107
|
+
return t !== "style" && (_n || e.indexOf("<a") === -1) ? "svg" : e.indexOf("currentColor") === -1 ? "bg" : "mask";
|
|
1768
2108
|
}
|
|
1769
|
-
var
|
|
1770
|
-
function
|
|
2109
|
+
var yn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, bn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
2110
|
+
function xn(e, t, n) {
|
|
1771
2111
|
if (t === 1) return e;
|
|
1772
2112
|
if (n ||= 100, typeof e == "number") return Math.ceil(e * t * n) / n;
|
|
1773
2113
|
if (typeof e != "string") return e;
|
|
1774
|
-
let r = e.split(
|
|
2114
|
+
let r = e.split(yn);
|
|
1775
2115
|
if (r === null || !r.length) return e;
|
|
1776
|
-
let i = [], a = r.shift(), o =
|
|
2116
|
+
let i = [], a = r.shift(), o = bn.test(a);
|
|
1777
2117
|
for (;;) {
|
|
1778
2118
|
if (o) {
|
|
1779
2119
|
let e = parseFloat(a);
|
|
@@ -1783,7 +2123,7 @@ function J(e, t, n) {
|
|
|
1783
2123
|
o = !o;
|
|
1784
2124
|
}
|
|
1785
2125
|
}
|
|
1786
|
-
function
|
|
2126
|
+
function Sn(e, t = "defs") {
|
|
1787
2127
|
let n = "", r = e.indexOf("<" + t);
|
|
1788
2128
|
for (; r >= 0;) {
|
|
1789
2129
|
let i = e.indexOf(">", r), a = e.indexOf("</" + t);
|
|
@@ -1797,20 +2137,20 @@ function Vt(e, t = "defs") {
|
|
|
1797
2137
|
content: e
|
|
1798
2138
|
};
|
|
1799
2139
|
}
|
|
1800
|
-
function
|
|
2140
|
+
function Cn(e, t) {
|
|
1801
2141
|
return e ? "<defs>" + e + "</defs>" + t : t;
|
|
1802
2142
|
}
|
|
1803
|
-
function
|
|
1804
|
-
let r =
|
|
1805
|
-
return
|
|
2143
|
+
function wn(e, t, n) {
|
|
2144
|
+
let r = Sn(e);
|
|
2145
|
+
return Cn(r.defs, t + r.content + n);
|
|
1806
2146
|
}
|
|
1807
|
-
var
|
|
1808
|
-
function
|
|
2147
|
+
var Tn = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
2148
|
+
function En(e, t) {
|
|
1809
2149
|
let n = {
|
|
1810
|
-
...
|
|
2150
|
+
...N,
|
|
1811
2151
|
...e
|
|
1812
2152
|
}, r = {
|
|
1813
|
-
...
|
|
2153
|
+
...bt,
|
|
1814
2154
|
...t
|
|
1815
2155
|
}, i = {
|
|
1816
2156
|
left: n.left,
|
|
@@ -1831,12 +2171,12 @@ function Gt(e, t) {
|
|
|
1831
2171
|
break;
|
|
1832
2172
|
case 3: s = i.width / 2 + i.left, t.unshift("rotate(-90 " + s.toString() + " " + s.toString() + ")");
|
|
1833
2173
|
}
|
|
1834
|
-
o % 2 == 1 && (i.left !== i.top && (s = i.left, i.left = i.top, i.top = s), i.width !== i.height && (s = i.width, i.width = i.height, i.height = s)), t.length && (a =
|
|
2174
|
+
o % 2 == 1 && (i.left !== i.top && (s = i.left, i.left = i.top, i.top = s), i.width !== i.height && (s = i.width, i.width = i.height, i.height = s)), t.length && (a = wn(a, "<g transform=\"" + t.join(" ") + "\">", "</g>"));
|
|
1835
2175
|
});
|
|
1836
2176
|
let o = r.width, s = r.height, c = i.width, l = i.height, u, d;
|
|
1837
|
-
o === null ? (d = s === null ? "1em" : s === "auto" ? l : s, u =
|
|
2177
|
+
o === null ? (d = s === null ? "1em" : s === "auto" ? l : s, u = xn(d, c / l)) : (u = o === "auto" ? c : o, d = s === null ? xn(u, l / c) : s === "auto" ? l : s);
|
|
1838
2178
|
let f = {}, p = (e, t) => {
|
|
1839
|
-
|
|
2179
|
+
Tn(t) || (f[e] = t.toString());
|
|
1840
2180
|
};
|
|
1841
2181
|
p("width", u), p("height", d);
|
|
1842
2182
|
let m = [
|
|
@@ -1851,19 +2191,19 @@ function Gt(e, t) {
|
|
|
1851
2191
|
body: a
|
|
1852
2192
|
};
|
|
1853
2193
|
}
|
|
1854
|
-
function
|
|
2194
|
+
function Dn(e, t) {
|
|
1855
2195
|
let n = e.indexOf("xlink:") === -1 ? "" : " xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
|
|
1856
2196
|
for (let e in t) n += " " + e + "=\"" + t[e] + "\"";
|
|
1857
2197
|
return "<svg xmlns=\"http://www.w3.org/2000/svg\"" + n + ">" + e + "</svg>";
|
|
1858
2198
|
}
|
|
1859
|
-
function
|
|
2199
|
+
function On(e) {
|
|
1860
2200
|
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ").replace(/:/g, "%3A").replace(/\//g, "%2F");
|
|
1861
2201
|
}
|
|
1862
|
-
function
|
|
1863
|
-
return "data:image/svg+xml," +
|
|
2202
|
+
function kn(e) {
|
|
2203
|
+
return "data:image/svg+xml," + On(e);
|
|
1864
2204
|
}
|
|
1865
|
-
function
|
|
1866
|
-
return "url(\"" +
|
|
2205
|
+
function An(e) {
|
|
2206
|
+
return "url(\"" + kn(e) + "\")";
|
|
1867
2207
|
}
|
|
1868
2208
|
var Y = (() => {
|
|
1869
2209
|
let e;
|
|
@@ -1871,14 +2211,14 @@ var Y = (() => {
|
|
|
1871
2211
|
if (e = fetch, typeof e == "function") return e;
|
|
1872
2212
|
} catch {}
|
|
1873
2213
|
})();
|
|
1874
|
-
function
|
|
2214
|
+
function jn(e) {
|
|
1875
2215
|
Y = e;
|
|
1876
2216
|
}
|
|
1877
|
-
function
|
|
2217
|
+
function Mn() {
|
|
1878
2218
|
return Y;
|
|
1879
2219
|
}
|
|
1880
|
-
function
|
|
1881
|
-
let n =
|
|
2220
|
+
function Nn(e, t) {
|
|
2221
|
+
let n = q(e);
|
|
1882
2222
|
if (!n) return 0;
|
|
1883
2223
|
let r;
|
|
1884
2224
|
if (!n.maxURL) r = 0;
|
|
@@ -1892,11 +2232,11 @@ function Qt(e, t) {
|
|
|
1892
2232
|
}
|
|
1893
2233
|
return r;
|
|
1894
2234
|
}
|
|
1895
|
-
function
|
|
2235
|
+
function Pn(e) {
|
|
1896
2236
|
return e === 404;
|
|
1897
2237
|
}
|
|
1898
|
-
var
|
|
1899
|
-
let r = [], i =
|
|
2238
|
+
var Fn = (e, t, n) => {
|
|
2239
|
+
let r = [], i = Nn(e, t), a = "icons", o = {
|
|
1900
2240
|
type: a,
|
|
1901
2241
|
provider: e,
|
|
1902
2242
|
prefix: t,
|
|
@@ -1911,21 +2251,21 @@ var en = (e, t, n) => {
|
|
|
1911
2251
|
}, s = n.length), o.icons.push(n);
|
|
1912
2252
|
}), r.push(o), r;
|
|
1913
2253
|
};
|
|
1914
|
-
function
|
|
2254
|
+
function In(e) {
|
|
1915
2255
|
if (typeof e == "string") {
|
|
1916
|
-
let t =
|
|
2256
|
+
let t = q(e);
|
|
1917
2257
|
if (t) return t.path;
|
|
1918
2258
|
}
|
|
1919
2259
|
return "/";
|
|
1920
2260
|
}
|
|
1921
|
-
var
|
|
1922
|
-
prepare:
|
|
2261
|
+
var Ln = {
|
|
2262
|
+
prepare: Fn,
|
|
1923
2263
|
send: (e, t, n) => {
|
|
1924
2264
|
if (!Y) {
|
|
1925
2265
|
n("abort", 424);
|
|
1926
2266
|
return;
|
|
1927
2267
|
}
|
|
1928
|
-
let r =
|
|
2268
|
+
let r = In(t.provider);
|
|
1929
2269
|
switch (t.type) {
|
|
1930
2270
|
case "icons": {
|
|
1931
2271
|
let e = t.prefix, n = t.icons.join(","), i = new URLSearchParams({ icons: n });
|
|
@@ -1946,7 +2286,7 @@ var nn = {
|
|
|
1946
2286
|
let t = e.status;
|
|
1947
2287
|
if (t !== 200) {
|
|
1948
2288
|
setTimeout(() => {
|
|
1949
|
-
n(
|
|
2289
|
+
n(Pn(t) ? "abort" : "next", t);
|
|
1950
2290
|
});
|
|
1951
2291
|
return;
|
|
1952
2292
|
}
|
|
@@ -1966,38 +2306,38 @@ var nn = {
|
|
|
1966
2306
|
});
|
|
1967
2307
|
}
|
|
1968
2308
|
};
|
|
1969
|
-
function
|
|
1970
|
-
|
|
2309
|
+
function Rn(e, t, n) {
|
|
2310
|
+
R(n || "", t).loadIcons = e;
|
|
1971
2311
|
}
|
|
1972
|
-
function
|
|
1973
|
-
|
|
2312
|
+
function zn(e, t, n) {
|
|
2313
|
+
R(n || "", t).loadIcon = e;
|
|
1974
2314
|
}
|
|
1975
|
-
var
|
|
2315
|
+
var Bn = "data-style", Vn = "", X = {};
|
|
1976
2316
|
function Z(e) {
|
|
1977
|
-
return ":host{display:inline-block;vertical-align:" + (e ? "-0.125em" : "0") + "}span,svg{display:block;margin:auto}" +
|
|
2317
|
+
return ":host{display:inline-block;vertical-align:" + (e ? "-0.125em" : "0") + "}span,svg{display:block;margin:auto}" + Vn;
|
|
1978
2318
|
}
|
|
1979
|
-
function
|
|
2319
|
+
function Hn(e) {
|
|
1980
2320
|
return "adoptedStyleSheets" in e && typeof CSSStyleSheet == "function" && typeof CSSStyleSheet.prototype.replaceSync == "function";
|
|
1981
2321
|
}
|
|
1982
|
-
function
|
|
2322
|
+
function Un(e) {
|
|
1983
2323
|
let t = e ? "inline" : "block", n = X[t];
|
|
1984
2324
|
return n || (n = X[t] = new CSSStyleSheet(), n.replaceSync(Z(e))), n;
|
|
1985
2325
|
}
|
|
1986
|
-
function
|
|
1987
|
-
|
|
2326
|
+
function Wn(e) {
|
|
2327
|
+
Vn = e, X.inline?.replaceSync(Z(!0)), X.block?.replaceSync(Z(!1));
|
|
1988
2328
|
}
|
|
1989
|
-
function
|
|
1990
|
-
if (
|
|
1991
|
-
let n =
|
|
2329
|
+
function Gn(e, t) {
|
|
2330
|
+
if (Hn(e)) {
|
|
2331
|
+
let n = Un(t), r = e.adoptedStyleSheets;
|
|
1992
2332
|
if (r.includes(n)) return;
|
|
1993
2333
|
e.adoptedStyleSheets = r.filter((e) => e !== X.inline && e !== X.block).concat(n);
|
|
1994
2334
|
return;
|
|
1995
2335
|
}
|
|
1996
|
-
let n = Array.from(e.childNodes).find((e) => e.hasAttribute && e.hasAttribute(
|
|
1997
|
-
n || (n = document.createElement("style"), n.setAttribute(
|
|
2336
|
+
let n = Array.from(e.childNodes).find((e) => e.hasAttribute && e.hasAttribute(Bn));
|
|
2337
|
+
n || (n = document.createElement("style"), n.setAttribute(Bn, Bn), e.appendChild(n)), n.textContent = Z(t);
|
|
1998
2338
|
}
|
|
1999
|
-
function
|
|
2000
|
-
|
|
2339
|
+
function Kn() {
|
|
2340
|
+
Xt("", Ln), Bt(!0);
|
|
2001
2341
|
let e;
|
|
2002
2342
|
try {
|
|
2003
2343
|
e = window;
|
|
@@ -2007,7 +2347,7 @@ function fn() {
|
|
|
2007
2347
|
let t = e.IconifyPreload, n = "Invalid IconifyPreload syntax.";
|
|
2008
2348
|
typeof t == "object" && t && (t instanceof Array ? t : [t]).forEach((e) => {
|
|
2009
2349
|
try {
|
|
2010
|
-
(typeof e != "object" || !e || e instanceof Array || typeof e.icons != "object" || typeof e.prefix != "string" || !
|
|
2350
|
+
(typeof e != "object" || !e || e instanceof Array || typeof e.icons != "object" || typeof e.prefix != "string" || !Ht(e)) && console.error(n);
|
|
2011
2351
|
} catch {
|
|
2012
2352
|
console.error(n);
|
|
2013
2353
|
}
|
|
@@ -2020,7 +2360,7 @@ function fn() {
|
|
|
2020
2360
|
try {
|
|
2021
2361
|
let r = t[e];
|
|
2022
2362
|
if (typeof r != "object" || !r || r.resources === void 0) continue;
|
|
2023
|
-
|
|
2363
|
+
Qt(e, r) || console.error(n);
|
|
2024
2364
|
} catch {
|
|
2025
2365
|
console.error(n);
|
|
2026
2366
|
}
|
|
@@ -2028,101 +2368,101 @@ function fn() {
|
|
|
2028
2368
|
}
|
|
2029
2369
|
}
|
|
2030
2370
|
return {
|
|
2031
|
-
iconLoaded:
|
|
2032
|
-
getIcon:
|
|
2033
|
-
listIcons:
|
|
2034
|
-
addIcon:
|
|
2035
|
-
addCollection:
|
|
2036
|
-
calculateSize:
|
|
2037
|
-
buildIcon:
|
|
2038
|
-
iconToHTML:
|
|
2039
|
-
svgToURL:
|
|
2040
|
-
loadIcons:
|
|
2041
|
-
loadIcon:
|
|
2042
|
-
addAPIProvider:
|
|
2043
|
-
setCustomIconLoader:
|
|
2044
|
-
setCustomIconsLoader:
|
|
2045
|
-
appendCustomStyle:
|
|
2371
|
+
iconLoaded: Ut,
|
|
2372
|
+
getIcon: Wt,
|
|
2373
|
+
listIcons: zt,
|
|
2374
|
+
addIcon: Vt,
|
|
2375
|
+
addCollection: Ht,
|
|
2376
|
+
calculateSize: xn,
|
|
2377
|
+
buildIcon: En,
|
|
2378
|
+
iconToHTML: Dn,
|
|
2379
|
+
svgToURL: An,
|
|
2380
|
+
loadIcons: pn,
|
|
2381
|
+
loadIcon: mn,
|
|
2382
|
+
addAPIProvider: Qt,
|
|
2383
|
+
setCustomIconLoader: zn,
|
|
2384
|
+
setCustomIconsLoader: Rn,
|
|
2385
|
+
appendCustomStyle: Wn,
|
|
2046
2386
|
_api: {
|
|
2047
|
-
getAPIConfig:
|
|
2048
|
-
setAPIModule:
|
|
2049
|
-
sendAPIQuery:
|
|
2050
|
-
setFetch:
|
|
2051
|
-
getFetch:
|
|
2052
|
-
listAPIProviders:
|
|
2387
|
+
getAPIConfig: q,
|
|
2388
|
+
setAPIModule: Xt,
|
|
2389
|
+
sendAPIQuery: sn,
|
|
2390
|
+
setFetch: jn,
|
|
2391
|
+
getFetch: Mn,
|
|
2392
|
+
listAPIProviders: $t
|
|
2053
2393
|
}
|
|
2054
2394
|
};
|
|
2055
2395
|
}
|
|
2056
|
-
var
|
|
2396
|
+
var qn = { "background-color": "currentColor" }, Jn = { "background-color": "transparent" }, Yn = {
|
|
2057
2397
|
image: "var(--svg)",
|
|
2058
2398
|
repeat: "no-repeat",
|
|
2059
2399
|
size: "100% 100%"
|
|
2060
|
-
},
|
|
2061
|
-
"-webkit-mask":
|
|
2062
|
-
mask:
|
|
2063
|
-
background:
|
|
2400
|
+
}, Xn = {
|
|
2401
|
+
"-webkit-mask": qn,
|
|
2402
|
+
mask: qn,
|
|
2403
|
+
background: Jn
|
|
2064
2404
|
};
|
|
2065
|
-
for (let e in
|
|
2066
|
-
let t =
|
|
2067
|
-
for (let n in
|
|
2405
|
+
for (let e in Xn) {
|
|
2406
|
+
let t = Xn[e];
|
|
2407
|
+
for (let n in Yn) t[e + "-" + n] = Yn[n];
|
|
2068
2408
|
}
|
|
2069
|
-
function
|
|
2409
|
+
function Zn(e) {
|
|
2070
2410
|
return e ? e + (e.match(/^[-0-9.]+$/) ? "px" : "") : "inherit";
|
|
2071
2411
|
}
|
|
2072
|
-
function
|
|
2412
|
+
function Qn(e, t, n) {
|
|
2073
2413
|
let r = document.createElement("span"), i = e.body;
|
|
2074
2414
|
i.indexOf("<a") !== -1 && (i += "<!-- " + Date.now() + " -->");
|
|
2075
|
-
let a = e.attributes, o =
|
|
2415
|
+
let a = e.attributes, o = An(Dn(i, {
|
|
2076
2416
|
...a,
|
|
2077
2417
|
width: t.width + "",
|
|
2078
2418
|
height: t.height + ""
|
|
2079
2419
|
})), s = r.style, c = {
|
|
2080
2420
|
"--svg": o,
|
|
2081
|
-
width:
|
|
2082
|
-
height:
|
|
2083
|
-
...n ?
|
|
2421
|
+
width: Zn(a.width),
|
|
2422
|
+
height: Zn(a.height),
|
|
2423
|
+
...n ? qn : Jn
|
|
2084
2424
|
};
|
|
2085
2425
|
for (let e in c) s.setProperty(e, c[e]);
|
|
2086
2426
|
return r;
|
|
2087
2427
|
}
|
|
2088
2428
|
var Q;
|
|
2089
|
-
function
|
|
2429
|
+
function $n() {
|
|
2090
2430
|
try {
|
|
2091
2431
|
Q = window.trustedTypes.createPolicy("iconify", { createHTML: (e) => e });
|
|
2092
2432
|
} catch {
|
|
2093
2433
|
Q = null;
|
|
2094
2434
|
}
|
|
2095
2435
|
}
|
|
2096
|
-
function
|
|
2097
|
-
return Q === void 0 &&
|
|
2436
|
+
function er(e) {
|
|
2437
|
+
return Q === void 0 && $n(), Q ? Q.createHTML(e) : e;
|
|
2098
2438
|
}
|
|
2099
|
-
function
|
|
2439
|
+
function tr(e) {
|
|
2100
2440
|
let t = document.createElement("span"), n = e.attributes, r = "";
|
|
2101
|
-
return n.width || (r = "width: inherit;"), n.height || (r += "height: inherit;"), r && (n.style = r), t.innerHTML =
|
|
2441
|
+
return n.width || (r = "width: inherit;"), n.height || (r += "height: inherit;"), r && (n.style = r), t.innerHTML = er(Dn(e.body, n)), t.firstChild;
|
|
2102
2442
|
}
|
|
2103
|
-
function
|
|
2443
|
+
function nr(e) {
|
|
2104
2444
|
return Array.from(e.childNodes).find((e) => {
|
|
2105
2445
|
let t = e.tagName && e.tagName.toUpperCase();
|
|
2106
2446
|
return t === "SPAN" || t === "SVG";
|
|
2107
2447
|
});
|
|
2108
2448
|
}
|
|
2109
|
-
function
|
|
2110
|
-
let n = t.icon.data, r = t.customisations, i =
|
|
2449
|
+
function rr(e, t) {
|
|
2450
|
+
let n = t.icon.data, r = t.customisations, i = En(n, r);
|
|
2111
2451
|
r.preserveAspectRatio && (i.attributes.preserveAspectRatio = r.preserveAspectRatio);
|
|
2112
2452
|
let a = t.renderedMode, o;
|
|
2113
2453
|
switch (a) {
|
|
2114
2454
|
case "svg":
|
|
2115
|
-
o =
|
|
2455
|
+
o = tr(i);
|
|
2116
2456
|
break;
|
|
2117
|
-
default: o =
|
|
2118
|
-
...
|
|
2457
|
+
default: o = Qn(i, {
|
|
2458
|
+
...N,
|
|
2119
2459
|
...n
|
|
2120
2460
|
}, a === "mask");
|
|
2121
2461
|
}
|
|
2122
|
-
let s =
|
|
2462
|
+
let s = nr(e);
|
|
2123
2463
|
s ? o.tagName === "SPAN" && s.tagName === o.tagName ? s.setAttribute("style", o.getAttribute("style")) : e.replaceChild(o, s) : e.appendChild(o);
|
|
2124
2464
|
}
|
|
2125
|
-
function
|
|
2465
|
+
function ir(e, t, n) {
|
|
2126
2466
|
return {
|
|
2127
2467
|
rendered: !1,
|
|
2128
2468
|
inline: t,
|
|
@@ -2130,7 +2470,7 @@ function wn(e, t, n) {
|
|
|
2130
2470
|
lastRender: n && (n.rendered ? n : n.lastRender)
|
|
2131
2471
|
};
|
|
2132
2472
|
}
|
|
2133
|
-
function
|
|
2473
|
+
function ar(e = "iconify-icon") {
|
|
2134
2474
|
let t, n;
|
|
2135
2475
|
try {
|
|
2136
2476
|
t = window.customElements, n = window.HTMLElement;
|
|
@@ -2160,7 +2500,7 @@ function Tn(e = "iconify-icon") {
|
|
|
2160
2500
|
constructor() {
|
|
2161
2501
|
super();
|
|
2162
2502
|
let e = this._shadowRoot = this.attachShadow({ mode: "open" }), t = this.hasAttribute("inline");
|
|
2163
|
-
|
|
2503
|
+
Gn(e, t), this._state = ir({ value: "" }, t), this._queueCheck();
|
|
2164
2504
|
}
|
|
2165
2505
|
connectedCallback() {
|
|
2166
2506
|
this._connected = !0, this.startObserver();
|
|
@@ -2175,7 +2515,7 @@ function Tn(e = "iconify-icon") {
|
|
|
2175
2515
|
switch (e) {
|
|
2176
2516
|
case "inline": {
|
|
2177
2517
|
let e = this.hasAttribute("inline"), t = this._state;
|
|
2178
|
-
e !== t.inline && (t.inline = e,
|
|
2518
|
+
e !== t.inline && (t.inline = e, Gn(this._shadowRoot, e));
|
|
2179
2519
|
break;
|
|
2180
2520
|
}
|
|
2181
2521
|
case "noobserver":
|
|
@@ -2214,7 +2554,7 @@ function Tn(e = "iconify-icon") {
|
|
|
2214
2554
|
t.lastChild.setCurrentTime(0);
|
|
2215
2555
|
return;
|
|
2216
2556
|
} catch {}
|
|
2217
|
-
|
|
2557
|
+
rr(t, e);
|
|
2218
2558
|
}
|
|
2219
2559
|
}
|
|
2220
2560
|
get status() {
|
|
@@ -2235,11 +2575,11 @@ function Tn(e = "iconify-icon") {
|
|
|
2235
2575
|
return;
|
|
2236
2576
|
}
|
|
2237
2577
|
if (!e.rendered || !this._visible) return;
|
|
2238
|
-
let n = this.getAttribute("mode"), r =
|
|
2239
|
-
(e.attrMode !== n ||
|
|
2578
|
+
let n = this.getAttribute("mode"), r = Tt(this);
|
|
2579
|
+
(e.attrMode !== n || Et(e.customisations, r) || !nr(this._shadowRoot)) && this._renderIcon(e.icon, r, n);
|
|
2240
2580
|
}
|
|
2241
2581
|
_iconChanged(e) {
|
|
2242
|
-
let t =
|
|
2582
|
+
let t = gn(e, (e, t, n) => {
|
|
2243
2583
|
let r = this._state;
|
|
2244
2584
|
if (r.rendered || this.getAttribute("icon") !== e) return;
|
|
2245
2585
|
let i = {
|
|
@@ -2249,22 +2589,22 @@ function Tn(e = "iconify-icon") {
|
|
|
2249
2589
|
};
|
|
2250
2590
|
i.data ? this._gotIconData(i) : r.icon = i;
|
|
2251
2591
|
});
|
|
2252
|
-
t.data ? this._gotIconData(t) : this._state =
|
|
2592
|
+
t.data ? this._gotIconData(t) : this._state = ir(t, this._state.inline, this._state);
|
|
2253
2593
|
}
|
|
2254
2594
|
_forceRender() {
|
|
2255
2595
|
if (!this._visible) {
|
|
2256
|
-
let e =
|
|
2596
|
+
let e = nr(this._shadowRoot);
|
|
2257
2597
|
e && this._shadowRoot.removeChild(e);
|
|
2258
2598
|
return;
|
|
2259
2599
|
}
|
|
2260
2600
|
this._queueCheck();
|
|
2261
2601
|
}
|
|
2262
2602
|
_gotIconData(e) {
|
|
2263
|
-
this._checkQueued = !1, this._renderIcon(e,
|
|
2603
|
+
this._checkQueued = !1, this._renderIcon(e, Tt(this), this.getAttribute("mode"));
|
|
2264
2604
|
}
|
|
2265
2605
|
_renderIcon(e, t, n) {
|
|
2266
|
-
let r =
|
|
2267
|
-
|
|
2606
|
+
let r = vn(e.data.body, n), i = this._state.inline;
|
|
2607
|
+
rr(this._shadowRoot, this._state = {
|
|
2268
2608
|
rendered: !0,
|
|
2269
2609
|
icon: e,
|
|
2270
2610
|
inline: i,
|
|
@@ -2302,23 +2642,25 @@ function Tn(e = "iconify-icon") {
|
|
|
2302
2642
|
}
|
|
2303
2643
|
});
|
|
2304
2644
|
});
|
|
2305
|
-
let o =
|
|
2645
|
+
let o = Kn();
|
|
2306
2646
|
for (let e in o) a[e] = a.prototype[e] = o[e];
|
|
2307
2647
|
return t.define(e, a), a;
|
|
2308
2648
|
}
|
|
2309
|
-
var { iconLoaded:
|
|
2649
|
+
var { iconLoaded: or, getIcon: sr, listIcons: cr, addIcon: lr, addCollection: ur, calculateSize: dr, buildIcon: fr, iconToHTML: pr, svgToURL: mr, loadIcons: hr, loadIcon: gr, setCustomIconLoader: _r, setCustomIconsLoader: vr, addAPIProvider: yr, _api: br } = ar() || Kn(), $ = {
|
|
2310
2650
|
hero: "dfk-hero",
|
|
2311
2651
|
features: "dfk-features",
|
|
2312
2652
|
nextSteps: "dfk-next-steps",
|
|
2313
|
-
sql: "dfk-sql"
|
|
2653
|
+
sql: "dfk-sql",
|
|
2654
|
+
mermaid: "dfk-mermaid"
|
|
2314
2655
|
};
|
|
2315
|
-
function
|
|
2656
|
+
function xr() {
|
|
2316
2657
|
if (typeof customElements < "u") for (let [e, t] of Object.entries({
|
|
2317
|
-
[$.hero]:
|
|
2318
|
-
[$.features]:
|
|
2319
|
-
[$.nextSteps]:
|
|
2320
|
-
[$.sql]:
|
|
2658
|
+
[$.hero]: te,
|
|
2659
|
+
[$.features]: m,
|
|
2660
|
+
[$.nextSteps]: Ae,
|
|
2661
|
+
[$.sql]: ht,
|
|
2662
|
+
[$.mermaid]: De
|
|
2321
2663
|
})) customElements.get(e) || customElements.define(e, t);
|
|
2322
2664
|
}
|
|
2323
2665
|
//#endregion
|
|
2324
|
-
export {
|
|
2666
|
+
export { te as a, De as i, ht as n, m as o, Ae as r, xr as t };
|