@storyblok/astro 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -10
- package/dist/storyblok-astro.js +6 -6
- package/dist/storyblok-astro.mjs +547 -544
- package/package.json +6 -6
package/dist/storyblok-astro.mjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
function Or(o, r,
|
|
2
|
-
const
|
|
1
|
+
function Or(o, r, t) {
|
|
2
|
+
const s = "virtual:storyblok-init", i = "\0" + s;
|
|
3
3
|
return {
|
|
4
4
|
name: "vite-plugin-storyblok-init",
|
|
5
5
|
async resolveId(l) {
|
|
6
|
-
if (l ===
|
|
7
|
-
return
|
|
6
|
+
if (l === s)
|
|
7
|
+
return i;
|
|
8
8
|
},
|
|
9
9
|
async load(l) {
|
|
10
|
-
if (l ===
|
|
10
|
+
if (l === i)
|
|
11
11
|
return `
|
|
12
12
|
import { storyblokInit, apiPlugin } from "@storyblok/js";
|
|
13
13
|
const { storyblokApi } = storyblokInit({
|
|
14
14
|
accessToken: "${o}",
|
|
15
15
|
use: ${r ? "[]" : "[apiPlugin]"},
|
|
16
|
-
apiOptions: ${JSON.stringify(
|
|
16
|
+
apiOptions: ${JSON.stringify(t)},
|
|
17
17
|
});
|
|
18
18
|
export const storyblokApiInstance = storyblokApi;
|
|
19
19
|
`;
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
const Cr = /[\p{Lu}]/u, jr = /[\p{Ll}]/u,
|
|
24
|
-
let
|
|
25
|
-
for (let
|
|
26
|
-
const
|
|
27
|
-
f =
|
|
23
|
+
const Cr = /[\p{Lu}]/u, jr = /[\p{Ll}]/u, Ne = /^[\p{Lu}](?![\p{Lu}])/gu, Ge = /([\p{Alpha}\p{N}_]|$)/u, fe = /[_.\- ]+/, xr = new RegExp("^" + fe.source), ze = new RegExp(fe.source + Ge.source, "gu"), Le = new RegExp("\\d+" + Ge.source, "gu"), $r = (o, r, t, s) => {
|
|
24
|
+
let i = !1, l = !1, u = !1, f = !1;
|
|
25
|
+
for (let p = 0; p < o.length; p++) {
|
|
26
|
+
const y = o[p];
|
|
27
|
+
f = p > 2 ? o[p - 3] === "-" : !0, i && Cr.test(y) ? (o = o.slice(0, p) + "-" + o.slice(p), i = !1, u = l, l = !0, p++) : l && u && jr.test(y) && (!f || s) ? (o = o.slice(0, p - 1) + "-" + o.slice(p - 1), u = l, l = !1, i = !0) : (i = r(y) === y && t(y) !== y, u = l, l = t(y) === y && r(y) !== y);
|
|
28
28
|
}
|
|
29
29
|
return o;
|
|
30
|
-
}, Er = (o, r) => (
|
|
31
|
-
function
|
|
30
|
+
}, Er = (o, r) => (Ne.lastIndex = 0, o.replaceAll(Ne, (t) => r(t))), Rr = (o, r) => (ze.lastIndex = 0, Le.lastIndex = 0, o.replaceAll(Le, (t, s, i) => ["_", "-"].includes(o.charAt(i + t.length)) ? t : r(t)).replaceAll(ze, (t, s) => r(s)));
|
|
31
|
+
function De(o, r) {
|
|
32
32
|
if (!(typeof o == "string" || Array.isArray(o)))
|
|
33
33
|
throw new TypeError("Expected the input to be `string | string[]`");
|
|
34
34
|
if (r = {
|
|
@@ -37,42 +37,42 @@ function Ut(o, r) {
|
|
|
37
37
|
...r
|
|
38
38
|
}, Array.isArray(o) ? o = o.map((l) => l.trim()).filter((l) => l.length).join("-") : o = o.trim(), o.length === 0)
|
|
39
39
|
return "";
|
|
40
|
-
const
|
|
41
|
-
return o.length === 1 ?
|
|
40
|
+
const t = r.locale === !1 ? (l) => l.toLowerCase() : (l) => l.toLocaleLowerCase(r.locale), s = r.locale === !1 ? (l) => l.toUpperCase() : (l) => l.toLocaleUpperCase(r.locale);
|
|
41
|
+
return o.length === 1 ? fe.test(o) ? "" : r.pascalCase ? s(o) : t(o) : (o !== t(o) && (o = $r(o, t, s, r.preserveConsecutiveUppercase)), o = o.replace(xr, ""), o = r.preserveConsecutiveUppercase ? Er(o, t) : t(o), r.pascalCase && (o = s(o.charAt(0)) + o.slice(1)), Rr(o, s));
|
|
42
42
|
}
|
|
43
|
-
function Pr(o, r,
|
|
44
|
-
const
|
|
43
|
+
function Pr(o, r, t, s) {
|
|
44
|
+
const i = "virtual:storyblok-components", l = "\0" + i;
|
|
45
45
|
return {
|
|
46
46
|
name: "vite-plugin-storyblok-components",
|
|
47
47
|
async resolveId(u) {
|
|
48
|
-
if (u ===
|
|
48
|
+
if (u === i)
|
|
49
49
|
return l;
|
|
50
50
|
},
|
|
51
51
|
async load(u) {
|
|
52
52
|
if (u === l) {
|
|
53
|
-
const f = [],
|
|
53
|
+
const f = [], p = [];
|
|
54
54
|
for await (const [_, k] of Object.entries(r)) {
|
|
55
|
-
const
|
|
55
|
+
const A = await this.resolve(
|
|
56
56
|
"/" + o + "/" + k + ".astro"
|
|
57
57
|
);
|
|
58
|
-
if (
|
|
59
|
-
f.push(`import ${
|
|
60
|
-
else if (
|
|
61
|
-
|
|
58
|
+
if (A)
|
|
59
|
+
f.push(`import ${De(_)} from "${A.id}"`);
|
|
60
|
+
else if (t)
|
|
61
|
+
p.push(_);
|
|
62
62
|
else
|
|
63
63
|
throw new Error(
|
|
64
64
|
`Component could not be found for blok "${_}"! Does "${"/" + o + "/" + k}.astro" exist?`
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
|
-
let
|
|
68
|
-
if (
|
|
69
|
-
if (
|
|
67
|
+
let y = "";
|
|
68
|
+
if (t)
|
|
69
|
+
if (y = ",FallbackComponent", s) {
|
|
70
70
|
const _ = await this.resolve(
|
|
71
|
-
"/" + o + "/" +
|
|
71
|
+
"/" + o + "/" + s + ".astro"
|
|
72
72
|
);
|
|
73
73
|
if (!_)
|
|
74
74
|
throw new Error(
|
|
75
|
-
`Custom fallback component could not be found. Does "${"/" + o + "/" +
|
|
75
|
+
`Custom fallback component could not be found. Does "${"/" + o + "/" + s}.astro" exist?`
|
|
76
76
|
);
|
|
77
77
|
f.push(
|
|
78
78
|
`import FallbackComponent from "${_.id}"`
|
|
@@ -82,9 +82,9 @@ function Pr(o, r, e, i) {
|
|
|
82
82
|
"import FallbackComponent from '@storyblok/astro/FallbackComponent.astro'"
|
|
83
83
|
);
|
|
84
84
|
if (Object.values(r).length)
|
|
85
|
-
return `${f.join(";")};export default {${Object.keys(r).filter((_) => !
|
|
86
|
-
if (
|
|
87
|
-
return `${f[0]}; export default {${
|
|
85
|
+
return `${f.join(";")};export default {${Object.keys(r).filter((_) => !p.includes(_)).map((_) => De(_)).join(",")}${y}}`;
|
|
86
|
+
if (t)
|
|
87
|
+
return `${f[0]}; export default {${y.replace(",", "")}}`;
|
|
88
88
|
throw new Error(
|
|
89
89
|
`Currently, no Storyblok components are registered in astro.config.mjs.
|
|
90
90
|
Please register your components or enable the fallback component.
|
|
@@ -95,53 +95,52 @@ Detailed information can be found here: https://github.com/storyblok/storyblok-a
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
function Mr(o) {
|
|
98
|
-
const r = "virtual:storyblok-options",
|
|
98
|
+
const r = "virtual:storyblok-options", t = "\0" + r;
|
|
99
99
|
return {
|
|
100
100
|
name: "vite-plugin-storyblok-options",
|
|
101
|
-
async resolveId(
|
|
102
|
-
if (
|
|
103
|
-
return
|
|
101
|
+
async resolveId(s) {
|
|
102
|
+
if (s === r)
|
|
103
|
+
return t;
|
|
104
104
|
},
|
|
105
|
-
async load(
|
|
106
|
-
if (
|
|
105
|
+
async load(s) {
|
|
106
|
+
if (s === t)
|
|
107
107
|
return `export default ${JSON.stringify(o)}`;
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
let
|
|
112
|
-
const
|
|
113
|
-
if (typeof window > "u" || (window.storyblokRegisterEvent = (
|
|
111
|
+
let Ue = !1;
|
|
112
|
+
const Be = [], Nr = (o) => new Promise((r, t) => {
|
|
113
|
+
if (typeof window > "u" || (window.storyblokRegisterEvent = (i) => {
|
|
114
114
|
if (window.location === window.parent.location) {
|
|
115
115
|
console.warn("You are not in Draft Mode or in the Visual Editor.");
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
|
|
119
|
-
}, document.getElementById("storyblok-javascript-bridge")))
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}, document.getElementsByTagName("head")[0].appendChild(i);
|
|
118
|
+
Ue ? i() : Be.push(i);
|
|
119
|
+
}, document.getElementById("storyblok-javascript-bridge"))) return;
|
|
120
|
+
const s = document.createElement("script");
|
|
121
|
+
s.async = !0, s.src = o, s.id = "storyblok-javascript-bridge", s.onerror = (i) => t(i), s.onload = (i) => {
|
|
122
|
+
Be.forEach((l) => l()), Ue = !0, r(i);
|
|
123
|
+
}, document.getElementsByTagName("head")[0].appendChild(s);
|
|
125
124
|
});
|
|
126
|
-
var zr = Object.defineProperty, Lr = (o, r,
|
|
125
|
+
var zr = Object.defineProperty, Lr = (o, r, t) => r in o ? zr(o, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[r] = t, S = (o, r, t) => Lr(o, typeof r != "symbol" ? r + "" : r, t);
|
|
127
126
|
class Dr {
|
|
128
127
|
constructor() {
|
|
129
|
-
S(this, "isCDNUrl", (r = "") => r.indexOf("/cdn/") > -1), S(this, "getOptionsPage", (r,
|
|
128
|
+
S(this, "isCDNUrl", (r = "") => r.indexOf("/cdn/") > -1), S(this, "getOptionsPage", (r, t = 25, s = 1) => ({
|
|
130
129
|
...r,
|
|
131
|
-
per_page:
|
|
132
|
-
page:
|
|
133
|
-
})), S(this, "delay", (r) => new Promise((
|
|
134
|
-
const
|
|
135
|
-
return this.arrayFrom(
|
|
136
|
-
}), S(this, "asyncMap", async (r,
|
|
137
|
-
const
|
|
130
|
+
per_page: t,
|
|
131
|
+
page: s
|
|
132
|
+
})), S(this, "delay", (r) => new Promise((t) => setTimeout(t, r))), S(this, "arrayFrom", (r = 0, t) => [...Array(r)].map(t)), S(this, "range", (r = 0, t = r) => {
|
|
133
|
+
const s = Math.abs(t - r) || 0, i = r < t ? 1 : -1;
|
|
134
|
+
return this.arrayFrom(s, (l, u) => u * i + r);
|
|
135
|
+
}), S(this, "asyncMap", async (r, t) => Promise.all(r.map(t))), S(this, "flatMap", (r = [], t) => r.map(t).reduce((s, i) => [...s, ...i], [])), S(this, "escapeHTML", function(r) {
|
|
136
|
+
const t = {
|
|
138
137
|
"&": "&",
|
|
139
138
|
"<": "<",
|
|
140
139
|
">": ">",
|
|
141
140
|
'"': """,
|
|
142
141
|
"'": "'"
|
|
143
|
-
},
|
|
144
|
-
return r &&
|
|
142
|
+
}, s = /[&<>"']/g, i = RegExp(s.source);
|
|
143
|
+
return r && i.test(r) ? r.replace(s, (l) => t[l]) : r;
|
|
145
144
|
});
|
|
146
145
|
}
|
|
147
146
|
/**
|
|
@@ -151,20 +150,20 @@ class Dr {
|
|
|
151
150
|
* @param {Boolean} isArray
|
|
152
151
|
* @return {String} Stringified object
|
|
153
152
|
*/
|
|
154
|
-
stringify(r,
|
|
155
|
-
const
|
|
153
|
+
stringify(r, t, s) {
|
|
154
|
+
const i = [];
|
|
156
155
|
for (const l in r) {
|
|
157
156
|
if (!Object.prototype.hasOwnProperty.call(r, l))
|
|
158
157
|
continue;
|
|
159
|
-
const u = r[l], f =
|
|
160
|
-
let
|
|
161
|
-
typeof u == "object" ?
|
|
158
|
+
const u = r[l], f = s ? "" : encodeURIComponent(l);
|
|
159
|
+
let p;
|
|
160
|
+
typeof u == "object" ? p = this.stringify(
|
|
162
161
|
u,
|
|
163
|
-
|
|
162
|
+
t ? t + encodeURIComponent("[" + f + "]") : f,
|
|
164
163
|
Array.isArray(u)
|
|
165
|
-
) :
|
|
164
|
+
) : p = (t ? t + encodeURIComponent("[" + f + "]") : f) + "=" + encodeURIComponent(u), i.push(p);
|
|
166
165
|
}
|
|
167
|
-
return
|
|
166
|
+
return i.join("&");
|
|
168
167
|
}
|
|
169
168
|
/**
|
|
170
169
|
* @method getRegionURL
|
|
@@ -172,28 +171,28 @@ class Dr {
|
|
|
172
171
|
* @return {String} The base URL of the region
|
|
173
172
|
*/
|
|
174
173
|
getRegionURL(r) {
|
|
175
|
-
const
|
|
174
|
+
const t = "api.storyblok.com", s = "api-us.storyblok.com", i = "app.storyblokchina.cn", l = "api-ap.storyblok.com", u = "api-ca.storyblok.com";
|
|
176
175
|
switch (r) {
|
|
177
176
|
case "us":
|
|
178
|
-
return i;
|
|
179
|
-
case "cn":
|
|
180
177
|
return s;
|
|
178
|
+
case "cn":
|
|
179
|
+
return i;
|
|
181
180
|
case "ap":
|
|
182
181
|
return l;
|
|
183
182
|
case "ca":
|
|
184
183
|
return u;
|
|
185
184
|
default:
|
|
186
|
-
return
|
|
185
|
+
return t;
|
|
187
186
|
}
|
|
188
187
|
}
|
|
189
188
|
}
|
|
190
189
|
const Ur = function(o, r) {
|
|
191
|
-
const
|
|
192
|
-
for (const
|
|
193
|
-
const
|
|
194
|
-
r.indexOf(
|
|
190
|
+
const t = {};
|
|
191
|
+
for (const s in o) {
|
|
192
|
+
const i = o[s];
|
|
193
|
+
r.indexOf(s) > -1 && i !== null && (t[s] = i);
|
|
195
194
|
}
|
|
196
|
-
return
|
|
195
|
+
return t;
|
|
197
196
|
}, Br = (o) => o === "email", Fr = () => ({
|
|
198
197
|
singleTag: "hr"
|
|
199
198
|
}), Hr = () => ({
|
|
@@ -219,13 +218,13 @@ const Ur = function(o, r) {
|
|
|
219
218
|
attrs: Ur(o.attrs, ["src", "alt", "title"])
|
|
220
219
|
}
|
|
221
220
|
]
|
|
222
|
-
}),
|
|
221
|
+
}), Xr = () => ({
|
|
223
222
|
tag: "li"
|
|
224
|
-
}),
|
|
223
|
+
}), Yr = () => ({
|
|
225
224
|
tag: "ol"
|
|
226
|
-
}),
|
|
225
|
+
}), Zr = () => ({
|
|
227
226
|
tag: "p"
|
|
228
|
-
}),
|
|
227
|
+
}), Qr = (o) => ({
|
|
229
228
|
tag: [
|
|
230
229
|
{
|
|
231
230
|
tag: "span",
|
|
@@ -236,11 +235,11 @@ const Ur = function(o, r) {
|
|
|
236
235
|
}
|
|
237
236
|
}
|
|
238
237
|
]
|
|
239
|
-
}),
|
|
238
|
+
}), Vr = () => ({
|
|
240
239
|
tag: "b"
|
|
241
|
-
}), tn = () => ({
|
|
242
|
-
tag: "s"
|
|
243
240
|
}), en = () => ({
|
|
241
|
+
tag: "s"
|
|
242
|
+
}), tn = () => ({
|
|
244
243
|
tag: "u"
|
|
245
244
|
}), rn = () => ({
|
|
246
245
|
tag: "strong"
|
|
@@ -253,17 +252,17 @@ const Ur = function(o, r) {
|
|
|
253
252
|
return {
|
|
254
253
|
tag: ""
|
|
255
254
|
};
|
|
256
|
-
const r = new Dr().escapeHTML,
|
|
257
|
-
if (delete
|
|
258
|
-
for (const
|
|
259
|
-
|
|
260
|
-
delete
|
|
255
|
+
const r = new Dr().escapeHTML, t = { ...o.attrs }, { linktype: s = "url" } = o.attrs;
|
|
256
|
+
if (delete t.linktype, t.href && (t.href = r(o.attrs.href || "")), Br(s) && (t.href = `mailto:${t.href}`), t.anchor && (t.href = `${t.href}#${t.anchor}`, delete t.anchor), t.custom) {
|
|
257
|
+
for (const i in t.custom)
|
|
258
|
+
t[i] = t.custom[i];
|
|
259
|
+
delete t.custom;
|
|
261
260
|
}
|
|
262
261
|
return {
|
|
263
262
|
tag: [
|
|
264
263
|
{
|
|
265
264
|
tag: "a",
|
|
266
|
-
attrs:
|
|
265
|
+
attrs: t
|
|
267
266
|
}
|
|
268
267
|
]
|
|
269
268
|
};
|
|
@@ -299,7 +298,7 @@ const Ur = function(o, r) {
|
|
|
299
298
|
} : {
|
|
300
299
|
tag: ""
|
|
301
300
|
};
|
|
302
|
-
},
|
|
301
|
+
}, dn = (o) => {
|
|
303
302
|
var r;
|
|
304
303
|
return (r = o.attrs) != null && r.color ? {
|
|
305
304
|
tag: [
|
|
@@ -313,7 +312,7 @@ const Ur = function(o, r) {
|
|
|
313
312
|
} : {
|
|
314
313
|
tag: ""
|
|
315
314
|
};
|
|
316
|
-
},
|
|
315
|
+
}, pn = {
|
|
317
316
|
nodes: {
|
|
318
317
|
horizontal_rule: Fr,
|
|
319
318
|
blockquote: Hr,
|
|
@@ -322,15 +321,15 @@ const Ur = function(o, r) {
|
|
|
322
321
|
hard_break: Jr,
|
|
323
322
|
heading: Kr,
|
|
324
323
|
image: Wr,
|
|
325
|
-
list_item:
|
|
326
|
-
ordered_list:
|
|
327
|
-
paragraph:
|
|
328
|
-
emoji:
|
|
324
|
+
list_item: Xr,
|
|
325
|
+
ordered_list: Yr,
|
|
326
|
+
paragraph: Zr,
|
|
327
|
+
emoji: Qr
|
|
329
328
|
},
|
|
330
329
|
marks: {
|
|
331
|
-
bold:
|
|
332
|
-
strike:
|
|
333
|
-
underline:
|
|
330
|
+
bold: Vr,
|
|
331
|
+
strike: en,
|
|
332
|
+
underline: tn,
|
|
334
333
|
strong: rn,
|
|
335
334
|
code: nn,
|
|
336
335
|
italic: on,
|
|
@@ -340,7 +339,7 @@ const Ur = function(o, r) {
|
|
|
340
339
|
superscript: cn,
|
|
341
340
|
anchor: un,
|
|
342
341
|
highlight: fn,
|
|
343
|
-
textStyle:
|
|
342
|
+
textStyle: dn
|
|
344
343
|
}
|
|
345
344
|
}, gn = function(o) {
|
|
346
345
|
const r = {
|
|
@@ -349,25 +348,28 @@ const Ur = function(o, r) {
|
|
|
349
348
|
">": ">",
|
|
350
349
|
'"': """,
|
|
351
350
|
"'": "'"
|
|
352
|
-
},
|
|
353
|
-
return o &&
|
|
351
|
+
}, t = /[&<>"']/g, s = RegExp(t.source);
|
|
352
|
+
return o && s.test(o) ? o.replace(t, (i) => r[i]) : o;
|
|
354
353
|
};
|
|
354
|
+
let Fe = !1;
|
|
355
355
|
class hn {
|
|
356
356
|
constructor(r) {
|
|
357
|
-
S(this, "marks"), S(this, "nodes"), r || (r =
|
|
357
|
+
S(this, "marks"), S(this, "nodes"), r || (r = pn), this.marks = r.marks || [], this.nodes = r.nodes || [];
|
|
358
358
|
}
|
|
359
|
-
addNode(r,
|
|
360
|
-
this.nodes[r] =
|
|
359
|
+
addNode(r, t) {
|
|
360
|
+
this.nodes[r] = t;
|
|
361
361
|
}
|
|
362
|
-
addMark(r,
|
|
363
|
-
this.marks[r] =
|
|
362
|
+
addMark(r, t) {
|
|
363
|
+
this.marks[r] = t;
|
|
364
364
|
}
|
|
365
|
-
render(r,
|
|
366
|
-
if (
|
|
365
|
+
render(r, t = { optimizeImages: !1 }, s = !0) {
|
|
366
|
+
if (!Fe && s && (console.warn(
|
|
367
|
+
"Warning ⚠️: The RichTextResolver class is deprecated and will be removed in the next major release. Please use the `@storyblok/richtext` package instead. https://github.com/storyblok/richtext/"
|
|
368
|
+
), Fe = !0), r && r.content && Array.isArray(r.content)) {
|
|
367
369
|
let i = "";
|
|
368
|
-
return r.content.forEach((
|
|
369
|
-
i += this.renderNode(
|
|
370
|
-
}),
|
|
370
|
+
return r.content.forEach((l) => {
|
|
371
|
+
i += this.renderNode(l);
|
|
372
|
+
}), t.optimizeImages ? this.optimizeImages(i, t.optimizeImages) : i;
|
|
371
373
|
}
|
|
372
374
|
return console.warn(
|
|
373
375
|
`The render method must receive an Object with a "content" field.
|
|
@@ -396,21 +398,21 @@ class hn {
|
|
|
396
398
|
}`
|
|
397
399
|
), "";
|
|
398
400
|
}
|
|
399
|
-
optimizeImages(r,
|
|
400
|
-
let
|
|
401
|
-
typeof
|
|
402
|
-
const f =
|
|
401
|
+
optimizeImages(r, t) {
|
|
402
|
+
let s = 0, i = 0, l = "", u = "";
|
|
403
|
+
typeof t != "boolean" && (typeof t.width == "number" && t.width > 0 && (l += `width="${t.width}" `, s = t.width), typeof t.height == "number" && t.height > 0 && (l += `height="${t.height}" `, i = t.height), (t.loading === "lazy" || t.loading === "eager") && (l += `loading="${t.loading}" `), typeof t.class == "string" && t.class.length > 0 && (l += `class="${t.class}" `), t.filters && (typeof t.filters.blur == "number" && t.filters.blur >= 0 && t.filters.blur <= 100 && (u += `:blur(${t.filters.blur})`), typeof t.filters.brightness == "number" && t.filters.brightness >= -100 && t.filters.brightness <= 100 && (u += `:brightness(${t.filters.brightness})`), t.filters.fill && (t.filters.fill.match(/[0-9A-Fa-f]{6}/g) || t.filters.fill === "transparent") && (u += `:fill(${t.filters.fill})`), t.filters.format && ["webp", "png", "jpeg"].includes(t.filters.format) && (u += `:format(${t.filters.format})`), typeof t.filters.grayscale == "boolean" && t.filters.grayscale && (u += ":grayscale()"), typeof t.filters.quality == "number" && t.filters.quality >= 0 && t.filters.quality <= 100 && (u += `:quality(${t.filters.quality})`), t.filters.rotate && [90, 180, 270].includes(t.filters.rotate) && (u += `:rotate(${t.filters.rotate})`), u.length > 0 && (u = "/filters" + u))), l.length > 0 && (r = r.replace(/<img/g, `<img ${l.trim()}`));
|
|
404
|
+
const f = s > 0 || i > 0 || u.length > 0 ? `${s}x${i}${u}` : "";
|
|
403
405
|
return r = r.replace(
|
|
404
406
|
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g,
|
|
405
407
|
`a.storyblok.com/f/$1/$2.$3/m/${f}`
|
|
406
|
-
), typeof
|
|
407
|
-
var
|
|
408
|
-
const k =
|
|
408
|
+
), typeof t != "boolean" && (t.sizes || t.srcset) && (r = r.replace(/<img.*?src=["|'](.*?)["|']/g, (p) => {
|
|
409
|
+
var y, _;
|
|
410
|
+
const k = p.match(
|
|
409
411
|
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g
|
|
410
412
|
);
|
|
411
413
|
if (k && k.length > 0) {
|
|
412
|
-
const
|
|
413
|
-
srcset: (
|
|
414
|
+
const A = {
|
|
415
|
+
srcset: (y = t.srcset) == null ? void 0 : y.map((w) => {
|
|
414
416
|
if (typeof w == "number")
|
|
415
417
|
return `//${k}/m/${w}x0${u} ${w}w`;
|
|
416
418
|
if (typeof w == "object" && w.length === 2) {
|
|
@@ -418,40 +420,42 @@ class hn {
|
|
|
418
420
|
return typeof w[0] == "number" && (M = w[0]), typeof w[1] == "number" && (F = w[1]), `//${k}/m/${M}x${F}${u} ${M}w`;
|
|
419
421
|
}
|
|
420
422
|
}).join(", "),
|
|
421
|
-
sizes: (_ =
|
|
423
|
+
sizes: (_ = t.sizes) == null ? void 0 : _.map((w) => w).join(", ")
|
|
422
424
|
};
|
|
423
425
|
let O = "";
|
|
424
|
-
return
|
|
426
|
+
return A.srcset && (O += `srcset="${A.srcset}" `), A.sizes && (O += `sizes="${A.sizes}" `), p.replace(/<img/g, `<img ${O.trim()}`);
|
|
425
427
|
}
|
|
426
|
-
return
|
|
428
|
+
return p;
|
|
427
429
|
})), r;
|
|
428
430
|
}
|
|
429
431
|
renderNode(r) {
|
|
430
|
-
const
|
|
431
|
-
r.marks && r.marks.forEach((
|
|
432
|
-
const l = this.getMatchingMark(
|
|
433
|
-
l && l.tag !== "" &&
|
|
432
|
+
const t = [];
|
|
433
|
+
r.marks && r.marks.forEach((i) => {
|
|
434
|
+
const l = this.getMatchingMark(i);
|
|
435
|
+
l && l.tag !== "" && t.push(this.renderOpeningTag(l.tag));
|
|
434
436
|
});
|
|
435
|
-
const
|
|
436
|
-
return
|
|
437
|
-
|
|
438
|
-
}) : r.text ?
|
|
439
|
-
const l = this.getMatchingMark(
|
|
440
|
-
l && l.tag !== "" &&
|
|
441
|
-
}),
|
|
442
|
-
}
|
|
443
|
-
renderTag(r,
|
|
444
|
-
return r.constructor === String ? `<${r}${
|
|
445
|
-
if (
|
|
446
|
-
return `<${
|
|
437
|
+
const s = this.getMatchingNode(r);
|
|
438
|
+
return s && s.tag && t.push(this.renderOpeningTag(s.tag)), r.content ? r.content.forEach((i) => {
|
|
439
|
+
t.push(this.renderNode(i));
|
|
440
|
+
}) : r.text ? t.push(gn(r.text)) : s && s.singleTag ? t.push(this.renderTag(s.singleTag, " /")) : s && s.html ? t.push(s.html) : r.type === "emoji" && t.push(this.renderEmoji(r)), s && s.tag && t.push(this.renderClosingTag(s.tag)), r.marks && r.marks.slice(0).reverse().forEach((i) => {
|
|
441
|
+
const l = this.getMatchingMark(i);
|
|
442
|
+
l && l.tag !== "" && t.push(this.renderClosingTag(l.tag));
|
|
443
|
+
}), t.join("");
|
|
444
|
+
}
|
|
445
|
+
renderTag(r, t) {
|
|
446
|
+
return r.constructor === String ? `<${r}${t}>` : r.map((s) => {
|
|
447
|
+
if (s.constructor === String)
|
|
448
|
+
return `<${s}${t}>`;
|
|
447
449
|
{
|
|
448
|
-
let
|
|
449
|
-
if (
|
|
450
|
-
for (const l in
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
450
|
+
let i = `<${s.tag}`;
|
|
451
|
+
if (s.attrs) {
|
|
452
|
+
for (const l in s.attrs)
|
|
453
|
+
if (Object.prototype.hasOwnProperty.call(s.attrs, l)) {
|
|
454
|
+
const u = s.attrs[l];
|
|
455
|
+
u !== null && (i += ` ${l}="${u}"`);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return `${i}${t}>`;
|
|
455
459
|
}
|
|
456
460
|
}).join("");
|
|
457
461
|
}
|
|
@@ -459,22 +463,22 @@ class hn {
|
|
|
459
463
|
return this.renderTag(r, "");
|
|
460
464
|
}
|
|
461
465
|
renderClosingTag(r) {
|
|
462
|
-
return r.constructor === String ? `</${r}>` : r.slice(0).reverse().map((
|
|
466
|
+
return r.constructor === String ? `</${r}>` : r.slice(0).reverse().map((t) => t.constructor === String ? `</${t}>` : `</${t.tag}>`).join("");
|
|
463
467
|
}
|
|
464
468
|
getMatchingNode(r) {
|
|
465
|
-
const
|
|
466
|
-
if (typeof
|
|
467
|
-
return
|
|
469
|
+
const t = this.nodes[r.type];
|
|
470
|
+
if (typeof t == "function")
|
|
471
|
+
return t(r);
|
|
468
472
|
}
|
|
469
473
|
getMatchingMark(r) {
|
|
470
|
-
const
|
|
471
|
-
if (typeof
|
|
472
|
-
return
|
|
474
|
+
const t = this.marks[r.type];
|
|
475
|
+
if (typeof t == "function")
|
|
476
|
+
return t(r);
|
|
473
477
|
}
|
|
474
478
|
renderEmoji(r) {
|
|
475
479
|
if (r.attrs.emoji)
|
|
476
480
|
return r.attrs.emoji;
|
|
477
|
-
const
|
|
481
|
+
const t = [
|
|
478
482
|
{
|
|
479
483
|
tag: "img",
|
|
480
484
|
attrs: {
|
|
@@ -485,10 +489,10 @@ class hn {
|
|
|
485
489
|
}
|
|
486
490
|
}
|
|
487
491
|
];
|
|
488
|
-
return this.renderTag(
|
|
492
|
+
return this.renderTag(t, " /");
|
|
489
493
|
}
|
|
490
494
|
}
|
|
491
|
-
const $n = (o) => {
|
|
495
|
+
const bn = hn, $n = (o) => {
|
|
492
496
|
if (typeof o != "object" || typeof o._editable > "u")
|
|
493
497
|
return {};
|
|
494
498
|
try {
|
|
@@ -503,542 +507,541 @@ const $n = (o) => {
|
|
|
503
507
|
return {};
|
|
504
508
|
}
|
|
505
509
|
};
|
|
506
|
-
let yn,
|
|
507
|
-
const
|
|
508
|
-
o.addNode("blok", (
|
|
509
|
-
let
|
|
510
|
-
return
|
|
511
|
-
|
|
510
|
+
let yn, mn = "https://app.storyblok.com/f/storyblok-v2-latest.js";
|
|
511
|
+
const vn = (o, r) => {
|
|
512
|
+
o.addNode("blok", (t) => {
|
|
513
|
+
let s = "";
|
|
514
|
+
return t.attrs.body.forEach((i) => {
|
|
515
|
+
s += r(i.component, i);
|
|
512
516
|
}), {
|
|
513
|
-
html:
|
|
517
|
+
html: s
|
|
514
518
|
};
|
|
515
519
|
});
|
|
516
|
-
},
|
|
517
|
-
let
|
|
518
|
-
if (!
|
|
520
|
+
}, _n = (o) => !o || !(o != null && o.content.some((r) => r.content || r.type === "blok" || r.type === "horizontal_rule")), wn = (o, r, t) => {
|
|
521
|
+
let s = t || yn;
|
|
522
|
+
if (!s) {
|
|
519
523
|
console.error(
|
|
520
524
|
"Please initialize the Storyblok SDK before calling the renderRichText function"
|
|
521
525
|
);
|
|
522
526
|
return;
|
|
523
527
|
}
|
|
524
|
-
return
|
|
525
|
-
},
|
|
526
|
-
function
|
|
528
|
+
return _n(o) ? "" : (r && (s = new bn(r.schema), r.resolver && vn(s, r.resolver)), s.render(o, {}, !1));
|
|
529
|
+
}, En = () => Nr(mn);
|
|
530
|
+
function Tn(o) {
|
|
527
531
|
let r = {
|
|
528
532
|
resolveRelations: []
|
|
529
533
|
};
|
|
530
|
-
function
|
|
531
|
-
|
|
532
|
-
...Array.isArray(
|
|
534
|
+
function t(s) {
|
|
535
|
+
s && Array.isArray(r.resolveRelations) && r.resolveRelations.push(
|
|
536
|
+
...Array.isArray(s) ? s : [s]
|
|
533
537
|
);
|
|
534
538
|
}
|
|
535
|
-
for (const
|
|
536
|
-
if (
|
|
537
|
-
const { apiOptions:
|
|
538
|
-
if (
|
|
539
|
+
for (const s of o)
|
|
540
|
+
if (s.options) {
|
|
541
|
+
const { apiOptions: i, bridgeOptions: l } = s.options;
|
|
542
|
+
if (t(i == null ? void 0 : i.resolve_relations), l) {
|
|
539
543
|
const { resolveRelations: u, ...f } = l;
|
|
540
|
-
|
|
544
|
+
t(u), Object.assign(r, f);
|
|
541
545
|
}
|
|
542
546
|
}
|
|
543
547
|
return r.resolveRelations = [...new Set(r.resolveRelations)], r;
|
|
544
548
|
}
|
|
545
|
-
var
|
|
546
|
-
function
|
|
549
|
+
var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
550
|
+
function kn(o) {
|
|
547
551
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
548
552
|
}
|
|
549
|
-
var
|
|
550
|
-
|
|
553
|
+
var Q = { exports: {} };
|
|
554
|
+
Q.exports;
|
|
551
555
|
(function(o, r) {
|
|
552
|
-
var
|
|
553
|
-
|
|
554
|
-
var
|
|
556
|
+
var t = 200, s = "__lodash_hash_undefined__", i = 800, l = 16, u = 9007199254740991, f = "[object Arguments]", p = "[object Array]", y = "[object AsyncFunction]", _ = "[object Boolean]", k = "[object Date]", A = "[object Error]", O = "[object Function]", w = "[object GeneratorFunction]", M = "[object Map]", F = "[object Number]", Je = "[object Null]", de = "[object Object]", Ke = "[object Proxy]", We = "[object RegExp]", Xe = "[object Set]", Ye = "[object String]", Ze = "[object Undefined]", Qe = "[object WeakMap]", Ve = "[object ArrayBuffer]", et = "[object DataView]", tt = "[object Float32Array]", rt = "[object Float64Array]", nt = "[object Int8Array]", ot = "[object Int16Array]", at = "[object Int32Array]", st = "[object Uint8Array]", it = "[object Uint8ClampedArray]", lt = "[object Uint16Array]", ct = "[object Uint32Array]", ut = /[\\^$.*+?()[\]{}|]/g, ft = /^\[object .+?Constructor\]$/, dt = /^(?:0|[1-9]\d*)$/, b = {};
|
|
557
|
+
b[tt] = b[rt] = b[nt] = b[ot] = b[at] = b[st] = b[it] = b[lt] = b[ct] = !0, b[f] = b[p] = b[Ve] = b[_] = b[et] = b[k] = b[A] = b[O] = b[M] = b[F] = b[de] = b[We] = b[Xe] = b[Ye] = b[Qe] = !1;
|
|
558
|
+
var pe = typeof Z == "object" && Z && Z.Object === Object && Z, pt = typeof self == "object" && self && self.Object === Object && self, N = pe || pt || Function("return this")(), ge = r && !r.nodeType && r, z = ge && !0 && o && !o.nodeType && o, he = z && z.exports === ge, V = he && pe.process, be = function() {
|
|
555
559
|
try {
|
|
556
|
-
var
|
|
557
|
-
return
|
|
560
|
+
var e = z && z.require && z.require("util").types;
|
|
561
|
+
return e || V && V.binding && V.binding("util");
|
|
558
562
|
} catch {
|
|
559
563
|
}
|
|
560
|
-
}(),
|
|
561
|
-
function
|
|
564
|
+
}(), ye = be && be.isTypedArray;
|
|
565
|
+
function gt(e, n, a) {
|
|
562
566
|
switch (a.length) {
|
|
563
567
|
case 0:
|
|
564
|
-
return
|
|
568
|
+
return e.call(n);
|
|
565
569
|
case 1:
|
|
566
|
-
return
|
|
570
|
+
return e.call(n, a[0]);
|
|
567
571
|
case 2:
|
|
568
|
-
return
|
|
572
|
+
return e.call(n, a[0], a[1]);
|
|
569
573
|
case 3:
|
|
570
|
-
return
|
|
574
|
+
return e.call(n, a[0], a[1], a[2]);
|
|
571
575
|
}
|
|
572
|
-
return
|
|
576
|
+
return e.apply(n, a);
|
|
573
577
|
}
|
|
574
|
-
function
|
|
575
|
-
for (var a = -1, c = Array(
|
|
578
|
+
function ht(e, n) {
|
|
579
|
+
for (var a = -1, c = Array(e); ++a < e; )
|
|
576
580
|
c[a] = n(a);
|
|
577
581
|
return c;
|
|
578
582
|
}
|
|
579
|
-
function
|
|
583
|
+
function bt(e) {
|
|
580
584
|
return function(n) {
|
|
581
|
-
return
|
|
585
|
+
return e(n);
|
|
582
586
|
};
|
|
583
587
|
}
|
|
584
|
-
function
|
|
585
|
-
return
|
|
588
|
+
function yt(e, n) {
|
|
589
|
+
return e == null ? void 0 : e[n];
|
|
586
590
|
}
|
|
587
|
-
function
|
|
591
|
+
function mt(e, n) {
|
|
588
592
|
return function(a) {
|
|
589
|
-
return
|
|
593
|
+
return e(n(a));
|
|
590
594
|
};
|
|
591
595
|
}
|
|
592
|
-
var
|
|
593
|
-
var
|
|
594
|
-
return
|
|
595
|
-
}(),
|
|
596
|
-
"^" + q.call(
|
|
597
|
-
), G =
|
|
596
|
+
var vt = Array.prototype, _t = Function.prototype, H = Object.prototype, ee = N["__core-js_shared__"], q = _t.toString, j = H.hasOwnProperty, me = function() {
|
|
597
|
+
var e = /[^.]+$/.exec(ee && ee.keys && ee.keys.IE_PROTO || "");
|
|
598
|
+
return e ? "Symbol(src)_1." + e : "";
|
|
599
|
+
}(), ve = H.toString, wt = q.call(Object), Tt = RegExp(
|
|
600
|
+
"^" + q.call(j).replace(ut, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
601
|
+
), G = he ? N.Buffer : void 0, _e = N.Symbol, we = N.Uint8Array;
|
|
602
|
+
G && G.allocUnsafe;
|
|
603
|
+
var Te = mt(Object.getPrototypeOf, Object), ke = Object.create, kt = H.propertyIsEnumerable, At = vt.splice, x = _e ? _e.toStringTag : void 0, J = function() {
|
|
598
604
|
try {
|
|
599
|
-
var
|
|
600
|
-
return
|
|
605
|
+
var e = ne(Object, "defineProperty");
|
|
606
|
+
return e({}, "", {}), e;
|
|
601
607
|
} catch {
|
|
602
608
|
}
|
|
603
|
-
}(),
|
|
604
|
-
function
|
|
609
|
+
}(), It = G ? G.isBuffer : void 0, Ae = Math.max, St = Date.now, Ie = ne(N, "Map"), L = ne(Object, "create"), Ot = /* @__PURE__ */ function() {
|
|
610
|
+
function e() {
|
|
605
611
|
}
|
|
606
612
|
return function(n) {
|
|
607
613
|
if (!E(n))
|
|
608
614
|
return {};
|
|
609
|
-
if (
|
|
610
|
-
return
|
|
611
|
-
|
|
612
|
-
var a = new
|
|
613
|
-
return
|
|
615
|
+
if (ke)
|
|
616
|
+
return ke(n);
|
|
617
|
+
e.prototype = n;
|
|
618
|
+
var a = new e();
|
|
619
|
+
return e.prototype = void 0, a;
|
|
614
620
|
};
|
|
615
621
|
}();
|
|
616
|
-
function
|
|
617
|
-
var n = -1, a =
|
|
622
|
+
function $(e) {
|
|
623
|
+
var n = -1, a = e == null ? 0 : e.length;
|
|
618
624
|
for (this.clear(); ++n < a; ) {
|
|
619
|
-
var c =
|
|
625
|
+
var c = e[n];
|
|
620
626
|
this.set(c[0], c[1]);
|
|
621
627
|
}
|
|
622
628
|
}
|
|
623
|
-
function
|
|
629
|
+
function Ct() {
|
|
624
630
|
this.__data__ = L ? L(null) : {}, this.size = 0;
|
|
625
631
|
}
|
|
626
|
-
function
|
|
627
|
-
var n = this.has(
|
|
632
|
+
function jt(e) {
|
|
633
|
+
var n = this.has(e) && delete this.__data__[e];
|
|
628
634
|
return this.size -= n ? 1 : 0, n;
|
|
629
635
|
}
|
|
630
|
-
function
|
|
636
|
+
function xt(e) {
|
|
631
637
|
var n = this.__data__;
|
|
632
638
|
if (L) {
|
|
633
|
-
var a = n[
|
|
634
|
-
return a ===
|
|
639
|
+
var a = n[e];
|
|
640
|
+
return a === s ? void 0 : a;
|
|
635
641
|
}
|
|
636
|
-
return
|
|
642
|
+
return j.call(n, e) ? n[e] : void 0;
|
|
637
643
|
}
|
|
638
|
-
function
|
|
644
|
+
function $t(e) {
|
|
639
645
|
var n = this.__data__;
|
|
640
|
-
return L ? n[
|
|
646
|
+
return L ? n[e] !== void 0 : j.call(n, e);
|
|
641
647
|
}
|
|
642
|
-
function
|
|
648
|
+
function Et(e, n) {
|
|
643
649
|
var a = this.__data__;
|
|
644
|
-
return this.size += this.has(
|
|
650
|
+
return this.size += this.has(e) ? 0 : 1, a[e] = L && n === void 0 ? s : n, this;
|
|
645
651
|
}
|
|
646
|
-
|
|
647
|
-
function
|
|
648
|
-
var n = -1, a =
|
|
652
|
+
$.prototype.clear = Ct, $.prototype.delete = jt, $.prototype.get = xt, $.prototype.has = $t, $.prototype.set = Et;
|
|
653
|
+
function C(e) {
|
|
654
|
+
var n = -1, a = e == null ? 0 : e.length;
|
|
649
655
|
for (this.clear(); ++n < a; ) {
|
|
650
|
-
var c =
|
|
656
|
+
var c = e[n];
|
|
651
657
|
this.set(c[0], c[1]);
|
|
652
658
|
}
|
|
653
659
|
}
|
|
654
|
-
function
|
|
660
|
+
function Rt() {
|
|
655
661
|
this.__data__ = [], this.size = 0;
|
|
656
662
|
}
|
|
657
|
-
function
|
|
658
|
-
var n = this.__data__, a = K(n,
|
|
663
|
+
function Pt(e) {
|
|
664
|
+
var n = this.__data__, a = K(n, e);
|
|
659
665
|
if (a < 0)
|
|
660
666
|
return !1;
|
|
661
667
|
var c = n.length - 1;
|
|
662
|
-
return a == c ? n.pop() :
|
|
668
|
+
return a == c ? n.pop() : At.call(n, a, 1), --this.size, !0;
|
|
663
669
|
}
|
|
664
|
-
function
|
|
665
|
-
var n = this.__data__, a = K(n,
|
|
670
|
+
function Mt(e) {
|
|
671
|
+
var n = this.__data__, a = K(n, e);
|
|
666
672
|
return a < 0 ? void 0 : n[a][1];
|
|
667
673
|
}
|
|
668
|
-
function
|
|
669
|
-
return K(this.__data__,
|
|
674
|
+
function Nt(e) {
|
|
675
|
+
return K(this.__data__, e) > -1;
|
|
670
676
|
}
|
|
671
|
-
function
|
|
672
|
-
var a = this.__data__, c = K(a,
|
|
673
|
-
return c < 0 ? (++this.size, a.push([
|
|
677
|
+
function zt(e, n) {
|
|
678
|
+
var a = this.__data__, c = K(a, e);
|
|
679
|
+
return c < 0 ? (++this.size, a.push([e, n])) : a[c][1] = n, this;
|
|
674
680
|
}
|
|
675
|
-
|
|
676
|
-
function R(
|
|
677
|
-
var n = -1, a =
|
|
681
|
+
C.prototype.clear = Rt, C.prototype.delete = Pt, C.prototype.get = Mt, C.prototype.has = Nt, C.prototype.set = zt;
|
|
682
|
+
function R(e) {
|
|
683
|
+
var n = -1, a = e == null ? 0 : e.length;
|
|
678
684
|
for (this.clear(); ++n < a; ) {
|
|
679
|
-
var c =
|
|
685
|
+
var c = e[n];
|
|
680
686
|
this.set(c[0], c[1]);
|
|
681
687
|
}
|
|
682
688
|
}
|
|
683
|
-
function
|
|
689
|
+
function Lt() {
|
|
684
690
|
this.size = 0, this.__data__ = {
|
|
685
|
-
hash: new
|
|
686
|
-
map: new (
|
|
687
|
-
string: new
|
|
691
|
+
hash: new $(),
|
|
692
|
+
map: new (Ie || C)(),
|
|
693
|
+
string: new $()
|
|
688
694
|
};
|
|
689
695
|
}
|
|
690
|
-
function
|
|
691
|
-
var n =
|
|
696
|
+
function Dt(e) {
|
|
697
|
+
var n = X(this, e).delete(e);
|
|
692
698
|
return this.size -= n ? 1 : 0, n;
|
|
693
699
|
}
|
|
694
|
-
function
|
|
695
|
-
return
|
|
700
|
+
function Ut(e) {
|
|
701
|
+
return X(this, e).get(e);
|
|
696
702
|
}
|
|
697
|
-
function
|
|
698
|
-
return
|
|
703
|
+
function Bt(e) {
|
|
704
|
+
return X(this, e).has(e);
|
|
699
705
|
}
|
|
700
|
-
function
|
|
701
|
-
var a =
|
|
702
|
-
return a.set(
|
|
706
|
+
function Ft(e, n) {
|
|
707
|
+
var a = X(this, e), c = a.size;
|
|
708
|
+
return a.set(e, n), this.size += a.size == c ? 0 : 1, this;
|
|
703
709
|
}
|
|
704
|
-
R.prototype.clear =
|
|
705
|
-
function P(
|
|
706
|
-
var n = this.__data__ = new
|
|
710
|
+
R.prototype.clear = Lt, R.prototype.delete = Dt, R.prototype.get = Ut, R.prototype.has = Bt, R.prototype.set = Ft;
|
|
711
|
+
function P(e) {
|
|
712
|
+
var n = this.__data__ = new C(e);
|
|
707
713
|
this.size = n.size;
|
|
708
714
|
}
|
|
709
|
-
function
|
|
710
|
-
this.__data__ = new
|
|
715
|
+
function Ht() {
|
|
716
|
+
this.__data__ = new C(), this.size = 0;
|
|
711
717
|
}
|
|
712
|
-
function
|
|
713
|
-
var n = this.__data__, a = n.delete(
|
|
718
|
+
function qt(e) {
|
|
719
|
+
var n = this.__data__, a = n.delete(e);
|
|
714
720
|
return this.size = n.size, a;
|
|
715
721
|
}
|
|
716
|
-
function
|
|
717
|
-
return this.__data__.get(
|
|
722
|
+
function Gt(e) {
|
|
723
|
+
return this.__data__.get(e);
|
|
718
724
|
}
|
|
719
|
-
function
|
|
720
|
-
return this.__data__.has(
|
|
725
|
+
function Jt(e) {
|
|
726
|
+
return this.__data__.has(e);
|
|
721
727
|
}
|
|
722
|
-
function
|
|
728
|
+
function Kt(e, n) {
|
|
723
729
|
var a = this.__data__;
|
|
724
|
-
if (a instanceof
|
|
730
|
+
if (a instanceof C) {
|
|
725
731
|
var c = a.__data__;
|
|
726
|
-
if (!
|
|
727
|
-
return c.push([
|
|
732
|
+
if (!Ie || c.length < t - 1)
|
|
733
|
+
return c.push([e, n]), this.size = ++a.size, this;
|
|
728
734
|
a = this.__data__ = new R(c);
|
|
729
735
|
}
|
|
730
|
-
return a.set(
|
|
731
|
-
}
|
|
732
|
-
P.prototype.clear =
|
|
733
|
-
function
|
|
734
|
-
var a =
|
|
735
|
-
for (var
|
|
736
|
-
|
|
737
|
-
(
|
|
738
|
-
d && (
|
|
739
|
-
h && (
|
|
740
|
-
|
|
741
|
-
return
|
|
742
|
-
}
|
|
743
|
-
function
|
|
744
|
-
(a !== void 0 && !
|
|
745
|
-
}
|
|
746
|
-
function
|
|
747
|
-
var c =
|
|
748
|
-
(!(
|
|
749
|
-
}
|
|
750
|
-
function K(
|
|
751
|
-
for (var a =
|
|
752
|
-
if (
|
|
736
|
+
return a.set(e, n), this.size = a.size, this;
|
|
737
|
+
}
|
|
738
|
+
P.prototype.clear = Ht, P.prototype.delete = qt, P.prototype.get = Gt, P.prototype.has = Jt, P.prototype.set = Kt;
|
|
739
|
+
function Wt(e, n) {
|
|
740
|
+
var a = se(e), c = !a && ae(e), d = !a && !c && xe(e), h = !a && !c && !d && Ee(e), m = a || c || d || h, g = m ? ht(e.length, String) : [], v = g.length;
|
|
741
|
+
for (var I in e)
|
|
742
|
+
m && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
743
|
+
(I == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
744
|
+
d && (I == "offset" || I == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
745
|
+
h && (I == "buffer" || I == "byteLength" || I == "byteOffset") || // Skip index properties.
|
|
746
|
+
Ce(I, v)) || g.push(I);
|
|
747
|
+
return g;
|
|
748
|
+
}
|
|
749
|
+
function te(e, n, a) {
|
|
750
|
+
(a !== void 0 && !Y(e[n], a) || a === void 0 && !(n in e)) && re(e, n, a);
|
|
751
|
+
}
|
|
752
|
+
function Xt(e, n, a) {
|
|
753
|
+
var c = e[n];
|
|
754
|
+
(!(j.call(e, n) && Y(c, a)) || a === void 0 && !(n in e)) && re(e, n, a);
|
|
755
|
+
}
|
|
756
|
+
function K(e, n) {
|
|
757
|
+
for (var a = e.length; a--; )
|
|
758
|
+
if (Y(e[a][0], n))
|
|
753
759
|
return a;
|
|
754
760
|
return -1;
|
|
755
761
|
}
|
|
756
|
-
function
|
|
757
|
-
n == "__proto__" && J ? J(
|
|
762
|
+
function re(e, n, a) {
|
|
763
|
+
n == "__proto__" && J ? J(e, n, {
|
|
758
764
|
configurable: !0,
|
|
759
765
|
enumerable: !0,
|
|
760
766
|
value: a,
|
|
761
767
|
writable: !0
|
|
762
|
-
}) :
|
|
768
|
+
}) : e[n] = a;
|
|
763
769
|
}
|
|
764
|
-
var
|
|
765
|
-
function W(
|
|
766
|
-
return
|
|
770
|
+
var Yt = cr();
|
|
771
|
+
function W(e) {
|
|
772
|
+
return e == null ? e === void 0 ? Ze : Je : x && x in Object(e) ? ur(e) : br(e);
|
|
767
773
|
}
|
|
768
|
-
function
|
|
769
|
-
return D(
|
|
774
|
+
function Se(e) {
|
|
775
|
+
return D(e) && W(e) == f;
|
|
770
776
|
}
|
|
771
|
-
function
|
|
772
|
-
if (!E(
|
|
777
|
+
function Zt(e) {
|
|
778
|
+
if (!E(e) || gr(e))
|
|
773
779
|
return !1;
|
|
774
|
-
var n =
|
|
775
|
-
return n.test(_r(
|
|
776
|
-
}
|
|
777
|
-
function
|
|
778
|
-
return D(
|
|
779
|
-
}
|
|
780
|
-
function
|
|
781
|
-
if (!E(
|
|
782
|
-
return hr(
|
|
783
|
-
var n =
|
|
784
|
-
for (var c in
|
|
785
|
-
c == "constructor" && (n || !
|
|
780
|
+
var n = le(e) ? Tt : ft;
|
|
781
|
+
return n.test(_r(e));
|
|
782
|
+
}
|
|
783
|
+
function Qt(e) {
|
|
784
|
+
return D(e) && $e(e.length) && !!b[W(e)];
|
|
785
|
+
}
|
|
786
|
+
function Vt(e) {
|
|
787
|
+
if (!E(e))
|
|
788
|
+
return hr(e);
|
|
789
|
+
var n = je(e), a = [];
|
|
790
|
+
for (var c in e)
|
|
791
|
+
c == "constructor" && (n || !j.call(e, c)) || a.push(c);
|
|
786
792
|
return a;
|
|
787
793
|
}
|
|
788
|
-
function
|
|
789
|
-
|
|
794
|
+
function Oe(e, n, a, c, d) {
|
|
795
|
+
e !== n && Yt(n, function(h, m) {
|
|
790
796
|
if (d || (d = new P()), E(h))
|
|
791
|
-
|
|
797
|
+
er(e, n, m, a, Oe, c, d);
|
|
792
798
|
else {
|
|
793
|
-
var
|
|
794
|
-
|
|
799
|
+
var g = c ? c(oe(e, m), h, m + "", e, n, d) : void 0;
|
|
800
|
+
g === void 0 && (g = h), te(e, m, g);
|
|
795
801
|
}
|
|
796
|
-
},
|
|
802
|
+
}, Re);
|
|
797
803
|
}
|
|
798
|
-
function
|
|
799
|
-
var
|
|
800
|
-
if (
|
|
801
|
-
|
|
804
|
+
function er(e, n, a, c, d, h, m) {
|
|
805
|
+
var g = oe(e, a), v = oe(n, a), I = m.get(v);
|
|
806
|
+
if (I) {
|
|
807
|
+
te(e, a, I);
|
|
802
808
|
return;
|
|
803
809
|
}
|
|
804
|
-
var T = h ? h(
|
|
810
|
+
var T = h ? h(g, v, a + "", e, n, m) : void 0, U = T === void 0;
|
|
805
811
|
if (U) {
|
|
806
|
-
var
|
|
807
|
-
T = v,
|
|
812
|
+
var ce = se(v), ue = !ce && xe(v), Me = !ce && !ue && Ee(v);
|
|
813
|
+
T = v, ce || ue || Me ? se(g) ? T = g : wr(g) ? T = sr(g) : ue ? (U = !1, T = nr(v)) : Me ? (U = !1, T = ar(v)) : T = [] : Tr(v) || ae(v) ? (T = g, ae(g) ? T = kr(g) : (!E(g) || le(g)) && (T = fr(v))) : U = !1;
|
|
808
814
|
}
|
|
809
|
-
U && (m.set(v, T), d(T, v, c, h, m), m.delete(v)),
|
|
815
|
+
U && (m.set(v, T), d(T, v, c, h, m), m.delete(v)), te(e, a, T);
|
|
810
816
|
}
|
|
811
|
-
function
|
|
812
|
-
return mr(
|
|
817
|
+
function tr(e, n) {
|
|
818
|
+
return mr(yr(e, n, Pe), e + "");
|
|
813
819
|
}
|
|
814
|
-
var rr = J ? function(
|
|
815
|
-
return J(
|
|
820
|
+
var rr = J ? function(e, n) {
|
|
821
|
+
return J(e, "toString", {
|
|
816
822
|
configurable: !0,
|
|
817
823
|
enumerable: !1,
|
|
818
824
|
value: Ir(n),
|
|
819
825
|
writable: !0
|
|
820
826
|
});
|
|
821
|
-
} :
|
|
822
|
-
function nr(
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
}
|
|
836
|
-
function ir(t, n) {
|
|
837
|
-
var a = -1, c = t.length;
|
|
827
|
+
} : Pe;
|
|
828
|
+
function nr(e, n) {
|
|
829
|
+
return e.slice();
|
|
830
|
+
}
|
|
831
|
+
function or(e) {
|
|
832
|
+
var n = new e.constructor(e.byteLength);
|
|
833
|
+
return new we(n).set(new we(e)), n;
|
|
834
|
+
}
|
|
835
|
+
function ar(e, n) {
|
|
836
|
+
var a = or(e.buffer);
|
|
837
|
+
return new e.constructor(a, e.byteOffset, e.length);
|
|
838
|
+
}
|
|
839
|
+
function sr(e, n) {
|
|
840
|
+
var a = -1, c = e.length;
|
|
838
841
|
for (n || (n = Array(c)); ++a < c; )
|
|
839
|
-
n[a] =
|
|
842
|
+
n[a] = e[a];
|
|
840
843
|
return n;
|
|
841
844
|
}
|
|
842
|
-
function
|
|
845
|
+
function ir(e, n, a, c) {
|
|
843
846
|
var d = !a;
|
|
844
847
|
a || (a = {});
|
|
845
848
|
for (var h = -1, m = n.length; ++h < m; ) {
|
|
846
|
-
var
|
|
847
|
-
v === void 0 && (v =
|
|
849
|
+
var g = n[h], v = void 0;
|
|
850
|
+
v === void 0 && (v = e[g]), d ? re(a, g, v) : Xt(a, g, v);
|
|
848
851
|
}
|
|
849
852
|
return a;
|
|
850
853
|
}
|
|
851
|
-
function lr(
|
|
852
|
-
return
|
|
854
|
+
function lr(e) {
|
|
855
|
+
return tr(function(n, a) {
|
|
853
856
|
var c = -1, d = a.length, h = d > 1 ? a[d - 1] : void 0, m = d > 2 ? a[2] : void 0;
|
|
854
|
-
for (h =
|
|
855
|
-
var
|
|
856
|
-
|
|
857
|
+
for (h = e.length > 3 && typeof h == "function" ? (d--, h) : void 0, m && dr(a[0], a[1], m) && (h = d < 3 ? void 0 : h, d = 1), n = Object(n); ++c < d; ) {
|
|
858
|
+
var g = a[c];
|
|
859
|
+
g && e(n, g, c, h);
|
|
857
860
|
}
|
|
858
861
|
return n;
|
|
859
862
|
});
|
|
860
863
|
}
|
|
861
|
-
function cr(
|
|
864
|
+
function cr(e) {
|
|
862
865
|
return function(n, a, c) {
|
|
863
|
-
for (var d = -1, h = Object(n), m = c(n),
|
|
864
|
-
var v = m[
|
|
866
|
+
for (var d = -1, h = Object(n), m = c(n), g = m.length; g--; ) {
|
|
867
|
+
var v = m[++d];
|
|
865
868
|
if (a(h[v], v, h) === !1)
|
|
866
869
|
break;
|
|
867
870
|
}
|
|
868
871
|
return n;
|
|
869
872
|
};
|
|
870
873
|
}
|
|
871
|
-
function
|
|
872
|
-
var a =
|
|
873
|
-
return
|
|
874
|
+
function X(e, n) {
|
|
875
|
+
var a = e.__data__;
|
|
876
|
+
return pr(n) ? a[typeof n == "string" ? "string" : "hash"] : a.map;
|
|
874
877
|
}
|
|
875
|
-
function
|
|
876
|
-
var a =
|
|
877
|
-
return
|
|
878
|
+
function ne(e, n) {
|
|
879
|
+
var a = yt(e, n);
|
|
880
|
+
return Zt(a) ? a : void 0;
|
|
878
881
|
}
|
|
879
|
-
function ur(
|
|
880
|
-
var n =
|
|
882
|
+
function ur(e) {
|
|
883
|
+
var n = j.call(e, x), a = e[x];
|
|
881
884
|
try {
|
|
882
|
-
|
|
885
|
+
e[x] = void 0;
|
|
883
886
|
var c = !0;
|
|
884
887
|
} catch {
|
|
885
888
|
}
|
|
886
|
-
var d =
|
|
887
|
-
return c && (n ?
|
|
889
|
+
var d = ve.call(e);
|
|
890
|
+
return c && (n ? e[x] = a : delete e[x]), d;
|
|
888
891
|
}
|
|
889
|
-
function fr(
|
|
890
|
-
return typeof
|
|
892
|
+
function fr(e) {
|
|
893
|
+
return typeof e.constructor == "function" && !je(e) ? Ot(Te(e)) : {};
|
|
891
894
|
}
|
|
892
|
-
function
|
|
893
|
-
var a = typeof
|
|
894
|
-
return n = n ?? u, !!n && (a == "number" || a != "symbol" &&
|
|
895
|
+
function Ce(e, n) {
|
|
896
|
+
var a = typeof e;
|
|
897
|
+
return n = n ?? u, !!n && (a == "number" || a != "symbol" && dt.test(e)) && e > -1 && e % 1 == 0 && e < n;
|
|
895
898
|
}
|
|
896
|
-
function
|
|
899
|
+
function dr(e, n, a) {
|
|
897
900
|
if (!E(a))
|
|
898
901
|
return !1;
|
|
899
902
|
var c = typeof n;
|
|
900
|
-
return (c == "number" ?
|
|
903
|
+
return (c == "number" ? ie(a) && Ce(n, a.length) : c == "string" && n in a) ? Y(a[n], e) : !1;
|
|
901
904
|
}
|
|
902
|
-
function
|
|
903
|
-
var n = typeof
|
|
904
|
-
return n == "string" || n == "number" || n == "symbol" || n == "boolean" ?
|
|
905
|
+
function pr(e) {
|
|
906
|
+
var n = typeof e;
|
|
907
|
+
return n == "string" || n == "number" || n == "symbol" || n == "boolean" ? e !== "__proto__" : e === null;
|
|
905
908
|
}
|
|
906
|
-
function gr(
|
|
907
|
-
return !!
|
|
909
|
+
function gr(e) {
|
|
910
|
+
return !!me && me in e;
|
|
908
911
|
}
|
|
909
|
-
function
|
|
910
|
-
var n =
|
|
911
|
-
return
|
|
912
|
+
function je(e) {
|
|
913
|
+
var n = e && e.constructor, a = typeof n == "function" && n.prototype || H;
|
|
914
|
+
return e === a;
|
|
912
915
|
}
|
|
913
|
-
function hr(
|
|
916
|
+
function hr(e) {
|
|
914
917
|
var n = [];
|
|
915
|
-
if (
|
|
916
|
-
for (var a in Object(
|
|
918
|
+
if (e != null)
|
|
919
|
+
for (var a in Object(e))
|
|
917
920
|
n.push(a);
|
|
918
921
|
return n;
|
|
919
922
|
}
|
|
920
|
-
function
|
|
921
|
-
return
|
|
923
|
+
function br(e) {
|
|
924
|
+
return ve.call(e);
|
|
922
925
|
}
|
|
923
|
-
function
|
|
924
|
-
return n =
|
|
925
|
-
for (var c = arguments, d = -1, h =
|
|
926
|
+
function yr(e, n, a) {
|
|
927
|
+
return n = Ae(n === void 0 ? e.length - 1 : n, 0), function() {
|
|
928
|
+
for (var c = arguments, d = -1, h = Ae(c.length - n, 0), m = Array(h); ++d < h; )
|
|
926
929
|
m[d] = c[n + d];
|
|
927
930
|
d = -1;
|
|
928
|
-
for (var
|
|
929
|
-
|
|
930
|
-
return
|
|
931
|
+
for (var g = Array(n + 1); ++d < n; )
|
|
932
|
+
g[d] = c[d];
|
|
933
|
+
return g[n] = a(m), gt(e, this, g);
|
|
931
934
|
};
|
|
932
935
|
}
|
|
933
|
-
function
|
|
934
|
-
if (!(n === "constructor" && typeof
|
|
935
|
-
return
|
|
936
|
+
function oe(e, n) {
|
|
937
|
+
if (!(n === "constructor" && typeof e[n] == "function") && n != "__proto__")
|
|
938
|
+
return e[n];
|
|
936
939
|
}
|
|
937
940
|
var mr = vr(rr);
|
|
938
|
-
function vr(
|
|
941
|
+
function vr(e) {
|
|
939
942
|
var n = 0, a = 0;
|
|
940
943
|
return function() {
|
|
941
|
-
var c =
|
|
944
|
+
var c = St(), d = l - (c - a);
|
|
942
945
|
if (a = c, d > 0) {
|
|
943
|
-
if (++n >=
|
|
946
|
+
if (++n >= i)
|
|
944
947
|
return arguments[0];
|
|
945
948
|
} else
|
|
946
949
|
n = 0;
|
|
947
|
-
return
|
|
950
|
+
return e.apply(void 0, arguments);
|
|
948
951
|
};
|
|
949
952
|
}
|
|
950
|
-
function _r(
|
|
951
|
-
if (
|
|
953
|
+
function _r(e) {
|
|
954
|
+
if (e != null) {
|
|
952
955
|
try {
|
|
953
|
-
return q.call(
|
|
956
|
+
return q.call(e);
|
|
954
957
|
} catch {
|
|
955
958
|
}
|
|
956
959
|
try {
|
|
957
|
-
return
|
|
960
|
+
return e + "";
|
|
958
961
|
} catch {
|
|
959
962
|
}
|
|
960
963
|
}
|
|
961
964
|
return "";
|
|
962
965
|
}
|
|
963
|
-
function
|
|
964
|
-
return
|
|
966
|
+
function Y(e, n) {
|
|
967
|
+
return e === n || e !== e && n !== n;
|
|
965
968
|
}
|
|
966
|
-
var
|
|
969
|
+
var ae = Se(/* @__PURE__ */ function() {
|
|
967
970
|
return arguments;
|
|
968
|
-
}()) ?
|
|
969
|
-
return D(
|
|
970
|
-
},
|
|
971
|
-
function
|
|
972
|
-
return
|
|
973
|
-
}
|
|
974
|
-
function wr(
|
|
975
|
-
return D(
|
|
976
|
-
}
|
|
977
|
-
var
|
|
978
|
-
function
|
|
979
|
-
if (!E(
|
|
971
|
+
}()) ? Se : function(e) {
|
|
972
|
+
return D(e) && j.call(e, "callee") && !kt.call(e, "callee");
|
|
973
|
+
}, se = Array.isArray;
|
|
974
|
+
function ie(e) {
|
|
975
|
+
return e != null && $e(e.length) && !le(e);
|
|
976
|
+
}
|
|
977
|
+
function wr(e) {
|
|
978
|
+
return D(e) && ie(e);
|
|
979
|
+
}
|
|
980
|
+
var xe = It || Sr;
|
|
981
|
+
function le(e) {
|
|
982
|
+
if (!E(e))
|
|
980
983
|
return !1;
|
|
981
|
-
var n = W(
|
|
982
|
-
return n == O || n == w || n ==
|
|
984
|
+
var n = W(e);
|
|
985
|
+
return n == O || n == w || n == y || n == Ke;
|
|
983
986
|
}
|
|
984
|
-
function
|
|
985
|
-
return typeof
|
|
987
|
+
function $e(e) {
|
|
988
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= u;
|
|
986
989
|
}
|
|
987
|
-
function E(
|
|
988
|
-
var n = typeof
|
|
989
|
-
return
|
|
990
|
+
function E(e) {
|
|
991
|
+
var n = typeof e;
|
|
992
|
+
return e != null && (n == "object" || n == "function");
|
|
990
993
|
}
|
|
991
|
-
function D(
|
|
992
|
-
return
|
|
994
|
+
function D(e) {
|
|
995
|
+
return e != null && typeof e == "object";
|
|
993
996
|
}
|
|
994
|
-
function Tr(
|
|
995
|
-
if (!D(
|
|
997
|
+
function Tr(e) {
|
|
998
|
+
if (!D(e) || W(e) != de)
|
|
996
999
|
return !1;
|
|
997
|
-
var n =
|
|
1000
|
+
var n = Te(e);
|
|
998
1001
|
if (n === null)
|
|
999
1002
|
return !0;
|
|
1000
|
-
var a =
|
|
1001
|
-
return typeof a == "function" && a instanceof a && q.call(a) ==
|
|
1003
|
+
var a = j.call(n, "constructor") && n.constructor;
|
|
1004
|
+
return typeof a == "function" && a instanceof a && q.call(a) == wt;
|
|
1002
1005
|
}
|
|
1003
|
-
var
|
|
1004
|
-
function kr(
|
|
1005
|
-
return
|
|
1006
|
+
var Ee = ye ? bt(ye) : Qt;
|
|
1007
|
+
function kr(e) {
|
|
1008
|
+
return ir(e, Re(e));
|
|
1006
1009
|
}
|
|
1007
|
-
function
|
|
1008
|
-
return
|
|
1010
|
+
function Re(e) {
|
|
1011
|
+
return ie(e) ? Wt(e) : Vt(e);
|
|
1009
1012
|
}
|
|
1010
|
-
var Ar = lr(function(
|
|
1011
|
-
|
|
1013
|
+
var Ar = lr(function(e, n, a, c) {
|
|
1014
|
+
Oe(e, n, a, c);
|
|
1012
1015
|
});
|
|
1013
|
-
function Ir(
|
|
1016
|
+
function Ir(e) {
|
|
1014
1017
|
return function() {
|
|
1015
|
-
return
|
|
1018
|
+
return e;
|
|
1016
1019
|
};
|
|
1017
1020
|
}
|
|
1018
|
-
function
|
|
1019
|
-
return
|
|
1021
|
+
function Pe(e) {
|
|
1022
|
+
return e;
|
|
1020
1023
|
}
|
|
1021
1024
|
function Sr() {
|
|
1022
1025
|
return !1;
|
|
1023
1026
|
}
|
|
1024
1027
|
o.exports = Ar;
|
|
1025
|
-
})(
|
|
1026
|
-
var
|
|
1027
|
-
const
|
|
1028
|
-
function
|
|
1028
|
+
})(Q, Q.exports);
|
|
1029
|
+
var An = Q.exports;
|
|
1030
|
+
const In = /* @__PURE__ */ kn(An);
|
|
1031
|
+
function Sn(o) {
|
|
1029
1032
|
let r = {};
|
|
1030
|
-
function
|
|
1031
|
-
if ((
|
|
1032
|
-
const l =
|
|
1033
|
+
function t(s, i) {
|
|
1034
|
+
if ((i == null ? void 0 : i.type) === "AwaitExpression" && i.argument.type === "CallExpression" && i.argument.callee.type === "Identifier" && i.argument.callee.name === "useStoryblok") {
|
|
1035
|
+
const l = i.argument.arguments;
|
|
1033
1036
|
if (l && l[1].type === "ObjectExpression") {
|
|
1034
|
-
const u =
|
|
1037
|
+
const u = He(l[1].properties);
|
|
1035
1038
|
r = {
|
|
1036
1039
|
...r,
|
|
1037
1040
|
apiOptions: u
|
|
1038
1041
|
};
|
|
1039
1042
|
}
|
|
1040
1043
|
if (l && l[2].type === "ObjectExpression") {
|
|
1041
|
-
const u =
|
|
1044
|
+
const u = He(l[2].properties);
|
|
1042
1045
|
r = {
|
|
1043
1046
|
...r,
|
|
1044
1047
|
bridgeOptions: u
|
|
@@ -1046,96 +1049,96 @@ function In(o) {
|
|
|
1046
1049
|
}
|
|
1047
1050
|
}
|
|
1048
1051
|
}
|
|
1049
|
-
return
|
|
1052
|
+
return In({}, o, t), r;
|
|
1050
1053
|
}
|
|
1051
|
-
function
|
|
1054
|
+
function He(o) {
|
|
1052
1055
|
const r = {};
|
|
1053
|
-
return o.reduce((
|
|
1054
|
-
if (
|
|
1055
|
-
const { key:
|
|
1056
|
-
if (
|
|
1056
|
+
return o.reduce((t, s) => {
|
|
1057
|
+
if (s.type !== "Property") return t;
|
|
1058
|
+
const { key: i, value: l } = s, { type: u } = l;
|
|
1059
|
+
if (i.type !== "Identifier") return t;
|
|
1057
1060
|
if (u === "Literal")
|
|
1058
|
-
|
|
1061
|
+
t[i.name] = l.value;
|
|
1059
1062
|
else if (u === "ArrayExpression") {
|
|
1060
|
-
const f = l.elements.reduce((
|
|
1061
|
-
|
|
1063
|
+
const f = l.elements.reduce((p, y) => y.type === "Literal" && y.value ? [...p, y.value] : p, []);
|
|
1064
|
+
t[i.name] = f;
|
|
1062
1065
|
}
|
|
1063
|
-
return
|
|
1066
|
+
return t;
|
|
1064
1067
|
}, r);
|
|
1065
1068
|
}
|
|
1066
1069
|
let B = [];
|
|
1067
|
-
function
|
|
1068
|
-
const
|
|
1070
|
+
function On(o, r) {
|
|
1071
|
+
const t = "virtual:storyblok-bridge", s = "\0" + t;
|
|
1069
1072
|
if (!o || r !== "server")
|
|
1070
1073
|
return {
|
|
1071
1074
|
name: "vite-plugin-storyblok-bridge",
|
|
1072
1075
|
resolveId(f) {
|
|
1073
|
-
if (f ===
|
|
1074
|
-
return
|
|
1076
|
+
if (f === t)
|
|
1077
|
+
return s;
|
|
1075
1078
|
},
|
|
1076
1079
|
load(f) {
|
|
1077
|
-
if (f ===
|
|
1080
|
+
if (f === s)
|
|
1078
1081
|
return "export const bridgeOptions = null";
|
|
1079
1082
|
}
|
|
1080
1083
|
};
|
|
1081
|
-
let
|
|
1084
|
+
let i = [], l = null, u;
|
|
1082
1085
|
return {
|
|
1083
1086
|
name: "vite-plugin-storyblok-bridge",
|
|
1084
1087
|
async resolveId(f) {
|
|
1085
|
-
if (f ===
|
|
1086
|
-
return
|
|
1088
|
+
if (f === t)
|
|
1089
|
+
return s;
|
|
1087
1090
|
},
|
|
1088
|
-
async transform(f,
|
|
1091
|
+
async transform(f, p) {
|
|
1089
1092
|
var O;
|
|
1090
|
-
if (
|
|
1091
|
-
const [, ..._] =
|
|
1092
|
-
B.length && (
|
|
1093
|
+
if (p.includes("node_modules") && !p.includes("/pages/") || !f.includes("useStoryblok") || !((O = this.getModuleInfo(p).meta) != null && O.astro)) return;
|
|
1094
|
+
const [, ..._] = p.split("src/pages/"), k = _.join("/").replace(".astro", ""), A = Sn(this.parse(f));
|
|
1095
|
+
B.length && (i = B.filter((w) => w.url !== k)), i.push({
|
|
1093
1096
|
url: k,
|
|
1094
|
-
options:
|
|
1097
|
+
options: A
|
|
1095
1098
|
}), l && (u && clearTimeout(u), u = setTimeout(() => {
|
|
1096
|
-
|
|
1099
|
+
Cn(B, i) || (B.length !== 0 && (l.restart(), console.info("Bridge options updated. Restarting...")), B = [...i]);
|
|
1097
1100
|
}, 1e3));
|
|
1098
1101
|
},
|
|
1099
1102
|
async load(f) {
|
|
1100
|
-
if (f ===
|
|
1101
|
-
return `export const bridgeOptions = ${JSON.stringify(
|
|
1103
|
+
if (f === s)
|
|
1104
|
+
return `export const bridgeOptions = ${JSON.stringify(Tn(i))}`;
|
|
1102
1105
|
},
|
|
1103
1106
|
configureServer(f) {
|
|
1104
1107
|
l = f;
|
|
1105
1108
|
}
|
|
1106
1109
|
};
|
|
1107
1110
|
}
|
|
1108
|
-
function
|
|
1109
|
-
return r.every(({ url:
|
|
1110
|
-
const
|
|
1111
|
-
return
|
|
1111
|
+
function Cn(o = [], r = []) {
|
|
1112
|
+
return r.every(({ url: t, options: s }) => {
|
|
1113
|
+
const i = o.find((l) => (l == null ? void 0 : l.url) === t);
|
|
1114
|
+
return i && JSON.stringify(s) === JSON.stringify(i.options);
|
|
1112
1115
|
});
|
|
1113
1116
|
}
|
|
1114
|
-
let
|
|
1115
|
-
async function
|
|
1116
|
-
const { action: r, story:
|
|
1117
|
-
if (r === "input" &&
|
|
1118
|
-
const
|
|
1119
|
-
const l = await
|
|
1117
|
+
let qe;
|
|
1118
|
+
async function Rn(o) {
|
|
1119
|
+
const { action: r, story: t } = o || {};
|
|
1120
|
+
if (r === "input" && t) {
|
|
1121
|
+
const s = async () => {
|
|
1122
|
+
const l = await xn(t), u = document.body;
|
|
1120
1123
|
if (l.outerHTML === u.outerHTML) return;
|
|
1121
1124
|
const f = document.querySelector('[data-blok-focused="true"]');
|
|
1122
|
-
|
|
1125
|
+
jn(u, l, f);
|
|
1123
1126
|
};
|
|
1124
|
-
clearTimeout(
|
|
1127
|
+
clearTimeout(qe), qe = setTimeout(s, 500);
|
|
1125
1128
|
}
|
|
1126
1129
|
["published", "change"].includes(o == null ? void 0 : o.action) && location.reload();
|
|
1127
1130
|
}
|
|
1128
|
-
function
|
|
1129
|
-
if (
|
|
1130
|
-
const
|
|
1131
|
-
`[data-blok-uid="${
|
|
1131
|
+
function jn(o, r, t) {
|
|
1132
|
+
if (t) {
|
|
1133
|
+
const s = t.getAttribute("data-blok-uid"), i = r.querySelector(
|
|
1134
|
+
`[data-blok-uid="${s}"]`
|
|
1132
1135
|
);
|
|
1133
|
-
|
|
1136
|
+
i && (i.setAttribute("data-blok-focused", "true"), t.replaceWith(i));
|
|
1134
1137
|
} else
|
|
1135
1138
|
o.replaceWith(r);
|
|
1136
1139
|
}
|
|
1137
|
-
async function
|
|
1138
|
-
const
|
|
1140
|
+
async function xn(o) {
|
|
1141
|
+
const t = await (await fetch(location.href, {
|
|
1139
1142
|
method: "POST",
|
|
1140
1143
|
body: JSON.stringify({
|
|
1141
1144
|
...o,
|
|
@@ -1145,37 +1148,37 @@ async function jn(o) {
|
|
|
1145
1148
|
"Content-Type": "application/json"
|
|
1146
1149
|
}
|
|
1147
1150
|
})).text();
|
|
1148
|
-
return new DOMParser().parseFromString(
|
|
1151
|
+
return new DOMParser().parseFromString(t, "text/html").body;
|
|
1149
1152
|
}
|
|
1150
|
-
function
|
|
1153
|
+
function Pn() {
|
|
1151
1154
|
return globalThis.storyblokApiInstance || console.error("storyblokApiInstance has not been initialized correctly"), globalThis.storyblokApiInstance;
|
|
1152
1155
|
}
|
|
1153
|
-
async function
|
|
1156
|
+
async function Mn(o, r = {}, t = {}, s) {
|
|
1154
1157
|
globalThis.storyblokApiInstance || console.error("storyblokApiInstance has not been initialized correctly");
|
|
1155
|
-
let
|
|
1156
|
-
if (
|
|
1157
|
-
|
|
1158
|
+
let i = null;
|
|
1159
|
+
if (s && s.locals._storyblok_preview_data)
|
|
1160
|
+
i = s.locals._storyblok_preview_data;
|
|
1158
1161
|
else {
|
|
1159
1162
|
const { data: l } = await globalThis.storyblokApiInstance.get(
|
|
1160
1163
|
o,
|
|
1161
1164
|
r,
|
|
1162
|
-
|
|
1165
|
+
t
|
|
1163
1166
|
);
|
|
1164
|
-
|
|
1167
|
+
i = l.story;
|
|
1165
1168
|
}
|
|
1166
|
-
return
|
|
1169
|
+
return i;
|
|
1167
1170
|
}
|
|
1168
|
-
function
|
|
1169
|
-
const
|
|
1170
|
-
if (!
|
|
1171
|
+
function Nn(o, r) {
|
|
1172
|
+
const t = globalThis.storyblokApiInstance.richTextResolver;
|
|
1173
|
+
if (!t) {
|
|
1171
1174
|
console.error(
|
|
1172
1175
|
"Please initialize the Storyblok SDK before calling the renderRichText function"
|
|
1173
1176
|
);
|
|
1174
1177
|
return;
|
|
1175
1178
|
}
|
|
1176
|
-
return
|
|
1179
|
+
return wn(o, r, t);
|
|
1177
1180
|
}
|
|
1178
|
-
function
|
|
1181
|
+
function zn(o) {
|
|
1179
1182
|
const r = {
|
|
1180
1183
|
useCustomApi: !1,
|
|
1181
1184
|
bridge: !0,
|
|
@@ -1188,13 +1191,13 @@ function Nn(o) {
|
|
|
1188
1191
|
name: "@storyblok/astro",
|
|
1189
1192
|
hooks: {
|
|
1190
1193
|
"astro:config:setup": ({
|
|
1191
|
-
injectScript:
|
|
1192
|
-
updateConfig:
|
|
1193
|
-
addDevToolbarApp:
|
|
1194
|
+
injectScript: t,
|
|
1195
|
+
updateConfig: s,
|
|
1196
|
+
addDevToolbarApp: i,
|
|
1194
1197
|
addMiddleware: l,
|
|
1195
1198
|
config: u
|
|
1196
1199
|
}) => {
|
|
1197
|
-
if (
|
|
1200
|
+
if (s({
|
|
1198
1201
|
vite: {
|
|
1199
1202
|
plugins: [
|
|
1200
1203
|
Or(
|
|
@@ -1209,7 +1212,7 @@ function Nn(o) {
|
|
|
1209
1212
|
r.customFallbackComponent
|
|
1210
1213
|
),
|
|
1211
1214
|
Mr(r),
|
|
1212
|
-
|
|
1215
|
+
On(
|
|
1213
1216
|
r.livePreview,
|
|
1214
1217
|
u.output
|
|
1215
1218
|
)
|
|
@@ -1219,7 +1222,7 @@ function Nn(o) {
|
|
|
1219
1222
|
throw new Error(
|
|
1220
1223
|
"To utilize the Astro Storyblok Live feature, Astro must be configured to run in SSR mode. Please disable this feature or switch Astro to SSR mode."
|
|
1221
1224
|
);
|
|
1222
|
-
if (
|
|
1225
|
+
if (t(
|
|
1223
1226
|
"page-ssr",
|
|
1224
1227
|
`
|
|
1225
1228
|
import { storyblokApiInstance } from "virtual:storyblok-init";
|
|
@@ -1228,13 +1231,13 @@ function Nn(o) {
|
|
|
1228
1231
|
), r.bridge && !r.livePreview) {
|
|
1229
1232
|
let f = "";
|
|
1230
1233
|
if (typeof r.bridge == "object") {
|
|
1231
|
-
const
|
|
1234
|
+
const p = { ...r.bridge };
|
|
1232
1235
|
f = `const storyblokInstance = new StoryblokBridge(${JSON.stringify(
|
|
1233
|
-
|
|
1236
|
+
p
|
|
1234
1237
|
)});`;
|
|
1235
1238
|
} else
|
|
1236
1239
|
f = "const storyblokInstance = new StoryblokBridge()";
|
|
1237
|
-
|
|
1240
|
+
t(
|
|
1238
1241
|
"page",
|
|
1239
1242
|
`
|
|
1240
1243
|
import { loadStoryblokBridge } from "@storyblok/astro";
|
|
@@ -1251,7 +1254,7 @@ function Nn(o) {
|
|
|
1251
1254
|
`
|
|
1252
1255
|
);
|
|
1253
1256
|
}
|
|
1254
|
-
r.livePreview && (
|
|
1257
|
+
r.livePreview && (t(
|
|
1255
1258
|
"page",
|
|
1256
1259
|
`
|
|
1257
1260
|
import { loadStoryblokBridge, handleStoryblokMessage } from "@storyblok/astro";
|
|
@@ -1268,19 +1271,19 @@ function Nn(o) {
|
|
|
1268
1271
|
), l({
|
|
1269
1272
|
entrypoint: "@storyblok/astro/middleware.ts",
|
|
1270
1273
|
order: "pre"
|
|
1271
|
-
})),
|
|
1274
|
+
})), i("@storyblok/astro/toolbarApp.ts");
|
|
1272
1275
|
}
|
|
1273
1276
|
}
|
|
1274
1277
|
};
|
|
1275
1278
|
}
|
|
1276
1279
|
export {
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1280
|
+
bn as RichTextResolver,
|
|
1281
|
+
pn as RichTextSchema,
|
|
1282
|
+
zn as default,
|
|
1283
|
+
Rn as handleStoryblokMessage,
|
|
1284
|
+
En as loadStoryblokBridge,
|
|
1285
|
+
Nn as renderRichText,
|
|
1283
1286
|
$n as storyblokEditable,
|
|
1284
|
-
|
|
1285
|
-
|
|
1287
|
+
Mn as useStoryblok,
|
|
1288
|
+
Pn as useStoryblokApi
|
|
1286
1289
|
};
|