@hackersheet/core 0.1.0-alpha.1

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 (104) hide show
  1. package/README.md +3 -0
  2. package/dist/chunk-3GXIDS5H.mjs +23 -0
  3. package/dist/chunk-5X53IRLN.mjs +2417 -0
  4. package/dist/chunk-7R3CATQT.mjs +143 -0
  5. package/dist/chunk-C3G2CMRR.mjs +13 -0
  6. package/dist/chunk-EXRG4APR.mjs +34 -0
  7. package/dist/chunk-FIFBNWMD.mjs +21 -0
  8. package/dist/chunk-FRXB4F4I.mjs +0 -0
  9. package/dist/chunk-JGQBUURE.mjs +60 -0
  10. package/dist/chunk-PA32N4A6.mjs +6 -0
  11. package/dist/chunk-PUTNZ4GU.mjs +12 -0
  12. package/dist/chunk-RRJUH3D4.mjs +0 -0
  13. package/dist/chunk-SYHSU6VH.mjs +38 -0
  14. package/dist/chunk-TXCPBPKN.mjs +12 -0
  15. package/dist/chunk-VKWT2GNZ.mjs +0 -0
  16. package/dist/chunk-WIUPPYM5.mjs +60 -0
  17. package/dist/chunk-YAN7TO2B.mjs +0 -0
  18. package/dist/chunk-ZZFAG7Y6.mjs +705 -0
  19. package/dist/client/client.d.mts +51 -0
  20. package/dist/client/client.d.ts +51 -0
  21. package/dist/client/client.js +3424 -0
  22. package/dist/client/client.mjs +20 -0
  23. package/dist/client/create-client.d.mts +11 -0
  24. package/dist/client/create-client.d.ts +11 -0
  25. package/dist/client/create-client.js +3429 -0
  26. package/dist/client/create-client.mjs +21 -0
  27. package/dist/client/operations/get-document.d.mts +15 -0
  28. package/dist/client/operations/get-document.d.ts +15 -0
  29. package/dist/client/operations/get-document.js +881 -0
  30. package/dist/client/operations/get-document.mjs +14 -0
  31. package/dist/client/operations/get-documents.d.mts +14 -0
  32. package/dist/client/operations/get-documents.d.ts +14 -0
  33. package/dist/client/operations/get-documents.js +798 -0
  34. package/dist/client/operations/get-documents.mjs +14 -0
  35. package/dist/client/operations/get-tag.d.mts +12 -0
  36. package/dist/client/operations/get-tag.d.ts +12 -0
  37. package/dist/client/operations/get-tag.js +776 -0
  38. package/dist/client/operations/get-tag.mjs +14 -0
  39. package/dist/client/operations/get-tags.d.mts +14 -0
  40. package/dist/client/operations/get-tags.d.ts +14 -0
  41. package/dist/client/operations/get-tags.js +772 -0
  42. package/dist/client/operations/get-tags.mjs +14 -0
  43. package/dist/client/operations/get-websites.d.mts +14 -0
  44. package/dist/client/operations/get-websites.d.ts +14 -0
  45. package/dist/client/operations/get-websites.js +798 -0
  46. package/dist/client/operations/get-websites.mjs +14 -0
  47. package/dist/client/operations/index.d.mts +11 -0
  48. package/dist/client/operations/index.d.ts +11 -0
  49. package/dist/client/operations/index.js +1041 -0
  50. package/dist/client/operations/index.mjs +31 -0
  51. package/dist/gql/fragment-masking.d.mts +22 -0
  52. package/dist/gql/fragment-masking.d.ts +22 -0
  53. package/dist/gql/fragment-masking.js +47 -0
  54. package/dist/gql/fragment-masking.mjs +10 -0
  55. package/dist/gql/gql.d.mts +70 -0
  56. package/dist/gql/gql.d.ts +70 -0
  57. package/dist/gql/gql.js +739 -0
  58. package/dist/gql/gql.mjs +7 -0
  59. package/dist/gql/graphql.d.mts +722 -0
  60. package/dist/gql/graphql.d.ts +722 -0
  61. package/dist/gql/graphql.js +733 -0
  62. package/dist/gql/graphql.mjs +14 -0
  63. package/dist/gql/index.d.mts +4 -0
  64. package/dist/gql/index.d.ts +4 -0
  65. package/dist/gql/index.js +761 -0
  66. package/dist/gql/index.mjs +16 -0
  67. package/dist/index.d.mts +8 -0
  68. package/dist/index.d.ts +8 -0
  69. package/dist/index.js +3429 -0
  70. package/dist/index.mjs +22 -0
  71. package/dist/types/document.d.mts +71 -0
  72. package/dist/types/document.d.ts +71 -0
  73. package/dist/types/document.js +18 -0
  74. package/dist/types/document.mjs +0 -0
  75. package/dist/types/index.d.mts +3 -0
  76. package/dist/types/index.d.ts +3 -0
  77. package/dist/types/index.js +18 -0
  78. package/dist/types/index.mjs +1 -0
  79. package/dist/types/tag.d.mts +23 -0
  80. package/dist/types/tag.d.ts +23 -0
  81. package/dist/types/tag.js +18 -0
  82. package/dist/types/tag.mjs +0 -0
  83. package/dist/types/website.d.mts +29 -0
  84. package/dist/types/website.d.ts +29 -0
  85. package/dist/types/website.js +18 -0
  86. package/dist/types/website.mjs +0 -0
  87. package/dist/utils/index.d.mts +2 -0
  88. package/dist/utils/index.d.ts +2 -0
  89. package/dist/utils/index.js +49 -0
  90. package/dist/utils/index.mjs +12 -0
  91. package/dist/utils/make-after-cursor-from-page.d.mts +3 -0
  92. package/dist/utils/make-after-cursor-from-page.d.ts +3 -0
  93. package/dist/utils/make-after-cursor-from-page.js +32 -0
  94. package/dist/utils/make-after-cursor-from-page.mjs +6 -0
  95. package/dist/utils/non-nullable-filter.d.mts +3 -0
  96. package/dist/utils/non-nullable-filter.d.ts +3 -0
  97. package/dist/utils/non-nullable-filter.js +30 -0
  98. package/dist/utils/non-nullable-filter.mjs +6 -0
  99. package/dist/utils/to-array-from-edges.d.mts +6 -0
  100. package/dist/utils/to-array-from-edges.d.ts +6 -0
  101. package/dist/utils/to-array-from-edges.js +34 -0
  102. package/dist/utils/to-array-from-edges.mjs +7 -0
  103. package/license.md +21 -0
  104. package/package.json +36 -0
