@hintergrund/ui 0.3.4 → 0.3.7

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 (87) hide show
  1. package/dist/BuilderAgentPane-Vj3NCGvZ.js +25916 -0
  2. package/dist/IntegrationHealth-D1HcBrQn.js +218 -0
  3. package/dist/admin.js +22766 -28480
  4. package/dist/anthropic-messages-D8Vp-Ncs.js +3772 -0
  5. package/dist/azure-openai-responses-DnjyYuiz.js +168 -0
  6. package/dist/builder.js +27 -22
  7. package/dist/config.types-DZ5yfeqq.js +20 -0
  8. package/dist/deferred-tools-nxpq94I4.js +34 -0
  9. package/dist/diagnostics-x5QOwca_.js +91 -0
  10. package/dist/error-body-pXgvw5vV.js +68 -0
  11. package/dist/font-pool/LICENSES.txt +22 -0
  12. package/dist/font-pool/inter.ttf +0 -0
  13. package/dist/font-pool/inter.woff2 +0 -0
  14. package/dist/font-pool/jetbrains-mono.ttf +0 -0
  15. package/dist/font-pool/jetbrains-mono.woff2 +0 -0
  16. package/dist/font-pool/lora.ttf +0 -0
  17. package/dist/font-pool/lora.woff2 +0 -0
  18. package/dist/font-pool/merriweather.ttf +0 -0
  19. package/dist/font-pool/merriweather.woff2 +0 -0
  20. package/dist/font-pool/montserrat.ttf +0 -0
  21. package/dist/font-pool/montserrat.woff2 +0 -0
  22. package/dist/font-pool/playfair-display.ttf +0 -0
  23. package/dist/font-pool/playfair-display.woff2 +0 -0
  24. package/dist/font-pool/poppins.ttf +0 -0
  25. package/dist/font-pool/poppins.woff2 +0 -0
  26. package/dist/font-pool/roboto.ttf +0 -0
  27. package/dist/font-pool/roboto.woff2 +0 -0
  28. package/dist/font-pool/space-grotesk.ttf +0 -0
  29. package/dist/font-pool/space-grotesk.woff2 +0 -0
  30. package/dist/font-pool/work-sans.ttf +0 -0
  31. package/dist/font-pool/work-sans.woff2 +0 -0
  32. package/dist/github-copilot-headers-pRo3v4t7.js +27 -0
  33. package/dist/global-xsR9gLDa.js +30568 -0
  34. package/dist/google-generative-ai-BmzNjEvl.js +291 -0
  35. package/dist/google-shared-CG2Lbh1z.js +8746 -0
  36. package/dist/google-vertex-Dfla93V_.js +329 -0
  37. package/dist/hash-BixfZjoG.js +21 -0
  38. package/dist/headers-CnTiKpOL.js +24 -0
  39. package/dist/json-parse-CxjAnWaM.js +231 -0
  40. package/dist/legacy-Zmnk-v81.js +14 -0
  41. package/dist/login.js +131 -146
  42. package/dist/mail.js +694 -789
  43. package/dist/mistral-conversations-DeDb7Gbd.js +558 -0
  44. package/dist/openai-ClxLHXsh.js +5371 -0
  45. package/dist/openai-codex-responses-usgOtWUT.js +909 -0
  46. package/dist/openai-completions-D_nFQy7A.js +730 -0
  47. package/dist/openai-prompt-cache-Bm8Re6Vv.js +17 -0
  48. package/dist/openai-responses-BqL3PFsb.js +192 -0
  49. package/dist/openai-responses-shared-BhQj78KM.js +481 -0
  50. package/dist/pi-messages-CRx0yqMp.js +268 -0
  51. package/dist/pi-user-agent-CsXkkH60.js +20 -0
  52. package/dist/provider-env-Cj6X7Wly.js +35 -0
  53. package/dist/provider-retry-BGImU1PV.js +68 -0
  54. package/dist/rolldown-runtime-nTTD767F.js +37 -0
  55. package/dist/setup.js +391 -418
  56. package/dist/transform-messages-DvxSeyBQ.js +383 -0
  57. package/dist/ui.css +2 -1
  58. package/package.json +5 -5
  59. package/dist/BuilderAgentPane-CwG29LOX.js +0 -13938
  60. package/dist/IntegrationHealth-G_4vzV66.js +0 -209
  61. package/dist/anthropic-messages-BmLfYiwX.js +0 -5605
  62. package/dist/azure-openai-responses-yf2M6GVe.js +0 -222
  63. package/dist/client-Cd7yMX39.js +0 -7860
  64. package/dist/config.types-iZoywORE.js +0 -15
  65. package/dist/deferred-tools-BZWMWBYN.js +0 -28
  66. package/dist/error-body-BUPcH4GF.js +0 -71
  67. package/dist/github-copilot-headers-B1RBGoZi.js +0 -21
  68. package/dist/global-CTQcFve1.js +0 -36177
  69. package/dist/google-generative-ai-DkzwUYzL.js +0 -264
  70. package/dist/google-shared-DTgKMtfJ.js +0 -11710
  71. package/dist/google-vertex-D2IzqvQM.js +0 -305
  72. package/dist/hash-DFlR084x.js +0 -14
  73. package/dist/headers-D4iLzGaS.js +0 -21
  74. package/dist/json-parse-LZdWp-Nd.js +0 -232
  75. package/dist/legacy-CckexQcJ.js +0 -5
  76. package/dist/mistral-conversations-CNfKG0tU.js +0 -513
  77. package/dist/openai-codex-responses-BLNjExaC.js +0 -947
  78. package/dist/openai-completions-46IVoF2N.js +0 -741
  79. package/dist/openai-prompt-cache-BJwqbEDx.js +0 -13
  80. package/dist/openai-responses-BfHoZFHI.js +0 -184
  81. package/dist/openai-responses-shared-DOTQAbCj.js +0 -477
  82. package/dist/pi-messages-fnW87Z4Z.js +0 -251
  83. package/dist/pi-user-agent-CUqx-qiX.js +0 -13
  84. package/dist/provider-env-D2VjEV3S.js +0 -26
  85. package/dist/provider-retry-BsigVlMg.js +0 -67
  86. package/dist/select-Cke4DYH1.js +0 -78
  87. package/dist/transform-messages-CsKsy6b4.js +0 -398
