sanity 3.74.2-corel.18 → 3.74.2-coreui.20
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/lib/_chunks-cjs/runtime.js +8 -4
- package/lib/_chunks-cjs/runtime.js.map +1 -1
- package/lib/_chunks-cjs/version.js +1 -1
- package/lib/_chunks-es/version.mjs +1 -1
- package/lib/_legacy/version.esm.js +1 -1
- package/package.json +10 -11
- package/src/_internal/cli/server/renderDocument.tsx +12 -0
- package/src/_internal/cli/server/runtime.ts +13 -10
- package/src/_internal/cli/server/vite/plugin-sanity-build-entries.ts +14 -12
- package/dist/BroadcastDisplayedDocument-BHYI8o6u.mjs +0 -19
- package/dist/BroadcastDisplayedDocument-BHYI8o6u.mjs.map +0 -1
- package/dist/DisplayedDocumentBroadcaster-DfHPxc7C.mjs +0 -58
- package/dist/DisplayedDocumentBroadcaster-DfHPxc7C.mjs.map +0 -1
- package/dist/LiveQueries-sYvgBCKh.mjs +0 -267
- package/dist/LiveQueries-sYvgBCKh.mjs.map +0 -1
- package/dist/LoaderQueries-AQneabiG.mjs +0 -581
- package/dist/LoaderQueries-AQneabiG.mjs.map +0 -1
- package/dist/Observable-wwWYwtkh.mjs +0 -551
- package/dist/Observable-wwWYwtkh.mjs.map +0 -1
- package/dist/PostMessageDocuments-DLMdHDk6.mjs +0 -75
- package/dist/PostMessageDocuments-DLMdHDk6.mjs.map +0 -1
- package/dist/PostMessageFeatures-CazMQz3f.mjs +0 -21
- package/dist/PostMessageFeatures-CazMQz3f.mjs.map +0 -1
- package/dist/PostMessagePerspective-m4uZ6sI5.mjs +0 -23
- package/dist/PostMessagePerspective-m4uZ6sI5.mjs.map +0 -1
- package/dist/PostMessagePreviewSnapshots-Dr7CEAiM.mjs +0 -66
- package/dist/PostMessagePreviewSnapshots-Dr7CEAiM.mjs.map +0 -1
- package/dist/PostMessageRefreshMutations-CWb9UqSy.mjs +0 -66
- package/dist/PostMessageRefreshMutations-CWb9UqSy.mjs.map +0 -1
- package/dist/PostMessageSchema-BVFyZOH1.mjs +0 -514
- package/dist/PostMessageSchema-BVFyZOH1.mjs.map +0 -1
- package/dist/PostMessageTelemetry-CSluBvcC.mjs +0 -51
- package/dist/PostMessageTelemetry-CSluBvcC.mjs.map +0 -1
- package/dist/PresentationToolGrantsCheck-4zo266wj.mjs +0 -3919
- package/dist/PresentationToolGrantsCheck-4zo266wj.mjs.map +0 -1
- package/dist/QRCodeSVG-D6VfGEbM.mjs +0 -648
- package/dist/QRCodeSVG-D6VfGEbM.mjs.map +0 -1
- package/dist/SourceContext-T8zcpOpp.mjs +0 -33
- package/dist/SourceContext-T8zcpOpp.mjs.map +0 -1
- package/dist/StructureToolProvider-BMLps71e.mjs +0 -13815
- package/dist/StructureToolProvider-BMLps71e.mjs.map +0 -1
- package/dist/Subject-DP0DoUP_.mjs +0 -108
- package/dist/Subject-DP0DoUP_.mjs.map +0 -1
- package/dist/ViteDevServerStopped-DdibXNvO.mjs +0 -44
- package/dist/ViteDevServerStopped-DdibXNvO.mjs.map +0 -1
- package/dist/_createContext.mjs +0 -36
- package/dist/_createContext.mjs.map +0 -1
- package/dist/_singletons.mjs +0 -195
- package/dist/_singletons.mjs.map +0 -1
- package/dist/browser-BzDH2pyp.mjs +0 -455
- package/dist/browser-BzDH2pyp.mjs.map +0 -1
- package/dist/browser-DWCoWoiH.mjs +0 -3988
- package/dist/browser-DWCoWoiH.mjs.map +0 -1
- package/dist/debounceTime-BeoKrERE.mjs +0 -130
- package/dist/debounceTime-BeoKrERE.mjs.map +0 -1
- package/dist/desk.mjs +0 -52
- package/dist/desk.mjs.map +0 -1
- package/dist/first-Di4GZDIY.mjs +0 -42
- package/dist/first-Di4GZDIY.mjs.map +0 -1
- package/dist/get-psIoeD-z.mjs +0 -327
- package/dist/get-psIoeD-z.mjs.map +0 -1
- package/dist/hooks-4sgcd521.mjs +0 -90
- package/dist/hooks-4sgcd521.mjs.map +0 -1
- package/dist/index-9PJcXUTv.mjs +0 -87
- package/dist/index-9PJcXUTv.mjs.map +0 -1
- package/dist/index-ByFK-IwD.mjs +0 -528
- package/dist/index-ByFK-IwD.mjs.map +0 -1
- package/dist/index-C2OAo3To.mjs +0 -7079
- package/dist/index-C2OAo3To.mjs.map +0 -1
- package/dist/index-C3OvVLVP.mjs +0 -4636
- package/dist/index-C3OvVLVP.mjs.map +0 -1
- package/dist/index-DBPVDKJN.mjs +0 -1198
- package/dist/index-DBPVDKJN.mjs.map +0 -1
- package/dist/index-DkvUNBNf.mjs +0 -73
- package/dist/index-DkvUNBNf.mjs.map +0 -1
- package/dist/index-Sp9w8lMg.mjs +0 -118
- package/dist/index-Sp9w8lMg.mjs.map +0 -1
- package/dist/index.browser-BxT2qp9y.mjs +0 -104
- package/dist/index.browser-BxT2qp9y.mjs.map +0 -1
- package/dist/index.mjs +0 -129019
- package/dist/index.mjs.map +0 -1
- package/dist/isObservable-ByOheaM8.mjs +0 -8
- package/dist/isObservable-ByOheaM8.mjs.map +0 -1
- package/dist/never-ChKjLemk.mjs +0 -6
- package/dist/never-ChKjLemk.mjs.map +0 -1
- package/dist/pane-C4tskUPg.mjs +0 -5
- package/dist/pane-C4tskUPg.mjs.map +0 -1
- package/dist/pane-Dhx8FvsK.mjs +0 -5
- package/dist/pane-Dhx8FvsK.mjs.map +0 -1
- package/dist/presentation-CSS9GR9X.mjs +0 -984
- package/dist/presentation-CSS9GR9X.mjs.map +0 -1
- package/dist/presentation.mjs +0 -14
- package/dist/presentation.mjs.map +0 -1
- package/dist/resources-4cbq8YlR.mjs +0 -124
- package/dist/resources-4cbq8YlR.mjs.map +0 -1
- package/dist/resources-BVETz6Ur.mjs +0 -57
- package/dist/resources-BVETz6Ur.mjs.map +0 -1
- package/dist/resources-D4AaU75F.mjs +0 -434
- package/dist/resources-D4AaU75F.mjs.map +0 -1
- package/dist/resources-Dc-6ZcPg.mjs +0 -157
- package/dist/resources-Dc-6ZcPg.mjs.map +0 -1
- package/dist/resources-DgU0prBM.mjs +0 -179
- package/dist/resources-DgU0prBM.mjs.map +0 -1
- package/dist/resources-MD8RsYhH.mjs +0 -288
- package/dist/resources-MD8RsYhH.mjs.map +0 -1
- package/dist/router.mjs +0 -689
- package/dist/router.mjs.map +0 -1
- package/dist/share-bcOpIdQz.mjs +0 -71
- package/dist/share-bcOpIdQz.mjs.map +0 -1
- package/dist/shareReplay-Dj1O6fKV.mjs +0 -43
- package/dist/shareReplay-Dj1O6fKV.mjs.map +0 -1
- package/dist/stegaEncodeSourceMap-DXdUZQye.mjs +0 -342
- package/dist/stegaEncodeSourceMap-DXdUZQye.mjs.map +0 -1
- package/dist/structure.mjs +0 -56
- package/dist/structure.mjs.map +0 -1
- package/dist/takeUntil-CgZP1bze.mjs +0 -111
- package/dist/takeUntil-CgZP1bze.mjs.map +0 -1
- package/dist/v4-C78sE4Gb.mjs +0 -27082
- package/dist/v4-C78sE4Gb.mjs.map +0 -1
- package/dist/version-D7UZEoYI.mjs +0 -5
- package/dist/version-D7UZEoYI.mjs.map +0 -1
@@ -1,3919 +0,0 @@
|
|
1
|
-
import { jsx as u, jsxs as q, Fragment as Pe } from "react/jsx-runtime";
|
2
|
-
import { p as ar, o as Ot, b as Pn, c as W, d as xe, A as ct, e as Mt, f as Sn, g as rn, h as _n, m as or, s as zt, r as sr, i as cr, D as lr, j as dr, k as ur, l as pr, n as an, C as mr, E as fr, P as xn, S as hr, q as gr, t as yr, v as vr, w as wr } from "./presentation-CSS9GR9X.mjs";
|
3
|
-
import { l as br, n as Pr, O as on, P as Sr, Q as _r, e as Ct, v as En, F as ae, R as nt, m as Ye, B as me, f as rt, T as X, U as Tn, V as xr, X as ke, Y as Er, Z as Tr, _ as Cr, $ as qe, a0 as Cn, S as De, C as ce, a1 as Rn, a2 as Rr, a3 as Ir, a4 as $r, a5 as Ar, a6 as kr, a7 as it, a8 as Or, a as Mr, u as In, a9 as zr, W as Lr, aa as Ur, ab as Wr, ac as Nr, ad as Dr, D as jr, ae as $n, af as qr, ag as Fr, ah as Vr } from "./v4-C78sE4Gb.mjs";
|
4
|
-
import { useContext as Lt, useMemo as he, createContext as Kr, forwardRef as lt, memo as Ut, useId as Hr, lazy as Ee, useState as z, useCallback as re, useEffect as V, Suspense as Wt, useRef as le, useImperativeHandle as Gr, useSyncExternalStore as Br, useReducer as Qr, useLayoutEffect as Qe, createElement as An, startTransition as Xr } from "react";
|
5
|
-
import { useTranslation as Te, useClient as dt, useCurrentUser as Nt, useGrantsStore as Jr, useUnique as kn, usePerspective as Yr, useProjectId as Zr, useDataset as ei, useWorkspace as ti, getPublishedId as ut, useActiveWorkspace as On, useSchema as ni, getPreviewValueWithFallback as ri, SanityDefaultPreview as ii, PreviewCard as ai, Translate as oi, CommentsIntentProvider as si, useDocumentPreviewStore as ci, getPreviewStateObservable as li } from "sanity";
|
6
|
-
import { f as Mn, s as zn, a as gt, b as Rt, e as Ze, d as di, r as He, g as ui, h as Ae, i as pi, j as mi, S as fi, v as hi } from "./index-C3OvVLVP.mjs";
|
7
|
-
import { b as yt, a as gi, p as vt } from "./Observable-wwWYwtkh.mjs";
|
8
|
-
import { f as Ln, a as Dt, c as yi, d as It, b as vi, t as wi, e as bi } from "./takeUntil-CgZP1bze.mjs";
|
9
|
-
import { StateLink as pt, useRouter as jt, decodeJsonParams as Pi } from "sanity/router";
|
10
|
-
import { styled as ge } from "styled-components";
|
11
|
-
import { PaneLayout as Un, DocumentListPane as Si, StructureToolProvider as Wn, PaneRouterContext as _i, DocumentPane as xi } from "sanity/structure";
|
12
|
-
import { i as Ei, D as Ti } from "./DisplayedDocumentBroadcaster-DfHPxc7C.mjs";
|
13
|
-
import { flushSync as Ci } from "react-dom";
|
14
|
-
function Ri(t, e) {
|
15
|
-
return e === void 0 && (e = null), e = e ?? t, br(function(n, i) {
|
16
|
-
var r = [], a = 0;
|
17
|
-
n.subscribe(Pr(i, function(o) {
|
18
|
-
var s, c, l, p, d = null;
|
19
|
-
a++ % e === 0 && r.push([]);
|
20
|
-
try {
|
21
|
-
for (var m = yt(r), f = m.next(); !f.done; f = m.next()) {
|
22
|
-
var g = f.value;
|
23
|
-
g.push(o), t <= g.length && (d = d ?? [], d.push(g));
|
24
|
-
}
|
25
|
-
} catch (w) {
|
26
|
-
s = { error: w };
|
27
|
-
} finally {
|
28
|
-
try {
|
29
|
-
f && !f.done && (c = m.return) && c.call(m);
|
30
|
-
} finally {
|
31
|
-
if (s) throw s.error;
|
32
|
-
}
|
33
|
-
}
|
34
|
-
if (d)
|
35
|
-
try {
|
36
|
-
for (var y = yt(d), h = y.next(); !h.done; h = y.next()) {
|
37
|
-
var g = h.value;
|
38
|
-
gi(r, g), i.next(g);
|
39
|
-
}
|
40
|
-
} catch (w) {
|
41
|
-
l = { error: w };
|
42
|
-
} finally {
|
43
|
-
try {
|
44
|
-
h && !h.done && (p = y.return) && p.call(y);
|
45
|
-
} finally {
|
46
|
-
if (l) throw l.error;
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}, function() {
|
50
|
-
var o, s;
|
51
|
-
try {
|
52
|
-
for (var c = yt(r), l = c.next(); !l.done; l = c.next()) {
|
53
|
-
var p = l.value;
|
54
|
-
i.next(p);
|
55
|
-
}
|
56
|
-
} catch (d) {
|
57
|
-
o = { error: d };
|
58
|
-
} finally {
|
59
|
-
try {
|
60
|
-
l && !l.done && (s = c.return) && s.call(c);
|
61
|
-
} finally {
|
62
|
-
if (o) throw o.error;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
i.complete();
|
66
|
-
}, void 0, function() {
|
67
|
-
r = null;
|
68
|
-
}));
|
69
|
-
});
|
70
|
-
}
|
71
|
-
function Ii({ children: t, isValidProp: e, ...n }) {
|
72
|
-
e && _r(e), n = { ...Lt(on), ...n }, n.isStatic = Sr(() => n.isStatic);
|
73
|
-
const i = he(() => n, [
|
74
|
-
JSON.stringify(n.transition),
|
75
|
-
n.transformPagePoint,
|
76
|
-
n.reducedMotion
|
77
|
-
]);
|
78
|
-
return u(on.Provider, { value: i, children: t });
|
79
|
-
}
|
80
|
-
const qt = "sanity.previewUrlSecret", $i = "sanity-preview-url-secret", We = `${$i}.share-access`, Fe = "sanity.previewUrlShareAccess", Ft = "2023-11-09", Vt = "sanity-preview-secret", Kt = "sanity-preview-pathname", Ht = "sanity-preview-perspective", Nn = 60 * 60, Ai = (
|
81
|
-
/* groq */
|
82
|
-
`*[_id == "${We}" && _type == "${Fe}"][0].secret`
|
83
|
-
), ki = (
|
84
|
-
/* groq */
|
85
|
-
`*[_type == "${qt}" && dateTime(_updatedAt) <= dateTime(now()) - ${Nn}]`
|
86
|
-
), Gt = "sanity.preview-url-secret", te = [];
|
87
|
-
for (let t = 0; t < 256; ++t)
|
88
|
-
te.push((t + 256).toString(16).slice(1));
|
89
|
-
function Oi(t, e = 0) {
|
90
|
-
return (te[t[e + 0]] + te[t[e + 1]] + te[t[e + 2]] + te[t[e + 3]] + "-" + te[t[e + 4]] + te[t[e + 5]] + "-" + te[t[e + 6]] + te[t[e + 7]] + "-" + te[t[e + 8]] + te[t[e + 9]] + "-" + te[t[e + 10]] + te[t[e + 11]] + te[t[e + 12]] + te[t[e + 13]] + te[t[e + 14]] + te[t[e + 15]]).toLowerCase();
|
91
|
-
}
|
92
|
-
let wt;
|
93
|
-
const Mi = new Uint8Array(16);
|
94
|
-
function zi() {
|
95
|
-
if (!wt) {
|
96
|
-
if (typeof crypto > "u" || !crypto.getRandomValues)
|
97
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
98
|
-
wt = crypto.getRandomValues.bind(crypto);
|
99
|
-
}
|
100
|
-
return wt(Mi);
|
101
|
-
}
|
102
|
-
const Li = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), sn = { randomUUID: Li };
|
103
|
-
function Xe(t, e, n) {
|
104
|
-
var r;
|
105
|
-
if (sn.randomUUID && !t)
|
106
|
-
return sn.randomUUID();
|
107
|
-
t = t || {};
|
108
|
-
const i = t.random ?? ((r = t.rng) == null ? void 0 : r.call(t)) ?? zi();
|
109
|
-
if (i.length < 16)
|
110
|
-
throw new Error("Random bytes length must be >= 16");
|
111
|
-
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Oi(i);
|
112
|
-
}
|
113
|
-
const cn = (t) => ({
|
114
|
-
context: e
|
115
|
-
}) => {
|
116
|
-
const { count: n, include: i, exclude: r, responseType: a = "message.received" } = t;
|
117
|
-
return {
|
118
|
-
count: n,
|
119
|
-
domain: e.domain,
|
120
|
-
from: e.connectTo,
|
121
|
-
include: i ? Array.isArray(i) ? i : [i] : [],
|
122
|
-
exclude: r ? Array.isArray(r) ? r : [r] : [],
|
123
|
-
responseType: a,
|
124
|
-
target: e.target,
|
125
|
-
to: e.name
|
126
|
-
};
|
127
|
-
}, Ui = (t) => (e) => {
|
128
|
-
const { data: n } = e;
|
129
|
-
return (t.include.length ? t.include.includes(n.type) : !0) && (t.exclude.length ? !t.exclude.includes(n.type) : !0) && n.domain === t.domain && n.from === t.from && n.to === t.to && (!t.target || e.source === t.target);
|
130
|
-
}, Wi = (t) => (e) => ({
|
131
|
-
type: t,
|
132
|
-
message: e
|
133
|
-
}), Ni = bi(
|
134
|
-
() => It(window, "message")
|
135
|
-
), Dn = (t) => Mn(({ input: e }) => Ni.pipe(
|
136
|
-
t ? Ct(t) : vt(),
|
137
|
-
Ln(Ui(e)),
|
138
|
-
Ct(Wi(e.responseType)),
|
139
|
-
e.count ? vt(
|
140
|
-
Ri(e.count),
|
141
|
-
yi((n) => n),
|
142
|
-
Dt(e.count)
|
143
|
-
) : vt()
|
144
|
-
)), Bt = "sanity/comlink", Di = 3e3, ji = 500, Je = "comlink/response", at = "comlink/heartbeat", Qt = "comlink/disconnect", Xt = "comlink/handshake/syn", Jt = "comlink/handshake/syn-ack", Yt = "comlink/handshake/ack", qi = (t) => (e) => e.pipe(
|
145
|
-
Dt(1),
|
146
|
-
Ct(() => {
|
147
|
-
throw new Error(t);
|
148
|
-
})
|
149
|
-
), jn = () => zn({
|
150
|
-
types: {},
|
151
|
-
actors: {
|
152
|
-
listen: Mn(
|
153
|
-
({
|
154
|
-
input: t
|
155
|
-
}) => {
|
156
|
-
const e = t.signal ? It(t.signal, "abort").pipe(
|
157
|
-
qi(`Request ${t.requestId} aborted`)
|
158
|
-
) : vi, n = (i) => {
|
159
|
-
var r, a;
|
160
|
-
return ((r = i.data) == null ? void 0 : r.type) === Je && ((a = i.data) == null ? void 0 : a.responseTo) === t.requestId && !!i.source && t.sources.has(i.source);
|
161
|
-
};
|
162
|
-
return It(window, "message").pipe(
|
163
|
-
Ln(n),
|
164
|
-
Dt(t.sources.size),
|
165
|
-
wi(e)
|
166
|
-
);
|
167
|
-
}
|
168
|
-
)
|
169
|
-
},
|
170
|
-
actions: {
|
171
|
-
"send message": ({ context: t }, e) => {
|
172
|
-
const { sources: n, targetOrigin: i } = t, { message: r } = e;
|
173
|
-
n.forEach((a) => {
|
174
|
-
a.postMessage(r, { targetOrigin: i });
|
175
|
-
});
|
176
|
-
},
|
177
|
-
"on success": gt(
|
178
|
-
({ context: t }) => t.parentRef,
|
179
|
-
({ context: t, self: e }) => {
|
180
|
-
var n;
|
181
|
-
return t.response && ((n = t.resolvable) == null || n.resolve(t.response)), {
|
182
|
-
type: "request.success",
|
183
|
-
requestId: e.id,
|
184
|
-
response: t.response,
|
185
|
-
responseTo: t.responseTo
|
186
|
-
};
|
187
|
-
}
|
188
|
-
),
|
189
|
-
"on fail": gt(
|
190
|
-
({ context: t }) => t.parentRef,
|
191
|
-
({ context: t, self: e }) => {
|
192
|
-
var n;
|
193
|
-
return t.suppressWarnings || console.warn(
|
194
|
-
`[@sanity/comlink] Received no response to message '${t.type}' on client '${t.from}' (ID: '${t.id}').`
|
195
|
-
), (n = t.resolvable) == null || n.reject(new Error("No response received")), { type: "request.failed", requestId: e.id };
|
196
|
-
}
|
197
|
-
),
|
198
|
-
"on abort": gt(
|
199
|
-
({ context: t }) => t.parentRef,
|
200
|
-
({ context: t, self: e }) => {
|
201
|
-
var n;
|
202
|
-
return (n = t.resolvable) == null || n.reject(new Error("Request aborted")), { type: "request.aborted", requestId: e.id };
|
203
|
-
}
|
204
|
-
)
|
205
|
-
},
|
206
|
-
guards: {
|
207
|
-
expectsResponse: ({ context: t }) => t.expectResponse
|
208
|
-
},
|
209
|
-
delays: {
|
210
|
-
initialTimeout: 0,
|
211
|
-
responseTimeout: ({ context: t }) => t.responseTimeout ?? Di
|
212
|
-
}
|
213
|
-
}).createMachine({
|
214
|
-
/** @xstate-layout N4IgpgJg5mDOIC5QAoC2BDAxgCwJYDswBKAOlwgBswBiAD1gBd0GwT0AzFgJ2QNwdzoKAFVyowAewCuDItTRY8hUuSoBtAAwBdRKAAOE2P1wT8ukLUQBGAEwBWEgBYAnK+eOAzB7sB2DzY8rABoQAE9rDQc3V0cNTw8fAA4NHwBfVJCFHAJiElgwfAgCKGpNHSQQAyMBU3NLBDsrDxI7DTaAjQA2OOcNDxDwhHsNJx9Ou0TOq2cJxP9HdMyMbOU8gqL8ErUrcv1DY1qK+sbm1vaPLp6+gcRnGydo9wDGycWQLKVc9AB3dGNN6jiWCwdAwMrmKoHMxHRCJRKOEiJHwuZKBZwXKzBMKIGyYkhtAkXOweTqOHw2RJvD45Ug-P4CAH0JgsNicMA8LhwAz4fKicTSWTyZafWm-f5QcEVSE1aGgepwhFIlF9aYYrGDC4+JzEppjGzOUkeGbpDIgfASCBwczU5QQ-YyuqIAC0nRuCBd+IJXu9KSpwppZEoYDt1RMsosiEcNjdVjiJEeGisiSTHkcVgWpptuXyhWKIahjqGzi1BqRJINnVcdkcbuTLS9VYC8ISfsUAbp4vzDphCHJIyjBvJNlxNmRNexQ3sJGH43GPj8jWJrZWuXYfyoEC7YcLsbrgRsjkcvkmdgNbopVhIPhVfnsh8ClMz-tWsCkmEwcHgUvt257u8v+6Hse4xnhOdZnImVidPqCRNB4JqpEAA */
|
215
|
-
context: ({ input: t }) => ({
|
216
|
-
channelId: t.channelId,
|
217
|
-
data: t.data,
|
218
|
-
domain: t.domain,
|
219
|
-
expectResponse: t.expectResponse ?? !1,
|
220
|
-
from: t.from,
|
221
|
-
id: `msg-${Xe()}`,
|
222
|
-
parentRef: t.parentRef,
|
223
|
-
resolvable: t.resolvable,
|
224
|
-
response: null,
|
225
|
-
responseTimeout: t.responseTimeout,
|
226
|
-
responseTo: t.responseTo,
|
227
|
-
signal: t.signal,
|
228
|
-
sources: t.sources instanceof Set ? t.sources : /* @__PURE__ */ new Set([t.sources]),
|
229
|
-
suppressWarnings: t.suppressWarnings,
|
230
|
-
targetOrigin: t.targetOrigin,
|
231
|
-
to: t.to,
|
232
|
-
type: t.type
|
233
|
-
}),
|
234
|
-
initial: "idle",
|
235
|
-
on: {
|
236
|
-
abort: ".aborted"
|
237
|
-
},
|
238
|
-
states: {
|
239
|
-
idle: {
|
240
|
-
after: {
|
241
|
-
initialTimeout: [
|
242
|
-
{
|
243
|
-
target: "sending"
|
244
|
-
}
|
245
|
-
]
|
246
|
-
}
|
247
|
-
},
|
248
|
-
sending: {
|
249
|
-
entry: {
|
250
|
-
type: "send message",
|
251
|
-
params: ({ context: t }) => {
|
252
|
-
const { channelId: e, data: n, domain: i, from: r, id: a, responseTo: o, to: s, type: c } = t;
|
253
|
-
return { message: {
|
254
|
-
channelId: e,
|
255
|
-
data: n,
|
256
|
-
domain: i,
|
257
|
-
from: r,
|
258
|
-
id: a,
|
259
|
-
to: s,
|
260
|
-
type: c,
|
261
|
-
responseTo: o
|
262
|
-
} };
|
263
|
-
}
|
264
|
-
},
|
265
|
-
always: [
|
266
|
-
{
|
267
|
-
guard: "expectsResponse",
|
268
|
-
target: "awaiting"
|
269
|
-
},
|
270
|
-
"success"
|
271
|
-
]
|
272
|
-
},
|
273
|
-
awaiting: {
|
274
|
-
invoke: {
|
275
|
-
id: "listen for response",
|
276
|
-
src: "listen",
|
277
|
-
input: ({ context: t }) => ({
|
278
|
-
requestId: t.id,
|
279
|
-
sources: t.sources,
|
280
|
-
signal: t.signal
|
281
|
-
}),
|
282
|
-
onError: "aborted"
|
283
|
-
},
|
284
|
-
after: {
|
285
|
-
responseTimeout: "failed"
|
286
|
-
},
|
287
|
-
on: {
|
288
|
-
message: {
|
289
|
-
actions: Rt({
|
290
|
-
response: ({ event: t }) => t.data.data,
|
291
|
-
responseTo: ({ event: t }) => t.data.responseTo
|
292
|
-
}),
|
293
|
-
target: "success"
|
294
|
-
}
|
295
|
-
}
|
296
|
-
},
|
297
|
-
failed: {
|
298
|
-
type: "final",
|
299
|
-
entry: "on fail"
|
300
|
-
},
|
301
|
-
success: {
|
302
|
-
type: "final",
|
303
|
-
entry: "on success"
|
304
|
-
},
|
305
|
-
aborted: {
|
306
|
-
type: "final",
|
307
|
-
entry: "on abort"
|
308
|
-
}
|
309
|
-
},
|
310
|
-
output: ({ context: t, self: e }) => ({
|
311
|
-
requestId: e.id,
|
312
|
-
response: t.response,
|
313
|
-
responseTo: t.responseTo
|
314
|
-
})
|
315
|
-
}), Fi = ui(({ sendBack: t, input: e }) => {
|
316
|
-
const n = () => {
|
317
|
-
t(e.event);
|
318
|
-
};
|
319
|
-
e.immediate && n();
|
320
|
-
const i = setInterval(n, e.interval);
|
321
|
-
return () => {
|
322
|
-
clearInterval(i);
|
323
|
-
};
|
324
|
-
}), ot = () => zn({
|
325
|
-
types: {},
|
326
|
-
actors: {
|
327
|
-
requestMachine: jn(),
|
328
|
-
listen: Dn(),
|
329
|
-
sendBackAtInterval: Fi
|
330
|
-
},
|
331
|
-
actions: {
|
332
|
-
"buffer message": Ze(({ enqueue: t }) => {
|
333
|
-
t.assign({
|
334
|
-
buffer: ({ event: e, context: n }) => (Ae(e, "post"), [...n.buffer, e.data])
|
335
|
-
}), t.emit(({ event: e }) => (Ae(e, "post"), {
|
336
|
-
type: "_buffer.added",
|
337
|
-
message: e.data
|
338
|
-
}));
|
339
|
-
}),
|
340
|
-
"create request": Rt({
|
341
|
-
requests: ({ context: t, event: e, self: n, spawn: i }) => {
|
342
|
-
Ae(e, "request");
|
343
|
-
const r = (Array.isArray(e.data) ? e.data : [e.data]).map((a) => {
|
344
|
-
const o = `req-${Xe()}`;
|
345
|
-
return i("requestMachine", {
|
346
|
-
id: o,
|
347
|
-
input: {
|
348
|
-
channelId: t.channelId,
|
349
|
-
data: a.data,
|
350
|
-
domain: t.domain,
|
351
|
-
expectResponse: a.expectResponse,
|
352
|
-
from: t.name,
|
353
|
-
parentRef: n,
|
354
|
-
responseTo: a.responseTo,
|
355
|
-
sources: t.target,
|
356
|
-
targetOrigin: t.targetOrigin,
|
357
|
-
to: t.connectTo,
|
358
|
-
type: a.type
|
359
|
-
}
|
360
|
-
});
|
361
|
-
});
|
362
|
-
return [...t.requests, ...r];
|
363
|
-
}
|
364
|
-
}),
|
365
|
-
"emit received message": Ze(({ enqueue: t }) => {
|
366
|
-
t.emit(({ event: e }) => (Ae(e, "message.received"), {
|
367
|
-
type: "_message",
|
368
|
-
message: e.message.data
|
369
|
-
})), t.emit(({ event: e }) => (Ae(e, "message.received"), {
|
370
|
-
type: e.message.data.type,
|
371
|
-
message: e.message.data
|
372
|
-
}));
|
373
|
-
}),
|
374
|
-
"emit status": di((t, e) => ({
|
375
|
-
type: "_status",
|
376
|
-
status: e.status
|
377
|
-
})),
|
378
|
-
"flush buffer": Ze(({ enqueue: t }) => {
|
379
|
-
t.raise(({ context: e }) => ({
|
380
|
-
type: "request",
|
381
|
-
data: e.buffer.map(({ data: n, type: i }) => ({ data: n, type: i }))
|
382
|
-
})), t.emit(({ context: e }) => ({
|
383
|
-
type: "_buffer.flushed",
|
384
|
-
messages: e.buffer
|
385
|
-
})), t.assign({
|
386
|
-
buffer: []
|
387
|
-
});
|
388
|
-
}),
|
389
|
-
post: He(({ event: t }) => (Ae(t, "post"), {
|
390
|
-
type: "request",
|
391
|
-
data: {
|
392
|
-
data: t.data.data,
|
393
|
-
expectResponse: !0,
|
394
|
-
type: t.data.type
|
395
|
-
}
|
396
|
-
})),
|
397
|
-
"remove request": Ze(({ context: t, enqueue: e, event: n }) => {
|
398
|
-
Ae(n, ["request.success", "request.failed", "request.aborted"]), pi(n.requestId), e.assign({ requests: t.requests.filter(({ id: i }) => i !== n.requestId) });
|
399
|
-
}),
|
400
|
-
respond: He(({ event: t }) => (Ae(t, "response"), {
|
401
|
-
type: "request",
|
402
|
-
data: {
|
403
|
-
data: t.data,
|
404
|
-
type: Je,
|
405
|
-
responseTo: t.respondTo
|
406
|
-
}
|
407
|
-
})),
|
408
|
-
"send handshake ack": He({
|
409
|
-
type: "request",
|
410
|
-
data: { type: Yt }
|
411
|
-
}),
|
412
|
-
"send disconnect": He(() => ({
|
413
|
-
type: "request",
|
414
|
-
data: { type: Qt }
|
415
|
-
})),
|
416
|
-
"send handshake syn": He({
|
417
|
-
type: "request",
|
418
|
-
data: { type: Xt }
|
419
|
-
}),
|
420
|
-
"set target": Rt({
|
421
|
-
target: ({ event: t }) => (Ae(t, "target.set"), t.target)
|
422
|
-
})
|
423
|
-
},
|
424
|
-
guards: {
|
425
|
-
"has target": ({ context: t }) => !!t.target,
|
426
|
-
"should send heartbeats": ({ context: t }) => t.heartbeat
|
427
|
-
}
|
428
|
-
}).createMachine({
|
429
|
-
/** @xstate-layout N4IgpgJg5mDOIC5QGMAWBDAdpsAbAxAC7oBOMhAdLGIQNoAMAuoqAA4D2sAloV+5ixAAPRAHZRAJgoAWABz0ArHICMy2QGZZCgJwAaEAE9EE+tIrb6ANgkLl46fTuj1AXxf60WHARJgAjgCucJSwAcjIcLAMzEggHNy8-IIiCKLS2hQS6qb2yurisrL6RgjK9LIyCuqq0g7WstZuHhjYePi+gcEUAGboXLiQ0YLxPHwCsSmiCgoykpayDtqS6trqxYjKEk0gnq24FFwQA-jI-DjIdEzDnKNJExuOZpZ12eq29OrSCuupypYUojUaTKCnm5Wk2123gORzA+HilxibBuiXGoBSGnUAIU4gU9FWamUtR+lmUM1EllBEkslMUEnpkJa0JaEFgGAA1lxMFB8LADJghrERqjkhtshk3mTtNo5OpqpYfqCKhTptoqpY1WUtu4dky8BQWWz0Jzue1-EFYIjrgkxqLSupqRRPpoPqJtLI0hIioZENJJE7NnJ8ZYHVk1YyvPrDRyuTyEYLkTa7uixVlMh81KGFhS1j6EPkZlpVjTphr8mkI3sDVhWTHTQBbSLoGAUXwRLgAN0GVyFKNt91KimUFEKXvKC2s9R+6X+jipnzJeSqEJ1UKjNaNJp5EC4sFOrQuCbifeTwg2cgoym0RPxDtqkj0eaB9Ao8zSolMEivZVcq71+33c5CEgeFOCtXskzRM8EDxKRpmkSw3QJbQsmpH5tHmV8JHSbJpDsakV2aSMALOMALhAjoLXAxNbiglI-SxWw1Vw0QNDw0Qfg9KQ7EJSxHHxApK2hQCyOAiAzVgDhMGoI9hX7FMEHSF8cWkelpHURCbBsb481xAEgT9BQJCmWQsiE-URPI8TG1gWBmzAVsyLATtuyRY9ILtWoKmlL82Kqd0tAVJ91LMHFZDKIkVlkNVZHMkiDzE-Adz3UjDx7GiRQHCKnheD53k+HSSkDDIwpBVTqQwuKKEssSDTAUhCAAI3qyg0DIrd8Fkk86MQUMnVM+RynoegTDJH48hGp0vR-FDRqqKqasgOqGua9AQjATAd1NSiul6fpXOtWi7Wy19cslD4vnG7IX3oVjVDUVYEJQqrksW8SdstLqPKy0wKgG1RhtMWogqKhoMjkWp6XxUyFBe3c3tAz70vco6fq+V8PTkGUFzdQqNnELEM2yClrwwzQ4ZShKQJqr7UYU98AS0W9pT4z5pHG0yXwMkNNTyGk3B1TB2AgOBBDXXBDsyhSFG9EovQqN5i1JeRcKqw4Bkl+ToMx8x0j+EaqQ9XMSkBURMgMkEwQWKro2NWNNdPFJAzN0lJGM4slDxhBEJfXyplBd03wW1KxIdnrBxBh4JAyW75C8rJpmDqmIGWkgmpasPjqUcaHooMLHA0uU1UkJOgKW1B6rT1bWor5At0zgcTAkK7hrz1irB0D8cW0UvRPLyv07WqgNq2qAG+l9SnXUz0UOXD5xuMs3Y4+DVJBX7UiKrV6Q8gcfoJO54rFefLLqfJYX1WKYNLxL4NO1NwgA */
|
430
|
-
id: "connection",
|
431
|
-
context: ({ input: t }) => ({
|
432
|
-
id: t.id || `${t.name}-${Xe()}`,
|
433
|
-
buffer: [],
|
434
|
-
channelId: `chn-${Xe()}`,
|
435
|
-
connectTo: t.connectTo,
|
436
|
-
domain: t.domain ?? Bt,
|
437
|
-
heartbeat: t.heartbeat ?? !1,
|
438
|
-
name: t.name,
|
439
|
-
requests: [],
|
440
|
-
target: t.target,
|
441
|
-
targetOrigin: t.targetOrigin
|
442
|
-
}),
|
443
|
-
on: {
|
444
|
-
"target.set": {
|
445
|
-
actions: "set target"
|
446
|
-
},
|
447
|
-
"request.success": {
|
448
|
-
actions: "remove request"
|
449
|
-
},
|
450
|
-
"request.failed": {
|
451
|
-
actions: "remove request"
|
452
|
-
}
|
453
|
-
},
|
454
|
-
initial: "idle",
|
455
|
-
states: {
|
456
|
-
idle: {
|
457
|
-
entry: [{ type: "emit status", params: { status: "idle" } }],
|
458
|
-
on: {
|
459
|
-
connect: {
|
460
|
-
target: "handshaking",
|
461
|
-
guard: "has target"
|
462
|
-
},
|
463
|
-
post: {
|
464
|
-
actions: "buffer message"
|
465
|
-
}
|
466
|
-
}
|
467
|
-
},
|
468
|
-
handshaking: {
|
469
|
-
id: "handshaking",
|
470
|
-
entry: [{ type: "emit status", params: { status: "handshaking" } }],
|
471
|
-
invoke: [
|
472
|
-
{
|
473
|
-
id: "send syn",
|
474
|
-
src: "sendBackAtInterval",
|
475
|
-
input: () => ({
|
476
|
-
event: { type: "syn" },
|
477
|
-
interval: ji,
|
478
|
-
immediate: !0
|
479
|
-
})
|
480
|
-
},
|
481
|
-
{
|
482
|
-
id: "listen for handshake",
|
483
|
-
src: "listen",
|
484
|
-
input: (t) => cn({
|
485
|
-
include: Jt,
|
486
|
-
count: 1
|
487
|
-
})(t)
|
488
|
-
/* Below would maybe be more readable than transitioning to
|
489
|
-
'connected' on 'message', and 'ack' on exit but having onDone when
|
490
|
-
using passing invocations currently breaks XState Editor */
|
491
|
-
// onDone: {
|
492
|
-
// target: 'connected',
|
493
|
-
// actions: 'ack',
|
494
|
-
// },
|
495
|
-
}
|
496
|
-
],
|
497
|
-
on: {
|
498
|
-
syn: {
|
499
|
-
actions: "send handshake syn"
|
500
|
-
},
|
501
|
-
request: {
|
502
|
-
actions: "create request"
|
503
|
-
},
|
504
|
-
post: {
|
505
|
-
actions: "buffer message"
|
506
|
-
},
|
507
|
-
"message.received": {
|
508
|
-
target: "connected"
|
509
|
-
},
|
510
|
-
disconnect: {
|
511
|
-
target: "disconnected"
|
512
|
-
}
|
513
|
-
},
|
514
|
-
exit: "send handshake ack"
|
515
|
-
},
|
516
|
-
connected: {
|
517
|
-
entry: ["flush buffer", { type: "emit status", params: { status: "connected" } }],
|
518
|
-
invoke: {
|
519
|
-
id: "listen for messages",
|
520
|
-
src: "listen",
|
521
|
-
input: cn({
|
522
|
-
exclude: [Je, at]
|
523
|
-
})
|
524
|
-
},
|
525
|
-
on: {
|
526
|
-
post: {
|
527
|
-
actions: "post"
|
528
|
-
},
|
529
|
-
request: {
|
530
|
-
actions: "create request"
|
531
|
-
},
|
532
|
-
response: {
|
533
|
-
actions: "respond"
|
534
|
-
},
|
535
|
-
"message.received": {
|
536
|
-
actions: "emit received message"
|
537
|
-
},
|
538
|
-
disconnect: {
|
539
|
-
target: "disconnected"
|
540
|
-
}
|
541
|
-
},
|
542
|
-
initial: "heartbeat",
|
543
|
-
states: {
|
544
|
-
heartbeat: {
|
545
|
-
initial: "checking",
|
546
|
-
states: {
|
547
|
-
checking: {
|
548
|
-
always: {
|
549
|
-
guard: "should send heartbeats",
|
550
|
-
target: "sending"
|
551
|
-
}
|
552
|
-
},
|
553
|
-
sending: {
|
554
|
-
on: {
|
555
|
-
"request.failed": {
|
556
|
-
target: "#handshaking"
|
557
|
-
}
|
558
|
-
},
|
559
|
-
invoke: {
|
560
|
-
id: "send heartbeat",
|
561
|
-
src: "sendBackAtInterval",
|
562
|
-
input: () => ({
|
563
|
-
event: { type: "post", data: { type: at, data: void 0 } },
|
564
|
-
interval: 2e3,
|
565
|
-
immediate: !1
|
566
|
-
})
|
567
|
-
}
|
568
|
-
}
|
569
|
-
}
|
570
|
-
}
|
571
|
-
}
|
572
|
-
},
|
573
|
-
disconnected: {
|
574
|
-
id: "disconnected",
|
575
|
-
entry: ["send disconnect", { type: "emit status", params: { status: "disconnected" } }],
|
576
|
-
on: {
|
577
|
-
request: {
|
578
|
-
actions: "create request"
|
579
|
-
},
|
580
|
-
post: {
|
581
|
-
actions: "buffer message"
|
582
|
-
},
|
583
|
-
connect: {
|
584
|
-
target: "handshaking",
|
585
|
-
guard: "has target"
|
586
|
-
}
|
587
|
-
}
|
588
|
-
}
|
589
|
-
}
|
590
|
-
}), bt = (t, e = ot()) => {
|
591
|
-
const n = t.id || `${t.name}-${Xe()}`, i = mi(e, {
|
592
|
-
input: { ...t, id: n }
|
593
|
-
}), r = (m, f) => {
|
594
|
-
const { unsubscribe: g } = i.on(
|
595
|
-
// @ts-expect-error @todo `type` typing
|
596
|
-
m,
|
597
|
-
async (y) => {
|
598
|
-
const h = await f(y.message.data);
|
599
|
-
h && i.send({ type: "response", respondTo: y.message.id, data: h });
|
600
|
-
}
|
601
|
-
);
|
602
|
-
return g;
|
603
|
-
}, a = () => {
|
604
|
-
i.send({ type: "connect" });
|
605
|
-
}, o = () => {
|
606
|
-
i.send({ type: "disconnect" });
|
607
|
-
}, s = (m, f) => {
|
608
|
-
const { unsubscribe: g } = i.on(
|
609
|
-
// @ts-expect-error @todo ReceivedEmitEvent causes this
|
610
|
-
"_status",
|
611
|
-
(y) => {
|
612
|
-
f && y.status !== f || m(y.status);
|
613
|
-
}
|
614
|
-
);
|
615
|
-
return g;
|
616
|
-
}, c = (m) => {
|
617
|
-
i.send({ type: "target.set", target: m });
|
618
|
-
}, l = (m, f) => {
|
619
|
-
const g = { type: m, data: f };
|
620
|
-
i.send({ type: "post", data: g });
|
621
|
-
}, p = () => {
|
622
|
-
i.stop();
|
623
|
-
}, d = () => (i.start(), p);
|
624
|
-
return {
|
625
|
-
actor: i,
|
626
|
-
connect: a,
|
627
|
-
disconnect: o,
|
628
|
-
id: n,
|
629
|
-
name: t.name,
|
630
|
-
machine: e,
|
631
|
-
on: r,
|
632
|
-
onStatus: s,
|
633
|
-
post: l,
|
634
|
-
setTarget: c,
|
635
|
-
start: d,
|
636
|
-
stop: p,
|
637
|
-
get target() {
|
638
|
-
return i.getSnapshot().context.target;
|
639
|
-
}
|
640
|
-
};
|
641
|
-
}, Pt = (t) => {
|
642
|
-
t.disconnect(), setTimeout(() => {
|
643
|
-
t.stop();
|
644
|
-
}, 0);
|
645
|
-
}, Vi = () => {
|
646
|
-
}, Ki = (t) => {
|
647
|
-
const { targetOrigin: e } = t, n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
648
|
-
return {
|
649
|
-
addTarget: (r) => {
|
650
|
-
if (n.has(r))
|
651
|
-
return Vi;
|
652
|
-
if (!n.size || !i.size)
|
653
|
-
return n.add(r), i.forEach((o) => {
|
654
|
-
o.connections.forEach((s) => {
|
655
|
-
s.setTarget(r), s.connect();
|
656
|
-
});
|
657
|
-
}), () => {
|
658
|
-
n.delete(r), i.forEach((o) => {
|
659
|
-
o.connections.forEach((s) => {
|
660
|
-
s.target === r && s.disconnect();
|
661
|
-
});
|
662
|
-
});
|
663
|
-
};
|
664
|
-
n.add(r);
|
665
|
-
const a = /* @__PURE__ */ new Set();
|
666
|
-
return i.forEach((o) => {
|
667
|
-
const s = bt(
|
668
|
-
{
|
669
|
-
...o.input,
|
670
|
-
target: r,
|
671
|
-
targetOrigin: e
|
672
|
-
},
|
673
|
-
o.machine
|
674
|
-
);
|
675
|
-
a.add(s), o.connections.add(s), o.subscribers.forEach(({ type: c, handler: l, unsubscribers: p }) => {
|
676
|
-
p.push(s.on(c, l));
|
677
|
-
}), o.internalEventSubscribers.forEach(({ type: c, handler: l, unsubscribers: p }) => {
|
678
|
-
p.push(s.actor.on(c, l).unsubscribe);
|
679
|
-
}), o.statusSubscribers.forEach(({ handler: c, unsubscribers: l }) => {
|
680
|
-
l.push(
|
681
|
-
s.onStatus((p) => c({ connection: s.id, status: p }))
|
682
|
-
);
|
683
|
-
}), s.start(), s.connect();
|
684
|
-
}), () => {
|
685
|
-
n.delete(r), a.forEach((o) => {
|
686
|
-
Pt(o), i.forEach((s) => {
|
687
|
-
s.connections.delete(o);
|
688
|
-
});
|
689
|
-
});
|
690
|
-
};
|
691
|
-
},
|
692
|
-
createChannel: (r, a = ot()) => {
|
693
|
-
const o = {
|
694
|
-
connections: /* @__PURE__ */ new Set(),
|
695
|
-
input: r,
|
696
|
-
internalEventSubscribers: /* @__PURE__ */ new Set(),
|
697
|
-
machine: a,
|
698
|
-
statusSubscribers: /* @__PURE__ */ new Set(),
|
699
|
-
subscribers: /* @__PURE__ */ new Set()
|
700
|
-
};
|
701
|
-
i.add(o);
|
702
|
-
const { connections: s, internalEventSubscribers: c, statusSubscribers: l, subscribers: p } = o;
|
703
|
-
if (n.size)
|
704
|
-
n.forEach((h) => {
|
705
|
-
const w = bt(
|
706
|
-
{
|
707
|
-
...r,
|
708
|
-
target: h,
|
709
|
-
targetOrigin: e
|
710
|
-
},
|
711
|
-
a
|
712
|
-
);
|
713
|
-
s.add(w);
|
714
|
-
});
|
715
|
-
else {
|
716
|
-
const h = bt({ ...r, targetOrigin: e }, a);
|
717
|
-
s.add(h);
|
718
|
-
}
|
719
|
-
const d = (...h) => {
|
720
|
-
const [w, P] = h;
|
721
|
-
s.forEach((b) => {
|
722
|
-
b.post(w, P);
|
723
|
-
});
|
724
|
-
}, m = (h, w) => {
|
725
|
-
const P = [];
|
726
|
-
s.forEach((S) => {
|
727
|
-
P.push(S.on(h, w));
|
728
|
-
});
|
729
|
-
const b = { type: h, handler: w, unsubscribers: P };
|
730
|
-
return p.add(b), () => {
|
731
|
-
P.forEach((S) => S()), p.delete(b);
|
732
|
-
};
|
733
|
-
}, f = (h, w) => {
|
734
|
-
const P = [];
|
735
|
-
s.forEach((S) => {
|
736
|
-
P.push(S.actor.on(h, w).unsubscribe);
|
737
|
-
});
|
738
|
-
const b = { type: h, handler: w, unsubscribers: P };
|
739
|
-
return c.add(b), () => {
|
740
|
-
P.forEach((S) => S()), c.delete(b);
|
741
|
-
};
|
742
|
-
}, g = (h) => {
|
743
|
-
const w = [];
|
744
|
-
s.forEach((b) => {
|
745
|
-
w.push(
|
746
|
-
b.onStatus((S) => h({ connection: b.id, status: S }))
|
747
|
-
);
|
748
|
-
});
|
749
|
-
const P = { handler: h, unsubscribers: w };
|
750
|
-
return l.add(P), () => {
|
751
|
-
w.forEach((b) => b()), l.delete(P);
|
752
|
-
};
|
753
|
-
}, y = () => {
|
754
|
-
const h = o.connections;
|
755
|
-
h.forEach(Pt), h.clear(), i.delete(o);
|
756
|
-
};
|
757
|
-
return {
|
758
|
-
on: m,
|
759
|
-
onInternalEvent: f,
|
760
|
-
onStatus: g,
|
761
|
-
post: d,
|
762
|
-
start: () => (s.forEach((h) => {
|
763
|
-
h.start(), h.connect();
|
764
|
-
}), y),
|
765
|
-
stop: y
|
766
|
-
};
|
767
|
-
},
|
768
|
-
destroy: () => {
|
769
|
-
i.forEach(({ connections: r }) => {
|
770
|
-
r.forEach(Pt), r.clear();
|
771
|
-
}), i.clear(), n.clear();
|
772
|
-
}
|
773
|
-
};
|
774
|
-
}, Hi = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Zt = /_key\s*==\s*['"](.*)['"]/, Gi = /^\d*:\d*$/;
|
775
|
-
function en(t) {
|
776
|
-
return typeof t == "number" || typeof t == "string" && /^\[\d+\]$/.test(t);
|
777
|
-
}
|
778
|
-
function mt(t) {
|
779
|
-
return typeof t == "string" ? Zt.test(t.trim()) : typeof t == "object" && "_key" in t;
|
780
|
-
}
|
781
|
-
function qn(t) {
|
782
|
-
if (typeof t == "string" && Gi.test(t))
|
783
|
-
return !0;
|
784
|
-
if (!Array.isArray(t) || t.length !== 2)
|
785
|
-
return !1;
|
786
|
-
const [e, n] = t;
|
787
|
-
return (typeof e == "number" || e === "") && (typeof n == "number" || n === "");
|
788
|
-
}
|
789
|
-
function Bi(t, e, n) {
|
790
|
-
const i = typeof e == "string" ? Fn(e) : e;
|
791
|
-
if (!Array.isArray(i))
|
792
|
-
throw new Error("Path must be an array or a string");
|
793
|
-
let r = t;
|
794
|
-
for (let a = 0; a < i.length; a++) {
|
795
|
-
const o = i[a];
|
796
|
-
if (en(o)) {
|
797
|
-
if (!Array.isArray(r))
|
798
|
-
return n;
|
799
|
-
r = r[o];
|
800
|
-
}
|
801
|
-
if (mt(o)) {
|
802
|
-
if (!Array.isArray(r))
|
803
|
-
return n;
|
804
|
-
r = r.find((s) => s._key === o._key);
|
805
|
-
}
|
806
|
-
if (typeof o == "string" && (r = typeof r == "object" && r !== null ? r[o] : void 0), typeof r > "u")
|
807
|
-
return n;
|
808
|
-
}
|
809
|
-
return r;
|
810
|
-
}
|
811
|
-
function Qi(t) {
|
812
|
-
if (!Array.isArray(t))
|
813
|
-
throw new Error("Path is not an array");
|
814
|
-
return t.reduce((e, n, i) => {
|
815
|
-
const r = typeof n;
|
816
|
-
if (r === "number")
|
817
|
-
return `${e}[${n}]`;
|
818
|
-
if (r === "string")
|
819
|
-
return `${e}${i === 0 ? "" : "."}${n}`;
|
820
|
-
if (mt(n) && n._key)
|
821
|
-
return `${e}[_key=="${n._key}"]`;
|
822
|
-
if (Array.isArray(n)) {
|
823
|
-
const [a, o] = n;
|
824
|
-
return `${e}[${a}:${o}]`;
|
825
|
-
}
|
826
|
-
throw new Error(`Unsupported path segment \`${JSON.stringify(n)}\``);
|
827
|
-
}, "");
|
828
|
-
}
|
829
|
-
function Fn(t) {
|
830
|
-
if (typeof t != "string")
|
831
|
-
throw new Error("Path is not a string");
|
832
|
-
const e = t.match(Hi);
|
833
|
-
if (!e)
|
834
|
-
throw new Error("Invalid path string");
|
835
|
-
return e.map(Xi);
|
836
|
-
}
|
837
|
-
function Xi(t) {
|
838
|
-
return en(t) ? Ji(t) : mt(t) ? Yi(t) : qn(t) ? Zi(t) : t;
|
839
|
-
}
|
840
|
-
function Ji(t) {
|
841
|
-
return Number(t.replace(/[^\d]/g, ""));
|
842
|
-
}
|
843
|
-
function Yi(t) {
|
844
|
-
return { _key: t.match(Zt)[1] };
|
845
|
-
}
|
846
|
-
function Zi(t) {
|
847
|
-
const [e, n] = t.split(":").map((i) => i === "" ? i : Number(i));
|
848
|
-
return [e, n];
|
849
|
-
}
|
850
|
-
var Vn = /* @__PURE__ */ Object.freeze({
|
851
|
-
__proto__: null,
|
852
|
-
fromString: Fn,
|
853
|
-
get: Bi,
|
854
|
-
isIndexSegment: en,
|
855
|
-
isIndexTuple: qn,
|
856
|
-
isKeySegment: mt,
|
857
|
-
reKeySegment: Zt,
|
858
|
-
toString: Qi
|
859
|
-
});
|
860
|
-
const ln = "drafts.";
|
861
|
-
function Fs(t) {
|
862
|
-
return t.startsWith(ln) ? t.slice(ln.length) : t;
|
863
|
-
}
|
864
|
-
const dn = {
|
865
|
-
"\f": "\\f",
|
866
|
-
"\n": "\\n",
|
867
|
-
"\r": "\\r",
|
868
|
-
" ": "\\t",
|
869
|
-
"'": "\\'",
|
870
|
-
"\\": "\\\\"
|
871
|
-
}, un = {
|
872
|
-
"\\f": "\f",
|
873
|
-
"\\n": `
|
874
|
-
`,
|
875
|
-
"\\r": "\r",
|
876
|
-
"\\t": " ",
|
877
|
-
"\\'": "'",
|
878
|
-
"\\\\": "\\"
|
879
|
-
};
|
880
|
-
function ea(t) {
|
881
|
-
return `$${t.map((e) => typeof e == "string" ? `['${e.replace(/[\f\n\r\t'\\]/g, (n) => dn[n])}']` : typeof e == "number" ? `[${e}]` : e._key !== "" ? `[?(@._key=='${e._key.replace(/['\\]/g, (n) => dn[n])}')]` : `[${e._index}]`).join("")}`;
|
882
|
-
}
|
883
|
-
function Vs(t) {
|
884
|
-
const e = [], n = /\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;
|
885
|
-
let i;
|
886
|
-
for (; (i = n.exec(t)) !== null; ) {
|
887
|
-
if (i[1] !== void 0) {
|
888
|
-
const r = i[1].replace(/\\(\\|f|n|r|t|')/g, (a) => un[a]);
|
889
|
-
e.push(r);
|
890
|
-
continue;
|
891
|
-
}
|
892
|
-
if (i[2] !== void 0) {
|
893
|
-
e.push(parseInt(i[2], 10));
|
894
|
-
continue;
|
895
|
-
}
|
896
|
-
if (i[3] !== void 0) {
|
897
|
-
const r = i[3].replace(/\\(\\')/g, (a) => un[a]);
|
898
|
-
e.push({
|
899
|
-
_key: r,
|
900
|
-
_index: -1
|
901
|
-
});
|
902
|
-
continue;
|
903
|
-
}
|
904
|
-
}
|
905
|
-
return e;
|
906
|
-
}
|
907
|
-
function ta(t) {
|
908
|
-
return t.map((e) => {
|
909
|
-
if (typeof e == "string" || typeof e == "number")
|
910
|
-
return e;
|
911
|
-
if (e._index !== -1)
|
912
|
-
return e._index;
|
913
|
-
throw new Error(`invalid segment:${JSON.stringify(e)}`);
|
914
|
-
});
|
915
|
-
}
|
916
|
-
function Ks(t, e) {
|
917
|
-
if (!(e != null && e.mappings))
|
918
|
-
return;
|
919
|
-
const n = ea(ta(t));
|
920
|
-
if (e.mappings[n] !== void 0)
|
921
|
-
return {
|
922
|
-
mapping: e.mappings[n],
|
923
|
-
matchedPath: n,
|
924
|
-
pathSuffix: ""
|
925
|
-
};
|
926
|
-
const i = Object.entries(e.mappings).filter(([s]) => n.startsWith(s)).sort(([s], [c]) => c.length - s.length);
|
927
|
-
if (i.length == 0)
|
928
|
-
return;
|
929
|
-
const [r, a] = i[0], o = n.substring(r.length);
|
930
|
-
return { mapping: a, matchedPath: r, pathSuffix: o };
|
931
|
-
}
|
932
|
-
function na(t) {
|
933
|
-
return t !== null && Array.isArray(t);
|
934
|
-
}
|
935
|
-
function pn(t) {
|
936
|
-
return typeof t == "object" && t !== null;
|
937
|
-
}
|
938
|
-
function Ge(t, e, n = []) {
|
939
|
-
if (na(t))
|
940
|
-
return t.map((i, r) => {
|
941
|
-
if (pn(i)) {
|
942
|
-
const a = i._key;
|
943
|
-
if (typeof a == "string")
|
944
|
-
return Ge(i, e, n.concat({ _key: a, _index: r }));
|
945
|
-
}
|
946
|
-
return Ge(i, e, n.concat(r));
|
947
|
-
});
|
948
|
-
if (pn(t)) {
|
949
|
-
if (t._type === "block" || t._type === "span") {
|
950
|
-
const i = { ...t };
|
951
|
-
return t._type === "block" ? i.children = Ge(t.children, e, n.concat("children")) : t._type === "span" && (i.text = Ge(t.text, e, n.concat("text"))), i;
|
952
|
-
}
|
953
|
-
return Object.fromEntries(
|
954
|
-
Object.entries(t).map(([i, r]) => [i, Ge(r, e, n.concat(i))])
|
955
|
-
);
|
956
|
-
}
|
957
|
-
return e(t, n);
|
958
|
-
}
|
959
|
-
function ra(t) {
|
960
|
-
const e = new URL(t), { searchParams: n } = e;
|
961
|
-
return n.delete(Kt), n.delete(Vt), n.delete(Ht), e;
|
962
|
-
}
|
963
|
-
function ia(t, e, n, i) {
|
964
|
-
const r = new URL(t), { searchParams: a } = r;
|
965
|
-
return a.set(Vt, e), a.set(Kt, n), a.set(Ht, i), r;
|
966
|
-
}
|
967
|
-
function Kn() {
|
968
|
-
if (typeof crypto < "u") {
|
969
|
-
const t = new Uint8Array(16);
|
970
|
-
crypto.getRandomValues(t);
|
971
|
-
let e = "";
|
972
|
-
for (let n = 0; n < t.length; n++)
|
973
|
-
e += t[n].toString(16).padStart(2, "0");
|
974
|
-
return e = btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/[=]+$/, ""), e;
|
975
|
-
}
|
976
|
-
return Math.random().toString(36).slice(2);
|
977
|
-
}
|
978
|
-
async function aa(t, e, n, i) {
|
979
|
-
const r = t.withConfig({ apiVersion: Ft }), a = Kn(), o = r.patch(We).set({ secret: a, studioUrl: n, userId: i });
|
980
|
-
return await r.transaction().createIfNotExists({ _id: We, _type: Fe, source: e, studioUrl: n, userId: i }).patch(o).commit({ tag: Gt }), { secret: a };
|
981
|
-
}
|
982
|
-
async function oa(t, e, n, i) {
|
983
|
-
const r = t.withConfig({ apiVersion: Ft }), a = r.patch(We).set({ secret: null, studioUrl: n, userId: i });
|
984
|
-
await r.transaction().createIfNotExists({ _id: We, _type: Fe, source: e, studioUrl: n, userId: i }).patch(a).commit({ tag: Gt });
|
985
|
-
}
|
986
|
-
function sa(t) {
|
987
|
-
for (var e = [], n = 0; n < t.length; ) {
|
988
|
-
var i = t[n];
|
989
|
-
if (i === "*" || i === "+" || i === "?") {
|
990
|
-
e.push({ type: "MODIFIER", index: n, value: t[n++] });
|
991
|
-
continue;
|
992
|
-
}
|
993
|
-
if (i === "\\") {
|
994
|
-
e.push({ type: "ESCAPED_CHAR", index: n++, value: t[n++] });
|
995
|
-
continue;
|
996
|
-
}
|
997
|
-
if (i === "{") {
|
998
|
-
e.push({ type: "OPEN", index: n, value: t[n++] });
|
999
|
-
continue;
|
1000
|
-
}
|
1001
|
-
if (i === "}") {
|
1002
|
-
e.push({ type: "CLOSE", index: n, value: t[n++] });
|
1003
|
-
continue;
|
1004
|
-
}
|
1005
|
-
if (i === ":") {
|
1006
|
-
for (var r = "", a = n + 1; a < t.length; ) {
|
1007
|
-
var o = t.charCodeAt(a);
|
1008
|
-
if (
|
1009
|
-
// `0-9`
|
1010
|
-
o >= 48 && o <= 57 || // `A-Z`
|
1011
|
-
o >= 65 && o <= 90 || // `a-z`
|
1012
|
-
o >= 97 && o <= 122 || // `_`
|
1013
|
-
o === 95
|
1014
|
-
) {
|
1015
|
-
r += t[a++];
|
1016
|
-
continue;
|
1017
|
-
}
|
1018
|
-
break;
|
1019
|
-
}
|
1020
|
-
if (!r)
|
1021
|
-
throw new TypeError("Missing parameter name at ".concat(n));
|
1022
|
-
e.push({ type: "NAME", index: n, value: r }), n = a;
|
1023
|
-
continue;
|
1024
|
-
}
|
1025
|
-
if (i === "(") {
|
1026
|
-
var s = 1, c = "", a = n + 1;
|
1027
|
-
if (t[a] === "?")
|
1028
|
-
throw new TypeError('Pattern cannot start with "?" at '.concat(a));
|
1029
|
-
for (; a < t.length; ) {
|
1030
|
-
if (t[a] === "\\") {
|
1031
|
-
c += t[a++] + t[a++];
|
1032
|
-
continue;
|
1033
|
-
}
|
1034
|
-
if (t[a] === ")") {
|
1035
|
-
if (s--, s === 0) {
|
1036
|
-
a++;
|
1037
|
-
break;
|
1038
|
-
}
|
1039
|
-
} else if (t[a] === "(" && (s++, t[a + 1] !== "?"))
|
1040
|
-
throw new TypeError("Capturing groups are not allowed at ".concat(a));
|
1041
|
-
c += t[a++];
|
1042
|
-
}
|
1043
|
-
if (s)
|
1044
|
-
throw new TypeError("Unbalanced pattern at ".concat(n));
|
1045
|
-
if (!c)
|
1046
|
-
throw new TypeError("Missing pattern at ".concat(n));
|
1047
|
-
e.push({ type: "PATTERN", index: n, value: c }), n = a;
|
1048
|
-
continue;
|
1049
|
-
}
|
1050
|
-
e.push({ type: "CHAR", index: n, value: t[n++] });
|
1051
|
-
}
|
1052
|
-
return e.push({ type: "END", index: n, value: "" }), e;
|
1053
|
-
}
|
1054
|
-
function ca(t, e) {
|
1055
|
-
e === void 0 && (e = {});
|
1056
|
-
for (var n = sa(t), i = e.prefixes, r = i === void 0 ? "./" : i, a = e.delimiter, o = a === void 0 ? "/#?" : a, s = [], c = 0, l = 0, p = "", d = function(_) {
|
1057
|
-
if (l < n.length && n[l].type === _)
|
1058
|
-
return n[l++].value;
|
1059
|
-
}, m = function(_) {
|
1060
|
-
var x = d(_);
|
1061
|
-
if (x !== void 0)
|
1062
|
-
return x;
|
1063
|
-
var I = n[l], T = I.type, A = I.index;
|
1064
|
-
throw new TypeError("Unexpected ".concat(T, " at ").concat(A, ", expected ").concat(_));
|
1065
|
-
}, f = function() {
|
1066
|
-
for (var _ = "", x; x = d("CHAR") || d("ESCAPED_CHAR"); )
|
1067
|
-
_ += x;
|
1068
|
-
return _;
|
1069
|
-
}, g = function(_) {
|
1070
|
-
for (var x = 0, I = o; x < I.length; x++) {
|
1071
|
-
var T = I[x];
|
1072
|
-
if (_.indexOf(T) > -1)
|
1073
|
-
return !0;
|
1074
|
-
}
|
1075
|
-
return !1;
|
1076
|
-
}, y = function(_) {
|
1077
|
-
var x = s[s.length - 1], I = _ || (x && typeof x == "string" ? x : "");
|
1078
|
-
if (x && !I)
|
1079
|
-
throw new TypeError('Must have text between two parameters, missing text after "'.concat(x.name, '"'));
|
1080
|
-
return !I || g(I) ? "[^".concat(Ue(o), "]+?") : "(?:(?!".concat(Ue(I), ")[^").concat(Ue(o), "])+?");
|
1081
|
-
}; l < n.length; ) {
|
1082
|
-
var h = d("CHAR"), w = d("NAME"), P = d("PATTERN");
|
1083
|
-
if (w || P) {
|
1084
|
-
var b = h || "";
|
1085
|
-
r.indexOf(b) === -1 && (p += b, b = ""), p && (s.push(p), p = ""), s.push({
|
1086
|
-
name: w || c++,
|
1087
|
-
prefix: b,
|
1088
|
-
suffix: "",
|
1089
|
-
pattern: P || y(b),
|
1090
|
-
modifier: d("MODIFIER") || ""
|
1091
|
-
});
|
1092
|
-
continue;
|
1093
|
-
}
|
1094
|
-
var S = h || d("ESCAPED_CHAR");
|
1095
|
-
if (S) {
|
1096
|
-
p += S;
|
1097
|
-
continue;
|
1098
|
-
}
|
1099
|
-
p && (s.push(p), p = "");
|
1100
|
-
var E = d("OPEN");
|
1101
|
-
if (E) {
|
1102
|
-
var b = f(), R = d("NAME") || "", v = d("PATTERN") || "", C = f();
|
1103
|
-
m("CLOSE"), s.push({
|
1104
|
-
name: R || (v ? c++ : ""),
|
1105
|
-
pattern: R && !v ? y(b) : v,
|
1106
|
-
prefix: b,
|
1107
|
-
suffix: C,
|
1108
|
-
modifier: d("MODIFIER") || ""
|
1109
|
-
});
|
1110
|
-
continue;
|
1111
|
-
}
|
1112
|
-
m("END");
|
1113
|
-
}
|
1114
|
-
return s;
|
1115
|
-
}
|
1116
|
-
function la(t, e) {
|
1117
|
-
var n = [], i = Gn(t, n, e);
|
1118
|
-
return da(i, n, e);
|
1119
|
-
}
|
1120
|
-
function da(t, e, n) {
|
1121
|
-
n === void 0 && (n = {});
|
1122
|
-
var i = n.decode, r = i === void 0 ? function(a) {
|
1123
|
-
return a;
|
1124
|
-
} : i;
|
1125
|
-
return function(a) {
|
1126
|
-
var o = t.exec(a);
|
1127
|
-
if (!o)
|
1128
|
-
return !1;
|
1129
|
-
for (var s = o[0], c = o.index, l = /* @__PURE__ */ Object.create(null), p = function(m) {
|
1130
|
-
if (o[m] === void 0)
|
1131
|
-
return "continue";
|
1132
|
-
var f = e[m - 1];
|
1133
|
-
f.modifier === "*" || f.modifier === "+" ? l[f.name] = o[m].split(f.prefix + f.suffix).map(function(g) {
|
1134
|
-
return r(g, f);
|
1135
|
-
}) : l[f.name] = r(o[m], f);
|
1136
|
-
}, d = 1; d < o.length; d++)
|
1137
|
-
p(d);
|
1138
|
-
return { path: s, index: c, params: l };
|
1139
|
-
};
|
1140
|
-
}
|
1141
|
-
function Ue(t) {
|
1142
|
-
return t.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
|
1143
|
-
}
|
1144
|
-
function Hn(t) {
|
1145
|
-
return t && t.sensitive ? "" : "i";
|
1146
|
-
}
|
1147
|
-
function ua(t, e) {
|
1148
|
-
if (!e)
|
1149
|
-
return t;
|
1150
|
-
for (var n = /\((?:\?<(.*?)>)?(?!\?)/g, i = 0, r = n.exec(t.source); r; )
|
1151
|
-
e.push({
|
1152
|
-
// Use parenthesized substring match if available, index otherwise
|
1153
|
-
name: r[1] || i++,
|
1154
|
-
prefix: "",
|
1155
|
-
suffix: "",
|
1156
|
-
modifier: "",
|
1157
|
-
pattern: ""
|
1158
|
-
}), r = n.exec(t.source);
|
1159
|
-
return t;
|
1160
|
-
}
|
1161
|
-
function pa(t, e, n) {
|
1162
|
-
var i = t.map(function(r) {
|
1163
|
-
return Gn(r, e, n).source;
|
1164
|
-
});
|
1165
|
-
return new RegExp("(?:".concat(i.join("|"), ")"), Hn(n));
|
1166
|
-
}
|
1167
|
-
function ma(t, e, n) {
|
1168
|
-
return fa(ca(t, n), e, n);
|
1169
|
-
}
|
1170
|
-
function fa(t, e, n) {
|
1171
|
-
n === void 0 && (n = {});
|
1172
|
-
for (var i = n.strict, r = i === void 0 ? !1 : i, a = n.start, o = a === void 0 ? !0 : a, s = n.end, c = s === void 0 ? !0 : s, l = n.encode, p = l === void 0 ? function(x) {
|
1173
|
-
return x;
|
1174
|
-
} : l, d = n.delimiter, m = d === void 0 ? "/#?" : d, f = n.endsWith, g = f === void 0 ? "" : f, y = "[".concat(Ue(g), "]|$"), h = "[".concat(Ue(m), "]"), w = o ? "^" : "", P = 0, b = t; P < b.length; P++) {
|
1175
|
-
var S = b[P];
|
1176
|
-
if (typeof S == "string")
|
1177
|
-
w += Ue(p(S));
|
1178
|
-
else {
|
1179
|
-
var E = Ue(p(S.prefix)), R = Ue(p(S.suffix));
|
1180
|
-
if (S.pattern)
|
1181
|
-
if (e && e.push(S), E || R)
|
1182
|
-
if (S.modifier === "+" || S.modifier === "*") {
|
1183
|
-
var v = S.modifier === "*" ? "?" : "";
|
1184
|
-
w += "(?:".concat(E, "((?:").concat(S.pattern, ")(?:").concat(R).concat(E, "(?:").concat(S.pattern, "))*)").concat(R, ")").concat(v);
|
1185
|
-
} else
|
1186
|
-
w += "(?:".concat(E, "(").concat(S.pattern, ")").concat(R, ")").concat(S.modifier);
|
1187
|
-
else {
|
1188
|
-
if (S.modifier === "+" || S.modifier === "*")
|
1189
|
-
throw new TypeError('Can not repeat "'.concat(S.name, '" without a prefix and suffix'));
|
1190
|
-
w += "(".concat(S.pattern, ")").concat(S.modifier);
|
1191
|
-
}
|
1192
|
-
else
|
1193
|
-
w += "(?:".concat(E).concat(R, ")").concat(S.modifier);
|
1194
|
-
}
|
1195
|
-
}
|
1196
|
-
if (c)
|
1197
|
-
r || (w += "".concat(h, "?")), w += n.endsWith ? "(?=".concat(y, ")") : "$";
|
1198
|
-
else {
|
1199
|
-
var C = t[t.length - 1], _ = typeof C == "string" ? h.indexOf(C[C.length - 1]) > -1 : C === void 0;
|
1200
|
-
r || (w += "(?:".concat(h, "(?=").concat(y, "))?")), _ || (w += "(?=".concat(h, "|").concat(y, ")"));
|
1201
|
-
}
|
1202
|
-
return new RegExp(w, Hn(n));
|
1203
|
-
}
|
1204
|
-
function Gn(t, e, n) {
|
1205
|
-
return t instanceof RegExp ? ua(t, e) : Array.isArray(t) ? pa(t, e, n) : ma(t, e, n);
|
1206
|
-
}
|
1207
|
-
async function ha(t, e, n, i, r = En()) {
|
1208
|
-
const a = t.withConfig({ apiVersion: Ft });
|
1209
|
-
try {
|
1210
|
-
const o = new Date(Date.now() + 1e3 * Nn), s = `drafts.${r}`, c = Kn(), l = a.patch(s).set({ secret: c, source: e, studioUrl: n, userId: i });
|
1211
|
-
return await a.transaction().createOrReplace({ _id: s, _type: qt }).patch(l).commit({ tag: Gt }), { secret: c, expiresAt: o };
|
1212
|
-
} finally {
|
1213
|
-
try {
|
1214
|
-
await a.delete({ query: ki });
|
1215
|
-
} catch (o) {
|
1216
|
-
console.error("Failed to delete expired secrets", o);
|
1217
|
-
}
|
1218
|
-
}
|
1219
|
-
}
|
1220
|
-
function ga(t) {
|
1221
|
-
const {
|
1222
|
-
draftMode: e,
|
1223
|
-
previewMode: n,
|
1224
|
-
origin: i = typeof location > "u" ? "https://localhost" : location.origin
|
1225
|
-
} = t, r = (n == null ? void 0 : n.enable) || (e == null ? void 0 : e.enable);
|
1226
|
-
let { preview: a = "/" } = t;
|
1227
|
-
const o = new URL(a, i), s = r ? new URL(r, i) : void 0;
|
1228
|
-
return async (c) => {
|
1229
|
-
try {
|
1230
|
-
if (c.previewSearchParam) {
|
1231
|
-
const p = new URL(c.previewSearchParam, o);
|
1232
|
-
p.origin === o.origin && (a = `${p.pathname}${p.search}`);
|
1233
|
-
}
|
1234
|
-
} catch {
|
1235
|
-
}
|
1236
|
-
typeof location < "u" && location.origin === o.origin && c.studioBasePath && (a.startsWith(`${c.studioBasePath}/`) || a === c.studioBasePath) && (a = t.preview || "/");
|
1237
|
-
const l = new URL(a, o);
|
1238
|
-
if (s) {
|
1239
|
-
const p = new URL(s), { searchParams: d } = p;
|
1240
|
-
return d.set(Vt, c.previewUrlSecret), d.set(Ht, c.studioPreviewPerspective), l.pathname !== p.pathname && d.set(
|
1241
|
-
Kt,
|
1242
|
-
`${l.pathname}${l.search}`
|
1243
|
-
), p.toString();
|
1244
|
-
}
|
1245
|
-
return l.toString();
|
1246
|
-
};
|
1247
|
-
}
|
1248
|
-
const ya = (t) => typeof t == "object" && typeof t.then == "function", et = [];
|
1249
|
-
function va(t, e, n = (i, r) => i === r) {
|
1250
|
-
if (t === e) return !0;
|
1251
|
-
if (!t || !e) return !1;
|
1252
|
-
const i = t.length;
|
1253
|
-
if (e.length !== i) return !1;
|
1254
|
-
for (let r = 0; r < i; r++) if (!n(t[r], e[r])) return !1;
|
1255
|
-
return !0;
|
1256
|
-
}
|
1257
|
-
function wa(t, e = null, n = !1, i = {}) {
|
1258
|
-
e === null && (e = [t]);
|
1259
|
-
for (const a of et)
|
1260
|
-
if (va(e, a.keys, a.equal)) {
|
1261
|
-
if (n) return;
|
1262
|
-
if (Object.prototype.hasOwnProperty.call(a, "error")) throw a.error;
|
1263
|
-
if (Object.prototype.hasOwnProperty.call(a, "response"))
|
1264
|
-
return i.lifespan && i.lifespan > 0 && (a.timeout && clearTimeout(a.timeout), a.timeout = setTimeout(a.remove, i.lifespan)), a.response;
|
1265
|
-
if (!n) throw a.promise;
|
1266
|
-
}
|
1267
|
-
const r = {
|
1268
|
-
keys: e,
|
1269
|
-
equal: i.equal,
|
1270
|
-
remove: () => {
|
1271
|
-
const a = et.indexOf(r);
|
1272
|
-
a !== -1 && et.splice(a, 1);
|
1273
|
-
},
|
1274
|
-
promise: (
|
1275
|
-
// Execute the promise
|
1276
|
-
(ya(t) ? t : t(...e)).then((a) => {
|
1277
|
-
r.response = a, i.lifespan && i.lifespan > 0 && (r.timeout = setTimeout(r.remove, i.lifespan));
|
1278
|
-
}).catch((a) => r.error = a)
|
1279
|
-
)
|
1280
|
-
};
|
1281
|
-
if (et.push(r), !n) throw r.promise;
|
1282
|
-
}
|
1283
|
-
const Bn = (t, e, n) => wa(t, e, !1, n), ba = /^([\w-]+):(0|[1-9][0-9]*)$/, Pa = /^([\w-]+):([0-9]+),([0-9]+)$/, Sa = /^([\w-]+):([\w-]+)$/;
|
1284
|
-
function _a(t) {
|
1285
|
-
const e = [];
|
1286
|
-
for (const n of t.split(".")) {
|
1287
|
-
const i = ba.exec(n);
|
1288
|
-
if (i) {
|
1289
|
-
e.push(i[1], Number(i[2]));
|
1290
|
-
continue;
|
1291
|
-
}
|
1292
|
-
const r = Pa.exec(n);
|
1293
|
-
if (r) {
|
1294
|
-
e.push(r[1], [Number(r[2]), Number(r[3])]);
|
1295
|
-
continue;
|
1296
|
-
}
|
1297
|
-
const a = Sa.exec(n);
|
1298
|
-
if (a) {
|
1299
|
-
e.push(a[1], {
|
1300
|
-
_key: a[2]
|
1301
|
-
});
|
1302
|
-
continue;
|
1303
|
-
}
|
1304
|
-
e.push(n);
|
1305
|
-
}
|
1306
|
-
return e;
|
1307
|
-
}
|
1308
|
-
const Ve = ar(zt(), or(1)), Be = Ot(Ve);
|
1309
|
-
Pn({
|
1310
|
-
baseUrl: Ve,
|
1311
|
-
dataset: Be,
|
1312
|
-
id: Ve,
|
1313
|
-
path: Ve,
|
1314
|
-
projectId: Be,
|
1315
|
-
tool: Be,
|
1316
|
-
type: Be,
|
1317
|
-
workspace: Be,
|
1318
|
-
isDraft: Ot(zt())
|
1319
|
-
});
|
1320
|
-
Pn({
|
1321
|
-
origin: Ve,
|
1322
|
-
href: Ve,
|
1323
|
-
data: Ot(sr(zt(), cr()))
|
1324
|
-
});
|
1325
|
-
const xa = {
|
1326
|
-
"handshake/syn": Xt,
|
1327
|
-
"handshake/syn-ack": Jt,
|
1328
|
-
"handshake/ack": Yt,
|
1329
|
-
"channel/response": Je,
|
1330
|
-
"channel/heartbeat": at,
|
1331
|
-
"channel/disconnect": Qt,
|
1332
|
-
"overlay/focus": "visual-editing/focus",
|
1333
|
-
"overlay/navigate": "visual-editing/navigate",
|
1334
|
-
"overlay/toggle": "visual-editing/toggle",
|
1335
|
-
"presentation/toggleOverlay": "presentation/toggle-overlay"
|
1336
|
-
}, Ea = {
|
1337
|
-
[Xt]: "handshake/syn",
|
1338
|
-
[Jt]: "handshake/syn-ack",
|
1339
|
-
[Yt]: "handshake/ack",
|
1340
|
-
[Je]: "channel/response",
|
1341
|
-
[at]: "channel/heartbeat",
|
1342
|
-
[Qt]: "channel/disconnect",
|
1343
|
-
"visual-editing/focus": "overlay/focus",
|
1344
|
-
"visual-editing/navigate": "overlay/navigate",
|
1345
|
-
"visual-editing/toggle": "overlay/toggle",
|
1346
|
-
"presentation/toggle-overlay": "presentation/toggleOverlay"
|
1347
|
-
}, Ta = (t) => {
|
1348
|
-
const {
|
1349
|
-
data: e
|
1350
|
-
} = t;
|
1351
|
-
return e && typeof e == "object" && "domain" in e && "type" in e && "from" in e && "to" in e && (e.domain === "sanity/channels" && (e.domain = Bt), e.to === "overlays" && (e.to = "visual-editing"), e.from === "overlays" && (e.from = "visual-editing"), e.channelId = e.connectionId, delete e.connectionId, e.type = xa[e.type] ?? e.type), t;
|
1352
|
-
}, Ca = (t) => {
|
1353
|
-
const {
|
1354
|
-
channelId: e,
|
1355
|
-
...n
|
1356
|
-
} = t, i = {
|
1357
|
-
...n,
|
1358
|
-
connectionId: e
|
1359
|
-
};
|
1360
|
-
return i.domain === Bt && (i.domain = "sanity/channels"), i.to === "visual-editing" && (i.to = "overlays"), i.from === "visual-editing" && (i.from = "overlays"), i.type = Ea[i.type] ?? i.type, i.type === "channel/response" && i.responseTo && !i.data && (i.data = {
|
1361
|
-
responseTo: i.responseTo
|
1362
|
-
}), (i.type === "handshake/syn" || i.type === "handshake/syn-ack" || i.type === "handshake/ack") && (i.data = {
|
1363
|
-
id: i.connectionId
|
1364
|
-
}), i;
|
1365
|
-
}, Ra = ({
|
1366
|
-
context: t
|
1367
|
-
}, e) => {
|
1368
|
-
const {
|
1369
|
-
sources: n,
|
1370
|
-
targetOrigin: i
|
1371
|
-
} = t, r = Ca(e.message);
|
1372
|
-
n.forEach((a) => {
|
1373
|
-
a.postMessage(r, {
|
1374
|
-
targetOrigin: i
|
1375
|
-
});
|
1376
|
-
});
|
1377
|
-
}, $t = () => ({
|
1378
|
-
listen: Dn(Ta),
|
1379
|
-
requestMachine: jn().provide({
|
1380
|
-
actions: {
|
1381
|
-
"send message": Ra
|
1382
|
-
}
|
1383
|
-
})
|
1384
|
-
});
|
1385
|
-
function Ia(t, e) {
|
1386
|
-
return `${t}-${typeof e == "string" ? e : JSON.stringify(e)}`;
|
1387
|
-
}
|
1388
|
-
const $a = typeof window < "u" && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform), mn = {
|
1389
|
-
alt: "altKey",
|
1390
|
-
ctrl: "ctrlKey",
|
1391
|
-
mod: $a ? "metaKey" : "ctrlKey",
|
1392
|
-
shift: "shiftKey"
|
1393
|
-
};
|
1394
|
-
function Aa(t, e) {
|
1395
|
-
return t.every((n) => mn[n] ? e[mn[n]] : e.key === n.toUpperCase());
|
1396
|
-
}
|
1397
|
-
function fn(t) {
|
1398
|
-
return t.key === "Alt";
|
1399
|
-
}
|
1400
|
-
function Qn(t, e) {
|
1401
|
-
let n;
|
1402
|
-
return (...i) => {
|
1403
|
-
clearTimeout(n), n = setTimeout(() => {
|
1404
|
-
t.apply(t, i);
|
1405
|
-
}, e);
|
1406
|
-
};
|
1407
|
-
}
|
1408
|
-
const ka = function(t) {
|
1409
|
-
const e = W(14), {
|
1410
|
-
comlink: n,
|
1411
|
-
children: i
|
1412
|
-
} = t;
|
1413
|
-
let r;
|
1414
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = {}, e[0] = r) : r = e[0];
|
1415
|
-
const a = le(r);
|
1416
|
-
let o, s;
|
1417
|
-
e[1] !== n ? (o = () => n == null ? void 0 : n.on("visual-editing/shared-state", () => ({
|
1418
|
-
state: a.current
|
1419
|
-
})), s = [n], e[1] = n, e[2] = o, e[3] = s) : (o = e[2], s = e[3]), V(o, s);
|
1420
|
-
let c;
|
1421
|
-
e[4] !== n ? (c = (h, w) => {
|
1422
|
-
a.current[h] = w, n == null || n.post("presentation/shared-state", {
|
1423
|
-
key: h,
|
1424
|
-
value: w
|
1425
|
-
});
|
1426
|
-
}, e[4] = n, e[5] = c) : c = e[5];
|
1427
|
-
const l = c;
|
1428
|
-
let p;
|
1429
|
-
e[6] !== n ? (p = (h) => {
|
1430
|
-
n == null || n.post("presentation/shared-state", {
|
1431
|
-
key: h
|
1432
|
-
}), delete a.current[h];
|
1433
|
-
}, e[6] = n, e[7] = p) : p = e[7];
|
1434
|
-
const d = p;
|
1435
|
-
let m, f;
|
1436
|
-
e[8] !== d || e[9] !== l ? (f = {
|
1437
|
-
removeValue: d,
|
1438
|
-
setValue: l
|
1439
|
-
}, e[8] = d, e[9] = l, e[10] = f) : f = e[10], m = f;
|
1440
|
-
const g = m;
|
1441
|
-
let y;
|
1442
|
-
return e[11] !== i || e[12] !== g ? (y = /* @__PURE__ */ u(hr.Provider, { value: g, children: i }), e[11] = i, e[12] = g, e[13] = y) : y = e[13], y;
|
1443
|
-
}, ft = Kr(null);
|
1444
|
-
ft.displayName = "PanelsContext";
|
1445
|
-
const Oa = ge.div`
|
1446
|
-
overflow: hidden;
|
1447
|
-
flex-basis: 0;
|
1448
|
-
flex-shrink: 1;
|
1449
|
-
`, tn = function(t) {
|
1450
|
-
const e = W(15), {
|
1451
|
-
children: n,
|
1452
|
-
defaultSize: i,
|
1453
|
-
id: r,
|
1454
|
-
minWidth: a,
|
1455
|
-
maxWidth: o,
|
1456
|
-
order: s
|
1457
|
-
} = t, c = i === void 0 ? null : i, l = s === void 0 ? 0 : s, p = Lt(ft);
|
1458
|
-
if (p === null)
|
1459
|
-
throw Error("Panel components must be rendered within a PanelGroup container");
|
1460
|
-
const {
|
1461
|
-
getPanelStyle: d,
|
1462
|
-
registerElement: m,
|
1463
|
-
unregisterElement: f
|
1464
|
-
} = p;
|
1465
|
-
let g;
|
1466
|
-
e[0] !== d || e[1] !== r ? (g = d(r), e[0] = d, e[1] = r, e[2] = g) : g = e[2];
|
1467
|
-
const y = g;
|
1468
|
-
let h, w;
|
1469
|
-
e[3] !== c || e[4] !== r || e[5] !== o || e[6] !== a || e[7] !== l || e[8] !== m || e[9] !== f ? (h = () => (m(r, {
|
1470
|
-
id: r,
|
1471
|
-
type: "panel",
|
1472
|
-
defaultSize: c,
|
1473
|
-
maxWidth: o ?? null,
|
1474
|
-
minWidth: a ?? 0,
|
1475
|
-
order: l
|
1476
|
-
}), () => {
|
1477
|
-
f(r);
|
1478
|
-
}), w = [r, c, l, o, a, m, f], e[3] = c, e[4] = r, e[5] = o, e[6] = a, e[7] = l, e[8] = m, e[9] = f, e[10] = h, e[11] = w) : (h = e[10], w = e[11]), Qe(h, w);
|
1479
|
-
let P;
|
1480
|
-
return e[12] !== n || e[13] !== y ? (P = /* @__PURE__ */ u(Oa, { style: y, children: n }), e[12] = n, e[13] = y, e[14] = P) : P = e[14], P;
|
1481
|
-
}, Xn = "presentation/panels", Jn = () => JSON.parse(localStorage.getItem(Xn) || "{}"), Ma = (t) => {
|
1482
|
-
localStorage.setItem(Xn, JSON.stringify(t));
|
1483
|
-
}, Yn = (t) => t.map((e) => [e.id, e.order].join(":")).join(",");
|
1484
|
-
function za() {
|
1485
|
-
const t = W(1);
|
1486
|
-
let e;
|
1487
|
-
const n = Ua, i = La;
|
1488
|
-
let r;
|
1489
|
-
if (t[0] === Symbol.for("react.memo_cache_sentinel")) {
|
1490
|
-
const a = Qn(i, 100);
|
1491
|
-
r = {
|
1492
|
-
get: n,
|
1493
|
-
set: i,
|
1494
|
-
setDebounced: a
|
1495
|
-
}, t[0] = r;
|
1496
|
-
} else
|
1497
|
-
r = t[0];
|
1498
|
-
return e = r, e;
|
1499
|
-
}
|
1500
|
-
function La(t, e) {
|
1501
|
-
const n = Jn(), i = Yn(t), r = {
|
1502
|
-
...n,
|
1503
|
-
[i]: e
|
1504
|
-
};
|
1505
|
-
Ma(r);
|
1506
|
-
}
|
1507
|
-
function Ua(t) {
|
1508
|
-
const e = Jn(), n = Yn(t);
|
1509
|
-
return Array.isArray(e[n]) && e[n].some(Wa) ? void 0 : e[n];
|
1510
|
-
}
|
1511
|
-
function Wa(t) {
|
1512
|
-
return t === null;
|
1513
|
-
}
|
1514
|
-
function At(t, e, n) {
|
1515
|
-
const {
|
1516
|
-
maxWidth: i,
|
1517
|
-
minWidth: r
|
1518
|
-
} = t, a = i == null ? 100 : i / n * 100, o = r / n * 100;
|
1519
|
-
return Math.min(a, Math.max(o, e));
|
1520
|
-
}
|
1521
|
-
function Na(t, e, n, i, r, a) {
|
1522
|
-
const {
|
1523
|
-
panels: o,
|
1524
|
-
widths: s
|
1525
|
-
} = r, {
|
1526
|
-
widths: c
|
1527
|
-
} = a, l = c || s, p = [...l];
|
1528
|
-
{
|
1529
|
-
const g = t < 0 ? i : n, y = o.findIndex((P) => P.id === g.id), h = l[y], w = At(g, h + Math.abs(t), e);
|
1530
|
-
if (h === w)
|
1531
|
-
return l;
|
1532
|
-
t = t < 0 ? h - w : w - h;
|
1533
|
-
}
|
1534
|
-
let d = 0, m = t < 0 ? n : i, f = o.findIndex((g) => g.id === m.id);
|
1535
|
-
for (; ; ) {
|
1536
|
-
const g = o[f], y = l[f], h = Math.abs(t) - Math.abs(d), w = At(g, y - h, e);
|
1537
|
-
if (y !== w && (d += y - w, p[f] = w, d.toPrecision(10).localeCompare(Math.abs(t).toPrecision(10), void 0, {
|
1538
|
-
numeric: !0
|
1539
|
-
}) >= 0))
|
1540
|
-
break;
|
1541
|
-
if (t < 0) {
|
1542
|
-
if (--f < 0)
|
1543
|
-
break;
|
1544
|
-
} else if (++f >= o.length)
|
1545
|
-
break;
|
1546
|
-
}
|
1547
|
-
return d === 0 ? l : (m = t < 0 ? i : n, f = o.findIndex((g) => g.id === m.id), p[f] = l[f] + d, p);
|
1548
|
-
}
|
1549
|
-
function Da(t, e, n) {
|
1550
|
-
if (t.length === 1) return "100";
|
1551
|
-
const i = t.findIndex((a) => a.id === e), r = n[i];
|
1552
|
-
return r == null ? "0" : r.toPrecision(10);
|
1553
|
-
}
|
1554
|
-
function hn(t, e, n = 0, i = null) {
|
1555
|
-
const r = t.clientX, a = (i || e.getBoundingClientRect()).left;
|
1556
|
-
return r - a - n;
|
1557
|
-
}
|
1558
|
-
function St(t) {
|
1559
|
-
return t.type === "panel";
|
1560
|
-
}
|
1561
|
-
function gn(t) {
|
1562
|
-
return t.type === "resizer";
|
1563
|
-
}
|
1564
|
-
function yn(t) {
|
1565
|
-
return Array.from(t.values()).sort(({
|
1566
|
-
order: e
|
1567
|
-
}, {
|
1568
|
-
order: n
|
1569
|
-
}) => e == null && n == null ? 0 : e == null ? -1 : n == null ? 1 : e - n);
|
1570
|
-
}
|
1571
|
-
function vn(t, e, n) {
|
1572
|
-
const i = e.reduce((o, s) => o + s, 0), r = [...e].map((o) => o / i * 100);
|
1573
|
-
let a = 0;
|
1574
|
-
for (let o = 0; o < t.length; o++) {
|
1575
|
-
const s = t[o], c = r[o], l = At(s, c, n);
|
1576
|
-
c != l && (a += c - l, r[o] = l);
|
1577
|
-
}
|
1578
|
-
if (a.toFixed(3) !== "0.000")
|
1579
|
-
for (let o = 0; o < t.length; o++) {
|
1580
|
-
const s = t[o];
|
1581
|
-
let {
|
1582
|
-
maxWidth: c,
|
1583
|
-
minWidth: l
|
1584
|
-
} = s;
|
1585
|
-
l = l / n * 100, c != null && (c = c / n * 100);
|
1586
|
-
const p = Math.min(c ?? 100, Math.max(l, r[o] + a));
|
1587
|
-
if (p !== r[o] && (a -= p - r[o], r[o] = p, Math.abs(a).toFixed(3) === "0.000"))
|
1588
|
-
break;
|
1589
|
-
}
|
1590
|
-
return r;
|
1591
|
-
}
|
1592
|
-
function ja(t) {
|
1593
|
-
let e = t.length, n = 100;
|
1594
|
-
const i = t.map((a) => a.defaultSize ? (n = n - a.defaultSize, e = e - 1, a.defaultSize) : null), r = n / e;
|
1595
|
-
return i.map((a) => a === null ? r : a);
|
1596
|
-
}
|
1597
|
-
const qa = ge.div`
|
1598
|
-
display: flex;
|
1599
|
-
flex-direction: row;
|
1600
|
-
height: 100%;
|
1601
|
-
overflow: hidden;
|
1602
|
-
width: 100%;
|
1603
|
-
`, Fa = function(t) {
|
1604
|
-
const e = W(46), {
|
1605
|
-
children: n
|
1606
|
-
} = t, i = le(null);
|
1607
|
-
let r;
|
1608
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ new Map(), e[0] = r) : r = e[0];
|
1609
|
-
const [a, o] = z(r);
|
1610
|
-
let s, c;
|
1611
|
-
e[1] !== a ? (c = yn(a).filter(St), e[1] = a, e[2] = c) : c = e[2], s = c;
|
1612
|
-
const l = s;
|
1613
|
-
let p;
|
1614
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (p = [], e[3] = p) : p = e[3];
|
1615
|
-
const [d, m] = z(p), [f, g] = z(null);
|
1616
|
-
let y;
|
1617
|
-
e[4] !== a || e[5] !== l || e[6] !== d ? (y = {
|
1618
|
-
elements: a,
|
1619
|
-
panels: l,
|
1620
|
-
widths: d
|
1621
|
-
}, e[4] = a, e[5] = l, e[6] = d, e[7] = y) : y = e[7];
|
1622
|
-
const h = le(y);
|
1623
|
-
let w;
|
1624
|
-
e[8] !== f || e[9] !== l || e[10] !== d ? (w = (K) => ({
|
1625
|
-
flexGrow: Da(l, K, d),
|
1626
|
-
pointerEvents: f === null ? void 0 : "none"
|
1627
|
-
}), e[8] = f, e[9] = l, e[10] = d, e[11] = w) : w = e[11];
|
1628
|
-
const P = w;
|
1629
|
-
let b;
|
1630
|
-
e[12] === Symbol.for("react.memo_cache_sentinel") ? (b = (K, H) => {
|
1631
|
-
o((F) => {
|
1632
|
-
if (F.has(K))
|
1633
|
-
return F;
|
1634
|
-
const Q = new Map(F);
|
1635
|
-
return Q.set(K, H), Q;
|
1636
|
-
});
|
1637
|
-
}, e[12] = b) : b = e[12];
|
1638
|
-
const S = b;
|
1639
|
-
let E;
|
1640
|
-
e[13] === Symbol.for("react.memo_cache_sentinel") ? (E = (K) => {
|
1641
|
-
o((H) => {
|
1642
|
-
if (!H.has(K))
|
1643
|
-
return H;
|
1644
|
-
const F = new Map(H);
|
1645
|
-
return F.delete(K), F;
|
1646
|
-
});
|
1647
|
-
}, e[13] = E) : E = e[13];
|
1648
|
-
const R = E;
|
1649
|
-
let v;
|
1650
|
-
e[14] === Symbol.for("react.memo_cache_sentinel") ? (v = {
|
1651
|
-
containerWidth: window.innerWidth,
|
1652
|
-
dragOffset: 0,
|
1653
|
-
panelAfter: null,
|
1654
|
-
panelBefore: null,
|
1655
|
-
resizerIndex: -1,
|
1656
|
-
resizerRect: null,
|
1657
|
-
startX: 0,
|
1658
|
-
widths: []
|
1659
|
-
}, e[14] = v) : v = e[14];
|
1660
|
-
const C = le(v);
|
1661
|
-
let _;
|
1662
|
-
e[15] !== a ? (_ = (K, H) => {
|
1663
|
-
const F = yn(a), Q = F.findIndex((ee) => ee.id === K), Y = a.get(K);
|
1664
|
-
if (!Y || !gn(Y))
|
1665
|
-
return;
|
1666
|
-
const Z = Y.el.current;
|
1667
|
-
Z && (C.current = {
|
1668
|
-
resizerIndex: Q,
|
1669
|
-
panelBefore: F.reduce((ee, G, oe) => St(G) && oe < Q ? G : ee, null),
|
1670
|
-
panelAfter: F.reduce((ee, G, oe) => ee === null && St(G) && oe > Q ? G : ee, null),
|
1671
|
-
containerWidth: window.innerWidth,
|
1672
|
-
startX: H.pageX,
|
1673
|
-
dragOffset: hn(H, Z),
|
1674
|
-
resizerRect: Z.getBoundingClientRect(),
|
1675
|
-
widths: h.current.widths
|
1676
|
-
}, g(K));
|
1677
|
-
}, e[15] = a, e[16] = _) : _ = e[16];
|
1678
|
-
const x = _;
|
1679
|
-
let I;
|
1680
|
-
e[17] === Symbol.for("react.memo_cache_sentinel") ? (I = () => {
|
1681
|
-
g(null);
|
1682
|
-
}, e[17] = I) : I = e[17];
|
1683
|
-
const T = I;
|
1684
|
-
let A;
|
1685
|
-
e[18] !== a ? (A = (K, H) => {
|
1686
|
-
H.preventDefault(), H.stopPropagation();
|
1687
|
-
const {
|
1688
|
-
containerWidth: F,
|
1689
|
-
dragOffset: Q,
|
1690
|
-
panelBefore: Y,
|
1691
|
-
panelAfter: Z,
|
1692
|
-
resizerRect: ee
|
1693
|
-
} = C.current;
|
1694
|
-
if (Y == null || Z == null)
|
1695
|
-
return;
|
1696
|
-
const G = a.get(K);
|
1697
|
-
if (!G || !gn(G))
|
1698
|
-
return;
|
1699
|
-
const oe = G.el.current;
|
1700
|
-
if (!oe)
|
1701
|
-
return;
|
1702
|
-
const ve = hn(H, oe, Q, ee);
|
1703
|
-
if (ve === 0)
|
1704
|
-
return;
|
1705
|
-
const {
|
1706
|
-
widths: Se
|
1707
|
-
} = h.current, Oe = i.current.getBoundingClientRect(), we = ve / Oe.width * 100, Me = Na(we, F, Y, Z, h.current, C.current);
|
1708
|
-
Se.some((_e, be) => _e !== Me[be]) && m(Me);
|
1709
|
-
}, e[18] = a, e[19] = A) : A = e[19];
|
1710
|
-
const k = A;
|
1711
|
-
let $, N;
|
1712
|
-
e[20] !== a || e[21] !== l || e[22] !== d ? ($ = () => {
|
1713
|
-
h.current.elements = a, h.current.panels = l, h.current.widths = d;
|
1714
|
-
}, N = [a, l, d], e[20] = a, e[21] = l, e[22] = d, e[23] = $, e[24] = N) : ($ = e[23], N = e[24]), Qe($, N);
|
1715
|
-
const M = za();
|
1716
|
-
let D, L;
|
1717
|
-
e[25] !== l || e[26] !== M ? (D = () => {
|
1718
|
-
const {
|
1719
|
-
widths: K
|
1720
|
-
} = h.current;
|
1721
|
-
if (K.length === l.length)
|
1722
|
-
return;
|
1723
|
-
const H = M.get(l);
|
1724
|
-
if (H) {
|
1725
|
-
const Q = vn(l, H, window.innerWidth);
|
1726
|
-
m(Q);
|
1727
|
-
return;
|
1728
|
-
}
|
1729
|
-
const F = ja(l);
|
1730
|
-
m(F);
|
1731
|
-
}, L = [M, l], e[25] = l, e[26] = M, e[27] = D, e[28] = L) : (D = e[27], L = e[28]), Qe(D, L);
|
1732
|
-
let B, J;
|
1733
|
-
e[29] !== l || e[30] !== M || e[31] !== d ? (B = () => {
|
1734
|
-
d.length && M.setDebounced(l, d);
|
1735
|
-
}, J = [M, l, d], e[29] = l, e[30] = M, e[31] = d, e[32] = B, e[33] = J) : (B = e[32], J = e[33]), V(B, J);
|
1736
|
-
let ie, de;
|
1737
|
-
e[34] === Symbol.for("react.memo_cache_sentinel") ? (ie = () => {
|
1738
|
-
const K = new ResizeObserver(() => {
|
1739
|
-
const {
|
1740
|
-
panels: H,
|
1741
|
-
widths: F
|
1742
|
-
} = h.current, Q = vn(H, F, window.innerWidth);
|
1743
|
-
F.some((Y, Z) => Y !== Q[Z]) && m(Q);
|
1744
|
-
});
|
1745
|
-
return K.observe(i.current), () => {
|
1746
|
-
K.disconnect();
|
1747
|
-
};
|
1748
|
-
}, de = [], e[34] = ie, e[35] = de) : (ie = e[34], de = e[35]), Qe(ie, de);
|
1749
|
-
let ye, se;
|
1750
|
-
e[36] !== f || e[37] !== k || e[38] !== P || e[39] !== x ? (se = {
|
1751
|
-
activeResizer: f,
|
1752
|
-
drag: k,
|
1753
|
-
getPanelStyle: P,
|
1754
|
-
registerElement: S,
|
1755
|
-
startDragging: x,
|
1756
|
-
stopDragging: T,
|
1757
|
-
unregisterElement: R
|
1758
|
-
}, e[36] = f, e[37] = k, e[38] = P, e[39] = x, e[40] = se) : se = e[40], ye = se;
|
1759
|
-
const ue = ye;
|
1760
|
-
let pe;
|
1761
|
-
e[41] !== n ? (pe = /* @__PURE__ */ u(qa, { ref: i, children: n }), e[41] = n, e[42] = pe) : pe = e[42];
|
1762
|
-
let fe;
|
1763
|
-
return e[43] !== ue || e[44] !== pe ? (fe = /* @__PURE__ */ u(ft.Provider, { value: ue, children: pe }), e[43] = ue, e[44] = pe, e[45] = fe) : fe = e[45], fe;
|
1764
|
-
};
|
1765
|
-
function nn(t) {
|
1766
|
-
const e = W(37);
|
1767
|
-
let n, i, r, a, o;
|
1768
|
-
e[0] !== t ? ({
|
1769
|
-
children: n,
|
1770
|
-
message: i,
|
1771
|
-
onRetry: a,
|
1772
|
-
onContinueAnyway: r,
|
1773
|
-
...o
|
1774
|
-
} = t, e[0] = t, e[1] = n, e[2] = i, e[3] = r, e[4] = a, e[5] = o) : (n = e[1], i = e[2], r = e[3], a = e[4], o = e[5]);
|
1775
|
-
const {
|
1776
|
-
t: s
|
1777
|
-
} = Te(xe);
|
1778
|
-
let c;
|
1779
|
-
e[6] !== s ? (c = s("error-card.retry-button.text"), e[6] = s, e[7] = c) : c = e[7];
|
1780
|
-
let l;
|
1781
|
-
e[8] !== a || e[9] !== c ? (l = /* @__PURE__ */ u(ke, { fontSize: 1, mode: "ghost", onClick: a, text: c }), e[8] = a, e[9] = c, e[10] = l) : l = e[10];
|
1782
|
-
const p = l;
|
1783
|
-
let d;
|
1784
|
-
e[11] !== s ? (d = s("error-card.continue-button.text"), e[11] = s, e[12] = d) : d = e[12];
|
1785
|
-
let m;
|
1786
|
-
e[13] !== r || e[14] !== d ? (m = /* @__PURE__ */ u(ke, { fontSize: 1, mode: "ghost", tone: "critical", onClick: r, text: d }), e[13] = r, e[14] = d, e[15] = m) : m = e[15];
|
1787
|
-
const f = m;
|
1788
|
-
let g;
|
1789
|
-
e[16] !== s ? (g = s("error-card.title"), e[16] = s, e[17] = g) : g = e[17];
|
1790
|
-
let y;
|
1791
|
-
e[18] !== g ? (y = /* @__PURE__ */ u(X, { size: 1, weight: "semibold", children: g }), e[18] = g, e[19] = y) : y = e[19];
|
1792
|
-
let h;
|
1793
|
-
e[20] !== i ? (h = /* @__PURE__ */ u(X, { muted: !0, size: 1, children: i }), e[20] = i, e[21] = h) : h = e[21];
|
1794
|
-
let w;
|
1795
|
-
e[22] !== y || e[23] !== h ? (w = /* @__PURE__ */ q(De, { space: 3, children: [
|
1796
|
-
y,
|
1797
|
-
h
|
1798
|
-
] }), e[22] = y, e[23] = h, e[24] = w) : w = e[24];
|
1799
|
-
let P;
|
1800
|
-
e[25] !== f || e[26] !== r || e[27] !== a || e[28] !== p ? (P = a && r ? /* @__PURE__ */ q(Or, { space: 2, children: [
|
1801
|
-
p,
|
1802
|
-
f
|
1803
|
-
] }) : a ? /* @__PURE__ */ u(me, { children: p }) : r ? /* @__PURE__ */ u(me, { children: f }) : null, e[25] = f, e[26] = r, e[27] = a, e[28] = p, e[29] = P) : P = e[29];
|
1804
|
-
let b;
|
1805
|
-
e[30] !== n || e[31] !== w || e[32] !== P ? (b = /* @__PURE__ */ u(ae, { align: "center", height: "fill", justify: "center", children: /* @__PURE__ */ u(Mr, { padding: 4, sizing: "border", width: 0, children: /* @__PURE__ */ q(De, { space: 4, children: [
|
1806
|
-
w,
|
1807
|
-
n,
|
1808
|
-
P
|
1809
|
-
] }) }) }), e[30] = n, e[31] = w, e[32] = P, e[33] = b) : b = e[33];
|
1810
|
-
let S;
|
1811
|
-
return e[34] !== o || e[35] !== b ? (S = /* @__PURE__ */ u(ce, { height: "fill", ...o, children: b }), e[34] = o, e[35] = b, e[36] = S) : S = e[36], S;
|
1812
|
-
}
|
1813
|
-
function Va(t = {}) {
|
1814
|
-
const e = Object.entries(t).map(([n, i]) => `${n}=${i}`).join("&");
|
1815
|
-
return e.length ? `?${e}` : "";
|
1816
|
-
}
|
1817
|
-
function Ka(t) {
|
1818
|
-
const e = ["comment", "inspect", "instruction", "pathKey", "rev", "since", "template", "view"], n = Object.entries(t).filter(([i]) => e.includes(i)).reduce((i, [r, a]) => a == null ? i : {
|
1819
|
-
...i,
|
1820
|
-
[r]: a
|
1821
|
-
}, {});
|
1822
|
-
return Va(n);
|
1823
|
-
}
|
1824
|
-
const Ha = lt(function(t, e) {
|
1825
|
-
const n = W(11);
|
1826
|
-
let i, r;
|
1827
|
-
n[0] !== t ? ({
|
1828
|
-
searchParams: r,
|
1829
|
-
...i
|
1830
|
-
} = t, n[0] = t, n[1] = i, n[2] = r) : (i = n[1], r = n[2]);
|
1831
|
-
let a;
|
1832
|
-
n[3] !== r ? (a = Object.entries(r), n[3] = r, n[4] = a) : a = n[4];
|
1833
|
-
let o;
|
1834
|
-
n[5] !== a ? (o = {
|
1835
|
-
type: void 0,
|
1836
|
-
_searchParams: a
|
1837
|
-
}, n[5] = a, n[6] = o) : o = n[6];
|
1838
|
-
let s;
|
1839
|
-
return n[7] !== e || n[8] !== i || n[9] !== o ? (s = /* @__PURE__ */ u(pt, { ...i, ref: e, state: o, title: void 0 }), n[7] = e, n[8] = i, n[9] = o, n[10] = s) : s = n[10], s;
|
1840
|
-
}), Ga = lt(function(t, e) {
|
1841
|
-
const n = W(15);
|
1842
|
-
let i, r, a, o;
|
1843
|
-
if (n[0] !== t) {
|
1844
|
-
const {
|
1845
|
-
documentId: p,
|
1846
|
-
documentType: d,
|
1847
|
-
parentRefPath: m,
|
1848
|
-
template: f,
|
1849
|
-
searchParams: g,
|
1850
|
-
...y
|
1851
|
-
} = t;
|
1852
|
-
i = p, r = d, o = g, a = y, n[0] = t, n[1] = i, n[2] = r, n[3] = a, n[4] = o;
|
1853
|
-
} else
|
1854
|
-
i = n[1], r = n[2], a = n[3], o = n[4];
|
1855
|
-
let s;
|
1856
|
-
n[5] !== o ? (s = Object.entries(o), n[5] = o, n[6] = s) : s = n[6];
|
1857
|
-
let c;
|
1858
|
-
n[7] !== i || n[8] !== r || n[9] !== s ? (c = {
|
1859
|
-
id: i,
|
1860
|
-
type: r,
|
1861
|
-
_searchParams: s
|
1862
|
-
}, n[7] = i, n[8] = r, n[9] = s, n[10] = c) : c = n[10];
|
1863
|
-
let l;
|
1864
|
-
return n[11] !== e || n[12] !== a || n[13] !== c ? (l = /* @__PURE__ */ u(pt, { ...a, ref: e, state: c, title: void 0 }), n[11] = e, n[12] = a, n[13] = c, n[14] = l) : l = n[14], l;
|
1865
|
-
});
|
1866
|
-
function Zn(t) {
|
1867
|
-
const e = W(26), {
|
1868
|
-
children: n,
|
1869
|
-
onStructureParams: i,
|
1870
|
-
structureParams: r,
|
1871
|
-
searchParams: a,
|
1872
|
-
refs: o
|
1873
|
-
} = t, {
|
1874
|
-
state: s,
|
1875
|
-
resolvePathFromState: c
|
1876
|
-
} = jt();
|
1877
|
-
let l;
|
1878
|
-
e[0] !== s._searchParams ? (l = Object.fromEntries(s._searchParams || []), e[0] = s._searchParams, e[1] = l) : l = e[1];
|
1879
|
-
const p = kn(l);
|
1880
|
-
let d;
|
1881
|
-
e[2] !== c || e[3] !== p || e[4] !== s ? (d = (C) => {
|
1882
|
-
const _ = c(s), x = Ka({
|
1883
|
-
...p,
|
1884
|
-
...C
|
1885
|
-
});
|
1886
|
-
return `${_}${x}`;
|
1887
|
-
}, e[2] = c, e[3] = p, e[4] = s, e[5] = d) : d = e[5];
|
1888
|
-
const m = d;
|
1889
|
-
let f, g;
|
1890
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (g = {}, e[6] = g) : g = e[6];
|
1891
|
-
const y = r;
|
1892
|
-
let h;
|
1893
|
-
e[7] === Symbol.for("react.memo_cache_sentinel") ? (h = [], e[7] = h) : h = e[7];
|
1894
|
-
let w;
|
1895
|
-
e[8] !== o || e[9] !== a ? (w = (C) => {
|
1896
|
-
const {
|
1897
|
-
childId: _,
|
1898
|
-
...x
|
1899
|
-
} = C, I = o == null ? void 0 : o.find((T) => T._id === _ || ut(T._id) === _);
|
1900
|
-
return I ? /* @__PURE__ */ u(pt, { ...x, state: {
|
1901
|
-
id: _,
|
1902
|
-
type: I._type,
|
1903
|
-
_searchParams: Object.entries(a)
|
1904
|
-
} }) : /* @__PURE__ */ u("div", { ...x });
|
1905
|
-
}, e[8] = o, e[9] = a, e[10] = w) : w = e[10];
|
1906
|
-
let P, b;
|
1907
|
-
e[11] !== a ? (P = (C) => /* @__PURE__ */ u(Ha, { ...C, searchParams: a }), b = (C) => /* @__PURE__ */ u(Ga, { ...C, searchParams: a }), e[11] = a, e[12] = P, e[13] = b) : (P = e[12], b = e[13]);
|
1908
|
-
let S;
|
1909
|
-
e[14] !== i ? (S = (C) => {
|
1910
|
-
i({
|
1911
|
-
...C,
|
1912
|
-
inspect: C.inspect ?? void 0
|
1913
|
-
});
|
1914
|
-
}, e[14] = i, e[15] = S) : S = e[15];
|
1915
|
-
let E;
|
1916
|
-
e[16] !== m || e[17] !== y || e[18] !== w || e[19] !== P || e[20] !== b || e[21] !== S ? (E = {
|
1917
|
-
index: 0,
|
1918
|
-
groupIndex: 0,
|
1919
|
-
siblingIndex: 0,
|
1920
|
-
payload: g,
|
1921
|
-
params: y,
|
1922
|
-
hasGroupSiblings: !1,
|
1923
|
-
groupLength: 1,
|
1924
|
-
routerPanesState: h,
|
1925
|
-
ChildLink: w,
|
1926
|
-
BackLink: P,
|
1927
|
-
ReferenceChildLink: b,
|
1928
|
-
ParameterizedLink: no,
|
1929
|
-
closeCurrentAndAfter: to,
|
1930
|
-
handleEditReference: eo,
|
1931
|
-
replaceCurrent: Za,
|
1932
|
-
closeCurrent: Ya,
|
1933
|
-
duplicateCurrent: Ja,
|
1934
|
-
setView: Xa,
|
1935
|
-
setParams: S,
|
1936
|
-
setPayload: Qa,
|
1937
|
-
navigateIntent: Ba,
|
1938
|
-
createPathWithParams: m
|
1939
|
-
}, e[16] = m, e[17] = y, e[18] = w, e[19] = P, e[20] = b, e[21] = S, e[22] = E) : E = e[22], f = E;
|
1940
|
-
const R = f;
|
1941
|
-
let v;
|
1942
|
-
return e[23] !== n || e[24] !== R ? (v = /* @__PURE__ */ u(_i.Provider, { value: R, children: n }), e[23] = n, e[24] = R, e[25] = v) : v = e[25], v;
|
1943
|
-
}
|
1944
|
-
function Ba(t, e, n) {
|
1945
|
-
console.warn("navigateIntent", t, e, n);
|
1946
|
-
}
|
1947
|
-
function Qa(t) {
|
1948
|
-
console.warn("setPayload", t);
|
1949
|
-
}
|
1950
|
-
function Xa(t) {
|
1951
|
-
console.warn("setView", t);
|
1952
|
-
}
|
1953
|
-
function Ja(t) {
|
1954
|
-
console.warn("duplicateCurrent", t);
|
1955
|
-
}
|
1956
|
-
function Ya() {
|
1957
|
-
console.warn("closeCurrent");
|
1958
|
-
}
|
1959
|
-
function Za(t) {
|
1960
|
-
console.warn("replaceCurrent", t);
|
1961
|
-
}
|
1962
|
-
function eo(t) {
|
1963
|
-
console.warn("handleEditReference", t);
|
1964
|
-
}
|
1965
|
-
function to() {
|
1966
|
-
console.warn("closeCurrentAndAfter");
|
1967
|
-
}
|
1968
|
-
function no() {
|
1969
|
-
return /* @__PURE__ */ u(Pe, { children: "ParameterizedLink" });
|
1970
|
-
}
|
1971
|
-
const ro = ge(Un)`
|
1972
|
-
height: 100%;
|
1973
|
-
`, io = ge(ae)`
|
1974
|
-
& > div {
|
1975
|
-
min-width: none !important;
|
1976
|
-
max-width: none !important;
|
1977
|
-
}
|
1978
|
-
`, ao = ge(nt)`
|
1979
|
-
white-space: pre-wrap;
|
1980
|
-
`;
|
1981
|
-
function oo(t) {
|
1982
|
-
var _, x, I, T;
|
1983
|
-
const e = W(33), {
|
1984
|
-
mainDocumentState: n,
|
1985
|
-
onStructureParams: i,
|
1986
|
-
searchParams: r,
|
1987
|
-
refs: a
|
1988
|
-
} = t, {
|
1989
|
-
t: o
|
1990
|
-
} = Te(xe), {
|
1991
|
-
devMode: s
|
1992
|
-
} = Mt();
|
1993
|
-
let c, l;
|
1994
|
-
if (e[0] !== ((_ = n == null ? void 0 : n.document) == null ? void 0 : _._id) || e[1] !== a) {
|
1995
|
-
let A;
|
1996
|
-
e[3] !== ((x = n == null ? void 0 : n.document) == null ? void 0 : x._id) ? (A = (k) => {
|
1997
|
-
var $;
|
1998
|
-
return ut(k._id) !== (($ = n == null ? void 0 : n.document) == null ? void 0 : $._id);
|
1999
|
-
}, e[3] = (I = n == null ? void 0 : n.document) == null ? void 0 : I._id, e[4] = A) : A = e[4], l = a.filter(A).map(co), e[0] = (T = n == null ? void 0 : n.document) == null ? void 0 : T._id, e[1] = a, e[2] = l;
|
2000
|
-
} else
|
2001
|
-
l = e[2];
|
2002
|
-
c = l;
|
2003
|
-
const p = c;
|
2004
|
-
let d, m;
|
2005
|
-
e[5] !== p ? (m = {
|
2006
|
-
filter: "_id in $ids",
|
2007
|
-
params: {
|
2008
|
-
ids: p
|
2009
|
-
}
|
2010
|
-
}, e[5] = p, e[6] = m) : m = e[6];
|
2011
|
-
let f;
|
2012
|
-
e[7] !== o ? (f = o("document-list-pane.document-list.title"), e[7] = o, e[8] = f) : f = e[8];
|
2013
|
-
let g;
|
2014
|
-
e[9] !== m || e[10] !== f ? (g = {
|
2015
|
-
id: "$root",
|
2016
|
-
options: m,
|
2017
|
-
schemaTypeName: "",
|
2018
|
-
title: f,
|
2019
|
-
type: "documentList"
|
2020
|
-
}, e[9] = m, e[10] = f, e[11] = g) : g = e[11], d = g;
|
2021
|
-
const y = d, [h, w] = z(null);
|
2022
|
-
let P;
|
2023
|
-
e[12] === Symbol.for("react.memo_cache_sentinel") ? (P = () => w(null), e[12] = P) : P = e[12];
|
2024
|
-
const b = P, [S] = z(so);
|
2025
|
-
let E;
|
2026
|
-
e[13] === Symbol.for("react.memo_cache_sentinel") ? (E = () => w(null), e[13] = E) : E = e[13];
|
2027
|
-
let R;
|
2028
|
-
if (e[14] !== a ? (R = [a], e[14] = a, e[15] = R) : R = e[15], V(E, R), h) {
|
2029
|
-
let A;
|
2030
|
-
e[16] !== o ? (A = o("document-list-pane.error.text"), e[16] = o, e[17] = A) : A = e[17];
|
2031
|
-
let k;
|
2032
|
-
e[18] !== s || e[19] !== h || e[20] !== o ? (k = s && /* @__PURE__ */ u(ce, { overflow: "auto", padding: 3, radius: 2, tone: "critical", children: /* @__PURE__ */ q(De, { space: 3, children: [
|
2033
|
-
/* @__PURE__ */ u(it, { muted: !0, size: 0, children: o("presentation-error.label") }),
|
2034
|
-
/* @__PURE__ */ u(ao, { size: 1, children: h.error.message })
|
2035
|
-
] }) }), e[18] = s, e[19] = h, e[20] = o, e[21] = k) : k = e[21];
|
2036
|
-
let $;
|
2037
|
-
return e[22] !== k || e[23] !== A ? ($ = /* @__PURE__ */ u(nn, { flex: 1, message: A, onRetry: b, children: k }), e[22] = k, e[23] = A, e[24] = $) : $ = e[24], $;
|
2038
|
-
}
|
2039
|
-
let v;
|
2040
|
-
e[25] !== y ? (v = /* @__PURE__ */ u(io, { direction: "column", flex: 1, children: /* @__PURE__ */ u(Si, { index: 0, itemId: "$root", pane: y, paneKey: "$root" }) }), e[25] = y, e[26] = v) : v = e[26];
|
2041
|
-
let C;
|
2042
|
-
return e[27] !== i || e[28] !== a || e[29] !== r || e[30] !== S || e[31] !== v ? (C = /* @__PURE__ */ u($n, { onCatch: w, children: /* @__PURE__ */ u(ro, { children: /* @__PURE__ */ u(Wn, { children: /* @__PURE__ */ u(Zn, { onStructureParams: i, structureParams: S, searchParams: r, refs: a, children: v }) }) }) }), e[27] = i, e[28] = a, e[29] = r, e[30] = S, e[31] = v, e[32] = C) : C = e[32], C;
|
2043
|
-
}
|
2044
|
-
function so() {
|
2045
|
-
return {};
|
2046
|
-
}
|
2047
|
-
function co(t) {
|
2048
|
-
return ut(t._id);
|
2049
|
-
}
|
2050
|
-
const lo = ge(nt)`
|
2051
|
-
white-space: pre-wrap;
|
2052
|
-
`;
|
2053
|
-
function uo(t) {
|
2054
|
-
const e = W(35), {
|
2055
|
-
documentId: n,
|
2056
|
-
documentType: i,
|
2057
|
-
onFocusPath: r,
|
2058
|
-
onStructureParams: a,
|
2059
|
-
searchParams: o,
|
2060
|
-
structureParams: s
|
2061
|
-
} = t, {
|
2062
|
-
template: c,
|
2063
|
-
templateParams: l
|
2064
|
-
} = s, {
|
2065
|
-
t: p
|
2066
|
-
} = Te(xe), {
|
2067
|
-
devMode: d
|
2068
|
-
} = Mt();
|
2069
|
-
let m, f;
|
2070
|
-
e[0] !== l ? (f = Pi(l), e[0] = l, e[1] = f) : f = e[1];
|
2071
|
-
let g;
|
2072
|
-
e[2] !== n || e[3] !== i || e[4] !== f || e[5] !== c ? (g = {
|
2073
|
-
id: n,
|
2074
|
-
type: i,
|
2075
|
-
template: c,
|
2076
|
-
templateParameters: f
|
2077
|
-
}, e[2] = n, e[3] = i, e[4] = f, e[5] = c, e[6] = g) : g = e[6];
|
2078
|
-
let y;
|
2079
|
-
e[7] !== n || e[8] !== g ? (y = {
|
2080
|
-
id: n,
|
2081
|
-
options: g,
|
2082
|
-
title: "",
|
2083
|
-
type: "document"
|
2084
|
-
}, e[7] = n, e[8] = g, e[9] = y) : y = e[9], m = y;
|
2085
|
-
const h = m, [w, P] = z(null);
|
2086
|
-
let b;
|
2087
|
-
e[10] === Symbol.for("react.memo_cache_sentinel") ? (b = () => P(null), e[10] = b) : b = e[10];
|
2088
|
-
const S = b;
|
2089
|
-
let E;
|
2090
|
-
e[11] === Symbol.for("react.memo_cache_sentinel") ? (E = () => {
|
2091
|
-
P(null);
|
2092
|
-
}, e[11] = E) : E = e[11];
|
2093
|
-
let R;
|
2094
|
-
if (e[12] !== n || e[13] !== i || e[14] !== s ? (R = [n, i, s], e[12] = n, e[13] = i, e[14] = s, e[15] = R) : R = e[15], V(E, R), w) {
|
2095
|
-
let I;
|
2096
|
-
e[16] !== p ? (I = p("document-pane.error.text"), e[16] = p, e[17] = I) : I = e[17];
|
2097
|
-
let T;
|
2098
|
-
e[18] !== d || e[19] !== w || e[20] !== p ? (T = d && /* @__PURE__ */ u(ce, { overflow: "auto", padding: 3, radius: 2, tone: "critical", children: /* @__PURE__ */ q(De, { space: 3, children: [
|
2099
|
-
/* @__PURE__ */ u(it, { muted: !0, size: 0, children: p("presentation-error.label") }),
|
2100
|
-
/* @__PURE__ */ u(lo, { size: 1, children: w.error.message })
|
2101
|
-
] }) }), e[18] = d, e[19] = w, e[20] = p, e[21] = T) : T = e[21];
|
2102
|
-
let A;
|
2103
|
-
return e[22] !== I || e[23] !== T ? (A = /* @__PURE__ */ u(nn, { flex: 1, message: I, onRetry: S, children: T }), e[22] = I, e[23] = T, e[24] = A) : A = e[24], A;
|
2104
|
-
}
|
2105
|
-
let v;
|
2106
|
-
e[25] === Symbol.for("react.memo_cache_sentinel") ? (v = {
|
2107
|
-
height: "100%"
|
2108
|
-
}, e[25] = v) : v = e[25];
|
2109
|
-
let C;
|
2110
|
-
e[26] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ u(xn, {}), e[26] = C) : C = e[26];
|
2111
|
-
let _;
|
2112
|
-
e[27] !== r || e[28] !== h ? (_ = /* @__PURE__ */ u(Wt, { fallback: C, children: /* @__PURE__ */ u(xi, { paneKey: "document", index: 1, itemId: "document", pane: h, onFocusPath: r }) }), e[27] = r, e[28] = h, e[29] = _) : _ = e[29];
|
2113
|
-
let x;
|
2114
|
-
return e[30] !== a || e[31] !== o || e[32] !== s || e[33] !== _ ? (x = /* @__PURE__ */ u($n, { onCatch: P, children: /* @__PURE__ */ u(Un, { style: v, children: /* @__PURE__ */ u(Zn, { searchParams: o, onStructureParams: a, structureParams: s, children: _ }) }) }), e[30] = a, e[31] = o, e[32] = s, e[33] = _, e[34] = x) : x = e[34], x;
|
2115
|
-
}
|
2116
|
-
function po(t) {
|
2117
|
-
const e = W(7), {
|
2118
|
-
documentId: n,
|
2119
|
-
documentType: i,
|
2120
|
-
onFocusPath: r,
|
2121
|
-
onStructureParams: a,
|
2122
|
-
searchParams: o,
|
2123
|
-
structureParams: s
|
2124
|
-
} = t;
|
2125
|
-
let c;
|
2126
|
-
return e[0] !== n || e[1] !== i || e[2] !== r || e[3] !== a || e[4] !== o || e[5] !== s ? (c = /* @__PURE__ */ u(Wn, { children: /* @__PURE__ */ u(uo, { documentId: n, documentType: i, onFocusPath: r, onStructureParams: a, searchParams: o, structureParams: s }) }), e[0] = n, e[1] = i, e[2] = r, e[3] = a, e[4] = o, e[5] = s, e[6] = c) : c = e[6], c;
|
2127
|
-
}
|
2128
|
-
function mo(t, e) {
|
2129
|
-
const n = W(6), i = ci();
|
2130
|
-
let r;
|
2131
|
-
n[0] === Symbol.for("react.memo_cache_sentinel") ? (r = {}, n[0] = r) : r = n[0];
|
2132
|
-
const [a, o] = z(r);
|
2133
|
-
let s, c;
|
2134
|
-
return n[1] !== t || n[2] !== i || n[3] !== e ? (s = () => {
|
2135
|
-
if (!e)
|
2136
|
-
return;
|
2137
|
-
const l = li(i, e, t, "").subscribe((p) => {
|
2138
|
-
o(p);
|
2139
|
-
});
|
2140
|
-
return () => {
|
2141
|
-
l == null || l.unsubscribe();
|
2142
|
-
};
|
2143
|
-
}, c = [i, e, t], n[1] = t, n[2] = i, n[3] = e, n[4] = s, n[5] = c) : (s = n[4], c = n[5]), V(s, c), a;
|
2144
|
-
}
|
2145
|
-
function fo(t) {
|
2146
|
-
var v, C, _, x, I, T, A, k;
|
2147
|
-
const e = W(39), {
|
2148
|
-
documentId: n,
|
2149
|
-
documentType: i,
|
2150
|
-
mainDocumentState: r,
|
2151
|
-
onFocusPath: a,
|
2152
|
-
onStructureParams: o,
|
2153
|
-
refs: s,
|
2154
|
-
searchParams: c,
|
2155
|
-
structureParams: l
|
2156
|
-
} = t, {
|
2157
|
-
t: p
|
2158
|
-
} = Te(xe), d = ni();
|
2159
|
-
let m;
|
2160
|
-
e[0] !== ((v = r == null ? void 0 : r.document) == null ? void 0 : v._id) || e[1] !== ((C = r == null ? void 0 : r.document) == null ? void 0 : C._type) || e[2] !== c ? (m = ($) => {
|
2161
|
-
var N, M;
|
2162
|
-
return /* @__PURE__ */ u(pt, { ...$, state: {
|
2163
|
-
id: (N = r == null ? void 0 : r.document) == null ? void 0 : N._id,
|
2164
|
-
type: (M = r == null ? void 0 : r.document) == null ? void 0 : M._type,
|
2165
|
-
_searchParams: Object.entries(c)
|
2166
|
-
} });
|
2167
|
-
}, e[0] = (_ = r == null ? void 0 : r.document) == null ? void 0 : _._id, e[1] = (x = r == null ? void 0 : r.document) == null ? void 0 : x._type, e[2] = c, e[3] = m) : m = e[3];
|
2168
|
-
const f = m;
|
2169
|
-
let g, y;
|
2170
|
-
e[4] !== ((I = r == null ? void 0 : r.document) == null ? void 0 : I._type) || e[5] !== d ? (y = d.get(((T = r == null ? void 0 : r.document) == null ? void 0 : T._type) || "shoe"), e[4] = (A = r == null ? void 0 : r.document) == null ? void 0 : A._type, e[5] = d, e[6] = y) : y = e[6], g = y;
|
2171
|
-
const h = g, w = mo(((k = r == null ? void 0 : r.document) == null ? void 0 : k._id) || "", h);
|
2172
|
-
let P;
|
2173
|
-
e: {
|
2174
|
-
if (!(r != null && r.document)) {
|
2175
|
-
P = null;
|
2176
|
-
break e;
|
2177
|
-
}
|
2178
|
-
const $ = r.document;
|
2179
|
-
let N;
|
2180
|
-
e[7] !== w.draft || e[8] !== w.published || e[9] !== $ ? (N = ri({
|
2181
|
-
value: $,
|
2182
|
-
published: w.published,
|
2183
|
-
draft: w.draft
|
2184
|
-
}), e[7] = w.draft, e[8] = w.published, e[9] = $, e[10] = N) : N = e[10];
|
2185
|
-
let M;
|
2186
|
-
e[11] !== p ? (M = p("main-document.label"), e[11] = p, e[12] = M) : M = e[12];
|
2187
|
-
let D;
|
2188
|
-
e[13] !== M ? (D = /* @__PURE__ */ u(ce, { padding: 1, radius: 2, shadow: 1, children: /* @__PURE__ */ u(X, { muted: !0, size: 0, weight: "medium", children: M }) }), e[13] = M, e[14] = D) : D = e[14];
|
2189
|
-
let L;
|
2190
|
-
e[15] !== h || e[16] !== N || e[17] !== D ? (L = /* @__PURE__ */ u(ii, { ...N, schemaType: h, status: D }), e[15] = h, e[16] = N, e[17] = D, e[18] = L) : L = e[18], P = L;
|
2191
|
-
}
|
2192
|
-
const b = P;
|
2193
|
-
if (n && i) {
|
2194
|
-
let $;
|
2195
|
-
return e[19] !== n || e[20] !== i || e[21] !== a || e[22] !== o || e[23] !== c || e[24] !== l ? ($ = /* @__PURE__ */ u(po, { documentId: n, documentType: i, onFocusPath: a, onStructureParams: o, searchParams: c, structureParams: l }), e[19] = n, e[20] = i, e[21] = a, e[22] = o, e[23] = c, e[24] = l, e[25] = $) : $ = e[25], $;
|
2196
|
-
}
|
2197
|
-
let S;
|
2198
|
-
e[26] !== f || e[27] !== r || e[28] !== b || e[29] !== p ? (S = r && /* @__PURE__ */ u(ce, { padding: 3, tone: r.document ? "inherit" : "caution", children: r.document ? /* @__PURE__ */ u(ai, { __unstable_focusRing: !0, as: f, "data-as": "a", radius: 2, sizing: "border", tone: "inherit", children: b }) : /* @__PURE__ */ u(ce, { padding: 2, radius: 2, tone: "inherit", children: /* @__PURE__ */ q(ae, { gap: 3, children: [
|
2199
|
-
/* @__PURE__ */ u(me, { flex: "none", children: /* @__PURE__ */ u(X, { size: 1, children: /* @__PURE__ */ u(Lr, {}) }) }),
|
2200
|
-
/* @__PURE__ */ u(me, { flex: 1, children: /* @__PURE__ */ u(X, { size: 1, children: /* @__PURE__ */ u(oi, { t: p, i18nKey: "main-document.missing.text", components: {
|
2201
|
-
Code: "code"
|
2202
|
-
}, values: {
|
2203
|
-
path: r.path
|
2204
|
-
} }) }) })
|
2205
|
-
] }) }) }), e[26] = f, e[27] = r, e[28] = b, e[29] = p, e[30] = S) : S = e[30];
|
2206
|
-
let E;
|
2207
|
-
e[31] !== r || e[32] !== o || e[33] !== s || e[34] !== c ? (E = /* @__PURE__ */ u(oo, { mainDocumentState: r, onStructureParams: o, searchParams: c, refs: s }), e[31] = r, e[32] = o, e[33] = s, e[34] = c, e[35] = E) : E = e[35];
|
2208
|
-
let R;
|
2209
|
-
return e[36] !== S || e[37] !== E ? (R = /* @__PURE__ */ q(ae, { direction: "column", flex: 1, height: "fill", children: [
|
2210
|
-
S,
|
2211
|
-
E
|
2212
|
-
] }), e[36] = S, e[37] = E, e[38] = R) : R = e[38], R;
|
2213
|
-
}
|
2214
|
-
const ne = [];
|
2215
|
-
for (let t = 0; t < 256; ++t)
|
2216
|
-
ne.push((t + 256).toString(16).slice(1));
|
2217
|
-
function ho(t, e = 0) {
|
2218
|
-
return (ne[t[e + 0]] + ne[t[e + 1]] + ne[t[e + 2]] + ne[t[e + 3]] + "-" + ne[t[e + 4]] + ne[t[e + 5]] + "-" + ne[t[e + 6]] + ne[t[e + 7]] + "-" + ne[t[e + 8]] + ne[t[e + 9]] + "-" + ne[t[e + 10]] + ne[t[e + 11]] + ne[t[e + 12]] + ne[t[e + 13]] + ne[t[e + 14]] + ne[t[e + 15]]).toLowerCase();
|
2219
|
-
}
|
2220
|
-
let _t;
|
2221
|
-
const go = new Uint8Array(16);
|
2222
|
-
function yo() {
|
2223
|
-
if (!_t) {
|
2224
|
-
if (typeof crypto > "u" || !crypto.getRandomValues)
|
2225
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
2226
|
-
_t = crypto.getRandomValues.bind(crypto);
|
2227
|
-
}
|
2228
|
-
return _t(go);
|
2229
|
-
}
|
2230
|
-
const vo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
2231
|
-
var wn = {
|
2232
|
-
randomUUID: vo
|
2233
|
-
};
|
2234
|
-
function wo(t, e, n) {
|
2235
|
-
if (wn.randomUUID && !t)
|
2236
|
-
return wn.randomUUID();
|
2237
|
-
t = t || {};
|
2238
|
-
const i = t.random || (t.rng || yo)();
|
2239
|
-
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, ho(i);
|
2240
|
-
}
|
2241
|
-
function bo(t) {
|
2242
|
-
const e = W(2);
|
2243
|
-
let n;
|
2244
|
-
e[0] !== t ? (n = () => t || wo(), e[0] = t, e[1] = n) : n = e[1];
|
2245
|
-
const [i] = z(n);
|
2246
|
-
return i;
|
2247
|
-
}
|
2248
|
-
const Po = ge.div`
|
2249
|
-
position: relative;
|
2250
|
-
`, So = ge.div`
|
2251
|
-
position: absolute;
|
2252
|
-
top: 0;
|
2253
|
-
bottom: 0;
|
2254
|
-
left: -5px;
|
2255
|
-
width: 9px;
|
2256
|
-
z-index: 10;
|
2257
|
-
cursor: ${({
|
2258
|
-
$disabled: t
|
2259
|
-
}) => t ? "auto" : "ew-resize"};
|
2260
|
-
|
2261
|
-
/* Border */
|
2262
|
-
& > span:nth-child(1) {
|
2263
|
-
display: block;
|
2264
|
-
border-left: 1px solid var(--card-border-color);
|
2265
|
-
position: absolute;
|
2266
|
-
top: 0;
|
2267
|
-
left: 4px;
|
2268
|
-
bottom: 0;
|
2269
|
-
transition: opacity 200ms;
|
2270
|
-
}
|
2271
|
-
|
2272
|
-
${({
|
2273
|
-
$disabled: t
|
2274
|
-
}) => !t && `
|
2275
|
-
/* Hover effect */
|
2276
|
-
& > span:nth-child(2) {
|
2277
|
-
display: block;
|
2278
|
-
position: absolute;
|
2279
|
-
top: 0;
|
2280
|
-
left: 0;
|
2281
|
-
width: 9px;
|
2282
|
-
bottom: 0;
|
2283
|
-
background-color: var(--card-border-color);
|
2284
|
-
opacity: 0;
|
2285
|
-
transition: opacity 150ms;
|
2286
|
-
}
|
2287
|
-
|
2288
|
-
@media (hover: hover) {
|
2289
|
-
&:hover > span:nth-child(2) {
|
2290
|
-
opacity: 0.2;
|
2291
|
-
}
|
2292
|
-
}
|
2293
|
-
`}
|
2294
|
-
`, er = function(t) {
|
2295
|
-
const e = W(27), {
|
2296
|
-
id: n,
|
2297
|
-
order: i,
|
2298
|
-
disabled: r
|
2299
|
-
} = t, a = r === void 0 ? !1 : r, o = le(null), s = Lt(ft);
|
2300
|
-
if (s === null)
|
2301
|
-
throw Error("Panel components must be rendered within a PanelGroup container");
|
2302
|
-
const c = bo(n), {
|
2303
|
-
activeResizer: l,
|
2304
|
-
drag: p,
|
2305
|
-
startDragging: d,
|
2306
|
-
stopDragging: m,
|
2307
|
-
registerElement: f,
|
2308
|
-
unregisterElement: g
|
2309
|
-
} = s, y = l === c;
|
2310
|
-
if (s === null)
|
2311
|
-
throw Error("Panel components must be rendered within a PanelGroup container");
|
2312
|
-
let h;
|
2313
|
-
e[0] !== c || e[1] !== d ? (h = (k) => {
|
2314
|
-
d(c, k.nativeEvent);
|
2315
|
-
}, e[0] = c, e[1] = d, e[2] = h) : h = e[2];
|
2316
|
-
const w = h;
|
2317
|
-
let P;
|
2318
|
-
e[3] !== p || e[4] !== c ? (P = (k) => {
|
2319
|
-
p(c, k);
|
2320
|
-
}, e[3] = p, e[4] = c, e[5] = P) : P = e[5];
|
2321
|
-
const b = P;
|
2322
|
-
let S;
|
2323
|
-
e[6] !== m ? (S = () => {
|
2324
|
-
o.current.blur(), m();
|
2325
|
-
}, e[6] = m, e[7] = S) : S = e[7];
|
2326
|
-
const E = S;
|
2327
|
-
let R, v;
|
2328
|
-
e[8] !== a || e[9] !== y || e[10] !== b || e[11] !== E ? (R = () => {
|
2329
|
-
if (!y || a)
|
2330
|
-
return;
|
2331
|
-
const k = function() {
|
2332
|
-
const $ = document.body.style, N = document.documentElement.style, {
|
2333
|
-
cursor: M
|
2334
|
-
} = N, {
|
2335
|
-
userSelect: D
|
2336
|
-
} = $;
|
2337
|
-
return N.cursor = "ew-resize", $.userSelect = "none", () => {
|
2338
|
-
M ? N.cursor = M : N.removeProperty("cursor"), D ? $.userSelect = D : $.removeProperty("user-select");
|
2339
|
-
};
|
2340
|
-
}();
|
2341
|
-
return window.addEventListener("mousemove", b), window.addEventListener("mouseup", E), window.addEventListener("contextmenu", E), () => {
|
2342
|
-
k(), window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", E), window.removeEventListener("contextmenu", E);
|
2343
|
-
};
|
2344
|
-
}, v = [a, y, b, E], e[8] = a, e[9] = y, e[10] = b, e[11] = E, e[12] = R, e[13] = v) : (R = e[12], v = e[13]), V(R, v);
|
2345
|
-
let C, _;
|
2346
|
-
e[14] !== c || e[15] !== i || e[16] !== f || e[17] !== g ? (C = () => (f(c, {
|
2347
|
-
id: c,
|
2348
|
-
order: i,
|
2349
|
-
type: "resizer",
|
2350
|
-
el: o
|
2351
|
-
}), () => {
|
2352
|
-
g(c);
|
2353
|
-
}), _ = [c, i, f, g], e[14] = c, e[15] = i, e[16] = f, e[17] = g, e[18] = C, e[19] = _) : (C = e[18], _ = e[19]), Qe(C, _);
|
2354
|
-
let x, I;
|
2355
|
-
e[20] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ u("span", {}), x = /* @__PURE__ */ u("span", {}), e[20] = x, e[21] = I) : (x = e[20], I = e[21]);
|
2356
|
-
let T;
|
2357
|
-
e[22] !== a ? (T = /* @__PURE__ */ q(So, { $disabled: a, children: [
|
2358
|
-
I,
|
2359
|
-
x
|
2360
|
-
] }), e[22] = a, e[23] = T) : T = e[23];
|
2361
|
-
let A;
|
2362
|
-
return e[24] !== w || e[25] !== T ? (A = /* @__PURE__ */ u(Po, { onMouseDown: w, ref: o, children: T }), e[24] = w, e[25] = T, e[26] = A) : A = e[26], A;
|
2363
|
-
}, _o = (t) => {
|
2364
|
-
const e = W(8), {
|
2365
|
-
documentId: n,
|
2366
|
-
setDisplayedDocument: i,
|
2367
|
-
getCommentIntent: r
|
2368
|
-
} = t;
|
2369
|
-
let a;
|
2370
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ u(er, { order: 4 }), e[0] = a) : a = e[0];
|
2371
|
-
let o;
|
2372
|
-
e[1] !== r || e[2] !== t.children ? (o = /* @__PURE__ */ u(si, { getIntent: r, children: t.children }), e[1] = r, e[2] = t.children, e[3] = o) : o = e[3];
|
2373
|
-
let s;
|
2374
|
-
return e[4] !== n || e[5] !== i || e[6] !== o ? (s = /* @__PURE__ */ q(Pe, { children: [
|
2375
|
-
a,
|
2376
|
-
/* @__PURE__ */ u(tn, { id: "content", minWidth: 325, order: 5, children: /* @__PURE__ */ u(Ti, { documentId: n, setDisplayedDocument: i, children: o }) })
|
2377
|
-
] }), e[4] = n, e[5] = i, e[6] = o, e[7] = s) : s = e[7], s;
|
2378
|
-
}, xo = (t) => {
|
2379
|
-
const e = W(14), {
|
2380
|
-
documentId: n,
|
2381
|
-
documentsOnPage: i,
|
2382
|
-
documentType: r,
|
2383
|
-
getCommentIntent: a,
|
2384
|
-
mainDocumentState: o,
|
2385
|
-
onFocusPath: s,
|
2386
|
-
onStructureParams: c,
|
2387
|
-
searchParams: l,
|
2388
|
-
setDisplayedDocument: p,
|
2389
|
-
structureParams: d
|
2390
|
-
} = t;
|
2391
|
-
let m;
|
2392
|
-
e[0] !== n || e[1] !== r || e[2] !== i || e[3] !== o || e[4] !== s || e[5] !== c || e[6] !== l || e[7] !== d ? (m = /* @__PURE__ */ u(fo, { documentId: n, documentType: r, mainDocumentState: o, onFocusPath: s, onStructureParams: c, refs: i, searchParams: l, structureParams: d }), e[0] = n, e[1] = r, e[2] = i, e[3] = o, e[4] = s, e[5] = c, e[6] = l, e[7] = d, e[8] = m) : m = e[8];
|
2393
|
-
let f;
|
2394
|
-
return e[9] !== n || e[10] !== a || e[11] !== p || e[12] !== m ? (f = /* @__PURE__ */ u(_o, { documentId: n, getCommentIntent: a, setDisplayedDocument: p, children: m }), e[9] = n, e[10] = a, e[11] = p, e[12] = m, e[13] = f) : f = e[13], f;
|
2395
|
-
}, Eo = function(t) {
|
2396
|
-
const e = W(5), {
|
2397
|
-
children: n,
|
2398
|
-
navigate: i
|
2399
|
-
} = t;
|
2400
|
-
let r;
|
2401
|
-
e[0] !== i ? (r = (s, c) => {
|
2402
|
-
i((c === void 0 ? void 0 : c) || {}, s ? {
|
2403
|
-
preview: s
|
2404
|
-
} : {});
|
2405
|
-
}, e[0] = i, e[1] = r) : r = e[1];
|
2406
|
-
const a = r;
|
2407
|
-
let o;
|
2408
|
-
return e[2] !== n || e[3] !== a ? (o = /* @__PURE__ */ u(gr.Provider, { value: a, children: n }), e[2] = n, e[3] = a, e[4] = o) : o = e[4], o;
|
2409
|
-
};
|
2410
|
-
function To(t, e) {
|
2411
|
-
const n = W(9);
|
2412
|
-
let i;
|
2413
|
-
n[0] !== e || n[1] !== t ? (i = () => JSON.parse(localStorage.getItem(t) ?? JSON.stringify(e)), n[0] = e, n[1] = t, n[2] = i) : i = n[2];
|
2414
|
-
const [r, a] = z(i);
|
2415
|
-
let o, s;
|
2416
|
-
n[3] !== t || n[4] !== r ? (o = () => {
|
2417
|
-
localStorage.setItem(t, JSON.stringify(r));
|
2418
|
-
}, s = [t, r], n[3] = t, n[4] = r, n[5] = o, n[6] = s) : (o = n[5], s = n[6]), V(o, s);
|
2419
|
-
let c;
|
2420
|
-
return n[7] !== r ? (c = [r, a], n[7] = r, n[8] = c) : c = n[8], c;
|
2421
|
-
}
|
2422
|
-
function Co(t) {
|
2423
|
-
const e = W(11), {
|
2424
|
-
unstable_navigator: n
|
2425
|
-
} = t, i = !!(n != null && n.component), [r, a] = To("presentation/navigator", i), o = i ? r : !1;
|
2426
|
-
let s;
|
2427
|
-
e: {
|
2428
|
-
if (!i) {
|
2429
|
-
s = void 0;
|
2430
|
-
break e;
|
2431
|
-
}
|
2432
|
-
let f;
|
2433
|
-
e[0] !== a ? (f = () => a(Ro), e[0] = a, e[1] = f) : f = e[1], s = f;
|
2434
|
-
}
|
2435
|
-
const c = s;
|
2436
|
-
let l;
|
2437
|
-
e[2] !== o || e[3] !== n ? (l = function() {
|
2438
|
-
return /* @__PURE__ */ u(Pe, { children: o && /* @__PURE__ */ u($o, { ...n }) });
|
2439
|
-
}, e[2] = o, e[3] = n, e[4] = l) : l = e[4];
|
2440
|
-
const p = l;
|
2441
|
-
let d;
|
2442
|
-
e[5] !== o || e[6] !== c ? (d = {
|
2443
|
-
navigatorEnabled: o,
|
2444
|
-
toggleNavigator: c
|
2445
|
-
}, e[5] = o, e[6] = c, e[7] = d) : d = e[7];
|
2446
|
-
let m;
|
2447
|
-
return e[8] !== p || e[9] !== d ? (m = [d, p], e[8] = p, e[9] = d, e[10] = m) : m = e[10], m;
|
2448
|
-
}
|
2449
|
-
function Ro(t) {
|
2450
|
-
return !t;
|
2451
|
-
}
|
2452
|
-
function Io(t) {
|
2453
|
-
const e = W(11), {
|
2454
|
-
minWidth: n,
|
2455
|
-
maxWidth: i,
|
2456
|
-
component: r
|
2457
|
-
} = t, a = n != null && i != null && n === i;
|
2458
|
-
let o;
|
2459
|
-
e[0] !== r ? (o = /* @__PURE__ */ u(r, {}), e[0] = r, e[1] = o) : o = e[1];
|
2460
|
-
let s;
|
2461
|
-
e[2] !== i || e[3] !== n || e[4] !== o ? (s = /* @__PURE__ */ u(tn, { id: "navigator", minWidth: n, maxWidth: i, order: 1, children: o }), e[2] = i, e[3] = n, e[4] = o, e[5] = s) : s = e[5];
|
2462
|
-
let c;
|
2463
|
-
e[6] !== a ? (c = /* @__PURE__ */ u(er, { order: 2, disabled: a }), e[6] = a, e[7] = c) : c = e[7];
|
2464
|
-
let l;
|
2465
|
-
return e[8] !== s || e[9] !== c ? (l = /* @__PURE__ */ q(Pe, { children: [
|
2466
|
-
s,
|
2467
|
-
c
|
2468
|
-
] }), e[8] = s, e[9] = c, e[10] = l) : l = e[10], l;
|
2469
|
-
}
|
2470
|
-
const $o = Ut(Io), Ao = function(t) {
|
2471
|
-
const e = W(3), {
|
2472
|
-
children: n,
|
2473
|
-
params: i
|
2474
|
-
} = t;
|
2475
|
-
let r;
|
2476
|
-
r = i;
|
2477
|
-
const a = r;
|
2478
|
-
let o;
|
2479
|
-
return e[0] !== n || e[1] !== a ? (o = /* @__PURE__ */ u(yr.Provider, { value: a, children: n }), e[0] = n, e[1] = a, e[2] = o) : o = e[2], o;
|
2480
|
-
}, ko = function(t) {
|
2481
|
-
const e = W(10), {
|
2482
|
-
children: n,
|
2483
|
-
devMode: i,
|
2484
|
-
name: r,
|
2485
|
-
navigate: a,
|
2486
|
-
params: o,
|
2487
|
-
searchParams: s,
|
2488
|
-
structureParams: c
|
2489
|
-
} = t;
|
2490
|
-
let l, p;
|
2491
|
-
e[0] !== i || e[1] !== r || e[2] !== a || e[3] !== o || e[4] !== s || e[5] !== c ? (p = {
|
2492
|
-
devMode: i,
|
2493
|
-
name: r,
|
2494
|
-
navigate: a,
|
2495
|
-
params: o,
|
2496
|
-
searchParams: s,
|
2497
|
-
structureParams: c
|
2498
|
-
}, e[0] = i, e[1] = r, e[2] = a, e[3] = o, e[4] = s, e[5] = c, e[6] = p) : p = e[6], l = p;
|
2499
|
-
const d = l;
|
2500
|
-
let m;
|
2501
|
-
return e[7] !== n || e[8] !== d ? (m = /* @__PURE__ */ u(vr.Provider, { value: d, children: n }), e[7] = n, e[8] = d, e[9] = m) : m = e[9], m;
|
2502
|
-
}, Oo = Ye.create(ge.iframe`
|
2503
|
-
box-shadow: 0 0 0 1px var(--card-border-color);
|
2504
|
-
border: 0;
|
2505
|
-
max-height: 100%;
|
2506
|
-
width: 100%;
|
2507
|
-
view-transition-class: presentation-tool-iframe;
|
2508
|
-
`), Mo = ge(me)`
|
2509
|
-
position: absolute;
|
2510
|
-
inset: 0;
|
2511
|
-
background: transparent;
|
2512
|
-
`, zo = lt(function(t, e) {
|
2513
|
-
const n = W(16), {
|
2514
|
-
animate: i,
|
2515
|
-
initial: r,
|
2516
|
-
onLoad: a,
|
2517
|
-
preventClick: o,
|
2518
|
-
src: s,
|
2519
|
-
variants: c,
|
2520
|
-
style: l
|
2521
|
-
} = t, p = `presentation-tool-iframe-${Hr().replace(/[^a-zA-Z0-9-_]/g, "_")}`;
|
2522
|
-
let d;
|
2523
|
-
n[0] !== l || n[1] !== p ? (d = {
|
2524
|
-
...l,
|
2525
|
-
viewTransitionName: p
|
2526
|
-
}, n[0] = l, n[1] = p, n[2] = d) : d = n[2];
|
2527
|
-
let m;
|
2528
|
-
n[3] !== i || n[4] !== r || n[5] !== a || n[6] !== e || n[7] !== s || n[8] !== d || n[9] !== c ? (m = /* @__PURE__ */ u(Oo, { style: d, animate: i, initial: r, onLoad: a, ref: e, src: s, variants: c }), n[3] = i, n[4] = r, n[5] = a, n[6] = e, n[7] = s, n[8] = d, n[9] = c, n[10] = m) : m = n[10];
|
2529
|
-
let f;
|
2530
|
-
n[11] !== o ? (f = o && /* @__PURE__ */ u(Mo, {}), n[11] = o, n[12] = f) : f = n[12];
|
2531
|
-
let g;
|
2532
|
-
return n[13] !== m || n[14] !== f ? (g = /* @__PURE__ */ q(Pe, { children: [
|
2533
|
-
m,
|
2534
|
-
f
|
2535
|
-
] }), n[13] = m, n[14] = f, n[15] = g) : g = n[15], g;
|
2536
|
-
});
|
2537
|
-
function Lo(t) {
|
2538
|
-
const e = W(16), {
|
2539
|
-
openPopup: n,
|
2540
|
-
previewLocationOrigin: i,
|
2541
|
-
previewLocationRoute: r
|
2542
|
-
} = t, {
|
2543
|
-
t: a
|
2544
|
-
} = Te(xe);
|
2545
|
-
let o;
|
2546
|
-
e[0] !== n ? (o = (y) => {
|
2547
|
-
y.preventDefault(), n(y.currentTarget.href);
|
2548
|
-
}, e[0] = n, e[1] = o) : o = e[1];
|
2549
|
-
const s = o;
|
2550
|
-
let c;
|
2551
|
-
e[2] !== a ? (c = a("share-url.menu-item.open.text"), e[2] = a, e[3] = c) : c = e[3];
|
2552
|
-
let l;
|
2553
|
-
e[4] !== c ? (l = /* @__PURE__ */ u(X, { size: 1, children: c }), e[4] = c, e[5] = l) : l = e[5];
|
2554
|
-
let p;
|
2555
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (p = ["bottom-start"], e[6] = p) : p = e[6];
|
2556
|
-
let d;
|
2557
|
-
e[7] !== a ? (d = a("share-url.menu-item.open.text"), e[7] = a, e[8] = d) : d = e[8];
|
2558
|
-
const m = `${i}${r}`;
|
2559
|
-
let f;
|
2560
|
-
e[9] !== s || e[10] !== d || e[11] !== m ? (f = /* @__PURE__ */ u(ke, { as: "a", "aria-label": d, fontSize: 1, icon: qr, mode: "bleed", padding: 2, href: m, onClick: s, rel: "opener", target: "_blank" }), e[9] = s, e[10] = d, e[11] = m, e[12] = f) : f = e[12];
|
2561
|
-
let g;
|
2562
|
-
return e[13] !== l || e[14] !== f ? (g = /* @__PURE__ */ u(qe, { animate: !0, content: l, fallbackPlacements: p, padding: 2, placement: "bottom", portal: !0, children: f }), e[13] = l, e[14] = f, e[15] = g) : g = e[15], g;
|
2563
|
-
}
|
2564
|
-
const Uo = function(t) {
|
2565
|
-
var D;
|
2566
|
-
const e = W(27), {
|
2567
|
-
fontSize: n,
|
2568
|
-
onChange: i,
|
2569
|
-
origin: r,
|
2570
|
-
padding: a,
|
2571
|
-
prefix: o,
|
2572
|
-
suffix: s,
|
2573
|
-
value: c
|
2574
|
-
} = t, l = n === void 0 ? 1 : n, p = a === void 0 ? 3 : a, {
|
2575
|
-
t: d
|
2576
|
-
} = Te(xe), {
|
2577
|
-
basePath: m
|
2578
|
-
} = ((D = On()) == null ? void 0 : D.activeWorkspace) || {}, f = m === void 0 ? "/" : m, g = le(null), [y, h] = z(void 0), [w, P] = z(void 0);
|
2579
|
-
let b;
|
2580
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (b = (L) => {
|
2581
|
-
h(L.currentTarget.value);
|
2582
|
-
}, e[0] = b) : b = e[0];
|
2583
|
-
const S = b;
|
2584
|
-
let E;
|
2585
|
-
e[1] !== f || e[2] !== i || e[3] !== r || e[4] !== y || e[5] !== d ? (E = (L) => {
|
2586
|
-
var B;
|
2587
|
-
if (L.key === "Enter") {
|
2588
|
-
if (y === void 0)
|
2589
|
-
return;
|
2590
|
-
const J = y.startsWith("/") || y === "" ? `${r}${y}` : y;
|
2591
|
-
if (!J.startsWith(r + "/") && J !== r) {
|
2592
|
-
P(d("preview-location-input.error", {
|
2593
|
-
origin: r,
|
2594
|
-
context: "missing-origin"
|
2595
|
-
}));
|
2596
|
-
return;
|
2597
|
-
}
|
2598
|
-
if (!r && (J.startsWith(`${f}/`) || J === f)) {
|
2599
|
-
P(d("preview-location-input.error", {
|
2600
|
-
basePath: f,
|
2601
|
-
context: "same-base-path"
|
2602
|
-
}));
|
2603
|
-
return;
|
2604
|
-
}
|
2605
|
-
const ie = J === r ? r + "/" : J;
|
2606
|
-
P(void 0), h(void 0), i(ie.slice(r.length)), (B = g.current) == null || B.blur();
|
2607
|
-
}
|
2608
|
-
L.key === "Escape" && (P(void 0), h(void 0));
|
2609
|
-
}, e[1] = f, e[2] = i, e[3] = r, e[4] = y, e[5] = d, e[6] = E) : E = e[6];
|
2610
|
-
const R = E;
|
2611
|
-
let v;
|
2612
|
-
e[7] === Symbol.for("react.memo_cache_sentinel") ? (v = () => {
|
2613
|
-
P(void 0), h(void 0);
|
2614
|
-
}, e[7] = v) : v = e[7];
|
2615
|
-
const C = v;
|
2616
|
-
let _;
|
2617
|
-
e[8] === Symbol.for("react.memo_cache_sentinel") ? (_ = () => {
|
2618
|
-
P(void 0), h(void 0);
|
2619
|
-
}, e[8] = _) : _ = e[8];
|
2620
|
-
let x;
|
2621
|
-
e[9] !== r || e[10] !== c ? (x = [r, c], e[9] = r, e[10] = c, e[11] = x) : x = e[11], V(_, x);
|
2622
|
-
let I, T;
|
2623
|
-
e[12] === Symbol.for("react.memo_cache_sentinel") ? (T = {
|
2624
|
-
icon: Fr
|
2625
|
-
}, e[12] = T) : T = e[12], I = T;
|
2626
|
-
const A = w ? I : void 0;
|
2627
|
-
let k;
|
2628
|
-
e[13] !== r || e[14] !== c ? (k = () => {
|
2629
|
-
P(void 0), h(r + c);
|
2630
|
-
}, e[13] = r, e[14] = c, e[15] = k) : k = e[15];
|
2631
|
-
let $;
|
2632
|
-
e[16] === Symbol.for("react.memo_cache_sentinel") ? ($ = {
|
2633
|
-
zIndex: 1
|
2634
|
-
}, e[16] = $) : $ = e[16];
|
2635
|
-
const N = y === void 0 ? `${r}${c}` : y;
|
2636
|
-
let M;
|
2637
|
-
return e[17] !== w || e[18] !== l || e[19] !== R || e[20] !== p || e[21] !== o || e[22] !== s || e[23] !== A || e[24] !== k || e[25] !== N ? (M = /* @__PURE__ */ u(Pe, { children: /* @__PURE__ */ u(Vr, { clearButton: A, customValidity: w, fontSize: l, onBlur: C, onClear: k, onChange: S, onKeyDownCapture: R, padding: p, prefix: o, style: $, radius: 2, ref: g, space: p, suffix: s, value: N }) }), e[17] = w, e[18] = l, e[19] = R, e[20] = p, e[21] = o, e[22] = s, e[23] = A, e[24] = k, e[25] = N, e[26] = M) : M = e[26], M;
|
2638
|
-
}, Wo = Ee(() => import("./QRCodeSVG-D6VfGEbM.mjs")), kt = 24, No = 16, Do = 224, jo = ge(fi)`
|
2639
|
-
position: absolute;
|
2640
|
-
top: 50%;
|
2641
|
-
left: 50%;
|
2642
|
-
transform: translate(-50%, -50%);
|
2643
|
-
height: ${kt}px;
|
2644
|
-
width: ${kt}px;
|
2645
|
-
`, qo = Ye.create(rt), Fo = Ye.create(X), Vo = Ye.create(jo), tr = Ut(function(t) {
|
2646
|
-
const {
|
2647
|
-
canToggleSharePreviewAccess: e,
|
2648
|
-
canUseSharedPreviewAccess: n,
|
2649
|
-
initialUrl: i,
|
2650
|
-
previewLocationRoute: r,
|
2651
|
-
perspective: a
|
2652
|
-
} = t, {
|
2653
|
-
t: o
|
2654
|
-
} = Te(xe), {
|
2655
|
-
push: s
|
2656
|
-
} = Tn(), c = dt({
|
2657
|
-
apiVersion: ct
|
2658
|
-
}), l = Nt(), [p, d] = z(!0), [m, f] = z(!1), [g, y] = z(!1), [h, w] = z(null), P = m || g || p, b = he(() => h ? ia(i, h, r, Array.isArray(a) ? a.join(",") : a) : null, [i, a, r, h]), [S, E] = z(null);
|
2659
|
-
if (S)
|
2660
|
-
throw S;
|
2661
|
-
const R = re(() => {
|
2662
|
-
s({
|
2663
|
-
closable: !0,
|
2664
|
-
status: "warning",
|
2665
|
-
title: o("share-preview-menu.error_toggle-sharing", {
|
2666
|
-
context: "toggle-sharing"
|
2667
|
-
})
|
2668
|
-
});
|
2669
|
-
}, [s, o]), v = re(async () => {
|
2670
|
-
try {
|
2671
|
-
y(!0), await oa(c, "@sanity/presentation", typeof window > "u" ? "" : location.href, l == null ? void 0 : l.id), w(null);
|
2672
|
-
} catch (x) {
|
2673
|
-
E(x);
|
2674
|
-
} finally {
|
2675
|
-
y(!1);
|
2676
|
-
}
|
2677
|
-
}, [c, l == null ? void 0 : l.id]), C = re(async () => {
|
2678
|
-
try {
|
2679
|
-
f(!0);
|
2680
|
-
const x = await aa(c, "@sanity/presentation", typeof window > "u" ? "" : location.href, l == null ? void 0 : l.id);
|
2681
|
-
w(x.secret);
|
2682
|
-
} catch (x) {
|
2683
|
-
E(x);
|
2684
|
-
} finally {
|
2685
|
-
f(!1);
|
2686
|
-
}
|
2687
|
-
}, [c, l == null ? void 0 : l.id]), _ = re(() => {
|
2688
|
-
try {
|
2689
|
-
if (!b)
|
2690
|
-
throw new Error("No URL to copy");
|
2691
|
-
navigator.clipboard.writeText(b.toString()), s({
|
2692
|
-
closable: !0,
|
2693
|
-
status: "success",
|
2694
|
-
title: o("share-url.clipboard.status", {
|
2695
|
-
context: "success"
|
2696
|
-
})
|
2697
|
-
});
|
2698
|
-
} catch (x) {
|
2699
|
-
E(x);
|
2700
|
-
}
|
2701
|
-
}, [s, o, b]);
|
2702
|
-
return V(() => {
|
2703
|
-
let x = new AbortController(), I = [];
|
2704
|
-
async function T(k, $) {
|
2705
|
-
const {
|
2706
|
-
result: N,
|
2707
|
-
syncTags: M
|
2708
|
-
} = await c.fetch(Ai, {}, {
|
2709
|
-
filterResponse: !1,
|
2710
|
-
lastLiveEventId: k,
|
2711
|
-
tag: "presentation.fetch-shared-access-secret"
|
2712
|
-
});
|
2713
|
-
Array.isArray(M) && (I = M), $.aborted || w(N);
|
2714
|
-
}
|
2715
|
-
const A = c.live.events().subscribe({
|
2716
|
-
next: (k) => {
|
2717
|
-
k.type === "message" && (x.abort(), x = new AbortController(), k.tags.some(($) => I.includes($)) && T(k.id, x.signal));
|
2718
|
-
},
|
2719
|
-
error: E
|
2720
|
-
});
|
2721
|
-
return T(null, x.signal).finally(() => d(!1)), () => {
|
2722
|
-
A.unsubscribe(), x.abort();
|
2723
|
-
};
|
2724
|
-
}, [c]), /* @__PURE__ */ u(xr, { button: /* @__PURE__ */ u(ke, { "aria-label": o("preview-frame.share-button.aria-label"), fontSize: 1, icon: Er, mode: "bleed", padding: 2 }), id: "share-menu", menu: /* @__PURE__ */ u(Tr, { style: {
|
2725
|
-
maxWidth: 248
|
2726
|
-
}, padding: n ? void 0 : 0, children: n ? /* @__PURE__ */ q(Pe, { children: [
|
2727
|
-
/* @__PURE__ */ u("label", { style: {
|
2728
|
-
cursor: "pointer"
|
2729
|
-
}, children: /* @__PURE__ */ q(Cr, { columns: 2, rows: 2, gapX: 3, gapY: 1, style: {
|
2730
|
-
justifyContent: "center",
|
2731
|
-
alignItems: "center",
|
2732
|
-
gridTemplateColumns: "min-content 1fr",
|
2733
|
-
gridTemplateRows: "min-content"
|
2734
|
-
}, paddingTop: 3, paddingX: 3, children: [
|
2735
|
-
/* @__PURE__ */ u(qe, { animate: !0, content: /* @__PURE__ */ u(X, { size: 1, children: o("share-preview-menu.toggle-button.tooltip", {
|
2736
|
-
context: b ? "disable" : "enable"
|
2737
|
-
}) }), fallbackPlacements: ["bottom-start"], padding: 1, placement: "bottom", portal: !0, children: /* @__PURE__ */ u(Cn, { checked: m || b !== null && !g, readOnly: m || g, indeterminate: p, onChange: e ? b ? v : C : R }) }),
|
2738
|
-
/* @__PURE__ */ u(X, { size: 1, weight: "medium", children: o("share-preview-menu.toggle-button.label", {
|
2739
|
-
context: "first-line"
|
2740
|
-
}) }),
|
2741
|
-
/* @__PURE__ */ u("span", {}),
|
2742
|
-
/* @__PURE__ */ u(X, { muted: !0, size: 1, children: o("share-preview-menu.toggle-button.label", {
|
2743
|
-
context: "second-line"
|
2744
|
-
}) })
|
2745
|
-
] }) }),
|
2746
|
-
/* @__PURE__ */ u(me, { padding: 3, paddingTop: 2, children: /* @__PURE__ */ q(De, { space: 3, children: [
|
2747
|
-
/* @__PURE__ */ u(ce, { tone: P || !b ? "transparent" : void 0, style: {
|
2748
|
-
position: "relative",
|
2749
|
-
aspectRatio: "1 / 1",
|
2750
|
-
display: "flex",
|
2751
|
-
alignItems: "center",
|
2752
|
-
justifyContent: "center"
|
2753
|
-
}, children: /* @__PURE__ */ u(Rn, { children: P ? /* @__PURE__ */ u(qo, { muted: !0, initial: {
|
2754
|
-
opacity: 0
|
2755
|
-
}, animate: {
|
2756
|
-
opacity: 1
|
2757
|
-
}, exit: {
|
2758
|
-
opacity: 0
|
2759
|
-
} }) : b ? /* @__PURE__ */ u(Pe, { children: /* @__PURE__ */ q(Wt, { fallback: /* @__PURE__ */ u(rt, {}), children: [
|
2760
|
-
/* @__PURE__ */ u(Wo, { title: o("share-preview-menu.qr-code.title", {
|
2761
|
-
url: b.toString()
|
2762
|
-
}), value: b.toString(), size: Do, color: "var(--card-fg-color)", logoSize: kt + No }),
|
2763
|
-
/* @__PURE__ */ u(Vo, { initial: {
|
2764
|
-
opacity: -0.5
|
2765
|
-
}, animate: {
|
2766
|
-
opacity: 1.5
|
2767
|
-
}, exit: {
|
2768
|
-
opacity: 0
|
2769
|
-
} })
|
2770
|
-
] }) }) : /* @__PURE__ */ u(Fo, { muted: !0, size: 1, style: {
|
2771
|
-
maxWidth: "100px",
|
2772
|
-
textWrap: "pretty",
|
2773
|
-
textAlign: "center"
|
2774
|
-
}, initial: {
|
2775
|
-
opacity: 0
|
2776
|
-
}, animate: {
|
2777
|
-
opacity: 1
|
2778
|
-
}, exit: {
|
2779
|
-
opacity: 0
|
2780
|
-
}, children: o("share-preview-menu.qr-code.placeholder") }) }) }),
|
2781
|
-
/* @__PURE__ */ u(X, { muted: !0, size: 1, children: o("share-preview-menu.qr-code.instructions") })
|
2782
|
-
] }) }),
|
2783
|
-
/* @__PURE__ */ u(Rr, {}),
|
2784
|
-
/* @__PURE__ */ u(Ir, { disabled: !b || g, icon: $r, onClick: _, fontSize: 1, padding: 3, text: o("share-preview-menu.copy-url.text") })
|
2785
|
-
] }) : /* @__PURE__ */ u(ce, { padding: 2, tone: "caution", radius: 3, children: /* @__PURE__ */ u(X, { style: {
|
2786
|
-
textWrap: "pretty"
|
2787
|
-
}, children: o("share-preview-menu.error", {
|
2788
|
-
context: "missing-grants"
|
2789
|
-
}) }) }) }), popover: {
|
2790
|
-
animate: !0,
|
2791
|
-
constrainSize: !0,
|
2792
|
-
placement: "bottom",
|
2793
|
-
portal: !0
|
2794
|
-
} });
|
2795
|
-
});
|
2796
|
-
tr.displayName = "Memo(SharePreviewMenu)";
|
2797
|
-
const Ko = (t) => {
|
2798
|
-
const e = W(96), {
|
2799
|
-
canSharePreviewAccess: n,
|
2800
|
-
canToggleSharePreviewAccess: i,
|
2801
|
-
canUseSharedPreviewAccess: r,
|
2802
|
-
dispatch: a,
|
2803
|
-
iframe: o,
|
2804
|
-
iframeRef: s,
|
2805
|
-
initialUrl: c,
|
2806
|
-
navigatorEnabled: l,
|
2807
|
-
onPathChange: p,
|
2808
|
-
onRefresh: d,
|
2809
|
-
openPopup: m,
|
2810
|
-
overlaysConnection: f,
|
2811
|
-
perspective: g,
|
2812
|
-
previewUrl: y,
|
2813
|
-
setViewport: h,
|
2814
|
-
targetOrigin: w,
|
2815
|
-
toggleNavigator: P,
|
2816
|
-
toggleOverlay: b,
|
2817
|
-
viewport: S,
|
2818
|
-
visualEditing: E
|
2819
|
-
} = t, {
|
2820
|
-
overlaysEnabled: R
|
2821
|
-
} = E, {
|
2822
|
-
t: v
|
2823
|
-
} = Te(xe);
|
2824
|
-
let C;
|
2825
|
-
e[0] !== h || e[1] !== S ? (C = () => h(S === "desktop" ? "mobile" : "desktop"), e[0] = h, e[1] = S, e[2] = C) : C = e[2];
|
2826
|
-
const _ = C;
|
2827
|
-
let x;
|
2828
|
-
x = w === location.origin ? "" : w;
|
2829
|
-
const I = x;
|
2830
|
-
let T;
|
2831
|
-
e[3] !== a || e[4] !== s.current || e[5] !== d || e[6] !== y || e[7] !== w ? (T = () => {
|
2832
|
-
d(() => {
|
2833
|
-
s.current && (a({
|
2834
|
-
type: Sn
|
2835
|
-
}), Object.assign(s.current, {
|
2836
|
-
src: `${w}${y || "/"}`
|
2837
|
-
}));
|
2838
|
-
});
|
2839
|
-
}, e[3] = a, e[4] = s.current, e[5] = d, e[6] = y, e[7] = w, e[8] = T) : T = e[8];
|
2840
|
-
const A = T;
|
2841
|
-
let k;
|
2842
|
-
const $ = new URL(y || "/", w), {
|
2843
|
-
pathname: N,
|
2844
|
-
search: M
|
2845
|
-
} = ra($);
|
2846
|
-
k = `${N}${M}`;
|
2847
|
-
const D = k;
|
2848
|
-
let L;
|
2849
|
-
e[9] !== l || e[10] !== v || e[11] !== P ? (L = P && /* @__PURE__ */ u(me, { flex: "none", marginRight: 1, padding: 1, children: /* @__PURE__ */ u(qe, { animate: !0, content: /* @__PURE__ */ u(X, { size: 1, children: v("preview-frame.navigator.toggle-button.tooltip") }), fallbackPlacements: ["bottom-start"], padding: 2, placement: "bottom", portal: !0, children: /* @__PURE__ */ u(ke, { "aria-label": v("preview-frame.navigator.toggle-button.aria-label"), fontSize: 1, icon: Ur, mode: "bleed", onClick: P, padding: 2, selected: l }) }) }), e[9] = l, e[10] = v, e[11] = P, e[12] = L) : L = e[12];
|
2850
|
-
let B;
|
2851
|
-
e[13] === Symbol.for("react.memo_cache_sentinel") ? (B = {
|
2852
|
-
whiteSpace: "nowrap"
|
2853
|
-
}, e[13] = B) : B = e[13];
|
2854
|
-
const J = R ? "disable" : "enable";
|
2855
|
-
let ie;
|
2856
|
-
e[14] !== v || e[15] !== J ? (ie = v("preview-frame.overlay.toggle-button.tooltip", {
|
2857
|
-
context: J
|
2858
|
-
}), e[14] = v, e[15] = J, e[16] = ie) : ie = e[16];
|
2859
|
-
let de;
|
2860
|
-
e[17] !== ie ? (de = /* @__PURE__ */ u(me, { padding: 1, children: /* @__PURE__ */ u(X, { size: 1, children: ie }) }), e[17] = ie, e[18] = de) : de = e[18];
|
2861
|
-
let ye;
|
2862
|
-
e[19] === Symbol.for("react.memo_cache_sentinel") ? (ye = /* @__PURE__ */ u(me, { paddingY: 1, children: /* @__PURE__ */ u(Wr, { keys: ["Alt"], style: {
|
2863
|
-
marginTop: -4,
|
2864
|
-
marginBottom: -4
|
2865
|
-
} }) }), e[19] = ye) : ye = e[19];
|
2866
|
-
let se;
|
2867
|
-
e[20] !== de ? (se = /* @__PURE__ */ q(ae, { align: "center", style: B, children: [
|
2868
|
-
de,
|
2869
|
-
ye
|
2870
|
-
] }), e[20] = de, e[21] = se) : se = e[21];
|
2871
|
-
let ue;
|
2872
|
-
e[22] === Symbol.for("react.memo_cache_sentinel") ? (ue = ["bottom-start"], e[22] = ue) : ue = e[22];
|
2873
|
-
let pe;
|
2874
|
-
e[23] === Symbol.for("react.memo_cache_sentinel") ? (pe = {
|
2875
|
-
lineHeight: 0,
|
2876
|
-
borderRadius: 999,
|
2877
|
-
userSelect: "none"
|
2878
|
-
}, e[23] = pe) : pe = e[23];
|
2879
|
-
const fe = R ? "transparent" : void 0;
|
2880
|
-
let K;
|
2881
|
-
e[24] === Symbol.for("react.memo_cache_sentinel") ? (K = {
|
2882
|
-
margin: -4
|
2883
|
-
}, e[24] = K) : K = e[24];
|
2884
|
-
const H = o.status === "loading" || f !== "connected";
|
2885
|
-
let F;
|
2886
|
-
e[25] !== R || e[26] !== H || e[27] !== b ? (F = /* @__PURE__ */ u("div", { style: K, children: /* @__PURE__ */ u(Cn, { checked: R, onChange: b, disabled: H }) }), e[25] = R, e[26] = H, e[27] = b, e[28] = F) : F = e[28];
|
2887
|
-
const Q = !R;
|
2888
|
-
let Y;
|
2889
|
-
e[29] !== v ? (Y = v("preview-frame.overlay.toggle-button.text"), e[29] = v, e[30] = Y) : Y = e[30];
|
2890
|
-
let Z;
|
2891
|
-
e[31] !== Q || e[32] !== Y ? (Z = /* @__PURE__ */ u(me, { children: /* @__PURE__ */ u(X, { muted: Q, size: 1, weight: "medium", children: Y }) }), e[31] = Q, e[32] = Y, e[33] = Z) : Z = e[33];
|
2892
|
-
let ee;
|
2893
|
-
e[34] !== F || e[35] !== Z ? (ee = /* @__PURE__ */ q(ae, { align: "center", gap: 3, children: [
|
2894
|
-
F,
|
2895
|
-
Z
|
2896
|
-
] }), e[34] = F, e[35] = Z, e[36] = ee) : ee = e[36];
|
2897
|
-
let G;
|
2898
|
-
e[37] !== fe || e[38] !== ee ? (G = /* @__PURE__ */ u(ce, { as: "label", flex: "none", marginRight: 1, padding: 3, style: pe, tone: fe, children: ee }), e[37] = fe, e[38] = ee, e[39] = G) : G = e[39];
|
2899
|
-
let oe;
|
2900
|
-
e[40] !== se || e[41] !== G ? (oe = /* @__PURE__ */ u(qe, { animate: !0, content: se, fallbackPlacements: ue, padding: 1, placement: "bottom", portal: !0, children: G }), e[40] = se, e[41] = G, e[42] = oe) : oe = e[42];
|
2901
|
-
let ve;
|
2902
|
-
e[43] !== o.status || e[44] !== v ? (ve = o.status === "loaded" ? v("preview-frame.refresh-button.tooltip") : v("preview-frame.status", {
|
2903
|
-
context: o.status
|
2904
|
-
}), e[43] = o.status, e[44] = v, e[45] = ve) : ve = e[45];
|
2905
|
-
let Se;
|
2906
|
-
e[46] !== ve ? (Se = /* @__PURE__ */ u(X, { size: 1, children: ve }), e[46] = ve, e[47] = Se) : Se = e[47];
|
2907
|
-
let Oe;
|
2908
|
-
e[48] === Symbol.for("react.memo_cache_sentinel") ? (Oe = ["bottom-end"], e[48] = Oe) : Oe = e[48];
|
2909
|
-
let we;
|
2910
|
-
e[49] !== v ? (we = v("preview-frame.refresh-button.aria-label"), e[49] = v, e[50] = we) : we = e[50];
|
2911
|
-
const Me = o.status === "reloading" || o.status === "refreshing";
|
2912
|
-
let _e;
|
2913
|
-
e[51] !== A || e[52] !== we || e[53] !== Me ? (_e = /* @__PURE__ */ u(ke, { "aria-label": we, fontSize: 1, icon: Nr, mode: "bleed", loading: Me, onClick: A, padding: 2 }), e[51] = A, e[52] = we, e[53] = Me, e[54] = _e) : _e = e[54];
|
2914
|
-
let be;
|
2915
|
-
e[55] !== Se || e[56] !== _e ? (be = /* @__PURE__ */ u(me, { padding: 1, children: /* @__PURE__ */ u(qe, { animate: !0, content: Se, fallbackPlacements: Oe, padding: 2, placement: "bottom", portal: !0, children: _e }) }), e[55] = Se, e[56] = _e, e[57] = be) : be = e[57];
|
2916
|
-
let ze;
|
2917
|
-
e[58] !== m || e[59] !== I || e[60] !== D ? (ze = /* @__PURE__ */ u(me, { padding: 1, children: /* @__PURE__ */ u(Lo, { openPopup: m, previewLocationOrigin: I, previewLocationRoute: D }) }), e[58] = m, e[59] = I, e[60] = D, e[61] = ze) : ze = e[61];
|
2918
|
-
let Ce;
|
2919
|
-
e[62] !== p || e[63] !== I || e[64] !== D || e[65] !== be || e[66] !== ze ? (Ce = /* @__PURE__ */ u(me, { flex: 1, marginX: 1, children: /* @__PURE__ */ u(Uo, { prefix: be, onChange: p, origin: I, suffix: ze, value: D }) }), e[62] = p, e[63] = I, e[64] = D, e[65] = be, e[66] = ze, e[67] = Ce) : Ce = e[67];
|
2920
|
-
const Ke = S === "desktop" ? "narrow" : "full";
|
2921
|
-
let Le;
|
2922
|
-
e[68] !== v || e[69] !== Ke ? (Le = v("preview-frame.viewport-button.tooltip", {
|
2923
|
-
context: Ke
|
2924
|
-
}), e[68] = v, e[69] = Ke, e[70] = Le) : Le = e[70];
|
2925
|
-
let Re;
|
2926
|
-
e[71] !== Le ? (Re = /* @__PURE__ */ u(X, { size: 1, children: Le }), e[71] = Le, e[72] = Re) : Re = e[72];
|
2927
|
-
let Ne;
|
2928
|
-
e[73] === Symbol.for("react.memo_cache_sentinel") ? (Ne = ["bottom-start"], e[73] = Ne) : Ne = e[73];
|
2929
|
-
let Ie;
|
2930
|
-
e[74] !== v ? (Ie = v("preview-frame.viewport-button.aria-label"), e[74] = v, e[75] = Ie) : Ie = e[75];
|
2931
|
-
const je = S === "desktop" ? Dr : jr;
|
2932
|
-
let $e;
|
2933
|
-
e[76] !== Ie || e[77] !== je || e[78] !== _ ? ($e = /* @__PURE__ */ u(ke, { "aria-label": Ie, fontSize: 1, icon: je, mode: "bleed", onClick: _, padding: 2 }), e[76] = Ie, e[77] = je, e[78] = _, e[79] = $e) : $e = e[79];
|
2934
|
-
let O;
|
2935
|
-
e[80] !== Re || e[81] !== $e ? (O = /* @__PURE__ */ u(ae, { align: "center", flex: "none", gap: 1, children: /* @__PURE__ */ u(qe, { animate: !0, content: Re, fallbackPlacements: Ne, padding: 2, placement: "bottom", portal: !0, children: $e }) }), e[80] = Re, e[81] = $e, e[82] = O) : O = e[82];
|
2936
|
-
let j;
|
2937
|
-
e[83] !== n || e[84] !== i || e[85] !== r || e[86] !== c || e[87] !== g || e[88] !== D ? (j = n && /* @__PURE__ */ u(ae, { align: "center", flex: "none", gap: 1, paddingX: 1, children: /* @__PURE__ */ u(tr, { canToggleSharePreviewAccess: i, canUseSharedPreviewAccess: r, previewLocationRoute: D, initialUrl: c, perspective: g }) }), e[83] = n, e[84] = i, e[85] = r, e[86] = c, e[87] = g, e[88] = D, e[89] = j) : j = e[89];
|
2938
|
-
let U;
|
2939
|
-
return e[90] !== oe || e[91] !== Ce || e[92] !== O || e[93] !== j || e[94] !== L ? (U = /* @__PURE__ */ q(Pe, { children: [
|
2940
|
-
L,
|
2941
|
-
oe,
|
2942
|
-
Ce,
|
2943
|
-
O,
|
2944
|
-
j
|
2945
|
-
] }), e[90] = oe, e[91] = Ce, e[92] = O, e[93] = j, e[94] = L, e[95] = U) : U = e[95], U;
|
2946
|
-
}, Ho = (t) => {
|
2947
|
-
var c;
|
2948
|
-
const e = W(6), n = Bo;
|
2949
|
-
let i;
|
2950
|
-
e[0] !== t ? (i = (c = t.options) != null && c.component ? An(t.options.component, {
|
2951
|
-
...t,
|
2952
|
-
renderDefault: n
|
2953
|
-
}) : n(t), e[0] = t, e[1] = i) : i = e[1];
|
2954
|
-
const r = i;
|
2955
|
-
let a;
|
2956
|
-
e[2] === Symbol.for("react.memo_cache_sentinel") ? (a = {
|
2957
|
-
position: "relative"
|
2958
|
-
}, e[2] = a) : a = e[2];
|
2959
|
-
let o;
|
2960
|
-
e[3] === Symbol.for("react.memo_cache_sentinel") ? (o = {
|
2961
|
-
minHeight: 0
|
2962
|
-
}, e[3] = o) : o = e[3];
|
2963
|
-
let s;
|
2964
|
-
return e[4] !== r ? (s = /* @__PURE__ */ u(ce, { flex: "none", padding: 2, borderBottom: !0, style: a, children: /* @__PURE__ */ u(ae, { align: "center", style: o, children: r }) }), e[4] = r, e[5] = s) : s = e[5], s;
|
2965
|
-
};
|
2966
|
-
function Go(t) {
|
2967
|
-
const e = W(2);
|
2968
|
-
let n;
|
2969
|
-
return e[0] !== t ? (n = () => /* @__PURE__ */ u(Ho, { ...t }), e[0] = t, e[1] = n) : n = e[1], n;
|
2970
|
-
}
|
2971
|
-
function Bo(t) {
|
2972
|
-
return An(Ko, t);
|
2973
|
-
}
|
2974
|
-
const xt = Ye.create(ae), nr = Ut(lt(function(t, e) {
|
2975
|
-
const {
|
2976
|
-
dispatch: n,
|
2977
|
-
iframe: i,
|
2978
|
-
header: r,
|
2979
|
-
initialUrl: a,
|
2980
|
-
loadersConnection: o,
|
2981
|
-
overlaysConnection: s,
|
2982
|
-
viewport: c
|
2983
|
-
} = t, {
|
2984
|
-
t: l
|
2985
|
-
} = Te(xe), {
|
2986
|
-
devMode: p
|
2987
|
-
} = Mt(), d = Ar(), m = le(null), f = Go({
|
2988
|
-
...t,
|
2989
|
-
iframeRef: m,
|
2990
|
-
options: r
|
2991
|
-
});
|
2992
|
-
Gr(e, () => m.current);
|
2993
|
-
const g = i.status === "loading" || i.status === "reloading", [y, h] = z(!1), w = i.status === "refreshing", [P, b] = z(!1), S = g || w || s === "connecting", E = re(() => {
|
2994
|
-
m.current && (m.current.src = a.toString(), n({
|
2995
|
-
type: Sn
|
2996
|
-
}));
|
2997
|
-
}, [n, a]), R = re(() => {
|
2998
|
-
C(!0);
|
2999
|
-
}, []), [v, C] = z(!1), [_, x] = z(!1);
|
3000
|
-
V(() => {
|
3001
|
-
if (!(g || w) && (s === "connecting" || s === "reconnecting")) {
|
3002
|
-
const L = setTimeout(() => {
|
3003
|
-
x(!0);
|
3004
|
-
}, 5e3);
|
3005
|
-
return () => clearTimeout(L);
|
3006
|
-
}
|
3007
|
-
}, [s, g, w]), V(() => {
|
3008
|
-
if (!(g || w || !_)) {
|
3009
|
-
if (s === "connected" && (b(!1), x(!1), h(!1), C(!1)), s === "connecting") {
|
3010
|
-
const L = setTimeout(() => {
|
3011
|
-
h(!0), console.error("Unable to connect to visual editing. Make sure you've setup '@sanity/visual-editing' correctly");
|
3012
|
-
}, rn);
|
3013
|
-
return () => clearTimeout(L);
|
3014
|
-
}
|
3015
|
-
if (s === "reconnecting") {
|
3016
|
-
const L = setTimeout(() => {
|
3017
|
-
h(!0), b(!0);
|
3018
|
-
}, rn);
|
3019
|
-
return () => clearTimeout(L);
|
3020
|
-
}
|
3021
|
-
}
|
3022
|
-
}, [g, s, w, _]);
|
3023
|
-
const I = re(() => {
|
3024
|
-
n({
|
3025
|
-
type: _n
|
3026
|
-
});
|
3027
|
-
}, [n]);
|
3028
|
-
V(() => {
|
3029
|
-
if (!m.current)
|
3030
|
-
return;
|
3031
|
-
const L = m.current;
|
3032
|
-
function B() {
|
3033
|
-
L === document.activeElement && L.dispatchEvent(new MouseEvent("mousedown", {
|
3034
|
-
bubbles: !0,
|
3035
|
-
cancelable: !0
|
3036
|
-
}));
|
3037
|
-
}
|
3038
|
-
return window.addEventListener("blur", B), () => {
|
3039
|
-
window.removeEventListener("blur", B);
|
3040
|
-
};
|
3041
|
-
}, []);
|
3042
|
-
const T = he(() => (g || s === "connecting" && i.status !== "refreshing") && !v, [v, i.status, g, s]), A = Br(re(() => () => {
|
3043
|
-
}, []), () => CSS.supports("(view-transition-name: test)")), k = he(() => [
|
3044
|
-
T ? "background" : "active",
|
3045
|
-
g ? "reloading" : "idle",
|
3046
|
-
// If CSS View Transitions are supported, then transition iframe viewport dimensions with that instead of Motion
|
3047
|
-
A ? "" : c,
|
3048
|
-
_ && !v ? "timedOut" : ""
|
3049
|
-
], [A, v, g, T, _, c]), [$, N] = z(c), [M, D] = z(Et[c]);
|
3050
|
-
return V(() => {
|
3051
|
-
if (A && c !== $) {
|
3052
|
-
const L = () => {
|
3053
|
-
N(c), D(Et[c]);
|
3054
|
-
};
|
3055
|
-
!d && "startViewTransition" in document && typeof document.startViewTransition == "function" ? document.startViewTransition(() => Ci(() => L())) : L();
|
3056
|
-
}
|
3057
|
-
}, [A, d, $, c]), /* @__PURE__ */ u(Ii, { transition: d ? {
|
3058
|
-
duration: 0
|
3059
|
-
} : void 0, children: /* @__PURE__ */ q(kr, { delay: 1e3, children: [
|
3060
|
-
/* @__PURE__ */ u(f, {}),
|
3061
|
-
/* @__PURE__ */ u(ce, { flex: 1, tone: "transparent", children: /* @__PURE__ */ q(ae, { align: "center", height: "fill", justify: "center", padding: (A ? $ : c) === "desktop" ? 0 : 2, sizing: "border", style: {
|
3062
|
-
position: "relative",
|
3063
|
-
cursor: S ? "wait" : void 0
|
3064
|
-
}, children: [
|
3065
|
-
/* @__PURE__ */ u(Rn, { children: !P && !g && !w && // viewport, // using CSS View Transitions instead of framer motion to drive this
|
3066
|
-
_ && !v ? /* @__PURE__ */ u(xt, { initial: "initial", animate: "animate", exit: "exit", variants: bn, justify: "center", align: "center", style: {
|
3067
|
-
inset: "0",
|
3068
|
-
position: "absolute",
|
3069
|
-
backdropFilter: y ? "blur(16px) saturate(0.5) grayscale(0.5)" : "blur(2px)",
|
3070
|
-
transition: "backdrop-filter 0.2s ease-in-out",
|
3071
|
-
// @TODO Because of Safari we have to do this
|
3072
|
-
WebkitBackdropFilter: y ? "blur(16px) saturate(0.5) grayscale(0.5)" : "blur(2px)",
|
3073
|
-
WebkitTransition: "-webkit-backdrop-filter 0.2s ease-in-out",
|
3074
|
-
zIndex: 1
|
3075
|
-
}, children: /* @__PURE__ */ q(ae, { style: {
|
3076
|
-
...st[c]
|
3077
|
-
}, justify: "center", align: "center", direction: "column", gap: 4, children: [
|
3078
|
-
y && /* @__PURE__ */ u(ke, { disabled: !0, fontSize: 1, mode: "ghost", text: l("preview-frame.continue-button.text"), style: {
|
3079
|
-
opacity: 0
|
3080
|
-
} }),
|
3081
|
-
/* @__PURE__ */ u(ce, { radius: 2, tone: y ? "caution" : "inherit", padding: 4, shadow: 1, children: /* @__PURE__ */ q(ae, { justify: "center", align: "center", direction: "column", gap: 4, children: [
|
3082
|
-
/* @__PURE__ */ u(rt, { muted: !0 }),
|
3083
|
-
/* @__PURE__ */ u(X, { muted: !0, size: 1, children: y ? l("preview-frame.status", {
|
3084
|
-
context: "timeout"
|
3085
|
-
}) : l("preview-frame.status", {
|
3086
|
-
context: "connecting"
|
3087
|
-
}) })
|
3088
|
-
] }) }),
|
3089
|
-
y && /* @__PURE__ */ u(
|
3090
|
-
ke,
|
3091
|
-
{
|
3092
|
-
fontSize: 1,
|
3093
|
-
tone: "critical",
|
3094
|
-
onClick: R,
|
3095
|
-
text: l("preview-frame.continue-button.text")
|
3096
|
-
}
|
3097
|
-
)
|
3098
|
-
] }) }) : (g || s === "connecting" && i.status !== "refreshing") && !v ? /* @__PURE__ */ u(xt, { initial: "initial", animate: "animate", exit: "exit", variants: bn, justify: "center", align: "center", style: {
|
3099
|
-
inset: "0",
|
3100
|
-
position: "absolute"
|
3101
|
-
// boxShadow: '0 0 0 1px var(--card-shadow-outline-color)',
|
3102
|
-
}, children: /* @__PURE__ */ q(ae, { style: {
|
3103
|
-
...st[c]
|
3104
|
-
}, justify: "center", align: "center", direction: "column", gap: 4, children: [
|
3105
|
-
/* @__PURE__ */ u(rt, { muted: !0 }),
|
3106
|
-
/* @__PURE__ */ u(X, { muted: !0, size: 1, children: l("preview-frame.status", {
|
3107
|
-
context: "loading"
|
3108
|
-
}) })
|
3109
|
-
] }) }) : P && !v ? /* @__PURE__ */ u(xt, { initial: "initial", animate: "animate", exit: "exit", variants: Qo, justify: "center", align: "center", style: {
|
3110
|
-
background: "var(--card-bg-color)",
|
3111
|
-
inset: "0",
|
3112
|
-
position: "absolute"
|
3113
|
-
}, children: /* @__PURE__ */ u(nn, { flex: 1, message: l("preview-frame.connection.error.text"), onRetry: E, onContinueAnyway: R, children: p && /* @__PURE__ */ q(Pe, { children: [
|
3114
|
-
s !== "connected" && /* @__PURE__ */ u(ce, { padding: 3, radius: 2, tone: "critical", children: /* @__PURE__ */ q(De, { space: 3, children: [
|
3115
|
-
/* @__PURE__ */ u(it, { muted: !0, size: 0, children: l("preview-frame.overlay.connection-status.label") }),
|
3116
|
-
/* @__PURE__ */ u(nt, { size: 1, children: l("channel.status", {
|
3117
|
-
context: s
|
3118
|
-
}) })
|
3119
|
-
] }) }),
|
3120
|
-
o !== "connected" && /* @__PURE__ */ u(ce, { padding: 3, radius: 2, tone: "critical", children: /* @__PURE__ */ q(De, { space: 3, children: [
|
3121
|
-
/* @__PURE__ */ u(it, { muted: !0, size: 0, children: l("preview-frame.loader.connection-status.label") }),
|
3122
|
-
/* @__PURE__ */ u(nt, { size: 1, children: l("channel.status", {
|
3123
|
-
context: o
|
3124
|
-
}) })
|
3125
|
-
] }) })
|
3126
|
-
] }) }) }) : null }),
|
3127
|
-
/* @__PURE__ */ u(zo, { animate: k, initial: ["background"], onLoad: I, preventClick: T, ref: m, src: a.toString(), style: M, variants: Et })
|
3128
|
-
] }) })
|
3129
|
-
] }) });
|
3130
|
-
}));
|
3131
|
-
nr.displayName = "Memo(ForwardRef(Preview))";
|
3132
|
-
const st = {
|
3133
|
-
desktop: {
|
3134
|
-
width: "100%",
|
3135
|
-
height: "100%"
|
3136
|
-
},
|
3137
|
-
mobile: {
|
3138
|
-
width: 375,
|
3139
|
-
height: 650
|
3140
|
-
}
|
3141
|
-
}, bn = {
|
3142
|
-
initial: {
|
3143
|
-
opacity: 1
|
3144
|
-
},
|
3145
|
-
animate: {
|
3146
|
-
opacity: [0, 0, 1]
|
3147
|
-
},
|
3148
|
-
exit: {
|
3149
|
-
opacity: [1, 0, 0]
|
3150
|
-
}
|
3151
|
-
}, Qo = {
|
3152
|
-
initial: {
|
3153
|
-
opacity: 1
|
3154
|
-
},
|
3155
|
-
animate: {
|
3156
|
-
opacity: [0, 0, 1]
|
3157
|
-
},
|
3158
|
-
exit: {
|
3159
|
-
opacity: [1, 0, 0]
|
3160
|
-
}
|
3161
|
-
}, Et = {
|
3162
|
-
desktop: {
|
3163
|
-
...st.desktop,
|
3164
|
-
boxShadow: "0 0 0 0px var(--card-border-color)"
|
3165
|
-
},
|
3166
|
-
mobile: {
|
3167
|
-
...st.mobile,
|
3168
|
-
boxShadow: "0 0 0 1px var(--card-border-color)"
|
3169
|
-
},
|
3170
|
-
background: {
|
3171
|
-
opacity: 0,
|
3172
|
-
scale: 1
|
3173
|
-
},
|
3174
|
-
idle: {
|
3175
|
-
scale: 1
|
3176
|
-
},
|
3177
|
-
reloading: {
|
3178
|
-
scale: [1, 1, 1, 0.98]
|
3179
|
-
},
|
3180
|
-
active: {
|
3181
|
-
opacity: [0, 0, 1],
|
3182
|
-
scale: 1
|
3183
|
-
},
|
3184
|
-
timedOut: {
|
3185
|
-
opacity: [0, 0, 1]
|
3186
|
-
}
|
3187
|
-
};
|
3188
|
-
function Xo() {
|
3189
|
-
let t = !1;
|
3190
|
-
return (...e) => {
|
3191
|
-
t || (console.warn(...e), t = !0);
|
3192
|
-
};
|
3193
|
-
}
|
3194
|
-
const Jo = Xo();
|
3195
|
-
function Yo(t, e) {
|
3196
|
-
hi(t);
|
3197
|
-
const [n, i] = z({}), [r, a] = z({}), o = le(""), s = re((c, l, p = []) => {
|
3198
|
-
const d = p.filter((m) => "_projectId" in m && m._projectId ? (Jo("Cross dataset references are not supported yet, ignoring source document", m), !1) : m);
|
3199
|
-
(l === "published" ? i : a)((m) => {
|
3200
|
-
const f = {};
|
3201
|
-
for (const y of d)
|
3202
|
-
f[y._id] = y;
|
3203
|
-
if (o.current !== e.current.url)
|
3204
|
-
return o.current = e.current.url, {
|
3205
|
-
[c]: f
|
3206
|
-
};
|
3207
|
-
const g = m[c];
|
3208
|
-
return Ei(g, f) ? m : {
|
3209
|
-
...m,
|
3210
|
-
[c]: f
|
3211
|
-
};
|
3212
|
-
});
|
3213
|
-
}, [e]);
|
3214
|
-
return [he(() => {
|
3215
|
-
const c = Object.values(t === "published" ? n : r).reduce((l, p) => (Object.values(p).forEach((d) => {
|
3216
|
-
l[d._id] = d;
|
3217
|
-
}), l), {});
|
3218
|
-
return Object.values(c);
|
3219
|
-
}, [t, r, n]), s];
|
3220
|
-
}
|
3221
|
-
function rr(t, e) {
|
3222
|
-
return t instanceof Function ? t(e) : t;
|
3223
|
-
}
|
3224
|
-
function Zo(t, e) {
|
3225
|
-
var n;
|
3226
|
-
if (t.resolve) {
|
3227
|
-
const i = (n = t.resolve(e)) == null ? void 0 : n.filter;
|
3228
|
-
return i ? `// groq
|
3229
|
-
*[${i}][0]{_id, _type}` : void 0;
|
3230
|
-
}
|
3231
|
-
return "type" in t ? `// groq
|
3232
|
-
*[_type == "${t.type}"][0]{_id, _type}` : `// groq
|
3233
|
-
*[${rr(t.filter, e)}][0]{_id, _type}`;
|
3234
|
-
}
|
3235
|
-
function es(t, e) {
|
3236
|
-
var n;
|
3237
|
-
return t.resolve ? ((n = t.resolve(e)) == null ? void 0 : n.params) ?? e.params : "type" in t ? {} : rr(t.params, e) ?? e.params;
|
3238
|
-
}
|
3239
|
-
function ts(t, e) {
|
3240
|
-
const n = Array.isArray(t) ? t : [t];
|
3241
|
-
for (t of n) {
|
3242
|
-
let i, r = t;
|
3243
|
-
if (typeof t == "string")
|
3244
|
-
try {
|
3245
|
-
const a = new URL(t);
|
3246
|
-
i = a.origin, r = a.pathname;
|
3247
|
-
} catch {
|
3248
|
-
}
|
3249
|
-
if (!(i && e.origin !== i))
|
3250
|
-
try {
|
3251
|
-
const a = la(r, {
|
3252
|
-
decode: decodeURIComponent
|
3253
|
-
})(e.pathname);
|
3254
|
-
if (a) {
|
3255
|
-
const {
|
3256
|
-
params: o,
|
3257
|
-
path: s
|
3258
|
-
} = a;
|
3259
|
-
return {
|
3260
|
-
origin: i,
|
3261
|
-
params: o,
|
3262
|
-
path: s
|
3263
|
-
};
|
3264
|
-
}
|
3265
|
-
} catch {
|
3266
|
-
throw new Error(`"${t}" is not a valid route pattern`);
|
3267
|
-
}
|
3268
|
-
}
|
3269
|
-
}
|
3270
|
-
function ns(t) {
|
3271
|
-
var E, R;
|
3272
|
-
const e = W(16), {
|
3273
|
-
navigate: n,
|
3274
|
-
navigationHistory: i,
|
3275
|
-
path: r,
|
3276
|
-
previewUrl: a,
|
3277
|
-
resolvers: o
|
3278
|
-
} = t;
|
3279
|
-
let s;
|
3280
|
-
e[0] !== o ? (s = o === void 0 ? [] : o, e[0] = o, e[1] = s) : s = e[1];
|
3281
|
-
const c = s, {
|
3282
|
-
state: l
|
3283
|
-
} = jt();
|
3284
|
-
let p;
|
3285
|
-
e[2] === Symbol.for("react.memo_cache_sentinel") ? (p = {
|
3286
|
-
apiVersion: ct
|
3287
|
-
}, e[2] = p) : p = e[2];
|
3288
|
-
const d = dt(p);
|
3289
|
-
let m;
|
3290
|
-
e[3] !== r || e[4] !== l ? (m = r || ((R = (E = l._searchParams) == null ? void 0 : E.find(rs)) == null ? void 0 : R[1]) || "", e[3] = r, e[4] = l, e[5] = m) : m = e[5];
|
3291
|
-
const f = m, [g, y] = z(void 0), h = le(void 0);
|
3292
|
-
let w;
|
3293
|
-
e[6] !== n || e[7] !== i ? (w = (v, C) => {
|
3294
|
-
var _, x;
|
3295
|
-
(!v || h.current !== v._id) && (y({
|
3296
|
-
document: v,
|
3297
|
-
path: C.pathname
|
3298
|
-
}), h.current = v == null ? void 0 : v._id, ((_ = i.at(-1)) == null ? void 0 : _.id) === ((x = i.at(-2)) == null ? void 0 : x.id) && (n == null || n({
|
3299
|
-
id: v == null ? void 0 : v._id,
|
3300
|
-
type: v == null ? void 0 : v._type
|
3301
|
-
})));
|
3302
|
-
}, e[6] = n, e[7] = i, e[8] = w) : w = e[8];
|
3303
|
-
const P = In(w);
|
3304
|
-
let b, S;
|
3305
|
-
return e[9] !== d || e[10] !== P || e[11] !== a || e[12] !== f || e[13] !== c ? (b = () => {
|
3306
|
-
const v = typeof a == "string" ? a : typeof a == "object" && (a == null ? void 0 : a.origin) || location.origin, C = new URL(f, v);
|
3307
|
-
if (c.length) {
|
3308
|
-
let _;
|
3309
|
-
for (const x of c) {
|
3310
|
-
const I = ts(x.route, C);
|
3311
|
-
if (I) {
|
3312
|
-
_ = {
|
3313
|
-
context: I,
|
3314
|
-
resolver: x
|
3315
|
-
};
|
3316
|
-
break;
|
3317
|
-
}
|
3318
|
-
}
|
3319
|
-
if (_) {
|
3320
|
-
const x = Zo(_.resolver, _.context), I = es(_.resolver, _.context);
|
3321
|
-
if (x) {
|
3322
|
-
const T = new AbortController(), A = {
|
3323
|
-
perspective: "previewDrafts",
|
3324
|
-
signal: T.signal
|
3325
|
-
};
|
3326
|
-
return d.fetch(x, I, A).then((k) => P(k, C)).catch((k) => {
|
3327
|
-
k instanceof Error && k.name === "AbortError" || (y({
|
3328
|
-
document: void 0,
|
3329
|
-
path: C.pathname
|
3330
|
-
}), h.current = void 0);
|
3331
|
-
}), () => {
|
3332
|
-
T.abort();
|
3333
|
-
};
|
3334
|
-
}
|
3335
|
-
}
|
3336
|
-
}
|
3337
|
-
y(void 0), h.current = void 0;
|
3338
|
-
}, S = [d, P, a, f, c], e[9] = d, e[10] = P, e[11] = a, e[12] = f, e[13] = c, e[14] = b, e[15] = S) : (b = e[14], S = e[15]), V(b, S), g;
|
3339
|
-
}
|
3340
|
-
function rs(t) {
|
3341
|
-
const [e] = t;
|
3342
|
-
return e === "preview";
|
3343
|
-
}
|
3344
|
-
function is(t) {
|
3345
|
-
var n;
|
3346
|
-
if (t === void 0)
|
3347
|
-
return;
|
3348
|
-
const e = (n = decodeURIComponent(t)) == null ? void 0 : n.split(".");
|
3349
|
-
return e[0] === "drafts" && e.shift(), e.join(".");
|
3350
|
-
}
|
3351
|
-
function as(t) {
|
3352
|
-
if (t !== void 0)
|
3353
|
-
return Vn.toString(_a(decodeURIComponent(t)));
|
3354
|
-
}
|
3355
|
-
function os(t) {
|
3356
|
-
return {
|
3357
|
-
id: is(t.id),
|
3358
|
-
path: as(t.path),
|
3359
|
-
type: t.type
|
3360
|
-
};
|
3361
|
-
}
|
3362
|
-
function tt(t) {
|
3363
|
-
return Object.fromEntries(Object.entries(t).filter(([, e]) => e !== void 0 && e !== "" && e !== null));
|
3364
|
-
}
|
3365
|
-
function ss({
|
3366
|
-
initialPreviewUrl: t,
|
3367
|
-
routerNavigate: e,
|
3368
|
-
routerState: n,
|
3369
|
-
routerSearchParams: i,
|
3370
|
-
frameStateRef: r
|
3371
|
-
}) {
|
3372
|
-
const a = he(() => {
|
3373
|
-
const {
|
3374
|
-
id: d,
|
3375
|
-
path: m,
|
3376
|
-
type: f
|
3377
|
-
} = os(n);
|
3378
|
-
return {
|
3379
|
-
id: d,
|
3380
|
-
type: f,
|
3381
|
-
path: m,
|
3382
|
-
preview: i.preview || `${t.pathname}${t.search}`,
|
3383
|
-
perspective: i.perspective,
|
3384
|
-
viewport: i.viewport,
|
3385
|
-
inspect: i.inspect,
|
3386
|
-
rev: i.rev,
|
3387
|
-
since: i.since,
|
3388
|
-
template: i.template,
|
3389
|
-
templateParams: i.templateParams,
|
3390
|
-
view: i.view,
|
3391
|
-
// assist
|
3392
|
-
pathKey: i.pathKey,
|
3393
|
-
instruction: i.instruction,
|
3394
|
-
// comments
|
3395
|
-
comment: i.comment,
|
3396
|
-
changesInspectorTab: i.changesInspectorTab
|
3397
|
-
};
|
3398
|
-
}, [n, i, t]), o = he(() => tt({
|
3399
|
-
inspect: a.inspect,
|
3400
|
-
path: a.path,
|
3401
|
-
rev: a.rev,
|
3402
|
-
since: a.since,
|
3403
|
-
template: a.template,
|
3404
|
-
templateParams: a.templateParams,
|
3405
|
-
view: a.view,
|
3406
|
-
// assist
|
3407
|
-
pathKey: a.pathKey,
|
3408
|
-
instruction: a.instruction,
|
3409
|
-
// comments
|
3410
|
-
comment: a.comment,
|
3411
|
-
changesInspectorTab: a.changesInspectorTab
|
3412
|
-
}), [a.changesInspectorTab, a.comment, a.inspect, a.instruction, a.path, a.pathKey, a.rev, a.since, a.template, a.templateParams, a.view]), s = he(() => tt({
|
3413
|
-
perspective: a.perspective,
|
3414
|
-
preview: a.preview,
|
3415
|
-
viewport: a.viewport
|
3416
|
-
}), [a.perspective, a.preview, a.viewport]), c = le(n);
|
3417
|
-
V(() => {
|
3418
|
-
c.current = n;
|
3419
|
-
}, [n]);
|
3420
|
-
const [l, p] = z([n]);
|
3421
|
-
return {
|
3422
|
-
navigate: re((d, m = {}, f) => {
|
3423
|
-
d.id && (d.id = ut(d.id));
|
3424
|
-
const {
|
3425
|
-
_searchParams: g,
|
3426
|
-
...y
|
3427
|
-
} = c.current, h = (g || []).reduce((S, [E, R]) => (S[E] = R, S), {}), w = tt({
|
3428
|
-
...y,
|
3429
|
-
...d
|
3430
|
-
}), P = tt({
|
3431
|
-
...h,
|
3432
|
-
...m
|
3433
|
-
});
|
3434
|
-
y.id !== w.id && (delete P.template, delete P.templateParams), w._searchParams = Object.entries(P).reduce((S, [E, R]) => [...S, [E, R]], []);
|
3435
|
-
const b = f ?? P.preview === r.current.url;
|
3436
|
-
p((S) => [...S, w]), e(w, {
|
3437
|
-
replace: b
|
3438
|
-
});
|
3439
|
-
}, [e, r]),
|
3440
|
-
navigationHistory: l,
|
3441
|
-
params: a,
|
3442
|
-
searchParams: s,
|
3443
|
-
structureParams: o
|
3444
|
-
};
|
3445
|
-
}
|
3446
|
-
const cs = (t) => {
|
3447
|
-
const e = W(10), [n, i] = z(ls);
|
3448
|
-
let r;
|
3449
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = (d) => {
|
3450
|
-
const m = window.open(d, "_blank");
|
3451
|
-
m && i((f) => new Set(f).add(m));
|
3452
|
-
}, e[0] = r) : r = e[0];
|
3453
|
-
const a = r;
|
3454
|
-
let o, s;
|
3455
|
-
e[1] !== t || e[2] !== n ? (o = () => {
|
3456
|
-
const d = [];
|
3457
|
-
if (n.size && t)
|
3458
|
-
for (const m of n)
|
3459
|
-
m && "closed" in m && !m.closed && d.push(t.addTarget(m));
|
3460
|
-
return () => {
|
3461
|
-
d.forEach(ds);
|
3462
|
-
};
|
3463
|
-
}, s = [t, n], e[1] = t, e[2] = n, e[3] = o, e[4] = s) : (o = e[3], s = e[4]), V(o, s);
|
3464
|
-
let c, l;
|
3465
|
-
e[5] !== n ? (c = () => {
|
3466
|
-
if (n.size) {
|
3467
|
-
const d = setInterval(() => {
|
3468
|
-
const m = /* @__PURE__ */ new Set();
|
3469
|
-
for (const f of n)
|
3470
|
-
f && "closed" in f && f.closed && m.add(f);
|
3471
|
-
m.size && i((f) => {
|
3472
|
-
const g = new Set(f);
|
3473
|
-
for (const y of m)
|
3474
|
-
g.delete(y);
|
3475
|
-
return g;
|
3476
|
-
});
|
3477
|
-
}, wr);
|
3478
|
-
return () => {
|
3479
|
-
clearInterval(d);
|
3480
|
-
};
|
3481
|
-
}
|
3482
|
-
}, l = [n], e[5] = n, e[6] = c, e[7] = l) : (c = e[6], l = e[7]), V(c, l);
|
3483
|
-
let p;
|
3484
|
-
return e[8] !== n ? (p = {
|
3485
|
-
popups: n,
|
3486
|
-
open: a
|
3487
|
-
}, e[8] = n, e[9] = p) : p = e[9], p;
|
3488
|
-
};
|
3489
|
-
function ls() {
|
3490
|
-
return /* @__PURE__ */ new Set();
|
3491
|
-
}
|
3492
|
-
function ds(t) {
|
3493
|
-
return t();
|
3494
|
-
}
|
3495
|
-
function us(t, e, n, i, r) {
|
3496
|
-
var d, m;
|
3497
|
-
const a = dt({
|
3498
|
-
apiVersion: ct
|
3499
|
-
}), o = On(), s = ((d = o == null ? void 0 : o.activeWorkspace) == null ? void 0 : d.basePath) || "/", c = ((m = o == null ? void 0 : o.activeWorkspace) == null ? void 0 : m.name) || "default", l = ms(e, s, c, i), p = fs(r && typeof t == "object" || typeof t == "function", l);
|
3500
|
-
return Bn(async () => {
|
3501
|
-
if (typeof t == "string") {
|
3502
|
-
const g = new URL(t, location.origin);
|
3503
|
-
let y = g;
|
3504
|
-
try {
|
3505
|
-
if (i) {
|
3506
|
-
const h = new URL(i, g);
|
3507
|
-
h.origin === g.origin && (y = h);
|
3508
|
-
}
|
3509
|
-
} catch {
|
3510
|
-
}
|
3511
|
-
return location.origin === y.origin && (y.pathname.startsWith(`${s}/`) || y.pathname === s) ? g : y;
|
3512
|
-
}
|
3513
|
-
const f = await (typeof t == "object" ? ga(t) : t)({
|
3514
|
-
client: a,
|
3515
|
-
previewUrlSecret: p,
|
3516
|
-
studioPreviewPerspective: Array.isArray(n) ? n.join(",") : n,
|
3517
|
-
previewSearchParam: i,
|
3518
|
-
studioBasePath: s
|
3519
|
-
});
|
3520
|
-
return new URL(f, location.origin);
|
3521
|
-
}, [...l, p]);
|
3522
|
-
}
|
3523
|
-
const ps = Symbol();
|
3524
|
-
function ms(t, e, n, i) {
|
3525
|
-
const r = W(12);
|
3526
|
-
let a;
|
3527
|
-
r[0] !== i ? (a = () => i || "", r[0] = i, r[1] = a) : a = r[1];
|
3528
|
-
const [o, s] = z(a), c = le(0);
|
3529
|
-
let l, p;
|
3530
|
-
r[2] !== o || r[3] !== i ? (l = () => {
|
3531
|
-
if (o && i)
|
3532
|
-
return window.clearTimeout(c.current), () => {
|
3533
|
-
c.current = window.setTimeout(() => {
|
3534
|
-
s("");
|
3535
|
-
}, 100);
|
3536
|
-
};
|
3537
|
-
}, p = [o, i], r[2] = o, r[3] = i, r[4] = l, r[5] = p) : (l = r[4], p = r[5]), V(l, p);
|
3538
|
-
const d = Nt();
|
3539
|
-
let m;
|
3540
|
-
const f = d == null ? void 0 : d.id;
|
3541
|
-
let g;
|
3542
|
-
return r[6] !== e || r[7] !== o || r[8] !== f || r[9] !== t || r[10] !== n ? (g = ["@sanity/presentation", e, n, t, f, ps, o], r[6] = e, r[7] = o, r[8] = f, r[9] = t, r[10] = n, r[11] = g) : g = r[11], m = g, m;
|
3543
|
-
}
|
3544
|
-
function fs(t, e) {
|
3545
|
-
const n = W(10);
|
3546
|
-
let i;
|
3547
|
-
n[0] === Symbol.for("react.memo_cache_sentinel") ? (i = {
|
3548
|
-
apiVersion: ct
|
3549
|
-
}, n[0] = i) : i = n[0];
|
3550
|
-
const r = dt(i), a = Nt(), [o, s] = z("");
|
3551
|
-
let c;
|
3552
|
-
n[1] !== r || n[2] !== (a == null ? void 0 : a.id) || n[3] !== e || n[4] !== t || n[5] !== o ? (c = t ? Bn(async () => await ha(r, "@sanity/presentation", typeof window > "u" ? "" : location.href, a == null ? void 0 : a.id), [...e, o]) : null, n[1] = r, n[2] = a == null ? void 0 : a.id, n[3] = e, n[4] = t, n[5] = o, n[6] = c) : c = n[6];
|
3553
|
-
const l = c;
|
3554
|
-
let p, d;
|
3555
|
-
return n[7] !== l ? (p = () => {
|
3556
|
-
if (!l)
|
3557
|
-
return;
|
3558
|
-
const m = setTimeout(() => {
|
3559
|
-
Xr(() => s(l.expiresAt.toString()));
|
3560
|
-
}, l.expiresAt.getTime() - Date.now());
|
3561
|
-
return () => clearTimeout(m);
|
3562
|
-
}, d = [l], n[7] = l, n[8] = p, n[9] = d) : (p = n[8], d = n[9]), V(p, d), (l == null ? void 0 : l.secret) || null;
|
3563
|
-
}
|
3564
|
-
function Tt() {
|
3565
|
-
const t = W(4);
|
3566
|
-
let e;
|
3567
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ new Map(), t[0] = e) : e = t[0];
|
3568
|
-
const [n, i] = z(e);
|
3569
|
-
let r;
|
3570
|
-
e: {
|
3571
|
-
const l = Array.from(n.values());
|
3572
|
-
if (l.find(ys)) {
|
3573
|
-
r = "connected";
|
3574
|
-
break e;
|
3575
|
-
}
|
3576
|
-
const p = l.filter(gs);
|
3577
|
-
if (p.length) {
|
3578
|
-
r = p.some(hs) ? "connecting" : "reconnecting";
|
3579
|
-
break e;
|
3580
|
-
}
|
3581
|
-
r = "idle";
|
3582
|
-
}
|
3583
|
-
const a = r;
|
3584
|
-
let o;
|
3585
|
-
t[1] === Symbol.for("react.memo_cache_sentinel") ? (o = (l) => {
|
3586
|
-
i((p) => {
|
3587
|
-
var m;
|
3588
|
-
const d = new Map(p);
|
3589
|
-
if (l.status === "disconnected")
|
3590
|
-
d.delete(l.connection);
|
3591
|
-
else {
|
3592
|
-
const f = ((m = d.get(l.connection)) == null ? void 0 : m.hasConnected) || l.status === "connected", g = l.status === "handshaking" ? "connecting" : l.status;
|
3593
|
-
d.set(l.connection, {
|
3594
|
-
status: g,
|
3595
|
-
hasConnected: f
|
3596
|
-
});
|
3597
|
-
}
|
3598
|
-
return d;
|
3599
|
-
});
|
3600
|
-
}, t[1] = o) : o = t[1];
|
3601
|
-
const s = o;
|
3602
|
-
let c;
|
3603
|
-
return t[2] !== a ? (c = [a, s], t[2] = a, t[3] = c) : c = t[3], c;
|
3604
|
-
}
|
3605
|
-
function hs(t) {
|
3606
|
-
const {
|
3607
|
-
hasConnected: e
|
3608
|
-
} = t;
|
3609
|
-
return !e;
|
3610
|
-
}
|
3611
|
-
function gs(t) {
|
3612
|
-
const {
|
3613
|
-
status: e
|
3614
|
-
} = t;
|
3615
|
-
return e === "connecting";
|
3616
|
-
}
|
3617
|
-
function ys(t) {
|
3618
|
-
const {
|
3619
|
-
status: e
|
3620
|
-
} = t;
|
3621
|
-
return e === "connected";
|
3622
|
-
}
|
3623
|
-
Ee(() => import("./LoaderQueries-AQneabiG.mjs"));
|
3624
|
-
const vs = Ee(() => import("./LiveQueries-sYvgBCKh.mjs")), ws = Ee(() => import("./PostMessageDocuments-DLMdHDk6.mjs")), bs = Ee(() => import("./PostMessageFeatures-CazMQz3f.mjs")), Ps = Ee(() => import("./PostMessageRefreshMutations-CWb9UqSy.mjs")), Ss = Ee(() => import("./PostMessagePerspective-m4uZ6sI5.mjs")), _s = Ee(() => import("./PostMessagePreviewSnapshots-Dr7CEAiM.mjs")), xs = Ee(() => import("./PostMessageSchema-BVFyZOH1.mjs")), Es = Ee(() => import("./PostMessageTelemetry-CSluBvcC.mjs")), Ts = ge(ae)`
|
3625
|
-
overflow-x: auto;
|
3626
|
-
`;
|
3627
|
-
function Cs(t) {
|
3628
|
-
var Re, Ne, Ie, je, $e;
|
3629
|
-
const {
|
3630
|
-
canCreateUrlPreviewSecrets: e,
|
3631
|
-
canToggleSharePreviewAccess: n,
|
3632
|
-
canUseSharedPreviewAccess: i,
|
3633
|
-
tool: r
|
3634
|
-
} = t, a = (Re = r.options) == null ? void 0 : Re.components, o = (Ne = r.options) == null ? void 0 : Ne.previewUrl, s = r.name || lr, {
|
3635
|
-
unstable_navigator: c,
|
3636
|
-
unstable_header: l
|
3637
|
-
} = a || {}, {
|
3638
|
-
navigate: p,
|
3639
|
-
state: d
|
3640
|
-
} = jt(), m = kn(Object.fromEntries(d._searchParams || [])), {
|
3641
|
-
perspectiveStack: f,
|
3642
|
-
selectedPerspectiveName: g = "previewDrafts"
|
3643
|
-
} = Yr(), y = g.startsWith("r") ? f : g, h = us(o || "/", s, y, m.preview || null, e), w = he(() => o && typeof o == "object" && "draftMode" in o && o.draftMode ? (console.warn("previewUrl.draftMode is deprecated, use previewUrl.previewMode instead"), o.draftMode.shareAccess !== !1) : o && typeof o == "object" && "previewMode" in o && o.previewMode ? o.previewMode.shareAccess !== !1 : !1, [o]), [P] = z(() => {
|
3644
|
-
var j;
|
3645
|
-
const O = (j = r.options) == null ? void 0 : j.devMode;
|
3646
|
-
return typeof O == "function" ? O() : typeof O == "boolean" ? O : typeof window < "u" && window.location.hostname === "localhost";
|
3647
|
-
}), b = he(() => h.origin, [h.origin]), S = le(null), [E, R] = z(), [v, C] = z(null), _ = le({
|
3648
|
-
title: void 0,
|
3649
|
-
url: void 0
|
3650
|
-
}), {
|
3651
|
-
navigate: x,
|
3652
|
-
navigationHistory: I,
|
3653
|
-
params: T,
|
3654
|
-
searchParams: A,
|
3655
|
-
structureParams: k
|
3656
|
-
} = ss({
|
3657
|
-
initialPreviewUrl: h,
|
3658
|
-
routerNavigate: p,
|
3659
|
-
routerState: d,
|
3660
|
-
routerSearchParams: m,
|
3661
|
-
frameStateRef: _
|
3662
|
-
}), $ = he(() => Qn(x, 50), [x]), [N, M] = Qr(dr, {}, ur), D = he(() => T.viewport ? "mobile" : "desktop", [T.viewport]), [L, B] = Yo(y, _), J = Zr(), ie = ei(), de = ns({
|
3663
|
-
// Prevent flash of content by using immediate navigation
|
3664
|
-
navigate: x,
|
3665
|
-
navigationHistory: I,
|
3666
|
-
path: T.preview,
|
3667
|
-
previewUrl: (Ie = r.options) == null ? void 0 : Ie.previewUrl,
|
3668
|
-
resolvers: ($e = (je = r.options) == null ? void 0 : je.resolve) == null ? void 0 : $e.mainDocuments
|
3669
|
-
}), [ye, se] = Tt(), [ue, pe] = Tt(), [fe, K] = Tt(), {
|
3670
|
-
open: H
|
3671
|
-
} = cs(E), F = N.iframe.status === "loading";
|
3672
|
-
V(() => {
|
3673
|
-
var U;
|
3674
|
-
const O = (U = S.current) == null ? void 0 : U.contentWindow;
|
3675
|
-
if (!O || F) return;
|
3676
|
-
const j = Ki({
|
3677
|
-
targetOrigin: b
|
3678
|
-
});
|
3679
|
-
return j.addTarget(O), R(j), () => {
|
3680
|
-
j.destroy(), R(void 0);
|
3681
|
-
};
|
3682
|
-
}, [b, F]);
|
3683
|
-
const Q = In((O, j, U) => $(O, j, U));
|
3684
|
-
V(() => {
|
3685
|
-
if (!E) return;
|
3686
|
-
const O = E.createChannel({
|
3687
|
-
name: "presentation",
|
3688
|
-
heartbeat: !0,
|
3689
|
-
connectTo: "visual-editing"
|
3690
|
-
}, ot().provide({
|
3691
|
-
actors: $t()
|
3692
|
-
}));
|
3693
|
-
O.on("visual-editing/focus", (U) => {
|
3694
|
-
"id" in U && Q({
|
3695
|
-
type: U.type,
|
3696
|
-
id: U.id,
|
3697
|
-
path: U.path
|
3698
|
-
});
|
3699
|
-
}), O.on("visual-editing/navigate", (U) => {
|
3700
|
-
const {
|
3701
|
-
title: ir,
|
3702
|
-
url: ht
|
3703
|
-
} = U;
|
3704
|
-
_.current.url !== ht && Q({}, {
|
3705
|
-
preview: ht
|
3706
|
-
}), _.current = {
|
3707
|
-
title: ir,
|
3708
|
-
url: ht
|
3709
|
-
};
|
3710
|
-
}), O.on("visual-editing/meta", (U) => {
|
3711
|
-
_.current.title = U.title;
|
3712
|
-
}), O.on("visual-editing/toggle", (U) => {
|
3713
|
-
M({
|
3714
|
-
type: pr,
|
3715
|
-
enabled: U.enabled
|
3716
|
-
});
|
3717
|
-
}), O.on("visual-editing/documents", (U) => {
|
3718
|
-
B(
|
3719
|
-
"visual-editing",
|
3720
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
3721
|
-
U.perspective,
|
3722
|
-
U.documents
|
3723
|
-
);
|
3724
|
-
}), O.on("visual-editing/refreshing", (U) => {
|
3725
|
-
U.source === "manual" ? clearTimeout(be.current) : U.source === "mutation" && M({
|
3726
|
-
type: an
|
3727
|
-
});
|
3728
|
-
}), O.on("visual-editing/refreshed", () => {
|
3729
|
-
M({
|
3730
|
-
type: _n
|
3731
|
-
});
|
3732
|
-
}), O.onStatus(se);
|
3733
|
-
const j = O.start();
|
3734
|
-
return C(O), () => {
|
3735
|
-
j(), C(null);
|
3736
|
-
};
|
3737
|
-
}, [E, Q, B, se, b]), V(() => {
|
3738
|
-
if (!E) return;
|
3739
|
-
const O = E.createChannel({
|
3740
|
-
name: "presentation",
|
3741
|
-
connectTo: "preview-kit",
|
3742
|
-
heartbeat: !0
|
3743
|
-
}, ot().provide({
|
3744
|
-
actors: $t()
|
3745
|
-
}));
|
3746
|
-
return O.onStatus(K), O.on("preview-kit/documents", (j) => {
|
3747
|
-
j.projectId === J && j.dataset === ie && B(
|
3748
|
-
"preview-kit",
|
3749
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
3750
|
-
j.perspective,
|
3751
|
-
j.documents
|
3752
|
-
);
|
3753
|
-
}), O.start();
|
3754
|
-
}, [E, ie, J, B, K, b]);
|
3755
|
-
const Y = re((O) => {
|
3756
|
-
$({
|
3757
|
-
path: Vn.toString(O)
|
3758
|
-
}, {}, !0);
|
3759
|
-
}, [$]), Z = re((O) => {
|
3760
|
-
const j = new URL(O, h.origin), U = j.pathname + j.search;
|
3761
|
-
j.origin === h.origin && U !== T.preview && $({}, {
|
3762
|
-
preview: U
|
3763
|
-
});
|
3764
|
-
}, [h, T, $]), ee = re((O) => {
|
3765
|
-
$({}, O);
|
3766
|
-
}, [$]);
|
3767
|
-
V(() => {
|
3768
|
-
T.id && T.path ? v == null || v.post("presentation/focus", {
|
3769
|
-
id: T.id,
|
3770
|
-
path: T.path
|
3771
|
-
}) : v == null || v.post("presentation/blur");
|
3772
|
-
}, [T.id, T.path, v]), V(() => {
|
3773
|
-
_.current.url && T.preview && _.current.url !== T.preview && (_.current.url = T.preview, ye !== "connected" && S.current ? S.current.src = `${b}${T.preview}` : v == null || v.post("presentation/navigate", {
|
3774
|
-
url: T.preview,
|
3775
|
-
type: "replace"
|
3776
|
-
}));
|
3777
|
-
}, [ye, b, T.preview, v]);
|
3778
|
-
const G = re(() => v == null ? void 0 : v.post("presentation/toggle-overlay"), [v]), [oe, ve] = z(null);
|
3779
|
-
V(() => {
|
3780
|
-
const O = (U) => {
|
3781
|
-
fn(U) && G();
|
3782
|
-
}, j = (U) => {
|
3783
|
-
fn(U) && G(), Aa(["mod", "\\"], U) && G();
|
3784
|
-
};
|
3785
|
-
return window.addEventListener("keydown", j), window.addEventListener("keyup", O), () => {
|
3786
|
-
window.removeEventListener("keydown", j), window.removeEventListener("keyup", O);
|
3787
|
-
};
|
3788
|
-
}, [G]);
|
3789
|
-
const [Se, Oe] = z(null), [{
|
3790
|
-
navigatorEnabled: we,
|
3791
|
-
toggleNavigator: Me
|
3792
|
-
}, _e] = Co({
|
3793
|
-
unstable_navigator: c
|
3794
|
-
}), be = le(), ze = re((O) => {
|
3795
|
-
if (M({
|
3796
|
-
type: an
|
3797
|
-
}), v) {
|
3798
|
-
be.current = window.setTimeout(O, 300), v.post("presentation/refresh", {
|
3799
|
-
source: "manual",
|
3800
|
-
livePreviewEnabled: fe === "connected" || ue === "connected"
|
3801
|
-
});
|
3802
|
-
return;
|
3803
|
-
}
|
3804
|
-
O();
|
3805
|
-
}, [ue, fe, v]), Ce = ti(), Ke = re(({
|
3806
|
-
id: O,
|
3807
|
-
type: j,
|
3808
|
-
path: U
|
3809
|
-
}) => {
|
3810
|
-
if (_.current.url)
|
3811
|
-
return {
|
3812
|
-
title: _.current.title || _.current.url,
|
3813
|
-
name: "edit",
|
3814
|
-
params: {
|
3815
|
-
id: O,
|
3816
|
-
path: U,
|
3817
|
-
type: j,
|
3818
|
-
inspect: mr,
|
3819
|
-
workspace: Ce.name,
|
3820
|
-
mode: fr,
|
3821
|
-
preview: T.preview
|
3822
|
-
}
|
3823
|
-
};
|
3824
|
-
}, [T.preview, Ce.name]), Le = re((O) => {
|
3825
|
-
$({}, {
|
3826
|
-
viewport: O === "desktop" ? void 0 : "mobile"
|
3827
|
-
}, !0);
|
3828
|
-
}, [$]);
|
3829
|
-
return /* @__PURE__ */ q(Pe, { children: [
|
3830
|
-
/* @__PURE__ */ u(ko, { devMode: P, name: s, navigate: $, params: T, searchParams: A, structureParams: k, children: /* @__PURE__ */ u(Eo, { navigate: $, children: /* @__PURE__ */ u(Ao, { params: T, children: /* @__PURE__ */ u(ka, { comlink: v, children: /* @__PURE__ */ u(Ts, { height: "fill", children: /* @__PURE__ */ q(Fa, { children: [
|
3831
|
-
/* @__PURE__ */ u(_e, {}),
|
3832
|
-
/* @__PURE__ */ u(tn, { id: "preview", minWidth: 325, defaultSize: we ? 50 : 75, order: 3, children: /* @__PURE__ */ u(ae, { direction: "column", flex: 1, height: "fill", ref: Oe, children: /* @__PURE__ */ u(zr, { element: Se, children: /* @__PURE__ */ u(nr, { canSharePreviewAccess: w, canToggleSharePreviewAccess: n, canUseSharedPreviewAccess: i, dispatch: M, header: l, iframe: N.iframe, initialUrl: h, loadersConnection: ue, navigatorEnabled: we, onPathChange: Z, onRefresh: ze, openPopup: H, overlaysConnection: ye, previewUrl: T.preview, perspective: y, ref: S, setViewport: Le, targetOrigin: b, toggleNavigator: Me, toggleOverlay: G, viewport: D, visualEditing: N.visualEditing }) }) }) }),
|
3833
|
-
/* @__PURE__ */ u(xo, { documentId: T.id, documentsOnPage: L, documentType: T.type, getCommentIntent: Ke, mainDocumentState: de, onFocusPath: Y, onStructureParams: ee, searchParams: A, setDisplayedDocument: ve, structureParams: k })
|
3834
|
-
] }) }) }) }) }) }),
|
3835
|
-
/* @__PURE__ */ q(Wt, { children: [
|
3836
|
-
E && /* @__PURE__ */ u(vs, { controller: E, perspective: y, liveDocument: oe, onDocumentsOnPage: B, onLoadersConnection: pe }),
|
3837
|
-
v && T.id && T.type && /* @__PURE__ */ u(Ps, { comlink: v, id: T.id, type: T.type, loadersConnection: ue, previewKitConnection: fe }),
|
3838
|
-
v && /* @__PURE__ */ u(xs, { comlink: v, perspective: y }),
|
3839
|
-
v && L.length > 0 && /* @__PURE__ */ u(_s, { comlink: v, perspective: y, refs: L }),
|
3840
|
-
v && /* @__PURE__ */ u(ws, { comlink: v }),
|
3841
|
-
v && /* @__PURE__ */ u(bs, { comlink: v }),
|
3842
|
-
v && /* @__PURE__ */ u(Ss, { comlink: v, perspective: y }),
|
3843
|
-
v && /* @__PURE__ */ u(Es, { comlink: v })
|
3844
|
-
] })
|
3845
|
-
] });
|
3846
|
-
}
|
3847
|
-
function Rs(t) {
|
3848
|
-
const e = W(16), {
|
3849
|
-
t: n
|
3850
|
-
} = Te(xe), {
|
3851
|
-
previewUrl: i
|
3852
|
-
} = t.tool.options ?? {}, {
|
3853
|
-
push: r
|
3854
|
-
} = Tn(), a = typeof i == "object" || typeof i == "function", o = Jr(), [s, c] = z(null), [l, p] = z(null), [d, m] = z(null), [f, g] = z(null);
|
3855
|
-
let y, h;
|
3856
|
-
e[0] !== o || e[1] !== a ? (y = () => {
|
3857
|
-
if (!a)
|
3858
|
-
return;
|
3859
|
-
const C = o.checkDocumentPermission("create", {
|
3860
|
-
_id: We,
|
3861
|
-
_type: Fe
|
3862
|
-
}).subscribe(c), _ = o.checkDocumentPermission("update", {
|
3863
|
-
_id: We,
|
3864
|
-
_type: Fe
|
3865
|
-
}).subscribe(p), x = o.checkDocumentPermission("read", {
|
3866
|
-
_id: We,
|
3867
|
-
_type: Fe
|
3868
|
-
}).subscribe(m), I = o.checkDocumentPermission("create", {
|
3869
|
-
_id: `drafts.${En()}`,
|
3870
|
-
_type: qt
|
3871
|
-
}).subscribe(g);
|
3872
|
-
return () => {
|
3873
|
-
C.unsubscribe(), _.unsubscribe(), x.unsubscribe(), I.unsubscribe();
|
3874
|
-
};
|
3875
|
-
}, h = [o, a], e[0] = o, e[1] = a, e[2] = y, e[3] = h) : (y = e[2], h = e[3]), V(y, h);
|
3876
|
-
const w = f == null ? void 0 : f.granted;
|
3877
|
-
let P, b;
|
3878
|
-
if (e[4] !== w || e[5] !== r || e[6] !== n || e[7] !== a ? (P = () => {
|
3879
|
-
if (!a || w !== !1)
|
3880
|
-
return;
|
3881
|
-
const C = requestAnimationFrame(() => r({
|
3882
|
-
closable: !0,
|
3883
|
-
status: "error",
|
3884
|
-
duration: 3e4,
|
3885
|
-
title: n("preview-url-secret.missing-grants")
|
3886
|
-
}));
|
3887
|
-
return () => cancelAnimationFrame(C);
|
3888
|
-
}, b = [w, r, n, a], e[4] = w, e[5] = r, e[6] = n, e[7] = a, e[8] = P, e[9] = b) : (P = e[8], b = e[9]), V(P, b), a && (!s || typeof s.granted > "u" || !l || typeof l.granted > "u" || !f || !d || typeof d.granted > "u" || typeof f.granted > "u")) {
|
3889
|
-
let C;
|
3890
|
-
return e[10] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ u(xn, {}), e[10] = C) : C = e[10], C;
|
3891
|
-
}
|
3892
|
-
const S = w === !0, E = (s == null ? void 0 : s.granted) === !0 && (l == null ? void 0 : l.granted) === !0, R = (d == null ? void 0 : d.granted) === !0;
|
3893
|
-
let v;
|
3894
|
-
return e[11] !== t || e[12] !== S || e[13] !== E || e[14] !== R ? (v = /* @__PURE__ */ u(Cs, { ...t, canCreateUrlPreviewSecrets: S, canToggleSharePreviewAccess: E, canUseSharedPreviewAccess: R }), e[11] = t, e[12] = S, e[13] = E, e[14] = R, e[15] = v) : v = e[15], v;
|
3895
|
-
}
|
3896
|
-
var Is = /* @__PURE__ */ Object.freeze({
|
3897
|
-
__proto__: null,
|
3898
|
-
default: Rs
|
3899
|
-
});
|
3900
|
-
const Hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
3901
|
-
__proto__: null,
|
3902
|
-
PresentationToolGrantsCheck: Is,
|
3903
|
-
createCompatibilityActors: $t,
|
3904
|
-
getQueryCacheKey: Ia
|
3905
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
3906
|
-
export {
|
3907
|
-
ln as D,
|
3908
|
-
Hs as P,
|
3909
|
-
$t as a,
|
3910
|
-
Fs as b,
|
3911
|
-
ot as c,
|
3912
|
-
Bi as d,
|
3913
|
-
Ia as g,
|
3914
|
-
Vs as p,
|
3915
|
-
Ks as r,
|
3916
|
-
Qi as t,
|
3917
|
-
Ge as w
|
3918
|
-
};
|
3919
|
-
//# sourceMappingURL=PresentationToolGrantsCheck-4zo266wj.mjs.map
|