@b10cks/client 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,267 +1,295 @@
1
- function _(i) {
2
- if (!i) return;
3
- if (i.type === "email") {
4
- const n = new URLSearchParams();
5
- i.subject && n.set("subject", i.subject), i.body && n.set("body", i.body), i.cc && n.set("cc", i.cc), i.bcc && n.set("bcc", i.bcc);
6
- const s = n.toString();
7
- return { href: `mailto:${i.email}${s ? `?${s}` : ""}`, target: "_self" };
8
- }
9
- if (i.type === "asset")
10
- return;
11
- const t = i.target ?? "_self";
12
- let e = i.url ?? "";
13
- return "anchor" in i && i.anchor && (e = `${e.trimEnd()}#${i.anchor}`), { href: e, target: t };
1
+ //#region \0rolldown/runtime.js
2
+ var e = Object.defineProperty, t = (t, n) => {
3
+ let r = {};
4
+ for (var i in t) e(r, i, {
5
+ get: t[i],
6
+ enumerable: !0
7
+ });
8
+ return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
9
+ };
10
+ //#endregion
11
+ //#region src/content.ts
12
+ function n(e) {
13
+ if (!e) return;
14
+ if (e.type === "email") {
15
+ let t = new URLSearchParams();
16
+ e.subject && t.set("subject", e.subject), e.body && t.set("body", e.body), e.cc && t.set("cc", e.cc), e.bcc && t.set("bcc", e.bcc);
17
+ let n = t.toString();
18
+ return {
19
+ href: `mailto:${e.email}${n ? `?${n}` : ""}`,
20
+ target: "_self"
21
+ };
22
+ }
23
+ if (e.type === "asset") return;
24
+ let t = e.target ?? "_self", n = e.url ?? "";
25
+ return "anchor" in e && e.anchor && (n = `${n.trimEnd()}#${e.anchor}`), {
26
+ href: n,
27
+ target: t
28
+ };
14
29
  }
15
- function A(i) {
16
- if (i != null) {
17
- if (typeof i == "boolean" || typeof i == "number") return String(i);
18
- if (typeof i == "string") return i;
19
- if (typeof i == "object" && !Array.isArray(i)) {
20
- const t = i;
21
- if ("null" in t) return "null:";
22
- if ("!null" in t) return "!null:";
23
- if ("between" in t) {
24
- const [n, s] = t.between;
25
- return `${n}...${s}`;
26
- }
27
- const e = [
28
- "eq",
29
- "neq",
30
- "like",
31
- "!like",
32
- "^like",
33
- "like$",
34
- "lt",
35
- "gt",
36
- "lte",
37
- "gte",
38
- "in",
39
- "!in",
40
- "empty",
41
- "!empty"
42
- ];
43
- for (const n of e)
44
- if (n in t) {
45
- const s = t[n];
46
- return Array.isArray(s) ? `${n}:${s.join(",")}` : `${n}:${String(s)}`;
47
- }
48
- }
49
- }
30
+ //#endregion
31
+ //#region src/data-api.ts
32
+ function r(e) {
33
+ if (e != null) {
34
+ if (typeof e == "boolean" || typeof e == "number") return String(e);
35
+ if (typeof e == "string") return e;
36
+ if (typeof e == "object" && !Array.isArray(e)) {
37
+ let t = e;
38
+ if ("null" in t) return "null:";
39
+ if ("!null" in t) return "!null:";
40
+ if ("between" in t) {
41
+ let e = t.between;
42
+ if (!Array.isArray(e) || e.length !== 2) return;
43
+ let [n, r] = e;
44
+ return `${n}...${r}`;
45
+ }
46
+ for (let e of [
47
+ "eq",
48
+ "neq",
49
+ "like",
50
+ "!like",
51
+ "^like",
52
+ "like$",
53
+ "lt",
54
+ "gt",
55
+ "lte",
56
+ "gte",
57
+ "in",
58
+ "!in",
59
+ "empty",
60
+ "!empty"
61
+ ]) if (e in t) {
62
+ let n = t[e];
63
+ return Array.isArray(n) ? `${e}:${n.join(",")}` : `${e}:${String(n)}`;
64
+ }
65
+ }
66
+ }
50
67
  }
51
- function S(i) {
52
- const t = {};
53
- for (const [e, n] of Object.entries(i)) {
54
- const s = A(n);
55
- s !== void 0 && (t[e] = s);
56
- }
57
- return t;
68
+ function i(e) {
69
+ let t = {};
70
+ for (let [n, i] of Object.entries(e)) {
71
+ let e = r(i);
72
+ e !== void 0 && (t[n] = e);
73
+ }
74
+ return t;
58
75
  }
59
- function g(i, t, e) {
60
- const n = t && typeof t == "object" ? S(t) : {}, s = Array.isArray(e) ? { sort: e.join(",") } : e != null ? { sort: e } : {};
61
- return { ...i, ...n, ...s };
76
+ function a(e, t, n) {
77
+ let r = t && typeof t == "object" ? i(t) : {}, a = Array.isArray(n) ? { sort: n.join(",") } : n == null ? {} : { sort: n };
78
+ return {
79
+ ...e,
80
+ ...r,
81
+ ...a
82
+ };
62
83
  }
63
- class P {
64
- constructor(t) {
65
- this.client = t;
66
- }
67
- redirectsCache = null;
68
- configCache = /* @__PURE__ */ new Map();
69
- async getResource(t, e = {}) {
70
- const n = await this.client.get(t, e);
71
- return this.unwrapResource(n);
72
- }
73
- async getCollection(t, e = {}, n = {}) {
74
- if (n.allPages)
75
- return this.client.getAll(t, e);
76
- const s = await this.client.get(t, e);
77
- return this.unwrapCollection(s);
78
- }
79
- async getContent(t, e = {}) {
80
- return this.getResource(`contents/${t}`, e);
81
- }
82
- async getContents(t = {}, e = {}) {
83
- const { filter: n, sort: s, ...r } = t;
84
- return this.getCollection(
85
- "contents",
86
- g(r, n, s),
87
- e
88
- );
89
- }
90
- async getBlock(t, e = {}) {
91
- return this.getResource(`blocks/${t}`, e);
92
- }
93
- async getBlocks(t = {}, e = {}) {
94
- const { filter: n, ...s } = t;
95
- return this.getCollection(
96
- "blocks",
97
- g(s, n, void 0),
98
- e
99
- );
100
- }
101
- async search(t) {
102
- const e = await this.client.get(
103
- "search",
104
- t
105
- );
106
- if (typeof e == "object" && e !== null && "data" in e && "meta" in e)
107
- return e;
108
- if (typeof e == "object" && e !== null && "data" in e) {
109
- const n = e.data;
110
- if (typeof n == "object" && n !== null && "meta" in n && "data" in n)
111
- return n;
112
- }
113
- return e;
114
- }
115
- async getSitemap(t = {}, e = {}) {
116
- return this.getCollection("sitemap", t, e);
117
- }
118
- async getDataEntries(t, e = {}, n = {}) {
119
- return this.getCollection(`datasources/${t}/entries`, e, n);
120
- }
121
- async getDataSources(t = {}, e = {}) {
122
- return this.getCollection("datasources", t, e);
123
- }
124
- async getSpace(t = {}) {
125
- return this.getResource("spaces/me", t);
126
- }
127
- async lookupRedirect(t) {
128
- if (!this.client.post)
129
- throw new Error(
130
- "lookupRedirect requires a client that supports POST. Use ApiClient from @b10cks/client."
131
- );
132
- return this.client.post("redirects/lookup", { source: t });
133
- }
134
- async getRedirects(t = {}, e = !1) {
135
- const { allPages: n = !1, forceRefresh: s = !1 } = typeof e == "boolean" ? { allPages: !0, forceRefresh: e } : e;
136
- if (n && this.redirectsCache && !s)
137
- return this.redirectsCache;
138
- const { filter: r, ...o } = t, a = g(o, r, void 0), c = await this.getCollection("redirects", a, { allPages: n }), d = Object.fromEntries(
139
- c.map(({ source: p, target: u, status_code: f }) => [p, { target: u, status_code: f }])
140
- );
141
- return n && (this.redirectsCache = d), d;
142
- }
143
- async getConfig({
144
- slug: t = "_config",
145
- language_iso: e,
146
- language: n,
147
- bypassCache: s = !1,
148
- ...r
149
- } = {}) {
150
- const o = e ?? n, a = JSON.stringify({ slug: t, language_iso: o, ...r });
151
- if (!s && this.configCache.has(a))
152
- return this.configCache.get(a);
153
- const d = (await this.getContent(t, {
154
- ...r,
155
- language_iso: o
156
- })).content ?? {};
157
- return s || this.configCache.set(a, d), d;
158
- }
159
- async syncRevision(t = 426713400) {
160
- const n = (await this.getSpace()).rv || t;
161
- return this.client.setRv(n), n;
162
- }
163
- clearCache() {
164
- this.redirectsCache = null, this.configCache.clear();
165
- }
166
- unwrapResource(t) {
167
- return typeof t == "object" && t !== null && "data" in t ? t.data : t;
168
- }
169
- unwrapCollection(t) {
170
- if (Array.isArray(t))
171
- return t;
172
- if (typeof t == "object" && t !== null && "data" in t) {
173
- if (Array.isArray(t.data))
174
- return t.data;
175
- if (typeof t.data == "object" && t.data !== null && "data" in t.data && Array.isArray(t.data.data))
176
- return t.data.data;
177
- }
178
- return [];
179
- }
180
- }
181
- function L(i) {
182
- return new P(i);
183
- }
184
- const T = /* @__PURE__ */ new Set([
185
- "CONTENT_UPDATE",
186
- "CONTENT_PATCH",
187
- "SELECT_UPDATE",
188
- "HOVER_UPDATE",
189
- "FIELD_UPDATE",
190
- "FIELD_SELECT"
191
- ]), j = "B10CKS_BRIDGE_READY";
192
- class h {
193
- static instance;
194
- listeners = {};
195
- initialized = !1;
196
- allowedOrigins = null;
197
- /** Origin of the editor, captured from the first trusted message. */
198
- parentOrigin = null;
199
- constructor() {
200
- }
201
- static getInstance() {
202
- return h.instance || (h.instance = new h()), h.instance;
203
- }
204
- init(t = {}) {
205
- !this.isInPreviewMode() || this.initialized || (this.allowedOrigins = t.allowedOrigins ?? null, window.addEventListener("message", this.handleMessage), this.initialized = !0, window.parent.postMessage({ type: j }, "*"));
206
- }
207
- destroy() {
208
- this.initialized && typeof window < "u" && window.removeEventListener("message", this.handleMessage), this.initialized = !1, this.parentOrigin = null;
209
- for (const t of Object.keys(this.listeners))
210
- this.listeners[t]?.clear();
211
- }
212
- isInPreviewMode() {
213
- return typeof window < "u" && window.self !== window.top;
214
- }
215
- on(t, e) {
216
- if (!this.isInPreviewMode())
217
- return () => {
218
- };
219
- const n = this.listeners[t] || /* @__PURE__ */ new Set();
220
- return this.listeners[t] = n, n.add(e), () => {
221
- n.delete(e);
222
- };
223
- }
224
- selectItem(t) {
225
- this.post("SELECT_UPDATE", { selectedItem: t });
226
- }
227
- /** Deep-select a nested field (e.g. a rich text field) in the editor. */
228
- selectField(t, e) {
229
- this.post("FIELD_SELECT", { itemId: t, path: e });
230
- }
231
- /** @deprecated Prefer {@link updateFieldAt} with a path. */
232
- updateField(t, e, n) {
233
- this.post("FIELD_UPDATE", { itemId: t, field: e, value: n });
234
- }
235
- /** Stream an inline edit back to the editor, addressed by path. */
236
- updateFieldAt(t, e, n) {
237
- this.post("FIELD_UPDATE", { itemId: t, path: e, value: n });
238
- }
239
- post(t, e) {
240
- this.isInPreviewMode() && window.parent.postMessage({ type: t, payload: e }, this.parentOrigin ?? "*");
241
- }
242
- handleMessage = (t) => {
243
- if (!this.isOriginTrusted(t.origin) || !t.data || typeof t.data != "object")
244
- return;
245
- const { type: e, payload: n } = t.data;
246
- !e || !T.has(e) || !n || (!this.parentOrigin && t.origin && t.origin !== "null" && (this.parentOrigin = t.origin), this.notify(e, n));
247
- };
248
- isOriginTrusted(t) {
249
- return this.parentOrigin ? t === this.parentOrigin : this.allowedOrigins ? this.allowedOrigins.includes(t) : !0;
250
- }
251
- notify(t, e) {
252
- const n = this.listeners[t];
253
- if (n)
254
- for (const s of n)
255
- s(e);
256
- }
84
+ var o = 128, s = class {
85
+ client;
86
+ redirectsCache = /* @__PURE__ */ new Map();
87
+ configCache = /* @__PURE__ */ new Map();
88
+ configInflight = /* @__PURE__ */ new Map();
89
+ constructor(e) {
90
+ this.client = e;
91
+ }
92
+ async getResource(e, t = {}) {
93
+ let n = await this.client.get(e, t);
94
+ return this.unwrapResource(n);
95
+ }
96
+ async getCollection(e, t = {}, n = {}) {
97
+ if (n.allPages) return this.client.getAll(e, t);
98
+ let r = await this.client.get(e, t);
99
+ return this.unwrapCollection(r);
100
+ }
101
+ async getContent(e, t = {}) {
102
+ return this.getResource(`contents/${e}`, t);
103
+ }
104
+ async getContents(e = {}, t = {}) {
105
+ let { filter: n, sort: r, ...i } = e;
106
+ return this.getCollection("contents", a(i, n, r), t);
107
+ }
108
+ async getBlock(e, t = {}) {
109
+ return this.getResource(`blocks/${e}`, t);
110
+ }
111
+ async getBlocks(e = {}, t = {}) {
112
+ let { filter: n, ...r } = e;
113
+ return this.getCollection("blocks", a(r, n, void 0), t);
114
+ }
115
+ async search(e) {
116
+ let t = await this.client.get("search", e);
117
+ if (typeof t == "object" && t && "data" in t && "meta" in t) return t;
118
+ if (typeof t == "object" && t && "data" in t) {
119
+ let e = t.data;
120
+ if (typeof e == "object" && e && "meta" in e && "data" in e) return e;
121
+ }
122
+ return t;
123
+ }
124
+ async getSitemap(e = {}, t = {}) {
125
+ return this.getCollection("sitemap", e, t);
126
+ }
127
+ async getDataEntries(e, t = {}, n = {}) {
128
+ return this.getCollection(`datasources/${e}/entries`, t, n);
129
+ }
130
+ async getDataSources(e = {}, t = {}) {
131
+ return this.getCollection("datasources", e, t);
132
+ }
133
+ async getSpace(e = {}) {
134
+ return this.getResource("spaces/me", e);
135
+ }
136
+ async lookupRedirect(e) {
137
+ if (!this.client.post) throw Error("lookupRedirect requires a client that supports POST. Use ApiClient from @b10cks/client.");
138
+ return this.client.post("redirects/lookup", { source: e });
139
+ }
140
+ async getRedirects(e = {}, t = !1) {
141
+ let { allPages: n = !1, forceRefresh: r = !1 } = typeof t == "boolean" ? {
142
+ allPages: !0,
143
+ forceRefresh: t
144
+ } : t, i = JSON.stringify({
145
+ params: e,
146
+ rv: this.currentRv()
147
+ });
148
+ if (n && !r) {
149
+ let e = this.redirectsCache.get(i);
150
+ if (e) return e;
151
+ }
152
+ let { filter: o, ...s } = e, c = a(s, o, void 0), l = await this.getCollection("redirects", c, { allPages: n }), u = Object.fromEntries(l.map(({ source: e, target: t, status_code: n }) => [e, {
153
+ target: t,
154
+ status_code: n
155
+ }]));
156
+ return n && this.redirectsCache.set(i, u), u;
157
+ }
158
+ currentRv() {
159
+ return typeof this.client.getRv == "function" ? this.client.getRv() : "";
160
+ }
161
+ async getConfig({ slug: e = "_config", language_iso: t, language: n, bypassCache: r = !1, ...i } = {}) {
162
+ let a = t ?? n, o = JSON.stringify({
163
+ slug: e,
164
+ language_iso: a,
165
+ rv: this.currentRv(),
166
+ ...i
167
+ });
168
+ if (!r && this.configCache.has(o)) return this.configCache.get(o);
169
+ let s = this.configInflight.get(o);
170
+ if (!r && s) return s;
171
+ let c = this.getContent(e, {
172
+ ...i,
173
+ language_iso: a
174
+ }).then((e) => {
175
+ let t = e.content ?? {};
176
+ return r || this.setConfigCache(o, t), t;
177
+ }).finally(() => {
178
+ this.configInflight.delete(o);
179
+ });
180
+ return r || this.configInflight.set(o, c), c;
181
+ }
182
+ setConfigCache(e, t) {
183
+ if (this.configCache.delete(e), this.configCache.set(e, t), this.configCache.size > o) {
184
+ let e = this.configCache.keys().next().value;
185
+ e !== void 0 && this.configCache.delete(e);
186
+ }
187
+ }
188
+ async syncRevision(e = 426713400) {
189
+ let t = (await this.getSpace()).rv || e;
190
+ return this.client.setRv(t), t;
191
+ }
192
+ clearCache() {
193
+ this.redirectsCache.clear(), this.configCache.clear(), this.configInflight.clear();
194
+ }
195
+ unwrapResource(e) {
196
+ return typeof e == "object" && e && "data" in e ? e.data : e;
197
+ }
198
+ unwrapCollection(e) {
199
+ if (Array.isArray(e)) return e;
200
+ if (typeof e == "object" && e && "data" in e) {
201
+ if (Array.isArray(e.data)) return e.data;
202
+ if (typeof e.data == "object" && e.data !== null && "data" in e.data && Array.isArray(e.data.data)) return e.data.data;
203
+ }
204
+ return [];
205
+ }
206
+ };
207
+ function c(e) {
208
+ return new s(e);
257
209
  }
258
- const l = h.getInstance(), v = "b10cks-preview-style", C = "--b10cks-scroll-offset";
259
- function E() {
260
- if (typeof document > "u" || document.getElementById(v))
261
- return;
262
- const i = document.createElement("style");
263
- i.id = v, i.textContent = `
264
- .b10cks-preview { scroll-margin-top: var(${C}, 0px); }
210
+ //#endregion
211
+ //#region src/preview-bridge.ts
212
+ var l = /* @__PURE__ */ new Set([
213
+ "CONTENT_UPDATE",
214
+ "CONTENT_PATCH",
215
+ "SELECT_UPDATE",
216
+ "HOVER_UPDATE",
217
+ "FIELD_UPDATE",
218
+ "FIELD_SELECT"
219
+ ]), u = "B10CKS_BRIDGE_READY", d = class e {
220
+ static instance;
221
+ listeners = {};
222
+ initialized = !1;
223
+ allowedOrigins = null;
224
+ parentOrigin = null;
225
+ constructor() {}
226
+ static getInstance() {
227
+ return e.instance ||= new e(), e.instance;
228
+ }
229
+ init(e = {}) {
230
+ !this.isInPreviewMode() || this.initialized || (this.allowedOrigins = e.allowedOrigins ?? null, window.addEventListener("message", this.handleMessage), this.initialized = !0, window.parent.postMessage({ type: u }, "*"));
231
+ }
232
+ destroy() {
233
+ this.initialized && typeof window < "u" && window.removeEventListener("message", this.handleMessage), this.initialized = !1, this.parentOrigin = null;
234
+ for (let e of Object.keys(this.listeners)) this.listeners[e]?.clear();
235
+ }
236
+ isInPreviewMode() {
237
+ return typeof window < "u" && window.self !== window.top;
238
+ }
239
+ on(e, t) {
240
+ if (!this.isInPreviewMode()) return () => {};
241
+ let n = this.listeners[e] || /* @__PURE__ */ new Set();
242
+ return this.listeners[e] = n, n.add(t), () => {
243
+ n.delete(t);
244
+ };
245
+ }
246
+ selectItem(e) {
247
+ this.post("SELECT_UPDATE", { selectedItem: e });
248
+ }
249
+ selectField(e, t) {
250
+ this.post("FIELD_SELECT", {
251
+ itemId: e,
252
+ path: t
253
+ });
254
+ }
255
+ updateField(e, t, n) {
256
+ this.post("FIELD_UPDATE", {
257
+ itemId: e,
258
+ field: t,
259
+ value: n
260
+ });
261
+ }
262
+ updateFieldAt(e, t, n) {
263
+ this.post("FIELD_UPDATE", {
264
+ itemId: e,
265
+ path: t,
266
+ value: n
267
+ });
268
+ }
269
+ post(e, t) {
270
+ this.isInPreviewMode() && window.parent.postMessage({
271
+ type: e,
272
+ payload: t
273
+ }, this.parentOrigin ?? "*");
274
+ }
275
+ handleMessage = (e) => {
276
+ if (!this.isOriginTrusted(e.origin) || !e.data || typeof e.data != "object") return;
277
+ let { type: t, payload: n } = e.data;
278
+ !t || !l.has(t) || !n || (!this.parentOrigin && e.origin && e.origin !== "null" && (this.parentOrigin = e.origin), this.notify(t, n));
279
+ };
280
+ isOriginTrusted(e) {
281
+ return this.parentOrigin ? e === this.parentOrigin : this.allowedOrigins ? this.allowedOrigins.includes(e) : !0;
282
+ }
283
+ notify(e, t) {
284
+ let n = this.listeners[e];
285
+ if (n) for (let e of n) e(t);
286
+ }
287
+ }, f = d.getInstance(), p = "b10cks-preview-style", m = "--b10cks-scroll-offset";
288
+ function h() {
289
+ if (typeof document > "u" || document.getElementById(p)) return;
290
+ let e = document.createElement("style");
291
+ e.id = p, e.textContent = `
292
+ .b10cks-preview { scroll-margin-top: var(${m}, 0px); }
265
293
  .b10cks-hover,
266
294
  .b10cks-preview:hover {
267
295
  outline: 2px dashed rgba(59, 130, 246, 0.5);
@@ -271,320 +299,345 @@ function E() {
271
299
  outline: 2px solid rgb(59, 130, 246) !important;
272
300
  outline-offset: 2px;
273
301
  }
274
- `, document.head.appendChild(i);
302
+ `, document.head.appendChild(e);
275
303
  }
276
- function F(i) {
277
- if (typeof document > "u")
278
- return;
279
- const t = typeof i == "number" ? `${i}px` : i;
280
- document.documentElement.style.setProperty(C, t);
304
+ function g(e) {
305
+ if (typeof document > "u") return;
306
+ let t = typeof e == "number" ? `${e}px` : e;
307
+ document.documentElement.style.setProperty(m, t);
281
308
  }
282
- function O(i, t) {
283
- if (!l.isInPreviewMode() || !t.id)
284
- return () => {
285
- };
286
- E();
287
- const { id: e, onSelectChange: n, onHoverChange: s, scrollOnSelect: r = !0 } = t;
288
- i.classList.add("b10cks-preview");
289
- const o = (u) => {
290
- u.preventDefault(), u.stopPropagation(), l.selectItem(e);
291
- }, a = ({ selectedItem: u }) => {
292
- const f = u === e;
293
- i.classList.toggle("b10cks-selected", f), f && r && k(i), n?.(f);
294
- }, c = ({ selectedItem: u }) => {
295
- const f = u === e;
296
- i.classList.toggle("b10cks-hover", f), s?.(f);
297
- };
298
- i.addEventListener("click", o);
299
- const d = l.on("SELECT_UPDATE", a), p = l.on("HOVER_UPDATE", c);
300
- return () => {
301
- i.removeEventListener("click", o), d(), p(), i.classList.remove("b10cks-preview", "b10cks-selected", "b10cks-hover");
302
- };
309
+ function _(e, t) {
310
+ if (!f.isInPreviewMode() || !t.id) return () => {};
311
+ h();
312
+ let { id: n, onSelectChange: r, onHoverChange: i, scrollOnSelect: a = !0 } = t;
313
+ e.classList.add("b10cks-preview");
314
+ let o = (e) => {
315
+ e.preventDefault(), e.stopPropagation(), f.selectItem(n);
316
+ }, s = ({ selectedItem: t }) => {
317
+ let i = t === n;
318
+ e.classList.toggle("b10cks-selected", i), i && a && y(e), r?.(i);
319
+ }, c = ({ selectedItem: t }) => {
320
+ let r = t === n;
321
+ e.classList.toggle("b10cks-hover", r), i?.(r);
322
+ };
323
+ e.addEventListener("click", o);
324
+ let l = f.on("SELECT_UPDATE", s), u = f.on("HOVER_UPDATE", c);
325
+ return () => {
326
+ e.removeEventListener("click", o), l(), u(), e.classList.remove("b10cks-preview", "b10cks-selected", "b10cks-hover");
327
+ };
303
328
  }
304
- function $(i, t) {
305
- if (!l.isInPreviewMode() || !t.id)
306
- return () => {
307
- };
308
- const { id: e, field: n, path: s, mode: r = "inline" } = t;
309
- if (r === "select") {
310
- E(), i.classList.add("b10cks-preview");
311
- const a = (c) => {
312
- c.preventDefault(), c.stopPropagation(), s ? l.selectField(e, s) : l.selectItem(e);
313
- };
314
- return i.addEventListener("click", a), () => {
315
- i.removeEventListener("click", a), i.classList.remove("b10cks-preview");
316
- };
317
- }
318
- i.setAttribute("contenteditable", "true");
319
- const o = (a) => {
320
- const c = a.target.innerText;
321
- s ? l.updateFieldAt(e, s, c) : l.updateField(e, n ?? "", c);
322
- };
323
- return i.addEventListener("input", o), () => {
324
- i.removeEventListener("input", o), i.removeAttribute("contenteditable");
325
- };
329
+ function v(e, t) {
330
+ if (!f.isInPreviewMode() || !t.id) return () => {};
331
+ let { id: n, field: r, path: i, mode: a = "inline" } = t;
332
+ if (a === "select") {
333
+ h(), e.classList.add("b10cks-preview");
334
+ let t = (e) => {
335
+ e.preventDefault(), e.stopPropagation(), i ? f.selectField(n, i) : f.selectItem(n);
336
+ };
337
+ return e.addEventListener("click", t), () => {
338
+ e.removeEventListener("click", t), e.classList.remove("b10cks-preview");
339
+ };
340
+ }
341
+ e.setAttribute("contenteditable", "true");
342
+ let o = (e) => {
343
+ let t = e.target.innerText;
344
+ i ? f.updateFieldAt(n, i, t) : f.updateField(n, r ?? "", t);
345
+ };
346
+ return e.addEventListener("input", o), () => {
347
+ e.removeEventListener("input", o), e.removeAttribute("contenteditable");
348
+ };
326
349
  }
327
- function k(i) {
328
- typeof i.scrollIntoView == "function" && i.scrollIntoView({ block: "nearest", behavior: "smooth" });
350
+ function y(e) {
351
+ typeof e.scrollIntoView == "function" && e.scrollIntoView({
352
+ block: "nearest",
353
+ behavior: "smooth"
354
+ });
329
355
  }
330
- function D(i, t) {
331
- let e = i;
332
- for (const n of t) {
333
- if (e == null || typeof e != "object")
334
- return;
335
- e = e[n];
336
- }
337
- return e;
356
+ //#endregion
357
+ //#region src/preview-store.ts
358
+ function b(e, t) {
359
+ let n = e;
360
+ for (let e of t) {
361
+ if (typeof n != "object" || !n) return;
362
+ n = n[e];
363
+ }
364
+ return n;
338
365
  }
339
- function m(i, t, e) {
340
- if (t.length === 0)
341
- return e;
342
- const [n, ...s] = t;
343
- if (n === void 0)
344
- return e;
345
- if (typeof n == "number") {
346
- const o = Array.isArray(i) ? i.slice() : [];
347
- return o[n] = m(o[n], s, e), o;
348
- }
349
- const r = i && typeof i == "object" && !Array.isArray(i) ? { ...i } : {};
350
- return r[n] = m(r[n], s, e), r;
366
+ function x(e, t, n) {
367
+ if (t.length === 0) return n;
368
+ let [r, ...i] = t;
369
+ if (r === void 0) return n;
370
+ if (typeof r == "number") {
371
+ let t = Array.isArray(e) ? e.slice() : [];
372
+ return t[r] = x(t[r], i, n), t;
373
+ }
374
+ let a = e && typeof e == "object" && !Array.isArray(e) ? { ...e } : {};
375
+ return a[r] = x(a[r], i, n), a;
351
376
  }
352
- class I {
353
- content;
354
- listeners = /* @__PURE__ */ new Set();
355
- constructor(t) {
356
- this.content = t;
357
- }
358
- subscribe = (t) => (this.listeners.add(t), () => {
359
- this.listeners.delete(t);
360
- });
361
- getSnapshot = () => this.content;
362
- setContent(t) {
363
- this.content = t, this.emit();
364
- }
365
- patch(t, e) {
366
- this.content = m(this.content, t, e), this.emit();
367
- }
368
- emit() {
369
- for (const t of this.listeners)
370
- t();
371
- }
372
- }
373
- function U(i) {
374
- const t = l.on("CONTENT_UPDATE", ({ content: n }) => {
375
- i.setContent(n);
376
- }), e = l.on("CONTENT_PATCH", ({ path: n, value: s }) => {
377
- i.patch(n, s);
378
- });
379
- return () => {
380
- t(), e();
381
- };
382
- }
383
- function w(i) {
384
- return (i ?? "").trim().replace(/^\/+|\/+$/g, "");
377
+ var S = class {
378
+ content;
379
+ listeners = /* @__PURE__ */ new Set();
380
+ constructor(e) {
381
+ this.content = e;
382
+ }
383
+ subscribe = (e) => (this.listeners.add(e), () => {
384
+ this.listeners.delete(e);
385
+ });
386
+ getSnapshot = () => this.content;
387
+ setContent(e) {
388
+ this.content = e, this.emit();
389
+ }
390
+ patch(e, t) {
391
+ this.content = x(this.content, e, t), this.emit();
392
+ }
393
+ emit() {
394
+ for (let e of this.listeners) e();
395
+ }
396
+ };
397
+ function C(e) {
398
+ let t = f.on("CONTENT_UPDATE", ({ content: t }) => {
399
+ e.setContent(t);
400
+ }), n = f.on("CONTENT_PATCH", ({ path: t, value: n }) => {
401
+ e.patch(t, n);
402
+ });
403
+ return () => {
404
+ t(), n();
405
+ };
385
406
  }
386
- function R(i, t) {
387
- const e = w(i), n = w(t);
388
- if (!n)
389
- return e && e !== "home" ? `/${e}` : "/";
390
- if (!e || e === "home")
391
- return `/${n}`;
392
- const s = `${n}/`;
393
- return e === n || e.startsWith(s) ? `/${e}` : `/${n}/${e}`;
407
+ //#endregion
408
+ //#region src/sitemap.ts
409
+ function w(e) {
410
+ return (e ?? "").trim().replace(/^\/+|\/+$/g, "");
394
411
  }
395
- function b(i, t) {
396
- if (!t) return null;
397
- try {
398
- return new URL(i, t).toString();
399
- } catch {
400
- return null;
401
- }
412
+ function T(e, t) {
413
+ let n = w(e), r = w(t);
414
+ if (!r) return n && n !== "home" ? `/${n}` : "/";
415
+ if (!n || n === "home") return `/${r}`;
416
+ let i = `${r}/`;
417
+ return n === r || n.startsWith(i) ? `/${n}` : `/${r}/${n}`;
402
418
  }
403
- function y(i) {
404
- return i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
419
+ function E(e, t) {
420
+ if (!t) return null;
421
+ try {
422
+ return new URL(e, t).toString();
423
+ } catch {
424
+ return null;
425
+ }
405
426
  }
406
- function x(i, t = {}) {
407
- const { siteUrl: e, locale: n } = t, s = /* @__PURE__ */ new Set();
408
- return i.filter((r) => {
409
- if (n && r.language_iso !== n || r.meta?.robots?.toLowerCase().includes("noindex")) return !1;
410
- const o = R(r.full_slug, r.language_iso), a = e ? b(o, e) ?? o : o;
411
- return s.has(a) ? !1 : (s.add(a), !0);
412
- });
427
+ function D(e) {
428
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
413
429
  }
414
- function z(i, t) {
415
- return [
416
- '<?xml version="1.0" encoding="UTF-8"?>',
417
- '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
418
- i.map((n) => {
419
- const s = R(n.full_slug, n.language_iso), r = t ? b(s, t) : s;
420
- if (!r) return "";
421
- const o = [" <url>", ` <loc>${y(r)}</loc>`];
422
- return n.published_at && o.push(` <lastmod>${y(n.published_at)}</lastmod>`), o.push(" </url>"), o.join(`
423
- `);
424
- }).filter(Boolean).join(`
425
- `),
426
- "</urlset>"
427
- ].join(`
428
- `);
430
+ function O(e, t = {}) {
431
+ let { siteUrl: n, locale: r } = t, i = /* @__PURE__ */ new Set();
432
+ return e.filter((e) => {
433
+ if (r && e.language_iso !== r || e.meta?.robots?.toLowerCase().includes("noindex")) return !1;
434
+ let t = T(e.full_slug, e.language_iso), a = n ? E(t, n) ?? t : t;
435
+ return i.has(a) ? !1 : (i.add(a), !0);
436
+ });
429
437
  }
430
- function M(i, t) {
431
- return [
432
- '<?xml version="1.0" encoding="UTF-8"?>',
433
- '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
434
- i.map((n) => {
435
- const s = t ? b(n, t) : n;
436
- return s ? [" <sitemap>", ` <loc>${y(s)}</loc>`, " </sitemap>"].join(`
437
- `) : "";
438
- }).filter(Boolean).join(`
439
- `),
440
- "</sitemapindex>"
441
- ].join(`
442
- `);
438
+ function k(e, t) {
439
+ return [
440
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
441
+ "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">",
442
+ e.map((e) => {
443
+ let n = T(e.full_slug, e.language_iso), r = t ? E(n, t) : n;
444
+ if (!r) return "";
445
+ let i = [" <url>", ` <loc>${D(r)}</loc>`];
446
+ return e.published_at && i.push(` <lastmod>${D(e.published_at)}</lastmod>`), i.push(" </url>"), i.join("\n");
447
+ }).filter(Boolean).join("\n"),
448
+ "</urlset>"
449
+ ].join("\n");
443
450
  }
444
- const N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
445
- __proto__: null
446
- }, Symbol.toStringTag, { value: "Module" }));
447
- class V {
448
- baseUrl;
449
- token;
450
- vid;
451
- fetchClient;
452
- getRvFn;
453
- setRvFn;
454
- /**
455
- * Per-instance revision store, used when no `getRv`/`setRv` callbacks are
456
- * supplied. Kept on the instance (not module scope) so concurrent requests
457
- * in a server runtime cannot leak revisions into one another. Server callers
458
- * that need request-scoped persistence should pass `getRv`/`setRv`.
459
- */
460
- rvValue = 0;
461
- constructor(t, e) {
462
- this.baseUrl = t.baseUrl.endsWith("/") ? t.baseUrl.slice(0, -1) : t.baseUrl, this.token = t.token;
463
- const n = typeof globalThis.fetch == "function" ? globalThis.fetch.bind(globalThis) : null;
464
- if (t.fetchClient)
465
- this.fetchClient = t.fetchClient;
466
- else if (n)
467
- this.fetchClient = n;
468
- else
469
- throw new Error(
470
- "No fetch implementation available. Provide `fetchClient` in ApiClient options."
471
- );
472
- this.getRvFn = t.getRv, this.setRvFn = t.setRv;
473
- const s = this.resolveRequestUrl(e);
474
- this.vid = t.version || "published", this.setRv(s?.searchParams.get("b10cks_rv") || t.rv || 0);
475
- }
476
- async get(t, e = {}) {
477
- const n = this.buildUrl(t, {
478
- vid: this.vid,
479
- rv: this.getRv(),
480
- ...e,
481
- token: this.token
482
- }), s = await this.fetchClient(n), r = await this.parseResponse(s);
483
- return this.hasRevision(r) && this.setRv(r.rv), r;
484
- }
485
- async post(t, e, n = {}) {
486
- const s = this.buildUrl(t, {
487
- vid: this.vid,
488
- rv: this.getRv(),
489
- ...n,
490
- token: this.token
491
- }), r = await this.fetchClient(s, {
492
- method: "POST",
493
- headers: { "Content-Type": "application/json" },
494
- body: e !== void 0 ? JSON.stringify(e) : void 0
495
- });
496
- return this.parseResponse(r);
497
- }
498
- async getAll(t, e = {}) {
499
- const n = await this.get(t, {
500
- ...e,
501
- page: 1
502
- }), s = this.normalizeCollectionResponse(n);
503
- if (s.rv && this.setRv(s.rv), !s.meta || s.meta.last_page <= 1)
504
- return s.data;
505
- const r = Array.from(
506
- { length: s.meta.last_page - 1 },
507
- (a, c) => this.get(t, { ...e, page: c + 2 })
508
- ), o = await Promise.all(r);
509
- return s.data.concat(
510
- o.flatMap((a) => this.normalizeCollectionResponse(a).data)
511
- );
512
- }
513
- setRv(t) {
514
- this.setRvFn ? this.setRvFn(t) : this.rvValue = t;
515
- }
516
- getRv() {
517
- return this.getRvFn ? this.getRvFn() : this.rvValue;
518
- }
519
- async parseResponse(t) {
520
- if (this.isFetchResponse(t)) {
521
- if (!t.ok)
522
- throw new Error(`Request failed with status ${t.status}`);
523
- return await t.json();
524
- }
525
- return t;
526
- }
527
- normalizeCollectionResponse(t) {
528
- if (this.isCollectionResponseEnvelope(t)) {
529
- const e = t.data;
530
- return {
531
- data: e.data,
532
- meta: e.meta,
533
- rv: t.rv || e.rv
534
- };
535
- }
536
- if (Array.isArray(t))
537
- return { data: t, meta: void 0, rv: void 0 };
538
- if (typeof t == "object" && t !== null && "data" in t) {
539
- const {
540
- data: e,
541
- meta: n,
542
- rv: s
543
- } = t;
544
- return { data: e, meta: n, rv: s };
545
- }
546
- return { data: [], meta: void 0, rv: void 0 };
547
- }
548
- buildUrl(t, e) {
549
- const n = new URL(`${this.baseUrl}/v1/${t}`);
550
- return Object.entries(e).forEach(([s, r]) => {
551
- r != null && n.searchParams.append(s, String(r));
552
- }), n.toString();
553
- }
554
- resolveRequestUrl(t) {
555
- return t ? t instanceof URL ? t : new URL(t, "http://localhost") : null;
556
- }
557
- isFetchResponse(t) {
558
- return typeof t == "object" && t !== null && "json" in t && typeof t.json == "function" && "ok" in t;
559
- }
560
- hasRevision(t) {
561
- return typeof t == "object" && t !== null && "rv" in t;
562
- }
563
- isCollectionResponseEnvelope(t) {
564
- return typeof t == "object" && t !== null && "data" in t && typeof t.data == "object" && t.data !== null && "data" in t.data && Array.isArray(t.data.data);
565
- }
451
+ function A(e, t) {
452
+ return [
453
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
454
+ "<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">",
455
+ e.map((e) => {
456
+ let n = t ? E(e, t) : e;
457
+ return n ? [
458
+ " <sitemap>",
459
+ ` <loc>${D(n)}</loc>`,
460
+ " </sitemap>"
461
+ ].join("\n") : "";
462
+ }).filter(Boolean).join("\n"),
463
+ "</sitemapindex>"
464
+ ].join("\n");
566
465
  }
567
- export {
568
- V as ApiClient,
569
- P as B10cksDataApi,
570
- h as PreviewBridge,
571
- I as PreviewStore,
572
- O as attachEditable,
573
- $ as attachEditableField,
574
- U as bindPreviewStore,
575
- R as buildLocalizedPath,
576
- L as createB10cksDataApi,
577
- E as ensurePreviewStyles,
578
- x as filterSitemapEntries,
579
- D as getAtPath,
580
- w as normalizePathSegment,
581
- l as previewBridge,
582
- M as renderSitemapIndex,
583
- z as renderSitemapXml,
584
- _ as resolveB10cksLink,
585
- S as serializeFilter,
586
- m as setAtPath,
587
- F as setPreviewScrollOffset,
588
- N as types
466
+ //#endregion
467
+ //#region src/types.ts
468
+ var j = /* @__PURE__ */ t({}), M = class extends Error {
469
+ status;
470
+ endpoint;
471
+ body;
472
+ constructor(e, t, n, r) {
473
+ super(e), this.status = t, this.endpoint = n, this.body = r, this.name = "ApiError";
474
+ }
475
+ }, N = (e) => e === 429 || e >= 500 && e <= 599, P = (e) => new Promise((t) => setTimeout(t, e)), F = class {
476
+ baseUrl;
477
+ token;
478
+ vid;
479
+ fetchClient;
480
+ getRvFn;
481
+ setRvFn;
482
+ timeoutMs;
483
+ retries;
484
+ maxConcurrency;
485
+ rvValue = 0;
486
+ constructor(e, t) {
487
+ this.baseUrl = e.baseUrl.endsWith("/") ? e.baseUrl.slice(0, -1) : e.baseUrl, this.token = e.token;
488
+ let n = typeof globalThis.fetch == "function" ? globalThis.fetch.bind(globalThis) : null;
489
+ if (e.fetchClient) this.fetchClient = e.fetchClient;
490
+ else if (n) this.fetchClient = n;
491
+ else throw Error("No fetch implementation available. Provide `fetchClient` in ApiClient options.");
492
+ this.getRvFn = e.getRv, this.setRvFn = e.setRv, this.timeoutMs = e.timeoutMs, this.retries = Math.max(0, e.retries ?? 0), this.maxConcurrency = Math.max(1, e.maxConcurrency ?? 6);
493
+ let r = this.resolveRequestUrl(t);
494
+ this.vid = e.version || "published", this.setRv(r?.searchParams.get("b10cks_rv") || e.rv || 0);
495
+ }
496
+ async get(e, t = {}) {
497
+ let n = this.buildUrl(e, {
498
+ vid: this.vid,
499
+ rv: this.getRv(),
500
+ ...t,
501
+ token: this.token
502
+ }), r = await this.requestWithRetry(n, e);
503
+ return this.hasRevision(r) && this.setRv(r.rv), r;
504
+ }
505
+ async post(e, t, n = {}) {
506
+ let r = this.buildUrl(e, {
507
+ vid: this.vid,
508
+ rv: this.getRv(),
509
+ ...n,
510
+ token: this.token
511
+ }), i = await this.fetchWithTimeout(r, {
512
+ method: "POST",
513
+ headers: { "Content-Type": "application/json" },
514
+ body: t === void 0 ? void 0 : JSON.stringify(t)
515
+ });
516
+ return this.parseResponse(i, e);
517
+ }
518
+ async fetchWithTimeout(e, t) {
519
+ if (!this.timeoutMs) return this.fetchClient(e, t);
520
+ let n = new AbortController(), r = setTimeout(() => n.abort(), this.timeoutMs);
521
+ try {
522
+ return await this.fetchClient(e, {
523
+ ...t,
524
+ signal: n.signal
525
+ });
526
+ } catch (t) {
527
+ throw t instanceof Error && t.name === "AbortError" ? new M(`Request timed out after ${this.timeoutMs}ms`, 0, e) : t;
528
+ } finally {
529
+ clearTimeout(r);
530
+ }
531
+ }
532
+ async requestWithRetry(e, t) {
533
+ let n;
534
+ for (let r = 0; r <= this.retries; r++) try {
535
+ let n = await this.fetchWithTimeout(e);
536
+ return await this.parseResponse(n, t);
537
+ } catch (e) {
538
+ if (n = e, !(r < this.retries && (!(e instanceof M) || e.status === 0 || N(e.status)))) throw e;
539
+ await P(200 * 2 ** r);
540
+ }
541
+ throw n;
542
+ }
543
+ async getAll(e, t = {}) {
544
+ let n = await this.get(e, {
545
+ ...t,
546
+ page: 1
547
+ }), r = this.normalizeCollectionResponse(n);
548
+ if (r.rv && this.setRv(r.rv), !r.meta || r.meta.last_page <= 1) return r.data;
549
+ let i = Array.from({ length: r.meta.last_page - 1 }, (e, t) => t + 2), a = await this.mapWithConcurrency(i, (n) => this.get(e, {
550
+ ...t,
551
+ page: n
552
+ }));
553
+ return r.data.concat(a.flatMap((e) => this.normalizeCollectionResponse(e).data));
554
+ }
555
+ async mapWithConcurrency(e, t) {
556
+ let n = Array.from({ length: e.length }), r = 0, i = async () => {
557
+ for (; r < e.length;) {
558
+ let i = r++;
559
+ n[i] = await t(e[i]);
560
+ }
561
+ }, a = Array.from({ length: Math.min(this.maxConcurrency, e.length) }, () => i());
562
+ return await Promise.all(a), n;
563
+ }
564
+ setRv(e) {
565
+ this.setRvFn ? this.setRvFn(e) : this.rvValue = e;
566
+ }
567
+ getRv() {
568
+ return this.getRvFn ? this.getRvFn() : this.rvValue;
569
+ }
570
+ async parseResponse(e, t) {
571
+ if (this.isFetchResponse(e)) {
572
+ if (!e.ok) {
573
+ let n = await this.readErrorBody(e);
574
+ throw new M(`Request to "${t}" failed with status ${e.status}`, e.status, t, n);
575
+ }
576
+ return await e.json();
577
+ }
578
+ return e;
579
+ }
580
+ async readErrorBody(e) {
581
+ try {
582
+ let t = await e.text();
583
+ if (!t) return;
584
+ try {
585
+ return JSON.parse(t);
586
+ } catch {
587
+ return t;
588
+ }
589
+ } catch {
590
+ return;
591
+ }
592
+ }
593
+ normalizeCollectionResponse(e) {
594
+ if (this.isCollectionResponseEnvelope(e)) {
595
+ let t = e.data;
596
+ return {
597
+ data: t.data,
598
+ meta: t.meta,
599
+ rv: e.rv || t.rv
600
+ };
601
+ }
602
+ if (Array.isArray(e)) return {
603
+ data: e,
604
+ meta: void 0,
605
+ rv: void 0
606
+ };
607
+ if (typeof e == "object" && e && "data" in e) {
608
+ let { data: t, meta: n, rv: r } = e;
609
+ return {
610
+ data: t,
611
+ meta: n,
612
+ rv: r
613
+ };
614
+ }
615
+ return {
616
+ data: [],
617
+ meta: void 0,
618
+ rv: void 0
619
+ };
620
+ }
621
+ buildUrl(e, t) {
622
+ let n = new URL(`${this.baseUrl}/v1/${e}`);
623
+ return Object.entries(t).forEach(([e, t]) => {
624
+ t != null && n.searchParams.append(e, String(t));
625
+ }), n.toString();
626
+ }
627
+ resolveRequestUrl(e) {
628
+ return e ? e instanceof URL ? e : new URL(e, "http://localhost") : null;
629
+ }
630
+ isFetchResponse(e) {
631
+ return typeof e == "object" && !!e && "json" in e && typeof e.json == "function" && "ok" in e;
632
+ }
633
+ hasRevision(e) {
634
+ return typeof e == "object" && !!e && "rv" in e && e.rv != null;
635
+ }
636
+ isCollectionResponseEnvelope(e) {
637
+ return typeof e == "object" && !!e && "data" in e && typeof e.data == "object" && e.data !== null && "data" in e.data && Array.isArray(e.data.data);
638
+ }
589
639
  };
590
- //# sourceMappingURL=index.mjs.map
640
+ //#endregion
641
+ export { F as ApiClient, M as ApiError, s as B10cksDataApi, d as PreviewBridge, S as PreviewStore, _ as attachEditable, v as attachEditableField, C as bindPreviewStore, T as buildLocalizedPath, c as createB10cksDataApi, h as ensurePreviewStyles, O as filterSitemapEntries, b as getAtPath, w as normalizePathSegment, f as previewBridge, A as renderSitemapIndex, k as renderSitemapXml, n as resolveB10cksLink, i as serializeFilter, x as setAtPath, g as setPreviewScrollOffset, j as types };
642
+
643
+ //# sourceMappingURL=index.mjs.map