zudoku 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +121 -0
  2. package/dist/config/config.d.ts +2 -6
  3. package/dist/config/validators/InputSidebarSchema.d.ts +1 -0
  4. package/dist/config/validators/validate.d.ts +151 -37
  5. package/dist/config/validators/validate.js +14 -11
  6. package/dist/config/validators/validate.js.map +1 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/lib/authentication/state.d.ts +16 -0
  9. package/dist/lib/authentication/state.js +5 -0
  10. package/dist/lib/authentication/state.js.map +1 -1
  11. package/dist/lib/components/InlineCode.d.ts +2 -1
  12. package/dist/lib/components/InlineCode.js +9 -1
  13. package/dist/lib/components/InlineCode.js.map +1 -1
  14. package/dist/lib/components/Layout.js +1 -1
  15. package/dist/lib/components/Layout.js.map +1 -1
  16. package/dist/lib/oas/graphql/index.d.ts +2 -1
  17. package/dist/lib/oas/graphql/index.js +22 -10
  18. package/dist/lib/oas/graphql/index.js.map +1 -1
  19. package/dist/lib/oas/parser/index.d.ts +1 -0
  20. package/dist/lib/oas/parser/index.js.map +1 -1
  21. package/dist/lib/plugins/markdown/MdxPage.js +2 -2
  22. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  23. package/dist/lib/plugins/markdown/generateRoutes.d.ts +1 -1
  24. package/dist/lib/plugins/markdown/generateRoutes.js +8 -6
  25. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  26. package/dist/lib/plugins/markdown/index.d.ts +2 -1
  27. package/dist/lib/plugins/markdown/index.js +2 -2
  28. package/dist/lib/plugins/markdown/index.js.map +1 -1
  29. package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -3
  30. package/dist/lib/plugins/openapi/Endpoint.js +46 -8
  31. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  32. package/dist/lib/plugins/openapi/OperationList.js +1 -1
  33. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  34. package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
  35. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  36. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +2 -1
  37. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +2 -2
  38. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  39. package/dist/lib/plugins/openapi/Sidecar.js +14 -3
  40. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  41. package/dist/lib/plugins/openapi/SimpleSelect.d.ts +2 -1
  42. package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
  43. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
  44. package/dist/lib/plugins/openapi/graphql/gql.d.ts +10 -2
  45. package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
  46. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  47. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +29 -3
  48. package/dist/lib/plugins/openapi/graphql/graphql.js +87 -0
  49. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  50. package/dist/lib/plugins/openapi/interfaces.d.ts +3 -0
  51. package/dist/lib/plugins/openapi/playground/Playground.d.ts +2 -1
  52. package/dist/lib/plugins/openapi/playground/Playground.js +12 -4
  53. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  54. package/dist/lib/plugins/openapi/playground/createUrl.js +3 -1
  55. package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
  56. package/dist/vite/config.d.ts +1 -1
  57. package/dist/vite/config.js +7 -3
  58. package/dist/vite/config.js.map +1 -1
  59. package/dist/vite/dev-server.d.ts +1 -0
  60. package/dist/vite/dev-server.js +7 -13
  61. package/dist/vite/dev-server.js.map +1 -1
  62. package/dist/vite/plugin-api.js +4 -7
  63. package/dist/vite/plugin-api.js.map +1 -1
  64. package/dist/vite/plugin-config-reload.js +9 -4
  65. package/dist/vite/plugin-config-reload.js.map +1 -1
  66. package/dist/vite/plugin-docs.js +7 -5
  67. package/dist/vite/plugin-docs.js.map +1 -1
  68. package/dist/vite/plugin-frontmatter.d.ts +2 -0
  69. package/dist/vite/plugin-frontmatter.js +30 -0
  70. package/dist/vite/plugin-frontmatter.js.map +1 -0
  71. package/dist/vite/plugin-sidebar.js +14 -1
  72. package/dist/vite/plugin-sidebar.js.map +1 -1
  73. package/dist/vite/plugin.js +2 -2
  74. package/dist/vite/plugin.js.map +1 -1
  75. package/lib/{CategoryHeading-XnFqN2lJ.js → CategoryHeading-ovR-zHRq.js} +2 -2
  76. package/lib/{CategoryHeading-XnFqN2lJ.js.map → CategoryHeading-ovR-zHRq.js.map} +1 -1
  77. package/lib/{DeveloperHint-FBb2uXJe.js → DeveloperHint-YeWHKvyr.js} +2 -2
  78. package/lib/{DeveloperHint-FBb2uXJe.js.map → DeveloperHint-YeWHKvyr.js.map} +1 -1
  79. package/lib/{ErrorPage-knunPbKI.js → ErrorPage-Dri5_2lr.js} +3 -3
  80. package/lib/{ErrorPage-knunPbKI.js.map → ErrorPage-Dri5_2lr.js.map} +1 -1
  81. package/lib/{Input-BEDZAKw0.js → Input-CtVUl3eT.js} +3 -3
  82. package/lib/{Input-BEDZAKw0.js.map → Input-CtVUl3eT.js.map} +1 -1
  83. package/lib/{Markdown-B4aR03g6.js → Markdown-DapSf3wG.js} +795 -793
  84. package/lib/Markdown-DapSf3wG.js.map +1 -0
  85. package/lib/{MdxPage-BZyQsH8Z.js → MdxPage-BqBWsXZ1.js} +23 -23
  86. package/lib/MdxPage-BqBWsXZ1.js.map +1 -0
  87. package/lib/{OperationList-2NeWEM0u.js → OperationList-JAQF5-tn.js} +151 -109
  88. package/lib/OperationList-JAQF5-tn.js.map +1 -0
  89. package/lib/{Route-BZPewmrN.js → Route-DSANUy5e.js} +2 -2
  90. package/lib/{Route-BZPewmrN.js.map → Route-DSANUy5e.js.map} +1 -1
  91. package/lib/{SidebarBadge-COz0hgfa.js → SidebarBadge-Dx7jtnoA.js} +3 -3
  92. package/lib/{SidebarBadge-COz0hgfa.js.map → SidebarBadge-Dx7jtnoA.js.map} +1 -1
  93. package/lib/{SlotletProvider-DJMaOUDs.js → SlotletProvider-D3UD5Go3.js} +4 -4
  94. package/lib/{SlotletProvider-DJMaOUDs.js.map → SlotletProvider-D3UD5Go3.js.map} +1 -1
  95. package/lib/assets/{worker-BvD7B6MG.js → worker-Bcj4NA2p.js} +3430 -1351
  96. package/lib/assets/worker-Bcj4NA2p.js.map +1 -0
  97. package/lib/index-Bn6Lc9tq.js +9 -0
  98. package/lib/index-Bn6Lc9tq.js.map +1 -0
  99. package/lib/{index-1EDgIO6b.js → index-BngPzhKn.js} +3 -3
  100. package/lib/{index-1EDgIO6b.js.map → index-BngPzhKn.js.map} +1 -1
  101. package/lib/{index-Zezcv0xb.js → index-Dolisrci.js} +3 -3
  102. package/lib/{index-Zezcv0xb.js.map → index-Dolisrci.js.map} +1 -1
  103. package/lib/{index-Dv2KZuEw.js → index-DyJyULzS.js} +1774 -1643
  104. package/lib/index-DyJyULzS.js.map +1 -0
  105. package/lib/index-LNp6rxyU.js +2094 -0
  106. package/lib/index-LNp6rxyU.js.map +1 -0
  107. package/lib/state-hNe1dw4B.js +548 -0
  108. package/lib/state-hNe1dw4B.js.map +1 -0
  109. package/lib/zudoku.auth-auth0.js +1 -1
  110. package/lib/zudoku.auth-clerk.js +1 -1
  111. package/lib/zudoku.auth-openid.js +4 -4
  112. package/lib/zudoku.components.js +6 -6
  113. package/lib/zudoku.components.js.map +1 -1
  114. package/lib/zudoku.openapi-worker.js +497 -489
  115. package/lib/zudoku.openapi-worker.js.map +1 -1
  116. package/lib/zudoku.plugin-api-keys.js +5 -5
  117. package/lib/zudoku.plugin-custom-page.js +1 -1
  118. package/lib/zudoku.plugin-markdown.js +18 -15
  119. package/lib/zudoku.plugin-markdown.js.map +1 -1
  120. package/lib/zudoku.plugin-openapi.js +4 -4
  121. package/package.json +14 -4
  122. package/src/lib/authentication/state.ts +17 -0
  123. package/src/lib/components/InlineCode.tsx +10 -0
  124. package/src/lib/components/Layout.tsx +1 -1
  125. package/src/lib/oas/graphql/index.ts +33 -13
  126. package/src/lib/oas/parser/index.ts +1 -0
  127. package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
  128. package/src/lib/plugins/markdown/generateRoutes.tsx +8 -5
  129. package/src/lib/plugins/markdown/index.tsx +3 -1
  130. package/src/lib/plugins/openapi/Endpoint.tsx +86 -22
  131. package/src/lib/plugins/openapi/OperationList.tsx +3 -1
  132. package/src/lib/plugins/openapi/OperationListItem.tsx +1 -1
  133. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +3 -0
  134. package/src/lib/plugins/openapi/Sidecar.tsx +17 -2
  135. package/src/lib/plugins/openapi/SimpleSelect.tsx +10 -2
  136. package/src/lib/plugins/openapi/graphql/gql.ts +11 -3
  137. package/src/lib/plugins/openapi/graphql/graphql.ts +116 -4
  138. package/src/lib/plugins/openapi/interfaces.ts +4 -1
  139. package/src/lib/plugins/openapi/playground/Playground.tsx +38 -4
  140. package/src/lib/plugins/openapi/playground/createUrl.ts +6 -1
  141. package/dist/lib/util/slugify.d.ts +0 -2
  142. package/dist/lib/util/slugify.js +0 -3
  143. package/dist/lib/util/slugify.js.map +0 -1
  144. package/dist/vite/plugin-icons.d.ts +0 -3
  145. package/dist/vite/plugin-icons.js +0 -47
  146. package/dist/vite/plugin-icons.js.map +0 -1
  147. package/lib/Markdown-B4aR03g6.js.map +0 -1
  148. package/lib/MdxPage-BZyQsH8Z.js.map +0 -1
  149. package/lib/OperationList-2NeWEM0u.js.map +0 -1
  150. package/lib/assets/worker-BvD7B6MG.js.map +0 -1
  151. package/lib/index-Dv2KZuEw.js.map +0 -1
  152. package/lib/slugify-DbLhpSPt.js +0 -28
  153. package/lib/slugify-DbLhpSPt.js.map +0 -1
  154. package/lib/state-lIwt9isb.js +0 -288
  155. package/lib/state-lIwt9isb.js.map +0 -1
  156. package/src/lib/util/slugify.ts +0 -3
