@enviabybus/react-utility-belt 2.4.2 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/chunks/http.error.0pMVpraj.js +2 -0
  2. package/dist/chunks/http.error.a7ylLT2G.js +75 -0
  3. package/dist/chunks/parser.helper.BHm3KRPh.js +42 -0
  4. package/dist/chunks/parser.helper.BKRe6p7c.js +1 -0
  5. package/dist/chunks/services.helper.-kkjd_CH.js +1 -0
  6. package/dist/chunks/services.helper.DjoudiHA.js +74 -0
  7. package/dist/components.cjs.js +1 -0
  8. package/dist/components.d.ts +1 -0
  9. package/dist/components.es.js +614 -0
  10. package/dist/errors.cjs.js +1 -2
  11. package/dist/errors.es.js +15 -72
  12. package/dist/helpers.cjs.js +3 -1
  13. package/dist/helpers.es.js +1469 -63
  14. package/dist/services.cjs.js +1 -10
  15. package/dist/services.es.js +317 -2178
  16. package/dist/src/components/form/AutocompleteField.d.ts +35 -0
  17. package/dist/src/components/form/AutocompleteField.d.ts.map +1 -0
  18. package/dist/src/components/form/BooleanSelectField.d.ts +10 -0
  19. package/dist/src/components/form/BooleanSelectField.d.ts.map +1 -0
  20. package/dist/src/components/form/CheckboxField.d.ts +40 -0
  21. package/dist/src/components/form/CheckboxField.d.ts.map +1 -0
  22. package/dist/src/components/form/DateTimeField.d.ts +33 -0
  23. package/dist/src/components/form/DateTimeField.d.ts.map +1 -0
  24. package/dist/src/components/form/EmailField.d.ts +8 -0
  25. package/dist/src/components/form/EmailField.d.ts.map +1 -0
  26. package/dist/src/components/form/NumberField.d.ts +10 -0
  27. package/dist/src/components/form/NumberField.d.ts.map +1 -0
  28. package/dist/src/components/form/PasswordField.d.ts +8 -0
  29. package/dist/src/components/form/PasswordField.d.ts.map +1 -0
  30. package/dist/src/components/form/RadioField.d.ts +37 -0
  31. package/dist/src/components/form/RadioField.d.ts.map +1 -0
  32. package/dist/src/components/form/SelectField.d.ts +33 -0
  33. package/dist/src/components/form/SelectField.d.ts.map +1 -0
  34. package/dist/src/components/form/SubmitButton.d.ts +20 -0
  35. package/dist/src/components/form/SubmitButton.d.ts.map +1 -0
  36. package/dist/src/components/form/TextField.d.ts +23 -0
  37. package/dist/src/components/form/TextField.d.ts.map +1 -0
  38. package/dist/src/components/form/index.d.ts +12 -0
  39. package/dist/src/components/form/index.d.ts.map +1 -0
  40. package/dist/src/components/index.d.ts +2 -0
  41. package/dist/src/components/index.d.ts.map +1 -0
  42. package/dist/src/errors/http.error.d.ts +1 -0
  43. package/dist/src/errors/http.error.d.ts.map +1 -1
  44. package/dist/src/helpers/audio.helper.d.ts +7 -0
  45. package/dist/src/helpers/audio.helper.d.ts.map +1 -0
  46. package/dist/src/helpers/currency.helper.d.ts +2 -0
  47. package/dist/src/helpers/currency.helper.d.ts.map +1 -0
  48. package/dist/src/helpers/date.helper.d.ts +12 -0
  49. package/dist/src/helpers/date.helper.d.ts.map +1 -0
  50. package/dist/src/helpers/external-storage.helper.d.ts +7 -0
  51. package/dist/src/helpers/external-storage.helper.d.ts.map +1 -0
  52. package/dist/src/helpers/file.helper.d.ts +8 -0
  53. package/dist/src/helpers/file.helper.d.ts.map +1 -0
  54. package/dist/src/helpers/graphql.helper.d.ts +5 -0
  55. package/dist/src/helpers/graphql.helper.d.ts.map +1 -0
  56. package/dist/src/helpers/http.helper.d.ts +23 -1
  57. package/dist/src/helpers/http.helper.d.ts.map +1 -1
  58. package/dist/src/helpers/index.d.ts +14 -0
  59. package/dist/src/helpers/index.d.ts.map +1 -1
  60. package/dist/src/helpers/interaction.helper.d.ts +7 -0
  61. package/dist/src/helpers/interaction.helper.d.ts.map +1 -0
  62. package/dist/src/helpers/mask.helper.d.ts +6 -0
  63. package/dist/src/helpers/mask.helper.d.ts.map +1 -0
  64. package/dist/src/helpers/measurement.helper.d.ts +10 -0
  65. package/dist/src/helpers/measurement.helper.d.ts.map +1 -0
  66. package/dist/src/helpers/navigation.helper.d.ts +5 -0
  67. package/dist/src/helpers/navigation.helper.d.ts.map +1 -0
  68. package/dist/src/helpers/object.helper.d.ts +4 -0
  69. package/dist/src/helpers/object.helper.d.ts.map +1 -0
  70. package/dist/src/helpers/pagination.helper.d.ts +2 -0
  71. package/dist/src/helpers/pagination.helper.d.ts.map +1 -0
  72. package/dist/src/helpers/parser.helper.d.ts +7 -0
  73. package/dist/src/helpers/parser.helper.d.ts.map +1 -0
  74. package/dist/src/helpers/version.helper.d.ts +7 -0
  75. package/dist/src/helpers/version.helper.d.ts.map +1 -0
  76. package/dist/src/services/tracker/posthog.adapter.d.ts.map +1 -1
  77. package/dist/src/services/tracker/tracker.service.d.ts +2 -1
  78. package/dist/src/services/tracker/tracker.service.d.ts.map +1 -1
  79. package/dist/src/types/form.d.ts +12 -0
  80. package/dist/src/types/form.d.ts.map +1 -0
  81. package/dist/src/types/graphql.d.ts +16 -0
  82. package/dist/src/types/graphql.d.ts.map +1 -0
  83. package/dist/src/types/helpers.d.ts +1 -0
  84. package/dist/src/types/helpers.d.ts.map +1 -1
  85. package/dist/src/types/index.d.ts +4 -0
  86. package/dist/src/types/index.d.ts.map +1 -1
  87. package/dist/src/types/measurements.d.ts +10 -0
  88. package/dist/src/types/measurements.d.ts.map +1 -0
  89. package/dist/types.cjs.js +1 -1
  90. package/dist/types.es.js +5 -1
  91. package/dist/vite.config.d.ts.map +1 -1
  92. package/package.json +16 -2
  93. package/dist/chunks/services.helper.BhBSTY1M.js +0 -3741
  94. package/dist/chunks/services.helper.DolZWkEs.js +0 -47
