@xosen/site-sdk 0.0.6 → 0.0.8

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.js CHANGED
@@ -1,1078 +1,131 @@
1
- import { onMounted as O, computed as f, defineComponent as g, openBlock as n, createElementBlock as a, Fragment as v, renderList as y, normalizeClass as S, toDisplayString as _, ref as j, onUnmounted as U, resolveComponent as R, createElementVNode as d, createVNode as N, withCtx as B, createBlock as C, createTextVNode as L, createCommentVNode as u, renderSlot as G, normalizeStyle as F, resolveDynamicComponent as M, watch as P, mergeProps as J } from "vue";
2
- import { useI18n as E } from "vue-i18n";
3
- function V(r) {
4
- function o(e) {
5
- const t = document.documentElement;
6
- if (e.colors)
7
- for (const [c, i] of Object.entries(e.colors))
8
- i && t.style.setProperty(`--x-color-${W(c)}`, i);
9
- e.typography?.fontFamily && t.style.setProperty("--x-font-family", e.typography.fontFamily), e.typography?.headingFont && t.style.setProperty("--x-font-heading", e.typography.headingFont), e.typography?.baseFontSize && t.style.setProperty("--x-font-size", e.typography.baseFontSize), e.shape?.borderRadius && t.style.setProperty("--x-border-radius", e.shape.borderRadius), e.shape?.maxWidth && t.style.setProperty("--x-max-width", e.shape.maxWidth);
10
- }
11
- O(() => {
12
- if (r) {
13
- o(r);
14
- return;
1
+ import { ref as y, onMounted as T, watch as $, computed as u, onUnmounted as b } from "vue";
2
+ import { useI18n as C } from "vue-i18n";
3
+ function R(n, o) {
4
+ const t = y(null), { locale: e } = C(), a = window.__SITE_DATA__, s = a?.locale;
5
+ function c() {
6
+ return a && a[n] && e.value === s ? (t.value = a[n], !0) : !1;
7
+ }
8
+ async function h() {
9
+ try {
10
+ const r = await fetch(`/api/content/${o}:${e.value}`);
11
+ r.ok && (t.value = await r.json());
12
+ } catch {
15
13
  }
16
- const t = window.__SITE_DATA__?.skin;
17
- t && (t.colors || t.typography || t.shape) && o({
18
- colors: t.colors || {},
19
- typography: t.typography || {},
20
- shape: t.shape || {}
21
- });
22
- });
23
- }
24
- function W(r) {
25
- return r.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
14
+ }
15
+ return T(() => {
16
+ c() || h();
17
+ }), $(e, () => {
18
+ h();
19
+ }), t;
26
20
  }
27
- function q() {
28
- const r = window.__SITE_DATA__, o = f(() => r?.config || null), e = f(() => r?.components || {}), t = f(() => o.value?.navigation || []), c = f(() => o.value?.locales || []), i = f(() => o.value?.defaultLocale || "en"), s = f(() => o.value?.branding || {}), l = f(() => o.value?.footer || {}), p = f(() => o.value?.features || {});
29
- function h($) {
30
- const x = p.value[$];
31
- return typeof x == "boolean" ? x : typeof x == "object";
21
+ function O() {
22
+ const n = window.__SITE_DATA__, o = u(() => n?.config || null), t = u(() => n?.components || {}), e = u(() => o.value?.navigation || []), a = u(() => o.value?.locales || []), s = u(() => o.value?.defaultLocale || "en"), c = u(() => o.value?.branding || {}), h = u(() => o.value?.footer || {}), r = u(() => o.value?.features || {});
23
+ function f(g) {
24
+ const p = r.value[g];
25
+ return typeof p == "boolean" ? p : typeof p == "object";
32
26
  }
33
27
  return {
34
28
  config: o,
35
- components: e,
36
- navigation: t,
37
- locales: c,
38
- defaultLocale: i,
39
- branding: s,
40
- footer: l,
41
- features: p,
42
- hasFeature: h
29
+ components: t,
30
+ navigation: e,
31
+ locales: a,
32
+ defaultLocale: s,
33
+ branding: c,
34
+ footer: h,
35
+ features: r,
36
+ hasFeature: f
43
37
  };
44
38
  }
45
- const K = /* @__PURE__ */ g({
46
- __name: "XLocaleSwitcher",
47
- props: {
48
- locales: { type: Array, required: !0 }
49
- },
50
- setup(r, { expose: o }) {
51
- o();
52
- const { locale: e } = E();
53
- function t(i) {
54
- e.value = i, localStorage.setItem("site-locale", i);
55
- }
56
- const c = { locale: e, switchLocale: t };
57
- return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
58
- }
59
- }), k = (r, o) => {
60
- const e = r.__vccOpts || r;
61
- for (const [t, c] of o)
62
- e[t] = c;
63
- return e;
64
- }, Y = { class: "x-locale-switcher" }, Z = ["onClick"];
65
- function Q(r, o, e, t, c, i) {
66
- return n(), a("div", Y, [
67
- (n(!0), a(
68
- v,
69
- null,
70
- y(e.locales, (s) => (n(), a("button", {
71
- key: s,
72
- class: S(["x-locale-switcher__btn", { "x-locale-switcher__btn--active": t.locale === s }]),
73
- onClick: (l) => t.switchLocale(s)
74
- }, _(s.toUpperCase()), 11, Z))),
75
- 128
76
- /* KEYED_FRAGMENT */
77
- ))
78
- ]);
79
- }
80
- const ee = /* @__PURE__ */ k(K, [["render", Q], ["__scopeId", "data-v-675f0bbd"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/common/XLocaleSwitcher.vue"]]), te = /* @__PURE__ */ g({
81
- __name: "XSiteNav",
82
- setup(r, { expose: o }) {
83
- o();
84
- const { locale: e } = E(), { navigation: t, branding: c, locales: i, defaultLocale: s } = q();
85
- function l(m) {
86
- return typeof m.text == "string" ? m.text : m.text[e.value] || m.text[s.value] || Object.values(m.text)[0] || "";
87
- }
88
- const p = j(!1), h = j(!1);
89
- function $() {
90
- p.value = window.scrollY > 20;
91
- }
92
- O(() => window.addEventListener("scroll", $)), U(() => window.removeEventListener("scroll", $));
93
- const x = { locale: e, navigation: t, branding: c, locales: i, defaultLocale: s, navText: l, scrolled: p, menuOpen: h, onScroll: $, XLocaleSwitcher: ee };
94
- return Object.defineProperty(x, "__isScriptSetup", { enumerable: !1, value: !0 }), x;
95
- }
96
- }), se = { class: "x-nav__container" }, oe = ["src", "alt"], ne = {
97
- key: 1,
98
- class: "x-nav__logo-text"
99
- }, ae = ["href"];
100
- function re(r, o, e, t, c, i) {
101
- const s = R("router-link");
102
- return n(), a(
103
- "nav",
104
- {
105
- class: S(["x-nav", { "x-nav--scrolled": t.scrolled }])
106
- },
107
- [
108
- d("div", se, [
109
- N(s, {
110
- to: "/",
111
- class: "x-nav__logo"
112
- }, {
113
- default: B(() => [
114
- t.branding.logo ? (n(), a("img", {
115
- key: 0,
116
- src: t.branding.logo,
117
- alt: t.branding.siteName || "",
118
- class: "x-nav__logo-img"
119
- }, null, 8, oe)) : (n(), a(
120
- "span",
121
- ne,
122
- _(t.branding.siteName || ""),
123
- 1
124
- /* TEXT */
125
- ))
126
- ]),
127
- _: 1
128
- /* STABLE */
129
- }),
130
- d(
131
- "div",
132
- {
133
- class: S(["x-nav__links", { "x-nav__links--open": t.menuOpen }])
134
- },
135
- [
136
- (n(!0), a(
137
- v,
138
- null,
139
- y(t.navigation, (l) => (n(), a(
140
- v,
141
- {
142
- key: l.url
143
- },
144
- [
145
- l.external ? (n(), a("a", {
146
- key: 0,
147
- href: l.url,
148
- class: "x-nav__link",
149
- target: "_blank",
150
- onClick: o[0] || (o[0] = (p) => t.menuOpen = !1)
151
- }, _(t.navText(l)), 9, ae)) : (n(), C(s, {
152
- key: 1,
153
- to: l.url,
154
- class: "x-nav__link",
155
- onClick: o[1] || (o[1] = (p) => t.menuOpen = !1)
156
- }, {
157
- default: B(() => [
158
- L(
159
- _(t.navText(l)),
160
- 1
161
- /* TEXT */
162
- )
163
- ]),
164
- _: 2
165
- /* DYNAMIC */
166
- }, 1032, ["to"]))
167
- ],
168
- 64
169
- /* STABLE_FRAGMENT */
170
- ))),
171
- 128
172
- /* KEYED_FRAGMENT */
173
- )),
174
- t.locales.length > 1 ? (n(), C(t.XLocaleSwitcher, {
175
- key: 0,
176
- locales: t.locales
177
- }, null, 8, ["locales"])) : u("v-if", !0)
178
- ],
179
- 2
180
- /* CLASS */
181
- ),
182
- d("button", {
183
- class: "x-nav__hamburger",
184
- onClick: o[2] || (o[2] = (l) => t.menuOpen = !t.menuOpen)
185
- }, [...o[3] || (o[3] = [
186
- d(
187
- "span",
188
- null,
189
- null,
190
- -1
191
- /* CACHED */
192
- ),
193
- d(
194
- "span",
195
- null,
196
- null,
197
- -1
198
- /* CACHED */
199
- ),
200
- d(
201
- "span",
202
- null,
203
- null,
204
- -1
205
- /* CACHED */
206
- )
207
- ])])
208
- ])
209
- ],
210
- 2
211
- /* CLASS */
212
- );
213
- }
214
- const ce = /* @__PURE__ */ k(te, [["render", re], ["__scopeId", "data-v-07c4b748"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/layout/XSiteNav.vue"]]), ie = /* @__PURE__ */ g({
215
- __name: "XSiteFooter",
216
- setup(r, { expose: o }) {
217
- o();
218
- const { footer: e, branding: t } = q(), c = f(() => e.value.copyright ? e.value.copyright : `© ${(/* @__PURE__ */ new Date()).getFullYear()} ${t.value.siteName || ""}`), i = { footerConfig: e, branding: t, copyright: c };
219
- return Object.defineProperty(i, "__isScriptSetup", { enumerable: !1, value: !0 }), i;
220
- }
221
- }), le = { class: "x-footer" }, _e = { class: "x-footer__container" }, ue = {
222
- key: 0,
223
- class: "x-footer__links"
224
- }, de = {
225
- key: 1,
226
- class: "x-footer__copyright"
227
- };
228
- function pe(r, o, e, t, c, i) {
229
- const s = R("router-link");
230
- return n(), a("footer", le, [
231
- d("div", _e, [
232
- t.footerConfig.links?.length ? (n(), a("div", ue, [
233
- (n(!0), a(
234
- v,
235
- null,
236
- y(t.footerConfig.links, (l) => (n(), C(s, {
237
- key: l.url,
238
- to: l.url,
239
- class: "x-footer__link"
240
- }, {
241
- default: B(() => [
242
- L(
243
- _(l.text),
244
- 1
245
- /* TEXT */
246
- )
247
- ]),
248
- _: 2
249
- /* DYNAMIC */
250
- }, 1032, ["to"]))),
251
- 128
252
- /* KEYED_FRAGMENT */
253
- ))
254
- ])) : u("v-if", !0),
255
- t.copyright ? (n(), a(
256
- "p",
257
- de,
258
- _(t.copyright),
259
- 1
260
- /* TEXT */
261
- )) : u("v-if", !0)
262
- ])
263
- ]);
264
- }
265
- const fe = /* @__PURE__ */ k(ie, [["render", pe], ["__scopeId", "data-v-f9b38381"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/layout/XSiteFooter.vue"]]), me = /* @__PURE__ */ g({
266
- __name: "XSiteLayout",
267
- setup(r, { expose: o }) {
268
- o(), V();
269
- const e = { XSiteNav: ce, XSiteFooter: fe };
270
- return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
271
- }
272
- }), ve = { class: "x-site-layout" }, he = { class: "x-site-layout__main" };
273
- function xe(r, o, e, t, c, i) {
274
- return n(), a("div", ve, [
275
- N(t.XSiteNav),
276
- d("main", he, [
277
- G(r.$slots, "default", {}, void 0, !0)
278
- ]),
279
- N(t.XSiteFooter)
280
- ]);
281
- }
282
- const os = /* @__PURE__ */ k(me, [["render", xe], ["__scopeId", "data-v-41b0f2a9"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/layout/XSiteLayout.vue"]]), ye = /* @__PURE__ */ g({
283
- __name: "XHeroBlock",
284
- props: {
285
- data: { type: Object, required: !0 },
286
- variant: { type: String, required: !1, default: "fullscreen" }
287
- },
288
- setup(r, { expose: o }) {
289
- o();
290
- const e = r, t = f(() => e.data.image ? { backgroundImage: `url(${e.data.image})` } : {}), c = { props: e, bgStyle: t };
291
- return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
292
- }
293
- }), ge = {
294
- key: 0,
295
- class: "x-hero__overlay"
296
- }, ke = { class: "x-hero__content" }, be = {
297
- key: 0,
298
- class: "x-hero__title"
299
- }, $e = {
300
- key: 1,
301
- class: "x-hero__subtitle"
302
- }, Se = {
303
- key: 2,
304
- class: "x-hero__buttons"
305
- }, we = ["href"], Te = {
306
- key: 3,
307
- class: "x-hero__stats"
308
- }, je = { class: "x-hero__stat-value" }, Ce = { class: "x-hero__stat-label" };
309
- function Oe(r, o, e, t, c, i) {
310
- return n(), a(
311
- "section",
312
- {
313
- class: S(["x-hero", { "x-hero--fullscreen": e.variant === "fullscreen" }]),
314
- style: F(t.bgStyle)
315
- },
316
- [
317
- e.data.image && e.data.overlay !== !1 ? (n(), a("div", ge)) : u("v-if", !0),
318
- d("div", ke, [
319
- e.data.title ? (n(), a(
320
- "h1",
321
- be,
322
- _(e.data.title),
323
- 1
324
- /* TEXT */
325
- )) : u("v-if", !0),
326
- e.data.subtitle ? (n(), a(
327
- "p",
328
- $e,
329
- _(e.data.subtitle),
330
- 1
331
- /* TEXT */
332
- )) : u("v-if", !0),
333
- e.data.buttons?.length ? (n(), a("div", Se, [
334
- (n(!0), a(
335
- v,
336
- null,
337
- y(e.data.buttons, (s, l) => (n(), a("a", {
338
- key: l,
339
- href: s.url,
340
- class: S(["x-btn", `x-btn--${s.variant || "primary"}`])
341
- }, _(s.text), 11, we))),
342
- 128
343
- /* KEYED_FRAGMENT */
344
- ))
345
- ])) : u("v-if", !0),
346
- e.data.stats?.length ? (n(), a("div", Te, [
347
- (n(!0), a(
348
- v,
349
- null,
350
- y(e.data.stats, (s, l) => (n(), a("div", {
351
- key: l,
352
- class: "x-hero__stat"
353
- }, [
354
- d(
355
- "span",
356
- je,
357
- _(s.value),
358
- 1
359
- /* TEXT */
360
- ),
361
- d(
362
- "span",
363
- Ce,
364
- _(s.label),
365
- 1
366
- /* TEXT */
367
- )
368
- ]))),
369
- 128
370
- /* KEYED_FRAGMENT */
371
- ))
372
- ])) : u("v-if", !0)
373
- ])
374
- ],
375
- 6
376
- /* CLASS, STYLE */
377
- );
378
- }
379
- const Xe = /* @__PURE__ */ k(ye, [["render", Oe], ["__scopeId", "data-v-d8cfe56f"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XHeroBlock.vue"]]), Be = /* @__PURE__ */ g({
380
- __name: "XHtmlBlock",
381
- props: {
382
- data: { type: Object, required: !0 }
383
- },
384
- setup(r, { expose: o }) {
385
- o();
386
- const e = {};
387
- return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
388
- }
389
- }), Ie = { class: "x-html-block" }, Ne = ["innerHTML"];
390
- function Pe(r, o, e, t, c, i) {
391
- return n(), a("section", Ie, [
392
- d("div", {
393
- class: "x-html-block__content",
394
- innerHTML: e.data.content
395
- }, null, 8, Ne)
396
- ]);
397
- }
398
- const Le = /* @__PURE__ */ k(Be, [["render", Pe], ["__scopeId", "data-v-abfd69e8"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XHtmlBlock.vue"]]), Ee = /* @__PURE__ */ g({
399
- __name: "XCardsBlock",
400
- props: {
401
- data: { type: Object, required: !0 },
402
- variant: { type: String, required: !1, default: "default" },
403
- columns: { type: Number, required: !1, default: void 0 }
404
- },
405
- setup(r, { expose: o }) {
406
- o();
407
- const e = r, t = f(() => ({ "--columns": e.columns || Math.min(e.data.cards.length, 4) })), c = { color: "var(--x-color-primary, #1e73be)" }, i = {
408
- "mdi-lightbulb": "💡",
409
- "mdi-code-braces": "⚙️",
410
- "mdi-headset": "🎧",
411
- "mdi-check-circle": "✅",
412
- "mdi-shield": "🛡️",
413
- "mdi-chart-line": "📈",
414
- "mdi-rocket": "🚀",
415
- "mdi-heart": "❤️",
416
- "mdi-star": "⭐",
417
- "mdi-cog": "⚙️",
418
- "mdi-email": "📧",
419
- "mdi-phone": "📞",
420
- "mdi-map-marker": "📍",
421
- "mdi-clock": "🕐",
422
- "mdi-account": "👤",
423
- "mdi-team": "👥"
424
- };
425
- function s(p) {
426
- return i[p] || p;
39
+ function j(n) {
40
+ function o(t) {
41
+ const e = document.documentElement;
42
+ if (t.colors)
43
+ for (const [a, s] of Object.entries(t.colors))
44
+ s && e.style.setProperty(`--x-color-${x(a)}`, s);
45
+ t.typography?.fontFamily && e.style.setProperty("--x-font-family", t.typography.fontFamily), t.typography?.headingFont && e.style.setProperty("--x-font-heading", t.typography.headingFont), t.typography?.baseFontSize && e.style.setProperty("--x-font-size", t.typography.baseFontSize), t.shape?.borderRadius && e.style.setProperty("--x-border-radius", t.shape.borderRadius), t.shape?.maxWidth && e.style.setProperty("--x-max-width", t.shape.maxWidth);
46
+ }
47
+ T(() => {
48
+ if (n) {
49
+ o(n);
50
+ return;
427
51
  }
428
- const l = { props: e, gridStyle: t, iconStyle: c, iconMap: i, iconDisplay: s };
429
- return Object.defineProperty(l, "__isScriptSetup", { enumerable: !1, value: !0 }), l;
430
- }
431
- }), Ae = { class: "x-cards-block__container" }, Ue = {
432
- key: 0,
433
- class: "x-cards-block__title"
434
- }, Re = {
435
- key: 1,
436
- class: "x-cards-block__subtitle"
437
- }, Fe = ["src", "alt"], Me = { class: "x-card__title" }, qe = { class: "x-card__desc" };
438
- function De(r, o, e, t, c, i) {
439
- return n(), a(
440
- "section",
441
- {
442
- class: S(["x-cards-block", `x-cards-block--${e.variant}`])
443
- },
444
- [
445
- d("div", Ae, [
446
- e.data.title ? (n(), a(
447
- "h2",
448
- Ue,
449
- _(e.data.title),
450
- 1
451
- /* TEXT */
452
- )) : u("v-if", !0),
453
- e.data.subtitle ? (n(), a(
454
- "p",
455
- Re,
456
- _(e.data.subtitle),
457
- 1
458
- /* TEXT */
459
- )) : u("v-if", !0),
460
- d(
461
- "div",
462
- {
463
- class: "x-cards-block__grid",
464
- style: F(t.gridStyle)
465
- },
466
- [
467
- (n(!0), a(
468
- v,
469
- null,
470
- y(e.data.cards, (s, l) => (n(), C(M(s.link ? "a" : "div"), {
471
- key: l,
472
- class: "x-card",
473
- href: s.link
474
- }, {
475
- default: B(() => [
476
- s.image && e.variant === "image-cards" ? (n(), a("img", {
477
- key: 0,
478
- src: s.image,
479
- alt: s.title,
480
- class: "x-card__image"
481
- }, null, 8, Fe)) : u("v-if", !0),
482
- s.icon && e.variant !== "image-cards" ? (n(), a(
483
- "div",
484
- {
485
- key: 1,
486
- class: "x-card__icon",
487
- style: t.iconStyle
488
- },
489
- _(t.iconDisplay(s.icon)),
490
- 1
491
- /* TEXT */
492
- )) : u("v-if", !0),
493
- d(
494
- "h3",
495
- Me,
496
- _(s.title),
497
- 1
498
- /* TEXT */
499
- ),
500
- d(
501
- "p",
502
- qe,
503
- _(s.desc),
504
- 1
505
- /* TEXT */
506
- )
507
- ]),
508
- _: 2
509
- /* DYNAMIC */
510
- }, 1032, ["href"]))),
511
- 128
512
- /* KEYED_FRAGMENT */
513
- ))
514
- ],
515
- 4
516
- /* STYLE */
517
- )
518
- ])
519
- ],
520
- 2
521
- /* CLASS */
522
- );
523
- }
524
- const He = /* @__PURE__ */ k(Ee, [["render", De], ["__scopeId", "data-v-a1505674"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XCardsBlock.vue"]]), ze = /* @__PURE__ */ g({
525
- __name: "XImageTextBlock",
526
- props: {
527
- data: { type: Object, required: !0 },
528
- reverse: { type: Boolean, required: !1, default: !1 }
529
- },
530
- setup(r, { expose: o }) {
531
- o();
532
- const e = {};
533
- return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
534
- }
535
- }), Ge = { class: "x-image-text__container" }, Je = { class: "x-image-text__text" }, Ve = {
536
- key: 0,
537
- class: "x-image-text__title"
538
- }, We = ["innerHTML"], Ke = {
539
- key: 2,
540
- class: "x-image-text__checklist"
541
- }, Ye = { class: "x-image-text__check-icon" }, Ze = {
542
- key: 0,
543
- class: "x-image-text__image-wrap"
544
- }, Qe = ["src", "alt"];
545
- function et(r, o, e, t, c, i) {
546
- return n(), a(
547
- "section",
548
- {
549
- class: S(["x-image-text", { "x-image-text--reverse": e.reverse }])
550
- },
551
- [
552
- d("div", Ge, [
553
- d("div", Je, [
554
- e.data.title ? (n(), a(
555
- "h2",
556
- Ve,
557
- _(e.data.title),
558
- 1
559
- /* TEXT */
560
- )) : u("v-if", !0),
561
- e.data.content ? (n(), a("div", {
562
- key: 1,
563
- class: "x-image-text__content",
564
- innerHTML: e.data.content
565
- }, null, 8, We)) : u("v-if", !0),
566
- e.data.items?.length ? (n(), a("ul", Ke, [
567
- (n(!0), a(
568
- v,
569
- null,
570
- y(e.data.items, (s, l) => (n(), a("li", { key: l }, [
571
- d(
572
- "span",
573
- Ye,
574
- _(s.icon || "✓"),
575
- 1
576
- /* TEXT */
577
- ),
578
- L(
579
- " " + _(s.text),
580
- 1
581
- /* TEXT */
582
- )
583
- ]))),
584
- 128
585
- /* KEYED_FRAGMENT */
586
- ))
587
- ])) : u("v-if", !0)
588
- ]),
589
- e.data.image ? (n(), a("div", Ze, [
590
- d("img", {
591
- src: e.data.image,
592
- alt: e.data.title || "",
593
- class: "x-image-text__image"
594
- }, null, 8, Qe)
595
- ])) : u("v-if", !0)
596
- ])
597
- ],
598
- 2
599
- /* CLASS */
600
- );
52
+ const e = window.__SITE_DATA__?.skin;
53
+ e && (e.colors || e.typography || e.shape) && o({
54
+ colors: e.colors || {},
55
+ typography: e.typography || {},
56
+ shape: e.shape || {}
57
+ });
58
+ });
601
59
  }
602
- const tt = /* @__PURE__ */ k(ze, [["render", et], ["__scopeId", "data-v-5ca1e218"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XImageTextBlock.vue"]]);
603
- function D(r, o) {
604
- const e = j(null), { locale: t } = E(), c = window.__SITE_DATA__, i = c?.locale;
605
- function s() {
606
- return c && c[r] && t.value === i ? (e.value = c[r], !0) : !1;
607
- }
608
- async function l() {
609
- try {
610
- const p = await fetch(`/api/content/${o}:${t.value}`);
611
- p.ok && (e.value = await p.json());
612
- } catch {
613
- }
614
- }
615
- return O(() => {
616
- s() || l();
617
- }), P(t, () => {
618
- l();
619
- }), e;
60
+ function x(n) {
61
+ return n.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
620
62
  }
621
- function st() {
63
+ function F() {
622
64
  const o = window.__SITE_DATA__?.apiBase || "";
623
- async function e(i) {
624
- const s = await fetch(`${o}${i}`);
625
- if (!s.ok)
626
- throw new Error(`API error: ${s.status}`);
627
- return s.json();
65
+ async function t(s) {
66
+ const c = await fetch(`${o}${s}`);
67
+ if (!c.ok)
68
+ throw new Error(`API error: ${c.status}`);
69
+ return c.json();
628
70
  }
629
- async function t() {
630
- return e("/v1/billing/tariffs");
71
+ async function e() {
72
+ return t("/v1/billing/tariffs");
631
73
  }
632
- async function c() {
633
- return e("/v1/billing/services");
74
+ async function a() {
75
+ return t("/v1/billing/services");
634
76
  }
635
77
  return {
636
- get: e,
637
- getTariffs: t,
638
- getProducts: c
78
+ get: t,
79
+ getTariffs: e,
80
+ getProducts: a
639
81
  };
640
82
  }
641
- const ot = /* @__PURE__ */ g({
642
- __name: "XPricingBlock",
643
- props: {
644
- data: { type: Object, required: !1 },
645
- source: { type: String, required: !1, default: "kv" },
646
- featuredIndex: { type: Number, required: !1, default: 1 }
647
- },
648
- setup(r, { expose: o }) {
649
- o();
650
- const e = r, t = f(() => e.data?.title), c = f(() => e.data?.subtitle), i = j([]), s = j(""), l = D("tariffs", "tariffs"), p = st();
651
- O(async () => {
652
- if (e.source === "api")
653
- try {
654
- i.value = await p.getTariffs();
655
- } catch {
656
- }
657
- }), P(
658
- l,
659
- (m) => {
660
- m && e.source === "kv" && (i.value = m);
661
- },
662
- { immediate: !0 }
663
- );
664
- const h = f(() => {
665
- const m = new Set(i.value.map((T) => T.tariffGroupName).filter(Boolean));
666
- return Array.from(m);
667
- });
668
- P(
669
- h,
670
- (m) => {
671
- m.length > 0 && !s.value && (s.value = m[0]);
672
- },
673
- { immediate: !0 }
674
- );
675
- const $ = f(() => !s.value || h.value.length <= 1 ? i.value : i.value.filter((m) => m.tariffGroupName === s.value)), x = { props: e, title: t, subtitle: c, plans: i, activeGroup: s, kvTariffs: l, api: p, groups: h, activePlans: $ };
676
- return Object.defineProperty(x, "__isScriptSetup", { enumerable: !1, value: !0 }), x;
677
- }
678
- }), nt = { class: "x-pricing" }, at = { class: "x-pricing__container" }, rt = {
679
- key: 0,
680
- class: "x-pricing__title"
681
- }, ct = {
682
- key: 1,
683
- class: "x-pricing__subtitle"
684
- }, it = {
685
- key: 2,
686
- class: "x-pricing__tabs"
687
- }, lt = ["onClick"], _t = { class: "x-pricing__grid" }, ut = { class: "x-pricing-card__name" }, dt = {
688
- key: 0,
689
- class: "x-pricing-card__desc"
690
- }, pt = { class: "x-pricing-card__price" }, ft = { class: "x-pricing-card__amount" }, mt = {
691
- key: 0,
692
- class: "x-pricing-card__period"
693
- }, vt = {
694
- key: 1,
695
- class: "x-pricing-card__features"
696
- }, ht = ["href"];
697
- function xt(r, o, e, t, c, i) {
698
- return n(), a("section", nt, [
699
- d("div", at, [
700
- t.title ? (n(), a(
701
- "h2",
702
- rt,
703
- _(t.title),
704
- 1
705
- /* TEXT */
706
- )) : u("v-if", !0),
707
- t.subtitle ? (n(), a(
708
- "p",
709
- ct,
710
- _(t.subtitle),
711
- 1
712
- /* TEXT */
713
- )) : u("v-if", !0),
714
- u(" Tabs for tariff groups "),
715
- t.groups.length > 1 ? (n(), a("div", it, [
716
- (n(!0), a(
717
- v,
718
- null,
719
- y(t.groups, (s) => (n(), a("button", {
720
- key: s,
721
- class: S(["x-pricing__tab", { "x-pricing__tab--active": t.activeGroup === s }]),
722
- onClick: (l) => t.activeGroup = s
723
- }, _(s), 11, lt))),
724
- 128
725
- /* KEYED_FRAGMENT */
726
- ))
727
- ])) : u("v-if", !0),
728
- d("div", _t, [
729
- (n(!0), a(
730
- v,
731
- null,
732
- y(t.activePlans, (s, l) => (n(), a(
733
- "div",
734
- {
735
- key: s.id || l,
736
- class: S(["x-pricing-card", { "x-pricing-card--featured": l === e.featuredIndex }])
737
- },
738
- [
739
- d(
740
- "h3",
741
- ut,
742
- _(s.name),
743
- 1
744
- /* TEXT */
745
- ),
746
- s.description ? (n(), a(
747
- "p",
748
- dt,
749
- _(s.description),
750
- 1
751
- /* TEXT */
752
- )) : u("v-if", !0),
753
- d("div", pt, [
754
- d(
755
- "span",
756
- ft,
757
- _(s.price),
758
- 1
759
- /* TEXT */
760
- ),
761
- s.period ? (n(), a(
762
- "span",
763
- mt,
764
- "/" + _(s.period),
765
- 1
766
- /* TEXT */
767
- )) : u("v-if", !0)
768
- ]),
769
- s.features?.length ? (n(), a("ul", vt, [
770
- (n(!0), a(
771
- v,
772
- null,
773
- y(s.features, (p, h) => (n(), a(
774
- "li",
775
- { key: h },
776
- _(p),
777
- 1
778
- /* TEXT */
779
- ))),
780
- 128
781
- /* KEYED_FRAGMENT */
782
- ))
783
- ])) : u("v-if", !0),
784
- s.actionUrl ? (n(), a("a", {
785
- key: 2,
786
- href: s.actionUrl,
787
- class: "x-btn x-btn--primary x-pricing-card__action"
788
- }, _(s.actionText || "Choose"), 9, ht)) : u("v-if", !0)
789
- ],
790
- 2
791
- /* CLASS */
792
- ))),
793
- 128
794
- /* KEYED_FRAGMENT */
795
- ))
796
- ])
797
- ])
798
- ]);
799
- }
800
- const yt = /* @__PURE__ */ k(ot, [["render", xt], ["__scopeId", "data-v-bd1e5d79"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XPricingBlock.vue"]]), gt = /* @__PURE__ */ g({
801
- __name: "XContactsBlock",
802
- props: {
803
- data: { type: Object, required: !1 }
804
- },
805
- setup(r, { expose: o }) {
806
- o();
807
- const e = D("contacts:offices", "contacts:offices"), t = f(() => e.value || []), c = { kvOffices: e, offices: t };
808
- return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
809
- }
810
- }), kt = { class: "x-contacts" }, bt = { class: "x-contacts__container" }, $t = {
811
- key: 0,
812
- class: "x-contacts__title"
813
- }, St = {
814
- key: 1,
815
- class: "x-contacts__grid"
816
- }, wt = { class: "x-contacts__name" }, Tt = {
817
- key: 0,
818
- class: "x-contacts__info"
819
- }, jt = {
820
- key: 1,
821
- class: "x-contacts__info"
822
- }, Ct = ["href"], Ot = {
823
- key: 2,
824
- class: "x-contacts__info"
825
- }, Xt = ["href"], Bt = {
826
- key: 3,
827
- class: "x-contacts__hours"
828
- };
829
- function It(r, o, e, t, c, i) {
830
- return n(), a("section", kt, [
831
- d("div", bt, [
832
- e.data?.title ? (n(), a(
833
- "h2",
834
- $t,
835
- _(e.data.title),
836
- 1
837
- /* TEXT */
838
- )) : u("v-if", !0),
839
- t.offices ? (n(), a("div", St, [
840
- (n(!0), a(
841
- v,
842
- null,
843
- y(t.offices, (s, l) => (n(), a(
844
- "div",
845
- {
846
- key: l,
847
- class: S(["x-contacts__card", { "x-contacts__card--main": s.isMain }])
848
- },
849
- [
850
- d(
851
- "h3",
852
- wt,
853
- _(s.name),
854
- 1
855
- /* TEXT */
856
- ),
857
- s.address ? (n(), a(
858
- "p",
859
- Tt,
860
- _(s.address),
861
- 1
862
- /* TEXT */
863
- )) : u("v-if", !0),
864
- s.phone ? (n(), a("p", jt, [
865
- d("a", {
866
- href: `tel:${s.phone}`
867
- }, _(s.phone), 9, Ct)
868
- ])) : u("v-if", !0),
869
- s.email ? (n(), a("p", Ot, [
870
- d("a", {
871
- href: `mailto:${s.email}`
872
- }, _(s.email), 9, Xt)
873
- ])) : u("v-if", !0),
874
- s.hours ? (n(), a(
875
- "p",
876
- Bt,
877
- _(s.hours),
878
- 1
879
- /* TEXT */
880
- )) : u("v-if", !0)
881
- ],
882
- 2
883
- /* CLASS */
884
- ))),
885
- 128
886
- /* KEYED_FRAGMENT */
887
- ))
888
- ])) : u("v-if", !0)
889
- ])
890
- ]);
891
- }
892
- const Nt = /* @__PURE__ */ k(gt, [["render", It], ["__scopeId", "data-v-e873ba26"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XContactsBlock.vue"]]), Pt = /* @__PURE__ */ g({
893
- __name: "XGalleryBlock",
894
- props: {
895
- data: { type: Object, required: !0 }
896
- },
897
- setup(r, { expose: o }) {
898
- o();
899
- const e = {};
900
- return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
901
- }
902
- }), Lt = { class: "x-gallery-block" }, Et = {
903
- key: 0,
904
- class: "x-gallery-block__title"
905
- }, At = { class: "x-gallery-block__grid" }, Ut = ["src", "alt"], Rt = { key: 0 };
906
- function Ft(r, o, e, t, c, i) {
907
- return n(), a("section", Lt, [
908
- e.data.title ? (n(), a(
909
- "h2",
910
- Et,
911
- _(e.data.title),
912
- 1
913
- /* TEXT */
914
- )) : u("v-if", !0),
915
- d("div", At, [
916
- (n(!0), a(
917
- v,
918
- null,
919
- y(e.data.images, (s, l) => (n(), a("figure", {
920
- key: l,
921
- class: "x-gallery-block__item"
922
- }, [
923
- d("img", {
924
- src: s.src,
925
- alt: s.alt || "",
926
- loading: "lazy"
927
- }, null, 8, Ut),
928
- s.caption ? (n(), a(
929
- "figcaption",
930
- Rt,
931
- _(s.caption),
932
- 1
933
- /* TEXT */
934
- )) : u("v-if", !0)
935
- ]))),
936
- 128
937
- /* KEYED_FRAGMENT */
938
- ))
939
- ])
940
- ]);
941
- }
942
- const Mt = /* @__PURE__ */ k(Pt, [["render", Ft], ["__scopeId", "data-v-b99bb987"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XGalleryBlock.vue"]]), qt = /* @__PURE__ */ g({
943
- __name: "XMapBlock",
944
- props: {
945
- data: { type: Object, required: !0 }
946
- },
947
- setup(r, { expose: o }) {
948
- o();
949
- const e = r, t = f(() => {
950
- const { lat: i, lng: s } = e.data.center || { lat: 0, lng: 0 };
951
- return e.data.zoom, `https://www.openstreetmap.org/export/embed.html?bbox=${s - 0.01},${i - 0.01},${s + 0.01},${i + 0.01}&layer=mapnik&marker=${i},${s}`;
952
- }), c = { props: e, mapUrl: t };
953
- return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
954
- }
955
- }), Dt = { class: "x-map-block" }, Ht = {
956
- key: 0,
957
- class: "x-map-block__title"
958
- }, zt = { class: "x-map-block__container" }, Gt = ["src"];
959
- function Jt(r, o, e, t, c, i) {
960
- return n(), a("section", Dt, [
961
- e.data.title ? (n(), a(
962
- "h2",
963
- Ht,
964
- _(e.data.title),
965
- 1
966
- /* TEXT */
967
- )) : u("v-if", !0),
968
- d("div", zt, [
969
- d("iframe", {
970
- src: t.mapUrl,
971
- width: "100%",
972
- height: "400",
973
- style: { border: "0" },
974
- allowfullscreen: "",
975
- loading: "lazy",
976
- referrerpolicy: "no-referrer-when-downgrade"
977
- }, null, 8, Gt)
978
- ])
979
- ]);
980
- }
981
- const Vt = /* @__PURE__ */ k(qt, [["render", Jt], ["__scopeId", "data-v-583f4762"], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XMapBlock.vue"]]), Wt = /* @__PURE__ */ g({
982
- __name: "XBlockRenderer",
983
- props: {
984
- blocks: { type: Array, required: !0 }
985
- },
986
- setup(r, { expose: o }) {
987
- o();
988
- const e = r, t = {
989
- hero: Xe,
990
- html: Le,
991
- cards: He,
992
- "image-text": tt,
993
- pricing: yt,
994
- contacts: Nt,
995
- gallery: Mt,
996
- map: Vt
997
- };
998
- function c(l) {
999
- return t[l];
1000
- }
1001
- const i = f(() => e.blocks.filter((l) => l.settings?.visible !== !1)), s = { props: e, blockRegistry: t, getBlockComponent: c, visibleBlocks: i };
1002
- return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
1003
- }
1004
- }), Kt = { class: "x-block-renderer" };
1005
- function Yt(r, o, e, t, c, i) {
1006
- return n(), a("div", Kt, [
1007
- (n(!0), a(
1008
- v,
1009
- null,
1010
- y(t.visibleBlocks, (s, l) => (n(), a(
1011
- v,
1012
- { key: l },
1013
- [
1014
- t.getBlockComponent(s.type) ? (n(), C(M(t.getBlockComponent(s.type)), J({
1015
- key: 0,
1016
- data: s.data || s.props
1017
- }, { ref_for: !0 }, s.settings, {
1018
- class: s.settings?.className
1019
- }), null, 16, ["data", "class"])) : u("v-if", !0)
1020
- ],
1021
- 64
1022
- /* STABLE_FRAGMENT */
1023
- ))),
1024
- 128
1025
- /* KEYED_FRAGMENT */
1026
- ))
1027
- ]);
1028
- }
1029
- const ns = /* @__PURE__ */ k(Wt, [["render", Yt], ["__file", "/Users/yariksav/projects/xosen/xosen-monorepo/packages/site-sdk/src/components/blocks/XBlockRenderer.vue"]]);
1030
- function H() {
83
+ function S() {
1031
84
  try {
1032
85
  return window.self !== window.top;
1033
86
  } catch {
1034
87
  return !0;
1035
88
  }
1036
89
  }
1037
- function as(r) {
1038
- H() && r.beforeEach((o, e) => !e.name);
90
+ function D(n) {
91
+ S() && n.beforeEach((o, t) => !t.name);
1039
92
  }
1040
- function rs() {
1041
- const r = j(null), o = j(H());
1042
- function e(t) {
1043
- const c = t.data;
1044
- c?.type === "xosen-preview-update" && c.page && (r.value = c.page, o.value = !0);
93
+ function U() {
94
+ const n = y(null), o = y(S());
95
+ function t(e) {
96
+ const a = e.data;
97
+ a?.type === "xosen-preview-update" && a.page && (n.value = a.page, o.value = !0);
1045
98
  }
1046
- return O(() => {
1047
- window.addEventListener("message", e);
1048
- }), U(() => {
1049
- window.removeEventListener("message", e);
99
+ return T(() => {
100
+ window.addEventListener("message", t);
101
+ }), b(() => {
102
+ window.removeEventListener("message", t);
1050
103
  }), {
1051
- previewPage: r,
104
+ previewPage: n,
1052
105
  isPreviewMode: o
1053
106
  };
1054
107
  }
1055
- const Zt = /\.(js|css|png|jpg|jpeg|gif|svg|ico|woff2?|ttf|eot|webp|avif|map|json|txt|xml|webmanifest)$/;
1056
- function Qt(r, o) {
1057
- const t = new URL(r.url).searchParams.get("lang");
1058
- if (t && o.supportedLocales?.includes(t)) return t;
108
+ const A = /\.(js|css|png|jpg|jpeg|gif|svg|ico|woff2?|ttf|eot|webp|avif|map|json|txt|xml|webmanifest)$/;
109
+ function N(n, o) {
110
+ const e = new URL(n.url).searchParams.get("lang");
111
+ if (e && o.supportedLocales?.includes(e)) return e;
1059
112
  if (o.supportedLocales?.length) {
1060
- const c = r.headers.get("Accept-Language") || "";
1061
- for (const i of o.supportedLocales)
1062
- if (c.includes(i)) return i;
113
+ const a = n.headers.get("Accept-Language") || "";
114
+ for (const s of o.supportedLocales)
115
+ if (a.includes(s)) return s;
1063
116
  }
1064
117
  return o.defaultLocale;
1065
118
  }
1066
- function es(r, o, e) {
1067
- if (!r.pathname.startsWith("/api/content/")) return null;
1068
- const t = decodeURIComponent(r.pathname.replace("/api/content/", ""));
1069
- return t ? (async () => {
1070
- let c = await o.SITE_CONTENT.get(t);
1071
- if (!c) {
1072
- const i = t.lastIndexOf(":");
1073
- i > 0 && t.slice(i + 1) !== e && (c = await o.SITE_CONTENT.get(t.slice(0, i + 1) + e));
119
+ function I(n, o, t) {
120
+ if (!n.pathname.startsWith("/api/content/")) return null;
121
+ const e = decodeURIComponent(n.pathname.replace("/api/content/", ""));
122
+ return e ? (async () => {
123
+ let a = await o.SITE_CONTENT.get(e);
124
+ if (!a) {
125
+ const s = e.lastIndexOf(":");
126
+ s > 0 && e.slice(s + 1) !== t && (a = await o.SITE_CONTENT.get(e.slice(0, s + 1) + t));
1074
127
  }
1075
- return c ? new Response(c, {
128
+ return a ? new Response(a, {
1076
129
  headers: {
1077
130
  "Content-Type": "application/json",
1078
131
  "Cache-Control": "public, max-age=60",
@@ -1081,54 +134,54 @@ function es(r, o, e) {
1081
134
  }) : Response.json({ error: "Not found" }, { status: 404 });
1082
135
  })() : Promise.resolve(Response.json({ error: "Key is required" }, { status: 400 }));
1083
136
  }
1084
- function A(r, o, e) {
1085
- let t = r;
137
+ function _(n, o, t) {
138
+ let e = n;
1086
139
  if (o.title) {
1087
- const c = e ? ` — ${e}` : "";
1088
- t = t.replace(/<title>[^<]*<\/title>/, `<title>${o.title}${c}</title>`);
140
+ const a = t ? ` — ${t}` : "";
141
+ e = e.replace(/<title>[^<]*<\/title>/, `<title>${o.title}${a}</title>`);
1089
142
  }
1090
- return o.meta?.description && (t = t.replace(/(<meta\s+name="description"\s+content=")[^"]*(")/, `$1${o.meta.description}$2`)), o.meta?.ogTitle && (t = t.replace(/(<meta\s+property="og:title"\s+content=")[^"]*(")/, `$1${o.meta.ogTitle}$2`)), o.html && (t = t.replace('<div id="app"></div>', `<div id="app">${o.html}</div>`)), t;
143
+ return o.meta?.description && (e = e.replace(/(<meta\s+name="description"\s+content=")[^"]*(")/, `$1${o.meta.description}$2`)), o.meta?.ogTitle && (e = e.replace(/(<meta\s+property="og:title"\s+content=")[^"]*(")/, `$1${o.meta.ogTitle}$2`)), o.html && (e = e.replace('<div id="app"></div>', `<div id="app">${o.html}</div>`)), e;
1091
144
  }
1092
- function cs(r) {
145
+ function J(n) {
1093
146
  return {
1094
- async fetch(o, e) {
1095
- const t = new URL(o.url), c = es(t, e, r.defaultLocale);
1096
- if (c) return c;
1097
- if (Zt.test(t.pathname))
1098
- return e.ASSETS.fetch(o);
1099
- const i = Qt(o, r), s = new URL("/index.html", o.url);
1100
- let p = await (await e.ASSETS.fetch(new Request(s))).text();
1101
- const h = r.defaultLocale, [$, x] = await Promise.all([
1102
- e.SITE_CONTENT.get("config"),
1103
- e.SITE_CONTENT.get(`content:${i}`)
1104
- ]), m = $ ? JSON.parse($) : {};
1105
- let T = x ? JSON.parse(x) : {};
1106
- if (!x && i !== h) {
1107
- const b = await e.SITE_CONTENT.get(`content:${h}`);
1108
- b && (T = JSON.parse(b));
147
+ async fetch(o, t) {
148
+ const e = new URL(o.url), a = I(e, t, n.defaultLocale);
149
+ if (a) return a;
150
+ if (A.test(e.pathname))
151
+ return t.ASSETS.fetch(o);
152
+ const s = N(o, n), c = new URL("/index.html", o.url);
153
+ let r = await (await t.ASSETS.fetch(new Request(c))).text();
154
+ const f = n.defaultLocale, [g, p] = await Promise.all([
155
+ t.SITE_CONTENT.get("config"),
156
+ t.SITE_CONTENT.get(`content:${s}`)
157
+ ]), v = g ? JSON.parse(g) : {};
158
+ let d = p ? JSON.parse(p) : {};
159
+ if (!p && s !== f) {
160
+ const i = await t.SITE_CONTENT.get(`content:${f}`);
161
+ i && (d = JSON.parse(i));
1109
162
  }
1110
- const X = t.pathname.match(/^\/p\/(.+)$/);
1111
- if (X) {
1112
- const b = X[1];
1113
- if (!T[b]) {
1114
- let w = await e.SITE_CONTENT.get(`page:${b}:${i}`);
1115
- !w && i !== h && (w = await e.SITE_CONTENT.get(`page:${b}:${h}`)), w && (T[b] = JSON.parse(w));
163
+ const m = e.pathname.match(/^\/p\/(.+)$/);
164
+ if (m) {
165
+ const i = m[1];
166
+ if (!d[i]) {
167
+ let l = await t.SITE_CONTENT.get(`page:${i}:${s}`);
168
+ !l && s !== f && (l = await t.SITE_CONTENT.get(`page:${i}:${f}`)), l && (d[i] = JSON.parse(l));
1116
169
  }
1117
170
  }
1118
- const I = {
1119
- locale: i,
1120
- config: m
171
+ const w = {
172
+ locale: s,
173
+ config: v
1121
174
  };
1122
- for (const [b, w] of Object.entries(T))
1123
- I[`page:${b}`] = w;
1124
- if (X) {
1125
- const b = X[1], w = I[`page:${b}`];
1126
- w && (p = A(p, w, r.siteName));
175
+ for (const [i, l] of Object.entries(d))
176
+ w[`page:${i}`] = l;
177
+ if (m) {
178
+ const i = m[1], l = w[`page:${i}`];
179
+ l && (r = _(r, l, n.siteName));
1127
180
  }
1128
- t.pathname === "/" && T.home && (p = A(p, T.home, r.siteName));
1129
- const z = `<script>window.__SITE_DATA__ = ${JSON.stringify(I)};<\/script>`;
1130
- return p = p.replace("</head>", `${z}
1131
- </head>`), new Response(p, {
181
+ e.pathname === "/" && d.home && (r = _(r, d.home, n.siteName));
182
+ const E = `<script>window.__SITE_DATA__ = ${JSON.stringify(w)};<\/script>`;
183
+ return r = r.replace("</head>", `${E}
184
+ </head>`), new Response(r, {
1132
185
  headers: {
1133
186
  "Content-Type": "text/html;charset=utf-8",
1134
187
  "Cache-Control": "public, max-age=60"
@@ -1137,26 +190,15 @@ function cs(r) {
1137
190
  }
1138
191
  };
1139
192
  }
193
+ const M = /* @__PURE__ */ Symbol("pageContext");
1140
194
  export {
1141
- ns as XBlockRenderer,
1142
- He as XCardsBlock,
1143
- Nt as XContactsBlock,
1144
- Mt as XGalleryBlock,
1145
- Xe as XHeroBlock,
1146
- Le as XHtmlBlock,
1147
- tt as XImageTextBlock,
1148
- ee as XLocaleSwitcher,
1149
- Vt as XMapBlock,
1150
- yt as XPricingBlock,
1151
- fe as XSiteFooter,
1152
- os as XSiteLayout,
1153
- ce as XSiteNav,
1154
- cs as createSiteWorker,
1155
- H as isInPreview,
1156
- as as setupPreviewRouter,
1157
- rs as useLivePreview,
1158
- st as useSiteApi,
1159
- q as useSiteConfig,
1160
- D as useSiteData,
1161
- V as useSkin
195
+ M as PAGE_CONTEXT_KEY,
196
+ J as createSiteWorker,
197
+ S as isInPreview,
198
+ D as setupPreviewRouter,
199
+ U as useLivePreview,
200
+ F as useSiteApi,
201
+ O as useSiteConfig,
202
+ R as useSiteData,
203
+ j as useSkin
1162
204
  };