@polyglot-bundles/de-parallel-text 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/essential-218/index.d.ts +9 -0
- package/dist/essential-218/index.d.ts.map +1 -0
- package/dist/essential-218/remarks.d.ts +2 -0
- package/dist/essential-218/remarks.d.ts.map +1 -0
- package/dist/essential-218/translations.d.ts +3 -0
- package/dist/essential-218/translations.d.ts.map +1 -0
- package/dist/essential-218/utils.d.ts +3 -0
- package/dist/essential-218/utils.d.ts.map +1 -0
- package/dist/essential-218-B3oYfd9D.js +4262 -0
- package/dist/essential-218-B3oYfd9D.js.map +1 -0
- package/dist/essential-218.js +2 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,4262 @@
|
|
|
1
|
+
//#region ../../shared/parallel-text-base/dist/essential-218.js
|
|
2
|
+
var e = [
|
|
3
|
+
{
|
|
4
|
+
id: 1,
|
|
5
|
+
text: "The sun shines."
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
id: 2,
|
|
9
|
+
text: "The sun is shining."
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: 3,
|
|
13
|
+
text: "The sun shone."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 4,
|
|
17
|
+
text: "The sun will shine."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 5,
|
|
21
|
+
text: "The sun has been shining."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 6,
|
|
25
|
+
text: "The sun is shining again."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 7,
|
|
29
|
+
text: "The sun will shine tomorrow."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 8,
|
|
33
|
+
text: "The sun shines brightly."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 9,
|
|
37
|
+
text: "The bright sun shines."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 10,
|
|
41
|
+
text: "The sun is rising now."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 11,
|
|
45
|
+
text: "All the people shouted."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 12,
|
|
49
|
+
text: "Some of the people shouted."
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 13,
|
|
53
|
+
text: "Many of the people shouted twice."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 14,
|
|
57
|
+
text: "Happy people often shout."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 15,
|
|
61
|
+
text: "The kitten jumped up."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 16,
|
|
65
|
+
text: "The kitten jumped onto the table."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 17,
|
|
69
|
+
text: "My little kitten walked away."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 18,
|
|
73
|
+
text: "It's raining."
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 19,
|
|
77
|
+
text: "The rain came down."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 20,
|
|
81
|
+
text: "The kitten is playing in the rain."
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 21,
|
|
85
|
+
text: "The rain has stopped."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 22,
|
|
89
|
+
text: "Soon the rain will stop."
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 23,
|
|
93
|
+
text: "I hope the rain stops soon."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 24,
|
|
97
|
+
text: "Once wild animals lived here."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 25,
|
|
101
|
+
text: "Slowly she looked around."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 26,
|
|
105
|
+
text: "Go away!"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: 27,
|
|
109
|
+
text: "Let's go!"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: 28,
|
|
113
|
+
text: "You should go."
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 29,
|
|
117
|
+
text: "I will be happy to go."
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 30,
|
|
121
|
+
text: "He will arrive soon."
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: 31,
|
|
125
|
+
text: "The baby's ball has rolled away."
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 32,
|
|
129
|
+
text: "The two boys are working together."
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: 33,
|
|
133
|
+
text: "This mist will probably clear away."
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 34,
|
|
137
|
+
text: "Lovely flowers are growing everywhere."
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 35,
|
|
141
|
+
text: "We should eat more slowly."
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: 36,
|
|
145
|
+
text: "You have come too soon."
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: 37,
|
|
149
|
+
text: "You must write more neatly."
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: 38,
|
|
153
|
+
text: "Directly opposite stands a wonderful palace."
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 39,
|
|
157
|
+
text: "Henry's dog is lost."
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: 40,
|
|
161
|
+
text: "My cat is black."
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: 41,
|
|
165
|
+
text: "The little girl's doll is broken."
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: 42,
|
|
169
|
+
text: "I usually sleep soundly."
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
id: 43,
|
|
173
|
+
text: "The children ran after Jack."
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: 44,
|
|
177
|
+
text: "I can play after school."
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: 45,
|
|
181
|
+
text: "We went to the village for a visit."
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: 46,
|
|
185
|
+
text: "We arrived at the river."
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: 47,
|
|
189
|
+
text: "I have been waiting for you."
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: 48,
|
|
193
|
+
text: "The campers sat around the fire."
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
id: 49,
|
|
197
|
+
text: "A little girl with a kitten sat near me."
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: 50,
|
|
201
|
+
text: "The child waited at the door for her father."
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: 51,
|
|
205
|
+
text: "Yesterday the oldest girl in the village lost her kitten."
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: 52,
|
|
209
|
+
text: "Were you born in this village?"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
id: 53,
|
|
213
|
+
text: "Can your brother dance well?"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: 54,
|
|
217
|
+
text: "Did the man leave?"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: 55,
|
|
221
|
+
text: "Is your sister coming for you?"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: 56,
|
|
225
|
+
text: "Can you come tomorrow?"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: 57,
|
|
229
|
+
text: "Have the neighbors gone away for the winter?"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: 58,
|
|
233
|
+
text: "Does the robin sing in the rain?"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: 59,
|
|
237
|
+
text: "Are you going with us to the concert?"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
id: 60,
|
|
241
|
+
text: "Have you ever travelled in the jungle?"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
id: 61,
|
|
245
|
+
text: "We sailed down the river for several miles."
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
id: 62,
|
|
249
|
+
text: "Everybody knows about hunting."
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
id: 63,
|
|
253
|
+
text: "On a Sunny morning after the solstice we started for the mountains."
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: 64,
|
|
257
|
+
text: "Tom laughed at the monkey's tricks."
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
id: 65,
|
|
261
|
+
text: "An old man with a walking stick stood beside the fence."
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
id: 66,
|
|
265
|
+
text: "The squirrel's nest was hidden by drooping boughs."
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: 67,
|
|
269
|
+
text: "The little seeds waited patiently under the snow for the warm spring sun."
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
id: 68,
|
|
273
|
+
text: "Many little girls with wreaths of flowers on their heads danced around the bonfire."
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
id: 69,
|
|
277
|
+
text: "The cover of the basket fell to the floor."
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
id: 70,
|
|
281
|
+
text: "The first boy in the line stopped at the entrance."
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
id: 71,
|
|
285
|
+
text: "On the top of the hill in a little hut lived a wise old woman."
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: 72,
|
|
289
|
+
text: "During our residence in the country we often walked in the pastures."
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
id: 73,
|
|
293
|
+
text: "When will your guests from the city arrive?"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
id: 74,
|
|
297
|
+
text: "Near the mouth of the river, its course turns sharply towards the East."
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
id: 75,
|
|
301
|
+
text: "Between the two lofty mountains lay a fertile valley."
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
id: 76,
|
|
305
|
+
text: "Among the wheat grew tall red poppies."
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
id: 77,
|
|
309
|
+
text: "The strong roots of the oak trees were torn from the ground."
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
id: 78,
|
|
313
|
+
text: "The sun looked down through the branches upon the children at play."
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: 79,
|
|
317
|
+
text: "The west wind blew across my face like a friendly caress."
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
id: 80,
|
|
321
|
+
text: "The spool of thread rolled across the floor."
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
id: 81,
|
|
325
|
+
text: "A box of growing plants stood in the Window."
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
id: 82,
|
|
329
|
+
text: "I am very happy."
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
id: 83,
|
|
333
|
+
text: "These oranges are juicy."
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
id: 84,
|
|
337
|
+
text: "Sea water is salty."
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
id: 85,
|
|
341
|
+
text: "The streets are full of people."
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: 86,
|
|
345
|
+
text: "Sugar tastes sweet."
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
id: 87,
|
|
349
|
+
text: "The fire feels hot."
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
id: 88,
|
|
353
|
+
text: "The little girl seemed lonely."
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
id: 89,
|
|
357
|
+
text: "The little boy's father had once been a sailor."
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
id: 90,
|
|
361
|
+
text: "I have lost my blanket."
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
id: 91,
|
|
365
|
+
text: "A robin has built his nest in the apple tree."
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
id: 92,
|
|
369
|
+
text: "At noon we ate our lunch by the roadside."
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
id: 93,
|
|
373
|
+
text: "Mr. Jones made a knife for his little boy."
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
id: 94,
|
|
377
|
+
text: "Their voices sound very happy."
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
id: 95,
|
|
381
|
+
text: "Is today Monday?"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
id: 96,
|
|
385
|
+
text: "Have all the leaves fallen from the tree?"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
id: 97,
|
|
389
|
+
text: "Will you be ready on time?"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
id: 98,
|
|
393
|
+
text: "Will you send this message for me?"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
id: 99,
|
|
397
|
+
text: "Are you waiting for me?"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
id: 100,
|
|
401
|
+
text: "Is this the first kitten of the litter?"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
id: 101,
|
|
405
|
+
text: "Are these shoes too big for you?"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
id: 102,
|
|
409
|
+
text: "How wide is the River?"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
id: 103,
|
|
413
|
+
text: "Listen."
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
id: 104,
|
|
417
|
+
text: "Sit here by me."
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
id: 105,
|
|
421
|
+
text: "Keep this secret until tomorrow."
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
id: 106,
|
|
425
|
+
text: "Come with us."
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
id: 107,
|
|
429
|
+
text: "Bring your friends with you."
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
id: 108,
|
|
433
|
+
text: "Be careful."
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
id: 109,
|
|
437
|
+
text: "Have some tea."
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
id: 110,
|
|
441
|
+
text: "Pip and his dog were great friends."
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
id: 111,
|
|
445
|
+
text: "John and Elizabeth are brother and sister."
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
id: 112,
|
|
449
|
+
text: "You and I will go together."
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
id: 113,
|
|
453
|
+
text: "They opened all the doors and windows."
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
id: 114,
|
|
457
|
+
text: "He is small, but strong."
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
id: 115,
|
|
461
|
+
text: "Is this tree an oak or a maple?"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
id: 116,
|
|
465
|
+
text: "Does the sky look blue or gray?"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
id: 117,
|
|
469
|
+
text: "Come with your father or mother."
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
id: 118,
|
|
473
|
+
text: "I am tired, but very happy."
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
id: 119,
|
|
477
|
+
text: "He played a tune on his wonderful flute."
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
id: 120,
|
|
481
|
+
text: "Toward the end of August the days grow much shorter."
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
id: 121,
|
|
485
|
+
text: "A company of soldiers marched over the hill and across the meadow."
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
id: 122,
|
|
489
|
+
text: "The first part of the story is very interesting."
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
id: 123,
|
|
493
|
+
text: "The crow dropped some pebbles into the pitcher and raised the water to the brim."
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
id: 124,
|
|
497
|
+
text: "The baby clapped her hands and laughed in glee."
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
id: 125,
|
|
501
|
+
text: "Stop your game and be quiet."
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
id: 126,
|
|
505
|
+
text: "The sound of the drums grew louder and louder."
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
id: 127,
|
|
509
|
+
text: "Do you like summer or winter better?"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
id: 128,
|
|
513
|
+
text: "That boy will have a wonderful trip."
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
id: 129,
|
|
517
|
+
text: "They popped corn, and then sat around the fire and ate it."
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
id: 130,
|
|
521
|
+
text: "They won the first two games, but lost the last one."
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
id: 131,
|
|
525
|
+
text: "Take this note, carry it to your mother; and wait for an answer."
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
id: 132,
|
|
529
|
+
text: "I awoke early, dressed hastily, and went down to breakfast."
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
id: 133,
|
|
533
|
+
text: "Aha! I have caught you!"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
id: 134,
|
|
537
|
+
text: "This string is too short!"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
id: 135,
|
|
541
|
+
text: "Oh, dear! the wind has blown my hat away!"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
id: 136,
|
|
545
|
+
text: "Alas! that news is sad indeed!"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
id: 137,
|
|
549
|
+
text: "Whew! that cold wind freezes my nose!"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
id: 138,
|
|
553
|
+
text: "Are you warm enough now?"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
id: 139,
|
|
557
|
+
text: "They heard the warning too late."
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
id: 140,
|
|
561
|
+
text: "We are a brave people, and love our country."
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
id: 141,
|
|
565
|
+
text: "All the children came except Mary."
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
id: 142,
|
|
569
|
+
text: "Jack seized a handful of pebbles and threw them into the lake."
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
id: 143,
|
|
573
|
+
text: "This cottage stood on a low hill, at some distance from the village."
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
id: 144,
|
|
577
|
+
text: "On a fine summer evening, the two old people were sitting outside the door of their cottage."
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
id: 145,
|
|
581
|
+
text: "Our bird's name is Jacko."
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
id: 146,
|
|
585
|
+
text: "The river knows the way to the sea."
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
id: 147,
|
|
589
|
+
text: "The boat sails away, like a bird on the wing."
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
id: 148,
|
|
593
|
+
text: "They looked cautiously about, but saw nothing."
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
id: 149,
|
|
597
|
+
text: "The little house had three rooms, a sitting room, a bedroom, and a tiny kitchen."
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
id: 150,
|
|
601
|
+
text: "We visited my uncle's village, the largest village in the world."
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
id: 151,
|
|
605
|
+
text: "We learn something new each day."
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
id: 152,
|
|
609
|
+
text: "The market begins five minutes earlier this week."
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
id: 153,
|
|
613
|
+
text: "Did you find the distance too great?"
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
id: 154,
|
|
617
|
+
text: "Hurry, children."
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
id: 155,
|
|
621
|
+
text: "Madam, I will obey your command."
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
id: 156,
|
|
625
|
+
text: "Here under this tree they gave their guests a splendid feast."
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
id: 157,
|
|
629
|
+
text: "In winter I get up at night, and dress by yellow candlelight."
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
id: 158,
|
|
633
|
+
text: "Tell the last part of that story again."
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
id: 159,
|
|
637
|
+
text: "Be quick or you will be too late."
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
id: 160,
|
|
641
|
+
text: "Will you go with us or wait here?"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
id: 161,
|
|
645
|
+
text: "She was always, shabby, often ragged, and on cold days very uncomfortable."
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
id: 162,
|
|
649
|
+
text: "Think first and then act."
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
id: 163,
|
|
653
|
+
text: "I stood, a little mite of a girl, upon a chair by the window, and watched the falling snowflakes."
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
id: 164,
|
|
657
|
+
text: "Show the guests these shells, my son, and tell them their strange history."
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
id: 165,
|
|
661
|
+
text: "Be satisfied with nothing but your best."
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
id: 166,
|
|
665
|
+
text: "We consider them our faithful friends."
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
id: 167,
|
|
669
|
+
text: "We will make this place our home."
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
id: 168,
|
|
673
|
+
text: "The squirrels make their nests warm and snug with soft moss and leaves."
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
id: 169,
|
|
677
|
+
text: "The little girl made the doll's dress herself."
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
id: 170,
|
|
681
|
+
text: "I hurt myself."
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
id: 171,
|
|
685
|
+
text: "She was talking to herself."
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
id: 172,
|
|
689
|
+
text: "He proved himself trustworthy."
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
id: 173,
|
|
693
|
+
text: "We could see ourselves in the water."
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
id: 174,
|
|
697
|
+
text: "Do it yourself."
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
id: 175,
|
|
701
|
+
text: "I feel ashamed of myself."
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
id: 176,
|
|
705
|
+
text: "Sit here by yourself."
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
id: 177,
|
|
709
|
+
text: "The dress of the little princess was embroidered with roses, the national flower of the Country."
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
id: 178,
|
|
713
|
+
text: "They wore red caps, the symbol of liberty."
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
id: 179,
|
|
717
|
+
text: "With him as our protector, we fear no danger."
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
id: 180,
|
|
721
|
+
text: "All her finery, lace, ribbons, and feathers, was packed away in a trunk."
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
id: 181,
|
|
725
|
+
text: "Light he thought her, like a feather."
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
id: 182,
|
|
729
|
+
text: "Every spring and fall our cousins pay us a long visit."
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
id: 183,
|
|
733
|
+
text: "In our climate the grass remains green all winter."
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
id: 184,
|
|
737
|
+
text: "The boy who brought the book has gone."
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
id: 185,
|
|
741
|
+
text: "These are the flowers that you ordered."
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
id: 186,
|
|
745
|
+
text: "I have lost the book that you gave me."
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
id: 187,
|
|
749
|
+
text: "The fisherman who owned the boat now demanded payment."
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
id: 188,
|
|
753
|
+
text: "Come when you are called."
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
id: 189,
|
|
757
|
+
text: "I shall stay at home if it rains."
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
id: 190,
|
|
761
|
+
text: "When he saw me, he stopped."
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
id: 191,
|
|
765
|
+
text: "Do not laugh at me because I seem so absent minded."
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
id: 192,
|
|
769
|
+
text: "I shall lend you the books that you need."
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
id: 193,
|
|
773
|
+
text: "Come early next Monday if you can."
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
id: 194,
|
|
777
|
+
text: "If you come early, wait in the hall."
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
id: 195,
|
|
781
|
+
text: "I had a younger brother whose name was Antonio."
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
id: 196,
|
|
785
|
+
text: "Gnomes are little men who live under the ground."
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
id: 197,
|
|
789
|
+
text: "He is loved by everybody, because he has a gentle disposition."
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
id: 198,
|
|
793
|
+
text: "Hold the horse while I run and get my cap."
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
id: 199,
|
|
797
|
+
text: "I have found the ring I lost."
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
id: 200,
|
|
801
|
+
text: "Play and I will sing."
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
id: 201,
|
|
805
|
+
text: "That is the funniest story I ever heard."
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
id: 202,
|
|
809
|
+
text: "She is taller than her brother."
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
id: 203,
|
|
813
|
+
text: "They are no wiser than we."
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
id: 204,
|
|
817
|
+
text: "Light travels faster than sound."
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
id: 205,
|
|
821
|
+
text: "We have more time than they."
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
id: 206,
|
|
825
|
+
text: "She has more friends than enemies."
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
id: 207,
|
|
829
|
+
text: "He was very poor, and with his wife and five children lived in a little low cabin of logs and stones."
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
id: 208,
|
|
833
|
+
text: "When the wind blew, the traveler wrapped his mantle more closely around him."
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
id: 209,
|
|
837
|
+
text: "I am sure that we can go."
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
id: 210,
|
|
841
|
+
text: "We went back to the place where we saw the roses."
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
id: 211,
|
|
845
|
+
text: "\"This tree is fifty feet high,\" said the gardener."
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
id: 212,
|
|
849
|
+
text: "I think that this train leaves five minutes earlier today."
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
id: 213,
|
|
853
|
+
text: "My opinion is that the governor will grant him a pardon."
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
id: 214,
|
|
857
|
+
text: "Why he has left the city is a mystery."
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
id: 215,
|
|
861
|
+
text: "The house stands where three roads meet."
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
id: 216,
|
|
865
|
+
text: "He has far more money than brains."
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
id: 217,
|
|
869
|
+
text: "Evidently that gate is never opened, for the long grass and the great hemlocks grow close against it."
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
id: 218,
|
|
873
|
+
text: "I met a little cottage girl; she was eight years old, she said."
|
|
874
|
+
}
|
|
875
|
+
];
|
|
876
|
+
//#endregion
|
|
877
|
+
//#region ../../shared/parallel-text-base/dist/parallel-document-CzdnXsEM.js
|
|
878
|
+
function t(e) {
|
|
879
|
+
let { originalText: t, lang: n, script: r, children: i = [], transcription: a, extras: o } = e;
|
|
880
|
+
return {
|
|
881
|
+
type: "SentenceNode",
|
|
882
|
+
originalText: t,
|
|
883
|
+
lang: n,
|
|
884
|
+
script: r,
|
|
885
|
+
transcription: a,
|
|
886
|
+
children: i,
|
|
887
|
+
extras: o
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
function n(e = [], t) {
|
|
891
|
+
return {
|
|
892
|
+
type: "ParagraphNode",
|
|
893
|
+
children: e,
|
|
894
|
+
position: void 0,
|
|
895
|
+
extras: t
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
function r(e) {
|
|
899
|
+
let { lang: t, script: n, children: r = [], metadata: i, extras: a } = e;
|
|
900
|
+
return {
|
|
901
|
+
type: "RootNode",
|
|
902
|
+
lang: t,
|
|
903
|
+
script: n,
|
|
904
|
+
metadata: i,
|
|
905
|
+
children: r,
|
|
906
|
+
position: void 0,
|
|
907
|
+
extras: a
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
var i;
|
|
911
|
+
(function(e) {
|
|
912
|
+
e.assertEqual = (e) => {};
|
|
913
|
+
function t(e) {}
|
|
914
|
+
e.assertIs = t;
|
|
915
|
+
function n(e) {
|
|
916
|
+
throw Error();
|
|
917
|
+
}
|
|
918
|
+
e.assertNever = n, e.arrayToEnum = (e) => {
|
|
919
|
+
let t = {};
|
|
920
|
+
for (let n of e) t[n] = n;
|
|
921
|
+
return t;
|
|
922
|
+
}, e.getValidEnumValues = (t) => {
|
|
923
|
+
let n = e.objectKeys(t).filter((e) => typeof t[t[e]] != "number"), r = {};
|
|
924
|
+
for (let e of n) r[e] = t[e];
|
|
925
|
+
return e.objectValues(r);
|
|
926
|
+
}, e.objectValues = (t) => e.objectKeys(t).map(function(e) {
|
|
927
|
+
return t[e];
|
|
928
|
+
}), e.objectKeys = typeof Object.keys == "function" ? (e) => Object.keys(e) : (e) => {
|
|
929
|
+
let t = [];
|
|
930
|
+
for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && t.push(n);
|
|
931
|
+
return t;
|
|
932
|
+
}, e.find = (e, t) => {
|
|
933
|
+
for (let n of e) if (t(n)) return n;
|
|
934
|
+
}, e.isInteger = typeof Number.isInteger == "function" ? (e) => Number.isInteger(e) : (e) => typeof e == "number" && Number.isFinite(e) && Math.floor(e) === e;
|
|
935
|
+
function r(e, t = " | ") {
|
|
936
|
+
return e.map((e) => typeof e == "string" ? `'${e}'` : e).join(t);
|
|
937
|
+
}
|
|
938
|
+
e.joinValues = r, e.jsonStringifyReplacer = (e, t) => typeof t == "bigint" ? t.toString() : t;
|
|
939
|
+
})(i ||= {});
|
|
940
|
+
var a;
|
|
941
|
+
(function(e) {
|
|
942
|
+
e.mergeShapes = (e, t) => ({
|
|
943
|
+
...e,
|
|
944
|
+
...t
|
|
945
|
+
});
|
|
946
|
+
})(a ||= {});
|
|
947
|
+
var o = i.arrayToEnum([
|
|
948
|
+
"string",
|
|
949
|
+
"nan",
|
|
950
|
+
"number",
|
|
951
|
+
"integer",
|
|
952
|
+
"float",
|
|
953
|
+
"boolean",
|
|
954
|
+
"date",
|
|
955
|
+
"bigint",
|
|
956
|
+
"symbol",
|
|
957
|
+
"function",
|
|
958
|
+
"undefined",
|
|
959
|
+
"null",
|
|
960
|
+
"array",
|
|
961
|
+
"object",
|
|
962
|
+
"unknown",
|
|
963
|
+
"promise",
|
|
964
|
+
"void",
|
|
965
|
+
"never",
|
|
966
|
+
"map",
|
|
967
|
+
"set"
|
|
968
|
+
]), s = (e) => {
|
|
969
|
+
switch (typeof e) {
|
|
970
|
+
case "undefined": return o.undefined;
|
|
971
|
+
case "string": return o.string;
|
|
972
|
+
case "number": return Number.isNaN(e) ? o.nan : o.number;
|
|
973
|
+
case "boolean": return o.boolean;
|
|
974
|
+
case "function": return o.function;
|
|
975
|
+
case "bigint": return o.bigint;
|
|
976
|
+
case "symbol": return o.symbol;
|
|
977
|
+
case "object": return Array.isArray(e) ? o.array : e === null ? o.null : e.then && typeof e.then == "function" && e.catch && typeof e.catch == "function" ? o.promise : typeof Map < "u" && e instanceof Map ? o.map : typeof Set < "u" && e instanceof Set ? o.set : typeof Date < "u" && e instanceof Date ? o.date : o.object;
|
|
978
|
+
default: return o.unknown;
|
|
979
|
+
}
|
|
980
|
+
}, c = i.arrayToEnum([
|
|
981
|
+
"invalid_type",
|
|
982
|
+
"invalid_literal",
|
|
983
|
+
"custom",
|
|
984
|
+
"invalid_union",
|
|
985
|
+
"invalid_union_discriminator",
|
|
986
|
+
"invalid_enum_value",
|
|
987
|
+
"unrecognized_keys",
|
|
988
|
+
"invalid_arguments",
|
|
989
|
+
"invalid_return_type",
|
|
990
|
+
"invalid_date",
|
|
991
|
+
"invalid_string",
|
|
992
|
+
"too_small",
|
|
993
|
+
"too_big",
|
|
994
|
+
"invalid_intersection_types",
|
|
995
|
+
"not_multiple_of",
|
|
996
|
+
"not_finite"
|
|
997
|
+
]), l = class e extends Error {
|
|
998
|
+
get errors() {
|
|
999
|
+
return this.issues;
|
|
1000
|
+
}
|
|
1001
|
+
constructor(e) {
|
|
1002
|
+
super(), this.issues = [], this.addIssue = (e) => {
|
|
1003
|
+
this.issues = [...this.issues, e];
|
|
1004
|
+
}, this.addIssues = (e = []) => {
|
|
1005
|
+
this.issues = [...this.issues, ...e];
|
|
1006
|
+
};
|
|
1007
|
+
let t = new.target.prototype;
|
|
1008
|
+
Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
|
|
1009
|
+
}
|
|
1010
|
+
format(e) {
|
|
1011
|
+
let t = e || function(e) {
|
|
1012
|
+
return e.message;
|
|
1013
|
+
}, n = { _errors: [] }, r = (e) => {
|
|
1014
|
+
for (let i of e.issues) if (i.code === "invalid_union") i.unionErrors.map(r);
|
|
1015
|
+
else if (i.code === "invalid_return_type") r(i.returnTypeError);
|
|
1016
|
+
else if (i.code === "invalid_arguments") r(i.argumentsError);
|
|
1017
|
+
else if (i.path.length === 0) n._errors.push(t(i));
|
|
1018
|
+
else {
|
|
1019
|
+
let e = n, r = 0;
|
|
1020
|
+
for (; r < i.path.length;) {
|
|
1021
|
+
let n = i.path[r];
|
|
1022
|
+
r === i.path.length - 1 ? (e[n] = e[n] || { _errors: [] }, e[n]._errors.push(t(i))) : e[n] = e[n] || { _errors: [] }, e = e[n], r++;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
return r(this), n;
|
|
1027
|
+
}
|
|
1028
|
+
static assert(t) {
|
|
1029
|
+
if (!(t instanceof e)) throw Error(`Not a ZodError: ${t}`);
|
|
1030
|
+
}
|
|
1031
|
+
toString() {
|
|
1032
|
+
return this.message;
|
|
1033
|
+
}
|
|
1034
|
+
get message() {
|
|
1035
|
+
return JSON.stringify(this.issues, i.jsonStringifyReplacer, 2);
|
|
1036
|
+
}
|
|
1037
|
+
get isEmpty() {
|
|
1038
|
+
return this.issues.length === 0;
|
|
1039
|
+
}
|
|
1040
|
+
flatten(e = (e) => e.message) {
|
|
1041
|
+
let t = {}, n = [];
|
|
1042
|
+
for (let r of this.issues) if (r.path.length > 0) {
|
|
1043
|
+
let n = r.path[0];
|
|
1044
|
+
t[n] = t[n] || [], t[n].push(e(r));
|
|
1045
|
+
} else n.push(e(r));
|
|
1046
|
+
return {
|
|
1047
|
+
formErrors: n,
|
|
1048
|
+
fieldErrors: t
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
get formErrors() {
|
|
1052
|
+
return this.flatten();
|
|
1053
|
+
}
|
|
1054
|
+
};
|
|
1055
|
+
l.create = (e) => new l(e);
|
|
1056
|
+
var u = (e, t) => {
|
|
1057
|
+
let n;
|
|
1058
|
+
switch (e.code) {
|
|
1059
|
+
case c.invalid_type:
|
|
1060
|
+
n = e.received === o.undefined ? "Required" : `Expected ${e.expected}, received ${e.received}`;
|
|
1061
|
+
break;
|
|
1062
|
+
case c.invalid_literal:
|
|
1063
|
+
n = `Invalid literal value, expected ${JSON.stringify(e.expected, i.jsonStringifyReplacer)}`;
|
|
1064
|
+
break;
|
|
1065
|
+
case c.unrecognized_keys:
|
|
1066
|
+
n = `Unrecognized key(s) in object: ${i.joinValues(e.keys, ", ")}`;
|
|
1067
|
+
break;
|
|
1068
|
+
case c.invalid_union:
|
|
1069
|
+
n = "Invalid input";
|
|
1070
|
+
break;
|
|
1071
|
+
case c.invalid_union_discriminator:
|
|
1072
|
+
n = `Invalid discriminator value. Expected ${i.joinValues(e.options)}`;
|
|
1073
|
+
break;
|
|
1074
|
+
case c.invalid_enum_value:
|
|
1075
|
+
n = `Invalid enum value. Expected ${i.joinValues(e.options)}, received '${e.received}'`;
|
|
1076
|
+
break;
|
|
1077
|
+
case c.invalid_arguments:
|
|
1078
|
+
n = "Invalid function arguments";
|
|
1079
|
+
break;
|
|
1080
|
+
case c.invalid_return_type:
|
|
1081
|
+
n = "Invalid function return type";
|
|
1082
|
+
break;
|
|
1083
|
+
case c.invalid_date:
|
|
1084
|
+
n = "Invalid date";
|
|
1085
|
+
break;
|
|
1086
|
+
case c.invalid_string:
|
|
1087
|
+
typeof e.validation == "object" ? "includes" in e.validation ? (n = `Invalid input: must include "${e.validation.includes}"`, typeof e.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${e.validation.position}`)) : "startsWith" in e.validation ? n = `Invalid input: must start with "${e.validation.startsWith}"` : "endsWith" in e.validation ? n = `Invalid input: must end with "${e.validation.endsWith}"` : i.assertNever(e.validation) : n = e.validation === "regex" ? "Invalid" : `Invalid ${e.validation}`;
|
|
1088
|
+
break;
|
|
1089
|
+
case c.too_small:
|
|
1090
|
+
n = e.type === "array" ? `Array must contain ${e.exact ? "exactly" : e.inclusive ? "at least" : "more than"} ${e.minimum} element(s)` : e.type === "string" ? `String must contain ${e.exact ? "exactly" : e.inclusive ? "at least" : "over"} ${e.minimum} character(s)` : e.type === "number" || e.type === "bigint" ? `Number must be ${e.exact ? "exactly equal to " : e.inclusive ? "greater than or equal to " : "greater than "}${e.minimum}` : e.type === "date" ? `Date must be ${e.exact ? "exactly equal to " : e.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(e.minimum))}` : "Invalid input";
|
|
1091
|
+
break;
|
|
1092
|
+
case c.too_big:
|
|
1093
|
+
n = e.type === "array" ? `Array must contain ${e.exact ? "exactly" : e.inclusive ? "at most" : "less than"} ${e.maximum} element(s)` : e.type === "string" ? `String must contain ${e.exact ? "exactly" : e.inclusive ? "at most" : "under"} ${e.maximum} character(s)` : e.type === "number" ? `Number must be ${e.exact ? "exactly" : e.inclusive ? "less than or equal to" : "less than"} ${e.maximum}` : e.type === "bigint" ? `BigInt must be ${e.exact ? "exactly" : e.inclusive ? "less than or equal to" : "less than"} ${e.maximum}` : e.type === "date" ? `Date must be ${e.exact ? "exactly" : e.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(e.maximum))}` : "Invalid input";
|
|
1094
|
+
break;
|
|
1095
|
+
case c.custom:
|
|
1096
|
+
n = "Invalid input";
|
|
1097
|
+
break;
|
|
1098
|
+
case c.invalid_intersection_types:
|
|
1099
|
+
n = "Intersection results could not be merged";
|
|
1100
|
+
break;
|
|
1101
|
+
case c.not_multiple_of:
|
|
1102
|
+
n = `Number must be a multiple of ${e.multipleOf}`;
|
|
1103
|
+
break;
|
|
1104
|
+
case c.not_finite:
|
|
1105
|
+
n = "Number must be finite";
|
|
1106
|
+
break;
|
|
1107
|
+
default: n = t.defaultError, i.assertNever(e);
|
|
1108
|
+
}
|
|
1109
|
+
return { message: n };
|
|
1110
|
+
}, ee = u;
|
|
1111
|
+
function te() {
|
|
1112
|
+
return ee;
|
|
1113
|
+
}
|
|
1114
|
+
var ne = (e) => {
|
|
1115
|
+
let { data: t, path: n, errorMaps: r, issueData: i } = e, a = [...n, ...i.path || []], o = {
|
|
1116
|
+
...i,
|
|
1117
|
+
path: a
|
|
1118
|
+
};
|
|
1119
|
+
if (i.message !== void 0) return {
|
|
1120
|
+
...i,
|
|
1121
|
+
path: a,
|
|
1122
|
+
message: i.message
|
|
1123
|
+
};
|
|
1124
|
+
let s = "", c = r.filter((e) => !!e).slice().reverse();
|
|
1125
|
+
for (let e of c) s = e(o, {
|
|
1126
|
+
data: t,
|
|
1127
|
+
defaultError: s
|
|
1128
|
+
}).message;
|
|
1129
|
+
return {
|
|
1130
|
+
...i,
|
|
1131
|
+
path: a,
|
|
1132
|
+
message: s
|
|
1133
|
+
};
|
|
1134
|
+
};
|
|
1135
|
+
function d(e, t) {
|
|
1136
|
+
let n = te(), r = ne({
|
|
1137
|
+
issueData: t,
|
|
1138
|
+
data: e.data,
|
|
1139
|
+
path: e.path,
|
|
1140
|
+
errorMaps: [
|
|
1141
|
+
e.common.contextualErrorMap,
|
|
1142
|
+
e.schemaErrorMap,
|
|
1143
|
+
n,
|
|
1144
|
+
n === u ? void 0 : u
|
|
1145
|
+
].filter((e) => !!e)
|
|
1146
|
+
});
|
|
1147
|
+
e.common.issues.push(r);
|
|
1148
|
+
}
|
|
1149
|
+
var f = class e {
|
|
1150
|
+
constructor() {
|
|
1151
|
+
this.value = "valid";
|
|
1152
|
+
}
|
|
1153
|
+
dirty() {
|
|
1154
|
+
this.value === "valid" && (this.value = "dirty");
|
|
1155
|
+
}
|
|
1156
|
+
abort() {
|
|
1157
|
+
this.value !== "aborted" && (this.value = "aborted");
|
|
1158
|
+
}
|
|
1159
|
+
static mergeArray(e, t) {
|
|
1160
|
+
let n = [];
|
|
1161
|
+
for (let r of t) {
|
|
1162
|
+
if (r.status === "aborted") return p;
|
|
1163
|
+
r.status === "dirty" && e.dirty(), n.push(r.value);
|
|
1164
|
+
}
|
|
1165
|
+
return {
|
|
1166
|
+
status: e.value,
|
|
1167
|
+
value: n
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1170
|
+
static async mergeObjectAsync(t, n) {
|
|
1171
|
+
let r = [];
|
|
1172
|
+
for (let e of n) {
|
|
1173
|
+
let t = await e.key, n = await e.value;
|
|
1174
|
+
r.push({
|
|
1175
|
+
key: t,
|
|
1176
|
+
value: n
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
return e.mergeObjectSync(t, r);
|
|
1180
|
+
}
|
|
1181
|
+
static mergeObjectSync(e, t) {
|
|
1182
|
+
let n = {};
|
|
1183
|
+
for (let r of t) {
|
|
1184
|
+
let { key: t, value: i } = r;
|
|
1185
|
+
if (t.status === "aborted" || i.status === "aborted") return p;
|
|
1186
|
+
t.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), t.value !== "__proto__" && (i.value !== void 0 || r.alwaysSet) && (n[t.value] = i.value);
|
|
1187
|
+
}
|
|
1188
|
+
return {
|
|
1189
|
+
status: e.value,
|
|
1190
|
+
value: n
|
|
1191
|
+
};
|
|
1192
|
+
}
|
|
1193
|
+
}, p = Object.freeze({ status: "aborted" }), re = (e) => ({
|
|
1194
|
+
status: "dirty",
|
|
1195
|
+
value: e
|
|
1196
|
+
}), m = (e) => ({
|
|
1197
|
+
status: "valid",
|
|
1198
|
+
value: e
|
|
1199
|
+
}), ie = (e) => e.status === "aborted", ae = (e) => e.status === "dirty", h = (e) => e.status === "valid", g = (e) => typeof Promise < "u" && e instanceof Promise, _;
|
|
1200
|
+
(function(e) {
|
|
1201
|
+
e.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, e.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
1202
|
+
})(_ ||= {});
|
|
1203
|
+
var v = class {
|
|
1204
|
+
constructor(e, t, n, r) {
|
|
1205
|
+
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
|
|
1206
|
+
}
|
|
1207
|
+
get path() {
|
|
1208
|
+
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
1209
|
+
}
|
|
1210
|
+
}, oe = (e, t) => {
|
|
1211
|
+
if (h(t)) return {
|
|
1212
|
+
success: !0,
|
|
1213
|
+
data: t.value
|
|
1214
|
+
};
|
|
1215
|
+
if (!e.common.issues.length) throw Error("Validation failed but no issues detected.");
|
|
1216
|
+
return {
|
|
1217
|
+
success: !1,
|
|
1218
|
+
get error() {
|
|
1219
|
+
return this._error ||= new l(e.common.issues), this._error;
|
|
1220
|
+
}
|
|
1221
|
+
};
|
|
1222
|
+
};
|
|
1223
|
+
function y(e) {
|
|
1224
|
+
if (!e) return {};
|
|
1225
|
+
let { errorMap: t, invalid_type_error: n, required_error: r, description: i } = e;
|
|
1226
|
+
if (t && (n || r)) throw Error("Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.");
|
|
1227
|
+
return t ? {
|
|
1228
|
+
errorMap: t,
|
|
1229
|
+
description: i
|
|
1230
|
+
} : {
|
|
1231
|
+
errorMap: (t, i) => {
|
|
1232
|
+
let { message: a } = e;
|
|
1233
|
+
return t.code === "invalid_enum_value" ? { message: a ?? i.defaultError } : i.data === void 0 ? { message: a ?? r ?? i.defaultError } : t.code === "invalid_type" ? { message: a ?? n ?? i.defaultError } : { message: i.defaultError };
|
|
1234
|
+
},
|
|
1235
|
+
description: i
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
var b = class {
|
|
1239
|
+
get description() {
|
|
1240
|
+
return this._def.description;
|
|
1241
|
+
}
|
|
1242
|
+
_getType(e) {
|
|
1243
|
+
return s(e.data);
|
|
1244
|
+
}
|
|
1245
|
+
_getOrReturnCtx(e, t) {
|
|
1246
|
+
return t || {
|
|
1247
|
+
common: e.parent.common,
|
|
1248
|
+
data: e.data,
|
|
1249
|
+
parsedType: s(e.data),
|
|
1250
|
+
schemaErrorMap: this._def.errorMap,
|
|
1251
|
+
path: e.path,
|
|
1252
|
+
parent: e.parent
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
_processInputParams(e) {
|
|
1256
|
+
return {
|
|
1257
|
+
status: new f(),
|
|
1258
|
+
ctx: {
|
|
1259
|
+
common: e.parent.common,
|
|
1260
|
+
data: e.data,
|
|
1261
|
+
parsedType: s(e.data),
|
|
1262
|
+
schemaErrorMap: this._def.errorMap,
|
|
1263
|
+
path: e.path,
|
|
1264
|
+
parent: e.parent
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
_parseSync(e) {
|
|
1269
|
+
let t = this._parse(e);
|
|
1270
|
+
if (g(t)) throw Error("Synchronous parse encountered promise.");
|
|
1271
|
+
return t;
|
|
1272
|
+
}
|
|
1273
|
+
_parseAsync(e) {
|
|
1274
|
+
let t = this._parse(e);
|
|
1275
|
+
return Promise.resolve(t);
|
|
1276
|
+
}
|
|
1277
|
+
parse(e, t) {
|
|
1278
|
+
let n = this.safeParse(e, t);
|
|
1279
|
+
if (n.success) return n.data;
|
|
1280
|
+
throw n.error;
|
|
1281
|
+
}
|
|
1282
|
+
safeParse(e, t) {
|
|
1283
|
+
let n = {
|
|
1284
|
+
common: {
|
|
1285
|
+
issues: [],
|
|
1286
|
+
async: t?.async ?? !1,
|
|
1287
|
+
contextualErrorMap: t?.errorMap
|
|
1288
|
+
},
|
|
1289
|
+
path: t?.path || [],
|
|
1290
|
+
schemaErrorMap: this._def.errorMap,
|
|
1291
|
+
parent: null,
|
|
1292
|
+
data: e,
|
|
1293
|
+
parsedType: s(e)
|
|
1294
|
+
};
|
|
1295
|
+
return oe(n, this._parseSync({
|
|
1296
|
+
data: e,
|
|
1297
|
+
path: n.path,
|
|
1298
|
+
parent: n
|
|
1299
|
+
}));
|
|
1300
|
+
}
|
|
1301
|
+
"~validate"(e) {
|
|
1302
|
+
let t = {
|
|
1303
|
+
common: {
|
|
1304
|
+
issues: [],
|
|
1305
|
+
async: !!this["~standard"].async
|
|
1306
|
+
},
|
|
1307
|
+
path: [],
|
|
1308
|
+
schemaErrorMap: this._def.errorMap,
|
|
1309
|
+
parent: null,
|
|
1310
|
+
data: e,
|
|
1311
|
+
parsedType: s(e)
|
|
1312
|
+
};
|
|
1313
|
+
if (!this["~standard"].async) try {
|
|
1314
|
+
let n = this._parseSync({
|
|
1315
|
+
data: e,
|
|
1316
|
+
path: [],
|
|
1317
|
+
parent: t
|
|
1318
|
+
});
|
|
1319
|
+
return h(n) ? { value: n.value } : { issues: t.common.issues };
|
|
1320
|
+
} catch (e) {
|
|
1321
|
+
e?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
|
|
1322
|
+
issues: [],
|
|
1323
|
+
async: !0
|
|
1324
|
+
};
|
|
1325
|
+
}
|
|
1326
|
+
return this._parseAsync({
|
|
1327
|
+
data: e,
|
|
1328
|
+
path: [],
|
|
1329
|
+
parent: t
|
|
1330
|
+
}).then((e) => h(e) ? { value: e.value } : { issues: t.common.issues });
|
|
1331
|
+
}
|
|
1332
|
+
async parseAsync(e, t) {
|
|
1333
|
+
let n = await this.safeParseAsync(e, t);
|
|
1334
|
+
if (n.success) return n.data;
|
|
1335
|
+
throw n.error;
|
|
1336
|
+
}
|
|
1337
|
+
async safeParseAsync(e, t) {
|
|
1338
|
+
let n = {
|
|
1339
|
+
common: {
|
|
1340
|
+
issues: [],
|
|
1341
|
+
contextualErrorMap: t?.errorMap,
|
|
1342
|
+
async: !0
|
|
1343
|
+
},
|
|
1344
|
+
path: t?.path || [],
|
|
1345
|
+
schemaErrorMap: this._def.errorMap,
|
|
1346
|
+
parent: null,
|
|
1347
|
+
data: e,
|
|
1348
|
+
parsedType: s(e)
|
|
1349
|
+
}, r = this._parse({
|
|
1350
|
+
data: e,
|
|
1351
|
+
path: n.path,
|
|
1352
|
+
parent: n
|
|
1353
|
+
});
|
|
1354
|
+
return oe(n, await (g(r) ? r : Promise.resolve(r)));
|
|
1355
|
+
}
|
|
1356
|
+
refine(e, t) {
|
|
1357
|
+
let n = (e) => typeof t == "string" || t === void 0 ? { message: t } : typeof t == "function" ? t(e) : t;
|
|
1358
|
+
return this._refinement((t, r) => {
|
|
1359
|
+
let i = e(t), a = () => r.addIssue({
|
|
1360
|
+
code: c.custom,
|
|
1361
|
+
...n(t)
|
|
1362
|
+
});
|
|
1363
|
+
return typeof Promise < "u" && i instanceof Promise ? i.then((e) => e ? !0 : (a(), !1)) : i ? !0 : (a(), !1);
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
refinement(e, t) {
|
|
1367
|
+
return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
|
|
1368
|
+
}
|
|
1369
|
+
_refinement(e) {
|
|
1370
|
+
return new R({
|
|
1371
|
+
schema: this,
|
|
1372
|
+
typeName: W.ZodEffects,
|
|
1373
|
+
effect: {
|
|
1374
|
+
type: "refinement",
|
|
1375
|
+
refinement: e
|
|
1376
|
+
}
|
|
1377
|
+
});
|
|
1378
|
+
}
|
|
1379
|
+
superRefine(e) {
|
|
1380
|
+
return this._refinement(e);
|
|
1381
|
+
}
|
|
1382
|
+
constructor(e) {
|
|
1383
|
+
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
|
|
1384
|
+
version: 1,
|
|
1385
|
+
vendor: "zod",
|
|
1386
|
+
validate: (e) => this["~validate"](e)
|
|
1387
|
+
};
|
|
1388
|
+
}
|
|
1389
|
+
optional() {
|
|
1390
|
+
return z.create(this, this._def);
|
|
1391
|
+
}
|
|
1392
|
+
nullable() {
|
|
1393
|
+
return B.create(this, this._def);
|
|
1394
|
+
}
|
|
1395
|
+
nullish() {
|
|
1396
|
+
return this.nullable().optional();
|
|
1397
|
+
}
|
|
1398
|
+
array() {
|
|
1399
|
+
return E.create(this);
|
|
1400
|
+
}
|
|
1401
|
+
promise() {
|
|
1402
|
+
return L.create(this, this._def);
|
|
1403
|
+
}
|
|
1404
|
+
or(e) {
|
|
1405
|
+
return k.create([this, e], this._def);
|
|
1406
|
+
}
|
|
1407
|
+
and(e) {
|
|
1408
|
+
return j.create(this, e, this._def);
|
|
1409
|
+
}
|
|
1410
|
+
transform(e) {
|
|
1411
|
+
return new R({
|
|
1412
|
+
...y(this._def),
|
|
1413
|
+
schema: this,
|
|
1414
|
+
typeName: W.ZodEffects,
|
|
1415
|
+
effect: {
|
|
1416
|
+
type: "transform",
|
|
1417
|
+
transform: e
|
|
1418
|
+
}
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1421
|
+
default(e) {
|
|
1422
|
+
let t = typeof e == "function" ? e : () => e;
|
|
1423
|
+
return new V({
|
|
1424
|
+
...y(this._def),
|
|
1425
|
+
innerType: this,
|
|
1426
|
+
defaultValue: t,
|
|
1427
|
+
typeName: W.ZodDefault
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
brand() {
|
|
1431
|
+
return new qe({
|
|
1432
|
+
typeName: W.ZodBranded,
|
|
1433
|
+
type: this,
|
|
1434
|
+
...y(this._def)
|
|
1435
|
+
});
|
|
1436
|
+
}
|
|
1437
|
+
catch(e) {
|
|
1438
|
+
let t = typeof e == "function" ? e : () => e;
|
|
1439
|
+
return new H({
|
|
1440
|
+
...y(this._def),
|
|
1441
|
+
innerType: this,
|
|
1442
|
+
catchValue: t,
|
|
1443
|
+
typeName: W.ZodCatch
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
describe(e) {
|
|
1447
|
+
let t = this.constructor;
|
|
1448
|
+
return new t({
|
|
1449
|
+
...this._def,
|
|
1450
|
+
description: e
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
pipe(e) {
|
|
1454
|
+
return Je.create(this, e);
|
|
1455
|
+
}
|
|
1456
|
+
readonly() {
|
|
1457
|
+
return U.create(this);
|
|
1458
|
+
}
|
|
1459
|
+
isOptional() {
|
|
1460
|
+
return this.safeParse(void 0).success;
|
|
1461
|
+
}
|
|
1462
|
+
isNullable() {
|
|
1463
|
+
return this.safeParse(null).success;
|
|
1464
|
+
}
|
|
1465
|
+
}, se = /^c[^\s-]{8,}$/i, ce = /^[0-9a-z]+$/, le = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ue = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, de = /^[a-z0-9_-]{21}$/i, fe = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, pe = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, me = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, he = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", ge, _e = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ve = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, ye = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, be = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, xe = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Se = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ce = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", we = RegExp(`^${Ce}$`);
|
|
1466
|
+
function Te(e) {
|
|
1467
|
+
let t = "[0-5]\\d";
|
|
1468
|
+
e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
|
|
1469
|
+
let n = e.precision ? "+" : "?";
|
|
1470
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
|
|
1471
|
+
}
|
|
1472
|
+
function Ee(e) {
|
|
1473
|
+
return RegExp(`^${Te(e)}$`);
|
|
1474
|
+
}
|
|
1475
|
+
function De(e) {
|
|
1476
|
+
let t = `${Ce}T${Te(e)}`, n = [];
|
|
1477
|
+
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
1478
|
+
}
|
|
1479
|
+
function Oe(e, t) {
|
|
1480
|
+
return !!((t === "v4" || !t) && _e.test(e) || (t === "v6" || !t) && ye.test(e));
|
|
1481
|
+
}
|
|
1482
|
+
function ke(e, t) {
|
|
1483
|
+
if (!fe.test(e)) return !1;
|
|
1484
|
+
try {
|
|
1485
|
+
let [n] = e.split(".");
|
|
1486
|
+
if (!n) return !1;
|
|
1487
|
+
let r = n.replace(/-/g, "+").replace(/_/g, "/").padEnd(n.length + (4 - n.length % 4) % 4, "="), i = JSON.parse(atob(r));
|
|
1488
|
+
return !(typeof i != "object" || !i || "typ" in i && i?.typ !== "JWT" || !i.alg || t && i.alg !== t);
|
|
1489
|
+
} catch {
|
|
1490
|
+
return !1;
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
function Ae(e, t) {
|
|
1494
|
+
return !!((t === "v4" || !t) && ve.test(e) || (t === "v6" || !t) && be.test(e));
|
|
1495
|
+
}
|
|
1496
|
+
var x = class e extends b {
|
|
1497
|
+
_parse(e) {
|
|
1498
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== o.string) {
|
|
1499
|
+
let t = this._getOrReturnCtx(e);
|
|
1500
|
+
return d(t, {
|
|
1501
|
+
code: c.invalid_type,
|
|
1502
|
+
expected: o.string,
|
|
1503
|
+
received: t.parsedType
|
|
1504
|
+
}), p;
|
|
1505
|
+
}
|
|
1506
|
+
let t = new f(), n;
|
|
1507
|
+
for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1508
|
+
code: c.too_small,
|
|
1509
|
+
minimum: r.value,
|
|
1510
|
+
type: "string",
|
|
1511
|
+
inclusive: !0,
|
|
1512
|
+
exact: !1,
|
|
1513
|
+
message: r.message
|
|
1514
|
+
}), t.dirty());
|
|
1515
|
+
else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1516
|
+
code: c.too_big,
|
|
1517
|
+
maximum: r.value,
|
|
1518
|
+
type: "string",
|
|
1519
|
+
inclusive: !0,
|
|
1520
|
+
exact: !1,
|
|
1521
|
+
message: r.message
|
|
1522
|
+
}), t.dirty());
|
|
1523
|
+
else if (r.kind === "length") {
|
|
1524
|
+
let i = e.data.length > r.value, a = e.data.length < r.value;
|
|
1525
|
+
(i || a) && (n = this._getOrReturnCtx(e, n), i ? d(n, {
|
|
1526
|
+
code: c.too_big,
|
|
1527
|
+
maximum: r.value,
|
|
1528
|
+
type: "string",
|
|
1529
|
+
inclusive: !0,
|
|
1530
|
+
exact: !0,
|
|
1531
|
+
message: r.message
|
|
1532
|
+
}) : a && d(n, {
|
|
1533
|
+
code: c.too_small,
|
|
1534
|
+
minimum: r.value,
|
|
1535
|
+
type: "string",
|
|
1536
|
+
inclusive: !0,
|
|
1537
|
+
exact: !0,
|
|
1538
|
+
message: r.message
|
|
1539
|
+
}), t.dirty());
|
|
1540
|
+
} else if (r.kind === "email") me.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1541
|
+
validation: "email",
|
|
1542
|
+
code: c.invalid_string,
|
|
1543
|
+
message: r.message
|
|
1544
|
+
}), t.dirty());
|
|
1545
|
+
else if (r.kind === "emoji") ge ||= new RegExp(he, "u"), ge.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1546
|
+
validation: "emoji",
|
|
1547
|
+
code: c.invalid_string,
|
|
1548
|
+
message: r.message
|
|
1549
|
+
}), t.dirty());
|
|
1550
|
+
else if (r.kind === "uuid") ue.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1551
|
+
validation: "uuid",
|
|
1552
|
+
code: c.invalid_string,
|
|
1553
|
+
message: r.message
|
|
1554
|
+
}), t.dirty());
|
|
1555
|
+
else if (r.kind === "nanoid") de.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1556
|
+
validation: "nanoid",
|
|
1557
|
+
code: c.invalid_string,
|
|
1558
|
+
message: r.message
|
|
1559
|
+
}), t.dirty());
|
|
1560
|
+
else if (r.kind === "cuid") se.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1561
|
+
validation: "cuid",
|
|
1562
|
+
code: c.invalid_string,
|
|
1563
|
+
message: r.message
|
|
1564
|
+
}), t.dirty());
|
|
1565
|
+
else if (r.kind === "cuid2") ce.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1566
|
+
validation: "cuid2",
|
|
1567
|
+
code: c.invalid_string,
|
|
1568
|
+
message: r.message
|
|
1569
|
+
}), t.dirty());
|
|
1570
|
+
else if (r.kind === "ulid") le.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1571
|
+
validation: "ulid",
|
|
1572
|
+
code: c.invalid_string,
|
|
1573
|
+
message: r.message
|
|
1574
|
+
}), t.dirty());
|
|
1575
|
+
else if (r.kind === "url") try {
|
|
1576
|
+
new URL(e.data);
|
|
1577
|
+
} catch {
|
|
1578
|
+
n = this._getOrReturnCtx(e, n), d(n, {
|
|
1579
|
+
validation: "url",
|
|
1580
|
+
code: c.invalid_string,
|
|
1581
|
+
message: r.message
|
|
1582
|
+
}), t.dirty();
|
|
1583
|
+
}
|
|
1584
|
+
else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1585
|
+
validation: "regex",
|
|
1586
|
+
code: c.invalid_string,
|
|
1587
|
+
message: r.message
|
|
1588
|
+
}), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1589
|
+
code: c.invalid_string,
|
|
1590
|
+
validation: {
|
|
1591
|
+
includes: r.value,
|
|
1592
|
+
position: r.position
|
|
1593
|
+
},
|
|
1594
|
+
message: r.message
|
|
1595
|
+
}), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1596
|
+
code: c.invalid_string,
|
|
1597
|
+
validation: { startsWith: r.value },
|
|
1598
|
+
message: r.message
|
|
1599
|
+
}), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1600
|
+
code: c.invalid_string,
|
|
1601
|
+
validation: { endsWith: r.value },
|
|
1602
|
+
message: r.message
|
|
1603
|
+
}), t.dirty()) : r.kind === "datetime" ? De(r).test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1604
|
+
code: c.invalid_string,
|
|
1605
|
+
validation: "datetime",
|
|
1606
|
+
message: r.message
|
|
1607
|
+
}), t.dirty()) : r.kind === "date" ? we.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1608
|
+
code: c.invalid_string,
|
|
1609
|
+
validation: "date",
|
|
1610
|
+
message: r.message
|
|
1611
|
+
}), t.dirty()) : r.kind === "time" ? Ee(r).test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1612
|
+
code: c.invalid_string,
|
|
1613
|
+
validation: "time",
|
|
1614
|
+
message: r.message
|
|
1615
|
+
}), t.dirty()) : r.kind === "duration" ? pe.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1616
|
+
validation: "duration",
|
|
1617
|
+
code: c.invalid_string,
|
|
1618
|
+
message: r.message
|
|
1619
|
+
}), t.dirty()) : r.kind === "ip" ? Oe(e.data, r.version) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1620
|
+
validation: "ip",
|
|
1621
|
+
code: c.invalid_string,
|
|
1622
|
+
message: r.message
|
|
1623
|
+
}), t.dirty()) : r.kind === "jwt" ? ke(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1624
|
+
validation: "jwt",
|
|
1625
|
+
code: c.invalid_string,
|
|
1626
|
+
message: r.message
|
|
1627
|
+
}), t.dirty()) : r.kind === "cidr" ? Ae(e.data, r.version) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1628
|
+
validation: "cidr",
|
|
1629
|
+
code: c.invalid_string,
|
|
1630
|
+
message: r.message
|
|
1631
|
+
}), t.dirty()) : r.kind === "base64" ? xe.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1632
|
+
validation: "base64",
|
|
1633
|
+
code: c.invalid_string,
|
|
1634
|
+
message: r.message
|
|
1635
|
+
}), t.dirty()) : r.kind === "base64url" ? Se.test(e.data) || (n = this._getOrReturnCtx(e, n), d(n, {
|
|
1636
|
+
validation: "base64url",
|
|
1637
|
+
code: c.invalid_string,
|
|
1638
|
+
message: r.message
|
|
1639
|
+
}), t.dirty()) : i.assertNever(r);
|
|
1640
|
+
return {
|
|
1641
|
+
status: t.value,
|
|
1642
|
+
value: e.data
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
_regex(e, t, n) {
|
|
1646
|
+
return this.refinement((t) => e.test(t), {
|
|
1647
|
+
validation: t,
|
|
1648
|
+
code: c.invalid_string,
|
|
1649
|
+
..._.errToObj(n)
|
|
1650
|
+
});
|
|
1651
|
+
}
|
|
1652
|
+
_addCheck(t) {
|
|
1653
|
+
return new e({
|
|
1654
|
+
...this._def,
|
|
1655
|
+
checks: [...this._def.checks, t]
|
|
1656
|
+
});
|
|
1657
|
+
}
|
|
1658
|
+
email(e) {
|
|
1659
|
+
return this._addCheck({
|
|
1660
|
+
kind: "email",
|
|
1661
|
+
..._.errToObj(e)
|
|
1662
|
+
});
|
|
1663
|
+
}
|
|
1664
|
+
url(e) {
|
|
1665
|
+
return this._addCheck({
|
|
1666
|
+
kind: "url",
|
|
1667
|
+
..._.errToObj(e)
|
|
1668
|
+
});
|
|
1669
|
+
}
|
|
1670
|
+
emoji(e) {
|
|
1671
|
+
return this._addCheck({
|
|
1672
|
+
kind: "emoji",
|
|
1673
|
+
..._.errToObj(e)
|
|
1674
|
+
});
|
|
1675
|
+
}
|
|
1676
|
+
uuid(e) {
|
|
1677
|
+
return this._addCheck({
|
|
1678
|
+
kind: "uuid",
|
|
1679
|
+
..._.errToObj(e)
|
|
1680
|
+
});
|
|
1681
|
+
}
|
|
1682
|
+
nanoid(e) {
|
|
1683
|
+
return this._addCheck({
|
|
1684
|
+
kind: "nanoid",
|
|
1685
|
+
..._.errToObj(e)
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1688
|
+
cuid(e) {
|
|
1689
|
+
return this._addCheck({
|
|
1690
|
+
kind: "cuid",
|
|
1691
|
+
..._.errToObj(e)
|
|
1692
|
+
});
|
|
1693
|
+
}
|
|
1694
|
+
cuid2(e) {
|
|
1695
|
+
return this._addCheck({
|
|
1696
|
+
kind: "cuid2",
|
|
1697
|
+
..._.errToObj(e)
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
ulid(e) {
|
|
1701
|
+
return this._addCheck({
|
|
1702
|
+
kind: "ulid",
|
|
1703
|
+
..._.errToObj(e)
|
|
1704
|
+
});
|
|
1705
|
+
}
|
|
1706
|
+
base64(e) {
|
|
1707
|
+
return this._addCheck({
|
|
1708
|
+
kind: "base64",
|
|
1709
|
+
..._.errToObj(e)
|
|
1710
|
+
});
|
|
1711
|
+
}
|
|
1712
|
+
base64url(e) {
|
|
1713
|
+
return this._addCheck({
|
|
1714
|
+
kind: "base64url",
|
|
1715
|
+
..._.errToObj(e)
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
jwt(e) {
|
|
1719
|
+
return this._addCheck({
|
|
1720
|
+
kind: "jwt",
|
|
1721
|
+
..._.errToObj(e)
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
ip(e) {
|
|
1725
|
+
return this._addCheck({
|
|
1726
|
+
kind: "ip",
|
|
1727
|
+
..._.errToObj(e)
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1730
|
+
cidr(e) {
|
|
1731
|
+
return this._addCheck({
|
|
1732
|
+
kind: "cidr",
|
|
1733
|
+
..._.errToObj(e)
|
|
1734
|
+
});
|
|
1735
|
+
}
|
|
1736
|
+
datetime(e) {
|
|
1737
|
+
return typeof e == "string" ? this._addCheck({
|
|
1738
|
+
kind: "datetime",
|
|
1739
|
+
precision: null,
|
|
1740
|
+
offset: !1,
|
|
1741
|
+
local: !1,
|
|
1742
|
+
message: e
|
|
1743
|
+
}) : this._addCheck({
|
|
1744
|
+
kind: "datetime",
|
|
1745
|
+
precision: e?.precision === void 0 ? null : e?.precision,
|
|
1746
|
+
offset: e?.offset ?? !1,
|
|
1747
|
+
local: e?.local ?? !1,
|
|
1748
|
+
..._.errToObj(e?.message)
|
|
1749
|
+
});
|
|
1750
|
+
}
|
|
1751
|
+
date(e) {
|
|
1752
|
+
return this._addCheck({
|
|
1753
|
+
kind: "date",
|
|
1754
|
+
message: e
|
|
1755
|
+
});
|
|
1756
|
+
}
|
|
1757
|
+
time(e) {
|
|
1758
|
+
return typeof e == "string" ? this._addCheck({
|
|
1759
|
+
kind: "time",
|
|
1760
|
+
precision: null,
|
|
1761
|
+
message: e
|
|
1762
|
+
}) : this._addCheck({
|
|
1763
|
+
kind: "time",
|
|
1764
|
+
precision: e?.precision === void 0 ? null : e?.precision,
|
|
1765
|
+
..._.errToObj(e?.message)
|
|
1766
|
+
});
|
|
1767
|
+
}
|
|
1768
|
+
duration(e) {
|
|
1769
|
+
return this._addCheck({
|
|
1770
|
+
kind: "duration",
|
|
1771
|
+
..._.errToObj(e)
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
regex(e, t) {
|
|
1775
|
+
return this._addCheck({
|
|
1776
|
+
kind: "regex",
|
|
1777
|
+
regex: e,
|
|
1778
|
+
..._.errToObj(t)
|
|
1779
|
+
});
|
|
1780
|
+
}
|
|
1781
|
+
includes(e, t) {
|
|
1782
|
+
return this._addCheck({
|
|
1783
|
+
kind: "includes",
|
|
1784
|
+
value: e,
|
|
1785
|
+
position: t?.position,
|
|
1786
|
+
..._.errToObj(t?.message)
|
|
1787
|
+
});
|
|
1788
|
+
}
|
|
1789
|
+
startsWith(e, t) {
|
|
1790
|
+
return this._addCheck({
|
|
1791
|
+
kind: "startsWith",
|
|
1792
|
+
value: e,
|
|
1793
|
+
..._.errToObj(t)
|
|
1794
|
+
});
|
|
1795
|
+
}
|
|
1796
|
+
endsWith(e, t) {
|
|
1797
|
+
return this._addCheck({
|
|
1798
|
+
kind: "endsWith",
|
|
1799
|
+
value: e,
|
|
1800
|
+
..._.errToObj(t)
|
|
1801
|
+
});
|
|
1802
|
+
}
|
|
1803
|
+
min(e, t) {
|
|
1804
|
+
return this._addCheck({
|
|
1805
|
+
kind: "min",
|
|
1806
|
+
value: e,
|
|
1807
|
+
..._.errToObj(t)
|
|
1808
|
+
});
|
|
1809
|
+
}
|
|
1810
|
+
max(e, t) {
|
|
1811
|
+
return this._addCheck({
|
|
1812
|
+
kind: "max",
|
|
1813
|
+
value: e,
|
|
1814
|
+
..._.errToObj(t)
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
length(e, t) {
|
|
1818
|
+
return this._addCheck({
|
|
1819
|
+
kind: "length",
|
|
1820
|
+
value: e,
|
|
1821
|
+
..._.errToObj(t)
|
|
1822
|
+
});
|
|
1823
|
+
}
|
|
1824
|
+
nonempty(e) {
|
|
1825
|
+
return this.min(1, _.errToObj(e));
|
|
1826
|
+
}
|
|
1827
|
+
trim() {
|
|
1828
|
+
return new e({
|
|
1829
|
+
...this._def,
|
|
1830
|
+
checks: [...this._def.checks, { kind: "trim" }]
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
toLowerCase() {
|
|
1834
|
+
return new e({
|
|
1835
|
+
...this._def,
|
|
1836
|
+
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1837
|
+
});
|
|
1838
|
+
}
|
|
1839
|
+
toUpperCase() {
|
|
1840
|
+
return new e({
|
|
1841
|
+
...this._def,
|
|
1842
|
+
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
get isDatetime() {
|
|
1846
|
+
return !!this._def.checks.find((e) => e.kind === "datetime");
|
|
1847
|
+
}
|
|
1848
|
+
get isDate() {
|
|
1849
|
+
return !!this._def.checks.find((e) => e.kind === "date");
|
|
1850
|
+
}
|
|
1851
|
+
get isTime() {
|
|
1852
|
+
return !!this._def.checks.find((e) => e.kind === "time");
|
|
1853
|
+
}
|
|
1854
|
+
get isDuration() {
|
|
1855
|
+
return !!this._def.checks.find((e) => e.kind === "duration");
|
|
1856
|
+
}
|
|
1857
|
+
get isEmail() {
|
|
1858
|
+
return !!this._def.checks.find((e) => e.kind === "email");
|
|
1859
|
+
}
|
|
1860
|
+
get isURL() {
|
|
1861
|
+
return !!this._def.checks.find((e) => e.kind === "url");
|
|
1862
|
+
}
|
|
1863
|
+
get isEmoji() {
|
|
1864
|
+
return !!this._def.checks.find((e) => e.kind === "emoji");
|
|
1865
|
+
}
|
|
1866
|
+
get isUUID() {
|
|
1867
|
+
return !!this._def.checks.find((e) => e.kind === "uuid");
|
|
1868
|
+
}
|
|
1869
|
+
get isNANOID() {
|
|
1870
|
+
return !!this._def.checks.find((e) => e.kind === "nanoid");
|
|
1871
|
+
}
|
|
1872
|
+
get isCUID() {
|
|
1873
|
+
return !!this._def.checks.find((e) => e.kind === "cuid");
|
|
1874
|
+
}
|
|
1875
|
+
get isCUID2() {
|
|
1876
|
+
return !!this._def.checks.find((e) => e.kind === "cuid2");
|
|
1877
|
+
}
|
|
1878
|
+
get isULID() {
|
|
1879
|
+
return !!this._def.checks.find((e) => e.kind === "ulid");
|
|
1880
|
+
}
|
|
1881
|
+
get isIP() {
|
|
1882
|
+
return !!this._def.checks.find((e) => e.kind === "ip");
|
|
1883
|
+
}
|
|
1884
|
+
get isCIDR() {
|
|
1885
|
+
return !!this._def.checks.find((e) => e.kind === "cidr");
|
|
1886
|
+
}
|
|
1887
|
+
get isBase64() {
|
|
1888
|
+
return !!this._def.checks.find((e) => e.kind === "base64");
|
|
1889
|
+
}
|
|
1890
|
+
get isBase64url() {
|
|
1891
|
+
return !!this._def.checks.find((e) => e.kind === "base64url");
|
|
1892
|
+
}
|
|
1893
|
+
get minLength() {
|
|
1894
|
+
let e = null;
|
|
1895
|
+
for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
|
|
1896
|
+
return e;
|
|
1897
|
+
}
|
|
1898
|
+
get maxLength() {
|
|
1899
|
+
let e = null;
|
|
1900
|
+
for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
1901
|
+
return e;
|
|
1902
|
+
}
|
|
1903
|
+
};
|
|
1904
|
+
x.create = (e) => new x({
|
|
1905
|
+
checks: [],
|
|
1906
|
+
typeName: W.ZodString,
|
|
1907
|
+
coerce: e?.coerce ?? !1,
|
|
1908
|
+
...y(e)
|
|
1909
|
+
});
|
|
1910
|
+
function je(e, t) {
|
|
1911
|
+
let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
|
|
1912
|
+
return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
|
|
1913
|
+
}
|
|
1914
|
+
var Me = class e extends b {
|
|
1915
|
+
constructor() {
|
|
1916
|
+
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1917
|
+
}
|
|
1918
|
+
_parse(e) {
|
|
1919
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== o.number) {
|
|
1920
|
+
let t = this._getOrReturnCtx(e);
|
|
1921
|
+
return d(t, {
|
|
1922
|
+
code: c.invalid_type,
|
|
1923
|
+
expected: o.number,
|
|
1924
|
+
received: t.parsedType
|
|
1925
|
+
}), p;
|
|
1926
|
+
}
|
|
1927
|
+
let t, n = new f();
|
|
1928
|
+
for (let r of this._def.checks) r.kind === "int" ? i.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), d(t, {
|
|
1929
|
+
code: c.invalid_type,
|
|
1930
|
+
expected: "integer",
|
|
1931
|
+
received: "float",
|
|
1932
|
+
message: r.message
|
|
1933
|
+
}), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), d(t, {
|
|
1934
|
+
code: c.too_small,
|
|
1935
|
+
minimum: r.value,
|
|
1936
|
+
type: "number",
|
|
1937
|
+
inclusive: r.inclusive,
|
|
1938
|
+
exact: !1,
|
|
1939
|
+
message: r.message
|
|
1940
|
+
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), d(t, {
|
|
1941
|
+
code: c.too_big,
|
|
1942
|
+
maximum: r.value,
|
|
1943
|
+
type: "number",
|
|
1944
|
+
inclusive: r.inclusive,
|
|
1945
|
+
exact: !1,
|
|
1946
|
+
message: r.message
|
|
1947
|
+
}), n.dirty()) : r.kind === "multipleOf" ? je(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), d(t, {
|
|
1948
|
+
code: c.not_multiple_of,
|
|
1949
|
+
multipleOf: r.value,
|
|
1950
|
+
message: r.message
|
|
1951
|
+
}), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), d(t, {
|
|
1952
|
+
code: c.not_finite,
|
|
1953
|
+
message: r.message
|
|
1954
|
+
}), n.dirty()) : i.assertNever(r);
|
|
1955
|
+
return {
|
|
1956
|
+
status: n.value,
|
|
1957
|
+
value: e.data
|
|
1958
|
+
};
|
|
1959
|
+
}
|
|
1960
|
+
gte(e, t) {
|
|
1961
|
+
return this.setLimit("min", e, !0, _.toString(t));
|
|
1962
|
+
}
|
|
1963
|
+
gt(e, t) {
|
|
1964
|
+
return this.setLimit("min", e, !1, _.toString(t));
|
|
1965
|
+
}
|
|
1966
|
+
lte(e, t) {
|
|
1967
|
+
return this.setLimit("max", e, !0, _.toString(t));
|
|
1968
|
+
}
|
|
1969
|
+
lt(e, t) {
|
|
1970
|
+
return this.setLimit("max", e, !1, _.toString(t));
|
|
1971
|
+
}
|
|
1972
|
+
setLimit(t, n, r, i) {
|
|
1973
|
+
return new e({
|
|
1974
|
+
...this._def,
|
|
1975
|
+
checks: [...this._def.checks, {
|
|
1976
|
+
kind: t,
|
|
1977
|
+
value: n,
|
|
1978
|
+
inclusive: r,
|
|
1979
|
+
message: _.toString(i)
|
|
1980
|
+
}]
|
|
1981
|
+
});
|
|
1982
|
+
}
|
|
1983
|
+
_addCheck(t) {
|
|
1984
|
+
return new e({
|
|
1985
|
+
...this._def,
|
|
1986
|
+
checks: [...this._def.checks, t]
|
|
1987
|
+
});
|
|
1988
|
+
}
|
|
1989
|
+
int(e) {
|
|
1990
|
+
return this._addCheck({
|
|
1991
|
+
kind: "int",
|
|
1992
|
+
message: _.toString(e)
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
positive(e) {
|
|
1996
|
+
return this._addCheck({
|
|
1997
|
+
kind: "min",
|
|
1998
|
+
value: 0,
|
|
1999
|
+
inclusive: !1,
|
|
2000
|
+
message: _.toString(e)
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
negative(e) {
|
|
2004
|
+
return this._addCheck({
|
|
2005
|
+
kind: "max",
|
|
2006
|
+
value: 0,
|
|
2007
|
+
inclusive: !1,
|
|
2008
|
+
message: _.toString(e)
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
nonpositive(e) {
|
|
2012
|
+
return this._addCheck({
|
|
2013
|
+
kind: "max",
|
|
2014
|
+
value: 0,
|
|
2015
|
+
inclusive: !0,
|
|
2016
|
+
message: _.toString(e)
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
nonnegative(e) {
|
|
2020
|
+
return this._addCheck({
|
|
2021
|
+
kind: "min",
|
|
2022
|
+
value: 0,
|
|
2023
|
+
inclusive: !0,
|
|
2024
|
+
message: _.toString(e)
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
multipleOf(e, t) {
|
|
2028
|
+
return this._addCheck({
|
|
2029
|
+
kind: "multipleOf",
|
|
2030
|
+
value: e,
|
|
2031
|
+
message: _.toString(t)
|
|
2032
|
+
});
|
|
2033
|
+
}
|
|
2034
|
+
finite(e) {
|
|
2035
|
+
return this._addCheck({
|
|
2036
|
+
kind: "finite",
|
|
2037
|
+
message: _.toString(e)
|
|
2038
|
+
});
|
|
2039
|
+
}
|
|
2040
|
+
safe(e) {
|
|
2041
|
+
return this._addCheck({
|
|
2042
|
+
kind: "min",
|
|
2043
|
+
inclusive: !0,
|
|
2044
|
+
value: -(2 ** 53 - 1),
|
|
2045
|
+
message: _.toString(e)
|
|
2046
|
+
})._addCheck({
|
|
2047
|
+
kind: "max",
|
|
2048
|
+
inclusive: !0,
|
|
2049
|
+
value: 2 ** 53 - 1,
|
|
2050
|
+
message: _.toString(e)
|
|
2051
|
+
});
|
|
2052
|
+
}
|
|
2053
|
+
get minValue() {
|
|
2054
|
+
let e = null;
|
|
2055
|
+
for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
|
|
2056
|
+
return e;
|
|
2057
|
+
}
|
|
2058
|
+
get maxValue() {
|
|
2059
|
+
let e = null;
|
|
2060
|
+
for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
2061
|
+
return e;
|
|
2062
|
+
}
|
|
2063
|
+
get isInt() {
|
|
2064
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && i.isInteger(e.value));
|
|
2065
|
+
}
|
|
2066
|
+
get isFinite() {
|
|
2067
|
+
let e = null, t = null;
|
|
2068
|
+
for (let n of this._def.checks) if (n.kind === "finite" || n.kind === "int" || n.kind === "multipleOf") return !0;
|
|
2069
|
+
else n.kind === "min" ? (t === null || n.value > t) && (t = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value);
|
|
2070
|
+
return Number.isFinite(t) && Number.isFinite(e);
|
|
2071
|
+
}
|
|
2072
|
+
};
|
|
2073
|
+
Me.create = (e) => new Me({
|
|
2074
|
+
checks: [],
|
|
2075
|
+
typeName: W.ZodNumber,
|
|
2076
|
+
coerce: e?.coerce || !1,
|
|
2077
|
+
...y(e)
|
|
2078
|
+
});
|
|
2079
|
+
var Ne = class e extends b {
|
|
2080
|
+
constructor() {
|
|
2081
|
+
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
2082
|
+
}
|
|
2083
|
+
_parse(e) {
|
|
2084
|
+
if (this._def.coerce) try {
|
|
2085
|
+
e.data = BigInt(e.data);
|
|
2086
|
+
} catch {
|
|
2087
|
+
return this._getInvalidInput(e);
|
|
2088
|
+
}
|
|
2089
|
+
if (this._getType(e) !== o.bigint) return this._getInvalidInput(e);
|
|
2090
|
+
let t, n = new f();
|
|
2091
|
+
for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), d(t, {
|
|
2092
|
+
code: c.too_small,
|
|
2093
|
+
type: "bigint",
|
|
2094
|
+
minimum: r.value,
|
|
2095
|
+
inclusive: r.inclusive,
|
|
2096
|
+
message: r.message
|
|
2097
|
+
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), d(t, {
|
|
2098
|
+
code: c.too_big,
|
|
2099
|
+
type: "bigint",
|
|
2100
|
+
maximum: r.value,
|
|
2101
|
+
inclusive: r.inclusive,
|
|
2102
|
+
message: r.message
|
|
2103
|
+
}), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t), d(t, {
|
|
2104
|
+
code: c.not_multiple_of,
|
|
2105
|
+
multipleOf: r.value,
|
|
2106
|
+
message: r.message
|
|
2107
|
+
}), n.dirty()) : i.assertNever(r);
|
|
2108
|
+
return {
|
|
2109
|
+
status: n.value,
|
|
2110
|
+
value: e.data
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
_getInvalidInput(e) {
|
|
2114
|
+
let t = this._getOrReturnCtx(e);
|
|
2115
|
+
return d(t, {
|
|
2116
|
+
code: c.invalid_type,
|
|
2117
|
+
expected: o.bigint,
|
|
2118
|
+
received: t.parsedType
|
|
2119
|
+
}), p;
|
|
2120
|
+
}
|
|
2121
|
+
gte(e, t) {
|
|
2122
|
+
return this.setLimit("min", e, !0, _.toString(t));
|
|
2123
|
+
}
|
|
2124
|
+
gt(e, t) {
|
|
2125
|
+
return this.setLimit("min", e, !1, _.toString(t));
|
|
2126
|
+
}
|
|
2127
|
+
lte(e, t) {
|
|
2128
|
+
return this.setLimit("max", e, !0, _.toString(t));
|
|
2129
|
+
}
|
|
2130
|
+
lt(e, t) {
|
|
2131
|
+
return this.setLimit("max", e, !1, _.toString(t));
|
|
2132
|
+
}
|
|
2133
|
+
setLimit(t, n, r, i) {
|
|
2134
|
+
return new e({
|
|
2135
|
+
...this._def,
|
|
2136
|
+
checks: [...this._def.checks, {
|
|
2137
|
+
kind: t,
|
|
2138
|
+
value: n,
|
|
2139
|
+
inclusive: r,
|
|
2140
|
+
message: _.toString(i)
|
|
2141
|
+
}]
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2144
|
+
_addCheck(t) {
|
|
2145
|
+
return new e({
|
|
2146
|
+
...this._def,
|
|
2147
|
+
checks: [...this._def.checks, t]
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
positive(e) {
|
|
2151
|
+
return this._addCheck({
|
|
2152
|
+
kind: "min",
|
|
2153
|
+
value: BigInt(0),
|
|
2154
|
+
inclusive: !1,
|
|
2155
|
+
message: _.toString(e)
|
|
2156
|
+
});
|
|
2157
|
+
}
|
|
2158
|
+
negative(e) {
|
|
2159
|
+
return this._addCheck({
|
|
2160
|
+
kind: "max",
|
|
2161
|
+
value: BigInt(0),
|
|
2162
|
+
inclusive: !1,
|
|
2163
|
+
message: _.toString(e)
|
|
2164
|
+
});
|
|
2165
|
+
}
|
|
2166
|
+
nonpositive(e) {
|
|
2167
|
+
return this._addCheck({
|
|
2168
|
+
kind: "max",
|
|
2169
|
+
value: BigInt(0),
|
|
2170
|
+
inclusive: !0,
|
|
2171
|
+
message: _.toString(e)
|
|
2172
|
+
});
|
|
2173
|
+
}
|
|
2174
|
+
nonnegative(e) {
|
|
2175
|
+
return this._addCheck({
|
|
2176
|
+
kind: "min",
|
|
2177
|
+
value: BigInt(0),
|
|
2178
|
+
inclusive: !0,
|
|
2179
|
+
message: _.toString(e)
|
|
2180
|
+
});
|
|
2181
|
+
}
|
|
2182
|
+
multipleOf(e, t) {
|
|
2183
|
+
return this._addCheck({
|
|
2184
|
+
kind: "multipleOf",
|
|
2185
|
+
value: e,
|
|
2186
|
+
message: _.toString(t)
|
|
2187
|
+
});
|
|
2188
|
+
}
|
|
2189
|
+
get minValue() {
|
|
2190
|
+
let e = null;
|
|
2191
|
+
for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
|
|
2192
|
+
return e;
|
|
2193
|
+
}
|
|
2194
|
+
get maxValue() {
|
|
2195
|
+
let e = null;
|
|
2196
|
+
for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
2197
|
+
return e;
|
|
2198
|
+
}
|
|
2199
|
+
};
|
|
2200
|
+
Ne.create = (e) => new Ne({
|
|
2201
|
+
checks: [],
|
|
2202
|
+
typeName: W.ZodBigInt,
|
|
2203
|
+
coerce: e?.coerce ?? !1,
|
|
2204
|
+
...y(e)
|
|
2205
|
+
});
|
|
2206
|
+
var Pe = class extends b {
|
|
2207
|
+
_parse(e) {
|
|
2208
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== o.boolean) {
|
|
2209
|
+
let t = this._getOrReturnCtx(e);
|
|
2210
|
+
return d(t, {
|
|
2211
|
+
code: c.invalid_type,
|
|
2212
|
+
expected: o.boolean,
|
|
2213
|
+
received: t.parsedType
|
|
2214
|
+
}), p;
|
|
2215
|
+
}
|
|
2216
|
+
return m(e.data);
|
|
2217
|
+
}
|
|
2218
|
+
};
|
|
2219
|
+
Pe.create = (e) => new Pe({
|
|
2220
|
+
typeName: W.ZodBoolean,
|
|
2221
|
+
coerce: e?.coerce || !1,
|
|
2222
|
+
...y(e)
|
|
2223
|
+
});
|
|
2224
|
+
var Fe = class e extends b {
|
|
2225
|
+
_parse(e) {
|
|
2226
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== o.date) {
|
|
2227
|
+
let t = this._getOrReturnCtx(e);
|
|
2228
|
+
return d(t, {
|
|
2229
|
+
code: c.invalid_type,
|
|
2230
|
+
expected: o.date,
|
|
2231
|
+
received: t.parsedType
|
|
2232
|
+
}), p;
|
|
2233
|
+
}
|
|
2234
|
+
if (Number.isNaN(e.data.getTime())) return d(this._getOrReturnCtx(e), { code: c.invalid_date }), p;
|
|
2235
|
+
let t = new f(), n;
|
|
2236
|
+
for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n), d(n, {
|
|
2237
|
+
code: c.too_small,
|
|
2238
|
+
message: r.message,
|
|
2239
|
+
inclusive: !0,
|
|
2240
|
+
exact: !1,
|
|
2241
|
+
minimum: r.value,
|
|
2242
|
+
type: "date"
|
|
2243
|
+
}), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n), d(n, {
|
|
2244
|
+
code: c.too_big,
|
|
2245
|
+
message: r.message,
|
|
2246
|
+
inclusive: !0,
|
|
2247
|
+
exact: !1,
|
|
2248
|
+
maximum: r.value,
|
|
2249
|
+
type: "date"
|
|
2250
|
+
}), t.dirty()) : i.assertNever(r);
|
|
2251
|
+
return {
|
|
2252
|
+
status: t.value,
|
|
2253
|
+
value: new Date(e.data.getTime())
|
|
2254
|
+
};
|
|
2255
|
+
}
|
|
2256
|
+
_addCheck(t) {
|
|
2257
|
+
return new e({
|
|
2258
|
+
...this._def,
|
|
2259
|
+
checks: [...this._def.checks, t]
|
|
2260
|
+
});
|
|
2261
|
+
}
|
|
2262
|
+
min(e, t) {
|
|
2263
|
+
return this._addCheck({
|
|
2264
|
+
kind: "min",
|
|
2265
|
+
value: e.getTime(),
|
|
2266
|
+
message: _.toString(t)
|
|
2267
|
+
});
|
|
2268
|
+
}
|
|
2269
|
+
max(e, t) {
|
|
2270
|
+
return this._addCheck({
|
|
2271
|
+
kind: "max",
|
|
2272
|
+
value: e.getTime(),
|
|
2273
|
+
message: _.toString(t)
|
|
2274
|
+
});
|
|
2275
|
+
}
|
|
2276
|
+
get minDate() {
|
|
2277
|
+
let e = null;
|
|
2278
|
+
for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
|
|
2279
|
+
return e == null ? null : new Date(e);
|
|
2280
|
+
}
|
|
2281
|
+
get maxDate() {
|
|
2282
|
+
let e = null;
|
|
2283
|
+
for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
|
|
2284
|
+
return e == null ? null : new Date(e);
|
|
2285
|
+
}
|
|
2286
|
+
};
|
|
2287
|
+
Fe.create = (e) => new Fe({
|
|
2288
|
+
checks: [],
|
|
2289
|
+
coerce: e?.coerce || !1,
|
|
2290
|
+
typeName: W.ZodDate,
|
|
2291
|
+
...y(e)
|
|
2292
|
+
});
|
|
2293
|
+
var Ie = class extends b {
|
|
2294
|
+
_parse(e) {
|
|
2295
|
+
if (this._getType(e) !== o.symbol) {
|
|
2296
|
+
let t = this._getOrReturnCtx(e);
|
|
2297
|
+
return d(t, {
|
|
2298
|
+
code: c.invalid_type,
|
|
2299
|
+
expected: o.symbol,
|
|
2300
|
+
received: t.parsedType
|
|
2301
|
+
}), p;
|
|
2302
|
+
}
|
|
2303
|
+
return m(e.data);
|
|
2304
|
+
}
|
|
2305
|
+
};
|
|
2306
|
+
Ie.create = (e) => new Ie({
|
|
2307
|
+
typeName: W.ZodSymbol,
|
|
2308
|
+
...y(e)
|
|
2309
|
+
});
|
|
2310
|
+
var S = class extends b {
|
|
2311
|
+
_parse(e) {
|
|
2312
|
+
if (this._getType(e) !== o.undefined) {
|
|
2313
|
+
let t = this._getOrReturnCtx(e);
|
|
2314
|
+
return d(t, {
|
|
2315
|
+
code: c.invalid_type,
|
|
2316
|
+
expected: o.undefined,
|
|
2317
|
+
received: t.parsedType
|
|
2318
|
+
}), p;
|
|
2319
|
+
}
|
|
2320
|
+
return m(e.data);
|
|
2321
|
+
}
|
|
2322
|
+
};
|
|
2323
|
+
S.create = (e) => new S({
|
|
2324
|
+
typeName: W.ZodUndefined,
|
|
2325
|
+
...y(e)
|
|
2326
|
+
});
|
|
2327
|
+
var C = class extends b {
|
|
2328
|
+
_parse(e) {
|
|
2329
|
+
if (this._getType(e) !== o.null) {
|
|
2330
|
+
let t = this._getOrReturnCtx(e);
|
|
2331
|
+
return d(t, {
|
|
2332
|
+
code: c.invalid_type,
|
|
2333
|
+
expected: o.null,
|
|
2334
|
+
received: t.parsedType
|
|
2335
|
+
}), p;
|
|
2336
|
+
}
|
|
2337
|
+
return m(e.data);
|
|
2338
|
+
}
|
|
2339
|
+
};
|
|
2340
|
+
C.create = (e) => new C({
|
|
2341
|
+
typeName: W.ZodNull,
|
|
2342
|
+
...y(e)
|
|
2343
|
+
});
|
|
2344
|
+
var Le = class extends b {
|
|
2345
|
+
constructor() {
|
|
2346
|
+
super(...arguments), this._any = !0;
|
|
2347
|
+
}
|
|
2348
|
+
_parse(e) {
|
|
2349
|
+
return m(e.data);
|
|
2350
|
+
}
|
|
2351
|
+
};
|
|
2352
|
+
Le.create = (e) => new Le({
|
|
2353
|
+
typeName: W.ZodAny,
|
|
2354
|
+
...y(e)
|
|
2355
|
+
});
|
|
2356
|
+
var w = class extends b {
|
|
2357
|
+
constructor() {
|
|
2358
|
+
super(...arguments), this._unknown = !0;
|
|
2359
|
+
}
|
|
2360
|
+
_parse(e) {
|
|
2361
|
+
return m(e.data);
|
|
2362
|
+
}
|
|
2363
|
+
};
|
|
2364
|
+
w.create = (e) => new w({
|
|
2365
|
+
typeName: W.ZodUnknown,
|
|
2366
|
+
...y(e)
|
|
2367
|
+
});
|
|
2368
|
+
var T = class extends b {
|
|
2369
|
+
_parse(e) {
|
|
2370
|
+
let t = this._getOrReturnCtx(e);
|
|
2371
|
+
return d(t, {
|
|
2372
|
+
code: c.invalid_type,
|
|
2373
|
+
expected: o.never,
|
|
2374
|
+
received: t.parsedType
|
|
2375
|
+
}), p;
|
|
2376
|
+
}
|
|
2377
|
+
};
|
|
2378
|
+
T.create = (e) => new T({
|
|
2379
|
+
typeName: W.ZodNever,
|
|
2380
|
+
...y(e)
|
|
2381
|
+
});
|
|
2382
|
+
var Re = class extends b {
|
|
2383
|
+
_parse(e) {
|
|
2384
|
+
if (this._getType(e) !== o.undefined) {
|
|
2385
|
+
let t = this._getOrReturnCtx(e);
|
|
2386
|
+
return d(t, {
|
|
2387
|
+
code: c.invalid_type,
|
|
2388
|
+
expected: o.void,
|
|
2389
|
+
received: t.parsedType
|
|
2390
|
+
}), p;
|
|
2391
|
+
}
|
|
2392
|
+
return m(e.data);
|
|
2393
|
+
}
|
|
2394
|
+
};
|
|
2395
|
+
Re.create = (e) => new Re({
|
|
2396
|
+
typeName: W.ZodVoid,
|
|
2397
|
+
...y(e)
|
|
2398
|
+
});
|
|
2399
|
+
var E = class e extends b {
|
|
2400
|
+
_parse(e) {
|
|
2401
|
+
let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
|
|
2402
|
+
if (t.parsedType !== o.array) return d(t, {
|
|
2403
|
+
code: c.invalid_type,
|
|
2404
|
+
expected: o.array,
|
|
2405
|
+
received: t.parsedType
|
|
2406
|
+
}), p;
|
|
2407
|
+
if (r.exactLength !== null) {
|
|
2408
|
+
let e = t.data.length > r.exactLength.value, i = t.data.length < r.exactLength.value;
|
|
2409
|
+
(e || i) && (d(t, {
|
|
2410
|
+
code: e ? c.too_big : c.too_small,
|
|
2411
|
+
minimum: i ? r.exactLength.value : void 0,
|
|
2412
|
+
maximum: e ? r.exactLength.value : void 0,
|
|
2413
|
+
type: "array",
|
|
2414
|
+
inclusive: !0,
|
|
2415
|
+
exact: !0,
|
|
2416
|
+
message: r.exactLength.message
|
|
2417
|
+
}), n.dirty());
|
|
2418
|
+
}
|
|
2419
|
+
if (r.minLength !== null && t.data.length < r.minLength.value && (d(t, {
|
|
2420
|
+
code: c.too_small,
|
|
2421
|
+
minimum: r.minLength.value,
|
|
2422
|
+
type: "array",
|
|
2423
|
+
inclusive: !0,
|
|
2424
|
+
exact: !1,
|
|
2425
|
+
message: r.minLength.message
|
|
2426
|
+
}), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (d(t, {
|
|
2427
|
+
code: c.too_big,
|
|
2428
|
+
maximum: r.maxLength.value,
|
|
2429
|
+
type: "array",
|
|
2430
|
+
inclusive: !0,
|
|
2431
|
+
exact: !1,
|
|
2432
|
+
message: r.maxLength.message
|
|
2433
|
+
}), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new v(t, e, t.path, n)))).then((e) => f.mergeArray(n, e));
|
|
2434
|
+
let i = [...t.data].map((e, n) => r.type._parseSync(new v(t, e, t.path, n)));
|
|
2435
|
+
return f.mergeArray(n, i);
|
|
2436
|
+
}
|
|
2437
|
+
get element() {
|
|
2438
|
+
return this._def.type;
|
|
2439
|
+
}
|
|
2440
|
+
min(t, n) {
|
|
2441
|
+
return new e({
|
|
2442
|
+
...this._def,
|
|
2443
|
+
minLength: {
|
|
2444
|
+
value: t,
|
|
2445
|
+
message: _.toString(n)
|
|
2446
|
+
}
|
|
2447
|
+
});
|
|
2448
|
+
}
|
|
2449
|
+
max(t, n) {
|
|
2450
|
+
return new e({
|
|
2451
|
+
...this._def,
|
|
2452
|
+
maxLength: {
|
|
2453
|
+
value: t,
|
|
2454
|
+
message: _.toString(n)
|
|
2455
|
+
}
|
|
2456
|
+
});
|
|
2457
|
+
}
|
|
2458
|
+
length(t, n) {
|
|
2459
|
+
return new e({
|
|
2460
|
+
...this._def,
|
|
2461
|
+
exactLength: {
|
|
2462
|
+
value: t,
|
|
2463
|
+
message: _.toString(n)
|
|
2464
|
+
}
|
|
2465
|
+
});
|
|
2466
|
+
}
|
|
2467
|
+
nonempty(e) {
|
|
2468
|
+
return this.min(1, e);
|
|
2469
|
+
}
|
|
2470
|
+
};
|
|
2471
|
+
E.create = (e, t) => new E({
|
|
2472
|
+
type: e,
|
|
2473
|
+
minLength: null,
|
|
2474
|
+
maxLength: null,
|
|
2475
|
+
exactLength: null,
|
|
2476
|
+
typeName: W.ZodArray,
|
|
2477
|
+
...y(t)
|
|
2478
|
+
});
|
|
2479
|
+
function D(e) {
|
|
2480
|
+
if (e instanceof O) {
|
|
2481
|
+
let t = {};
|
|
2482
|
+
for (let n in e.shape) {
|
|
2483
|
+
let r = e.shape[n];
|
|
2484
|
+
t[n] = z.create(D(r));
|
|
2485
|
+
}
|
|
2486
|
+
return new O({
|
|
2487
|
+
...e._def,
|
|
2488
|
+
shape: () => t
|
|
2489
|
+
});
|
|
2490
|
+
} else if (e instanceof E) return new E({
|
|
2491
|
+
...e._def,
|
|
2492
|
+
type: D(e.element)
|
|
2493
|
+
});
|
|
2494
|
+
else if (e instanceof z) return z.create(D(e.unwrap()));
|
|
2495
|
+
else if (e instanceof B) return B.create(D(e.unwrap()));
|
|
2496
|
+
else if (e instanceof M) return M.create(e.items.map((e) => D(e)));
|
|
2497
|
+
else return e;
|
|
2498
|
+
}
|
|
2499
|
+
var O = class e extends b {
|
|
2500
|
+
constructor() {
|
|
2501
|
+
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
2502
|
+
}
|
|
2503
|
+
_getCached() {
|
|
2504
|
+
if (this._cached !== null) return this._cached;
|
|
2505
|
+
let e = this._def.shape();
|
|
2506
|
+
return this._cached = {
|
|
2507
|
+
shape: e,
|
|
2508
|
+
keys: i.objectKeys(e)
|
|
2509
|
+
}, this._cached;
|
|
2510
|
+
}
|
|
2511
|
+
_parse(e) {
|
|
2512
|
+
if (this._getType(e) !== o.object) {
|
|
2513
|
+
let t = this._getOrReturnCtx(e);
|
|
2514
|
+
return d(t, {
|
|
2515
|
+
code: c.invalid_type,
|
|
2516
|
+
expected: o.object,
|
|
2517
|
+
received: t.parsedType
|
|
2518
|
+
}), p;
|
|
2519
|
+
}
|
|
2520
|
+
let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = [];
|
|
2521
|
+
if (!(this._def.catchall instanceof T && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
|
|
2522
|
+
let s = [];
|
|
2523
|
+
for (let e of i) {
|
|
2524
|
+
let t = r[e], i = n.data[e];
|
|
2525
|
+
s.push({
|
|
2526
|
+
key: {
|
|
2527
|
+
status: "valid",
|
|
2528
|
+
value: e
|
|
2529
|
+
},
|
|
2530
|
+
value: t._parse(new v(n, i, n.path, e)),
|
|
2531
|
+
alwaysSet: e in n.data
|
|
2532
|
+
});
|
|
2533
|
+
}
|
|
2534
|
+
if (this._def.catchall instanceof T) {
|
|
2535
|
+
let e = this._def.unknownKeys;
|
|
2536
|
+
if (e === "passthrough") for (let e of a) s.push({
|
|
2537
|
+
key: {
|
|
2538
|
+
status: "valid",
|
|
2539
|
+
value: e
|
|
2540
|
+
},
|
|
2541
|
+
value: {
|
|
2542
|
+
status: "valid",
|
|
2543
|
+
value: n.data[e]
|
|
2544
|
+
}
|
|
2545
|
+
});
|
|
2546
|
+
else if (e === "strict") a.length > 0 && (d(n, {
|
|
2547
|
+
code: c.unrecognized_keys,
|
|
2548
|
+
keys: a
|
|
2549
|
+
}), t.dirty());
|
|
2550
|
+
else if (e !== "strip") throw Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
2551
|
+
} else {
|
|
2552
|
+
let e = this._def.catchall;
|
|
2553
|
+
for (let t of a) {
|
|
2554
|
+
let r = n.data[t];
|
|
2555
|
+
s.push({
|
|
2556
|
+
key: {
|
|
2557
|
+
status: "valid",
|
|
2558
|
+
value: t
|
|
2559
|
+
},
|
|
2560
|
+
value: e._parse(new v(n, r, n.path, t)),
|
|
2561
|
+
alwaysSet: t in n.data
|
|
2562
|
+
});
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
return n.common.async ? Promise.resolve().then(async () => {
|
|
2566
|
+
let e = [];
|
|
2567
|
+
for (let t of s) {
|
|
2568
|
+
let n = await t.key, r = await t.value;
|
|
2569
|
+
e.push({
|
|
2570
|
+
key: n,
|
|
2571
|
+
value: r,
|
|
2572
|
+
alwaysSet: t.alwaysSet
|
|
2573
|
+
});
|
|
2574
|
+
}
|
|
2575
|
+
return e;
|
|
2576
|
+
}).then((e) => f.mergeObjectSync(t, e)) : f.mergeObjectSync(t, s);
|
|
2577
|
+
}
|
|
2578
|
+
get shape() {
|
|
2579
|
+
return this._def.shape();
|
|
2580
|
+
}
|
|
2581
|
+
strict(t) {
|
|
2582
|
+
return _.errToObj, new e({
|
|
2583
|
+
...this._def,
|
|
2584
|
+
unknownKeys: "strict",
|
|
2585
|
+
...t === void 0 ? {} : { errorMap: (e, n) => {
|
|
2586
|
+
let r = this._def.errorMap?.(e, n).message ?? n.defaultError;
|
|
2587
|
+
return e.code === "unrecognized_keys" ? { message: _.errToObj(t).message ?? r } : { message: r };
|
|
2588
|
+
} }
|
|
2589
|
+
});
|
|
2590
|
+
}
|
|
2591
|
+
strip() {
|
|
2592
|
+
return new e({
|
|
2593
|
+
...this._def,
|
|
2594
|
+
unknownKeys: "strip"
|
|
2595
|
+
});
|
|
2596
|
+
}
|
|
2597
|
+
passthrough() {
|
|
2598
|
+
return new e({
|
|
2599
|
+
...this._def,
|
|
2600
|
+
unknownKeys: "passthrough"
|
|
2601
|
+
});
|
|
2602
|
+
}
|
|
2603
|
+
extend(t) {
|
|
2604
|
+
return new e({
|
|
2605
|
+
...this._def,
|
|
2606
|
+
shape: () => ({
|
|
2607
|
+
...this._def.shape(),
|
|
2608
|
+
...t
|
|
2609
|
+
})
|
|
2610
|
+
});
|
|
2611
|
+
}
|
|
2612
|
+
merge(t) {
|
|
2613
|
+
return new e({
|
|
2614
|
+
unknownKeys: t._def.unknownKeys,
|
|
2615
|
+
catchall: t._def.catchall,
|
|
2616
|
+
shape: () => ({
|
|
2617
|
+
...this._def.shape(),
|
|
2618
|
+
...t._def.shape()
|
|
2619
|
+
}),
|
|
2620
|
+
typeName: W.ZodObject
|
|
2621
|
+
});
|
|
2622
|
+
}
|
|
2623
|
+
setKey(e, t) {
|
|
2624
|
+
return this.augment({ [e]: t });
|
|
2625
|
+
}
|
|
2626
|
+
catchall(t) {
|
|
2627
|
+
return new e({
|
|
2628
|
+
...this._def,
|
|
2629
|
+
catchall: t
|
|
2630
|
+
});
|
|
2631
|
+
}
|
|
2632
|
+
pick(t) {
|
|
2633
|
+
let n = {};
|
|
2634
|
+
for (let e of i.objectKeys(t)) t[e] && this.shape[e] && (n[e] = this.shape[e]);
|
|
2635
|
+
return new e({
|
|
2636
|
+
...this._def,
|
|
2637
|
+
shape: () => n
|
|
2638
|
+
});
|
|
2639
|
+
}
|
|
2640
|
+
omit(t) {
|
|
2641
|
+
let n = {};
|
|
2642
|
+
for (let e of i.objectKeys(this.shape)) t[e] || (n[e] = this.shape[e]);
|
|
2643
|
+
return new e({
|
|
2644
|
+
...this._def,
|
|
2645
|
+
shape: () => n
|
|
2646
|
+
});
|
|
2647
|
+
}
|
|
2648
|
+
deepPartial() {
|
|
2649
|
+
return D(this);
|
|
2650
|
+
}
|
|
2651
|
+
partial(t) {
|
|
2652
|
+
let n = {};
|
|
2653
|
+
for (let e of i.objectKeys(this.shape)) {
|
|
2654
|
+
let r = this.shape[e];
|
|
2655
|
+
t && !t[e] ? n[e] = r : n[e] = r.optional();
|
|
2656
|
+
}
|
|
2657
|
+
return new e({
|
|
2658
|
+
...this._def,
|
|
2659
|
+
shape: () => n
|
|
2660
|
+
});
|
|
2661
|
+
}
|
|
2662
|
+
required(t) {
|
|
2663
|
+
let n = {};
|
|
2664
|
+
for (let e of i.objectKeys(this.shape)) if (t && !t[e]) n[e] = this.shape[e];
|
|
2665
|
+
else {
|
|
2666
|
+
let t = this.shape[e];
|
|
2667
|
+
for (; t instanceof z;) t = t._def.innerType;
|
|
2668
|
+
n[e] = t;
|
|
2669
|
+
}
|
|
2670
|
+
return new e({
|
|
2671
|
+
...this._def,
|
|
2672
|
+
shape: () => n
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
keyof() {
|
|
2676
|
+
return Ge(i.objectKeys(this.shape));
|
|
2677
|
+
}
|
|
2678
|
+
};
|
|
2679
|
+
O.create = (e, t) => new O({
|
|
2680
|
+
shape: () => e,
|
|
2681
|
+
unknownKeys: "strip",
|
|
2682
|
+
catchall: T.create(),
|
|
2683
|
+
typeName: W.ZodObject,
|
|
2684
|
+
...y(t)
|
|
2685
|
+
}), O.strictCreate = (e, t) => new O({
|
|
2686
|
+
shape: () => e,
|
|
2687
|
+
unknownKeys: "strict",
|
|
2688
|
+
catchall: T.create(),
|
|
2689
|
+
typeName: W.ZodObject,
|
|
2690
|
+
...y(t)
|
|
2691
|
+
}), O.lazycreate = (e, t) => new O({
|
|
2692
|
+
shape: e,
|
|
2693
|
+
unknownKeys: "strip",
|
|
2694
|
+
catchall: T.create(),
|
|
2695
|
+
typeName: W.ZodObject,
|
|
2696
|
+
...y(t)
|
|
2697
|
+
});
|
|
2698
|
+
var k = class extends b {
|
|
2699
|
+
_parse(e) {
|
|
2700
|
+
let { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
2701
|
+
function r(e) {
|
|
2702
|
+
for (let t of e) if (t.result.status === "valid") return t.result;
|
|
2703
|
+
for (let n of e) if (n.result.status === "dirty") return t.common.issues.push(...n.ctx.common.issues), n.result;
|
|
2704
|
+
let n = e.map((e) => new l(e.ctx.common.issues));
|
|
2705
|
+
return d(t, {
|
|
2706
|
+
code: c.invalid_union,
|
|
2707
|
+
unionErrors: n
|
|
2708
|
+
}), p;
|
|
2709
|
+
}
|
|
2710
|
+
if (t.common.async) return Promise.all(n.map(async (e) => {
|
|
2711
|
+
let n = {
|
|
2712
|
+
...t,
|
|
2713
|
+
common: {
|
|
2714
|
+
...t.common,
|
|
2715
|
+
issues: []
|
|
2716
|
+
},
|
|
2717
|
+
parent: null
|
|
2718
|
+
};
|
|
2719
|
+
return {
|
|
2720
|
+
result: await e._parseAsync({
|
|
2721
|
+
data: t.data,
|
|
2722
|
+
path: t.path,
|
|
2723
|
+
parent: n
|
|
2724
|
+
}),
|
|
2725
|
+
ctx: n
|
|
2726
|
+
};
|
|
2727
|
+
})).then(r);
|
|
2728
|
+
{
|
|
2729
|
+
let e, r = [];
|
|
2730
|
+
for (let i of n) {
|
|
2731
|
+
let n = {
|
|
2732
|
+
...t,
|
|
2733
|
+
common: {
|
|
2734
|
+
...t.common,
|
|
2735
|
+
issues: []
|
|
2736
|
+
},
|
|
2737
|
+
parent: null
|
|
2738
|
+
}, a = i._parseSync({
|
|
2739
|
+
data: t.data,
|
|
2740
|
+
path: t.path,
|
|
2741
|
+
parent: n
|
|
2742
|
+
});
|
|
2743
|
+
if (a.status === "valid") return a;
|
|
2744
|
+
a.status === "dirty" && !e && (e = {
|
|
2745
|
+
result: a,
|
|
2746
|
+
ctx: n
|
|
2747
|
+
}), n.common.issues.length && r.push(n.common.issues);
|
|
2748
|
+
}
|
|
2749
|
+
if (e) return t.common.issues.push(...e.ctx.common.issues), e.result;
|
|
2750
|
+
let i = r.map((e) => new l(e));
|
|
2751
|
+
return d(t, {
|
|
2752
|
+
code: c.invalid_union,
|
|
2753
|
+
unionErrors: i
|
|
2754
|
+
}), p;
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
get options() {
|
|
2758
|
+
return this._def.options;
|
|
2759
|
+
}
|
|
2760
|
+
};
|
|
2761
|
+
k.create = (e, t) => new k({
|
|
2762
|
+
options: e,
|
|
2763
|
+
typeName: W.ZodUnion,
|
|
2764
|
+
...y(t)
|
|
2765
|
+
});
|
|
2766
|
+
var A = (e) => e instanceof N ? A(e.schema) : e instanceof R ? A(e.innerType()) : e instanceof P ? [e.value] : e instanceof F ? e.options : e instanceof I ? i.objectValues(e.enum) : e instanceof V ? A(e._def.innerType) : e instanceof S ? [void 0] : e instanceof C ? [null] : e instanceof z ? [void 0, ...A(e.unwrap())] : e instanceof B ? [null, ...A(e.unwrap())] : e instanceof qe || e instanceof U ? A(e.unwrap()) : e instanceof H ? A(e._def.innerType) : [], ze = class e extends b {
|
|
2767
|
+
_parse(e) {
|
|
2768
|
+
let { ctx: t } = this._processInputParams(e);
|
|
2769
|
+
if (t.parsedType !== o.object) return d(t, {
|
|
2770
|
+
code: c.invalid_type,
|
|
2771
|
+
expected: o.object,
|
|
2772
|
+
received: t.parsedType
|
|
2773
|
+
}), p;
|
|
2774
|
+
let n = this.discriminator, r = t.data[n], i = this.optionsMap.get(r);
|
|
2775
|
+
return i ? t.common.async ? i._parseAsync({
|
|
2776
|
+
data: t.data,
|
|
2777
|
+
path: t.path,
|
|
2778
|
+
parent: t
|
|
2779
|
+
}) : i._parseSync({
|
|
2780
|
+
data: t.data,
|
|
2781
|
+
path: t.path,
|
|
2782
|
+
parent: t
|
|
2783
|
+
}) : (d(t, {
|
|
2784
|
+
code: c.invalid_union_discriminator,
|
|
2785
|
+
options: Array.from(this.optionsMap.keys()),
|
|
2786
|
+
path: [n]
|
|
2787
|
+
}), p);
|
|
2788
|
+
}
|
|
2789
|
+
get discriminator() {
|
|
2790
|
+
return this._def.discriminator;
|
|
2791
|
+
}
|
|
2792
|
+
get options() {
|
|
2793
|
+
return this._def.options;
|
|
2794
|
+
}
|
|
2795
|
+
get optionsMap() {
|
|
2796
|
+
return this._def.optionsMap;
|
|
2797
|
+
}
|
|
2798
|
+
static create(t, n, r) {
|
|
2799
|
+
let i = /* @__PURE__ */ new Map();
|
|
2800
|
+
for (let e of n) {
|
|
2801
|
+
let n = A(e.shape[t]);
|
|
2802
|
+
if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
2803
|
+
for (let r of n) {
|
|
2804
|
+
if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
|
|
2805
|
+
i.set(r, e);
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
return new e({
|
|
2809
|
+
typeName: W.ZodDiscriminatedUnion,
|
|
2810
|
+
discriminator: t,
|
|
2811
|
+
options: n,
|
|
2812
|
+
optionsMap: i,
|
|
2813
|
+
...y(r)
|
|
2814
|
+
});
|
|
2815
|
+
}
|
|
2816
|
+
};
|
|
2817
|
+
function Be(e, t) {
|
|
2818
|
+
let n = s(e), r = s(t);
|
|
2819
|
+
if (e === t) return {
|
|
2820
|
+
valid: !0,
|
|
2821
|
+
data: e
|
|
2822
|
+
};
|
|
2823
|
+
if (n === o.object && r === o.object) {
|
|
2824
|
+
let n = i.objectKeys(t), r = i.objectKeys(e).filter((e) => n.indexOf(e) !== -1), a = {
|
|
2825
|
+
...e,
|
|
2826
|
+
...t
|
|
2827
|
+
};
|
|
2828
|
+
for (let n of r) {
|
|
2829
|
+
let r = Be(e[n], t[n]);
|
|
2830
|
+
if (!r.valid) return { valid: !1 };
|
|
2831
|
+
a[n] = r.data;
|
|
2832
|
+
}
|
|
2833
|
+
return {
|
|
2834
|
+
valid: !0,
|
|
2835
|
+
data: a
|
|
2836
|
+
};
|
|
2837
|
+
} else if (n === o.array && r === o.array) {
|
|
2838
|
+
if (e.length !== t.length) return { valid: !1 };
|
|
2839
|
+
let n = [];
|
|
2840
|
+
for (let r = 0; r < e.length; r++) {
|
|
2841
|
+
let i = e[r], a = t[r], o = Be(i, a);
|
|
2842
|
+
if (!o.valid) return { valid: !1 };
|
|
2843
|
+
n.push(o.data);
|
|
2844
|
+
}
|
|
2845
|
+
return {
|
|
2846
|
+
valid: !0,
|
|
2847
|
+
data: n
|
|
2848
|
+
};
|
|
2849
|
+
} else if (n === o.date && r === o.date && +e == +t) return {
|
|
2850
|
+
valid: !0,
|
|
2851
|
+
data: e
|
|
2852
|
+
};
|
|
2853
|
+
else return { valid: !1 };
|
|
2854
|
+
}
|
|
2855
|
+
var j = class extends b {
|
|
2856
|
+
_parse(e) {
|
|
2857
|
+
let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
|
|
2858
|
+
if (ie(e) || ie(r)) return p;
|
|
2859
|
+
let i = Be(e.value, r.value);
|
|
2860
|
+
return i.valid ? ((ae(e) || ae(r)) && t.dirty(), {
|
|
2861
|
+
status: t.value,
|
|
2862
|
+
value: i.data
|
|
2863
|
+
}) : (d(n, { code: c.invalid_intersection_types }), p);
|
|
2864
|
+
};
|
|
2865
|
+
return n.common.async ? Promise.all([this._def.left._parseAsync({
|
|
2866
|
+
data: n.data,
|
|
2867
|
+
path: n.path,
|
|
2868
|
+
parent: n
|
|
2869
|
+
}), this._def.right._parseAsync({
|
|
2870
|
+
data: n.data,
|
|
2871
|
+
path: n.path,
|
|
2872
|
+
parent: n
|
|
2873
|
+
})]).then(([e, t]) => r(e, t)) : r(this._def.left._parseSync({
|
|
2874
|
+
data: n.data,
|
|
2875
|
+
path: n.path,
|
|
2876
|
+
parent: n
|
|
2877
|
+
}), this._def.right._parseSync({
|
|
2878
|
+
data: n.data,
|
|
2879
|
+
path: n.path,
|
|
2880
|
+
parent: n
|
|
2881
|
+
}));
|
|
2882
|
+
}
|
|
2883
|
+
};
|
|
2884
|
+
j.create = (e, t, n) => new j({
|
|
2885
|
+
left: e,
|
|
2886
|
+
right: t,
|
|
2887
|
+
typeName: W.ZodIntersection,
|
|
2888
|
+
...y(n)
|
|
2889
|
+
});
|
|
2890
|
+
var M = class e extends b {
|
|
2891
|
+
_parse(e) {
|
|
2892
|
+
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2893
|
+
if (n.parsedType !== o.array) return d(n, {
|
|
2894
|
+
code: c.invalid_type,
|
|
2895
|
+
expected: o.array,
|
|
2896
|
+
received: n.parsedType
|
|
2897
|
+
}), p;
|
|
2898
|
+
if (n.data.length < this._def.items.length) return d(n, {
|
|
2899
|
+
code: c.too_small,
|
|
2900
|
+
minimum: this._def.items.length,
|
|
2901
|
+
inclusive: !0,
|
|
2902
|
+
exact: !1,
|
|
2903
|
+
type: "array"
|
|
2904
|
+
}), p;
|
|
2905
|
+
!this._def.rest && n.data.length > this._def.items.length && (d(n, {
|
|
2906
|
+
code: c.too_big,
|
|
2907
|
+
maximum: this._def.items.length,
|
|
2908
|
+
inclusive: !0,
|
|
2909
|
+
exact: !1,
|
|
2910
|
+
type: "array"
|
|
2911
|
+
}), t.dirty());
|
|
2912
|
+
let r = [...n.data].map((e, t) => {
|
|
2913
|
+
let r = this._def.items[t] || this._def.rest;
|
|
2914
|
+
return r ? r._parse(new v(n, e, n.path, t)) : null;
|
|
2915
|
+
}).filter((e) => !!e);
|
|
2916
|
+
return n.common.async ? Promise.all(r).then((e) => f.mergeArray(t, e)) : f.mergeArray(t, r);
|
|
2917
|
+
}
|
|
2918
|
+
get items() {
|
|
2919
|
+
return this._def.items;
|
|
2920
|
+
}
|
|
2921
|
+
rest(t) {
|
|
2922
|
+
return new e({
|
|
2923
|
+
...this._def,
|
|
2924
|
+
rest: t
|
|
2925
|
+
});
|
|
2926
|
+
}
|
|
2927
|
+
};
|
|
2928
|
+
M.create = (e, t) => {
|
|
2929
|
+
if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2930
|
+
return new M({
|
|
2931
|
+
items: e,
|
|
2932
|
+
typeName: W.ZodTuple,
|
|
2933
|
+
rest: null,
|
|
2934
|
+
...y(t)
|
|
2935
|
+
});
|
|
2936
|
+
};
|
|
2937
|
+
var Ve = class e extends b {
|
|
2938
|
+
get keySchema() {
|
|
2939
|
+
return this._def.keyType;
|
|
2940
|
+
}
|
|
2941
|
+
get valueSchema() {
|
|
2942
|
+
return this._def.valueType;
|
|
2943
|
+
}
|
|
2944
|
+
_parse(e) {
|
|
2945
|
+
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2946
|
+
if (n.parsedType !== o.object) return d(n, {
|
|
2947
|
+
code: c.invalid_type,
|
|
2948
|
+
expected: o.object,
|
|
2949
|
+
received: n.parsedType
|
|
2950
|
+
}), p;
|
|
2951
|
+
let r = [], i = this._def.keyType, a = this._def.valueType;
|
|
2952
|
+
for (let e in n.data) r.push({
|
|
2953
|
+
key: i._parse(new v(n, e, n.path, e)),
|
|
2954
|
+
value: a._parse(new v(n, n.data[e], n.path, e)),
|
|
2955
|
+
alwaysSet: e in n.data
|
|
2956
|
+
});
|
|
2957
|
+
return n.common.async ? f.mergeObjectAsync(t, r) : f.mergeObjectSync(t, r);
|
|
2958
|
+
}
|
|
2959
|
+
get element() {
|
|
2960
|
+
return this._def.valueType;
|
|
2961
|
+
}
|
|
2962
|
+
static create(t, n, r) {
|
|
2963
|
+
return n instanceof b ? new e({
|
|
2964
|
+
keyType: t,
|
|
2965
|
+
valueType: n,
|
|
2966
|
+
typeName: W.ZodRecord,
|
|
2967
|
+
...y(r)
|
|
2968
|
+
}) : new e({
|
|
2969
|
+
keyType: x.create(),
|
|
2970
|
+
valueType: t,
|
|
2971
|
+
typeName: W.ZodRecord,
|
|
2972
|
+
...y(n)
|
|
2973
|
+
});
|
|
2974
|
+
}
|
|
2975
|
+
}, He = class extends b {
|
|
2976
|
+
get keySchema() {
|
|
2977
|
+
return this._def.keyType;
|
|
2978
|
+
}
|
|
2979
|
+
get valueSchema() {
|
|
2980
|
+
return this._def.valueType;
|
|
2981
|
+
}
|
|
2982
|
+
_parse(e) {
|
|
2983
|
+
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2984
|
+
if (n.parsedType !== o.map) return d(n, {
|
|
2985
|
+
code: c.invalid_type,
|
|
2986
|
+
expected: o.map,
|
|
2987
|
+
received: n.parsedType
|
|
2988
|
+
}), p;
|
|
2989
|
+
let r = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([e, t], a) => ({
|
|
2990
|
+
key: r._parse(new v(n, e, n.path, [a, "key"])),
|
|
2991
|
+
value: i._parse(new v(n, t, n.path, [a, "value"]))
|
|
2992
|
+
}));
|
|
2993
|
+
if (n.common.async) {
|
|
2994
|
+
let e = /* @__PURE__ */ new Map();
|
|
2995
|
+
return Promise.resolve().then(async () => {
|
|
2996
|
+
for (let n of a) {
|
|
2997
|
+
let r = await n.key, i = await n.value;
|
|
2998
|
+
if (r.status === "aborted" || i.status === "aborted") return p;
|
|
2999
|
+
(r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
|
|
3000
|
+
}
|
|
3001
|
+
return {
|
|
3002
|
+
status: t.value,
|
|
3003
|
+
value: e
|
|
3004
|
+
};
|
|
3005
|
+
});
|
|
3006
|
+
} else {
|
|
3007
|
+
let e = /* @__PURE__ */ new Map();
|
|
3008
|
+
for (let n of a) {
|
|
3009
|
+
let r = n.key, i = n.value;
|
|
3010
|
+
if (r.status === "aborted" || i.status === "aborted") return p;
|
|
3011
|
+
(r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
|
|
3012
|
+
}
|
|
3013
|
+
return {
|
|
3014
|
+
status: t.value,
|
|
3015
|
+
value: e
|
|
3016
|
+
};
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
};
|
|
3020
|
+
He.create = (e, t, n) => new He({
|
|
3021
|
+
valueType: t,
|
|
3022
|
+
keyType: e,
|
|
3023
|
+
typeName: W.ZodMap,
|
|
3024
|
+
...y(n)
|
|
3025
|
+
});
|
|
3026
|
+
var Ue = class e extends b {
|
|
3027
|
+
_parse(e) {
|
|
3028
|
+
let { status: t, ctx: n } = this._processInputParams(e);
|
|
3029
|
+
if (n.parsedType !== o.set) return d(n, {
|
|
3030
|
+
code: c.invalid_type,
|
|
3031
|
+
expected: o.set,
|
|
3032
|
+
received: n.parsedType
|
|
3033
|
+
}), p;
|
|
3034
|
+
let r = this._def;
|
|
3035
|
+
r.minSize !== null && n.data.size < r.minSize.value && (d(n, {
|
|
3036
|
+
code: c.too_small,
|
|
3037
|
+
minimum: r.minSize.value,
|
|
3038
|
+
type: "set",
|
|
3039
|
+
inclusive: !0,
|
|
3040
|
+
exact: !1,
|
|
3041
|
+
message: r.minSize.message
|
|
3042
|
+
}), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (d(n, {
|
|
3043
|
+
code: c.too_big,
|
|
3044
|
+
maximum: r.maxSize.value,
|
|
3045
|
+
type: "set",
|
|
3046
|
+
inclusive: !0,
|
|
3047
|
+
exact: !1,
|
|
3048
|
+
message: r.maxSize.message
|
|
3049
|
+
}), t.dirty());
|
|
3050
|
+
let i = this._def.valueType;
|
|
3051
|
+
function a(e) {
|
|
3052
|
+
let n = /* @__PURE__ */ new Set();
|
|
3053
|
+
for (let r of e) {
|
|
3054
|
+
if (r.status === "aborted") return p;
|
|
3055
|
+
r.status === "dirty" && t.dirty(), n.add(r.value);
|
|
3056
|
+
}
|
|
3057
|
+
return {
|
|
3058
|
+
status: t.value,
|
|
3059
|
+
value: n
|
|
3060
|
+
};
|
|
3061
|
+
}
|
|
3062
|
+
let s = [...n.data.values()].map((e, t) => i._parse(new v(n, e, n.path, t)));
|
|
3063
|
+
return n.common.async ? Promise.all(s).then((e) => a(e)) : a(s);
|
|
3064
|
+
}
|
|
3065
|
+
min(t, n) {
|
|
3066
|
+
return new e({
|
|
3067
|
+
...this._def,
|
|
3068
|
+
minSize: {
|
|
3069
|
+
value: t,
|
|
3070
|
+
message: _.toString(n)
|
|
3071
|
+
}
|
|
3072
|
+
});
|
|
3073
|
+
}
|
|
3074
|
+
max(t, n) {
|
|
3075
|
+
return new e({
|
|
3076
|
+
...this._def,
|
|
3077
|
+
maxSize: {
|
|
3078
|
+
value: t,
|
|
3079
|
+
message: _.toString(n)
|
|
3080
|
+
}
|
|
3081
|
+
});
|
|
3082
|
+
}
|
|
3083
|
+
size(e, t) {
|
|
3084
|
+
return this.min(e, t).max(e, t);
|
|
3085
|
+
}
|
|
3086
|
+
nonempty(e) {
|
|
3087
|
+
return this.min(1, e);
|
|
3088
|
+
}
|
|
3089
|
+
};
|
|
3090
|
+
Ue.create = (e, t) => new Ue({
|
|
3091
|
+
valueType: e,
|
|
3092
|
+
minSize: null,
|
|
3093
|
+
maxSize: null,
|
|
3094
|
+
typeName: W.ZodSet,
|
|
3095
|
+
...y(t)
|
|
3096
|
+
});
|
|
3097
|
+
var We = class e extends b {
|
|
3098
|
+
constructor() {
|
|
3099
|
+
super(...arguments), this.validate = this.implement;
|
|
3100
|
+
}
|
|
3101
|
+
_parse(e) {
|
|
3102
|
+
let { ctx: t } = this._processInputParams(e);
|
|
3103
|
+
if (t.parsedType !== o.function) return d(t, {
|
|
3104
|
+
code: c.invalid_type,
|
|
3105
|
+
expected: o.function,
|
|
3106
|
+
received: t.parsedType
|
|
3107
|
+
}), p;
|
|
3108
|
+
function n(e, n) {
|
|
3109
|
+
return ne({
|
|
3110
|
+
data: e,
|
|
3111
|
+
path: t.path,
|
|
3112
|
+
errorMaps: [
|
|
3113
|
+
t.common.contextualErrorMap,
|
|
3114
|
+
t.schemaErrorMap,
|
|
3115
|
+
te(),
|
|
3116
|
+
u
|
|
3117
|
+
].filter((e) => !!e),
|
|
3118
|
+
issueData: {
|
|
3119
|
+
code: c.invalid_arguments,
|
|
3120
|
+
argumentsError: n
|
|
3121
|
+
}
|
|
3122
|
+
});
|
|
3123
|
+
}
|
|
3124
|
+
function r(e, n) {
|
|
3125
|
+
return ne({
|
|
3126
|
+
data: e,
|
|
3127
|
+
path: t.path,
|
|
3128
|
+
errorMaps: [
|
|
3129
|
+
t.common.contextualErrorMap,
|
|
3130
|
+
t.schemaErrorMap,
|
|
3131
|
+
te(),
|
|
3132
|
+
u
|
|
3133
|
+
].filter((e) => !!e),
|
|
3134
|
+
issueData: {
|
|
3135
|
+
code: c.invalid_return_type,
|
|
3136
|
+
returnTypeError: n
|
|
3137
|
+
}
|
|
3138
|
+
});
|
|
3139
|
+
}
|
|
3140
|
+
let i = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
3141
|
+
if (this._def.returns instanceof L) {
|
|
3142
|
+
let e = this;
|
|
3143
|
+
return m(async function(...t) {
|
|
3144
|
+
let o = new l([]), s = await e._def.args.parseAsync(t, i).catch((e) => {
|
|
3145
|
+
throw o.addIssue(n(t, e)), o;
|
|
3146
|
+
}), c = await Reflect.apply(a, this, s);
|
|
3147
|
+
return await e._def.returns._def.type.parseAsync(c, i).catch((e) => {
|
|
3148
|
+
throw o.addIssue(r(c, e)), o;
|
|
3149
|
+
});
|
|
3150
|
+
});
|
|
3151
|
+
} else {
|
|
3152
|
+
let e = this;
|
|
3153
|
+
return m(function(...t) {
|
|
3154
|
+
let o = e._def.args.safeParse(t, i);
|
|
3155
|
+
if (!o.success) throw new l([n(t, o.error)]);
|
|
3156
|
+
let s = Reflect.apply(a, this, o.data), c = e._def.returns.safeParse(s, i);
|
|
3157
|
+
if (!c.success) throw new l([r(s, c.error)]);
|
|
3158
|
+
return c.data;
|
|
3159
|
+
});
|
|
3160
|
+
}
|
|
3161
|
+
}
|
|
3162
|
+
parameters() {
|
|
3163
|
+
return this._def.args;
|
|
3164
|
+
}
|
|
3165
|
+
returnType() {
|
|
3166
|
+
return this._def.returns;
|
|
3167
|
+
}
|
|
3168
|
+
args(...t) {
|
|
3169
|
+
return new e({
|
|
3170
|
+
...this._def,
|
|
3171
|
+
args: M.create(t).rest(w.create())
|
|
3172
|
+
});
|
|
3173
|
+
}
|
|
3174
|
+
returns(t) {
|
|
3175
|
+
return new e({
|
|
3176
|
+
...this._def,
|
|
3177
|
+
returns: t
|
|
3178
|
+
});
|
|
3179
|
+
}
|
|
3180
|
+
implement(e) {
|
|
3181
|
+
return this.parse(e);
|
|
3182
|
+
}
|
|
3183
|
+
strictImplement(e) {
|
|
3184
|
+
return this.parse(e);
|
|
3185
|
+
}
|
|
3186
|
+
static create(t, n, r) {
|
|
3187
|
+
return new e({
|
|
3188
|
+
args: t || M.create([]).rest(w.create()),
|
|
3189
|
+
returns: n || w.create(),
|
|
3190
|
+
typeName: W.ZodFunction,
|
|
3191
|
+
...y(r)
|
|
3192
|
+
});
|
|
3193
|
+
}
|
|
3194
|
+
}, N = class extends b {
|
|
3195
|
+
get schema() {
|
|
3196
|
+
return this._def.getter();
|
|
3197
|
+
}
|
|
3198
|
+
_parse(e) {
|
|
3199
|
+
let { ctx: t } = this._processInputParams(e);
|
|
3200
|
+
return this._def.getter()._parse({
|
|
3201
|
+
data: t.data,
|
|
3202
|
+
path: t.path,
|
|
3203
|
+
parent: t
|
|
3204
|
+
});
|
|
3205
|
+
}
|
|
3206
|
+
};
|
|
3207
|
+
N.create = (e, t) => new N({
|
|
3208
|
+
getter: e,
|
|
3209
|
+
typeName: W.ZodLazy,
|
|
3210
|
+
...y(t)
|
|
3211
|
+
});
|
|
3212
|
+
var P = class extends b {
|
|
3213
|
+
_parse(e) {
|
|
3214
|
+
if (e.data !== this._def.value) {
|
|
3215
|
+
let t = this._getOrReturnCtx(e);
|
|
3216
|
+
return d(t, {
|
|
3217
|
+
received: t.data,
|
|
3218
|
+
code: c.invalid_literal,
|
|
3219
|
+
expected: this._def.value
|
|
3220
|
+
}), p;
|
|
3221
|
+
}
|
|
3222
|
+
return {
|
|
3223
|
+
status: "valid",
|
|
3224
|
+
value: e.data
|
|
3225
|
+
};
|
|
3226
|
+
}
|
|
3227
|
+
get value() {
|
|
3228
|
+
return this._def.value;
|
|
3229
|
+
}
|
|
3230
|
+
};
|
|
3231
|
+
P.create = (e, t) => new P({
|
|
3232
|
+
value: e,
|
|
3233
|
+
typeName: W.ZodLiteral,
|
|
3234
|
+
...y(t)
|
|
3235
|
+
});
|
|
3236
|
+
function Ge(e, t) {
|
|
3237
|
+
return new F({
|
|
3238
|
+
values: e,
|
|
3239
|
+
typeName: W.ZodEnum,
|
|
3240
|
+
...y(t)
|
|
3241
|
+
});
|
|
3242
|
+
}
|
|
3243
|
+
var F = class e extends b {
|
|
3244
|
+
_parse(e) {
|
|
3245
|
+
if (typeof e.data != "string") {
|
|
3246
|
+
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
3247
|
+
return d(t, {
|
|
3248
|
+
expected: i.joinValues(n),
|
|
3249
|
+
received: t.parsedType,
|
|
3250
|
+
code: c.invalid_type
|
|
3251
|
+
}), p;
|
|
3252
|
+
}
|
|
3253
|
+
if (this._cache ||= new Set(this._def.values), !this._cache.has(e.data)) {
|
|
3254
|
+
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
3255
|
+
return d(t, {
|
|
3256
|
+
received: t.data,
|
|
3257
|
+
code: c.invalid_enum_value,
|
|
3258
|
+
options: n
|
|
3259
|
+
}), p;
|
|
3260
|
+
}
|
|
3261
|
+
return m(e.data);
|
|
3262
|
+
}
|
|
3263
|
+
get options() {
|
|
3264
|
+
return this._def.values;
|
|
3265
|
+
}
|
|
3266
|
+
get enum() {
|
|
3267
|
+
let e = {};
|
|
3268
|
+
for (let t of this._def.values) e[t] = t;
|
|
3269
|
+
return e;
|
|
3270
|
+
}
|
|
3271
|
+
get Values() {
|
|
3272
|
+
let e = {};
|
|
3273
|
+
for (let t of this._def.values) e[t] = t;
|
|
3274
|
+
return e;
|
|
3275
|
+
}
|
|
3276
|
+
get Enum() {
|
|
3277
|
+
let e = {};
|
|
3278
|
+
for (let t of this._def.values) e[t] = t;
|
|
3279
|
+
return e;
|
|
3280
|
+
}
|
|
3281
|
+
extract(t, n = this._def) {
|
|
3282
|
+
return e.create(t, {
|
|
3283
|
+
...this._def,
|
|
3284
|
+
...n
|
|
3285
|
+
});
|
|
3286
|
+
}
|
|
3287
|
+
exclude(t, n = this._def) {
|
|
3288
|
+
return e.create(this.options.filter((e) => !t.includes(e)), {
|
|
3289
|
+
...this._def,
|
|
3290
|
+
...n
|
|
3291
|
+
});
|
|
3292
|
+
}
|
|
3293
|
+
};
|
|
3294
|
+
F.create = Ge;
|
|
3295
|
+
var I = class extends b {
|
|
3296
|
+
_parse(e) {
|
|
3297
|
+
let t = i.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
3298
|
+
if (n.parsedType !== o.string && n.parsedType !== o.number) {
|
|
3299
|
+
let e = i.objectValues(t);
|
|
3300
|
+
return d(n, {
|
|
3301
|
+
expected: i.joinValues(e),
|
|
3302
|
+
received: n.parsedType,
|
|
3303
|
+
code: c.invalid_type
|
|
3304
|
+
}), p;
|
|
3305
|
+
}
|
|
3306
|
+
if (this._cache ||= new Set(i.getValidEnumValues(this._def.values)), !this._cache.has(e.data)) {
|
|
3307
|
+
let e = i.objectValues(t);
|
|
3308
|
+
return d(n, {
|
|
3309
|
+
received: n.data,
|
|
3310
|
+
code: c.invalid_enum_value,
|
|
3311
|
+
options: e
|
|
3312
|
+
}), p;
|
|
3313
|
+
}
|
|
3314
|
+
return m(e.data);
|
|
3315
|
+
}
|
|
3316
|
+
get enum() {
|
|
3317
|
+
return this._def.values;
|
|
3318
|
+
}
|
|
3319
|
+
};
|
|
3320
|
+
I.create = (e, t) => new I({
|
|
3321
|
+
values: e,
|
|
3322
|
+
typeName: W.ZodNativeEnum,
|
|
3323
|
+
...y(t)
|
|
3324
|
+
});
|
|
3325
|
+
var L = class extends b {
|
|
3326
|
+
unwrap() {
|
|
3327
|
+
return this._def.type;
|
|
3328
|
+
}
|
|
3329
|
+
_parse(e) {
|
|
3330
|
+
let { ctx: t } = this._processInputParams(e);
|
|
3331
|
+
return t.parsedType !== o.promise && t.common.async === !1 ? (d(t, {
|
|
3332
|
+
code: c.invalid_type,
|
|
3333
|
+
expected: o.promise,
|
|
3334
|
+
received: t.parsedType
|
|
3335
|
+
}), p) : m((t.parsedType === o.promise ? t.data : Promise.resolve(t.data)).then((e) => this._def.type.parseAsync(e, {
|
|
3336
|
+
path: t.path,
|
|
3337
|
+
errorMap: t.common.contextualErrorMap
|
|
3338
|
+
})));
|
|
3339
|
+
}
|
|
3340
|
+
};
|
|
3341
|
+
L.create = (e, t) => new L({
|
|
3342
|
+
type: e,
|
|
3343
|
+
typeName: W.ZodPromise,
|
|
3344
|
+
...y(t)
|
|
3345
|
+
});
|
|
3346
|
+
var R = class extends b {
|
|
3347
|
+
innerType() {
|
|
3348
|
+
return this._def.schema;
|
|
3349
|
+
}
|
|
3350
|
+
sourceType() {
|
|
3351
|
+
return this._def.schema._def.typeName === W.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
3352
|
+
}
|
|
3353
|
+
_parse(e) {
|
|
3354
|
+
let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, a = {
|
|
3355
|
+
addIssue: (e) => {
|
|
3356
|
+
d(n, e), e.fatal ? t.abort() : t.dirty();
|
|
3357
|
+
},
|
|
3358
|
+
get path() {
|
|
3359
|
+
return n.path;
|
|
3360
|
+
}
|
|
3361
|
+
};
|
|
3362
|
+
if (a.addIssue = a.addIssue.bind(a), r.type === "preprocess") {
|
|
3363
|
+
let e = r.transform(n.data, a);
|
|
3364
|
+
if (n.common.async) return Promise.resolve(e).then(async (e) => {
|
|
3365
|
+
if (t.value === "aborted") return p;
|
|
3366
|
+
let r = await this._def.schema._parseAsync({
|
|
3367
|
+
data: e,
|
|
3368
|
+
path: n.path,
|
|
3369
|
+
parent: n
|
|
3370
|
+
});
|
|
3371
|
+
return r.status === "aborted" ? p : r.status === "dirty" || t.value === "dirty" ? re(r.value) : r;
|
|
3372
|
+
});
|
|
3373
|
+
{
|
|
3374
|
+
if (t.value === "aborted") return p;
|
|
3375
|
+
let r = this._def.schema._parseSync({
|
|
3376
|
+
data: e,
|
|
3377
|
+
path: n.path,
|
|
3378
|
+
parent: n
|
|
3379
|
+
});
|
|
3380
|
+
return r.status === "aborted" ? p : r.status === "dirty" || t.value === "dirty" ? re(r.value) : r;
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
if (r.type === "refinement") {
|
|
3384
|
+
let e = (e) => {
|
|
3385
|
+
let t = r.refinement(e, a);
|
|
3386
|
+
if (n.common.async) return Promise.resolve(t);
|
|
3387
|
+
if (t instanceof Promise) throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3388
|
+
return e;
|
|
3389
|
+
};
|
|
3390
|
+
if (n.common.async === !1) {
|
|
3391
|
+
let r = this._def.schema._parseSync({
|
|
3392
|
+
data: n.data,
|
|
3393
|
+
path: n.path,
|
|
3394
|
+
parent: n
|
|
3395
|
+
});
|
|
3396
|
+
return r.status === "aborted" ? p : (r.status === "dirty" && t.dirty(), e(r.value), {
|
|
3397
|
+
status: t.value,
|
|
3398
|
+
value: r.value
|
|
3399
|
+
});
|
|
3400
|
+
} else return this._def.schema._parseAsync({
|
|
3401
|
+
data: n.data,
|
|
3402
|
+
path: n.path,
|
|
3403
|
+
parent: n
|
|
3404
|
+
}).then((n) => n.status === "aborted" ? p : (n.status === "dirty" && t.dirty(), e(n.value).then(() => ({
|
|
3405
|
+
status: t.value,
|
|
3406
|
+
value: n.value
|
|
3407
|
+
}))));
|
|
3408
|
+
}
|
|
3409
|
+
if (r.type === "transform") if (n.common.async === !1) {
|
|
3410
|
+
let e = this._def.schema._parseSync({
|
|
3411
|
+
data: n.data,
|
|
3412
|
+
path: n.path,
|
|
3413
|
+
parent: n
|
|
3414
|
+
});
|
|
3415
|
+
if (!h(e)) return p;
|
|
3416
|
+
let i = r.transform(e.value, a);
|
|
3417
|
+
if (i instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3418
|
+
return {
|
|
3419
|
+
status: t.value,
|
|
3420
|
+
value: i
|
|
3421
|
+
};
|
|
3422
|
+
} else return this._def.schema._parseAsync({
|
|
3423
|
+
data: n.data,
|
|
3424
|
+
path: n.path,
|
|
3425
|
+
parent: n
|
|
3426
|
+
}).then((e) => h(e) ? Promise.resolve(r.transform(e.value, a)).then((e) => ({
|
|
3427
|
+
status: t.value,
|
|
3428
|
+
value: e
|
|
3429
|
+
})) : p);
|
|
3430
|
+
i.assertNever(r);
|
|
3431
|
+
}
|
|
3432
|
+
};
|
|
3433
|
+
R.create = (e, t, n) => new R({
|
|
3434
|
+
schema: e,
|
|
3435
|
+
typeName: W.ZodEffects,
|
|
3436
|
+
effect: t,
|
|
3437
|
+
...y(n)
|
|
3438
|
+
}), R.createWithPreprocess = (e, t, n) => new R({
|
|
3439
|
+
schema: t,
|
|
3440
|
+
effect: {
|
|
3441
|
+
type: "preprocess",
|
|
3442
|
+
transform: e
|
|
3443
|
+
},
|
|
3444
|
+
typeName: W.ZodEffects,
|
|
3445
|
+
...y(n)
|
|
3446
|
+
});
|
|
3447
|
+
var z = class extends b {
|
|
3448
|
+
_parse(e) {
|
|
3449
|
+
return this._getType(e) === o.undefined ? m(void 0) : this._def.innerType._parse(e);
|
|
3450
|
+
}
|
|
3451
|
+
unwrap() {
|
|
3452
|
+
return this._def.innerType;
|
|
3453
|
+
}
|
|
3454
|
+
};
|
|
3455
|
+
z.create = (e, t) => new z({
|
|
3456
|
+
innerType: e,
|
|
3457
|
+
typeName: W.ZodOptional,
|
|
3458
|
+
...y(t)
|
|
3459
|
+
});
|
|
3460
|
+
var B = class extends b {
|
|
3461
|
+
_parse(e) {
|
|
3462
|
+
return this._getType(e) === o.null ? m(null) : this._def.innerType._parse(e);
|
|
3463
|
+
}
|
|
3464
|
+
unwrap() {
|
|
3465
|
+
return this._def.innerType;
|
|
3466
|
+
}
|
|
3467
|
+
};
|
|
3468
|
+
B.create = (e, t) => new B({
|
|
3469
|
+
innerType: e,
|
|
3470
|
+
typeName: W.ZodNullable,
|
|
3471
|
+
...y(t)
|
|
3472
|
+
});
|
|
3473
|
+
var V = class extends b {
|
|
3474
|
+
_parse(e) {
|
|
3475
|
+
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
3476
|
+
return t.parsedType === o.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
3477
|
+
data: n,
|
|
3478
|
+
path: t.path,
|
|
3479
|
+
parent: t
|
|
3480
|
+
});
|
|
3481
|
+
}
|
|
3482
|
+
removeDefault() {
|
|
3483
|
+
return this._def.innerType;
|
|
3484
|
+
}
|
|
3485
|
+
};
|
|
3486
|
+
V.create = (e, t) => new V({
|
|
3487
|
+
innerType: e,
|
|
3488
|
+
typeName: W.ZodDefault,
|
|
3489
|
+
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
3490
|
+
...y(t)
|
|
3491
|
+
});
|
|
3492
|
+
var H = class extends b {
|
|
3493
|
+
_parse(e) {
|
|
3494
|
+
let { ctx: t } = this._processInputParams(e), n = {
|
|
3495
|
+
...t,
|
|
3496
|
+
common: {
|
|
3497
|
+
...t.common,
|
|
3498
|
+
issues: []
|
|
3499
|
+
}
|
|
3500
|
+
}, r = this._def.innerType._parse({
|
|
3501
|
+
data: n.data,
|
|
3502
|
+
path: n.path,
|
|
3503
|
+
parent: { ...n }
|
|
3504
|
+
});
|
|
3505
|
+
return g(r) ? r.then((e) => ({
|
|
3506
|
+
status: "valid",
|
|
3507
|
+
value: e.status === "valid" ? e.value : this._def.catchValue({
|
|
3508
|
+
get error() {
|
|
3509
|
+
return new l(n.common.issues);
|
|
3510
|
+
},
|
|
3511
|
+
input: n.data
|
|
3512
|
+
})
|
|
3513
|
+
})) : {
|
|
3514
|
+
status: "valid",
|
|
3515
|
+
value: r.status === "valid" ? r.value : this._def.catchValue({
|
|
3516
|
+
get error() {
|
|
3517
|
+
return new l(n.common.issues);
|
|
3518
|
+
},
|
|
3519
|
+
input: n.data
|
|
3520
|
+
})
|
|
3521
|
+
};
|
|
3522
|
+
}
|
|
3523
|
+
removeCatch() {
|
|
3524
|
+
return this._def.innerType;
|
|
3525
|
+
}
|
|
3526
|
+
};
|
|
3527
|
+
H.create = (e, t) => new H({
|
|
3528
|
+
innerType: e,
|
|
3529
|
+
typeName: W.ZodCatch,
|
|
3530
|
+
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
3531
|
+
...y(t)
|
|
3532
|
+
});
|
|
3533
|
+
var Ke = class extends b {
|
|
3534
|
+
_parse(e) {
|
|
3535
|
+
if (this._getType(e) !== o.nan) {
|
|
3536
|
+
let t = this._getOrReturnCtx(e);
|
|
3537
|
+
return d(t, {
|
|
3538
|
+
code: c.invalid_type,
|
|
3539
|
+
expected: o.nan,
|
|
3540
|
+
received: t.parsedType
|
|
3541
|
+
}), p;
|
|
3542
|
+
}
|
|
3543
|
+
return {
|
|
3544
|
+
status: "valid",
|
|
3545
|
+
value: e.data
|
|
3546
|
+
};
|
|
3547
|
+
}
|
|
3548
|
+
};
|
|
3549
|
+
Ke.create = (e) => new Ke({
|
|
3550
|
+
typeName: W.ZodNaN,
|
|
3551
|
+
...y(e)
|
|
3552
|
+
});
|
|
3553
|
+
var qe = class extends b {
|
|
3554
|
+
_parse(e) {
|
|
3555
|
+
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
3556
|
+
return this._def.type._parse({
|
|
3557
|
+
data: n,
|
|
3558
|
+
path: t.path,
|
|
3559
|
+
parent: t
|
|
3560
|
+
});
|
|
3561
|
+
}
|
|
3562
|
+
unwrap() {
|
|
3563
|
+
return this._def.type;
|
|
3564
|
+
}
|
|
3565
|
+
}, Je = class e extends b {
|
|
3566
|
+
_parse(e) {
|
|
3567
|
+
let { status: t, ctx: n } = this._processInputParams(e);
|
|
3568
|
+
if (n.common.async) return (async () => {
|
|
3569
|
+
let e = await this._def.in._parseAsync({
|
|
3570
|
+
data: n.data,
|
|
3571
|
+
path: n.path,
|
|
3572
|
+
parent: n
|
|
3573
|
+
});
|
|
3574
|
+
return e.status === "aborted" ? p : e.status === "dirty" ? (t.dirty(), re(e.value)) : this._def.out._parseAsync({
|
|
3575
|
+
data: e.value,
|
|
3576
|
+
path: n.path,
|
|
3577
|
+
parent: n
|
|
3578
|
+
});
|
|
3579
|
+
})();
|
|
3580
|
+
{
|
|
3581
|
+
let e = this._def.in._parseSync({
|
|
3582
|
+
data: n.data,
|
|
3583
|
+
path: n.path,
|
|
3584
|
+
parent: n
|
|
3585
|
+
});
|
|
3586
|
+
return e.status === "aborted" ? p : e.status === "dirty" ? (t.dirty(), {
|
|
3587
|
+
status: "dirty",
|
|
3588
|
+
value: e.value
|
|
3589
|
+
}) : this._def.out._parseSync({
|
|
3590
|
+
data: e.value,
|
|
3591
|
+
path: n.path,
|
|
3592
|
+
parent: n
|
|
3593
|
+
});
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
static create(t, n) {
|
|
3597
|
+
return new e({
|
|
3598
|
+
in: t,
|
|
3599
|
+
out: n,
|
|
3600
|
+
typeName: W.ZodPipeline
|
|
3601
|
+
});
|
|
3602
|
+
}
|
|
3603
|
+
}, U = class extends b {
|
|
3604
|
+
_parse(e) {
|
|
3605
|
+
let t = this._def.innerType._parse(e), n = (e) => (h(e) && (e.value = Object.freeze(e.value)), e);
|
|
3606
|
+
return g(t) ? t.then((e) => n(e)) : n(t);
|
|
3607
|
+
}
|
|
3608
|
+
unwrap() {
|
|
3609
|
+
return this._def.innerType;
|
|
3610
|
+
}
|
|
3611
|
+
};
|
|
3612
|
+
U.create = (e, t) => new U({
|
|
3613
|
+
innerType: e,
|
|
3614
|
+
typeName: W.ZodReadonly,
|
|
3615
|
+
...y(t)
|
|
3616
|
+
}), O.lazycreate;
|
|
3617
|
+
var W;
|
|
3618
|
+
(function(e) {
|
|
3619
|
+
e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
|
|
3620
|
+
})(W ||= {});
|
|
3621
|
+
var G = x.create, Ye = Me.create;
|
|
3622
|
+
Ke.create, Ne.create, Pe.create, Fe.create, Ie.create, S.create, C.create;
|
|
3623
|
+
var K = Le.create;
|
|
3624
|
+
w.create, T.create, Re.create;
|
|
3625
|
+
var q = E.create, J = O.create;
|
|
3626
|
+
O.strictCreate;
|
|
3627
|
+
var Y = k.create;
|
|
3628
|
+
ze.create, j.create, M.create;
|
|
3629
|
+
var Xe = Ve.create;
|
|
3630
|
+
He.create, Ue.create, We.create, N.create;
|
|
3631
|
+
var X = P.create, Z = F.create;
|
|
3632
|
+
I.create, L.create, R.create, z.create, B.create, R.createWithPreprocess, Je.create;
|
|
3633
|
+
var Ze = Z([
|
|
3634
|
+
"character",
|
|
3635
|
+
"syllable",
|
|
3636
|
+
"word",
|
|
3637
|
+
"phrase",
|
|
3638
|
+
"sentence",
|
|
3639
|
+
"paragraph"
|
|
3640
|
+
]), Qe = Z([
|
|
3641
|
+
"formal",
|
|
3642
|
+
"informal",
|
|
3643
|
+
"historical",
|
|
3644
|
+
"regional",
|
|
3645
|
+
"dialectal"
|
|
3646
|
+
]), $e = Y([
|
|
3647
|
+
X("rtgs"),
|
|
3648
|
+
X("aua"),
|
|
3649
|
+
X("paiboon"),
|
|
3650
|
+
X("romaji"),
|
|
3651
|
+
X("furigana"),
|
|
3652
|
+
X("ipa"),
|
|
3653
|
+
X("pinyin"),
|
|
3654
|
+
X("hangul"),
|
|
3655
|
+
G()
|
|
3656
|
+
]), Q = Y([
|
|
3657
|
+
X("th"),
|
|
3658
|
+
X("ja"),
|
|
3659
|
+
X("zh"),
|
|
3660
|
+
X("ko"),
|
|
3661
|
+
X("en"),
|
|
3662
|
+
G()
|
|
3663
|
+
]), et = Y([
|
|
3664
|
+
X("thai"),
|
|
3665
|
+
X("hiragana"),
|
|
3666
|
+
X("katakana"),
|
|
3667
|
+
X("kanji"),
|
|
3668
|
+
X("hanzi"),
|
|
3669
|
+
X("hangul"),
|
|
3670
|
+
X("latin"),
|
|
3671
|
+
X("mixed"),
|
|
3672
|
+
G()
|
|
3673
|
+
]), tt = J({
|
|
3674
|
+
text: G(),
|
|
3675
|
+
context: Qe,
|
|
3676
|
+
notes: G().optional()
|
|
3677
|
+
}), nt = J({
|
|
3678
|
+
text: G(),
|
|
3679
|
+
system: $e,
|
|
3680
|
+
variants: q(tt).optional(),
|
|
3681
|
+
tone: Ye().optional(),
|
|
3682
|
+
syllables: q(G()).optional(),
|
|
3683
|
+
phonetic: G().optional()
|
|
3684
|
+
}), rt = Xe(G(), nt), it = J({
|
|
3685
|
+
meaning: G().optional(),
|
|
3686
|
+
partOfSpeech: G(),
|
|
3687
|
+
usage: G().optional(),
|
|
3688
|
+
etymology: G().optional(),
|
|
3689
|
+
examples: q(G()).optional(),
|
|
3690
|
+
frequency: Z([
|
|
3691
|
+
"high",
|
|
3692
|
+
"medium",
|
|
3693
|
+
"low"
|
|
3694
|
+
]).optional(),
|
|
3695
|
+
formality: Z([
|
|
3696
|
+
"formal",
|
|
3697
|
+
"neutral",
|
|
3698
|
+
"informal"
|
|
3699
|
+
]).optional(),
|
|
3700
|
+
register: G().optional()
|
|
3701
|
+
}), at = J({
|
|
3702
|
+
type: G(),
|
|
3703
|
+
lang: Q.optional(),
|
|
3704
|
+
script: et.optional(),
|
|
3705
|
+
level: Ze.optional(),
|
|
3706
|
+
position: K().optional()
|
|
3707
|
+
});
|
|
3708
|
+
Y([
|
|
3709
|
+
at.extend({
|
|
3710
|
+
type: X("GLOSTWordNode"),
|
|
3711
|
+
value: G(),
|
|
3712
|
+
transcription: rt,
|
|
3713
|
+
metadata: it,
|
|
3714
|
+
level: Ze,
|
|
3715
|
+
children: q(K()).default([])
|
|
3716
|
+
}),
|
|
3717
|
+
at.extend({
|
|
3718
|
+
type: X("GLOSTSentenceNode"),
|
|
3719
|
+
originalText: G(),
|
|
3720
|
+
lang: Q,
|
|
3721
|
+
script: et,
|
|
3722
|
+
transcription: rt.optional(),
|
|
3723
|
+
children: q(K()).default([])
|
|
3724
|
+
}),
|
|
3725
|
+
at.extend({
|
|
3726
|
+
type: X("GLOSTParagraphNode"),
|
|
3727
|
+
lang: Q,
|
|
3728
|
+
script: et,
|
|
3729
|
+
children: q(K()).default([])
|
|
3730
|
+
}),
|
|
3731
|
+
at.extend({
|
|
3732
|
+
type: X("GLOSTRootNode"),
|
|
3733
|
+
lang: Q,
|
|
3734
|
+
script: et,
|
|
3735
|
+
metadata: J({
|
|
3736
|
+
title: G().optional(),
|
|
3737
|
+
author: G().optional(),
|
|
3738
|
+
date: G().optional(),
|
|
3739
|
+
description: G().optional()
|
|
3740
|
+
}).optional(),
|
|
3741
|
+
children: q(K()).default([])
|
|
3742
|
+
})
|
|
3743
|
+
]), new class {
|
|
3744
|
+
plugins = /* @__PURE__ */ new Map();
|
|
3745
|
+
extensions = /* @__PURE__ */ new Map();
|
|
3746
|
+
register(e, t) {
|
|
3747
|
+
let n = {
|
|
3748
|
+
...t,
|
|
3749
|
+
id: e.id,
|
|
3750
|
+
name: e.name,
|
|
3751
|
+
description: e.description || t.description,
|
|
3752
|
+
registeredAt: /* @__PURE__ */ new Date()
|
|
3753
|
+
};
|
|
3754
|
+
this.plugins.has(e.id) && console.warn(`Plugin "${e.id}" is already registered. Overwriting.`), this.plugins.set(e.id, n), this.extensions.set(e.id, e);
|
|
3755
|
+
}
|
|
3756
|
+
getMetadata(e) {
|
|
3757
|
+
return this.plugins.get(e);
|
|
3758
|
+
}
|
|
3759
|
+
getExtension(e) {
|
|
3760
|
+
return this.extensions.get(e);
|
|
3761
|
+
}
|
|
3762
|
+
list() {
|
|
3763
|
+
return Array.from(this.plugins.values());
|
|
3764
|
+
}
|
|
3765
|
+
search(e) {
|
|
3766
|
+
let t = this.list();
|
|
3767
|
+
if (e.keyword) {
|
|
3768
|
+
let n = e.keyword.toLowerCase();
|
|
3769
|
+
t = t.filter((e) => e.name.toLowerCase().includes(n) || e.description.toLowerCase().includes(n) || e.tags.some((e) => e.toLowerCase().includes(n)));
|
|
3770
|
+
}
|
|
3771
|
+
return e.category && (t = t.filter((t) => t.category === e.category)), e.language && (t = t.filter((t) => !t.supports.languages || t.supports.languages.includes(e.language))), e.tags && e.tags.length > 0 && (t = t.filter((t) => e.tags.some((e) => t.tags.includes(e)))), e.author && (t = t.filter((t) => t.author === e.author)), e.capability && (t = t.filter((t) => t.supports.custom?.[e.capability] === !0)), t;
|
|
3772
|
+
}
|
|
3773
|
+
getByCategory(e) {
|
|
3774
|
+
return this.list().filter((t) => t.category === e);
|
|
3775
|
+
}
|
|
3776
|
+
getLanguageSupport(e) {
|
|
3777
|
+
return this.list().filter((t) => !t.supports.languages || t.supports.languages.includes(e));
|
|
3778
|
+
}
|
|
3779
|
+
isLanguageSupported(e, t) {
|
|
3780
|
+
let n = this.getMetadata(e);
|
|
3781
|
+
return n ? !n.supports.languages || n.supports.languages.includes(t) : !1;
|
|
3782
|
+
}
|
|
3783
|
+
isCompatible(e, t) {
|
|
3784
|
+
let n = this.getMetadata(e);
|
|
3785
|
+
return n ? n.version === t || n.version >= t : !1;
|
|
3786
|
+
}
|
|
3787
|
+
checkConflicts(e) {
|
|
3788
|
+
let t = [];
|
|
3789
|
+
for (let n = 0; n < e.length; n++) {
|
|
3790
|
+
let r = e[n], i = this.getMetadata(r);
|
|
3791
|
+
if (i) for (let a = n + 1; a < e.length; a++) {
|
|
3792
|
+
let n = e[a], o = this.getMetadata(n);
|
|
3793
|
+
if (!o) continue;
|
|
3794
|
+
i.conflicts?.includes(n) && t.push({
|
|
3795
|
+
plugin1: r,
|
|
3796
|
+
plugin2: n,
|
|
3797
|
+
reason: `${r} declares conflict with ${n}`,
|
|
3798
|
+
severity: "error"
|
|
3799
|
+
}), o.conflicts?.includes(r) && t.push({
|
|
3800
|
+
plugin1: n,
|
|
3801
|
+
plugin2: r,
|
|
3802
|
+
reason: `${n} declares conflict with ${r}`,
|
|
3803
|
+
severity: "error"
|
|
3804
|
+
});
|
|
3805
|
+
let s = this.getExtension(r), c = this.getExtension(n);
|
|
3806
|
+
if (s?.provides?.extras && c?.provides?.extras) {
|
|
3807
|
+
let e = s.provides.extras.filter((e) => c.provides.extras.includes(e));
|
|
3808
|
+
e.length > 0 && t.push({
|
|
3809
|
+
plugin1: r,
|
|
3810
|
+
plugin2: n,
|
|
3811
|
+
reason: `Both plugins provide the same fields: ${e.join(", ")}`,
|
|
3812
|
+
severity: "warning"
|
|
3813
|
+
});
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
}
|
|
3817
|
+
return {
|
|
3818
|
+
hasConflicts: t.length > 0,
|
|
3819
|
+
conflicts: t
|
|
3820
|
+
};
|
|
3821
|
+
}
|
|
3822
|
+
resolveDependencies(e) {
|
|
3823
|
+
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = (a) => {
|
|
3824
|
+
if (r.has(a)) throw Error(`Circular dependency detected involving plugin: ${a}`);
|
|
3825
|
+
if (n.has(a)) return;
|
|
3826
|
+
let o = this.getExtension(a);
|
|
3827
|
+
if (!o) throw Error(`Plugin "${a}" not found in registry`);
|
|
3828
|
+
if (r.add(a), o.dependencies) for (let t of o.dependencies) e.includes(t) && i(t);
|
|
3829
|
+
r.delete(a), n.add(a), t.push(a);
|
|
3830
|
+
};
|
|
3831
|
+
for (let t of e) i(t);
|
|
3832
|
+
return t;
|
|
3833
|
+
}
|
|
3834
|
+
validate(e, t) {
|
|
3835
|
+
let n = this.getMetadata(e), r = [], i = [];
|
|
3836
|
+
if (!n) return r.push({
|
|
3837
|
+
plugin: e,
|
|
3838
|
+
message: `Plugin "${e}" not found in registry`,
|
|
3839
|
+
code: "PLUGIN_NOT_FOUND"
|
|
3840
|
+
}), {
|
|
3841
|
+
valid: !1,
|
|
3842
|
+
errors: r,
|
|
3843
|
+
warnings: i
|
|
3844
|
+
};
|
|
3845
|
+
if (n.options && t) {
|
|
3846
|
+
let a = n.options;
|
|
3847
|
+
if (a.required) for (let n of a.required) n in t || r.push({
|
|
3848
|
+
plugin: e,
|
|
3849
|
+
message: `Required option "${n}" is missing`,
|
|
3850
|
+
code: "MISSING_REQUIRED_OPTION"
|
|
3851
|
+
});
|
|
3852
|
+
if (a.properties) for (let [n, o] of Object.entries(t)) {
|
|
3853
|
+
let t = a.properties[n];
|
|
3854
|
+
if (!t) {
|
|
3855
|
+
a.additionalProperties || i.push({
|
|
3856
|
+
plugin: e,
|
|
3857
|
+
message: `Unknown option "${n}"`,
|
|
3858
|
+
code: "UNKNOWN_OPTION"
|
|
3859
|
+
});
|
|
3860
|
+
continue;
|
|
3861
|
+
}
|
|
3862
|
+
let s = typeof o, c = t.type;
|
|
3863
|
+
s !== c && !(c === "array" && Array.isArray(o)) && r.push({
|
|
3864
|
+
plugin: e,
|
|
3865
|
+
message: `Option "${n}" should be ${c}, got ${s}`,
|
|
3866
|
+
code: "INVALID_OPTION_TYPE"
|
|
3867
|
+
});
|
|
3868
|
+
}
|
|
3869
|
+
}
|
|
3870
|
+
return n.requires?.glostVersion && i.push({
|
|
3871
|
+
plugin: e,
|
|
3872
|
+
message: `Plugin requires GLOST version ${n.requires.glostVersion}`,
|
|
3873
|
+
code: "VERSION_REQUIREMENT"
|
|
3874
|
+
}), {
|
|
3875
|
+
valid: r.length === 0,
|
|
3876
|
+
errors: r,
|
|
3877
|
+
warnings: i
|
|
3878
|
+
};
|
|
3879
|
+
}
|
|
3880
|
+
getStatistics() {
|
|
3881
|
+
let e = this.list(), t = {
|
|
3882
|
+
transformer: 0,
|
|
3883
|
+
enhancer: 0,
|
|
3884
|
+
generator: 0,
|
|
3885
|
+
analyzer: 0,
|
|
3886
|
+
utility: 0
|
|
3887
|
+
}, n = {}, r = {};
|
|
3888
|
+
for (let i of e) {
|
|
3889
|
+
if (t[i.category]++, i.supports.languages) for (let e of i.supports.languages) n[e] = (n[e] || 0) + 1;
|
|
3890
|
+
for (let e of i.tags) r[e] = (r[e] || 0) + 1;
|
|
3891
|
+
}
|
|
3892
|
+
let i = Object.entries(r).sort((e, t) => t[1] - e[1]).slice(0, 10).map(([e, t]) => ({
|
|
3893
|
+
tag: e,
|
|
3894
|
+
count: t
|
|
3895
|
+
}));
|
|
3896
|
+
return {
|
|
3897
|
+
total: e.length,
|
|
3898
|
+
byCategory: t,
|
|
3899
|
+
byLanguage: n,
|
|
3900
|
+
topTags: i
|
|
3901
|
+
};
|
|
3902
|
+
}
|
|
3903
|
+
has(e) {
|
|
3904
|
+
return this.plugins.has(e);
|
|
3905
|
+
}
|
|
3906
|
+
unregister(e) {
|
|
3907
|
+
let t = this.plugins.has(e);
|
|
3908
|
+
return this.plugins.delete(e), this.extensions.delete(e), t;
|
|
3909
|
+
}
|
|
3910
|
+
clear() {
|
|
3911
|
+
this.plugins.clear(), this.extensions.clear();
|
|
3912
|
+
}
|
|
3913
|
+
}();
|
|
3914
|
+
function ot(e) {
|
|
3915
|
+
return {
|
|
3916
|
+
type: "ParallelDocument",
|
|
3917
|
+
trees: e.trees,
|
|
3918
|
+
alignments: e.alignments ?? [],
|
|
3919
|
+
metadata: e.metadata
|
|
3920
|
+
};
|
|
3921
|
+
}
|
|
3922
|
+
var $ = "en", st = "latin";
|
|
3923
|
+
function ct(t) {
|
|
3924
|
+
let { targetLang: n, targetScript: r = "latin", translations: i } = t, a = /* @__PURE__ */ new Map();
|
|
3925
|
+
for (let e of i) a.set(e.sentenceId, e);
|
|
3926
|
+
let o = [], s = [], c = [];
|
|
3927
|
+
for (let t of e) {
|
|
3928
|
+
let e = lt(t.id);
|
|
3929
|
+
o.push(ut(t.text, $, st, e));
|
|
3930
|
+
let i = a.get(t.id);
|
|
3931
|
+
s.push(ut(i?.text ?? "", n, r, e)), i && i.text.length > 0 && c.push(ft(e, $, n, i.metadata?.verified));
|
|
3932
|
+
}
|
|
3933
|
+
let l = dt($, st, o), u = dt(n, r, s);
|
|
3934
|
+
return ot({
|
|
3935
|
+
trees: {
|
|
3936
|
+
[$]: l,
|
|
3937
|
+
[n]: u
|
|
3938
|
+
},
|
|
3939
|
+
alignments: [...c, ...t.alignments ?? []],
|
|
3940
|
+
metadata: {
|
|
3941
|
+
title: t.metadata?.title ?? `Essential 218 (${n})`,
|
|
3942
|
+
titles: t.metadata?.titles,
|
|
3943
|
+
source: t.metadata?.source ?? "https://cofl.github.io/conlang/resources/mirror/conlang-syntax-test-cases.html",
|
|
3944
|
+
status: t.metadata?.status,
|
|
3945
|
+
extras: {
|
|
3946
|
+
...t.metadata?.extras,
|
|
3947
|
+
defaultRemarks: t.defaultRemarks ?? {},
|
|
3948
|
+
corpus: "essential-218"
|
|
3949
|
+
}
|
|
3950
|
+
}
|
|
3951
|
+
});
|
|
3952
|
+
}
|
|
3953
|
+
function lt(e) {
|
|
3954
|
+
return `218:${e}`;
|
|
3955
|
+
}
|
|
3956
|
+
function ut(e, n, r, i) {
|
|
3957
|
+
let a = t({
|
|
3958
|
+
originalText: e,
|
|
3959
|
+
lang: n,
|
|
3960
|
+
script: r,
|
|
3961
|
+
children: []
|
|
3962
|
+
});
|
|
3963
|
+
return a.extras = {
|
|
3964
|
+
...a.extras ?? {},
|
|
3965
|
+
id: i
|
|
3966
|
+
}, a;
|
|
3967
|
+
}
|
|
3968
|
+
function dt(e, t, i) {
|
|
3969
|
+
let a = n(i);
|
|
3970
|
+
return a.extras = {
|
|
3971
|
+
...a.extras ?? {},
|
|
3972
|
+
id: "p1"
|
|
3973
|
+
}, r({
|
|
3974
|
+
lang: e,
|
|
3975
|
+
script: t,
|
|
3976
|
+
children: [a]
|
|
3977
|
+
});
|
|
3978
|
+
}
|
|
3979
|
+
function ft(e, t, n, r) {
|
|
3980
|
+
return {
|
|
3981
|
+
id: `edge:${e}`,
|
|
3982
|
+
level: "sentence",
|
|
3983
|
+
refs: {
|
|
3984
|
+
[t]: [{
|
|
3985
|
+
lang: t,
|
|
3986
|
+
id: e
|
|
3987
|
+
}],
|
|
3988
|
+
[n]: [{
|
|
3989
|
+
lang: n,
|
|
3990
|
+
id: e
|
|
3991
|
+
}]
|
|
3992
|
+
},
|
|
3993
|
+
source: t,
|
|
3994
|
+
confidence: r ? "high" : void 0,
|
|
3995
|
+
provenance: {
|
|
3996
|
+
kind: "lookup",
|
|
3997
|
+
detail: "by-id-pairing"
|
|
3998
|
+
}
|
|
3999
|
+
};
|
|
4000
|
+
}
|
|
4001
|
+
//#endregion
|
|
4002
|
+
//#region src/essential-218/translations.ts
|
|
4003
|
+
var pt = [
|
|
4004
|
+
{
|
|
4005
|
+
sentenceId: 1,
|
|
4006
|
+
text: "Die Sonne scheint.",
|
|
4007
|
+
metadata: { verified: !1 }
|
|
4008
|
+
},
|
|
4009
|
+
{
|
|
4010
|
+
sentenceId: 2,
|
|
4011
|
+
text: "Die Sonne scheint gerade.",
|
|
4012
|
+
metadata: { verified: !1 }
|
|
4013
|
+
},
|
|
4014
|
+
{
|
|
4015
|
+
sentenceId: 3,
|
|
4016
|
+
text: "Die Sonne hat geschienen.",
|
|
4017
|
+
metadata: { verified: !1 }
|
|
4018
|
+
},
|
|
4019
|
+
{
|
|
4020
|
+
sentenceId: 4,
|
|
4021
|
+
text: "Die Sonne wird scheinen.",
|
|
4022
|
+
metadata: { verified: !1 }
|
|
4023
|
+
},
|
|
4024
|
+
{
|
|
4025
|
+
sentenceId: 5,
|
|
4026
|
+
text: "Die Sonne hat geschienen.",
|
|
4027
|
+
metadata: { verified: !1 }
|
|
4028
|
+
},
|
|
4029
|
+
{
|
|
4030
|
+
sentenceId: 6,
|
|
4031
|
+
text: "Die Sonne scheint wieder.",
|
|
4032
|
+
metadata: { verified: !1 }
|
|
4033
|
+
},
|
|
4034
|
+
{
|
|
4035
|
+
sentenceId: 7,
|
|
4036
|
+
text: "Die Sonne wird morgen scheinen.",
|
|
4037
|
+
metadata: { verified: !1 }
|
|
4038
|
+
},
|
|
4039
|
+
{
|
|
4040
|
+
sentenceId: 8,
|
|
4041
|
+
text: "Die Sonne scheint hell.",
|
|
4042
|
+
metadata: { verified: !1 }
|
|
4043
|
+
},
|
|
4044
|
+
{
|
|
4045
|
+
sentenceId: 9,
|
|
4046
|
+
text: "Die helle Sonne scheint.",
|
|
4047
|
+
metadata: { verified: !1 }
|
|
4048
|
+
},
|
|
4049
|
+
{
|
|
4050
|
+
sentenceId: 10,
|
|
4051
|
+
text: "Die Sonne geht jetzt auf.",
|
|
4052
|
+
metadata: { verified: !1 }
|
|
4053
|
+
},
|
|
4054
|
+
{
|
|
4055
|
+
sentenceId: 11,
|
|
4056
|
+
text: "Alle Leute haben geschrien.",
|
|
4057
|
+
metadata: { verified: !1 }
|
|
4058
|
+
},
|
|
4059
|
+
{
|
|
4060
|
+
sentenceId: 12,
|
|
4061
|
+
text: "Einige der Leute haben geschrien.",
|
|
4062
|
+
metadata: { verified: !1 }
|
|
4063
|
+
},
|
|
4064
|
+
{
|
|
4065
|
+
sentenceId: 13,
|
|
4066
|
+
text: "Viele der Leute haben zweimal geschrien.",
|
|
4067
|
+
metadata: { verified: !1 }
|
|
4068
|
+
},
|
|
4069
|
+
{
|
|
4070
|
+
sentenceId: 14,
|
|
4071
|
+
text: "Glückliche Menschen schreien oft.",
|
|
4072
|
+
metadata: { verified: !1 }
|
|
4073
|
+
},
|
|
4074
|
+
{
|
|
4075
|
+
sentenceId: 15,
|
|
4076
|
+
text: "Das Kätzchen ist hochgesprungen.",
|
|
4077
|
+
metadata: { verified: !1 }
|
|
4078
|
+
},
|
|
4079
|
+
{
|
|
4080
|
+
sentenceId: 16,
|
|
4081
|
+
text: "Das Kätzchen ist auf den Tisch gesprungen.",
|
|
4082
|
+
metadata: { verified: !1 }
|
|
4083
|
+
},
|
|
4084
|
+
{
|
|
4085
|
+
sentenceId: 17,
|
|
4086
|
+
text: "Mein kleines Kätzchen ist weggegangen.",
|
|
4087
|
+
metadata: { verified: !1 }
|
|
4088
|
+
},
|
|
4089
|
+
{
|
|
4090
|
+
sentenceId: 18,
|
|
4091
|
+
text: "Es regnet.",
|
|
4092
|
+
metadata: { verified: !1 }
|
|
4093
|
+
},
|
|
4094
|
+
{
|
|
4095
|
+
sentenceId: 19,
|
|
4096
|
+
text: "Der Regen ist gefallen.",
|
|
4097
|
+
metadata: { verified: !1 }
|
|
4098
|
+
},
|
|
4099
|
+
{
|
|
4100
|
+
sentenceId: 20,
|
|
4101
|
+
text: "Das Kätzchen spielt im Regen.",
|
|
4102
|
+
metadata: { verified: !1 }
|
|
4103
|
+
},
|
|
4104
|
+
{
|
|
4105
|
+
sentenceId: 21,
|
|
4106
|
+
text: "Der Regen hat aufgehört.",
|
|
4107
|
+
metadata: { verified: !1 }
|
|
4108
|
+
},
|
|
4109
|
+
{
|
|
4110
|
+
sentenceId: 22,
|
|
4111
|
+
text: "Bald wird der Regen aufhören.",
|
|
4112
|
+
metadata: { verified: !1 }
|
|
4113
|
+
},
|
|
4114
|
+
{
|
|
4115
|
+
sentenceId: 23,
|
|
4116
|
+
text: "Ich hoffe, der Regen hört bald auf.",
|
|
4117
|
+
metadata: { verified: !1 }
|
|
4118
|
+
},
|
|
4119
|
+
{
|
|
4120
|
+
sentenceId: 24,
|
|
4121
|
+
text: "Einst lebten hier wilde Tiere.",
|
|
4122
|
+
metadata: { verified: !1 }
|
|
4123
|
+
},
|
|
4124
|
+
{
|
|
4125
|
+
sentenceId: 25,
|
|
4126
|
+
text: "Langsam schaute sie sich um.",
|
|
4127
|
+
metadata: { verified: !1 }
|
|
4128
|
+
},
|
|
4129
|
+
{
|
|
4130
|
+
sentenceId: 26,
|
|
4131
|
+
text: "Geh weg!",
|
|
4132
|
+
metadata: { verified: !1 }
|
|
4133
|
+
},
|
|
4134
|
+
{
|
|
4135
|
+
sentenceId: 27,
|
|
4136
|
+
text: "Lass uns gehen!",
|
|
4137
|
+
metadata: { verified: !1 }
|
|
4138
|
+
},
|
|
4139
|
+
{
|
|
4140
|
+
sentenceId: 28,
|
|
4141
|
+
text: "Du solltest gehen.",
|
|
4142
|
+
metadata: { verified: !1 }
|
|
4143
|
+
},
|
|
4144
|
+
{
|
|
4145
|
+
sentenceId: 29,
|
|
4146
|
+
text: "Ich werde gerne gehen.",
|
|
4147
|
+
metadata: { verified: !1 }
|
|
4148
|
+
},
|
|
4149
|
+
{
|
|
4150
|
+
sentenceId: 30,
|
|
4151
|
+
text: "Er wird bald ankommen.",
|
|
4152
|
+
metadata: { verified: !1 }
|
|
4153
|
+
},
|
|
4154
|
+
{
|
|
4155
|
+
sentenceId: 31,
|
|
4156
|
+
text: "Der Ball des Babys ist weggerollt.",
|
|
4157
|
+
metadata: { verified: !1 }
|
|
4158
|
+
},
|
|
4159
|
+
{
|
|
4160
|
+
sentenceId: 32,
|
|
4161
|
+
text: "Die zwei Jungen arbeiten zusammen.",
|
|
4162
|
+
metadata: { verified: !1 }
|
|
4163
|
+
},
|
|
4164
|
+
{
|
|
4165
|
+
sentenceId: 33,
|
|
4166
|
+
text: "Dieser Nebel wird sich wahrscheinlich auflösen.",
|
|
4167
|
+
metadata: { verified: !1 }
|
|
4168
|
+
},
|
|
4169
|
+
{
|
|
4170
|
+
sentenceId: 34,
|
|
4171
|
+
text: "Schöne Blumen wachsen überall.",
|
|
4172
|
+
metadata: { verified: !1 }
|
|
4173
|
+
},
|
|
4174
|
+
{
|
|
4175
|
+
sentenceId: 35,
|
|
4176
|
+
text: "Wir sollten langsamer essen.",
|
|
4177
|
+
metadata: { verified: !1 }
|
|
4178
|
+
},
|
|
4179
|
+
{
|
|
4180
|
+
sentenceId: 36,
|
|
4181
|
+
text: "Du bist zu früh gekommen.",
|
|
4182
|
+
metadata: { verified: !1 }
|
|
4183
|
+
},
|
|
4184
|
+
{
|
|
4185
|
+
sentenceId: 37,
|
|
4186
|
+
text: "Du musst ordentlicher schreiben.",
|
|
4187
|
+
metadata: { verified: !1 }
|
|
4188
|
+
},
|
|
4189
|
+
{
|
|
4190
|
+
sentenceId: 38,
|
|
4191
|
+
text: "Direkt gegenüber steht ein wundervoller Palast.",
|
|
4192
|
+
metadata: { verified: !1 }
|
|
4193
|
+
},
|
|
4194
|
+
{
|
|
4195
|
+
sentenceId: 39,
|
|
4196
|
+
text: "Henrys Hund ist verloren.",
|
|
4197
|
+
metadata: { verified: !1 }
|
|
4198
|
+
},
|
|
4199
|
+
{
|
|
4200
|
+
sentenceId: 40,
|
|
4201
|
+
text: "Meine Katze ist schwarz.",
|
|
4202
|
+
metadata: { verified: !1 }
|
|
4203
|
+
},
|
|
4204
|
+
{
|
|
4205
|
+
sentenceId: 41,
|
|
4206
|
+
text: "Die Puppe des kleinen Mädchens ist kaputt.",
|
|
4207
|
+
metadata: { verified: !1 }
|
|
4208
|
+
},
|
|
4209
|
+
{
|
|
4210
|
+
sentenceId: 42,
|
|
4211
|
+
text: "Ich schlafe normalerweise tief.",
|
|
4212
|
+
metadata: { verified: !1 }
|
|
4213
|
+
},
|
|
4214
|
+
{
|
|
4215
|
+
sentenceId: 43,
|
|
4216
|
+
text: "Die Kinder liefen hinter Jack her.",
|
|
4217
|
+
metadata: { verified: !1 }
|
|
4218
|
+
},
|
|
4219
|
+
{
|
|
4220
|
+
sentenceId: 44,
|
|
4221
|
+
text: "Ich kann nach der Schule spielen.",
|
|
4222
|
+
metadata: { verified: !1 }
|
|
4223
|
+
},
|
|
4224
|
+
{
|
|
4225
|
+
sentenceId: 45,
|
|
4226
|
+
text: "Wir gingen zu Besuch ins Dorf.",
|
|
4227
|
+
metadata: { verified: !1 }
|
|
4228
|
+
},
|
|
4229
|
+
{
|
|
4230
|
+
sentenceId: 46,
|
|
4231
|
+
text: "Wir kamen am Fluss an.",
|
|
4232
|
+
metadata: { verified: !1 }
|
|
4233
|
+
},
|
|
4234
|
+
{
|
|
4235
|
+
sentenceId: 47,
|
|
4236
|
+
text: "Ich habe auf dich gewartet.",
|
|
4237
|
+
metadata: { verified: !1 }
|
|
4238
|
+
},
|
|
4239
|
+
{
|
|
4240
|
+
sentenceId: 48,
|
|
4241
|
+
text: "Die Camper saßen um das Feuer.",
|
|
4242
|
+
metadata: { verified: !1 }
|
|
4243
|
+
},
|
|
4244
|
+
{
|
|
4245
|
+
sentenceId: 49,
|
|
4246
|
+
text: "Ein kleines Mädchen mit einem Kätzchen saß neben mir.",
|
|
4247
|
+
metadata: { verified: !1 }
|
|
4248
|
+
},
|
|
4249
|
+
{
|
|
4250
|
+
sentenceId: 50,
|
|
4251
|
+
text: "Das Kind wartete an der Tür auf seinen Vater.",
|
|
4252
|
+
metadata: { verified: !1 }
|
|
4253
|
+
}
|
|
4254
|
+
], mt = {}, ht = ct({
|
|
4255
|
+
targetLang: "de",
|
|
4256
|
+
translations: pt,
|
|
4257
|
+
defaultRemarks: mt
|
|
4258
|
+
}), gt = mt;
|
|
4259
|
+
//#endregion
|
|
4260
|
+
export { ht as n, gt as t };
|
|
4261
|
+
|
|
4262
|
+
//# sourceMappingURL=essential-218-B3oYfd9D.js.map
|