package/dist/index.js ADDED
@@ -0,0 +1,3429 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ createClient: () => createClient
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+
27
+ // ../../node_modules/.pnpm/@0no-co+graphql.web@1.0.7_graphql@16.9.0/node_modules/@0no-co/graphql.web/dist/graphql.web.mjs
28
+ var e = {
29
+ NAME: "Name",
30
+ DOCUMENT: "Document",
31
+ OPERATION_DEFINITION: "OperationDefinition",
32
+ VARIABLE_DEFINITION: "VariableDefinition",
33
+ SELECTION_SET: "SelectionSet",
34
+ FIELD: "Field",
35
+ ARGUMENT: "Argument",
36
+ FRAGMENT_SPREAD: "FragmentSpread",
37
+ INLINE_FRAGMENT: "InlineFragment",
38
+ FRAGMENT_DEFINITION: "FragmentDefinition",
39
+ VARIABLE: "Variable",
40
+ INT: "IntValue",
41
+ FLOAT: "FloatValue",
42
+ STRING: "StringValue",
43
+ BOOLEAN: "BooleanValue",
44
+ NULL: "NullValue",
45
+ ENUM: "EnumValue",
46
+ LIST: "ListValue",
47
+ OBJECT: "ObjectValue",
48
+ OBJECT_FIELD: "ObjectField",
49
+ DIRECTIVE: "Directive",
50
+ NAMED_TYPE: "NamedType",
51
+ LIST_TYPE: "ListType",
52
+ NON_NULL_TYPE: "NonNullType"
53
+ };
54
+ var GraphQLError = class extends Error {
55
+ constructor(e3, r2, i3, n2, a2, t2, l3) {
56
+ super(e3);
57
+ this.name = "GraphQLError";
58
+ this.message = e3;
59
+ if (a2) {
60
+ this.path = a2;
61
+ }
62
+ if (r2) {
63
+ this.nodes = Array.isArray(r2) ? r2 : [r2];
64
+ }
65
+ if (i3) {
66
+ this.source = i3;
67
+ }
68
+ if (n2) {
69
+ this.positions = n2;
70
+ }
71
+ if (t2) {
72
+ this.originalError = t2;
73
+ }
74
+ var o2 = l3;
75
+ if (!o2 && t2) {
76
+ var u3 = t2.extensions;
77
+ if (u3 && "object" == typeof u3) {
78
+ o2 = u3;
79
+ }
80
+ }
81
+ this.extensions = o2 || {};
82
+ }
83
+ toJSON() {
84
+ return {
85
+ ...this,
86
+ message: this.message
87
+ };
88
+ }
89
+ toString() {
90
+ return this.message;
91
+ }
92
+ get [Symbol.toStringTag]() {
93
+ return "GraphQLError";
94
+ }
95
+ };
96
+ var i;
97
+ var n;
98
+ function error(e3) {
99
+ return new GraphQLError(`Syntax Error: Unexpected token at ${n} in ${e3}`);
100
+ }
101
+ function advance(e3) {
102
+ e3.lastIndex = n;
103
+ if (e3.test(i)) {
104
+ return i.slice(n, n = e3.lastIndex);
105
+ }
106
+ }
107
+ var a = / +(?=[^\s])/y;
108
+ function blockString(e3) {
109
+ var r2 = e3.split("\n");
110
+ var i3 = "";
111
+ var n2 = 0;
112
+ var t2 = 0;
113
+ var l3 = r2.length - 1;
114
+ for (var o2 = 0; o2 < r2.length; o2++) {
115
+ a.lastIndex = 0;
116
+ if (a.test(r2[o2])) {
117
+ if (o2 && (!n2 || a.lastIndex < n2)) {
118
+ n2 = a.lastIndex;
119
+ }
120
+ t2 = t2 || o2;
121
+ l3 = o2;
122
+ }
123
+ }
124
+ for (var u3 = t2; u3 <= l3; u3++) {
125
+ if (u3 !== t2) {
126
+ i3 += "\n";
127
+ }
128
+ i3 += r2[u3].slice(n2).replace(/\\"""/g, '"""');
129
+ }
130
+ return i3;
131
+ }
132
+ function ignored() {
133
+ for (var e3 = 0 | i.charCodeAt(n++); 9 === e3 || 10 === e3 || 13 === e3 || 32 === e3 || 35 === e3 || 44 === e3 || 65279 === e3; e3 = 0 | i.charCodeAt(n++)) {
134
+ if (35 === e3) {
135
+ while (10 !== (e3 = i.charCodeAt(n++)) && 13 !== e3) {
136
+ }
137
+ }
138
+ }
139
+ n--;
140
+ }
141
+ var t = /[_A-Za-z]\w*/y;
142
+ var l = new RegExp("(?:(null|true|false)|\\$(" + t.source + ')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|(' + t.source + "))", "y");
143
+ var o = function(e3) {
144
+ e3[e3.Const = 1] = "Const";
145
+ e3[e3.Var = 2] = "Var";
146
+ e3[e3.Int = 3] = "Int";
147
+ e3[e3.Float = 4] = "Float";
148
+ e3[e3.BlockString = 5] = "BlockString";
149
+ e3[e3.String = 6] = "String";
150
+ e3[e3.Enum = 7] = "Enum";
151
+ return e3;
152
+ }(o || {});
153
+ var u = /\\/g;
154
+ function value(e3) {
155
+ var r2;
156
+ var a2;
157
+ l.lastIndex = n;
158
+ if (91 === i.charCodeAt(n)) {
159
+ n++;
160
+ ignored();
161
+ var d3 = [];
162
+ while (93 !== i.charCodeAt(n)) {
163
+ d3.push(value(e3));
164
+ }
165
+ n++;
166
+ ignored();
167
+ return {
168
+ kind: "ListValue",
169
+ values: d3
170
+ };
171
+ } else if (123 === i.charCodeAt(n)) {
172
+ n++;
173
+ ignored();
174
+ var v3 = [];
175
+ while (125 !== i.charCodeAt(n)) {
176
+ if (null == (r2 = advance(t))) {
177
+ throw error("ObjectField");
178
+ }
179
+ ignored();
180
+ if (58 !== i.charCodeAt(n++)) {
181
+ throw error("ObjectField");
182
+ }
183
+ ignored();
184
+ v3.push({
185
+ kind: "ObjectField",
186
+ name: {
187
+ kind: "Name",
188
+ value: r2
189
+ },
190
+ value: value(e3)
191
+ });
192
+ }
193
+ n++;
194
+ ignored();
195
+ return {
196
+ kind: "ObjectValue",
197
+ fields: v3
198
+ };
199
+ } else if (null != (a2 = l.exec(i))) {
200
+ n = l.lastIndex;
201
+ ignored();
202
+ if (null != (r2 = a2[o.Const])) {
203
+ return "null" === r2 ? {
204
+ kind: "NullValue"
205
+ } : {
206
+ kind: "BooleanValue",
207
+ value: "true" === r2
208
+ };
209
+ } else if (null != (r2 = a2[o.Var])) {
210
+ if (e3) {
211
+ throw error("Variable");
212
+ } else {
213
+ return {
214
+ kind: "Variable",
215
+ name: {
216
+ kind: "Name",
217
+ value: r2
218
+ }
219
+ };
220
+ }
221
+ } else if (null != (r2 = a2[o.Int])) {
222
+ var s2;
223
+ if (null != (s2 = a2[o.Float])) {
224
+ return {
225
+ kind: "FloatValue",
226
+ value: r2 + s2
227
+ };
228
+ } else {
229
+ return {
230
+ kind: "IntValue",
231
+ value: r2
232
+ };
233
+ }
234
+ } else if (null != (r2 = a2[o.BlockString])) {
235
+ return {
236
+ kind: "StringValue",
237
+ value: blockString(r2.slice(3, -3)),
238
+ block: true
239
+ };
240
+ } else if (null != (r2 = a2[o.String])) {
241
+ return {
242
+ kind: "StringValue",
243
+ value: u.test(r2) ? JSON.parse(r2) : r2.slice(1, -1),
244
+ block: false
245
+ };
246
+ } else if (null != (r2 = a2[o.Enum])) {
247
+ return {
248
+ kind: "EnumValue",
249
+ value: r2
250
+ };
251
+ }
252
+ }
253
+ throw error("Value");
254
+ }
255
+ function arguments_(e3) {
256
+ if (40 === i.charCodeAt(n)) {
257
+ var r2 = [];
258
+ n++;
259
+ ignored();
260
+ var a2;
261
+ do {
262
+ if (null == (a2 = advance(t))) {
263
+ throw error("Argument");
264
+ }
265
+ ignored();
266
+ if (58 !== i.charCodeAt(n++)) {
267
+ throw error("Argument");
268
+ }
269
+ ignored();
270
+ r2.push({
271
+ kind: "Argument",
272
+ name: {
273
+ kind: "Name",
274
+ value: a2
275
+ },
276
+ value: value(e3)
277
+ });
278
+ } while (41 !== i.charCodeAt(n));
279
+ n++;
280
+ ignored();
281
+ return r2;
282
+ }
283
+ }
284
+ function directives(e3) {
285
+ if (64 === i.charCodeAt(n)) {
286
+ var r2 = [];
287
+ var a2;
288
+ do {
289
+ n++;
290
+ if (null == (a2 = advance(t))) {
291
+ throw error("Directive");
292
+ }
293
+ ignored();
294
+ r2.push({
295
+ kind: "Directive",
296
+ name: {
297
+ kind: "Name",
298
+ value: a2
299
+ },
300
+ arguments: arguments_(e3)
301
+ });
302
+ } while (64 === i.charCodeAt(n));
303
+ return r2;
304
+ }
305
+ }
306
+ function type() {
307
+ var e3;
308
+ var r2 = 0;
309
+ while (91 === i.charCodeAt(n)) {
310
+ r2++;
311
+ n++;
312
+ ignored();
313
+ }
314
+ if (null == (e3 = advance(t))) {
315
+ throw error("NamedType");
316
+ }
317
+ ignored();
318
+ var a2 = {
319
+ kind: "NamedType",
320
+ name: {
321
+ kind: "Name",
322
+ value: e3
323
+ }
324
+ };
325
+ do {
326
+ if (33 === i.charCodeAt(n)) {
327
+ n++;
328
+ ignored();
329
+ a2 = {
330
+ kind: "NonNullType",
331
+ type: a2
332
+ };
333
+ }
334
+ if (r2) {
335
+ if (93 !== i.charCodeAt(n++)) {
336
+ throw error("NamedType");
337
+ }
338
+ ignored();
339
+ a2 = {
340
+ kind: "ListType",
341
+ type: a2
342
+ };
343
+ }
344
+ } while (r2--);
345
+ return a2;
346
+ }
347
+ var d = new RegExp("(?:(\\.{3})|(" + t.source + "))", "y");
348
+ var v = function(e3) {
349
+ e3[e3.Spread = 1] = "Spread";
350
+ e3[e3.Name = 2] = "Name";
351
+ return e3;
352
+ }(v || {});
353
+ function selectionSet() {
354
+ var e3 = [];
355
+ var r2;
356
+ var a2;
357
+ do {
358
+ d.lastIndex = n;
359
+ if (null != (a2 = d.exec(i))) {
360
+ n = d.lastIndex;
361
+ if (null != a2[v.Spread]) {
362
+ ignored();
363
+ var l3 = advance(t);
364
+ if (null != l3 && "on" !== l3) {
365
+ ignored();
366
+ e3.push({
367
+ kind: "FragmentSpread",
368
+ name: {
369
+ kind: "Name",
370
+ value: l3
371
+ },
372
+ directives: directives(false)
373
+ });
374
+ } else {
375
+ ignored();
376
+ if ("on" === l3) {
377
+ if (null == (l3 = advance(t))) {
378
+ throw error("NamedType");
379
+ }
380
+ ignored();
381
+ }
382
+ var o2 = directives(false);
383
+ if (123 !== i.charCodeAt(n++)) {
384
+ throw error("InlineFragment");
385
+ }
386
+ ignored();
387
+ e3.push({
388
+ kind: "InlineFragment",
389
+ typeCondition: l3 ? {
390
+ kind: "NamedType",
391
+ name: {
392
+ kind: "Name",
393
+ value: l3
394
+ }
395
+ } : void 0,
396
+ directives: o2,
397
+ selectionSet: selectionSet()
398
+ });
399
+ }
400
+ } else if (null != (r2 = a2[v.Name])) {
401
+ var u3 = void 0;
402
+ ignored();
403
+ if (58 === i.charCodeAt(n)) {
404
+ n++;
405
+ ignored();
406
+ u3 = r2;
407
+ if (null == (r2 = advance(t))) {
408
+ throw error("Field");
409
+ }
410
+ ignored();
411
+ }
412
+ var s2 = arguments_(false);
413
+ ignored();
414
+ var c2 = directives(false);
415
+ var f3 = void 0;
416
+ if (123 === i.charCodeAt(n)) {
417
+ n++;
418
+ ignored();
419
+ f3 = selectionSet();
420
+ }
421
+ e3.push({
422
+ kind: "Field",
423
+ alias: u3 ? {
424
+ kind: "Name",
425
+ value: u3
426
+ } : void 0,
427
+ name: {
428
+ kind: "Name",
429
+ value: r2
430
+ },
431
+ arguments: s2,
432
+ directives: c2,
433
+ selectionSet: f3
434
+ });
435
+ }
436
+ } else {
437
+ throw error("SelectionSet");
438
+ }
439
+ } while (125 !== i.charCodeAt(n));
440
+ n++;
441
+ ignored();
442
+ return {
443
+ kind: "SelectionSet",
444
+ selections: e3
445
+ };
446
+ }
447
+ function fragmentDefinition() {
448
+ var e3;
449
+ var r2;
450
+ if (null == (e3 = advance(t))) {
451
+ throw error("FragmentDefinition");
452
+ }
453
+ ignored();
454
+ if ("on" !== advance(t)) {
455
+ throw error("FragmentDefinition");
456
+ }
457
+ ignored();
458
+ if (null == (r2 = advance(t))) {
459
+ throw error("FragmentDefinition");
460
+ }
461
+ ignored();
462
+ var a2 = directives(false);
463
+ if (123 !== i.charCodeAt(n++)) {
464
+ throw error("FragmentDefinition");
465
+ }
466
+ ignored();
467
+ return {
468
+ kind: "FragmentDefinition",
469
+ name: {
470
+ kind: "Name",
471
+ value: e3
472
+ },
473
+ typeCondition: {
474
+ kind: "NamedType",
475
+ name: {
476
+ kind: "Name",
477
+ value: r2
478
+ }
479
+ },
480
+ directives: a2,
481
+ selectionSet: selectionSet()
482
+ };
483
+ }
484
+ var s = /(?:query|mutation|subscription|fragment)/y;
485
+ function operationDefinition(e3) {
486
+ var r2;
487
+ var a2;
488
+ var l3;
489
+ if (e3) {
490
+ ignored();
491
+ r2 = advance(t);
492
+ a2 = function variableDefinitions() {
493
+ ignored();
494
+ if (40 === i.charCodeAt(n)) {
495
+ var e4 = [];
496
+ n++;
497
+ ignored();
498
+ var r3;
499
+ do {
500
+ if (36 !== i.charCodeAt(n++)) {
501
+ throw error("Variable");
502
+ }
503
+ if (null == (r3 = advance(t))) {
504
+ throw error("Variable");
505
+ }
506
+ ignored();
507
+ if (58 !== i.charCodeAt(n++)) {
508
+ throw error("VariableDefinition");
509
+ }
510
+ ignored();
511
+ var a3 = type();
512
+ var l4 = void 0;
513
+ if (61 === i.charCodeAt(n)) {
514
+ n++;
515
+ ignored();
516
+ l4 = value(true);
517
+ }
518
+ ignored();
519
+ e4.push({
520
+ kind: "VariableDefinition",
521
+ variable: {
522
+ kind: "Variable",
523
+ name: {
524
+ kind: "Name",
525
+ value: r3
526
+ }
527
+ },
528
+ type: a3,
529
+ defaultValue: l4,
530
+ directives: directives(true)
531
+ });
532
+ } while (41 !== i.charCodeAt(n));
533
+ n++;
534
+ ignored();
535
+ return e4;
536
+ }
537
+ }();
538
+ l3 = directives(false);
539
+ }
540
+ if (123 === i.charCodeAt(n)) {
541
+ n++;
542
+ ignored();
543
+ return {
544
+ kind: "OperationDefinition",
545
+ operation: e3 || "query",
546
+ name: r2 ? {
547
+ kind: "Name",
548
+ value: r2
549
+ } : void 0,
550
+ variableDefinitions: a2,
551
+ directives: l3,
552
+ selectionSet: selectionSet()
553
+ };
554
+ }
555
+ }
556
+ function parse(e3, r2) {
557
+ i = "string" == typeof e3.body ? e3.body : e3;
558
+ n = 0;
559
+ return function document() {
560
+ var e4;
561
+ var r3;
562
+ ignored();
563
+ var a2 = [];
564
+ do {
565
+ if ("fragment" === (e4 = advance(s))) {
566
+ ignored();
567
+ a2.push(fragmentDefinition());
568
+ } else if (null != (r3 = operationDefinition(e4))) {
569
+ a2.push(r3);
570
+ } else {
571
+ throw error("Document");
572
+ }
573
+ } while (n < i.length);
574
+ return {
575
+ kind: "Document",
576
+ definitions: a2
577
+ };
578
+ }();
579
+ }
580
+ function mapJoin(e3, r2, i3) {
581
+ var n2 = "";
582
+ for (var a2 = 0; a2 < e3.length; a2++) {
583
+ if (a2) {
584
+ n2 += r2;
585
+ }
586
+ n2 += i3(e3[a2]);
587
+ }
588
+ return n2;
589
+ }
590
+ function printString(e3) {
591
+ return JSON.stringify(e3);
592
+ }
593
+ function printBlockString(e3) {
594
+ return '"""\n' + e3.replace(/"""/g, '\\"""') + '\n"""';
595
+ }
596
+ var f = "\n";
597
+ var m = {
598
+ OperationDefinition(e3) {
599
+ var r2 = e3.operation;
600
+ if (e3.name) {
601
+ r2 += " " + e3.name.value;
602
+ }
603
+ if (e3.variableDefinitions && e3.variableDefinitions.length) {
604
+ if (!e3.name) {
605
+ r2 += " ";
606
+ }
607
+ r2 += "(" + mapJoin(e3.variableDefinitions, ", ", m.VariableDefinition) + ")";
608
+ }
609
+ if (e3.directives && e3.directives.length) {
610
+ r2 += " " + mapJoin(e3.directives, " ", m.Directive);
611
+ }
612
+ return "query" !== r2 ? r2 + " " + m.SelectionSet(e3.selectionSet) : m.SelectionSet(e3.selectionSet);
613
+ },
614
+ VariableDefinition(e3) {
615
+ var r2 = m.Variable(e3.variable) + ": " + _print(e3.type);
616
+ if (e3.defaultValue) {
617
+ r2 += " = " + _print(e3.defaultValue);
618
+ }
619
+ if (e3.directives && e3.directives.length) {
620
+ r2 += " " + mapJoin(e3.directives, " ", m.Directive);
621
+ }
622
+ return r2;
623
+ },
624
+ Field(e3) {
625
+ var r2 = e3.alias ? e3.alias.value + ": " + e3.name.value : e3.name.value;
626
+ if (e3.arguments && e3.arguments.length) {
627
+ var i3 = mapJoin(e3.arguments, ", ", m.Argument);
628
+ if (r2.length + i3.length + 2 > 80) {
629
+ r2 += "(" + (f += " ") + mapJoin(e3.arguments, f, m.Argument) + (f = f.slice(0, -2)) + ")";
630
+ } else {
631
+ r2 += "(" + i3 + ")";
632
+ }
633
+ }
634
+ if (e3.directives && e3.directives.length) {
635
+ r2 += " " + mapJoin(e3.directives, " ", m.Directive);
636
+ }
637
+ if (e3.selectionSet) {
638
+ r2 += " " + m.SelectionSet(e3.selectionSet);
639
+ }
640
+ return r2;
641
+ },
642
+ StringValue(e3) {
643
+ if (e3.block) {
644
+ return printBlockString(e3.value).replace(/\n/g, f);
645
+ } else {
646
+ return printString(e3.value);
647
+ }
648
+ },
649
+ BooleanValue: (e3) => "" + e3.value,
650
+ NullValue: (e3) => "null",
651
+ IntValue: (e3) => e3.value,
652
+ FloatValue: (e3) => e3.value,
653
+ EnumValue: (e3) => e3.value,
654
+ Name: (e3) => e3.value,
655
+ Variable: (e3) => "$" + e3.name.value,
656
+ ListValue: (e3) => "[" + mapJoin(e3.values, ", ", _print) + "]",
657
+ ObjectValue: (e3) => "{" + mapJoin(e3.fields, ", ", m.ObjectField) + "}",
658
+ ObjectField: (e3) => e3.name.value + ": " + _print(e3.value),
659
+ Document(e3) {
660
+ if (!e3.definitions || !e3.definitions.length) {
661
+ return "";
662
+ }
663
+ return mapJoin(e3.definitions, "\n\n", _print);
664
+ },
665
+ SelectionSet: (e3) => "{" + (f += " ") + mapJoin(e3.selections, f, _print) + (f = f.slice(0, -2)) + "}",
666
+ Argument: (e3) => e3.name.value + ": " + _print(e3.value),
667
+ FragmentSpread(e3) {
668
+ var r2 = "..." + e3.name.value;
669
+ if (e3.directives && e3.directives.length) {
670
+ r2 += " " + mapJoin(e3.directives, " ", m.Directive);
671
+ }
672
+ return r2;
673
+ },
674
+ InlineFragment(e3) {
675
+ var r2 = "...";
676
+ if (e3.typeCondition) {
677
+ r2 += " on " + e3.typeCondition.name.value;
678
+ }
679
+ if (e3.directives && e3.directives.length) {
680
+ r2 += " " + mapJoin(e3.directives, " ", m.Directive);
681
+ }
682
+ return r2 += " " + m.SelectionSet(e3.selectionSet);
683
+ },
684
+ FragmentDefinition(e3) {
685
+ var r2 = "fragment " + e3.name.value;
686
+ r2 += " on " + e3.typeCondition.name.value;
687
+ if (e3.directives && e3.directives.length) {
688
+ r2 += " " + mapJoin(e3.directives, " ", m.Directive);
689
+ }
690
+ return r2 + " " + m.SelectionSet(e3.selectionSet);
691
+ },
692
+ Directive(e3) {
693
+ var r2 = "@" + e3.name.value;
694
+ if (e3.arguments && e3.arguments.length) {
695
+ r2 += "(" + mapJoin(e3.arguments, ", ", m.Argument) + ")";
696
+ }
697
+ return r2;
698
+ },
699
+ NamedType: (e3) => e3.name.value,
700
+ ListType: (e3) => "[" + _print(e3.type) + "]",
701
+ NonNullType: (e3) => _print(e3.type) + "!"
702
+ };
703
+ var _print = (e3) => m[e3.kind](e3);
704
+ function print(e3) {
705
+ f = "\n";
706
+ return m[e3.kind] ? m[e3.kind](e3) : "";
707
+ }
708
+
709
+ // ../../node_modules/.pnpm/wonka@6.3.4/node_modules/wonka/dist/wonka.mjs
710
+ var teardownPlaceholder = () => {
711
+ };
712
+ var e2 = teardownPlaceholder;
713
+ function start(e3) {
714
+ return {
715
+ tag: 0,
716
+ 0: e3
717
+ };
718
+ }
719
+ function push(e3) {
720
+ return {
721
+ tag: 1,
722
+ 0: e3
723
+ };
724
+ }
725
+ var asyncIteratorSymbol = () => "function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator";
726
+ var identity = (e3) => e3;
727
+ function filter(r2) {
728
+ return (t2) => (i3) => {
729
+ var a2 = e2;
730
+ t2((e3) => {
731
+ if (0 === e3) {
732
+ i3(0);
733
+ } else if (0 === e3.tag) {
734
+ a2 = e3[0];
735
+ i3(e3);
736
+ } else if (!r2(e3[0])) {
737
+ a2(0);
738
+ } else {
739
+ i3(e3);
740
+ }
741
+ });
742
+ };
743
+ }
744
+ function map(e3) {
745
+ return (r2) => (t2) => r2((r3) => {
746
+ if (0 === r3 || 0 === r3.tag) {
747
+ t2(r3);
748
+ } else {
749
+ t2(push(e3(r3[0])));
750
+ }
751
+ });
752
+ }
753
+ function mergeMap(r2) {
754
+ return (t2) => (i3) => {
755
+ var a2 = [];
756
+ var f3 = e2;
757
+ var n2 = false;
758
+ var s2 = false;
759
+ t2((t3) => {
760
+ if (s2) {
761
+ } else if (0 === t3) {
762
+ s2 = true;
763
+ if (!a2.length) {
764
+ i3(0);
765
+ }
766
+ } else if (0 === t3.tag) {
767
+ f3 = t3[0];
768
+ } else {
769
+ n2 = false;
770
+ !function applyInnerSource(r3) {
771
+ var t4 = e2;
772
+ r3((e3) => {
773
+ if (0 === e3) {
774
+ if (a2.length) {
775
+ var r4 = a2.indexOf(t4);
776
+ if (r4 > -1) {
777
+ (a2 = a2.slice()).splice(r4, 1);
778
+ }
779
+ if (!a2.length) {
780
+ if (s2) {
781
+ i3(0);
782
+ } else if (!n2) {
783
+ n2 = true;
784
+ f3(0);
785
+ }
786
+ }
787
+ }
788
+ } else if (0 === e3.tag) {
789
+ a2.push(t4 = e3[0]);
790
+ t4(0);
791
+ } else if (a2.length) {
792
+ i3(e3);
793
+ t4(0);
794
+ }
795
+ });
796
+ }(r2(t3[0]));
797
+ if (!n2) {
798
+ n2 = true;
799
+ f3(0);
800
+ }
801
+ }
802
+ });
803
+ i3(start((e3) => {
804
+ if (1 === e3) {
805
+ if (!s2) {
806
+ s2 = true;
807
+ f3(1);
808
+ }
809
+ for (var r3 = 0, t3 = a2, i4 = a2.length; r3 < i4; r3++) {
810
+ t3[r3](1);
811
+ }
812
+ a2.length = 0;
813
+ } else {
814
+ if (!s2 && !n2) {
815
+ n2 = true;
816
+ f3(0);
817
+ } else {
818
+ n2 = false;
819
+ }
820
+ for (var l3 = 0, u3 = a2, o2 = a2.length; l3 < o2; l3++) {
821
+ u3[l3](0);
822
+ }
823
+ }
824
+ }));
825
+ };
826
+ }
827
+ function mergeAll(e3) {
828
+ return mergeMap(identity)(e3);
829
+ }
830
+ function merge(e3) {
831
+ return mergeAll(r(e3));
832
+ }
833
+ function onEnd(e3) {
834
+ return (r2) => (t2) => {
835
+ var i3 = false;
836
+ r2((r3) => {
837
+ if (i3) {
838
+ } else if (0 === r3) {
839
+ i3 = true;
840
+ t2(0);
841
+ e3();
842
+ } else if (0 === r3.tag) {
843
+ var a2 = r3[0];
844
+ t2(start((r4) => {
845
+ if (1 === r4) {
846
+ i3 = true;
847
+ a2(1);
848
+ e3();
849
+ } else {
850
+ a2(r4);
851
+ }
852
+ }));
853
+ } else {
854
+ t2(r3);
855
+ }
856
+ });
857
+ };
858
+ }
859
+ function onPush(e3) {
860
+ return (r2) => (t2) => {
861
+ var i3 = false;
862
+ r2((r3) => {
863
+ if (i3) {
864
+ } else if (0 === r3) {
865
+ i3 = true;
866
+ t2(0);
867
+ } else if (0 === r3.tag) {
868
+ var a2 = r3[0];
869
+ t2(start((e4) => {
870
+ if (1 === e4) {
871
+ i3 = true;
872
+ }
873
+ a2(e4);
874
+ }));
875
+ } else {
876
+ e3(r3[0]);
877
+ t2(r3);
878
+ }
879
+ });
880
+ };
881
+ }
882
+ function onStart(e3) {
883
+ return (r2) => (t2) => r2((r3) => {
884
+ if (0 === r3) {
885
+ t2(0);
886
+ } else if (0 === r3.tag) {
887
+ t2(r3);
888
+ e3();
889
+ } else {
890
+ t2(r3);
891
+ }
892
+ });
893
+ }
894
+ function share(r2) {
895
+ var t2 = [];
896
+ var i3 = e2;
897
+ var a2 = false;
898
+ return (e3) => {
899
+ t2.push(e3);
900
+ if (1 === t2.length) {
901
+ r2((e4) => {
902
+ if (0 === e4) {
903
+ for (var r3 = 0, f3 = t2, n2 = t2.length; r3 < n2; r3++) {
904
+ f3[r3](0);
905
+ }
906
+ t2.length = 0;
907
+ } else if (0 === e4.tag) {
908
+ i3 = e4[0];
909
+ } else {
910
+ a2 = false;
911
+ for (var s2 = 0, l3 = t2, u3 = t2.length; s2 < u3; s2++) {
912
+ l3[s2](e4);
913
+ }
914
+ }
915
+ });
916
+ }
917
+ e3(start((r3) => {
918
+ if (1 === r3) {
919
+ var f3 = t2.indexOf(e3);
920
+ if (f3 > -1) {
921
+ (t2 = t2.slice()).splice(f3, 1);
922
+ }
923
+ if (!t2.length) {
924
+ i3(1);
925
+ }
926
+ } else if (!a2) {
927
+ a2 = true;
928
+ i3(0);
929
+ }
930
+ }));
931
+ };
932
+ }
933
+ function switchMap(r2) {
934
+ return (t2) => (i3) => {
935
+ var a2 = e2;
936
+ var f3 = e2;
937
+ var n2 = false;
938
+ var s2 = false;
939
+ var l3 = false;
940
+ var u3 = false;
941
+ t2((t3) => {
942
+ if (u3) {
943
+ } else if (0 === t3) {
944
+ u3 = true;
945
+ if (!l3) {
946
+ i3(0);
947
+ }
948
+ } else if (0 === t3.tag) {
949
+ a2 = t3[0];
950
+ } else {
951
+ if (l3) {
952
+ f3(1);
953
+ f3 = e2;
954
+ }
955
+ if (!n2) {
956
+ n2 = true;
957
+ a2(0);
958
+ } else {
959
+ n2 = false;
960
+ }
961
+ !function applyInnerSource(e3) {
962
+ l3 = true;
963
+ e3((e4) => {
964
+ if (!l3) {
965
+ } else if (0 === e4) {
966
+ l3 = false;
967
+ if (u3) {
968
+ i3(0);
969
+ } else if (!n2) {
970
+ n2 = true;
971
+ a2(0);
972
+ }
973
+ } else if (0 === e4.tag) {
974
+ s2 = false;
975
+ (f3 = e4[0])(0);
976
+ } else {
977
+ i3(e4);
978
+ if (!s2) {
979
+ f3(0);
980
+ } else {
981
+ s2 = false;
982
+ }
983
+ }
984
+ });
985
+ }(r2(t3[0]));
986
+ }
987
+ });
988
+ i3(start((e3) => {
989
+ if (1 === e3) {
990
+ if (!u3) {
991
+ u3 = true;
992
+ a2(1);
993
+ }
994
+ if (l3) {
995
+ l3 = false;
996
+ f3(1);
997
+ }
998
+ } else {
999
+ if (!u3 && !n2) {
1000
+ n2 = true;
1001
+ a2(0);
1002
+ }
1003
+ if (l3 && !s2) {
1004
+ s2 = true;
1005
+ f3(0);
1006
+ }
1007
+ }
1008
+ }));
1009
+ };
1010
+ }
1011
+ function take(r2) {
1012
+ return (t2) => (i3) => {
1013
+ var a2 = e2;
1014
+ var f3 = false;
1015
+ var n2 = 0;
1016
+ t2((e3) => {
1017
+ if (f3) {
1018
+ } else if (0 === e3) {
1019
+ f3 = true;
1020
+ i3(0);
1021
+ } else if (0 === e3.tag) {
1022
+ if (r2 <= 0) {
1023
+ f3 = true;
1024
+ i3(0);
1025
+ e3[0](1);
1026
+ } else {
1027
+ a2 = e3[0];
1028
+ }
1029
+ } else if (n2++ < r2) {
1030
+ i3(e3);
1031
+ if (!f3 && n2 >= r2) {
1032
+ f3 = true;
1033
+ i3(0);
1034
+ a2(1);
1035
+ }
1036
+ } else {
1037
+ i3(e3);
1038
+ }
1039
+ });
1040
+ i3(start((e3) => {
1041
+ if (1 === e3 && !f3) {
1042
+ f3 = true;
1043
+ a2(1);
1044
+ } else if (0 === e3 && !f3 && n2 < r2) {
1045
+ a2(0);
1046
+ }
1047
+ }));
1048
+ };
1049
+ }
1050
+ function takeUntil(r2) {
1051
+ return (t2) => (i3) => {
1052
+ var a2 = e2;
1053
+ var f3 = e2;
1054
+ var n2 = false;
1055
+ t2((e3) => {
1056
+ if (n2) {
1057
+ } else if (0 === e3) {
1058
+ n2 = true;
1059
+ f3(1);
1060
+ i3(0);
1061
+ } else if (0 === e3.tag) {
1062
+ a2 = e3[0];
1063
+ r2((e4) => {
1064
+ if (0 === e4) {
1065
+ } else if (0 === e4.tag) {
1066
+ (f3 = e4[0])(0);
1067
+ } else {
1068
+ n2 = true;
1069
+ f3(1);
1070
+ a2(1);
1071
+ i3(0);
1072
+ }
1073
+ });
1074
+ } else {
1075
+ i3(e3);
1076
+ }
1077
+ });
1078
+ i3(start((e3) => {
1079
+ if (1 === e3 && !n2) {
1080
+ n2 = true;
1081
+ a2(1);
1082
+ f3(1);
1083
+ } else if (!n2) {
1084
+ a2(0);
1085
+ }
1086
+ }));
1087
+ };
1088
+ }
1089
+ function takeWhile(r2, t2) {
1090
+ return (i3) => (a2) => {
1091
+ var f3 = e2;
1092
+ var n2 = false;
1093
+ i3((e3) => {
1094
+ if (n2) {
1095
+ } else if (0 === e3) {
1096
+ n2 = true;
1097
+ a2(0);
1098
+ } else if (0 === e3.tag) {
1099
+ f3 = e3[0];
1100
+ a2(e3);
1101
+ } else if (!r2(e3[0])) {
1102
+ n2 = true;
1103
+ if (t2) {
1104
+ a2(e3);
1105
+ }
1106
+ a2(0);
1107
+ f3(1);
1108
+ } else {
1109
+ a2(e3);
1110
+ }
1111
+ });
1112
+ };
1113
+ }
1114
+ function lazy(e3) {
1115
+ return (r2) => e3()(r2);
1116
+ }
1117
+ function fromAsyncIterable(e3) {
1118
+ return (r2) => {
1119
+ var t2 = e3[asyncIteratorSymbol()] && e3[asyncIteratorSymbol()]() || e3;
1120
+ var i3 = false;
1121
+ var a2 = false;
1122
+ var f3 = false;
1123
+ var n2;
1124
+ r2(start(async (e4) => {
1125
+ if (1 === e4) {
1126
+ i3 = true;
1127
+ if (t2.return) {
1128
+ t2.return();
1129
+ }
1130
+ } else if (a2) {
1131
+ f3 = true;
1132
+ } else {
1133
+ for (f3 = a2 = true; f3 && !i3; ) {
1134
+ if ((n2 = await t2.next()).done) {
1135
+ i3 = true;
1136
+ if (t2.return) {
1137
+ await t2.return();
1138
+ }
1139
+ r2(0);
1140
+ } else {
1141
+ try {
1142
+ f3 = false;
1143
+ r2(push(n2.value));
1144
+ } catch (e5) {
1145
+ if (t2.throw) {
1146
+ if (i3 = !!(await t2.throw(e5)).done) {
1147
+ r2(0);
1148
+ }
1149
+ } else {
1150
+ throw e5;
1151
+ }
1152
+ }
1153
+ }
1154
+ }
1155
+ a2 = false;
1156
+ }
1157
+ }));
1158
+ };
1159
+ }
1160
+ function fromIterable(e3) {
1161
+ if (e3[Symbol.asyncIterator]) {
1162
+ return fromAsyncIterable(e3);
1163
+ }
1164
+ return (r2) => {
1165
+ var t2 = e3[Symbol.iterator]();
1166
+ var i3 = false;
1167
+ var a2 = false;
1168
+ var f3 = false;
1169
+ var n2;
1170
+ r2(start((e4) => {
1171
+ if (1 === e4) {
1172
+ i3 = true;
1173
+ if (t2.return) {
1174
+ t2.return();
1175
+ }
1176
+ } else if (a2) {
1177
+ f3 = true;
1178
+ } else {
1179
+ for (f3 = a2 = true; f3 && !i3; ) {
1180
+ if ((n2 = t2.next()).done) {
1181
+ i3 = true;
1182
+ if (t2.return) {
1183
+ t2.return();
1184
+ }
1185
+ r2(0);
1186
+ } else {
1187
+ try {
1188
+ f3 = false;
1189
+ r2(push(n2.value));
1190
+ } catch (e5) {
1191
+ if (t2.throw) {
1192
+ if (i3 = !!t2.throw(e5).done) {
1193
+ r2(0);
1194
+ }
1195
+ } else {
1196
+ throw e5;
1197
+ }
1198
+ }
1199
+ }
1200
+ }
1201
+ a2 = false;
1202
+ }
1203
+ }));
1204
+ };
1205
+ }
1206
+ var r = fromIterable;
1207
+ function fromValue(e3) {
1208
+ return (r2) => {
1209
+ var t2 = false;
1210
+ r2(start((i3) => {
1211
+ if (1 === i3) {
1212
+ t2 = true;
1213
+ } else if (!t2) {
1214
+ t2 = true;
1215
+ r2(push(e3));
1216
+ r2(0);
1217
+ }
1218
+ }));
1219
+ };
1220
+ }
1221
+ function make(e3) {
1222
+ return (r2) => {
1223
+ var t2 = false;
1224
+ var i3 = e3({
1225
+ next(e4) {
1226
+ if (!t2) {
1227
+ r2(push(e4));
1228
+ }
1229
+ },
1230
+ complete() {
1231
+ if (!t2) {
1232
+ t2 = true;
1233
+ r2(0);
1234
+ }
1235
+ }
1236
+ });
1237
+ r2(start((e4) => {
1238
+ if (1 === e4 && !t2) {
1239
+ t2 = true;
1240
+ i3();
1241
+ }
1242
+ }));
1243
+ };
1244
+ }
1245
+ function makeSubject() {
1246
+ var e3;
1247
+ var r2;
1248
+ return {
1249
+ source: share(make((t2) => {
1250
+ e3 = t2.next;
1251
+ r2 = t2.complete;
1252
+ return teardownPlaceholder;
1253
+ })),
1254
+ next(r3) {
1255
+ if (e3) {
1256
+ e3(r3);
1257
+ }
1258
+ },
1259
+ complete() {
1260
+ if (r2) {
1261
+ r2();
1262
+ }
1263
+ }
1264
+ };
1265
+ }
1266
+ function subscribe(r2) {
1267
+ return (t2) => {
1268
+ var i3 = e2;
1269
+ var a2 = false;
1270
+ t2((e3) => {
1271
+ if (0 === e3) {
1272
+ a2 = true;
1273
+ } else if (0 === e3.tag) {
1274
+ (i3 = e3[0])(0);
1275
+ } else if (!a2) {
1276
+ r2(e3[0]);
1277
+ i3(0);
1278
+ }
1279
+ });
1280
+ return {
1281
+ unsubscribe() {
1282
+ if (!a2) {
1283
+ a2 = true;
1284
+ i3(1);
1285
+ }
1286
+ }
1287
+ };
1288
+ };
1289
+ }
1290
+ function publish(e3) {
1291
+ subscribe((e4) => {
1292
+ })(e3);
1293
+ }
1294
+ function toPromise(r2) {
1295
+ return new Promise((t2) => {
1296
+ var i3 = e2;
1297
+ var a2;
1298
+ r2((e3) => {
1299
+ if (0 === e3) {
1300
+ Promise.resolve(a2).then(t2);
1301
+ } else if (0 === e3.tag) {
1302
+ (i3 = e3[0])(0);
1303
+ } else {
1304
+ a2 = e3[0];
1305
+ i3(0);
1306
+ }
1307
+ });
1308
+ });
1309
+ }
1310
+
1311
+ // ../../node_modules/.pnpm/@urql+core@5.0.4_graphql@16.9.0/node_modules/@urql/core/dist/urql-core-chunk.mjs
1312
+ var rehydrateGraphQlError = (r2) => {
1313
+ if (r2 && r2.message && (r2.extensions || "GraphQLError" === r2.name)) {
1314
+ return r2;
1315
+ } else if ("object" == typeof r2 && r2.message) {
1316
+ return new GraphQLError(r2.message, r2.nodes, r2.source, r2.positions, r2.path, r2, r2.extensions || {});
1317
+ } else {
1318
+ return new GraphQLError(r2);
1319
+ }
1320
+ };
1321
+ var CombinedError = class extends Error {
1322
+ constructor(e3) {
1323
+ var r2 = (e3.graphQLErrors || []).map(rehydrateGraphQlError);
1324
+ var t2 = ((e4, r3) => {
1325
+ var t3 = "";
1326
+ if (e4) {
1327
+ return `[Network] ${e4.message}`;
1328
+ }
1329
+ if (r3) {
1330
+ for (var a2 of r3) {
1331
+ if (t3) {
1332
+ t3 += "\n";
1333
+ }
1334
+ t3 += `[GraphQL] ${a2.message}`;
1335
+ }
1336
+ }
1337
+ return t3;
1338
+ })(e3.networkError, r2);
1339
+ super(t2);
1340
+ this.name = "CombinedError";
1341
+ this.message = t2;
1342
+ this.graphQLErrors = r2;
1343
+ this.networkError = e3.networkError;
1344
+ this.response = e3.response;
1345
+ }
1346
+ toString() {
1347
+ return this.message;
1348
+ }
1349
+ };
1350
+ var phash = (e3, r2) => {
1351
+ var t2 = 0 | (r2 || 5381);
1352
+ for (var a2 = 0, o2 = 0 | e3.length; a2 < o2; a2++) {
1353
+ t2 = (t2 << 5) + t2 + e3.charCodeAt(a2);
1354
+ }
1355
+ return t2;
1356
+ };
1357
+ var i2 = /* @__PURE__ */ new Set();
1358
+ var f2 = /* @__PURE__ */ new WeakMap();
1359
+ var stringify = (e3, r2) => {
1360
+ if (null === e3 || i2.has(e3)) {
1361
+ return "null";
1362
+ } else if ("object" != typeof e3) {
1363
+ return JSON.stringify(e3) || "";
1364
+ } else if (e3.toJSON) {
1365
+ return stringify(e3.toJSON(), r2);
1366
+ } else if (Array.isArray(e3)) {
1367
+ var t2 = "[";
1368
+ for (var a2 of e3) {
1369
+ if (t2.length > 1) {
1370
+ t2 += ",";
1371
+ }
1372
+ t2 += stringify(a2, r2) || "null";
1373
+ }
1374
+ return t2 += "]";
1375
+ } else if (!r2 && (l2 !== NoopConstructor && e3 instanceof l2 || c !== NoopConstructor && e3 instanceof c)) {
1376
+ return "null";
1377
+ }
1378
+ var o2 = Object.keys(e3).sort();
1379
+ if (!o2.length && e3.constructor && Object.getPrototypeOf(e3).constructor !== Object.prototype.constructor) {
1380
+ var n2 = f2.get(e3) || Math.random().toString(36).slice(2);
1381
+ f2.set(e3, n2);
1382
+ return stringify({
1383
+ __key: n2
1384
+ }, r2);
1385
+ }
1386
+ i2.add(e3);
1387
+ var s2 = "{";
1388
+ for (var d3 of o2) {
1389
+ var v3 = stringify(e3[d3], r2);
1390
+ if (v3) {
1391
+ if (s2.length > 1) {
1392
+ s2 += ",";
1393
+ }
1394
+ s2 += stringify(d3, r2) + ":" + v3;
1395
+ }
1396
+ }
1397
+ i2.delete(e3);
1398
+ return s2 += "}";
1399
+ };
1400
+ var extract = (e3, r2, t2) => {
1401
+ if (null == t2 || "object" != typeof t2 || t2.toJSON || i2.has(t2)) {
1402
+ } else if (Array.isArray(t2)) {
1403
+ for (var a2 = 0, o2 = t2.length; a2 < o2; a2++) {
1404
+ extract(e3, `${r2}.${a2}`, t2[a2]);
1405
+ }
1406
+ } else if (t2 instanceof l2 || t2 instanceof c) {
1407
+ e3.set(r2, t2);
1408
+ } else {
1409
+ i2.add(t2);
1410
+ for (var n2 of Object.keys(t2)) {
1411
+ extract(e3, `${r2}.${n2}`, t2[n2]);
1412
+ }
1413
+ }
1414
+ };
1415
+ var stringifyVariables = (e3, r2) => {
1416
+ i2.clear();
1417
+ return stringify(e3, r2 || false);
1418
+ };
1419
+ var NoopConstructor = class {
1420
+ };
1421
+ var l2 = "undefined" != typeof File ? File : NoopConstructor;
1422
+ var c = "undefined" != typeof Blob ? Blob : NoopConstructor;
1423
+ var d2 = /("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g;
1424
+ var v2 = /(?:#[^\n\r]+)?(?:[\r\n]+|$)/g;
1425
+ var replaceOutsideStrings = (e3, r2) => r2 % 2 == 0 ? e3.replace(v2, "\n") : e3;
1426
+ var sanitizeDocument = (e3) => e3.split(d2).map(replaceOutsideStrings).join("").trim();
1427
+ var p = /* @__PURE__ */ new Map();
1428
+ var u2 = /* @__PURE__ */ new Map();
1429
+ var stringifyDocument = (e3) => {
1430
+ var t2;
1431
+ if ("string" == typeof e3) {
1432
+ t2 = sanitizeDocument(e3);
1433
+ } else if (e3.loc && u2.get(e3.__key) === e3) {
1434
+ t2 = e3.loc.source.body;
1435
+ } else {
1436
+ t2 = p.get(e3) || sanitizeDocument(print(e3));
1437
+ p.set(e3, t2);
1438
+ }
1439
+ if ("string" != typeof e3 && !e3.loc) {
1440
+ e3.loc = {
1441
+ start: 0,
1442
+ end: t2.length,
1443
+ source: {
1444
+ body: t2,
1445
+ name: "gql",
1446
+ locationOffset: {
1447
+ line: 1,
1448
+ column: 1
1449
+ }
1450
+ }
1451
+ };
1452
+ }
1453
+ return t2;
1454
+ };
1455
+ var hashDocument = (e3) => {
1456
+ var r2;
1457
+ if (e3.documentId) {
1458
+ r2 = phash(e3.documentId);
1459
+ } else {
1460
+ r2 = phash(stringifyDocument(e3));
1461
+ if (e3.definitions) {
1462
+ var t2 = getOperationName(e3);
1463
+ if (t2) {
1464
+ r2 = phash(`
1465
+ # ${t2}`, r2);
1466
+ }
1467
+ }
1468
+ }
1469
+ return r2;
1470
+ };
1471
+ var keyDocument = (e3) => {
1472
+ var r2;
1473
+ var a2;
1474
+ if ("string" == typeof e3) {
1475
+ r2 = hashDocument(e3);
1476
+ a2 = u2.get(r2) || parse(e3, {
1477
+ noLocation: true
1478
+ });
1479
+ } else {
1480
+ r2 = e3.__key || hashDocument(e3);
1481
+ a2 = u2.get(r2) || e3;
1482
+ }
1483
+ if (!a2.loc) {
1484
+ stringifyDocument(a2);
1485
+ }
1486
+ a2.__key = r2;
1487
+ u2.set(r2, a2);
1488
+ return a2;
1489
+ };
1490
+ var createRequest = (e3, r2, t2) => {
1491
+ var a2 = r2 || {};
1492
+ var o2 = keyDocument(e3);
1493
+ var n2 = stringifyVariables(a2, true);
1494
+ var s2 = o2.__key;
1495
+ if ("{}" !== n2) {
1496
+ s2 = phash(n2, s2);
1497
+ }
1498
+ return {
1499
+ key: s2,
1500
+ query: o2,
1501
+ variables: a2,
1502
+ extensions: t2
1503
+ };
1504
+ };
1505
+ var getOperationName = (e3) => {
1506
+ for (var r2 of e3.definitions) {
1507
+ if (r2.kind === e.OPERATION_DEFINITION) {
1508
+ return r2.name ? r2.name.value : void 0;
1509
+ }
1510
+ }
1511
+ };
1512
+ var getOperationType = (e3) => {
1513
+ for (var r2 of e3.definitions) {
1514
+ if (r2.kind === e.OPERATION_DEFINITION) {
1515
+ return r2.operation;
1516
+ }
1517
+ }
1518
+ };
1519
+ var makeResult = (e3, r2, t2) => {
1520
+ if (!("data" in r2 || "errors" in r2 && Array.isArray(r2.errors))) {
1521
+ throw new Error("No Content");
1522
+ }
1523
+ var a2 = "subscription" === e3.kind;
1524
+ return {
1525
+ operation: e3,
1526
+ data: r2.data,
1527
+ error: Array.isArray(r2.errors) ? new CombinedError({
1528
+ graphQLErrors: r2.errors,
1529
+ response: t2
1530
+ }) : void 0,
1531
+ extensions: r2.extensions ? {
1532
+ ...r2.extensions
1533
+ } : void 0,
1534
+ hasNext: null == r2.hasNext ? a2 : r2.hasNext,
1535
+ stale: false
1536
+ };
1537
+ };
1538
+ var deepMerge = (e3, r2) => {
1539
+ if ("object" == typeof e3 && null != e3) {
1540
+ if (!e3.constructor || e3.constructor === Object || Array.isArray(e3)) {
1541
+ e3 = Array.isArray(e3) ? [...e3] : {
1542
+ ...e3
1543
+ };
1544
+ for (var t2 of Object.keys(r2)) {
1545
+ e3[t2] = deepMerge(e3[t2], r2[t2]);
1546
+ }
1547
+ return e3;
1548
+ }
1549
+ }
1550
+ return r2;
1551
+ };
1552
+ var mergeResultPatch = (e3, r2, t2, a2) => {
1553
+ var o2 = e3.error ? e3.error.graphQLErrors : [];
1554
+ var n2 = !!e3.extensions || !!(r2.payload || r2).extensions;
1555
+ var s2 = {
1556
+ ...e3.extensions,
1557
+ ...(r2.payload || r2).extensions
1558
+ };
1559
+ var i3 = r2.incremental;
1560
+ if ("path" in r2) {
1561
+ i3 = [r2];
1562
+ }
1563
+ var f3 = {
1564
+ data: e3.data
1565
+ };
1566
+ if (i3) {
1567
+ var _loop = function(e4) {
1568
+ if (Array.isArray(e4.errors)) {
1569
+ o2.push(...e4.errors);
1570
+ }
1571
+ if (e4.extensions) {
1572
+ Object.assign(s2, e4.extensions);
1573
+ n2 = true;
1574
+ }
1575
+ var r3 = "data";
1576
+ var t3 = f3;
1577
+ var i4 = [];
1578
+ if (e4.path) {
1579
+ i4 = e4.path;
1580
+ } else if (a2) {
1581
+ var l4 = a2.find((r4) => r4.id === e4.id);
1582
+ if (e4.subPath) {
1583
+ i4 = [...l4.path, ...e4.subPath];
1584
+ } else {
1585
+ i4 = l4.path;
1586
+ }
1587
+ }
1588
+ for (var c2 = 0, d3 = i4.length; c2 < d3; r3 = i4[c2++]) {
1589
+ t3 = t3[r3] = Array.isArray(t3[r3]) ? [...t3[r3]] : {
1590
+ ...t3[r3]
1591
+ };
1592
+ }
1593
+ if (e4.items) {
1594
+ var v3 = +r3 >= 0 ? r3 : 0;
1595
+ for (var p2 = 0, u3 = e4.items.length; p2 < u3; p2++) {
1596
+ t3[v3 + p2] = deepMerge(t3[v3 + p2], e4.items[p2]);
1597
+ }
1598
+ } else if (void 0 !== e4.data) {
1599
+ t3[r3] = deepMerge(t3[r3], e4.data);
1600
+ }
1601
+ };
1602
+ for (var l3 of i3) {
1603
+ _loop(l3);
1604
+ }
1605
+ } else {
1606
+ f3.data = (r2.payload || r2).data || e3.data;
1607
+ o2 = r2.errors || r2.payload && r2.payload.errors || o2;
1608
+ }
1609
+ return {
1610
+ operation: e3.operation,
1611
+ data: f3.data,
1612
+ error: o2.length ? new CombinedError({
1613
+ graphQLErrors: o2,
1614
+ response: t2
1615
+ }) : void 0,
1616
+ extensions: n2 ? s2 : void 0,
1617
+ hasNext: null != r2.hasNext ? r2.hasNext : e3.hasNext,
1618
+ stale: false
1619
+ };
1620
+ };
1621
+ var makeErrorResult = (e3, r2, t2) => ({
1622
+ operation: e3,
1623
+ data: void 0,
1624
+ error: new CombinedError({
1625
+ networkError: r2,
1626
+ response: t2
1627
+ }),
1628
+ extensions: void 0,
1629
+ hasNext: false,
1630
+ stale: false
1631
+ });
1632
+ function makeFetchBody(e3) {
1633
+ var r2 = {
1634
+ query: void 0,
1635
+ documentId: void 0,
1636
+ operationName: getOperationName(e3.query),
1637
+ variables: e3.variables || void 0,
1638
+ extensions: e3.extensions
1639
+ };
1640
+ if ("documentId" in e3.query && e3.query.documentId && (!e3.query.definitions || !e3.query.definitions.length)) {
1641
+ r2.documentId = e3.query.documentId;
1642
+ } else if (!e3.extensions || !e3.extensions.persistedQuery || e3.extensions.persistedQuery.miss) {
1643
+ r2.query = stringifyDocument(e3.query);
1644
+ }
1645
+ return r2;
1646
+ }
1647
+ var makeFetchURL = (e3, r2) => {
1648
+ var t2 = "query" === e3.kind && e3.context.preferGetMethod;
1649
+ if (!t2 || !r2) {
1650
+ return e3.context.url;
1651
+ }
1652
+ var a2 = splitOutSearchParams(e3.context.url);
1653
+ for (var o2 in r2) {
1654
+ var n2 = r2[o2];
1655
+ if (n2) {
1656
+ a2[1].set(o2, "object" == typeof n2 ? stringifyVariables(n2) : n2);
1657
+ }
1658
+ }
1659
+ var s2 = a2.join("?");
1660
+ if (s2.length > 2047 && "force" !== t2) {
1661
+ e3.context.preferGetMethod = false;
1662
+ return e3.context.url;
1663
+ }
1664
+ return s2;
1665
+ };
1666
+ var splitOutSearchParams = (e3) => {
1667
+ var r2 = e3.indexOf("?");
1668
+ return r2 > -1 ? [e3.slice(0, r2), new URLSearchParams(e3.slice(r2 + 1))] : [e3, new URLSearchParams()];
1669
+ };
1670
+ var serializeBody = (e3, r2) => {
1671
+ if (r2 && !("query" === e3.kind && !!e3.context.preferGetMethod)) {
1672
+ var t2 = stringifyVariables(r2);
1673
+ var a2 = ((e4) => {
1674
+ var r3 = /* @__PURE__ */ new Map();
1675
+ if (l2 !== NoopConstructor || c !== NoopConstructor) {
1676
+ i2.clear();
1677
+ extract(r3, "variables", e4);
1678
+ }
1679
+ return r3;
1680
+ })(r2.variables);
1681
+ if (a2.size) {
1682
+ var o2 = new FormData();
1683
+ o2.append("operations", t2);
1684
+ o2.append("map", stringifyVariables({
1685
+ ...[...a2.keys()].map((e4) => [e4])
1686
+ }));
1687
+ var n2 = 0;
1688
+ for (var s2 of a2.values()) {
1689
+ o2.append("" + n2++, s2);
1690
+ }
1691
+ return o2;
1692
+ }
1693
+ return t2;
1694
+ }
1695
+ };
1696
+ var makeFetchOptions = (e3, r2) => {
1697
+ var t2 = {
1698
+ accept: "subscription" === e3.kind ? "text/event-stream, multipart/mixed" : "application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed"
1699
+ };
1700
+ var a2 = ("function" == typeof e3.context.fetchOptions ? e3.context.fetchOptions() : e3.context.fetchOptions) || {};
1701
+ if (a2.headers) {
1702
+ if (((e4) => "has" in e4 && !Object.keys(e4).length)(a2.headers)) {
1703
+ a2.headers.forEach((e4, r3) => {
1704
+ t2[r3] = e4;
1705
+ });
1706
+ } else if (Array.isArray(a2.headers)) {
1707
+ a2.headers.forEach((e4, r3) => {
1708
+ if (Array.isArray(e4)) {
1709
+ if (t2[e4[0]]) {
1710
+ t2[e4[0]] = `${t2[e4[0]]},${e4[1]}`;
1711
+ } else {
1712
+ t2[e4[0]] = e4[1];
1713
+ }
1714
+ } else {
1715
+ t2[r3] = e4;
1716
+ }
1717
+ });
1718
+ } else {
1719
+ for (var o2 in a2.headers) {
1720
+ t2[o2.toLowerCase()] = a2.headers[o2];
1721
+ }
1722
+ }
1723
+ }
1724
+ var n2 = serializeBody(e3, r2);
1725
+ if ("string" == typeof n2 && !t2["content-type"]) {
1726
+ t2["content-type"] = "application/json";
1727
+ }
1728
+ return {
1729
+ ...a2,
1730
+ method: n2 ? "POST" : "GET",
1731
+ body: n2,
1732
+ headers: t2
1733
+ };
1734
+ };
1735
+ var y = "undefined" != typeof TextDecoder ? new TextDecoder() : null;
1736
+ var h = /boundary="?([^=";]+)"?/i;
1737
+ var m2 = /data: ?([^\n]+)/;
1738
+ var toString = (e3) => "Buffer" === e3.constructor.name ? e3.toString() : y.decode(e3);
1739
+ async function* streamBody(e3) {
1740
+ if (e3.body[Symbol.asyncIterator]) {
1741
+ for await (var r2 of e3.body) {
1742
+ yield toString(r2);
1743
+ }
1744
+ } else {
1745
+ var t2 = e3.body.getReader();
1746
+ var a2;
1747
+ try {
1748
+ while (!(a2 = await t2.read()).done) {
1749
+ yield toString(a2.value);
1750
+ }
1751
+ } finally {
1752
+ t2.cancel();
1753
+ }
1754
+ }
1755
+ }
1756
+ async function* split(e3, r2) {
1757
+ var t2 = "";
1758
+ var a2;
1759
+ for await (var o2 of e3) {
1760
+ t2 += o2;
1761
+ while ((a2 = t2.indexOf(r2)) > -1) {
1762
+ yield t2.slice(0, a2);
1763
+ t2 = t2.slice(a2 + r2.length);
1764
+ }
1765
+ }
1766
+ }
1767
+ async function* fetchOperation(e3, r2, t2) {
1768
+ var a2 = true;
1769
+ var o2 = null;
1770
+ var n2;
1771
+ try {
1772
+ yield await Promise.resolve();
1773
+ var s2 = (n2 = await (e3.context.fetch || fetch)(r2, t2)).headers.get("Content-Type") || "";
1774
+ var i3;
1775
+ if (/multipart\/mixed/i.test(s2)) {
1776
+ i3 = async function* parseMultipartMixed(e4, r3) {
1777
+ var t3 = e4.match(h);
1778
+ var a3 = "--" + (t3 ? t3[1] : "-");
1779
+ var o3 = true;
1780
+ var n3;
1781
+ for await (var s3 of split(streamBody(r3), "\r\n" + a3)) {
1782
+ if (o3) {
1783
+ o3 = false;
1784
+ var i4 = s3.indexOf(a3);
1785
+ if (i4 > -1) {
1786
+ s3 = s3.slice(i4 + a3.length);
1787
+ } else {
1788
+ continue;
1789
+ }
1790
+ }
1791
+ try {
1792
+ yield n3 = JSON.parse(s3.slice(s3.indexOf("\r\n\r\n") + 4));
1793
+ } catch (e5) {
1794
+ if (!n3) {
1795
+ throw e5;
1796
+ }
1797
+ }
1798
+ if (n3 && false === n3.hasNext) {
1799
+ break;
1800
+ }
1801
+ }
1802
+ if (n3 && false !== n3.hasNext) {
1803
+ yield {
1804
+ hasNext: false
1805
+ };
1806
+ }
1807
+ }(s2, n2);
1808
+ } else if (/text\/event-stream/i.test(s2)) {
1809
+ i3 = async function* parseEventStream(e4) {
1810
+ var r3;
1811
+ for await (var t3 of split(streamBody(e4), "\n\n")) {
1812
+ var a3 = t3.match(m2);
1813
+ if (a3) {
1814
+ var o3 = a3[1];
1815
+ try {
1816
+ yield r3 = JSON.parse(o3);
1817
+ } catch (e5) {
1818
+ if (!r3) {
1819
+ throw e5;
1820
+ }
1821
+ }
1822
+ if (r3 && false === r3.hasNext) {
1823
+ break;
1824
+ }
1825
+ }
1826
+ }
1827
+ if (r3 && false !== r3.hasNext) {
1828
+ yield {
1829
+ hasNext: false
1830
+ };
1831
+ }
1832
+ }(n2);
1833
+ } else if (!/text\//i.test(s2)) {
1834
+ i3 = async function* parseJSON(e4) {
1835
+ yield JSON.parse(await e4.text());
1836
+ }(n2);
1837
+ } else {
1838
+ i3 = async function* parseMaybeJSON(e4) {
1839
+ var r3 = await e4.text();
1840
+ try {
1841
+ var t3 = JSON.parse(r3);
1842
+ if ("production" !== process.env.NODE_ENV) {
1843
+ console.warn('Found response with content-type "text/plain" but it had a valid "application/json" response.');
1844
+ }
1845
+ yield t3;
1846
+ } catch (e5) {
1847
+ throw new Error(r3);
1848
+ }
1849
+ }(n2);
1850
+ }
1851
+ var f3;
1852
+ for await (var l3 of i3) {
1853
+ if (l3.pending && !o2) {
1854
+ f3 = l3.pending;
1855
+ } else if (l3.pending) {
1856
+ f3 = [...f3, ...l3.pending];
1857
+ }
1858
+ o2 = o2 ? mergeResultPatch(o2, l3, n2, f3) : makeResult(e3, l3, n2);
1859
+ a2 = false;
1860
+ yield o2;
1861
+ a2 = true;
1862
+ }
1863
+ if (!o2) {
1864
+ yield o2 = makeResult(e3, {}, n2);
1865
+ }
1866
+ } catch (r3) {
1867
+ if (!a2) {
1868
+ throw r3;
1869
+ }
1870
+ yield makeErrorResult(e3, n2 && (n2.status < 200 || n2.status >= 300) && n2.statusText ? new Error(n2.statusText) : r3, n2);
1871
+ }
1872
+ }
1873
+ function makeFetchSource(e3, r2, t2) {
1874
+ var a2;
1875
+ if ("undefined" != typeof AbortController) {
1876
+ t2.signal = (a2 = new AbortController()).signal;
1877
+ }
1878
+ return onEnd(() => {
1879
+ if (a2) {
1880
+ a2.abort();
1881
+ }
1882
+ })(filter((e4) => !!e4)(fromAsyncIterable(fetchOperation(e3, r2, t2))));
1883
+ }
1884
+
1885
+ // ../../node_modules/.pnpm/@urql+core@5.0.4_graphql@16.9.0/node_modules/@urql/core/dist/urql-core.mjs
1886
+ var collectTypes = (e3, r2) => {
1887
+ if (Array.isArray(e3)) {
1888
+ for (var t2 of e3) {
1889
+ collectTypes(t2, r2);
1890
+ }
1891
+ } else if ("object" == typeof e3 && null !== e3) {
1892
+ for (var n2 in e3) {
1893
+ if ("__typename" === n2 && "string" == typeof e3[n2]) {
1894
+ r2.add(e3[n2]);
1895
+ } else {
1896
+ collectTypes(e3[n2], r2);
1897
+ }
1898
+ }
1899
+ }
1900
+ return r2;
1901
+ };
1902
+ var formatNode = (r2) => {
1903
+ if ("definitions" in r2) {
1904
+ var t2 = [];
1905
+ for (var n2 of r2.definitions) {
1906
+ var a2 = formatNode(n2);
1907
+ t2.push(a2);
1908
+ }
1909
+ return {
1910
+ ...r2,
1911
+ definitions: t2
1912
+ };
1913
+ }
1914
+ if ("directives" in r2 && r2.directives && r2.directives.length) {
1915
+ var o2 = [];
1916
+ var i3 = {};
1917
+ for (var s2 of r2.directives) {
1918
+ var c2 = s2.name.value;
1919
+ if ("_" !== c2[0]) {
1920
+ o2.push(s2);
1921
+ } else {
1922
+ c2 = c2.slice(1);
1923
+ }
1924
+ i3[c2] = s2;
1925
+ }
1926
+ r2 = {
1927
+ ...r2,
1928
+ directives: o2,
1929
+ _directives: i3
1930
+ };
1931
+ }
1932
+ if ("selectionSet" in r2) {
1933
+ var u3 = [];
1934
+ var p2 = r2.kind === e.OPERATION_DEFINITION;
1935
+ if (r2.selectionSet) {
1936
+ for (var d3 of r2.selectionSet.selections || []) {
1937
+ p2 = p2 || d3.kind === e.FIELD && "__typename" === d3.name.value && !d3.alias;
1938
+ var v3 = formatNode(d3);
1939
+ u3.push(v3);
1940
+ }
1941
+ if (!p2) {
1942
+ u3.push({
1943
+ kind: e.FIELD,
1944
+ name: {
1945
+ kind: e.NAME,
1946
+ value: "__typename"
1947
+ },
1948
+ _generated: true
1949
+ });
1950
+ }
1951
+ return {
1952
+ ...r2,
1953
+ selectionSet: {
1954
+ ...r2.selectionSet,
1955
+ selections: u3
1956
+ }
1957
+ };
1958
+ }
1959
+ }
1960
+ return r2;
1961
+ };
1962
+ var I = /* @__PURE__ */ new Map();
1963
+ var formatDocument = (e3) => {
1964
+ var t2 = keyDocument(e3);
1965
+ var n2 = I.get(t2.__key);
1966
+ if (!n2) {
1967
+ I.set(t2.__key, n2 = formatNode(t2));
1968
+ Object.defineProperty(n2, "__key", {
1969
+ value: t2.__key,
1970
+ enumerable: false
1971
+ });
1972
+ }
1973
+ return n2;
1974
+ };
1975
+ function withPromise(e3) {
1976
+ var source$ = (r2) => e3(r2);
1977
+ source$.toPromise = () => toPromise(take(1)(filter((e4) => !e4.stale && !e4.hasNext)(source$)));
1978
+ source$.then = (e4, r2) => source$.toPromise().then(e4, r2);
1979
+ source$.subscribe = (e4) => subscribe(e4)(source$);
1980
+ return source$;
1981
+ }
1982
+ function makeOperation(e3, r2, t2) {
1983
+ return {
1984
+ ...r2,
1985
+ kind: e3,
1986
+ context: r2.context ? {
1987
+ ...r2.context,
1988
+ ...t2
1989
+ } : t2 || r2.context
1990
+ };
1991
+ }
1992
+ var addMetadata = (e3, r2) => makeOperation(e3.kind, e3, {
1993
+ meta: {
1994
+ ...e3.context.meta,
1995
+ ...r2
1996
+ }
1997
+ });
1998
+ var noop = () => {
1999
+ };
2000
+ var shouldSkip = ({ kind: e3 }) => "mutation" !== e3 && "query" !== e3;
2001
+ var mapTypeNames = (e3) => {
2002
+ var r2 = formatDocument(e3.query);
2003
+ if (r2 !== e3.query) {
2004
+ var t2 = makeOperation(e3.kind, e3);
2005
+ t2.query = r2;
2006
+ return t2;
2007
+ } else {
2008
+ return e3;
2009
+ }
2010
+ };
2011
+ var cacheExchange = ({ forward: e3, client: r2, dispatchDebug: t2 }) => {
2012
+ var a2 = /* @__PURE__ */ new Map();
2013
+ var o2 = /* @__PURE__ */ new Map();
2014
+ var isOperationCached = (e4) => "query" === e4.kind && "network-only" !== e4.context.requestPolicy && ("cache-only" === e4.context.requestPolicy || a2.has(e4.key));
2015
+ return (i3) => {
2016
+ var s2 = map((e4) => {
2017
+ var o3 = a2.get(e4.key);
2018
+ "production" !== process.env.NODE_ENV && t2({
2019
+ operation: e4,
2020
+ ...o3 ? {
2021
+ type: "cacheHit",
2022
+ message: "The result was successfully retried from the cache"
2023
+ } : {
2024
+ type: "cacheMiss",
2025
+ message: "The result could not be retrieved from the cache"
2026
+ },
2027
+ source: "cacheExchange"
2028
+ });
2029
+ var i4 = o3 || makeResult(e4, {
2030
+ data: null
2031
+ });
2032
+ i4 = {
2033
+ ...i4,
2034
+ operation: "production" !== process.env.NODE_ENV ? addMetadata(e4, {
2035
+ cacheOutcome: o3 ? "hit" : "miss"
2036
+ }) : e4
2037
+ };
2038
+ if ("cache-and-network" === e4.context.requestPolicy) {
2039
+ i4.stale = true;
2040
+ reexecuteOperation(r2, e4);
2041
+ }
2042
+ return i4;
2043
+ })(filter((e4) => !shouldSkip(e4) && isOperationCached(e4))(i3));
2044
+ var c2 = onPush((e4) => {
2045
+ var { operation: n2 } = e4;
2046
+ if (!n2) {
2047
+ return;
2048
+ }
2049
+ var i4 = n2.context.additionalTypenames || [];
2050
+ if ("subscription" !== e4.operation.kind) {
2051
+ i4 = ((e5) => [...collectTypes(e5, /* @__PURE__ */ new Set())])(e4.data).concat(i4);
2052
+ }
2053
+ if ("mutation" === e4.operation.kind || "subscription" === e4.operation.kind) {
2054
+ var s3 = /* @__PURE__ */ new Set();
2055
+ "production" !== process.env.NODE_ENV && t2({
2056
+ type: "cacheInvalidation",
2057
+ message: `The following typenames have been invalidated: ${i4}`,
2058
+ operation: n2,
2059
+ data: {
2060
+ typenames: i4,
2061
+ response: e4
2062
+ },
2063
+ source: "cacheExchange"
2064
+ });
2065
+ for (var c3 = 0; c3 < i4.length; c3++) {
2066
+ var u3 = i4[c3];
2067
+ var p2 = o2.get(u3);
2068
+ if (!p2) {
2069
+ o2.set(u3, p2 = /* @__PURE__ */ new Set());
2070
+ }
2071
+ for (var d3 of p2.values()) {
2072
+ s3.add(d3);
2073
+ }
2074
+ p2.clear();
2075
+ }
2076
+ for (var v3 of s3.values()) {
2077
+ if (a2.has(v3)) {
2078
+ n2 = a2.get(v3).operation;
2079
+ a2.delete(v3);
2080
+ reexecuteOperation(r2, n2);
2081
+ }
2082
+ }
2083
+ } else if ("query" === n2.kind && e4.data) {
2084
+ a2.set(n2.key, e4);
2085
+ for (var l3 = 0; l3 < i4.length; l3++) {
2086
+ var f3 = i4[l3];
2087
+ var h2 = o2.get(f3);
2088
+ if (!h2) {
2089
+ o2.set(f3, h2 = /* @__PURE__ */ new Set());
2090
+ }
2091
+ h2.add(n2.key);
2092
+ }
2093
+ }
2094
+ })(e3(filter((e4) => "query" !== e4.kind || "cache-only" !== e4.context.requestPolicy)(map((e4) => "production" !== process.env.NODE_ENV ? addMetadata(e4, {
2095
+ cacheOutcome: "miss"
2096
+ }) : e4)(merge([map(mapTypeNames)(filter((e4) => !shouldSkip(e4) && !isOperationCached(e4))(i3)), filter((e4) => shouldSkip(e4))(i3)])))));
2097
+ return merge([s2, c2]);
2098
+ };
2099
+ };
2100
+ var reexecuteOperation = (e3, r2) => e3.reexecuteOperation(makeOperation(r2.kind, r2, {
2101
+ requestPolicy: "network-only"
2102
+ }));
2103
+ var fetchExchange = ({ forward: e3, dispatchDebug: r2 }) => (t2) => {
2104
+ var n2 = mergeMap((e4) => {
2105
+ var n3 = makeFetchBody(e4);
2106
+ var a3 = makeFetchURL(e4, n3);
2107
+ var i3 = makeFetchOptions(e4, n3);
2108
+ "production" !== process.env.NODE_ENV && r2({
2109
+ type: "fetchRequest",
2110
+ message: "A fetch request is being executed.",
2111
+ operation: e4,
2112
+ data: {
2113
+ url: a3,
2114
+ fetchOptions: i3
2115
+ },
2116
+ source: "fetchExchange"
2117
+ });
2118
+ var s2 = takeUntil(filter((r3) => "teardown" === r3.kind && r3.key === e4.key)(t2))(makeFetchSource(e4, a3, i3));
2119
+ if ("production" !== process.env.NODE_ENV) {
2120
+ return onPush((t3) => {
2121
+ var n4 = !t3.data ? t3.error : void 0;
2122
+ "production" !== process.env.NODE_ENV && r2({
2123
+ type: n4 ? "fetchError" : "fetchSuccess",
2124
+ message: `A ${n4 ? "failed" : "successful"} fetch response has been returned.`,
2125
+ operation: e4,
2126
+ data: {
2127
+ url: a3,
2128
+ fetchOptions: i3,
2129
+ value: n4 || t3
2130
+ },
2131
+ source: "fetchExchange"
2132
+ });
2133
+ })(s2);
2134
+ }
2135
+ return s2;
2136
+ })(filter((e4) => "teardown" !== e4.kind && ("subscription" !== e4.kind || !!e4.context.fetchSubscriptions))(t2));
2137
+ var a2 = e3(filter((e4) => "teardown" === e4.kind || "subscription" === e4.kind && !e4.context.fetchSubscriptions)(t2));
2138
+ return merge([n2, a2]);
2139
+ };
2140
+ var composeExchanges = (e3) => ({ client: r2, forward: t2, dispatchDebug: n2 }) => e3.reduceRight((e4, t3) => {
2141
+ var a2 = false;
2142
+ return t3({
2143
+ client: r2,
2144
+ forward(r3) {
2145
+ if ("production" !== process.env.NODE_ENV) {
2146
+ if (a2) {
2147
+ throw new Error("forward() must only be called once in each Exchange.");
2148
+ }
2149
+ a2 = true;
2150
+ }
2151
+ return share(e4(share(r3)));
2152
+ },
2153
+ dispatchDebug(e5) {
2154
+ "production" !== process.env.NODE_ENV && n2({
2155
+ timestamp: Date.now(),
2156
+ source: t3.name,
2157
+ ...e5
2158
+ });
2159
+ }
2160
+ });
2161
+ }, t2);
2162
+ var fallbackExchange = ({ dispatchDebug: e3 }) => (r2) => {
2163
+ if ("production" !== process.env.NODE_ENV) {
2164
+ r2 = onPush((r3) => {
2165
+ if ("teardown" !== r3.kind && "production" !== process.env.NODE_ENV) {
2166
+ var t2 = `No exchange has handled operations of kind "${r3.kind}". Check whether you've added an exchange responsible for these operations.`;
2167
+ "production" !== process.env.NODE_ENV && e3({
2168
+ type: "fallbackCatch",
2169
+ message: t2,
2170
+ operation: r3,
2171
+ source: "fallbackExchange"
2172
+ });
2173
+ console.warn(t2);
2174
+ }
2175
+ })(r2);
2176
+ }
2177
+ return filter((e4) => false)(r2);
2178
+ };
2179
+ var C = function Client(e3) {
2180
+ if ("production" !== process.env.NODE_ENV && !e3.url) {
2181
+ throw new Error("You are creating an urql-client without a url.");
2182
+ }
2183
+ var r2 = 0;
2184
+ var t2 = /* @__PURE__ */ new Map();
2185
+ var n2 = /* @__PURE__ */ new Map();
2186
+ var a2 = /* @__PURE__ */ new Set();
2187
+ var o2 = [];
2188
+ var i3 = {
2189
+ url: e3.url,
2190
+ fetchSubscriptions: e3.fetchSubscriptions,
2191
+ fetchOptions: e3.fetchOptions,
2192
+ fetch: e3.fetch,
2193
+ preferGetMethod: e3.preferGetMethod,
2194
+ requestPolicy: e3.requestPolicy || "cache-first"
2195
+ };
2196
+ var s2 = makeSubject();
2197
+ function nextOperation(e4) {
2198
+ if ("mutation" === e4.kind || "teardown" === e4.kind || !a2.has(e4.key)) {
2199
+ if ("teardown" === e4.kind) {
2200
+ a2.delete(e4.key);
2201
+ } else if ("mutation" !== e4.kind) {
2202
+ a2.add(e4.key);
2203
+ }
2204
+ s2.next(e4);
2205
+ }
2206
+ }
2207
+ var c2 = false;
2208
+ function dispatchOperation(e4) {
2209
+ if (e4) {
2210
+ nextOperation(e4);
2211
+ }
2212
+ if (!c2) {
2213
+ c2 = true;
2214
+ while (c2 && (e4 = o2.shift())) {
2215
+ nextOperation(e4);
2216
+ }
2217
+ c2 = false;
2218
+ }
2219
+ }
2220
+ var makeResultSource = (e4) => {
2221
+ var r3 = takeUntil(filter((r4) => "teardown" === r4.kind && r4.key === e4.key)(s2.source))(filter((r4) => r4.operation.kind === e4.kind && r4.operation.key === e4.key && (!r4.operation.context._instance || r4.operation.context._instance === e4.context._instance))(O));
2222
+ if ("query" !== e4.kind) {
2223
+ r3 = takeWhile((e5) => !!e5.hasNext, true)(r3);
2224
+ } else {
2225
+ r3 = switchMap((r4) => {
2226
+ var t3 = fromValue(r4);
2227
+ return r4.stale || r4.hasNext ? t3 : merge([t3, map(() => {
2228
+ r4.stale = true;
2229
+ return r4;
2230
+ })(take(1)(filter((r5) => r5.key === e4.key)(s2.source)))]);
2231
+ })(r3);
2232
+ }
2233
+ if ("mutation" !== e4.kind) {
2234
+ r3 = onEnd(() => {
2235
+ a2.delete(e4.key);
2236
+ t2.delete(e4.key);
2237
+ n2.delete(e4.key);
2238
+ c2 = false;
2239
+ for (var r4 = o2.length - 1; r4 >= 0; r4--) {
2240
+ if (o2[r4].key === e4.key) {
2241
+ o2.splice(r4, 1);
2242
+ }
2243
+ }
2244
+ nextOperation(makeOperation("teardown", e4, e4.context));
2245
+ })(onPush((r4) => {
2246
+ if (r4.stale) {
2247
+ if (!r4.hasNext) {
2248
+ a2.delete(e4.key);
2249
+ } else {
2250
+ for (var n3 of o2) {
2251
+ if (n3.key === r4.operation.key) {
2252
+ a2.delete(n3.key);
2253
+ break;
2254
+ }
2255
+ }
2256
+ }
2257
+ } else if (!r4.hasNext) {
2258
+ a2.delete(e4.key);
2259
+ }
2260
+ t2.set(e4.key, r4);
2261
+ })(r3));
2262
+ } else {
2263
+ r3 = onStart(() => {
2264
+ nextOperation(e4);
2265
+ })(r3);
2266
+ }
2267
+ return share(r3);
2268
+ };
2269
+ var u3 = this instanceof Client ? this : Object.create(Client.prototype);
2270
+ var p2 = Object.assign(u3, {
2271
+ suspense: !!e3.suspense,
2272
+ operations$: s2.source,
2273
+ reexecuteOperation(e4) {
2274
+ if ("teardown" === e4.kind) {
2275
+ dispatchOperation(e4);
2276
+ } else if ("mutation" === e4.kind) {
2277
+ o2.push(e4);
2278
+ Promise.resolve().then(dispatchOperation);
2279
+ } else if (n2.has(e4.key)) {
2280
+ var r3 = false;
2281
+ for (var t3 = 0; t3 < o2.length; t3++) {
2282
+ if (o2[t3].key === e4.key) {
2283
+ o2[t3] = e4;
2284
+ r3 = true;
2285
+ }
2286
+ }
2287
+ if (!(r3 || a2.has(e4.key) && "network-only" !== e4.context.requestPolicy)) {
2288
+ o2.push(e4);
2289
+ Promise.resolve().then(dispatchOperation);
2290
+ } else {
2291
+ a2.delete(e4.key);
2292
+ Promise.resolve().then(dispatchOperation);
2293
+ }
2294
+ }
2295
+ },
2296
+ createRequestOperation(e4, t3, n3) {
2297
+ if (!n3) {
2298
+ n3 = {};
2299
+ }
2300
+ var a3;
2301
+ if ("production" !== process.env.NODE_ENV && "teardown" !== e4 && (a3 = getOperationType(t3.query)) !== e4) {
2302
+ throw new Error(`Expected operation of type "${e4}" but found "${a3}"`);
2303
+ }
2304
+ return makeOperation(e4, t3, {
2305
+ _instance: "mutation" === e4 ? r2 = r2 + 1 | 0 : void 0,
2306
+ ...i3,
2307
+ ...n3,
2308
+ requestPolicy: n3.requestPolicy || i3.requestPolicy,
2309
+ suspense: n3.suspense || false !== n3.suspense && p2.suspense
2310
+ });
2311
+ },
2312
+ executeRequestOperation(e4) {
2313
+ if ("mutation" === e4.kind) {
2314
+ return withPromise(makeResultSource(e4));
2315
+ }
2316
+ return withPromise(lazy(() => {
2317
+ var r3 = n2.get(e4.key);
2318
+ if (!r3) {
2319
+ n2.set(e4.key, r3 = makeResultSource(e4));
2320
+ }
2321
+ r3 = onStart(() => {
2322
+ dispatchOperation(e4);
2323
+ })(r3);
2324
+ var a3 = t2.get(e4.key);
2325
+ if ("query" === e4.kind && a3 && (a3.stale || a3.hasNext)) {
2326
+ return switchMap(fromValue)(merge([r3, filter((r4) => r4 === t2.get(e4.key))(fromValue(a3))]));
2327
+ } else {
2328
+ return r3;
2329
+ }
2330
+ }));
2331
+ },
2332
+ executeQuery(e4, r3) {
2333
+ var t3 = p2.createRequestOperation("query", e4, r3);
2334
+ return p2.executeRequestOperation(t3);
2335
+ },
2336
+ executeSubscription(e4, r3) {
2337
+ var t3 = p2.createRequestOperation("subscription", e4, r3);
2338
+ return p2.executeRequestOperation(t3);
2339
+ },
2340
+ executeMutation(e4, r3) {
2341
+ var t3 = p2.createRequestOperation("mutation", e4, r3);
2342
+ return p2.executeRequestOperation(t3);
2343
+ },
2344
+ readQuery(e4, r3, t3) {
2345
+ var n3 = null;
2346
+ subscribe((e5) => {
2347
+ n3 = e5;
2348
+ })(p2.query(e4, r3, t3)).unsubscribe();
2349
+ return n3;
2350
+ },
2351
+ query: (e4, r3, t3) => p2.executeQuery(createRequest(e4, r3), t3),
2352
+ subscription: (e4, r3, t3) => p2.executeSubscription(createRequest(e4, r3), t3),
2353
+ mutation: (e4, r3, t3) => p2.executeMutation(createRequest(e4, r3), t3)
2354
+ });
2355
+ var d3 = noop;
2356
+ if ("production" !== process.env.NODE_ENV) {
2357
+ var { next: f3, source: x } = makeSubject();
2358
+ p2.subscribeToDebugTarget = (e4) => subscribe(e4)(x);
2359
+ d3 = f3;
2360
+ }
2361
+ var g = composeExchanges(e3.exchanges);
2362
+ var O = share(g({
2363
+ client: p2,
2364
+ dispatchDebug: d3,
2365
+ forward: fallbackExchange({
2366
+ dispatchDebug: d3
2367
+ })
2368
+ })(s2.source));
2369
+ publish(O);
2370
+ return p2;
2371
+ };
2372
+ var Q = C;
2373
+
2374
+ // src/gql/graphql.ts
2375
+ var DocumentDocument = {
2376
+ kind: "Document",
2377
+ definitions: [
2378
+ {
2379
+ kind: "OperationDefinition",
2380
+ operation: "query",
2381
+ name: { kind: "Name", value: "document" },
2382
+ variableDefinitions: [
2383
+ {
2384
+ kind: "VariableDefinition",
2385
+ variable: { kind: "Variable", name: { kind: "Name", value: "slug" } },
2386
+ type: { kind: "NamedType", name: { kind: "Name", value: "String" } }
2387
+ }
2388
+ ],
2389
+ selectionSet: {
2390
+ kind: "SelectionSet",
2391
+ selections: [
2392
+ {
2393
+ kind: "Field",
2394
+ name: { kind: "Name", value: "document" },
2395
+ arguments: [
2396
+ {
2397
+ kind: "Argument",
2398
+ name: { kind: "Name", value: "slug" },
2399
+ value: { kind: "Variable", name: { kind: "Name", value: "slug" } }
2400
+ }
2401
+ ],
2402
+ selectionSet: {
2403
+ kind: "SelectionSet",
2404
+ selections: [
2405
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2406
+ { kind: "Field", name: { kind: "Name", value: "slug" } },
2407
+ { kind: "Field", name: { kind: "Name", value: "emoji" } },
2408
+ { kind: "Field", name: { kind: "Name", value: "title" } },
2409
+ { kind: "Field", name: { kind: "Name", value: "draft" } },
2410
+ { kind: "Field", name: { kind: "Name", value: "content" } },
2411
+ { kind: "Field", name: { kind: "Name", value: "path" } },
2412
+ {
2413
+ kind: "Field",
2414
+ name: { kind: "Name", value: "tags" },
2415
+ selectionSet: {
2416
+ kind: "SelectionSet",
2417
+ selections: [
2418
+ {
2419
+ kind: "Field",
2420
+ name: { kind: "Name", value: "edges" },
2421
+ selectionSet: {
2422
+ kind: "SelectionSet",
2423
+ selections: [
2424
+ {
2425
+ kind: "Field",
2426
+ name: { kind: "Name", value: "node" },
2427
+ selectionSet: {
2428
+ kind: "SelectionSet",
2429
+ selections: [
2430
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2431
+ { kind: "Field", name: { kind: "Name", value: "name" } }
2432
+ ]
2433
+ }
2434
+ }
2435
+ ]
2436
+ }
2437
+ }
2438
+ ]
2439
+ }
2440
+ },
2441
+ {
2442
+ kind: "Field",
2443
+ name: { kind: "Name", value: "preview" },
2444
+ selectionSet: {
2445
+ kind: "SelectionSet",
2446
+ selections: [
2447
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2448
+ { kind: "Field", name: { kind: "Name", value: "width" } },
2449
+ { kind: "Field", name: { kind: "Name", value: "height" } },
2450
+ { kind: "Field", name: { kind: "Name", value: "path" } },
2451
+ { kind: "Field", name: { kind: "Name", value: "fileUrl" } }
2452
+ ]
2453
+ }
2454
+ },
2455
+ { kind: "Field", name: { kind: "Name", value: "publishedAt" } },
2456
+ { kind: "Field", name: { kind: "Name", value: "modifiedAt" } },
2457
+ {
2458
+ kind: "Field",
2459
+ name: { kind: "Name", value: "assets" },
2460
+ selectionSet: {
2461
+ kind: "SelectionSet",
2462
+ selections: [
2463
+ {
2464
+ kind: "Field",
2465
+ name: { kind: "Name", value: "edges" },
2466
+ selectionSet: {
2467
+ kind: "SelectionSet",
2468
+ selections: [
2469
+ {
2470
+ kind: "Field",
2471
+ name: { kind: "Name", value: "node" },
2472
+ selectionSet: {
2473
+ kind: "SelectionSet",
2474
+ selections: [
2475
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2476
+ { kind: "Field", name: { kind: "Name", value: "path" } },
2477
+ { kind: "Field", name: { kind: "Name", value: "name" } },
2478
+ { kind: "Field", name: { kind: "Name", value: "fileUrl" } },
2479
+ { kind: "Field", name: { kind: "Name", value: "height" } },
2480
+ { kind: "Field", name: { kind: "Name", value: "width" } }
2481
+ ]
2482
+ }
2483
+ }
2484
+ ]
2485
+ }
2486
+ }
2487
+ ]
2488
+ }
2489
+ },
2490
+ {
2491
+ kind: "Field",
2492
+ name: { kind: "Name", value: "outboundLinkDocuments" },
2493
+ selectionSet: {
2494
+ kind: "SelectionSet",
2495
+ selections: [
2496
+ {
2497
+ kind: "Field",
2498
+ name: { kind: "Name", value: "edges" },
2499
+ selectionSet: {
2500
+ kind: "SelectionSet",
2501
+ selections: [
2502
+ {
2503
+ kind: "Field",
2504
+ name: { kind: "Name", value: "node" },
2505
+ selectionSet: {
2506
+ kind: "SelectionSet",
2507
+ selections: [
2508
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2509
+ { kind: "Field", name: { kind: "Name", value: "slug" } },
2510
+ { kind: "Field", name: { kind: "Name", value: "emoji" } },
2511
+ { kind: "Field", name: { kind: "Name", value: "title" } },
2512
+ { kind: "Field", name: { kind: "Name", value: "draft" } },
2513
+ { kind: "Field", name: { kind: "Name", value: "path" } },
2514
+ {
2515
+ kind: "Field",
2516
+ name: { kind: "Name", value: "tags" },
2517
+ selectionSet: {
2518
+ kind: "SelectionSet",
2519
+ selections: [
2520
+ {
2521
+ kind: "Field",
2522
+ name: { kind: "Name", value: "edges" },
2523
+ selectionSet: {
2524
+ kind: "SelectionSet",
2525
+ selections: [
2526
+ {
2527
+ kind: "Field",
2528
+ name: { kind: "Name", value: "node" },
2529
+ selectionSet: {
2530
+ kind: "SelectionSet",
2531
+ selections: [
2532
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2533
+ { kind: "Field", name: { kind: "Name", value: "name" } }
2534
+ ]
2535
+ }
2536
+ }
2537
+ ]
2538
+ }
2539
+ }
2540
+ ]
2541
+ }
2542
+ },
2543
+ { kind: "Field", name: { kind: "Name", value: "publishedAt" } },
2544
+ { kind: "Field", name: { kind: "Name", value: "modifiedAt" } }
2545
+ ]
2546
+ }
2547
+ }
2548
+ ]
2549
+ }
2550
+ }
2551
+ ]
2552
+ }
2553
+ },
2554
+ {
2555
+ kind: "Field",
2556
+ name: { kind: "Name", value: "inboundLinkDocuments" },
2557
+ selectionSet: {
2558
+ kind: "SelectionSet",
2559
+ selections: [
2560
+ {
2561
+ kind: "Field",
2562
+ name: { kind: "Name", value: "edges" },
2563
+ selectionSet: {
2564
+ kind: "SelectionSet",
2565
+ selections: [
2566
+ {
2567
+ kind: "Field",
2568
+ name: { kind: "Name", value: "node" },
2569
+ selectionSet: {
2570
+ kind: "SelectionSet",
2571
+ selections: [
2572
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2573
+ { kind: "Field", name: { kind: "Name", value: "slug" } },
2574
+ { kind: "Field", name: { kind: "Name", value: "emoji" } },
2575
+ { kind: "Field", name: { kind: "Name", value: "title" } },
2576
+ { kind: "Field", name: { kind: "Name", value: "draft" } },
2577
+ { kind: "Field", name: { kind: "Name", value: "path" } },
2578
+ {
2579
+ kind: "Field",
2580
+ name: { kind: "Name", value: "tags" },
2581
+ selectionSet: {
2582
+ kind: "SelectionSet",
2583
+ selections: [
2584
+ {
2585
+ kind: "Field",
2586
+ name: { kind: "Name", value: "edges" },
2587
+ selectionSet: {
2588
+ kind: "SelectionSet",
2589
+ selections: [
2590
+ {
2591
+ kind: "Field",
2592
+ name: { kind: "Name", value: "node" },
2593
+ selectionSet: {
2594
+ kind: "SelectionSet",
2595
+ selections: [
2596
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2597
+ { kind: "Field", name: { kind: "Name", value: "name" } }
2598
+ ]
2599
+ }
2600
+ }
2601
+ ]
2602
+ }
2603
+ }
2604
+ ]
2605
+ }
2606
+ },
2607
+ { kind: "Field", name: { kind: "Name", value: "publishedAt" } },
2608
+ { kind: "Field", name: { kind: "Name", value: "modifiedAt" } }
2609
+ ]
2610
+ }
2611
+ }
2612
+ ]
2613
+ }
2614
+ }
2615
+ ]
2616
+ }
2617
+ },
2618
+ {
2619
+ kind: "Field",
2620
+ name: { kind: "Name", value: "websites" },
2621
+ selectionSet: {
2622
+ kind: "SelectionSet",
2623
+ selections: [
2624
+ {
2625
+ kind: "Field",
2626
+ name: { kind: "Name", value: "edges" },
2627
+ selectionSet: {
2628
+ kind: "SelectionSet",
2629
+ selections: [
2630
+ {
2631
+ kind: "Field",
2632
+ name: { kind: "Name", value: "node" },
2633
+ selectionSet: {
2634
+ kind: "SelectionSet",
2635
+ selections: [
2636
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2637
+ { kind: "Field", name: { kind: "Name", value: "url" } },
2638
+ { kind: "Field", name: { kind: "Name", value: "domain" } },
2639
+ { kind: "Field", name: { kind: "Name", value: "title" } },
2640
+ { kind: "Field", name: { kind: "Name", value: "description" } },
2641
+ { kind: "Field", name: { kind: "Name", value: "ogSiteName" } },
2642
+ { kind: "Field", name: { kind: "Name", value: "ogTitle" } },
2643
+ { kind: "Field", name: { kind: "Name", value: "ogType" } },
2644
+ { kind: "Field", name: { kind: "Name", value: "ogUrl" } },
2645
+ { kind: "Field", name: { kind: "Name", value: "ogDescription" } },
2646
+ { kind: "Field", name: { kind: "Name", value: "ogLocale" } },
2647
+ {
2648
+ kind: "Field",
2649
+ name: { kind: "Name", value: "ogImage" },
2650
+ selectionSet: {
2651
+ kind: "SelectionSet",
2652
+ selections: [
2653
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2654
+ { kind: "Field", name: { kind: "Name", value: "fileUrl" } },
2655
+ { kind: "Field", name: { kind: "Name", value: "width" } },
2656
+ { kind: "Field", name: { kind: "Name", value: "height" } }
2657
+ ]
2658
+ }
2659
+ }
2660
+ ]
2661
+ }
2662
+ }
2663
+ ]
2664
+ }
2665
+ }
2666
+ ]
2667
+ }
2668
+ }
2669
+ ]
2670
+ }
2671
+ }
2672
+ ]
2673
+ }
2674
+ }
2675
+ ]
2676
+ };
2677
+ var DocumentsDocument = {
2678
+ kind: "Document",
2679
+ definitions: [
2680
+ {
2681
+ kind: "OperationDefinition",
2682
+ operation: "query",
2683
+ name: { kind: "Name", value: "documents" },
2684
+ variableDefinitions: [
2685
+ {
2686
+ kind: "VariableDefinition",
2687
+ variable: { kind: "Variable", name: { kind: "Name", value: "after" } },
2688
+ type: { kind: "NamedType", name: { kind: "Name", value: "String" } }
2689
+ },
2690
+ {
2691
+ kind: "VariableDefinition",
2692
+ variable: { kind: "Variable", name: { kind: "Name", value: "first" } },
2693
+ type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }
2694
+ },
2695
+ {
2696
+ kind: "VariableDefinition",
2697
+ variable: { kind: "Variable", name: { kind: "Name", value: "filter" } },
2698
+ type: { kind: "NamedType", name: { kind: "Name", value: "DocumentConnectionFilter" } }
2699
+ },
2700
+ {
2701
+ kind: "VariableDefinition",
2702
+ variable: { kind: "Variable", name: { kind: "Name", value: "sort" } },
2703
+ type: { kind: "NamedType", name: { kind: "Name", value: "ConnectionSort" } }
2704
+ }
2705
+ ],
2706
+ selectionSet: {
2707
+ kind: "SelectionSet",
2708
+ selections: [
2709
+ {
2710
+ kind: "Field",
2711
+ name: { kind: "Name", value: "documents" },
2712
+ arguments: [
2713
+ {
2714
+ kind: "Argument",
2715
+ name: { kind: "Name", value: "after" },
2716
+ value: { kind: "Variable", name: { kind: "Name", value: "after" } }
2717
+ },
2718
+ {
2719
+ kind: "Argument",
2720
+ name: { kind: "Name", value: "first" },
2721
+ value: { kind: "Variable", name: { kind: "Name", value: "first" } }
2722
+ },
2723
+ {
2724
+ kind: "Argument",
2725
+ name: { kind: "Name", value: "filter" },
2726
+ value: { kind: "Variable", name: { kind: "Name", value: "filter" } }
2727
+ },
2728
+ {
2729
+ kind: "Argument",
2730
+ name: { kind: "Name", value: "sort" },
2731
+ value: { kind: "Variable", name: { kind: "Name", value: "sort" } }
2732
+ }
2733
+ ],
2734
+ selectionSet: {
2735
+ kind: "SelectionSet",
2736
+ selections: [
2737
+ { kind: "Field", name: { kind: "Name", value: "totalCount" } },
2738
+ {
2739
+ kind: "Field",
2740
+ name: { kind: "Name", value: "edges" },
2741
+ selectionSet: {
2742
+ kind: "SelectionSet",
2743
+ selections: [
2744
+ {
2745
+ kind: "Field",
2746
+ name: { kind: "Name", value: "node" },
2747
+ selectionSet: {
2748
+ kind: "SelectionSet",
2749
+ selections: [
2750
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2751
+ { kind: "Field", name: { kind: "Name", value: "slug" } },
2752
+ { kind: "Field", name: { kind: "Name", value: "emoji" } },
2753
+ { kind: "Field", name: { kind: "Name", value: "title" } },
2754
+ { kind: "Field", name: { kind: "Name", value: "draft" } },
2755
+ { kind: "Field", name: { kind: "Name", value: "path" } },
2756
+ {
2757
+ kind: "Field",
2758
+ name: { kind: "Name", value: "tags" },
2759
+ selectionSet: {
2760
+ kind: "SelectionSet",
2761
+ selections: [
2762
+ {
2763
+ kind: "Field",
2764
+ name: { kind: "Name", value: "edges" },
2765
+ selectionSet: {
2766
+ kind: "SelectionSet",
2767
+ selections: [
2768
+ {
2769
+ kind: "Field",
2770
+ name: { kind: "Name", value: "node" },
2771
+ selectionSet: {
2772
+ kind: "SelectionSet",
2773
+ selections: [
2774
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2775
+ { kind: "Field", name: { kind: "Name", value: "name" } }
2776
+ ]
2777
+ }
2778
+ }
2779
+ ]
2780
+ }
2781
+ }
2782
+ ]
2783
+ }
2784
+ },
2785
+ {
2786
+ kind: "Field",
2787
+ name: { kind: "Name", value: "preview" },
2788
+ selectionSet: {
2789
+ kind: "SelectionSet",
2790
+ selections: [
2791
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2792
+ { kind: "Field", name: { kind: "Name", value: "width" } },
2793
+ { kind: "Field", name: { kind: "Name", value: "height" } },
2794
+ { kind: "Field", name: { kind: "Name", value: "path" } },
2795
+ { kind: "Field", name: { kind: "Name", value: "fileUrl" } }
2796
+ ]
2797
+ }
2798
+ },
2799
+ { kind: "Field", name: { kind: "Name", value: "publishedAt" } },
2800
+ { kind: "Field", name: { kind: "Name", value: "modifiedAt" } }
2801
+ ]
2802
+ }
2803
+ }
2804
+ ]
2805
+ }
2806
+ }
2807
+ ]
2808
+ }
2809
+ }
2810
+ ]
2811
+ }
2812
+ }
2813
+ ]
2814
+ };
2815
+ var TagDocument = {
2816
+ kind: "Document",
2817
+ definitions: [
2818
+ {
2819
+ kind: "OperationDefinition",
2820
+ operation: "query",
2821
+ name: { kind: "Name", value: "tag" },
2822
+ variableDefinitions: [
2823
+ {
2824
+ kind: "VariableDefinition",
2825
+ variable: { kind: "Variable", name: { kind: "Name", value: "name" } },
2826
+ type: { kind: "NamedType", name: { kind: "Name", value: "String" } }
2827
+ }
2828
+ ],
2829
+ selectionSet: {
2830
+ kind: "SelectionSet",
2831
+ selections: [
2832
+ {
2833
+ kind: "Field",
2834
+ name: { kind: "Name", value: "tag" },
2835
+ arguments: [
2836
+ {
2837
+ kind: "Argument",
2838
+ name: { kind: "Name", value: "name" },
2839
+ value: { kind: "Variable", name: { kind: "Name", value: "name" } }
2840
+ }
2841
+ ],
2842
+ selectionSet: {
2843
+ kind: "SelectionSet",
2844
+ selections: [
2845
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2846
+ { kind: "Field", name: { kind: "Name", value: "name" } },
2847
+ { kind: "Field", name: { kind: "Name", value: "documentCount" } },
2848
+ { kind: "Field", name: { kind: "Name", value: "documentCountInPublished" } },
2849
+ {
2850
+ kind: "Field",
2851
+ name: { kind: "Name", value: "relatedTags" },
2852
+ selectionSet: {
2853
+ kind: "SelectionSet",
2854
+ selections: [
2855
+ {
2856
+ kind: "Field",
2857
+ name: { kind: "Name", value: "edges" },
2858
+ selectionSet: {
2859
+ kind: "SelectionSet",
2860
+ selections: [
2861
+ {
2862
+ kind: "Field",
2863
+ name: { kind: "Name", value: "node" },
2864
+ selectionSet: {
2865
+ kind: "SelectionSet",
2866
+ selections: [
2867
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2868
+ { kind: "Field", name: { kind: "Name", value: "name" } },
2869
+ { kind: "Field", name: { kind: "Name", value: "documentCount" } },
2870
+ { kind: "Field", name: { kind: "Name", value: "documentCountInPublished" } }
2871
+ ]
2872
+ }
2873
+ }
2874
+ ]
2875
+ }
2876
+ }
2877
+ ]
2878
+ }
2879
+ }
2880
+ ]
2881
+ }
2882
+ }
2883
+ ]
2884
+ }
2885
+ }
2886
+ ]
2887
+ };
2888
+ var TagsDocument = {
2889
+ kind: "Document",
2890
+ definitions: [
2891
+ {
2892
+ kind: "OperationDefinition",
2893
+ operation: "query",
2894
+ name: { kind: "Name", value: "tags" },
2895
+ variableDefinitions: [
2896
+ {
2897
+ kind: "VariableDefinition",
2898
+ variable: { kind: "Variable", name: { kind: "Name", value: "sort" } },
2899
+ type: { kind: "NamedType", name: { kind: "Name", value: "ConnectionSort" } }
2900
+ }
2901
+ ],
2902
+ selectionSet: {
2903
+ kind: "SelectionSet",
2904
+ selections: [
2905
+ {
2906
+ kind: "Field",
2907
+ name: { kind: "Name", value: "tags" },
2908
+ arguments: [
2909
+ {
2910
+ kind: "Argument",
2911
+ name: { kind: "Name", value: "sort" },
2912
+ value: { kind: "Variable", name: { kind: "Name", value: "sort" } }
2913
+ }
2914
+ ],
2915
+ selectionSet: {
2916
+ kind: "SelectionSet",
2917
+ selections: [
2918
+ { kind: "Field", name: { kind: "Name", value: "totalCount" } },
2919
+ {
2920
+ kind: "Field",
2921
+ name: { kind: "Name", value: "edges" },
2922
+ selectionSet: {
2923
+ kind: "SelectionSet",
2924
+ selections: [
2925
+ {
2926
+ kind: "Field",
2927
+ name: { kind: "Name", value: "node" },
2928
+ selectionSet: {
2929
+ kind: "SelectionSet",
2930
+ selections: [
2931
+ { kind: "Field", name: { kind: "Name", value: "id" } },
2932
+ { kind: "Field", name: { kind: "Name", value: "name" } },
2933
+ { kind: "Field", name: { kind: "Name", value: "documentCount" } },
2934
+ { kind: "Field", name: { kind: "Name", value: "documentCountInPublished" } }
2935
+ ]
2936
+ }
2937
+ }
2938
+ ]
2939
+ }
2940
+ }
2941
+ ]
2942
+ }
2943
+ }
2944
+ ]
2945
+ }
2946
+ }
2947
+ ]
2948
+ };
2949
+ var WebsitesDocument = {
2950
+ kind: "Document",
2951
+ definitions: [
2952
+ {
2953
+ kind: "OperationDefinition",
2954
+ operation: "query",
2955
+ name: { kind: "Name", value: "websites" },
2956
+ variableDefinitions: [
2957
+ {
2958
+ kind: "VariableDefinition",
2959
+ variable: { kind: "Variable", name: { kind: "Name", value: "after" } },
2960
+ type: { kind: "NamedType", name: { kind: "Name", value: "String" } }
2961
+ },
2962
+ {
2963
+ kind: "VariableDefinition",
2964
+ variable: { kind: "Variable", name: { kind: "Name", value: "first" } },
2965
+ type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }
2966
+ }
2967
+ ],
2968
+ selectionSet: {
2969
+ kind: "SelectionSet",
2970
+ selections: [
2971
+ {
2972
+ kind: "Field",
2973
+ name: { kind: "Name", value: "websites" },
2974
+ arguments: [
2975
+ {
2976
+ kind: "Argument",
2977
+ name: { kind: "Name", value: "after" },
2978
+ value: { kind: "Variable", name: { kind: "Name", value: "after" } }
2979
+ },
2980
+ {
2981
+ kind: "Argument",
2982
+ name: { kind: "Name", value: "first" },
2983
+ value: { kind: "Variable", name: { kind: "Name", value: "first" } }
2984
+ }
2985
+ ],
2986
+ selectionSet: {
2987
+ kind: "SelectionSet",
2988
+ selections: [
2989
+ { kind: "Field", name: { kind: "Name", value: "totalCount" } },
2990
+ {
2991
+ kind: "Field",
2992
+ name: { kind: "Name", value: "edges" },
2993
+ selectionSet: {
2994
+ kind: "SelectionSet",
2995
+ selections: [
2996
+ {
2997
+ kind: "Field",
2998
+ name: { kind: "Name", value: "node" },
2999
+ selectionSet: {
3000
+ kind: "SelectionSet",
3001
+ selections: [
3002
+ { kind: "Field", name: { kind: "Name", value: "id" } },
3003
+ { kind: "Field", name: { kind: "Name", value: "url" } },
3004
+ { kind: "Field", name: { kind: "Name", value: "domain" } },
3005
+ { kind: "Field", name: { kind: "Name", value: "title" } },
3006
+ { kind: "Field", name: { kind: "Name", value: "description" } },
3007
+ { kind: "Field", name: { kind: "Name", value: "ogSiteName" } },
3008
+ { kind: "Field", name: { kind: "Name", value: "ogTitle" } },
3009
+ { kind: "Field", name: { kind: "Name", value: "ogType" } },
3010
+ { kind: "Field", name: { kind: "Name", value: "ogUrl" } },
3011
+ { kind: "Field", name: { kind: "Name", value: "ogDescription" } },
3012
+ { kind: "Field", name: { kind: "Name", value: "ogLocale" } },
3013
+ {
3014
+ kind: "Field",
3015
+ name: { kind: "Name", value: "ogImage" },
3016
+ selectionSet: {
3017
+ kind: "SelectionSet",
3018
+ selections: [
3019
+ { kind: "Field", name: { kind: "Name", value: "id" } },
3020
+ { kind: "Field", name: { kind: "Name", value: "fileUrl" } },
3021
+ { kind: "Field", name: { kind: "Name", value: "width" } },
3022
+ { kind: "Field", name: { kind: "Name", value: "height" } }
3023
+ ]
3024
+ }
3025
+ },
3026
+ {
3027
+ kind: "Field",
3028
+ name: { kind: "Name", value: "documents" },
3029
+ selectionSet: {
3030
+ kind: "SelectionSet",
3031
+ selections: [
3032
+ {
3033
+ kind: "Field",
3034
+ name: { kind: "Name", value: "edges" },
3035
+ selectionSet: {
3036
+ kind: "SelectionSet",
3037
+ selections: [
3038
+ {
3039
+ kind: "Field",
3040
+ name: { kind: "Name", value: "node" },
3041
+ selectionSet: {
3042
+ kind: "SelectionSet",
3043
+ selections: [
3044
+ { kind: "Field", name: { kind: "Name", value: "id" } },
3045
+ { kind: "Field", name: { kind: "Name", value: "draft" } },
3046
+ { kind: "Field", name: { kind: "Name", value: "title" } },
3047
+ { kind: "Field", name: { kind: "Name", value: "slug" } }
3048
+ ]
3049
+ }
3050
+ }
3051
+ ]
3052
+ }
3053
+ }
3054
+ ]
3055
+ }
3056
+ }
3057
+ ]
3058
+ }
3059
+ }
3060
+ ]
3061
+ }
3062
+ }
3063
+ ]
3064
+ }
3065
+ }
3066
+ ]
3067
+ }
3068
+ }
3069
+ ]
3070
+ };
3071
+
3072
+ // src/gql/gql.ts
3073
+ var documents = {
3074
+ "\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n": DocumentDocument,
3075
+ "\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n": DocumentsDocument,
3076
+ "\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n": TagDocument,
3077
+ "\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n": TagsDocument,
3078
+ "\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n": WebsitesDocument
3079
+ };
3080
+ function graphql(source) {
3081
+ return documents[source] ?? {};
3082
+ }
3083
+
3084
+ // src/utils/non-nullable-filter.ts
3085
+ var nonNullableFilter = (value2) => value2 != null;
3086
+
3087
+ // src/utils/to-array-from-edges.ts
3088
+ function toArrayFromEdges(edges) {
3089
+ if (!edges) return [];
3090
+ return edges.map((edge) => edge?.node).filter(nonNullableFilter) ?? [];
3091
+ }
3092
+
3093
+ // src/client/operations/get-document.ts
3094
+ graphql(`
3095
+ query document($slug: String) {
3096
+ document(slug: $slug) {
3097
+ id
3098
+ slug
3099
+ emoji
3100
+ title
3101
+ draft
3102
+ content
3103
+ path
3104
+ tags {
3105
+ edges {
3106
+ node {
3107
+ id
3108
+ name
3109
+ }
3110
+ }
3111
+ }
3112
+ preview {
3113
+ id
3114
+ width
3115
+ height
3116
+ path
3117
+ fileUrl
3118
+ }
3119
+ publishedAt
3120
+ modifiedAt
3121
+ assets {
3122
+ edges {
3123
+ node {
3124
+ id
3125
+ path
3126
+ name
3127
+ fileUrl
3128
+ height
3129
+ width
3130
+ }
3131
+ }
3132
+ }
3133
+ outboundLinkDocuments {
3134
+ edges {
3135
+ node {
3136
+ id
3137
+ slug
3138
+ emoji
3139
+ title
3140
+ draft
3141
+ path
3142
+ tags {
3143
+ edges {
3144
+ node {
3145
+ id
3146
+ name
3147
+ }
3148
+ }
3149
+ }
3150
+ publishedAt
3151
+ modifiedAt
3152
+ }
3153
+ }
3154
+ }
3155
+ inboundLinkDocuments {
3156
+ edges {
3157
+ node {
3158
+ id
3159
+ slug
3160
+ emoji
3161
+ title
3162
+ draft
3163
+ path
3164
+ tags {
3165
+ edges {
3166
+ node {
3167
+ id
3168
+ name
3169
+ }
3170
+ }
3171
+ }
3172
+ publishedAt
3173
+ modifiedAt
3174
+ }
3175
+ }
3176
+ }
3177
+ websites {
3178
+ edges {
3179
+ node {
3180
+ id
3181
+ url
3182
+ domain
3183
+ title
3184
+ description
3185
+ ogSiteName
3186
+ ogTitle
3187
+ ogType
3188
+ ogUrl
3189
+ ogDescription
3190
+ ogLocale
3191
+ ogImage {
3192
+ id
3193
+ fileUrl
3194
+ width
3195
+ height
3196
+ }
3197
+ }
3198
+ }
3199
+ }
3200
+ }
3201
+ }
3202
+ `);
3203
+ function makeGetDocumentResponse(result) {
3204
+ if (!result.data?.document) {
3205
+ return { document: null, error: result.error };
3206
+ }
3207
+ const tmpDoc = result.data?.document;
3208
+ const document = {
3209
+ ...tmpDoc,
3210
+ tags: toArrayFromEdges(tmpDoc.tags?.edges),
3211
+ assets: toArrayFromEdges(tmpDoc.assets?.edges),
3212
+ outboundLinkDocuments: toArrayFromEdges(tmpDoc.outboundLinkDocuments?.edges).map((doc) => ({
3213
+ ...doc,
3214
+ tags: toArrayFromEdges(doc.tags?.edges)
3215
+ })),
3216
+ inboundLinkDocuments: toArrayFromEdges(tmpDoc.inboundLinkDocuments?.edges).map((doc) => ({
3217
+ ...doc,
3218
+ tags: toArrayFromEdges(doc.tags?.edges)
3219
+ })),
3220
+ websites: toArrayFromEdges(tmpDoc.websites?.edges)
3221
+ };
3222
+ const error2 = result.error;
3223
+ return { document, error: error2 };
3224
+ }
3225
+
3226
+ // src/client/operations/get-documents.ts
3227
+ graphql(`
3228
+ query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {
3229
+ documents(after: $after, first: $first, filter: $filter, sort: $sort) {
3230
+ totalCount
3231
+ edges {
3232
+ node {
3233
+ id
3234
+ slug
3235
+ emoji
3236
+ title
3237
+ draft
3238
+ path
3239
+ tags {
3240
+ edges {
3241
+ node {
3242
+ id
3243
+ name
3244
+ }
3245
+ }
3246
+ }
3247
+ preview {
3248
+ id
3249
+ width
3250
+ height
3251
+ path
3252
+ fileUrl
3253
+ }
3254
+ publishedAt
3255
+ modifiedAt
3256
+ }
3257
+ }
3258
+ }
3259
+ }
3260
+ `);
3261
+ function makeGetDocumentsResponse(result) {
3262
+ if (!result.data || !result.data.documents) {
3263
+ return { documents: [], totalCount: 0, isEmpty: true, error: result.error };
3264
+ }
3265
+ const tmpDocs = result.data.documents;
3266
+ const documents2 = toArrayFromEdges(tmpDocs?.edges).map((document) => ({
3267
+ ...document,
3268
+ tags: toArrayFromEdges(document.tags?.edges)
3269
+ }));
3270
+ const totalCount = result.data?.documents?.totalCount || 0;
3271
+ const isEmpty = totalCount === 0;
3272
+ const error2 = result.error;
3273
+ return { documents: documents2, totalCount, isEmpty, error: error2 };
3274
+ }
3275
+
3276
+ // src/client/operations/get-tag.ts
3277
+ graphql(`
3278
+ query tag($name: String) {
3279
+ tag(name: $name) {
3280
+ id
3281
+ name
3282
+ documentCount
3283
+ documentCountInPublished
3284
+ relatedTags {
3285
+ edges {
3286
+ node {
3287
+ id
3288
+ name
3289
+ documentCount
3290
+ documentCountInPublished
3291
+ }
3292
+ }
3293
+ }
3294
+ }
3295
+ }
3296
+ `);
3297
+ function makeGetTagResponse(result) {
3298
+ const tmpTag = result.data?.tag;
3299
+ const tag = tmpTag ? { ...tmpTag, relatedTags: toArrayFromEdges(tmpTag.relatedTags?.edges) } : null;
3300
+ const error2 = result.error;
3301
+ return { tag, error: error2 };
3302
+ }
3303
+
3304
+ // src/client/operations/get-tags.ts
3305
+ graphql(`
3306
+ query tags($sort: ConnectionSort) {
3307
+ tags(sort: $sort) {
3308
+ totalCount
3309
+ edges {
3310
+ node {
3311
+ id
3312
+ name
3313
+ documentCount
3314
+ documentCountInPublished
3315
+ }
3316
+ }
3317
+ }
3318
+ }
3319
+ `);
3320
+ function makeGetTagsResponse(result) {
3321
+ const tags = toArrayFromEdges(result.data?.tags?.edges);
3322
+ const totalCount = result.data?.tags?.totalCount || 0;
3323
+ const isEmpty = totalCount === 0;
3324
+ const error2 = result.error;
3325
+ return { tags, totalCount, isEmpty, error: error2 };
3326
+ }
3327
+
3328
+ // src/client/operations/get-websites.ts
3329
+ graphql(`
3330
+ query websites($after: String, $first: Int) {
3331
+ websites(after: $after, first: $first) {
3332
+ totalCount
3333
+ edges {
3334
+ node {
3335
+ id
3336
+ url
3337
+ domain
3338
+ title
3339
+ description
3340
+ ogSiteName
3341
+ ogTitle
3342
+ ogType
3343
+ ogUrl
3344
+ ogDescription
3345
+ ogLocale
3346
+ ogImage {
3347
+ id
3348
+ fileUrl
3349
+ width
3350
+ height
3351
+ }
3352
+ documents {
3353
+ edges {
3354
+ node {
3355
+ id
3356
+ draft
3357
+ title
3358
+ slug
3359
+ }
3360
+ }
3361
+ }
3362
+ }
3363
+ }
3364
+ }
3365
+ }
3366
+ `);
3367
+ function makeGetWebsitesResponse(result) {
3368
+ const websites = toArrayFromEdges(result.data?.websites?.edges).map((website) => ({
3369
+ ...website,
3370
+ documents: toArrayFromEdges(website.documents?.edges)
3371
+ }));
3372
+ const totalCount = result.data?.websites?.totalCount || 0;
3373
+ const isEmpty = totalCount === 0;
3374
+ const error2 = result.error;
3375
+ return { websites, totalCount, isEmpty, error: error2 };
3376
+ }
3377
+
3378
+ // src/client/client.ts
3379
+ var Client2 = class {
3380
+ url;
3381
+ accessKey;
3382
+ urqlClient;
3383
+ constructor(options) {
3384
+ this.url = options.url;
3385
+ this.accessKey = options.accessKey;
3386
+ this.urqlClient = options.urqlClient ?? this.createUrqlClient();
3387
+ }
3388
+ async getDocument(args) {
3389
+ const result = await this.urqlClient.query(DocumentDocument, args);
3390
+ return makeGetDocumentResponse(result);
3391
+ }
3392
+ async getDocuments(args) {
3393
+ const result = await this.urqlClient.query(DocumentsDocument, args ?? {});
3394
+ return makeGetDocumentsResponse(result);
3395
+ }
3396
+ async getTag(args) {
3397
+ const result = await this.urqlClient.query(TagDocument, args);
3398
+ return makeGetTagResponse(result);
3399
+ }
3400
+ async getTags(args) {
3401
+ const result = await this.urqlClient.query(TagsDocument, args ?? {});
3402
+ return makeGetTagsResponse(result);
3403
+ }
3404
+ async getWebsites(args) {
3405
+ const result = await this.urqlClient.query(WebsitesDocument, args ?? {});
3406
+ return makeGetWebsitesResponse(result);
3407
+ }
3408
+ createUrqlClient() {
3409
+ return Q({
3410
+ url: this.url,
3411
+ exchanges: [cacheExchange, fetchExchange],
3412
+ fetchOptions: {
3413
+ headers: {
3414
+ Authorization: `bearer ${this.accessKey}`
3415
+ },
3416
+ cache: "no-store"
3417
+ }
3418
+ });
3419
+ }
3420
+ };
3421
+
3422
+ // src/client/create-client.ts
3423
+ function createClient(options) {
3424
+ return new Client2(options);
3425
+ }
3426
+ // Annotate the CommonJS export names for ESM import in node:
3427
+ 0 && (module.exports = {
3428
+ createClient
3429
+ });