@@ -0,0 +1,548 @@
1
+ import T from "react";
2
+ import { g as Z } from "./_commonjsHelpers-BkfeUUK-.js";
3
+ var ee = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
4
+ const G = (e) => {
5
+ let c;
6
+ const u = /* @__PURE__ */ new Set(), a = (f, i) => {
7
+ const s = typeof f == "function" ? f(c) : f;
8
+ if (!Object.is(s, c)) {
9
+ const v = c;
10
+ c = i ?? (typeof s != "object" || s === null) ? s : Object.assign({}, c, s), u.forEach((p) => p(c, v));
11
+ }
12
+ }, _ = () => c, E = { setState: a, getState: _, getInitialState: () => d, subscribe: (f) => (u.add(f), () => u.delete(f)), destroy: () => {
13
+ (ee ? "production" : void 0) !== "production" && console.warn(
14
+ "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."
15
+ ), u.clear();
16
+ } }, d = c = e(a, _, E);
17
+ return E;
18
+ }, te = (e) => e ? G(e) : G;
19
+ var N = { exports: {} }, M = {}, b = { exports: {} }, U = {};
20
+ /**
21
+ * @license React
22
+ * use-sync-external-store-shim.production.min.js
23
+ *
24
+ * Copyright (c) Facebook, Inc. and its affiliates.
25
+ *
26
+ * This source code is licensed under the MIT license found in the
27
+ * LICENSE file in the root directory of this source tree.
28
+ */
29
+ var z;
30
+ function re() {
31
+ if (z) return U;
32
+ z = 1;
33
+ var e = T;
34
+ function c(i, s) {
35
+ return i === s && (i !== 0 || 1 / i === 1 / s) || i !== i && s !== s;
36
+ }
37
+ var u = typeof Object.is == "function" ? Object.is : c, a = e.useState, _ = e.useEffect, t = e.useLayoutEffect, O = e.useDebugValue;
38
+ function y(i, s) {
39
+ var v = s(), p = a({ inst: { value: v, getSnapshot: s } }), n = p[0].inst, r = p[1];
40
+ return t(function() {
41
+ n.value = v, n.getSnapshot = s, E(n) && r({ inst: n });
42
+ }, [i, v, s]), _(function() {
43
+ return E(n) && r({ inst: n }), i(function() {
44
+ E(n) && r({ inst: n });
45
+ });
46
+ }, [i]), O(v), v;
47
+ }
48
+ function E(i) {
49
+ var s = i.getSnapshot;
50
+ i = i.value;
51
+ try {
52
+ var v = s();
53
+ return !u(i, v);
54
+ } catch {
55
+ return !0;
56
+ }
57
+ }
58
+ function d(i, s) {
59
+ return s();
60
+ }
61
+ var f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : y;
62
+ return U.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : f, U;
63
+ }
64
+ var W = {};
65
+ /**
66
+ * @license React
67
+ * use-sync-external-store-shim.development.js
68
+ *
69
+ * Copyright (c) Facebook, Inc. and its affiliates.
70
+ *
71
+ * This source code is licensed under the MIT license found in the
72
+ * LICENSE file in the root directory of this source tree.
73
+ */
74
+ var K;
75
+ function ne() {
76
+ return K || (K = 1, process.env.NODE_ENV !== "production" && function() {
77
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
78
+ var e = T, c = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
79
+ function u(l) {
80
+ {
81
+ for (var S = arguments.length, g = new Array(S > 1 ? S - 1 : 0), m = 1; m < S; m++)
82
+ g[m - 1] = arguments[m];
83
+ a("error", l, g);
84
+ }
85
+ }
86
+ function a(l, S, g) {
87
+ {
88
+ var m = c.ReactDebugCurrentFrame, R = m.getStackAddendum();
89
+ R !== "" && (S += "%s", g = g.concat([R]));
90
+ var D = g.map(function(L) {
91
+ return String(L);
92
+ });
93
+ D.unshift("Warning: " + S), Function.prototype.apply.call(console[l], console, D);
94
+ }
95
+ }
96
+ function _(l, S) {
97
+ return l === S && (l !== 0 || 1 / l === 1 / S) || l !== l && S !== S;
98
+ }
99
+ var t = typeof Object.is == "function" ? Object.is : _, O = e.useState, y = e.useEffect, E = e.useLayoutEffect, d = e.useDebugValue, f = !1, i = !1;
100
+ function s(l, S, g) {
101
+ f || e.startTransition !== void 0 && (f = !0, u("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
102
+ var m = S();
103
+ if (!i) {
104
+ var R = S();
105
+ t(m, R) || (u("The result of getSnapshot should be cached to avoid an infinite loop"), i = !0);
106
+ }
107
+ var D = O({
108
+ inst: {
109
+ value: m,
110
+ getSnapshot: S
111
+ }
112
+ }), L = D[0].inst, w = D[1];
113
+ return E(function() {
114
+ L.value = m, L.getSnapshot = S, v(L) && w({
115
+ inst: L
116
+ });
117
+ }, [l, m, S]), y(function() {
118
+ v(L) && w({
119
+ inst: L
120
+ });
121
+ var x = function() {
122
+ v(L) && w({
123
+ inst: L
124
+ });
125
+ };
126
+ return l(x);
127
+ }, [l]), d(m), m;
128
+ }
129
+ function v(l) {
130
+ var S = l.getSnapshot, g = l.value;
131
+ try {
132
+ var m = S();
133
+ return !t(g, m);
134
+ } catch {
135
+ return !0;
136
+ }
137
+ }
138
+ function p(l, S, g) {
139
+ return S();
140
+ }
141
+ var n = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", r = !n, h = r ? p : s, o = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : h;
142
+ W.useSyncExternalStore = o, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
143
+ }()), W;
144
+ }
145
+ var P;
146
+ function J() {
147
+ return P || (P = 1, process.env.NODE_ENV === "production" ? b.exports = re() : b.exports = ne()), b.exports;
148
+ }
149
+ /**
150
+ * @license React
151
+ * use-sync-external-store-shim/with-selector.production.min.js
152
+ *
153
+ * Copyright (c) Facebook, Inc. and its affiliates.
154
+ *
155
+ * This source code is licensed under the MIT license found in the
156
+ * LICENSE file in the root directory of this source tree.
157
+ */
158
+ var q;
159
+ function oe() {
160
+ if (q) return M;
161
+ q = 1;
162
+ var e = T, c = J();
163
+ function u(d, f) {
164
+ return d === f && (d !== 0 || 1 / d === 1 / f) || d !== d && f !== f;
165
+ }
166
+ var a = typeof Object.is == "function" ? Object.is : u, _ = c.useSyncExternalStore, t = e.useRef, O = e.useEffect, y = e.useMemo, E = e.useDebugValue;
167
+ return M.useSyncExternalStoreWithSelector = function(d, f, i, s, v) {
168
+ var p = t(null);
169
+ if (p.current === null) {
170
+ var n = { hasValue: !1, value: null };
171
+ p.current = n;
172
+ } else n = p.current;
173
+ p = y(function() {
174
+ function h(m) {
175
+ if (!o) {
176
+ if (o = !0, l = m, m = s(m), v !== void 0 && n.hasValue) {
177
+ var R = n.value;
178
+ if (v(R, m)) return S = R;
179
+ }
180
+ return S = m;
181
+ }
182
+ if (R = S, a(l, m)) return R;
183
+ var D = s(m);
184
+ return v !== void 0 && v(R, D) ? R : (l = m, S = D);
185
+ }
186
+ var o = !1, l, S, g = i === void 0 ? null : i;
187
+ return [function() {
188
+ return h(f());
189
+ }, g === null ? void 0 : function() {
190
+ return h(g());
191
+ }];
192
+ }, [f, i, s, v]);
193
+ var r = _(d, p[0], p[1]);
194
+ return O(function() {
195
+ n.hasValue = !0, n.value = r;
196
+ }, [r]), E(r), r;
197
+ }, M;
198
+ }
199
+ var j = {};
200
+ /**
201
+ * @license React
202
+ * use-sync-external-store-shim/with-selector.development.js
203
+ *
204
+ * Copyright (c) Facebook, Inc. and its affiliates.
205
+ *
206
+ * This source code is licensed under the MIT license found in the
207
+ * LICENSE file in the root directory of this source tree.
208
+ */
209
+ var F;
210
+ function ie() {
211
+ return F || (F = 1, process.env.NODE_ENV !== "production" && function() {
212
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
213
+ var e = T, c = J();
214
+ function u(f, i) {
215
+ return f === i && (f !== 0 || 1 / f === 1 / i) || f !== f && i !== i;
216
+ }
217
+ var a = typeof Object.is == "function" ? Object.is : u, _ = c.useSyncExternalStore, t = e.useRef, O = e.useEffect, y = e.useMemo, E = e.useDebugValue;
218
+ function d(f, i, s, v, p) {
219
+ var n = t(null), r;
220
+ n.current === null ? (r = {
221
+ hasValue: !1,
222
+ value: null
223
+ }, n.current = r) : r = n.current;
224
+ var h = y(function() {
225
+ var g = !1, m, R, D = function(I) {
226
+ if (!g) {
227
+ g = !0, m = I;
228
+ var C = v(I);
229
+ if (p !== void 0 && r.hasValue) {
230
+ var H = r.value;
231
+ if (p(H, C))
232
+ return R = H, H;
233
+ }
234
+ return R = C, C;
235
+ }
236
+ var X = m, V = R;
237
+ if (a(X, I))
238
+ return V;
239
+ var B = v(I);
240
+ return p !== void 0 && p(V, B) ? V : (m = I, R = B, B);
241
+ }, L = s === void 0 ? null : s, w = function() {
242
+ return D(i());
243
+ }, x = L === null ? void 0 : function() {
244
+ return D(L());
245
+ };
246
+ return [w, x];
247
+ }, [i, s, v, p]), o = h[0], l = h[1], S = _(f, o, l);
248
+ return O(function() {
249
+ r.hasValue = !0, r.value = S;
250
+ }, [S]), E(S), S;
251
+ }
252
+ j.useSyncExternalStoreWithSelector = d, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
253
+ }()), j;
254
+ }
255
+ process.env.NODE_ENV === "production" ? N.exports = oe() : N.exports = ie();
256
+ var ue = N.exports;
257
+ const ae = /* @__PURE__ */ Z(ue);
258
+ var Y = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
259
+ const { useDebugValue: se } = T, { useSyncExternalStoreWithSelector: ce } = ae;
260
+ let $ = !1;
261
+ const le = (e) => e;
262
+ function de(e, c = le, u) {
263
+ (Y ? "production" : void 0) !== "production" && u && !$ && (console.warn(
264
+ "[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"
265
+ ), $ = !0);
266
+ const a = ce(
267
+ e.subscribe,
268
+ e.getState,
269
+ e.getServerState || e.getInitialState,
270
+ c,
271
+ u
272
+ );
273
+ return se(a), a;
274
+ }
275
+ const k = (e) => {
276
+ (Y ? "production" : void 0) !== "production" && typeof e != "function" && console.warn(
277
+ "[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`."
278
+ );
279
+ const c = typeof e == "function" ? te(e) : e, u = (a, _) => de(c, a, _);
280
+ return Object.assign(u, c), u;
281
+ }, Q = (e) => e ? k(e) : k;
282
+ var fe = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
283
+ function ve(e, c) {
284
+ let u;
285
+ try {
286
+ u = e();
287
+ } catch {
288
+ return;
289
+ }
290
+ return {
291
+ getItem: (_) => {
292
+ var t;
293
+ const O = (E) => E === null ? null : JSON.parse(E, void 0), y = (t = u.getItem(_)) != null ? t : null;
294
+ return y instanceof Promise ? y.then(O) : O(y);
295
+ },
296
+ setItem: (_, t) => u.setItem(
297
+ _,
298
+ JSON.stringify(t, void 0)
299
+ ),
300
+ removeItem: (_) => u.removeItem(_)
301
+ };
302
+ }
303
+ const A = (e) => (c) => {
304
+ try {
305
+ const u = e(c);
306
+ return u instanceof Promise ? u : {
307
+ then(a) {
308
+ return A(a)(u);
309
+ },
310
+ catch(a) {
311
+ return this;
312
+ }
313
+ };
314
+ } catch (u) {
315
+ return {
316
+ then(a) {
317
+ return this;
318
+ },
319
+ catch(a) {
320
+ return A(a)(u);
321
+ }
322
+ };
323
+ }
324
+ }, Se = (e, c) => (u, a, _) => {
325
+ let t = {
326
+ getStorage: () => localStorage,
327
+ serialize: JSON.stringify,
328
+ deserialize: JSON.parse,
329
+ partialize: (r) => r,
330
+ version: 0,
331
+ merge: (r, h) => ({
332
+ ...h,
333
+ ...r
334
+ }),
335
+ ...c
336
+ }, O = !1;
337
+ const y = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set();
338
+ let d;
339
+ try {
340
+ d = t.getStorage();
341
+ } catch {
342
+ }
343
+ if (!d)
344
+ return e(
345
+ (...r) => {
346
+ console.warn(
347
+ `[zustand persist middleware] Unable to update item '${t.name}', the given storage is currently unavailable.`
348
+ ), u(...r);
349
+ },
350
+ a,
351
+ _
352
+ );
353
+ const f = A(t.serialize), i = () => {
354
+ const r = t.partialize({ ...a() });
355
+ let h;
356
+ const o = f({ state: r, version: t.version }).then(
357
+ (l) => d.setItem(t.name, l)
358
+ ).catch((l) => {
359
+ h = l;
360
+ });
361
+ if (h)
362
+ throw h;
363
+ return o;
364
+ }, s = _.setState;
365
+ _.setState = (r, h) => {
366
+ s(r, h), i();
367
+ };
368
+ const v = e(
369
+ (...r) => {
370
+ u(...r), i();
371
+ },
372
+ a,
373
+ _
374
+ );
375
+ let p;
376
+ const n = () => {
377
+ var r;
378
+ if (!d) return;
379
+ O = !1, y.forEach((o) => o(a()));
380
+ const h = ((r = t.onRehydrateStorage) == null ? void 0 : r.call(t, a())) || void 0;
381
+ return A(d.getItem.bind(d))(t.name).then((o) => {
382
+ if (o)
383
+ return t.deserialize(o);
384
+ }).then((o) => {
385
+ if (o)
386
+ if (typeof o.version == "number" && o.version !== t.version) {
387
+ if (t.migrate)
388
+ return t.migrate(
389
+ o.state,
390
+ o.version
391
+ );
392
+ console.error(
393
+ "State loaded from storage couldn't be migrated since no migrate function was provided"
394
+ );
395
+ } else
396
+ return o.state;
397
+ }).then((o) => {
398
+ var l;
399
+ return p = t.merge(
400
+ o,
401
+ (l = a()) != null ? l : v
402
+ ), u(p, !0), i();
403
+ }).then(() => {
404
+ h == null || h(p, void 0), O = !0, E.forEach((o) => o(p));
405
+ }).catch((o) => {
406
+ h == null || h(void 0, o);
407
+ });
408
+ };
409
+ return _.persist = {
410
+ setOptions: (r) => {
411
+ t = {
412
+ ...t,
413
+ ...r
414
+ }, r.getStorage && (d = r.getStorage());
415
+ },
416
+ clearStorage: () => {
417
+ d == null || d.removeItem(t.name);
418
+ },
419
+ getOptions: () => t,
420
+ rehydrate: () => n(),
421
+ hasHydrated: () => O,
422
+ onHydrate: (r) => (y.add(r), () => {
423
+ y.delete(r);
424
+ }),
425
+ onFinishHydration: (r) => (E.add(r), () => {
426
+ E.delete(r);
427
+ })
428
+ }, n(), p || v;
429
+ }, _e = (e, c) => (u, a, _) => {
430
+ let t = {
431
+ storage: ve(() => localStorage),
432
+ partialize: (n) => n,
433
+ version: 0,
434
+ merge: (n, r) => ({
435
+ ...r,
436
+ ...n
437
+ }),
438
+ ...c
439
+ }, O = !1;
440
+ const y = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set();
441
+ let d = t.storage;
442
+ if (!d)
443
+ return e(
444
+ (...n) => {
445
+ console.warn(
446
+ `[zustand persist middleware] Unable to update item '${t.name}', the given storage is currently unavailable.`
447
+ ), u(...n);
448
+ },
449
+ a,
450
+ _
451
+ );
452
+ const f = () => {
453
+ const n = t.partialize({ ...a() });
454
+ return d.setItem(t.name, {
455
+ state: n,
456
+ version: t.version
457
+ });
458
+ }, i = _.setState;
459
+ _.setState = (n, r) => {
460
+ i(n, r), f();
461
+ };
462
+ const s = e(
463
+ (...n) => {
464
+ u(...n), f();
465
+ },
466
+ a,
467
+ _
468
+ );
469
+ _.getInitialState = () => s;
470
+ let v;
471
+ const p = () => {
472
+ var n, r;
473
+ if (!d) return;
474
+ O = !1, y.forEach((o) => {
475
+ var l;
476
+ return o((l = a()) != null ? l : s);
477
+ });
478
+ const h = ((r = t.onRehydrateStorage) == null ? void 0 : r.call(t, (n = a()) != null ? n : s)) || void 0;
479
+ return A(d.getItem.bind(d))(t.name).then((o) => {
480
+ if (o)
481
+ if (typeof o.version == "number" && o.version !== t.version) {
482
+ if (t.migrate)
483
+ return [
484
+ !0,
485
+ t.migrate(
486
+ o.state,
487
+ o.version
488
+ )
489
+ ];
490
+ console.error(
491
+ "State loaded from storage couldn't be migrated since no migrate function was provided"
492
+ );
493
+ } else
494
+ return [!1, o.state];
495
+ return [!1, void 0];
496
+ }).then((o) => {
497
+ var l;
498
+ const [S, g] = o;
499
+ if (v = t.merge(
500
+ g,
501
+ (l = a()) != null ? l : s
502
+ ), u(v, !0), S)
503
+ return f();
504
+ }).then(() => {
505
+ h == null || h(v, void 0), v = a(), O = !0, E.forEach((o) => o(v));
506
+ }).catch((o) => {
507
+ h == null || h(void 0, o);
508
+ });
509
+ };
510
+ return _.persist = {
511
+ setOptions: (n) => {
512
+ t = {
513
+ ...t,
514
+ ...n
515
+ }, n.storage && (d = n.storage);
516
+ },
517
+ clearStorage: () => {
518
+ d == null || d.removeItem(t.name);
519
+ },
520
+ getOptions: () => t,
521
+ rehydrate: () => p(),
522
+ hasHydrated: () => O,
523
+ onHydrate: (n) => (y.add(n), () => {
524
+ y.delete(n);
525
+ }),
526
+ onFinishHydration: (n) => (E.add(n), () => {
527
+ E.delete(n);
528
+ })
529
+ }, t.skipHydration || p(), v || s;
530
+ }, pe = (e, c) => "getStorage" in c || "serialize" in c || "deserialize" in c ? ((fe ? "production" : void 0) !== "production" && console.warn(
531
+ "[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."
532
+ ), Se(e, c)) : _e(e, c), me = pe, ye = Q(() => ({
533
+ isPending: !1,
534
+ isAuthenticated: !1
535
+ })), Oe = Q()(
536
+ me(
537
+ (e) => ({
538
+ selectedServer: void 0,
539
+ setSelectedServer: (c) => e({ selectedServer: c })
540
+ }),
541
+ { name: "zudoku-selected-server" }
542
+ )
543
+ );
544
+ export {
545
+ Oe as a,
546
+ ye as u
547
+ };
548
+ //# sourceMappingURL=state-hNe1dw4B.js.map