zudoku 0.16.2 → 0.17.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 (174) hide show
  1. package/dist/app/entry.server.js +4 -5
  2. package/dist/app/entry.server.js.map +1 -1
  3. package/dist/app/main.d.ts +1 -1
  4. package/dist/app/main.js +2 -2
  5. package/dist/app/main.js.map +1 -1
  6. package/dist/config/validators/validate.d.ts +44 -44
  7. package/dist/config/validators/validate.js.map +1 -1
  8. package/dist/index.d.ts +2 -2
  9. package/dist/index.js +1 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/lib/authentication/authentication.d.ts +2 -2
  12. package/dist/lib/authentication/state.d.ts +1 -1
  13. package/dist/lib/authentication/state.js +5 -3
  14. package/dist/lib/authentication/state.js.map +1 -1
  15. package/dist/lib/authentication/use-broadcast/shared.d.ts +48 -0
  16. package/dist/lib/authentication/use-broadcast/shared.js +243 -0
  17. package/dist/lib/authentication/use-broadcast/shared.js.map +1 -0
  18. package/dist/lib/authentication/use-broadcast/useBroadcast.d.ts +24 -0
  19. package/dist/lib/authentication/use-broadcast/useBroadcast.js +106 -0
  20. package/dist/lib/authentication/use-broadcast/useBroadcast.js.map +1 -0
  21. package/dist/lib/components/ClientOnly.d.ts +4 -2
  22. package/dist/lib/components/ClientOnly.js +1 -1
  23. package/dist/lib/components/ClientOnly.js.map +1 -1
  24. package/dist/lib/components/Header.js +4 -2
  25. package/dist/lib/components/Header.js.map +1 -1
  26. package/dist/lib/components/{DevPortal.d.ts → Zudoku.d.ts} +3 -3
  27. package/dist/lib/components/{DevPortal.js → Zudoku.js} +11 -11
  28. package/dist/lib/components/Zudoku.js.map +1 -0
  29. package/dist/lib/components/context/ZudokuContext.d.ts +4 -4
  30. package/dist/lib/components/context/ZudokuContext.js +1 -1
  31. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  32. package/dist/lib/components/context/ZudokuProvider.d.ts +2 -2
  33. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  34. package/dist/lib/components/index.d.ts +4 -7
  35. package/dist/lib/components/index.js +2 -3
  36. package/dist/lib/components/index.js.map +1 -1
  37. package/dist/lib/core/{DevPortalContext.d.ts → ZudokuContext.d.ts} +5 -5
  38. package/dist/lib/core/{DevPortalContext.js → ZudokuContext.js} +2 -2
  39. package/dist/lib/core/ZudokuContext.js.map +1 -0
  40. package/dist/lib/core/plugins.d.ts +12 -12
  41. package/dist/lib/core/plugins.js.map +1 -1
  42. package/dist/lib/plugins/api-keys/index.d.ts +9 -9
  43. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  44. package/dist/lib/plugins/custom-pages/index.d.ts +2 -2
  45. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  46. package/dist/lib/plugins/markdown/index.d.ts +2 -2
  47. package/dist/lib/plugins/markdown/index.js.map +1 -1
  48. package/dist/lib/plugins/openapi/CollapsibleCode.js +4 -2
  49. package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
  50. package/dist/lib/plugins/openapi/OperationList.js +1 -1
  51. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  52. package/dist/lib/plugins/openapi/ParameterListItem.js +6 -1
  53. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  54. package/dist/lib/plugins/openapi/Sidecar.js +28 -24
  55. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  56. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +1 -4
  57. package/dist/lib/plugins/openapi/client/createMemoryClient.js +9 -1
  58. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
  59. package/dist/lib/plugins/openapi/client/createWorkerClient.js +2 -1
  60. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
  61. package/dist/lib/plugins/openapi/index.d.ts +2 -2
  62. package/dist/lib/plugins/openapi/index.js.map +1 -1
  63. package/dist/lib/plugins/redirect/index.d.ts +2 -2
  64. package/dist/lib/plugins/redirect/index.js.map +1 -1
  65. package/dist/lib/plugins/search-inkeep/index.d.ts +2 -2
  66. package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
  67. package/dist/lib/ui/ActionButton.d.ts +4 -0
  68. package/dist/lib/ui/ActionButton.js +10 -0
  69. package/dist/lib/ui/ActionButton.js.map +1 -0
  70. package/dist/lib/util/useIsomorphicLayoutEffect.d.ts +3 -0
  71. package/dist/lib/util/useIsomorphicLayoutEffect.js +4 -0
  72. package/dist/lib/util/useIsomorphicLayoutEffect.js.map +1 -0
  73. package/dist/lib/util/useOnScreen.d.ts +4 -0
  74. package/dist/lib/util/useOnScreen.js +19 -0
  75. package/dist/lib/util/useOnScreen.js.map +1 -0
  76. package/dist/vite/plugin-mdx.d.ts +0 -6
  77. package/dist/vite/plugin-mdx.js.map +1 -1
  78. package/lib/{AnchorLink-BbB2q-jx.js → AnchorLink-DYbUOP9U.js} +2 -2
  79. package/lib/{AnchorLink-BbB2q-jx.js.map → AnchorLink-DYbUOP9U.js.map} +1 -1
  80. package/lib/{AuthenticationPlugin-C9BHGXlE.js → AuthenticationPlugin-bqGAKfot.js} +3 -3
  81. package/lib/{AuthenticationPlugin-C9BHGXlE.js.map → AuthenticationPlugin-bqGAKfot.js.map} +1 -1
  82. package/lib/{ClientOnly-CVN6leDu.js → ClientOnly-E7hGysn1.js} +4 -4
  83. package/lib/ClientOnly-E7hGysn1.js.map +1 -0
  84. package/lib/{Markdown-BDcCAWwm.js → Markdown-D6UxMbZm.js} +2 -2
  85. package/lib/{Markdown-BDcCAWwm.js.map → Markdown-D6UxMbZm.js.map} +1 -1
  86. package/lib/{MdxPage-DKMH_t0f.js → MdxPage-DRKqyn2b.js} +5 -5
  87. package/lib/{MdxPage-DKMH_t0f.js.map → MdxPage-DRKqyn2b.js.map} +1 -1
  88. package/lib/{OperationList-35iw_Gil.js → OperationList-BHUBGM0c.js} +116 -113
  89. package/lib/OperationList-BHUBGM0c.js.map +1 -0
  90. package/lib/{Route-BsEZmkNl.js → Route-B0XuN1oC.js} +3 -3
  91. package/lib/{Route-BsEZmkNl.js.map → Route-B0XuN1oC.js.map} +1 -1
  92. package/lib/{Select-Bagt3Bme.js → Select-DYKDahHt.js} +3 -3
  93. package/lib/{Select-Bagt3Bme.js.map → Select-DYKDahHt.js.map} +1 -1
  94. package/lib/{Spinner-C6zroowC.js → SidebarBadge-Bbt92M5K.js} +16 -18
  95. package/lib/SidebarBadge-Bbt92M5K.js.map +1 -0
  96. package/lib/{SlotletProvider-Da7eFgd2.js → SlotletProvider-mhjLPG44.js} +4 -4
  97. package/lib/{SlotletProvider-Da7eFgd2.js.map → SlotletProvider-mhjLPG44.js.map} +1 -1
  98. package/lib/Spinner-ChOGyPls.js +51 -0
  99. package/lib/Spinner-ChOGyPls.js.map +1 -0
  100. package/lib/{hook-sn0zMTkE.js → hook-CjQERPa7.js} +3 -3
  101. package/lib/{hook-sn0zMTkE.js.map → hook-CjQERPa7.js.map} +1 -1
  102. package/lib/{index-BdD8UbS-.js → index-BRg5pi5D.js} +1351 -1364
  103. package/lib/index-BRg5pi5D.js.map +1 -0
  104. package/lib/{index-CRo94sKK.js → index-DM9hrcCG.js} +4 -4
  105. package/lib/{index-CRo94sKK.js.map → index-DM9hrcCG.js.map} +1 -1
  106. package/lib/state-BsPrOUAh.js +252 -0
  107. package/lib/state-BsPrOUAh.js.map +1 -0
  108. package/lib/ui/ActionButton.js +24 -0
  109. package/lib/ui/ActionButton.js.map +1 -0
  110. package/lib/urql-core-35Qt_U4i.js +1511 -0
  111. package/lib/{urql-core-KJnLL26g.js.map → urql-core-35Qt_U4i.js.map} +1 -1
  112. package/lib/{useExposedProps-ChOIUaS4.js → useExposedProps-BxyHjPNN.js} +2 -2
  113. package/lib/{useExposedProps-ChOIUaS4.js.map → useExposedProps-BxyHjPNN.js.map} +1 -1
  114. package/lib/{ZudokuContext-BKXGJTmu.js → utils-DNAltzXc.js} +153 -152
  115. package/lib/utils-DNAltzXc.js.map +1 -0
  116. package/lib/zudoku.auth-auth0.js +1 -1
  117. package/lib/zudoku.auth-clerk.js +2 -2
  118. package/lib/zudoku.auth-openid.js +4 -4
  119. package/lib/zudoku.components.js +690 -667
  120. package/lib/zudoku.components.js.map +1 -1
  121. package/lib/zudoku.openapi-worker.js +737 -729
  122. package/lib/zudoku.openapi-worker.js.map +1 -1
  123. package/lib/zudoku.plugin-api-keys.js +5 -5
  124. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  125. package/lib/zudoku.plugin-custom-pages.js +2 -2
  126. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  127. package/lib/zudoku.plugin-markdown.js +1 -1
  128. package/lib/zudoku.plugin-markdown.js.map +1 -1
  129. package/lib/zudoku.plugin-openapi.js +6 -6
  130. package/lib/zudoku.plugin-redirect.js.map +1 -1
  131. package/lib/zudoku.plugin-search-inkeep.js +1 -1
  132. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  133. package/package.json +2 -2
  134. package/src/app/entry.server.tsx +9 -5
  135. package/src/app/main.tsx +4 -4
  136. package/src/lib/authentication/authentication.ts +2 -2
  137. package/src/lib/authentication/state.ts +12 -5
  138. package/{LICENSE.md → src/lib/authentication/use-broadcast/LICENSE.md} +2 -2
  139. package/src/lib/authentication/use-broadcast/shared.ts +372 -0
  140. package/src/lib/authentication/use-broadcast/useBroadcast.ts +146 -0
  141. package/src/lib/components/ClientOnly.tsx +6 -3
  142. package/src/lib/components/Header.tsx +31 -25
  143. package/src/lib/components/Zudoku.tsx +113 -0
  144. package/src/lib/components/context/ZudokuContext.ts +3 -3
  145. package/src/lib/components/context/ZudokuProvider.tsx +2 -2
  146. package/src/lib/components/index.ts +2 -3
  147. package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +5 -5
  148. package/src/lib/core/plugins.ts +12 -16
  149. package/src/lib/plugins/api-keys/index.tsx +9 -9
  150. package/src/lib/plugins/custom-pages/index.tsx +2 -2
  151. package/src/lib/plugins/markdown/index.tsx +2 -2
  152. package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -8
  153. package/src/lib/plugins/openapi/OperationList.tsx +2 -1
  154. package/src/lib/plugins/openapi/ParameterListItem.tsx +37 -31
  155. package/src/lib/plugins/openapi/Sidecar.tsx +65 -51
  156. package/src/lib/plugins/openapi/client/createMemoryClient.ts +17 -3
  157. package/src/lib/plugins/openapi/client/createWorkerClient.ts +5 -1
  158. package/src/lib/plugins/openapi/index.tsx +2 -4
  159. package/src/lib/plugins/redirect/index.tsx +2 -2
  160. package/src/lib/plugins/search-inkeep/index.tsx +2 -2
  161. package/src/lib/ui/ActionButton.tsx +28 -0
  162. package/src/lib/util/useIsomorphicLayoutEffect.ts +5 -0
  163. package/src/lib/util/useOnScreen.ts +32 -0
  164. package/dist/lib/components/DevPortal.js.map +0 -1
  165. package/dist/lib/core/DevPortalContext.js.map +0 -1
  166. package/lib/ClientOnly-CVN6leDu.js.map +0 -1
  167. package/lib/OperationList-35iw_Gil.js.map +0 -1
  168. package/lib/Spinner-C6zroowC.js.map +0 -1
  169. package/lib/ZudokuContext-BKXGJTmu.js.map +0 -1
  170. package/lib/index-BdD8UbS-.js.map +0 -1
  171. package/lib/state-CsuHT8ZO.js +0 -183
  172. package/lib/state-CsuHT8ZO.js.map +0 -1
  173. package/lib/urql-core-KJnLL26g.js +0 -1455
  174. package/src/lib/components/DevPortal.tsx +0 -111
