@storyblok/astro 7.2.3 → 7.2.4

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.
@@ -7,14 +7,14 @@ const te = `<svg width="45px" height="53px" viewBox="0 0 45 53" version="1.1" xm
7
7
  </g>
8
8
  </g>
9
9
  </g>
10
- </svg>`, re = /[\p{Lu}]/u, oe = /[\p{Ll}]/u, M = /^[\p{Lu}](?![\p{Lu}])/gu, G = /([\p{Alpha}\p{N}_]|$)/u, O = /[_.\- ]+/, ne = new RegExp("^" + O.source), P = new RegExp(O.source + G.source, "gu"), j = new RegExp("\\d+" + G.source, "gu"), se = (e, t, r, s) => {
11
- let a = !1, n = !1, h = !1, p = !1;
10
+ </svg>`, re = /[\p{Lu}]/u, oe = /[\p{Ll}]/u, M = /^[\p{Lu}](?![\p{Lu}])/gu, G = /([\p{Alpha}\p{N}_]|$)/u, O = /[_.\- ]+/, se = new RegExp("^" + O.source), P = new RegExp(O.source + G.source, "gu"), j = new RegExp("\\d+" + G.source, "gu"), ne = (e, t, r, n) => {
11
+ let a = !1, s = !1, h = !1, p = !1;
12
12
  for (let i = 0; i < e.length; i++) {
13
13
  const d = e[i];
14
- p = i > 2 ? e[i - 3] === "-" : !0, a && re.test(d) ? (e = e.slice(0, i) + "-" + e.slice(i), a = !1, h = n, n = !0, i++) : n && h && oe.test(d) && (!p || s) ? (e = e.slice(0, i - 1) + "-" + e.slice(i - 1), h = n, n = !1, a = !0) : (a = t(d) === d && r(d) !== d, h = n, n = r(d) === d && t(d) !== d);
14
+ p = i > 2 ? e[i - 3] === "-" : !0, a && re.test(d) ? (e = e.slice(0, i) + "-" + e.slice(i), a = !1, h = s, s = !0, i++) : s && h && oe.test(d) && (!p || n) ? (e = e.slice(0, i - 1) + "-" + e.slice(i - 1), h = s, s = !1, a = !0) : (a = t(d) === d && r(d) !== d, h = s, s = r(d) === d && t(d) !== d);
15
15
  }
16
16
  return e;
17
- }, ae = (e, t) => (M.lastIndex = 0, e.replaceAll(M, (r) => t(r))), le = (e, t) => (P.lastIndex = 0, j.lastIndex = 0, e.replaceAll(j, (r, s, a) => ["_", "-"].includes(e.charAt(a + r.length)) ? r : t(r)).replaceAll(P, (r, s) => t(s)));
17
+ }, ae = (e, t) => (M.lastIndex = 0, e.replaceAll(M, (r) => t(r))), le = (e, t) => (P.lastIndex = 0, j.lastIndex = 0, e.replaceAll(j, (r, n, a) => ["_", "-"].includes(e.charAt(a + r.length)) ? r : t(r)).replaceAll(P, (r, n) => t(n)));
18
18
  function ie(e, t) {
19
19
  if (!(typeof e == "string" || Array.isArray(e)))
20
20
  throw new TypeError("Expected the input to be `string | string[]`");
@@ -22,57 +22,57 @@ function ie(e, t) {
22
22
  pascalCase: !1,
23
23
  preserveConsecutiveUppercase: !1,
24
24
  ...t
25
- }, Array.isArray(e) ? e = e.map((n) => n.trim()).filter((n) => n.length).join("-") : e = e.trim(), e.length === 0)
25
+ }, Array.isArray(e) ? e = e.map((s) => s.trim()).filter((s) => s.length).join("-") : e = e.trim(), e.length === 0)
26
26
  return "";
27
- const r = t.locale === !1 ? (n) => n.toLowerCase() : (n) => n.toLocaleLowerCase(t.locale), s = t.locale === !1 ? (n) => n.toUpperCase() : (n) => n.toLocaleUpperCase(t.locale);
28
- return e.length === 1 ? O.test(e) ? "" : t.pascalCase ? s(e) : r(e) : (e !== r(e) && (e = se(e, r, s, t.preserveConsecutiveUppercase)), e = e.replace(ne, ""), e = t.preserveConsecutiveUppercase ? ae(e, r) : r(e), t.pascalCase && (e = s(e.charAt(0)) + e.slice(1)), le(e, s));
27
+ const r = t.locale === !1 ? (s) => s.toLowerCase() : (s) => s.toLocaleLowerCase(t.locale), n = t.locale === !1 ? (s) => s.toUpperCase() : (s) => s.toLocaleUpperCase(t.locale);
28
+ return e.length === 1 ? O.test(e) ? "" : t.pascalCase ? n(e) : r(e) : (e !== r(e) && (e = ne(e, r, n, t.preserveConsecutiveUppercase)), e = e.replace(se, ""), e = t.preserveConsecutiveUppercase ? ae(e, r) : r(e), t.pascalCase && (e = n(e.charAt(0)) + e.slice(1)), le(e, n));
29
29
  }
30
30
  function D(e) {
31
31
  return ie(e);
32
32
  }
33
- function ce(e, t = {}, r, s) {
34
- const a = "virtual:storyblok-components", n = `\0${a}`;
33
+ function ce(e, t = {}, r, n) {
34
+ const a = "virtual:storyblok-components", s = `\0${a}`;
35
35
  return {
36
36
  name: "vite-plugin-storyblok-components",
37
37
  async resolveId(h) {
38
38
  if (h === a)
39
- return n;
39
+ return s;
40
40
  },
41
41
  async load(h) {
42
- if (h === n) {
42
+ if (h === s) {
43
43
  const p = [], i = [];
44
- for await (const [f, v] of Object.entries(t)) {
44
+ for await (const [b, E] of Object.entries(t)) {
45
45
  const A = await this.resolve(
46
- `/${e}/${v}.astro`
46
+ `/${e}/${E}.astro`
47
47
  );
48
48
  if (A)
49
- p.push(`import ${D(f)} from "${A.id}"`);
49
+ p.push(`import ${D(b)} from "${A.id}"`);
50
50
  else if (r)
51
- i.push(f);
51
+ i.push(b);
52
52
  else
53
53
  throw new Error(
54
- `Component could not be found for blok "${f}"! Does "${`/${e}/${v}`}.astro" exist?`
54
+ `Component could not be found for blok "${b}"! Does "${`/${e}/${E}`}.astro" exist?`
55
55
  );
56
56
  }
57
57
  let d = "";
58
58
  if (r)
59
- if (d = ",FallbackComponent", s) {
60
- const f = await this.resolve(
61
- `/${e}/${s}.astro`
59
+ if (d = ",FallbackComponent", n) {
60
+ const b = await this.resolve(
61
+ `/${e}/${n}.astro`
62
62
  );
63
- if (!f)
63
+ if (!b)
64
64
  throw new Error(
65
- `Custom fallback component could not be found. Does "${`/${e}/${s}`}.astro" exist?`
65
+ `Custom fallback component could not be found. Does "${`/${e}/${n}`}.astro" exist?`
66
66
  );
67
67
  p.push(
68
- `import FallbackComponent from "${f.id}"`
68
+ `import FallbackComponent from "${b.id}"`
69
69
  );
70
70
  } else
71
71
  p.push(
72
72
  "import FallbackComponent from '@storyblok/astro/FallbackComponent.astro'"
73
73
  );
74
74
  if (Object.values(t).length)
75
- return `${p.join(";")};export default {${Object.keys(t).filter((f) => !i.includes(f)).map((f) => D(f)).join(",")}${d}}`;
75
+ return `${p.join(";")};export default {${Object.keys(t).filter((b) => !i.includes(b)).map((b) => D(b)).join(",")}${d}}`;
76
76
  if (r)
77
77
  return `${p[0]}; export default {${d.replace(",", "")}}`;
78
78
  throw new Error(
@@ -85,15 +85,15 @@ Detailed information can be found here: https://github.com/storyblok/storyblok-a
85
85
  };
86
86
  }
87
87
  function ue(e, t, r) {
88
- const s = "virtual:storyblok-init", a = `\0${s}`;
88
+ const n = "virtual:storyblok-init", a = `\0${n}`;
89
89
  return {
90
90
  name: "vite-plugin-storyblok-init",
91
- async resolveId(n) {
92
- if (n === s)
91
+ async resolveId(s) {
92
+ if (s === n)
93
93
  return a;
94
94
  },
95
- async load(n) {
96
- if (n === a)
95
+ async load(s) {
96
+ if (s === a)
97
97
  return `
98
98
  import { storyblokInit, apiPlugin } from "@storyblok/js";
99
99
  const { storyblokApi } = storyblokInit({
@@ -110,12 +110,12 @@ function de(e) {
110
110
  const t = "virtual:storyblok-options", r = `\0${t}`;
111
111
  return {
112
112
  name: "vite-plugin-storyblok-options",
113
- async resolveId(s) {
114
- if (s === t)
113
+ async resolveId(n) {
114
+ if (n === t)
115
115
  return r;
116
116
  },
117
- async load(s) {
118
- if (s === r)
117
+ async load(n) {
118
+ if (n === r)
119
119
  return `export default ${JSON.stringify(e)}`;
120
120
  }
121
121
  };
@@ -145,9 +145,9 @@ function Ne(e) {
145
145
  name: "@storyblok/astro",
146
146
  hooks: {
147
147
  "astro:config:setup": ({
148
- injectScript: s,
148
+ injectScript: n,
149
149
  updateConfig: a,
150
- addDevToolbarApp: n,
150
+ addDevToolbarApp: s,
151
151
  addMiddleware: h,
152
152
  config: p
153
153
  }) => {
@@ -172,13 +172,13 @@ function Ne(e) {
172
172
  throw new Error(
173
173
  "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."
174
174
  );
175
- s(
175
+ n(
176
176
  "page-ssr",
177
177
  `
178
178
  import { storyblokApiInstance } from "virtual:storyblok-init";
179
179
  globalThis.storyblokApiInstance = storyblokApiInstance;
180
180
  `
181
- ), t.bridge && !t.livePreview && s(
181
+ ), t.bridge && !t.livePreview && n(
182
182
  "page",
183
183
  `import { loadStoryblokBridge } from "@storyblok/astro";
184
184
  loadStoryblokBridge().then(() => {
@@ -191,7 +191,7 @@ function Ne(e) {
191
191
  });
192
192
  });
193
193
  `
194
- ), t.livePreview && (s(
194
+ ), t.livePreview && (n(
195
195
  "page",
196
196
  `import { loadStoryblokBridge, handleStoryblokMessage } from "@storyblok/astro";
197
197
  loadStoryblokBridge().then(() => {
@@ -203,7 +203,7 @@ function Ne(e) {
203
203
  ), h({
204
204
  entrypoint: "@storyblok/astro/middleware.ts",
205
205
  order: "pre"
206
- })), n({
206
+ })), s({
207
207
  id: "storyblok",
208
208
  name: "Storyblok",
209
209
  icon: te,
@@ -217,27 +217,27 @@ let U;
217
217
  async function Me(e) {
218
218
  const { action: t, story: r } = e || {};
219
219
  if (t === "input" && r) {
220
- const s = async () => {
221
- const n = await fe(r), h = document.body;
222
- if (n.outerHTML === h.outerHTML)
220
+ const n = async () => {
221
+ const s = await be(r), h = document.body;
222
+ if (s.outerHTML === h.outerHTML)
223
223
  return;
224
224
  const p = document.querySelector('[data-blok-focused="true"]');
225
- he(h, n, p), document.dispatchEvent(new Event("storyblok-live-preview-updated"));
225
+ he(h, s, p), document.dispatchEvent(new Event("storyblok-live-preview-updated"));
226
226
  };
227
- clearTimeout(U), U = setTimeout(s, 500);
227
+ clearTimeout(U), U = setTimeout(n, 500);
228
228
  }
229
229
  ["published", "change"].includes(e == null ? void 0 : e.action) && location.reload();
230
230
  }
231
231
  function he(e, t, r) {
232
232
  if (r) {
233
- const s = r.getAttribute("data-blok-uid"), a = t.querySelector(
234
- `[data-blok-uid="${s}"]`
233
+ const n = r.getAttribute("data-blok-uid"), a = t.querySelector(
234
+ `[data-blok-uid="${n}"]`
235
235
  );
236
236
  a && (a.setAttribute("data-blok-focused", "true"), r.replaceWith(a));
237
237
  } else
238
238
  e.replaceWith(t);
239
239
  }
240
- async function fe(e) {
240
+ async function be(e) {
241
241
  const r = await (await fetch(location.href, {
242
242
  method: "POST",
243
243
  body: JSON.stringify({
@@ -257,7 +257,7 @@ I.prototype.attrIndex = function(e) {
257
257
  if (!this.attrs)
258
258
  return -1;
259
259
  const t = this.attrs;
260
- for (let r = 0, s = t.length; r < s; r++)
260
+ for (let r = 0, n = t.length; r < n; r++)
261
261
  if (t[r][0] === e)
262
262
  return r;
263
263
  return -1;
@@ -266,8 +266,8 @@ I.prototype.attrPush = function(e) {
266
266
  this.attrs ? this.attrs.push(e) : this.attrs = [e];
267
267
  };
268
268
  I.prototype.attrSet = function(e, t) {
269
- const r = this.attrIndex(e), s = [e, t];
270
- r < 0 ? this.attrPush(s) : this.attrs[r] = s;
269
+ const r = this.attrIndex(e), n = [e, t];
270
+ r < 0 ? this.attrPush(n) : this.attrs[r] = n;
271
271
  };
272
272
  I.prototype.attrGet = function(e) {
273
273
  const t = this.attrIndex(e);
@@ -278,17 +278,17 @@ I.prototype.attrJoin = function(e, t) {
278
278
  const r = this.attrIndex(e);
279
279
  r < 0 ? this.attrPush([e, t]) : this.attrs[r][1] = this.attrs[r][1] + " " + t;
280
280
  };
281
- const be = "[a-zA-Z_:][a-zA-Z0-9:._-]*", ye = "[^\"'=<>`\\x00-\\x20]+", ge = "'[^']*'", ke = '"[^"]*"', me = "(?:" + ye + "|" + ge + "|" + ke + ")", we = "(?:\\s+" + be + "(?:\\s*=\\s*" + me + ")?)", Ce = "<[A-Za-z][A-Za-z0-9\\-]*" + we + "*\\s*\\/?>", Ee = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>", ve = new RegExp("^(?:" + Ce + "|" + Ee + ")");
282
- new RegExp(ve.source + "\\s*$");
283
- const Z = [];
281
+ const ye = "[a-zA-Z_:][a-zA-Z0-9:._-]*", fe = "[^\"'=<>`\\x00-\\x20]+", ge = "'[^']*'", me = '"[^"]*"', ke = "(?:" + fe + "|" + ge + "|" + me + ")", we = "(?:\\s+" + ye + "(?:\\s*=\\s*" + ke + ")?)", Ce = "<[A-Za-z][A-Za-z0-9\\-]*" + we + "*\\s*\\/?>", ve = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>", Ee = new RegExp("^(?:" + Ce + "|" + ve + ")");
282
+ new RegExp(Ee.source + "\\s*$");
283
+ const K = [];
284
284
  for (let e = 0; e < 256; e++)
285
- Z.push(0);
285
+ K.push(0);
286
286
  "\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e) {
287
- Z[e.charCodeAt(0)] = 1;
287
+ K[e.charCodeAt(0)] = 1;
288
288
  });
289
- let k = /* @__PURE__ */ function(e) {
289
+ let m = /* @__PURE__ */ function(e) {
290
290
  return e.DOCUMENT = "doc", e.HEADING = "heading", e.PARAGRAPH = "paragraph", e.QUOTE = "blockquote", e.OL_LIST = "ordered_list", e.UL_LIST = "bullet_list", e.LIST_ITEM = "list_item", e.CODE_BLOCK = "code_block", e.HR = "horizontal_rule", e.BR = "hard_break", e.IMAGE = "image", e.EMOJI = "emoji", e.COMPONENT = "blok", e.TABLE = "table", e.TABLE_ROW = "tableRow", e.TABLE_CELL = "tableCell", e.TABLE_HEADER = "tableHeader", e;
291
- }({}), E = /* @__PURE__ */ function(e) {
291
+ }({}), v = /* @__PURE__ */ function(e) {
292
292
  return e.BOLD = "bold", e.STRONG = "strong", e.STRIKE = "strike", e.UNDERLINE = "underline", e.ITALIC = "italic", e.CODE = "code", e.LINK = "link", e.ANCHOR = "anchor", e.STYLED = "styled", e.SUPERSCRIPT = "superscript", e.SUBSCRIPT = "subscript", e.TEXT_STYLE = "textStyle", e.HIGHLIGHT = "highlight", e;
293
293
  }({}), Ae = /* @__PURE__ */ function(e) {
294
294
  return e.TEXT = "text", e;
@@ -300,30 +300,30 @@ function Le(e, t) {
300
300
  src: e,
301
301
  attrs: {}
302
302
  };
303
- let r = 0, s = 0;
304
- const a = {}, n = [];
305
- function h(i, d, f, v, A) {
306
- typeof i != "number" || i <= d || i >= f ? console.warn(`[StoryblokRichText] - ${v.charAt(0).toUpperCase() + v.slice(1)} value must be a number between ${d} and ${f} (inclusive)`) : A.push(`${v}(${i})`);
303
+ let r = 0, n = 0;
304
+ const a = {}, s = [];
305
+ function h(i, d, b, E, A) {
306
+ typeof i != "number" || i <= d || i >= b ? console.warn(`[StoryblokRichText] - ${E.charAt(0).toUpperCase() + E.slice(1)} value must be a number between ${d} and ${b} (inclusive)`) : A.push(`${E}(${i})`);
307
307
  }
308
308
  if (typeof t == "object") {
309
- if (typeof t.width == "number" && t.width > 0 ? (a.width = t.width, r = t.width) : console.warn("[StoryblokRichText] - Width value must be a number greater than 0"), t.height && typeof t.height == "number" && t.height > 0 ? (a.height = t.height, s = t.height) : console.warn("[StoryblokRichText] - Height value must be a number greater than 0"), t.loading && ["lazy", "eager"].includes(t.loading) && (a.loading = t.loading), t.class && (a.class = t.class), t.filters) {
310
- const { filters: i } = t || {}, { blur: d, brightness: f, fill: v, format: A, grayscale: C, quality: L, rotate: $ } = i || {};
311
- d && h(d, 0, 100, "blur", n), L && h(L, 0, 100, "quality", n), f && h(f, 0, 100, "brightness", n), v && n.push(`fill(${v})`), C && n.push("grayscale()"), $ && [
309
+ if (typeof t.width == "number" && t.width > 0 ? (a.width = t.width, r = t.width) : console.warn("[StoryblokRichText] - Width value must be a number greater than 0"), t.height && typeof t.height == "number" && t.height > 0 ? (a.height = t.height, n = t.height) : console.warn("[StoryblokRichText] - Height value must be a number greater than 0"), t.loading && ["lazy", "eager"].includes(t.loading) && (a.loading = t.loading), t.class && (a.class = t.class), t.filters) {
310
+ const { filters: i } = t || {}, { blur: d, brightness: b, fill: E, format: A, grayscale: C, quality: L, rotate: $ } = i || {};
311
+ d && h(d, 0, 100, "blur", s), L && h(L, 0, 100, "quality", s), b && h(b, 0, 100, "brightness", s), E && s.push(`fill(${E})`), C && s.push("grayscale()"), $ && [
312
312
  0,
313
313
  90,
314
314
  180,
315
315
  270
316
- ].includes(t.filters.rotate || 0) && n.push(`rotate(${$})`), A && [
316
+ ].includes(t.filters.rotate || 0) && s.push(`rotate(${$})`), A && [
317
317
  "webp",
318
318
  "png",
319
319
  "jpeg"
320
- ].includes(A) && n.push(`format(${A})`);
320
+ ].includes(A) && s.push(`format(${A})`);
321
321
  }
322
322
  t.srcset && (a.srcset = t.srcset.map((i) => {
323
- if (typeof i == "number") return `${e}/m/${i}x0/${n.length > 0 ? `filters:${n.join(":")}` : ""} ${i}w`;
323
+ if (typeof i == "number") return `${e}/m/${i}x0/${s.length > 0 ? `filters:${s.join(":")}` : ""} ${i}w`;
324
324
  if (Array.isArray(i) && i.length === 2) {
325
- const [d, f] = i;
326
- return `${e}/m/${d}x${f}/${n.length > 0 ? `filters:${n.join(":")}` : ""} ${d}w`;
325
+ const [d, b] = i;
326
+ return `${e}/m/${d}x${b}/${s.length > 0 ? `filters:${s.join(":")}` : ""} ${d}w`;
327
327
  } else {
328
328
  console.warn("[StoryblokRichText] - srcset entry must be a number or a tuple of two numbers");
329
329
  return;
@@ -331,7 +331,7 @@ function Le(e, t) {
331
331
  }).join(", ")), t.sizes && (a.sizes = t.sizes.join(", "));
332
332
  }
333
333
  let p = `${e}/m/`;
334
- return r > 0 && s > 0 && (p = `${p}${r}x${s}/`), n.length > 0 && (p = `${p}filters:${n.join(":")}`), {
334
+ return r > 0 && n > 0 && (p = `${p}${r}x${n}/`), s.length > 0 && (p = `${p}filters:${s.join(":")}`), {
335
335
  src: p,
336
336
  attrs: a
337
337
  };
@@ -356,39 +356,39 @@ function Te(e) {
356
356
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
357
357
  }
358
358
  const R = (e) => Object.fromEntries(Object.entries(e).filter(([t, r]) => r !== void 0));
359
- function H(e, t = {}, r) {
360
- const s = $e(t), a = s ? `${e} ${s}` : e, n = Array.isArray(r) ? r.join("") : r || "";
359
+ function F(e, t = {}, r) {
360
+ const n = $e(t), a = n ? `${e} ${n}` : e, s = Array.isArray(r) ? r.join("") : r || "";
361
361
  if (e) {
362
362
  if (Ie.includes(e)) return `<${a}>`;
363
- } else return n;
364
- return `<${a}>${n}</${e}>`;
363
+ } else return s;
364
+ return `<${a}>${s}</${e}>`;
365
365
  }
366
366
  function Re(e = {}) {
367
- const t = /* @__PURE__ */ new Map(), { renderFn: r = H, textFn: s = Te, resolvers: a = {}, optimizeImages: n = !1, keyedResolvers: h = !1 } = e, p = r !== H, i = (o) => (l, c) => {
367
+ const t = /* @__PURE__ */ new Map(), { renderFn: r = F, textFn: n = Te, resolvers: a = {}, optimizeImages: s = !1, keyedResolvers: h = !1 } = e, p = r !== F, i = (o) => (l, c) => {
368
368
  const u = l.attrs || {};
369
369
  return c.render(o, u, l.children || null);
370
370
  }, d = (o, l) => {
371
- const { src: c, alt: u, title: b, srcset: m, sizes: y } = o.attrs || {};
371
+ const { src: c, alt: u, title: y, srcset: k, sizes: f } = o.attrs || {};
372
372
  let g = c, w = {};
373
- if (n) {
374
- const { src: Q, attrs: ee } = Le(c, n);
373
+ if (s) {
374
+ const { src: Q, attrs: ee } = Le(c, s);
375
375
  g = Q, w = ee;
376
376
  }
377
377
  const X = {
378
378
  src: g,
379
379
  alt: u,
380
- title: b,
381
- srcset: m,
382
- sizes: y,
380
+ title: y,
381
+ srcset: k,
382
+ sizes: f,
383
383
  ...w
384
384
  };
385
385
  return l.render("img", R(X));
386
- }, f = (o, l) => {
386
+ }, b = (o, l) => {
387
387
  const { level: c, ...u } = o.attrs || {};
388
388
  return l.render(`h${c}`, u, o.children);
389
- }, v = (o, l) => {
390
- var c, u, b, m;
391
- const y = l.render("img", {
389
+ }, E = (o, l) => {
390
+ var c, u, y, k;
391
+ const f = l.render("img", {
392
392
  src: (c = o.attrs) == null ? void 0 : c.fallbackImage,
393
393
  alt: (u = o.attrs) == null ? void 0 : u.alt,
394
394
  style: "width: 1.25em; height: 1.25em; vertical-align: text-top",
@@ -397,108 +397,108 @@ function Re(e = {}) {
397
397
  });
398
398
  return l.render("span", {
399
399
  "data-type": "emoji",
400
- "data-name": (b = o.attrs) == null ? void 0 : b.name,
401
- "data-emoji": (m = o.attrs) == null ? void 0 : m.emoji
402
- }, y);
403
- }, A = (o, l) => l.render("pre", o.attrs || {}, l.render("code", {}, o.children || "")), C = (o, l = !1) => ({ text: c, attrs: u }, b) => {
404
- const { class: m, id: y, ...g } = u || {}, w = l ? {
405
- class: m,
406
- id: y,
400
+ "data-name": (y = o.attrs) == null ? void 0 : y.name,
401
+ "data-emoji": (k = o.attrs) == null ? void 0 : k.emoji
402
+ }, f);
403
+ }, A = (o, l) => l.render("pre", o.attrs || {}, l.render("code", {}, o.children || "")), C = (o, l = !1) => ({ text: c, attrs: u }, y) => {
404
+ const { class: k, id: f, ...g } = u || {}, w = l ? {
405
+ class: k,
406
+ id: f,
407
407
  style: Se(g) || void 0
408
408
  } : u || {};
409
- return b.render(o, R(w), c);
409
+ return y.render(o, R(w), c);
410
410
  }, L = (o) => x(o), $ = (o) => {
411
411
  const { marks: l, ...c } = o;
412
412
  if ("text" in o) {
413
- if (l) return l.reduce((b, m) => L({
414
- ...m,
415
- text: b
413
+ if (l) return l.reduce((y, k) => L({
414
+ ...k,
415
+ text: y
416
416
  }), L({
417
417
  ...c,
418
418
  children: c.children
419
419
  }));
420
420
  const u = o.attrs || {};
421
421
  if (h) {
422
- const b = t.get("txt") || 0;
423
- t.set("txt", b + 1), u.key = `txt-${b}`;
422
+ const y = t.get("txt") || 0;
423
+ t.set("txt", y + 1), u.key = `txt-${y}`;
424
424
  }
425
- return s(c.text, u);
425
+ return n(c.text, u);
426
426
  }
427
427
  return "";
428
428
  }, _ = (o, l) => {
429
- const { linktype: c, href: u, anchor: b, ...m } = o.attrs || {};
430
- let y = "";
429
+ const { linktype: c, href: u, anchor: y, ...k } = o.attrs || {};
430
+ let f = "";
431
431
  switch (c) {
432
432
  case T.ASSET:
433
433
  case T.URL:
434
- y = u;
434
+ f = u;
435
435
  break;
436
436
  case T.EMAIL:
437
- y = `mailto:${u}`;
437
+ f = `mailto:${u}`;
438
438
  break;
439
439
  case T.STORY:
440
- y = u, b && (y = `${y}#${b}`);
440
+ f = u, y && (f = `${f}#${y}`);
441
441
  break;
442
442
  default:
443
- y = u;
443
+ f = u;
444
444
  break;
445
445
  }
446
- const g = { ...m };
447
- return y && (g.href = y), l.render("a", g, o.text);
448
- }, J = (o, l) => {
446
+ const g = { ...k };
447
+ return f && (g.href = f), l.render("a", g, o.text);
448
+ }, Z = (o, l) => {
449
449
  var c, u;
450
450
  return console.warn("[StoryblokRichtText] - BLOK resolver is not available for vanilla usage"), l.render("span", {
451
451
  blok: (c = o == null ? void 0 : o.attrs) == null ? void 0 : c.body[0],
452
452
  id: (u = o.attrs) == null ? void 0 : u.id,
453
453
  style: "display: none"
454
454
  });
455
- }, K = (o, l) => {
455
+ }, J = (o, l) => {
456
456
  const c = {}, u = l.render("tbody", {}, o.children);
457
457
  return l.render("table", c, u);
458
- }, W = (o, l) => {
458
+ }, Y = (o, l) => {
459
459
  const c = {};
460
460
  return l.render("tr", c, o.children);
461
- }, Y = (o, l) => {
462
- const { colspan: c, rowspan: u, colwidth: b, backgroundColor: m, ...y } = o.attrs || {}, g = { ...y };
461
+ }, q = (o, l) => {
462
+ const { colspan: c, rowspan: u, colwidth: y, backgroundColor: k, ...f } = o.attrs || {}, g = { ...f };
463
463
  c > 1 && (g.colspan = c), u > 1 && (g.rowspan = u);
464
464
  const w = [];
465
- return b && w.push(`width: ${b}px;`), m && w.push(`background-color: ${m};`), w.length > 0 && (g.style = w.join(" ")), l.render("td", R(g), o.children);
466
- }, q = (o, l) => {
467
- const { colspan: c, rowspan: u, colwidth: b, backgroundColor: m, ...y } = o.attrs || {}, g = { ...y };
465
+ return y && w.push(`width: ${y}px;`), k && w.push(`background-color: ${k};`), w.length > 0 && (g.style = w.join(" ")), l.render("td", R(g), o.children);
466
+ }, W = (o, l) => {
467
+ const { colspan: c, rowspan: u, colwidth: y, backgroundColor: k, ...f } = o.attrs || {}, g = { ...f };
468
468
  c > 1 && (g.colspan = c), u > 1 && (g.rowspan = u);
469
469
  const w = [];
470
- return b && w.push(`width: ${b}px;`), m && w.push(`background-color: ${m};`), w.length > 0 && (g.style = w.join(" ")), l.render("th", R(g), o.children);
470
+ return y && w.push(`width: ${y}px;`), k && w.push(`background-color: ${k};`), w.length > 0 && (g.style = w.join(" ")), l.render("th", R(g), o.children);
471
471
  }, B = /* @__PURE__ */ new Map([
472
- [k.DOCUMENT, i("")],
473
- [k.HEADING, f],
474
- [k.PARAGRAPH, i("p")],
475
- [k.UL_LIST, i("ul")],
476
- [k.OL_LIST, i("ol")],
477
- [k.LIST_ITEM, i("li")],
478
- [k.IMAGE, d],
479
- [k.EMOJI, v],
480
- [k.CODE_BLOCK, A],
481
- [k.HR, i("hr")],
482
- [k.BR, i("br")],
483
- [k.QUOTE, i("blockquote")],
484
- [k.COMPONENT, J],
472
+ [m.DOCUMENT, i("")],
473
+ [m.HEADING, b],
474
+ [m.PARAGRAPH, i("p")],
475
+ [m.UL_LIST, i("ul")],
476
+ [m.OL_LIST, i("ol")],
477
+ [m.LIST_ITEM, i("li")],
478
+ [m.IMAGE, d],
479
+ [m.EMOJI, E],
480
+ [m.CODE_BLOCK, A],
481
+ [m.HR, i("hr")],
482
+ [m.BR, i("br")],
483
+ [m.QUOTE, i("blockquote")],
484
+ [m.COMPONENT, Z],
485
485
  [Ae.TEXT, $],
486
- [E.LINK, _],
487
- [E.ANCHOR, _],
488
- [E.STYLED, C("span", !0)],
489
- [E.BOLD, C("strong")],
490
- [E.TEXT_STYLE, C("span", !0)],
491
- [E.ITALIC, C("em")],
492
- [E.UNDERLINE, C("u")],
493
- [E.STRIKE, C("s")],
494
- [E.CODE, C("code")],
495
- [E.SUPERSCRIPT, C("sup")],
496
- [E.SUBSCRIPT, C("sub")],
497
- [E.HIGHLIGHT, C("mark")],
498
- [k.TABLE, K],
499
- [k.TABLE_ROW, W],
500
- [k.TABLE_CELL, Y],
501
- [k.TABLE_HEADER, q]
486
+ [v.LINK, _],
487
+ [v.ANCHOR, _],
488
+ [v.STYLED, C("span", !0)],
489
+ [v.BOLD, C("strong")],
490
+ [v.TEXT_STYLE, C("span", !0)],
491
+ [v.ITALIC, C("em")],
492
+ [v.UNDERLINE, C("u")],
493
+ [v.STRIKE, C("s")],
494
+ [v.CODE, C("code")],
495
+ [v.SUPERSCRIPT, C("sup")],
496
+ [v.SUBSCRIPT, C("sub")],
497
+ [v.HIGHLIGHT, C("mark")],
498
+ [m.TABLE, J],
499
+ [m.TABLE_ROW, Y],
500
+ [m.TABLE_CELL, q],
501
+ [m.TABLE_HEADER, W]
502
502
  ]), N = new Map([...B, ...Object.entries(a).map(([o, l]) => [o, l])]), V = () => ({
503
503
  render: (o, l = {}, c) => {
504
504
  if (h && o) {
@@ -527,8 +527,8 @@ function Re(e = {}) {
527
527
  }
528
528
  return { render: x };
529
529
  }
530
- let z = !1;
531
- const F = [], xe = (e) => new Promise((t, r) => {
530
+ let H = !1;
531
+ const z = [], xe = (e) => new Promise((t, r) => {
532
532
  if (typeof window > "u") {
533
533
  r(new Error("Cannot load Storyblok bridge: window is undefined (server-side environment)"));
534
534
  return;
@@ -538,15 +538,15 @@ const F = [], xe = (e) => new Promise((t, r) => {
538
538
  console.warn("You are not in Draft Mode or in the Visual Editor.");
539
539
  return;
540
540
  }
541
- z ? a() : F.push(a);
541
+ H ? a() : z.push(a);
542
542
  }, document.getElementById("storyblok-javascript-bridge")) {
543
543
  t(void 0);
544
544
  return;
545
545
  }
546
- const s = document.createElement("script");
547
- s.async = !0, s.src = e, s.id = "storyblok-javascript-bridge", s.onerror = (a) => r(a), s.onload = (a) => {
548
- F.forEach((n) => n()), z = !0, t(a);
549
- }, document.getElementsByTagName("head")[0].appendChild(s);
546
+ const n = document.createElement("script");
547
+ n.async = !0, n.src = e, n.id = "storyblok-javascript-bridge", n.onerror = (a) => r(a), n.onload = (a) => {
548
+ z.forEach((s) => s()), H = !0, t(a);
549
+ }, document.getElementsByTagName("head")[0].appendChild(n);
550
550
  }), Pe = (e) => {
551
551
  if (typeof e != "object" || typeof e._editable > "u")
552
552
  return {};
@@ -1,4 +1,4 @@
1
- (function(C,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(C=typeof globalThis<"u"?globalThis:C||self,S(C.storyblokAstro={}))})(this,function(C){"use strict";const S=`<svg width="45px" height="53px" viewBox="0 0 45 53" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1
+ (function(w,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(w=typeof globalThis<"u"?globalThis:w||self,S(w.storyblokAstro={}))})(this,function(w){"use strict";const S=`<svg width="45px" height="53px" viewBox="0 0 45 53" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2
2
  <g id="storyblok-logo-kit" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
3
3
  <g id="storyblok-partner-logo" transform="translate(-59.000000, -169.000000)" fill-rule="nonzero">
4
4
  <g id="storyblok-symbol" transform="translate(59.000000, 169.000000)">
@@ -7,9 +7,9 @@
7
7
  </g>
8
8
  </g>
9
9
  </g>
10
- </svg>`,Y=/[\p{Lu}]/u,q=/[\p{Ll}]/u,N=/^[\p{Lu}](?![\p{Lu}])/gu,P=/([\p{Alpha}\p{N}_]|$)/u,_=/[_.\- ]+/,V=new RegExp("^"+_.source),j=new RegExp(_.source+P.source,"gu"),D=new RegExp("\\d+"+P.source,"gu"),X=(e,t,r,s)=>{let a=!1,n=!1,f=!1,p=!1;for(let i=0;i<e.length;i++){const d=e[i];p=i>2?e[i-3]==="-":!0,a&&Y.test(d)?(e=e.slice(0,i)+"-"+e.slice(i),a=!1,f=n,n=!0,i++):n&&f&&q.test(d)&&(!p||s)?(e=e.slice(0,i-1)+"-"+e.slice(i-1),f=n,n=!1,a=!0):(a=t(d)===d&&r(d)!==d,f=n,n=r(d)===d&&t(d)!==d)}return e},Q=(e,t)=>(N.lastIndex=0,e.replaceAll(N,r=>t(r))),ee=(e,t)=>(j.lastIndex=0,D.lastIndex=0,e.replaceAll(D,(r,s,a)=>["_","-"].includes(e.charAt(a+r.length))?r:t(r)).replaceAll(j,(r,s)=>t(s)));function te(e,t){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");if(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},Array.isArray(e)?e=e.map(n=>n.trim()).filter(n=>n.length).join("-"):e=e.trim(),e.length===0)return"";const r=t.locale===!1?n=>n.toLowerCase():n=>n.toLocaleLowerCase(t.locale),s=t.locale===!1?n=>n.toUpperCase():n=>n.toLocaleUpperCase(t.locale);return e.length===1?_.test(e)?"":t.pascalCase?s(e):r(e):(e!==r(e)&&(e=X(e,r,s,t.preserveConsecutiveUppercase)),e=e.replace(V,""),e=t.preserveConsecutiveUppercase?Q(e,r):r(e),t.pascalCase&&(e=s(e.charAt(0))+e.slice(1)),ee(e,s))}function M(e){return te(e)}function re(e,t={},r,s){const a="virtual:storyblok-components",n=`\0${a}`;return{name:"vite-plugin-storyblok-components",async resolveId(f){if(f===a)return n},async load(f){if(f===n){const p=[],i=[];for await(const[h,A]of Object.entries(t)){const L=await this.resolve(`/${e}/${A}.astro`);if(L)p.push(`import ${M(h)} from "${L.id}"`);else if(r)i.push(h);else throw new Error(`Component could not be found for blok "${h}"! Does "${`/${e}/${A}`}.astro" exist?`)}let d="";if(r)if(d=",FallbackComponent",s){const h=await this.resolve(`/${e}/${s}.astro`);if(!h)throw new Error(`Custom fallback component could not be found. Does "${`/${e}/${s}`}.astro" exist?`);p.push(`import FallbackComponent from "${h.id}"`)}else p.push("import FallbackComponent from '@storyblok/astro/FallbackComponent.astro'");if(Object.values(t).length)return`${p.join(";")};export default {${Object.keys(t).filter(h=>!i.includes(h)).map(h=>M(h)).join(",")}${d}}`;if(r)return`${p[0]}; export default {${d.replace(",","")}}`;throw new Error(`Currently, no Storyblok components are registered in astro.config.mjs.
10
+ </svg>`,q=/[\p{Lu}]/u,W=/[\p{Ll}]/u,N=/^[\p{Lu}](?![\p{Lu}])/gu,P=/([\p{Alpha}\p{N}_]|$)/u,_=/[_.\- ]+/,V=new RegExp("^"+_.source),j=new RegExp(_.source+P.source,"gu"),D=new RegExp("\\d+"+P.source,"gu"),X=(e,t,r,n)=>{let l=!1,s=!1,h=!1,p=!1;for(let i=0;i<e.length;i++){const d=e[i];p=i>2?e[i-3]==="-":!0,l&&q.test(d)?(e=e.slice(0,i)+"-"+e.slice(i),l=!1,h=s,s=!0,i++):s&&h&&W.test(d)&&(!p||n)?(e=e.slice(0,i-1)+"-"+e.slice(i-1),h=s,s=!1,l=!0):(l=t(d)===d&&r(d)!==d,h=s,s=r(d)===d&&t(d)!==d)}return e},Q=(e,t)=>(N.lastIndex=0,e.replaceAll(N,r=>t(r))),ee=(e,t)=>(j.lastIndex=0,D.lastIndex=0,e.replaceAll(D,(r,n,l)=>["_","-"].includes(e.charAt(l+r.length))?r:t(r)).replaceAll(j,(r,n)=>t(n)));function te(e,t){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");if(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},Array.isArray(e)?e=e.map(s=>s.trim()).filter(s=>s.length).join("-"):e=e.trim(),e.length===0)return"";const r=t.locale===!1?s=>s.toLowerCase():s=>s.toLocaleLowerCase(t.locale),n=t.locale===!1?s=>s.toUpperCase():s=>s.toLocaleUpperCase(t.locale);return e.length===1?_.test(e)?"":t.pascalCase?n(e):r(e):(e!==r(e)&&(e=X(e,r,n,t.preserveConsecutiveUppercase)),e=e.replace(V,""),e=t.preserveConsecutiveUppercase?Q(e,r):r(e),t.pascalCase&&(e=n(e.charAt(0))+e.slice(1)),ee(e,n))}function M(e){return te(e)}function re(e,t={},r,n){const l="virtual:storyblok-components",s=`\0${l}`;return{name:"vite-plugin-storyblok-components",async resolveId(h){if(h===l)return s},async load(h){if(h===s){const p=[],i=[];for await(const[b,A]of Object.entries(t)){const L=await this.resolve(`/${e}/${A}.astro`);if(L)p.push(`import ${M(b)} from "${L.id}"`);else if(r)i.push(b);else throw new Error(`Component could not be found for blok "${b}"! Does "${`/${e}/${A}`}.astro" exist?`)}let d="";if(r)if(d=",FallbackComponent",n){const b=await this.resolve(`/${e}/${n}.astro`);if(!b)throw new Error(`Custom fallback component could not be found. Does "${`/${e}/${n}`}.astro" exist?`);p.push(`import FallbackComponent from "${b.id}"`)}else p.push("import FallbackComponent from '@storyblok/astro/FallbackComponent.astro'");if(Object.values(t).length)return`${p.join(";")};export default {${Object.keys(t).filter(b=>!i.includes(b)).map(b=>M(b)).join(",")}${d}}`;if(r)return`${p[0]}; export default {${d.replace(",","")}}`;throw new Error(`Currently, no Storyblok components are registered in astro.config.mjs.
11
11
  Please register your components or enable the fallback component.
12
- Detailed information can be found here: https://github.com/storyblok/storyblok-astro`)}}}}function oe(e,t,r){const s="virtual:storyblok-init",a=`\0${s}`;return{name:"vite-plugin-storyblok-init",async resolveId(n){if(n===s)return a},async load(n){if(n===a)return`
12
+ Detailed information can be found here: https://github.com/storyblok/storyblok-astro`)}}}}function oe(e,t,r){const n="virtual:storyblok-init",l=`\0${n}`;return{name:"vite-plugin-storyblok-init",async resolveId(s){if(s===n)return l},async load(s){if(s===l)return`
13
13
  import { storyblokInit, apiPlugin } from "@storyblok/js";
14
14
  const { storyblokApi } = storyblokInit({
15
15
  accessToken: "${e}",
@@ -17,10 +17,10 @@ Detailed information can be found here: https://github.com/storyblok/storyblok-a
17
17
  apiOptions: ${JSON.stringify(r)},
18
18
  });
19
19
  export const storyblokApiInstance = storyblokApi;
20
- `}}}function ne(e){const t="virtual:storyblok-options",r=`\0${t}`;return{name:"vite-plugin-storyblok-options",async resolveId(s){if(s===t)return r},async load(s){if(s===r)return`export default ${JSON.stringify(e)}`}}}function se(){if(!(globalThis!=null&&globalThis.storyblokApiInstance))throw new Error("storyblokApiInstance has not been initialized correctly");return globalThis.storyblokApiInstance}async function ae(e){let t=null;return e&&e.locals._storyblok_preview_data&&(t=e.locals._storyblok_preview_data),t}function le(e){return typeof e=="object"?`const storyblokInstance = new StoryblokBridge(${JSON.stringify(e)});`:"const storyblokInstance = new StoryblokBridge();"}function ie(e){const t={useCustomApi:!1,bridge:!0,componentsDir:"src",enableFallbackComponent:!1,livePreview:!1,...e},r=le(t.bridge);return{name:"@storyblok/astro",hooks:{"astro:config:setup":({injectScript:s,updateConfig:a,addDevToolbarApp:n,addMiddleware:f,config:p})=>{if(a({vite:{plugins:[oe(t.accessToken,t.useCustomApi,t.apiOptions),re(t.componentsDir,t.components,t.enableFallbackComponent,t.customFallbackComponent),ne(t)]}}),t.livePreview&&(p==null?void 0:p.output)!=="server")throw new Error("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.");s("page-ssr",`
20
+ `}}}function se(e){const t="virtual:storyblok-options",r=`\0${t}`;return{name:"vite-plugin-storyblok-options",async resolveId(n){if(n===t)return r},async load(n){if(n===r)return`export default ${JSON.stringify(e)}`}}}function ne(){if(!(globalThis!=null&&globalThis.storyblokApiInstance))throw new Error("storyblokApiInstance has not been initialized correctly");return globalThis.storyblokApiInstance}async function le(e){let t=null;return e&&e.locals._storyblok_preview_data&&(t=e.locals._storyblok_preview_data),t}function ae(e){return typeof e=="object"?`const storyblokInstance = new StoryblokBridge(${JSON.stringify(e)});`:"const storyblokInstance = new StoryblokBridge();"}function ie(e){const t={useCustomApi:!1,bridge:!0,componentsDir:"src",enableFallbackComponent:!1,livePreview:!1,...e},r=ae(t.bridge);return{name:"@storyblok/astro",hooks:{"astro:config:setup":({injectScript:n,updateConfig:l,addDevToolbarApp:s,addMiddleware:h,config:p})=>{if(l({vite:{plugins:[oe(t.accessToken,t.useCustomApi,t.apiOptions),re(t.componentsDir,t.components,t.enableFallbackComponent,t.customFallbackComponent),se(t)]}}),t.livePreview&&(p==null?void 0:p.output)!=="server")throw new Error("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.");n("page-ssr",`
21
21
  import { storyblokApiInstance } from "virtual:storyblok-init";
22
22
  globalThis.storyblokApiInstance = storyblokApiInstance;
23
- `),t.bridge&&!t.livePreview&&s("page",`import { loadStoryblokBridge } from "@storyblok/astro";
23
+ `),t.bridge&&!t.livePreview&&n("page",`import { loadStoryblokBridge } from "@storyblok/astro";
24
24
  loadStoryblokBridge().then(() => {
25
25
  const { StoryblokBridge, location } = window;
26
26
  ${r}
@@ -30,10 +30,10 @@ Detailed information can be found here: https://github.com/storyblok/storyblok-a
30
30
  }
31
31
  });
32
32
  });
33
- `),t.livePreview&&(s("page",`import { loadStoryblokBridge, handleStoryblokMessage } from "@storyblok/astro";
33
+ `),t.livePreview&&(n("page",`import { loadStoryblokBridge, handleStoryblokMessage } from "@storyblok/astro";
34
34
  loadStoryblokBridge().then(() => {
35
35
  const { StoryblokBridge, location } = window;
36
36
  ${r}
37
37
  storyblokInstance.on(["published", "change", "input"], handleStoryblokMessage);
38
38
  });
39
- `),f({entrypoint:"@storyblok/astro/middleware.ts",order:"pre"})),n({id:"storyblok",name:"Storyblok",icon:S,entrypoint:"@storyblok/astro/toolbarApp.ts"})}}}}let U;async function ce(e){const{action:t,story:r}=e||{};if(t==="input"&&r){const s=async()=>{const n=await de(r),f=document.body;if(n.outerHTML===f.outerHTML)return;const p=document.querySelector('[data-blok-focused="true"]');ue(f,n,p),document.dispatchEvent(new Event("storyblok-live-preview-updated"))};clearTimeout(U),U=setTimeout(s,500)}["published","change"].includes(e==null?void 0:e.action)&&location.reload()}function ue(e,t,r){if(r){const s=r.getAttribute("data-blok-uid"),a=t.querySelector(`[data-blok-uid="${s}"]`);a&&(a.setAttribute("data-blok-focused","true"),r.replaceWith(a))}else e.replaceWith(t)}async function de(e){const r=await(await fetch(location.href,{method:"POST",body:JSON.stringify({...e,is_storyblok_preview:!0}),headers:{"Content-Type":"application/json"}})).text();return new DOMParser().parseFromString(r,"text/html").body}function I(e,t,r){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=r,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}I.prototype.attrIndex=function(e){if(!this.attrs)return-1;const t=this.attrs;for(let r=0,s=t.length;r<s;r++)if(t[r][0]===e)return r;return-1},I.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},I.prototype.attrSet=function(e,t){const r=this.attrIndex(e),s=[e,t];r<0?this.attrPush(s):this.attrs[r]=s},I.prototype.attrGet=function(e){const t=this.attrIndex(e);let r=null;return t>=0&&(r=this.attrs[t][1]),r},I.prototype.attrJoin=function(e,t){const r=this.attrIndex(e);r<0?this.attrPush([e,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t};const pe="[a-zA-Z_:][a-zA-Z0-9:._-]*",fe="[^\"'=<>`\\x00-\\x20]+",he="'[^']*'",be='"[^"]*"',ye="(?:"+fe+"|"+he+"|"+be+")",ge="(?:\\s+"+pe+"(?:\\s*=\\s*"+ye+")?)",me="<[A-Za-z][A-Za-z0-9\\-]*"+ge+"*\\s*\\/?>",ke="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Ce=new RegExp("^(?:"+me+"|"+ke+")");new RegExp(Ce.source+"\\s*$");const H=[];for(let e=0;e<256;e++)H.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){H[e.charCodeAt(0)]=1});let g=function(e){return e.DOCUMENT="doc",e.HEADING="heading",e.PARAGRAPH="paragraph",e.QUOTE="blockquote",e.OL_LIST="ordered_list",e.UL_LIST="bullet_list",e.LIST_ITEM="list_item",e.CODE_BLOCK="code_block",e.HR="horizontal_rule",e.BR="hard_break",e.IMAGE="image",e.EMOJI="emoji",e.COMPONENT="blok",e.TABLE="table",e.TABLE_ROW="tableRow",e.TABLE_CELL="tableCell",e.TABLE_HEADER="tableHeader",e}({}),v=function(e){return e.BOLD="bold",e.STRONG="strong",e.STRIKE="strike",e.UNDERLINE="underline",e.ITALIC="italic",e.CODE="code",e.LINK="link",e.ANCHOR="anchor",e.STYLED="styled",e.SUPERSCRIPT="superscript",e.SUBSCRIPT="subscript",e.TEXT_STYLE="textStyle",e.HIGHLIGHT="highlight",e}({}),we=function(e){return e.TEXT="text",e}({}),T=function(e){return e.URL="url",e.STORY="story",e.ASSET="asset",e.EMAIL="email",e}({});function ve(e,t){if(!t)return{src:e,attrs:{}};let r=0,s=0;const a={},n=[];function f(i,d,h,A,L){typeof i!="number"||i<=d||i>=h?console.warn(`[StoryblokRichText] - ${A.charAt(0).toUpperCase()+A.slice(1)} value must be a number between ${d} and ${h} (inclusive)`):L.push(`${A}(${i})`)}if(typeof t=="object"){if(typeof t.width=="number"&&t.width>0?(a.width=t.width,r=t.width):console.warn("[StoryblokRichText] - Width value must be a number greater than 0"),t.height&&typeof t.height=="number"&&t.height>0?(a.height=t.height,s=t.height):console.warn("[StoryblokRichText] - Height value must be a number greater than 0"),t.loading&&["lazy","eager"].includes(t.loading)&&(a.loading=t.loading),t.class&&(a.class=t.class),t.filters){const{filters:i}=t||{},{blur:d,brightness:h,fill:A,format:L,grayscale:E,quality:$,rotate:O}=i||{};d&&f(d,0,100,"blur",n),$&&f($,0,100,"quality",n),h&&f(h,0,100,"brightness",n),A&&n.push(`fill(${A})`),E&&n.push("grayscale()"),O&&[0,90,180,270].includes(t.filters.rotate||0)&&n.push(`rotate(${O})`),L&&["webp","png","jpeg"].includes(L)&&n.push(`format(${L})`)}t.srcset&&(a.srcset=t.srcset.map(i=>{if(typeof i=="number")return`${e}/m/${i}x0/${n.length>0?`filters:${n.join(":")}`:""} ${i}w`;if(Array.isArray(i)&&i.length===2){const[d,h]=i;return`${e}/m/${d}x${h}/${n.length>0?`filters:${n.join(":")}`:""} ${d}w`}else{console.warn("[StoryblokRichText] - srcset entry must be a number or a tuple of two numbers");return}}).join(", ")),t.sizes&&(a.sizes=t.sizes.join(", "))}let p=`${e}/m/`;return r>0&&s>0&&(p=`${p}${r}x${s}/`),n.length>0&&(p=`${p}filters:${n.join(":")}`),{src:p,attrs:a}}const Ee=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Ae=(e={})=>Object.keys(e).map(t=>`${t}="${e[t]}"`).join(" "),Le=(e={})=>Object.keys(e).map(t=>`${t}: ${e[t]}`).join("; ");function Se(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const R=e=>Object.fromEntries(Object.entries(e).filter(([t,r])=>r!==void 0));function z(e,t={},r){const s=Ae(t),a=s?`${e} ${s}`:e,n=Array.isArray(r)?r.join(""):r||"";if(e){if(Ee.includes(e))return`<${a}>`}else return n;return`<${a}>${n}</${e}>`}function F(e={}){const t=new Map,{renderFn:r=z,textFn:s=Se,resolvers:a={},optimizeImages:n=!1,keyedResolvers:f=!1}=e,p=r!==z,i=o=>(l,c)=>{const u=l.attrs||{};return c.render(o,u,l.children||null)},d=(o,l)=>{const{src:c,alt:u,title:b,srcset:k,sizes:y}=o.attrs||{};let m=c,w={};if(n){const{src:De,attrs:Ue}=ve(c,n);m=De,w=Ue}const je={src:m,alt:u,title:b,srcset:k,sizes:y,...w};return l.render("img",R(je))},h=(o,l)=>{const{level:c,...u}=o.attrs||{};return l.render(`h${c}`,u,o.children)},A=(o,l)=>{var c,u,b,k;const y=l.render("img",{src:(c=o.attrs)==null?void 0:c.fallbackImage,alt:(u=o.attrs)==null?void 0:u.alt,style:"width: 1.25em; height: 1.25em; vertical-align: text-top",draggable:"false",loading:"lazy"});return l.render("span",{"data-type":"emoji","data-name":(b=o.attrs)==null?void 0:b.name,"data-emoji":(k=o.attrs)==null?void 0:k.emoji},y)},L=(o,l)=>l.render("pre",o.attrs||{},l.render("code",{},o.children||"")),E=(o,l=!1)=>({text:c,attrs:u},b)=>{const{class:k,id:y,...m}=u||{},w=l?{class:k,id:y,style:Le(m)||void 0}:u||{};return b.render(o,R(w),c)},$=o=>B(o),O=o=>{const{marks:l,...c}=o;if("text"in o){if(l)return l.reduce((b,k)=>$({...k,text:b}),$({...c,children:c.children}));const u=o.attrs||{};if(f){const b=t.get("txt")||0;t.set("txt",b+1),u.key=`txt-${b}`}return s(c.text,u)}return""},J=(o,l)=>{const{linktype:c,href:u,anchor:b,...k}=o.attrs||{};let y="";switch(c){case T.ASSET:case T.URL:y=u;break;case T.EMAIL:y=`mailto:${u}`;break;case T.STORY:y=u,b&&(y=`${y}#${b}`);break;default:y=u;break}const m={...k};return y&&(m.href=y),l.render("a",m,o.text)},xe=(o,l)=>{var c,u;return console.warn("[StoryblokRichtText] - BLOK resolver is not available for vanilla usage"),l.render("span",{blok:(c=o==null?void 0:o.attrs)==null?void 0:c.body[0],id:(u=o.attrs)==null?void 0:u.id,style:"display: none"})},_e=(o,l)=>{const c={},u=l.render("tbody",{},o.children);return l.render("table",c,u)},Me=(o,l)=>{const c={};return l.render("tr",c,o.children)},Be=(o,l)=>{const{colspan:c,rowspan:u,colwidth:b,backgroundColor:k,...y}=o.attrs||{},m={...y};c>1&&(m.colspan=c),u>1&&(m.rowspan=u);const w=[];return b&&w.push(`width: ${b}px;`),k&&w.push(`background-color: ${k};`),w.length>0&&(m.style=w.join(" ")),l.render("td",R(m),o.children)},Ne=(o,l)=>{const{colspan:c,rowspan:u,colwidth:b,backgroundColor:k,...y}=o.attrs||{},m={...y};c>1&&(m.colspan=c),u>1&&(m.rowspan=u);const w=[];return b&&w.push(`width: ${b}px;`),k&&w.push(`background-color: ${k};`),w.length>0&&(m.style=w.join(" ")),l.render("th",R(m),o.children)},K=new Map([[g.DOCUMENT,i("")],[g.HEADING,h],[g.PARAGRAPH,i("p")],[g.UL_LIST,i("ul")],[g.OL_LIST,i("ol")],[g.LIST_ITEM,i("li")],[g.IMAGE,d],[g.EMOJI,A],[g.CODE_BLOCK,L],[g.HR,i("hr")],[g.BR,i("br")],[g.QUOTE,i("blockquote")],[g.COMPONENT,xe],[we.TEXT,O],[v.LINK,J],[v.ANCHOR,J],[v.STYLED,E("span",!0)],[v.BOLD,E("strong")],[v.TEXT_STYLE,E("span",!0)],[v.ITALIC,E("em")],[v.UNDERLINE,E("u")],[v.STRIKE,E("s")],[v.CODE,E("code")],[v.SUPERSCRIPT,E("sup")],[v.SUBSCRIPT,E("sub")],[v.HIGHLIGHT,E("mark")],[g.TABLE,_e],[g.TABLE_ROW,Me],[g.TABLE_CELL,Be],[g.TABLE_HEADER,Ne]]),W=new Map([...K,...Object.entries(a).map(([o,l])=>[o,l])]),Pe=()=>({render:(o,l={},c)=>{if(f&&o){const u=t.get(o)||0;t.set(o,u+1),l.key=`${o}-${u}`}return r(o,l,c)},originalResolvers:K,mergedResolvers:W});function x(o){const l=W.get(o.type);if(!l)return console.error("<Storyblok>",`No resolver found for node type ${o.type}`),"";const c=Pe();if(o.type==="text")return l(o,c);const u=o.content?o.content.map(B):void 0;return l({...o,children:u},c)}function B(o){return o.type==="doc"?p?o.content.map(x):o.content.map(x).join(""):Array.isArray(o)?o.map(x):x(o)}return{render:B}}let G=!1;const Z=[],Ie=e=>new Promise((t,r)=>{if(typeof window>"u"){r(new Error("Cannot load Storyblok bridge: window is undefined (server-side environment)"));return}if(window.storyblokRegisterEvent=a=>{if(!window.location.search.includes("_storyblok")){console.warn("You are not in Draft Mode or in the Visual Editor.");return}G?a():Z.push(a)},document.getElementById("storyblok-javascript-bridge")){t(void 0);return}const s=document.createElement("script");s.async=!0,s.src=e,s.id="storyblok-javascript-bridge",s.onerror=a=>r(a),s.onload=a=>{Z.forEach(n=>n()),G=!0,t(a)},document.getElementsByTagName("head")[0].appendChild(s)}),$e=e=>{if(typeof e!="object"||typeof e._editable>"u")return{};try{const t=JSON.parse(e._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return t?{"data-blok-c":JSON.stringify(t),"data-blok-uid":`${t.id}-${t.uid}`}:{}}catch{return{}}};let Te="https://app.storyblok.com/f/storyblok-v2-latest.js";function Re(e,t){return F(t).render(e)}const Oe=()=>Ie(Te);C.getLiveStory=ae,C.handleStoryblokMessage=ce,C.loadStoryblokBridge=Oe,C.renderRichText=Re,C.richTextResolver=F,C.storyblok=ie,C.storyblokEditable=$e,C.toCamelCase=M,C.useStoryblokApi=se,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
39
+ `),h({entrypoint:"@storyblok/astro/middleware.ts",order:"pre"})),s({id:"storyblok",name:"Storyblok",icon:S,entrypoint:"@storyblok/astro/toolbarApp.ts"})}}}}let U;async function ce(e){const{action:t,story:r}=e||{};if(t==="input"&&r){const n=async()=>{const s=await de(r),h=document.body;if(s.outerHTML===h.outerHTML)return;const p=document.querySelector('[data-blok-focused="true"]');ue(h,s,p),document.dispatchEvent(new Event("storyblok-live-preview-updated"))};clearTimeout(U),U=setTimeout(n,500)}["published","change"].includes(e==null?void 0:e.action)&&location.reload()}function ue(e,t,r){if(r){const n=r.getAttribute("data-blok-uid"),l=t.querySelector(`[data-blok-uid="${n}"]`);l&&(l.setAttribute("data-blok-focused","true"),r.replaceWith(l))}else e.replaceWith(t)}async function de(e){const r=await(await fetch(location.href,{method:"POST",body:JSON.stringify({...e,is_storyblok_preview:!0}),headers:{"Content-Type":"application/json"}})).text();return new DOMParser().parseFromString(r,"text/html").body}function I(e,t,r){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=r,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}I.prototype.attrIndex=function(e){if(!this.attrs)return-1;const t=this.attrs;for(let r=0,n=t.length;r<n;r++)if(t[r][0]===e)return r;return-1},I.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},I.prototype.attrSet=function(e,t){const r=this.attrIndex(e),n=[e,t];r<0?this.attrPush(n):this.attrs[r]=n},I.prototype.attrGet=function(e){const t=this.attrIndex(e);let r=null;return t>=0&&(r=this.attrs[t][1]),r},I.prototype.attrJoin=function(e,t){const r=this.attrIndex(e);r<0?this.attrPush([e,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t};const pe="[a-zA-Z_:][a-zA-Z0-9:._-]*",he="[^\"'=<>`\\x00-\\x20]+",be="'[^']*'",fe='"[^"]*"',ye="(?:"+he+"|"+be+"|"+fe+")",ge="(?:\\s+"+pe+"(?:\\s*=\\s*"+ye+")?)",me="<[A-Za-z][A-Za-z0-9\\-]*"+ge+"*\\s*\\/?>",ke="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",we=new RegExp("^(?:"+me+"|"+ke+")");new RegExp(we.source+"\\s*$");const F=[];for(let e=0;e<256;e++)F.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){F[e.charCodeAt(0)]=1});let g=function(e){return e.DOCUMENT="doc",e.HEADING="heading",e.PARAGRAPH="paragraph",e.QUOTE="blockquote",e.OL_LIST="ordered_list",e.UL_LIST="bullet_list",e.LIST_ITEM="list_item",e.CODE_BLOCK="code_block",e.HR="horizontal_rule",e.BR="hard_break",e.IMAGE="image",e.EMOJI="emoji",e.COMPONENT="blok",e.TABLE="table",e.TABLE_ROW="tableRow",e.TABLE_CELL="tableCell",e.TABLE_HEADER="tableHeader",e}({}),v=function(e){return e.BOLD="bold",e.STRONG="strong",e.STRIKE="strike",e.UNDERLINE="underline",e.ITALIC="italic",e.CODE="code",e.LINK="link",e.ANCHOR="anchor",e.STYLED="styled",e.SUPERSCRIPT="superscript",e.SUBSCRIPT="subscript",e.TEXT_STYLE="textStyle",e.HIGHLIGHT="highlight",e}({}),Ce=function(e){return e.TEXT="text",e}({}),$=function(e){return e.URL="url",e.STORY="story",e.ASSET="asset",e.EMAIL="email",e}({});function ve(e,t){if(!t)return{src:e,attrs:{}};let r=0,n=0;const l={},s=[];function h(i,d,b,A,L){typeof i!="number"||i<=d||i>=b?console.warn(`[StoryblokRichText] - ${A.charAt(0).toUpperCase()+A.slice(1)} value must be a number between ${d} and ${b} (inclusive)`):L.push(`${A}(${i})`)}if(typeof t=="object"){if(typeof t.width=="number"&&t.width>0?(l.width=t.width,r=t.width):console.warn("[StoryblokRichText] - Width value must be a number greater than 0"),t.height&&typeof t.height=="number"&&t.height>0?(l.height=t.height,n=t.height):console.warn("[StoryblokRichText] - Height value must be a number greater than 0"),t.loading&&["lazy","eager"].includes(t.loading)&&(l.loading=t.loading),t.class&&(l.class=t.class),t.filters){const{filters:i}=t||{},{blur:d,brightness:b,fill:A,format:L,grayscale:E,quality:T,rotate:O}=i||{};d&&h(d,0,100,"blur",s),T&&h(T,0,100,"quality",s),b&&h(b,0,100,"brightness",s),A&&s.push(`fill(${A})`),E&&s.push("grayscale()"),O&&[0,90,180,270].includes(t.filters.rotate||0)&&s.push(`rotate(${O})`),L&&["webp","png","jpeg"].includes(L)&&s.push(`format(${L})`)}t.srcset&&(l.srcset=t.srcset.map(i=>{if(typeof i=="number")return`${e}/m/${i}x0/${s.length>0?`filters:${s.join(":")}`:""} ${i}w`;if(Array.isArray(i)&&i.length===2){const[d,b]=i;return`${e}/m/${d}x${b}/${s.length>0?`filters:${s.join(":")}`:""} ${d}w`}else{console.warn("[StoryblokRichText] - srcset entry must be a number or a tuple of two numbers");return}}).join(", ")),t.sizes&&(l.sizes=t.sizes.join(", "))}let p=`${e}/m/`;return r>0&&n>0&&(p=`${p}${r}x${n}/`),s.length>0&&(p=`${p}filters:${s.join(":")}`),{src:p,attrs:l}}const Ee=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Ae=(e={})=>Object.keys(e).map(t=>`${t}="${e[t]}"`).join(" "),Le=(e={})=>Object.keys(e).map(t=>`${t}: ${e[t]}`).join("; ");function Se(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const R=e=>Object.fromEntries(Object.entries(e).filter(([t,r])=>r!==void 0));function H(e,t={},r){const n=Ae(t),l=n?`${e} ${n}`:e,s=Array.isArray(r)?r.join(""):r||"";if(e){if(Ee.includes(e))return`<${l}>`}else return s;return`<${l}>${s}</${e}>`}function z(e={}){const t=new Map,{renderFn:r=H,textFn:n=Se,resolvers:l={},optimizeImages:s=!1,keyedResolvers:h=!1}=e,p=r!==H,i=o=>(a,c)=>{const u=a.attrs||{};return c.render(o,u,a.children||null)},d=(o,a)=>{const{src:c,alt:u,title:f,srcset:k,sizes:y}=o.attrs||{};let m=c,C={};if(s){const{src:De,attrs:Ue}=ve(c,s);m=De,C=Ue}const je={src:m,alt:u,title:f,srcset:k,sizes:y,...C};return a.render("img",R(je))},b=(o,a)=>{const{level:c,...u}=o.attrs||{};return a.render(`h${c}`,u,o.children)},A=(o,a)=>{var c,u,f,k;const y=a.render("img",{src:(c=o.attrs)==null?void 0:c.fallbackImage,alt:(u=o.attrs)==null?void 0:u.alt,style:"width: 1.25em; height: 1.25em; vertical-align: text-top",draggable:"false",loading:"lazy"});return a.render("span",{"data-type":"emoji","data-name":(f=o.attrs)==null?void 0:f.name,"data-emoji":(k=o.attrs)==null?void 0:k.emoji},y)},L=(o,a)=>a.render("pre",o.attrs||{},a.render("code",{},o.children||"")),E=(o,a=!1)=>({text:c,attrs:u},f)=>{const{class:k,id:y,...m}=u||{},C=a?{class:k,id:y,style:Le(m)||void 0}:u||{};return f.render(o,R(C),c)},T=o=>B(o),O=o=>{const{marks:a,...c}=o;if("text"in o){if(a)return a.reduce((f,k)=>T({...k,text:f}),T({...c,children:c.children}));const u=o.attrs||{};if(h){const f=t.get("txt")||0;t.set("txt",f+1),u.key=`txt-${f}`}return n(c.text,u)}return""},Z=(o,a)=>{const{linktype:c,href:u,anchor:f,...k}=o.attrs||{};let y="";switch(c){case $.ASSET:case $.URL:y=u;break;case $.EMAIL:y=`mailto:${u}`;break;case $.STORY:y=u,f&&(y=`${y}#${f}`);break;default:y=u;break}const m={...k};return y&&(m.href=y),a.render("a",m,o.text)},xe=(o,a)=>{var c,u;return console.warn("[StoryblokRichtText] - BLOK resolver is not available for vanilla usage"),a.render("span",{blok:(c=o==null?void 0:o.attrs)==null?void 0:c.body[0],id:(u=o.attrs)==null?void 0:u.id,style:"display: none"})},_e=(o,a)=>{const c={},u=a.render("tbody",{},o.children);return a.render("table",c,u)},Me=(o,a)=>{const c={};return a.render("tr",c,o.children)},Be=(o,a)=>{const{colspan:c,rowspan:u,colwidth:f,backgroundColor:k,...y}=o.attrs||{},m={...y};c>1&&(m.colspan=c),u>1&&(m.rowspan=u);const C=[];return f&&C.push(`width: ${f}px;`),k&&C.push(`background-color: ${k};`),C.length>0&&(m.style=C.join(" ")),a.render("td",R(m),o.children)},Ne=(o,a)=>{const{colspan:c,rowspan:u,colwidth:f,backgroundColor:k,...y}=o.attrs||{},m={...y};c>1&&(m.colspan=c),u>1&&(m.rowspan=u);const C=[];return f&&C.push(`width: ${f}px;`),k&&C.push(`background-color: ${k};`),C.length>0&&(m.style=C.join(" ")),a.render("th",R(m),o.children)},J=new Map([[g.DOCUMENT,i("")],[g.HEADING,b],[g.PARAGRAPH,i("p")],[g.UL_LIST,i("ul")],[g.OL_LIST,i("ol")],[g.LIST_ITEM,i("li")],[g.IMAGE,d],[g.EMOJI,A],[g.CODE_BLOCK,L],[g.HR,i("hr")],[g.BR,i("br")],[g.QUOTE,i("blockquote")],[g.COMPONENT,xe],[Ce.TEXT,O],[v.LINK,Z],[v.ANCHOR,Z],[v.STYLED,E("span",!0)],[v.BOLD,E("strong")],[v.TEXT_STYLE,E("span",!0)],[v.ITALIC,E("em")],[v.UNDERLINE,E("u")],[v.STRIKE,E("s")],[v.CODE,E("code")],[v.SUPERSCRIPT,E("sup")],[v.SUBSCRIPT,E("sub")],[v.HIGHLIGHT,E("mark")],[g.TABLE,_e],[g.TABLE_ROW,Me],[g.TABLE_CELL,Be],[g.TABLE_HEADER,Ne]]),Y=new Map([...J,...Object.entries(l).map(([o,a])=>[o,a])]),Pe=()=>({render:(o,a={},c)=>{if(h&&o){const u=t.get(o)||0;t.set(o,u+1),a.key=`${o}-${u}`}return r(o,a,c)},originalResolvers:J,mergedResolvers:Y});function x(o){const a=Y.get(o.type);if(!a)return console.error("<Storyblok>",`No resolver found for node type ${o.type}`),"";const c=Pe();if(o.type==="text")return a(o,c);const u=o.content?o.content.map(B):void 0;return a({...o,children:u},c)}function B(o){return o.type==="doc"?p?o.content.map(x):o.content.map(x).join(""):Array.isArray(o)?o.map(x):x(o)}return{render:B}}let G=!1;const K=[],Ie=e=>new Promise((t,r)=>{if(typeof window>"u"){r(new Error("Cannot load Storyblok bridge: window is undefined (server-side environment)"));return}if(window.storyblokRegisterEvent=l=>{if(!window.location.search.includes("_storyblok")){console.warn("You are not in Draft Mode or in the Visual Editor.");return}G?l():K.push(l)},document.getElementById("storyblok-javascript-bridge")){t(void 0);return}const n=document.createElement("script");n.async=!0,n.src=e,n.id="storyblok-javascript-bridge",n.onerror=l=>r(l),n.onload=l=>{K.forEach(s=>s()),G=!0,t(l)},document.getElementsByTagName("head")[0].appendChild(n)}),Te=e=>{if(typeof e!="object"||typeof e._editable>"u")return{};try{const t=JSON.parse(e._editable.replace(/^<!--#storyblok#/,"").replace(/-->$/,""));return t?{"data-blok-c":JSON.stringify(t),"data-blok-uid":`${t.id}-${t.uid}`}:{}}catch{return{}}};let $e="https://app.storyblok.com/f/storyblok-v2-latest.js";function Re(e,t){return z(t).render(e)}const Oe=()=>Ie($e);w.getLiveStory=le,w.handleStoryblokMessage=ce,w.loadStoryblokBridge=Oe,w.renderRichText=Re,w.richTextResolver=z,w.storyblok=ie,w.storyblokEditable=Te,w.toCamelCase=M,w.useStoryblokApi=ne,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@storyblok/astro",
3
3
  "type": "module",
4
- "version": "7.2.3",
4
+ "version": "7.2.4",
5
5
  "private": false,
6
6
  "description": "Official Astro integration for the Storyblok Headless CMS",
7
7
  "author": "Storyblok",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "camelcase": "^8.0.0",
59
- "@storyblok/js": "4.2.3"
59
+ "@storyblok/js": "4.2.4"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@cypress/vite-dev-server": "^6.0.3",
@@ -77,7 +77,7 @@
77
77
  "vite-plugin-dts": "^4.5.3",
78
78
  "vite-plugin-static-copy": "^2.2.0",
79
79
  "vitest": "^3.1.3",
80
- "@storyblok/eslint-config": "0.4.0"
80
+ "@storyblok/eslint-config": "0.4.1"
81
81
  },
82
82
  "eslintConfig": {
83
83
  "env": {
@@ -134,6 +134,7 @@
134
134
  "scripts": {
135
135
  "dev": "vite",
136
136
  "build": "vite build && tsc --project tsconfig.json",
137
+ "test:types": "tsc --noEmit --skipLibCheck",
137
138
  "playground": "pnpm run --filter ./playground/ssg dev",
138
139
  "playground:ssr": "pnpm run --filter ./playground/ssr dev",
139
140
  "playground:test": "pnpm run --filter ./playground/test dev",