@noxickon/onyx 0.0.4-dev.5 → 0.0.4-dev.8

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.
@@ -1,24 +1,23 @@
1
- import { j as te } from "./jsx-runtime--oOP9f8K.js";
2
- import { createContext as ne, useState as ie, useEffect as se, useContext as re } from "react";
3
- import { _ as M, u as oe } from "./useQuery-BvCyJMae.js";
1
+ import { _ as M } from "./tslib.es6-ci7D5hcx.js";
2
+ import { createContext as ee } from "react";
4
3
  function L(e, t) {
5
4
  if (!!!e)
6
5
  throw new Error(t);
7
6
  }
8
- function ae(e) {
7
+ function te(e) {
9
8
  return typeof e == "object" && e !== null;
10
9
  }
11
- function ce(e, t) {
10
+ function ne(e, t) {
12
11
  if (!!!e)
13
12
  throw new Error(
14
13
  "Unexpected invariant triggered."
15
14
  );
16
15
  }
17
- const ue = /\r\n|[\n\r]/g;
16
+ const ie = /\r\n|[\n\r]/g;
18
17
  function F(e, t) {
19
18
  let n = 0, s = 1;
20
- for (const i of e.body.matchAll(ue)) {
21
- if (typeof i.index == "number" || ce(!1), i.index >= t)
19
+ for (const i of e.body.matchAll(ie)) {
20
+ if (typeof i.index == "number" || ne(!1), i.index >= t)
22
21
  break;
23
22
  n = i.index + i[0].length, s += 1;
24
23
  }
@@ -27,32 +26,32 @@ function F(e, t) {
27
26
  column: t + 1 - n
28
27
  };
29
28
  }
30
- function le(e) {
29
+ function se(e) {
31
30
  return G(
32
31
  e.source,
33
32
  F(e.source, e.start)
34
33
  );
35
34
  }
36
35
  function G(e, t) {
37
- const n = e.locationOffset.column - 1, s = "".padStart(n) + e.body, i = t.line - 1, r = e.locationOffset.line - 1, a = t.line + r, u = t.line === 1 ? n : 0, l = t.column + u, f = `${e.name}:${a}:${l}
38
- `, h = s.split(/\r\n|[\n\r]/g), N = h[i];
36
+ const n = e.locationOffset.column - 1, s = "".padStart(n) + e.body, i = t.line - 1, r = e.locationOffset.line - 1, a = t.line + r, u = t.line === 1 ? n : 0, l = t.column + u, E = `${e.name}:${a}:${l}
37
+ `, p = s.split(/\r\n|[\n\r]/g), N = p[i];
39
38
  if (N.length > 120) {
40
- const m = Math.floor(l / 80), b = l % 80, E = [];
41
- for (let x = 0; x < N.length; x += 80)
42
- E.push(N.slice(x, x + 80));
43
- return f + V([
44
- [`${a} |`, E[0]],
45
- ...E.slice(1, m + 1).map((x) => ["|", x]),
39
+ const m = Math.floor(l / 80), b = l % 80, f = [];
40
+ for (let I = 0; I < N.length; I += 80)
41
+ f.push(N.slice(I, I + 80));
42
+ return E + V([
43
+ [`${a} |`, f[0]],
44
+ ...f.slice(1, m + 1).map((I) => ["|", I]),
46
45
  ["|", "^".padStart(b)],
47
- ["|", E[m + 1]]
46
+ ["|", f[m + 1]]
48
47
  ]);
49
48
  }
50
- return f + V([
49
+ return E + V([
51
50
  // Lines specified like this: ["prefix", "string"],
52
- [`${a - 1} |`, h[i - 1]],
51
+ [`${a - 1} |`, p[i - 1]],
53
52
  [`${a} |`, N],
54
53
  ["|", "^".padStart(l)],
55
- [`${a + 1} |`, h[i + 1]]
54
+ [`${a + 1} |`, p[i + 1]]
56
55
  ]);
57
56
  }
58
57
  function V(e) {
@@ -60,7 +59,7 @@ function V(e) {
60
59
  return t.map(([s, i]) => s.padStart(n) + (i ? " " + i : "")).join(`
61
60
  `);
62
61
  }
63
- function he(e) {
62
+ function re(e) {
64
63
  const t = e[0];
65
64
  return t == null || "kind" in t || "length" in t ? {
66
65
  nodes: t,
@@ -112,17 +111,17 @@ class U extends Error {
112
111
  */
113
112
  constructor(t, ...n) {
114
113
  var s, i, r;
115
- const { nodes: a, source: u, positions: l, path: f, originalError: h, extensions: N } = he(n);
116
- super(t), this.name = "GraphQLError", this.path = f ?? void 0, this.originalError = h ?? void 0, this.nodes = B(
114
+ const { nodes: a, source: u, positions: l, path: E, originalError: p, extensions: N } = re(n);
115
+ super(t), this.name = "GraphQLError", this.path = E ?? void 0, this.originalError = p ?? void 0, this.nodes = B(
117
116
  Array.isArray(a) ? a : a ? [a] : void 0
118
117
  );
119
118
  const m = B(
120
- (s = this.nodes) === null || s === void 0 ? void 0 : s.map((E) => E.loc).filter((E) => E != null)
119
+ (s = this.nodes) === null || s === void 0 ? void 0 : s.map((f) => f.loc).filter((f) => f != null)
121
120
  );
122
- this.source = u ?? (m == null || (i = m[0]) === null || i === void 0 ? void 0 : i.source), this.positions = l ?? m?.map((E) => E.start), this.locations = l && u ? l.map((E) => F(u, E)) : m?.map((E) => F(E.source, E.start));
123
- const b = ae(
124
- h?.extensions
125
- ) ? h?.extensions : void 0;
121
+ this.source = u ?? (m == null || (i = m[0]) === null || i === void 0 ? void 0 : i.source), this.positions = l ?? m?.map((f) => f.start), this.locations = l && u ? l.map((f) => F(u, f)) : m?.map((f) => F(f.source, f.start));
122
+ const b = te(
123
+ p?.extensions
124
+ ) ? p?.extensions : void 0;
126
125
  this.extensions = (r = N ?? b) !== null && r !== void 0 ? r : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
127
126
  message: {
128
127
  writable: !0,
@@ -143,8 +142,8 @@ class U extends Error {
143
142
  originalError: {
144
143
  enumerable: !1
145
144
  }
146
- }), h != null && h.stack ? Object.defineProperty(this, "stack", {
147
- value: h.stack,
145
+ }), p != null && p.stack ? Object.defineProperty(this, "stack", {
146
+ value: p.stack,
148
147
  writable: !0,
149
148
  configurable: !0
150
149
  }) : Error.captureStackTrace ? Error.captureStackTrace(this, U) : Object.defineProperty(this, "stack", {
@@ -162,7 +161,7 @@ class U extends Error {
162
161
  for (const n of this.nodes)
163
162
  n.loc && (t += `
164
163
 
165
- ` + le(n.loc));
164
+ ` + se(n.loc));
166
165
  else if (this.source && this.locations)
167
166
  for (const n of this.locations)
168
167
  t += `
@@ -186,7 +185,7 @@ function d(e, t, n) {
186
185
  positions: [t]
187
186
  });
188
187
  }
189
- class pe {
188
+ class oe {
190
189
  /**
191
190
  * The character offset at which this Node begins.
192
191
  */
@@ -257,7 +256,7 @@ class Y {
257
256
  };
258
257
  }
259
258
  }
260
- const de = {
259
+ const ae = {
261
260
  Name: [],
262
261
  Document: ["definitions"],
263
262
  OperationDefinition: [
@@ -332,11 +331,11 @@ const de = {
332
331
  EnumTypeExtension: ["name", "directives", "values"],
333
332
  InputObjectTypeExtension: ["name", "directives", "fields"]
334
333
  };
335
- new Set(Object.keys(de));
336
- var I;
334
+ new Set(Object.keys(ae));
335
+ var x;
337
336
  (function(e) {
338
337
  e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
339
- })(I || (I = {}));
338
+ })(x || (x = {}));
340
339
  var w;
341
340
  (function(e) {
342
341
  e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
@@ -345,10 +344,10 @@ var c;
345
344
  (function(e) {
346
345
  e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
347
346
  })(c || (c = {}));
348
- function fe(e) {
347
+ function ce(e) {
349
348
  return e === 9 || e === 32;
350
349
  }
351
- function g(e) {
350
+ function D(e) {
352
351
  return e >= 48 && e <= 57;
353
352
  }
354
353
  function $(e) {
@@ -358,15 +357,15 @@ function $(e) {
358
357
  function J(e) {
359
358
  return $(e) || e === 95;
360
359
  }
361
- function Ee(e) {
362
- return $(e) || g(e) || e === 95;
360
+ function ue(e) {
361
+ return $(e) || D(e) || e === 95;
363
362
  }
364
- function me(e) {
363
+ function le(e) {
365
364
  var t;
366
365
  let n = Number.MAX_SAFE_INTEGER, s = null, i = -1;
367
366
  for (let a = 0; a < e.length; ++a) {
368
367
  var r;
369
- const u = e[a], l = Ne(u);
368
+ const u = e[a], l = he(u);
370
369
  l !== u.length && (s = (r = s) !== null && r !== void 0 ? r : a, i = a, a !== 0 && l < n && (n = l));
371
370
  }
372
371
  return e.map((a, u) => u === 0 ? a : a.slice(n)).slice(
@@ -374,9 +373,9 @@ function me(e) {
374
373
  i + 1
375
374
  );
376
375
  }
377
- function Ne(e) {
376
+ function he(e) {
378
377
  let t = 0;
379
- for (; t < e.length && fe(e.charCodeAt(t)); )
378
+ for (; t < e.length && ce(e.charCodeAt(t)); )
380
379
  ++t;
381
380
  return t;
382
381
  }
@@ -384,7 +383,7 @@ var o;
384
383
  (function(e) {
385
384
  e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
386
385
  })(o || (o = {}));
387
- class Te {
386
+ class pe {
388
387
  /**
389
388
  * The previously focused non-ignored token.
390
389
  */
@@ -421,26 +420,26 @@ class Te {
421
420
  if (t.next)
422
421
  t = t.next;
423
422
  else {
424
- const n = Ie(this, t.end);
423
+ const n = fe(this, t.end);
425
424
  t.next = n, n.prev = t, t = n;
426
425
  }
427
426
  while (t.kind === o.COMMENT);
428
427
  return t;
429
428
  }
430
429
  }
431
- function xe(e) {
430
+ function de(e) {
432
431
  return e === o.BANG || e === o.DOLLAR || e === o.AMP || e === o.PAREN_L || e === o.PAREN_R || e === o.SPREAD || e === o.COLON || e === o.EQUALS || e === o.AT || e === o.BRACKET_L || e === o.BRACKET_R || e === o.BRACE_L || e === o.PIPE || e === o.BRACE_R;
433
432
  }
434
- function A(e) {
433
+ function _(e) {
435
434
  return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
436
435
  }
437
436
  function k(e, t) {
438
- return Q(e.charCodeAt(t)) && X(e.charCodeAt(t + 1));
437
+ return X(e.charCodeAt(t)) && q(e.charCodeAt(t + 1));
439
438
  }
440
- function Q(e) {
439
+ function X(e) {
441
440
  return e >= 55296 && e <= 56319;
442
441
  }
443
- function X(e) {
442
+ function q(e) {
444
443
  return e >= 56320 && e <= 57343;
445
444
  }
446
445
  function T(e, t) {
@@ -453,11 +452,11 @@ function T(e, t) {
453
452
  }
454
453
  return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
455
454
  }
456
- function p(e, t, n, s, i) {
455
+ function h(e, t, n, s, i) {
457
456
  const r = e.line, a = 1 + n - e.lineStart;
458
457
  return new Y(t, n, s, r, a, i);
459
458
  }
460
- function Ie(e, t) {
459
+ function fe(e, t) {
461
460
  const n = e.source.body, s = n.length;
462
461
  let i = t;
463
462
  for (; i < s; ) {
@@ -498,7 +497,7 @@ function Ie(e, t) {
498
497
  continue;
499
498
  // Comment
500
499
  case 35:
501
- return Oe(e, i);
500
+ return Ee(e, i);
502
501
  // Token ::
503
502
  // - Punctuator
504
503
  // - Name
@@ -508,66 +507,66 @@ function Ie(e, t) {
508
507
  //
509
508
  // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
510
509
  case 33:
511
- return p(e, o.BANG, i, i + 1);
510
+ return h(e, o.BANG, i, i + 1);
512
511
  case 36:
513
- return p(e, o.DOLLAR, i, i + 1);
512
+ return h(e, o.DOLLAR, i, i + 1);
514
513
  case 38:
515
- return p(e, o.AMP, i, i + 1);
514
+ return h(e, o.AMP, i, i + 1);
516
515
  case 40:
517
- return p(e, o.PAREN_L, i, i + 1);
516
+ return h(e, o.PAREN_L, i, i + 1);
518
517
  case 41:
519
- return p(e, o.PAREN_R, i, i + 1);
518
+ return h(e, o.PAREN_R, i, i + 1);
520
519
  case 46:
521
520
  if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
522
- return p(e, o.SPREAD, i, i + 3);
521
+ return h(e, o.SPREAD, i, i + 3);
523
522
  break;
524
523
  case 58:
525
- return p(e, o.COLON, i, i + 1);
524
+ return h(e, o.COLON, i, i + 1);
526
525
  case 61:
527
- return p(e, o.EQUALS, i, i + 1);
526
+ return h(e, o.EQUALS, i, i + 1);
528
527
  case 64:
529
- return p(e, o.AT, i, i + 1);
528
+ return h(e, o.AT, i, i + 1);
530
529
  case 91:
531
- return p(e, o.BRACKET_L, i, i + 1);
530
+ return h(e, o.BRACKET_L, i, i + 1);
532
531
  case 93:
533
- return p(e, o.BRACKET_R, i, i + 1);
532
+ return h(e, o.BRACKET_R, i, i + 1);
534
533
  case 123:
535
- return p(e, o.BRACE_L, i, i + 1);
534
+ return h(e, o.BRACE_L, i, i + 1);
536
535
  case 124:
537
- return p(e, o.PIPE, i, i + 1);
536
+ return h(e, o.PIPE, i, i + 1);
538
537
  case 125:
539
- return p(e, o.BRACE_R, i, i + 1);
538
+ return h(e, o.BRACE_R, i, i + 1);
540
539
  // StringValue
541
540
  case 34:
542
- return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? ve(e, i) : _e(e, i);
541
+ return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? Oe(e, i) : Ne(e, i);
543
542
  }
544
- if (g(r) || r === 45)
545
- return Ae(e, i, r);
543
+ if (D(r) || r === 45)
544
+ return me(e, i, r);
546
545
  if (J(r))
547
- return Ce(e, i);
546
+ return _e(e, i);
548
547
  throw d(
549
548
  e.source,
550
549
  i,
551
- r === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : A(r) || k(n, i) ? `Unexpected character: ${T(e, i)}.` : `Invalid character: ${T(e, i)}.`
550
+ r === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : _(r) || k(n, i) ? `Unexpected character: ${T(e, i)}.` : `Invalid character: ${T(e, i)}.`
552
551
  );
553
552
  }
554
- return p(e, o.EOF, s, s);
553
+ return h(e, o.EOF, s, s);
555
554
  }
556
- function Oe(e, t) {
555
+ function Ee(e, t) {
557
556
  const n = e.source.body, s = n.length;
558
557
  let i = t + 1;
559
558
  for (; i < s; ) {
560
559
  const r = n.charCodeAt(i);
561
560
  if (r === 10 || r === 13)
562
561
  break;
563
- if (A(r))
562
+ if (_(r))
564
563
  ++i;
565
564
  else if (k(n, i))
566
565
  i += 2;
567
566
  else
568
567
  break;
569
568
  }
570
- return p(
569
+ return h(
571
570
  e,
572
571
  o.COMMENT,
573
572
  t,
@@ -575,11 +574,11 @@ function Oe(e, t) {
575
574
  n.slice(t + 1, i)
576
575
  );
577
576
  }
578
- function Ae(e, t, n) {
577
+ function me(e, t, n) {
579
578
  const s = e.source.body;
580
579
  let i = t, r = n, a = !1;
581
580
  if (r === 45 && (r = s.charCodeAt(++i)), r === 48) {
582
- if (r = s.charCodeAt(++i), g(r))
581
+ if (r = s.charCodeAt(++i), D(r))
583
582
  throw d(
584
583
  e.source,
585
584
  i,
@@ -599,7 +598,7 @@ function Ae(e, t, n) {
599
598
  i
600
599
  )}.`
601
600
  );
602
- return p(
601
+ return h(
603
602
  e,
604
603
  a ? o.FLOAT : o.INT,
605
604
  t,
@@ -608,7 +607,7 @@ function Ae(e, t, n) {
608
607
  );
609
608
  }
610
609
  function R(e, t, n) {
611
- if (!g(n))
610
+ if (!D(n))
612
611
  throw d(
613
612
  e.source,
614
613
  t,
@@ -619,26 +618,26 @@ function R(e, t, n) {
619
618
  );
620
619
  const s = e.source.body;
621
620
  let i = t + 1;
622
- for (; g(s.charCodeAt(i)); )
621
+ for (; D(s.charCodeAt(i)); )
623
622
  ++i;
624
623
  return i;
625
624
  }
626
- function _e(e, t) {
625
+ function Ne(e, t) {
627
626
  const n = e.source.body, s = n.length;
628
627
  let i = t + 1, r = i, a = "";
629
628
  for (; i < s; ) {
630
629
  const u = n.charCodeAt(i);
631
630
  if (u === 34)
632
- return a += n.slice(r, i), p(e, o.STRING, t, i + 1, a);
631
+ return a += n.slice(r, i), h(e, o.STRING, t, i + 1, a);
633
632
  if (u === 92) {
634
633
  a += n.slice(r, i);
635
- const l = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? ye(e, i) : ge(e, i) : De(e, i);
634
+ const l = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? Te(e, i) : Ie(e, i) : xe(e, i);
636
635
  a += l.value, i += l.size, r = i;
637
636
  continue;
638
637
  }
639
638
  if (u === 10 || u === 13)
640
639
  break;
641
- if (A(u))
640
+ if (_(u))
642
641
  ++i;
643
642
  else if (k(n, i))
644
643
  i += 2;
@@ -654,13 +653,13 @@ function _e(e, t) {
654
653
  }
655
654
  throw d(e.source, i, "Unterminated string.");
656
655
  }
657
- function ye(e, t) {
656
+ function Te(e, t) {
658
657
  const n = e.source.body;
659
658
  let s = 0, i = 3;
660
659
  for (; i < 12; ) {
661
660
  const r = n.charCodeAt(t + i++);
662
661
  if (r === 125) {
663
- if (i < 5 || !A(s))
662
+ if (i < 5 || !_(s))
664
663
  break;
665
664
  return {
666
665
  value: String.fromCodePoint(s),
@@ -679,16 +678,16 @@ function ye(e, t) {
679
678
  )}".`
680
679
  );
681
680
  }
682
- function ge(e, t) {
681
+ function Ie(e, t) {
683
682
  const n = e.source.body, s = j(n, t + 2);
684
- if (A(s))
683
+ if (_(s))
685
684
  return {
686
685
  value: String.fromCodePoint(s),
687
686
  size: 6
688
687
  };
689
- if (Q(s) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
688
+ if (X(s) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
690
689
  const i = j(n, t + 8);
691
- if (X(i))
690
+ if (q(i))
692
691
  return {
693
692
  value: String.fromCodePoint(s, i),
694
693
  size: 12
@@ -706,7 +705,7 @@ function j(e, t) {
706
705
  function y(e) {
707
706
  return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
708
707
  }
709
- function De(e, t) {
708
+ function xe(e, t) {
710
709
  const n = e.source.body;
711
710
  switch (n.charCodeAt(t + 1)) {
712
711
  case 34:
@@ -760,34 +759,34 @@ function De(e, t) {
760
759
  )}".`
761
760
  );
762
761
  }
763
- function ve(e, t) {
762
+ function Oe(e, t) {
764
763
  const n = e.source.body, s = n.length;
765
764
  let i = e.lineStart, r = t + 3, a = r, u = "";
766
765
  const l = [];
767
766
  for (; r < s; ) {
768
- const f = n.charCodeAt(r);
769
- if (f === 34 && n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34) {
767
+ const E = n.charCodeAt(r);
768
+ if (E === 34 && n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34) {
770
769
  u += n.slice(a, r), l.push(u);
771
- const h = p(
770
+ const p = h(
772
771
  e,
773
772
  o.BLOCK_STRING,
774
773
  t,
775
774
  r + 3,
776
775
  // Return a string of the lines joined with U+000A.
777
- me(l).join(`
776
+ le(l).join(`
778
777
  `)
779
778
  );
780
- return e.line += l.length - 1, e.lineStart = i, h;
779
+ return e.line += l.length - 1, e.lineStart = i, p;
781
780
  }
782
- if (f === 92 && n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 && n.charCodeAt(r + 3) === 34) {
781
+ if (E === 92 && n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 && n.charCodeAt(r + 3) === 34) {
783
782
  u += n.slice(a, r), a = r + 1, r += 4;
784
783
  continue;
785
784
  }
786
- if (f === 10 || f === 13) {
787
- u += n.slice(a, r), l.push(u), f === 13 && n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, u = "", a = r, i = r;
785
+ if (E === 10 || E === 13) {
786
+ u += n.slice(a, r), l.push(u), E === 13 && n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, u = "", a = r, i = r;
788
787
  continue;
789
788
  }
790
- if (A(f))
789
+ if (_(E))
791
790
  ++r;
792
791
  else if (k(n, r))
793
792
  r += 2;
@@ -803,17 +802,17 @@ function ve(e, t) {
803
802
  }
804
803
  throw d(e.source, r, "Unterminated string.");
805
804
  }
806
- function Ce(e, t) {
805
+ function _e(e, t) {
807
806
  const n = e.source.body, s = n.length;
808
807
  let i = t + 1;
809
808
  for (; i < s; ) {
810
809
  const r = n.charCodeAt(i);
811
- if (Ee(r))
810
+ if (ue(r))
812
811
  ++i;
813
812
  else
814
813
  break;
815
814
  }
816
- return p(
815
+ return h(
817
816
  e,
818
817
  o.NAME,
819
818
  t,
@@ -821,7 +820,7 @@ function Ce(e, t) {
821
820
  n.slice(t, i)
822
821
  );
823
822
  }
824
- const ke = 10, q = 2;
823
+ const Ae = 10, Q = 2;
825
824
  function z(e) {
826
825
  return S(e, []);
827
826
  }
@@ -832,45 +831,45 @@ function S(e, t) {
832
831
  case "function":
833
832
  return e.name ? `[function ${e.name}]` : "[function]";
834
833
  case "object":
835
- return Se(e, t);
834
+ return ye(e, t);
836
835
  default:
837
836
  return String(e);
838
837
  }
839
838
  }
840
- function Se(e, t) {
839
+ function ye(e, t) {
841
840
  if (e === null)
842
841
  return "null";
843
842
  if (t.includes(e))
844
843
  return "[Circular]";
845
844
  const n = [...t, e];
846
- if (be(e)) {
845
+ if (De(e)) {
847
846
  const s = e.toJSON();
848
847
  if (s !== e)
849
848
  return typeof s == "string" ? s : S(s, n);
850
849
  } else if (Array.isArray(e))
851
- return Re(e, n);
852
- return Le(e, n);
850
+ return ve(e, n);
851
+ return ge(e, n);
853
852
  }
854
- function be(e) {
853
+ function De(e) {
855
854
  return typeof e.toJSON == "function";
856
855
  }
857
- function Le(e, t) {
856
+ function ge(e, t) {
858
857
  const n = Object.entries(e);
859
- return n.length === 0 ? "{}" : t.length > q ? "[" + Fe(e) + "]" : "{ " + n.map(
858
+ return n.length === 0 ? "{}" : t.length > Q ? "[" + Ce(e) + "]" : "{ " + n.map(
860
859
  ([i, r]) => i + ": " + S(r, t)
861
860
  ).join(", ") + " }";
862
861
  }
863
- function Re(e, t) {
862
+ function ve(e, t) {
864
863
  if (e.length === 0)
865
864
  return "[]";
866
- if (t.length > q)
865
+ if (t.length > Q)
867
866
  return "[Array]";
868
- const n = Math.min(ke, e.length), s = e.length - n, i = [];
867
+ const n = Math.min(Ae, e.length), s = e.length - n, i = [];
869
868
  for (let r = 0; r < n; ++r)
870
869
  i.push(S(e[r], t));
871
870
  return s === 1 ? i.push("... 1 more item") : s > 1 && i.push(`... ${s} more items`), "[" + i.join(", ") + "]";
872
871
  }
873
- function Fe(e) {
872
+ function Ce(e) {
874
873
  const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
875
874
  if (t === "Object" && typeof e.constructor == "function") {
876
875
  const n = e.constructor.name;
@@ -879,11 +878,11 @@ function Fe(e) {
879
878
  }
880
879
  return t;
881
880
  }
882
- const we = globalThis.process && // eslint-disable-next-line no-undef
883
- process.env.NODE_ENV === "production", Pe = (
881
+ const ke = globalThis.process && // eslint-disable-next-line no-undef
882
+ process.env.NODE_ENV === "production", Se = (
884
883
  /* c8 ignore next 6 */
885
884
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
886
- we ? function(t, n) {
885
+ ke ? function(t, n) {
887
886
  return t instanceof n;
888
887
  } : function(t, n) {
889
888
  if (t instanceof n)
@@ -930,20 +929,20 @@ class H {
930
929
  return "Source";
931
930
  }
932
931
  }
933
- function Ue(e) {
934
- return Pe(e, H);
932
+ function be(e) {
933
+ return Se(e, H);
935
934
  }
936
- function Me(e, t) {
937
- const n = new Ve(e, t), s = n.parseDocument();
935
+ function Le(e, t) {
936
+ const n = new Re(e, t), s = n.parseDocument();
938
937
  return Object.defineProperty(s, "tokenCount", {
939
938
  enumerable: !1,
940
939
  value: n.tokenCount
941
940
  }), s;
942
941
  }
943
- class Ve {
942
+ class Re {
944
943
  constructor(t, n = {}) {
945
- const s = Ue(t) ? t : new H(t);
946
- this._lexer = new Te(s), this._options = n, this._tokenCounter = 0;
944
+ const s = be(t) ? t : new H(t);
945
+ this._lexer = new pe(s), this._options = n, this._tokenCounter = 0;
947
946
  }
948
947
  get tokenCount() {
949
948
  return this._tokenCounter;
@@ -1048,7 +1047,7 @@ class Ve {
1048
1047
  if (this.peek(o.BRACE_L))
1049
1048
  return this.node(t, {
1050
1049
  kind: c.OPERATION_DEFINITION,
1051
- operation: I.QUERY,
1050
+ operation: x.QUERY,
1052
1051
  name: void 0,
1053
1052
  variableDefinitions: [],
1054
1053
  directives: [],
@@ -1072,11 +1071,11 @@ class Ve {
1072
1071
  const t = this.expectToken(o.NAME);
1073
1072
  switch (t.value) {
1074
1073
  case "query":
1075
- return I.QUERY;
1074
+ return x.QUERY;
1076
1075
  case "mutation":
1077
- return I.MUTATION;
1076
+ return x.MUTATION;
1078
1077
  case "subscription":
1079
- return I.SUBSCRIPTION;
1078
+ return x.SUBSCRIPTION;
1080
1079
  }
1081
1080
  throw this.unexpected(t);
1082
1081
  }
@@ -1643,7 +1642,7 @@ class Ve {
1643
1642
  throw d(
1644
1643
  this._lexer.source,
1645
1644
  this._lexer.token.start,
1646
- `${D(
1645
+ `${g(
1647
1646
  this._lexer.token
1648
1647
  )} is reserved and cannot be used for an enum value.`
1649
1648
  );
@@ -1913,7 +1912,7 @@ class Ve {
1913
1912
  * given parsed object.
1914
1913
  */
1915
1914
  node(t, n) {
1916
- return this._options.noLocation !== !0 && (n.loc = new pe(
1915
+ return this._options.noLocation !== !0 && (n.loc = new oe(
1917
1916
  t,
1918
1917
  this._lexer.lastToken,
1919
1918
  this._lexer.source
@@ -1936,7 +1935,7 @@ class Ve {
1936
1935
  throw d(
1937
1936
  this._lexer.source,
1938
1937
  n.start,
1939
- `Expected ${W(t)}, found ${D(n)}.`
1938
+ `Expected ${W(t)}, found ${g(n)}.`
1940
1939
  );
1941
1940
  }
1942
1941
  /**
@@ -1958,7 +1957,7 @@ class Ve {
1958
1957
  throw d(
1959
1958
  this._lexer.source,
1960
1959
  n.start,
1961
- `Expected "${t}", found ${D(n)}.`
1960
+ `Expected "${t}", found ${g(n)}.`
1962
1961
  );
1963
1962
  }
1964
1963
  /**
@@ -1977,7 +1976,7 @@ class Ve {
1977
1976
  return d(
1978
1977
  this._lexer.source,
1979
1978
  n.start,
1980
- `Unexpected ${D(n)}.`
1979
+ `Unexpected ${g(n)}.`
1981
1980
  );
1982
1981
  }
1983
1982
  /**
@@ -2044,25 +2043,25 @@ class Ve {
2044
2043
  );
2045
2044
  }
2046
2045
  }
2047
- function D(e) {
2046
+ function g(e) {
2048
2047
  const t = e.value;
2049
2048
  return W(e.kind) + (t != null ? ` "${t}"` : "");
2050
2049
  }
2051
2050
  function W(e) {
2052
- return xe(e) ? `"${e}"` : e;
2051
+ return de(e) ? `"${e}"` : e;
2053
2052
  }
2054
2053
  var v = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), Z = !0, C = !1;
2055
2054
  function K(e) {
2056
2055
  return e.replace(/[\s,]+/g, " ").trim();
2057
2056
  }
2058
- function Be(e) {
2057
+ function Fe(e) {
2059
2058
  return K(e.source.body.substring(e.start, e.end));
2060
2059
  }
2061
- function je(e) {
2060
+ function we(e) {
2062
2061
  var t = /* @__PURE__ */ new Set(), n = [];
2063
2062
  return e.definitions.forEach(function(s) {
2064
2063
  if (s.kind === "FragmentDefinition") {
2065
- var i = s.name.value, r = Be(s.loc), a = P.get(i);
2064
+ var i = s.name.value, r = Fe(s.loc), a = P.get(i);
2066
2065
  a && !a.has(r) ? Z && console.warn("Warning: fragment with name " + i + ` already exists.
2067
2066
  graphql-tag enforces all fragment names across your application to be unique; read more about
2068
2067
  this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : a || P.set(i, a = /* @__PURE__ */ new Set()), a.add(r), t.has(r) || (t.add(r), n.push(s));
@@ -2070,7 +2069,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) :
2070
2069
  n.push(s);
2071
2070
  }), M(M({}, e), { definitions: n });
2072
2071
  }
2073
- function Ge(e) {
2072
+ function Pe(e) {
2074
2073
  var t = new Set(e.definitions);
2075
2074
  t.forEach(function(s) {
2076
2075
  s.loc && delete s.loc, Object.keys(s).forEach(function(i) {
@@ -2081,16 +2080,16 @@ function Ge(e) {
2081
2080
  var n = e.loc;
2082
2081
  return n && (delete n.startToken, delete n.endToken), e;
2083
2082
  }
2084
- function Ye(e) {
2083
+ function Ue(e) {
2085
2084
  var t = K(e);
2086
2085
  if (!v.has(t)) {
2087
- var n = Me(e, {
2086
+ var n = Le(e, {
2088
2087
  experimentalFragmentVariables: C,
2089
2088
  allowLegacyFragmentVariables: C
2090
2089
  });
2091
2090
  if (!n || n.kind !== "Document")
2092
2091
  throw new Error("Not a valid GraphQL document.");
2093
- v.set(t, Ge(je(n)));
2092
+ v.set(t, Pe(we(n)));
2094
2093
  }
2095
2094
  return v.get(t);
2096
2095
  }
@@ -2101,41 +2100,32 @@ function O(e) {
2101
2100
  var s = e[0];
2102
2101
  return t.forEach(function(i, r) {
2103
2102
  i && i.kind === "Document" ? s += i.loc.source.body : s += i, s += e[r + 1];
2104
- }), Ye(s);
2103
+ }), Ue(s);
2105
2104
  }
2106
- function $e() {
2105
+ function Me() {
2107
2106
  v.clear(), P.clear();
2108
2107
  }
2109
- function Je() {
2108
+ function Ve() {
2110
2109
  Z = !1;
2111
2110
  }
2112
- function Qe() {
2111
+ function Be() {
2113
2112
  C = !0;
2114
2113
  }
2115
- function Xe() {
2114
+ function je() {
2116
2115
  C = !1;
2117
2116
  }
2118
- var _ = {
2117
+ var A = {
2119
2118
  gql: O,
2120
- resetCaches: $e,
2121
- disableFragmentWarnings: Je,
2122
- enableExperimentalFragmentVariables: Qe,
2123
- disableExperimentalFragmentVariables: Xe
2119
+ resetCaches: Me,
2120
+ disableFragmentWarnings: Ve,
2121
+ enableExperimentalFragmentVariables: Be,
2122
+ disableExperimentalFragmentVariables: je
2124
2123
  };
2125
2124
  (function(e) {
2126
- e.gql = _.gql, e.resetCaches = _.resetCaches, e.disableFragmentWarnings = _.disableFragmentWarnings, e.enableExperimentalFragmentVariables = _.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = _.disableExperimentalFragmentVariables;
2125
+ e.gql = A.gql, e.resetCaches = A.resetCaches, e.disableFragmentWarnings = A.disableFragmentWarnings, e.enableExperimentalFragmentVariables = A.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = A.disableExperimentalFragmentVariables;
2127
2126
  })(O || (O = {}));
2128
2127
  O.default = O;
2129
- const ee = ne({
2130
- user: null,
2131
- loading: !0,
2132
- error: null,
2133
- isLoggedIn: !1,
2134
- isAdmin: !1,
2135
- refreshUser: async () => Promise.resolve(),
2136
- setUser: () => {
2137
- }
2138
- }), qe = O`
2128
+ const $e = O`
2139
2129
  query getCurrentUser {
2140
2130
  me {
2141
2131
  id
@@ -2144,48 +2134,16 @@ const ee = ne({
2144
2134
  role
2145
2135
  }
2146
2136
  }
2147
- `;
2148
- function Ze({
2149
- adminRole: e = "admin",
2150
- children: t,
2151
- getCurrentUserQuery: n = qe,
2152
- options: s = {},
2153
- pollInterval: i = 5 * 60 * 1e3
2154
- }) {
2155
- const [r, a] = ie(null), { data: u, error: l, loading: f, refetch: h } = oe(n, {
2156
- fetchPolicy: "cache-and-network",
2157
- nextFetchPolicy: "cache-first",
2158
- errorPolicy: "all",
2159
- pollInterval: i,
2160
- ...s
2161
- }), N = u?.me, m = r?.role === e;
2162
- return se(() => {
2163
- a(u?.me || null);
2164
- }, [u]), /* @__PURE__ */ te.jsx(
2165
- ee.Provider,
2166
- {
2167
- value: {
2168
- user: r,
2169
- loading: f,
2170
- error: l ?? null,
2171
- isLoggedIn: N,
2172
- isAdmin: m,
2173
- refreshUser: h,
2174
- setUser: a
2175
- },
2176
- children: t
2177
- }
2178
- );
2179
- }
2180
- function Ke() {
2181
- const e = re(ee);
2182
- if (!e)
2183
- throw new Error("useOxAuth must be used within an AuthProvider");
2184
- return e;
2185
- }
2137
+ `, Je = ee({
2138
+ user: null,
2139
+ loading: !0,
2140
+ error: null,
2141
+ isLoggedIn: !1,
2142
+ isAdmin: !1,
2143
+ refreshUser: async () => Promise.resolve()
2144
+ });
2186
2145
  export {
2187
- Ze as O,
2188
- ee as a,
2189
- O as g,
2190
- Ke as u
2146
+ $e as D,
2147
+ Je as O,
2148
+ O as g
2191
2149
  };