sanity 3.94.1 → 3.94.2-next.0.91a5116c07

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.
Files changed (113) hide show
  1. package/lib/_chunks-cjs/version.js +1 -1
  2. package/lib/_chunks-es/version.mjs +1 -1
  3. package/package.json +25 -25
  4. package/dist/BehaviorSubject-CU-WJrzA.mjs +0 -30
  5. package/dist/BehaviorSubject-CU-WJrzA.mjs.map +0 -1
  6. package/dist/BroadcastDisplayedDocument-BSV9T3BU.mjs +0 -20
  7. package/dist/BroadcastDisplayedDocument-BSV9T3BU.mjs.map +0 -1
  8. package/dist/DisplayedDocumentBroadcaster-DZ65n35Q.mjs +0 -62
  9. package/dist/DisplayedDocumentBroadcaster-DZ65n35Q.mjs.map +0 -1
  10. package/dist/LiveQueries-Crz53eU5.mjs +0 -407
  11. package/dist/LiveQueries-Crz53eU5.mjs.map +0 -1
  12. package/dist/Observable-CCQtH8Gg.mjs +0 -546
  13. package/dist/Observable-CCQtH8Gg.mjs.map +0 -1
  14. package/dist/PostMessageDocuments-BjgsJxz4.mjs +0 -72
  15. package/dist/PostMessageDocuments-BjgsJxz4.mjs.map +0 -1
  16. package/dist/PostMessagePerspective-pucY-E6a.mjs +0 -22
  17. package/dist/PostMessagePerspective-pucY-E6a.mjs.map +0 -1
  18. package/dist/PostMessagePreviewSnapshots-CRQgRg4_.mjs +0 -71
  19. package/dist/PostMessagePreviewSnapshots-CRQgRg4_.mjs.map +0 -1
  20. package/dist/PostMessageRefreshMutations-D944RbO3.mjs +0 -66
  21. package/dist/PostMessageRefreshMutations-D944RbO3.mjs.map +0 -1
  22. package/dist/PostMessageSchema-3eOtr1bs.mjs +0 -516
  23. package/dist/PostMessageSchema-3eOtr1bs.mjs.map +0 -1
  24. package/dist/PostMessageTelemetry-DMTQDJeN.mjs +0 -20
  25. package/dist/PostMessageTelemetry-DMTQDJeN.mjs.map +0 -1
  26. package/dist/PresentationToolGrantsCheck-B0q4AQ3b.mjs +0 -3999
  27. package/dist/PresentationToolGrantsCheck-B0q4AQ3b.mjs.map +0 -1
  28. package/dist/QRCodeSVG-hyTW2xeN.mjs +0 -648
  29. package/dist/QRCodeSVG-hyTW2xeN.mjs.map +0 -1
  30. package/dist/Refractor-Zss2QEe8.mjs +0 -2568
  31. package/dist/Refractor-Zss2QEe8.mjs.map +0 -1
  32. package/dist/SourceContext-QxJD1Wrm.mjs +0 -111
  33. package/dist/SourceContext-QxJD1Wrm.mjs.map +0 -1
  34. package/dist/StructureToolProvider-B-7cwz7l.mjs +0 -2287
  35. package/dist/StructureToolProvider-B-7cwz7l.mjs.map +0 -1
  36. package/dist/ViteDevServerStopped-CgIEqy9p.mjs +0 -57
  37. package/dist/ViteDevServerStopped-CgIEqy9p.mjs.map +0 -1
  38. package/dist/_createContext.mjs +0 -38
  39. package/dist/_createContext.mjs.map +0 -1
  40. package/dist/_singletons.mjs +0 -216
  41. package/dist/_singletons.mjs.map +0 -1
  42. package/dist/browser-B0Q9qZJS.mjs +0 -478
  43. package/dist/browser-B0Q9qZJS.mjs.map +0 -1
  44. package/dist/browser-DmX5VEcE.mjs +0 -324
  45. package/dist/browser-DmX5VEcE.mjs.map +0 -1
  46. package/dist/desk.mjs +0 -53
  47. package/dist/desk.mjs.map +0 -1
  48. package/dist/first-Cz545eV-.mjs +0 -42
  49. package/dist/first-Cz545eV-.mjs.map +0 -1
  50. package/dist/index-B2GCDfau.mjs +0 -96
  51. package/dist/index-B2GCDfau.mjs.map +0 -1
  52. package/dist/index-BRIelBPK.mjs +0 -6946
  53. package/dist/index-BRIelBPK.mjs.map +0 -1
  54. package/dist/index-BUB137yJ.mjs +0 -144
  55. package/dist/index-BUB137yJ.mjs.map +0 -1
  56. package/dist/index-C3PGPrdL.mjs +0 -1192
  57. package/dist/index-C3PGPrdL.mjs.map +0 -1
  58. package/dist/index-C9NvTy6s.mjs +0 -319
  59. package/dist/index-C9NvTy6s.mjs.map +0 -1
  60. package/dist/index-DCkQlgdi.mjs +0 -4001
  61. package/dist/index-DCkQlgdi.mjs.map +0 -1
  62. package/dist/index-DG-3plB0.mjs +0 -71
  63. package/dist/index-DG-3plB0.mjs.map +0 -1
  64. package/dist/index-RoxwhtVB.mjs +0 -5600
  65. package/dist/index-RoxwhtVB.mjs.map +0 -1
  66. package/dist/index-iMZR29eF.mjs +0 -756
  67. package/dist/index-iMZR29eF.mjs.map +0 -1
  68. package/dist/index-wVXq9rWS.mjs +0 -244
  69. package/dist/index-wVXq9rWS.mjs.map +0 -1
  70. package/dist/index.mjs +0 -137385
  71. package/dist/index.mjs.map +0 -1
  72. package/dist/lodash-Vz5dH_Dm.mjs +0 -3679
  73. package/dist/lodash-Vz5dH_Dm.mjs.map +0 -1
  74. package/dist/pane-Bm_57XKB.mjs +0 -5
  75. package/dist/pane-Bm_57XKB.mjs.map +0 -1
  76. package/dist/pane-Dopl4BjD.mjs +0 -5
  77. package/dist/pane-Dopl4BjD.mjs.map +0 -1
  78. package/dist/presentation-DsIky7Cj.mjs +0 -556
  79. package/dist/presentation-DsIky7Cj.mjs.map +0 -1
  80. package/dist/presentation.mjs +0 -10
  81. package/dist/presentation.mjs.map +0 -1
  82. package/dist/publishReplay-PuJoYJpp.mjs +0 -92
  83. package/dist/publishReplay-PuJoYJpp.mjs.map +0 -1
  84. package/dist/refractor-Bg1S3YDK.mjs +0 -26
  85. package/dist/refractor-Bg1S3YDK.mjs.map +0 -1
  86. package/dist/resources-BQsCEzu1.mjs +0 -60
  87. package/dist/resources-BQsCEzu1.mjs.map +0 -1
  88. package/dist/resources-BahMtJuO.mjs +0 -177
  89. package/dist/resources-BahMtJuO.mjs.map +0 -1
  90. package/dist/resources-CjkBN4z6.mjs +0 -126
  91. package/dist/resources-CjkBN4z6.mjs.map +0 -1
  92. package/dist/resources-Dc-6ZcPg.mjs +0 -157
  93. package/dist/resources-Dc-6ZcPg.mjs.map +0 -1
  94. package/dist/resources-DqxSuDsr.mjs +0 -37
  95. package/dist/resources-DqxSuDsr.mjs.map +0 -1
  96. package/dist/resources-_gTjFWLH.mjs +0 -517
  97. package/dist/resources-_gTjFWLH.mjs.map +0 -1
  98. package/dist/resources-kA1bao30.mjs +0 -358
  99. package/dist/resources-kA1bao30.mjs.map +0 -1
  100. package/dist/router.mjs +0 -721
  101. package/dist/router.mjs.map +0 -1
  102. package/dist/stegaEncodeSourceMap-DCG9Ba1H.mjs +0 -358
  103. package/dist/stegaEncodeSourceMap-DCG9Ba1H.mjs.map +0 -1
  104. package/dist/structure.mjs +0 -57
  105. package/dist/structure.mjs.map +0 -1
  106. package/dist/structureTool-Bth1vd8r.mjs +0 -13150
  107. package/dist/structureTool-Bth1vd8r.mjs.map +0 -1
  108. package/dist/switchMap-DHVUskpL.mjs +0 -54
  109. package/dist/switchMap-DHVUskpL.mjs.map +0 -1
  110. package/dist/v4-zH-CAum7.mjs +0 -24798
  111. package/dist/v4-zH-CAum7.mjs.map +0 -1
  112. package/dist/version-DoE_JnhG.mjs +0 -5
  113. package/dist/version-DoE_JnhG.mjs.map +0 -1
