@olonjs/react 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import Ie, { Component as je, useContext as re, createContext as ne, useMemo as X, useState as J, useEffect as z, forwardRef as Se, createElement as le, useRef as fe, useLayoutEffect as Oe } from "react";
2
- import { Link as De, createRoutesFromElements as Me, createBrowserRouter as Le, RouterProvider as Fe, ScrollRestoration as ze, Outlet as $e, useLocation as He, Route as L } from "react-router-dom";
3
- import { buildThemeVariableMap as Ye, resolveRuntimeConfig as Ce, normalizeBasePath as Ue, ensureWebMcpRuntime as Je, cn as ce, shouldRenderSiteGlobalHeader as We, resolveSectionMenuItems as Z, STUDIO_EVENTS as M, resolveHeaderMenuItems as Be, buildSelectionPath as he, resolveSlugFromPathname as qe, resolvePageMatchFromRegistry as Ve, resolveCollectionContext as Ge, syncHeadLink as ge, buildPageManifestHref as Xe, buildPageContractHref as Qe, syncWebMcpJsonLd as Ze } from "@olonjs/core";
4
- import { buildThemeVariableMap as Lt } from "@olonjs/core";
5
- var K = { exports: {} }, V = {};
1
+ import Ie, { Component as Ce, useContext as ne, createContext as oe, useMemo as K, useState as J, useEffect as $, forwardRef as je, createElement as ce, useRef as he, useLayoutEffect as De } from "react";
2
+ import { Link as Le, createRoutesFromElements as Me, createBrowserRouter as Fe, RouterProvider as $e, ScrollRestoration as Ue, Outlet as ze, useLocation as He, Route as M } from "react-router-dom";
3
+ import { buildThemeVariableMap as Ye, resolveRuntimeConfig as we, normalizeBasePath as Je, ensureWebMcpRuntime as Be, cn as de, shouldRenderSiteGlobalHeader as Ve, resolveSectionMenuItems as Q, STUDIO_EVENTS as L, resolveHeaderMenuItems as We, buildSelectionPath as ge, resolveSlugFromPathname as qe, resolvePageMatchFromRegistry as Ge, resolveCollectionContext as Ke, syncHeadLink as ve, buildPageManifestHref as Xe, buildPageContractHref as Qe, syncWebMcpJsonLd as Ze } from "@olonjs/core";
4
+ import { buildThemeVariableMap as Jt } from "@olonjs/core";
5
+ var Z = { exports: {} }, q = {};
6
6
  /**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
@@ -12,27 +12,27 @@ var K = { exports: {} }, V = {};
12
12
  * This source code is licensed under the MIT license found in the
13
13
  * LICENSE file in the root directory of this source tree.
14
14
  */