@@ -1,2007 +1,244 @@
1
- import { c as G, d as Bt, l as Be, a as rt, f as Dt, g as _t, e as nt } from "./chunks/services.helper.BhBSTY1M.js";
2
- import { useRef as Mt, useEffect as st, useState as Ht, createContext as qt, useContext as jt } from "react";
3
- import { jsx as ot } from "react/jsx-runtime";
4
- import { useMutation as It, useQuery as $t } from "@tanstack/react-query";
5
- import { BaseError as De, HttpServiceError as L, GraphQLServiceError as _e, GraphQLServiceErrorCode as Me, GraphQLErrors as He, HttpServiceErrorCode as W } from "./errors.es.js";
6
- const zt = (e) => ({
1
+ import { c as x } from "react/compiler-runtime";
2
+ import { useRef as F, useEffect as O, useState as I, createContext as _, useContext as W } from "react";
3
+ import { omitBy as J, isNil as Q } from "lodash";
4
+ import { jsx as K } from "react/jsx-runtime";
5
+ import "react-router-dom";
6
+ import M, { AxiosError as j, isAxiosError as Y } from "axios";
7
+ import m from "js-logger";
8
+ import { useMutation as X, useQuery as Z } from "@tanstack/react-query";
9
+ import { b as ee, a as $, c as D } from "./chunks/services.helper.DjoudiHA.js";
10
+ import { B, a as v, b as A } from "./chunks/http.error.a7ylLT2G.js";
11
+ import { GraphQLServiceError as G, GraphQLServiceErrorCode as k, GraphQLErrors as U } from "./errors.es.js";
12
+ const re = (e) => ({
7
13
  ...t
8
- }) => e(t), Qn = ({
14
+ }) => e(t), Ge = ({
9
15
  useAdapter: e,
10
16
  LoggerService: t
11
- }) => ee("ERROR_SERVICE", zt(e), [t.ServiceProvider]), Xn = () => ({
17
+ }) => R("ERROR_SERVICE", re(e), [t.ServiceProvider]), ke = () => ({
12
18
  LoggerService: e
13
19
  }) => {
14
- const t = $(e), r = Mt({}), n = (c, h) => {
15
- const u = r.current;
20
+ const t = b(e), r = F({}), n = (s, a) => {
21
+ const o = r.current;
16
22
  r.current = {
17
- ...u,
18
- [c]: [...u[c] || [], h]
23
+ ...o,
24
+ [s]: [...o[s] || [], a]
19
25
  };
20
- }, s = (c, h) => {
21
- const u = r.current;
26
+ }, i = (s, a) => {
27
+ const o = r.current;
22
28
  r.current = {
23
- ...u,
29
+ ...o,
24
30
  // Used internaly, assured not to be undefined
25
- [c]: u[c].filter((a) => a !== h)
31
+ [s]: o[s].filter((u) => u !== a)
26
32
  };
27
33
  };
28
34
  return {
29
- raiseError: (c) => {
30
- var h;
31
- t.error(c), (h = r.current[c.code]) == null || h.forEach((u) => u(c));
35
+ raiseError: (s) => {
36
+ var a;
37
+ t.error(s), (a = r.current[s.code]) == null || a.forEach((o) => o(s));
32
38
  },
33
- useErrorHandler: (c, h) => {
34
- const u = G.c(4);
35
- let a, f;
36
- u[0] !== h || u[1] !== c ? (a = () => (n(c, h), () => {
37
- s(c, h);
38
- }), f = [c, h], u[0] = h, u[1] = c, u[2] = a, u[3] = f) : (a = u[2], f = u[3]), st(a, f);
39
+ useErrorHandler: (s, a) => {
40
+ const o = x(4);
41
+ let u, c;
42
+ o[0] !== a || o[1] !== s ? (u = () => (n(s, a), () => {
43
+ i(s, a);
44
+ }), c = [s, a], o[0] = a, o[1] = s, o[2] = u, o[3] = c) : (u = o[2], c = o[3]), O(u, c);
39
45
  }
40
46
  };
41
- }, Jt = ({
47
+ }, te = ({
42
48
  HttpService: e,
43
49
  ErrorService: t
44
50
  }) => () => {
45
- const r = $(t), n = $(e), s = (u) => {
51
+ const r = b(t), n = b(e), i = (o) => {
46
52
  const {
47
- details: a,
48
- message: f
49
- } = u, m = a != null && a.body && typeof a.body == "object" && "errors" in a.body && a.body.errors instanceof Array ? a.body.errors : [];
50
- if (m.length === 0)
51
- return r.raiseError(u), u;
52
- if (m.find((p) => {
53
- var E;
54
- return ((E = p.extensions) == null ? void 0 : E.code) === He.AuthenticationError || p.message.toLowerCase().includes("authorization");
53
+ details: u,
54
+ message: c
55
+ } = o, l = u != null && u.body && typeof u.body == "object" && "errors" in u.body && u.body.errors instanceof Array ? u.body.errors : [];
56
+ if (l.length === 0)
57
+ return r.raiseError(o), o;
58
+ if (l.find((g) => {
59
+ var d;
60
+ return ((d = g.extensions) == null ? void 0 : d.code) === U.AuthenticationError || g.message.toLowerCase().includes("authorization");
55
61
  })) {
56
- const p = new L({
57
- code: W.Unauthorized,
58
- details: a,
59
- message: f
62
+ const g = new v({
63
+ code: A.Unauthorized,
64
+ details: u,
65
+ message: c
60
66
  });
61
- return r.raiseError(p), p;
67
+ return r.raiseError(g), g;
62
68
  }
63
- const d = typeof m[0] == "string" ? m[0] : null, y = new L({
64
- code: W.Generic,
65
- details: a,
66
- message: f + (d ? ` (${d})` : "")
69
+ const y = typeof l[0] == "string" ? l[0] : null, P = new v({
70
+ code: A.Generic,
71
+ details: u,
72
+ message: c + (y ? ` (${y})` : "")
67
73
  });
68
- return r.raiseError(y), y;
69
- }, o = (u) => {
74
+ return r.raiseError(P), P;
75
+ }, h = (o) => {
70
76
  const {
71
- details: a,
72
- message: f
73
- } = u, m = new L({
74
- code: W.Unauthorized,
75
- details: a,
76
- message: f
77
+ details: u,
78
+ message: c
79
+ } = o, l = new v({
80
+ code: A.Unauthorized,
81
+ details: u,
82
+ message: c
77
83
  });
78
- return r.raiseError(m), m;
79
- }, i = (u) => {
80
- const a = u.find((g) => {
81
- var d;
82
- return ((d = g == null ? void 0 : g.extensions) == null ? void 0 : d.code) === He.AuthenticationError;
84
+ return r.raiseError(l), l;
85
+ }, E = (o) => {
86
+ const u = o.find((S) => {
87
+ var y;
88
+ return ((y = S == null ? void 0 : S.extensions) == null ? void 0 : y.code) === U.AuthenticationError;
83
89
  });
84
- if (a) return o(a);
85
- const f = typeof u[0] == "string" ? u[0] : "Unknown error.", m = new _e({
86
- code: Me.Generic,
87
- message: f
90
+ if (u) return h(u);
91
+ const c = typeof o[0] == "string" ? o[0] : "Unknown error.", l = new G({
92
+ code: k.Generic,
93
+ message: c
88
94
  });
89
- return r.raiseError(m), m;
90
- }, c = (u) => {
91
- if ("errors" in u && u.errors instanceof Array && u.errors.length > 0)
92
- return i(u.errors);
93
- if (!u.data) {
94
- const f = new _e({
95
- code: Me.Generic,
95
+ return r.raiseError(l), l;
96
+ }, s = (o) => {
97
+ if ("errors" in o && o.errors instanceof Array && o.errors.length > 0)
98
+ return E(o.errors);
99
+ if (!o.data) {
100
+ const c = new G({
101
+ code: k.Generic,
96
102
  message: "Response is missing 'data' attribute."
97
103
  });
98
- return r.raiseError(f), f;
104
+ return r.raiseError(c), c;
99
105
  }
100
- return u.data;
106
+ return o.data;
101
107
  };
102
108
  return {
103
- execute: async (u) => {
104
- const a = Array.isArray(u.url) ? Bt(u.url) : u.url;
109
+ execute: async (o) => {
110
+ const u = Array.isArray(o.url) ? ee(o.url) : o.url;
105
111
  try {
106
- const f = await n.post({
112
+ const c = await n.post({
107
113
  body: {
108
- query: u.query,
109
- variables: u.variables
114
+ query: o.query,
115
+ variables: o.variables
110
116
  },
111
- headers: u.headers,
112
- url: a
117
+ headers: o.headers,
118
+ url: u
113
119
  });
114
- if (!f) return {};
115
- const m = c(f.body);
116
- if (m instanceof De)
117
- throw m;
118
- return m;
119
- } catch (f) {
120
- throw f instanceof L ? s(f) : f instanceof De ? f : new Error("Could not handle error");
120
+ if (!c) return {};
121
+ const l = s(c.body);
122
+ if (l instanceof B)
123
+ throw l;
124
+ return l;
125
+ } catch (c) {
126
+ throw c instanceof v ? i(c) : c instanceof B ? c : new Error("Could not handle error");
121
127
  }
122
128
  }
123
129
  };
124
- }, Zn = ({
130
+ }, Ue = ({
125
131
  HttpService: e,
126
132
  ErrorService: t
127
- }) => ee("GRAPHQL_SERVICE", Jt({
133
+ }) => R("GRAPHQL_SERVICE", te({
128
134
  ErrorService: t,
129
135
  HttpService: e
130
- }), [e.ServiceProvider, t.ServiceProvider]), Vt = (e) => ({
136
+ }), [e.ServiceProvider, t.ServiceProvider]), oe = (e) => ({
131
137
  ErrorService: t,
132
138
  LoggerService: r
133
139
  }) => {
134
- const n = e(), s = $(r), o = $(t), i = (E) => {
135
- const b = Be.omitBy(E, Be.isNil);
136
- s.info(`HTTP request: ${JSON.stringify(b)}`);
137
- }, c = (E) => {
140
+ const n = e(), i = b(r), h = b(t), E = (d) => {
141
+ const f = J(d, Q);
142
+ i.info(`HTTP request: ${JSON.stringify(f)}`);
143
+ }, s = (d) => {
138
144
  const {
139
- body: b,
140
- status: S
141
- } = E;
142
- s.info(`HTTP response: ${JSON.stringify({
143
- body: b,
144
- status: S
145
+ body: f,
146
+ status: p
147
+ } = d;
148
+ i.info(`HTTP response: ${JSON.stringify({
149
+ body: f,
150
+ status: p
145
151
  })}`);
146
- }, h = (E) => E >= 400 && E < 600, u = (E) => {
152
+ }, a = (d) => d >= 400 && d < 600, o = (d) => {
147
153
  const {
148
- details: b,
149
- message: S
150
- } = E;
151
- return o.raiseError(new L({
152
- code: W.Unauthorized,
153
- details: b,
154
- message: S
154
+ details: f,
155
+ message: p
156
+ } = d;
157
+ return h.raiseError(new v({
158
+ code: A.Unauthorized,
159
+ details: f,
160
+ message: p
155
161
  }));
156
- }, a = (E) => {
162
+ }, u = (d) => {
157
163
  const {
158
- status: b
159
- } = E.details || {};
160
- if (!b || b >= 500) {
161
- const S = JSON.stringify(E);
162
- s.error(S);
164
+ status: f
165
+ } = d.details || {};
166
+ if (!f || f >= 500) {
167
+ const p = JSON.stringify(d);
168
+ i.error(p);
163
169
  } else {
164
- if (b === 401)
165
- return u(E);
166
- s.warn(E);
167
- }
168
- return o.raiseError(E);
169
- }, f = async (E, b, S = {}) => {
170
- i({
171
- method: E,
172
- ...b
170
+ if (f === 401)
171
+ return o(d);
172
+ i.warn(d);
173
+ }
174
+ return h.raiseError(d);
175
+ }, c = async (d, f, p = {}) => {
176
+ E({
177
+ method: d,
178
+ ...f
173
179
  });
174
- let O, T;
175
- const P = (A) => {
176
- if (A instanceof L) {
177
- T = A;
180
+ let w, C;
181
+ const T = (L) => {
182
+ if (L instanceof v) {
183
+ C = L;
178
184
  return;
179
185
  }
180
- O = A;
186
+ w = L;
181
187
  };
182
- switch (E) {
188
+ switch (d) {
183
189
  case "GET": {
184
- P(await n.get(b, S));
190
+ T(await n.get(f, p));
185
191
  break;
186
192
  }
187
193
  case "DELETE": {
188
- P(await n.delete(b, S));
194
+ T(await n.delete(f, p));
189
195
  break;
190
196
  }
191
197
  case "PATCH": {
192
- P(await n.patch(b, S));
198
+ T(await n.patch(f, p));
193
199
  break;
194
200
  }
195
201
  case "POST": {
196
- P(await n.post(b, S));
202
+ T(await n.post(f, p));
197
203
  break;
198
204
  }
199
205
  case "PUT": {
200
- P(await n.put(b, S));
206
+ T(await n.put(f, p));
201
207
  break;
202
208
  }
203
209
  default:
204
- throw Error(`Unknown method HTTP method '${E}'`);
210
+ throw Error(`Unknown method HTTP method '${d}'`);
205
211
  }
206
- if (T)
207
- throw a(T), T;
208
- return O ? (c(O), h(O.status) && a(new L({
212
+ if (C)
213
+ throw u(C), C;
214
+ return w ? (s(w), a(w.status) && u(new v({
209
215
  details: {
210
- body: JSON.stringify(O.body),
211
- method: E,
212
- status: O.status,
213
- url: b.url
216
+ body: JSON.stringify(w.body),
217
+ method: d,
218
+ status: w.status,
219
+ url: f.url
214
220
  }
215
- })), O) : void 0;
221
+ })), w) : void 0;
216
222
  };
217
223
  return {
218
- delete: (E, b = {}) => f("DELETE", E, b),
219
- get: (E, b = {}) => f("GET", E, b),
220
- patch: (E, b = {}) => f("PATCH", E, b),
221
- post: async (E, b = {}) => await f("POST", E, b),
222
- put: (E, b = {}) => f("PUT", E, b)
224
+ delete: (d, f = {}) => c("DELETE", d, f),
225
+ get: (d, f = {}) => c("GET", d, f),
226
+ patch: (d, f = {}) => c("PATCH", d, f),
227
+ post: async (d, f = {}) => await c("POST", d, f),
228
+ put: (d, f = {}) => c("PUT", d, f)
223
229
  };
224
- }, Yn = ({
230
+ }, Oe = ({
225
231
  useAdapter: e,
226
232
  ErrorService: t,
227
233
  LoggerService: r
228
- }) => ee("HTTP_SERVICE", Vt(e), [t.ServiceProvider, r.ServiceProvider]);
229
- function it(e, t) {
230
- return function() {
231
- return e.apply(t, arguments);
232
- };
233
- }
234
- const { toString: Kt } = Object.prototype, { getPrototypeOf: Oe } = Object, { iterator: ue, toStringTag: at } = Symbol, le = /* @__PURE__ */ ((e) => (t) => {
235
- const r = Kt.call(t);
236
- return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
237
- })(/* @__PURE__ */ Object.create(null)), N = (e) => (e = e.toLowerCase(), (t) => le(t) === e), fe = (e) => (t) => typeof t === e, { isArray: z } = Array, I = fe("undefined");
238
- function Q(e) {
239
- return e !== null && !I(e) && e.constructor !== null && !I(e.constructor) && x(e.constructor.isBuffer) && e.constructor.isBuffer(e);
240
- }
241
- const ct = N("ArrayBuffer");
242
- function Wt(e) {
243
- let t;
244
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && ct(e.buffer), t;
245
- }
246
- const Gt = fe("string"), x = fe("function"), ut = fe("number"), X = (e) => e !== null && typeof e == "object", Qt = (e) => e === !0 || e === !1, oe = (e) => {
247
- if (le(e) !== "object")
248
- return !1;
249
- const t = Oe(e);
250
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(at in e) && !(ue in e);
251
- }, Xt = (e) => {
252
- if (!X(e) || Q(e))
253
- return !1;
254
- try {
255
- return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
256
- } catch {
257
- return !1;
258
- }
259
- }, Zt = N("Date"), Yt = N("File"), er = N("Blob"), tr = N("FileList"), rr = (e) => X(e) && x(e.pipe), nr = (e) => {
260
- let t;
261
- return e && (typeof FormData == "function" && e instanceof FormData || x(e.append) && ((t = le(e)) === "formdata" || // detect form-data instance
262
- t === "object" && x(e.toString) && e.toString() === "[object FormData]"));
263
- }, sr = N("URLSearchParams"), [or, ir, ar, cr] = ["ReadableStream", "Request", "Response", "Headers"].map(N), ur = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
264
- function Z(e, t, { allOwnKeys: r = !1 } = {}) {
265
- if (e === null || typeof e > "u")
266
- return;
267
- let n, s;
268
- if (typeof e != "object" && (e = [e]), z(e))
269
- for (n = 0, s = e.length; n < s; n++)
270
- t.call(null, e[n], n, e);
271
- else {
272
- if (Q(e))
273
- return;
274
- const o = r ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
275
- let c;
276
- for (n = 0; n < i; n++)
277
- c = o[n], t.call(null, e[c], c, e);
278
- }
279
- }
280
- function lt(e, t) {
281
- if (Q(e))
282
- return null;
283
- t = t.toLowerCase();
284
- const r = Object.keys(e);
285
- let n = r.length, s;
286
- for (; n-- > 0; )
287
- if (s = r[n], t === s.toLowerCase())
288
- return s;
289
- return null;
290
- }
291
- const _ = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ft = (e) => !I(e) && e !== _;
292
- function we() {
293
- const { caseless: e, skipUndefined: t } = ft(this) && this || {}, r = {}, n = (s, o) => {
294
- const i = e && lt(r, o) || o;
295
- oe(r[i]) && oe(s) ? r[i] = we(r[i], s) : oe(s) ? r[i] = we({}, s) : z(s) ? r[i] = s.slice() : (!t || !I(s)) && (r[i] = s);
296
- };
297
- for (let s = 0, o = arguments.length; s < o; s++)
298
- arguments[s] && Z(arguments[s], n);
299
- return r;
300
- }
301
- const lr = (e, t, r, { allOwnKeys: n } = {}) => (Z(t, (s, o) => {
302
- r && x(s) ? e[o] = it(s, r) : e[o] = s;
303
- }, { allOwnKeys: n }), e), fr = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), dr = (e, t, r, n) => {
304
- e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", {
305
- value: t.prototype
306
- }), r && Object.assign(e.prototype, r);
307
- }, hr = (e, t, r, n) => {
308
- let s, o, i;
309
- const c = {};
310
- if (t = t || {}, e == null) return t;
311
- do {
312
- for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
313
- i = s[o], (!n || n(i, e, t)) && !c[i] && (t[i] = e[i], c[i] = !0);
314
- e = r !== !1 && Oe(e);
315
- } while (e && (!r || r(e, t)) && e !== Object.prototype);
316
- return t;
317
- }, pr = (e, t, r) => {
318
- e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
319
- const n = e.indexOf(t, r);
320
- return n !== -1 && n === r;
321
- }, mr = (e) => {
322
- if (!e) return null;
323
- if (z(e)) return e;
324
- let t = e.length;
325
- if (!ut(t)) return null;
326
- const r = new Array(t);
327
- for (; t-- > 0; )
328
- r[t] = e[t];
329
- return r;
330
- }, yr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Oe(Uint8Array)), Er = (e, t) => {
331
- const n = (e && e[ue]).call(e);
332
- let s;
333
- for (; (s = n.next()) && !s.done; ) {
334
- const o = s.value;
335
- t.call(e, o[0], o[1]);
336
- }
337
- }, gr = (e, t) => {
338
- let r;
339
- const n = [];
340
- for (; (r = e.exec(t)) !== null; )
341
- n.push(r);
342
- return n;
343
- }, wr = N("HTMLFormElement"), br = (e) => e.toLowerCase().replace(
344
- /[-_\s]([a-z\d])(\w*)/g,
345
- function(r, n, s) {
346
- return n.toUpperCase() + s;
347
- }
348
- ), qe = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), Sr = N("RegExp"), dt = (e, t) => {
349
- const r = Object.getOwnPropertyDescriptors(e), n = {};
350
- Z(r, (s, o) => {
351
- let i;
352
- (i = t(s, o, e)) !== !1 && (n[o] = i || s);
353
- }), Object.defineProperties(e, n);
354
- }, Rr = (e) => {
355
- dt(e, (t, r) => {
356
- if (x(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
357
- return !1;
358
- const n = e[r];
359
- if (x(n)) {
360
- if (t.enumerable = !1, "writable" in t) {
361
- t.writable = !1;
362
- return;
363
- }
364
- t.set || (t.set = () => {
365
- throw Error("Can not rewrite read-only method '" + r + "'");
366
- });
367
- }
368
- });
369
- }, Or = (e, t) => {
370
- const r = {}, n = (s) => {
371
- s.forEach((o) => {
372
- r[o] = !0;
373
- });
374
- };
375
- return z(e) ? n(e) : n(String(e).split(t)), r;
376
- }, Tr = () => {
377
- }, Ar = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
378
- function Cr(e) {
379
- return !!(e && x(e.append) && e[at] === "FormData" && e[ue]);
380
- }
381
- const xr = (e) => {
382
- const t = new Array(10), r = (n, s) => {
383
- if (X(n)) {
384
- if (t.indexOf(n) >= 0)
385
- return;
386
- if (Q(n))
387
- return n;
388
- if (!("toJSON" in n)) {
389
- t[s] = n;
390
- const o = z(n) ? [] : {};
391
- return Z(n, (i, c) => {
392
- const h = r(i, s + 1);
393
- !I(h) && (o[c] = h);
394
- }), t[s] = void 0, o;
395
- }
396
- }
397
- return n;
398
- };
399
- return r(e, 0);
400
- }, vr = N("AsyncFunction"), Pr = (e) => e && (X(e) || x(e)) && x(e.then) && x(e.catch), ht = ((e, t) => e ? setImmediate : t ? ((r, n) => (_.addEventListener("message", ({ source: s, data: o }) => {
401
- s === _ && o === r && n.length && n.shift()();
402
- }, !1), (s) => {
403
- n.push(s), _.postMessage(r, "*");
404
- }))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
405
- typeof setImmediate == "function",
406
- x(_.postMessage)
407
- ), Lr = typeof queueMicrotask < "u" ? queueMicrotask.bind(_) : typeof process < "u" && process.nextTick || ht, Nr = (e) => e != null && x(e[ue]), l = {
408
- isArray: z,
409
- isArrayBuffer: ct,
410
- isBuffer: Q,
411
- isFormData: nr,
412
- isArrayBufferView: Wt,
413
- isString: Gt,
414
- isNumber: ut,
415
- isBoolean: Qt,
416
- isObject: X,
417
- isPlainObject: oe,
418
- isEmptyObject: Xt,
419
- isReadableStream: or,
420
- isRequest: ir,
421
- isResponse: ar,
422
- isHeaders: cr,
423
- isUndefined: I,
424
- isDate: Zt,
425
- isFile: Yt,
426
- isBlob: er,
427
- isRegExp: Sr,
428
- isFunction: x,
429
- isStream: rr,
430
- isURLSearchParams: sr,
431
- isTypedArray: yr,
432
- isFileList: tr,
433
- forEach: Z,
434
- merge: we,
435
- extend: lr,
436
- trim: ur,
437
- stripBOM: fr,
438
- inherits: dr,
439
- toFlatObject: hr,
440
- kindOf: le,
441
- kindOfTest: N,
442
- endsWith: pr,
443
- toArray: mr,
444
- forEachEntry: Er,
445
- matchAll: gr,
446
- isHTMLForm: wr,
447
- hasOwnProperty: qe,
448
- hasOwnProp: qe,
449
- // an alias to avoid ESLint no-prototype-builtins detection
450
- reduceDescriptors: dt,
451
- freezeMethods: Rr,
452
- toObjectSet: Or,
453
- toCamelCase: br,
454
- noop: Tr,
455
- toFiniteNumber: Ar,
456
- findKey: lt,
457
- global: _,
458
- isContextDefined: ft,
459
- isSpecCompliantForm: Cr,
460
- toJSONObject: xr,
461
- isAsyncFn: vr,
462
- isThenable: Pr,
463
- setImmediate: ht,
464
- asap: Lr,
465
- isIterable: Nr
466
- };
467
- function w(e, t, r, n, s) {
468
- Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), r && (this.config = r), n && (this.request = n), s && (this.response = s, this.status = s.status ? s.status : null);
469
- }
470
- l.inherits(w, Error, {
471
- toJSON: function() {
472
- return {
473
- // Standard
474
- message: this.message,
475
- name: this.name,
476
- // Microsoft
477
- description: this.description,
478
- number: this.number,
479
- // Mozilla
480
- fileName: this.fileName,
481
- lineNumber: this.lineNumber,
482
- columnNumber: this.columnNumber,
483
- stack: this.stack,
484
- // Axios
485
- config: l.toJSONObject(this.config),
486
- code: this.code,
487
- status: this.status
488
- };
489
- }
490
- });
491
- const pt = w.prototype, mt = {};
492
- [
493
- "ERR_BAD_OPTION_VALUE",
494
- "ERR_BAD_OPTION",
495
- "ECONNABORTED",
496
- "ETIMEDOUT",
497
- "ERR_NETWORK",
498
- "ERR_FR_TOO_MANY_REDIRECTS",
499
- "ERR_DEPRECATED",
500
- "ERR_BAD_RESPONSE",
501
- "ERR_BAD_REQUEST",
502
- "ERR_CANCELED",
503
- "ERR_NOT_SUPPORT",
504
- "ERR_INVALID_URL"
505
- // eslint-disable-next-line func-names
506
- ].forEach((e) => {
507
- mt[e] = { value: e };
508
- });
509
- Object.defineProperties(w, mt);
510
- Object.defineProperty(pt, "isAxiosError", { value: !0 });
511
- w.from = (e, t, r, n, s, o) => {
512
- const i = Object.create(pt);
513
- l.toFlatObject(e, i, function(a) {
514
- return a !== Error.prototype;
515
- }, (u) => u !== "isAxiosError");
516
- const c = e && e.message ? e.message : "Error", h = t == null && e ? e.code : t;
517
- return w.call(i, c, h, r, n, s), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", o && Object.assign(i, o), i;
518
- };
519
- const Fr = null;
520
- function be(e) {
521
- return l.isPlainObject(e) || l.isArray(e);
522
- }
523
- function yt(e) {
524
- return l.endsWith(e, "[]") ? e.slice(0, -2) : e;
525
- }
526
- function je(e, t, r) {
527
- return e ? e.concat(t).map(function(s, o) {
528
- return s = yt(s), !r && o ? "[" + s + "]" : s;
529
- }).join(r ? "." : "") : t;
530
- }
531
- function Ur(e) {
532
- return l.isArray(e) && !e.some(be);
533
- }
534
- const kr = l.toFlatObject(l, {}, null, function(t) {
535
- return /^is[A-Z]/.test(t);
536
- });
537
- function de(e, t, r) {
538
- if (!l.isObject(e))
539
- throw new TypeError("target must be an object");
540
- t = t || new FormData(), r = l.toFlatObject(r, {
541
- metaTokens: !0,
542
- dots: !1,
543
- indexes: !1
544
- }, !1, function(y, p) {
545
- return !l.isUndefined(p[y]);
546
- });
547
- const n = r.metaTokens, s = r.visitor || a, o = r.dots, i = r.indexes, h = (r.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(t);
548
- if (!l.isFunction(s))
549
- throw new TypeError("visitor must be a function");
550
- function u(d) {
551
- if (d === null) return "";
552
- if (l.isDate(d))
553
- return d.toISOString();
554
- if (l.isBoolean(d))
555
- return d.toString();
556
- if (!h && l.isBlob(d))
557
- throw new w("Blob is not supported. Use a Buffer instead.");
558
- return l.isArrayBuffer(d) || l.isTypedArray(d) ? h && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
559
- }
560
- function a(d, y, p) {
561
- let E = d;
562
- if (d && !p && typeof d == "object") {
563
- if (l.endsWith(y, "{}"))
564
- y = n ? y : y.slice(0, -2), d = JSON.stringify(d);
565
- else if (l.isArray(d) && Ur(d) || (l.isFileList(d) || l.endsWith(y, "[]")) && (E = l.toArray(d)))
566
- return y = yt(y), E.forEach(function(S, O) {
567
- !(l.isUndefined(S) || S === null) && t.append(
568
- // eslint-disable-next-line no-nested-ternary
569
- i === !0 ? je([y], O, o) : i === null ? y : y + "[]",
570
- u(S)
571
- );
572
- }), !1;
573
- }
574
- return be(d) ? !0 : (t.append(je(p, y, o), u(d)), !1);
575
- }
576
- const f = [], m = Object.assign(kr, {
577
- defaultVisitor: a,
578
- convertValue: u,
579
- isVisitable: be
580
- });
581
- function g(d, y) {
582
- if (!l.isUndefined(d)) {
583
- if (f.indexOf(d) !== -1)
584
- throw Error("Circular reference detected in " + y.join("."));
585
- f.push(d), l.forEach(d, function(E, b) {
586
- (!(l.isUndefined(E) || E === null) && s.call(
587
- t,
588
- E,
589
- l.isString(b) ? b.trim() : b,
590
- y,
591
- m
592
- )) === !0 && g(E, y ? y.concat(b) : [b]);
593
- }), f.pop();
594
- }
595
- }
596
- if (!l.isObject(e))
597
- throw new TypeError("data must be an object");
598
- return g(e), t;
599
- }
600
- function Ie(e) {
601
- const t = {
602
- "!": "%21",
603
- "'": "%27",
604
- "(": "%28",
605
- ")": "%29",
606
- "~": "%7E",
607
- "%20": "+",
608
- "%00": "\0"
609
- };
610
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) {
611
- return t[n];
612
- });
613
- }
614
- function Te(e, t) {
615
- this._pairs = [], e && de(e, this, t);
616
- }
617
- const Et = Te.prototype;
618
- Et.append = function(t, r) {
619
- this._pairs.push([t, r]);
620
- };
621
- Et.toString = function(t) {
622
- const r = t ? function(n) {
623
- return t.call(this, n, Ie);
624
- } : Ie;
625
- return this._pairs.map(function(s) {
626
- return r(s[0]) + "=" + r(s[1]);
627
- }, "").join("&");
628
- };
629
- function Br(e) {
630
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
631
- }
632
- function gt(e, t, r) {
633
- if (!t)
634
- return e;
635
- const n = r && r.encode || Br;
636
- l.isFunction(r) && (r = {
637
- serialize: r
638
- });
639
- const s = r && r.serialize;
640
- let o;
641
- if (s ? o = s(t, r) : o = l.isURLSearchParams(t) ? t.toString() : new Te(t, r).toString(n), o) {
642
- const i = e.indexOf("#");
643
- i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
644
- }
645
- return e;
646
- }
647
- class $e {
648
- constructor() {
649
- this.handlers = [];
650
- }
651
- /**
652
- * Add a new interceptor to the stack
653
- *
654
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
655
- * @param {Function} rejected The function to handle `reject` for a `Promise`
656
- *
657
- * @return {Number} An ID used to remove interceptor later
658
- */
659
- use(t, r, n) {
660
- return this.handlers.push({
661
- fulfilled: t,
662
- rejected: r,
663
- synchronous: n ? n.synchronous : !1,
664
- runWhen: n ? n.runWhen : null
665
- }), this.handlers.length - 1;
666
- }
667
- /**
668
- * Remove an interceptor from the stack
669
- *
670
- * @param {Number} id The ID that was returned by `use`
671
- *
672
- * @returns {void}
673
- */
674
- eject(t) {
675
- this.handlers[t] && (this.handlers[t] = null);
676
- }
677
- /**
678
- * Clear all interceptors from the stack
679
- *
680
- * @returns {void}
681
- */
682
- clear() {
683
- this.handlers && (this.handlers = []);
684
- }
685
- /**
686
- * Iterate over all the registered interceptors
687
- *
688
- * This method is particularly useful for skipping over any
689
- * interceptors that may have become `null` calling `eject`.
690
- *
691
- * @param {Function} fn The function to call for each interceptor
692
- *
693
- * @returns {void}
694
- */
695
- forEach(t) {
696
- l.forEach(this.handlers, function(n) {
697
- n !== null && t(n);
698
- });
699
- }
700
- }
701
- const wt = {
702
- silentJSONParsing: !0,
703
- forcedJSONParsing: !0,
704
- clarifyTimeoutError: !1
705
- }, Dr = typeof URLSearchParams < "u" ? URLSearchParams : Te, _r = typeof FormData < "u" ? FormData : null, Mr = typeof Blob < "u" ? Blob : null, Hr = {
706
- isBrowser: !0,
707
- classes: {
708
- URLSearchParams: Dr,
709
- FormData: _r,
710
- Blob: Mr
711
- },
712
- protocols: ["http", "https", "file", "blob", "url", "data"]
713
- }, Ae = typeof window < "u" && typeof document < "u", Se = typeof navigator == "object" && navigator || void 0, qr = Ae && (!Se || ["ReactNative", "NativeScript", "NS"].indexOf(Se.product) < 0), jr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
714
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Ir = Ae && window.location.href || "http://localhost", $r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
715
- __proto__: null,
716
- hasBrowserEnv: Ae,
717
- hasStandardBrowserEnv: qr,
718
- hasStandardBrowserWebWorkerEnv: jr,
719
- navigator: Se,
720
- origin: Ir
721
- }, Symbol.toStringTag, { value: "Module" })), C = {
722
- ...$r,
723
- ...Hr
724
- };
725
- function zr(e, t) {
726
- return de(e, new C.classes.URLSearchParams(), {
727
- visitor: function(r, n, s, o) {
728
- return C.isNode && l.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
729
- },
730
- ...t
731
- });
732
- }
733
- function Jr(e) {
734
- return l.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
735
- }
736
- function Vr(e) {
737
- const t = {}, r = Object.keys(e);
738
- let n;
739
- const s = r.length;
740
- let o;
741
- for (n = 0; n < s; n++)
742
- o = r[n], t[o] = e[o];
743
- return t;
744
- }
745
- function bt(e) {
746
- function t(r, n, s, o) {
747
- let i = r[o++];
748
- if (i === "__proto__") return !0;
749
- const c = Number.isFinite(+i), h = o >= r.length;
750
- return i = !i && l.isArray(s) ? s.length : i, h ? (l.hasOwnProp(s, i) ? s[i] = [s[i], n] : s[i] = n, !c) : ((!s[i] || !l.isObject(s[i])) && (s[i] = []), t(r, n, s[i], o) && l.isArray(s[i]) && (s[i] = Vr(s[i])), !c);
751
- }
752
- if (l.isFormData(e) && l.isFunction(e.entries)) {
753
- const r = {};
754
- return l.forEachEntry(e, (n, s) => {
755
- t(Jr(n), s, r, 0);
756
- }), r;
757
- }
758
- return null;
759
- }
760
- function Kr(e, t, r) {
761
- if (l.isString(e))
762
- try {
763
- return (t || JSON.parse)(e), l.trim(e);
764
- } catch (n) {
765
- if (n.name !== "SyntaxError")
766
- throw n;
767
- }
768
- return (r || JSON.stringify)(e);
769
- }
770
- const Y = {
771
- transitional: wt,
772
- adapter: ["xhr", "http", "fetch"],
773
- transformRequest: [function(t, r) {
774
- const n = r.getContentType() || "", s = n.indexOf("application/json") > -1, o = l.isObject(t);
775
- if (o && l.isHTMLForm(t) && (t = new FormData(t)), l.isFormData(t))
776
- return s ? JSON.stringify(bt(t)) : t;
777
- if (l.isArrayBuffer(t) || l.isBuffer(t) || l.isStream(t) || l.isFile(t) || l.isBlob(t) || l.isReadableStream(t))
778
- return t;
779
- if (l.isArrayBufferView(t))
780
- return t.buffer;
781
- if (l.isURLSearchParams(t))
782
- return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
783
- let c;
784
- if (o) {
785
- if (n.indexOf("application/x-www-form-urlencoded") > -1)
786
- return zr(t, this.formSerializer).toString();
787
- if ((c = l.isFileList(t)) || n.indexOf("multipart/form-data") > -1) {
788
- const h = this.env && this.env.FormData;
789
- return de(
790
- c ? { "files[]": t } : t,
791
- h && new h(),
792
- this.formSerializer
793
- );
794
- }
795
- }
796
- return o || s ? (r.setContentType("application/json", !1), Kr(t)) : t;
797
- }],
798
- transformResponse: [function(t) {
799
- const r = this.transitional || Y.transitional, n = r && r.forcedJSONParsing, s = this.responseType === "json";
800
- if (l.isResponse(t) || l.isReadableStream(t))
801
- return t;
802
- if (t && l.isString(t) && (n && !this.responseType || s)) {
803
- const i = !(r && r.silentJSONParsing) && s;
804
- try {
805
- return JSON.parse(t, this.parseReviver);
806
- } catch (c) {
807
- if (i)
808
- throw c.name === "SyntaxError" ? w.from(c, w.ERR_BAD_RESPONSE, this, null, this.response) : c;
809
- }
810
- }
811
- return t;
812
- }],
813
- /**
814
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
815
- * timeout is not created.
816
- */
817
- timeout: 0,
818
- xsrfCookieName: "XSRF-TOKEN",
819
- xsrfHeaderName: "X-XSRF-TOKEN",
820
- maxContentLength: -1,
821
- maxBodyLength: -1,
822
- env: {
823
- FormData: C.classes.FormData,
824
- Blob: C.classes.Blob
825
- },
826
- validateStatus: function(t) {
827
- return t >= 200 && t < 300;
828
- },
829
- headers: {
830
- common: {
831
- Accept: "application/json, text/plain, */*",
832
- "Content-Type": void 0
833
- }
834
- }
835
- };
836
- l.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
837
- Y.headers[e] = {};
838
- });
839
- const Wr = l.toObjectSet([
840
- "age",
841
- "authorization",
842
- "content-length",
843
- "content-type",
844
- "etag",
845
- "expires",
846
- "from",
847
- "host",
848
- "if-modified-since",
849
- "if-unmodified-since",
850
- "last-modified",
851
- "location",
852
- "max-forwards",
853
- "proxy-authorization",
854
- "referer",
855
- "retry-after",
856
- "user-agent"
857
- ]), Gr = (e) => {
858
- const t = {};
859
- let r, n, s;
860
- return e && e.split(`
861
- `).forEach(function(i) {
862
- s = i.indexOf(":"), r = i.substring(0, s).trim().toLowerCase(), n = i.substring(s + 1).trim(), !(!r || t[r] && Wr[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
863
- }), t;
864
- }, ze = Symbol("internals");
865
- function K(e) {
866
- return e && String(e).trim().toLowerCase();
867
- }
868
- function ie(e) {
869
- return e === !1 || e == null ? e : l.isArray(e) ? e.map(ie) : String(e);
870
- }
871
- function Qr(e) {
872
- const t = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
873
- let n;
874
- for (; n = r.exec(e); )
875
- t[n[1]] = n[2];
876
- return t;
877
- }
878
- const Xr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
879
- function ye(e, t, r, n, s) {
880
- if (l.isFunction(n))
881
- return n.call(this, t, r);
882
- if (s && (t = r), !!l.isString(t)) {
883
- if (l.isString(n))
884
- return t.indexOf(n) !== -1;
885
- if (l.isRegExp(n))
886
- return n.test(t);
887
- }
888
- }
889
- function Zr(e) {
890
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, n) => r.toUpperCase() + n);
891
- }
892
- function Yr(e, t) {
893
- const r = l.toCamelCase(" " + t);
894
- ["get", "set", "has"].forEach((n) => {
895
- Object.defineProperty(e, n + r, {
896
- value: function(s, o, i) {
897
- return this[n].call(this, t, s, o, i);
898
- },
899
- configurable: !0
900
- });
901
- });
902
- }
903
- let v = class {
904
- constructor(t) {
905
- t && this.set(t);
906
- }
907
- set(t, r, n) {
908
- const s = this;
909
- function o(c, h, u) {
910
- const a = K(h);
911
- if (!a)
912
- throw new Error("header name must be a non-empty string");
913
- const f = l.findKey(s, a);
914
- (!f || s[f] === void 0 || u === !0 || u === void 0 && s[f] !== !1) && (s[f || h] = ie(c));
915
- }
916
- const i = (c, h) => l.forEach(c, (u, a) => o(u, a, h));
917
- if (l.isPlainObject(t) || t instanceof this.constructor)
918
- i(t, r);
919
- else if (l.isString(t) && (t = t.trim()) && !Xr(t))
920
- i(Gr(t), r);
921
- else if (l.isObject(t) && l.isIterable(t)) {
922
- let c = {}, h, u;
923
- for (const a of t) {
924
- if (!l.isArray(a))
925
- throw TypeError("Object iterator must return a key-value pair");
926
- c[u = a[0]] = (h = c[u]) ? l.isArray(h) ? [...h, a[1]] : [h, a[1]] : a[1];
927
- }
928
- i(c, r);
929
- } else
930
- t != null && o(r, t, n);
931
- return this;
932
- }
933
- get(t, r) {
934
- if (t = K(t), t) {
935
- const n = l.findKey(this, t);
936
- if (n) {
937
- const s = this[n];
938
- if (!r)
939
- return s;
940
- if (r === !0)
941
- return Qr(s);
942
- if (l.isFunction(r))
943
- return r.call(this, s, n);
944
- if (l.isRegExp(r))
945
- return r.exec(s);
946
- throw new TypeError("parser must be boolean|regexp|function");
947
- }
948
- }
949
- }
950
- has(t, r) {
951
- if (t = K(t), t) {
952
- const n = l.findKey(this, t);
953
- return !!(n && this[n] !== void 0 && (!r || ye(this, this[n], n, r)));
954
- }
955
- return !1;
956
- }
957
- delete(t, r) {
958
- const n = this;
959
- let s = !1;
960
- function o(i) {
961
- if (i = K(i), i) {
962
- const c = l.findKey(n, i);
963
- c && (!r || ye(n, n[c], c, r)) && (delete n[c], s = !0);
964
- }
965
- }
966
- return l.isArray(t) ? t.forEach(o) : o(t), s;
967
- }
968
- clear(t) {
969
- const r = Object.keys(this);
970
- let n = r.length, s = !1;
971
- for (; n--; ) {
972
- const o = r[n];
973
- (!t || ye(this, this[o], o, t, !0)) && (delete this[o], s = !0);
974
- }
975
- return s;
976
- }
977
- normalize(t) {
978
- const r = this, n = {};
979
- return l.forEach(this, (s, o) => {
980
- const i = l.findKey(n, o);
981
- if (i) {
982
- r[i] = ie(s), delete r[o];
983
- return;
984
- }
985
- const c = t ? Zr(o) : String(o).trim();
986
- c !== o && delete r[o], r[c] = ie(s), n[c] = !0;
987
- }), this;
988
- }
989
- concat(...t) {
990
- return this.constructor.concat(this, ...t);
991
- }
992
- toJSON(t) {
993
- const r = /* @__PURE__ */ Object.create(null);
994
- return l.forEach(this, (n, s) => {
995
- n != null && n !== !1 && (r[s] = t && l.isArray(n) ? n.join(", ") : n);
996
- }), r;
997
- }
998
- [Symbol.iterator]() {
999
- return Object.entries(this.toJSON())[Symbol.iterator]();
1000
- }
1001
- toString() {
1002
- return Object.entries(this.toJSON()).map(([t, r]) => t + ": " + r).join(`
1003
- `);
1004
- }
1005
- getSetCookie() {
1006
- return this.get("set-cookie") || [];
1007
- }
1008
- get [Symbol.toStringTag]() {
1009
- return "AxiosHeaders";
1010
- }
1011
- static from(t) {
1012
- return t instanceof this ? t : new this(t);
1013
- }
1014
- static concat(t, ...r) {
1015
- const n = new this(t);
1016
- return r.forEach((s) => n.set(s)), n;
1017
- }
1018
- static accessor(t) {
1019
- const n = (this[ze] = this[ze] = {
1020
- accessors: {}
1021
- }).accessors, s = this.prototype;
1022
- function o(i) {
1023
- const c = K(i);
1024
- n[c] || (Yr(s, i), n[c] = !0);
1025
- }
1026
- return l.isArray(t) ? t.forEach(o) : o(t), this;
1027
- }
1028
- };
1029
- v.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1030
- l.reduceDescriptors(v.prototype, ({ value: e }, t) => {
1031
- let r = t[0].toUpperCase() + t.slice(1);
1032
- return {
1033
- get: () => e,
1034
- set(n) {
1035
- this[r] = n;
1036
- }
1037
- };
1038
- });
1039
- l.freezeMethods(v);
1040
- function Ee(e, t) {
1041
- const r = this || Y, n = t || r, s = v.from(n.headers);
1042
- let o = n.data;
1043
- return l.forEach(e, function(c) {
1044
- o = c.call(r, o, s.normalize(), t ? t.status : void 0);
1045
- }), s.normalize(), o;
1046
- }
1047
- function St(e) {
1048
- return !!(e && e.__CANCEL__);
1049
- }
1050
- function J(e, t, r) {
1051
- w.call(this, e ?? "canceled", w.ERR_CANCELED, t, r), this.name = "CanceledError";
1052
- }
1053
- l.inherits(J, w, {
1054
- __CANCEL__: !0
1055
- });
1056
- function Rt(e, t, r) {
1057
- const n = r.config.validateStatus;
1058
- !r.status || !n || n(r.status) ? e(r) : t(new w(
1059
- "Request failed with status code " + r.status,
1060
- [w.ERR_BAD_REQUEST, w.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
1061
- r.config,
1062
- r.request,
1063
- r
1064
- ));
1065
- }
1066
- function en(e) {
1067
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
1068
- return t && t[1] || "";
1069
- }
1070
- function tn(e, t) {
1071
- e = e || 10;
1072
- const r = new Array(e), n = new Array(e);
1073
- let s = 0, o = 0, i;
1074
- return t = t !== void 0 ? t : 1e3, function(h) {
1075
- const u = Date.now(), a = n[o];
1076
- i || (i = u), r[s] = h, n[s] = u;
1077
- let f = o, m = 0;
1078
- for (; f !== s; )
1079
- m += r[f++], f = f % e;
1080
- if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
1081
- return;
1082
- const g = a && u - a;
1083
- return g ? Math.round(m * 1e3 / g) : void 0;
1084
- };
1085
- }
1086
- function rn(e, t) {
1087
- let r = 0, n = 1e3 / t, s, o;
1088
- const i = (u, a = Date.now()) => {
1089
- r = a, s = null, o && (clearTimeout(o), o = null), e(...u);
1090
- };
1091
- return [(...u) => {
1092
- const a = Date.now(), f = a - r;
1093
- f >= n ? i(u, a) : (s = u, o || (o = setTimeout(() => {
1094
- o = null, i(s);
1095
- }, n - f)));
1096
- }, () => s && i(s)];
1097
- }
1098
- const ce = (e, t, r = 3) => {
1099
- let n = 0;
1100
- const s = tn(50, 250);
1101
- return rn((o) => {
1102
- const i = o.loaded, c = o.lengthComputable ? o.total : void 0, h = i - n, u = s(h), a = i <= c;
1103
- n = i;
1104
- const f = {
1105
- loaded: i,
1106
- total: c,
1107
- progress: c ? i / c : void 0,
1108
- bytes: h,
1109
- rate: u || void 0,
1110
- estimated: u && c && a ? (c - i) / u : void 0,
1111
- event: o,
1112
- lengthComputable: c != null,
1113
- [t ? "download" : "upload"]: !0
1114
- };
1115
- e(f);
1116
- }, r);
1117
- }, Je = (e, t) => {
1118
- const r = e != null;
1119
- return [(n) => t[0]({
1120
- lengthComputable: r,
1121
- total: e,
1122
- loaded: n
1123
- }), t[1]];
1124
- }, Ve = (e) => (...t) => l.asap(() => e(...t)), nn = C.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, C.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))(
1125
- new URL(C.origin),
1126
- C.navigator && /(msie|trident)/i.test(C.navigator.userAgent)
1127
- ) : () => !0, sn = C.hasStandardBrowserEnv ? (
1128
- // Standard browser envs support document.cookie
1129
- {
1130
- write(e, t, r, n, s, o, i) {
1131
- if (typeof document > "u") return;
1132
- const c = [`${e}=${encodeURIComponent(t)}`];
1133
- l.isNumber(r) && c.push(`expires=${new Date(r).toUTCString()}`), l.isString(n) && c.push(`path=${n}`), l.isString(s) && c.push(`domain=${s}`), o === !0 && c.push("secure"), l.isString(i) && c.push(`SameSite=${i}`), document.cookie = c.join("; ");
1134
- },
1135
- read(e) {
1136
- if (typeof document > "u") return null;
1137
- const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
1138
- return t ? decodeURIComponent(t[1]) : null;
1139
- },
1140
- remove(e) {
1141
- this.write(e, "", Date.now() - 864e5, "/");
1142
- }
1143
- }
1144
- ) : (
1145
- // Non-standard browser env (web workers, react-native) lack needed support.
1146
- {
1147
- write() {
1148
- },
1149
- read() {
1150
- return null;
1151
- },
1152
- remove() {
1153
- }
1154
- }
1155
- );
1156
- function on(e) {
1157
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1158
- }
1159
- function an(e, t) {
1160
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1161
- }
1162
- function Ot(e, t, r) {
1163
- let n = !on(t);
1164
- return e && (n || r == !1) ? an(e, t) : t;
1165
- }
1166
- const Ke = (e) => e instanceof v ? { ...e } : e;
1167
- function H(e, t) {
1168
- t = t || {};
1169
- const r = {};
1170
- function n(u, a, f, m) {
1171
- return l.isPlainObject(u) && l.isPlainObject(a) ? l.merge.call({ caseless: m }, u, a) : l.isPlainObject(a) ? l.merge({}, a) : l.isArray(a) ? a.slice() : a;
1172
- }
1173
- function s(u, a, f, m) {
1174
- if (l.isUndefined(a)) {
1175
- if (!l.isUndefined(u))
1176
- return n(void 0, u, f, m);
1177
- } else return n(u, a, f, m);
1178
- }
1179
- function o(u, a) {
1180
- if (!l.isUndefined(a))
1181
- return n(void 0, a);
1182
- }
1183
- function i(u, a) {
1184
- if (l.isUndefined(a)) {
1185
- if (!l.isUndefined(u))
1186
- return n(void 0, u);
1187
- } else return n(void 0, a);
1188
- }
1189
- function c(u, a, f) {
1190
- if (f in t)
1191
- return n(u, a);
1192
- if (f in e)
1193
- return n(void 0, u);
1194
- }
1195
- const h = {
1196
- url: o,
1197
- method: o,
1198
- data: o,
1199
- baseURL: i,
1200
- transformRequest: i,
1201
- transformResponse: i,
1202
- paramsSerializer: i,
1203
- timeout: i,
1204
- timeoutMessage: i,
1205
- withCredentials: i,
1206
- withXSRFToken: i,
1207
- adapter: i,
1208
- responseType: i,
1209
- xsrfCookieName: i,
1210
- xsrfHeaderName: i,
1211
- onUploadProgress: i,
1212
- onDownloadProgress: i,
1213
- decompress: i,
1214
- maxContentLength: i,
1215
- maxBodyLength: i,
1216
- beforeRedirect: i,
1217
- transport: i,
1218
- httpAgent: i,
1219
- httpsAgent: i,
1220
- cancelToken: i,
1221
- socketPath: i,
1222
- responseEncoding: i,
1223
- validateStatus: c,
1224
- headers: (u, a, f) => s(Ke(u), Ke(a), f, !0)
1225
- };
1226
- return l.forEach(Object.keys({ ...e, ...t }), function(a) {
1227
- const f = h[a] || s, m = f(e[a], t[a], a);
1228
- l.isUndefined(m) && f !== c || (r[a] = m);
1229
- }), r;
1230
- }
1231
- const Tt = (e) => {
1232
- const t = H({}, e);
1233
- let { data: r, withXSRFToken: n, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
1234
- if (t.headers = i = v.from(i), t.url = gt(Ot(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && i.set(
1235
- "Authorization",
1236
- "Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
1237
- ), l.isFormData(r)) {
1238
- if (C.hasStandardBrowserEnv || C.hasStandardBrowserWebWorkerEnv)
1239
- i.setContentType(void 0);
1240
- else if (l.isFunction(r.getHeaders)) {
1241
- const h = r.getHeaders(), u = ["content-type", "content-length"];
1242
- Object.entries(h).forEach(([a, f]) => {
1243
- u.includes(a.toLowerCase()) && i.set(a, f);
1244
- });
1245
- }
1246
- }
1247
- if (C.hasStandardBrowserEnv && (n && l.isFunction(n) && (n = n(t)), n || n !== !1 && nn(t.url))) {
1248
- const h = s && o && sn.read(o);
1249
- h && i.set(s, h);
1250
- }
1251
- return t;
1252
- }, cn = typeof XMLHttpRequest < "u", un = cn && function(e) {
1253
- return new Promise(function(r, n) {
1254
- const s = Tt(e);
1255
- let o = s.data;
1256
- const i = v.from(s.headers).normalize();
1257
- let { responseType: c, onUploadProgress: h, onDownloadProgress: u } = s, a, f, m, g, d;
1258
- function y() {
1259
- g && g(), d && d(), s.cancelToken && s.cancelToken.unsubscribe(a), s.signal && s.signal.removeEventListener("abort", a);
1260
- }
1261
- let p = new XMLHttpRequest();
1262
- p.open(s.method.toUpperCase(), s.url, !0), p.timeout = s.timeout;
1263
- function E() {
1264
- if (!p)
1265
- return;
1266
- const S = v.from(
1267
- "getAllResponseHeaders" in p && p.getAllResponseHeaders()
1268
- ), T = {
1269
- data: !c || c === "text" || c === "json" ? p.responseText : p.response,
1270
- status: p.status,
1271
- statusText: p.statusText,
1272
- headers: S,
1273
- config: e,
1274
- request: p
1275
- };
1276
- Rt(function(A) {
1277
- r(A), y();
1278
- }, function(A) {
1279
- n(A), y();
1280
- }, T), p = null;
1281
- }
1282
- "onloadend" in p ? p.onloadend = E : p.onreadystatechange = function() {
1283
- !p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(E);
1284
- }, p.onabort = function() {
1285
- p && (n(new w("Request aborted", w.ECONNABORTED, e, p)), p = null);
1286
- }, p.onerror = function(O) {
1287
- const T = O && O.message ? O.message : "Network Error", P = new w(T, w.ERR_NETWORK, e, p);
1288
- P.event = O || null, n(P), p = null;
1289
- }, p.ontimeout = function() {
1290
- let O = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1291
- const T = s.transitional || wt;
1292
- s.timeoutErrorMessage && (O = s.timeoutErrorMessage), n(new w(
1293
- O,
1294
- T.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
1295
- e,
1296
- p
1297
- )), p = null;
1298
- }, o === void 0 && i.setContentType(null), "setRequestHeader" in p && l.forEach(i.toJSON(), function(O, T) {
1299
- p.setRequestHeader(T, O);
1300
- }), l.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([m, d] = ce(u, !0), p.addEventListener("progress", m)), h && p.upload && ([f, g] = ce(h), p.upload.addEventListener("progress", f), p.upload.addEventListener("loadend", g)), (s.cancelToken || s.signal) && (a = (S) => {
1301
- p && (n(!S || S.type ? new J(null, e, p) : S), p.abort(), p = null);
1302
- }, s.cancelToken && s.cancelToken.subscribe(a), s.signal && (s.signal.aborted ? a() : s.signal.addEventListener("abort", a)));
1303
- const b = en(s.url);
1304
- if (b && C.protocols.indexOf(b) === -1) {
1305
- n(new w("Unsupported protocol " + b + ":", w.ERR_BAD_REQUEST, e));
1306
- return;
1307
- }
1308
- p.send(o || null);
1309
- });
1310
- }, ln = (e, t) => {
1311
- const { length: r } = e = e ? e.filter(Boolean) : [];
1312
- if (t || r) {
1313
- let n = new AbortController(), s;
1314
- const o = function(u) {
1315
- if (!s) {
1316
- s = !0, c();
1317
- const a = u instanceof Error ? u : this.reason;
1318
- n.abort(a instanceof w ? a : new J(a instanceof Error ? a.message : a));
1319
- }
1320
- };
1321
- let i = t && setTimeout(() => {
1322
- i = null, o(new w(`timeout ${t} of ms exceeded`, w.ETIMEDOUT));
1323
- }, t);
1324
- const c = () => {
1325
- e && (i && clearTimeout(i), i = null, e.forEach((u) => {
1326
- u.unsubscribe ? u.unsubscribe(o) : u.removeEventListener("abort", o);
1327
- }), e = null);
1328
- };
1329
- e.forEach((u) => u.addEventListener("abort", o));
1330
- const { signal: h } = n;
1331
- return h.unsubscribe = () => l.asap(c), h;
1332
- }
1333
- }, fn = function* (e, t) {
1334
- let r = e.byteLength;
1335
- if (r < t) {
1336
- yield e;
1337
- return;
1338
- }
1339
- let n = 0, s;
1340
- for (; n < r; )
1341
- s = n + t, yield e.slice(n, s), n = s;
1342
- }, dn = async function* (e, t) {
1343
- for await (const r of hn(e))
1344
- yield* fn(r, t);
1345
- }, hn = async function* (e) {
1346
- if (e[Symbol.asyncIterator]) {
1347
- yield* e;
1348
- return;
1349
- }
1350
- const t = e.getReader();
1351
- try {
1352
- for (; ; ) {
1353
- const { done: r, value: n } = await t.read();
1354
- if (r)
1355
- break;
1356
- yield n;
1357
- }
1358
- } finally {
1359
- await t.cancel();
1360
- }
1361
- }, We = (e, t, r, n) => {
1362
- const s = dn(e, t);
1363
- let o = 0, i, c = (h) => {
1364
- i || (i = !0, n && n(h));
1365
- };
1366
- return new ReadableStream({
1367
- async pull(h) {
1368
- try {
1369
- const { done: u, value: a } = await s.next();
1370
- if (u) {
1371
- c(), h.close();
1372
- return;
1373
- }
1374
- let f = a.byteLength;
1375
- if (r) {
1376
- let m = o += f;
1377
- r(m);
1378
- }
1379
- h.enqueue(new Uint8Array(a));
1380
- } catch (u) {
1381
- throw c(u), u;
1382
- }
1383
- },
1384
- cancel(h) {
1385
- return c(h), s.return();
1386
- }
1387
- }, {
1388
- highWaterMark: 2
1389
- });
1390
- }, Ge = 64 * 1024, { isFunction: se } = l, pn = (({ Request: e, Response: t }) => ({
1391
- Request: e,
1392
- Response: t
1393
- }))(l.global), {
1394
- ReadableStream: Qe,
1395
- TextEncoder: Xe
1396
- } = l.global, Ze = (e, ...t) => {
1397
- try {
1398
- return !!e(...t);
1399
- } catch {
1400
- return !1;
1401
- }
1402
- }, mn = (e) => {
1403
- e = l.merge.call({
1404
- skipUndefined: !0
1405
- }, pn, e);
1406
- const { fetch: t, Request: r, Response: n } = e, s = t ? se(t) : typeof fetch == "function", o = se(r), i = se(n);
1407
- if (!s)
1408
- return !1;
1409
- const c = s && se(Qe), h = s && (typeof Xe == "function" ? /* @__PURE__ */ ((d) => (y) => d.encode(y))(new Xe()) : async (d) => new Uint8Array(await new r(d).arrayBuffer())), u = o && c && Ze(() => {
1410
- let d = !1;
1411
- const y = new r(C.origin, {
1412
- body: new Qe(),
1413
- method: "POST",
1414
- get duplex() {
1415
- return d = !0, "half";
1416
- }
1417
- }).headers.has("Content-Type");
1418
- return d && !y;
1419
- }), a = i && c && Ze(() => l.isReadableStream(new n("").body)), f = {
1420
- stream: a && ((d) => d.body)
1421
- };
1422
- s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
1423
- !f[d] && (f[d] = (y, p) => {
1424
- let E = y && y[d];
1425
- if (E)
1426
- return E.call(y);
1427
- throw new w(`Response type '${d}' is not supported`, w.ERR_NOT_SUPPORT, p);
1428
- });
1429
- });
1430
- const m = async (d) => {
1431
- if (d == null)
1432
- return 0;
1433
- if (l.isBlob(d))
1434
- return d.size;
1435
- if (l.isSpecCompliantForm(d))
1436
- return (await new r(C.origin, {
1437
- method: "POST",
1438
- body: d
1439
- }).arrayBuffer()).byteLength;
1440
- if (l.isArrayBufferView(d) || l.isArrayBuffer(d))
1441
- return d.byteLength;
1442
- if (l.isURLSearchParams(d) && (d = d + ""), l.isString(d))
1443
- return (await h(d)).byteLength;
1444
- }, g = async (d, y) => {
1445
- const p = l.toFiniteNumber(d.getContentLength());
1446
- return p ?? m(y);
1447
- };
1448
- return async (d) => {
1449
- let {
1450
- url: y,
1451
- method: p,
1452
- data: E,
1453
- signal: b,
1454
- cancelToken: S,
1455
- timeout: O,
1456
- onDownloadProgress: T,
1457
- onUploadProgress: P,
1458
- responseType: A,
1459
- headers: pe,
1460
- withCredentials: te = "same-origin",
1461
- fetchOptions: Pe
1462
- } = Tt(d), Le = t || fetch;
1463
- A = A ? (A + "").toLowerCase() : "text";
1464
- let re = ln([b, S && S.toAbortSignal()], O), V = null;
1465
- const D = re && re.unsubscribe && (() => {
1466
- re.unsubscribe();
1467
- });
1468
- let Ne;
1469
- try {
1470
- if (P && u && p !== "get" && p !== "head" && (Ne = await g(pe, E)) !== 0) {
1471
- let B = new r(y, {
1472
- method: "POST",
1473
- body: E,
1474
- duplex: "half"
1475
- }), j;
1476
- if (l.isFormData(E) && (j = B.headers.get("content-type")) && pe.setContentType(j), B.body) {
1477
- const [me, ne] = Je(
1478
- Ne,
1479
- ce(Ve(P))
1480
- );
1481
- E = We(B.body, Ge, me, ne);
1482
- }
1483
- }
1484
- l.isString(te) || (te = te ? "include" : "omit");
1485
- const F = o && "credentials" in r.prototype, Fe = {
1486
- ...Pe,
1487
- signal: re,
1488
- method: p.toUpperCase(),
1489
- headers: pe.normalize().toJSON(),
1490
- body: E,
1491
- duplex: "half",
1492
- credentials: F ? te : void 0
1493
- };
1494
- V = o && new r(y, Fe);
1495
- let k = await (o ? Le(V, Pe) : Le(y, Fe));
1496
- const Ue = a && (A === "stream" || A === "response");
1497
- if (a && (T || Ue && D)) {
1498
- const B = {};
1499
- ["status", "statusText", "headers"].forEach((ke) => {
1500
- B[ke] = k[ke];
1501
- });
1502
- const j = l.toFiniteNumber(k.headers.get("content-length")), [me, ne] = T && Je(
1503
- j,
1504
- ce(Ve(T), !0)
1505
- ) || [];
1506
- k = new n(
1507
- We(k.body, Ge, me, () => {
1508
- ne && ne(), D && D();
1509
- }),
1510
- B
1511
- );
1512
- }
1513
- A = A || "text";
1514
- let kt = await f[l.findKey(f, A) || "text"](k, d);
1515
- return !Ue && D && D(), await new Promise((B, j) => {
1516
- Rt(B, j, {
1517
- data: kt,
1518
- headers: v.from(k.headers),
1519
- status: k.status,
1520
- statusText: k.statusText,
1521
- config: d,
1522
- request: V
1523
- });
1524
- });
1525
- } catch (F) {
1526
- throw D && D(), F && F.name === "TypeError" && /Load failed|fetch/i.test(F.message) ? Object.assign(
1527
- new w("Network Error", w.ERR_NETWORK, d, V),
1528
- {
1529
- cause: F.cause || F
1530
- }
1531
- ) : w.from(F, F && F.code, d, V);
1532
- }
1533
- };
1534
- }, yn = /* @__PURE__ */ new Map(), At = (e) => {
1535
- let t = e && e.env || {};
1536
- const { fetch: r, Request: n, Response: s } = t, o = [
1537
- n,
1538
- s,
1539
- r
1540
- ];
1541
- let i = o.length, c = i, h, u, a = yn;
1542
- for (; c--; )
1543
- h = o[c], u = a.get(h), u === void 0 && a.set(h, u = c ? /* @__PURE__ */ new Map() : mn(t)), a = u;
1544
- return u;
1545
- };
1546
- At();
1547
- const Ce = {
1548
- http: Fr,
1549
- xhr: un,
1550
- fetch: {
1551
- get: At
1552
- }
1553
- };
1554
- l.forEach(Ce, (e, t) => {
1555
- if (e) {
1556
- try {
1557
- Object.defineProperty(e, "name", { value: t });
1558
- } catch {
1559
- }
1560
- Object.defineProperty(e, "adapterName", { value: t });
1561
- }
1562
- });
1563
- const Ye = (e) => `- ${e}`, En = (e) => l.isFunction(e) || e === null || e === !1;
1564
- function gn(e, t) {
1565
- e = l.isArray(e) ? e : [e];
1566
- const { length: r } = e;
1567
- let n, s;
1568
- const o = {};
1569
- for (let i = 0; i < r; i++) {
1570
- n = e[i];
1571
- let c;
1572
- if (s = n, !En(n) && (s = Ce[(c = String(n)).toLowerCase()], s === void 0))
1573
- throw new w(`Unknown adapter '${c}'`);
1574
- if (s && (l.isFunction(s) || (s = s.get(t))))
1575
- break;
1576
- o[c || "#" + i] = s;
1577
- }
1578
- if (!s) {
1579
- const i = Object.entries(o).map(
1580
- ([h, u]) => `adapter ${h} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
1581
- );
1582
- let c = r ? i.length > 1 ? `since :
1583
- ` + i.map(Ye).join(`
1584
- `) : " " + Ye(i[0]) : "as no adapter specified";
1585
- throw new w(
1586
- "There is no suitable adapter to dispatch the request " + c,
1587
- "ERR_NOT_SUPPORT"
1588
- );
1589
- }
1590
- return s;
1591
- }
1592
- const Ct = {
1593
- /**
1594
- * Resolve an adapter from a list of adapter names or functions.
1595
- * @type {Function}
1596
- */
1597
- getAdapter: gn,
1598
- /**
1599
- * Exposes all known adapters
1600
- * @type {Object<string, Function|Object>}
1601
- */
1602
- adapters: Ce
1603
- };
1604
- function ge(e) {
1605
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1606
- throw new J(null, e);
1607
- }
1608
- function et(e) {
1609
- return ge(e), e.headers = v.from(e.headers), e.data = Ee.call(
1610
- e,
1611
- e.transformRequest
1612
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Ct.getAdapter(e.adapter || Y.adapter, e)(e).then(function(n) {
1613
- return ge(e), n.data = Ee.call(
1614
- e,
1615
- e.transformResponse,
1616
- n
1617
- ), n.headers = v.from(n.headers), n;
1618
- }, function(n) {
1619
- return St(n) || (ge(e), n && n.response && (n.response.data = Ee.call(
1620
- e,
1621
- e.transformResponse,
1622
- n.response
1623
- ), n.response.headers = v.from(n.response.headers))), Promise.reject(n);
1624
- });
1625
- }
1626
- const xt = "1.13.2", he = {};
1627
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1628
- he[e] = function(n) {
1629
- return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
1630
- };
1631
- });
1632
- const tt = {};
1633
- he.transitional = function(t, r, n) {
1634
- function s(o, i) {
1635
- return "[Axios v" + xt + "] Transitional option '" + o + "'" + i + (n ? ". " + n : "");
1636
- }
1637
- return (o, i, c) => {
1638
- if (t === !1)
1639
- throw new w(
1640
- s(i, " has been removed" + (r ? " in " + r : "")),
1641
- w.ERR_DEPRECATED
1642
- );
1643
- return r && !tt[i] && (tt[i] = !0, console.warn(
1644
- s(
1645
- i,
1646
- " has been deprecated since v" + r + " and will be removed in the near future"
1647
- )
1648
- )), t ? t(o, i, c) : !0;
1649
- };
1650
- };
1651
- he.spelling = function(t) {
1652
- return (r, n) => (console.warn(`${n} is likely a misspelling of ${t}`), !0);
1653
- };
1654
- function wn(e, t, r) {
1655
- if (typeof e != "object")
1656
- throw new w("options must be an object", w.ERR_BAD_OPTION_VALUE);
1657
- const n = Object.keys(e);
1658
- let s = n.length;
1659
- for (; s-- > 0; ) {
1660
- const o = n[s], i = t[o];
1661
- if (i) {
1662
- const c = e[o], h = c === void 0 || i(c, o, e);
1663
- if (h !== !0)
1664
- throw new w("option " + o + " must be " + h, w.ERR_BAD_OPTION_VALUE);
1665
- continue;
1666
- }
1667
- if (r !== !0)
1668
- throw new w("Unknown option " + o, w.ERR_BAD_OPTION);
1669
- }
1670
- }
1671
- const ae = {
1672
- assertOptions: wn,
1673
- validators: he
1674
- }, U = ae.validators;
1675
- let M = class {
1676
- constructor(t) {
1677
- this.defaults = t || {}, this.interceptors = {
1678
- request: new $e(),
1679
- response: new $e()
1680
- };
1681
- }
1682
- /**
1683
- * Dispatch a request
1684
- *
1685
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1686
- * @param {?Object} config
1687
- *
1688
- * @returns {Promise} The Promise to be fulfilled
1689
- */
1690
- async request(t, r) {
1691
- try {
1692
- return await this._request(t, r);
1693
- } catch (n) {
1694
- if (n instanceof Error) {
1695
- let s = {};
1696
- Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
1697
- const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1698
- try {
1699
- n.stack ? o && !String(n.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (n.stack += `
1700
- ` + o) : n.stack = o;
1701
- } catch {
1702
- }
1703
- }
1704
- throw n;
1705
- }
1706
- }
1707
- _request(t, r) {
1708
- typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = H(this.defaults, r);
1709
- const { transitional: n, paramsSerializer: s, headers: o } = r;
1710
- n !== void 0 && ae.assertOptions(n, {
1711
- silentJSONParsing: U.transitional(U.boolean),
1712
- forcedJSONParsing: U.transitional(U.boolean),
1713
- clarifyTimeoutError: U.transitional(U.boolean)
1714
- }, !1), s != null && (l.isFunction(s) ? r.paramsSerializer = {
1715
- serialize: s
1716
- } : ae.assertOptions(s, {
1717
- encode: U.function,
1718
- serialize: U.function
1719
- }, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), ae.assertOptions(r, {
1720
- baseUrl: U.spelling("baseURL"),
1721
- withXsrfToken: U.spelling("withXSRFToken")
1722
- }, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
1723
- let i = o && l.merge(
1724
- o.common,
1725
- o[r.method]
1726
- );
1727
- o && l.forEach(
1728
- ["delete", "get", "head", "post", "put", "patch", "common"],
1729
- (d) => {
1730
- delete o[d];
1731
- }
1732
- ), r.headers = v.concat(i, o);
1733
- const c = [];
1734
- let h = !0;
1735
- this.interceptors.request.forEach(function(y) {
1736
- typeof y.runWhen == "function" && y.runWhen(r) === !1 || (h = h && y.synchronous, c.unshift(y.fulfilled, y.rejected));
1737
- });
1738
- const u = [];
1739
- this.interceptors.response.forEach(function(y) {
1740
- u.push(y.fulfilled, y.rejected);
1741
- });
1742
- let a, f = 0, m;
1743
- if (!h) {
1744
- const d = [et.bind(this), void 0];
1745
- for (d.unshift(...c), d.push(...u), m = d.length, a = Promise.resolve(r); f < m; )
1746
- a = a.then(d[f++], d[f++]);
1747
- return a;
1748
- }
1749
- m = c.length;
1750
- let g = r;
1751
- for (; f < m; ) {
1752
- const d = c[f++], y = c[f++];
1753
- try {
1754
- g = d(g);
1755
- } catch (p) {
1756
- y.call(this, p);
1757
- break;
1758
- }
1759
- }
1760
- try {
1761
- a = et.call(this, g);
1762
- } catch (d) {
1763
- return Promise.reject(d);
1764
- }
1765
- for (f = 0, m = u.length; f < m; )
1766
- a = a.then(u[f++], u[f++]);
1767
- return a;
1768
- }
1769
- getUri(t) {
1770
- t = H(this.defaults, t);
1771
- const r = Ot(t.baseURL, t.url, t.allowAbsoluteUrls);
1772
- return gt(r, t.params, t.paramsSerializer);
1773
- }
1774
- };
1775
- l.forEach(["delete", "get", "head", "options"], function(t) {
1776
- M.prototype[t] = function(r, n) {
1777
- return this.request(H(n || {}, {
1778
- method: t,
1779
- url: r,
1780
- data: (n || {}).data
1781
- }));
1782
- };
1783
- });
1784
- l.forEach(["post", "put", "patch"], function(t) {
1785
- function r(n) {
1786
- return function(o, i, c) {
1787
- return this.request(H(c || {}, {
1788
- method: t,
1789
- headers: n ? {
1790
- "Content-Type": "multipart/form-data"
1791
- } : {},
1792
- url: o,
1793
- data: i
1794
- }));
1795
- };
1796
- }
1797
- M.prototype[t] = r(), M.prototype[t + "Form"] = r(!0);
1798
- });
1799
- let bn = class vt {
1800
- constructor(t) {
1801
- if (typeof t != "function")
1802
- throw new TypeError("executor must be a function.");
1803
- let r;
1804
- this.promise = new Promise(function(o) {
1805
- r = o;
1806
- });
1807
- const n = this;
1808
- this.promise.then((s) => {
1809
- if (!n._listeners) return;
1810
- let o = n._listeners.length;
1811
- for (; o-- > 0; )
1812
- n._listeners[o](s);
1813
- n._listeners = null;
1814
- }), this.promise.then = (s) => {
1815
- let o;
1816
- const i = new Promise((c) => {
1817
- n.subscribe(c), o = c;
1818
- }).then(s);
1819
- return i.cancel = function() {
1820
- n.unsubscribe(o);
1821
- }, i;
1822
- }, t(function(o, i, c) {
1823
- n.reason || (n.reason = new J(o, i, c), r(n.reason));
1824
- });
1825
- }
1826
- /**
1827
- * Throws a `CanceledError` if cancellation has been requested.
1828
- */
1829
- throwIfRequested() {
1830
- if (this.reason)
1831
- throw this.reason;
1832
- }
1833
- /**
1834
- * Subscribe to the cancel signal
1835
- */
1836
- subscribe(t) {
1837
- if (this.reason) {
1838
- t(this.reason);
1839
- return;
1840
- }
1841
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
1842
- }
1843
- /**
1844
- * Unsubscribe from the cancel signal
1845
- */
1846
- unsubscribe(t) {
1847
- if (!this._listeners)
1848
- return;
1849
- const r = this._listeners.indexOf(t);
1850
- r !== -1 && this._listeners.splice(r, 1);
1851
- }
1852
- toAbortSignal() {
1853
- const t = new AbortController(), r = (n) => {
1854
- t.abort(n);
1855
- };
1856
- return this.subscribe(r), t.signal.unsubscribe = () => this.unsubscribe(r), t.signal;
1857
- }
1858
- /**
1859
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1860
- * cancels the `CancelToken`.
1861
- */
1862
- static source() {
1863
- let t;
1864
- return {
1865
- token: new vt(function(s) {
1866
- t = s;
1867
- }),
1868
- cancel: t
1869
- };
1870
- }
1871
- };
1872
- function Sn(e) {
1873
- return function(r) {
1874
- return e.apply(null, r);
1875
- };
1876
- }
1877
- function Rn(e) {
1878
- return l.isObject(e) && e.isAxiosError === !0;
1879
- }
1880
- const Re = {
1881
- Continue: 100,
1882
- SwitchingProtocols: 101,
1883
- Processing: 102,
1884
- EarlyHints: 103,
1885
- Ok: 200,
1886
- Created: 201,
1887
- Accepted: 202,
1888
- NonAuthoritativeInformation: 203,
1889
- NoContent: 204,
1890
- ResetContent: 205,
1891
- PartialContent: 206,
1892
- MultiStatus: 207,
1893
- AlreadyReported: 208,
1894
- ImUsed: 226,
1895
- MultipleChoices: 300,
1896
- MovedPermanently: 301,
1897
- Found: 302,
1898
- SeeOther: 303,
1899
- NotModified: 304,
1900
- UseProxy: 305,
1901
- Unused: 306,
1902
- TemporaryRedirect: 307,
1903
- PermanentRedirect: 308,
1904
- BadRequest: 400,
1905
- Unauthorized: 401,
1906
- PaymentRequired: 402,
1907
- Forbidden: 403,
1908
- NotFound: 404,
1909
- MethodNotAllowed: 405,
1910
- NotAcceptable: 406,
1911
- ProxyAuthenticationRequired: 407,
1912
- RequestTimeout: 408,
1913
- Conflict: 409,
1914
- Gone: 410,
1915
- LengthRequired: 411,
1916
- PreconditionFailed: 412,
1917
- PayloadTooLarge: 413,
1918
- UriTooLong: 414,
1919
- UnsupportedMediaType: 415,
1920
- RangeNotSatisfiable: 416,
1921
- ExpectationFailed: 417,
1922
- ImATeapot: 418,
1923
- MisdirectedRequest: 421,
1924
- UnprocessableEntity: 422,
1925
- Locked: 423,
1926
- FailedDependency: 424,
1927
- TooEarly: 425,
1928
- UpgradeRequired: 426,
1929
- PreconditionRequired: 428,
1930
- TooManyRequests: 429,
1931
- RequestHeaderFieldsTooLarge: 431,
1932
- UnavailableForLegalReasons: 451,
1933
- InternalServerError: 500,
1934
- NotImplemented: 501,
1935
- BadGateway: 502,
1936
- ServiceUnavailable: 503,
1937
- GatewayTimeout: 504,
1938
- HttpVersionNotSupported: 505,
1939
- VariantAlsoNegotiates: 506,
1940
- InsufficientStorage: 507,
1941
- LoopDetected: 508,
1942
- NotExtended: 510,
1943
- NetworkAuthenticationRequired: 511,
1944
- WebServerIsDown: 521,
1945
- ConnectionTimedOut: 522,
1946
- OriginIsUnreachable: 523,
1947
- TimeoutOccurred: 524,
1948
- SslHandshakeFailed: 525,
1949
- InvalidSslCertificate: 526
1950
- };
1951
- Object.entries(Re).forEach(([e, t]) => {
1952
- Re[t] = e;
1953
- });
1954
- function Pt(e) {
1955
- const t = new M(e), r = it(M.prototype.request, t);
1956
- return l.extend(r, M.prototype, t, { allOwnKeys: !0 }), l.extend(r, t, null, { allOwnKeys: !0 }), r.create = function(s) {
1957
- return Pt(H(e, s));
1958
- }, r;
1959
- }
1960
- const R = Pt(Y);
1961
- R.Axios = M;
1962
- R.CanceledError = J;
1963
- R.CancelToken = bn;
1964
- R.isCancel = St;
1965
- R.VERSION = xt;
1966
- R.toFormData = de;
1967
- R.AxiosError = w;
1968
- R.Cancel = R.CanceledError;
1969
- R.all = function(t) {
1970
- return Promise.all(t);
1971
- };
1972
- R.spread = Sn;
1973
- R.isAxiosError = Rn;
1974
- R.mergeConfig = H;
1975
- R.AxiosHeaders = v;
1976
- R.formToJSON = (e) => bt(l.isHTMLForm(e) ? new FormData(e) : e);
1977
- R.getAdapter = Ct.getAdapter;
1978
- R.HttpStatusCode = Re;
1979
- R.default = R;
1980
- const {
1981
- Axios: rs,
1982
- AxiosError: On,
1983
- CanceledError: ns,
1984
- isCancel: ss,
1985
- CancelToken: os,
1986
- VERSION: is,
1987
- all: as,
1988
- Cancel: cs,
1989
- isAxiosError: Tn,
1990
- spread: us,
1991
- toFormData: ls,
1992
- AxiosHeaders: fs,
1993
- HttpStatusCode: ds,
1994
- formToJSON: hs,
1995
- getAdapter: ps,
1996
- mergeConfig: ms
1997
- } = R, An = (e) => ({
1998
- PATCH: R.patch,
1999
- POST: R.post,
2000
- PUT: R.put
2001
- })[e], Cn = (e) => ({
2002
- DELETE: R.delete,
2003
- GET: R.get
2004
- })[e], xn = (e) => {
234
+ }) => R("HTTP_SERVICE", oe(e), [t.ServiceProvider, r.ServiceProvider]), ne = (e) => ({
235
+ PATCH: M.patch,
236
+ POST: M.post,
237
+ PUT: M.put
238
+ })[e], se = (e) => ({
239
+ DELETE: M.delete,
240
+ GET: M.get
241
+ })[e], ce = (e) => {
2005
242
  const {
2006
243
  data: t,
2007
244
  headers: r,
@@ -2012,9 +249,9 @@ const {
2012
249
  header: r,
2013
250
  status: n
2014
251
  };
2015
- }, vn = (e) => {
2016
- if (!Tn(e))
2017
- return new L({
252
+ }, ae = (e) => {
253
+ if (!Y(e))
254
+ return new v({
2018
255
  message: "An unknown error occurred"
2019
256
  });
2020
257
  const {
@@ -2022,335 +259,237 @@ const {
2022
259
  response: r
2023
260
  } = e;
2024
261
  if (!r)
2025
- return new L({
262
+ return new v({
2026
263
  message: t
2027
264
  });
2028
265
  const {
2029
266
  config: {
2030
267
  url: n,
2031
- method: s
268
+ method: i
2032
269
  },
2033
- status: o,
2034
- data: i
2035
- } = r, c = {
2036
- method: s,
2037
- status: o,
270
+ status: h,
271
+ data: E
272
+ } = r, s = {
273
+ method: i,
274
+ status: h,
2038
275
  url: n
2039
276
  };
2040
- if (!i)
2041
- return new L({
2042
- details: c,
277
+ if (!E)
278
+ return new v({
279
+ details: s,
2043
280
  message: t
2044
281
  });
2045
282
  try {
2046
- return new L({
283
+ return new v({
2047
284
  details: {
2048
- ...c,
2049
- body: i
285
+ ...s,
286
+ body: E
2050
287
  },
2051
288
  message: t
2052
289
  });
2053
290
  } catch {
2054
- return new L({
2055
- details: c,
291
+ return new v({
292
+ details: s,
2056
293
  message: t
2057
294
  });
2058
295
  }
2059
- }, Lt = async (e) => {
296
+ }, N = async (e) => {
2060
297
  try {
2061
298
  const t = await e;
2062
- return xn(t);
299
+ return ce(t);
2063
300
  } catch (t) {
2064
- return t instanceof On ? vn(t) : new L({
2065
- code: W.Generic,
301
+ return t instanceof j ? ae(t) : new v({
302
+ code: A.Generic,
2066
303
  message: "An unknown error occurred"
2067
304
  });
2068
305
  }
2069
- }, Nt = (e, {
306
+ }, V = (e, {
2070
307
  headers: t = {},
2071
308
  query: r = {},
2072
309
  timeout: n,
2073
- url: s
2074
- }, o) => {
2075
- const i = Cn(e), c = {
310
+ url: i
311
+ }, h) => {
312
+ const E = se(e), s = {
2076
313
  headers: t
2077
- }, h = rt(s, r);
2078
- return o.buffer && (c.responseType = "arraybuffer"), n && (c.timeout = n), Lt(i(h, c));
2079
- }, xe = (e, {
314
+ }, a = $(i, r);
315
+ return h.buffer && (s.responseType = "arraybuffer"), n && (s.timeout = n), N(E(a, s));
316
+ }, H = (e, {
2080
317
  headers: t = {},
2081
318
  body: r = null,
2082
319
  query: n = {},
2083
- timeout: s,
2084
- url: o,
2085
- attachments: i
2086
- }, c) => {
2087
- const h = An(e), u = i && i.length > 0, a = new FormData(), f = u ? a : r, m = {
320
+ timeout: i,
321
+ url: h,
322
+ attachments: E
323
+ }, s) => {
324
+ const a = ne(e), o = E && E.length > 0, u = new FormData(), c = o ? u : r, l = {
2088
325
  headers: t
2089
- }, g = rt(o, n);
2090
- return u && i.forEach((d) => {
2091
- a.append(d.name, d.filePath);
2092
- }), c.buffer && (m.responseType = "arraybuffer"), s && (m.timeout = s), Lt(h(g, f, m));
2093
- }, Pn = (e, t) => Nt("DELETE", e, t), Ln = (e, t) => Nt("GET", e, t), Nn = (e, t) => xe("PATCH", e, t), Fn = (e, t) => xe("POST", e, t), Un = (e, t) => xe("PUT", e, t), ys = () => () => ({
2094
- delete: Pn,
2095
- get: Ln,
2096
- patch: Nn,
2097
- post: Fn,
2098
- put: Un
2099
- }), kn = (e) => () => e(), Es = ({
326
+ }, S = $(h, n);
327
+ return o && E.forEach((y) => {
328
+ u.append(y.name, y.filePath);
329
+ }), s.buffer && (l.responseType = "arraybuffer"), i && (l.timeout = i), N(a(S, c, l));
330
+ }, ie = (e, t) => V("DELETE", e, t), ue = (e, t) => V("GET", e, t), de = (e, t) => H("PATCH", e, t), le = (e, t) => H("POST", e, t), he = (e, t) => H("PUT", e, t), Qe = () => () => ({
331
+ delete: ie,
332
+ get: ue,
333
+ patch: de,
334
+ post: le,
335
+ put: he
336
+ }), Ee = (e) => () => e(), Ke = ({
2100
337
  useAdapter: e
2101
- }) => ee("LOGGER_SERVICE", kn(e), []);
2102
- var Ft = { exports: {} };
2103
- /*!
2104
- * js-logger - http://github.com/jonnyreeves/js-logger
2105
- * Jonny Reeves, http://jonnyreeves.co.uk/
2106
- * js-logger may be freely distributed under the MIT license.
2107
- */
2108
- (function(e) {
2109
- (function(t) {
2110
- var r = {};
2111
- r.VERSION = "1.6.1";
2112
- var n, s = {}, o = function(a, f) {
2113
- return function() {
2114
- return f.apply(a, arguments);
2115
- };
2116
- }, i = function() {
2117
- var a = arguments, f = a[0], m, g;
2118
- for (g = 1; g < a.length; g++)
2119
- for (m in a[g])
2120
- !(m in f) && a[g].hasOwnProperty(m) && (f[m] = a[g][m]);
2121
- return f;
2122
- }, c = function(a, f) {
2123
- return { value: a, name: f };
2124
- };
2125
- r.TRACE = c(1, "TRACE"), r.DEBUG = c(2, "DEBUG"), r.INFO = c(3, "INFO"), r.TIME = c(4, "TIME"), r.WARN = c(5, "WARN"), r.ERROR = c(8, "ERROR"), r.OFF = c(99, "OFF");
2126
- var h = function(a) {
2127
- this.context = a, this.setLevel(a.filterLevel), this.log = this.info;
2128
- };
2129
- h.prototype = {
2130
- // Changes the current logging level for the logging instance.
2131
- setLevel: function(a) {
2132
- a && "value" in a && (this.context.filterLevel = a);
2133
- },
2134
- // Gets the current logging level for the logging instance
2135
- getLevel: function() {
2136
- return this.context.filterLevel;
2137
- },
2138
- // Is the logger configured to output messages at the supplied level?
2139
- enabledFor: function(a) {
2140
- var f = this.context.filterLevel;
2141
- return a.value >= f.value;
2142
- },
2143
- trace: function() {
2144
- this.invoke(r.TRACE, arguments);
2145
- },
2146
- debug: function() {
2147
- this.invoke(r.DEBUG, arguments);
2148
- },
2149
- info: function() {
2150
- this.invoke(r.INFO, arguments);
2151
- },
2152
- warn: function() {
2153
- this.invoke(r.WARN, arguments);
2154
- },
2155
- error: function() {
2156
- this.invoke(r.ERROR, arguments);
2157
- },
2158
- time: function(a) {
2159
- typeof a == "string" && a.length > 0 && this.invoke(r.TIME, [a, "start"]);
2160
- },
2161
- timeEnd: function(a) {
2162
- typeof a == "string" && a.length > 0 && this.invoke(r.TIME, [a, "end"]);
2163
- },
2164
- // Invokes the logger callback if it's not being filtered.
2165
- invoke: function(a, f) {
2166
- n && this.enabledFor(a) && n(f, i({ level: a }, this.context));
2167
- }
2168
- };
2169
- var u = new h({ filterLevel: r.OFF });
2170
- (function() {
2171
- var a = r;
2172
- a.enabledFor = o(u, u.enabledFor), a.trace = o(u, u.trace), a.debug = o(u, u.debug), a.time = o(u, u.time), a.timeEnd = o(u, u.timeEnd), a.info = o(u, u.info), a.warn = o(u, u.warn), a.error = o(u, u.error), a.log = a.info;
2173
- })(), r.setHandler = function(a) {
2174
- n = a;
2175
- }, r.setLevel = function(a) {
2176
- u.setLevel(a);
2177
- for (var f in s)
2178
- s.hasOwnProperty(f) && s[f].setLevel(a);
2179
- }, r.getLevel = function() {
2180
- return u.getLevel();
2181
- }, r.get = function(a) {
2182
- return s[a] || (s[a] = new h(i({ name: a }, u.context)));
2183
- }, r.createDefaultHandler = function(a) {
2184
- a = a || {}, a.formatter = a.formatter || function(d, y) {
2185
- y.name && d.unshift("[" + y.name + "]");
2186
- };
2187
- var f = {}, m = function(g, d) {
2188
- Function.prototype.apply.call(g, console, d);
2189
- };
2190
- return typeof console > "u" ? function() {
2191
- } : function(g, d) {
2192
- g = Array.prototype.slice.call(g);
2193
- var y = console.log, p;
2194
- d.level === r.TIME ? (p = (d.name ? "[" + d.name + "] " : "") + g[0], g[1] === "start" ? console.time ? console.time(p) : f[p] = (/* @__PURE__ */ new Date()).getTime() : console.timeEnd ? console.timeEnd(p) : m(y, [p + ": " + ((/* @__PURE__ */ new Date()).getTime() - f[p]) + "ms"])) : (d.level === r.WARN && console.warn ? y = console.warn : d.level === r.ERROR && console.error ? y = console.error : d.level === r.INFO && console.info ? y = console.info : d.level === r.DEBUG && console.debug ? y = console.debug : d.level === r.TRACE && console.trace && (y = console.trace), a.formatter(g, d), m(y, g));
2195
- };
2196
- }, r.useDefaults = function(a) {
2197
- r.setLevel(a && a.defaultLevel || r.DEBUG), r.setHandler(r.createDefaultHandler(a));
2198
- }, r.setDefaults = r.useDefaults, e.exports ? e.exports = r : (r._prevLogger = t.Logger, r.noConflict = function() {
2199
- return t.Logger = r._prevLogger, r;
2200
- }, t.Logger = r);
2201
- })(Dt);
2202
- })(Ft);
2203
- var Bn = Ft.exports;
2204
- const q = /* @__PURE__ */ _t(Bn), ve = (e) => typeof e == "string" ? e : e.stack || e.toString(), Dn = (e) => {
2205
- q.debug("💡", e);
2206
- }, _n = (e) => {
2207
- q.error("❌", ve(e));
2208
- }, Mn = (e) => {
2209
- q.error("❌", ve(e));
2210
- }, Hn = (e) => {
2211
- q.info("✅", ve(e));
2212
- }, qn = (e) => {
2213
- q.warn("⚠️", e.toString());
2214
- }, gs = () => () => (st(() => {
2215
- q.useDefaults({
2216
- defaultLevel: q.INFO
338
+ }) => R("LOGGER_SERVICE", Ee(e), []), q = (e) => typeof e == "string" ? e : e.stack || e.toString(), fe = (e) => {
339
+ m.debug("💡", e);
340
+ }, ve = (e) => {
341
+ m.error("❌", q(e));
342
+ }, pe = (e) => {
343
+ m.error("❌", q(e));
344
+ }, ye = (e) => {
345
+ m.info("✅", q(e));
346
+ }, Se = (e) => {
347
+ m.warn("⚠️", e.toString());
348
+ }, $e = () => () => (O(() => {
349
+ m.useDefaults({
350
+ defaultLevel: m.INFO
2217
351
  });
2218
352
  }, []), {
2219
- debug: Dn,
2220
- error: _n,
2221
- fatal: Mn,
2222
- info: Hn,
2223
- warn: qn
2224
- }), jn = (e) => ({
353
+ debug: fe,
354
+ error: ve,
355
+ fatal: pe,
356
+ info: ye,
357
+ warn: Se
358
+ }), ge = (e) => ({
2225
359
  ...t
2226
- }) => ({
2227
- captureEvent: e(t).captureEvent
2228
- }), ws = ({
360
+ }) => {
361
+ const r = e(t);
362
+ return {
363
+ captureEvent: be("posthog-capture-event", async (i) => {
364
+ !Q(t.enabled) && !t.enabled || await r.captureEvent(i);
365
+ })
366
+ };
367
+ }, De = ({
2229
368
  useAdapter: e,
2230
369
  HttpService: t
2231
- }) => ee("TRACKER_SERVICE", jn(e), [t.ServiceProvider]), bs = ({
370
+ }) => R("TRACKER_SERVICE", ge(e), [t.ServiceProvider]), Ne = ({
2232
371
  getDistinctId: e,
2233
372
  getTimestamp: t,
2234
373
  getHeaders: r,
2235
374
  transformProperties: n,
2236
- config: s
375
+ config: i
2237
376
  }) => ({
2238
- HttpService: o
377
+ HttpService: h
2239
378
  }) => {
2240
- const i = $(o), c = () => ({
2241
- Authorization: `Bearer ${s.apiKey}`,
379
+ const E = b(h), s = () => ({
380
+ Authorization: `Bearer ${i.apiKey}`,
2242
381
  ...r == null ? void 0 : r()
2243
- }), h = (f) => [s.host, f].filter(Boolean).join("/"), u = (f, m) => i.post({
2244
- body: m,
2245
- headers: c(),
2246
- url: h(f)
382
+ }), a = (c) => [i.host, c].filter(Boolean).join("/"), o = (c, l) => E.post({
383
+ body: l,
384
+ headers: s(),
385
+ url: a(c)
2247
386
  });
2248
387
  return {
2249
- captureEvent: zn("posthog-capture-event", async ({
2250
- event: f,
2251
- properties: m
388
+ captureEvent: async ({
389
+ event: c,
390
+ properties: l
2252
391
  }) => {
2253
- const g = s.paths.event, d = e(f, m), y = t == null ? void 0 : t(f, m), p = n(f, m);
2254
- await u(g, {
2255
- api_key: s.apiKey,
2256
- distinct_id: d,
2257
- event: f,
2258
- properties: p,
2259
- timestamp: y
392
+ const S = i.paths.event, y = e(c, l), P = t == null ? void 0 : t(c, l), g = n(c, l);
393
+ await o(S, {
394
+ api_key: i.apiKey,
395
+ distinct_id: y,
396
+ event: c,
397
+ properties: g,
398
+ timestamp: P
2260
399
  });
2261
- })
400
+ }
2262
401
  };
2263
402
  };
2264
- var In = /* @__PURE__ */ ((e) => (e.MUTATION = "mutation", e.QUERY = "query", e))(In || {});
2265
- const $n = () => {
2266
- const e = qt(void 0);
403
+ var we = /* @__PURE__ */ ((e) => (e.MUTATION = "mutation", e.QUERY = "query", e))(we || {});
404
+ const me = () => {
405
+ const e = _(void 0);
2267
406
  return {
2268
407
  Provider: (n) => {
2269
- const s = G.c(3), {
2270
- children: o,
2271
- value: i
408
+ const i = x(3), {
409
+ children: h,
410
+ value: E
2272
411
  } = n;
2273
- let c;
2274
- return s[0] !== o || s[1] !== i ? (c = /* @__PURE__ */ ot(e.Provider, { value: i, children: o }), s[0] = o, s[1] = i, s[2] = c) : c = s[2], c;
412
+ let s;
413
+ return i[0] !== h || i[1] !== E ? (s = /* @__PURE__ */ K(e.Provider, { value: E, children: h }), i[0] = h, i[1] = E, i[2] = s) : s = i[2], s;
2275
414
  },
2276
415
  useContext: () => {
2277
- const n = jt(e);
416
+ const n = W(e);
2278
417
  if (n === void 0)
2279
418
  throw new Error("Context is missing a provider");
2280
419
  return n;
2281
420
  }
2282
421
  };
2283
- }, Ut = (e, t, r) => {
422
+ }, z = (e, t, r) => {
2284
423
  const n = r;
2285
424
  return n.serviceMethodKey = t, n.serviceMethodType = e, n;
2286
- }, zn = (e, t) => Ut("mutation", e, t), Ss = (e, t) => Ut("query", e, t), ee = (e, t, r) => {
425
+ }, be = (e, t) => z("mutation", e, t), Ve = (e, t) => z("query", e, t), R = (e, t, r) => {
2287
426
  const {
2288
427
  useContext: n,
2289
- Provider: s
2290
- } = $n(), o = (c) => {
2291
- const h = G.c(6);
2292
- let u, a;
2293
- h[0] !== c ? ({
2294
- children: u,
2295
- ...a
2296
- } = c, h[0] = c, h[1] = u, h[2] = a) : (u = h[1], a = h[2]);
2297
- const f = t(a);
2298
- let m;
2299
- return h[3] !== u || h[4] !== f ? (m = /* @__PURE__ */ ot(s, { value: f, children: u }), h[3] = u, h[4] = f, h[5] = m) : m = h[5], m;
428
+ Provider: i
429
+ } = me(), h = (s) => {
430
+ const a = x(6);
431
+ let o, u;
432
+ a[0] !== s ? ({
433
+ children: o,
434
+ ...u
435
+ } = s, a[0] = s, a[1] = o, a[2] = u) : (o = a[1], u = a[2]);
436
+ const c = t(u);
437
+ let l;
438
+ return a[3] !== o || a[4] !== c ? (l = /* @__PURE__ */ K(i, { value: c, children: o }), a[3] = o, a[4] = c, a[5] = l) : l = a[5], l;
2300
439
  };
2301
- return o.serviceName = Symbol(e), o.serviceDependencies = r, {
2302
- ServiceProvider: o,
440
+ return h.serviceName = Symbol(e), h.serviceDependencies = r, {
441
+ ServiceProvider: h,
2303
442
  useService: n
2304
443
  };
2305
- }, $ = (e) => e.useService(), Rs = (e, t) => {
2306
- const r = G.c(7);
444
+ }, b = (e) => e.useService(), ze = (e, t) => {
445
+ const r = x(7);
2307
446
  let n;
2308
- r[0] !== e || r[1] !== t.mutationKey ? (n = nt([e.serviceMethodKey, e, ...t.mutationKey ?? []]), r[0] = e, r[1] = t.mutationKey, r[2] = n) : n = r[2];
2309
- let s;
2310
- return r[3] !== e || r[4] !== t || r[5] !== n ? (s = {
447
+ r[0] !== e || r[1] !== t.mutationKey ? (n = D([e.serviceMethodKey, e, ...t.mutationKey ?? []]), r[0] = e, r[1] = t.mutationKey, r[2] = n) : n = r[2];
448
+ let i;
449
+ return r[3] !== e || r[4] !== t || r[5] !== n ? (i = {
2311
450
  ...t,
2312
451
  mutationFn: e,
2313
452
  mutationKey: n
2314
- }, r[3] = e, r[4] = t, r[5] = n, r[6] = s) : s = r[6], It(s);
2315
- }, Os = (e, t) => {
2316
- const r = G.c(14), [n, s] = Ht("initialVariables" in t ? t.initialVariables : void 0);
2317
- let o;
2318
- r[0] !== e || r[1] !== n ? (o = () => e(n), r[0] = e, r[1] = n, r[2] = o) : o = r[2];
2319
- let i;
2320
- r[3] !== e || r[4] !== t || r[5] !== n ? (i = nt([e.serviceMethodKey, e, ..."initialVariables" in t ? [n] : [], ...t.queryKey ?? []]), r[3] = e, r[4] = t, r[5] = n, r[6] = i) : i = r[6];
2321
- let c;
2322
- r[7] !== t || r[8] !== o || r[9] !== i ? (c = {
453
+ }, r[3] = e, r[4] = t, r[5] = n, r[6] = i) : i = r[6], X(i);
454
+ }, Fe = (e, t) => {
455
+ const r = x(14), [n, i] = I("initialVariables" in t ? t.initialVariables : void 0);
456
+ let h;
457
+ r[0] !== e || r[1] !== n ? (h = () => e(n), r[0] = e, r[1] = n, r[2] = h) : h = r[2];
458
+ let E;
459
+ r[3] !== e || r[4] !== t || r[5] !== n ? (E = D([e.serviceMethodKey, e, ..."initialVariables" in t ? [n] : [], ...t.queryKey ?? []]), r[3] = e, r[4] = t, r[5] = n, r[6] = E) : E = r[6];
460
+ let s;
461
+ r[7] !== t || r[8] !== h || r[9] !== E ? (s = {
2323
462
  ...t,
2324
- queryFn: o,
2325
- queryKey: i
2326
- }, r[7] = t, r[8] = o, r[9] = i, r[10] = c) : c = r[10];
2327
- const h = $t(c);
463
+ queryFn: h,
464
+ queryKey: E
465
+ }, r[7] = t, r[8] = h, r[9] = E, r[10] = s) : s = r[10];
466
+ const a = Z(s);
2328
467
  if ("initialVariables" in t) {
2329
- let u;
2330
- return r[11] !== h || r[12] !== n ? (u = {
2331
- ...h,
2332
- setVariables: s,
468
+ let o;
469
+ return r[11] !== a || r[12] !== n ? (o = {
470
+ ...a,
471
+ setVariables: i,
2333
472
  variables: n
2334
- }, r[11] = h, r[12] = n, r[13] = u) : u = r[13], u;
473
+ }, r[11] = a, r[12] = n, r[13] = o) : o = r[13], o;
2335
474
  }
2336
- return h;
475
+ return a;
2337
476
  };
2338
477
  export {
2339
- In as ServiceMethodType,
2340
- ys as createAxiosHttpAdapter,
2341
- Qn as createErrorService,
2342
- Xn as createEventBasedErrorAdapter,
2343
- Zn as createGraphQLService,
2344
- Yn as createHttpService,
2345
- gs as createJsLogLoggerAdapter,
2346
- kn as createLoggerBuilder,
2347
- Es as createLoggerService,
2348
- bs as createPosthogTrackerAdapter,
2349
- ee as createService,
2350
- ws as createTrackerService,
2351
- zn as useBuildMutation,
2352
- Ss as useBuildQuery,
2353
- $ as useService,
2354
- Rs as useServiceMutation,
2355
- Os as useServiceQuery
478
+ we as ServiceMethodType,
479
+ Qe as createAxiosHttpAdapter,
480
+ Ge as createErrorService,
481
+ ke as createEventBasedErrorAdapter,
482
+ Ue as createGraphQLService,
483
+ Oe as createHttpService,
484
+ $e as createJsLogLoggerAdapter,
485
+ Ee as createLoggerBuilder,
486
+ Ke as createLoggerService,
487
+ Ne as createPosthogTrackerAdapter,
488
+ R as createService,
489
+ De as createTrackerService,
490
+ be as useBuildMutation,
491
+ Ve as useBuildQuery,
492
+ b as useService,
493
+ ze as useServiceMutation,
494
+ Fe as useServiceQuery
2356
495
  };