@@ -1,305 +0,0 @@
1
- import { r as v, i as R, a as O, m as _, G as L, c as M, s as G, b as S, d as P, T as h, R as A } from "./google-shared-DTgKMtfJ.js";
2
- import { D as N, H as D, G as U } from "./BuilderAgentPane-CwG29LOX.js";
3
- import { f as H, n as V } from "./error-body-BUPcH4GF.js";
4
- import { p as K } from "./headers-D4iLzGaS.js";
5
- import { g as m } from "./provider-env-D2VjEV3S.js";
6
- import { b as W, s as j } from "./transform-messages-CsKsy6b4.js";
7
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
8
- return Promise.resolve().then(e);
9
- } });
10
- const w = "v1", $ = "gcp-vertex-credentials", B = {
11
- THINKING_LEVEL_UNSPECIFIED: h.THINKING_LEVEL_UNSPECIFIED,
12
- MINIMAL: h.MINIMAL,
13
- LOW: h.LOW,
14
- MEDIUM: h.MEDIUM,
15
- HIGH: h.HIGH
16
- };
17
- let q = 0;
18
- const I = (e, t, i) => {
19
- const o = new N();
20
- return (async () => {
21
- const n = {
22
- role: "assistant",
23
- content: [],
24
- api: "google-vertex",
25
- provider: e.provider,
26
- model: e.id,
27
- usage: {
28
- input: 0,
29
- output: 0,
30
- cacheRead: 0,
31
- cacheWrite: 0,
32
- totalTokens: 0,
33
- cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 }
34
- },
35
- stopReason: "pending",
36
- timestamp: Date.now()
37
- };
38
- try {
39
- if (i?.fetch && i.fetch !== globalThis.fetch)
40
- throw new Error("Custom fetch is not supported by the Google Vertex adapter");
41
- const s = Y(i), u = s ? J(e, s, i?.headers) : F(e, ee(i), te(i), i?.headers, i?.env);
42
- let d = ne(e, t, i);
43
- const k = await i?.onPayload?.(d, e);
44
- k !== void 0 && (d = k);
45
- const p = await v(() => u.models.generateContentStream(d), i);
46
- o.push({ type: "start", partial: n });
47
- let a = null;
48
- const T = n.content, l = () => T.length - 1;
49
- for await (const c of p) {
50
- n.responseId ||= c.responseId;
51
- const f = c.candidates?.[0];
52
- if (f?.content?.parts)
53
- for (const r of f.content.parts) {
54
- if (r.text !== void 0) {
55
- const g = R(r);
56
- (!a || g && a.type !== "thinking" || !g && a.type !== "text") && (a && (a.type === "text" ? o.push({
57
- type: "text_end",
58
- contentIndex: T.length - 1,
59
- content: a.text,
60
- partial: n
61
- }) : o.push({
62
- type: "thinking_end",
63
- contentIndex: l(),
64
- content: a.thinking,
65
- partial: n
66
- })), g ? (a = { type: "thinking", thinking: "", thinkingSignature: void 0 }, n.content.push(a), o.push({ type: "thinking_start", contentIndex: l(), partial: n })) : (a = { type: "text", text: "" }, n.content.push(a), o.push({ type: "text_start", contentIndex: l(), partial: n }))), a.type === "thinking" ? (a.thinking += r.text, a.thinkingSignature = O(a.thinkingSignature, r.thoughtSignature), o.push({
67
- type: "thinking_delta",
68
- contentIndex: l(),
69
- delta: r.text,
70
- partial: n
71
- })) : (a.text += r.text, a.textSignature = O(a.textSignature, r.thoughtSignature), o.push({
72
- type: "text_delta",
73
- contentIndex: l(),
74
- delta: r.text,
75
- partial: n
76
- }));
77
- }
78
- if (r.functionCall) {
79
- a && (a.type === "text" ? o.push({
80
- type: "text_end",
81
- contentIndex: l(),
82
- content: a.text,
83
- partial: n
84
- }) : o.push({
85
- type: "thinking_end",
86
- contentIndex: l(),
87
- content: a.thinking,
88
- partial: n
89
- }), a = null);
90
- const g = r.functionCall.id, C = {
91
- type: "toolCall",
92
- id: !g || n.content.some((b) => b.type === "toolCall" && b.id === g) ? `${r.functionCall.name}_${Date.now()}_${++q}` : g,
93
- name: r.functionCall.name || "",
94
- arguments: r.functionCall.args ?? {},
95
- ...r.thoughtSignature && { thoughtSignature: r.thoughtSignature }
96
- };
97
- n.content.push(C), o.push({ type: "toolcall_start", contentIndex: l(), partial: n }), o.push({
98
- type: "toolcall_delta",
99
- contentIndex: l(),
100
- delta: JSON.stringify(C.arguments),
101
- partial: n
102
- }), o.push({ type: "toolcall_end", contentIndex: l(), toolCall: C, partial: n });
103
- }
104
- }
105
- f?.finishReason && (n.rawStopReason = f.finishReason, n.stopReason = _(f.finishReason), n.content.some((r) => r.type === "toolCall") && n.stopReason === "stop" && (n.stopReason = "toolUse")), c.usageMetadata && (n.usage = {
106
- input: (c.usageMetadata.promptTokenCount || 0) - (c.usageMetadata.cachedContentTokenCount || 0),
107
- output: (c.usageMetadata.candidatesTokenCount || 0) + (c.usageMetadata.thoughtsTokenCount || 0),
108
- cacheRead: c.usageMetadata.cachedContentTokenCount || 0,
109
- cacheWrite: 0,
110
- reasoning: c.usageMetadata.thoughtsTokenCount || 0,
111
- totalTokens: c.usageMetadata.totalTokenCount || 0,
112
- cost: {
113
- input: 0,
114
- output: 0,
115
- cacheRead: 0,
116
- cacheWrite: 0,
117
- total: 0
118
- }
119
- }, D(e, n.usage));
120
- }
121
- if (a && (a.type === "text" ? o.push({
122
- type: "text_end",
123
- contentIndex: l(),
124
- content: a.text,
125
- partial: n
126
- }) : o.push({
127
- type: "thinking_end",
128
- contentIndex: l(),
129
- content: a.thinking,
130
- partial: n
131
- })), i?.signal?.aborted)
132
- throw new Error("Request was aborted");
133
- if (n.stopReason === "pending")
134
- throw new Error("Google Vertex stream ended without a finish reason");
135
- if (n.stopReason === "aborted" || n.stopReason === "error") {
136
- const c = n.rawStopReason ? `Provider stopped with: ${n.rawStopReason}` : "An unknown error occurred";
137
- throw new Error(c);
138
- }
139
- o.push({ type: "done", reason: n.stopReason, message: n }), o.end();
140
- } catch (s) {
141
- for (const u of n.content)
142
- "index" in u && delete u.index;
143
- n.stopReason = i?.signal?.aborted ? "aborted" : "error", n.errorMessage = H(V(s)), o.push({ type: "error", reason: n.stopReason, error: n }), o.end();
144
- }
145
- })(), o;
146
- }, pe = (e, t, i) => {
147
- const o = W(e, t, i, void 0);
148
- if (!i?.reasoning)
149
- return I(e, t, {
150
- ...o,
151
- thinking: { enabled: !1 }
152
- });
153
- const n = U(e, i.reasoning), s = n === "off" ? "high" : n, u = e;
154
- return y(u) || E(u) ? I(e, t, {
155
- ...o,
156
- thinking: {
157
- enabled: !0,
158
- level: oe(s, u)
159
- }
160
- }) : I(e, t, {
161
- ...o,
162
- thinking: {
163
- enabled: !0,
164
- budgetTokens: ae(u, s, i.thinkingBudgets)
165
- }
166
- });
167
- };
168
- function F(e, t, i, o, n) {
169
- const s = Q(n);
170
- return new L({
171
- vertexai: !0,
172
- project: t,
173
- location: i,
174
- apiVersion: w,
175
- ...s ? { googleAuthOptions: s } : {},
176
- httpOptions: x(e, o)
177
- });
178
- }
179
- function J(e, t, i) {
180
- return new L({
181
- vertexai: !0,
182
- apiKey: t,
183
- apiVersion: w,
184
- httpOptions: x(e, i)
185
- });
186
- }
187
- function x(e, t) {
188
- const i = {}, o = z(e.baseUrl);
189
- o && (i.baseUrl = o, i.baseUrlResourceScope = A.COLLECTION, X(o) && (i.apiVersion = ""));
190
- const n = K({ ...e.headers, ...t });
191
- return n && (i.headers = n), Object.keys(i).length > 0 ? i : void 0;
192
- }
193
- function z(e) {
194
- const t = e.trim();
195
- if (!(!t || t.includes("{location}")))
196
- return t;
197
- }
198
- function X(e) {
199
- try {
200
- return new URL(e).pathname.split("/").some((i) => /^v\d+(?:beta\d*)?$/.test(i));
201
- } catch {
202
- return /(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e);
203
- }
204
- }
205
- function Q(e) {
206
- const t = m("GOOGLE_APPLICATION_CREDENTIALS", e);
207
- return t ? { keyFilename: t } : void 0;
208
- }
209
- function Y(e) {
210
- const t = e?.apiKey?.trim();
211
- if (!(!t || t === $ || Z(t)))
212
- return t;
213
- }
214
- function Z(e) {
215
- return /^<[^>]+>$/.test(e);
216
- }
217
- function ee(e) {
218
- const t = e?.project || m("GOOGLE_CLOUD_PROJECT", e?.env) || m("GCLOUD_PROJECT", e?.env);
219
- if (!t)
220
- throw new Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");
221
- return t;
222
- }
223
- function te(e) {
224
- const t = e?.location || m("GOOGLE_CLOUD_LOCATION", e?.env);
225
- if (!t)
226
- throw new Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");
227
- return t;
228
- }
229
- function ne(e, t, i = {}) {
230
- const o = M(e, t), n = {};
231
- i.temperature !== void 0 && (n.temperature = i.temperature), i.maxTokens !== void 0 && (n.maxOutputTokens = i.maxTokens);
232
- const s = G(e.id), u = t.tools?.length ? S(t.tools, i.toolChoice, s) : void 0, d = {
233
- ...Object.keys(n).length > 0 && n,
234
- ...t.systemPrompt && { systemInstruction: j(t.systemPrompt) },
235
- ...t.tools && t.tools.length > 0 && {
236
- tools: P(t.tools, !1, s)
237
- },
238
- ...u !== void 0 && {
239
- toolConfig: { functionCallingConfig: { mode: u } }
240
- }
241
- };
242
- if (i.thinking?.enabled && e.reasoning) {
243
- const p = { includeThoughts: !0 };
244
- i.thinking.level !== void 0 ? p.thinkingLevel = B[i.thinking.level] : i.thinking.budgetTokens !== void 0 && (p.thinkingBudget = i.thinking.budgetTokens), d.thinkingConfig = p;
245
- } else e.reasoning && i.thinking && !i.thinking.enabled && (d.thinkingConfig = ie(e));
246
- if (i.signal) {
247
- if (i.signal.aborted)
248
- throw new Error("Request aborted");
249
- d.abortSignal = i.signal;
250
- }
251
- return {
252
- model: e.id,
253
- contents: o,
254
- config: d
255
- };
256
- }
257
- function y(e) {
258
- return /gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase());
259
- }
260
- function E(e) {
261
- const t = e.id.toLowerCase();
262
- return /gemini-3(?:\.\d+)?-flash/.test(t) || t === "gemini-flash-latest" || t === "gemini-flash-lite-latest";
263
- }
264
- function ie(e) {
265
- const t = e;
266
- return y(t) ? { thinkingLevel: h.LOW } : E(t) ? { thinkingLevel: h.MINIMAL } : { thinkingBudget: 0 };
267
- }
268
- function oe(e, t) {
269
- if (y(t))
270
- switch (e) {
271
- case "minimal":
272
- case "low":
273
- return "LOW";
274
- case "medium":
275
- case "high":
276
- return "HIGH";
277
- }
278
- switch (e) {
279
- case "minimal":
280
- return "MINIMAL";
281
- case "low":
282
- return "LOW";
283
- case "medium":
284
- return "MEDIUM";
285
- case "high":
286
- return "HIGH";
287
- }
288
- }
289
- function ae(e, t, i) {
290
- return i?.[t] !== void 0 ? i[t] : e.id.includes("2.5-pro") ? {
291
- minimal: 128,
292
- low: 2048,
293
- medium: 8192,
294
- high: 32768
295
- }[t] : e.id.includes("2.5-flash") ? {
296
- minimal: 128,
297
- low: 2048,
298
- medium: 8192,
299
- high: 24576
300
- }[t] : -1;
301
- }
302
- export {
303
- I as stream,
304
- pe as streamSimple
305
- };
@@ -1,14 +0,0 @@
1
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(o) {
2
- return Promise.resolve().then(o);
3
- } });
4
- function n(o) {
5
- let e = 3735928559, t = 1103547991;
6
- for (let r = 0; r < o.length; r++) {
7
- const i = o.charCodeAt(r);
8
- e = Math.imul(e ^ i, 2654435761), t = Math.imul(t ^ i, 1597334677);
9
- }
10
- return e = Math.imul(e ^ e >>> 16, 2246822507) ^ Math.imul(t ^ t >>> 13, 3266489909), t = Math.imul(t ^ t >>> 16, 2246822507) ^ Math.imul(e ^ e >>> 13, 3266489909), (t >>> 0).toString(36) + (e >>> 0).toString(36);
11
- }
12
- export {
13
- n as s
14
- };
@@ -1,21 +0,0 @@
1
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
2
- return Promise.resolve().then(e);
3
- } });
4
- function s(e) {
5
- const r = {};
6
- for (const [o, n] of e.entries())
7
- r[o] = n;
8
- return r;
9
- }
10
- function t(e) {
11
- if (!e)
12
- return;
13
- const r = {};
14
- for (const [o, n] of Object.entries(e))
15
- n !== null && (r[o] = n);
16
- return Object.keys(r).length > 0 ? r : void 0;
17
- }
18
- export {
19
- s as h,
20
- t as p
21
- };
@@ -1,232 +0,0 @@
1
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
2
- return Promise.resolve().then(e);
3
- } });
4
- var d = {}, y = {}, T;
5
- function J() {
6
- return T || (T = 1, (function(e) {
7
- Object.defineProperty(e, "__esModule", { value: !0 }), e.Allow = e.ALL = e.COLLECTION = e.ATOM = e.SPECIAL = e.INF = e._INFINITY = e.INFINITY = e.NAN = e.BOOL = e.NULL = e.OBJ = e.ARR = e.NUM = e.STR = void 0, e.STR = 1, e.NUM = 2, e.ARR = 4, e.OBJ = 8, e.NULL = 16, e.BOOL = 32, e.NAN = 64, e.INFINITY = 128, e._INFINITY = 256, e.INF = e.INFINITY | e._INFINITY, e.SPECIAL = e.NULL | e.BOOL | e.INF | e.NAN, e.ATOM = e.STR | e.NUM | e.SPECIAL, e.COLLECTION = e.ARR | e.OBJ, e.ALL = e.ATOM | e.COLLECTION, e.Allow = { STR: e.STR, NUM: e.NUM, ARR: e.ARR, OBJ: e.OBJ, NULL: e.NULL, BOOL: e.BOOL, NAN: e.NAN, INFINITY: e.INFINITY, _INFINITY: e._INFINITY, INF: e.INF, SPECIAL: e.SPECIAL, ATOM: e.ATOM, COLLECTION: e.COLLECTION, ALL: e.ALL }, e.default = e.Allow;
8
- })(y)), y;
9
- }
10
- var _;
11
- function B() {
12
- return _ || (_ = 1, (function(e) {
13
- var c = d && d.__createBinding || (Object.create ? (function(r, n, u, t) {
14
- t === void 0 && (t = u);
15
- var f = Object.getOwnPropertyDescriptor(n, u);
16
- (!f || ("get" in f ? !n.__esModule : f.writable || f.configurable)) && (f = { enumerable: !0, get: function() {
17
- return n[u];
18
- } }), Object.defineProperty(r, t, f);
19
- }) : (function(r, n, u, t) {
20
- t === void 0 && (t = u), r[t] = n[u];
21
- })), s = d && d.__exportStar || function(r, n) {
22
- for (var u in r) u !== "default" && !Object.prototype.hasOwnProperty.call(n, u) && c(n, r, u);
23
- };
24
- Object.defineProperty(e, "__esModule", { value: !0 }), e.Allow = e.MalformedJSON = e.PartialJSON = e.parseJSON = e.parse = void 0;
25
- const i = J();
26
- Object.defineProperty(e, "Allow", { enumerable: !0, get: function() {
27
- return i.Allow;
28
- } }), s(J(), e);
29
- class l extends Error {
30
- }
31
- e.PartialJSON = l;
32
- class I extends Error {
33
- }
34
- e.MalformedJSON = I;
35
- function b(r, n = i.Allow.ALL) {
36
- if (typeof r != "string")
37
- throw new TypeError(`expecting str, got ${typeof r}`);
38
- if (!r.trim())
39
- throw new Error(`${r} is empty`);
40
- return E(r.trim(), n);
41
- }
42
- e.parseJSON = b;
43
- const E = (r, n) => {
44
- const u = r.length;
45
- let t = 0;
46
- const f = (a) => {
47
- throw new l(`${a} at position ${t}`);
48
- }, h = (a) => {
49
- throw new I(`${a} at position ${t}`);
50
- }, L = () => (A(), t >= u && f("Unexpected end of input"), r[t] === '"' ? w() : r[t] === "{" ? o() : r[t] === "[" ? M() : r.substring(t, t + 4) === "null" || i.Allow.NULL & n && u - t < 4 && "null".startsWith(r.substring(t)) ? (t += 4, null) : r.substring(t, t + 4) === "true" || i.Allow.BOOL & n && u - t < 4 && "true".startsWith(r.substring(t)) ? (t += 4, !0) : r.substring(t, t + 5) === "false" || i.Allow.BOOL & n && u - t < 5 && "false".startsWith(r.substring(t)) ? (t += 5, !1) : r.substring(t, t + 8) === "Infinity" || i.Allow.INFINITY & n && u - t < 8 && "Infinity".startsWith(r.substring(t)) ? (t += 8, 1 / 0) : r.substring(t, t + 9) === "-Infinity" || i.Allow._INFINITY & n && 1 < u - t && u - t < 9 && "-Infinity".startsWith(r.substring(t)) ? (t += 9, -1 / 0) : r.substring(t, t + 3) === "NaN" || i.Allow.NAN & n && u - t < 3 && "NaN".startsWith(r.substring(t)) ? (t += 3, NaN) : v()), w = () => {
51
- const a = t;
52
- let N = !1;
53
- for (t++; t < u && (r[t] !== '"' || N && r[t - 1] === "\\"); )
54
- N = r[t] === "\\" ? !N : !1, t++;
55
- if (r.charAt(t) == '"')
56
- try {
57
- return JSON.parse(r.substring(a, ++t - Number(N)));
58
- } catch (O) {
59
- h(String(O));
60
- }
61
- else if (i.Allow.STR & n)
62
- try {
63
- return JSON.parse(r.substring(a, t - Number(N)) + '"');
64
- } catch {
65
- return JSON.parse(r.substring(a, r.lastIndexOf("\\")) + '"');
66
- }
67
- f("Unterminated string literal");
68
- }, o = () => {
69
- t++, A();
70
- const a = {};
71
- try {
72
- for (; r[t] !== "}"; ) {
73
- if (A(), t >= u && i.Allow.OBJ & n)
74
- return a;
75
- const N = w();
76
- A(), t++;
77
- try {
78
- const O = L();
79
- a[N] = O;
80
- } catch (O) {
81
- if (i.Allow.OBJ & n)
82
- return a;
83
- throw O;
84
- }
85
- A(), r[t] === "," && t++;
86
- }
87
- } catch {
88
- if (i.Allow.OBJ & n)
89
- return a;
90
- f("Expected '}' at end of object");
91
- }
92
- return t++, a;
93
- }, M = () => {
94
- t++;
95
- const a = [];
96
- try {
97
- for (; r[t] !== "]"; )
98
- a.push(L()), A(), r[t] === "," && t++;
99
- } catch {
100
- if (i.Allow.ARR & n)
101
- return a;
102
- f("Expected ']' at end of array");
103
- }
104
- return t++, a;
105
- }, v = () => {
106
- if (t === 0) {
107
- r === "-" && h("Not sure what '-' is");
108
- try {
109
- return JSON.parse(r);
110
- } catch (N) {
111
- if (i.Allow.NUM & n)
112
- try {
113
- return JSON.parse(r.substring(0, r.lastIndexOf("e")));
114
- } catch {
115
- }
116
- h(String(N));
117
- }
118
- }
119
- const a = t;
120
- for (r[t] === "-" && t++; r[t] && ",]}".indexOf(r[t]) === -1; )
121
- t++;
122
- t == u && !(i.Allow.NUM & n) && f("Unterminated number literal");
123
- try {
124
- return JSON.parse(r.substring(a, t));
125
- } catch {
126
- r.substring(a, t) === "-" && f("Not sure what '-' is");
127
- try {
128
- return JSON.parse(r.substring(a, r.lastIndexOf("e")));
129
- } catch (O) {
130
- h(String(O));
131
- }
132
- }
133
- }, A = () => {
134
- for (; t < u && `
135
- \r `.includes(r[t]); )
136
- t++;
137
- };
138
- return L();
139
- }, P = b;
140
- e.parse = P;
141
- })(d)), d;
142
- }
143
- var C = B();
144
- const F = /* @__PURE__ */ new Set(['"', "\\", "/", "b", "f", "n", "r", "t", "u"]);
145
- function m(e) {
146
- const c = e.codePointAt(0);
147
- return c !== void 0 && c >= 0 && c <= 31;
148
- }
149
- function U(e) {
150
- switch (e) {
151
- case "\b":
152
- return "\\b";
153
- case "\f":
154
- return "\\f";
155
- case `
156
- `:
157
- return "\\n";
158
- case "\r":
159
- return "\\r";
160
- case " ":
161
- return "\\t";
162
- default:
163
- return `\\u${e.codePointAt(0)?.toString(16).padStart(4, "0") ?? "0000"}`;
164
- }
165
- }
166
- function R(e) {
167
- let c = "", s = !1;
168
- for (let i = 0; i < e.length; i++) {
169
- const l = e[i];
170
- if (!s) {
171
- c += l, l === '"' && (s = !0);
172
- continue;
173
- }
174
- if (l === '"') {
175
- c += l, s = !1;
176
- continue;
177
- }
178
- if (l === "\\") {
179
- const I = e[i + 1];
180
- if (I === void 0) {
181
- c += "\\\\";
182
- continue;
183
- }
184
- if (I === "u") {
185
- const b = e.slice(i + 2, i + 6);
186
- if (/^[0-9a-fA-F]{4}$/.test(b)) {
187
- c += `\\u${b}`, i += 5;
188
- continue;
189
- }
190
- }
191
- if (F.has(I)) {
192
- c += `\\${I}`, i += 1;
193
- continue;
194
- }
195
- c += "\\\\";
196
- continue;
197
- }
198
- c += m(l) ? U(l) : l;
199
- }
200
- return c;
201
- }
202
- function Y(e) {
203
- try {
204
- return JSON.parse(e);
205
- } catch (c) {
206
- const s = R(e);
207
- if (s !== e)
208
- return JSON.parse(s);
209
- throw c;
210
- }
211
- }
212
- function $(e) {
213
- if (!e || e.trim() === "")
214
- return {};
215
- try {
216
- return Y(e);
217
- } catch {
218
- try {
219
- return C.parse(e) ?? {};
220
- } catch {
221
- try {
222
- return C.parse(R(e)) ?? {};
223
- } catch {
224
- return {};
225
- }
226
- }
227
- }
228
- }
229
- export {
230
- Y as a,
231
- $ as p
232
- };
@@ -1,5 +0,0 @@
1
- import { bH as o } from "./global-CTQcFve1.js";
2
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
3
- return Promise.resolve().then(e);
4
- } });
5
- o();