15
- var ve;
16
- function Ke() {
17
- if (ve) return V;
18
- ve = 1;
15
+ var be;
16
+ function et() {
17
+ if (be) return q;
18
+ be = 1;
19
19
  var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
20
- function s(a, o, d) {
21
- var m = null;
22
- if (d !== void 0 && (m = "" + d), o.key !== void 0 && (m = "" + o.key), "key" in o) {
23
- d = {};
24
- for (var y in o)
25
- y !== "key" && (d[y] = o[y]);
26
- } else d = o;
27
- return o = d.ref, {
20
+ function o(a, s, i) {
21
+ var l = null;
22
+ if (i !== void 0 && (l = "" + i), s.key !== void 0 && (l = "" + s.key), "key" in s) {
23
+ i = {};
24
+ for (var v in s)
25
+ v !== "key" && (i[v] = s[v]);
26
+ } else i = s;
27
+ return s = i.ref, {
28
28
  $$typeof: e,
29
29
  type: a,
30
- key: m,
31
- ref: o !== void 0 ? o : null,
32
- props: d
30
+ key: l,
31
+ ref: s !== void 0 ? s : null,
32
+ props: i
33
33
  };
34
34
  }
35
- return V.Fragment = n, V.jsx = s, V.jsxs = s, V;
35
+ return q.Fragment = n, q.jsx = o, q.jsxs = o, q;
36
36
  }
37
37
  var G = {};
38
38
  /**
@@ -44,9 +44,9 @@ var G = {};
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
46
  */
47
- var be;
48
- function et() {
49
- return be || (be = 1, process.env.NODE_ENV !== "production" && (function() {
47
+ var ye;
48
+ function tt() {
49
+ return ye || (ye = 1, process.env.NODE_ENV !== "production" && (function() {
50
50
  function e(t) {
51
51
  if (t == null) return null;
52
52
  if (typeof t == "function")
@@ -57,34 +57,34 @@ function et() {
57
57
  return "Fragment";
58
58
  case A:
59
59
  return "Profiler";
60
- case j:
60
+ case C:
61
61
  return "StrictMode";
62
62
  case w:
63
63
  return "Suspense";
64
64
  case k:
65
65
  return "SuspenseList";
66
- case O:
66
+ case I:
67
67
  return "Activity";
68
68
  }
69
69
  if (typeof t == "object")
70
70
  switch (typeof t.tag == "number" && console.error(
71
71
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
72
  ), t.$$typeof) {
73
- case E:
73
+ case S:
74
74
  return "Portal";
75
75
  case g:
76
76
  return t.displayName || "Context";
77
- case v:
77
+ case b:
78
78
  return (t._context.displayName || "Context") + ".Consumer";
79
- case u:
80
- var c = t.render;
81
- return t = t.displayName, t || (t = c.displayName || c.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
79
+ case m:
80
+ var u = t.render;
81
+ return t = t.displayName, t || (t = u.displayName || u.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
82
82
  case T:
83
- return c = t.displayName || null, c !== null ? c : e(t.type) || "Memo";
83
+ return u = t.displayName || null, u !== null ? u : e(t.type) || "Memo";
84
84
  case P:
85
- c = t._payload, t = t._init;
85
+ u = t._payload, t = t._init;
86
86
  try {
87
- return e(t(c));
87
+ return e(t(u));
88
88
  } catch {
89
89
  }
90
90
  }
@@ -93,20 +93,20 @@ function et() {
93
93
  function n(t) {
94
94
  return "" + t;
95
95
  }
96
- function s(t) {
96
+ function o(t) {
97
97
  try {
98
98
  n(t);
99
- var c = !1;
99
+ var u = !1;
100
100
  } catch {
101
- c = !0;
101
+ u = !0;
102
102
  }
103
- if (c) {
104
- c = console;
105
- var S = c.error, R = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
106
- return S.call(
107
- c,
103
+ if (u) {
104
+ u = console;
105
+ var j = u.error, _ = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
106
+ return j.call(
107
+ u,
108
108
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
- R
109
+ _
110
110
  ), n(t);
111
111
  }
112
112
  }
@@ -115,55 +115,55 @@ function et() {
115
115
  if (typeof t == "object" && t !== null && t.$$typeof === P)
116
116
  return "<...>";
117
117
  try {
118
- var c = e(t);
119
- return c ? "<" + c + ">" : "<...>";
118
+ var u = e(t);
119
+ return u ? "<" + u + ">" : "<...>";
120
120
  } catch {
121
121
  return "<...>";
122
122
  }
123
123
  }
124
- function o() {
125
- var t = $.A;
124
+ function s() {
125
+ var t = U.A;
126
126
  return t === null ? null : t.getOwner();
127
127
  }
128
- function d() {
128
+ function i() {
129
129
  return Error("react-stack-top-frame");
130
130
  }
131
- function m(t) {
132
- if (U.call(t, "key")) {
133
- var c = Object.getOwnPropertyDescriptor(t, "key").get;
134
- if (c && c.isReactWarning) return !1;
131
+ function l(t) {
132
+ if (Y.call(t, "key")) {
133
+ var u = Object.getOwnPropertyDescriptor(t, "key").get;
134
+ if (u && u.isReactWarning) return !1;
135
135
  }
136
136
  return t.key !== void 0;
137
137
  }
138
- function y(t, c) {
139
- function S() {
138
+ function v(t, u) {
139
+ function j() {
140
140
  F || (F = !0, console.error(
141
141
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
142
- c
142
+ u
143
143
  ));
144
144
  }
145
- S.isReactWarning = !0, Object.defineProperty(t, "key", {
146
- get: S,
145
+ j.isReactWarning = !0, Object.defineProperty(t, "key", {
146
+ get: j,
147
147
  configurable: !0
148
148
  });
149
149
  }
150
- function C() {
150
+ function x() {
151
151
  var t = e(this.type);
152
- return I[t] || (I[t] = !0, console.error(
152
+ return O[t] || (O[t] = !0, console.error(
153
153
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
154
154
  )), t = this.props.ref, t !== void 0 ? t : null;
155
155
  }
156
- function b(t, c, S, R, Q, oe) {
157
- var _ = S.ref;
156
+ function y(t, u, j, _, X, se) {
157
+ var R = j.ref;
158
158
  return t = {
159
- $$typeof: l,
159
+ $$typeof: d,
160
160
  type: t,
161
- key: c,
162
- props: S,
163
- _owner: R
164
- }, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(t, "ref", {
161
+ key: u,
162
+ props: j,
163
+ _owner: _
164
+ }, (R !== void 0 ? R : null) !== null ? Object.defineProperty(t, "ref", {
165
165
  enumerable: !1,
166
- get: C
166
+ get: x
167
167
  }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
168
168
  configurable: !1,
169
169
  enumerable: !1,
@@ -178,117 +178,117 @@ function et() {
178
178
  configurable: !1,
179
179
  enumerable: !1,
180
180
  writable: !0,
181
- value: Q
181
+ value: X
182
182
  }), Object.defineProperty(t, "_debugTask", {
183
183
  configurable: !1,
184
184
  enumerable: !1,
185
185
  writable: !0,
186
- value: oe
186
+ value: se
187
187
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
188
188
  }
189
- function f(t, c, S, R, Q, oe) {
190
- var _ = c.children;
191
- if (_ !== void 0)
192
- if (R)
193
- if (W(_)) {
194
- for (R = 0; R < _.length; R++)
195
- x(_[R]);
196
- Object.freeze && Object.freeze(_);
189
+ function p(t, u, j, _, X, se) {
190
+ var R = u.children;
191
+ if (R !== void 0)
192
+ if (_)
193
+ if (B(R)) {
194
+ for (_ = 0; _ < R.length; _++)
195
+ E(R[_]);
196
+ Object.freeze && Object.freeze(R);
197
197
  } else
198
198
  console.error(
199
199
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
200
200
  );
201
- else x(_);
202
- if (U.call(c, "key")) {
203
- _ = e(t);
204
- var B = Object.keys(c).filter(function(Ae) {
205
- return Ae !== "key";
201
+ else E(R);
202
+ if (Y.call(u, "key")) {
203
+ R = e(t);
204
+ var V = Object.keys(u).filter(function(Oe) {
205
+ return Oe !== "key";
206
206
  });
207
- R = 0 < B.length ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}", q[_ + R] || (B = 0 < B.length ? "{" + B.join(": ..., ") + ": ...}" : "{}", console.error(
207
+ _ = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", W[R + _] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
208
208
  `A props object containing a "key" prop is being spread into JSX:
209
209
  let props = %s;
210
210
  <%s {...props} />
211
211
  React keys must be passed directly to JSX without using spread:
212
212
  let props = %s;
213
213
  <%s key={someKey} {...props} />`,
214
- R,
215
214
  _,
216
- B,
217
- _
218
- ), q[_ + R] = !0);
215
+ R,
216
+ V,
217
+ R
218
+ ), W[R + _] = !0);
219
219
  }
220
- if (_ = null, S !== void 0 && (s(S), _ = "" + S), m(c) && (s(c.key), _ = "" + c.key), "key" in c) {
221
- S = {};
222
- for (var se in c)
223
- se !== "key" && (S[se] = c[se]);
224
- } else S = c;
225
- return _ && y(
226
- S,
220
+ if (R = null, j !== void 0 && (o(j), R = "" + j), l(u) && (o(u.key), R = "" + u.key), "key" in u) {
221
+ j = {};
222
+ for (var ae in u)
223
+ ae !== "key" && (j[ae] = u[ae]);
224
+ } else j = u;
225
+ return R && v(
226
+ j,
227
227
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
228
- ), b(
228
+ ), y(
229
229
  t,
230
- _,
231
- S,
232
- o(),
233
- Q,
234
- oe
230
+ R,
231
+ j,
232
+ s(),
233
+ X,
234
+ se
235
235
  );
236
236
  }
237
- function x(t) {
238
- p(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === P && (t._payload.status === "fulfilled" ? p(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
237
+ function E(t) {
238
+ f(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === P && (t._payload.status === "fulfilled" ? f(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
239
239
  }
240
- function p(t) {
241
- return typeof t == "object" && t !== null && t.$$typeof === l;
240
+ function f(t) {
241
+ return typeof t == "object" && t !== null && t.$$typeof === d;
242
242
  }
243
- var i = Ie, l = Symbol.for("react.transitional.element"), E = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), A = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), g = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), k = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), D = Symbol.for("react.client.reference"), $ = i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, W = Array.isArray, H = console.createTask ? console.createTask : function() {
243
+ var c = Ie, d = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), A = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), g = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), k = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), I = Symbol.for("react.activity"), D = Symbol.for("react.client.reference"), U = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, B = Array.isArray, z = console.createTask ? console.createTask : function() {
244
244
  return null;
245
245
  };
246
- i = {
246
+ c = {
247
247
  react_stack_bottom_frame: function(t) {
248
248
  return t();
249
249
  }
250
250
  };
251
- var F, I = {}, N = i.react_stack_bottom_frame.bind(
252
- i,
253
- d
254
- )(), Y = H(a(d)), q = {};
255
- G.Fragment = h, G.jsx = function(t, c, S) {
256
- var R = 1e4 > $.recentlyCreatedOwnerStacks++;
257
- return f(
251
+ var F, O = {}, N = c.react_stack_bottom_frame.bind(
252
+ c,
253
+ i
254
+ )(), H = z(a(i)), W = {};
255
+ G.Fragment = h, G.jsx = function(t, u, j) {
256
+ var _ = 1e4 > U.recentlyCreatedOwnerStacks++;
257
+ return p(
258
258
  t,
259
- c,
260
- S,
259
+ u,
260
+ j,
261
261
  !1,
262
- R ? Error("react-stack-top-frame") : N,
263
- R ? H(a(t)) : Y
262
+ _ ? Error("react-stack-top-frame") : N,
263
+ _ ? z(a(t)) : H
264
264
  );
265
- }, G.jsxs = function(t, c, S) {
266
- var R = 1e4 > $.recentlyCreatedOwnerStacks++;
267
- return f(
265
+ }, G.jsxs = function(t, u, j) {
266
+ var _ = 1e4 > U.recentlyCreatedOwnerStacks++;
267
+ return p(
268
268
  t,
269
- c,
270
- S,
269
+ u,
270
+ j,
271
271
  !0,
272
- R ? Error("react-stack-top-frame") : N,
273
- R ? H(a(t)) : Y
272
+ _ ? Error("react-stack-top-frame") : N,
273
+ _ ? z(a(t)) : H
274
274
  );
275
275
  };
276
276
  })()), G;
277
277
  }
278
- var ye;
279
- function tt() {
280
- return ye || (ye = 1, process.env.NODE_ENV === "production" ? K.exports = Ke() : K.exports = et()), K.exports;
278
+ var Ee;
279
+ function rt() {
280
+ return Ee || (Ee = 1, process.env.NODE_ENV === "production" ? Z.exports = et() : Z.exports = tt()), Z.exports;
281
281
  }
282
- var r = tt();
283
- class rt extends je {
282
+ var r = rt();
283
+ class nt extends Ce {
284
284
  constructor(n) {
285
285
  super(n), this.state = { hasError: !1, error: null };
286
286
  }
287
287
  static getDerivedStateFromError(n) {
288
288
  return { hasError: !0, error: n };
289
289
  }
290
- componentDidCatch(n, s) {
291
- console.error("[JsonPages Engine]", n, s);
290
+ componentDidCatch(n, o) {
291
+ console.error("[JsonPages Engine]", n, o);
292
292
  }
293
293
  render() {
294
294
  return this.state.hasError && this.state.error ? /* @__PURE__ */ r.jsxs(
@@ -327,7 +327,7 @@ class rt extends je {
327
327
  ) : this.props.children;
328
328
  }
329
329
  }
330
- const nt = () => /* @__PURE__ */ r.jsxs(
330
+ const ot = () => /* @__PURE__ */ r.jsxs(
331
331
  "div",
332
332
  {
333
333
  style: {
@@ -342,7 +342,7 @@ const nt = () => /* @__PURE__ */ r.jsxs(
342
342
  /* @__PURE__ */ r.jsx("h1", { className: "text-6xl font-bold text-[var(--local-text)] mb-4", children: "404" }),
343
343
  /* @__PURE__ */ r.jsx("p", { className: "text-xl text-[var(--local-text-muted)] mb-8", children: "Page not found" }),
344
344
  /* @__PURE__ */ r.jsx(
345
- De,
345
+ Le,
346
346
  {
347
347
  to: "/",
348
348
  className: "inline-flex items-center gap-2 px-6 py-3 rounded-[var(--local-radius-md)] bg-[var(--local-primary)] text-[var(--local-bg)] font-semibold text-sm hover:opacity-90 transition-opacity",
@@ -351,8 +351,8 @@ const nt = () => /* @__PURE__ */ r.jsxs(
351
351
  )
352
352
  ]
353
353
  }
354
- ), we = ne(void 0), ot = ({ config: e, children: n }) => /* @__PURE__ */ r.jsx(
355
- we.Provider,
354
+ ), Te = oe(void 0), st = ({ config: e, children: n }) => /* @__PURE__ */ r.jsx(
355
+ Te.Provider,
356
356
  {
357
357
  value: {
358
358
  registry: e.registry,
@@ -365,129 +365,129 @@ const nt = () => /* @__PURE__ */ r.jsxs(
365
365
  children: n
366
366
  }
367
367
  );
368
- function st() {
369
- const e = re(we);
368
+ function at() {
369
+ const e = ne(Te);
370
370
  if (e === void 0)
371
371
  throw new Error("useConfig must be used within ConfigProvider");
372
372
  return e;
373
373
  }
374
- const ae = /* @__PURE__ */ new Set(), de = {
374
+ const ie = /* @__PURE__ */ new Set(), ue = {
375
375
  setTheme: (e) => {
376
- const n = document.documentElement, s = Ye(e);
377
- ae.forEach((a) => {
376
+ const n = document.documentElement, o = Ye(e);
377
+ ie.forEach((a) => {
378
378
  n.style.removeProperty(a);
379
- }), ae.clear(), Object.entries(s).forEach(([a, o]) => {
380
- n.style.setProperty(a, o), ae.add(a);
379
+ }), ie.clear(), Object.entries(o).forEach(([a, s]) => {
380
+ n.style.setProperty(a, s), ie.add(a);
381
381
  });
382
382
  }
383
- }, Te = ne({}), Pt = () => re(Te);
383
+ }, _e = oe({}), It = () => ne(_e);
384
384
  function Re() {
385
385
  return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
386
- /* @__PURE__ */ r.jsx(ze, {}),
387
- /* @__PURE__ */ r.jsx($e, {})
386
+ /* @__PURE__ */ r.jsx(Ue, {}),
387
+ /* @__PURE__ */ r.jsx(ze, {})
388
388
  ] });
389
389
  }
390
- function _e({ config: e, routesBuilder: n, adminCss: s = "" }) {
391
- var O, D, $, U, W, H, F;
390
+ function ke({ config: e, routesBuilder: n, adminCss: o = "" }) {
391
+ var I, D, U, Y, B, z, F;
392
392
  const {
393
393
  registry: a = {},
394
- schemas: o = {},
395
- basePath: d = "/",
396
- pages: m = {},
397
- siteConfig: y,
398
- themeConfig: C,
399
- menuConfig: b,
400
- collections: f,
401
- collectionSchemas: x,
402
- refDocuments: p,
403
- themeCss: i,
404
- addSection: l,
405
- NotFoundComponent: E = nt
406
- } = e, h = (l == null ? void 0 : l.addableSectionTypes) ?? Object.keys(o).filter((I) => I !== "header" && I !== "footer"), j = {
407
- saveToFile: (O = e.persistence) == null ? void 0 : O.saveToFile,
394
+ schemas: s = {},
395
+ basePath: i = "/",
396
+ pages: l = {},
397
+ siteConfig: v,
398
+ themeConfig: x,
399
+ menuConfig: y,
400
+ collections: p,
401
+ collectionSchemas: E,
402
+ refDocuments: f,
403
+ themeCss: c,
404
+ addSection: d,
405
+ NotFoundComponent: S = ot
406
+ } = e, h = (d == null ? void 0 : d.addableSectionTypes) ?? Object.keys(s).filter((O) => O !== "header" && O !== "footer"), C = {
407
+ saveToFile: (I = e.persistence) == null ? void 0 : I.saveToFile,
408
408
  hotSave: (D = e.persistence) == null ? void 0 : D.hotSave,
409
- coldSave: ($ = e.persistence) == null ? void 0 : $.coldSave,
410
- showLocalSave: ((U = e.persistence) == null ? void 0 : U.showLocalSave) ?? !0,
411
- showHotSave: ((W = e.persistence) == null ? void 0 : W.showHotSave) ?? !1,
412
- showColdSave: ((H = e.persistence) == null ? void 0 : H.showColdSave) ?? !1
413
- }, A = typeof (i == null ? void 0 : i.tenant) == "string" ? i.tenant : "", v = typeof (i == null ? void 0 : i.admin) == "string" ? i.admin : s, g = X(
414
- () => Ce({
415
- pages: m,
416
- siteConfig: y,
417
- themeConfig: C,
418
- menuConfig: b,
419
- collections: f,
420
- collectionSchemas: x,
421
- refDocuments: p
409
+ coldSave: (U = e.persistence) == null ? void 0 : U.coldSave,
410
+ showLocalSave: ((Y = e.persistence) == null ? void 0 : Y.showLocalSave) ?? !0,
411
+ showHotSave: ((B = e.persistence) == null ? void 0 : B.showHotSave) ?? !1,
412
+ showColdSave: ((z = e.persistence) == null ? void 0 : z.showColdSave) ?? !1
413
+ }, A = typeof (c == null ? void 0 : c.tenant) == "string" ? c.tenant : "", b = typeof (c == null ? void 0 : c.admin) == "string" ? c.admin : o, g = K(
414
+ () => we({
415
+ pages: l,
416
+ siteConfig: v,
417
+ themeConfig: x,
418
+ menuConfig: y,
419
+ collections: p,
420
+ collectionSchemas: E,
421
+ refDocuments: f
422
422
  }),
423
- [m, y, C, b, f, x, p]
424
- ), [u, w] = J(!1), k = Ue(d);
425
- z(() => {
426
- var I, N;
423
+ [l, v, x, y, p, E, f]
424
+ ), [m, w] = J(!1), k = Je(i);
425
+ $(() => {
426
+ var O, N;
427
427
  try {
428
- (I = g.themeConfig) != null && I.tokens && de.setTheme(g.themeConfig);
429
- } catch (Y) {
430
- console.warn("[JsonPages] setTheme failed", Y);
428
+ (O = g.themeConfig) != null && O.tokens && ue.setTheme(g.themeConfig);
429
+ } catch (H) {
430
+ console.warn("[JsonPages] setTheme failed", H);
431
431
  }
432
- (N = e.webmcp) != null && N.enabled && Je(), w(!0);
432
+ (N = e.webmcp) != null && N.enabled && Be(), w(!0);
433
433
  }, [g.themeConfig, (F = e.webmcp) == null ? void 0 : F.enabled]);
434
434
  const T = {
435
435
  registry: a,
436
- schemas: o,
437
- pageRegistry: m,
438
- siteConfig: y,
439
- menuConfig: b,
436
+ schemas: s,
437
+ pageRegistry: l,
438
+ siteConfig: v,
439
+ menuConfig: y,
440
440
  themeConfig: g.themeConfig,
441
- collections: f,
442
- collectionSchemas: x,
443
- refDocuments: p,
444
- addSectionConfig: l,
441
+ collections: p,
442
+ collectionSchemas: E,
443
+ refDocuments: f,
444
+ addSectionConfig: d,
445
445
  addableSectionTypes: h,
446
446
  webmcp: e.webmcp,
447
- persistence: j,
447
+ persistence: C,
448
448
  routerBasePath: k,
449
449
  tenantCss: A,
450
- adminCss: v,
451
- NotFoundComponent: E
452
- }, P = X(() => {
453
- const I = Me(n(T));
454
- return Le(I, { basename: k });
450
+ adminCss: b,
451
+ NotFoundComponent: S
452
+ }, P = K(() => {
453
+ const O = Me(n(T));
454
+ return Fe(O, { basename: k });
455
455
  }, [
456
- E,
457
- l,
456
+ S,
457
+ d,
458
458
  h,
459
- v,
460
- g.themeConfig,
461
459
  b,
462
- f,
463
- x,
464
- m,
465
- j.coldSave,
466
- j.hotSave,
467
- j.saveToFile,
468
- j.showColdSave,
469
- j.showHotSave,
470
- j.showLocalSave,
460
+ g.themeConfig,
461
+ y,
471
462
  p,
463
+ E,
464
+ l,
465
+ C.coldSave,
466
+ C.hotSave,
467
+ C.saveToFile,
468
+ C.showColdSave,
469
+ C.showHotSave,
470
+ C.showLocalSave,
471
+ f,
472
472
  k,
473
- o,
474
- y,
473
+ s,
474
+ v,
475
475
  A,
476
476
  e.webmcp,
477
477
  n
478
478
  ]);
479
- return u ? /* @__PURE__ */ r.jsx(rt, { children: /* @__PURE__ */ r.jsx(Te.Provider, { value: e.iconRegistry ?? {}, children: /* @__PURE__ */ r.jsx(
480
- ot,
479
+ return m ? /* @__PURE__ */ r.jsx(nt, { children: /* @__PURE__ */ r.jsx(_e.Provider, { value: e.iconRegistry ?? {}, children: /* @__PURE__ */ r.jsx(
480
+ st,
481
481
  {
482
482
  config: {
483
483
  registry: a,
484
- schemas: o,
484
+ schemas: s,
485
485
  tenantId: e.tenantId ?? "default",
486
486
  basePath: k,
487
487
  assets: e.assets,
488
488
  overlayDisabledSectionTypes: e.overlayDisabledSectionTypes
489
489
  },
490
- children: /* @__PURE__ */ r.jsx(Fe, { router: P })
490
+ children: /* @__PURE__ */ r.jsx($e, { router: P })
491
491
  }
492
492
  ) }) }) : /* @__PURE__ */ r.jsx(
493
493
  "div",
@@ -506,18 +506,18 @@ function _e({ config: e, routesBuilder: n, adminCss: s = "" }) {
506
506
  }
507
507
  );
508
508
  }
509
- const ke = ne(void 0), ue = ({ mode: e, children: n }) => (z(() => {
509
+ const Ne = oe(void 0), me = ({ mode: e, children: n }) => ($(() => {
510
510
  if (e !== "studio") return;
511
- const s = new MutationObserver((a) => {
512
- a.forEach((o) => {
513
- o.addedNodes.forEach((d) => {
514
- d instanceof HTMLElement && d.hasAttribute("data-radix-portal") && d.setAttribute("data-jp-studio-portal", "true");
511
+ const o = new MutationObserver((a) => {
512
+ a.forEach((s) => {
513
+ s.addedNodes.forEach((i) => {
514
+ i instanceof HTMLElement && i.hasAttribute("data-radix-portal") && i.setAttribute("data-jp-studio-portal", "true");
515
515
  });
516
516
  });
517
517
  });
518
- return s.observe(document.body, { childList: !0 }), () => s.disconnect();
519
- }, [e]), /* @__PURE__ */ r.jsx(ke.Provider, { value: { mode: e }, children: n })), at = () => {
520
- const e = re(ke);
518
+ return o.observe(document.body, { childList: !0 }), () => o.disconnect();
519
+ }, [e]), /* @__PURE__ */ r.jsx(Ne.Provider, { value: { mode: e }, children: n })), it = () => {
520
+ const e = ne(Ne);
521
521
  if (e === void 0)
522
522
  throw new Error("useStudio must be used within a StudioProvider");
523
523
  return e;
@@ -528,14 +528,14 @@ const ke = ne(void 0), ue = ({ mode: e, children: n }) => (z(() => {
528
528
  * This source code is licensed under the ISC license.
529
529
  * See the LICENSE file in the root directory of this source tree.
530
530
  */
531
- const it = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Ne = (...e) => e.filter((n, s, a) => !!n && n.trim() !== "" && a.indexOf(n) === s).join(" ").trim();
531
+ const lt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Pe = (...e) => e.filter((n, o, a) => !!n && n.trim() !== "" && a.indexOf(n) === o).join(" ").trim();
532
532
  /**
533
533
  * @license lucide-react v0.474.0 - ISC
534
534
  *
535
535
  * This source code is licensed under the ISC license.
536
536
  * See the LICENSE file in the root directory of this source tree.
537
537
  */
538
- var lt = {
538
+ var ct = {
539
539
  xmlns: "http://www.w3.org/2000/svg",
540
540
  width: 24,
541
541
  height: 24,
@@ -552,31 +552,31 @@ var lt = {
552
552
  * This source code is licensed under the ISC license.
553
553
  * See the LICENSE file in the root directory of this source tree.
554
554
  */
555
- const ct = Se(
555
+ const dt = je(
556
556
  ({
557
557
  color: e = "currentColor",
558
558
  size: n = 24,
559
- strokeWidth: s = 2,
559
+ strokeWidth: o = 2,
560
560
  absoluteStrokeWidth: a,
561
- className: o = "",
562
- children: d,
563
- iconNode: m,
564
- ...y
565
- }, C) => le(
561
+ className: s = "",
562
+ children: i,
563
+ iconNode: l,
564
+ ...v
565
+ }, x) => ce(
566
566
  "svg",
567
567
  {
568
- ref: C,
569
- ...lt,
568
+ ref: x,
569
+ ...ct,
570
570
  width: n,
571
571
  height: n,
572
572
  stroke: e,
573
- strokeWidth: a ? Number(s) * 24 / Number(n) : s,
574
- className: Ne("lucide", o),
575
- ...y
573
+ strokeWidth: a ? Number(o) * 24 / Number(n) : o,
574
+ className: Pe("lucide", s),
575
+ ...v
576
576
  },
577
577
  [
578
- ...m.map(([b, f]) => le(b, f)),
579
- ...Array.isArray(d) ? d : [d]
578
+ ...l.map(([y, p]) => ce(y, p)),
579
+ ...Array.isArray(i) ? i : [i]
580
580
  ]
581
581
  )
582
582
  );
@@ -586,16 +586,16 @@ const ct = Se(
586
586
  * This source code is licensed under the ISC license.
587
587
  * See the LICENSE file in the root directory of this source tree.
588
588
  */
589
- const me = (e, n) => {
590
- const s = Se(
591
- ({ className: a, ...o }, d) => le(ct, {
592
- ref: d,
589
+ const pe = (e, n) => {
590
+ const o = je(
591
+ ({ className: a, ...s }, i) => ce(dt, {
592
+ ref: i,
593
593
  iconNode: n,
594
- className: Ne(`lucide-${it(e)}`, a),
595
- ...o
594
+ className: Pe(`lucide-${lt(e)}`, a),
595
+ ...s
596
596
  })
597
597
  );
598
- return s.displayName = `${e}`, s;
598
+ return o.displayName = `${e}`, o;
599
599
  };
600
600
  /**
601
601
  * @license lucide-react v0.474.0 - ISC
@@ -603,21 +603,21 @@ const me = (e, n) => {
603
603
  * This source code is licensed under the ISC license.
604
604
  * See the LICENSE file in the root directory of this source tree.
605
605
  */
606
- const dt = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ut = me("ChevronDown", dt);
606
+ const ut = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], mt = pe("ChevronDown", ut);
607
607
  /**
608
608
  * @license lucide-react v0.474.0 - ISC
609
609
  *
610
610
  * This source code is licensed under the ISC license.
611
611
  * See the LICENSE file in the root directory of this source tree.
612
612
  */
613
- const mt = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], pt = me("ChevronUp", mt);
613
+ const pt = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], ft = pe("ChevronUp", pt);
614
614
  /**
615
615
  * @license lucide-react v0.474.0 - ISC
616
616
  *
617
617
  * This source code is licensed under the ISC license.
618
618
  * See the LICENSE file in the root directory of this source tree.
619
619
  */
620
- const ft = [
620
+ const ht = [
621
621
  [
622
622
  "path",
623
623
  {
@@ -627,20 +627,20 @@ const ft = [
627
627
  ],
628
628
  ["path", { d: "M12 9v4", key: "juzpu7" }],
629
629
  ["path", { d: "M12 17h.01", key: "p32p05" }]
630
- ], ht = me("TriangleAlert", ft);
631
- class gt extends je {
630
+ ], gt = pe("TriangleAlert", ht);
631
+ class vt extends Ce {
632
632
  constructor(n) {
633
633
  super(n), this.state = { hasError: !1 };
634
634
  }
635
635
  static getDerivedStateFromError() {
636
636
  return { hasError: !0 };
637
637
  }
638
- componentDidCatch(n, s) {
639
- console.error(`[JsonPages] Component Crash [${this.props.type}]:`, n, s);
638
+ componentDidCatch(n, o) {
639
+ console.error(`[JsonPages] Component Crash [${this.props.type}]:`, n, o);
640
640
  }
641
641
  render() {
642
642
  return this.state.hasError ? /* @__PURE__ */ r.jsxs("div", { className: "p-8 m-4 bg-amber-500/5 border-2 border-dashed border-amber-500/20 rounded-xl flex flex-col items-center text-center gap-3", children: [
643
- /* @__PURE__ */ r.jsx(ht, { className: "text-amber-500", size: 32 }),
643
+ /* @__PURE__ */ r.jsx(gt, { className: "text-amber-500", size: 32 }),
644
644
  /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
645
645
  /* @__PURE__ */ r.jsx("h4", { className: "text-sm font-bold text-amber-200 uppercase tracking-tight", children: "Component Error" }),
646
646
  /* @__PURE__ */ r.jsxs("p", { className: "text-xs text-amber-500/70 font-mono", children: [
@@ -652,54 +652,54 @@ class gt extends je {
652
652
  ] }) : this.props.children;
653
653
  }
654
654
  }
655
- const vt = ({ type: e, scope: n, isSelected: s, sectionId: a, sectionIndex: o = 0, totalSections: d = 0, onReorder: m }) => {
656
- const y = typeof o == "number" && o > 0 && m, C = typeof o == "number" && o < d - 1 && m;
655
+ const bt = ({ type: e, scope: n, isSelected: o, sectionId: a, sectionIndex: s = 0, totalSections: i = 0, onReorder: l }) => {
656
+ const v = typeof s == "number" && s > 0 && l, x = typeof s == "number" && s < i - 1 && l;
657
657
  return /* @__PURE__ */ r.jsx(
658
658
  "div",
659
659
  {
660
660
  "data-jp-section-overlay": !0,
661
661
  "aria-hidden": !0,
662
- className: ce(
662
+ className: de(
663
663
  "absolute inset-0 pointer-events-none transition-all duration-200 z-[50]",
664
664
  "border-2 border-transparent group-hover:border-blue-400/50 group-hover:border-dashed",
665
- s && "border-2 border-blue-600 border-solid bg-blue-500/5"
665
+ o && "border-2 border-blue-600 border-solid bg-blue-500/5"
666
666
  ),
667
667
  children: /* @__PURE__ */ r.jsxs(
668
668
  "div",
669
669
  {
670
- className: ce(
670
+ className: de(
671
671
  "absolute top-0 right-0 flex flex-nowrap items-center gap-1 pl-1 pr-2 py-1 text-[9px] font-black uppercase tracking-widest transition-opacity pointer-events-auto",
672
672
  "bg-blue-600 text-white",
673
- s || "group-hover:opacity-100 opacity-0"
673
+ o || "group-hover:opacity-100 opacity-0"
674
674
  ),
675
675
  children: [
676
- m && a != null && /* @__PURE__ */ r.jsxs("span", { className: "shrink-0 flex items-center gap-0.5", children: [
676
+ l && a != null && /* @__PURE__ */ r.jsxs("span", { className: "shrink-0 flex items-center gap-0.5", children: [
677
677
  /* @__PURE__ */ r.jsx(
678
678
  "button",
679
679
  {
680
680
  type: "button",
681
- onClick: (b) => {
682
- b.stopPropagation(), y && m(a, o - 1);
681
+ onClick: (y) => {
682
+ y.stopPropagation(), v && l(a, s - 1);
683
683
  },
684
- disabled: !y,
684
+ disabled: !v,
685
685
  className: "inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",
686
686
  title: "Move section up",
687
687
  "aria-label": "Move section up",
688
- children: /* @__PURE__ */ r.jsx(pt, { size: 12, strokeWidth: 2.5 })
688
+ children: /* @__PURE__ */ r.jsx(ft, { size: 12, strokeWidth: 2.5 })
689
689
  }
690
690
  ),
691
691
  /* @__PURE__ */ r.jsx(
692
692
  "button",
693
693
  {
694
694
  type: "button",
695
- onClick: (b) => {
696
- b.stopPropagation(), C && m(a, o + 2);
695
+ onClick: (y) => {
696
+ y.stopPropagation(), x && l(a, s + 2);
697
697
  },
698
- disabled: !C,
698
+ disabled: !x,
699
699
  className: "inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",
700
700
  title: "Move section down",
701
701
  "aria-label": "Move section down",
702
- children: /* @__PURE__ */ r.jsx(ut, { size: 12, strokeWidth: 2.5 })
702
+ children: /* @__PURE__ */ r.jsx(mt, { size: 12, strokeWidth: 2.5 })
703
703
  }
704
704
  )
705
705
  ] }),
@@ -714,93 +714,93 @@ const vt = ({ type: e, scope: n, isSelected: s, sectionId: a, sectionIndex: o =
714
714
  }, ee = ({
715
715
  section: e,
716
716
  menu: n,
717
- selectedId: s,
717
+ selectedId: o,
718
718
  reorderable: a,
719
- sectionIndex: o,
720
- totalSections: d,
721
- onReorder: m
719
+ sectionIndex: s,
720
+ totalSections: i,
721
+ onReorder: l
722
722
  }) => {
723
- const { mode: y } = at(), { registry: C, overlayDisabledSectionTypes: b } = st(), f = y === "studio", x = f && s === e.id, p = C[e.type], i = e.type === "header" || e.type === "footer" ? "global" : "local", l = Array.isArray(b) ? b.includes(e.type) : !1, E = e.type === "header" && typeof e.settings == "object" && e.settings !== null && "sticky" in e.settings && !!e.settings.sticky;
724
- if (!p)
723
+ const { mode: v } = it(), { registry: x, overlayDisabledSectionTypes: y } = at(), p = v === "studio", E = p && o === e.id, f = x[e.type], c = e.type === "header" || e.type === "footer" ? "global" : "local", d = Array.isArray(y) ? y.includes(e.type) : !1, S = e.type === "header" && typeof e.settings == "object" && e.settings !== null && "sticky" in e.settings && !!e.settings.sticky;
724
+ if (!f)
725
725
  return /* @__PURE__ */ r.jsxs("div", { className: "p-6 m-4 bg-red-500/10 text-red-400 border border-red-500/20 rounded-lg text-sm font-mono", children: [
726
726
  /* @__PURE__ */ r.jsx("strong", { children: "Missing Component:" }),
727
727
  " ",
728
728
  e.type
729
729
  ] });
730
730
  const h = () => {
731
- const A = p;
731
+ const A = f;
732
732
  return n ? /* @__PURE__ */ r.jsx(A, { data: e.data, settings: e.settings, menu: n }) : /* @__PURE__ */ r.jsx(A, { data: e.data, settings: e.settings });
733
- }, j = typeof e.data == "object" && e.data !== null && "anchorId" in e.data ? String(e.data.anchorId ?? "") : void 0;
733
+ }, C = typeof e.data == "object" && e.data !== null && "anchorId" in e.data ? String(e.data.anchorId ?? "") : void 0;
734
734
  return /* @__PURE__ */ r.jsxs(
735
735
  "div",
736
736
  {
737
- id: j || void 0,
738
- "data-section-id": f ? e.id : void 0,
739
- "data-section-type": f ? e.type : void 0,
740
- "data-section-scope": f ? i : void 0,
741
- ...f && x ? { "data-jp-selected": !0 } : {},
742
- className: ce(
737
+ id: C || void 0,
738
+ "data-section-id": p ? e.id : void 0,
739
+ "data-section-type": p ? e.type : void 0,
740
+ "data-section-scope": p ? c : void 0,
741
+ ...p && E ? { "data-jp-selected": !0 } : {},
742
+ className: de(
743
743
  "relative w-full",
744
- f && !l && "group cursor-pointer",
745
- f && E ? "sticky top-0 z-[60]" : e.type === "header" ? "relative" : "relative z-0",
746
- x && "z-[70]"
744
+ p && !d && "group cursor-pointer",
745
+ p && S ? "sticky top-0 z-[60]" : e.type === "header" ? "relative" : "relative z-0",
746
+ E && "z-[70]"
747
747
  ),
748
748
  children: [
749
- /* @__PURE__ */ r.jsx("div", { className: e.type === "header" ? "relative" : "relative z-0", children: /* @__PURE__ */ r.jsx(gt, { type: e.type, children: h() }) }),
750
- f && !l && /* @__PURE__ */ r.jsx(
751
- vt,
749
+ /* @__PURE__ */ r.jsx("div", { className: e.type === "header" ? "relative" : "relative z-0", children: /* @__PURE__ */ r.jsx(vt, { type: e.type, children: h() }) }),
750
+ p && !d && /* @__PURE__ */ r.jsx(
751
+ bt,
752
752
  {
753
753
  type: e.type,
754
- scope: i,
755
- isSelected: !!x,
756
- sectionId: a && i === "local" ? e.id : void 0,
757
- sectionIndex: a && i === "local" ? o : void 0,
758
- totalSections: a && i === "local" ? d : void 0,
759
- onReorder: a && i === "local" ? m : void 0
754
+ scope: c,
755
+ isSelected: !!E,
756
+ sectionId: a && c === "local" ? e.id : void 0,
757
+ sectionIndex: a && c === "local" ? s : void 0,
758
+ totalSections: a && c === "local" ? i : void 0,
759
+ onReorder: a && c === "local" ? l : void 0
760
760
  }
761
761
  )
762
762
  ]
763
763
  }
764
764
  );
765
- }, bt = (e) => {
766
- z(() => {
765
+ }, yt = (e) => {
766
+ $(() => {
767
767
  document.title = e.title;
768
768
  let n = document.querySelector('meta[name="description"]');
769
769
  n || (n = document.createElement("meta"), n.setAttribute("name", "description"), document.head.appendChild(n)), n.setAttribute("content", e.description);
770
770
  }, [e.title, e.description]);
771
- }, yt = "application/json", Pe = ({
771
+ }, Et = "application/json", Ae = ({
772
772
  pageConfig: e,
773
773
  siteConfig: n,
774
- menuConfig: s,
774
+ menuConfig: o,
775
775
  selectedId: a,
776
- onReorder: o,
777
- scrollToSectionId: d,
778
- onActiveSectionChange: m
776
+ onReorder: s,
777
+ scrollToSectionId: i,
778
+ onActiveSectionChange: l
779
779
  }) => {
780
- bt(e.meta);
781
- const [y, C] = J(null), b = fe({}), f = fe(m);
782
- f.current = m;
783
- const x = We(e, n), p = x ? n.header ?? null : null, i = n.footer ?? null, l = (v) => {
780
+ yt(e.meta);
781
+ const [v, x] = J(null), y = he({}), p = he(l);
782
+ p.current = l;
783
+ const E = Ve(e, n), f = E ? n.header ?? null : null, c = n.footer ?? null, d = (b) => {
784
784
  var g;
785
- (g = f.current) == null || g.call(f, v);
785
+ (g = p.current) == null || g.call(p, b);
786
786
  };
787
- z(() => {
788
- if (!d) return;
789
- const v = b.current[d];
790
- v && v.scrollIntoView({ behavior: "smooth", block: "center" });
791
- }, [d]), z(() => {
792
- if (!f.current) return;
787
+ $(() => {
788
+ if (!i) return;
789
+ const b = y.current[i];
790
+ b && b.scrollIntoView({ behavior: "smooth", block: "center" });
791
+ }, [i]), $(() => {
792
+ if (!p.current) return;
793
793
  const g = [
794
- ...p ? [p.id] : [],
794
+ ...f ? [f.id] : [],
795
795
  ...e.sections.map((T) => T.id),
796
- ...i ? [i.id] : []
797
- ], u = new IntersectionObserver(
796
+ ...c ? [c.id] : []
797
+ ], m = new IntersectionObserver(
798
798
  (T) => {
799
799
  T.forEach((P) => {
800
- var O;
800
+ var I;
801
801
  if (P.isIntersecting && P.intersectionRatio > 0.5) {
802
802
  const D = P.target.getAttribute("data-section-id");
803
- D && ((O = f.current) == null || O.call(f, D));
803
+ D && ((I = p.current) == null || I.call(p, D));
804
804
  }
805
805
  });
806
806
  },
@@ -809,37 +809,37 @@ const vt = ({ type: e, scope: n, isSelected: s, sectionId: a, sectionIndex: o =
809
809
  let w = !1;
810
810
  const k = requestAnimationFrame(() => {
811
811
  w || g.forEach((T) => {
812
- const P = b.current[T];
813
- P && u.observe(P);
812
+ const P = y.current[T];
813
+ P && m.observe(P);
814
814
  });
815
815
  });
816
816
  return () => {
817
- w = !0, cancelAnimationFrame(k), u.disconnect();
817
+ w = !0, cancelAnimationFrame(k), m.disconnect();
818
818
  };
819
- }, [i, p, e.sections, e["global-header"], x]);
820
- const E = (v, g) => {
821
- v.preventDefault(), v.dataTransfer.dropEffect = "move", C(g);
819
+ }, [c, f, e.sections, e["global-header"], E]);
820
+ const S = (b, g) => {
821
+ b.preventDefault(), b.dataTransfer.dropEffect = "move", x(g);
822
822
  }, h = () => {
823
- C(null);
824
- }, j = (v, g) => {
825
- if (v.preventDefault(), C(null), !!o)
823
+ x(null);
824
+ }, C = (b, g) => {
825
+ if (b.preventDefault(), x(null), !!s)
826
826
  try {
827
- const u = v.dataTransfer.getData(yt), { sectionId: w } = JSON.parse(u);
828
- typeof w == "string" && o(w, g);
827
+ const m = b.dataTransfer.getData(Et), { sectionId: w } = JSON.parse(m);
828
+ typeof w == "string" && s(w, g);
829
829
  } catch {
830
830
  }
831
831
  }, A = () => {
832
- const v = typeof o == "function", g = e.sections.map((u, w) => {
833
- const k = y === w;
834
- return v ? /* @__PURE__ */ r.jsxs(
832
+ const b = typeof s == "function", g = e.sections.map((m, w) => {
833
+ const k = v === w;
834
+ return b ? /* @__PURE__ */ r.jsxs(
835
835
  "div",
836
836
  {
837
837
  ref: (T) => {
838
- b.current[u.id] = T;
838
+ y.current[m.id] = T;
839
839
  },
840
- "data-section-id": u.id,
840
+ "data-section-id": m.id,
841
841
  style: { position: "relative" },
842
- onMouseEnter: () => l(u.id),
842
+ onMouseEnter: () => d(m.id),
843
843
  children: [
844
844
  /* @__PURE__ */ r.jsx(
845
845
  "div",
@@ -856,48 +856,48 @@ const vt = ({ type: e, scope: n, isSelected: s, sectionId: a, sectionIndex: o =
856
856
  backgroundColor: k ? "rgba(59, 130, 246, 0.4)" : "transparent",
857
857
  borderTop: k ? "2px solid rgb(96, 165, 250)" : "2px solid transparent"
858
858
  },
859
- onDragOver: (T) => E(T, w),
859
+ onDragOver: (T) => S(T, w),
860
860
  onDragLeave: h,
861
- onDrop: (T) => j(T, w)
861
+ onDrop: (T) => C(T, w)
862
862
  }
863
863
  ),
864
864
  /* @__PURE__ */ r.jsx(
865
865
  ee,
866
866
  {
867
- section: u,
868
- menu: Z(u, s.main ?? []),
867
+ section: m,
868
+ menu: Q(m, o.main ?? []),
869
869
  selectedId: a,
870
870
  reorderable: !0,
871
871
  sectionIndex: w,
872
872
  totalSections: e.sections.length,
873
- onReorder: o
873
+ onReorder: s
874
874
  }
875
875
  )
876
876
  ]
877
877
  },
878
- u.id
878
+ m.id
879
879
  ) : /* @__PURE__ */ r.jsx(
880
880
  "div",
881
881
  {
882
882
  ref: (T) => {
883
- b.current[u.id] = T;
883
+ y.current[m.id] = T;
884
884
  },
885
- "data-section-id": u.id,
886
- onMouseEnter: () => l(u.id),
885
+ "data-section-id": m.id,
886
+ onMouseEnter: () => d(m.id),
887
887
  children: /* @__PURE__ */ r.jsx(
888
888
  ee,
889
889
  {
890
- section: u,
891
- menu: Z(u, s.main ?? []),
890
+ section: m,
891
+ menu: Q(m, o.main ?? []),
892
892
  selectedId: a
893
893
  }
894
894
  )
895
895
  },
896
- u.id
896
+ m.id
897
897
  );
898
898
  });
899
- if (v && g.length > 0) {
900
- const u = e.sections.length, w = y === u;
899
+ if (b && g.length > 0) {
900
+ const m = e.sections.length, w = v === m;
901
901
  g.push(
902
902
  /* @__PURE__ */ r.jsx(
903
903
  "div",
@@ -914,9 +914,9 @@ const vt = ({ type: e, scope: n, isSelected: s, sectionId: a, sectionIndex: o =
914
914
  backgroundColor: w ? "rgba(59, 130, 246, 0.4)" : "transparent",
915
915
  borderTop: w ? "2px solid rgb(96, 165, 250)" : "2px solid transparent"
916
916
  },
917
- onDragOver: (k) => E(k, u),
917
+ onDragOver: (k) => S(k, m),
918
918
  onDragLeave: h,
919
- onDrop: (k) => j(k, u)
919
+ onDrop: (k) => C(k, m)
920
920
  },
921
921
  "jp-drop-after-last"
922
922
  )
@@ -925,219 +925,219 @@ const vt = ({ type: e, scope: n, isSelected: s, sectionId: a, sectionIndex: o =
925
925
  return g;
926
926
  };
927
927
  return /* @__PURE__ */ r.jsxs("div", { className: "min-h-screen flex flex-col bg-[var(--color-background)]", children: [
928
- p != null && /* @__PURE__ */ r.jsx(
928
+ f != null && /* @__PURE__ */ r.jsx(
929
929
  "div",
930
930
  {
931
- ref: (v) => {
932
- b.current[p.id] = v;
931
+ ref: (b) => {
932
+ y.current[f.id] = b;
933
933
  },
934
- "data-section-id": p.id,
935
- onMouseEnter: () => l(p.id),
934
+ "data-section-id": f.id,
935
+ onMouseEnter: () => d(f.id),
936
936
  children: /* @__PURE__ */ r.jsx(
937
937
  ee,
938
938
  {
939
- section: p,
940
- menu: Z(p, s.main ?? []),
939
+ section: f,
940
+ menu: Q(f, o.main ?? []),
941
941
  selectedId: a
942
942
  }
943
943
  )
944
944
  }
945
945
  ),
946
946
  /* @__PURE__ */ r.jsx("main", { className: "flex-1", children: A() }),
947
- i != null && /* @__PURE__ */ r.jsx(
947
+ c != null && /* @__PURE__ */ r.jsx(
948
948
  "div",
949
949
  {
950
- ref: (v) => {
951
- b.current[i.id] = v;
950
+ ref: (b) => {
951
+ y.current[c.id] = b;
952
952
  },
953
- "data-section-id": i.id,
954
- onMouseEnter: () => l(i.id),
953
+ "data-section-id": c.id,
954
+ onMouseEnter: () => d(c.id),
955
955
  children: /* @__PURE__ */ r.jsx(
956
956
  ee,
957
957
  {
958
- section: i,
959
- menu: Z(i, s.main ?? []),
958
+ section: c,
959
+ menu: Q(c, o.main ?? []),
960
960
  selectedId: a
961
961
  }
962
962
  )
963
963
  }
964
964
  )
965
965
  ] });
966
- }, xt = '[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]', Et = "[data-jp-field],[data-jp-item-id],[data-jp-item-field]", jt = () => {
967
- var p;
968
- const [e, n] = J(null), [s, a] = J(null), [o, d] = J({ main: [] }), [m, y] = J(null), [C, b] = J(null);
969
- if (z(() => {
970
- const i = (l) => {
971
- if (!(l.origin !== window.location.origin || l.source !== window.parent) && (l.data.type === M.UPDATE_DRAFTS && (n(l.data.draft), a(l.data.globalDraft), l.data.menuConfig && d(l.data.menuConfig), l.data.themeConfig && de.setTheme(l.data.themeConfig)), l.data.type === M.SYNC_SELECTION && y(l.data.selectedId), l.data.type === M.REQUEST_SCROLL_TO_SECTION && b(l.data.sectionId ?? null), l.data.type === M.REQUEST_INLINE_FLUSH)) {
972
- const E = typeof l.data.requestId == "string" ? l.data.requestId : null;
973
- window.dispatchEvent(new CustomEvent(M.REQUEST_INLINE_FLUSH, { detail: { requestId: E } })), setTimeout(() => {
966
+ }, xt = '[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]', St = "[data-jp-field],[data-jp-item-id],[data-jp-item-field]", Ct = () => {
967
+ var f;
968
+ const [e, n] = J(null), [o, a] = J(null), [s, i] = J({ main: [] }), [l, v] = J(null), [x, y] = J(null);
969
+ if ($(() => {
970
+ const c = (d) => {
971
+ if (!(d.origin !== window.location.origin || d.source !== window.parent) && (d.data.type === L.UPDATE_DRAFTS && (n(d.data.draft), a(d.data.globalDraft), d.data.menuConfig && i(d.data.menuConfig), d.data.themeConfig && ue.setTheme(d.data.themeConfig)), d.data.type === L.SYNC_SELECTION && v(d.data.selectedId), d.data.type === L.REQUEST_SCROLL_TO_SECTION && y(d.data.sectionId ?? null), d.data.type === L.REQUEST_INLINE_FLUSH)) {
972
+ const S = typeof d.data.requestId == "string" ? d.data.requestId : null;
973
+ window.dispatchEvent(new CustomEvent(L.REQUEST_INLINE_FLUSH, { detail: { requestId: S } })), setTimeout(() => {
974
974
  window.parent.postMessage(
975
- { type: M.INLINE_FLUSHED, requestId: E },
975
+ { type: L.INLINE_FLUSHED, requestId: S },
976
976
  window.location.origin
977
977
  );
978
978
  }, 0);
979
979
  }
980
980
  };
981
- return window.addEventListener("message", i), window.parent.postMessage({ type: M.STAGE_READY }, "*"), () => window.removeEventListener("message", i);
982
- }, []), z(() => {
983
- const i = (h) => !!h.closest(Et), l = (h) => !!(h.closest('[data-jp-ignore-select="true"]') || h.closest(xt) && !i(h) || h.closest("a[href]") && !i(h)), E = (h) => {
984
- var U, W, H;
985
- const j = h.target;
986
- if (l(j)) {
987
- j.closest("a[href]") && h.preventDefault();
981
+ return window.addEventListener("message", c), window.parent.postMessage({ type: L.STAGE_READY }, "*"), () => window.removeEventListener("message", c);
982
+ }, []), $(() => {
983
+ const c = (h) => !!h.closest(St), d = (h) => !!(h.closest('[data-jp-ignore-select="true"]') || h.closest(xt) && !c(h) || h.closest("a[href]") && !c(h)), S = (h) => {
984
+ var Y, B, z;
985
+ const C = h.target;
986
+ if (d(C)) {
987
+ C.closest("a[href]") && h.preventDefault();
988
988
  return;
989
989
  }
990
- const A = h.clientX, v = h.clientY;
991
- let g = null, u = j;
992
- for (; u && u !== document.body; ) {
993
- const F = (U = u.getAttribute) == null ? void 0 : U.call(u, "data-section-id"), I = (W = u.getAttribute) == null ? void 0 : W.call(u, "data-section-type"), N = (H = u.getAttribute) == null ? void 0 : H.call(u, "data-section-scope");
994
- if (F && I && N) {
995
- g = u;
990
+ const A = h.clientX, b = h.clientY;
991
+ let g = null, m = C;
992
+ for (; m && m !== document.body; ) {
993
+ const F = (Y = m.getAttribute) == null ? void 0 : Y.call(m, "data-section-id"), O = (B = m.getAttribute) == null ? void 0 : B.call(m, "data-section-type"), N = (z = m.getAttribute) == null ? void 0 : z.call(m, "data-section-scope");
994
+ if (F && O && N) {
995
+ g = m;
996
996
  break;
997
997
  }
998
- u = u.parentElement;
998
+ m = m.parentElement;
999
999
  }
1000
1000
  if (!g) return;
1001
1001
  h.preventDefault(), h.stopPropagation();
1002
1002
  const w = g.getAttribute("data-section-id"), k = g.getAttribute("data-section-type"), T = g.getAttribute("data-section-scope");
1003
1003
  if (!w || !k || !T) return;
1004
1004
  const P = { id: w, type: k, scope: T };
1005
- if (j === g) {
1006
- window.parent.postMessage({ type: M.SECTION_SELECT, section: P }, "*");
1005
+ if (C === g) {
1006
+ window.parent.postMessage({ type: L.SECTION_SELECT, section: P }, "*");
1007
1007
  return;
1008
1008
  }
1009
- const O = document.elementFromPoint(A, v) ?? j;
1010
- if (!O || !g.contains(O)) {
1011
- window.parent.postMessage({ type: M.SECTION_SELECT, section: P }, "*");
1009
+ const I = document.elementFromPoint(A, b) ?? C;
1010
+ if (!I || !g.contains(I)) {
1011
+ window.parent.postMessage({ type: L.SECTION_SELECT, section: P }, "*");
1012
1012
  return;
1013
1013
  }
1014
- if (O === g) {
1015
- window.parent.postMessage({ type: M.SECTION_SELECT, section: P }, "*");
1014
+ if (I === g) {
1015
+ window.parent.postMessage({ type: L.SECTION_SELECT, section: P }, "*");
1016
1016
  return;
1017
1017
  }
1018
- let D = he(O, g);
1019
- if (D.length === 0 && O) {
1018
+ let D = ge(I, g);
1019
+ if (D.length === 0 && I) {
1020
1020
  let F = null;
1021
- const I = (N) => {
1022
- var q, t;
1023
- const Y = N.getBoundingClientRect();
1024
- if (Y.left <= A && A <= Y.right && Y.top <= v && v <= Y.bottom) {
1025
- for (let c = 0; c < N.children.length; c++) I(N.children[c]);
1026
- ((q = N.getAttribute) != null && q.call(N, "data-jp-item-id") || (t = N.getAttribute) != null && t.call(N, "data-jp-field")) && (F = N);
1021
+ const O = (N) => {
1022
+ var W, t;
1023
+ const H = N.getBoundingClientRect();
1024
+ if (H.left <= A && A <= H.right && H.top <= b && b <= H.bottom) {
1025
+ for (let u = 0; u < N.children.length; u++) O(N.children[u]);
1026
+ ((W = N.getAttribute) != null && W.call(N, "data-jp-item-id") || (t = N.getAttribute) != null && t.call(N, "data-jp-field")) && (F = N);
1027
1027
  }
1028
1028
  };
1029
- I(O), F && (D = he(F, g));
1029
+ O(I), F && (D = ge(F, g));
1030
1030
  }
1031
- const $ = { type: M.SECTION_SELECT, section: P };
1032
- D.length > 0 && ($.itemPath = D), window.parent.postMessage($, "*");
1031
+ const U = { type: L.SECTION_SELECT, section: P };
1032
+ D.length > 0 && (U.itemPath = D), window.parent.postMessage(U, "*");
1033
1033
  };
1034
- return document.addEventListener("click", E, !0), () => document.removeEventListener("click", E, !0);
1035
- }, []), z(() => {
1036
- if (!C) return;
1037
- const i = setTimeout(() => b(null), 600);
1038
- return () => clearTimeout(i);
1039
- }, [C]), !e || !s)
1034
+ return document.addEventListener("click", S, !0), () => document.removeEventListener("click", S, !0);
1035
+ }, []), $(() => {
1036
+ if (!x) return;
1037
+ const c = setTimeout(() => y(null), 600);
1038
+ return () => clearTimeout(c);
1039
+ }, [x]), !e || !o)
1040
1040
  return /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-center h-screen w-full bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse", children: "Waiting for Studio Signal..." });
1041
- const f = {
1042
- ...o,
1043
- main: Be((p = s.header) == null ? void 0 : p.data, o.main ?? [])
1044
- }, x = (i) => {
1041
+ const p = {
1042
+ ...s,
1043
+ main: We((f = o.header) == null ? void 0 : f.data, s.main ?? [])
1044
+ }, E = (c) => {
1045
1045
  window.parent.postMessage({
1046
- type: M.ACTIVE_SECTION_CHANGED,
1047
- activeSectionId: i
1046
+ type: L.ACTIVE_SECTION_CHANGED,
1047
+ activeSectionId: c
1048
1048
  }, "*");
1049
1049
  };
1050
- return /* @__PURE__ */ r.jsx(ue, { mode: "studio", children: /* @__PURE__ */ r.jsx("div", { className: "jp-ice-active", children: /* @__PURE__ */ r.jsx(
1051
- Pe,
1050
+ return /* @__PURE__ */ r.jsx(me, { mode: "studio", children: /* @__PURE__ */ r.jsx("div", { className: "jp-ice-active", children: /* @__PURE__ */ r.jsx(
1051
+ Ae,
1052
1052
  {
1053
1053
  pageConfig: e,
1054
- siteConfig: s,
1055
- menuConfig: f,
1056
- selectedId: m,
1057
- scrollToSectionId: C,
1058
- onActiveSectionChange: x
1054
+ siteConfig: o,
1055
+ menuConfig: p,
1056
+ selectedId: l,
1057
+ scrollToSectionId: x,
1058
+ onActiveSectionChange: E
1059
1059
  }
1060
1060
  ) }) });
1061
- }, pe = ({ mode: e, tenantCss: n, adminCss: s, children: a }) => (Oe(() => {
1062
- const o = `jp-theme-${e}`, d = e === "tenant" ? n : s;
1063
- if (!document.getElementById(o) && d) {
1064
- const m = document.createElement("style");
1065
- m.id = o, m.innerHTML = d, document.head.appendChild(m);
1061
+ }, fe = ({ mode: e, tenantCss: n, adminCss: o, children: a }) => (De(() => {
1062
+ const s = `jp-theme-${e}`, i = e === "tenant" ? n : o;
1063
+ if (!document.getElementById(s) && i) {
1064
+ const l = document.createElement("style");
1065
+ l.id = s, l.innerHTML = i, document.head.appendChild(l);
1066
1066
  }
1067
1067
  return () => {
1068
- const m = document.getElementById(o);
1069
- m && m.remove();
1068
+ const l = document.getElementById(s);
1069
+ l && l.remove();
1070
1070
  };
1071
- }, [e, n, s]), /* @__PURE__ */ r.jsx(r.Fragment, { children: a })), xe = ({ tenantCss: e, adminCss: n }) => /* @__PURE__ */ r.jsx(pe, { mode: "tenant", tenantCss: e, adminCss: n, children: /* @__PURE__ */ r.jsx(jt, {}) });
1072
- let ie = null;
1073
- function St() {
1074
- return ie || (ie = import("@olonjs/studio")), ie;
1071
+ }, [e, n, o]), /* @__PURE__ */ r.jsx(r.Fragment, { children: a })), xe = ({ tenantCss: e, adminCss: n }) => /* @__PURE__ */ r.jsx(fe, { mode: "tenant", tenantCss: e, adminCss: n, children: /* @__PURE__ */ r.jsx(Ct, {}) });
1072
+ let le = null;
1073
+ function jt() {
1074
+ return le || (le = import("@olonjs/studio")), le;
1075
1075
  }
1076
- const Ee = ({ tenantCss: e, adminCss: n, ...s }) => {
1077
- const [a, o] = J(null);
1078
- z(() => {
1079
- let m = !1;
1080
- return St().then((y) => {
1081
- m || o(y);
1076
+ const Se = ({ tenantCss: e, adminCss: n, ...o }) => {
1077
+ const [a, s] = J(null);
1078
+ $(() => {
1079
+ let l = !1;
1080
+ return jt().then((v) => {
1081
+ l || s(v);
1082
1082
  }), () => {
1083
- m = !0;
1083
+ l = !0;
1084
1084
  };
1085
1085
  }, []);
1086
- const d = n || (a == null ? void 0 : a.adminSkinCss) || "";
1087
- return /* @__PURE__ */ r.jsx(pe, { mode: "admin", tenantCss: e, adminCss: d, children: /* @__PURE__ */ r.jsx(ue, { mode: "studio", children: a ? /* @__PURE__ */ r.jsx(a.StudioRouteBody, { ...s }) : /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-center h-screen w-screen bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse", children: "Loading Studio..." }) }) });
1088
- }, te = ({
1086
+ const i = n || (a == null ? void 0 : a.adminSkinCss) || "";
1087
+ return /* @__PURE__ */ r.jsx(fe, { mode: "admin", tenantCss: e, adminCss: i, children: /* @__PURE__ */ r.jsx(me, { mode: "studio", children: a ? /* @__PURE__ */ r.jsx(a.StudioRouteBody, { ...o }) : /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-center h-screen w-screen bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse", children: "Loading Studio..." }) }) });
1088
+ }, re = ({
1089
1089
  pageRegistry: e,
1090
1090
  siteConfig: n,
1091
- menuConfig: s,
1091
+ menuConfig: o,
1092
1092
  themeConfig: a,
1093
- collections: o,
1094
- collectionSchemas: d,
1095
- refDocuments: m,
1096
- tenantCss: y,
1097
- adminCss: C,
1098
- NotFoundComponent: b
1093
+ collections: s,
1094
+ collectionSchemas: i,
1095
+ refDocuments: l,
1096
+ tenantCss: v,
1097
+ adminCss: x,
1098
+ NotFoundComponent: y
1099
1099
  }) => {
1100
- const f = He(), x = qe(f.pathname), p = X(
1101
- () => Ve(e, x),
1102
- [e, x]
1103
- ), i = X(
1104
- () => p ? Ge(p.page, p.params, o) : null,
1105
- [o, p]
1106
- ), l = X(
1107
- () => Ce({
1108
- pages: p ? { [p.registrySlug]: p.page } : {},
1100
+ const p = He(), E = qe(p.pathname), f = K(
1101
+ () => Ge(e, E),
1102
+ [e, E]
1103
+ ), c = K(
1104
+ () => f ? Ke(f.page, f.params, s) : null,
1105
+ [s, f]
1106
+ ), d = K(
1107
+ () => we({
1108
+ pages: f ? { [f.registrySlug]: f.page } : {},
1109
1109
  siteConfig: n,
1110
1110
  themeConfig: a,
1111
- menuConfig: s,
1112
- collections: o,
1113
- collectionSchemas: d,
1114
- collectionContext: i,
1115
- refDocuments: m
1111
+ menuConfig: o,
1112
+ collections: s,
1113
+ collectionSchemas: i,
1114
+ collectionContext: c,
1115
+ refDocuments: l
1116
1116
  }),
1117
- [p, n, a, s, o, d, i, m]
1118
- ), E = p ? l.pages[p.registrySlug] : void 0;
1119
- return z(() => {
1117
+ [f, n, a, o, s, i, c, l]
1118
+ ), S = f ? d.pages[f.registrySlug] : void 0;
1119
+ return $(() => {
1120
1120
  var h;
1121
1121
  try {
1122
- (h = l.themeConfig) != null && h.tokens && de.setTheme(l.themeConfig);
1123
- } catch (j) {
1124
- console.warn("[JsonPages] visitor theme resolution failed", j);
1122
+ (h = d.themeConfig) != null && h.tokens && ue.setTheme(d.themeConfig);
1123
+ } catch (C) {
1124
+ console.warn("[JsonPages] visitor theme resolution failed", C);
1125
1125
  }
1126
- }, [l.themeConfig]), z(() => {
1127
- var A, v;
1128
- if (!E) return;
1129
- const h = typeof ((A = E.meta) == null ? void 0 : A.title) == "string" ? E.meta.title : x, j = typeof ((v = E.meta) == null ? void 0 : v.description) == "string" ? E.meta.description : "";
1130
- ge("mcp-manifest", Xe(x)), ge("olon-contract", Qe(x)), Ze(h, j, x === "home" ? "/" : `/${x}`);
1131
- }, [E, x]), E ? /* @__PURE__ */ r.jsx(pe, { mode: "tenant", tenantCss: y, adminCss: C, children: /* @__PURE__ */ r.jsx(ue, { mode: "visitor", children: /* @__PURE__ */ r.jsx(
1132
- Pe,
1126
+ }, [d.themeConfig]), $(() => {
1127
+ var A, b;
1128
+ if (!S) return;
1129
+ const h = typeof ((A = S.meta) == null ? void 0 : A.title) == "string" ? S.meta.title : E, C = typeof ((b = S.meta) == null ? void 0 : b.description) == "string" ? S.meta.description : "";
1130
+ ve("mcp-manifest", Xe(E)), ve("olon-contract", Qe(E)), Ze(h, C, E === "home" ? "/" : `/${E}`);
1131
+ }, [S, E]), S ? /* @__PURE__ */ r.jsx(fe, { mode: "tenant", tenantCss: v, adminCss: x, children: /* @__PURE__ */ r.jsx(me, { mode: "visitor", children: /* @__PURE__ */ r.jsx(
1132
+ Ae,
1133
1133
  {
1134
- pageConfig: E,
1135
- siteConfig: l.siteConfig,
1136
- menuConfig: l.menuConfig
1134
+ pageConfig: S,
1135
+ siteConfig: d.siteConfig,
1136
+ menuConfig: d.menuConfig
1137
1137
  }
1138
- ) }) }) : /* @__PURE__ */ r.jsx(b, {});
1138
+ ) }) }) : /* @__PURE__ */ r.jsx(y, {});
1139
1139
  };
1140
- function Ct(e) {
1140
+ function wt(e) {
1141
1141
  const n = {
1142
1142
  pageRegistry: e.pageRegistry,
1143
1143
  siteConfig: e.siteConfig,
@@ -1149,7 +1149,7 @@ function Ct(e) {
1149
1149
  tenantCss: e.tenantCss,
1150
1150
  adminCss: e.adminCss,
1151
1151
  NotFoundComponent: e.NotFoundComponent
1152
- }, s = {
1152
+ }, o = {
1153
1153
  pageRegistry: e.pageRegistry,
1154
1154
  schemas: e.schemas,
1155
1155
  siteConfig: e.siteConfig,
@@ -1170,32 +1170,32 @@ function Ct(e) {
1170
1170
  showHotSave: e.persistence.showHotSave,
1171
1171
  showColdSave: e.persistence.showColdSave
1172
1172
  };
1173
- return /* @__PURE__ */ r.jsxs(L, { element: /* @__PURE__ */ r.jsx(Re, {}), children: [
1174
- /* @__PURE__ */ r.jsx(L, { path: "/", element: /* @__PURE__ */ r.jsx(te, { ...n }) }),
1175
- /* @__PURE__ */ r.jsx(L, { path: "/*", element: /* @__PURE__ */ r.jsx(te, { ...n }) }),
1176
- /* @__PURE__ */ r.jsx(L, { path: "/admin", element: /* @__PURE__ */ r.jsx(Ee, { ...s }) }),
1177
- /* @__PURE__ */ r.jsx(L, { path: "/admin/*", element: /* @__PURE__ */ r.jsx(Ee, { ...s }) }),
1173
+ return /* @__PURE__ */ r.jsxs(M, { element: /* @__PURE__ */ r.jsx(Re, {}), children: [
1174
+ /* @__PURE__ */ r.jsx(M, { path: "/", element: /* @__PURE__ */ r.jsx(re, { ...n }) }),
1175
+ /* @__PURE__ */ r.jsx(M, { path: "/*", element: /* @__PURE__ */ r.jsx(re, { ...n }) }),
1176
+ /* @__PURE__ */ r.jsx(M, { path: "/admin", element: /* @__PURE__ */ r.jsx(Se, { ...o }) }),
1177
+ /* @__PURE__ */ r.jsx(M, { path: "/admin/*", element: /* @__PURE__ */ r.jsx(Se, { ...o }) }),
1178
1178
  /* @__PURE__ */ r.jsx(
1179
- L,
1179
+ M,
1180
1180
  {
1181
1181
  path: "/admin/preview",
1182
1182
  element: /* @__PURE__ */ r.jsx(xe, { tenantCss: e.tenantCss, adminCss: e.adminCss })
1183
1183
  }
1184
1184
  ),
1185
1185
  /* @__PURE__ */ r.jsx(
1186
- L,
1186
+ M,
1187
1187
  {
1188
1188
  path: "/admin/preview/*",
1189
1189
  element: /* @__PURE__ */ r.jsx(xe, { tenantCss: e.tenantCss, adminCss: e.adminCss })
1190
1190
  }
1191
1191
  ),
1192
- /* @__PURE__ */ r.jsx(L, { path: "*", element: /* @__PURE__ */ r.jsx(e.NotFoundComponent, {}) })
1192
+ /* @__PURE__ */ r.jsx(M, { path: "*", element: /* @__PURE__ */ r.jsx(e.NotFoundComponent, {}) })
1193
1193
  ] });
1194
1194
  }
1195
- function At({ config: e }) {
1196
- return /* @__PURE__ */ r.jsx(_e, { config: e, routesBuilder: Ct });
1195
+ function Dt({ config: e }) {
1196
+ return /* @__PURE__ */ r.jsx(ke, { config: e, routesBuilder: wt });
1197
1197
  }
1198
- function wt(e) {
1198
+ function Tt(e) {
1199
1199
  const n = {
1200
1200
  pageRegistry: e.pageRegistry,
1201
1201
  siteConfig: e.siteConfig,
@@ -1209,40 +1209,103 @@ function wt(e) {
1209
1209
  // empty string at the Core level for runtime; ignored by ThemeLoader in tenant mode
1210
1210
  NotFoundComponent: e.NotFoundComponent
1211
1211
  };
1212
- return /* @__PURE__ */ r.jsxs(L, { element: /* @__PURE__ */ r.jsx(Re, {}), children: [
1213
- /* @__PURE__ */ r.jsx(L, { path: "/", element: /* @__PURE__ */ r.jsx(te, { ...n }) }),
1214
- /* @__PURE__ */ r.jsx(L, { path: "/*", element: /* @__PURE__ */ r.jsx(te, { ...n }) }),
1215
- /* @__PURE__ */ r.jsx(L, { path: "*", element: /* @__PURE__ */ r.jsx(e.NotFoundComponent, {}) })
1212
+ return /* @__PURE__ */ r.jsxs(M, { element: /* @__PURE__ */ r.jsx(Re, {}), children: [
1213
+ /* @__PURE__ */ r.jsx(M, { path: "/", element: /* @__PURE__ */ r.jsx(re, { ...n }) }),
1214
+ /* @__PURE__ */ r.jsx(M, { path: "/*", element: /* @__PURE__ */ r.jsx(re, { ...n }) }),
1215
+ /* @__PURE__ */ r.jsx(M, { path: "*", element: /* @__PURE__ */ r.jsx(e.NotFoundComponent, {}) })
1216
1216
  ] });
1217
1217
  }
1218
- function It({ config: e }) {
1219
- return /* @__PURE__ */ r.jsx(_e, { config: e, routesBuilder: wt });
1218
+ function Lt({ config: e }) {
1219
+ return /* @__PURE__ */ r.jsx(ke, { config: e, routesBuilder: Tt });
1220
+ }
1221
+ const _t = { status: "idle", message: "" }, Rt = oe({});
1222
+ function Mt(e) {
1223
+ return ne(Rt)[e] ?? _t;
1220
1224
  }
1221
- const Tt = { status: "idle", message: "" }, Rt = ne({});
1222
- function Ot(e) {
1223
- return re(Rt)[e] ?? Tt;
1225
+ function kt(e, n) {
1226
+ return !!(e && n);
1227
+ }
1228
+ function Ft(e) {
1229
+ const n = e.apiUrl.trim(), o = e.apiKey.trim(), a = kt(n, o), s = a && e.save2RepoFlag, i = a;
1230
+ let l = "local";
1231
+ return a && (l = s ? "static" : "live"), {
1232
+ isCloudMode: a,
1233
+ bootSource: l,
1234
+ hotSaveEnabled: i,
1235
+ save2RepoEnabled: s,
1236
+ showLocalSave: !a,
1237
+ showHotSave: i,
1238
+ showColdSave: s,
1239
+ apiUrl: n,
1240
+ apiKey: o
1241
+ };
1242
+ }
1243
+ function te(e, n) {
1244
+ const o = e[n];
1245
+ return typeof o == "string" ? o.trim() : "";
1246
+ }
1247
+ function $t(e) {
1248
+ const n = te(e, "VITE_OLONJS_CLOUD_URL") || te(e, "VITE_JSONPAGES_CLOUD_URL"), o = te(e, "VITE_OLONJS_API_KEY") || te(e, "VITE_JSONPAGES_API_KEY"), a = e.VITE_SAVE2REPO === "true";
1249
+ return { apiUrl: n, apiKey: o, save2RepoFlag: a };
1250
+ }
1251
+ function Nt(e) {
1252
+ return e.trim().replace(/\/+$/, "");
1253
+ }
1254
+ function Ut(e) {
1255
+ const n = Nt(e);
1256
+ if (!n) return [];
1257
+ const o = /\/api\/v1$/i.test(n) ? n : `${n}/api/v1`;
1258
+ return Array.from(/* @__PURE__ */ new Set([o, n]));
1259
+ }
1260
+ function zt(e) {
1261
+ const { apiUrl: n, apiKey: o, fetchImpl: a = fetch, onSuccess: s } = e;
1262
+ return async (i, l) => {
1263
+ const v = n.trim(), x = o.trim();
1264
+ if (!v || !x)
1265
+ throw new Error("Cloud mode is not configured for hot save.");
1266
+ const y = v.replace(/\/+$/, ""), p = await a(`${y}/hotSave`, {
1267
+ method: "POST",
1268
+ headers: {
1269
+ "Content-Type": "application/json",
1270
+ Authorization: `Bearer ${x}`
1271
+ },
1272
+ body: JSON.stringify({
1273
+ slug: l,
1274
+ page: i.page,
1275
+ siteConfig: i.site,
1276
+ collections: i.collections
1277
+ })
1278
+ }), E = await p.json().catch(() => ({}));
1279
+ if (!p.ok)
1280
+ throw new Error(E.error || E.code || `Hot save failed: ${p.status}`);
1281
+ await (s == null ? void 0 : s({ state: i, slug: l, apiUrl: v, apiKey: x }));
1282
+ };
1224
1283
  }
1225
1284
  export {
1226
- ot as ConfigProvider,
1227
- nt as DefaultNotFound,
1228
- rt as EngineErrorBoundary,
1229
- Te as IconRegistryContext,
1230
- At as JsonPagesEngine,
1285
+ st as ConfigProvider,
1286
+ ot as DefaultNotFound,
1287
+ nt as EngineErrorBoundary,
1288
+ _e as IconRegistryContext,
1289
+ Dt as JsonPagesEngine,
1231
1290
  Rt as OlonFormsContext,
1232
- It as OlonJSEngine,
1233
- Pe as PageRenderer,
1234
- jt as PreviewEntry,
1291
+ Lt as OlonJSEngine,
1292
+ Ae as PageRenderer,
1293
+ Ct as PreviewEntry,
1235
1294
  xe as PreviewRoute,
1236
1295
  ee as SectionRenderer,
1237
- ue as StudioProvider,
1238
- Ee as StudioRoute,
1239
- pe as ThemeLoader,
1240
- te as VisitorRoute,
1241
- Lt as buildThemeVariableMap,
1242
- de as themeManager,
1243
- st as useConfig,
1244
- bt as useDocumentMeta,
1245
- Ot as useFormState,
1246
- Pt as useIconRegistry,
1247
- at as useStudio
1296
+ me as StudioProvider,
1297
+ Se as StudioRoute,
1298
+ fe as ThemeLoader,
1299
+ re as VisitorRoute,
1300
+ Ut as buildApiCandidates,
1301
+ Jt as buildThemeVariableMap,
1302
+ zt as createHotSaveHandler,
1303
+ $t as readCloudEnvFromVite,
1304
+ Ft as resolveCloudPolicy,
1305
+ ue as themeManager,
1306
+ at as useConfig,
1307
+ yt as useDocumentMeta,
1308
+ Mt as useFormState,
1309
+ It as useIconRegistry,
1310
+ it as useStudio
1248
1311
  };