@storyblok/astro 4.1.0-next.1 → 4.1.0-next.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/dist/storyblok-astro.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
1
|
+
function Sr(o, e, r) {
|
|
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({
|
|
@@ -20,15 +20,15 @@ function Or(o, e, r) {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
let
|
|
23
|
+
const Cr = /[\p{Lu}]/u, $r = /[\p{Ll}]/u, zt = /^[\p{Lu}](?![\p{Lu}])/gu, Gt = /([\p{Alpha}\p{N}_]|$)/u, ft = /[_.\- ]+/, jr = new RegExp("^" + ft.source), Lt = new RegExp(ft.source + Gt.source, "gu"), Dt = new RegExp("\\d+" + Gt.source, "gu"), xr = (o, e, r, s) => {
|
|
24
|
+
let i = !1, l = !1, u = !1, h = !1;
|
|
25
25
|
for (let d = 0; d < o.length; d++) {
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const g = o[d];
|
|
27
|
+
h = d > 2 ? o[d - 3] === "-" : !0, i && Cr.test(g) ? (o = o.slice(0, d) + "-" + o.slice(d), i = !1, u = l, l = !0, d++) : l && u && $r.test(g) && (!h || s) ? (o = o.slice(0, d - 1) + "-" + o.slice(d - 1), u = l, l = !1, i = !0) : (i = e(g) === g && r(g) !== g, u = l, l = r(g) === g && e(g) !== g);
|
|
28
28
|
}
|
|
29
29
|
return o;
|
|
30
|
-
},
|
|
31
|
-
function
|
|
30
|
+
}, Er = (o, e) => (zt.lastIndex = 0, o.replaceAll(zt, (r) => e(r))), Rr = (o, e) => (Lt.lastIndex = 0, Dt.lastIndex = 0, o.replaceAll(Dt, (r, s, i) => ["_", "-"].includes(o.charAt(i + r.length)) ? r : e(r)).replaceAll(Lt, (r, s) => e(s)));
|
|
31
|
+
function Ut(o, e) {
|
|
32
32
|
if (!(typeof o == "string" || Array.isArray(o)))
|
|
33
33
|
throw new TypeError("Expected the input to be `string | string[]`");
|
|
34
34
|
if (e = {
|
|
@@ -37,54 +37,54 @@ function Dt(o, e) {
|
|
|
37
37
|
...e
|
|
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 r = e.locale === !1 ? (l) => l.toLowerCase() : (l) => l.toLocaleLowerCase(e.locale),
|
|
41
|
-
return o.length === 1 ? ft.test(o) ? "" : e.pascalCase ?
|
|
40
|
+
const r = e.locale === !1 ? (l) => l.toLowerCase() : (l) => l.toLocaleLowerCase(e.locale), s = e.locale === !1 ? (l) => l.toUpperCase() : (l) => l.toLocaleUpperCase(e.locale);
|
|
41
|
+
return o.length === 1 ? ft.test(o) ? "" : e.pascalCase ? s(o) : r(o) : (o !== r(o) && (o = xr(o, r, s, e.preserveConsecutiveUppercase)), o = o.replace(jr, ""), o = e.preserveConsecutiveUppercase ? Er(o, r) : r(o), e.pascalCase && (o = s(o.charAt(0)) + o.slice(1)), Rr(o, s));
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
43
|
+
function Mr(o, e, r, 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
|
|
54
|
-
for await (const [v,
|
|
55
|
-
const
|
|
56
|
-
"/" + o + "/" +
|
|
53
|
+
const h = [], d = [];
|
|
54
|
+
for await (const [v, T] of Object.entries(e)) {
|
|
55
|
+
const w = await this.resolve(
|
|
56
|
+
"/" + o + "/" + T + ".astro"
|
|
57
57
|
);
|
|
58
|
-
if (
|
|
59
|
-
|
|
58
|
+
if (w)
|
|
59
|
+
h.push(`import ${Ut(v)} from "${w.id}"`);
|
|
60
60
|
else if (r)
|
|
61
61
|
d.push(v);
|
|
62
62
|
else
|
|
63
63
|
throw new Error(
|
|
64
|
-
`Component could not be found for blok "${v}"! Does "${"/" + o + "/" +
|
|
64
|
+
`Component could not be found for blok "${v}"! Does "${"/" + o + "/" + T}.astro" exist?`
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
|
-
let
|
|
67
|
+
let g = "";
|
|
68
68
|
if (r)
|
|
69
|
-
if (
|
|
69
|
+
if (g = ",FallbackComponent", s) {
|
|
70
70
|
const v = await this.resolve(
|
|
71
|
-
"/" + o + "/" +
|
|
71
|
+
"/" + o + "/" + s + ".astro"
|
|
72
72
|
);
|
|
73
73
|
if (!v)
|
|
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
|
+
h.push(
|
|
78
78
|
`import FallbackComponent from "${v.id}"`
|
|
79
79
|
);
|
|
80
80
|
} else
|
|
81
|
-
|
|
81
|
+
h.push(
|
|
82
82
|
"import FallbackComponent from '@storyblok/astro/FallbackComponent.astro'"
|
|
83
83
|
);
|
|
84
84
|
if (Object.values(e).length)
|
|
85
|
-
return `${
|
|
85
|
+
return `${h.join(";")};export default {${Object.keys(e).filter((v) => !d.includes(v)).map((v) => Ut(v)).join(",")}${g}}`;
|
|
86
86
|
if (r)
|
|
87
|
-
return `${
|
|
87
|
+
return `${h[0]}; export default {${g.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.
|
|
@@ -94,37 +94,37 @@ Detailed information can be found here: https://github.com/storyblok/storyblok-a
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Pr(o) {
|
|
98
98
|
const e = "virtual:storyblok-options", r = "\0" + e;
|
|
99
99
|
return {
|
|
100
100
|
name: "vite-plugin-storyblok-options",
|
|
101
|
-
async resolveId(
|
|
102
|
-
if (
|
|
101
|
+
async resolveId(s) {
|
|
102
|
+
if (s === e)
|
|
103
103
|
return r;
|
|
104
104
|
},
|
|
105
|
-
async load(
|
|
106
|
-
if (
|
|
105
|
+
async load(s) {
|
|
106
|
+
if (s === r)
|
|
107
107
|
return `export default ${JSON.stringify(o)}`;
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
112
|
-
function
|
|
112
|
+
function Nr(o) {
|
|
113
113
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
114
114
|
}
|
|
115
115
|
var Q = { exports: {} };
|
|
116
116
|
Q.exports;
|
|
117
117
|
(function(o, e) {
|
|
118
|
-
var r = 200,
|
|
119
|
-
|
|
120
|
-
var dt = typeof Z == "object" && Z && Z.Object === Object && Z,
|
|
118
|
+
var r = 200, s = "__lodash_hash_undefined__", i = 800, l = 16, u = 9007199254740991, h = "[object Arguments]", d = "[object Array]", g = "[object AsyncFunction]", v = "[object Boolean]", T = "[object Date]", w = "[object Error]", E = "[object Function]", A = "[object GeneratorFunction]", P = "[object Map]", B = "[object Number]", Jt = "[object Null]", pt = "[object Object]", Kt = "[object Proxy]", Wt = "[object RegExp]", Yt = "[object Set]", Xt = "[object String]", Zt = "[object Undefined]", Qt = "[object WeakMap]", Vt = "[object ArrayBuffer]", te = "[object DataView]", ee = "[object Float32Array]", re = "[object Float64Array]", ne = "[object Int8Array]", oe = "[object Int16Array]", ae = "[object Int32Array]", se = "[object Uint8Array]", ie = "[object Uint8ClampedArray]", le = "[object Uint16Array]", ce = "[object Uint32Array]", ue = /[\\^$.*+?()[\]{}|]/g, fe = /^\[object .+?Constructor\]$/, pe = /^(?:0|[1-9]\d*)$/, b = {};
|
|
119
|
+
b[ee] = b[re] = b[ne] = b[oe] = b[ae] = b[se] = b[ie] = b[le] = b[ce] = !0, b[h] = b[d] = b[Vt] = b[v] = b[te] = b[T] = b[w] = b[E] = b[P] = b[B] = b[pt] = b[Wt] = b[Yt] = b[Xt] = b[Qt] = !1;
|
|
120
|
+
var dt = typeof Z == "object" && Z && Z.Object === Object && Z, de = typeof self == "object" && self && self.Object === Object && self, N = dt || de || Function("return this")(), gt = e && !e.nodeType && e, z = gt && !0 && o && !o.nodeType && o, ht = z && z.exports === gt, V = ht && dt.process, yt = function() {
|
|
121
121
|
try {
|
|
122
122
|
var t = z && z.require && z.require("util").types;
|
|
123
123
|
return t || V && V.binding && V.binding("util");
|
|
124
124
|
} catch {
|
|
125
125
|
}
|
|
126
126
|
}(), bt = yt && yt.isTypedArray;
|
|
127
|
-
function
|
|
127
|
+
function ge(t, n, a) {
|
|
128
128
|
switch (a.length) {
|
|
129
129
|
case 0:
|
|
130
130
|
return t.call(n);
|
|
@@ -137,36 +137,36 @@ Q.exports;
|
|
|
137
137
|
}
|
|
138
138
|
return t.apply(n, a);
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function he(t, n) {
|
|
141
141
|
for (var a = -1, c = Array(t); ++a < t; )
|
|
142
142
|
c[a] = n(a);
|
|
143
143
|
return c;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function ye(t) {
|
|
146
146
|
return function(n) {
|
|
147
147
|
return t(n);
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function be(t, n) {
|
|
151
151
|
return t == null ? void 0 : t[n];
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function me(t, n) {
|
|
154
154
|
return function(a) {
|
|
155
155
|
return t(n(a));
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
var
|
|
158
|
+
var _e = Array.prototype, ve = Function.prototype, H = Object.prototype, tt = N["__core-js_shared__"], q = ve.toString, S = H.hasOwnProperty, mt = function() {
|
|
159
159
|
var t = /[^.]+$/.exec(tt && tt.keys && tt.keys.IE_PROTO || "");
|
|
160
160
|
return t ? "Symbol(src)_1." + t : "";
|
|
161
|
-
}(), _t = H.toString,
|
|
162
|
-
"^" + q.call(S).replace(
|
|
163
|
-
), G = ht ? N.Buffer : void 0, vt = N.Symbol, Tt = N.Uint8Array, wt = G ? G.allocUnsafe : void 0, At =
|
|
161
|
+
}(), _t = H.toString, Te = q.call(Object), we = RegExp(
|
|
162
|
+
"^" + q.call(S).replace(ue, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
163
|
+
), G = ht ? N.Buffer : void 0, vt = N.Symbol, Tt = N.Uint8Array, wt = G ? G.allocUnsafe : void 0, At = me(Object.getPrototypeOf, Object), It = Object.create, Ae = H.propertyIsEnumerable, Ie = _e.splice, $ = vt ? vt.toStringTag : void 0, J = function() {
|
|
164
164
|
try {
|
|
165
165
|
var t = nt(Object, "defineProperty");
|
|
166
166
|
return t({}, "", {}), t;
|
|
167
167
|
} catch {
|
|
168
168
|
}
|
|
169
|
-
}(),
|
|
169
|
+
}(), ke = G ? G.isBuffer : void 0, kt = Math.max, Oe = Date.now, Ot = nt(N, "Map"), L = nt(Object, "create"), Se = /* @__PURE__ */ function() {
|
|
170
170
|
function t() {
|
|
171
171
|
}
|
|
172
172
|
return function(n) {
|
|
@@ -179,17 +179,17 @@ Q.exports;
|
|
|
179
179
|
return t.prototype = void 0, a;
|
|
180
180
|
};
|
|
181
181
|
}();
|
|
182
|
-
function
|
|
182
|
+
function j(t) {
|
|
183
183
|
var n = -1, a = t == null ? 0 : t.length;
|
|
184
184
|
for (this.clear(); ++n < a; ) {
|
|
185
185
|
var c = t[n];
|
|
186
186
|
this.set(c[0], c[1]);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function Ce() {
|
|
190
190
|
this.__data__ = L ? L(null) : {}, this.size = 0;
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function $e(t) {
|
|
193
193
|
var n = this.has(t) && delete this.__data__[t];
|
|
194
194
|
return this.size -= n ? 1 : 0, n;
|
|
195
195
|
}
|
|
@@ -197,19 +197,19 @@ Q.exports;
|
|
|
197
197
|
var n = this.__data__;
|
|
198
198
|
if (L) {
|
|
199
199
|
var a = n[t];
|
|
200
|
-
return a ===
|
|
200
|
+
return a === s ? void 0 : a;
|
|
201
201
|
}
|
|
202
202
|
return S.call(n, t) ? n[t] : void 0;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function xe(t) {
|
|
205
205
|
var n = this.__data__;
|
|
206
206
|
return L ? n[t] !== void 0 : S.call(n, t);
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function Ee(t, n) {
|
|
209
209
|
var a = this.__data__;
|
|
210
|
-
return this.size += this.has(t) ? 0 : 1, a[t] = L && n === void 0 ?
|
|
210
|
+
return this.size += this.has(t) ? 0 : 1, a[t] = L && n === void 0 ? s : n, this;
|
|
211
211
|
}
|
|
212
|
-
|
|
212
|
+
j.prototype.clear = Ce, j.prototype.delete = $e, j.prototype.get = je, j.prototype.has = xe, j.prototype.set = Ee;
|
|
213
213
|
function C(t) {
|
|
214
214
|
var n = -1, a = t == null ? 0 : t.length;
|
|
215
215
|
for (this.clear(); ++n < a; ) {
|
|
@@ -217,28 +217,28 @@ Q.exports;
|
|
|
217
217
|
this.set(c[0], c[1]);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function Re() {
|
|
221
221
|
this.__data__ = [], this.size = 0;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function Me(t) {
|
|
224
224
|
var n = this.__data__, a = K(n, t);
|
|
225
225
|
if (a < 0)
|
|
226
226
|
return !1;
|
|
227
227
|
var c = n.length - 1;
|
|
228
|
-
return a == c ? n.pop() :
|
|
228
|
+
return a == c ? n.pop() : Ie.call(n, a, 1), --this.size, !0;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function Pe(t) {
|
|
231
231
|
var n = this.__data__, a = K(n, t);
|
|
232
232
|
return a < 0 ? void 0 : n[a][1];
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Ne(t) {
|
|
235
235
|
return K(this.__data__, t) > -1;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function ze(t, n) {
|
|
238
238
|
var a = this.__data__, c = K(a, t);
|
|
239
239
|
return c < 0 ? (++this.size, a.push([t, n])) : a[c][1] = n, this;
|
|
240
240
|
}
|
|
241
|
-
C.prototype.clear =
|
|
241
|
+
C.prototype.clear = Re, C.prototype.delete = Me, C.prototype.get = Pe, C.prototype.has = Ne, C.prototype.set = ze;
|
|
242
242
|
function R(t) {
|
|
243
243
|
var n = -1, a = t == null ? 0 : t.length;
|
|
244
244
|
for (this.clear(); ++n < a; ) {
|
|
@@ -246,46 +246,46 @@ Q.exports;
|
|
|
246
246
|
this.set(c[0], c[1]);
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function Le() {
|
|
250
250
|
this.size = 0, this.__data__ = {
|
|
251
|
-
hash: new
|
|
251
|
+
hash: new j(),
|
|
252
252
|
map: new (Ot || C)(),
|
|
253
|
-
string: new
|
|
253
|
+
string: new j()
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function De(t) {
|
|
257
257
|
var n = Y(this, t).delete(t);
|
|
258
258
|
return this.size -= n ? 1 : 0, n;
|
|
259
259
|
}
|
|
260
260
|
function Ue(t) {
|
|
261
261
|
return Y(this, t).get(t);
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Fe(t) {
|
|
264
264
|
return Y(this, t).has(t);
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function Be(t, n) {
|
|
267
267
|
var a = Y(this, t), c = a.size;
|
|
268
268
|
return a.set(t, n), this.size += a.size == c ? 0 : 1, this;
|
|
269
269
|
}
|
|
270
|
-
R.prototype.clear =
|
|
270
|
+
R.prototype.clear = Le, R.prototype.delete = De, R.prototype.get = Ue, R.prototype.has = Fe, R.prototype.set = Be;
|
|
271
271
|
function M(t) {
|
|
272
272
|
var n = this.__data__ = new C(t);
|
|
273
273
|
this.size = n.size;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function He() {
|
|
276
276
|
this.__data__ = new C(), this.size = 0;
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function qe(t) {
|
|
279
279
|
var n = this.__data__, a = n.delete(t);
|
|
280
280
|
return this.size = n.size, a;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Ge(t) {
|
|
283
283
|
return this.__data__.get(t);
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function Je(t) {
|
|
286
286
|
return this.__data__.has(t);
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function Ke(t, n) {
|
|
289
289
|
var a = this.__data__;
|
|
290
290
|
if (a instanceof C) {
|
|
291
291
|
var c = a.__data__;
|
|
@@ -295,21 +295,21 @@ Q.exports;
|
|
|
295
295
|
}
|
|
296
296
|
return a.set(t, n), this.size = a.size, this;
|
|
297
297
|
}
|
|
298
|
-
M.prototype.clear =
|
|
299
|
-
function
|
|
300
|
-
var a =
|
|
298
|
+
M.prototype.clear = He, M.prototype.delete = qe, M.prototype.get = Ge, M.prototype.has = Je, M.prototype.set = Ke;
|
|
299
|
+
function We(t, n) {
|
|
300
|
+
var a = st(t), c = !a && at(t), p = !a && !c && xt(t), y = !a && !c && !p && Rt(t), m = a || c || p || y, f = m ? he(t.length, String) : [], _ = f.length;
|
|
301
301
|
for (var k in t)
|
|
302
302
|
(n || S.call(t, k)) && !(m && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
303
303
|
(k == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
304
304
|
p && (k == "offset" || k == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
y && (k == "buffer" || k == "byteLength" || k == "byteOffset") || // Skip index properties.
|
|
306
|
+
$t(k, _))) && f.push(k);
|
|
307
307
|
return f;
|
|
308
308
|
}
|
|
309
309
|
function et(t, n, a) {
|
|
310
310
|
(a !== void 0 && !X(t[n], a) || a === void 0 && !(n in t)) && rt(t, n, a);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Ye(t, n, a) {
|
|
313
313
|
var c = t[n];
|
|
314
314
|
(!(S.call(t, n) && X(c, a)) || a === void 0 && !(n in t)) && rt(t, n, a);
|
|
315
315
|
}
|
|
@@ -327,79 +327,79 @@ Q.exports;
|
|
|
327
327
|
writable: !0
|
|
328
328
|
}) : t[n] = a;
|
|
329
329
|
}
|
|
330
|
-
var
|
|
330
|
+
var Xe = cr();
|
|
331
331
|
function W(t) {
|
|
332
|
-
return t == null ? t === void 0 ?
|
|
332
|
+
return t == null ? t === void 0 ? Zt : Jt : $ && $ in Object(t) ? ur(t) : yr(t);
|
|
333
333
|
}
|
|
334
334
|
function St(t) {
|
|
335
|
-
return
|
|
336
|
-
}
|
|
337
|
-
function Xe(t) {
|
|
338
|
-
if (!x(t) || dr(t))
|
|
339
|
-
return !1;
|
|
340
|
-
var n = lt(t) ? Te : ue;
|
|
341
|
-
return n.test(_r(t));
|
|
335
|
+
return D(t) && W(t) == h;
|
|
342
336
|
}
|
|
343
337
|
function Ze(t) {
|
|
344
|
-
|
|
338
|
+
if (!x(t) || gr(t))
|
|
339
|
+
return !1;
|
|
340
|
+
var n = lt(t) ? we : fe;
|
|
341
|
+
return n.test(vr(t));
|
|
345
342
|
}
|
|
346
343
|
function Qe(t) {
|
|
344
|
+
return D(t) && Et(t.length) && !!b[W(t)];
|
|
345
|
+
}
|
|
346
|
+
function Ve(t) {
|
|
347
347
|
if (!x(t))
|
|
348
|
-
return
|
|
349
|
-
var n =
|
|
348
|
+
return hr(t);
|
|
349
|
+
var n = jt(t), a = [];
|
|
350
350
|
for (var c in t)
|
|
351
351
|
c == "constructor" && (n || !S.call(t, c)) || a.push(c);
|
|
352
352
|
return a;
|
|
353
353
|
}
|
|
354
354
|
function Ct(t, n, a, c, p) {
|
|
355
|
-
t !== n &&
|
|
356
|
-
if (p || (p = new M()), x(
|
|
357
|
-
|
|
355
|
+
t !== n && Xe(n, function(y, m) {
|
|
356
|
+
if (p || (p = new M()), x(y))
|
|
357
|
+
tr(t, n, m, a, Ct, c, p);
|
|
358
358
|
else {
|
|
359
|
-
var f = c ? c(ot(t, m),
|
|
360
|
-
f === void 0 && (f =
|
|
359
|
+
var f = c ? c(ot(t, m), y, m + "", t, n, p) : void 0;
|
|
360
|
+
f === void 0 && (f = y), et(t, m, f);
|
|
361
361
|
}
|
|
362
362
|
}, Mt);
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function tr(t, n, a, c, p, y, m) {
|
|
365
365
|
var f = ot(t, a), _ = ot(n, a), k = m.get(_);
|
|
366
366
|
if (k) {
|
|
367
367
|
et(t, a, k);
|
|
368
368
|
return;
|
|
369
369
|
}
|
|
370
|
-
var I =
|
|
371
|
-
if (
|
|
372
|
-
var ct =
|
|
373
|
-
I = _, ct || ut || Nt ?
|
|
370
|
+
var I = y ? y(f, _, a + "", t, n, m) : void 0, U = I === void 0;
|
|
371
|
+
if (U) {
|
|
372
|
+
var ct = st(_), ut = !ct && xt(_), Nt = !ct && !ut && Rt(_);
|
|
373
|
+
I = _, ct || ut || Nt ? st(f) ? I = f : Tr(f) ? I = sr(f) : ut ? (U = !1, I = nr(_, !0)) : Nt ? (U = !1, I = ar(_, !0)) : I = [] : wr(_) || at(_) ? (I = f, at(f) ? I = Ar(f) : (!x(f) || lt(f)) && (I = fr(_))) : U = !1;
|
|
374
374
|
}
|
|
375
|
-
|
|
375
|
+
U && (m.set(_, I), p(I, _, c, y, m), m.delete(_)), et(t, a, I);
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
return br(
|
|
377
|
+
function er(t, n) {
|
|
378
|
+
return mr(br(t, n, Pt), t + "");
|
|
379
379
|
}
|
|
380
|
-
var
|
|
380
|
+
var rr = J ? function(t, n) {
|
|
381
381
|
return J(t, "toString", {
|
|
382
382
|
configurable: !0,
|
|
383
383
|
enumerable: !1,
|
|
384
|
-
value:
|
|
384
|
+
value: kr(n),
|
|
385
385
|
writable: !0
|
|
386
386
|
});
|
|
387
387
|
} : Pt;
|
|
388
|
-
function
|
|
388
|
+
function nr(t, n) {
|
|
389
389
|
if (n)
|
|
390
390
|
return t.slice();
|
|
391
391
|
var a = t.length, c = wt ? wt(a) : new t.constructor(a);
|
|
392
392
|
return t.copy(c), c;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function or(t) {
|
|
395
395
|
var n = new t.constructor(t.byteLength);
|
|
396
396
|
return new Tt(n).set(new Tt(t)), n;
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
var a = n ?
|
|
398
|
+
function ar(t, n) {
|
|
399
|
+
var a = n ? or(t.buffer) : t.buffer;
|
|
400
400
|
return new t.constructor(a, t.byteOffset, t.length);
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function sr(t, n) {
|
|
403
403
|
var a = -1, c = t.length;
|
|
404
404
|
for (n || (n = Array(c)); ++a < c; )
|
|
405
405
|
n[a] = t[a];
|
|
@@ -408,27 +408,27 @@ Q.exports;
|
|
|
408
408
|
function ir(t, n, a, c) {
|
|
409
409
|
var p = !a;
|
|
410
410
|
a || (a = {});
|
|
411
|
-
for (var
|
|
412
|
-
var f = n[
|
|
413
|
-
_ === void 0 && (_ = t[f]), p ? rt(a, f, _) :
|
|
411
|
+
for (var y = -1, m = n.length; ++y < m; ) {
|
|
412
|
+
var f = n[y], _ = c ? c(a[f], t[f], f, a, t) : void 0;
|
|
413
|
+
_ === void 0 && (_ = t[f]), p ? rt(a, f, _) : Ye(a, f, _);
|
|
414
414
|
}
|
|
415
415
|
return a;
|
|
416
416
|
}
|
|
417
|
-
function
|
|
418
|
-
return
|
|
419
|
-
var c = -1, p = a.length,
|
|
420
|
-
for (
|
|
417
|
+
function lr(t) {
|
|
418
|
+
return er(function(n, a) {
|
|
419
|
+
var c = -1, p = a.length, y = p > 1 ? a[p - 1] : void 0, m = p > 2 ? a[2] : void 0;
|
|
420
|
+
for (y = t.length > 3 && typeof y == "function" ? (p--, y) : void 0, m && pr(a[0], a[1], m) && (y = p < 3 ? void 0 : y, p = 1), n = Object(n); ++c < p; ) {
|
|
421
421
|
var f = a[c];
|
|
422
|
-
f && t(n, f, c,
|
|
422
|
+
f && t(n, f, c, y);
|
|
423
423
|
}
|
|
424
424
|
return n;
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function cr(t) {
|
|
428
428
|
return function(n, a, c) {
|
|
429
|
-
for (var p = -1,
|
|
429
|
+
for (var p = -1, y = Object(n), m = c(n), f = m.length; f--; ) {
|
|
430
430
|
var _ = m[t ? f : ++p];
|
|
431
|
-
if (a(
|
|
431
|
+
if (a(y[_], _, y) === !1)
|
|
432
432
|
break;
|
|
433
433
|
}
|
|
434
434
|
return n;
|
|
@@ -436,84 +436,84 @@ Q.exports;
|
|
|
436
436
|
}
|
|
437
437
|
function Y(t, n) {
|
|
438
438
|
var a = t.__data__;
|
|
439
|
-
return
|
|
439
|
+
return dr(n) ? a[typeof n == "string" ? "string" : "hash"] : a.map;
|
|
440
440
|
}
|
|
441
441
|
function nt(t, n) {
|
|
442
|
-
var a =
|
|
443
|
-
return
|
|
442
|
+
var a = be(t, n);
|
|
443
|
+
return Ze(a) ? a : void 0;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
var n = S.call(t,
|
|
445
|
+
function ur(t) {
|
|
446
|
+
var n = S.call(t, $), a = t[$];
|
|
447
447
|
try {
|
|
448
|
-
t[
|
|
448
|
+
t[$] = void 0;
|
|
449
449
|
var c = !0;
|
|
450
450
|
} catch {
|
|
451
451
|
}
|
|
452
452
|
var p = _t.call(t);
|
|
453
|
-
return c && (n ? t[
|
|
453
|
+
return c && (n ? t[$] = a : delete t[$]), p;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
return typeof t.constructor == "function" &&
|
|
455
|
+
function fr(t) {
|
|
456
|
+
return typeof t.constructor == "function" && !jt(t) ? Se(At(t)) : {};
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function $t(t, n) {
|
|
459
459
|
var a = typeof t;
|
|
460
|
-
return n = n ?? u, !!n && (a == "number" || a != "symbol" &&
|
|
460
|
+
return n = n ?? u, !!n && (a == "number" || a != "symbol" && pe.test(t)) && t > -1 && t % 1 == 0 && t < n;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function pr(t, n, a) {
|
|
463
463
|
if (!x(a))
|
|
464
464
|
return !1;
|
|
465
465
|
var c = typeof n;
|
|
466
|
-
return (c == "number" ?
|
|
466
|
+
return (c == "number" ? it(a) && $t(n, a.length) : c == "string" && n in a) ? X(a[n], t) : !1;
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function dr(t) {
|
|
469
469
|
var n = typeof t;
|
|
470
470
|
return n == "string" || n == "number" || n == "symbol" || n == "boolean" ? t !== "__proto__" : t === null;
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function gr(t) {
|
|
473
473
|
return !!mt && mt in t;
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function jt(t) {
|
|
476
476
|
var n = t && t.constructor, a = typeof n == "function" && n.prototype || H;
|
|
477
477
|
return t === a;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function hr(t) {
|
|
480
480
|
var n = [];
|
|
481
481
|
if (t != null)
|
|
482
482
|
for (var a in Object(t))
|
|
483
483
|
n.push(a);
|
|
484
484
|
return n;
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function yr(t) {
|
|
487
487
|
return _t.call(t);
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function br(t, n, a) {
|
|
490
490
|
return n = kt(n === void 0 ? t.length - 1 : n, 0), function() {
|
|
491
|
-
for (var c = arguments, p = -1,
|
|
491
|
+
for (var c = arguments, p = -1, y = kt(c.length - n, 0), m = Array(y); ++p < y; )
|
|
492
492
|
m[p] = c[n + p];
|
|
493
493
|
p = -1;
|
|
494
494
|
for (var f = Array(n + 1); ++p < n; )
|
|
495
495
|
f[p] = c[p];
|
|
496
|
-
return f[n] = a(m),
|
|
496
|
+
return f[n] = a(m), ge(t, this, f);
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
499
|
function ot(t, n) {
|
|
500
500
|
if (!(n === "constructor" && typeof t[n] == "function") && n != "__proto__")
|
|
501
501
|
return t[n];
|
|
502
502
|
}
|
|
503
|
-
var
|
|
504
|
-
function
|
|
503
|
+
var mr = _r(rr);
|
|
504
|
+
function _r(t) {
|
|
505
505
|
var n = 0, a = 0;
|
|
506
506
|
return function() {
|
|
507
|
-
var c =
|
|
507
|
+
var c = Oe(), p = l - (c - a);
|
|
508
508
|
if (a = c, p > 0) {
|
|
509
|
-
if (++n >=
|
|
509
|
+
if (++n >= i)
|
|
510
510
|
return arguments[0];
|
|
511
511
|
} else
|
|
512
512
|
n = 0;
|
|
513
513
|
return t.apply(void 0, arguments);
|
|
514
514
|
};
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function vr(t) {
|
|
517
517
|
if (t != null) {
|
|
518
518
|
try {
|
|
519
519
|
return q.call(t);
|
|
@@ -532,20 +532,20 @@ Q.exports;
|
|
|
532
532
|
var at = St(/* @__PURE__ */ function() {
|
|
533
533
|
return arguments;
|
|
534
534
|
}()) ? St : function(t) {
|
|
535
|
-
return
|
|
536
|
-
},
|
|
537
|
-
function
|
|
535
|
+
return D(t) && S.call(t, "callee") && !Ae.call(t, "callee");
|
|
536
|
+
}, st = Array.isArray;
|
|
537
|
+
function it(t) {
|
|
538
538
|
return t != null && Et(t.length) && !lt(t);
|
|
539
539
|
}
|
|
540
|
-
function
|
|
541
|
-
return
|
|
540
|
+
function Tr(t) {
|
|
541
|
+
return D(t) && it(t);
|
|
542
542
|
}
|
|
543
|
-
var xt =
|
|
543
|
+
var xt = ke || Or;
|
|
544
544
|
function lt(t) {
|
|
545
545
|
if (!x(t))
|
|
546
546
|
return !1;
|
|
547
547
|
var n = W(t);
|
|
548
|
-
return n == E || n == A || n ==
|
|
548
|
+
return n == E || n == A || n == g || n == Kt;
|
|
549
549
|
}
|
|
550
550
|
function Et(t) {
|
|
551
551
|
return typeof t == "number" && t > -1 && t % 1 == 0 && t <= u;
|
|
@@ -554,29 +554,29 @@ Q.exports;
|
|
|
554
554
|
var n = typeof t;
|
|
555
555
|
return t != null && (n == "object" || n == "function");
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function D(t) {
|
|
558
558
|
return t != null && typeof t == "object";
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
if (!
|
|
560
|
+
function wr(t) {
|
|
561
|
+
if (!D(t) || W(t) != pt)
|
|
562
562
|
return !1;
|
|
563
563
|
var n = At(t);
|
|
564
564
|
if (n === null)
|
|
565
565
|
return !0;
|
|
566
566
|
var a = S.call(n, "constructor") && n.constructor;
|
|
567
|
-
return typeof a == "function" && a instanceof a && q.call(a) ==
|
|
567
|
+
return typeof a == "function" && a instanceof a && q.call(a) == Te;
|
|
568
568
|
}
|
|
569
|
-
var Rt = bt ?
|
|
570
|
-
function
|
|
569
|
+
var Rt = bt ? ye(bt) : Qe;
|
|
570
|
+
function Ar(t) {
|
|
571
571
|
return ir(t, Mt(t));
|
|
572
572
|
}
|
|
573
573
|
function Mt(t) {
|
|
574
|
-
return
|
|
574
|
+
return it(t) ? We(t, !0) : Ve(t);
|
|
575
575
|
}
|
|
576
|
-
var
|
|
576
|
+
var Ir = lr(function(t, n, a, c) {
|
|
577
577
|
Ct(t, n, a, c);
|
|
578
578
|
});
|
|
579
|
-
function
|
|
579
|
+
function kr(t) {
|
|
580
580
|
return function() {
|
|
581
581
|
return t;
|
|
582
582
|
};
|
|
@@ -584,58 +584,58 @@ Q.exports;
|
|
|
584
584
|
function Pt(t) {
|
|
585
585
|
return t;
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Or() {
|
|
588
588
|
return !1;
|
|
589
589
|
}
|
|
590
|
-
o.exports =
|
|
590
|
+
o.exports = Ir;
|
|
591
591
|
})(Q, Q.exports);
|
|
592
|
-
var
|
|
593
|
-
const
|
|
594
|
-
function
|
|
592
|
+
var zr = Q.exports;
|
|
593
|
+
const Lr = /* @__PURE__ */ Nr(zr);
|
|
594
|
+
function Dr(o) {
|
|
595
595
|
let e;
|
|
596
|
-
function r(
|
|
597
|
-
var l, u,
|
|
598
|
-
if ((
|
|
599
|
-
const
|
|
600
|
-
((d =
|
|
596
|
+
function r(s, i) {
|
|
597
|
+
var l, u, h, d, g, v, T;
|
|
598
|
+
if ((i == null ? void 0 : i.type) === "AwaitExpression" && ((u = (l = i == null ? void 0 : i.argument) == null ? void 0 : l.callee) == null ? void 0 : u.name) === "useStoryblok") {
|
|
599
|
+
const w = (h = i == null ? void 0 : i.argument) == null ? void 0 : h.arguments;
|
|
600
|
+
((d = w[1]) == null ? void 0 : d.type) === "ObjectExpression" && (e = {
|
|
601
601
|
...e,
|
|
602
|
-
apiOptions: Ft((
|
|
603
|
-
}), ((v =
|
|
602
|
+
apiOptions: Ft((g = w[1]) == null ? void 0 : g.properties)
|
|
603
|
+
}), ((v = w[2]) == null ? void 0 : v.type) === "ObjectExpression" && (e = {
|
|
604
604
|
...e,
|
|
605
|
-
bridgeOptions: Ft((
|
|
605
|
+
bridgeOptions: Ft((T = w[2]) == null ? void 0 : T.properties)
|
|
606
606
|
});
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
return
|
|
609
|
+
return Lr({}, o, r), e;
|
|
610
610
|
}
|
|
611
611
|
function Ft(o) {
|
|
612
|
-
return o.reduce((e, { key: r, value:
|
|
613
|
-
const { type:
|
|
614
|
-
return e[r.name] =
|
|
612
|
+
return o.reduce((e, { key: r, value: s }) => {
|
|
613
|
+
const { type: i } = s;
|
|
614
|
+
return e[r.name] = i === "Literal" ? s.value : i === "ArrayExpression" ? s.elements.map((l) => l.value) : s.value, e;
|
|
615
615
|
}, {});
|
|
616
616
|
}
|
|
617
617
|
function Ur(o) {
|
|
618
618
|
let e = {
|
|
619
619
|
resolveRelations: []
|
|
620
620
|
};
|
|
621
|
-
function r(
|
|
622
|
-
|
|
623
|
-
}
|
|
624
|
-
for (const
|
|
625
|
-
if (
|
|
626
|
-
const { apiOptions:
|
|
627
|
-
if (r(
|
|
628
|
-
const { resolveRelations: u, ...
|
|
629
|
-
r(u), Object.assign(e,
|
|
621
|
+
function r(s) {
|
|
622
|
+
s && (Array.isArray(s) ? e.resolveRelations.push(...s) : e.resolveRelations.push(s));
|
|
623
|
+
}
|
|
624
|
+
for (const s of o)
|
|
625
|
+
if (s.options) {
|
|
626
|
+
const { apiOptions: i, bridgeOptions: l } = s.options;
|
|
627
|
+
if (r(i == null ? void 0 : i.resolve_relations), l) {
|
|
628
|
+
const { resolveRelations: u, ...h } = l;
|
|
629
|
+
r(u), Object.assign(e, h);
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
return e.resolveRelations = [...new Set(e.resolveRelations)], e;
|
|
633
633
|
}
|
|
634
634
|
let F = [];
|
|
635
|
-
function
|
|
635
|
+
function Fr() {
|
|
636
636
|
let o = [];
|
|
637
637
|
const e = "virtual:storyblok-bridge", r = "\0" + e;
|
|
638
|
-
let
|
|
638
|
+
let s = null, i = null;
|
|
639
639
|
return {
|
|
640
640
|
name: "vite-plugin-storyblok-bridge",
|
|
641
641
|
async resolveId(l) {
|
|
@@ -643,15 +643,15 @@ function Dr() {
|
|
|
643
643
|
return r;
|
|
644
644
|
},
|
|
645
645
|
async transform(l, u) {
|
|
646
|
-
var
|
|
647
|
-
if (u.includes("node_modules") && !u.includes("/pages/") || !l.includes("useStoryblok") || !((
|
|
646
|
+
var T;
|
|
647
|
+
if (u.includes("node_modules") && !u.includes("/pages/") || !l.includes("useStoryblok") || !((T = this.getModuleInfo(u).meta) != null && T.astro))
|
|
648
648
|
return;
|
|
649
|
-
const [, ...d] = u.split("src/pages/"),
|
|
650
|
-
F.length && (o = F.filter((
|
|
651
|
-
url:
|
|
649
|
+
const [, ...d] = u.split("src/pages/"), g = d.join("/").replace(".astro", ""), v = Dr(this.parse(l));
|
|
650
|
+
F.length && (o = F.filter((w) => w.url !== g)), o.push({
|
|
651
|
+
url: g,
|
|
652
652
|
options: v
|
|
653
|
-
}),
|
|
654
|
-
|
|
653
|
+
}), s && (i && clearTimeout(i), i = setTimeout(() => {
|
|
654
|
+
Br(F, o) || (F.length !== 0 && (s.restart(), console.info("Updating bridge options...")), F = [...o]);
|
|
655
655
|
}, 1e3));
|
|
656
656
|
},
|
|
657
657
|
async load(l) {
|
|
@@ -659,50 +659,50 @@ function Dr() {
|
|
|
659
659
|
return `export const bridgeOptions = ${JSON.stringify(Ur(o))}`;
|
|
660
660
|
},
|
|
661
661
|
configureServer(l) {
|
|
662
|
-
|
|
662
|
+
s = l;
|
|
663
663
|
}
|
|
664
664
|
};
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
return e.every(({ url: r, options:
|
|
668
|
-
const
|
|
669
|
-
return
|
|
666
|
+
function Br(o = [], e = []) {
|
|
667
|
+
return e.every(({ url: r, options: s }) => {
|
|
668
|
+
const i = o.find((l) => (l == null ? void 0 : l.url) === r);
|
|
669
|
+
return i && JSON.stringify(s) === JSON.stringify(i.options);
|
|
670
670
|
});
|
|
671
671
|
}
|
|
672
672
|
let Bt = !1;
|
|
673
|
-
const Ht = [],
|
|
674
|
-
if (typeof window > "u" || (window.storyblokRegisterEvent = (
|
|
673
|
+
const Ht = [], Hr = (o) => new Promise((e, r) => {
|
|
674
|
+
if (typeof window > "u" || (window.storyblokRegisterEvent = (i) => {
|
|
675
675
|
if (window.location === window.parent.location) {
|
|
676
676
|
console.warn("You are not in Draft Mode or in the Visual Editor.");
|
|
677
677
|
return;
|
|
678
678
|
}
|
|
679
|
-
Bt ?
|
|
679
|
+
Bt ? i() : Ht.push(i);
|
|
680
680
|
}, document.getElementById("storyblok-javascript-bridge")))
|
|
681
681
|
return;
|
|
682
|
-
const
|
|
683
|
-
|
|
684
|
-
Ht.forEach((l) => l()), Bt = !0, e(
|
|
685
|
-
}, document.getElementsByTagName("head")[0].appendChild(
|
|
682
|
+
const s = document.createElement("script");
|
|
683
|
+
s.async = !0, s.src = o, s.id = "storyblok-javascript-bridge", s.onerror = (i) => r(i), s.onload = (i) => {
|
|
684
|
+
Ht.forEach((l) => l()), Bt = !0, e(i);
|
|
685
|
+
}, document.getElementsByTagName("head")[0].appendChild(s);
|
|
686
686
|
});
|
|
687
|
-
var
|
|
688
|
-
class
|
|
687
|
+
var qr = Object.defineProperty, Gr = (o, e, r) => e in o ? qr(o, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[e] = r, O = (o, e, r) => (Gr(o, typeof e != "symbol" ? e + "" : e, r), r);
|
|
688
|
+
class Jr {
|
|
689
689
|
constructor() {
|
|
690
|
-
O(this, "isCDNUrl", (e = "") => e.indexOf("/cdn/") > -1), O(this, "getOptionsPage", (e, r = 25,
|
|
690
|
+
O(this, "isCDNUrl", (e = "") => e.indexOf("/cdn/") > -1), O(this, "getOptionsPage", (e, r = 25, s = 1) => ({
|
|
691
691
|
...e,
|
|
692
692
|
per_page: r,
|
|
693
|
-
page:
|
|
693
|
+
page: s
|
|
694
694
|
})), O(this, "delay", (e) => new Promise((r) => setTimeout(r, e))), O(this, "arrayFrom", (e = 0, r) => [...Array(e)].map(r)), O(this, "range", (e = 0, r = e) => {
|
|
695
|
-
const
|
|
696
|
-
return this.arrayFrom(
|
|
697
|
-
}), O(this, "asyncMap", async (e, r) => Promise.all(e.map(r))), O(this, "flatMap", (e = [], r) => e.map(r).reduce((
|
|
695
|
+
const s = Math.abs(r - e) || 0, i = e < r ? 1 : -1;
|
|
696
|
+
return this.arrayFrom(s, (l, u) => u * i + e);
|
|
697
|
+
}), O(this, "asyncMap", async (e, r) => Promise.all(e.map(r))), O(this, "flatMap", (e = [], r) => e.map(r).reduce((s, i) => [...s, ...i], [])), O(this, "escapeHTML", function(e) {
|
|
698
698
|
const r = {
|
|
699
699
|
"&": "&",
|
|
700
700
|
"<": "<",
|
|
701
701
|
">": ">",
|
|
702
702
|
'"': """,
|
|
703
703
|
"'": "'"
|
|
704
|
-
},
|
|
705
|
-
return e &&
|
|
704
|
+
}, s = /[&<>"']/g, i = RegExp(s.source);
|
|
705
|
+
return e && i.test(e) ? e.replace(s, (l) => r[l]) : e;
|
|
706
706
|
});
|
|
707
707
|
}
|
|
708
708
|
/**
|
|
@@ -712,20 +712,20 @@ class Gr {
|
|
|
712
712
|
* @param {Boolean} isArray
|
|
713
713
|
* @return {String} Stringified object
|
|
714
714
|
*/
|
|
715
|
-
stringify(e, r,
|
|
716
|
-
const
|
|
715
|
+
stringify(e, r, s) {
|
|
716
|
+
const i = [];
|
|
717
717
|
for (const l in e) {
|
|
718
718
|
if (!Object.prototype.hasOwnProperty.call(e, l))
|
|
719
719
|
continue;
|
|
720
|
-
const u = e[l],
|
|
720
|
+
const u = e[l], h = s ? "" : encodeURIComponent(l);
|
|
721
721
|
let d;
|
|
722
722
|
typeof u == "object" ? d = this.stringify(
|
|
723
723
|
u,
|
|
724
|
-
r ? r + encodeURIComponent("[" +
|
|
724
|
+
r ? r + encodeURIComponent("[" + h + "]") : h,
|
|
725
725
|
Array.isArray(u)
|
|
726
|
-
) : d = (r ? r + encodeURIComponent("[" +
|
|
726
|
+
) : d = (r ? r + encodeURIComponent("[" + h + "]") : h) + "=" + encodeURIComponent(u), i.push(d);
|
|
727
727
|
}
|
|
728
|
-
return
|
|
728
|
+
return i.join("&");
|
|
729
729
|
}
|
|
730
730
|
/**
|
|
731
731
|
* @method getRegionURL
|
|
@@ -733,12 +733,12 @@ class Gr {
|
|
|
733
733
|
* @return {String} The base URL of the region
|
|
734
734
|
*/
|
|
735
735
|
getRegionURL(e) {
|
|
736
|
-
const r = "api.storyblok.com",
|
|
736
|
+
const r = "api.storyblok.com", s = "api-us.storyblok.com", i = "app.storyblokchina.cn", l = "api-ap.storyblok.com", u = "api-ca.storyblok.com";
|
|
737
737
|
switch (e) {
|
|
738
738
|
case "us":
|
|
739
|
-
return i;
|
|
740
|
-
case "cn":
|
|
741
739
|
return s;
|
|
740
|
+
case "cn":
|
|
741
|
+
return i;
|
|
742
742
|
case "ap":
|
|
743
743
|
return l;
|
|
744
744
|
case "ca":
|
|
@@ -748,20 +748,20 @@ class Gr {
|
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
const
|
|
751
|
+
const Kr = function(o, e) {
|
|
752
752
|
const r = {};
|
|
753
|
-
for (const
|
|
754
|
-
const
|
|
755
|
-
e.indexOf(
|
|
753
|
+
for (const s in o) {
|
|
754
|
+
const i = o[s];
|
|
755
|
+
e.indexOf(s) > -1 && i !== null && (r[s] = i);
|
|
756
756
|
}
|
|
757
757
|
return r;
|
|
758
|
-
},
|
|
758
|
+
}, Wr = (o) => o === "email", Yr = () => ({
|
|
759
759
|
singleTag: "hr"
|
|
760
|
-
}), Yr = () => ({
|
|
761
|
-
tag: "blockquote"
|
|
762
760
|
}), Xr = () => ({
|
|
761
|
+
tag: "blockquote"
|
|
762
|
+
}), Zr = () => ({
|
|
763
763
|
tag: "ul"
|
|
764
|
-
}),
|
|
764
|
+
}), Qr = (o) => ({
|
|
765
765
|
tag: [
|
|
766
766
|
"pre",
|
|
767
767
|
{
|
|
@@ -769,24 +769,24 @@ const Jr = function(o, e) {
|
|
|
769
769
|
attrs: o.attrs
|
|
770
770
|
}
|
|
771
771
|
]
|
|
772
|
-
}),
|
|
772
|
+
}), Vr = () => ({
|
|
773
773
|
singleTag: "br"
|
|
774
|
-
}), Vr = (o) => ({
|
|
775
|
-
tag: `h${o.attrs.level}`
|
|
776
774
|
}), tn = (o) => ({
|
|
775
|
+
tag: `h${o.attrs.level}`
|
|
776
|
+
}), en = (o) => ({
|
|
777
777
|
singleTag: [
|
|
778
778
|
{
|
|
779
779
|
tag: "img",
|
|
780
|
-
attrs:
|
|
780
|
+
attrs: Kr(o.attrs, ["src", "alt", "title"])
|
|
781
781
|
}
|
|
782
782
|
]
|
|
783
|
-
}), en = () => ({
|
|
784
|
-
tag: "li"
|
|
785
783
|
}), rn = () => ({
|
|
786
|
-
tag: "
|
|
784
|
+
tag: "li"
|
|
787
785
|
}), nn = () => ({
|
|
786
|
+
tag: "ol"
|
|
787
|
+
}), on = () => ({
|
|
788
788
|
tag: "p"
|
|
789
|
-
}),
|
|
789
|
+
}), an = (o) => ({
|
|
790
790
|
tag: [
|
|
791
791
|
{
|
|
792
792
|
tag: "span",
|
|
@@ -797,27 +797,27 @@ const Jr = function(o, e) {
|
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
799
|
]
|
|
800
|
-
}), an = () => ({
|
|
801
|
-
tag: "b"
|
|
802
800
|
}), sn = () => ({
|
|
803
|
-
tag: "
|
|
801
|
+
tag: "b"
|
|
804
802
|
}), ln = () => ({
|
|
805
|
-
tag: "
|
|
803
|
+
tag: "s"
|
|
806
804
|
}), cn = () => ({
|
|
807
|
-
tag: "
|
|
805
|
+
tag: "u"
|
|
808
806
|
}), un = () => ({
|
|
809
|
-
tag: "
|
|
807
|
+
tag: "strong"
|
|
810
808
|
}), fn = () => ({
|
|
809
|
+
tag: "code"
|
|
810
|
+
}), pn = () => ({
|
|
811
811
|
tag: "i"
|
|
812
|
-
}),
|
|
812
|
+
}), dn = (o) => {
|
|
813
813
|
if (!o.attrs)
|
|
814
814
|
return {
|
|
815
815
|
tag: ""
|
|
816
816
|
};
|
|
817
|
-
const e = new
|
|
818
|
-
if (delete r.linktype, r.href && (r.href = e(o.attrs.href || "")),
|
|
819
|
-
for (const
|
|
820
|
-
r[
|
|
817
|
+
const e = new Jr().escapeHTML, r = { ...o.attrs }, { linktype: s = "url" } = o.attrs;
|
|
818
|
+
if (delete r.linktype, r.href && (r.href = e(o.attrs.href || "")), Wr(s) && (r.href = `mailto:${r.href}`), r.anchor && (r.href = `${r.href}#${r.anchor}`, delete r.anchor), r.custom) {
|
|
819
|
+
for (const i in r.custom)
|
|
820
|
+
r[i] = r.custom[i];
|
|
821
821
|
delete r.custom;
|
|
822
822
|
}
|
|
823
823
|
return {
|
|
@@ -828,25 +828,25 @@ const Jr = function(o, e) {
|
|
|
828
828
|
}
|
|
829
829
|
]
|
|
830
830
|
};
|
|
831
|
-
},
|
|
831
|
+
}, gn = (o) => ({
|
|
832
832
|
tag: [
|
|
833
833
|
{
|
|
834
834
|
tag: "span",
|
|
835
835
|
attrs: o.attrs
|
|
836
836
|
}
|
|
837
837
|
]
|
|
838
|
-
}), gn = () => ({
|
|
839
|
-
tag: "sub"
|
|
840
838
|
}), hn = () => ({
|
|
839
|
+
tag: "sub"
|
|
840
|
+
}), yn = () => ({
|
|
841
841
|
tag: "sup"
|
|
842
|
-
}),
|
|
842
|
+
}), bn = (o) => ({
|
|
843
843
|
tag: [
|
|
844
844
|
{
|
|
845
845
|
tag: "span",
|
|
846
846
|
attrs: o.attrs
|
|
847
847
|
}
|
|
848
848
|
]
|
|
849
|
-
}),
|
|
849
|
+
}), mn = (o) => {
|
|
850
850
|
var e;
|
|
851
851
|
return (e = o.attrs) != null && e.color ? {
|
|
852
852
|
tag: [
|
|
@@ -860,7 +860,7 @@ const Jr = function(o, e) {
|
|
|
860
860
|
} : {
|
|
861
861
|
tag: ""
|
|
862
862
|
};
|
|
863
|
-
},
|
|
863
|
+
}, _n = (o) => {
|
|
864
864
|
var e;
|
|
865
865
|
return (e = o.attrs) != null && e.color ? {
|
|
866
866
|
tag: [
|
|
@@ -874,48 +874,48 @@ const Jr = function(o, e) {
|
|
|
874
874
|
} : {
|
|
875
875
|
tag: ""
|
|
876
876
|
};
|
|
877
|
-
},
|
|
877
|
+
}, vn = {
|
|
878
878
|
nodes: {
|
|
879
|
-
horizontal_rule:
|
|
880
|
-
blockquote:
|
|
881
|
-
bullet_list:
|
|
882
|
-
code_block:
|
|
883
|
-
hard_break:
|
|
884
|
-
heading:
|
|
885
|
-
image:
|
|
886
|
-
list_item:
|
|
887
|
-
ordered_list:
|
|
888
|
-
paragraph:
|
|
889
|
-
emoji:
|
|
879
|
+
horizontal_rule: Yr,
|
|
880
|
+
blockquote: Xr,
|
|
881
|
+
bullet_list: Zr,
|
|
882
|
+
code_block: Qr,
|
|
883
|
+
hard_break: Vr,
|
|
884
|
+
heading: tn,
|
|
885
|
+
image: en,
|
|
886
|
+
list_item: rn,
|
|
887
|
+
ordered_list: nn,
|
|
888
|
+
paragraph: on,
|
|
889
|
+
emoji: an
|
|
890
890
|
},
|
|
891
891
|
marks: {
|
|
892
|
-
bold:
|
|
893
|
-
strike:
|
|
894
|
-
underline:
|
|
895
|
-
strong:
|
|
896
|
-
code:
|
|
897
|
-
italic:
|
|
898
|
-
link:
|
|
899
|
-
styled:
|
|
900
|
-
subscript:
|
|
901
|
-
superscript:
|
|
902
|
-
anchor:
|
|
903
|
-
highlight:
|
|
904
|
-
textStyle:
|
|
905
|
-
}
|
|
906
|
-
},
|
|
892
|
+
bold: sn,
|
|
893
|
+
strike: ln,
|
|
894
|
+
underline: cn,
|
|
895
|
+
strong: un,
|
|
896
|
+
code: fn,
|
|
897
|
+
italic: pn,
|
|
898
|
+
link: dn,
|
|
899
|
+
styled: gn,
|
|
900
|
+
subscript: hn,
|
|
901
|
+
superscript: yn,
|
|
902
|
+
anchor: bn,
|
|
903
|
+
highlight: mn,
|
|
904
|
+
textStyle: _n
|
|
905
|
+
}
|
|
906
|
+
}, Tn = function(o) {
|
|
907
907
|
const e = {
|
|
908
908
|
"&": "&",
|
|
909
909
|
"<": "<",
|
|
910
910
|
">": ">",
|
|
911
911
|
'"': """,
|
|
912
912
|
"'": "'"
|
|
913
|
-
}, r = /[&<>"']/g,
|
|
914
|
-
return o &&
|
|
913
|
+
}, r = /[&<>"']/g, s = RegExp(r.source);
|
|
914
|
+
return o && s.test(o) ? o.replace(r, (i) => e[i]) : o;
|
|
915
915
|
};
|
|
916
|
-
class
|
|
916
|
+
class wn {
|
|
917
917
|
constructor(e) {
|
|
918
|
-
O(this, "marks"), O(this, "nodes"), e || (e =
|
|
918
|
+
O(this, "marks"), O(this, "nodes"), e || (e = vn), this.marks = e.marks || [], this.nodes = e.nodes || [];
|
|
919
919
|
}
|
|
920
920
|
addNode(e, r) {
|
|
921
921
|
this.nodes[e] = r;
|
|
@@ -925,10 +925,10 @@ class Tn {
|
|
|
925
925
|
}
|
|
926
926
|
render(e, r = { optimizeImages: !1 }) {
|
|
927
927
|
if (e && e.content && Array.isArray(e.content)) {
|
|
928
|
-
let
|
|
929
|
-
return e.content.forEach((
|
|
930
|
-
|
|
931
|
-
}), r.optimizeImages ? this.optimizeImages(
|
|
928
|
+
let s = "";
|
|
929
|
+
return e.content.forEach((i) => {
|
|
930
|
+
s += this.renderNode(i);
|
|
931
|
+
}), r.optimizeImages ? this.optimizeImages(s, r.optimizeImages) : s;
|
|
932
932
|
}
|
|
933
933
|
return console.warn(
|
|
934
934
|
`The render method must receive an Object with a "content" field.
|
|
@@ -958,61 +958,61 @@ class Tn {
|
|
|
958
958
|
), "";
|
|
959
959
|
}
|
|
960
960
|
optimizeImages(e, r) {
|
|
961
|
-
let
|
|
962
|
-
typeof r != "boolean" && (typeof r.width == "number" && r.width > 0 && (l += `width="${r.width}" `,
|
|
963
|
-
const
|
|
961
|
+
let s = 0, i = 0, l = "", u = "";
|
|
962
|
+
typeof r != "boolean" && (typeof r.width == "number" && r.width > 0 && (l += `width="${r.width}" `, s = r.width), typeof r.height == "number" && r.height > 0 && (l += `height="${r.height}" `, i = r.height), (r.loading === "lazy" || r.loading === "eager") && (l += `loading="${r.loading}" `), typeof r.class == "string" && r.class.length > 0 && (l += `class="${r.class}" `), r.filters && (typeof r.filters.blur == "number" && r.filters.blur >= 0 && r.filters.blur <= 100 && (u += `:blur(${r.filters.blur})`), typeof r.filters.brightness == "number" && r.filters.brightness >= -100 && r.filters.brightness <= 100 && (u += `:brightness(${r.filters.brightness})`), r.filters.fill && (r.filters.fill.match(/[0-9A-Fa-f]{6}/g) || r.filters.fill === "transparent") && (u += `:fill(${r.filters.fill})`), r.filters.format && ["webp", "png", "jpeg"].includes(r.filters.format) && (u += `:format(${r.filters.format})`), typeof r.filters.grayscale == "boolean" && r.filters.grayscale && (u += ":grayscale()"), typeof r.filters.quality == "number" && r.filters.quality >= 0 && r.filters.quality <= 100 && (u += `:quality(${r.filters.quality})`), r.filters.rotate && [90, 180, 270].includes(r.filters.rotate) && (u += `:rotate(${r.filters.rotate})`), u.length > 0 && (u = "/filters" + u))), l.length > 0 && (e = e.replace(/<img/g, `<img ${l.trim()}`));
|
|
963
|
+
const h = s > 0 || i > 0 || u.length > 0 ? `${s}x${i}${u}` : "";
|
|
964
964
|
return e = e.replace(
|
|
965
965
|
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g,
|
|
966
|
-
`a.storyblok.com/f/$1/$2.$3/m/${
|
|
966
|
+
`a.storyblok.com/f/$1/$2.$3/m/${h}`
|
|
967
967
|
), typeof r != "boolean" && (r.sizes || r.srcset) && (e = e.replace(/<img.*?src=["|'](.*?)["|']/g, (d) => {
|
|
968
|
-
var
|
|
969
|
-
const
|
|
968
|
+
var g, v;
|
|
969
|
+
const T = d.match(
|
|
970
970
|
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|tiff|bmp)/g
|
|
971
971
|
);
|
|
972
|
-
if (
|
|
973
|
-
const
|
|
974
|
-
srcset: (
|
|
972
|
+
if (T && T.length > 0) {
|
|
973
|
+
const w = {
|
|
974
|
+
srcset: (g = r.srcset) == null ? void 0 : g.map((A) => {
|
|
975
975
|
if (typeof A == "number")
|
|
976
|
-
return `//${
|
|
976
|
+
return `//${T}/m/${A}x0${u} ${A}w`;
|
|
977
977
|
if (typeof A == "object" && A.length === 2) {
|
|
978
978
|
let P = 0, B = 0;
|
|
979
|
-
return typeof A[0] == "number" && (P = A[0]), typeof A[1] == "number" && (B = A[1]), `//${
|
|
979
|
+
return typeof A[0] == "number" && (P = A[0]), typeof A[1] == "number" && (B = A[1]), `//${T}/m/${P}x${B}${u} ${P}w`;
|
|
980
980
|
}
|
|
981
981
|
}).join(", "),
|
|
982
982
|
sizes: (v = r.sizes) == null ? void 0 : v.map((A) => A).join(", ")
|
|
983
983
|
};
|
|
984
984
|
let E = "";
|
|
985
|
-
return
|
|
985
|
+
return w.srcset && (E += `srcset="${w.srcset}" `), w.sizes && (E += `sizes="${w.sizes}" `), d.replace(/<img/g, `<img ${E.trim()}`);
|
|
986
986
|
}
|
|
987
987
|
return d;
|
|
988
988
|
})), e;
|
|
989
989
|
}
|
|
990
990
|
renderNode(e) {
|
|
991
991
|
const r = [];
|
|
992
|
-
e.marks && e.marks.forEach((
|
|
993
|
-
const l = this.getMatchingMark(
|
|
992
|
+
e.marks && e.marks.forEach((i) => {
|
|
993
|
+
const l = this.getMatchingMark(i);
|
|
994
994
|
l && l.tag !== "" && r.push(this.renderOpeningTag(l.tag));
|
|
995
995
|
});
|
|
996
|
-
const
|
|
997
|
-
return
|
|
998
|
-
r.push(this.renderNode(
|
|
999
|
-
}) : e.text ? r.push(
|
|
1000
|
-
const l = this.getMatchingMark(
|
|
996
|
+
const s = this.getMatchingNode(e);
|
|
997
|
+
return s && s.tag && r.push(this.renderOpeningTag(s.tag)), e.content ? e.content.forEach((i) => {
|
|
998
|
+
r.push(this.renderNode(i));
|
|
999
|
+
}) : e.text ? r.push(Tn(e.text)) : s && s.singleTag ? r.push(this.renderTag(s.singleTag, " /")) : s && s.html ? r.push(s.html) : e.type === "emoji" && r.push(this.renderEmoji(e)), s && s.tag && r.push(this.renderClosingTag(s.tag)), e.marks && e.marks.slice(0).reverse().forEach((i) => {
|
|
1000
|
+
const l = this.getMatchingMark(i);
|
|
1001
1001
|
l && l.tag !== "" && r.push(this.renderClosingTag(l.tag));
|
|
1002
1002
|
}), r.join("");
|
|
1003
1003
|
}
|
|
1004
1004
|
renderTag(e, r) {
|
|
1005
|
-
return e.constructor === String ? `<${e}${r}>` : e.map((
|
|
1006
|
-
if (
|
|
1007
|
-
return `<${
|
|
1005
|
+
return e.constructor === String ? `<${e}${r}>` : e.map((s) => {
|
|
1006
|
+
if (s.constructor === String)
|
|
1007
|
+
return `<${s}${r}>`;
|
|
1008
1008
|
{
|
|
1009
|
-
let
|
|
1010
|
-
if (
|
|
1011
|
-
for (const l in
|
|
1012
|
-
const u =
|
|
1013
|
-
u !== null && (
|
|
1009
|
+
let i = `<${s.tag}`;
|
|
1010
|
+
if (s.attrs)
|
|
1011
|
+
for (const l in s.attrs) {
|
|
1012
|
+
const u = s.attrs[l];
|
|
1013
|
+
u !== null && (i += ` ${l}="${u}"`);
|
|
1014
1014
|
}
|
|
1015
|
-
return `${
|
|
1015
|
+
return `${i}${r}>`;
|
|
1016
1016
|
}
|
|
1017
1017
|
}).join("");
|
|
1018
1018
|
}
|
|
@@ -1064,48 +1064,56 @@ const jn = (o) => {
|
|
|
1064
1064
|
return {};
|
|
1065
1065
|
}
|
|
1066
1066
|
};
|
|
1067
|
-
let
|
|
1068
|
-
const
|
|
1067
|
+
let An, In = "https://app.storyblok.com/f/storyblok-v2-latest.js";
|
|
1068
|
+
const kn = (o, e) => {
|
|
1069
1069
|
o.addNode("blok", (r) => {
|
|
1070
|
-
let
|
|
1071
|
-
return r.attrs.body.forEach((
|
|
1072
|
-
|
|
1070
|
+
let s = "";
|
|
1071
|
+
return r.attrs.body.forEach((i) => {
|
|
1072
|
+
s += e(i.component, i);
|
|
1073
1073
|
}), {
|
|
1074
|
-
html:
|
|
1074
|
+
html: s
|
|
1075
1075
|
};
|
|
1076
1076
|
});
|
|
1077
|
-
},
|
|
1078
|
-
let
|
|
1079
|
-
if (!
|
|
1077
|
+
}, On = (o) => !o || !(o != null && o.content.some((e) => e.content || e.type === "blok" || e.type === "horizontal_rule")), Sn = (o, e, r) => {
|
|
1078
|
+
let s = r || An;
|
|
1079
|
+
if (!s) {
|
|
1080
1080
|
console.error(
|
|
1081
1081
|
"Please initialize the Storyblok SDK before calling the renderRichText function"
|
|
1082
1082
|
);
|
|
1083
1083
|
return;
|
|
1084
1084
|
}
|
|
1085
|
-
return
|
|
1086
|
-
},
|
|
1087
|
-
|
|
1088
|
-
|
|
1085
|
+
return On(o) ? "" : (e && (s = new wn(e.schema), e.resolver && kn(s, e.resolver)), s.render(o));
|
|
1086
|
+
}, xn = () => Hr(In);
|
|
1087
|
+
let qt;
|
|
1088
|
+
async function En(o) {
|
|
1089
|
+
var s;
|
|
1089
1090
|
const { action: e, story: r } = o || {};
|
|
1090
1091
|
if (e === "input" && r) {
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1092
|
+
const i = async () => {
|
|
1093
|
+
const u = performance.now(), h = await $n(r), d = performance.now();
|
|
1094
|
+
console.log(`getNewHTMLBody took ${d - u} milliseconds.`);
|
|
1095
|
+
const g = document.body;
|
|
1096
|
+
if (h.outerHTML === g.outerHTML)
|
|
1097
|
+
return;
|
|
1098
|
+
const v = document.querySelector('[data-blok-focused="true"]');
|
|
1099
|
+
Cn(g, h, v);
|
|
1100
|
+
const T = performance.now();
|
|
1101
|
+
console.log(`updateDOMWithNewBody took ${T - d} milliseconds.`), console.log(`total time took ${T - u} milliseconds.`);
|
|
1102
|
+
};
|
|
1103
|
+
clearTimeout(qt), qt = setTimeout(i, 1500);
|
|
1104
|
+
}
|
|
1105
|
+
["published", "change"].includes((s = o == null ? void 0 : o.data) == null ? void 0 : s.action) && location.reload();
|
|
1098
1106
|
}
|
|
1099
|
-
function
|
|
1107
|
+
function Cn(o, e, r) {
|
|
1100
1108
|
if (r) {
|
|
1101
|
-
const
|
|
1102
|
-
`[data-blok-uid="${
|
|
1109
|
+
const s = r.getAttribute("data-blok-uid"), i = e.querySelector(
|
|
1110
|
+
`[data-blok-uid="${s}"]`
|
|
1103
1111
|
);
|
|
1104
|
-
|
|
1112
|
+
i && (i.setAttribute("data-blok-focused", "true"), console.log("Doing partial replace"), r.replaceWith(i));
|
|
1105
1113
|
} else
|
|
1106
1114
|
console.log("Doing full replace"), o.replaceWith(e);
|
|
1107
1115
|
}
|
|
1108
|
-
async function
|
|
1116
|
+
async function $n(o) {
|
|
1109
1117
|
const r = await (await fetch(location.href, {
|
|
1110
1118
|
method: "POST",
|
|
1111
1119
|
body: JSON.stringify({
|
|
@@ -1118,25 +1126,25 @@ async function Cn(o) {
|
|
|
1118
1126
|
})).text();
|
|
1119
1127
|
return new DOMParser().parseFromString(r, "text/html").body;
|
|
1120
1128
|
}
|
|
1121
|
-
function
|
|
1129
|
+
function Rn() {
|
|
1122
1130
|
return globalThis.storyblokApiInstance || console.error("storyblokApiInstance has not been initialized correctly"), globalThis.storyblokApiInstance;
|
|
1123
1131
|
}
|
|
1124
|
-
async function
|
|
1132
|
+
async function Mn(o, e = {}, r = {}, s) {
|
|
1125
1133
|
globalThis.storyblokApiInstance || console.error("storyblokApiInstance has not been initialized correctly");
|
|
1126
|
-
let
|
|
1127
|
-
if (
|
|
1128
|
-
|
|
1134
|
+
let i = null;
|
|
1135
|
+
if (s && s.locals._storyblok_preview_data)
|
|
1136
|
+
i = s.locals._storyblok_preview_data;
|
|
1129
1137
|
else {
|
|
1130
1138
|
const { data: l } = await globalThis.storyblokApiInstance.get(
|
|
1131
1139
|
o,
|
|
1132
1140
|
e,
|
|
1133
1141
|
r
|
|
1134
1142
|
);
|
|
1135
|
-
|
|
1143
|
+
i = l.story;
|
|
1136
1144
|
}
|
|
1137
|
-
return
|
|
1145
|
+
return i;
|
|
1138
1146
|
}
|
|
1139
|
-
function
|
|
1147
|
+
function Pn(o, e) {
|
|
1140
1148
|
const r = globalThis.storyblokApiInstance.richTextResolver;
|
|
1141
1149
|
if (!r) {
|
|
1142
1150
|
console.error(
|
|
@@ -1144,9 +1152,9 @@ function Mn(o, e) {
|
|
|
1144
1152
|
);
|
|
1145
1153
|
return;
|
|
1146
1154
|
}
|
|
1147
|
-
return
|
|
1155
|
+
return Sn(o, e, r);
|
|
1148
1156
|
}
|
|
1149
|
-
function
|
|
1157
|
+
function Nn(o) {
|
|
1150
1158
|
const e = {
|
|
1151
1159
|
useCustomApi: !1,
|
|
1152
1160
|
bridge: !0,
|
|
@@ -1159,26 +1167,26 @@ function Pn(o) {
|
|
|
1159
1167
|
hooks: {
|
|
1160
1168
|
"astro:config:setup": ({
|
|
1161
1169
|
injectScript: r,
|
|
1162
|
-
updateConfig:
|
|
1163
|
-
addDevToolbarApp:
|
|
1170
|
+
updateConfig: s,
|
|
1171
|
+
addDevToolbarApp: i,
|
|
1164
1172
|
addMiddleware: l
|
|
1165
1173
|
}) => {
|
|
1166
|
-
|
|
1174
|
+
s({
|
|
1167
1175
|
vite: {
|
|
1168
1176
|
plugins: [
|
|
1169
|
-
|
|
1177
|
+
Sr(
|
|
1170
1178
|
e.accessToken,
|
|
1171
1179
|
e.useCustomApi,
|
|
1172
1180
|
e.apiOptions
|
|
1173
1181
|
),
|
|
1174
|
-
|
|
1182
|
+
Mr(
|
|
1175
1183
|
e.componentsDir,
|
|
1176
1184
|
e.components,
|
|
1177
1185
|
e.enableFallbackComponent,
|
|
1178
1186
|
e.customFallbackComponent
|
|
1179
1187
|
),
|
|
1180
|
-
|
|
1181
|
-
|
|
1188
|
+
Pr(e),
|
|
1189
|
+
Fr()
|
|
1182
1190
|
]
|
|
1183
1191
|
}
|
|
1184
1192
|
}), r(
|
|
@@ -1203,19 +1211,19 @@ function Pn(o) {
|
|
|
1203
1211
|
), l({
|
|
1204
1212
|
entrypoint: "@storyblok/astro/middleware.ts",
|
|
1205
1213
|
order: "pre"
|
|
1206
|
-
})),
|
|
1214
|
+
})), i("@storyblok/astro/toolbarApp.ts");
|
|
1207
1215
|
}
|
|
1208
1216
|
}
|
|
1209
1217
|
};
|
|
1210
1218
|
}
|
|
1211
1219
|
export {
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1220
|
+
wn as RichTextResolver,
|
|
1221
|
+
vn as RichTextSchema,
|
|
1222
|
+
Nn as default,
|
|
1223
|
+
En as handleStoryblokMessage,
|
|
1224
|
+
xn as loadStoryblokBridge,
|
|
1225
|
+
Pn as renderRichText,
|
|
1218
1226
|
jn as storyblokEditable,
|
|
1219
|
-
|
|
1220
|
-
|
|
1227
|
+
Mn as useStoryblok,
|
|
1228
|
+
Rn as useStoryblokApi
|
|
1221
1229
|
};
|