@@ -0,0 +1,1511 @@
1
+ var M = {
2
+ NAME: "Name",
3
+ DOCUMENT: "Document",
4
+ OPERATION_DEFINITION: "OperationDefinition",
5
+ VARIABLE_DEFINITION: "VariableDefinition",
6
+ SELECTION_SET: "SelectionSet",
7
+ FIELD: "Field",
8
+ ARGUMENT: "Argument",
9
+ FRAGMENT_SPREAD: "FragmentSpread",
10
+ INLINE_FRAGMENT: "InlineFragment",
11
+ FRAGMENT_DEFINITION: "FragmentDefinition",
12
+ VARIABLE: "Variable",
13
+ INT: "IntValue",
14
+ FLOAT: "FloatValue",
15
+ STRING: "StringValue",
16
+ BOOLEAN: "BooleanValue",
17
+ NULL: "NullValue",
18
+ ENUM: "EnumValue",
19
+ LIST: "ListValue",
20
+ OBJECT: "ObjectValue",
21
+ OBJECT_FIELD: "ObjectField",
22
+ DIRECTIVE: "Directive",
23
+ NAMED_TYPE: "NamedType",
24
+ LIST_TYPE: "ListType",
25
+ NON_NULL_TYPE: "NonNullType"
26
+ };
27
+ class ve extends Error {
28
+ constructor(r, t, n, i, a, o, s) {
29
+ super(r), this.name = "GraphQLError", this.message = r, a && (this.path = a), t && (this.nodes = Array.isArray(t) ? t : [t]), n && (this.source = n), i && (this.positions = i), o && (this.originalError = o);
30
+ var u = s;
31
+ if (!u && o) {
32
+ var f = o.extensions;
33
+ f && typeof f == "object" && (u = f);
34
+ }
35
+ this.extensions = u || {};
36
+ }
37
+ toJSON() {
38
+ return {
39
+ ...this,
40
+ message: this.message
41
+ };
42
+ }
43
+ toString() {
44
+ return this.message;
45
+ }
46
+ get [Symbol.toStringTag]() {
47
+ return "GraphQLError";
48
+ }
49
+ }
50
+ var N, d;
51
+ function w(e) {
52
+ return new ve(`Syntax Error: Unexpected token at ${d} in ${e}`);
53
+ }
54
+ function T(e) {
55
+ if (e.lastIndex = d, e.test(N))
56
+ return N.slice(d, d = e.lastIndex);
57
+ }
58
+ var H = / +(?=[^\s])/y;
59
+ function ze(e) {
60
+ for (var r = e.split(`
61
+ `), t = "", n = 0, i = 0, a = r.length - 1, o = 0; o < r.length; o++)
62
+ H.lastIndex = 0, H.test(r[o]) && (o && (!n || H.lastIndex < n) && (n = H.lastIndex), i = i || o, a = o);
63
+ for (var s = i; s <= a; s++)
64
+ s !== i && (t += `
65
+ `), t += r[s].slice(n).replace(/\\"""/g, '"""');
66
+ return t;
67
+ }
68
+ function y() {
69
+ for (var e = 0 | N.charCodeAt(d++); e === 9 || e === 10 || e === 13 || e === 32 || e === 35 || e === 44 || e === 65279; e = 0 | N.charCodeAt(d++))
70
+ if (e === 35)
71
+ for (; (e = N.charCodeAt(d++)) !== 10 && e !== 13; )
72
+ ;
73
+ d--;
74
+ }
75
+ var I = /[_A-Za-z]\w*/y, le = new RegExp("(?:(null|true|false)|\\$(" + I.source + ')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|(' + I.source + "))", "y"), L = function(e) {
76
+ return e[e.Const = 1] = "Const", e[e.Var = 2] = "Var", e[e.Int = 3] = "Int", e[e.Float = 4] = "Float", e[e.BlockString = 5] = "BlockString", e[e.String = 6] = "String", e[e.Enum = 7] = "Enum", e;
77
+ }(L || {}), Ye = /\\/;
78
+ function X(e) {
79
+ var r, t;
80
+ if (le.lastIndex = d, N.charCodeAt(d) === 91) {
81
+ d++, y();
82
+ for (var n = []; N.charCodeAt(d) !== 93; )
83
+ n.push(X(e));
84
+ return d++, y(), {
85
+ kind: "ListValue",
86
+ values: n
87
+ };
88
+ } else if (N.charCodeAt(d) === 123) {
89
+ d++, y();
90
+ for (var i = []; N.charCodeAt(d) !== 125; ) {
91
+ if ((r = T(I)) == null || (y(), N.charCodeAt(d++) !== 58))
92
+ throw w("ObjectField");
93
+ y(), i.push({
94
+ kind: "ObjectField",
95
+ name: {
96
+ kind: "Name",
97
+ value: r
98
+ },
99
+ value: X(e)
100
+ });
101
+ }
102
+ return d++, y(), {
103
+ kind: "ObjectValue",
104
+ fields: i
105
+ };
106
+ } else if ((t = le.exec(N)) != null) {
107
+ if (d = le.lastIndex, y(), (r = t[L.Const]) != null)
108
+ return r === "null" ? {
109
+ kind: "NullValue"
110
+ } : {
111
+ kind: "BooleanValue",
112
+ value: r === "true"
113
+ };
114
+ if ((r = t[L.Var]) != null) {
115
+ if (e)
116
+ throw w("Variable");
117
+ return {
118
+ kind: "Variable",
119
+ name: {
120
+ kind: "Name",
121
+ value: r
122
+ }
123
+ };
124
+ } else if ((r = t[L.Int]) != null) {
125
+ var a;
126
+ return (a = t[L.Float]) != null ? {
127
+ kind: "FloatValue",
128
+ value: r + a
129
+ } : {
130
+ kind: "IntValue",
131
+ value: r
132
+ };
133
+ } else {
134
+ if ((r = t[L.BlockString]) != null)
135
+ return {
136
+ kind: "StringValue",
137
+ value: ze(r.slice(3, -3)),
138
+ block: !0
139
+ };
140
+ if ((r = t[L.String]) != null)
141
+ return {
142
+ kind: "StringValue",
143
+ value: Ye.test(r) ? JSON.parse(r) : r.slice(1, -1),
144
+ block: !1
145
+ };
146
+ if ((r = t[L.Enum]) != null)
147
+ return {
148
+ kind: "EnumValue",
149
+ value: r
150
+ };
151
+ }
152
+ }
153
+ throw w("Value");
154
+ }
155
+ function Re(e) {
156
+ if (N.charCodeAt(d) === 40) {
157
+ var r = [];
158
+ d++, y();
159
+ var t;
160
+ do {
161
+ if ((t = T(I)) == null || (y(), N.charCodeAt(d++) !== 58))
162
+ throw w("Argument");
163
+ y(), r.push({
164
+ kind: "Argument",
165
+ name: {
166
+ kind: "Name",
167
+ value: t
168
+ },
169
+ value: X(e)
170
+ });
171
+ } while (N.charCodeAt(d) !== 41);
172
+ return d++, y(), r;
173
+ }
174
+ }
175
+ function $(e) {
176
+ if (N.charCodeAt(d) === 64) {
177
+ var r = [], t;
178
+ do {
179
+ if (d++, (t = T(I)) == null)
180
+ throw w("Directive");
181
+ y(), r.push({
182
+ kind: "Directive",
183
+ name: {
184
+ kind: "Name",
185
+ value: t
186
+ },
187
+ arguments: Re(e)
188
+ });
189
+ } while (N.charCodeAt(d) === 64);
190
+ return r;
191
+ }
192
+ }
193
+ function We() {
194
+ for (var e, r = 0; N.charCodeAt(d) === 91; )
195
+ r++, d++, y();
196
+ if ((e = T(I)) == null)
197
+ throw w("NamedType");
198
+ y();
199
+ var t = {
200
+ kind: "NamedType",
201
+ name: {
202
+ kind: "Name",
203
+ value: e
204
+ }
205
+ };
206
+ do
207
+ if (N.charCodeAt(d) === 33 && (d++, y(), t = {
208
+ kind: "NonNullType",
209
+ type: t
210
+ }), r) {
211
+ if (N.charCodeAt(d++) !== 93)
212
+ throw w("NamedType");
213
+ y(), t = {
214
+ kind: "ListType",
215
+ type: t
216
+ };
217
+ }
218
+ while (r--);
219
+ return t;
220
+ }
221
+ var ue = new RegExp("(?:(\\.{3})|(" + I.source + "))", "y"), de = function(e) {
222
+ return e[e.Spread = 1] = "Spread", e[e.Name = 2] = "Name", e;
223
+ }(de || {});
224
+ function ee() {
225
+ var e = [], r, t;
226
+ do
227
+ if (ue.lastIndex = d, (t = ue.exec(N)) != null) {
228
+ if (d = ue.lastIndex, t[de.Spread] != null) {
229
+ y();
230
+ var n = T(I);
231
+ if (n != null && n !== "on")
232
+ y(), e.push({
233
+ kind: "FragmentSpread",
234
+ name: {
235
+ kind: "Name",
236
+ value: n
237
+ },
238
+ directives: $(!1)
239
+ });
240
+ else {
241
+ if (y(), n === "on") {
242
+ if ((n = T(I)) == null)
243
+ throw w("NamedType");
244
+ y();
245
+ }
246
+ var i = $(!1);
247
+ if (N.charCodeAt(d++) !== 123)
248
+ throw w("InlineFragment");
249
+ y(), e.push({
250
+ kind: "InlineFragment",
251
+ typeCondition: n ? {
252
+ kind: "NamedType",
253
+ name: {
254
+ kind: "Name",
255
+ value: n
256
+ }
257
+ } : void 0,
258
+ directives: i,
259
+ selectionSet: ee()
260
+ });
261
+ }
262
+ } else if ((r = t[de.Name]) != null) {
263
+ var a = void 0;
264
+ if (y(), N.charCodeAt(d) === 58) {
265
+ if (d++, y(), a = r, (r = T(I)) == null)
266
+ throw w("Field");
267
+ y();
268
+ }
269
+ var o = Re(!1);
270
+ y();
271
+ var s = $(!1), u = void 0;
272
+ N.charCodeAt(d) === 123 && (d++, y(), u = ee()), e.push({
273
+ kind: "Field",
274
+ alias: a ? {
275
+ kind: "Name",
276
+ value: a
277
+ } : void 0,
278
+ name: {
279
+ kind: "Name",
280
+ value: r
281
+ },
282
+ arguments: o,
283
+ directives: s,
284
+ selectionSet: u
285
+ });
286
+ }
287
+ } else
288
+ throw w("SelectionSet");
289
+ while (N.charCodeAt(d) !== 125);
290
+ return d++, y(), {
291
+ kind: "SelectionSet",
292
+ selections: e
293
+ };
294
+ }
295
+ function He() {
296
+ var e, r;
297
+ if ((e = T(I)) == null || (y(), T(I) !== "on") || (y(), (r = T(I)) == null))
298
+ throw w("FragmentDefinition");
299
+ y();
300
+ var t = $(!1);
301
+ if (N.charCodeAt(d++) !== 123)
302
+ throw w("FragmentDefinition");
303
+ return y(), {
304
+ kind: "FragmentDefinition",
305
+ name: {
306
+ kind: "Name",
307
+ value: e
308
+ },
309
+ typeCondition: {
310
+ kind: "NamedType",
311
+ name: {
312
+ kind: "Name",
313
+ value: r
314
+ }
315
+ },
316
+ directives: t,
317
+ selectionSet: ee()
318
+ };
319
+ }
320
+ var Ze = /(?:query|mutation|subscription|fragment)/y;
321
+ function Ke(e) {
322
+ var r, t, n;
323
+ if (e && (y(), r = T(I), t = function() {
324
+ if (y(), N.charCodeAt(d) === 40) {
325
+ var a = [];
326
+ d++, y();
327
+ var o;
328
+ do {
329
+ if (N.charCodeAt(d++) !== 36 || (o = T(I)) == null)
330
+ throw w("Variable");
331
+ if (y(), N.charCodeAt(d++) !== 58)
332
+ throw w("VariableDefinition");
333
+ y();
334
+ var s = We(), u = void 0;
335
+ N.charCodeAt(d) === 61 && (d++, y(), u = X(!0)), y(), a.push({
336
+ kind: "VariableDefinition",
337
+ variable: {
338
+ kind: "Variable",
339
+ name: {
340
+ kind: "Name",
341
+ value: o
342
+ }
343
+ },
344
+ type: s,
345
+ defaultValue: u,
346
+ directives: $(!0)
347
+ });
348
+ } while (N.charCodeAt(d) !== 41);
349
+ return d++, y(), a;
350
+ }
351
+ }(), n = $(!1)), N.charCodeAt(d) === 123)
352
+ return d++, y(), {
353
+ kind: "OperationDefinition",
354
+ operation: e || "query",
355
+ name: r ? {
356
+ kind: "Name",
357
+ value: r
358
+ } : void 0,
359
+ variableDefinitions: t,
360
+ directives: n,
361
+ selectionSet: ee()
362
+ };
363
+ }
364
+ function Xe(e, r) {
365
+ return N = typeof e.body == "string" ? e.body : e, d = 0, function() {
366
+ var n, i;
367
+ y();
368
+ var a = [];
369
+ do
370
+ if ((n = T(Ze)) === "fragment")
371
+ y(), a.push(He());
372
+ else if ((i = Ke(n)) != null)
373
+ a.push(i);
374
+ else
375
+ throw w("Document");
376
+ while (d < N.length);
377
+ return {
378
+ kind: "Document",
379
+ definitions: a
380
+ };
381
+ }();
382
+ }
383
+ function V(e, r, t) {
384
+ for (var n = "", i = 0; i < e.length; i++)
385
+ i && (n += r), n += t(e[i]);
386
+ return n;
387
+ }
388
+ function er(e) {
389
+ return JSON.stringify(e);
390
+ }
391
+ function rr(e) {
392
+ return `"""
393
+ ` + e.replace(/"""/g, '\\"""') + `
394
+ """`;
395
+ }
396
+ var F = `
397
+ `, O = {
398
+ OperationDefinition(e) {
399
+ var r = e.operation;
400
+ return e.name && (r += " " + e.name.value), e.variableDefinitions && e.variableDefinitions.length && (e.name || (r += " "), r += "(" + V(e.variableDefinitions, ", ", O.VariableDefinition) + ")"), e.directives && e.directives.length && (r += " " + V(e.directives, " ", O.Directive)), r !== "query" ? r + " " + O.SelectionSet(e.selectionSet) : O.SelectionSet(e.selectionSet);
401
+ },
402
+ VariableDefinition(e) {
403
+ var r = O.Variable(e.variable) + ": " + P(e.type);
404
+ return e.defaultValue && (r += " = " + P(e.defaultValue)), e.directives && e.directives.length && (r += " " + V(e.directives, " ", O.Directive)), r;
405
+ },
406
+ Field(e) {
407
+ var r = e.alias ? e.alias.value + ": " + e.name.value : e.name.value;
408
+ if (e.arguments && e.arguments.length) {
409
+ var t = V(e.arguments, ", ", O.Argument);
410
+ r.length + t.length + 2 > 80 ? r += "(" + (F += " ") + V(e.arguments, F, O.Argument) + (F = F.slice(0, -2)) + ")" : r += "(" + t + ")";
411
+ }
412
+ return e.directives && e.directives.length && (r += " " + V(e.directives, " ", O.Directive)), e.selectionSet && (r += " " + O.SelectionSet(e.selectionSet)), r;
413
+ },
414
+ StringValue(e) {
415
+ return e.block ? rr(e.value).replace(/\n/g, F) : er(e.value);
416
+ },
417
+ BooleanValue: (e) => "" + e.value,
418
+ NullValue: (e) => "null",
419
+ IntValue: (e) => e.value,
420
+ FloatValue: (e) => e.value,
421
+ EnumValue: (e) => e.value,
422
+ Name: (e) => e.value,
423
+ Variable: (e) => "$" + e.name.value,
424
+ ListValue: (e) => "[" + V(e.values, ", ", P) + "]",
425
+ ObjectValue: (e) => "{" + V(e.fields, ", ", O.ObjectField) + "}",
426
+ ObjectField: (e) => e.name.value + ": " + P(e.value),
427
+ Document(e) {
428
+ return !e.definitions || !e.definitions.length ? "" : V(e.definitions, `
429
+
430
+ `, P);
431
+ },
432
+ SelectionSet: (e) => "{" + (F += " ") + V(e.selections, F, P) + (F = F.slice(0, -2)) + "}",
433
+ Argument: (e) => e.name.value + ": " + P(e.value),
434
+ FragmentSpread(e) {
435
+ var r = "..." + e.name.value;
436
+ return e.directives && e.directives.length && (r += " " + V(e.directives, " ", O.Directive)), r;
437
+ },
438
+ InlineFragment(e) {
439
+ var r = "...";
440
+ return e.typeCondition && (r += " on " + e.typeCondition.name.value), e.directives && e.directives.length && (r += " " + V(e.directives, " ", O.Directive)), r += " " + O.SelectionSet(e.selectionSet);
441
+ },
442
+ FragmentDefinition(e) {
443
+ var r = "fragment " + e.name.value;
444
+ return r += " on " + e.typeCondition.name.value, e.directives && e.directives.length && (r += " " + V(e.directives, " ", O.Directive)), r + " " + O.SelectionSet(e.selectionSet);
445
+ },
446
+ Directive(e) {
447
+ var r = "@" + e.name.value;
448
+ return e.arguments && e.arguments.length && (r += "(" + V(e.arguments, ", ", O.Argument) + ")"), r;
449
+ },
450
+ NamedType: (e) => e.name.value,
451
+ ListType: (e) => "[" + P(e.type) + "]",
452
+ NonNullType: (e) => P(e.type) + "!"
453
+ }, P = (e) => O[e.kind](e);
454
+ function tr(e) {
455
+ return F = `
456
+ `, O[e.kind] ? O[e.kind](e) : "";
457
+ }
458
+ var Ne = () => {
459
+ }, q = Ne;
460
+ function C(e) {
461
+ return {
462
+ tag: 0,
463
+ 0: e
464
+ };
465
+ }
466
+ function W(e) {
467
+ return {
468
+ tag: 1,
469
+ 0: e
470
+ };
471
+ }
472
+ var Ee = () => typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator", nr = (e) => e;
473
+ function A(e) {
474
+ return (r) => (t) => {
475
+ var n = q;
476
+ r((i) => {
477
+ i === 0 ? t(0) : i.tag === 0 ? (n = i[0], t(i)) : e(i[0]) ? t(i) : n(0);
478
+ });
479
+ };
480
+ }
481
+ function J(e) {
482
+ return (r) => (t) => r((n) => {
483
+ n === 0 || n.tag === 0 ? t(n) : t(W(e(n[0])));
484
+ });
485
+ }
486
+ function re(e) {
487
+ return (r) => (t) => {
488
+ var n = [], i = q, a = !1, o = !1;
489
+ r((s) => {
490
+ o || (s === 0 ? (o = !0, n.length || t(0)) : s.tag === 0 ? i = s[0] : (a = !1, function(f) {
491
+ var h = q;
492
+ f((c) => {
493
+ if (c === 0) {
494
+ if (n.length) {
495
+ var m = n.indexOf(h);
496
+ m > -1 && (n = n.slice()).splice(m, 1), n.length || (o ? t(0) : a || (a = !0, i(0)));
497
+ }
498
+ } else c.tag === 0 ? (n.push(h = c[0]), h(0)) : n.length && (t(c), h(0));
499
+ });
500
+ }(e(s[0])), a || (a = !0, i(0))));
501
+ }), t(C((s) => {
502
+ if (s === 1) {
503
+ o || (o = !0, i(1));
504
+ for (var u = 0, f = n, h = n.length; u < h; u++)
505
+ f[u](1);
506
+ n.length = 0;
507
+ } else {
508
+ !o && !a ? (a = !0, i(0)) : a = !1;
509
+ for (var c = 0, m = n, p = n.length; c < p; c++)
510
+ m[c](0);
511
+ }
512
+ }));
513
+ };
514
+ }
515
+ function ar(e) {
516
+ return re(nr)(e);
517
+ }
518
+ function Q(e) {
519
+ return ar(lr(e));
520
+ }
521
+ function je(e) {
522
+ return (r) => (t) => {
523
+ var n = !1;
524
+ r((i) => {
525
+ if (!n) if (i === 0)
526
+ n = !0, t(0), e();
527
+ else if (i.tag === 0) {
528
+ var a = i[0];
529
+ t(C((o) => {
530
+ o === 1 ? (n = !0, a(1), e()) : a(o);
531
+ }));
532
+ } else
533
+ t(i);
534
+ });
535
+ };
536
+ }
537
+ function B(e) {
538
+ return (r) => (t) => {
539
+ var n = !1;
540
+ r((i) => {
541
+ if (!n) if (i === 0)
542
+ n = !0, t(0);
543
+ else if (i.tag === 0) {
544
+ var a = i[0];
545
+ t(C((o) => {
546
+ o === 1 && (n = !0), a(o);
547
+ }));
548
+ } else
549
+ e(i[0]), t(i);
550
+ });
551
+ };
552
+ }
553
+ function be(e) {
554
+ return (r) => (t) => r((n) => {
555
+ n === 0 ? t(0) : n.tag === 0 ? (t(n), e()) : t(n);
556
+ });
557
+ }
558
+ function z(e) {
559
+ var r = [], t = q, n = !1;
560
+ return (i) => {
561
+ r.push(i), r.length === 1 && e((a) => {
562
+ if (a === 0) {
563
+ for (var o = 0, s = r, u = r.length; o < u; o++)
564
+ s[o](0);
565
+ r.length = 0;
566
+ } else if (a.tag === 0)
567
+ t = a[0];
568
+ else {
569
+ n = !1;
570
+ for (var f = 0, h = r, c = r.length; f < c; f++)
571
+ h[f](a);
572
+ }
573
+ }), i(C((a) => {
574
+ if (a === 1) {
575
+ var o = r.indexOf(i);
576
+ o > -1 && (r = r.slice()).splice(o, 1), r.length || t(1);
577
+ } else n || (n = !0, t(0));
578
+ }));
579
+ };
580
+ }
581
+ function Oe(e) {
582
+ return (r) => (t) => {
583
+ var n = q, i = q, a = !1, o = !1, s = !1, u = !1;
584
+ r((f) => {
585
+ u || (f === 0 ? (u = !0, s || t(0)) : f.tag === 0 ? n = f[0] : (s && (i(1), i = q), a ? a = !1 : (a = !0, n(0)), function(c) {
586
+ s = !0, c((m) => {
587
+ s && (m === 0 ? (s = !1, u ? t(0) : a || (a = !0, n(0))) : m.tag === 0 ? (o = !1, (i = m[0])(0)) : (t(m), o ? o = !1 : i(0)));
588
+ });
589
+ }(e(f[0]))));
590
+ }), t(C((f) => {
591
+ f === 1 ? (u || (u = !0, n(1)), s && (s = !1, i(1))) : (!u && !a && (a = !0, n(0)), s && !o && (o = !0, i(0)));
592
+ }));
593
+ };
594
+ }
595
+ function Me(e) {
596
+ return (r) => (t) => {
597
+ var n = q, i = !1, a = 0;
598
+ r((o) => {
599
+ i || (o === 0 ? (i = !0, t(0)) : o.tag === 0 ? n = o[0] : a++ < e ? (t(o), !i && a >= e && (i = !0, t(0), n(1))) : t(o));
600
+ }), t(C((o) => {
601
+ o === 1 && !i ? (i = !0, n(1)) : o === 0 && !i && a < e && n(0);
602
+ }));
603
+ };
604
+ }
605
+ function $e(e) {
606
+ return (r) => (t) => {
607
+ var n = q, i = q, a = !1;
608
+ r((o) => {
609
+ a || (o === 0 ? (a = !0, i(1), t(0)) : o.tag === 0 ? (n = o[0], e((s) => {
610
+ s === 0 || (s.tag === 0 ? (i = s[0])(0) : (a = !0, i(1), n(1), t(0)));
611
+ })) : t(o));
612
+ }), t(C((o) => {
613
+ o === 1 && !a ? (a = !0, n(1), i(1)) : a || n(0);
614
+ }));
615
+ };
616
+ }
617
+ function ir(e, r) {
618
+ return (t) => (n) => {
619
+ var i = q, a = !1;
620
+ t((o) => {
621
+ a || (o === 0 ? (a = !0, n(0)) : o.tag === 0 ? (i = o[0], n(o)) : e(o[0]) ? n(o) : (a = !0, r && n(o), n(0), i(1)));
622
+ });
623
+ };
624
+ }
625
+ function or(e) {
626
+ return (r) => e()(r);
627
+ }
628
+ function Je(e) {
629
+ return (r) => {
630
+ var t = e[Ee()] && e[Ee()]() || e, n = !1, i = !1, a = !1, o;
631
+ r(C(async (s) => {
632
+ if (s === 1)
633
+ n = !0, t.return && t.return();
634
+ else if (i)
635
+ a = !0;
636
+ else {
637
+ for (a = i = !0; a && !n; )
638
+ if ((o = await t.next()).done)
639
+ n = !0, t.return && await t.return(), r(0);
640
+ else
641
+ try {
642
+ a = !1, r(W(o.value));
643
+ } catch (u) {
644
+ if (t.throw)
645
+ (n = !!(await t.throw(u)).done) && r(0);
646
+ else
647
+ throw u;
648
+ }
649
+ i = !1;
650
+ }
651
+ }));
652
+ };
653
+ }
654
+ function sr(e) {
655
+ return e[Symbol.asyncIterator] ? Je(e) : (r) => {
656
+ var t = e[Symbol.iterator](), n = !1, i = !1, a = !1, o;
657
+ r(C((s) => {
658
+ if (s === 1)
659
+ n = !0, t.return && t.return();
660
+ else if (i)
661
+ a = !0;
662
+ else {
663
+ for (a = i = !0; a && !n; )
664
+ if ((o = t.next()).done)
665
+ n = !0, t.return && t.return(), r(0);
666
+ else
667
+ try {
668
+ a = !1, r(W(o.value));
669
+ } catch (u) {
670
+ if (t.throw)
671
+ (n = !!t.throw(u).done) && r(0);
672
+ else
673
+ throw u;
674
+ }
675
+ i = !1;
676
+ }
677
+ }));
678
+ };
679
+ }
680
+ var lr = sr;
681
+ function U(e) {
682
+ return (r) => {
683
+ var t = !1;
684
+ r(C((n) => {
685
+ n === 1 ? t = !0 : t || (t = !0, r(W(e)), r(0));
686
+ }));
687
+ };
688
+ }
689
+ function Qe(e) {
690
+ return (r) => {
691
+ var t = !1, n = e({
692
+ next(i) {
693
+ t || r(W(i));
694
+ },
695
+ complete() {
696
+ t || (t = !0, r(0));
697
+ }
698
+ });
699
+ r(C((i) => {
700
+ i === 1 && !t && (t = !0, n());
701
+ }));
702
+ };
703
+ }
704
+ function Se() {
705
+ var e, r;
706
+ return {
707
+ source: z(Qe((t) => (e = t.next, r = t.complete, Ne))),
708
+ next(t) {
709
+ e && e(t);
710
+ },
711
+ complete() {
712
+ r && r();
713
+ }
714
+ };
715
+ }
716
+ function De(e) {
717
+ return Qe((r) => (e.then((t) => {
718
+ Promise.resolve(t).then(() => {
719
+ r.next(t), r.complete();
720
+ });
721
+ }), Ne));
722
+ }
723
+ function te(e) {
724
+ return (r) => {
725
+ var t = q, n = !1;
726
+ return r((i) => {
727
+ i === 0 ? n = !0 : i.tag === 0 ? (t = i[0])(0) : n || (e(i[0]), t(0));
728
+ }), {
729
+ unsubscribe() {
730
+ n || (n = !0, t(1));
731
+ }
732
+ };
733
+ };
734
+ }
735
+ function ur(e) {
736
+ te((r) => {
737
+ })(e);
738
+ }
739
+ function fr(e) {
740
+ return new Promise((r) => {
741
+ var t = q, n;
742
+ e((i) => {
743
+ i === 0 ? Promise.resolve(n).then(r) : i.tag === 0 ? (t = i[0])(0) : (n = i[0], t(0));
744
+ });
745
+ });
746
+ }
747
+ var cr = (e) => e && e.message && (e.extensions || e.name === "GraphQLError") ? e : typeof e == "object" && e.message ? new ve(e.message, e.nodes, e.source, e.positions, e.path, e, e.extensions || {}) : new ve(e);
748
+ class oe extends Error {
749
+ constructor(r) {
750
+ var t = (r.graphQLErrors || []).map(cr), n = ((i, a) => {
751
+ var o = "";
752
+ if (i)
753
+ return `[Network] ${i.message}`;
754
+ if (a)
755
+ for (var s of a)
756
+ o && (o += `
757
+ `), o += `[GraphQL] ${s.message}`;
758
+ return o;
759
+ })(r.networkError, t);
760
+ super(n), this.name = "CombinedError", this.message = n, this.graphQLErrors = t, this.networkError = r.networkError, this.response = r.response;
761
+ }
762
+ toString() {
763
+ return this.message;
764
+ }
765
+ }
766
+ var Z = (e, r) => {
767
+ for (var t = 0 | (r || 5381), n = 0, i = 0 | e.length; n < i; n++)
768
+ t = (t << 5) + t + e.charCodeAt(n);
769
+ return t;
770
+ }, R = /* @__PURE__ */ new Set(), Ae = /* @__PURE__ */ new WeakMap(), j = (e, r) => {
771
+ if (e === null || R.has(e))
772
+ return "null";
773
+ if (typeof e != "object")
774
+ return JSON.stringify(e) || "";
775
+ if (e.toJSON)
776
+ return j(e.toJSON(), r);
777
+ if (Array.isArray(e)) {
778
+ var t = "[";
779
+ for (var n of e)
780
+ t.length > 1 && (t += ","), t += j(n, r) || "null";
781
+ return t += "]";
782
+ } else if (!r && (ae !== G && e instanceof ae || ie !== G && e instanceof ie))
783
+ return "null";
784
+ var i = Object.keys(e).sort();
785
+ if (!i.length && e.constructor && Object.getPrototypeOf(e).constructor !== Object.prototype.constructor) {
786
+ var a = Ae.get(e) || Math.random().toString(36).slice(2);
787
+ return Ae.set(e, a), j({
788
+ __key: a
789
+ }, r);
790
+ }
791
+ R.add(e);
792
+ var o = "{";
793
+ for (var s of i) {
794
+ var u = j(e[s], r);
795
+ u && (o.length > 1 && (o += ","), o += j(s, r) + ":" + u);
796
+ }
797
+ return R.delete(e), o += "}";
798
+ }, he = (e, r, t) => {
799
+ if (!(t == null || typeof t != "object" || t.toJSON || R.has(t))) if (Array.isArray(t))
800
+ for (var n = 0, i = t.length; n < i; n++)
801
+ he(e, `${r}.${n}`, t[n]);
802
+ else if (t instanceof ae || t instanceof ie)
803
+ e.set(r, t);
804
+ else {
805
+ R.add(t);
806
+ for (var a of Object.keys(t))
807
+ he(e, `${r}.${a}`, t[a]);
808
+ }
809
+ }, ne = (e, r) => (R.clear(), j(e, r || !1));
810
+ class G {
811
+ }
812
+ var ae = typeof File < "u" ? File : G, ie = typeof Blob < "u" ? Blob : G, vr = /("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g, dr = /(?:#[^\n\r]+)?(?:[\r\n]+|$)/g, hr = (e, r) => r % 2 == 0 ? e.replace(dr, `
813
+ `) : e, Ie = (e) => e.split(vr).map(hr).join("").trim(), Ve = /* @__PURE__ */ new Map(), K = /* @__PURE__ */ new Map(), we = (e) => {
814
+ var r;
815
+ return typeof e == "string" ? r = Ie(e) : e.loc && K.get(e.__key) === e ? r = e.loc.source.body : (r = Ve.get(e) || Ie(tr(e)), Ve.set(e, r)), typeof e != "string" && !e.loc && (e.loc = {
816
+ start: 0,
817
+ end: r.length,
818
+ source: {
819
+ body: r,
820
+ name: "gql",
821
+ locationOffset: {
822
+ line: 1,
823
+ column: 1
824
+ }
825
+ }
826
+ }), r;
827
+ }, _e = (e) => {
828
+ var r;
829
+ if (e.documentId)
830
+ r = Z(e.documentId);
831
+ else if (r = Z(we(e)), e.definitions) {
832
+ var t = Ge(e);
833
+ t && (r = Z(`
834
+ # ${t}`, r));
835
+ }
836
+ return r;
837
+ }, Be = (e) => {
838
+ var r, t;
839
+ return typeof e == "string" ? (r = _e(e), t = K.get(r) || Xe(e)) : (r = e.__key || _e(e), t = K.get(r) || e), t.loc || we(t), t.__key = r, K.set(r, t), t;
840
+ }, fe = (e, r, t) => {
841
+ var n = r || {}, i = Be(e), a = ne(n, !0), o = i.__key;
842
+ return a !== "{}" && (o = Z(a, o)), {
843
+ key: o,
844
+ query: i,
845
+ variables: n,
846
+ extensions: t
847
+ };
848
+ }, Ge = (e) => {
849
+ for (var r of e.definitions)
850
+ if (r.kind === M.OPERATION_DEFINITION)
851
+ return r.name ? r.name.value : void 0;
852
+ }, pr = (e) => {
853
+ for (var r of e.definitions)
854
+ if (r.kind === M.OPERATION_DEFINITION)
855
+ return r.operation;
856
+ }, pe = (e, r, t) => {
857
+ if (!("data" in r || "errors" in r && Array.isArray(r.errors)))
858
+ throw new Error("No Content");
859
+ var n = e.kind === "subscription";
860
+ return {
861
+ operation: e,
862
+ data: r.data,
863
+ error: Array.isArray(r.errors) ? new oe({
864
+ graphQLErrors: r.errors,
865
+ response: t
866
+ }) : void 0,
867
+ extensions: r.extensions ? {
868
+ ...r.extensions
869
+ } : void 0,
870
+ hasNext: r.hasNext == null ? n : r.hasNext,
871
+ stale: !1
872
+ };
873
+ }, ye = (e, r) => {
874
+ if (typeof e == "object" && e != null && (!e.constructor || e.constructor === Object || Array.isArray(e))) {
875
+ e = Array.isArray(e) ? [...e] : {
876
+ ...e
877
+ };
878
+ for (var t of Object.keys(r))
879
+ e[t] = ye(e[t], r[t]);
880
+ return e;
881
+ }
882
+ return r;
883
+ }, yr = (e, r, t, n) => {
884
+ var i = e.error ? e.error.graphQLErrors : [], a = !!e.extensions || !!(r.payload || r).extensions, o = {
885
+ ...e.extensions,
886
+ ...(r.payload || r).extensions
887
+ }, s = r.incremental;
888
+ "path" in r && (s = [r]);
889
+ var u = {
890
+ data: e.data
891
+ };
892
+ if (s) {
893
+ var f = function(c) {
894
+ Array.isArray(c.errors) && i.push(...c.errors), c.extensions && (Object.assign(o, c.extensions), a = !0);
895
+ var m = "data", p = u, k = [];
896
+ if (c.path)
897
+ k = c.path;
898
+ else if (n) {
899
+ var E = n.find((g) => g.id === c.id);
900
+ c.subPath ? k = [...E.path, ...c.subPath] : k = E.path;
901
+ }
902
+ for (var x = 0, S = k.length; x < S; m = k[x++])
903
+ p = p[m] = Array.isArray(p[m]) ? [...p[m]] : {
904
+ ...p[m]
905
+ };
906
+ if (c.items)
907
+ for (var D = +m >= 0 ? m : 0, b = 0, l = c.items.length; b < l; b++)
908
+ p[D + b] = ye(p[D + b], c.items[b]);
909
+ else c.data !== void 0 && (p[m] = ye(p[m], c.data));
910
+ };
911
+ for (var h of s)
912
+ f(h);
913
+ } else
914
+ u.data = (r.payload || r).data || e.data, i = r.errors || r.payload && r.payload.errors || i;
915
+ return {
916
+ operation: e.operation,
917
+ data: u.data,
918
+ error: i.length ? new oe({
919
+ graphQLErrors: i,
920
+ response: t
921
+ }) : void 0,
922
+ extensions: a ? o : void 0,
923
+ hasNext: r.hasNext != null ? r.hasNext : e.hasNext,
924
+ stale: !1
925
+ };
926
+ }, mr = (e, r, t) => ({
927
+ operation: e,
928
+ data: void 0,
929
+ error: new oe({
930
+ networkError: r,
931
+ response: t
932
+ }),
933
+ extensions: void 0,
934
+ hasNext: !1,
935
+ stale: !1
936
+ });
937
+ function gr(e) {
938
+ var r = {
939
+ query: void 0,
940
+ documentId: void 0,
941
+ operationName: Ge(e.query),
942
+ variables: e.variables || void 0,
943
+ extensions: e.extensions
944
+ };
945
+ return "documentId" in e.query && e.query.documentId && (!e.query.definitions || !e.query.definitions.length) ? r.documentId = e.query.documentId : (!e.extensions || !e.extensions.persistedQuery || e.extensions.persistedQuery.miss) && (r.query = we(e.query)), r;
946
+ }
947
+ var kr = (e, r) => {
948
+ var t = e.kind === "query" && e.context.preferGetMethod;
949
+ if (!t || !r)
950
+ return e.context.url;
951
+ var n = xr(e.context.url);
952
+ for (var i in r) {
953
+ var a = r[i];
954
+ a && n[1].set(i, typeof a == "object" ? ne(a) : a);
955
+ }
956
+ var o = n.join("?");
957
+ return o.length > 2047 && t !== "force" ? (e.context.preferGetMethod = !1, e.context.url) : o;
958
+ }, xr = (e) => {
959
+ var r = e.indexOf("?");
960
+ return r > -1 ? [e.slice(0, r), new URLSearchParams(e.slice(r + 1))] : [e, new URLSearchParams()];
961
+ }, Nr = (e, r) => {
962
+ if (r && !(e.kind === "query" && e.context.preferGetMethod)) {
963
+ var t = ne(r), n = ((s) => {
964
+ var u = /* @__PURE__ */ new Map();
965
+ return (ae !== G || ie !== G) && (R.clear(), he(u, "variables", s)), u;
966
+ })(r.variables);
967
+ if (n.size) {
968
+ var i = new FormData();
969
+ i.append("operations", t), i.append("map", ne({
970
+ ...[...n.keys()].map((s) => [s])
971
+ }));
972
+ var a = 0;
973
+ for (var o of n.values())
974
+ i.append("" + a++, o);
975
+ return i;
976
+ }
977
+ return t;
978
+ }
979
+ }, wr = (e, r) => {
980
+ var t = {
981
+ accept: e.kind === "subscription" ? "text/event-stream, multipart/mixed" : "application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed"
982
+ }, n = (typeof e.context.fetchOptions == "function" ? e.context.fetchOptions() : e.context.fetchOptions) || {};
983
+ if (n.headers)
984
+ if (((o) => "has" in o && !Object.keys(o).length)(n.headers))
985
+ n.headers.forEach((o, s) => {
986
+ t[s] = o;
987
+ });
988
+ else if (Array.isArray(n.headers))
989
+ n.headers.forEach((o, s) => {
990
+ Array.isArray(o) ? t[o[0]] ? t[o[0]] = `${t[o[0]]},${o[1]}` : t[o[0]] = o[1] : t[s] = o;
991
+ });
992
+ else
993
+ for (var i in n.headers)
994
+ t[i.toLowerCase()] = n.headers[i];
995
+ var a = Nr(e, r);
996
+ return typeof a == "string" && !t["content-type"] && (t["content-type"] = "application/json"), {
997
+ ...n,
998
+ method: a ? "POST" : "GET",
999
+ body: a,
1000
+ headers: t
1001
+ };
1002
+ }, Er = typeof TextDecoder < "u" ? new TextDecoder() : null, br = /boundary="?([^=";]+)"?/i, Or = /data: ?([^\n]+)/, Te = (e) => e.constructor.name === "Buffer" ? e.toString() : Er.decode(e);
1003
+ async function* qe(e) {
1004
+ if (e.body[Symbol.asyncIterator])
1005
+ for await (var r of e.body)
1006
+ yield Te(r);
1007
+ else {
1008
+ var t = e.body.getReader(), n;
1009
+ try {
1010
+ for (; !(n = await t.read()).done; )
1011
+ yield Te(n.value);
1012
+ } finally {
1013
+ t.cancel();
1014
+ }
1015
+ }
1016
+ }
1017
+ async function* Ce(e, r) {
1018
+ var t = "", n;
1019
+ for await (var i of e)
1020
+ for (t += i; (n = t.indexOf(r)) > -1; )
1021
+ yield t.slice(0, n), t = t.slice(n + r.length);
1022
+ }
1023
+ async function* Sr(e, r, t) {
1024
+ var n = !0, i = null, a;
1025
+ try {
1026
+ yield await Promise.resolve();
1027
+ var o = (a = await (e.context.fetch || fetch)(r, t)).headers.get("Content-Type") || "", s;
1028
+ /multipart\/mixed/i.test(o) ? s = async function* (c, m) {
1029
+ var p = c.match(br), k = "--" + (p ? p[1] : "-"), E = !0, x;
1030
+ for await (var S of Ce(qe(m), `\r
1031
+ ` + k)) {
1032
+ if (E) {
1033
+ E = !1;
1034
+ var D = S.indexOf(k);
1035
+ if (D > -1)
1036
+ S = S.slice(D + k.length);
1037
+ else
1038
+ continue;
1039
+ }
1040
+ try {
1041
+ yield x = JSON.parse(S.slice(S.indexOf(`\r
1042
+ \r
1043
+ `) + 4));
1044
+ } catch (b) {
1045
+ if (!x)
1046
+ throw b;
1047
+ }
1048
+ if (x && x.hasNext === !1)
1049
+ break;
1050
+ }
1051
+ x && x.hasNext !== !1 && (yield {
1052
+ hasNext: !1
1053
+ });
1054
+ }(o, a) : /text\/event-stream/i.test(o) ? s = async function* (c) {
1055
+ var m;
1056
+ for await (var p of Ce(qe(c), `
1057
+
1058
+ `)) {
1059
+ var k = p.match(Or);
1060
+ if (k) {
1061
+ var E = k[1];
1062
+ try {
1063
+ yield m = JSON.parse(E);
1064
+ } catch (x) {
1065
+ if (!m)
1066
+ throw x;
1067
+ }
1068
+ if (m && m.hasNext === !1)
1069
+ break;
1070
+ }
1071
+ }
1072
+ m && m.hasNext !== !1 && (yield {
1073
+ hasNext: !1
1074
+ });
1075
+ }(a) : /text\//i.test(o) ? s = async function* (c) {
1076
+ var m = await c.text();
1077
+ try {
1078
+ var p = JSON.parse(m);
1079
+ process.env.NODE_ENV !== "production" && console.warn('Found response with content-type "text/plain" but it had a valid "application/json" response.'), yield p;
1080
+ } catch {
1081
+ throw new Error(m);
1082
+ }
1083
+ }(a) : s = async function* (c) {
1084
+ yield JSON.parse(await c.text());
1085
+ }(a);
1086
+ var u;
1087
+ for await (var f of s)
1088
+ f.pending && !i ? u = f.pending : f.pending && (u = [...u, ...f.pending]), i = i ? yr(i, f, a, u) : pe(e, f, a), n = !1, yield i, n = !0;
1089
+ i || (yield i = pe(e, {}, a));
1090
+ } catch (h) {
1091
+ if (!n)
1092
+ throw h;
1093
+ yield mr(e, a && (a.status < 200 || a.status >= 300) && a.statusText ? new Error(a.statusText) : h, a);
1094
+ }
1095
+ }
1096
+ function Dr(e, r, t) {
1097
+ var n;
1098
+ return typeof AbortController < "u" && (t.signal = (n = new AbortController()).signal), je(() => {
1099
+ n && n.abort();
1100
+ })(A((i) => !!i)(Je(Sr(e, r, t))));
1101
+ }
1102
+ var me = (e, r) => {
1103
+ if (Array.isArray(e))
1104
+ for (var t of e)
1105
+ me(t, r);
1106
+ else if (typeof e == "object" && e !== null)
1107
+ for (var n in e)
1108
+ n === "__typename" && typeof e[n] == "string" ? r.add(e[n]) : me(e[n], r);
1109
+ return r;
1110
+ }, ge = (e) => {
1111
+ if ("definitions" in e) {
1112
+ var r = [];
1113
+ for (var t of e.definitions) {
1114
+ var n = ge(t);
1115
+ r.push(n);
1116
+ }
1117
+ return {
1118
+ ...e,
1119
+ definitions: r
1120
+ };
1121
+ }
1122
+ if ("directives" in e && e.directives && e.directives.length) {
1123
+ var i = [], a = {};
1124
+ for (var o of e.directives) {
1125
+ var s = o.name.value;
1126
+ s[0] !== "_" ? i.push(o) : s = s.slice(1), a[s] = o;
1127
+ }
1128
+ e = {
1129
+ ...e,
1130
+ directives: i,
1131
+ _directives: a
1132
+ };
1133
+ }
1134
+ if ("selectionSet" in e) {
1135
+ var u = [], f = e.kind === M.OPERATION_DEFINITION;
1136
+ if (e.selectionSet) {
1137
+ for (var h of e.selectionSet.selections || []) {
1138
+ f = f || h.kind === M.FIELD && h.name.value === "__typename" && !h.alias;
1139
+ var c = ge(h);
1140
+ u.push(c);
1141
+ }
1142
+ return f || u.push({
1143
+ kind: M.FIELD,
1144
+ name: {
1145
+ kind: M.NAME,
1146
+ value: "__typename"
1147
+ },
1148
+ _generated: !0
1149
+ }), {
1150
+ ...e,
1151
+ selectionSet: {
1152
+ ...e.selectionSet,
1153
+ selections: u
1154
+ }
1155
+ };
1156
+ }
1157
+ }
1158
+ return e;
1159
+ }, Fe = /* @__PURE__ */ new Map(), Ar = (e) => {
1160
+ var r = Be(e), t = Fe.get(r.__key);
1161
+ return t || (Fe.set(r.__key, t = ge(r)), Object.defineProperty(t, "__key", {
1162
+ value: r.__key,
1163
+ enumerable: !1
1164
+ })), t;
1165
+ };
1166
+ function Pe(e) {
1167
+ var r = (t) => e(t);
1168
+ return r.toPromise = () => fr(Me(1)(A((t) => !t.stale && !t.hasNext)(r))), r.then = (t, n) => r.toPromise().then(t, n), r.subscribe = (t) => te(t)(r), r;
1169
+ }
1170
+ function Y(e, r, t) {
1171
+ return {
1172
+ ...r,
1173
+ kind: e,
1174
+ context: r.context ? {
1175
+ ...r.context,
1176
+ ...t
1177
+ } : t || r.context
1178
+ };
1179
+ }
1180
+ var ke = (e, r) => Y(e.kind, e, {
1181
+ meta: {
1182
+ ...e.context.meta,
1183
+ ...r
1184
+ }
1185
+ }), Ir = () => {
1186
+ }, ce = ({ kind: e }) => e !== "mutation" && e !== "query", Ue = (e) => {
1187
+ var r = Ar(e.query);
1188
+ if (r !== e.query) {
1189
+ var t = Y(e.kind, e);
1190
+ return t.query = r, t;
1191
+ } else
1192
+ return e;
1193
+ }, Tr = ({ forward: e, client: r, dispatchDebug: t }) => {
1194
+ var n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = (o) => o.kind === "query" && o.context.requestPolicy !== "network-only" && (o.context.requestPolicy === "cache-only" || n.has(o.key));
1195
+ return (o) => {
1196
+ var s = J((f) => {
1197
+ var h = n.get(f.key);
1198
+ process.env.NODE_ENV !== "production" && t({
1199
+ operation: f,
1200
+ ...h ? {
1201
+ type: "cacheHit",
1202
+ message: "The result was successfully retried from the cache"
1203
+ } : {
1204
+ type: "cacheMiss",
1205
+ message: "The result could not be retrieved from the cache"
1206
+ },
1207
+ source: "cacheExchange"
1208
+ });
1209
+ var c = h || pe(f, {
1210
+ data: null
1211
+ });
1212
+ return c = {
1213
+ ...c,
1214
+ operation: process.env.NODE_ENV !== "production" ? ke(f, {
1215
+ cacheOutcome: h ? "hit" : "miss"
1216
+ }) : f
1217
+ }, f.context.requestPolicy === "cache-and-network" && (c.stale = !0, xe(r, f)), c;
1218
+ })(A((f) => !ce(f) && a(f))(o)), u = B((f) => {
1219
+ var { operation: h } = f;
1220
+ if (h) {
1221
+ var c = h.context.additionalTypenames || [];
1222
+ if (f.operation.kind !== "subscription" && (c = ((g) => [...me(g, /* @__PURE__ */ new Set())])(f.data).concat(c)), f.operation.kind === "mutation" || f.operation.kind === "subscription") {
1223
+ var m = /* @__PURE__ */ new Set();
1224
+ process.env.NODE_ENV !== "production" && t({
1225
+ type: "cacheInvalidation",
1226
+ message: `The following typenames have been invalidated: ${c}`,
1227
+ operation: h,
1228
+ data: {
1229
+ typenames: c,
1230
+ response: f
1231
+ },
1232
+ source: "cacheExchange"
1233
+ });
1234
+ for (var p = 0; p < c.length; p++) {
1235
+ var k = c[p], E = i.get(k);
1236
+ E || i.set(k, E = /* @__PURE__ */ new Set());
1237
+ for (var x of E.values())
1238
+ m.add(x);
1239
+ E.clear();
1240
+ }
1241
+ for (var S of m.values())
1242
+ n.has(S) && (h = n.get(S).operation, n.delete(S), xe(r, h));
1243
+ } else if (h.kind === "query" && f.data) {
1244
+ n.set(h.key, f);
1245
+ for (var D = 0; D < c.length; D++) {
1246
+ var b = c[D], l = i.get(b);
1247
+ l || i.set(b, l = /* @__PURE__ */ new Set()), l.add(h.key);
1248
+ }
1249
+ }
1250
+ }
1251
+ })(e(A((f) => f.kind !== "query" || f.context.requestPolicy !== "cache-only")(J((f) => process.env.NODE_ENV !== "production" ? ke(f, {
1252
+ cacheOutcome: "miss"
1253
+ }) : f)(Q([J(Ue)(A((f) => !ce(f) && !a(f))(o)), A((f) => ce(f))(o)])))));
1254
+ return Q([s, u]);
1255
+ };
1256
+ }, xe = (e, r) => e.reexecuteOperation(Y(r.kind, r, {
1257
+ requestPolicy: "network-only"
1258
+ })), Le = /* @__PURE__ */ new Set(), qr = (e = {}) => {
1259
+ var r = !!e.staleWhileRevalidate, t = !!e.includeExtensions, n = {}, i = [], a = (s) => {
1260
+ i.push(s.operation.key), i.length === 1 && Promise.resolve().then(() => {
1261
+ for (var u; u = i.shift(); )
1262
+ n[u] = null;
1263
+ });
1264
+ }, o = ({ client: s, forward: u }) => (f) => {
1265
+ var h = e && typeof e.isClient == "boolean" ? !!e.isClient : !s.suspense, c = u(J(Ue)(A((p) => p.kind === "teardown" || !n[p.key] || !!n[p.key].hasNext || p.context.requestPolicy === "network-only")(f))), m = J((p) => {
1266
+ var k = ((E, x, S) => ({
1267
+ operation: E,
1268
+ data: x.data ? JSON.parse(x.data) : void 0,
1269
+ extensions: S && x.extensions ? JSON.parse(x.extensions) : void 0,
1270
+ error: x.error ? new oe({
1271
+ networkError: x.error.networkError ? new Error(x.error.networkError) : void 0,
1272
+ graphQLErrors: x.error.graphQLErrors
1273
+ }) : void 0,
1274
+ stale: !1,
1275
+ hasNext: !!x.hasNext
1276
+ }))(p, n[p.key], t);
1277
+ return r && !Le.has(p.key) && (k.stale = !0, Le.add(p.key), xe(s, p)), {
1278
+ ...k,
1279
+ operation: process.env.NODE_ENV !== "production" ? ke(p, {
1280
+ cacheOutcome: "hit"
1281
+ }) : p
1282
+ };
1283
+ })(A((p) => p.kind !== "teardown" && !!n[p.key] && p.context.requestPolicy !== "network-only")(f));
1284
+ return h ? m = B(a)(m) : c = B((p) => {
1285
+ var { operation: k } = p;
1286
+ if (k.kind !== "mutation") {
1287
+ var E = ((x, S) => {
1288
+ var D = {
1289
+ data: JSON.stringify(x.data),
1290
+ hasNext: x.hasNext
1291
+ };
1292
+ return x.data !== void 0 && (D.data = JSON.stringify(x.data)), S && x.extensions !== void 0 && (D.extensions = JSON.stringify(x.extensions)), x.error && (D.error = {
1293
+ graphQLErrors: x.error.graphQLErrors.map((b) => !b.path && !b.extensions ? b.message : {
1294
+ message: b.message,
1295
+ path: b.path,
1296
+ extensions: b.extensions
1297
+ })
1298
+ }, x.error.networkError && (D.error.networkError = "" + x.error.networkError)), D;
1299
+ })(p, t);
1300
+ n[k.key] = E;
1301
+ }
1302
+ })(c), Q([c, m]);
1303
+ };
1304
+ return o.restoreData = (s) => {
1305
+ for (var u in s)
1306
+ n[u] !== null && (n[u] = s[u]);
1307
+ }, o.extractData = () => {
1308
+ var s = {};
1309
+ for (var u in n)
1310
+ n[u] != null && (s[u] = n[u]);
1311
+ return s;
1312
+ }, e && e.initialState && o.restoreData(e.initialState), o;
1313
+ }, Cr = ({ forward: e, dispatchDebug: r }) => (t) => {
1314
+ var n = re((a) => {
1315
+ var o = gr(a), s = kr(a, o), u = wr(a, o);
1316
+ process.env.NODE_ENV !== "production" && r({
1317
+ type: "fetchRequest",
1318
+ message: "A fetch request is being executed.",
1319
+ operation: a,
1320
+ data: {
1321
+ url: s,
1322
+ fetchOptions: u
1323
+ },
1324
+ source: "fetchExchange"
1325
+ });
1326
+ var f = $e(A((h) => h.kind === "teardown" && h.key === a.key)(t))(Dr(a, s, u));
1327
+ return process.env.NODE_ENV !== "production" ? B((h) => {
1328
+ var c = h.data ? void 0 : h.error;
1329
+ process.env.NODE_ENV !== "production" && r({
1330
+ type: c ? "fetchError" : "fetchSuccess",
1331
+ message: `A ${c ? "failed" : "successful"} fetch response has been returned.`,
1332
+ operation: a,
1333
+ data: {
1334
+ url: s,
1335
+ fetchOptions: u,
1336
+ value: c || h
1337
+ },
1338
+ source: "fetchExchange"
1339
+ });
1340
+ })(f) : f;
1341
+ })(A((a) => a.kind !== "teardown" && (a.kind !== "subscription" || !!a.context.fetchSubscriptions))(t)), i = e(A((a) => a.kind === "teardown" || a.kind === "subscription" && !a.context.fetchSubscriptions)(t));
1342
+ return Q([n, i]);
1343
+ }, Vr = (e) => ({ client: r, forward: t, dispatchDebug: n }) => e.reduceRight((i, a) => {
1344
+ var o = !1;
1345
+ return a({
1346
+ client: r,
1347
+ forward(s) {
1348
+ if (process.env.NODE_ENV !== "production") {
1349
+ if (o)
1350
+ throw new Error("forward() must only be called once in each Exchange.");
1351
+ o = !0;
1352
+ }
1353
+ return z(i(z(s)));
1354
+ },
1355
+ dispatchDebug(s) {
1356
+ process.env.NODE_ENV !== "production" && n({
1357
+ timestamp: Date.now(),
1358
+ source: a.name,
1359
+ ...s
1360
+ });
1361
+ }
1362
+ });
1363
+ }, t), Fr = ({ onOperation: e, onResult: r, onError: t }) => ({ forward: n }) => (i) => re((a) => {
1364
+ t && a.error && t(a.error, a.operation);
1365
+ var o = r && r(a) || a;
1366
+ return "then" in o ? De(o) : U(o);
1367
+ })(n(re((a) => {
1368
+ var o = e && e(a) || a;
1369
+ return "then" in o ? De(o) : U(o);
1370
+ })(i))), _r = ({ dispatchDebug: e }) => (r) => (process.env.NODE_ENV !== "production" && (r = B((t) => {
1371
+ if (t.kind !== "teardown" && process.env.NODE_ENV !== "production") {
1372
+ var n = `No exchange has handled operations of kind "${t.kind}". Check whether you've added an exchange responsible for these operations.`;
1373
+ process.env.NODE_ENV !== "production" && e({
1374
+ type: "fallbackCatch",
1375
+ message: n,
1376
+ operation: t,
1377
+ source: "fallbackExchange"
1378
+ }), console.warn(n);
1379
+ }
1380
+ })(r)), A((t) => !1)(r)), Pr = function e(r) {
1381
+ if (process.env.NODE_ENV !== "production" && !r.url)
1382
+ throw new Error("You are creating an urql-client without a url.");
1383
+ var t = 0, n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = [], s = {
1384
+ url: r.url,
1385
+ fetchSubscriptions: r.fetchSubscriptions,
1386
+ fetchOptions: r.fetchOptions,
1387
+ fetch: r.fetch,
1388
+ preferGetMethod: r.preferGetMethod,
1389
+ requestPolicy: r.requestPolicy || "cache-first"
1390
+ }, u = Se();
1391
+ function f(l) {
1392
+ (l.kind === "mutation" || l.kind === "teardown" || !a.has(l.key)) && (l.kind === "teardown" ? a.delete(l.key) : l.kind !== "mutation" && a.add(l.key), u.next(l));
1393
+ }
1394
+ var h = !1;
1395
+ function c(l) {
1396
+ if (l && f(l), !h) {
1397
+ for (h = !0; h && (l = o.shift()); )
1398
+ f(l);
1399
+ h = !1;
1400
+ }
1401
+ }
1402
+ var m = (l) => {
1403
+ var g = $e(A((v) => v.kind === "teardown" && v.key === l.key)(u.source))(A((v) => v.operation.kind === l.kind && v.operation.key === l.key && (!v.operation.context._instance || v.operation.context._instance === l.context._instance))(b));
1404
+ return l.kind !== "query" ? g = ir((v) => !!v.hasNext, !0)(g) : g = Oe((v) => {
1405
+ var _ = U(v);
1406
+ return v.stale || v.hasNext ? _ : Q([_, J(() => (v.stale = !0, v))(Me(1)(A((se) => se.key === l.key)(u.source)))]);
1407
+ })(g), l.kind !== "mutation" ? g = je(() => {
1408
+ a.delete(l.key), n.delete(l.key), i.delete(l.key), h = !1;
1409
+ for (var v = o.length - 1; v >= 0; v--)
1410
+ o[v].key === l.key && o.splice(v, 1);
1411
+ f(Y("teardown", l, l.context));
1412
+ })(B((v) => {
1413
+ if (v.stale) {
1414
+ if (!v.hasNext)
1415
+ a.delete(l.key);
1416
+ else
1417
+ for (var _ of o)
1418
+ if (_.key === v.operation.key) {
1419
+ a.delete(_.key);
1420
+ break;
1421
+ }
1422
+ } else v.hasNext || a.delete(l.key);
1423
+ n.set(l.key, v);
1424
+ })(g)) : g = be(() => {
1425
+ f(l);
1426
+ })(g), z(g);
1427
+ }, p = this instanceof e ? this : Object.create(e.prototype), k = Object.assign(p, {
1428
+ suspense: !!r.suspense,
1429
+ operations$: u.source,
1430
+ reexecuteOperation(l) {
1431
+ if (l.kind === "teardown")
1432
+ c(l);
1433
+ else if (l.kind === "mutation")
1434
+ o.push(l), Promise.resolve().then(c);
1435
+ else if (i.has(l.key)) {
1436
+ for (var g = !1, v = 0; v < o.length; v++)
1437
+ o[v].key === l.key && (o[v] = l, g = !0);
1438
+ g || a.has(l.key) && l.context.requestPolicy !== "network-only" ? (a.delete(l.key), Promise.resolve().then(c)) : (o.push(l), Promise.resolve().then(c));
1439
+ }
1440
+ },
1441
+ createRequestOperation(l, g, v) {
1442
+ v || (v = {});
1443
+ var _;
1444
+ if (process.env.NODE_ENV !== "production" && l !== "teardown" && (_ = pr(g.query)) !== l)
1445
+ throw new Error(`Expected operation of type "${l}" but found "${_}"`);
1446
+ return Y(l, g, {
1447
+ _instance: l === "mutation" ? t = t + 1 | 0 : void 0,
1448
+ ...s,
1449
+ ...v,
1450
+ requestPolicy: v.requestPolicy || s.requestPolicy,
1451
+ suspense: v.suspense || v.suspense !== !1 && k.suspense
1452
+ });
1453
+ },
1454
+ executeRequestOperation(l) {
1455
+ return l.kind === "mutation" ? Pe(m(l)) : Pe(or(() => {
1456
+ var g = i.get(l.key);
1457
+ g || i.set(l.key, g = m(l)), g = be(() => {
1458
+ c(l);
1459
+ })(g);
1460
+ var v = n.get(l.key);
1461
+ return l.kind === "query" && v && (v.stale || v.hasNext) ? Oe(U)(Q([g, A((_) => _ === n.get(l.key))(U(v))])) : g;
1462
+ }));
1463
+ },
1464
+ executeQuery(l, g) {
1465
+ var v = k.createRequestOperation("query", l, g);
1466
+ return k.executeRequestOperation(v);
1467
+ },
1468
+ executeSubscription(l, g) {
1469
+ var v = k.createRequestOperation("subscription", l, g);
1470
+ return k.executeRequestOperation(v);
1471
+ },
1472
+ executeMutation(l, g) {
1473
+ var v = k.createRequestOperation("mutation", l, g);
1474
+ return k.executeRequestOperation(v);
1475
+ },
1476
+ readQuery(l, g, v) {
1477
+ var _ = null;
1478
+ return te((se) => {
1479
+ _ = se;
1480
+ })(k.query(l, g, v)).unsubscribe(), _;
1481
+ },
1482
+ query: (l, g, v) => k.executeQuery(fe(l, g), v),
1483
+ subscription: (l, g, v) => k.executeSubscription(fe(l, g), v),
1484
+ mutation: (l, g, v) => k.executeMutation(fe(l, g), v)
1485
+ }), E = Ir;
1486
+ if (process.env.NODE_ENV !== "production") {
1487
+ var { next: x, source: S } = Se();
1488
+ k.subscribeToDebugTarget = (l) => te(l)(S), E = x;
1489
+ }
1490
+ var D = Vr(r.exchanges), b = z(D({
1491
+ client: k,
1492
+ dispatchDebug: E,
1493
+ forward: _r({
1494
+ dispatchDebug: E
1495
+ })
1496
+ })(u.source));
1497
+ return ur(b), k;
1498
+ };
1499
+ export {
1500
+ Pr as C,
1501
+ je as a,
1502
+ Tr as b,
1503
+ fe as c,
1504
+ qr as d,
1505
+ Cr as f,
1506
+ Fr as m,
1507
+ B as o,
1508
+ te as s,
1509
+ ir as t
1510
+ };
1511
+ //# sourceMappingURL=urql-core-35Qt_U4i.js.map