@opentabs-dev/opentabs-plugin-notebooklm 0.0.113 → 0.0.114
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.
- package/dist/adapter.iife.js +1746 -1745
- package/dist/adapter.iife.js.map +4 -4
- package/dist/tools.json +1 -1
- package/package.json +3 -3
package/dist/adapter.iife.js
CHANGED
|
@@ -6,501 +6,6 @@
|
|
|
6
6
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
// node_modules/@opentabs-dev/shared/dist/error.js
|
|
10
|
-
var toErrorMessage = (err2) => err2 instanceof Error ? err2.message : String(err2);
|
|
11
|
-
|
|
12
|
-
// node_modules/@opentabs-dev/plugin-sdk/dist/errors.js
|
|
13
|
-
var ToolError = class _ToolError extends Error {
|
|
14
|
-
code;
|
|
15
|
-
/** Whether this error is retryable (defaults to false). */
|
|
16
|
-
retryable;
|
|
17
|
-
/** Suggested delay before retrying, in milliseconds. */
|
|
18
|
-
retryAfterMs;
|
|
19
|
-
/** Error category for structured error classification. */
|
|
20
|
-
category;
|
|
21
|
-
constructor(message, code, opts) {
|
|
22
|
-
super(message);
|
|
23
|
-
this.code = code;
|
|
24
|
-
this.name = "ToolError";
|
|
25
|
-
this.retryable = opts?.retryable ?? false;
|
|
26
|
-
this.retryAfterMs = opts?.retryAfterMs;
|
|
27
|
-
this.category = opts?.category;
|
|
28
|
-
}
|
|
29
|
-
/** Authentication or authorization error (not retryable). Accepts an optional domain-specific code. */
|
|
30
|
-
static auth(message, code) {
|
|
31
|
-
return new _ToolError(message, code ?? "AUTH_ERROR", { category: "auth", retryable: false });
|
|
32
|
-
}
|
|
33
|
-
/** Resource not found (not retryable). Accepts an optional domain-specific code. */
|
|
34
|
-
static notFound(message, code) {
|
|
35
|
-
return new _ToolError(message, code ?? "NOT_FOUND", { category: "not_found", retryable: false });
|
|
36
|
-
}
|
|
37
|
-
/** Rate limited (retryable). Accepts an optional retry delay in milliseconds and an optional domain-specific code. */
|
|
38
|
-
static rateLimited(message, retryAfterMs, code) {
|
|
39
|
-
return new _ToolError(message, code ?? "RATE_LIMITED", { category: "rate_limit", retryable: true, retryAfterMs });
|
|
40
|
-
}
|
|
41
|
-
/** Input validation error (not retryable). Accepts an optional domain-specific code. */
|
|
42
|
-
static validation(message, code) {
|
|
43
|
-
return new _ToolError(message, code ?? "VALIDATION_ERROR", { category: "validation", retryable: false });
|
|
44
|
-
}
|
|
45
|
-
/** Operation timed out (retryable). Accepts an optional domain-specific code. */
|
|
46
|
-
static timeout(message, code) {
|
|
47
|
-
return new _ToolError(message, code ?? "TIMEOUT", { category: "timeout", retryable: true });
|
|
48
|
-
}
|
|
49
|
-
/** Internal/unexpected error (not retryable). Accepts an optional domain-specific code. */
|
|
50
|
-
static internal(message, code) {
|
|
51
|
-
return new _ToolError(message, code ?? "INTERNAL_ERROR", { category: "internal", retryable: false });
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// node_modules/@opentabs-dev/plugin-sdk/dist/fetch.js
|
|
56
|
-
var MAX_ERROR_BODY_LENGTH = 512;
|
|
57
|
-
var httpStatusToToolError = (response, message) => {
|
|
58
|
-
const status = response.status;
|
|
59
|
-
if (status === 401 || status === 403) {
|
|
60
|
-
return ToolError.auth(message);
|
|
61
|
-
}
|
|
62
|
-
if (status === 404) {
|
|
63
|
-
return ToolError.notFound(message);
|
|
64
|
-
}
|
|
65
|
-
if (status === 429) {
|
|
66
|
-
const retryAfter = response.headers.get("Retry-After");
|
|
67
|
-
const retryAfterMs = retryAfter !== null ? parseRetryAfterMs(retryAfter) : void 0;
|
|
68
|
-
return ToolError.rateLimited(message, retryAfterMs);
|
|
69
|
-
}
|
|
70
|
-
if (status === 400 || status === 422) {
|
|
71
|
-
return ToolError.validation(message);
|
|
72
|
-
}
|
|
73
|
-
if (status === 408) {
|
|
74
|
-
return ToolError.timeout(message);
|
|
75
|
-
}
|
|
76
|
-
if (status >= 500) {
|
|
77
|
-
const TRANSIENT_5XX = /* @__PURE__ */ new Set([500, 502, 503, 504]);
|
|
78
|
-
const retryable = TRANSIENT_5XX.has(status);
|
|
79
|
-
const retryAfter = status === 503 ? response.headers.get("Retry-After") : null;
|
|
80
|
-
const retryAfterMs = retryAfter !== null ? parseRetryAfterMs(retryAfter) : void 0;
|
|
81
|
-
return new ToolError(message, "http_error", { category: "internal", retryable, retryAfterMs });
|
|
82
|
-
}
|
|
83
|
-
if (status >= 400 && status < 500) {
|
|
84
|
-
return new ToolError(message, "http_error", { retryable: false });
|
|
85
|
-
}
|
|
86
|
-
return new ToolError(message, "http_error", { category: "internal" });
|
|
87
|
-
};
|
|
88
|
-
var parseRetryAfterMs = (value) => {
|
|
89
|
-
const seconds = Number(value);
|
|
90
|
-
if (!Number.isNaN(seconds) && seconds >= 0) {
|
|
91
|
-
return seconds * 1e3;
|
|
92
|
-
}
|
|
93
|
-
const date5 = Date.parse(value);
|
|
94
|
-
if (!Number.isNaN(date5)) {
|
|
95
|
-
const ms = date5 - Date.now();
|
|
96
|
-
return ms > 0 ? ms : void 0;
|
|
97
|
-
}
|
|
98
|
-
return void 0;
|
|
99
|
-
};
|
|
100
|
-
var buildQueryString = (params) => {
|
|
101
|
-
const searchParams = new URLSearchParams();
|
|
102
|
-
for (const [key, value] of Object.entries(params)) {
|
|
103
|
-
if (value === void 0)
|
|
104
|
-
continue;
|
|
105
|
-
if (Array.isArray(value)) {
|
|
106
|
-
for (const item of value) {
|
|
107
|
-
searchParams.append(key, String(item));
|
|
108
|
-
}
|
|
109
|
-
} else {
|
|
110
|
-
searchParams.append(key, String(value));
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return searchParams.toString();
|
|
114
|
-
};
|
|
115
|
-
var fetchFromPage = async (url2, init) => {
|
|
116
|
-
const { timeout = 3e4, signal, ...rest } = init ?? {};
|
|
117
|
-
const timeoutSignal = AbortSignal.timeout(timeout);
|
|
118
|
-
const combinedSignal = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;
|
|
119
|
-
let response;
|
|
120
|
-
try {
|
|
121
|
-
response = await fetch(url2, {
|
|
122
|
-
credentials: "include",
|
|
123
|
-
...rest,
|
|
124
|
-
signal: combinedSignal
|
|
125
|
-
});
|
|
126
|
-
} catch (error51) {
|
|
127
|
-
if (error51 instanceof DOMException && error51.name === "TimeoutError") {
|
|
128
|
-
throw ToolError.timeout(`fetchFromPage: request timed out after ${timeout}ms for ${url2}`);
|
|
129
|
-
}
|
|
130
|
-
if (combinedSignal.aborted) {
|
|
131
|
-
throw new ToolError(`fetchFromPage: request aborted for ${url2}`, "aborted");
|
|
132
|
-
}
|
|
133
|
-
throw new ToolError(`fetchFromPage: network error for ${url2}: ${toErrorMessage(error51)}`, "network_error", {
|
|
134
|
-
category: "internal",
|
|
135
|
-
retryable: true
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
if (!response.ok) {
|
|
139
|
-
const rawText = await response.text().catch(() => response.statusText);
|
|
140
|
-
const errorText = rawText.length > MAX_ERROR_BODY_LENGTH ? `${rawText.slice(0, MAX_ERROR_BODY_LENGTH)}\u2026` : rawText;
|
|
141
|
-
const msg = `fetchFromPage: HTTP ${response.status} for ${url2}: ${errorText}`;
|
|
142
|
-
throw httpStatusToToolError(response, msg);
|
|
143
|
-
}
|
|
144
|
-
return response;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
// node_modules/@opentabs-dev/plugin-sdk/dist/timing.js
|
|
148
|
-
var waitUntil = (predicate, opts) => {
|
|
149
|
-
const interval = opts?.interval ?? 200;
|
|
150
|
-
const timeout = opts?.timeout ?? 1e4;
|
|
151
|
-
const signal = opts?.signal;
|
|
152
|
-
const abortReason = () => signal?.reason instanceof Error ? signal.reason : new Error("waitUntil: aborted");
|
|
153
|
-
if (signal?.aborted)
|
|
154
|
-
return Promise.reject(abortReason());
|
|
155
|
-
return new Promise((resolve, reject) => {
|
|
156
|
-
let settled = false;
|
|
157
|
-
let poller;
|
|
158
|
-
let lastPredicateError;
|
|
159
|
-
const isSettled = () => settled;
|
|
160
|
-
const cleanup = () => {
|
|
161
|
-
settled = true;
|
|
162
|
-
clearTimeout(timer);
|
|
163
|
-
clearTimeout(poller);
|
|
164
|
-
signal?.removeEventListener("abort", onAbort);
|
|
165
|
-
};
|
|
166
|
-
const onAbort = () => {
|
|
167
|
-
if (isSettled())
|
|
168
|
-
return;
|
|
169
|
-
cleanup();
|
|
170
|
-
reject(abortReason());
|
|
171
|
-
};
|
|
172
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
173
|
-
const timer = setTimeout(() => {
|
|
174
|
-
if (isSettled())
|
|
175
|
-
return;
|
|
176
|
-
cleanup();
|
|
177
|
-
const errorContext = lastPredicateError instanceof Error ? `: predicate last threw \u2014 ${lastPredicateError.message}` : "";
|
|
178
|
-
reject(new Error(`waitUntil: timed out after ${timeout}ms waiting for predicate to return true${errorContext}`));
|
|
179
|
-
}, timeout);
|
|
180
|
-
const check2 = async () => {
|
|
181
|
-
if (isSettled())
|
|
182
|
-
return;
|
|
183
|
-
try {
|
|
184
|
-
const result = await predicate();
|
|
185
|
-
if (result) {
|
|
186
|
-
cleanup();
|
|
187
|
-
resolve();
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
} catch (err2) {
|
|
191
|
-
lastPredicateError = err2;
|
|
192
|
-
}
|
|
193
|
-
if (!isSettled()) {
|
|
194
|
-
poller = setTimeout(() => void check2(), interval);
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
void check2();
|
|
198
|
-
});
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
// node_modules/@opentabs-dev/plugin-sdk/dist/log.js
|
|
202
|
-
var MAX_DATA_LENGTH = 10;
|
|
203
|
-
var MAX_STRING_LENGTH = 4096;
|
|
204
|
-
var MAX_SERIALIZED_SIZE = 64 * 1024;
|
|
205
|
-
var safeSerializeArg = (value) => {
|
|
206
|
-
try {
|
|
207
|
-
if (value === null || value === void 0)
|
|
208
|
-
return value;
|
|
209
|
-
const type = typeof value;
|
|
210
|
-
if (type === "boolean" || type === "number")
|
|
211
|
-
return value;
|
|
212
|
-
if (type === "string") {
|
|
213
|
-
return value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}\u2026` : value;
|
|
214
|
-
}
|
|
215
|
-
if (type === "function")
|
|
216
|
-
return `[Function: ${value.name || "anonymous"}]`;
|
|
217
|
-
if (type === "symbol")
|
|
218
|
-
return `[Symbol: ${value.description ?? ""}]`;
|
|
219
|
-
if (type === "bigint")
|
|
220
|
-
return `[BigInt: ${value.toString()}]`;
|
|
221
|
-
if (typeof value.nodeType === "number" && typeof value.nodeName === "string") {
|
|
222
|
-
try {
|
|
223
|
-
const node = value;
|
|
224
|
-
let classStr = "";
|
|
225
|
-
if (typeof node.className === "string") {
|
|
226
|
-
classStr = node.className ? `.${node.className.split(" ")[0] ?? ""}` : "";
|
|
227
|
-
} else if (node.className !== null && typeof node.className === "object") {
|
|
228
|
-
const baseVal = node.className.baseVal;
|
|
229
|
-
if (typeof baseVal === "string") {
|
|
230
|
-
classStr = baseVal ? `.${baseVal.split(" ")[0] ?? ""}` : "";
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
return `[${node.nodeName}${node.id ? `#${node.id}` : ""}${classStr}]`;
|
|
234
|
-
} catch {
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
if (value instanceof Error) {
|
|
238
|
-
return { name: value.name, message: value.message, stack: value.stack };
|
|
239
|
-
}
|
|
240
|
-
if (value instanceof WeakRef)
|
|
241
|
-
return "[WeakRef]";
|
|
242
|
-
if (value instanceof WeakMap)
|
|
243
|
-
return "[WeakMap]";
|
|
244
|
-
if (value instanceof WeakSet)
|
|
245
|
-
return "[WeakSet]";
|
|
246
|
-
if (value instanceof ArrayBuffer)
|
|
247
|
-
return "[ArrayBuffer]";
|
|
248
|
-
if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer)
|
|
249
|
-
return "[SharedArrayBuffer]";
|
|
250
|
-
try {
|
|
251
|
-
const seen = /* @__PURE__ */ new WeakSet();
|
|
252
|
-
const json2 = JSON.stringify(value, (_key, v) => {
|
|
253
|
-
if (typeof v === "object" && v !== null) {
|
|
254
|
-
if (seen.has(v))
|
|
255
|
-
return "[Circular]";
|
|
256
|
-
seen.add(v);
|
|
257
|
-
}
|
|
258
|
-
if (typeof v === "function")
|
|
259
|
-
return `[Function: ${v.name || "anonymous"}]`;
|
|
260
|
-
if (typeof v === "bigint")
|
|
261
|
-
return `[BigInt: ${v.toString()}]`;
|
|
262
|
-
if (typeof v === "symbol")
|
|
263
|
-
return `[Symbol: ${v.description ?? ""}]`;
|
|
264
|
-
if (v instanceof WeakRef)
|
|
265
|
-
return "[WeakRef]";
|
|
266
|
-
if (v instanceof WeakMap)
|
|
267
|
-
return "[WeakMap]";
|
|
268
|
-
if (v instanceof WeakSet)
|
|
269
|
-
return "[WeakSet]";
|
|
270
|
-
if (v instanceof ArrayBuffer)
|
|
271
|
-
return "[ArrayBuffer]";
|
|
272
|
-
if (typeof SharedArrayBuffer !== "undefined" && v instanceof SharedArrayBuffer)
|
|
273
|
-
return "[SharedArrayBuffer]";
|
|
274
|
-
return v;
|
|
275
|
-
});
|
|
276
|
-
if (json2.length > MAX_SERIALIZED_SIZE) {
|
|
277
|
-
return `[Object truncated: ${json2.length} chars]`;
|
|
278
|
-
}
|
|
279
|
-
return JSON.parse(json2);
|
|
280
|
-
} catch {
|
|
281
|
-
return `[Unserializable: ${typeof value}]`;
|
|
282
|
-
}
|
|
283
|
-
} catch {
|
|
284
|
-
return `[Unserializable: ${typeof value}]`;
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
var safeSerialize = (args) => {
|
|
288
|
-
const capped = args.length > MAX_DATA_LENGTH ? args.slice(0, MAX_DATA_LENGTH) : args;
|
|
289
|
-
return capped.map(safeSerializeArg);
|
|
290
|
-
};
|
|
291
|
-
var CONSOLE_METHODS = {
|
|
292
|
-
debug: "debug",
|
|
293
|
-
info: "info",
|
|
294
|
-
warning: "warn",
|
|
295
|
-
error: "error"
|
|
296
|
-
};
|
|
297
|
-
var defaultTransport = (entry) => {
|
|
298
|
-
const method = CONSOLE_METHODS[entry.level];
|
|
299
|
-
console[method](`[sdk.log] ${entry.message}`, ...entry.data);
|
|
300
|
-
};
|
|
301
|
-
var activeTransport = defaultTransport;
|
|
302
|
-
var _setLogTransport = (transport) => {
|
|
303
|
-
const previous = activeTransport;
|
|
304
|
-
activeTransport = transport;
|
|
305
|
-
return () => {
|
|
306
|
-
if (activeTransport === transport)
|
|
307
|
-
activeTransport = previous;
|
|
308
|
-
};
|
|
309
|
-
};
|
|
310
|
-
var makeLogMethod = (level) => (message, ...args) => {
|
|
311
|
-
const entry = {
|
|
312
|
-
level,
|
|
313
|
-
message,
|
|
314
|
-
data: safeSerialize(args),
|
|
315
|
-
ts: (/* @__PURE__ */ new Date()).toISOString()
|
|
316
|
-
};
|
|
317
|
-
activeTransport(entry);
|
|
318
|
-
};
|
|
319
|
-
var log = Object.freeze({
|
|
320
|
-
debug: makeLogMethod("debug"),
|
|
321
|
-
info: makeLogMethod("info"),
|
|
322
|
-
warn: makeLogMethod("warning"),
|
|
323
|
-
error: makeLogMethod("error")
|
|
324
|
-
});
|
|
325
|
-
var ot = globalThis.__openTabs ?? {};
|
|
326
|
-
globalThis.__openTabs = ot;
|
|
327
|
-
ot._setLogTransport = _setLogTransport;
|
|
328
|
-
ot.log = log;
|
|
329
|
-
|
|
330
|
-
// node_modules/@opentabs-dev/plugin-sdk/dist/storage.js
|
|
331
|
-
var getAuthCache = (namespace) => {
|
|
332
|
-
try {
|
|
333
|
-
const ns = globalThis.__openTabs;
|
|
334
|
-
const cache = ns?.tokenCache;
|
|
335
|
-
return cache?.[namespace] ?? null;
|
|
336
|
-
} catch {
|
|
337
|
-
return null;
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
|
-
var setAuthCache = (namespace, value) => {
|
|
341
|
-
try {
|
|
342
|
-
const g = globalThis;
|
|
343
|
-
if (!g.__openTabs)
|
|
344
|
-
g.__openTabs = {};
|
|
345
|
-
const ns = g.__openTabs;
|
|
346
|
-
if (!ns.tokenCache)
|
|
347
|
-
ns.tokenCache = {};
|
|
348
|
-
ns.tokenCache[namespace] = value;
|
|
349
|
-
} catch {
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
var clearAuthCache = (namespace) => {
|
|
353
|
-
try {
|
|
354
|
-
const ns = globalThis.__openTabs;
|
|
355
|
-
const cache = ns?.tokenCache;
|
|
356
|
-
if (cache)
|
|
357
|
-
cache[namespace] = void 0;
|
|
358
|
-
} catch {
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
// node_modules/@opentabs-dev/plugin-sdk/dist/page-state.js
|
|
363
|
-
var BLOCKED_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
364
|
-
var getPageGlobal = (path) => {
|
|
365
|
-
try {
|
|
366
|
-
const segments = path.split(".");
|
|
367
|
-
let current = globalThis;
|
|
368
|
-
for (const segment of segments) {
|
|
369
|
-
if (current === null || current === void 0)
|
|
370
|
-
return void 0;
|
|
371
|
-
if (typeof current !== "object" && typeof current !== "function")
|
|
372
|
-
return void 0;
|
|
373
|
-
if (BLOCKED_SEGMENTS.has(segment))
|
|
374
|
-
return void 0;
|
|
375
|
-
current = current[segment];
|
|
376
|
-
}
|
|
377
|
-
return current;
|
|
378
|
-
} catch {
|
|
379
|
-
return void 0;
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
// node_modules/@opentabs-dev/plugin-sdk/dist/index.js
|
|
384
|
-
var defineTool = (config2) => config2;
|
|
385
|
-
var OpenTabsPlugin = class {
|
|
386
|
-
/**
|
|
387
|
-
* Chrome match patterns for URLs that should NOT match this plugin.
|
|
388
|
-
* Tabs matching both urlPatterns and excludePatterns are excluded.
|
|
389
|
-
* Useful when a broad urlPattern overlaps with another plugin's domain.
|
|
390
|
-
* @see https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns
|
|
391
|
-
*/
|
|
392
|
-
excludePatterns;
|
|
393
|
-
/**
|
|
394
|
-
* URL to open when no matching tab exists and the user triggers an
|
|
395
|
-
* 'open tab' action from the side panel. Should be a concrete URL
|
|
396
|
-
* (e.g., 'https://github.com'), not a match pattern.
|
|
397
|
-
*/
|
|
398
|
-
homepage;
|
|
399
|
-
/** Typed configuration schema — declares settings that users provide via config.json or the side panel. */
|
|
400
|
-
configSchema;
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
// src/notebooklm-api.ts
|
|
404
|
-
var API_PATH = "/_/LabsTailwindUi/data/batchexecute";
|
|
405
|
-
var getWizData = () => {
|
|
406
|
-
const data = getPageGlobal("WIZ_global_data");
|
|
407
|
-
if (!data?.SNlM0e) return null;
|
|
408
|
-
return data;
|
|
409
|
-
};
|
|
410
|
-
var getAuth = () => {
|
|
411
|
-
const cached2 = getAuthCache("notebooklm");
|
|
412
|
-
if (cached2?.at) return cached2;
|
|
413
|
-
const wiz = getWizData();
|
|
414
|
-
if (!wiz?.SNlM0e) return null;
|
|
415
|
-
const auth = {
|
|
416
|
-
at: wiz.SNlM0e,
|
|
417
|
-
bl: wiz.cfb2h ?? "",
|
|
418
|
-
userId: wiz.S06Grb ?? "",
|
|
419
|
-
email: wiz.oPEP7c ?? "",
|
|
420
|
-
sid: wiz.FdrFJe ?? ""
|
|
421
|
-
};
|
|
422
|
-
setAuthCache("notebooklm", auth);
|
|
423
|
-
return auth;
|
|
424
|
-
};
|
|
425
|
-
var isAuthenticated = () => getAuth() !== null;
|
|
426
|
-
var waitForAuth = async () => {
|
|
427
|
-
try {
|
|
428
|
-
await waitUntil(() => isAuthenticated(), {
|
|
429
|
-
interval: 500,
|
|
430
|
-
timeout: 5e3
|
|
431
|
-
});
|
|
432
|
-
return true;
|
|
433
|
-
} catch {
|
|
434
|
-
return false;
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
var getCurrentUserInfo = () => {
|
|
438
|
-
const auth = getAuth();
|
|
439
|
-
if (!auth) throw ToolError.auth("Not authenticated \u2014 please log in to NotebookLM.");
|
|
440
|
-
return { userId: auth.userId, email: auth.email };
|
|
441
|
-
};
|
|
442
|
-
var parseBatchResponse = (text) => {
|
|
443
|
-
const lines = text.split("\n");
|
|
444
|
-
for (const line of lines) {
|
|
445
|
-
const trimmed = line.trim();
|
|
446
|
-
if (!trimmed || trimmed === ")]}'" || /^\d+$/.test(trimmed)) continue;
|
|
447
|
-
try {
|
|
448
|
-
const parsed = JSON.parse(trimmed);
|
|
449
|
-
if (!Array.isArray(parsed)) continue;
|
|
450
|
-
const inner = parsed[0];
|
|
451
|
-
if (!Array.isArray(inner)) continue;
|
|
452
|
-
if (inner[0] === "wrb.fr") {
|
|
453
|
-
const dataStr = inner[2];
|
|
454
|
-
if (dataStr === null || dataStr === void 0) {
|
|
455
|
-
const errorCode = inner[5];
|
|
456
|
-
if (errorCode) {
|
|
457
|
-
const code = Array.isArray(errorCode) ? errorCode[0] : errorCode;
|
|
458
|
-
if (code === 3) throw ToolError.validation("Invalid request parameters.");
|
|
459
|
-
if (code === 5) throw ToolError.notFound("Resource not found.");
|
|
460
|
-
if (code === 7) throw ToolError.auth("Not authenticated \u2014 please log in to NotebookLM.");
|
|
461
|
-
if (code === 16) throw ToolError.auth("Not authenticated \u2014 please log in to NotebookLM.");
|
|
462
|
-
throw ToolError.internal(`RPC error code ${code}`);
|
|
463
|
-
}
|
|
464
|
-
return null;
|
|
465
|
-
}
|
|
466
|
-
return JSON.parse(dataStr);
|
|
467
|
-
}
|
|
468
|
-
} catch (e) {
|
|
469
|
-
if (e instanceof ToolError) throw e;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
throw ToolError.internal("Failed to parse batchexecute response.");
|
|
473
|
-
};
|
|
474
|
-
var rpc = async (rpcId, params, sourcePath) => {
|
|
475
|
-
const auth = getAuth();
|
|
476
|
-
if (!auth) throw ToolError.auth("Not authenticated \u2014 please log in to NotebookLM.");
|
|
477
|
-
const qs = buildQueryString({
|
|
478
|
-
rpcids: rpcId,
|
|
479
|
-
"source-path": sourcePath ?? "/",
|
|
480
|
-
bl: auth.bl,
|
|
481
|
-
hl: "en"
|
|
482
|
-
});
|
|
483
|
-
const url2 = `${API_PATH}?${qs}`;
|
|
484
|
-
const body = new URLSearchParams();
|
|
485
|
-
body.set("f.req", JSON.stringify([[[rpcId, JSON.stringify(params), null, "generic"]]]));
|
|
486
|
-
body.set("at", auth.at);
|
|
487
|
-
const resp = await fetchFromPage(url2, {
|
|
488
|
-
method: "POST",
|
|
489
|
-
headers: {
|
|
490
|
-
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
|
491
|
-
"X-Same-Domain": "1"
|
|
492
|
-
},
|
|
493
|
-
body: body.toString()
|
|
494
|
-
});
|
|
495
|
-
const text = await resp.text();
|
|
496
|
-
if (resp.status === 401 || resp.status === 403) {
|
|
497
|
-
clearAuthCache("notebooklm");
|
|
498
|
-
throw ToolError.auth("Not authenticated \u2014 please log in to NotebookLM.");
|
|
499
|
-
}
|
|
500
|
-
return parseBatchResponse(text);
|
|
501
|
-
};
|
|
502
|
-
var FEATURE_FLAGS = [2];
|
|
503
|
-
|
|
504
9
|
// node_modules/zod/v4/classic/external.js
|
|
505
10
|
var external_exports = {};
|
|
506
11
|
__export(external_exports, {
|
|
@@ -13605,1415 +13110,1910 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
13605
13110
|
$ZodJWT.init(inst, def);
|
|
13606
13111
|
ZodStringFormat.init(inst, def);
|
|
13607
13112
|
});
|
|
13608
|
-
function jwt(params) {
|
|
13609
|
-
return _jwt(ZodJWT, params);
|
|
13113
|
+
function jwt(params) {
|
|
13114
|
+
return _jwt(ZodJWT, params);
|
|
13115
|
+
}
|
|
13116
|
+
var ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => {
|
|
13117
|
+
$ZodCustomStringFormat.init(inst, def);
|
|
13118
|
+
ZodStringFormat.init(inst, def);
|
|
13119
|
+
});
|
|
13120
|
+
function stringFormat(format, fnOrRegex, _params = {}) {
|
|
13121
|
+
return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
13122
|
+
}
|
|
13123
|
+
function hostname2(_params) {
|
|
13124
|
+
return _stringFormat(ZodCustomStringFormat, "hostname", regexes_exports.hostname, _params);
|
|
13125
|
+
}
|
|
13126
|
+
function hex2(_params) {
|
|
13127
|
+
return _stringFormat(ZodCustomStringFormat, "hex", regexes_exports.hex, _params);
|
|
13128
|
+
}
|
|
13129
|
+
function hash(alg, params) {
|
|
13130
|
+
const enc = params?.enc ?? "hex";
|
|
13131
|
+
const format = `${alg}_${enc}`;
|
|
13132
|
+
const regex = regexes_exports[format];
|
|
13133
|
+
if (!regex)
|
|
13134
|
+
throw new Error(`Unrecognized hash format: ${format}`);
|
|
13135
|
+
return _stringFormat(ZodCustomStringFormat, format, regex, params);
|
|
13136
|
+
}
|
|
13137
|
+
var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
13138
|
+
$ZodNumber.init(inst, def);
|
|
13139
|
+
ZodType.init(inst, def);
|
|
13140
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
|
|
13141
|
+
_installLazyMethods(inst, "ZodNumber", {
|
|
13142
|
+
gt(value, params) {
|
|
13143
|
+
return this.check(_gt(value, params));
|
|
13144
|
+
},
|
|
13145
|
+
gte(value, params) {
|
|
13146
|
+
return this.check(_gte(value, params));
|
|
13147
|
+
},
|
|
13148
|
+
min(value, params) {
|
|
13149
|
+
return this.check(_gte(value, params));
|
|
13150
|
+
},
|
|
13151
|
+
lt(value, params) {
|
|
13152
|
+
return this.check(_lt(value, params));
|
|
13153
|
+
},
|
|
13154
|
+
lte(value, params) {
|
|
13155
|
+
return this.check(_lte(value, params));
|
|
13156
|
+
},
|
|
13157
|
+
max(value, params) {
|
|
13158
|
+
return this.check(_lte(value, params));
|
|
13159
|
+
},
|
|
13160
|
+
int(params) {
|
|
13161
|
+
return this.check(int(params));
|
|
13162
|
+
},
|
|
13163
|
+
safe(params) {
|
|
13164
|
+
return this.check(int(params));
|
|
13165
|
+
},
|
|
13166
|
+
positive(params) {
|
|
13167
|
+
return this.check(_gt(0, params));
|
|
13168
|
+
},
|
|
13169
|
+
nonnegative(params) {
|
|
13170
|
+
return this.check(_gte(0, params));
|
|
13171
|
+
},
|
|
13172
|
+
negative(params) {
|
|
13173
|
+
return this.check(_lt(0, params));
|
|
13174
|
+
},
|
|
13175
|
+
nonpositive(params) {
|
|
13176
|
+
return this.check(_lte(0, params));
|
|
13177
|
+
},
|
|
13178
|
+
multipleOf(value, params) {
|
|
13179
|
+
return this.check(_multipleOf(value, params));
|
|
13180
|
+
},
|
|
13181
|
+
step(value, params) {
|
|
13182
|
+
return this.check(_multipleOf(value, params));
|
|
13183
|
+
},
|
|
13184
|
+
finite() {
|
|
13185
|
+
return this;
|
|
13186
|
+
}
|
|
13187
|
+
});
|
|
13188
|
+
const bag = inst._zod.bag;
|
|
13189
|
+
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
13190
|
+
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
13191
|
+
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
13192
|
+
inst.isFinite = true;
|
|
13193
|
+
inst.format = bag.format ?? null;
|
|
13194
|
+
});
|
|
13195
|
+
function number2(params) {
|
|
13196
|
+
return _number(ZodNumber, params);
|
|
13197
|
+
}
|
|
13198
|
+
var ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
|
|
13199
|
+
$ZodNumberFormat.init(inst, def);
|
|
13200
|
+
ZodNumber.init(inst, def);
|
|
13201
|
+
});
|
|
13202
|
+
function int(params) {
|
|
13203
|
+
return _int(ZodNumberFormat, params);
|
|
13204
|
+
}
|
|
13205
|
+
function float32(params) {
|
|
13206
|
+
return _float32(ZodNumberFormat, params);
|
|
13207
|
+
}
|
|
13208
|
+
function float64(params) {
|
|
13209
|
+
return _float64(ZodNumberFormat, params);
|
|
13210
|
+
}
|
|
13211
|
+
function int32(params) {
|
|
13212
|
+
return _int32(ZodNumberFormat, params);
|
|
13213
|
+
}
|
|
13214
|
+
function uint32(params) {
|
|
13215
|
+
return _uint32(ZodNumberFormat, params);
|
|
13216
|
+
}
|
|
13217
|
+
var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
13218
|
+
$ZodBoolean.init(inst, def);
|
|
13219
|
+
ZodType.init(inst, def);
|
|
13220
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => booleanProcessor(inst, ctx, json2, params);
|
|
13221
|
+
});
|
|
13222
|
+
function boolean2(params) {
|
|
13223
|
+
return _boolean(ZodBoolean, params);
|
|
13224
|
+
}
|
|
13225
|
+
var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
|
|
13226
|
+
$ZodBigInt.init(inst, def);
|
|
13227
|
+
ZodType.init(inst, def);
|
|
13228
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
|
|
13229
|
+
inst.gte = (value, params) => inst.check(_gte(value, params));
|
|
13230
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
13231
|
+
inst.gt = (value, params) => inst.check(_gt(value, params));
|
|
13232
|
+
inst.gte = (value, params) => inst.check(_gte(value, params));
|
|
13233
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
13234
|
+
inst.lt = (value, params) => inst.check(_lt(value, params));
|
|
13235
|
+
inst.lte = (value, params) => inst.check(_lte(value, params));
|
|
13236
|
+
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
13237
|
+
inst.positive = (params) => inst.check(_gt(BigInt(0), params));
|
|
13238
|
+
inst.negative = (params) => inst.check(_lt(BigInt(0), params));
|
|
13239
|
+
inst.nonpositive = (params) => inst.check(_lte(BigInt(0), params));
|
|
13240
|
+
inst.nonnegative = (params) => inst.check(_gte(BigInt(0), params));
|
|
13241
|
+
inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
|
|
13242
|
+
const bag = inst._zod.bag;
|
|
13243
|
+
inst.minValue = bag.minimum ?? null;
|
|
13244
|
+
inst.maxValue = bag.maximum ?? null;
|
|
13245
|
+
inst.format = bag.format ?? null;
|
|
13246
|
+
});
|
|
13247
|
+
function bigint2(params) {
|
|
13248
|
+
return _bigint(ZodBigInt, params);
|
|
13249
|
+
}
|
|
13250
|
+
var ZodBigIntFormat = /* @__PURE__ */ $constructor("ZodBigIntFormat", (inst, def) => {
|
|
13251
|
+
$ZodBigIntFormat.init(inst, def);
|
|
13252
|
+
ZodBigInt.init(inst, def);
|
|
13253
|
+
});
|
|
13254
|
+
function int64(params) {
|
|
13255
|
+
return _int64(ZodBigIntFormat, params);
|
|
13256
|
+
}
|
|
13257
|
+
function uint64(params) {
|
|
13258
|
+
return _uint64(ZodBigIntFormat, params);
|
|
13259
|
+
}
|
|
13260
|
+
var ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => {
|
|
13261
|
+
$ZodSymbol.init(inst, def);
|
|
13262
|
+
ZodType.init(inst, def);
|
|
13263
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => symbolProcessor(inst, ctx, json2, params);
|
|
13264
|
+
});
|
|
13265
|
+
function symbol(params) {
|
|
13266
|
+
return _symbol(ZodSymbol, params);
|
|
13267
|
+
}
|
|
13268
|
+
var ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) => {
|
|
13269
|
+
$ZodUndefined.init(inst, def);
|
|
13270
|
+
ZodType.init(inst, def);
|
|
13271
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => undefinedProcessor(inst, ctx, json2, params);
|
|
13272
|
+
});
|
|
13273
|
+
function _undefined3(params) {
|
|
13274
|
+
return _undefined2(ZodUndefined, params);
|
|
13275
|
+
}
|
|
13276
|
+
var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
|
|
13277
|
+
$ZodNull.init(inst, def);
|
|
13278
|
+
ZodType.init(inst, def);
|
|
13279
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => nullProcessor(inst, ctx, json2, params);
|
|
13280
|
+
});
|
|
13281
|
+
function _null3(params) {
|
|
13282
|
+
return _null2(ZodNull, params);
|
|
13283
|
+
}
|
|
13284
|
+
var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
|
|
13285
|
+
$ZodAny.init(inst, def);
|
|
13286
|
+
ZodType.init(inst, def);
|
|
13287
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => anyProcessor(inst, ctx, json2, params);
|
|
13288
|
+
});
|
|
13289
|
+
function any() {
|
|
13290
|
+
return _any(ZodAny);
|
|
13610
13291
|
}
|
|
13611
|
-
var
|
|
13612
|
-
$
|
|
13613
|
-
|
|
13292
|
+
var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
13293
|
+
$ZodUnknown.init(inst, def);
|
|
13294
|
+
ZodType.init(inst, def);
|
|
13295
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => unknownProcessor(inst, ctx, json2, params);
|
|
13614
13296
|
});
|
|
13615
|
-
function
|
|
13616
|
-
return
|
|
13297
|
+
function unknown() {
|
|
13298
|
+
return _unknown(ZodUnknown);
|
|
13617
13299
|
}
|
|
13618
|
-
|
|
13619
|
-
|
|
13300
|
+
var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
13301
|
+
$ZodNever.init(inst, def);
|
|
13302
|
+
ZodType.init(inst, def);
|
|
13303
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => neverProcessor(inst, ctx, json2, params);
|
|
13304
|
+
});
|
|
13305
|
+
function never(params) {
|
|
13306
|
+
return _never(ZodNever, params);
|
|
13620
13307
|
}
|
|
13621
|
-
|
|
13622
|
-
|
|
13308
|
+
var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
|
|
13309
|
+
$ZodVoid.init(inst, def);
|
|
13310
|
+
ZodType.init(inst, def);
|
|
13311
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => voidProcessor(inst, ctx, json2, params);
|
|
13312
|
+
});
|
|
13313
|
+
function _void2(params) {
|
|
13314
|
+
return _void(ZodVoid, params);
|
|
13623
13315
|
}
|
|
13624
|
-
|
|
13625
|
-
|
|
13626
|
-
|
|
13627
|
-
|
|
13628
|
-
|
|
13629
|
-
|
|
13630
|
-
|
|
13316
|
+
var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
|
|
13317
|
+
$ZodDate.init(inst, def);
|
|
13318
|
+
ZodType.init(inst, def);
|
|
13319
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
|
|
13320
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
13321
|
+
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
13322
|
+
const c = inst._zod.bag;
|
|
13323
|
+
inst.minDate = c.minimum ? new Date(c.minimum) : null;
|
|
13324
|
+
inst.maxDate = c.maximum ? new Date(c.maximum) : null;
|
|
13325
|
+
});
|
|
13326
|
+
function date3(params) {
|
|
13327
|
+
return _date(ZodDate, params);
|
|
13631
13328
|
}
|
|
13632
|
-
var
|
|
13633
|
-
$
|
|
13329
|
+
var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
13330
|
+
$ZodArray.init(inst, def);
|
|
13634
13331
|
ZodType.init(inst, def);
|
|
13635
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13636
|
-
|
|
13637
|
-
|
|
13638
|
-
|
|
13332
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => arrayProcessor(inst, ctx, json2, params);
|
|
13333
|
+
inst.element = def.element;
|
|
13334
|
+
_installLazyMethods(inst, "ZodArray", {
|
|
13335
|
+
min(n, params) {
|
|
13336
|
+
return this.check(_minLength(n, params));
|
|
13639
13337
|
},
|
|
13640
|
-
|
|
13641
|
-
return this.check(
|
|
13338
|
+
nonempty(params) {
|
|
13339
|
+
return this.check(_minLength(1, params));
|
|
13642
13340
|
},
|
|
13643
|
-
|
|
13644
|
-
return this.check(
|
|
13341
|
+
max(n, params) {
|
|
13342
|
+
return this.check(_maxLength(n, params));
|
|
13645
13343
|
},
|
|
13646
|
-
|
|
13647
|
-
return this.check(
|
|
13344
|
+
length(n, params) {
|
|
13345
|
+
return this.check(_length(n, params));
|
|
13648
13346
|
},
|
|
13649
|
-
|
|
13650
|
-
return this.
|
|
13347
|
+
unwrap() {
|
|
13348
|
+
return this.element;
|
|
13349
|
+
}
|
|
13350
|
+
});
|
|
13351
|
+
});
|
|
13352
|
+
function array(element, params) {
|
|
13353
|
+
return _array(ZodArray, element, params);
|
|
13354
|
+
}
|
|
13355
|
+
function keyof(schema) {
|
|
13356
|
+
const shape = schema._zod.def.shape;
|
|
13357
|
+
return _enum2(Object.keys(shape));
|
|
13358
|
+
}
|
|
13359
|
+
var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
13360
|
+
$ZodObjectJIT.init(inst, def);
|
|
13361
|
+
ZodType.init(inst, def);
|
|
13362
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => objectProcessor(inst, ctx, json2, params);
|
|
13363
|
+
util_exports.defineLazy(inst, "shape", () => {
|
|
13364
|
+
return def.shape;
|
|
13365
|
+
});
|
|
13366
|
+
_installLazyMethods(inst, "ZodObject", {
|
|
13367
|
+
keyof() {
|
|
13368
|
+
return _enum2(Object.keys(this._zod.def.shape));
|
|
13651
13369
|
},
|
|
13652
|
-
|
|
13653
|
-
return this.
|
|
13370
|
+
catchall(catchall) {
|
|
13371
|
+
return this.clone({ ...this._zod.def, catchall });
|
|
13654
13372
|
},
|
|
13655
|
-
|
|
13656
|
-
return this.
|
|
13373
|
+
passthrough() {
|
|
13374
|
+
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
13657
13375
|
},
|
|
13658
|
-
|
|
13659
|
-
return this.
|
|
13376
|
+
loose() {
|
|
13377
|
+
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
13660
13378
|
},
|
|
13661
|
-
|
|
13662
|
-
return this.
|
|
13379
|
+
strict() {
|
|
13380
|
+
return this.clone({ ...this._zod.def, catchall: never() });
|
|
13663
13381
|
},
|
|
13664
|
-
|
|
13665
|
-
return this.
|
|
13382
|
+
strip() {
|
|
13383
|
+
return this.clone({ ...this._zod.def, catchall: void 0 });
|
|
13666
13384
|
},
|
|
13667
|
-
|
|
13668
|
-
return
|
|
13385
|
+
extend(incoming) {
|
|
13386
|
+
return util_exports.extend(this, incoming);
|
|
13669
13387
|
},
|
|
13670
|
-
|
|
13671
|
-
return
|
|
13388
|
+
safeExtend(incoming) {
|
|
13389
|
+
return util_exports.safeExtend(this, incoming);
|
|
13672
13390
|
},
|
|
13673
|
-
|
|
13674
|
-
return
|
|
13391
|
+
merge(other) {
|
|
13392
|
+
return util_exports.merge(this, other);
|
|
13675
13393
|
},
|
|
13676
|
-
|
|
13677
|
-
return
|
|
13394
|
+
pick(mask) {
|
|
13395
|
+
return util_exports.pick(this, mask);
|
|
13678
13396
|
},
|
|
13679
|
-
|
|
13680
|
-
return this;
|
|
13397
|
+
omit(mask) {
|
|
13398
|
+
return util_exports.omit(this, mask);
|
|
13399
|
+
},
|
|
13400
|
+
partial(...args) {
|
|
13401
|
+
return util_exports.partial(ZodOptional, this, args[0]);
|
|
13402
|
+
},
|
|
13403
|
+
required(...args) {
|
|
13404
|
+
return util_exports.required(ZodNonOptional, this, args[0]);
|
|
13681
13405
|
}
|
|
13682
13406
|
});
|
|
13683
|
-
const bag = inst._zod.bag;
|
|
13684
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
13685
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
13686
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
13687
|
-
inst.isFinite = true;
|
|
13688
|
-
inst.format = bag.format ?? null;
|
|
13689
13407
|
});
|
|
13690
|
-
function
|
|
13691
|
-
|
|
13408
|
+
function object(shape, params) {
|
|
13409
|
+
const def = {
|
|
13410
|
+
type: "object",
|
|
13411
|
+
shape: shape ?? {},
|
|
13412
|
+
...util_exports.normalizeParams(params)
|
|
13413
|
+
};
|
|
13414
|
+
return new ZodObject(def);
|
|
13415
|
+
}
|
|
13416
|
+
function strictObject(shape, params) {
|
|
13417
|
+
return new ZodObject({
|
|
13418
|
+
type: "object",
|
|
13419
|
+
shape,
|
|
13420
|
+
catchall: never(),
|
|
13421
|
+
...util_exports.normalizeParams(params)
|
|
13422
|
+
});
|
|
13423
|
+
}
|
|
13424
|
+
function looseObject(shape, params) {
|
|
13425
|
+
return new ZodObject({
|
|
13426
|
+
type: "object",
|
|
13427
|
+
shape,
|
|
13428
|
+
catchall: unknown(),
|
|
13429
|
+
...util_exports.normalizeParams(params)
|
|
13430
|
+
});
|
|
13431
|
+
}
|
|
13432
|
+
var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
13433
|
+
$ZodUnion.init(inst, def);
|
|
13434
|
+
ZodType.init(inst, def);
|
|
13435
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params);
|
|
13436
|
+
inst.options = def.options;
|
|
13437
|
+
});
|
|
13438
|
+
function union(options, params) {
|
|
13439
|
+
return new ZodUnion({
|
|
13440
|
+
type: "union",
|
|
13441
|
+
options,
|
|
13442
|
+
...util_exports.normalizeParams(params)
|
|
13443
|
+
});
|
|
13444
|
+
}
|
|
13445
|
+
var ZodXor = /* @__PURE__ */ $constructor("ZodXor", (inst, def) => {
|
|
13446
|
+
ZodUnion.init(inst, def);
|
|
13447
|
+
$ZodXor.init(inst, def);
|
|
13448
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params);
|
|
13449
|
+
inst.options = def.options;
|
|
13450
|
+
});
|
|
13451
|
+
function xor(options, params) {
|
|
13452
|
+
return new ZodXor({
|
|
13453
|
+
type: "union",
|
|
13454
|
+
options,
|
|
13455
|
+
inclusive: false,
|
|
13456
|
+
...util_exports.normalizeParams(params)
|
|
13457
|
+
});
|
|
13458
|
+
}
|
|
13459
|
+
var ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
13460
|
+
ZodUnion.init(inst, def);
|
|
13461
|
+
$ZodDiscriminatedUnion.init(inst, def);
|
|
13462
|
+
});
|
|
13463
|
+
function discriminatedUnion(discriminator, options, params) {
|
|
13464
|
+
return new ZodDiscriminatedUnion({
|
|
13465
|
+
type: "union",
|
|
13466
|
+
options,
|
|
13467
|
+
discriminator,
|
|
13468
|
+
...util_exports.normalizeParams(params)
|
|
13469
|
+
});
|
|
13470
|
+
}
|
|
13471
|
+
var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
|
|
13472
|
+
$ZodIntersection.init(inst, def);
|
|
13473
|
+
ZodType.init(inst, def);
|
|
13474
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => intersectionProcessor(inst, ctx, json2, params);
|
|
13475
|
+
});
|
|
13476
|
+
function intersection(left, right) {
|
|
13477
|
+
return new ZodIntersection({
|
|
13478
|
+
type: "intersection",
|
|
13479
|
+
left,
|
|
13480
|
+
right
|
|
13481
|
+
});
|
|
13482
|
+
}
|
|
13483
|
+
var ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
|
|
13484
|
+
$ZodTuple.init(inst, def);
|
|
13485
|
+
ZodType.init(inst, def);
|
|
13486
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => tupleProcessor(inst, ctx, json2, params);
|
|
13487
|
+
inst.rest = (rest) => inst.clone({
|
|
13488
|
+
...inst._zod.def,
|
|
13489
|
+
rest
|
|
13490
|
+
});
|
|
13491
|
+
});
|
|
13492
|
+
function tuple(items, _paramsOrRest, _params) {
|
|
13493
|
+
const hasRest = _paramsOrRest instanceof $ZodType;
|
|
13494
|
+
const params = hasRest ? _params : _paramsOrRest;
|
|
13495
|
+
const rest = hasRest ? _paramsOrRest : null;
|
|
13496
|
+
return new ZodTuple({
|
|
13497
|
+
type: "tuple",
|
|
13498
|
+
items,
|
|
13499
|
+
rest,
|
|
13500
|
+
...util_exports.normalizeParams(params)
|
|
13501
|
+
});
|
|
13502
|
+
}
|
|
13503
|
+
var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
13504
|
+
$ZodRecord.init(inst, def);
|
|
13505
|
+
ZodType.init(inst, def);
|
|
13506
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => recordProcessor(inst, ctx, json2, params);
|
|
13507
|
+
inst.keyType = def.keyType;
|
|
13508
|
+
inst.valueType = def.valueType;
|
|
13509
|
+
});
|
|
13510
|
+
function record(keyType, valueType, params) {
|
|
13511
|
+
if (!valueType || !valueType._zod) {
|
|
13512
|
+
return new ZodRecord({
|
|
13513
|
+
type: "record",
|
|
13514
|
+
keyType: string2(),
|
|
13515
|
+
valueType: keyType,
|
|
13516
|
+
...util_exports.normalizeParams(valueType)
|
|
13517
|
+
});
|
|
13518
|
+
}
|
|
13519
|
+
return new ZodRecord({
|
|
13520
|
+
type: "record",
|
|
13521
|
+
keyType,
|
|
13522
|
+
valueType,
|
|
13523
|
+
...util_exports.normalizeParams(params)
|
|
13524
|
+
});
|
|
13692
13525
|
}
|
|
13693
|
-
|
|
13694
|
-
|
|
13695
|
-
|
|
13696
|
-
|
|
13697
|
-
|
|
13698
|
-
|
|
13526
|
+
function partialRecord(keyType, valueType, params) {
|
|
13527
|
+
const k = clone(keyType);
|
|
13528
|
+
k._zod.values = void 0;
|
|
13529
|
+
return new ZodRecord({
|
|
13530
|
+
type: "record",
|
|
13531
|
+
keyType: k,
|
|
13532
|
+
valueType,
|
|
13533
|
+
...util_exports.normalizeParams(params)
|
|
13534
|
+
});
|
|
13699
13535
|
}
|
|
13700
|
-
function
|
|
13701
|
-
return
|
|
13536
|
+
function looseRecord(keyType, valueType, params) {
|
|
13537
|
+
return new ZodRecord({
|
|
13538
|
+
type: "record",
|
|
13539
|
+
keyType,
|
|
13540
|
+
valueType,
|
|
13541
|
+
mode: "loose",
|
|
13542
|
+
...util_exports.normalizeParams(params)
|
|
13543
|
+
});
|
|
13702
13544
|
}
|
|
13703
|
-
|
|
13704
|
-
|
|
13545
|
+
var ZodMap = /* @__PURE__ */ $constructor("ZodMap", (inst, def) => {
|
|
13546
|
+
$ZodMap.init(inst, def);
|
|
13547
|
+
ZodType.init(inst, def);
|
|
13548
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => mapProcessor(inst, ctx, json2, params);
|
|
13549
|
+
inst.keyType = def.keyType;
|
|
13550
|
+
inst.valueType = def.valueType;
|
|
13551
|
+
inst.min = (...args) => inst.check(_minSize(...args));
|
|
13552
|
+
inst.nonempty = (params) => inst.check(_minSize(1, params));
|
|
13553
|
+
inst.max = (...args) => inst.check(_maxSize(...args));
|
|
13554
|
+
inst.size = (...args) => inst.check(_size(...args));
|
|
13555
|
+
});
|
|
13556
|
+
function map(keyType, valueType, params) {
|
|
13557
|
+
return new ZodMap({
|
|
13558
|
+
type: "map",
|
|
13559
|
+
keyType,
|
|
13560
|
+
valueType,
|
|
13561
|
+
...util_exports.normalizeParams(params)
|
|
13562
|
+
});
|
|
13705
13563
|
}
|
|
13706
|
-
|
|
13707
|
-
|
|
13564
|
+
var ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => {
|
|
13565
|
+
$ZodSet.init(inst, def);
|
|
13566
|
+
ZodType.init(inst, def);
|
|
13567
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => setProcessor(inst, ctx, json2, params);
|
|
13568
|
+
inst.min = (...args) => inst.check(_minSize(...args));
|
|
13569
|
+
inst.nonempty = (params) => inst.check(_minSize(1, params));
|
|
13570
|
+
inst.max = (...args) => inst.check(_maxSize(...args));
|
|
13571
|
+
inst.size = (...args) => inst.check(_size(...args));
|
|
13572
|
+
});
|
|
13573
|
+
function set(valueType, params) {
|
|
13574
|
+
return new ZodSet({
|
|
13575
|
+
type: "set",
|
|
13576
|
+
valueType,
|
|
13577
|
+
...util_exports.normalizeParams(params)
|
|
13578
|
+
});
|
|
13708
13579
|
}
|
|
13709
|
-
|
|
13710
|
-
|
|
13580
|
+
var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
13581
|
+
$ZodEnum.init(inst, def);
|
|
13582
|
+
ZodType.init(inst, def);
|
|
13583
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params);
|
|
13584
|
+
inst.enum = def.entries;
|
|
13585
|
+
inst.options = Object.values(def.entries);
|
|
13586
|
+
const keys = new Set(Object.keys(def.entries));
|
|
13587
|
+
inst.extract = (values, params) => {
|
|
13588
|
+
const newEntries = {};
|
|
13589
|
+
for (const value of values) {
|
|
13590
|
+
if (keys.has(value)) {
|
|
13591
|
+
newEntries[value] = def.entries[value];
|
|
13592
|
+
} else
|
|
13593
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
13594
|
+
}
|
|
13595
|
+
return new ZodEnum({
|
|
13596
|
+
...def,
|
|
13597
|
+
checks: [],
|
|
13598
|
+
...util_exports.normalizeParams(params),
|
|
13599
|
+
entries: newEntries
|
|
13600
|
+
});
|
|
13601
|
+
};
|
|
13602
|
+
inst.exclude = (values, params) => {
|
|
13603
|
+
const newEntries = { ...def.entries };
|
|
13604
|
+
for (const value of values) {
|
|
13605
|
+
if (keys.has(value)) {
|
|
13606
|
+
delete newEntries[value];
|
|
13607
|
+
} else
|
|
13608
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
13609
|
+
}
|
|
13610
|
+
return new ZodEnum({
|
|
13611
|
+
...def,
|
|
13612
|
+
checks: [],
|
|
13613
|
+
...util_exports.normalizeParams(params),
|
|
13614
|
+
entries: newEntries
|
|
13615
|
+
});
|
|
13616
|
+
};
|
|
13617
|
+
});
|
|
13618
|
+
function _enum2(values, params) {
|
|
13619
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
13620
|
+
return new ZodEnum({
|
|
13621
|
+
type: "enum",
|
|
13622
|
+
entries,
|
|
13623
|
+
...util_exports.normalizeParams(params)
|
|
13624
|
+
});
|
|
13711
13625
|
}
|
|
13712
|
-
|
|
13713
|
-
|
|
13626
|
+
function nativeEnum(entries, params) {
|
|
13627
|
+
return new ZodEnum({
|
|
13628
|
+
type: "enum",
|
|
13629
|
+
entries,
|
|
13630
|
+
...util_exports.normalizeParams(params)
|
|
13631
|
+
});
|
|
13632
|
+
}
|
|
13633
|
+
var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
|
|
13634
|
+
$ZodLiteral.init(inst, def);
|
|
13714
13635
|
ZodType.init(inst, def);
|
|
13715
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13636
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => literalProcessor(inst, ctx, json2, params);
|
|
13637
|
+
inst.values = new Set(def.values);
|
|
13638
|
+
Object.defineProperty(inst, "value", {
|
|
13639
|
+
get() {
|
|
13640
|
+
if (def.values.length > 1) {
|
|
13641
|
+
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
13642
|
+
}
|
|
13643
|
+
return def.values[0];
|
|
13644
|
+
}
|
|
13645
|
+
});
|
|
13716
13646
|
});
|
|
13717
|
-
function
|
|
13718
|
-
return
|
|
13647
|
+
function literal(value, params) {
|
|
13648
|
+
return new ZodLiteral({
|
|
13649
|
+
type: "literal",
|
|
13650
|
+
values: Array.isArray(value) ? value : [value],
|
|
13651
|
+
...util_exports.normalizeParams(params)
|
|
13652
|
+
});
|
|
13719
13653
|
}
|
|
13720
|
-
var
|
|
13721
|
-
$
|
|
13654
|
+
var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
|
|
13655
|
+
$ZodFile.init(inst, def);
|
|
13722
13656
|
ZodType.init(inst, def);
|
|
13723
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13724
|
-
inst.
|
|
13725
|
-
inst.
|
|
13726
|
-
inst.
|
|
13727
|
-
inst.gte = (value, params) => inst.check(_gte(value, params));
|
|
13728
|
-
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
13729
|
-
inst.lt = (value, params) => inst.check(_lt(value, params));
|
|
13730
|
-
inst.lte = (value, params) => inst.check(_lte(value, params));
|
|
13731
|
-
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
13732
|
-
inst.positive = (params) => inst.check(_gt(BigInt(0), params));
|
|
13733
|
-
inst.negative = (params) => inst.check(_lt(BigInt(0), params));
|
|
13734
|
-
inst.nonpositive = (params) => inst.check(_lte(BigInt(0), params));
|
|
13735
|
-
inst.nonnegative = (params) => inst.check(_gte(BigInt(0), params));
|
|
13736
|
-
inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
|
|
13737
|
-
const bag = inst._zod.bag;
|
|
13738
|
-
inst.minValue = bag.minimum ?? null;
|
|
13739
|
-
inst.maxValue = bag.maximum ?? null;
|
|
13740
|
-
inst.format = bag.format ?? null;
|
|
13657
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => fileProcessor(inst, ctx, json2, params);
|
|
13658
|
+
inst.min = (size, params) => inst.check(_minSize(size, params));
|
|
13659
|
+
inst.max = (size, params) => inst.check(_maxSize(size, params));
|
|
13660
|
+
inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params));
|
|
13741
13661
|
});
|
|
13742
|
-
function
|
|
13743
|
-
return
|
|
13662
|
+
function file(params) {
|
|
13663
|
+
return _file(ZodFile, params);
|
|
13744
13664
|
}
|
|
13745
|
-
var
|
|
13746
|
-
$
|
|
13747
|
-
|
|
13665
|
+
var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
13666
|
+
$ZodTransform.init(inst, def);
|
|
13667
|
+
ZodType.init(inst, def);
|
|
13668
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => transformProcessor(inst, ctx, json2, params);
|
|
13669
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
13670
|
+
if (_ctx.direction === "backward") {
|
|
13671
|
+
throw new $ZodEncodeError(inst.constructor.name);
|
|
13672
|
+
}
|
|
13673
|
+
payload.addIssue = (issue2) => {
|
|
13674
|
+
if (typeof issue2 === "string") {
|
|
13675
|
+
payload.issues.push(util_exports.issue(issue2, payload.value, def));
|
|
13676
|
+
} else {
|
|
13677
|
+
const _issue = issue2;
|
|
13678
|
+
if (_issue.fatal)
|
|
13679
|
+
_issue.continue = false;
|
|
13680
|
+
_issue.code ?? (_issue.code = "custom");
|
|
13681
|
+
_issue.input ?? (_issue.input = payload.value);
|
|
13682
|
+
_issue.inst ?? (_issue.inst = inst);
|
|
13683
|
+
payload.issues.push(util_exports.issue(_issue));
|
|
13684
|
+
}
|
|
13685
|
+
};
|
|
13686
|
+
const output = def.transform(payload.value, payload);
|
|
13687
|
+
if (output instanceof Promise) {
|
|
13688
|
+
return output.then((output2) => {
|
|
13689
|
+
payload.value = output2;
|
|
13690
|
+
payload.fallback = true;
|
|
13691
|
+
return payload;
|
|
13692
|
+
});
|
|
13693
|
+
}
|
|
13694
|
+
payload.value = output;
|
|
13695
|
+
payload.fallback = true;
|
|
13696
|
+
return payload;
|
|
13697
|
+
};
|
|
13748
13698
|
});
|
|
13749
|
-
function
|
|
13750
|
-
return
|
|
13699
|
+
function transform(fn) {
|
|
13700
|
+
return new ZodTransform({
|
|
13701
|
+
type: "transform",
|
|
13702
|
+
transform: fn
|
|
13703
|
+
});
|
|
13751
13704
|
}
|
|
13752
|
-
|
|
13753
|
-
|
|
13705
|
+
var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
13706
|
+
$ZodOptional.init(inst, def);
|
|
13707
|
+
ZodType.init(inst, def);
|
|
13708
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params);
|
|
13709
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
13710
|
+
});
|
|
13711
|
+
function optional(innerType) {
|
|
13712
|
+
return new ZodOptional({
|
|
13713
|
+
type: "optional",
|
|
13714
|
+
innerType
|
|
13715
|
+
});
|
|
13754
13716
|
}
|
|
13755
|
-
var
|
|
13756
|
-
$
|
|
13717
|
+
var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
13718
|
+
$ZodExactOptional.init(inst, def);
|
|
13757
13719
|
ZodType.init(inst, def);
|
|
13758
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13720
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params);
|
|
13721
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
13759
13722
|
});
|
|
13760
|
-
function
|
|
13761
|
-
return
|
|
13723
|
+
function exactOptional(innerType) {
|
|
13724
|
+
return new ZodExactOptional({
|
|
13725
|
+
type: "optional",
|
|
13726
|
+
innerType
|
|
13727
|
+
});
|
|
13762
13728
|
}
|
|
13763
|
-
var
|
|
13764
|
-
$
|
|
13729
|
+
var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
13730
|
+
$ZodNullable.init(inst, def);
|
|
13765
13731
|
ZodType.init(inst, def);
|
|
13766
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13732
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => nullableProcessor(inst, ctx, json2, params);
|
|
13733
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
13767
13734
|
});
|
|
13768
|
-
function
|
|
13769
|
-
return
|
|
13735
|
+
function nullable(innerType) {
|
|
13736
|
+
return new ZodNullable({
|
|
13737
|
+
type: "nullable",
|
|
13738
|
+
innerType
|
|
13739
|
+
});
|
|
13770
13740
|
}
|
|
13771
|
-
|
|
13772
|
-
|
|
13773
|
-
ZodType.init(inst, def);
|
|
13774
|
-
inst._zod.processJSONSchema = (ctx, json2, params) => nullProcessor(inst, ctx, json2, params);
|
|
13775
|
-
});
|
|
13776
|
-
function _null3(params) {
|
|
13777
|
-
return _null2(ZodNull, params);
|
|
13741
|
+
function nullish2(innerType) {
|
|
13742
|
+
return optional(nullable(innerType));
|
|
13778
13743
|
}
|
|
13779
|
-
var
|
|
13780
|
-
$
|
|
13744
|
+
var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
|
|
13745
|
+
$ZodDefault.init(inst, def);
|
|
13781
13746
|
ZodType.init(inst, def);
|
|
13782
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13747
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => defaultProcessor(inst, ctx, json2, params);
|
|
13748
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
13749
|
+
inst.removeDefault = inst.unwrap;
|
|
13783
13750
|
});
|
|
13784
|
-
function
|
|
13785
|
-
return
|
|
13751
|
+
function _default2(innerType, defaultValue) {
|
|
13752
|
+
return new ZodDefault({
|
|
13753
|
+
type: "default",
|
|
13754
|
+
innerType,
|
|
13755
|
+
get defaultValue() {
|
|
13756
|
+
return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue);
|
|
13757
|
+
}
|
|
13758
|
+
});
|
|
13786
13759
|
}
|
|
13787
|
-
var
|
|
13788
|
-
$
|
|
13760
|
+
var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
13761
|
+
$ZodPrefault.init(inst, def);
|
|
13789
13762
|
ZodType.init(inst, def);
|
|
13790
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13763
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => prefaultProcessor(inst, ctx, json2, params);
|
|
13764
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
13791
13765
|
});
|
|
13792
|
-
function
|
|
13793
|
-
return
|
|
13766
|
+
function prefault(innerType, defaultValue) {
|
|
13767
|
+
return new ZodPrefault({
|
|
13768
|
+
type: "prefault",
|
|
13769
|
+
innerType,
|
|
13770
|
+
get defaultValue() {
|
|
13771
|
+
return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue);
|
|
13772
|
+
}
|
|
13773
|
+
});
|
|
13794
13774
|
}
|
|
13795
|
-
var
|
|
13796
|
-
$
|
|
13775
|
+
var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
13776
|
+
$ZodNonOptional.init(inst, def);
|
|
13797
13777
|
ZodType.init(inst, def);
|
|
13798
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13778
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => nonoptionalProcessor(inst, ctx, json2, params);
|
|
13779
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
13799
13780
|
});
|
|
13800
|
-
function
|
|
13801
|
-
return
|
|
13781
|
+
function nonoptional(innerType, params) {
|
|
13782
|
+
return new ZodNonOptional({
|
|
13783
|
+
type: "nonoptional",
|
|
13784
|
+
innerType,
|
|
13785
|
+
...util_exports.normalizeParams(params)
|
|
13786
|
+
});
|
|
13802
13787
|
}
|
|
13803
|
-
var
|
|
13804
|
-
$
|
|
13788
|
+
var ZodSuccess = /* @__PURE__ */ $constructor("ZodSuccess", (inst, def) => {
|
|
13789
|
+
$ZodSuccess.init(inst, def);
|
|
13805
13790
|
ZodType.init(inst, def);
|
|
13806
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13791
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => successProcessor(inst, ctx, json2, params);
|
|
13792
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
13807
13793
|
});
|
|
13808
|
-
function
|
|
13809
|
-
return
|
|
13794
|
+
function success(innerType) {
|
|
13795
|
+
return new ZodSuccess({
|
|
13796
|
+
type: "success",
|
|
13797
|
+
innerType
|
|
13798
|
+
});
|
|
13810
13799
|
}
|
|
13811
|
-
var
|
|
13812
|
-
$
|
|
13800
|
+
var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
|
|
13801
|
+
$ZodCatch.init(inst, def);
|
|
13813
13802
|
ZodType.init(inst, def);
|
|
13814
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13815
|
-
inst.
|
|
13816
|
-
inst.
|
|
13817
|
-
const c = inst._zod.bag;
|
|
13818
|
-
inst.minDate = c.minimum ? new Date(c.minimum) : null;
|
|
13819
|
-
inst.maxDate = c.maximum ? new Date(c.maximum) : null;
|
|
13803
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => catchProcessor(inst, ctx, json2, params);
|
|
13804
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
13805
|
+
inst.removeCatch = inst.unwrap;
|
|
13820
13806
|
});
|
|
13821
|
-
function
|
|
13822
|
-
return
|
|
13807
|
+
function _catch2(innerType, catchValue) {
|
|
13808
|
+
return new ZodCatch({
|
|
13809
|
+
type: "catch",
|
|
13810
|
+
innerType,
|
|
13811
|
+
catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
|
|
13812
|
+
});
|
|
13823
13813
|
}
|
|
13824
|
-
var
|
|
13825
|
-
$
|
|
13814
|
+
var ZodNaN = /* @__PURE__ */ $constructor("ZodNaN", (inst, def) => {
|
|
13815
|
+
$ZodNaN.init(inst, def);
|
|
13826
13816
|
ZodType.init(inst, def);
|
|
13827
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13828
|
-
inst.element = def.element;
|
|
13829
|
-
_installLazyMethods(inst, "ZodArray", {
|
|
13830
|
-
min(n, params) {
|
|
13831
|
-
return this.check(_minLength(n, params));
|
|
13832
|
-
},
|
|
13833
|
-
nonempty(params) {
|
|
13834
|
-
return this.check(_minLength(1, params));
|
|
13835
|
-
},
|
|
13836
|
-
max(n, params) {
|
|
13837
|
-
return this.check(_maxLength(n, params));
|
|
13838
|
-
},
|
|
13839
|
-
length(n, params) {
|
|
13840
|
-
return this.check(_length(n, params));
|
|
13841
|
-
},
|
|
13842
|
-
unwrap() {
|
|
13843
|
-
return this.element;
|
|
13844
|
-
}
|
|
13845
|
-
});
|
|
13817
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => nanProcessor(inst, ctx, json2, params);
|
|
13846
13818
|
});
|
|
13847
|
-
function
|
|
13848
|
-
return
|
|
13849
|
-
}
|
|
13850
|
-
function keyof(schema) {
|
|
13851
|
-
const shape = schema._zod.def.shape;
|
|
13852
|
-
return _enum2(Object.keys(shape));
|
|
13819
|
+
function nan(params) {
|
|
13820
|
+
return _nan(ZodNaN, params);
|
|
13853
13821
|
}
|
|
13854
|
-
var
|
|
13855
|
-
$
|
|
13822
|
+
var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
|
|
13823
|
+
$ZodPipe.init(inst, def);
|
|
13856
13824
|
ZodType.init(inst, def);
|
|
13857
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13858
|
-
|
|
13859
|
-
|
|
13860
|
-
});
|
|
13861
|
-
_installLazyMethods(inst, "ZodObject", {
|
|
13862
|
-
keyof() {
|
|
13863
|
-
return _enum2(Object.keys(this._zod.def.shape));
|
|
13864
|
-
},
|
|
13865
|
-
catchall(catchall) {
|
|
13866
|
-
return this.clone({ ...this._zod.def, catchall });
|
|
13867
|
-
},
|
|
13868
|
-
passthrough() {
|
|
13869
|
-
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
13870
|
-
},
|
|
13871
|
-
loose() {
|
|
13872
|
-
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
13873
|
-
},
|
|
13874
|
-
strict() {
|
|
13875
|
-
return this.clone({ ...this._zod.def, catchall: never() });
|
|
13876
|
-
},
|
|
13877
|
-
strip() {
|
|
13878
|
-
return this.clone({ ...this._zod.def, catchall: void 0 });
|
|
13879
|
-
},
|
|
13880
|
-
extend(incoming) {
|
|
13881
|
-
return util_exports.extend(this, incoming);
|
|
13882
|
-
},
|
|
13883
|
-
safeExtend(incoming) {
|
|
13884
|
-
return util_exports.safeExtend(this, incoming);
|
|
13885
|
-
},
|
|
13886
|
-
merge(other) {
|
|
13887
|
-
return util_exports.merge(this, other);
|
|
13888
|
-
},
|
|
13889
|
-
pick(mask) {
|
|
13890
|
-
return util_exports.pick(this, mask);
|
|
13891
|
-
},
|
|
13892
|
-
omit(mask) {
|
|
13893
|
-
return util_exports.omit(this, mask);
|
|
13894
|
-
},
|
|
13895
|
-
partial(...args) {
|
|
13896
|
-
return util_exports.partial(ZodOptional, this, args[0]);
|
|
13897
|
-
},
|
|
13898
|
-
required(...args) {
|
|
13899
|
-
return util_exports.required(ZodNonOptional, this, args[0]);
|
|
13900
|
-
}
|
|
13901
|
-
});
|
|
13825
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => pipeProcessor(inst, ctx, json2, params);
|
|
13826
|
+
inst.in = def.in;
|
|
13827
|
+
inst.out = def.out;
|
|
13902
13828
|
});
|
|
13903
|
-
function
|
|
13904
|
-
|
|
13905
|
-
type: "
|
|
13906
|
-
|
|
13907
|
-
|
|
13908
|
-
|
|
13909
|
-
|
|
13829
|
+
function pipe(in_, out) {
|
|
13830
|
+
return new ZodPipe({
|
|
13831
|
+
type: "pipe",
|
|
13832
|
+
in: in_,
|
|
13833
|
+
out
|
|
13834
|
+
// ...util.normalizeParams(params),
|
|
13835
|
+
});
|
|
13910
13836
|
}
|
|
13911
|
-
|
|
13912
|
-
|
|
13913
|
-
|
|
13914
|
-
|
|
13915
|
-
|
|
13916
|
-
|
|
13837
|
+
var ZodCodec = /* @__PURE__ */ $constructor("ZodCodec", (inst, def) => {
|
|
13838
|
+
ZodPipe.init(inst, def);
|
|
13839
|
+
$ZodCodec.init(inst, def);
|
|
13840
|
+
});
|
|
13841
|
+
function codec(in_, out, params) {
|
|
13842
|
+
return new ZodCodec({
|
|
13843
|
+
type: "pipe",
|
|
13844
|
+
in: in_,
|
|
13845
|
+
out,
|
|
13846
|
+
transform: params.decode,
|
|
13847
|
+
reverseTransform: params.encode
|
|
13917
13848
|
});
|
|
13918
13849
|
}
|
|
13919
|
-
function
|
|
13920
|
-
|
|
13921
|
-
|
|
13922
|
-
|
|
13923
|
-
|
|
13924
|
-
|
|
13850
|
+
function invertCodec(codec2) {
|
|
13851
|
+
const def = codec2._zod.def;
|
|
13852
|
+
return new ZodCodec({
|
|
13853
|
+
type: "pipe",
|
|
13854
|
+
in: def.out,
|
|
13855
|
+
out: def.in,
|
|
13856
|
+
transform: def.reverseTransform,
|
|
13857
|
+
reverseTransform: def.transform
|
|
13925
13858
|
});
|
|
13926
13859
|
}
|
|
13927
|
-
var
|
|
13928
|
-
|
|
13860
|
+
var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => {
|
|
13861
|
+
ZodPipe.init(inst, def);
|
|
13862
|
+
$ZodPreprocess.init(inst, def);
|
|
13863
|
+
});
|
|
13864
|
+
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
13865
|
+
$ZodReadonly.init(inst, def);
|
|
13929
13866
|
ZodType.init(inst, def);
|
|
13930
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13931
|
-
inst.
|
|
13867
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => readonlyProcessor(inst, ctx, json2, params);
|
|
13868
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
13932
13869
|
});
|
|
13933
|
-
function
|
|
13934
|
-
return new
|
|
13935
|
-
type: "
|
|
13936
|
-
|
|
13937
|
-
...util_exports.normalizeParams(params)
|
|
13870
|
+
function readonly(innerType) {
|
|
13871
|
+
return new ZodReadonly({
|
|
13872
|
+
type: "readonly",
|
|
13873
|
+
innerType
|
|
13938
13874
|
});
|
|
13939
13875
|
}
|
|
13940
|
-
var
|
|
13941
|
-
|
|
13942
|
-
|
|
13943
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13944
|
-
inst.options = def.options;
|
|
13876
|
+
var ZodTemplateLiteral = /* @__PURE__ */ $constructor("ZodTemplateLiteral", (inst, def) => {
|
|
13877
|
+
$ZodTemplateLiteral.init(inst, def);
|
|
13878
|
+
ZodType.init(inst, def);
|
|
13879
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => templateLiteralProcessor(inst, ctx, json2, params);
|
|
13945
13880
|
});
|
|
13946
|
-
function
|
|
13947
|
-
return new
|
|
13948
|
-
type: "
|
|
13949
|
-
|
|
13950
|
-
inclusive: false,
|
|
13881
|
+
function templateLiteral(parts, params) {
|
|
13882
|
+
return new ZodTemplateLiteral({
|
|
13883
|
+
type: "template_literal",
|
|
13884
|
+
parts,
|
|
13951
13885
|
...util_exports.normalizeParams(params)
|
|
13952
13886
|
});
|
|
13953
13887
|
}
|
|
13954
|
-
var
|
|
13955
|
-
|
|
13956
|
-
|
|
13888
|
+
var ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
|
|
13889
|
+
$ZodLazy.init(inst, def);
|
|
13890
|
+
ZodType.init(inst, def);
|
|
13891
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => lazyProcessor(inst, ctx, json2, params);
|
|
13892
|
+
inst.unwrap = () => inst._zod.def.getter();
|
|
13957
13893
|
});
|
|
13958
|
-
function
|
|
13959
|
-
return new
|
|
13960
|
-
type: "
|
|
13961
|
-
|
|
13962
|
-
discriminator,
|
|
13963
|
-
...util_exports.normalizeParams(params)
|
|
13894
|
+
function lazy(getter) {
|
|
13895
|
+
return new ZodLazy({
|
|
13896
|
+
type: "lazy",
|
|
13897
|
+
getter
|
|
13964
13898
|
});
|
|
13965
13899
|
}
|
|
13966
|
-
var
|
|
13967
|
-
$
|
|
13900
|
+
var ZodPromise = /* @__PURE__ */ $constructor("ZodPromise", (inst, def) => {
|
|
13901
|
+
$ZodPromise.init(inst, def);
|
|
13968
13902
|
ZodType.init(inst, def);
|
|
13969
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13903
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => promiseProcessor(inst, ctx, json2, params);
|
|
13904
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
13970
13905
|
});
|
|
13971
|
-
function
|
|
13972
|
-
return new
|
|
13973
|
-
type: "
|
|
13974
|
-
|
|
13975
|
-
right
|
|
13906
|
+
function promise(innerType) {
|
|
13907
|
+
return new ZodPromise({
|
|
13908
|
+
type: "promise",
|
|
13909
|
+
innerType
|
|
13976
13910
|
});
|
|
13977
13911
|
}
|
|
13978
|
-
var
|
|
13979
|
-
$
|
|
13912
|
+
var ZodFunction = /* @__PURE__ */ $constructor("ZodFunction", (inst, def) => {
|
|
13913
|
+
$ZodFunction.init(inst, def);
|
|
13980
13914
|
ZodType.init(inst, def);
|
|
13981
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
13982
|
-
inst.rest = (rest) => inst.clone({
|
|
13983
|
-
...inst._zod.def,
|
|
13984
|
-
rest
|
|
13985
|
-
});
|
|
13915
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => functionProcessor(inst, ctx, json2, params);
|
|
13986
13916
|
});
|
|
13987
|
-
function
|
|
13988
|
-
|
|
13989
|
-
|
|
13990
|
-
|
|
13991
|
-
|
|
13992
|
-
type: "tuple",
|
|
13993
|
-
items,
|
|
13994
|
-
rest,
|
|
13995
|
-
...util_exports.normalizeParams(params)
|
|
13917
|
+
function _function(params) {
|
|
13918
|
+
return new ZodFunction({
|
|
13919
|
+
type: "function",
|
|
13920
|
+
input: Array.isArray(params?.input) ? tuple(params?.input) : params?.input ?? array(unknown()),
|
|
13921
|
+
output: params?.output ?? unknown()
|
|
13996
13922
|
});
|
|
13997
13923
|
}
|
|
13998
|
-
var
|
|
13999
|
-
$
|
|
13924
|
+
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
13925
|
+
$ZodCustom.init(inst, def);
|
|
14000
13926
|
ZodType.init(inst, def);
|
|
14001
|
-
inst._zod.processJSONSchema = (ctx, json2, params) =>
|
|
14002
|
-
inst.keyType = def.keyType;
|
|
14003
|
-
inst.valueType = def.valueType;
|
|
13927
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => customProcessor(inst, ctx, json2, params);
|
|
14004
13928
|
});
|
|
14005
|
-
function
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
keyType: string2(),
|
|
14010
|
-
valueType: keyType,
|
|
14011
|
-
...util_exports.normalizeParams(valueType)
|
|
14012
|
-
});
|
|
14013
|
-
}
|
|
14014
|
-
return new ZodRecord({
|
|
14015
|
-
type: "record",
|
|
14016
|
-
keyType,
|
|
14017
|
-
valueType,
|
|
14018
|
-
...util_exports.normalizeParams(params)
|
|
13929
|
+
function check(fn) {
|
|
13930
|
+
const ch = new $ZodCheck({
|
|
13931
|
+
check: "custom"
|
|
13932
|
+
// ...util.normalizeParams(params),
|
|
14019
13933
|
});
|
|
13934
|
+
ch._zod.check = fn;
|
|
13935
|
+
return ch;
|
|
14020
13936
|
}
|
|
14021
|
-
function
|
|
14022
|
-
|
|
14023
|
-
|
|
14024
|
-
|
|
14025
|
-
|
|
14026
|
-
|
|
14027
|
-
|
|
13937
|
+
function custom(fn, _params) {
|
|
13938
|
+
return _custom(ZodCustom, fn ?? (() => true), _params);
|
|
13939
|
+
}
|
|
13940
|
+
function refine(fn, _params = {}) {
|
|
13941
|
+
return _refine(ZodCustom, fn, _params);
|
|
13942
|
+
}
|
|
13943
|
+
function superRefine(fn, params) {
|
|
13944
|
+
return _superRefine(fn, params);
|
|
13945
|
+
}
|
|
13946
|
+
var describe2 = describe;
|
|
13947
|
+
var meta2 = meta;
|
|
13948
|
+
function _instanceof(cls, params = {}) {
|
|
13949
|
+
const inst = new ZodCustom({
|
|
13950
|
+
type: "custom",
|
|
13951
|
+
check: "custom",
|
|
13952
|
+
fn: (data) => data instanceof cls,
|
|
13953
|
+
abort: true,
|
|
14028
13954
|
...util_exports.normalizeParams(params)
|
|
14029
13955
|
});
|
|
13956
|
+
inst._zod.bag.Class = cls;
|
|
13957
|
+
inst._zod.check = (payload) => {
|
|
13958
|
+
if (!(payload.value instanceof cls)) {
|
|
13959
|
+
payload.issues.push({
|
|
13960
|
+
code: "invalid_type",
|
|
13961
|
+
expected: cls.name,
|
|
13962
|
+
input: payload.value,
|
|
13963
|
+
inst,
|
|
13964
|
+
path: [...inst._zod.def.path ?? []]
|
|
13965
|
+
});
|
|
13966
|
+
}
|
|
13967
|
+
};
|
|
13968
|
+
return inst;
|
|
14030
13969
|
}
|
|
14031
|
-
|
|
14032
|
-
|
|
14033
|
-
|
|
14034
|
-
|
|
14035
|
-
|
|
14036
|
-
|
|
14037
|
-
|
|
13970
|
+
var stringbool = (...args) => _stringbool({
|
|
13971
|
+
Codec: ZodCodec,
|
|
13972
|
+
Boolean: ZodBoolean,
|
|
13973
|
+
String: ZodString
|
|
13974
|
+
}, ...args);
|
|
13975
|
+
function json(params) {
|
|
13976
|
+
const jsonSchema = lazy(() => {
|
|
13977
|
+
return union([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]);
|
|
14038
13978
|
});
|
|
13979
|
+
return jsonSchema;
|
|
14039
13980
|
}
|
|
14040
|
-
|
|
14041
|
-
|
|
14042
|
-
|
|
14043
|
-
|
|
14044
|
-
|
|
14045
|
-
|
|
14046
|
-
|
|
14047
|
-
|
|
14048
|
-
|
|
14049
|
-
|
|
14050
|
-
|
|
14051
|
-
|
|
14052
|
-
|
|
14053
|
-
|
|
14054
|
-
|
|
14055
|
-
|
|
14056
|
-
|
|
13981
|
+
function preprocess(fn, schema) {
|
|
13982
|
+
return new ZodPreprocess({
|
|
13983
|
+
type: "pipe",
|
|
13984
|
+
in: transform(fn),
|
|
13985
|
+
out: schema
|
|
13986
|
+
});
|
|
13987
|
+
}
|
|
13988
|
+
|
|
13989
|
+
// node_modules/zod/v4/classic/compat.js
|
|
13990
|
+
var ZodIssueCode = {
|
|
13991
|
+
invalid_type: "invalid_type",
|
|
13992
|
+
too_big: "too_big",
|
|
13993
|
+
too_small: "too_small",
|
|
13994
|
+
invalid_format: "invalid_format",
|
|
13995
|
+
not_multiple_of: "not_multiple_of",
|
|
13996
|
+
unrecognized_keys: "unrecognized_keys",
|
|
13997
|
+
invalid_union: "invalid_union",
|
|
13998
|
+
invalid_key: "invalid_key",
|
|
13999
|
+
invalid_element: "invalid_element",
|
|
14000
|
+
invalid_value: "invalid_value",
|
|
14001
|
+
custom: "custom"
|
|
14002
|
+
};
|
|
14003
|
+
function setErrorMap(map2) {
|
|
14004
|
+
config({
|
|
14005
|
+
customError: map2
|
|
14057
14006
|
});
|
|
14058
14007
|
}
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
|
|
14066
|
-
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
|
-
|
|
14070
|
-
|
|
14071
|
-
|
|
14072
|
-
|
|
14073
|
-
|
|
14008
|
+
function getErrorMap() {
|
|
14009
|
+
return config().customError;
|
|
14010
|
+
}
|
|
14011
|
+
var ZodFirstPartyTypeKind;
|
|
14012
|
+
/* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
|
|
14013
|
+
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
14014
|
+
|
|
14015
|
+
// node_modules/zod/v4/classic/from-json-schema.js
|
|
14016
|
+
var z = {
|
|
14017
|
+
...schemas_exports2,
|
|
14018
|
+
...checks_exports2,
|
|
14019
|
+
iso: iso_exports
|
|
14020
|
+
};
|
|
14021
|
+
var RECOGNIZED_KEYS = /* @__PURE__ */ new Set([
|
|
14022
|
+
// Schema identification
|
|
14023
|
+
"$schema",
|
|
14024
|
+
"$ref",
|
|
14025
|
+
"$defs",
|
|
14026
|
+
"definitions",
|
|
14027
|
+
// Core schema keywords
|
|
14028
|
+
"$id",
|
|
14029
|
+
"id",
|
|
14030
|
+
"$comment",
|
|
14031
|
+
"$anchor",
|
|
14032
|
+
"$vocabulary",
|
|
14033
|
+
"$dynamicRef",
|
|
14034
|
+
"$dynamicAnchor",
|
|
14035
|
+
// Type
|
|
14036
|
+
"type",
|
|
14037
|
+
"enum",
|
|
14038
|
+
"const",
|
|
14039
|
+
// Composition
|
|
14040
|
+
"anyOf",
|
|
14041
|
+
"oneOf",
|
|
14042
|
+
"allOf",
|
|
14043
|
+
"not",
|
|
14044
|
+
// Object
|
|
14045
|
+
"properties",
|
|
14046
|
+
"required",
|
|
14047
|
+
"additionalProperties",
|
|
14048
|
+
"patternProperties",
|
|
14049
|
+
"propertyNames",
|
|
14050
|
+
"minProperties",
|
|
14051
|
+
"maxProperties",
|
|
14052
|
+
// Array
|
|
14053
|
+
"items",
|
|
14054
|
+
"prefixItems",
|
|
14055
|
+
"additionalItems",
|
|
14056
|
+
"minItems",
|
|
14057
|
+
"maxItems",
|
|
14058
|
+
"uniqueItems",
|
|
14059
|
+
"contains",
|
|
14060
|
+
"minContains",
|
|
14061
|
+
"maxContains",
|
|
14062
|
+
// String
|
|
14063
|
+
"minLength",
|
|
14064
|
+
"maxLength",
|
|
14065
|
+
"pattern",
|
|
14066
|
+
"format",
|
|
14067
|
+
// Number
|
|
14068
|
+
"minimum",
|
|
14069
|
+
"maximum",
|
|
14070
|
+
"exclusiveMinimum",
|
|
14071
|
+
"exclusiveMaximum",
|
|
14072
|
+
"multipleOf",
|
|
14073
|
+
// Already handled metadata
|
|
14074
|
+
"description",
|
|
14075
|
+
"default",
|
|
14076
|
+
// Content
|
|
14077
|
+
"contentEncoding",
|
|
14078
|
+
"contentMediaType",
|
|
14079
|
+
"contentSchema",
|
|
14080
|
+
// Unsupported (error-throwing)
|
|
14081
|
+
"unevaluatedItems",
|
|
14082
|
+
"unevaluatedProperties",
|
|
14083
|
+
"if",
|
|
14084
|
+
"then",
|
|
14085
|
+
"else",
|
|
14086
|
+
"dependentSchemas",
|
|
14087
|
+
"dependentRequired",
|
|
14088
|
+
// OpenAPI
|
|
14089
|
+
"nullable",
|
|
14090
|
+
"readOnly"
|
|
14091
|
+
]);
|
|
14092
|
+
function detectVersion(schema, defaultTarget) {
|
|
14093
|
+
const $schema = schema.$schema;
|
|
14094
|
+
if ($schema === "https://json-schema.org/draft/2020-12/schema") {
|
|
14095
|
+
return "draft-2020-12";
|
|
14096
|
+
}
|
|
14097
|
+
if ($schema === "http://json-schema.org/draft-07/schema#") {
|
|
14098
|
+
return "draft-7";
|
|
14099
|
+
}
|
|
14100
|
+
if ($schema === "http://json-schema.org/draft-04/schema#") {
|
|
14101
|
+
return "draft-4";
|
|
14102
|
+
}
|
|
14103
|
+
return defaultTarget ?? "draft-2020-12";
|
|
14104
|
+
}
|
|
14105
|
+
function resolveRef(ref, ctx) {
|
|
14106
|
+
if (!ref.startsWith("#")) {
|
|
14107
|
+
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
14108
|
+
}
|
|
14109
|
+
const path = ref.slice(1).split("/").filter(Boolean);
|
|
14110
|
+
if (path.length === 0) {
|
|
14111
|
+
return ctx.rootSchema;
|
|
14112
|
+
}
|
|
14113
|
+
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
14114
|
+
if (path[0] === defsKey) {
|
|
14115
|
+
const key = path[1];
|
|
14116
|
+
if (!key || !ctx.defs[key]) {
|
|
14117
|
+
throw new Error(`Reference not found: ${ref}`);
|
|
14118
|
+
}
|
|
14119
|
+
return ctx.defs[key];
|
|
14120
|
+
}
|
|
14121
|
+
throw new Error(`Reference not found: ${ref}`);
|
|
14074
14122
|
}
|
|
14075
|
-
|
|
14076
|
-
|
|
14077
|
-
|
|
14078
|
-
|
|
14079
|
-
inst.enum = def.entries;
|
|
14080
|
-
inst.options = Object.values(def.entries);
|
|
14081
|
-
const keys = new Set(Object.keys(def.entries));
|
|
14082
|
-
inst.extract = (values, params) => {
|
|
14083
|
-
const newEntries = {};
|
|
14084
|
-
for (const value of values) {
|
|
14085
|
-
if (keys.has(value)) {
|
|
14086
|
-
newEntries[value] = def.entries[value];
|
|
14087
|
-
} else
|
|
14088
|
-
throw new Error(`Key ${value} not found in enum`);
|
|
14123
|
+
function convertBaseSchema(schema, ctx) {
|
|
14124
|
+
if (schema.not !== void 0) {
|
|
14125
|
+
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
14126
|
+
return z.never();
|
|
14089
14127
|
}
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
|
|
14095
|
-
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
|
|
14099
|
-
|
|
14100
|
-
|
|
14101
|
-
|
|
14102
|
-
|
|
14103
|
-
|
|
14128
|
+
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
14129
|
+
}
|
|
14130
|
+
if (schema.unevaluatedItems !== void 0) {
|
|
14131
|
+
throw new Error("unevaluatedItems is not supported");
|
|
14132
|
+
}
|
|
14133
|
+
if (schema.unevaluatedProperties !== void 0) {
|
|
14134
|
+
throw new Error("unevaluatedProperties is not supported");
|
|
14135
|
+
}
|
|
14136
|
+
if (schema.if !== void 0 || schema.then !== void 0 || schema.else !== void 0) {
|
|
14137
|
+
throw new Error("Conditional schemas (if/then/else) are not supported");
|
|
14138
|
+
}
|
|
14139
|
+
if (schema.dependentSchemas !== void 0 || schema.dependentRequired !== void 0) {
|
|
14140
|
+
throw new Error("dependentSchemas and dependentRequired are not supported");
|
|
14141
|
+
}
|
|
14142
|
+
if (schema.$ref) {
|
|
14143
|
+
const refPath = schema.$ref;
|
|
14144
|
+
if (ctx.refs.has(refPath)) {
|
|
14145
|
+
return ctx.refs.get(refPath);
|
|
14104
14146
|
}
|
|
14105
|
-
|
|
14106
|
-
|
|
14107
|
-
|
|
14108
|
-
|
|
14109
|
-
|
|
14147
|
+
if (ctx.processing.has(refPath)) {
|
|
14148
|
+
return z.lazy(() => {
|
|
14149
|
+
if (!ctx.refs.has(refPath)) {
|
|
14150
|
+
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
14151
|
+
}
|
|
14152
|
+
return ctx.refs.get(refPath);
|
|
14153
|
+
});
|
|
14154
|
+
}
|
|
14155
|
+
ctx.processing.add(refPath);
|
|
14156
|
+
const resolved = resolveRef(refPath, ctx);
|
|
14157
|
+
const zodSchema2 = convertSchema(resolved, ctx);
|
|
14158
|
+
ctx.refs.set(refPath, zodSchema2);
|
|
14159
|
+
ctx.processing.delete(refPath);
|
|
14160
|
+
return zodSchema2;
|
|
14161
|
+
}
|
|
14162
|
+
if (schema.enum !== void 0) {
|
|
14163
|
+
const enumValues = schema.enum;
|
|
14164
|
+
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
14165
|
+
return z.null();
|
|
14166
|
+
}
|
|
14167
|
+
if (enumValues.length === 0) {
|
|
14168
|
+
return z.never();
|
|
14169
|
+
}
|
|
14170
|
+
if (enumValues.length === 1) {
|
|
14171
|
+
return z.literal(enumValues[0]);
|
|
14172
|
+
}
|
|
14173
|
+
if (enumValues.every((v) => typeof v === "string")) {
|
|
14174
|
+
return z.enum(enumValues);
|
|
14175
|
+
}
|
|
14176
|
+
const literalSchemas = enumValues.map((v) => z.literal(v));
|
|
14177
|
+
if (literalSchemas.length < 2) {
|
|
14178
|
+
return literalSchemas[0];
|
|
14179
|
+
}
|
|
14180
|
+
return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
14181
|
+
}
|
|
14182
|
+
if (schema.const !== void 0) {
|
|
14183
|
+
return z.literal(schema.const);
|
|
14184
|
+
}
|
|
14185
|
+
const type = schema.type;
|
|
14186
|
+
if (Array.isArray(type)) {
|
|
14187
|
+
const typeSchemas = type.map((t) => {
|
|
14188
|
+
const typeSchema = { ...schema, type: t };
|
|
14189
|
+
return convertBaseSchema(typeSchema, ctx);
|
|
14110
14190
|
});
|
|
14111
|
-
|
|
14112
|
-
|
|
14113
|
-
|
|
14114
|
-
|
|
14115
|
-
|
|
14116
|
-
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
|
|
14120
|
-
|
|
14121
|
-
|
|
14122
|
-
|
|
14123
|
-
|
|
14124
|
-
|
|
14125
|
-
|
|
14126
|
-
|
|
14127
|
-
|
|
14128
|
-
|
|
14129
|
-
|
|
14130
|
-
|
|
14131
|
-
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
|
|
14136
|
-
|
|
14191
|
+
if (typeSchemas.length === 0) {
|
|
14192
|
+
return z.never();
|
|
14193
|
+
}
|
|
14194
|
+
if (typeSchemas.length === 1) {
|
|
14195
|
+
return typeSchemas[0];
|
|
14196
|
+
}
|
|
14197
|
+
return z.union(typeSchemas);
|
|
14198
|
+
}
|
|
14199
|
+
if (!type) {
|
|
14200
|
+
return z.any();
|
|
14201
|
+
}
|
|
14202
|
+
let zodSchema;
|
|
14203
|
+
switch (type) {
|
|
14204
|
+
case "string": {
|
|
14205
|
+
let stringSchema = z.string();
|
|
14206
|
+
if (schema.format) {
|
|
14207
|
+
const format = schema.format;
|
|
14208
|
+
if (format === "email") {
|
|
14209
|
+
stringSchema = stringSchema.check(z.email());
|
|
14210
|
+
} else if (format === "uri" || format === "uri-reference") {
|
|
14211
|
+
stringSchema = stringSchema.check(z.url());
|
|
14212
|
+
} else if (format === "uuid" || format === "guid") {
|
|
14213
|
+
stringSchema = stringSchema.check(z.uuid());
|
|
14214
|
+
} else if (format === "date-time") {
|
|
14215
|
+
stringSchema = stringSchema.check(z.iso.datetime());
|
|
14216
|
+
} else if (format === "date") {
|
|
14217
|
+
stringSchema = stringSchema.check(z.iso.date());
|
|
14218
|
+
} else if (format === "time") {
|
|
14219
|
+
stringSchema = stringSchema.check(z.iso.time());
|
|
14220
|
+
} else if (format === "duration") {
|
|
14221
|
+
stringSchema = stringSchema.check(z.iso.duration());
|
|
14222
|
+
} else if (format === "ipv4") {
|
|
14223
|
+
stringSchema = stringSchema.check(z.ipv4());
|
|
14224
|
+
} else if (format === "ipv6") {
|
|
14225
|
+
stringSchema = stringSchema.check(z.ipv6());
|
|
14226
|
+
} else if (format === "mac") {
|
|
14227
|
+
stringSchema = stringSchema.check(z.mac());
|
|
14228
|
+
} else if (format === "cidr") {
|
|
14229
|
+
stringSchema = stringSchema.check(z.cidrv4());
|
|
14230
|
+
} else if (format === "cidr-v6") {
|
|
14231
|
+
stringSchema = stringSchema.check(z.cidrv6());
|
|
14232
|
+
} else if (format === "base64") {
|
|
14233
|
+
stringSchema = stringSchema.check(z.base64());
|
|
14234
|
+
} else if (format === "base64url") {
|
|
14235
|
+
stringSchema = stringSchema.check(z.base64url());
|
|
14236
|
+
} else if (format === "e164") {
|
|
14237
|
+
stringSchema = stringSchema.check(z.e164());
|
|
14238
|
+
} else if (format === "jwt") {
|
|
14239
|
+
stringSchema = stringSchema.check(z.jwt());
|
|
14240
|
+
} else if (format === "emoji") {
|
|
14241
|
+
stringSchema = stringSchema.check(z.emoji());
|
|
14242
|
+
} else if (format === "nanoid") {
|
|
14243
|
+
stringSchema = stringSchema.check(z.nanoid());
|
|
14244
|
+
} else if (format === "cuid") {
|
|
14245
|
+
stringSchema = stringSchema.check(z.cuid());
|
|
14246
|
+
} else if (format === "cuid2") {
|
|
14247
|
+
stringSchema = stringSchema.check(z.cuid2());
|
|
14248
|
+
} else if (format === "ulid") {
|
|
14249
|
+
stringSchema = stringSchema.check(z.ulid());
|
|
14250
|
+
} else if (format === "xid") {
|
|
14251
|
+
stringSchema = stringSchema.check(z.xid());
|
|
14252
|
+
} else if (format === "ksuid") {
|
|
14253
|
+
stringSchema = stringSchema.check(z.ksuid());
|
|
14254
|
+
}
|
|
14137
14255
|
}
|
|
14138
|
-
|
|
14256
|
+
if (typeof schema.minLength === "number") {
|
|
14257
|
+
stringSchema = stringSchema.min(schema.minLength);
|
|
14258
|
+
}
|
|
14259
|
+
if (typeof schema.maxLength === "number") {
|
|
14260
|
+
stringSchema = stringSchema.max(schema.maxLength);
|
|
14261
|
+
}
|
|
14262
|
+
if (schema.pattern) {
|
|
14263
|
+
stringSchema = stringSchema.regex(new RegExp(schema.pattern));
|
|
14264
|
+
}
|
|
14265
|
+
zodSchema = stringSchema;
|
|
14266
|
+
break;
|
|
14139
14267
|
}
|
|
14140
|
-
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
14144
|
-
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
14165
|
-
if (_ctx.direction === "backward") {
|
|
14166
|
-
throw new $ZodEncodeError(inst.constructor.name);
|
|
14268
|
+
case "number":
|
|
14269
|
+
case "integer": {
|
|
14270
|
+
let numberSchema = type === "integer" ? z.number().int() : z.number();
|
|
14271
|
+
if (typeof schema.minimum === "number") {
|
|
14272
|
+
numberSchema = numberSchema.min(schema.minimum);
|
|
14273
|
+
}
|
|
14274
|
+
if (typeof schema.maximum === "number") {
|
|
14275
|
+
numberSchema = numberSchema.max(schema.maximum);
|
|
14276
|
+
}
|
|
14277
|
+
if (typeof schema.exclusiveMinimum === "number") {
|
|
14278
|
+
numberSchema = numberSchema.gt(schema.exclusiveMinimum);
|
|
14279
|
+
} else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") {
|
|
14280
|
+
numberSchema = numberSchema.gt(schema.minimum);
|
|
14281
|
+
}
|
|
14282
|
+
if (typeof schema.exclusiveMaximum === "number") {
|
|
14283
|
+
numberSchema = numberSchema.lt(schema.exclusiveMaximum);
|
|
14284
|
+
} else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") {
|
|
14285
|
+
numberSchema = numberSchema.lt(schema.maximum);
|
|
14286
|
+
}
|
|
14287
|
+
if (typeof schema.multipleOf === "number") {
|
|
14288
|
+
numberSchema = numberSchema.multipleOf(schema.multipleOf);
|
|
14289
|
+
}
|
|
14290
|
+
zodSchema = numberSchema;
|
|
14291
|
+
break;
|
|
14167
14292
|
}
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
14293
|
+
case "boolean": {
|
|
14294
|
+
zodSchema = z.boolean();
|
|
14295
|
+
break;
|
|
14296
|
+
}
|
|
14297
|
+
case "null": {
|
|
14298
|
+
zodSchema = z.null();
|
|
14299
|
+
break;
|
|
14300
|
+
}
|
|
14301
|
+
case "object": {
|
|
14302
|
+
const shape = {};
|
|
14303
|
+
const properties = schema.properties || {};
|
|
14304
|
+
const requiredSet = new Set(schema.required || []);
|
|
14305
|
+
for (const [key, propSchema] of Object.entries(properties)) {
|
|
14306
|
+
const propZodSchema = convertSchema(propSchema, ctx);
|
|
14307
|
+
shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional();
|
|
14308
|
+
}
|
|
14309
|
+
if (schema.propertyNames) {
|
|
14310
|
+
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
14311
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z.any();
|
|
14312
|
+
if (Object.keys(shape).length === 0) {
|
|
14313
|
+
zodSchema = z.record(keySchema, valueSchema);
|
|
14314
|
+
break;
|
|
14315
|
+
}
|
|
14316
|
+
const objectSchema2 = z.object(shape).passthrough();
|
|
14317
|
+
const recordSchema = z.looseRecord(keySchema, valueSchema);
|
|
14318
|
+
zodSchema = z.intersection(objectSchema2, recordSchema);
|
|
14319
|
+
break;
|
|
14320
|
+
}
|
|
14321
|
+
if (schema.patternProperties) {
|
|
14322
|
+
const patternProps = schema.patternProperties;
|
|
14323
|
+
const patternKeys = Object.keys(patternProps);
|
|
14324
|
+
const looseRecords = [];
|
|
14325
|
+
for (const pattern of patternKeys) {
|
|
14326
|
+
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
14327
|
+
const keySchema = z.string().regex(new RegExp(pattern));
|
|
14328
|
+
looseRecords.push(z.looseRecord(keySchema, patternValue));
|
|
14329
|
+
}
|
|
14330
|
+
const schemasToIntersect = [];
|
|
14331
|
+
if (Object.keys(shape).length > 0) {
|
|
14332
|
+
schemasToIntersect.push(z.object(shape).passthrough());
|
|
14333
|
+
}
|
|
14334
|
+
schemasToIntersect.push(...looseRecords);
|
|
14335
|
+
if (schemasToIntersect.length === 0) {
|
|
14336
|
+
zodSchema = z.object({}).passthrough();
|
|
14337
|
+
} else if (schemasToIntersect.length === 1) {
|
|
14338
|
+
zodSchema = schemasToIntersect[0];
|
|
14339
|
+
} else {
|
|
14340
|
+
let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
14341
|
+
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
14342
|
+
result = z.intersection(result, schemasToIntersect[i]);
|
|
14343
|
+
}
|
|
14344
|
+
zodSchema = result;
|
|
14345
|
+
}
|
|
14346
|
+
break;
|
|
14347
|
+
}
|
|
14348
|
+
const objectSchema = z.object(shape);
|
|
14349
|
+
if (schema.additionalProperties === false) {
|
|
14350
|
+
zodSchema = objectSchema.strict();
|
|
14351
|
+
} else if (typeof schema.additionalProperties === "object") {
|
|
14352
|
+
zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));
|
|
14171
14353
|
} else {
|
|
14172
|
-
|
|
14173
|
-
if (_issue.fatal)
|
|
14174
|
-
_issue.continue = false;
|
|
14175
|
-
_issue.code ?? (_issue.code = "custom");
|
|
14176
|
-
_issue.input ?? (_issue.input = payload.value);
|
|
14177
|
-
_issue.inst ?? (_issue.inst = inst);
|
|
14178
|
-
payload.issues.push(util_exports.issue(_issue));
|
|
14354
|
+
zodSchema = objectSchema.passthrough();
|
|
14179
14355
|
}
|
|
14180
|
-
|
|
14181
|
-
const output = def.transform(payload.value, payload);
|
|
14182
|
-
if (output instanceof Promise) {
|
|
14183
|
-
return output.then((output2) => {
|
|
14184
|
-
payload.value = output2;
|
|
14185
|
-
payload.fallback = true;
|
|
14186
|
-
return payload;
|
|
14187
|
-
});
|
|
14356
|
+
break;
|
|
14188
14357
|
}
|
|
14189
|
-
|
|
14190
|
-
|
|
14191
|
-
|
|
14192
|
-
|
|
14193
|
-
|
|
14194
|
-
|
|
14195
|
-
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
|
|
14199
|
-
|
|
14200
|
-
|
|
14201
|
-
|
|
14202
|
-
|
|
14203
|
-
|
|
14204
|
-
|
|
14205
|
-
|
|
14206
|
-
|
|
14207
|
-
|
|
14208
|
-
|
|
14209
|
-
|
|
14210
|
-
|
|
14211
|
-
|
|
14212
|
-
|
|
14213
|
-
|
|
14214
|
-
|
|
14215
|
-
|
|
14216
|
-
|
|
14217
|
-
|
|
14218
|
-
|
|
14219
|
-
|
|
14220
|
-
|
|
14221
|
-
|
|
14222
|
-
|
|
14223
|
-
|
|
14224
|
-
|
|
14225
|
-
|
|
14226
|
-
|
|
14227
|
-
|
|
14228
|
-
|
|
14229
|
-
|
|
14230
|
-
|
|
14231
|
-
|
|
14232
|
-
|
|
14233
|
-
|
|
14234
|
-
});
|
|
14235
|
-
}
|
|
14236
|
-
function nullish2(innerType) {
|
|
14237
|
-
return optional(nullable(innerType));
|
|
14238
|
-
}
|
|
14239
|
-
var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
|
|
14240
|
-
$ZodDefault.init(inst, def);
|
|
14241
|
-
ZodType.init(inst, def);
|
|
14242
|
-
inst._zod.processJSONSchema = (ctx, json2, params) => defaultProcessor(inst, ctx, json2, params);
|
|
14243
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
14244
|
-
inst.removeDefault = inst.unwrap;
|
|
14245
|
-
});
|
|
14246
|
-
function _default2(innerType, defaultValue) {
|
|
14247
|
-
return new ZodDefault({
|
|
14248
|
-
type: "default",
|
|
14249
|
-
innerType,
|
|
14250
|
-
get defaultValue() {
|
|
14251
|
-
return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue);
|
|
14358
|
+
case "array": {
|
|
14359
|
+
const prefixItems = schema.prefixItems;
|
|
14360
|
+
const items = schema.items;
|
|
14361
|
+
if (prefixItems && Array.isArray(prefixItems)) {
|
|
14362
|
+
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
14363
|
+
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
14364
|
+
if (rest) {
|
|
14365
|
+
zodSchema = z.tuple(tupleItems).rest(rest);
|
|
14366
|
+
} else {
|
|
14367
|
+
zodSchema = z.tuple(tupleItems);
|
|
14368
|
+
}
|
|
14369
|
+
if (typeof schema.minItems === "number") {
|
|
14370
|
+
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
14371
|
+
}
|
|
14372
|
+
if (typeof schema.maxItems === "number") {
|
|
14373
|
+
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
14374
|
+
}
|
|
14375
|
+
} else if (Array.isArray(items)) {
|
|
14376
|
+
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
14377
|
+
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
14378
|
+
if (rest) {
|
|
14379
|
+
zodSchema = z.tuple(tupleItems).rest(rest);
|
|
14380
|
+
} else {
|
|
14381
|
+
zodSchema = z.tuple(tupleItems);
|
|
14382
|
+
}
|
|
14383
|
+
if (typeof schema.minItems === "number") {
|
|
14384
|
+
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
14385
|
+
}
|
|
14386
|
+
if (typeof schema.maxItems === "number") {
|
|
14387
|
+
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
14388
|
+
}
|
|
14389
|
+
} else if (items !== void 0) {
|
|
14390
|
+
const element = convertSchema(items, ctx);
|
|
14391
|
+
let arraySchema = z.array(element);
|
|
14392
|
+
if (typeof schema.minItems === "number") {
|
|
14393
|
+
arraySchema = arraySchema.min(schema.minItems);
|
|
14394
|
+
}
|
|
14395
|
+
if (typeof schema.maxItems === "number") {
|
|
14396
|
+
arraySchema = arraySchema.max(schema.maxItems);
|
|
14397
|
+
}
|
|
14398
|
+
zodSchema = arraySchema;
|
|
14399
|
+
} else {
|
|
14400
|
+
zodSchema = z.array(z.any());
|
|
14401
|
+
}
|
|
14402
|
+
break;
|
|
14252
14403
|
}
|
|
14253
|
-
|
|
14404
|
+
default:
|
|
14405
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
14406
|
+
}
|
|
14407
|
+
return zodSchema;
|
|
14254
14408
|
}
|
|
14255
|
-
|
|
14256
|
-
|
|
14257
|
-
|
|
14258
|
-
|
|
14259
|
-
|
|
14260
|
-
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
|
|
14265
|
-
|
|
14266
|
-
|
|
14409
|
+
function convertSchema(schema, ctx) {
|
|
14410
|
+
if (typeof schema === "boolean") {
|
|
14411
|
+
return schema ? z.any() : z.never();
|
|
14412
|
+
}
|
|
14413
|
+
let baseSchema = convertBaseSchema(schema, ctx);
|
|
14414
|
+
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
14415
|
+
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
14416
|
+
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
14417
|
+
const anyOfUnion = z.union(options);
|
|
14418
|
+
baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
14419
|
+
}
|
|
14420
|
+
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
14421
|
+
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
14422
|
+
const oneOfUnion = z.xor(options);
|
|
14423
|
+
baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
14424
|
+
}
|
|
14425
|
+
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
14426
|
+
if (schema.allOf.length === 0) {
|
|
14427
|
+
baseSchema = hasExplicitType ? baseSchema : z.any();
|
|
14428
|
+
} else {
|
|
14429
|
+
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
14430
|
+
const startIdx = hasExplicitType ? 0 : 1;
|
|
14431
|
+
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
14432
|
+
result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
14433
|
+
}
|
|
14434
|
+
baseSchema = result;
|
|
14267
14435
|
}
|
|
14268
|
-
}
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14272
|
-
|
|
14273
|
-
|
|
14274
|
-
|
|
14275
|
-
|
|
14276
|
-
|
|
14277
|
-
|
|
14278
|
-
|
|
14279
|
-
|
|
14280
|
-
|
|
14281
|
-
|
|
14282
|
-
|
|
14283
|
-
|
|
14284
|
-
|
|
14285
|
-
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
|
|
14289
|
-
|
|
14290
|
-
|
|
14291
|
-
|
|
14292
|
-
|
|
14293
|
-
|
|
14294
|
-
}
|
|
14295
|
-
var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
|
|
14296
|
-
$ZodCatch.init(inst, def);
|
|
14297
|
-
ZodType.init(inst, def);
|
|
14298
|
-
inst._zod.processJSONSchema = (ctx, json2, params) => catchProcessor(inst, ctx, json2, params);
|
|
14299
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
14300
|
-
inst.removeCatch = inst.unwrap;
|
|
14301
|
-
});
|
|
14302
|
-
function _catch2(innerType, catchValue) {
|
|
14303
|
-
return new ZodCatch({
|
|
14304
|
-
type: "catch",
|
|
14305
|
-
innerType,
|
|
14306
|
-
catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
|
|
14307
|
-
});
|
|
14308
|
-
}
|
|
14309
|
-
var ZodNaN = /* @__PURE__ */ $constructor("ZodNaN", (inst, def) => {
|
|
14310
|
-
$ZodNaN.init(inst, def);
|
|
14311
|
-
ZodType.init(inst, def);
|
|
14312
|
-
inst._zod.processJSONSchema = (ctx, json2, params) => nanProcessor(inst, ctx, json2, params);
|
|
14313
|
-
});
|
|
14314
|
-
function nan(params) {
|
|
14315
|
-
return _nan(ZodNaN, params);
|
|
14316
|
-
}
|
|
14317
|
-
var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
|
|
14318
|
-
$ZodPipe.init(inst, def);
|
|
14319
|
-
ZodType.init(inst, def);
|
|
14320
|
-
inst._zod.processJSONSchema = (ctx, json2, params) => pipeProcessor(inst, ctx, json2, params);
|
|
14321
|
-
inst.in = def.in;
|
|
14322
|
-
inst.out = def.out;
|
|
14323
|
-
});
|
|
14324
|
-
function pipe(in_, out) {
|
|
14325
|
-
return new ZodPipe({
|
|
14326
|
-
type: "pipe",
|
|
14327
|
-
in: in_,
|
|
14328
|
-
out
|
|
14329
|
-
// ...util.normalizeParams(params),
|
|
14330
|
-
});
|
|
14331
|
-
}
|
|
14332
|
-
var ZodCodec = /* @__PURE__ */ $constructor("ZodCodec", (inst, def) => {
|
|
14333
|
-
ZodPipe.init(inst, def);
|
|
14334
|
-
$ZodCodec.init(inst, def);
|
|
14335
|
-
});
|
|
14336
|
-
function codec(in_, out, params) {
|
|
14337
|
-
return new ZodCodec({
|
|
14338
|
-
type: "pipe",
|
|
14339
|
-
in: in_,
|
|
14340
|
-
out,
|
|
14341
|
-
transform: params.decode,
|
|
14342
|
-
reverseTransform: params.encode
|
|
14343
|
-
});
|
|
14344
|
-
}
|
|
14345
|
-
function invertCodec(codec2) {
|
|
14346
|
-
const def = codec2._zod.def;
|
|
14347
|
-
return new ZodCodec({
|
|
14348
|
-
type: "pipe",
|
|
14349
|
-
in: def.out,
|
|
14350
|
-
out: def.in,
|
|
14351
|
-
transform: def.reverseTransform,
|
|
14352
|
-
reverseTransform: def.transform
|
|
14353
|
-
});
|
|
14354
|
-
}
|
|
14355
|
-
var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => {
|
|
14356
|
-
ZodPipe.init(inst, def);
|
|
14357
|
-
$ZodPreprocess.init(inst, def);
|
|
14358
|
-
});
|
|
14359
|
-
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
14360
|
-
$ZodReadonly.init(inst, def);
|
|
14361
|
-
ZodType.init(inst, def);
|
|
14362
|
-
inst._zod.processJSONSchema = (ctx, json2, params) => readonlyProcessor(inst, ctx, json2, params);
|
|
14363
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
14364
|
-
});
|
|
14365
|
-
function readonly(innerType) {
|
|
14366
|
-
return new ZodReadonly({
|
|
14367
|
-
type: "readonly",
|
|
14368
|
-
innerType
|
|
14369
|
-
});
|
|
14370
|
-
}
|
|
14371
|
-
var ZodTemplateLiteral = /* @__PURE__ */ $constructor("ZodTemplateLiteral", (inst, def) => {
|
|
14372
|
-
$ZodTemplateLiteral.init(inst, def);
|
|
14373
|
-
ZodType.init(inst, def);
|
|
14374
|
-
inst._zod.processJSONSchema = (ctx, json2, params) => templateLiteralProcessor(inst, ctx, json2, params);
|
|
14375
|
-
});
|
|
14376
|
-
function templateLiteral(parts, params) {
|
|
14377
|
-
return new ZodTemplateLiteral({
|
|
14378
|
-
type: "template_literal",
|
|
14379
|
-
parts,
|
|
14380
|
-
...util_exports.normalizeParams(params)
|
|
14381
|
-
});
|
|
14382
|
-
}
|
|
14383
|
-
var ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
|
|
14384
|
-
$ZodLazy.init(inst, def);
|
|
14385
|
-
ZodType.init(inst, def);
|
|
14386
|
-
inst._zod.processJSONSchema = (ctx, json2, params) => lazyProcessor(inst, ctx, json2, params);
|
|
14387
|
-
inst.unwrap = () => inst._zod.def.getter();
|
|
14388
|
-
});
|
|
14389
|
-
function lazy(getter) {
|
|
14390
|
-
return new ZodLazy({
|
|
14391
|
-
type: "lazy",
|
|
14392
|
-
getter
|
|
14393
|
-
});
|
|
14394
|
-
}
|
|
14395
|
-
var ZodPromise = /* @__PURE__ */ $constructor("ZodPromise", (inst, def) => {
|
|
14396
|
-
$ZodPromise.init(inst, def);
|
|
14397
|
-
ZodType.init(inst, def);
|
|
14398
|
-
inst._zod.processJSONSchema = (ctx, json2, params) => promiseProcessor(inst, ctx, json2, params);
|
|
14399
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
14400
|
-
});
|
|
14401
|
-
function promise(innerType) {
|
|
14402
|
-
return new ZodPromise({
|
|
14403
|
-
type: "promise",
|
|
14404
|
-
innerType
|
|
14405
|
-
});
|
|
14406
|
-
}
|
|
14407
|
-
var ZodFunction = /* @__PURE__ */ $constructor("ZodFunction", (inst, def) => {
|
|
14408
|
-
$ZodFunction.init(inst, def);
|
|
14409
|
-
ZodType.init(inst, def);
|
|
14410
|
-
inst._zod.processJSONSchema = (ctx, json2, params) => functionProcessor(inst, ctx, json2, params);
|
|
14411
|
-
});
|
|
14412
|
-
function _function(params) {
|
|
14413
|
-
return new ZodFunction({
|
|
14414
|
-
type: "function",
|
|
14415
|
-
input: Array.isArray(params?.input) ? tuple(params?.input) : params?.input ?? array(unknown()),
|
|
14416
|
-
output: params?.output ?? unknown()
|
|
14417
|
-
});
|
|
14418
|
-
}
|
|
14419
|
-
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
14420
|
-
$ZodCustom.init(inst, def);
|
|
14421
|
-
ZodType.init(inst, def);
|
|
14422
|
-
inst._zod.processJSONSchema = (ctx, json2, params) => customProcessor(inst, ctx, json2, params);
|
|
14423
|
-
});
|
|
14424
|
-
function check(fn) {
|
|
14425
|
-
const ch = new $ZodCheck({
|
|
14426
|
-
check: "custom"
|
|
14427
|
-
// ...util.normalizeParams(params),
|
|
14428
|
-
});
|
|
14429
|
-
ch._zod.check = fn;
|
|
14430
|
-
return ch;
|
|
14431
|
-
}
|
|
14432
|
-
function custom(fn, _params) {
|
|
14433
|
-
return _custom(ZodCustom, fn ?? (() => true), _params);
|
|
14434
|
-
}
|
|
14435
|
-
function refine(fn, _params = {}) {
|
|
14436
|
-
return _refine(ZodCustom, fn, _params);
|
|
14437
|
-
}
|
|
14438
|
-
function superRefine(fn, params) {
|
|
14439
|
-
return _superRefine(fn, params);
|
|
14440
|
-
}
|
|
14441
|
-
var describe2 = describe;
|
|
14442
|
-
var meta2 = meta;
|
|
14443
|
-
function _instanceof(cls, params = {}) {
|
|
14444
|
-
const inst = new ZodCustom({
|
|
14445
|
-
type: "custom",
|
|
14446
|
-
check: "custom",
|
|
14447
|
-
fn: (data) => data instanceof cls,
|
|
14448
|
-
abort: true,
|
|
14449
|
-
...util_exports.normalizeParams(params)
|
|
14450
|
-
});
|
|
14451
|
-
inst._zod.bag.Class = cls;
|
|
14452
|
-
inst._zod.check = (payload) => {
|
|
14453
|
-
if (!(payload.value instanceof cls)) {
|
|
14454
|
-
payload.issues.push({
|
|
14455
|
-
code: "invalid_type",
|
|
14456
|
-
expected: cls.name,
|
|
14457
|
-
input: payload.value,
|
|
14458
|
-
inst,
|
|
14459
|
-
path: [...inst._zod.def.path ?? []]
|
|
14460
|
-
});
|
|
14436
|
+
}
|
|
14437
|
+
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
14438
|
+
baseSchema = z.nullable(baseSchema);
|
|
14439
|
+
}
|
|
14440
|
+
if (schema.readOnly === true) {
|
|
14441
|
+
baseSchema = z.readonly(baseSchema);
|
|
14442
|
+
}
|
|
14443
|
+
if (schema.default !== void 0) {
|
|
14444
|
+
baseSchema = baseSchema.default(schema.default);
|
|
14445
|
+
}
|
|
14446
|
+
const extraMeta = {};
|
|
14447
|
+
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
14448
|
+
for (const key of coreMetadataKeys) {
|
|
14449
|
+
if (key in schema) {
|
|
14450
|
+
extraMeta[key] = schema[key];
|
|
14451
|
+
}
|
|
14452
|
+
}
|
|
14453
|
+
const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
|
|
14454
|
+
for (const key of contentMetadataKeys) {
|
|
14455
|
+
if (key in schema) {
|
|
14456
|
+
extraMeta[key] = schema[key];
|
|
14457
|
+
}
|
|
14458
|
+
}
|
|
14459
|
+
for (const key of Object.keys(schema)) {
|
|
14460
|
+
if (!RECOGNIZED_KEYS.has(key)) {
|
|
14461
|
+
extraMeta[key] = schema[key];
|
|
14461
14462
|
}
|
|
14463
|
+
}
|
|
14464
|
+
if (Object.keys(extraMeta).length > 0) {
|
|
14465
|
+
ctx.registry.add(baseSchema, extraMeta);
|
|
14466
|
+
}
|
|
14467
|
+
if (schema.description) {
|
|
14468
|
+
baseSchema = baseSchema.describe(schema.description);
|
|
14469
|
+
}
|
|
14470
|
+
return baseSchema;
|
|
14471
|
+
}
|
|
14472
|
+
function fromJSONSchema(schema, params) {
|
|
14473
|
+
if (typeof schema === "boolean") {
|
|
14474
|
+
return schema ? z.any() : z.never();
|
|
14475
|
+
}
|
|
14476
|
+
let normalized;
|
|
14477
|
+
try {
|
|
14478
|
+
normalized = JSON.parse(JSON.stringify(schema));
|
|
14479
|
+
} catch {
|
|
14480
|
+
throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
|
|
14481
|
+
}
|
|
14482
|
+
const version2 = detectVersion(normalized, params?.defaultTarget);
|
|
14483
|
+
const defs = normalized.$defs || normalized.definitions || {};
|
|
14484
|
+
const ctx = {
|
|
14485
|
+
version: version2,
|
|
14486
|
+
defs,
|
|
14487
|
+
refs: /* @__PURE__ */ new Map(),
|
|
14488
|
+
processing: /* @__PURE__ */ new Set(),
|
|
14489
|
+
rootSchema: normalized,
|
|
14490
|
+
registry: params?.registry ?? globalRegistry
|
|
14462
14491
|
};
|
|
14463
|
-
return
|
|
14492
|
+
return convertSchema(normalized, ctx);
|
|
14464
14493
|
}
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14468
|
-
|
|
14469
|
-
|
|
14470
|
-
|
|
14471
|
-
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
|
|
14494
|
+
|
|
14495
|
+
// node_modules/zod/v4/classic/coerce.js
|
|
14496
|
+
var coerce_exports = {};
|
|
14497
|
+
__export(coerce_exports, {
|
|
14498
|
+
bigint: () => bigint3,
|
|
14499
|
+
boolean: () => boolean3,
|
|
14500
|
+
date: () => date4,
|
|
14501
|
+
number: () => number3,
|
|
14502
|
+
string: () => string3
|
|
14503
|
+
});
|
|
14504
|
+
function string3(params) {
|
|
14505
|
+
return _coercedString(ZodString, params);
|
|
14475
14506
|
}
|
|
14476
|
-
function
|
|
14477
|
-
return
|
|
14478
|
-
type: "pipe",
|
|
14479
|
-
in: transform(fn),
|
|
14480
|
-
out: schema
|
|
14481
|
-
});
|
|
14507
|
+
function number3(params) {
|
|
14508
|
+
return _coercedNumber(ZodNumber, params);
|
|
14482
14509
|
}
|
|
14483
|
-
|
|
14484
|
-
|
|
14485
|
-
var ZodIssueCode = {
|
|
14486
|
-
invalid_type: "invalid_type",
|
|
14487
|
-
too_big: "too_big",
|
|
14488
|
-
too_small: "too_small",
|
|
14489
|
-
invalid_format: "invalid_format",
|
|
14490
|
-
not_multiple_of: "not_multiple_of",
|
|
14491
|
-
unrecognized_keys: "unrecognized_keys",
|
|
14492
|
-
invalid_union: "invalid_union",
|
|
14493
|
-
invalid_key: "invalid_key",
|
|
14494
|
-
invalid_element: "invalid_element",
|
|
14495
|
-
invalid_value: "invalid_value",
|
|
14496
|
-
custom: "custom"
|
|
14497
|
-
};
|
|
14498
|
-
function setErrorMap(map2) {
|
|
14499
|
-
config({
|
|
14500
|
-
customError: map2
|
|
14501
|
-
});
|
|
14510
|
+
function boolean3(params) {
|
|
14511
|
+
return _coercedBoolean(ZodBoolean, params);
|
|
14502
14512
|
}
|
|
14503
|
-
function
|
|
14504
|
-
return
|
|
14513
|
+
function bigint3(params) {
|
|
14514
|
+
return _coercedBigint(ZodBigInt, params);
|
|
14515
|
+
}
|
|
14516
|
+
function date4(params) {
|
|
14517
|
+
return _coercedDate(ZodDate, params);
|
|
14505
14518
|
}
|
|
14506
|
-
var ZodFirstPartyTypeKind;
|
|
14507
|
-
/* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
|
|
14508
|
-
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
14509
14519
|
|
|
14510
|
-
// node_modules/zod/v4/classic/
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14518
|
-
|
|
14519
|
-
|
|
14520
|
-
|
|
14521
|
-
|
|
14522
|
-
|
|
14523
|
-
|
|
14524
|
-
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
|
|
14528
|
-
|
|
14529
|
-
|
|
14530
|
-
|
|
14531
|
-
|
|
14532
|
-
"enum",
|
|
14533
|
-
"const",
|
|
14534
|
-
// Composition
|
|
14535
|
-
"anyOf",
|
|
14536
|
-
"oneOf",
|
|
14537
|
-
"allOf",
|
|
14538
|
-
"not",
|
|
14539
|
-
// Object
|
|
14540
|
-
"properties",
|
|
14541
|
-
"required",
|
|
14542
|
-
"additionalProperties",
|
|
14543
|
-
"patternProperties",
|
|
14544
|
-
"propertyNames",
|
|
14545
|
-
"minProperties",
|
|
14546
|
-
"maxProperties",
|
|
14547
|
-
// Array
|
|
14548
|
-
"items",
|
|
14549
|
-
"prefixItems",
|
|
14550
|
-
"additionalItems",
|
|
14551
|
-
"minItems",
|
|
14552
|
-
"maxItems",
|
|
14553
|
-
"uniqueItems",
|
|
14554
|
-
"contains",
|
|
14555
|
-
"minContains",
|
|
14556
|
-
"maxContains",
|
|
14557
|
-
// String
|
|
14558
|
-
"minLength",
|
|
14559
|
-
"maxLength",
|
|
14560
|
-
"pattern",
|
|
14561
|
-
"format",
|
|
14562
|
-
// Number
|
|
14563
|
-
"minimum",
|
|
14564
|
-
"maximum",
|
|
14565
|
-
"exclusiveMinimum",
|
|
14566
|
-
"exclusiveMaximum",
|
|
14567
|
-
"multipleOf",
|
|
14568
|
-
// Already handled metadata
|
|
14569
|
-
"description",
|
|
14570
|
-
"default",
|
|
14571
|
-
// Content
|
|
14572
|
-
"contentEncoding",
|
|
14573
|
-
"contentMediaType",
|
|
14574
|
-
"contentSchema",
|
|
14575
|
-
// Unsupported (error-throwing)
|
|
14576
|
-
"unevaluatedItems",
|
|
14577
|
-
"unevaluatedProperties",
|
|
14578
|
-
"if",
|
|
14579
|
-
"then",
|
|
14580
|
-
"else",
|
|
14581
|
-
"dependentSchemas",
|
|
14582
|
-
"dependentRequired",
|
|
14583
|
-
// OpenAPI
|
|
14584
|
-
"nullable",
|
|
14585
|
-
"readOnly"
|
|
14586
|
-
]);
|
|
14587
|
-
function detectVersion(schema, defaultTarget) {
|
|
14588
|
-
const $schema = schema.$schema;
|
|
14589
|
-
if ($schema === "https://json-schema.org/draft/2020-12/schema") {
|
|
14590
|
-
return "draft-2020-12";
|
|
14520
|
+
// node_modules/zod/v4/classic/external.js
|
|
14521
|
+
config(en_default());
|
|
14522
|
+
|
|
14523
|
+
// node_modules/@opentabs-dev/shared/dist/error.js
|
|
14524
|
+
var toErrorMessage = (err2) => err2 instanceof Error ? err2.message : String(err2);
|
|
14525
|
+
|
|
14526
|
+
// node_modules/@opentabs-dev/plugin-sdk/dist/errors.js
|
|
14527
|
+
var ToolError = class _ToolError extends Error {
|
|
14528
|
+
code;
|
|
14529
|
+
/** Whether this error is retryable (defaults to false). */
|
|
14530
|
+
retryable;
|
|
14531
|
+
/** Suggested delay before retrying, in milliseconds. */
|
|
14532
|
+
retryAfterMs;
|
|
14533
|
+
/** Error category for structured error classification. */
|
|
14534
|
+
category;
|
|
14535
|
+
constructor(message, code, opts) {
|
|
14536
|
+
super(message);
|
|
14537
|
+
this.code = code;
|
|
14538
|
+
this.name = "ToolError";
|
|
14539
|
+
this.retryable = opts?.retryable ?? false;
|
|
14540
|
+
this.retryAfterMs = opts?.retryAfterMs;
|
|
14541
|
+
this.category = opts?.category;
|
|
14591
14542
|
}
|
|
14592
|
-
|
|
14593
|
-
|
|
14543
|
+
/** Authentication or authorization error (not retryable). Accepts an optional domain-specific code. */
|
|
14544
|
+
static auth(message, code) {
|
|
14545
|
+
return new _ToolError(message, code ?? "AUTH_ERROR", { category: "auth", retryable: false });
|
|
14594
14546
|
}
|
|
14595
|
-
|
|
14596
|
-
|
|
14547
|
+
/** Resource not found (not retryable). Accepts an optional domain-specific code. */
|
|
14548
|
+
static notFound(message, code) {
|
|
14549
|
+
return new _ToolError(message, code ?? "NOT_FOUND", { category: "not_found", retryable: false });
|
|
14597
14550
|
}
|
|
14598
|
-
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
if (!ref.startsWith("#")) {
|
|
14602
|
-
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
14551
|
+
/** Rate limited (retryable). Accepts an optional retry delay in milliseconds and an optional domain-specific code. */
|
|
14552
|
+
static rateLimited(message, retryAfterMs, code) {
|
|
14553
|
+
return new _ToolError(message, code ?? "RATE_LIMITED", { category: "rate_limit", retryable: true, retryAfterMs });
|
|
14603
14554
|
}
|
|
14604
|
-
|
|
14605
|
-
|
|
14606
|
-
return
|
|
14555
|
+
/** Input validation error (not retryable). Accepts an optional domain-specific code. */
|
|
14556
|
+
static validation(message, code) {
|
|
14557
|
+
return new _ToolError(message, code ?? "VALIDATION_ERROR", { category: "validation", retryable: false });
|
|
14607
14558
|
}
|
|
14608
|
-
|
|
14609
|
-
|
|
14610
|
-
|
|
14611
|
-
|
|
14612
|
-
|
|
14613
|
-
|
|
14614
|
-
return
|
|
14559
|
+
/** Operation timed out (retryable). Accepts an optional domain-specific code. */
|
|
14560
|
+
static timeout(message, code) {
|
|
14561
|
+
return new _ToolError(message, code ?? "TIMEOUT", { category: "timeout", retryable: true });
|
|
14562
|
+
}
|
|
14563
|
+
/** Internal/unexpected error (not retryable). Accepts an optional domain-specific code. */
|
|
14564
|
+
static internal(message, code) {
|
|
14565
|
+
return new _ToolError(message, code ?? "INTERNAL_ERROR", { category: "internal", retryable: false });
|
|
14566
|
+
}
|
|
14567
|
+
};
|
|
14568
|
+
|
|
14569
|
+
// node_modules/@opentabs-dev/plugin-sdk/dist/fetch.js
|
|
14570
|
+
var MAX_ERROR_BODY_LENGTH = 512;
|
|
14571
|
+
var httpStatusToToolError = (response, message) => {
|
|
14572
|
+
const status = response.status;
|
|
14573
|
+
if (status === 401 || status === 403) {
|
|
14574
|
+
return ToolError.auth(message);
|
|
14575
|
+
}
|
|
14576
|
+
if (status === 404) {
|
|
14577
|
+
return ToolError.notFound(message);
|
|
14578
|
+
}
|
|
14579
|
+
if (status === 429) {
|
|
14580
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
14581
|
+
const retryAfterMs = retryAfter !== null ? parseRetryAfterMs(retryAfter) : void 0;
|
|
14582
|
+
return ToolError.rateLimited(message, retryAfterMs);
|
|
14615
14583
|
}
|
|
14616
|
-
|
|
14617
|
-
|
|
14618
|
-
function convertBaseSchema(schema, ctx) {
|
|
14619
|
-
if (schema.not !== void 0) {
|
|
14620
|
-
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
14621
|
-
return z.never();
|
|
14622
|
-
}
|
|
14623
|
-
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
14584
|
+
if (status === 400 || status === 422) {
|
|
14585
|
+
return ToolError.validation(message);
|
|
14624
14586
|
}
|
|
14625
|
-
if (
|
|
14626
|
-
|
|
14587
|
+
if (status === 408) {
|
|
14588
|
+
return ToolError.timeout(message);
|
|
14627
14589
|
}
|
|
14628
|
-
if (
|
|
14629
|
-
|
|
14590
|
+
if (status >= 500) {
|
|
14591
|
+
const TRANSIENT_5XX = /* @__PURE__ */ new Set([500, 502, 503, 504]);
|
|
14592
|
+
const retryable = TRANSIENT_5XX.has(status);
|
|
14593
|
+
const retryAfter = status === 503 ? response.headers.get("Retry-After") : null;
|
|
14594
|
+
const retryAfterMs = retryAfter !== null ? parseRetryAfterMs(retryAfter) : void 0;
|
|
14595
|
+
return new ToolError(message, "http_error", { category: "internal", retryable, retryAfterMs });
|
|
14630
14596
|
}
|
|
14631
|
-
if (
|
|
14632
|
-
|
|
14597
|
+
if (status >= 400 && status < 500) {
|
|
14598
|
+
return new ToolError(message, "http_error", { retryable: false });
|
|
14633
14599
|
}
|
|
14634
|
-
|
|
14635
|
-
|
|
14600
|
+
return new ToolError(message, "http_error", { category: "internal" });
|
|
14601
|
+
};
|
|
14602
|
+
var parseRetryAfterMs = (value) => {
|
|
14603
|
+
const seconds = Number(value);
|
|
14604
|
+
if (!Number.isNaN(seconds) && seconds >= 0) {
|
|
14605
|
+
return seconds * 1e3;
|
|
14636
14606
|
}
|
|
14637
|
-
|
|
14638
|
-
|
|
14639
|
-
|
|
14640
|
-
|
|
14641
|
-
}
|
|
14642
|
-
if (ctx.processing.has(refPath)) {
|
|
14643
|
-
return z.lazy(() => {
|
|
14644
|
-
if (!ctx.refs.has(refPath)) {
|
|
14645
|
-
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
14646
|
-
}
|
|
14647
|
-
return ctx.refs.get(refPath);
|
|
14648
|
-
});
|
|
14649
|
-
}
|
|
14650
|
-
ctx.processing.add(refPath);
|
|
14651
|
-
const resolved = resolveRef(refPath, ctx);
|
|
14652
|
-
const zodSchema2 = convertSchema(resolved, ctx);
|
|
14653
|
-
ctx.refs.set(refPath, zodSchema2);
|
|
14654
|
-
ctx.processing.delete(refPath);
|
|
14655
|
-
return zodSchema2;
|
|
14607
|
+
const date5 = Date.parse(value);
|
|
14608
|
+
if (!Number.isNaN(date5)) {
|
|
14609
|
+
const ms = date5 - Date.now();
|
|
14610
|
+
return ms > 0 ? ms : void 0;
|
|
14656
14611
|
}
|
|
14657
|
-
|
|
14658
|
-
|
|
14659
|
-
|
|
14660
|
-
|
|
14661
|
-
|
|
14662
|
-
if (
|
|
14663
|
-
|
|
14664
|
-
|
|
14665
|
-
|
|
14666
|
-
|
|
14667
|
-
|
|
14668
|
-
|
|
14669
|
-
|
|
14670
|
-
}
|
|
14671
|
-
const literalSchemas = enumValues.map((v) => z.literal(v));
|
|
14672
|
-
if (literalSchemas.length < 2) {
|
|
14673
|
-
return literalSchemas[0];
|
|
14612
|
+
return void 0;
|
|
14613
|
+
};
|
|
14614
|
+
var buildQueryString = (params) => {
|
|
14615
|
+
const searchParams = new URLSearchParams();
|
|
14616
|
+
for (const [key, value] of Object.entries(params)) {
|
|
14617
|
+
if (value === void 0)
|
|
14618
|
+
continue;
|
|
14619
|
+
if (Array.isArray(value)) {
|
|
14620
|
+
for (const item of value) {
|
|
14621
|
+
searchParams.append(key, String(item));
|
|
14622
|
+
}
|
|
14623
|
+
} else {
|
|
14624
|
+
searchParams.append(key, String(value));
|
|
14674
14625
|
}
|
|
14675
|
-
return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
14676
14626
|
}
|
|
14677
|
-
|
|
14678
|
-
|
|
14679
|
-
|
|
14680
|
-
const
|
|
14681
|
-
|
|
14682
|
-
|
|
14683
|
-
|
|
14684
|
-
|
|
14627
|
+
return searchParams.toString();
|
|
14628
|
+
};
|
|
14629
|
+
var fetchFromPage = async (url2, init) => {
|
|
14630
|
+
const { timeout = 3e4, signal, ...rest } = init ?? {};
|
|
14631
|
+
const timeoutSignal = AbortSignal.timeout(timeout);
|
|
14632
|
+
const combinedSignal = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;
|
|
14633
|
+
let response;
|
|
14634
|
+
try {
|
|
14635
|
+
response = await fetch(url2, {
|
|
14636
|
+
credentials: "include",
|
|
14637
|
+
...rest,
|
|
14638
|
+
signal: combinedSignal
|
|
14685
14639
|
});
|
|
14686
|
-
|
|
14687
|
-
|
|
14640
|
+
} catch (error51) {
|
|
14641
|
+
if (error51 instanceof DOMException && error51.name === "TimeoutError") {
|
|
14642
|
+
throw ToolError.timeout(`fetchFromPage: request timed out after ${timeout}ms for ${url2}`);
|
|
14688
14643
|
}
|
|
14689
|
-
if (
|
|
14690
|
-
|
|
14644
|
+
if (combinedSignal.aborted) {
|
|
14645
|
+
throw new ToolError(`fetchFromPage: request aborted for ${url2}`, "aborted");
|
|
14691
14646
|
}
|
|
14692
|
-
|
|
14647
|
+
throw new ToolError(`fetchFromPage: network error for ${url2}: ${toErrorMessage(error51)}`, "network_error", {
|
|
14648
|
+
category: "internal",
|
|
14649
|
+
retryable: true
|
|
14650
|
+
});
|
|
14693
14651
|
}
|
|
14694
|
-
if (!
|
|
14695
|
-
|
|
14652
|
+
if (!response.ok) {
|
|
14653
|
+
const rawText = await response.text().catch(() => response.statusText);
|
|
14654
|
+
const errorText = rawText.length > MAX_ERROR_BODY_LENGTH ? `${rawText.slice(0, MAX_ERROR_BODY_LENGTH)}\u2026` : rawText;
|
|
14655
|
+
const msg = `fetchFromPage: HTTP ${response.status} for ${url2}: ${errorText}`;
|
|
14656
|
+
throw httpStatusToToolError(response, msg);
|
|
14696
14657
|
}
|
|
14697
|
-
|
|
14698
|
-
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
|
|
14705
|
-
|
|
14706
|
-
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
|
|
14715
|
-
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
|
|
14727
|
-
|
|
14728
|
-
|
|
14729
|
-
|
|
14730
|
-
|
|
14731
|
-
|
|
14732
|
-
|
|
14733
|
-
|
|
14734
|
-
|
|
14735
|
-
|
|
14736
|
-
|
|
14737
|
-
|
|
14738
|
-
|
|
14739
|
-
|
|
14740
|
-
|
|
14741
|
-
|
|
14742
|
-
|
|
14743
|
-
|
|
14744
|
-
|
|
14745
|
-
} else if (format === "xid") {
|
|
14746
|
-
stringSchema = stringSchema.check(z.xid());
|
|
14747
|
-
} else if (format === "ksuid") {
|
|
14748
|
-
stringSchema = stringSchema.check(z.ksuid());
|
|
14749
|
-
}
|
|
14750
|
-
}
|
|
14751
|
-
if (typeof schema.minLength === "number") {
|
|
14752
|
-
stringSchema = stringSchema.min(schema.minLength);
|
|
14753
|
-
}
|
|
14754
|
-
if (typeof schema.maxLength === "number") {
|
|
14755
|
-
stringSchema = stringSchema.max(schema.maxLength);
|
|
14756
|
-
}
|
|
14757
|
-
if (schema.pattern) {
|
|
14758
|
-
stringSchema = stringSchema.regex(new RegExp(schema.pattern));
|
|
14759
|
-
}
|
|
14760
|
-
zodSchema = stringSchema;
|
|
14761
|
-
break;
|
|
14762
|
-
}
|
|
14763
|
-
case "number":
|
|
14764
|
-
case "integer": {
|
|
14765
|
-
let numberSchema = type === "integer" ? z.number().int() : z.number();
|
|
14766
|
-
if (typeof schema.minimum === "number") {
|
|
14767
|
-
numberSchema = numberSchema.min(schema.minimum);
|
|
14768
|
-
}
|
|
14769
|
-
if (typeof schema.maximum === "number") {
|
|
14770
|
-
numberSchema = numberSchema.max(schema.maximum);
|
|
14771
|
-
}
|
|
14772
|
-
if (typeof schema.exclusiveMinimum === "number") {
|
|
14773
|
-
numberSchema = numberSchema.gt(schema.exclusiveMinimum);
|
|
14774
|
-
} else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") {
|
|
14775
|
-
numberSchema = numberSchema.gt(schema.minimum);
|
|
14776
|
-
}
|
|
14777
|
-
if (typeof schema.exclusiveMaximum === "number") {
|
|
14778
|
-
numberSchema = numberSchema.lt(schema.exclusiveMaximum);
|
|
14779
|
-
} else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") {
|
|
14780
|
-
numberSchema = numberSchema.lt(schema.maximum);
|
|
14658
|
+
return response;
|
|
14659
|
+
};
|
|
14660
|
+
|
|
14661
|
+
// node_modules/@opentabs-dev/plugin-sdk/dist/timing.js
|
|
14662
|
+
var waitUntil = (predicate, opts) => {
|
|
14663
|
+
const interval = opts?.interval ?? 200;
|
|
14664
|
+
const timeout = opts?.timeout ?? 1e4;
|
|
14665
|
+
const signal = opts?.signal;
|
|
14666
|
+
const abortReason = () => signal?.reason instanceof Error ? signal.reason : new Error("waitUntil: aborted");
|
|
14667
|
+
if (signal?.aborted)
|
|
14668
|
+
return Promise.reject(abortReason());
|
|
14669
|
+
return new Promise((resolve, reject) => {
|
|
14670
|
+
let settled = false;
|
|
14671
|
+
let poller;
|
|
14672
|
+
let lastPredicateError;
|
|
14673
|
+
const isSettled = () => settled;
|
|
14674
|
+
const cleanup = () => {
|
|
14675
|
+
settled = true;
|
|
14676
|
+
clearTimeout(timer);
|
|
14677
|
+
clearTimeout(poller);
|
|
14678
|
+
signal?.removeEventListener("abort", onAbort);
|
|
14679
|
+
};
|
|
14680
|
+
const onAbort = () => {
|
|
14681
|
+
if (isSettled())
|
|
14682
|
+
return;
|
|
14683
|
+
cleanup();
|
|
14684
|
+
reject(abortReason());
|
|
14685
|
+
};
|
|
14686
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
14687
|
+
const timer = setTimeout(() => {
|
|
14688
|
+
if (isSettled())
|
|
14689
|
+
return;
|
|
14690
|
+
cleanup();
|
|
14691
|
+
const errorContext = lastPredicateError instanceof Error ? `: predicate last threw \u2014 ${lastPredicateError.message}` : "";
|
|
14692
|
+
reject(new Error(`waitUntil: timed out after ${timeout}ms waiting for predicate to return true${errorContext}`));
|
|
14693
|
+
}, timeout);
|
|
14694
|
+
const check2 = async () => {
|
|
14695
|
+
if (isSettled())
|
|
14696
|
+
return;
|
|
14697
|
+
try {
|
|
14698
|
+
const result = await predicate();
|
|
14699
|
+
if (result) {
|
|
14700
|
+
cleanup();
|
|
14701
|
+
resolve();
|
|
14702
|
+
return;
|
|
14703
|
+
}
|
|
14704
|
+
} catch (err2) {
|
|
14705
|
+
lastPredicateError = err2;
|
|
14781
14706
|
}
|
|
14782
|
-
if (
|
|
14783
|
-
|
|
14707
|
+
if (!isSettled()) {
|
|
14708
|
+
poller = setTimeout(() => void check2(), interval);
|
|
14784
14709
|
}
|
|
14785
|
-
|
|
14786
|
-
|
|
14787
|
-
|
|
14788
|
-
|
|
14789
|
-
|
|
14790
|
-
|
|
14791
|
-
|
|
14792
|
-
|
|
14793
|
-
|
|
14794
|
-
|
|
14710
|
+
};
|
|
14711
|
+
void check2();
|
|
14712
|
+
});
|
|
14713
|
+
};
|
|
14714
|
+
|
|
14715
|
+
// node_modules/@opentabs-dev/plugin-sdk/dist/log.js
|
|
14716
|
+
var MAX_DATA_LENGTH = 10;
|
|
14717
|
+
var MAX_STRING_LENGTH = 4096;
|
|
14718
|
+
var MAX_SERIALIZED_SIZE = 64 * 1024;
|
|
14719
|
+
var safeSerializeArg = (value) => {
|
|
14720
|
+
try {
|
|
14721
|
+
if (value === null || value === void 0)
|
|
14722
|
+
return value;
|
|
14723
|
+
const type = typeof value;
|
|
14724
|
+
if (type === "boolean" || type === "number")
|
|
14725
|
+
return value;
|
|
14726
|
+
if (type === "string") {
|
|
14727
|
+
return value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}\u2026` : value;
|
|
14795
14728
|
}
|
|
14796
|
-
|
|
14797
|
-
|
|
14798
|
-
|
|
14799
|
-
|
|
14800
|
-
|
|
14801
|
-
|
|
14802
|
-
|
|
14803
|
-
|
|
14804
|
-
|
|
14805
|
-
|
|
14806
|
-
|
|
14807
|
-
|
|
14808
|
-
|
|
14809
|
-
|
|
14810
|
-
|
|
14811
|
-
|
|
14812
|
-
const recordSchema = z.looseRecord(keySchema, valueSchema);
|
|
14813
|
-
zodSchema = z.intersection(objectSchema2, recordSchema);
|
|
14814
|
-
break;
|
|
14815
|
-
}
|
|
14816
|
-
if (schema.patternProperties) {
|
|
14817
|
-
const patternProps = schema.patternProperties;
|
|
14818
|
-
const patternKeys = Object.keys(patternProps);
|
|
14819
|
-
const looseRecords = [];
|
|
14820
|
-
for (const pattern of patternKeys) {
|
|
14821
|
-
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
14822
|
-
const keySchema = z.string().regex(new RegExp(pattern));
|
|
14823
|
-
looseRecords.push(z.looseRecord(keySchema, patternValue));
|
|
14824
|
-
}
|
|
14825
|
-
const schemasToIntersect = [];
|
|
14826
|
-
if (Object.keys(shape).length > 0) {
|
|
14827
|
-
schemasToIntersect.push(z.object(shape).passthrough());
|
|
14828
|
-
}
|
|
14829
|
-
schemasToIntersect.push(...looseRecords);
|
|
14830
|
-
if (schemasToIntersect.length === 0) {
|
|
14831
|
-
zodSchema = z.object({}).passthrough();
|
|
14832
|
-
} else if (schemasToIntersect.length === 1) {
|
|
14833
|
-
zodSchema = schemasToIntersect[0];
|
|
14834
|
-
} else {
|
|
14835
|
-
let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
14836
|
-
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
14837
|
-
result = z.intersection(result, schemasToIntersect[i]);
|
|
14729
|
+
if (type === "function")
|
|
14730
|
+
return `[Function: ${value.name || "anonymous"}]`;
|
|
14731
|
+
if (type === "symbol")
|
|
14732
|
+
return `[Symbol: ${value.description ?? ""}]`;
|
|
14733
|
+
if (type === "bigint")
|
|
14734
|
+
return `[BigInt: ${value.toString()}]`;
|
|
14735
|
+
if (typeof value.nodeType === "number" && typeof value.nodeName === "string") {
|
|
14736
|
+
try {
|
|
14737
|
+
const node = value;
|
|
14738
|
+
let classStr = "";
|
|
14739
|
+
if (typeof node.className === "string") {
|
|
14740
|
+
classStr = node.className ? `.${node.className.split(" ")[0] ?? ""}` : "";
|
|
14741
|
+
} else if (node.className !== null && typeof node.className === "object") {
|
|
14742
|
+
const baseVal = node.className.baseVal;
|
|
14743
|
+
if (typeof baseVal === "string") {
|
|
14744
|
+
classStr = baseVal ? `.${baseVal.split(" ")[0] ?? ""}` : "";
|
|
14838
14745
|
}
|
|
14839
|
-
zodSchema = result;
|
|
14840
14746
|
}
|
|
14841
|
-
|
|
14842
|
-
}
|
|
14843
|
-
const objectSchema = z.object(shape);
|
|
14844
|
-
if (schema.additionalProperties === false) {
|
|
14845
|
-
zodSchema = objectSchema.strict();
|
|
14846
|
-
} else if (typeof schema.additionalProperties === "object") {
|
|
14847
|
-
zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));
|
|
14848
|
-
} else {
|
|
14849
|
-
zodSchema = objectSchema.passthrough();
|
|
14747
|
+
return `[${node.nodeName}${node.id ? `#${node.id}` : ""}${classStr}]`;
|
|
14748
|
+
} catch {
|
|
14850
14749
|
}
|
|
14851
|
-
break;
|
|
14852
14750
|
}
|
|
14853
|
-
|
|
14854
|
-
|
|
14855
|
-
const items = schema.items;
|
|
14856
|
-
if (prefixItems && Array.isArray(prefixItems)) {
|
|
14857
|
-
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
14858
|
-
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
14859
|
-
if (rest) {
|
|
14860
|
-
zodSchema = z.tuple(tupleItems).rest(rest);
|
|
14861
|
-
} else {
|
|
14862
|
-
zodSchema = z.tuple(tupleItems);
|
|
14863
|
-
}
|
|
14864
|
-
if (typeof schema.minItems === "number") {
|
|
14865
|
-
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
14866
|
-
}
|
|
14867
|
-
if (typeof schema.maxItems === "number") {
|
|
14868
|
-
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
14869
|
-
}
|
|
14870
|
-
} else if (Array.isArray(items)) {
|
|
14871
|
-
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
14872
|
-
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
14873
|
-
if (rest) {
|
|
14874
|
-
zodSchema = z.tuple(tupleItems).rest(rest);
|
|
14875
|
-
} else {
|
|
14876
|
-
zodSchema = z.tuple(tupleItems);
|
|
14877
|
-
}
|
|
14878
|
-
if (typeof schema.minItems === "number") {
|
|
14879
|
-
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
14880
|
-
}
|
|
14881
|
-
if (typeof schema.maxItems === "number") {
|
|
14882
|
-
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
14883
|
-
}
|
|
14884
|
-
} else if (items !== void 0) {
|
|
14885
|
-
const element = convertSchema(items, ctx);
|
|
14886
|
-
let arraySchema = z.array(element);
|
|
14887
|
-
if (typeof schema.minItems === "number") {
|
|
14888
|
-
arraySchema = arraySchema.min(schema.minItems);
|
|
14889
|
-
}
|
|
14890
|
-
if (typeof schema.maxItems === "number") {
|
|
14891
|
-
arraySchema = arraySchema.max(schema.maxItems);
|
|
14892
|
-
}
|
|
14893
|
-
zodSchema = arraySchema;
|
|
14894
|
-
} else {
|
|
14895
|
-
zodSchema = z.array(z.any());
|
|
14896
|
-
}
|
|
14897
|
-
break;
|
|
14751
|
+
if (value instanceof Error) {
|
|
14752
|
+
return { name: value.name, message: value.message, stack: value.stack };
|
|
14898
14753
|
}
|
|
14899
|
-
|
|
14900
|
-
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
|
-
|
|
14904
|
-
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
|
|
14908
|
-
|
|
14909
|
-
|
|
14910
|
-
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
|
|
14914
|
-
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
|
|
14918
|
-
|
|
14919
|
-
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14923
|
-
|
|
14924
|
-
|
|
14925
|
-
|
|
14926
|
-
|
|
14927
|
-
|
|
14754
|
+
if (value instanceof WeakRef)
|
|
14755
|
+
return "[WeakRef]";
|
|
14756
|
+
if (value instanceof WeakMap)
|
|
14757
|
+
return "[WeakMap]";
|
|
14758
|
+
if (value instanceof WeakSet)
|
|
14759
|
+
return "[WeakSet]";
|
|
14760
|
+
if (value instanceof ArrayBuffer)
|
|
14761
|
+
return "[ArrayBuffer]";
|
|
14762
|
+
if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer)
|
|
14763
|
+
return "[SharedArrayBuffer]";
|
|
14764
|
+
try {
|
|
14765
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
14766
|
+
const json2 = JSON.stringify(value, (_key, v) => {
|
|
14767
|
+
if (typeof v === "object" && v !== null) {
|
|
14768
|
+
if (seen.has(v))
|
|
14769
|
+
return "[Circular]";
|
|
14770
|
+
seen.add(v);
|
|
14771
|
+
}
|
|
14772
|
+
if (typeof v === "function")
|
|
14773
|
+
return `[Function: ${v.name || "anonymous"}]`;
|
|
14774
|
+
if (typeof v === "bigint")
|
|
14775
|
+
return `[BigInt: ${v.toString()}]`;
|
|
14776
|
+
if (typeof v === "symbol")
|
|
14777
|
+
return `[Symbol: ${v.description ?? ""}]`;
|
|
14778
|
+
if (v instanceof WeakRef)
|
|
14779
|
+
return "[WeakRef]";
|
|
14780
|
+
if (v instanceof WeakMap)
|
|
14781
|
+
return "[WeakMap]";
|
|
14782
|
+
if (v instanceof WeakSet)
|
|
14783
|
+
return "[WeakSet]";
|
|
14784
|
+
if (v instanceof ArrayBuffer)
|
|
14785
|
+
return "[ArrayBuffer]";
|
|
14786
|
+
if (typeof SharedArrayBuffer !== "undefined" && v instanceof SharedArrayBuffer)
|
|
14787
|
+
return "[SharedArrayBuffer]";
|
|
14788
|
+
return v;
|
|
14789
|
+
});
|
|
14790
|
+
if (json2.length > MAX_SERIALIZED_SIZE) {
|
|
14791
|
+
return `[Object truncated: ${json2.length} chars]`;
|
|
14928
14792
|
}
|
|
14929
|
-
|
|
14793
|
+
return JSON.parse(json2);
|
|
14794
|
+
} catch {
|
|
14795
|
+
return `[Unserializable: ${typeof value}]`;
|
|
14930
14796
|
}
|
|
14797
|
+
} catch {
|
|
14798
|
+
return `[Unserializable: ${typeof value}]`;
|
|
14931
14799
|
}
|
|
14932
|
-
|
|
14933
|
-
|
|
14800
|
+
};
|
|
14801
|
+
var safeSerialize = (args) => {
|
|
14802
|
+
const capped = args.length > MAX_DATA_LENGTH ? args.slice(0, MAX_DATA_LENGTH) : args;
|
|
14803
|
+
return capped.map(safeSerializeArg);
|
|
14804
|
+
};
|
|
14805
|
+
var CONSOLE_METHODS = {
|
|
14806
|
+
debug: "debug",
|
|
14807
|
+
info: "info",
|
|
14808
|
+
warning: "warn",
|
|
14809
|
+
error: "error"
|
|
14810
|
+
};
|
|
14811
|
+
var defaultTransport = (entry) => {
|
|
14812
|
+
const method = CONSOLE_METHODS[entry.level];
|
|
14813
|
+
console[method](`[sdk.log] ${entry.message}`, ...entry.data);
|
|
14814
|
+
};
|
|
14815
|
+
var activeTransport = defaultTransport;
|
|
14816
|
+
var _setLogTransport = (transport) => {
|
|
14817
|
+
const previous = activeTransport;
|
|
14818
|
+
activeTransport = transport;
|
|
14819
|
+
return () => {
|
|
14820
|
+
if (activeTransport === transport)
|
|
14821
|
+
activeTransport = previous;
|
|
14822
|
+
};
|
|
14823
|
+
};
|
|
14824
|
+
var makeLogMethod = (level) => (message, ...args) => {
|
|
14825
|
+
const entry = {
|
|
14826
|
+
level,
|
|
14827
|
+
message,
|
|
14828
|
+
data: safeSerialize(args),
|
|
14829
|
+
ts: (/* @__PURE__ */ new Date()).toISOString()
|
|
14830
|
+
};
|
|
14831
|
+
activeTransport(entry);
|
|
14832
|
+
};
|
|
14833
|
+
var log = Object.freeze({
|
|
14834
|
+
debug: makeLogMethod("debug"),
|
|
14835
|
+
info: makeLogMethod("info"),
|
|
14836
|
+
warn: makeLogMethod("warning"),
|
|
14837
|
+
error: makeLogMethod("error")
|
|
14838
|
+
});
|
|
14839
|
+
var ot = globalThis.__openTabs ?? {};
|
|
14840
|
+
globalThis.__openTabs = ot;
|
|
14841
|
+
ot._setLogTransport = _setLogTransport;
|
|
14842
|
+
ot.log = log;
|
|
14843
|
+
|
|
14844
|
+
// node_modules/@opentabs-dev/plugin-sdk/dist/storage.js
|
|
14845
|
+
var getAuthCache = (namespace) => {
|
|
14846
|
+
try {
|
|
14847
|
+
const ns = globalThis.__openTabs;
|
|
14848
|
+
const cache = ns?.tokenCache;
|
|
14849
|
+
return cache?.[namespace] ?? null;
|
|
14850
|
+
} catch {
|
|
14851
|
+
return null;
|
|
14934
14852
|
}
|
|
14935
|
-
|
|
14936
|
-
|
|
14853
|
+
};
|
|
14854
|
+
var setAuthCache = (namespace, value) => {
|
|
14855
|
+
try {
|
|
14856
|
+
const g = globalThis;
|
|
14857
|
+
if (!g.__openTabs)
|
|
14858
|
+
g.__openTabs = {};
|
|
14859
|
+
const ns = g.__openTabs;
|
|
14860
|
+
if (!ns.tokenCache)
|
|
14861
|
+
ns.tokenCache = {};
|
|
14862
|
+
ns.tokenCache[namespace] = value;
|
|
14863
|
+
} catch {
|
|
14937
14864
|
}
|
|
14938
|
-
|
|
14939
|
-
|
|
14865
|
+
};
|
|
14866
|
+
var clearAuthCache = (namespace) => {
|
|
14867
|
+
try {
|
|
14868
|
+
const ns = globalThis.__openTabs;
|
|
14869
|
+
const cache = ns?.tokenCache;
|
|
14870
|
+
if (cache)
|
|
14871
|
+
cache[namespace] = void 0;
|
|
14872
|
+
} catch {
|
|
14940
14873
|
}
|
|
14941
|
-
|
|
14942
|
-
|
|
14943
|
-
|
|
14944
|
-
|
|
14945
|
-
|
|
14874
|
+
};
|
|
14875
|
+
|
|
14876
|
+
// node_modules/@opentabs-dev/plugin-sdk/dist/page-state.js
|
|
14877
|
+
var BLOCKED_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
14878
|
+
var getPageGlobal = (path) => {
|
|
14879
|
+
try {
|
|
14880
|
+
const segments = path.split(".");
|
|
14881
|
+
let current = globalThis;
|
|
14882
|
+
for (const segment of segments) {
|
|
14883
|
+
if (current === null || current === void 0)
|
|
14884
|
+
return void 0;
|
|
14885
|
+
if (typeof current !== "object" && typeof current !== "function")
|
|
14886
|
+
return void 0;
|
|
14887
|
+
if (BLOCKED_SEGMENTS.has(segment))
|
|
14888
|
+
return void 0;
|
|
14889
|
+
current = current[segment];
|
|
14946
14890
|
}
|
|
14891
|
+
return current;
|
|
14892
|
+
} catch {
|
|
14893
|
+
return void 0;
|
|
14947
14894
|
}
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14895
|
+
};
|
|
14896
|
+
|
|
14897
|
+
// node_modules/@opentabs-dev/plugin-sdk/dist/index.js
|
|
14898
|
+
var defineTool = (config2) => config2;
|
|
14899
|
+
var OpenTabsPlugin = class {
|
|
14900
|
+
/**
|
|
14901
|
+
* Chrome match patterns for URLs that should NOT match this plugin.
|
|
14902
|
+
* Tabs matching both urlPatterns and excludePatterns are excluded.
|
|
14903
|
+
* Useful when a broad urlPattern overlaps with another plugin's domain.
|
|
14904
|
+
* @see https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns
|
|
14905
|
+
*/
|
|
14906
|
+
excludePatterns;
|
|
14907
|
+
/**
|
|
14908
|
+
* URL to open when no matching tab exists and the user triggers an
|
|
14909
|
+
* 'open tab' action from the side panel. Should be a concrete URL
|
|
14910
|
+
* (e.g., 'https://github.com'), not a match pattern.
|
|
14911
|
+
*/
|
|
14912
|
+
homepage;
|
|
14913
|
+
/** Typed configuration schema — declares settings that users provide via config.json or the side panel. */
|
|
14914
|
+
configSchema;
|
|
14915
|
+
};
|
|
14916
|
+
|
|
14917
|
+
// src/notebooklm-api.ts
|
|
14918
|
+
var API_PATH = "/_/LabsTailwindUi/data/batchexecute";
|
|
14919
|
+
var getWizData = () => {
|
|
14920
|
+
const data = getPageGlobal("WIZ_global_data");
|
|
14921
|
+
if (!data?.SNlM0e) return null;
|
|
14922
|
+
return data;
|
|
14923
|
+
};
|
|
14924
|
+
var getAuth = () => {
|
|
14925
|
+
const cached2 = getAuthCache("notebooklm");
|
|
14926
|
+
if (cached2?.at) return cached2;
|
|
14927
|
+
const wiz = getWizData();
|
|
14928
|
+
if (!wiz?.SNlM0e) return null;
|
|
14929
|
+
const auth = {
|
|
14930
|
+
at: wiz.SNlM0e,
|
|
14931
|
+
bl: wiz.cfb2h ?? "",
|
|
14932
|
+
userId: wiz.S06Grb ?? "",
|
|
14933
|
+
email: wiz.oPEP7c ?? "",
|
|
14934
|
+
sid: wiz.FdrFJe ?? ""
|
|
14935
|
+
};
|
|
14936
|
+
setAuthCache("notebooklm", auth);
|
|
14937
|
+
return auth;
|
|
14938
|
+
};
|
|
14939
|
+
var isAuthenticated = () => getAuth() !== null;
|
|
14940
|
+
var waitForAuth = async () => {
|
|
14941
|
+
try {
|
|
14942
|
+
await waitUntil(() => isAuthenticated(), {
|
|
14943
|
+
interval: 500,
|
|
14944
|
+
timeout: 5e3
|
|
14945
|
+
});
|
|
14946
|
+
return true;
|
|
14947
|
+
} catch {
|
|
14948
|
+
return false;
|
|
14953
14949
|
}
|
|
14954
|
-
|
|
14955
|
-
|
|
14956
|
-
|
|
14950
|
+
};
|
|
14951
|
+
var getCurrentUserInfo = () => {
|
|
14952
|
+
const auth = getAuth();
|
|
14953
|
+
if (!auth) throw ToolError.auth("Not authenticated \u2014 please log in to NotebookLM.");
|
|
14954
|
+
return { userId: auth.userId, email: auth.email };
|
|
14955
|
+
};
|
|
14956
|
+
var parseBatchResponse = (text) => {
|
|
14957
|
+
const lines = text.split("\n");
|
|
14958
|
+
for (const line of lines) {
|
|
14959
|
+
const trimmed = line.trim();
|
|
14960
|
+
if (!trimmed || trimmed === ")]}'" || /^\d+$/.test(trimmed)) continue;
|
|
14961
|
+
try {
|
|
14962
|
+
const parsed = JSON.parse(trimmed);
|
|
14963
|
+
if (!Array.isArray(parsed)) continue;
|
|
14964
|
+
const inner = parsed[0];
|
|
14965
|
+
if (!Array.isArray(inner)) continue;
|
|
14966
|
+
if (inner[0] === "wrb.fr") {
|
|
14967
|
+
const dataStr = inner[2];
|
|
14968
|
+
if (dataStr === null || dataStr === void 0) {
|
|
14969
|
+
const errorCode = inner[5];
|
|
14970
|
+
if (errorCode) {
|
|
14971
|
+
const code = Array.isArray(errorCode) ? errorCode[0] : errorCode;
|
|
14972
|
+
if (code === 3) throw ToolError.validation("Invalid request parameters.");
|
|
14973
|
+
if (code === 5) throw ToolError.notFound("Resource not found.");
|
|
14974
|
+
if (code === 7) throw ToolError.auth("Not authenticated \u2014 please log in to NotebookLM.");
|
|
14975
|
+
if (code === 16) throw ToolError.auth("Not authenticated \u2014 please log in to NotebookLM.");
|
|
14976
|
+
throw ToolError.internal(`RPC error code ${code}`);
|
|
14977
|
+
}
|
|
14978
|
+
return null;
|
|
14979
|
+
}
|
|
14980
|
+
return JSON.parse(dataStr);
|
|
14981
|
+
}
|
|
14982
|
+
} catch (e) {
|
|
14983
|
+
if (e instanceof ToolError) throw e;
|
|
14957
14984
|
}
|
|
14958
14985
|
}
|
|
14959
|
-
|
|
14960
|
-
|
|
14961
|
-
|
|
14962
|
-
|
|
14963
|
-
|
|
14964
|
-
|
|
14965
|
-
|
|
14966
|
-
|
|
14967
|
-
|
|
14968
|
-
|
|
14969
|
-
|
|
14970
|
-
}
|
|
14971
|
-
|
|
14972
|
-
|
|
14973
|
-
|
|
14974
|
-
|
|
14975
|
-
|
|
14986
|
+
throw ToolError.internal("Failed to parse batchexecute response.");
|
|
14987
|
+
};
|
|
14988
|
+
var rpc = async (rpcId, params, sourcePath) => {
|
|
14989
|
+
const auth = getAuth();
|
|
14990
|
+
if (!auth) throw ToolError.auth("Not authenticated \u2014 please log in to NotebookLM.");
|
|
14991
|
+
const qs = buildQueryString({
|
|
14992
|
+
rpcids: rpcId,
|
|
14993
|
+
"source-path": sourcePath ?? "/",
|
|
14994
|
+
bl: auth.bl,
|
|
14995
|
+
hl: "en"
|
|
14996
|
+
});
|
|
14997
|
+
const url2 = `${API_PATH}?${qs}`;
|
|
14998
|
+
const body = new URLSearchParams();
|
|
14999
|
+
body.set("f.req", JSON.stringify([[[rpcId, JSON.stringify(params), null, "generic"]]]));
|
|
15000
|
+
body.set("at", auth.at);
|
|
15001
|
+
const resp = await fetchFromPage(url2, {
|
|
15002
|
+
method: "POST",
|
|
15003
|
+
headers: {
|
|
15004
|
+
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
|
15005
|
+
"X-Same-Domain": "1"
|
|
15006
|
+
},
|
|
15007
|
+
body: body.toString()
|
|
15008
|
+
});
|
|
15009
|
+
const text = await resp.text();
|
|
15010
|
+
if (resp.status === 401 || resp.status === 403) {
|
|
15011
|
+
clearAuthCache("notebooklm");
|
|
15012
|
+
throw ToolError.auth("Not authenticated \u2014 please log in to NotebookLM.");
|
|
14976
15013
|
}
|
|
14977
|
-
|
|
14978
|
-
|
|
14979
|
-
|
|
14980
|
-
version: version2,
|
|
14981
|
-
defs,
|
|
14982
|
-
refs: /* @__PURE__ */ new Map(),
|
|
14983
|
-
processing: /* @__PURE__ */ new Set(),
|
|
14984
|
-
rootSchema: normalized,
|
|
14985
|
-
registry: params?.registry ?? globalRegistry
|
|
14986
|
-
};
|
|
14987
|
-
return convertSchema(normalized, ctx);
|
|
14988
|
-
}
|
|
14989
|
-
|
|
14990
|
-
// node_modules/zod/v4/classic/coerce.js
|
|
14991
|
-
var coerce_exports = {};
|
|
14992
|
-
__export(coerce_exports, {
|
|
14993
|
-
bigint: () => bigint3,
|
|
14994
|
-
boolean: () => boolean3,
|
|
14995
|
-
date: () => date4,
|
|
14996
|
-
number: () => number3,
|
|
14997
|
-
string: () => string3
|
|
14998
|
-
});
|
|
14999
|
-
function string3(params) {
|
|
15000
|
-
return _coercedString(ZodString, params);
|
|
15001
|
-
}
|
|
15002
|
-
function number3(params) {
|
|
15003
|
-
return _coercedNumber(ZodNumber, params);
|
|
15004
|
-
}
|
|
15005
|
-
function boolean3(params) {
|
|
15006
|
-
return _coercedBoolean(ZodBoolean, params);
|
|
15007
|
-
}
|
|
15008
|
-
function bigint3(params) {
|
|
15009
|
-
return _coercedBigint(ZodBigInt, params);
|
|
15010
|
-
}
|
|
15011
|
-
function date4(params) {
|
|
15012
|
-
return _coercedDate(ZodDate, params);
|
|
15013
|
-
}
|
|
15014
|
-
|
|
15015
|
-
// node_modules/zod/v4/classic/external.js
|
|
15016
|
-
config(en_default());
|
|
15014
|
+
return parseBatchResponse(text);
|
|
15015
|
+
};
|
|
15016
|
+
var FEATURE_FLAGS = [2];
|
|
15017
15017
|
|
|
15018
15018
|
// src/tools/schemas.ts
|
|
15019
15019
|
var notebookSchema = external_exports.object({
|
|
@@ -15609,7 +15609,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15609
15609
|
};
|
|
15610
15610
|
var src_default = new NotebookLMPlugin();
|
|
15611
15611
|
|
|
15612
|
-
// dist/
|
|
15612
|
+
// dist/_adapter_entry_3540fb4f-a580-495a-9992-e583eaf6d6d3.ts
|
|
15613
|
+
external_exports.config({ jitless: true });
|
|
15613
15614
|
if (!globalThis.__openTabs) {
|
|
15614
15615
|
globalThis.__openTabs = {};
|
|
15615
15616
|
} else {
|
|
@@ -15827,5 +15828,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15827
15828
|
};
|
|
15828
15829
|
delete src_default.onDeactivate;
|
|
15829
15830
|
}
|
|
15830
|
-
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["notebooklm"]){var a=o.adapters["notebooklm"];a.__adapterHash="
|
|
15831
|
+
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["notebooklm"]){var a=o.adapters["notebooklm"];a.__adapterHash="64fae7f3af508cba9c7b899501ac8342bb0536b503bad24d02b839ec5ee74132";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"notebooklm",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
|
|
15831
15832
|
//# sourceMappingURL=adapter.iife.js.map
|