@@ -1,5 +0,0 @@
1
- import { d as e } from "./structureTool-Bth1vd8r.mjs";
2
- export {
3
- e as default
4
- };
5
- //# sourceMappingURL=pane-Bm_57XKB.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pane-Bm_57XKB.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- import { h as f } from "./structureTool-Bth1vd8r.mjs";
2
- export {
3
- f as default
4
- };
5
- //# sourceMappingURL=pane-Dopl4BjD.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pane-Dopl4BjD.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,556 +0,0 @@
1
- import { d as x } from "./index-C9NvTy6s.mjs";
2
- import { useContext as b, useEffect as Z, useState as B, createElement as ce, useLayoutEffect as ae, lazy as ee, Suspense as K } from "react";
3
- import { PresentationSharedStateContext as le, PresentationContext as z, PresentationDocumentContext as Q, PresentationNavigateContext as me, PresentationParamsContext as ue } from "sanity/_singletons";
4
- import { jsxs as E, jsx as _, Fragment as j } from "react/jsx-runtime";
5
- import { defineLocaleResourceBundle as fe, useDocumentStore as de, useDocumentPreviewStore as pe, usePerspective as he, useTranslation as ve, defineDocumentFieldAction as ye, useWorkspace as Pe, isRecord as ge, pathToString as _e, getPublishedId as te, definePlugin as we, getVersionFromId as Se, isDocumentSchemaType as Te } from "sanity";
6
- import { f as Ie, g as q, j as Ee, m as Le, F as M, E as xe, W as be, I as ne, B as $, T as O, C as W, k as se, l as Oe, S as oe, D as Ce, n as Ae, p as H, e as De, M as Ne, v as Re } from "./v4-zH-CAum7.mjs";
7
- import { styled as $e, css as Ue } from "styled-components";
8
- import { useIntentLink as ke, useRouter as Be, encodeJsonParams as Me, route as R } from "sanity/router";
9
- const Et = (o, e) => {
10
- const n = x.c(5), a = b(le);
11
- if (!a)
12
- throw new Error("Preview Snapshots context is missing");
13
- const {
14
- setValue: r
15
- } = a;
16
- let u, l;
17
- n[0] !== o || n[1] !== r || n[2] !== e ? (u = () => {
18
- r(o, e);
19
- }, l = [o, e, r], n[0] = o, n[1] = r, n[2] = e, n[3] = u, n[4] = l) : (u = n[3], l = n[4]), Z(u, l);
20
- }, Ve = "sanity.previewUrlSecret", re = "sanity-preview-url-secret", ze = `${re}.share-access`, Fe = "sanity.previewUrlShareAccess", je = "2025-02-19", Lt = "sanity-preview-secret", xt = "sanity-preview-pathname", bt = "sanity-preview-perspective", Ot = "x-vercel-protection-bypass", Ct = "x-vercel-set-bypass-cookie", He = 60 * 60, At = (
21
- /* groq */
22
- `*[_id == "${ze}" && _type == "${Fe}"][0].secret`
23
- ), Dt = (
24
- /* groq */
25
- `*[_type == "${Ve}" && dateTime(_updatedAt) <= dateTime(now()) - ${He}]`
26
- ), Qe = "sanity.vercelProtectionBypass", We = `${re}.vercel-protection-bypass`, Nt = (
27
- /* groq */
28
- `*[_id == "${We}" && _type == "${Qe}"][0].secret`
29
- ), Rt = "sanity.preview-url-secret", Ye = Ie, V = "presentation", G = "Presentation", Ke = "presentation", $t = 3e3, Ut = je, kt = 1e3, Bt = 3e4, Mt = 1e3, ie = "presentation", qe = fe({
30
- locale: "en-US",
31
- namespace: ie,
32
- resources: () => import("./resources-CjkBN4z6.mjs")
33
- }), J = {
34
- locations: []
35
- };
36
- function Ge(o) {
37
- const e = x.c(23), {
38
- id: n,
39
- resolvers: a,
40
- type: r,
41
- version: u
42
- } = o, l = de(), s = pe(), {
43
- perspectiveStack: t
44
- } = he(), [c, h] = B(J), i = a && (typeof a == "function" ? a : a[r.name]), [m, P] = B(i ? "resolving" : "empty");
45
- let f;
46
- e: {
47
- if (!i) {
48
- f = void 0;
49
- break e;
50
- }
51
- if (typeof i == "function") {
52
- let y;
53
- if (e[0] !== l || e[1] !== n || e[2] !== t || e[3] !== i || e[4] !== r.name || e[5] !== u) {
54
- const S = {
55
- id: n,
56
- type: r.name,
57
- version: u,
58
- perspectiveStack: t
59
- }, L = i(S, {
60
- documentStore: l
61
- });
62
- y = Ee(L) ? L : q(L), e[0] = l, e[1] = n, e[2] = t, e[3] = i, e[4] = r.name, e[5] = u, e[6] = y;
63
- } else
64
- y = e[6];
65
- f = y;
66
- break e;
67
- }
68
- if ("select" in i && "resolve" in i) {
69
- let y;
70
- if (e[7] !== s || e[8] !== n || e[9] !== t || e[10] !== i || e[11] !== r) {
71
- const S = {
72
- _type: "reference",
73
- _ref: n
74
- }, T = {
75
- ...r,
76
- preview: {
77
- select: i.select
78
- }
79
- }, L = {
80
- perspective: t
81
- };
82
- let I;
83
- e[13] !== i ? (I = (C) => i.resolve(C.snapshot || null), e[13] = i, e[14] = I) : I = e[14], y = s.observeForPreview(S, T, L).pipe(Le(I)), e[7] = s, e[8] = n, e[9] = t, e[10] = i, e[11] = r, e[12] = y;
84
- } else
85
- y = e[12];
86
- f = y;
87
- break e;
88
- }
89
- let p;
90
- e[15] !== i ? (p = q(i), e[15] = i, e[16] = p) : p = e[16], f = p;
91
- }
92
- const d = f;
93
- let g, v;
94
- e[17] !== d ? (g = () => {
95
- const p = d == null ? void 0 : d.subscribe((y) => {
96
- h(y || J), P(y ? "resolved" : "empty");
97
- });
98
- return () => p == null ? void 0 : p.unsubscribe();
99
- }, v = [d], e[17] = d, e[18] = g, e[19] = v) : (g = e[18], v = e[19]), Z(g, v);
100
- let w;
101
- return e[20] !== c || e[21] !== m ? (w = {
102
- state: c,
103
- status: m
104
- }, e[20] = c, e[21] = m, e[22] = w) : w = e[22], w;
105
- }
106
- function Je(o) {
107
- const e = o === void 0 ? !0 : o, n = b(z);
108
- if (e && !n)
109
- throw new Error("Presentation context is missing");
110
- return n;
111
- }
112
- function Xe() {
113
- var o;
114
- return ((o = Je(!1)) == null ? void 0 : o.name) ?? void 0;
115
- }
116
- const Ze = {
117
- positive: ne,
118
- caution: be,
119
- critical: xe
120
- };
121
- function et(o) {
122
- const e = x.c(39), {
123
- documentId: n,
124
- options: a,
125
- resolvers: r,
126
- schemaType: u,
127
- showPresentationTitle: l,
128
- version: s
129
- } = o;
130
- let t;
131
- e[0] !== n || e[1] !== r || e[2] !== u || e[3] !== s ? (t = {
132
- id: n,
133
- version: s,
134
- resolvers: r,
135
- type: u
136
- }, e[0] = n, e[1] = r, e[2] = u, e[3] = s, e[4] = t) : t = e[4];
137
- const {
138
- state: c,
139
- status: h
140
- } = Ge(t), i = h === "resolving", {
141
- locations: m,
142
- message: P,
143
- tone: f
144
- } = c, d = (m == null ? void 0 : m.length) || 0, {
145
- t: g
146
- } = ve(ie), v = b(z), w = v == null ? void 0 : v.name, [p, y] = B(!1);
147
- let S;
148
- e[5] !== d ? (S = () => {
149
- d && y(tt);
150
- }, e[5] = d, e[6] = S) : S = e[6];
151
- const T = S;
152
- let L;
153
- e[7] !== i || e[8] !== d || e[9] !== P || e[10] !== g ? (L = i ? g("locations-banner.resolving.text") : P || g("locations-banner.locations-count", {
154
- count: d
155
- }), e[7] = i, e[8] = d, e[9] = P, e[10] = g, e[11] = L) : L = e[11];
156
- const I = L, C = f ? Ze[f] : void 0;
157
- if (!r || h === "empty")
158
- return null;
159
- let U;
160
- e[12] === Symbol.for("react.memo_cache_sentinel") ? (U = {
161
- margin: -1
162
- }, e[12] = U) : U = e[12];
163
- let A;
164
- e[13] !== C || e[14] !== m || e[15] !== a || e[16] !== l || e[17] !== I || e[18] !== f ? (A = !m && /* @__PURE__ */ E(M, { align: "flex-start", gap: 3, padding: 3, children: [
165
- f && C && /* @__PURE__ */ _($, { flex: "none", children: /* @__PURE__ */ _(O, { size: 1, children: /* @__PURE__ */ _(C, {}) }) }),
166
- /* @__PURE__ */ _($, { flex: 1, children: /* @__PURE__ */ E(O, { size: 1, weight: "medium", children: [
167
- l && /* @__PURE__ */ E(j, { children: [
168
- a.title || G,
169
- " · "
170
- ] }),
171
- I
172
- ] }) })
173
- ] }), e[13] = C, e[14] = m, e[15] = a, e[16] = l, e[17] = I, e[18] = f, e[19] = A) : A = e[19];
174
- let D;
175
- e[20] !== n || e[21] !== p || e[22] !== i || e[23] !== m || e[24] !== d || e[25] !== a || e[26] !== v || e[27] !== w || e[28] !== u || e[29] !== l || e[30] !== I || e[31] !== T ? (D = m && /* @__PURE__ */ E(j, { children: [
176
- /* @__PURE__ */ _(W, { as: d ? "button" : void 0, onClick: T, padding: 3, radius: 1, tone: "inherit", children: /* @__PURE__ */ E(M, { gap: 3, children: [
177
- /* @__PURE__ */ _($, { flex: "none", children: i ? /* @__PURE__ */ _(se, { size: 1 }) : /* @__PURE__ */ _(O, { size: 1, children: d === 0 ? /* @__PURE__ */ _(ne, {}) : /* @__PURE__ */ _(Oe, { style: {
178
- transform: `rotate(${p ? "90deg" : 0})`,
179
- transition: "transform 100ms ease-in-out"
180
- } }) }) }),
181
- /* @__PURE__ */ _($, { flex: 1, children: /* @__PURE__ */ E(O, { size: 1, weight: "medium", children: [
182
- l && /* @__PURE__ */ E(j, { children: [
183
- a.title || G,
184
- " · "
185
- ] }),
186
- I
187
- ] }) })
188
- ] }) }),
189
- /* @__PURE__ */ _(oe, { hidden: !p, marginTop: 1, space: 1, children: m.map((F) => {
190
- let Y = !1;
191
- return (a.name || V) === w && (v != null && v.params.preview) && (Y = st(v.params.preview, F.href)), /* @__PURE__ */ _(nt, { active: Y, documentId: n, documentType: u.name, node: F, toolName: a.name || V }, F.href);
192
- }) })
193
- ] }), e[20] = n, e[21] = p, e[22] = i, e[23] = m, e[24] = d, e[25] = a, e[26] = v, e[27] = w, e[28] = u, e[29] = l, e[30] = I, e[31] = T, e[32] = D) : D = e[32];
194
- let N;
195
- e[33] !== A || e[34] !== D ? (N = /* @__PURE__ */ E("div", { style: U, children: [
196
- A,
197
- D
198
- ] }), e[33] = A, e[34] = D, e[35] = N) : N = e[35];
199
- let k;
200
- return e[36] !== N || e[37] !== f ? (k = /* @__PURE__ */ _(W, { padding: 1, radius: 2, border: !0, tone: f, children: N }), e[36] = N, e[37] = f, e[38] = k) : k = e[38], k;
201
- }
202
- function tt(o) {
203
- return !o;
204
- }
205
- function nt(o) {
206
- const e = x.c(26), {
207
- documentId: n,
208
- documentType: a,
209
- node: r,
210
- active: u,
211
- toolName: l
212
- } = o, s = b(z), t = Xe(), c = l === t, h = s == null ? void 0 : s.navigate, i = s == null ? void 0 : s.structureParams;
213
- let m;
214
- e[0] !== n || e[1] !== a || e[2] !== r.href || e[3] !== i || e[4] !== l ? (m = {
215
- intent: "edit",
216
- params: {
217
- id: n,
218
- type: a,
219
- mode: "presentation",
220
- presentation: l,
221
- ...i,
222
- preview: r.href
223
- }
224
- }, e[0] = n, e[1] = a, e[2] = r.href, e[3] = i, e[4] = l, e[5] = m) : m = e[5];
225
- const P = ke(m);
226
- let f;
227
- e[6] !== h || e[7] !== r.href ? (f = () => {
228
- h == null || h({}, {
229
- preview: r.href
230
- });
231
- }, e[6] = h, e[7] = r.href, e[8] = f) : f = e[8];
232
- const d = f;
233
- let g;
234
- e[9] !== c || e[10] !== P ? (g = c ? {} : P, e[9] = c, e[10] = P, e[11] = g) : g = e[11];
235
- const v = c ? d : P.onClick;
236
- let w;
237
- e[12] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ _($, { flex: "none", children: /* @__PURE__ */ _(O, { size: 1, children: /* @__PURE__ */ _(Ce, {}) }) }), e[12] = w) : w = e[12];
238
- let p;
239
- e[13] !== r.title ? (p = /* @__PURE__ */ _(O, { size: 1, weight: "medium", children: r.title }), e[13] = r.title, e[14] = p) : p = e[14];
240
- let y;
241
- e[15] !== r.href ? (y = /* @__PURE__ */ _(O, { muted: !0, size: 1, textOverflow: "ellipsis", children: r.href }), e[15] = r.href, e[16] = y) : y = e[16];
242
- let S;
243
- e[17] !== p || e[18] !== y ? (S = /* @__PURE__ */ E(M, { gap: 3, children: [
244
- w,
245
- /* @__PURE__ */ E(oe, { flex: 1, space: 2, children: [
246
- p,
247
- y
248
- ] })
249
- ] }), e[17] = p, e[18] = y, e[19] = S) : S = e[19];
250
- let T;
251
- return e[20] !== u || e[21] !== r.href || e[22] !== g || e[23] !== v || e[24] !== S ? (T = /* @__PURE__ */ ce(W, { ...g, as: "a", key: r.href, onClick: v, padding: 3, radius: 1, pressed: u, tone: "inherit" }, S), e[20] = u, e[21] = r.href, e[22] = g, e[23] = v, e[24] = S, e[25] = T) : T = e[25], T;
252
- }
253
- function st(o, e) {
254
- try {
255
- const n = new URL(o, location.origin), a = new URL(e, n.origin);
256
- if (n.origin !== a.origin || n.pathname !== a.pathname)
257
- return !1;
258
- const r = new URLSearchParams(a.search), u = new URLSearchParams(n.search);
259
- for (const [l, s] of r.entries())
260
- if (u.get(l) !== s)
261
- return !1;
262
- return !0;
263
- } catch {
264
- return !1;
265
- }
266
- }
267
- const ot = $e.div((o) => {
268
- const e = Ae(o.theme);
269
- return Ue`
270
- display: flex;
271
- flex-direction: column;
272
- gap: ${H(e.space[2])};
273
- min-height: ${H(42)};
274
- margin-bottom: ${H(e.space[5])};
275
-
276
- &:empty {
277
- display: none;
278
- }
279
- `;
280
- });
281
- function rt(o) {
282
- const e = x.c(19), {
283
- documentId: n,
284
- options: a,
285
- schemaType: r,
286
- version: u
287
- } = o, l = b(Q);
288
- let s;
289
- e[0] !== (l == null ? void 0 : l.options) ? (s = (l == null ? void 0 : l.options) || [], e[0] = l == null ? void 0 : l.options, e[1] = s) : s = e[1];
290
- const t = s;
291
- let c, h;
292
- e[2] !== t ? (c = t.map(it), h = c.some(Boolean), e[2] = t, e[3] = c, e[4] = h) : (c = e[3], h = e[4]);
293
- const i = h;
294
- if (l && l.options[0] !== a || !i)
295
- return null;
296
- let m;
297
- if (e[5] !== t || e[6] !== n || e[7] !== c || e[8] !== r || e[9] !== u) {
298
- let f;
299
- e[11] !== t.length || e[12] !== n || e[13] !== c || e[14] !== r || e[15] !== u ? (f = (d, g) => /* @__PURE__ */ _(et, { documentId: n, options: d, resolvers: c[g], schemaType: r, showPresentationTitle: t.length > 1, version: u }, g), e[11] = t.length, e[12] = n, e[13] = c, e[14] = r, e[15] = u, e[16] = f) : f = e[16], m = t.map(f), e[5] = t, e[6] = n, e[7] = c, e[8] = r, e[9] = u, e[10] = m;
300
- } else
301
- m = e[10];
302
- let P;
303
- return e[17] !== m ? (P = /* @__PURE__ */ _(ot, { children: m }), e[17] = m, e[18] = P) : P = e[18], P;
304
- }
305
- function it(o) {
306
- var e;
307
- return ((e = o.resolve) == null ? void 0 : e.locations) || o.locate;
308
- }
309
- function ct(o) {
310
- const e = x.c(15), {
311
- children: n,
312
- options: a
313
- } = o, r = b(Q), u = r == null ? void 0 : r.register, [l, s] = B(at);
314
- let t;
315
- e[0] !== u ? (t = (p) => u ? u(p) : (s((y) => [p].concat(y)), () => {
316
- s((y) => y.filter((S) => S !== p));
317
- }), e[0] = u, e[1] = t) : t = e[1];
318
- const c = t;
319
- let h;
320
- const i = (r == null ? void 0 : r.options) || l;
321
- let m;
322
- e[2] !== c || e[3] !== i ? (m = {
323
- options: i,
324
- register: c
325
- }, e[2] = c, e[3] = i, e[4] = m) : m = e[4], h = m;
326
- const P = h;
327
- let f;
328
- e[5] !== c ? (f = (p) => c(p), e[5] = c, e[6] = f) : f = e[6];
329
- const d = De(f);
330
- let g;
331
- e[7] !== a || e[8] !== d ? (g = () => d(a), e[7] = a, e[8] = d, e[9] = g) : g = e[9];
332
- let v;
333
- e[10] !== a ? (v = [a], e[10] = a, e[11] = v) : v = e[11], ae(g, v);
334
- let w;
335
- return e[12] !== n || e[13] !== P ? (w = /* @__PURE__ */ _(Q.Provider, { value: P, children: n }), e[12] = n, e[13] = P, e[14] = w) : w = e[14], w;
336
- }
337
- function at() {
338
- return [];
339
- }
340
- function lt(o) {
341
- const e = x.c(13), {
342
- documentId: n,
343
- documentType: a,
344
- path: r
345
- } = o, u = Pe(), {
346
- navigateIntent: l
347
- } = Be(), s = b(z);
348
- let t;
349
- const c = (s == null ? void 0 : s.name) || V;
350
- let h;
351
- e[0] !== n || e[1] !== a || e[2] !== c || e[3] !== u.tools ? (h = mt(u.tools, n, a, c), e[0] = n, e[1] = a, e[2] = c, e[3] = u.tools, e[4] = h) : h = e[4], t = h;
352
- const i = t, m = !s || r.length > 0 || !i, P = (i == null ? void 0 : i.icon) || Ne, f = `Open in ${(i == null ? void 0 : i.title) || "Structure"}`;
353
- let d;
354
- return e[5] !== n || e[6] !== a || e[7] !== l || e[8] !== r || e[9] !== m || e[10] !== P || e[11] !== f ? (d = {
355
- type: "action",
356
- hidden: m,
357
- icon: P,
358
- title: f,
359
- onAction() {
360
- l("edit", {
361
- id: n,
362
- type: a,
363
- mode: "structure",
364
- path: _e(r)
365
- });
366
- },
367
- renderAsButton: !0
368
- }, e[5] = n, e[6] = a, e[7] = l, e[8] = r, e[9] = m, e[10] = P, e[11] = f, e[12] = d) : d = e[12], d;
369
- }
370
- const X = ye({
371
- name: "presentation/openInStructure",
372
- useAction: lt
373
- });
374
- function mt(o, e, n, a) {
375
- var s;
376
- const r = o.filter((t) => t.name !== a).map((t) => {
377
- var h;
378
- const c = (h = t.canHandleIntent) == null ? void 0 : h.call(t, "edit", {
379
- id: e,
380
- type: n,
381
- mode: "structure"
382
- }, {});
383
- return {
384
- tool: t,
385
- match: c
386
- };
387
- }), u = r.filter((t) => ge(t.match) && t.match.mode);
388
- return u.length > 0 ? u[0].tool : (s = r.filter((t) => t.match)[0]) == null ? void 0 : s.tool;
389
- }
390
- const ut = ["preview", "viewport"];
391
- function ft(o, e, n, a) {
392
- const {
393
- id: r,
394
- mode: u,
395
- path: l,
396
- presentation: s,
397
- type: t,
398
- ...c
399
- } = e, i = {
400
- ...((n == null ? void 0 : n._searchParams) || []).filter(([m]) => ut.includes(m)).reduce((m, [P, f]) => ({
401
- ...m,
402
- [P]: f
403
- }), {}),
404
- ...c
405
- };
406
- return o === "edit" && r ? (i.preview = i.preview || new URLSearchParams(window.location.search).get("preview") || "/", {
407
- type: t || "*",
408
- id: te(r),
409
- path: l,
410
- _searchParams: Object.entries(i)
411
- }) : o === "create" ? (i.preview = i.preview || new URLSearchParams(window.location.search).get("preview") || "/", a && typeof a == "object" && (i.templateParams = Me(a)), {
412
- type: t || "*",
413
- id: r || Re(),
414
- _searchParams: Object.entries(i)
415
- }) : {
416
- intent: o,
417
- params: e,
418
- payload: a
419
- };
420
- }
421
- function dt() {
422
- const o = x.c(1);
423
- let e;
424
- return o[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ _(M, { align: "center", direction: "column", height: "fill", justify: "center", style: {
425
- width: "100%"
426
- }, children: /* @__PURE__ */ _(se, {}) }), o[0] = e) : e = o[0], e;
427
- }
428
- const pt = R.create("/", {
429
- __unsafe_disableScopedSearchParams: !0
430
- }, [R.intents("/intent"), R.create(":type", [R.create(":id", [R.create(":path")])])]), ht = ee(() => import("./PresentationToolGrantsCheck-B0q4AQ3b.mjs").then((o) => o.P)), vt = ee(() => import("./BroadcastDisplayedDocument-BSV9T3BU.mjs"));
431
- function Vt(o) {
432
- return o;
433
- }
434
- function zt(o) {
435
- return o;
436
- }
437
- const Ft = we((o) => {
438
- var l;
439
- const e = o.name || V;
440
- "locate" in o && console.warn("Presentation’s `locate` option is deprecated. Use `resolve.locations` instead.");
441
- const n = !!((l = o.resolve) != null && l.locations || o.locate);
442
- function a(s) {
443
- const t = x.c(22), c = s.value;
444
- let h;
445
- t[0] !== (c == null ? void 0 : c._id) ? (h = c != null && c._id ? te(c == null ? void 0 : c._id) : void 0, t[0] = c == null ? void 0 : c._id, t[1] = h) : h = t[1];
446
- const i = h;
447
- let m;
448
- t[2] !== c ? (m = c != null && c._id ? Se(c._id) : void 0, t[2] = c, t[3] = m) : m = t[3];
449
- const P = m;
450
- if (Te(s.schemaType)) {
451
- let d;
452
- t[4] !== i || t[5] !== P || t[6] !== s.schemaType ? (d = n && i && /* @__PURE__ */ _(rt, { documentId: i, version: P, options: o, schemaType: s.schemaType }), t[4] = i, t[5] = P, t[6] = s.schemaType, t[7] = d) : d = t[7];
453
- let g;
454
- t[8] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ _(dt, {}), t[8] = g) : g = t[8];
455
- let v;
456
- t[9] !== s ? (v = s.renderDefault(s), t[9] = s, t[10] = v) : v = t[10];
457
- let w;
458
- t[11] !== v ? (w = /* @__PURE__ */ _(K, { fallback: g, children: v }), t[11] = v, t[12] = w) : w = t[12];
459
- let p;
460
- t[13] !== i || t[14] !== c ? (p = /* @__PURE__ */ _(K, { children: /* @__PURE__ */ _(vt, { value: c }, i) }, "broadcast-displayed-document"), t[13] = i, t[14] = c, t[15] = p) : p = t[15];
461
- let y;
462
- return t[16] !== d || t[17] !== w || t[18] !== p ? (y = /* @__PURE__ */ E(ct, { options: o, children: [
463
- d,
464
- w,
465
- p
466
- ] }), t[16] = d, t[17] = w, t[18] = p, t[19] = y) : y = t[19], y;
467
- }
468
- let f;
469
- return t[20] !== s ? (f = s.renderDefault(s), t[20] = s, t[21] = f) : f = t[21], f;
470
- }
471
- function r(s) {
472
- return !("type" in s) || "presentation" in s && s.presentation !== e ? !1 : "template" in s ? {
473
- template: !0
474
- } : !0;
475
- }
476
- function u(s) {
477
- return !("type" in s) || !("id" in s) || "presentation" in s && s.presentation !== e ? !1 : "mode" in s ? {
478
- mode: s.mode === Ke
479
- } : !0;
480
- }
481
- return {
482
- i18n: {
483
- bundles: [qe]
484
- },
485
- document: {
486
- unstable_fieldActions: (s) => [
487
- ...s.filter((t) => t.name !== X.name),
488
- // prevent duplication
489
- X
490
- ]
491
- },
492
- form: {
493
- components: {
494
- input: a
495
- }
496
- },
497
- tools: [{
498
- icon: o.icon || Ye,
499
- name: e,
500
- title: o.title,
501
- component: ht,
502
- options: o,
503
- canHandleIntent(s, t) {
504
- return s === "create" ? r(t) : s === "edit" ? u(t) : !1;
505
- },
506
- getIntentState: ft,
507
- router: pt,
508
- __internalApplicationType: "sanity/presentation"
509
- }]
510
- };
511
- });
512
- function jt() {
513
- const o = b(me);
514
- if (!o)
515
- throw new Error("Presentation navigate context is missing");
516
- return o;
517
- }
518
- function Ht(o) {
519
- const e = o === void 0 ? !0 : o, n = b(ue);
520
- if (e && !n)
521
- throw new Error("Presentation params context is missing");
522
- return n;
523
- }
524
- export {
525
- Ut as A,
526
- V as D,
527
- Ke as E,
528
- Bt as L,
529
- kt as M,
530
- dt as P,
531
- He as S,
532
- Je as a,
533
- xt as b,
534
- Lt as c,
535
- bt as d,
536
- Ot as e,
537
- Ct as f,
538
- je as g,
539
- Fe as h,
540
- At as i,
541
- $t as j,
542
- jt as k,
543
- Mt as l,
544
- Ve as m,
545
- Dt as n,
546
- Nt as o,
547
- ie as p,
548
- Et as q,
549
- Vt as r,
550
- ze as s,
551
- Rt as t,
552
- Ht as u,
553
- zt as v,
554
- Ft as w
555
- };
556
- //# sourceMappingURL=presentation-DsIky7Cj.mjs.map