@hyperjump/json-schema 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +176 -0
  3. package/dist/json-schema-amd.js +4710 -0
  4. package/dist/json-schema-amd.js.map +1 -0
  5. package/dist/json-schema-amd.min.js +2 -0
  6. package/dist/json-schema-amd.min.js.map +1 -0
  7. package/dist/json-schema-cjs.js +4708 -0
  8. package/dist/json-schema-cjs.js.map +1 -0
  9. package/dist/json-schema-cjs.min.js +2 -0
  10. package/dist/json-schema-cjs.min.js.map +1 -0
  11. package/dist/json-schema-esm.js +4691 -0
  12. package/dist/json-schema-esm.js.map +1 -0
  13. package/dist/json-schema-esm.min.js +2 -0
  14. package/dist/json-schema-esm.min.js.map +1 -0
  15. package/dist/json-schema-iife.js +4713 -0
  16. package/dist/json-schema-iife.js.map +1 -0
  17. package/dist/json-schema-iife.min.js +2 -0
  18. package/dist/json-schema-iife.min.js.map +1 -0
  19. package/dist/json-schema-system.js +4698 -0
  20. package/dist/json-schema-system.js.map +1 -0
  21. package/dist/json-schema-system.min.js +2 -0
  22. package/dist/json-schema-system.min.js.map +1 -0
  23. package/dist/json-schema-umd.js +4714 -0
  24. package/dist/json-schema-umd.js.map +1 -0
  25. package/dist/json-schema-umd.min.js +2 -0
  26. package/dist/json-schema-umd.min.js.map +1 -0
  27. package/lib/common.js +13 -0
  28. package/lib/draft-04.d.ts +40 -0
  29. package/lib/draft-04.js +94 -0
  30. package/lib/draft-06.d.ts +44 -0
  31. package/lib/draft-06.js +51 -0
  32. package/lib/draft-07.d.ts +52 -0
  33. package/lib/draft-07.js +55 -0
  34. package/lib/draft-2019-09.d.ts +62 -0
  35. package/lib/draft-2019-09.js +92 -0
  36. package/lib/draft-2020-12.d.ts +62 -0
  37. package/lib/draft-2020-12.js +103 -0
  38. package/lib/index.d.ts +28 -0
  39. package/lib/index.js +26 -0
  40. package/lib/index.mjs +18 -0
  41. package/lib/keywords/additionalItems.js +27 -0
  42. package/lib/keywords/additionalItems6.js +23 -0
  43. package/lib/keywords/additionalProperties.js +33 -0
  44. package/lib/keywords/additionalProperties6.js +28 -0
  45. package/lib/keywords/allOf.js +28 -0
  46. package/lib/keywords/anyOf.js +29 -0
  47. package/lib/keywords/const.js +8 -0
  48. package/lib/keywords/contains-minContains-maxContains.js +33 -0
  49. package/lib/keywords/contains.js +10 -0
  50. package/lib/keywords/definitions.js +15 -0
  51. package/lib/keywords/dependencies.js +29 -0
  52. package/lib/keywords/dependentRequired.js +19 -0
  53. package/lib/keywords/dependentSchemas.js +30 -0
  54. package/lib/keywords/dynamicRef.js +24 -0
  55. package/lib/keywords/else.js +43 -0
  56. package/lib/keywords/enum.js +8 -0
  57. package/lib/keywords/exclusiveMaximum.js +7 -0
  58. package/lib/keywords/exclusiveMinimum.js +7 -0
  59. package/lib/keywords/if.js +19 -0
  60. package/lib/keywords/index.js +55 -0
  61. package/lib/keywords/items.js +31 -0
  62. package/lib/keywords/items202012.js +23 -0
  63. package/lib/keywords/maxItems.js +7 -0
  64. package/lib/keywords/maxLength.js +7 -0
  65. package/lib/keywords/maxLength6.js +7 -0
  66. package/lib/keywords/maxProperties.js +7 -0
  67. package/lib/keywords/maximum-exclusiveMaximum.js +20 -0
  68. package/lib/keywords/maximum.js +7 -0
  69. package/lib/keywords/minItems.js +7 -0
  70. package/lib/keywords/minLength.js +7 -0
  71. package/lib/keywords/minLength6.js +7 -0
  72. package/lib/keywords/minProperties.js +7 -0
  73. package/lib/keywords/minimum-exclusiveMinimum.js +20 -0
  74. package/lib/keywords/minimum.js +7 -0
  75. package/lib/keywords/multipleOf.js +17 -0
  76. package/lib/keywords/not.js +7 -0
  77. package/lib/keywords/oneOf.js +48 -0
  78. package/lib/keywords/pattern.js +7 -0
  79. package/lib/keywords/patternProperties.js +23 -0
  80. package/lib/keywords/properties.js +25 -0
  81. package/lib/keywords/propertyNames.js +11 -0
  82. package/lib/keywords/ref.js +13 -0
  83. package/lib/keywords/required.js +10 -0
  84. package/lib/keywords/then.js +43 -0
  85. package/lib/keywords/tupleItems.js +24 -0
  86. package/lib/keywords/type.js +7 -0
  87. package/lib/keywords/unevaluatedItems.js +23 -0
  88. package/lib/keywords/unevaluatedProperties.js +24 -0
  89. package/lib/keywords/uniqueItems.js +16 -0
  90. package/meta/draft/2019-09/meta/applicator.js +55 -0
  91. package/meta/draft/2019-09/meta/content.js +17 -0
  92. package/meta/draft/2019-09/meta/core.js +57 -0
  93. package/meta/draft/2019-09/meta/format.js +14 -0
  94. package/meta/draft/2019-09/meta/meta-data.js +37 -0
  95. package/meta/draft/2019-09/meta/validation.js +98 -0
  96. package/meta/draft/2019-09/schema.js +42 -0
  97. package/meta/draft/2020-12/meta/applicator.js +49 -0
  98. package/meta/draft/2020-12/meta/content.js +17 -0
  99. package/meta/draft/2020-12/meta/core.js +57 -0
  100. package/meta/draft/2020-12/meta/format-annotation.js +14 -0
  101. package/meta/draft/2020-12/meta/format-assertion.js +14 -0
  102. package/meta/draft/2020-12/meta/meta-data.js +37 -0
  103. package/meta/draft/2020-12/meta/unevaluated.js +15 -0
  104. package/meta/draft/2020-12/meta/validation.js +98 -0
  105. package/meta/draft/2020-12/schema.js +44 -0
  106. package/meta/draft-04/hyper-schema.js +136 -0
  107. package/meta/draft-04/schema.js +149 -0
  108. package/meta/draft-06/schema.js +154 -0
  109. package/meta/draft-07/schema.js +172 -0
  110. package/package.json +57 -0
@@ -0,0 +1,4713 @@
1
+ var JsonSchema = (function (exports) {
2
+ 'use strict';
3
+
4
+ var justCurryIt = curry;
5
+
6
+ /*
7
+ function add(a, b, c) {
8
+ return a + b + c;
9
+ }
10
+ curry(add)(1)(2)(3); // 6
11
+ curry(add)(1)(2)(2); // 5
12
+ curry(add)(2)(4, 3); // 9
13
+
14
+ function add(...args) {
15
+ return args.reduce((sum, n) => sum + n, 0)
16
+ }
17
+ var curryAdd4 = curry(add, 4)
18
+ curryAdd4(1)(2, 3)(4); // 10
19
+
20
+ function converter(ratio, input) {
21
+ return (input*ratio).toFixed(1);
22
+ }
23
+ const curriedConverter = curry(converter)
24
+ const milesToKm = curriedConverter(1.62);
25
+ milesToKm(35); // 56.7
26
+ milesToKm(10); // 16.2
27
+ */
28
+
29
+ function curry(fn, arity) {
30
+ return function curried() {
31
+ if (arity == null) {
32
+ arity = fn.length;
33
+ }
34
+ var args = [].slice.call(arguments);
35
+ if (args.length >= arity) {
36
+ return fn.apply(this, args);
37
+ } else {
38
+ return function() {
39
+ return curried.apply(this, args.concat([].slice.call(arguments)));
40
+ };
41
+ }
42
+ };
43
+ }
44
+
45
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
46
+
47
+ function createCommonjsModule(fn, module) {
48
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
49
+ }
50
+
51
+ var pubsub = createCommonjsModule(function (module, exports) {
52
+ /**
53
+ * Copyright (c) 2010,2011,2012,2013,2014 Morgan Roderick http://roderick.dk
54
+ * License: MIT - http://mrgnrdrck.mit-license.org
55
+ *
56
+ * https://github.com/mroderick/PubSubJS
57
+ */
58
+
59
+ (function (root, factory){
60
+
61
+ var PubSub = {};
62
+ root.PubSub = PubSub;
63
+ factory(PubSub);
64
+ // CommonJS and Node.js module support
65
+ {
66
+ if (module !== undefined && module.exports) {
67
+ exports = module.exports = PubSub; // Node.js specific `module.exports`
68
+ }
69
+ exports.PubSub = PubSub; // CommonJS module 1.1.1 spec
70
+ module.exports = exports = PubSub; // CommonJS
71
+ }
72
+
73
+ }(( typeof window === 'object' && window ) || commonjsGlobal, function (PubSub){
74
+
75
+ var messages = {},
76
+ lastUid = -1,
77
+ ALL_SUBSCRIBING_MSG = '*';
78
+
79
+ function hasKeys(obj){
80
+ var key;
81
+
82
+ for (key in obj){
83
+ if ( Object.prototype.hasOwnProperty.call(obj, key) ){
84
+ return true;
85
+ }
86
+ }
87
+ return false;
88
+ }
89
+
90
+ /**
91
+ * Returns a function that throws the passed exception, for use as argument for setTimeout
92
+ * @alias throwException
93
+ * @function
94
+ * @param { Object } ex An Error object
95
+ */
96
+ function throwException( ex ){
97
+ return function reThrowException(){
98
+ throw ex;
99
+ };
100
+ }
101
+
102
+ function callSubscriberWithDelayedExceptions( subscriber, message, data ){
103
+ try {
104
+ subscriber( message, data );
105
+ } catch( ex ){
106
+ setTimeout( throwException( ex ), 0);
107
+ }
108
+ }
109
+
110
+ function callSubscriberWithImmediateExceptions( subscriber, message, data ){
111
+ subscriber( message, data );
112
+ }
113
+
114
+ function deliverMessage( originalMessage, matchedMessage, data, immediateExceptions ){
115
+ var subscribers = messages[matchedMessage],
116
+ callSubscriber = immediateExceptions ? callSubscriberWithImmediateExceptions : callSubscriberWithDelayedExceptions,
117
+ s;
118
+
119
+ if ( !Object.prototype.hasOwnProperty.call( messages, matchedMessage ) ) {
120
+ return;
121
+ }
122
+
123
+ for (s in subscribers){
124
+ if ( Object.prototype.hasOwnProperty.call(subscribers, s)){
125
+ callSubscriber( subscribers[s], originalMessage, data );
126
+ }
127
+ }
128
+ }
129
+
130
+ function createDeliveryFunction( message, data, immediateExceptions ){
131
+ return function deliverNamespaced(){
132
+ var topic = String( message ),
133
+ position = topic.lastIndexOf( '.' );
134
+
135
+ // deliver the message as it is now
136
+ deliverMessage(message, message, data, immediateExceptions);
137
+
138
+ // trim the hierarchy and deliver message to each level
139
+ while( position !== -1 ){
140
+ topic = topic.substr( 0, position );
141
+ position = topic.lastIndexOf('.');
142
+ deliverMessage( message, topic, data, immediateExceptions );
143
+ }
144
+
145
+ deliverMessage(message, ALL_SUBSCRIBING_MSG, data, immediateExceptions);
146
+ };
147
+ }
148
+
149
+ function hasDirectSubscribersFor( message ) {
150
+ var topic = String( message ),
151
+ found = Boolean(Object.prototype.hasOwnProperty.call( messages, topic ) && hasKeys(messages[topic]));
152
+
153
+ return found;
154
+ }
155
+
156
+ function messageHasSubscribers( message ){
157
+ var topic = String( message ),
158
+ found = hasDirectSubscribersFor(topic) || hasDirectSubscribersFor(ALL_SUBSCRIBING_MSG),
159
+ position = topic.lastIndexOf( '.' );
160
+
161
+ while ( !found && position !== -1 ){
162
+ topic = topic.substr( 0, position );
163
+ position = topic.lastIndexOf( '.' );
164
+ found = hasDirectSubscribersFor(topic);
165
+ }
166
+
167
+ return found;
168
+ }
169
+
170
+ function publish( message, data, sync, immediateExceptions ){
171
+ message = (typeof message === 'symbol') ? message.toString() : message;
172
+
173
+ var deliver = createDeliveryFunction( message, data, immediateExceptions ),
174
+ hasSubscribers = messageHasSubscribers( message );
175
+
176
+ if ( !hasSubscribers ){
177
+ return false;
178
+ }
179
+
180
+ if ( sync === true ){
181
+ deliver();
182
+ } else {
183
+ setTimeout( deliver, 0 );
184
+ }
185
+ return true;
186
+ }
187
+
188
+ /**
189
+ * Publishes the message, passing the data to it's subscribers
190
+ * @function
191
+ * @alias publish
192
+ * @param { String } message The message to publish
193
+ * @param {} data The data to pass to subscribers
194
+ * @return { Boolean }
195
+ */
196
+ PubSub.publish = function( message, data ){
197
+ return publish( message, data, false, PubSub.immediateExceptions );
198
+ };
199
+
200
+ /**
201
+ * Publishes the message synchronously, passing the data to it's subscribers
202
+ * @function
203
+ * @alias publishSync
204
+ * @param { String } message The message to publish
205
+ * @param {} data The data to pass to subscribers
206
+ * @return { Boolean }
207
+ */
208
+ PubSub.publishSync = function( message, data ){
209
+ return publish( message, data, true, PubSub.immediateExceptions );
210
+ };
211
+
212
+ /**
213
+ * Subscribes the passed function to the passed message. Every returned token is unique and should be stored if you need to unsubscribe
214
+ * @function
215
+ * @alias subscribe
216
+ * @param { String } message The message to subscribe to
217
+ * @param { Function } func The function to call when a new message is published
218
+ * @return { String }
219
+ */
220
+ PubSub.subscribe = function( message, func ){
221
+ if ( typeof func !== 'function'){
222
+ return false;
223
+ }
224
+
225
+ message = (typeof message === 'symbol') ? message.toString() : message;
226
+
227
+ // message is not registered yet
228
+ if ( !Object.prototype.hasOwnProperty.call( messages, message ) ){
229
+ messages[message] = {};
230
+ }
231
+
232
+ // forcing token as String, to allow for future expansions without breaking usage
233
+ // and allow for easy use as key names for the 'messages' object
234
+ var token = 'uid_' + String(++lastUid);
235
+ messages[message][token] = func;
236
+
237
+ // return token for unsubscribing
238
+ return token;
239
+ };
240
+
241
+ PubSub.subscribeAll = function( func ){
242
+ return PubSub.subscribe(ALL_SUBSCRIBING_MSG, func);
243
+ };
244
+
245
+ /**
246
+ * Subscribes the passed function to the passed message once
247
+ * @function
248
+ * @alias subscribeOnce
249
+ * @param { String } message The message to subscribe to
250
+ * @param { Function } func The function to call when a new message is published
251
+ * @return { PubSub }
252
+ */
253
+ PubSub.subscribeOnce = function( message, func ){
254
+ var token = PubSub.subscribe( message, function(){
255
+ // before func apply, unsubscribe message
256
+ PubSub.unsubscribe( token );
257
+ func.apply( this, arguments );
258
+ });
259
+ return PubSub;
260
+ };
261
+
262
+ /**
263
+ * Clears all subscriptions
264
+ * @function
265
+ * @public
266
+ * @alias clearAllSubscriptions
267
+ */
268
+ PubSub.clearAllSubscriptions = function clearAllSubscriptions(){
269
+ messages = {};
270
+ };
271
+
272
+ /**
273
+ * Clear subscriptions by the topic
274
+ * @function
275
+ * @public
276
+ * @alias clearAllSubscriptions
277
+ * @return { int }
278
+ */
279
+ PubSub.clearSubscriptions = function clearSubscriptions(topic){
280
+ var m;
281
+ for (m in messages){
282
+ if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){
283
+ delete messages[m];
284
+ }
285
+ }
286
+ };
287
+
288
+ /**
289
+ Count subscriptions by the topic
290
+ * @function
291
+ * @public
292
+ * @alias countSubscriptions
293
+ * @return { Array }
294
+ */
295
+ PubSub.countSubscriptions = function countSubscriptions(topic){
296
+ var m;
297
+ // eslint-disable-next-line no-unused-vars
298
+ var token;
299
+ var count = 0;
300
+ for (m in messages) {
301
+ if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0) {
302
+ for (token in messages[m]) {
303
+ count++;
304
+ }
305
+ break;
306
+ }
307
+ }
308
+ return count;
309
+ };
310
+
311
+
312
+ /**
313
+ Gets subscriptions by the topic
314
+ * @function
315
+ * @public
316
+ * @alias getSubscriptions
317
+ */
318
+ PubSub.getSubscriptions = function getSubscriptions(topic){
319
+ var m;
320
+ var list = [];
321
+ for (m in messages){
322
+ if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){
323
+ list.push(m);
324
+ }
325
+ }
326
+ return list;
327
+ };
328
+
329
+ /**
330
+ * Removes subscriptions
331
+ *
332
+ * - When passed a token, removes a specific subscription.
333
+ *
334
+ * - When passed a function, removes all subscriptions for that function
335
+ *
336
+ * - When passed a topic, removes all subscriptions for that topic (hierarchy)
337
+ * @function
338
+ * @public
339
+ * @alias subscribeOnce
340
+ * @param { String | Function } value A token, function or topic to unsubscribe from
341
+ * @example // Unsubscribing with a token
342
+ * var token = PubSub.subscribe('mytopic', myFunc);
343
+ * PubSub.unsubscribe(token);
344
+ * @example // Unsubscribing with a function
345
+ * PubSub.unsubscribe(myFunc);
346
+ * @example // Unsubscribing from a topic
347
+ * PubSub.unsubscribe('mytopic');
348
+ */
349
+ PubSub.unsubscribe = function(value){
350
+ var descendantTopicExists = function(topic) {
351
+ var m;
352
+ for ( m in messages ){
353
+ if ( Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0 ){
354
+ // a descendant of the topic exists:
355
+ return true;
356
+ }
357
+ }
358
+
359
+ return false;
360
+ },
361
+ isTopic = typeof value === 'string' && ( Object.prototype.hasOwnProperty.call(messages, value) || descendantTopicExists(value) ),
362
+ isToken = !isTopic && typeof value === 'string',
363
+ isFunction = typeof value === 'function',
364
+ result = false,
365
+ m, message, t;
366
+
367
+ if (isTopic){
368
+ PubSub.clearSubscriptions(value);
369
+ return;
370
+ }
371
+
372
+ for ( m in messages ){
373
+ if ( Object.prototype.hasOwnProperty.call( messages, m ) ){
374
+ message = messages[m];
375
+
376
+ if ( isToken && message[value] ){
377
+ delete message[value];
378
+ result = value;
379
+ // tokens are unique, so we can just stop here
380
+ break;
381
+ }
382
+
383
+ if (isFunction) {
384
+ for ( t in message ){
385
+ if (Object.prototype.hasOwnProperty.call(message, t) && message[t] === value){
386
+ delete message[t];
387
+ result = true;
388
+ }
389
+ }
390
+ }
391
+ }
392
+ }
393
+
394
+ return result;
395
+ };
396
+ }));
397
+ });
398
+ pubsub.PubSub;
399
+
400
+ var urlResolveBrowser = urlResolve;
401
+
402
+ /*
403
+ The majority of the module is built by following RFC1808
404
+ url: https://tools.ietf.org/html/rfc1808
405
+ */
406
+
407
+ // adds a slash at end if not present
408
+ function _addSlash (url) {
409
+ return url + (url[url.length-1] === '/' ? '' : '/');
410
+ }
411
+
412
+ // resolve the ..'s (directory up) and such
413
+ function _pathResolve (path) {
414
+ let pathSplit = path.split('/');
415
+
416
+ // happens when path starts with /
417
+ if (pathSplit[0] === '') {
418
+ pathSplit = pathSplit.slice(1);
419
+ }
420
+
421
+ // let segmentCount = 0; // number of segments that have been passed
422
+ let resultArray = [];
423
+ pathSplit.forEach((current, index) => {
424
+ // skip occurances of '.'
425
+ if (current !== '.') {
426
+ if (current === '..') {
427
+ resultArray.pop(); // remove previous
428
+ } else if (current !== '' || index === pathSplit.length - 1) {
429
+ resultArray.push(current);
430
+ }
431
+ }
432
+ });
433
+ return '/' + resultArray.join('/');
434
+ }
435
+
436
+ // parses a base url string into an object containing host, path and query
437
+ function _baseParse (base) {
438
+ const resultObject = {
439
+ host: '',
440
+ path: '',
441
+ query: '',
442
+ protocol: ''
443
+ };
444
+
445
+ let path = base;
446
+ let protocolEndIndex = base.indexOf('//');
447
+
448
+ resultObject.protocol = path.substring(0, protocolEndIndex);
449
+
450
+ protocolEndIndex += 2; // add two to pass double slash
451
+
452
+ const pathIndex = base.indexOf('/', protocolEndIndex);
453
+ const queryIndex = base.indexOf('?');
454
+ const hashIndex = base.indexOf('#');
455
+
456
+ if (hashIndex !== -1) {
457
+ path = path.substring(0, hashIndex); // remove hash, not needed for base
458
+ }
459
+
460
+ if (queryIndex !== -1) {
461
+ const query = path.substring(queryIndex); // remove query, save in return obj
462
+ resultObject.query = query;
463
+ path = path.substring(0, queryIndex);
464
+ }
465
+
466
+ if (pathIndex !== -1) {
467
+ const host = path.substring(0, pathIndex); // separate host & path
468
+ resultObject.host = host;
469
+ path = path.substring(pathIndex);
470
+ resultObject.path = path;
471
+ } else {
472
+ resultObject.host = path; // there was no path, therefore path is host
473
+ }
474
+
475
+ return resultObject;
476
+ }
477
+
478
+ // https://tools.ietf.org/html/rfc3986#section-3.1
479
+ const _scheme = '[a-z][a-z0-9+.-]*'; // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )]
480
+ const _isAbsolute = new RegExp(`^(${_scheme}:)?//`, 'i');
481
+
482
+ // parses a relative url string into an object containing the href,
483
+ // hash, query and whether it is a net path, absolute path or relative path
484
+ function _relativeParse (relative) {
485
+ const resultObject = {
486
+ href: relative, // href is always what was passed through
487
+ hash: '',
488
+ query: '',
489
+ netPath: false,
490
+ absolutePath: false,
491
+ relativePath: false
492
+ };
493
+ // check for protocol
494
+ // if protocol exists, is net path (absolute URL)
495
+ if (_isAbsolute.test(relative)) {
496
+ resultObject.netPath = true;
497
+ // return, in this case the relative is the resolved url, no need to parse.
498
+ return resultObject;
499
+ }
500
+
501
+ // if / is first, this is an absolute path,
502
+ // I.E. it overwrites the base URL's path
503
+ if (relative[0] === '/') {
504
+ resultObject.absolutePath = true;
505
+ // return resultObject
506
+ } else if (relative !== '') {
507
+ resultObject.relativePath = true;
508
+ }
509
+
510
+ let path = relative;
511
+ const queryIndex = relative.indexOf('?');
512
+ const hashIndex = relative.indexOf('#');
513
+
514
+ if (hashIndex !== -1) {
515
+ const hash = path.substring(hashIndex);
516
+ resultObject.hash = hash;
517
+ path = path.substring(0, hashIndex);
518
+ }
519
+
520
+ if (queryIndex !== -1) {
521
+ const query = path.substring(queryIndex);
522
+ resultObject.query = query;
523
+ path = path.substring(0, queryIndex);
524
+ }
525
+
526
+ resultObject.path = path; // whatever is left is path
527
+ return resultObject;
528
+ }
529
+
530
+ function _shouldAddSlash (url) {
531
+ const protocolIndex = url.indexOf('//') + 2;
532
+ const noPath = !(url.includes('/', protocolIndex));
533
+ const noQuery = !(url.includes('?', protocolIndex));
534
+ const noHash = !(url.includes('#', protocolIndex));
535
+ return (noPath && noQuery && noHash);
536
+ }
537
+
538
+ function _shouldAddProtocol (url) {
539
+ return url.startsWith('//');
540
+ }
541
+
542
+ /*
543
+ * PRECONDITION: Base is a fully qualified URL. e.g. http://example.com/
544
+ * optional: path, query or hash
545
+ * returns the resolved url
546
+ */
547
+ function urlResolve (base, relative) {
548
+ base = base.trim();
549
+ relative = relative.trim();
550
+
551
+ // about is always absolute
552
+ if (relative.startsWith('about:')) {
553
+ return relative;
554
+ }
555
+
556
+ const baseObj = _baseParse(base);
557
+ const relativeObj = _relativeParse(relative);
558
+
559
+ if (!baseObj.protocol && !relativeObj.netPath) {
560
+ throw new Error('Error, protocol is not specified');
561
+ }
562
+
563
+ if (relativeObj.netPath) { // relative is full qualified URL
564
+ if (_shouldAddProtocol(relativeObj.href)) {
565
+ relativeObj.href = baseObj.protocol + relativeObj.href;
566
+ }
567
+
568
+ if (_shouldAddSlash(relativeObj.href)) {
569
+ return _addSlash(relativeObj.href);
570
+ }
571
+
572
+ return relativeObj.href;
573
+ } else if (relativeObj.absolutePath) { // relative is an absolute path
574
+ const {path, query, hash} = relativeObj;
575
+
576
+ return baseObj.host + _pathResolve(path) + query + hash;
577
+ } else if (relativeObj.relativePath) { // relative is a relative path
578
+ const {path, query, hash} = relativeObj;
579
+
580
+ let basePath = baseObj.path;
581
+ let resultString = baseObj.host;
582
+
583
+ let resolvePath;
584
+
585
+ if (path.length === 0) {
586
+ resolvePath = basePath;
587
+ } else {
588
+ // remove last segment if no slash at end
589
+ basePath = basePath.substring(0, basePath.lastIndexOf('/'));
590
+ resolvePath = _pathResolve(basePath + '/' + path);
591
+ }
592
+
593
+ // if result is just the base host, add /
594
+ if ((resolvePath === '') && (!query) && (!hash)) {
595
+ resultString += '/';
596
+ } else {
597
+ resultString += resolvePath + query + hash;
598
+ }
599
+
600
+ return resultString;
601
+ } else {
602
+ const {host, path, query} = baseObj;
603
+ // when path and query aren't supplied add slash
604
+ if ((!path) && (!query)) {
605
+ return _addSlash(host);
606
+ }
607
+ return host + path + query + relativeObj.hash;
608
+ }
609
+ }
610
+
611
+ const isObject$1 = (value) => typeof value === "object" && !Array.isArray(value) && value !== null;
612
+ const isType = {
613
+ null: (value) => value === null,
614
+ boolean: (value) => typeof value === "boolean",
615
+ object: isObject$1,
616
+ array: (value) => Array.isArray(value),
617
+ number: (value) => typeof value === "number",
618
+ integer: (value) => Number.isInteger(value),
619
+ string: (value) => typeof value === "string"
620
+ };
621
+ const jsonTypeOf$2 = (value, type) => isType[type](value);
622
+
623
+ const splitUrl$4 = (url) => {
624
+ const indexOfHash = url.indexOf("#");
625
+ const ndx = indexOfHash === -1 ? url.length : indexOfHash;
626
+ const urlReference = url.slice(0, ndx);
627
+ const urlFragment = url.slice(ndx + 1);
628
+
629
+ return [decodeURI(urlReference), decodeURI(urlFragment)];
630
+ };
631
+
632
+ const getScheme = (url) => {
633
+ const matches = RegExp(/^(.+):\/\//).exec(url);
634
+ return matches ? matches[1] : "";
635
+ };
636
+
637
+ const safeResolveUrl$1 = (contextUrl, url) => {
638
+ const resolvedUrl = urlResolveBrowser(contextUrl, url);
639
+ const contextId = splitUrl$4(contextUrl)[0];
640
+ if (contextId && getScheme(resolvedUrl) === "file" && getScheme(contextId) !== "file") {
641
+ throw Error(`Can't access file '${resolvedUrl}' resource from network context '${contextUrl}'`);
642
+ }
643
+ return resolvedUrl;
644
+ };
645
+
646
+ var common$1 = { jsonTypeOf: jsonTypeOf$2, splitUrl: splitUrl$4, safeResolveUrl: safeResolveUrl$1 };
647
+
648
+ const nil$2 = "";
649
+
650
+ const compile$P = (pointer) => {
651
+ if (pointer.length > 0 && pointer[0] !== "/") {
652
+ throw Error("Invalid JSON Pointer");
653
+ }
654
+
655
+ return pointer.split("/").slice(1).map(unescape);
656
+ };
657
+
658
+ const get$1 = (pointer, value = undefined) => {
659
+ const ptr = compile$P(pointer);
660
+
661
+ const fn = (value) => ptr.reduce(([value, pointer], segment) => {
662
+ return [applySegment(value, segment, pointer), append(segment, pointer)];
663
+ }, [value, ""])[0];
664
+
665
+ return value === undefined ? fn : fn(value);
666
+ };
667
+
668
+ const set = (pointer, subject = undefined, value = undefined) => {
669
+ const ptr = compile$P(pointer);
670
+ const fn = justCurryIt((subject, value) => _set(ptr, subject, value, nil$2));
671
+ return subject === undefined ? fn : fn(subject, value);
672
+ };
673
+
674
+ const _set = (pointer, subject, value, cursor) => {
675
+ if (pointer.length === 0) {
676
+ return value;
677
+ } else if (pointer.length > 1) {
678
+ const segment = pointer.shift();
679
+ return { ...subject, [segment]: _set(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
680
+ } else if (Array.isArray(subject)) {
681
+ const clonedSubject = [...subject];
682
+ const segment = computeSegment(subject, pointer[0]);
683
+ clonedSubject[segment] = value;
684
+ return clonedSubject;
685
+ } else if (typeof subject === "object" && subject !== null) {
686
+ return { ...subject, [pointer[0]]: value };
687
+ } else {
688
+ return applySegment(subject, pointer[0], cursor);
689
+ }
690
+ };
691
+
692
+ const assign = (pointer, subject = undefined, value = undefined) => {
693
+ const ptr = compile$P(pointer);
694
+ const fn = justCurryIt((subject, value) => _assign(ptr, subject, value, nil$2));
695
+ return subject === undefined ? fn : fn(subject, value);
696
+ };
697
+
698
+ const _assign = (pointer, subject, value, cursor) => {
699
+ if (pointer.length === 0) {
700
+ return;
701
+ } else if (pointer.length === 1 && !isScalar(subject)) {
702
+ const segment = computeSegment(subject, pointer[0]);
703
+ subject[segment] = value;
704
+ } else {
705
+ const segment = pointer.shift();
706
+ _assign(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor));
707
+ }
708
+ };
709
+
710
+ const unset = (pointer, subject = undefined) => {
711
+ const ptr = compile$P(pointer);
712
+ const fn = (subject) => _unset(ptr, subject, nil$2);
713
+ return subject === undefined ? fn : fn(subject);
714
+ };
715
+
716
+ const _unset = (pointer, subject, cursor) => {
717
+ if (pointer.length == 0) {
718
+ return undefined;
719
+ } else if (pointer.length > 1) {
720
+ const segment = pointer.shift();
721
+ const value = applySegment(subject, segment, cursor);
722
+ return { ...subject, [segment]: _unset(pointer, value, append(segment, cursor)) };
723
+ } else if (Array.isArray(subject)) {
724
+ return subject.filter((_, ndx) => ndx != pointer[0]);
725
+ } else if (typeof subject === "object" && subject !== null) {
726
+ // eslint-disable-next-line no-unused-vars
727
+ const { [pointer[0]]: _, ...result } = subject;
728
+ return result;
729
+ } else {
730
+ return applySegment(subject, pointer[0], cursor);
731
+ }
732
+ };
733
+
734
+ const remove = (pointer, subject = undefined) => {
735
+ const ptr = compile$P(pointer);
736
+ const fn = (subject) => _remove(ptr, subject, nil$2);
737
+ return subject === undefined ? fn : fn(subject);
738
+ };
739
+
740
+ const _remove = (pointer, subject, cursor) => {
741
+ if (pointer.length === 0) {
742
+ return;
743
+ } else if (pointer.length > 1) {
744
+ const segment = pointer.shift();
745
+ const value = applySegment(subject, segment, cursor);
746
+ _remove(pointer, value, append(segment, cursor));
747
+ } else if (Array.isArray(subject)) {
748
+ subject.splice(pointer[0], 1);
749
+ } else if (typeof subject === "object" && subject !== null) {
750
+ delete subject[pointer[0]];
751
+ } else {
752
+ applySegment(subject, pointer[0], cursor);
753
+ }
754
+ };
755
+
756
+ const append = justCurryIt((segment, pointer) => pointer + "/" + escape(segment));
757
+
758
+ const escape = (segment) => segment.toString().replace(/~/g, "~0").replace(/\//g, "~1");
759
+ const unescape = (segment) => segment.toString().replace(/~1/g, "/").replace(/~0/g, "~");
760
+ const computeSegment = (value, segment) => Array.isArray(value) && segment === "-" ? value.length : segment;
761
+
762
+ const applySegment = (value, segment, cursor = "") => {
763
+ if (value === undefined) {
764
+ throw TypeError(`Value at '${cursor}' is undefined and does not have property '${segment}'`);
765
+ } else if (value === null) {
766
+ throw TypeError(`Value at '${cursor}' is null and does not have property '${segment}'`);
767
+ } else if (isScalar(value)) {
768
+ throw TypeError(`Value at '${cursor}' is a ${typeof value} and does not have property '${segment}'`);
769
+ } else {
770
+ const computedSegment = computeSegment(value, segment);
771
+ return value[computedSegment];
772
+ }
773
+ };
774
+
775
+ const isScalar = (value) => value === null || typeof value !== "object";
776
+
777
+ var lib$3 = { nil: nil$2, append, get: get$1, set, assign, unset, remove };
778
+ lib$3.nil;
779
+ lib$3.append;
780
+ lib$3.get;
781
+ lib$3.set;
782
+ lib$3.assign;
783
+ lib$3.unset;
784
+ lib$3.remove;
785
+
786
+ const $__value = Symbol("$__value");
787
+ const $__href = Symbol("$__href");
788
+
789
+ const cons$1 = (href, value) => Object.freeze({
790
+ [$__href]: href,
791
+ [$__value]: value
792
+ });
793
+
794
+ const isReference = (ref) => ref && ref[$__href] !== undefined;
795
+ const href = (ref) => ref[$__href];
796
+ const value$2 = (ref) => ref[$__value];
797
+
798
+ var reference = { cons: cons$1, isReference, href, value: value$2 };
799
+
800
+ const { jsonTypeOf: jsonTypeOf$1 } = common$1;
801
+
802
+
803
+
804
+ const nil$1 = Object.freeze({ id: "", pointer: "", instance: undefined, value: undefined });
805
+ const cons = (instance, id = "") => Object.freeze({ ...nil$1, id, instance, value: instance });
806
+ const uri$1 = (doc) => `${doc.id}#${encodeURI(doc.pointer)}`;
807
+ const value$1 = (doc) => reference.isReference(doc.value) ? reference.value(doc.value) : doc.value;
808
+ const has$1 = (key, doc) => key in value$1(doc);
809
+ const typeOf$1 = justCurryIt((doc, type) => jsonTypeOf$1(value$1(doc), type));
810
+
811
+ const step$1 = (key, doc) => Object.freeze({
812
+ ...doc,
813
+ pointer: lib$3.append(key, doc.pointer),
814
+ value: value$1(doc)[key]
815
+ });
816
+
817
+ const entries$2 = (doc) => Object.keys(value$1(doc))
818
+ .map((key) => [key, step$1(key, doc)]);
819
+
820
+ const keys$1 = (doc) => Object.keys(value$1(doc));
821
+
822
+ const map$2 = justCurryIt((fn, doc) => value$1(doc)
823
+ .map((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
824
+
825
+ const filter$1 = justCurryIt((fn, doc) => value$1(doc)
826
+ .map((item, ndx, array, thisArg) => step$1(ndx, doc))
827
+ .filter((item, ndx, array, thisArg) => fn(item, ndx, array, thisArg)));
828
+
829
+ const reduce$1 = justCurryIt((fn, acc, doc) => value$1(doc)
830
+ .reduce((acc, item, ndx) => fn(acc, step$1(ndx, doc), ndx), acc));
831
+
832
+ const every$1 = justCurryIt((fn, doc) => value$1(doc)
833
+ .every((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
834
+
835
+ const some$1 = justCurryIt((fn, doc) => value$1(doc)
836
+ .some((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
837
+
838
+ const length$1 = (doc) => value$1(doc).length;
839
+
840
+ var instance = { nil: nil$1, cons, uri: uri$1, value: value$1, has: has$1, typeOf: typeOf$1, step: step$1, entries: entries$2, keys: keys$1, map: map$2, filter: filter$1, reduce: reduce$1, every: every$1, some: some$1, length: length$1 };
841
+ instance.nil;
842
+ instance.cons;
843
+ instance.uri;
844
+ instance.value;
845
+ instance.has;
846
+ instance.typeOf;
847
+ instance.step;
848
+ instance.entries;
849
+ instance.keys;
850
+ instance.map;
851
+ instance.filter;
852
+ instance.reduce;
853
+ instance.every;
854
+ instance.some;
855
+ instance.length;
856
+
857
+ /*!
858
+ * content-type
859
+ * Copyright(c) 2015 Douglas Christopher Wilson
860
+ * MIT Licensed
861
+ */
862
+
863
+ /**
864
+ * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
865
+ *
866
+ * parameter = token "=" ( token / quoted-string )
867
+ * token = 1*tchar
868
+ * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
869
+ * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
870
+ * / DIGIT / ALPHA
871
+ * ; any VCHAR, except delimiters
872
+ * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
873
+ * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
874
+ * obs-text = %x80-FF
875
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
876
+ */
877
+ var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g;
878
+ var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/;
879
+ var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
880
+
881
+ /**
882
+ * RegExp to match quoted-pair in RFC 7230 sec 3.2.6
883
+ *
884
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
885
+ * obs-text = %x80-FF
886
+ */
887
+ var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g;
888
+
889
+ /**
890
+ * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
891
+ */
892
+ var QUOTE_REGEXP = /([\\"])/g;
893
+
894
+ /**
895
+ * RegExp to match type in RFC 7231 sec 3.1.1.1
896
+ *
897
+ * media-type = type "/" subtype
898
+ * type = token
899
+ * subtype = token
900
+ */
901
+ var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
902
+
903
+ /**
904
+ * Module exports.
905
+ * @public
906
+ */
907
+
908
+ var format_1 = format$1;
909
+ var parse_1 = parse;
910
+
911
+ /**
912
+ * Format object to media type.
913
+ *
914
+ * @param {object} obj
915
+ * @return {string}
916
+ * @public
917
+ */
918
+
919
+ function format$1 (obj) {
920
+ if (!obj || typeof obj !== 'object') {
921
+ throw new TypeError('argument obj is required')
922
+ }
923
+
924
+ var parameters = obj.parameters;
925
+ var type = obj.type;
926
+
927
+ if (!type || !TYPE_REGEXP.test(type)) {
928
+ throw new TypeError('invalid type')
929
+ }
930
+
931
+ var string = type;
932
+
933
+ // append parameters
934
+ if (parameters && typeof parameters === 'object') {
935
+ var param;
936
+ var params = Object.keys(parameters).sort();
937
+
938
+ for (var i = 0; i < params.length; i++) {
939
+ param = params[i];
940
+
941
+ if (!TOKEN_REGEXP.test(param)) {
942
+ throw new TypeError('invalid parameter name')
943
+ }
944
+
945
+ string += '; ' + param + '=' + qstring(parameters[param]);
946
+ }
947
+ }
948
+
949
+ return string
950
+ }
951
+
952
+ /**
953
+ * Parse media type to object.
954
+ *
955
+ * @param {string|object} string
956
+ * @return {Object}
957
+ * @public
958
+ */
959
+
960
+ function parse (string) {
961
+ if (!string) {
962
+ throw new TypeError('argument string is required')
963
+ }
964
+
965
+ // support req/res-like objects as argument
966
+ var header = typeof string === 'object'
967
+ ? getcontenttype(string)
968
+ : string;
969
+
970
+ if (typeof header !== 'string') {
971
+ throw new TypeError('argument string is required to be a string')
972
+ }
973
+
974
+ var index = header.indexOf(';');
975
+ var type = index !== -1
976
+ ? header.substr(0, index).trim()
977
+ : header.trim();
978
+
979
+ if (!TYPE_REGEXP.test(type)) {
980
+ throw new TypeError('invalid media type')
981
+ }
982
+
983
+ var obj = new ContentType(type.toLowerCase());
984
+
985
+ // parse parameters
986
+ if (index !== -1) {
987
+ var key;
988
+ var match;
989
+ var value;
990
+
991
+ PARAM_REGEXP.lastIndex = index;
992
+
993
+ while ((match = PARAM_REGEXP.exec(header))) {
994
+ if (match.index !== index) {
995
+ throw new TypeError('invalid parameter format')
996
+ }
997
+
998
+ index += match[0].length;
999
+ key = match[1].toLowerCase();
1000
+ value = match[2];
1001
+
1002
+ if (value[0] === '"') {
1003
+ // remove quotes and escapes
1004
+ value = value
1005
+ .substr(1, value.length - 2)
1006
+ .replace(QESC_REGEXP, '$1');
1007
+ }
1008
+
1009
+ obj.parameters[key] = value;
1010
+ }
1011
+
1012
+ if (index !== header.length) {
1013
+ throw new TypeError('invalid parameter format')
1014
+ }
1015
+ }
1016
+
1017
+ return obj
1018
+ }
1019
+
1020
+ /**
1021
+ * Get content-type from req/res objects.
1022
+ *
1023
+ * @param {object}
1024
+ * @return {Object}
1025
+ * @private
1026
+ */
1027
+
1028
+ function getcontenttype (obj) {
1029
+ var header;
1030
+
1031
+ if (typeof obj.getHeader === 'function') {
1032
+ // res-like
1033
+ header = obj.getHeader('content-type');
1034
+ } else if (typeof obj.headers === 'object') {
1035
+ // req-like
1036
+ header = obj.headers && obj.headers['content-type'];
1037
+ }
1038
+
1039
+ if (typeof header !== 'string') {
1040
+ throw new TypeError('content-type header is missing from object')
1041
+ }
1042
+
1043
+ return header
1044
+ }
1045
+
1046
+ /**
1047
+ * Quote a string if necessary.
1048
+ *
1049
+ * @param {string} val
1050
+ * @return {string}
1051
+ * @private
1052
+ */
1053
+
1054
+ function qstring (val) {
1055
+ var str = String(val);
1056
+
1057
+ // no need to quote tokens
1058
+ if (TOKEN_REGEXP.test(str)) {
1059
+ return str
1060
+ }
1061
+
1062
+ if (str.length > 0 && !TEXT_REGEXP.test(str)) {
1063
+ throw new TypeError('invalid parameter value')
1064
+ }
1065
+
1066
+ return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'
1067
+ }
1068
+
1069
+ /**
1070
+ * Class to represent a content type.
1071
+ * @private
1072
+ */
1073
+ function ContentType (type) {
1074
+ this.parameters = Object.create(null);
1075
+ this.type = type;
1076
+ }
1077
+
1078
+ var contentType = {
1079
+ format: format_1,
1080
+ parse: parse_1
1081
+ };
1082
+
1083
+ var entries$1 = async (doc) => Object.entries(await doc);
1084
+
1085
+ var map$1 = justCurryIt(async (fn, doc) => (await doc).map(fn));
1086
+
1087
+ var reduce = justCurryIt(async (fn, acc, doc) => {
1088
+ return (await doc).reduce(async (acc, item) => fn(await acc, item), acc);
1089
+ });
1090
+
1091
+ var filter = justCurryIt(async (fn, doc, options = {}) => {
1092
+ return reduce(async (acc, item) => {
1093
+ return (await fn(item)) ? acc.concat([item]) : acc;
1094
+ }, [], doc, options);
1095
+ });
1096
+
1097
+ var some = justCurryIt(async (fn, doc) => {
1098
+ const results = await map$1(fn, doc);
1099
+ return (await Promise.all(results))
1100
+ .some((a) => a);
1101
+ });
1102
+
1103
+ var every = justCurryIt(async (fn, doc) => {
1104
+ const results = await map$1(fn, doc);
1105
+ return (await Promise.all(results))
1106
+ .every((a) => a);
1107
+ });
1108
+
1109
+ var pipeline = justCurryIt((fns, doc) => {
1110
+ return fns.reduce(async (acc, fn) => fn(await acc), doc);
1111
+ });
1112
+
1113
+ var all = (doc) => Promise.all(doc);
1114
+
1115
+ var allValues = (doc) => {
1116
+ return pipeline([
1117
+ entries$1,
1118
+ reduce(async (acc, [propertyName, propertyValue]) => {
1119
+ acc[propertyName] = await propertyValue;
1120
+ return acc;
1121
+ }, {})
1122
+ ], doc);
1123
+ };
1124
+
1125
+ var lib$2 = {
1126
+ entries: entries$1,
1127
+ map: map$1,
1128
+ filter: filter,
1129
+ reduce: reduce,
1130
+ some: some,
1131
+ every: every,
1132
+ pipeline: pipeline,
1133
+ all: all,
1134
+ allValues: allValues
1135
+ };
1136
+ lib$2.entries;
1137
+ lib$2.map;
1138
+ lib$2.filter;
1139
+ lib$2.reduce;
1140
+ lib$2.some;
1141
+ lib$2.every;
1142
+ lib$2.pipeline;
1143
+ lib$2.all;
1144
+ lib$2.allValues;
1145
+
1146
+ var fetch_browser = fetch;
1147
+
1148
+ const { jsonTypeOf, splitUrl: splitUrl$3, safeResolveUrl } = common$1;
1149
+
1150
+
1151
+
1152
+
1153
+ // Config
1154
+ const config = {};
1155
+ const configAlias = {};
1156
+
1157
+ const setConfig = (schemaVersion, key, value) => {
1158
+ if (!config[schemaVersion]) {
1159
+ config[schemaVersion] = {};
1160
+ }
1161
+ config[schemaVersion][key] = value;
1162
+ };
1163
+
1164
+ const getConfig = (schemaVersion, key) => {
1165
+ const configVersion = schemaVersion in configAlias ? configAlias[schemaVersion] : schemaVersion;
1166
+ if (configVersion in config) {
1167
+ return config[configVersion][key];
1168
+ }
1169
+ };
1170
+
1171
+ // Schema Management
1172
+ const schemaStore = {};
1173
+ const schemaStoreAlias = {};
1174
+
1175
+ const add$1 = (schema, url = "", defaultSchemaVersion = "") => {
1176
+ schema = JSON.parse(JSON.stringify(schema));
1177
+
1178
+ // Schema Version
1179
+ const schemaVersion = splitUrl$3(schema["$schema"] || defaultSchemaVersion)[0];
1180
+ if (!schemaVersion) {
1181
+ throw Error("Couldn't determine schema version");
1182
+ }
1183
+ delete schema["$schema"];
1184
+
1185
+ // Identifier
1186
+ const baseToken = getConfig(schemaVersion, "baseToken");
1187
+ const anchorToken = getConfig(schemaVersion, "anchorToken");
1188
+ const externalId = splitUrl$3(url)[0];
1189
+ if (!externalId && !splitUrl$3(schema[baseToken] || "")[0]) {
1190
+ throw Error("Couldn't determine an identifier for the schema");
1191
+ }
1192
+ const internalUrl = safeResolveUrl(externalId, schema[baseToken] || "");
1193
+ const [id, fragment] = splitUrl$3(internalUrl);
1194
+ delete schema[baseToken];
1195
+ if (fragment && baseToken === anchorToken) {
1196
+ schema[anchorToken] = anchorToken !== baseToken ? encodeURI(fragment) : `#${encodeURI(fragment)}`;
1197
+ }
1198
+ if (externalId) {
1199
+ schemaStoreAlias[externalId] = id;
1200
+ }
1201
+
1202
+ // recursiveAnchor
1203
+ const dynamicAnchors = {};
1204
+ const recursiveAnchorToken = getConfig(schemaVersion, "recursiveAnchorToken");
1205
+ if (schema[recursiveAnchorToken] === true) {
1206
+ dynamicAnchors[""] = `${id}#`;
1207
+ schema[anchorToken] = "";
1208
+ delete schema[recursiveAnchorToken];
1209
+ }
1210
+
1211
+ // Vocabulary
1212
+ let vocabulary;
1213
+ const vocabularyToken = getConfig(schemaVersion, "vocabularyToken");
1214
+ if (jsonTypeOf(schema[vocabularyToken], "object")) {
1215
+ configAlias[id] = schemaVersion;
1216
+ vocabulary = schema[vocabularyToken];
1217
+ delete schema[vocabularyToken];
1218
+ } else {
1219
+ configAlias[id] = schemaVersion;
1220
+ vocabulary = { [schemaVersion]: true };
1221
+ }
1222
+
1223
+ // Store Schema
1224
+ const anchors = { "": "" };
1225
+ schemaStore[id] = {
1226
+ id: id,
1227
+ schemaVersion: schemaVersion,
1228
+ schema: processSchema(schema, id, schemaVersion, lib$3.nil, anchors, dynamicAnchors),
1229
+ anchors: anchors,
1230
+ dynamicAnchors: dynamicAnchors,
1231
+ vocabulary: vocabulary,
1232
+ validated: false
1233
+ };
1234
+
1235
+ return schemaStore[id];
1236
+ };
1237
+
1238
+ const processSchema = (subject, id, schemaVersion, pointer, anchors, dynamicAnchors) => {
1239
+ if (jsonTypeOf(subject, "object")) {
1240
+ const embeddedSchemaVersion = typeof subject["$schema"] === "string" ? splitUrl$3(subject["$schema"])[0] : schemaVersion;
1241
+ const embeddedEmbeddedToken = getConfig(embeddedSchemaVersion, "embeddedToken");
1242
+ const embeddedAnchorToken = getConfig(embeddedSchemaVersion, "anchorToken");
1243
+ if (typeof subject[embeddedEmbeddedToken] === "string" && (embeddedEmbeddedToken !== embeddedAnchorToken || subject[embeddedEmbeddedToken][0] !== "#")) {
1244
+ const ref = safeResolveUrl(id, subject[embeddedEmbeddedToken]);
1245
+ subject[embeddedEmbeddedToken] = ref;
1246
+ add$1(subject, ref, schemaVersion);
1247
+ return reference.cons(subject[embeddedEmbeddedToken], subject);
1248
+ }
1249
+
1250
+ const anchorToken = getConfig(schemaVersion, "anchorToken");
1251
+ const dynamicAnchorToken = getConfig(schemaVersion, "dynamicAnchorToken");
1252
+ if (typeof subject[dynamicAnchorToken] === "string") {
1253
+ dynamicAnchors[subject[dynamicAnchorToken]] = `${id}#${encodeURI(pointer)}`;
1254
+ anchors[subject[dynamicAnchorToken]] = pointer;
1255
+ delete subject[dynamicAnchorToken];
1256
+ }
1257
+
1258
+ const embeddedToken = getConfig(schemaVersion, "embeddedToken");
1259
+ if (typeof subject[anchorToken] === "string") {
1260
+ const anchor = anchorToken !== embeddedToken ? subject[anchorToken] : subject[anchorToken].slice(1);
1261
+ anchors[anchor] = pointer;
1262
+ delete subject[anchorToken];
1263
+ }
1264
+
1265
+ const jrefToken = getConfig(schemaVersion, "jrefToken");
1266
+ if (typeof subject[jrefToken] === "string") {
1267
+ return reference.cons(subject[jrefToken], subject);
1268
+ }
1269
+
1270
+ for (const key in subject) {
1271
+ subject[key] = processSchema(subject[key], id, schemaVersion, lib$3.append(key, pointer), anchors, dynamicAnchors);
1272
+ }
1273
+
1274
+ return subject;
1275
+ } else if (Array.isArray(subject)) {
1276
+ return subject.map((item, ndx) => processSchema(item, id, schemaVersion, lib$3.append(ndx, pointer), anchors, dynamicAnchors));
1277
+ } else {
1278
+ return subject;
1279
+ }
1280
+ };
1281
+
1282
+ const hasStoredSchema = (id) => id in schemaStore || id in schemaStoreAlias;
1283
+ const getStoredSchema = (id) => schemaStore[schemaStoreAlias[id]] || schemaStore[id];
1284
+
1285
+ const markValidated = (id) => {
1286
+ schemaStore[id].validated = true;
1287
+ };
1288
+
1289
+ // Schema Retrieval
1290
+ const nil = Object.freeze({
1291
+ id: "",
1292
+ schemaVersion: undefined,
1293
+ vocabulary: {},
1294
+ pointer: lib$3.nil,
1295
+ schema: undefined,
1296
+ value: undefined,
1297
+ anchors: {},
1298
+ dynamicAnchors: {},
1299
+ validated: true
1300
+ });
1301
+
1302
+ const get = async (url, contextDoc = nil) => {
1303
+ const resolvedUrl = safeResolveUrl(uri(contextDoc), url);
1304
+ const [id, fragment] = splitUrl$3(resolvedUrl);
1305
+
1306
+ if (!hasStoredSchema(id)) {
1307
+ const response = await fetch_browser(id, { headers: { Accept: "application/schema+json" } });
1308
+ if (response.status >= 400) {
1309
+ await response.text(); // Sometimes node hangs without this hack
1310
+ throw Error(`Failed to retrieve schema with id: ${id}`);
1311
+ }
1312
+
1313
+ if (response.headers.has("content-type")) {
1314
+ const contentType$1 = contentType.parse(response.headers.get("content-type")).type;
1315
+ if (contentType$1 !== "application/schema+json") {
1316
+ throw Error(`${id} is not a schema. Found a document with media type: ${contentType$1}`);
1317
+ }
1318
+ }
1319
+
1320
+ add$1(await response.json(), id);
1321
+ }
1322
+
1323
+ const storedSchema = getStoredSchema(id);
1324
+ const pointer = fragment[0] !== "/" ? getAnchorPointer(storedSchema, fragment) : fragment;
1325
+ const doc = Object.freeze({
1326
+ ...storedSchema,
1327
+ pointer: pointer,
1328
+ value: lib$3.get(pointer, storedSchema.schema)
1329
+ });
1330
+
1331
+ return followReferences$1(doc);
1332
+ };
1333
+
1334
+ const followReferences$1 = (doc) => reference.isReference(doc.value) ? get(reference.href(doc.value), doc) : doc;
1335
+
1336
+ const getAnchorPointer = (schema, fragment) => {
1337
+ if (!(fragment in schema.anchors)) {
1338
+ throw Error(`No such anchor '${encodeURI(schema.id)}#${encodeURI(fragment)}'`);
1339
+ }
1340
+
1341
+ return schema.anchors[fragment];
1342
+ };
1343
+
1344
+ // Utility Functions
1345
+ const uri = (doc) => `${doc.id}#${encodeURI(doc.pointer)}`;
1346
+ const value = (doc) => reference.isReference(doc.value) ? reference.value(doc.value) : doc.value;
1347
+ const has = (key, doc) => key in value(doc);
1348
+ const typeOf = (doc, type) => jsonTypeOf(value(doc), type);
1349
+
1350
+ const step = (key, doc) => {
1351
+ const storedSchema = getStoredSchema(doc.id);
1352
+ const nextDoc = Object.freeze({
1353
+ ...doc,
1354
+ pointer: lib$3.append(key, doc.pointer),
1355
+ value: value(doc)[key],
1356
+ validated: storedSchema.validated
1357
+ });
1358
+ return followReferences$1(nextDoc);
1359
+ };
1360
+
1361
+ const keys = (doc) => Object.keys(value(doc));
1362
+
1363
+ const entries = (doc) => lib$2.pipeline([
1364
+ value,
1365
+ Object.keys,
1366
+ lib$2.map(async (key) => [key, await step(key, doc)]),
1367
+ lib$2.all
1368
+ ], doc);
1369
+
1370
+ const map = justCurryIt((fn, doc) => lib$2.pipeline([
1371
+ value,
1372
+ lib$2.map(async (item, ndx) => fn(await step(ndx, doc), ndx)),
1373
+ lib$2.all
1374
+ ], doc));
1375
+
1376
+ const length = (doc) => value(doc).length;
1377
+
1378
+ var schema$5 = {
1379
+ setConfig, getConfig,
1380
+ add: add$1, get, markValidated,
1381
+ uri, value, getAnchorPointer, typeOf, has, step, keys, entries, map, length
1382
+ };
1383
+ schema$5.setConfig;
1384
+ schema$5.getConfig;
1385
+ schema$5.add;
1386
+ schema$5.get;
1387
+ schema$5.markValidated;
1388
+ schema$5.uri;
1389
+ schema$5.value;
1390
+ schema$5.getAnchorPointer;
1391
+ schema$5.typeOf;
1392
+ schema$5.has;
1393
+ schema$5.step;
1394
+ schema$5.keys;
1395
+ schema$5.entries;
1396
+ schema$5.map;
1397
+ schema$5.length;
1398
+
1399
+ class InvalidSchemaError$1 extends Error {
1400
+ constructor(output) {
1401
+ super("Invalid Schema");
1402
+ this.name = this.constructor.name;
1403
+ this.output = output;
1404
+ }
1405
+ }
1406
+
1407
+ var invalidSchemaError = InvalidSchemaError$1;
1408
+
1409
+ const { splitUrl: splitUrl$2 } = common$1;
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+ const FLAG = "FLAG", BASIC = "BASIC", DETAILED = "DETAILED", VERBOSE = "VERBOSE";
1416
+
1417
+ let metaOutputFormat = DETAILED;
1418
+ let shouldMetaValidate = true;
1419
+
1420
+ const validate$1 = async (schema, value = undefined, outputFormat = undefined) => {
1421
+ const compiled = await compile$O(schema);
1422
+ const interpretAst = (value, outputFormat) => interpret$O(compiled, instance.cons(value), outputFormat);
1423
+
1424
+ return value === undefined ? interpretAst : interpretAst(value, outputFormat);
1425
+ };
1426
+
1427
+ const compile$O = async (schema) => {
1428
+ const ast = { metaData: {} };
1429
+ const schemaUri = await compileSchema(schema, ast);
1430
+ return { ast, schemaUri };
1431
+ };
1432
+
1433
+ const interpret$O = justCurryIt(({ ast, schemaUri }, value, outputFormat = FLAG) => {
1434
+ if (![FLAG, BASIC, DETAILED, VERBOSE].includes(outputFormat)) {
1435
+ throw Error(`The '${outputFormat}' error format is not supported`);
1436
+ }
1437
+
1438
+ const output = [];
1439
+ const subscriptionToken = pubsub.subscribe("result", outputHandler(outputFormat, output));
1440
+ interpretSchema(schemaUri, value, ast, {});
1441
+ pubsub.unsubscribe(subscriptionToken);
1442
+
1443
+ return output[0];
1444
+ });
1445
+
1446
+ const outputHandler = (outputFormat, output) => {
1447
+ const resultStack = [];
1448
+
1449
+ return (message, keywordResult) => {
1450
+ if (message === "result") {
1451
+ const { keyword, absoluteKeywordLocation, instanceLocation, valid } = keywordResult;
1452
+ const result = { keyword, absoluteKeywordLocation, instanceLocation, valid, errors: [] };
1453
+ resultStack.push(result);
1454
+ } else if (message === "result.start") {
1455
+ resultStack.push(message);
1456
+ } else if (message === "result.end") {
1457
+ const result = resultStack.pop();
1458
+ while (resultStack[resultStack.length - 1] !== "result.start") {
1459
+ const topResult = resultStack.pop();
1460
+
1461
+ const errors = [topResult];
1462
+ if (outputFormat === BASIC) {
1463
+ errors.push(...topResult.errors);
1464
+ delete topResult.errors;
1465
+ }
1466
+
1467
+ if (outputFormat === VERBOSE || (outputFormat !== FLAG && !topResult.valid)) {
1468
+ result.errors.unshift(...errors);
1469
+ }
1470
+ }
1471
+ resultStack[resultStack.length - 1] = result;
1472
+
1473
+ output[0] = result;
1474
+ }
1475
+ };
1476
+ };
1477
+
1478
+ const setMetaOutputFormat = (format) => {
1479
+ metaOutputFormat = format;
1480
+ };
1481
+
1482
+ const setShouldMetaValidate = (isEnabled) => {
1483
+ shouldMetaValidate = isEnabled;
1484
+ };
1485
+
1486
+ const _keywords = {};
1487
+ const getKeyword = (id) => _keywords[id];
1488
+ const hasKeyword = (id) => id in _keywords;
1489
+ const addKeyword = (id, keywordHandler) => {
1490
+ _keywords[id] = {
1491
+ collectEvaluatedItems: (keywordValue, instance, ast, dynamicAnchors, isTop) => keywordHandler.interpret(keywordValue, instance, ast, dynamicAnchors, isTop) && new Set(),
1492
+ collectEvaluatedProperties: (keywordValue, instance, ast, dynamicAnchors, isTop) => keywordHandler.interpret(keywordValue, instance, ast, dynamicAnchors, isTop) && [],
1493
+ ...keywordHandler
1494
+ };
1495
+ };
1496
+
1497
+ const _vocabularies = {};
1498
+ const defineVocabulary = (id, keywords) => {
1499
+ _vocabularies[id] = keywords;
1500
+ };
1501
+
1502
+ const metaValidators = {};
1503
+ const compileSchema = async (schema, ast) => {
1504
+ schema = await followReferences(schema);
1505
+
1506
+ // Vocabularies
1507
+ if (!hasKeyword(`${schema.schemaVersion}#validate`)) {
1508
+ const metaSchema = await schema$5.get(schema.schemaVersion);
1509
+
1510
+ // Check for mandatory vocabularies
1511
+ const mandatoryVocabularies = schema$5.getConfig(metaSchema.id, "mandatoryVocabularies") || [];
1512
+ mandatoryVocabularies.forEach((vocabularyId) => {
1513
+ if (!metaSchema.vocabulary[vocabularyId]) {
1514
+ throw Error(`Vocabulary '${vocabularyId}' must be explicitly declared and required`);
1515
+ }
1516
+ });
1517
+
1518
+ // Load vocabularies
1519
+ Object.entries(metaSchema.vocabulary)
1520
+ .forEach(([vocabularyId, isRequired]) => {
1521
+ if (vocabularyId in _vocabularies) {
1522
+ Object.entries(_vocabularies[vocabularyId])
1523
+ .forEach(([keyword, keywordHandler]) => {
1524
+ addKeyword(`${metaSchema.id}#${keyword}`, keywordHandler);
1525
+ });
1526
+ } else if (isRequired) {
1527
+ throw Error(`Missing required vocabulary: ${vocabularyId}`);
1528
+ }
1529
+ });
1530
+ }
1531
+
1532
+ // Meta validation
1533
+ if (shouldMetaValidate && !schema.validated) {
1534
+ schema$5.markValidated(schema.id);
1535
+
1536
+ // Compile
1537
+ if (!(schema.schemaVersion in metaValidators)) {
1538
+ const metaSchema = await schema$5.get(schema.schemaVersion);
1539
+ const compiledSchema = await compile$O(metaSchema);
1540
+ metaValidators[metaSchema.id] = interpret$O(compiledSchema);
1541
+ }
1542
+
1543
+ // Interpret
1544
+ const schemaInstance = instance.cons(schema.schema, schema.id);
1545
+ const metaResults = metaValidators[schema.schemaVersion](schemaInstance, metaOutputFormat);
1546
+ if (!metaResults.valid) {
1547
+ throw new invalidSchemaError(metaResults);
1548
+ }
1549
+ }
1550
+
1551
+ // Compile
1552
+ if (!(schema.id in ast.metaData)) {
1553
+ ast.metaData[schema.id] = {
1554
+ id: schema.id,
1555
+ dynamicAnchors: schema.dynamicAnchors,
1556
+ anchors: schema.anchors
1557
+ };
1558
+ }
1559
+ return getKeyword(`${schema.schemaVersion}#validate`).compile(schema, ast);
1560
+ };
1561
+
1562
+ const followReferences = async (doc) => {
1563
+ return schema$5.typeOf(doc, "string") ? followReferences(await schema$5.get(schema$5.value(doc), doc)) : doc;
1564
+ };
1565
+
1566
+ const interpretSchema = (schemaUri, instance, ast, dynamicAnchors) => {
1567
+ const keywordId = getKeywordId(schemaUri, ast);
1568
+ const id = splitUrl$2(schemaUri)[0];
1569
+ return getKeyword(keywordId).interpret(schemaUri, instance, ast, { ...ast.metaData[id].dynamicAnchors, ...dynamicAnchors });
1570
+ };
1571
+
1572
+ const collectEvaluatedProperties$e = (schemaUri, instance, ast, dynamicAnchors, isTop) => {
1573
+ const keywordId = getKeywordId(schemaUri, ast);
1574
+ return getKeyword(keywordId).collectEvaluatedProperties(schemaUri, instance, ast, dynamicAnchors, isTop);
1575
+ };
1576
+
1577
+ const collectEvaluatedItems$f = (schemaUri, instance, ast, dynamicAnchors, isTop) => {
1578
+ const keywordId = getKeywordId(schemaUri, ast);
1579
+ return getKeyword(keywordId).collectEvaluatedItems(schemaUri, instance, ast, dynamicAnchors, isTop);
1580
+ };
1581
+
1582
+ const getKeywordId = (schemaUri, ast) => {
1583
+ if (!(schemaUri in ast)) {
1584
+ throw Error(`No schema found at ${schemaUri}`);
1585
+ }
1586
+
1587
+ return ast[schemaUri][0];
1588
+ };
1589
+
1590
+ const add = (schema, url = "", defaultSchemaVersion = "") => {
1591
+ const doc = schema$5.add(schema, url, defaultSchemaVersion);
1592
+ delete metaValidators[doc.id];
1593
+
1594
+ return doc;
1595
+ };
1596
+
1597
+ var core$2 = {
1598
+ validate: validate$1, compile: compile$O, interpret: interpret$O,
1599
+ setMetaOutputFormat, setShouldMetaValidate, FLAG, BASIC, DETAILED, VERBOSE,
1600
+ add, getKeyword, hasKeyword, defineVocabulary,
1601
+ compileSchema, interpretSchema, collectEvaluatedProperties: collectEvaluatedProperties$e, collectEvaluatedItems: collectEvaluatedItems$f
1602
+ };
1603
+ core$2.validate;
1604
+ core$2.compile;
1605
+ core$2.interpret;
1606
+ core$2.setMetaOutputFormat;
1607
+ core$2.setShouldMetaValidate;
1608
+ core$2.FLAG;
1609
+ core$2.BASIC;
1610
+ core$2.DETAILED;
1611
+ core$2.VERBOSE;
1612
+ core$2.add;
1613
+ core$2.getKeyword;
1614
+ core$2.hasKeyword;
1615
+ core$2.defineVocabulary;
1616
+ core$2.compileSchema;
1617
+ core$2.interpretSchema;
1618
+ core$2.collectEvaluatedProperties;
1619
+ core$2.collectEvaluatedItems;
1620
+
1621
+ const compile$N = (schema) => schema$5.value(schema);
1622
+ const interpret$N = () => true;
1623
+
1624
+ var metaData$2 = { compile: compile$N, interpret: interpret$N };
1625
+ metaData$2.compile;
1626
+ metaData$2.interpret;
1627
+
1628
+ const compile$M = async (schema, ast) => {
1629
+ const url = schema$5.uri(schema);
1630
+ if (!(url in ast)) {
1631
+ ast[url] = false; // Place dummy entry in ast to avoid recursive loops
1632
+
1633
+ const schemaValue = schema$5.value(schema);
1634
+ if (!["object", "boolean"].includes(typeof schemaValue)) {
1635
+ throw Error(`No schema found at '${schema$5.uri(schema)}'`);
1636
+ }
1637
+
1638
+ ast[url] = [
1639
+ `${schema.schemaVersion}#validate`,
1640
+ schema$5.uri(schema),
1641
+ typeof schemaValue === "boolean" ? schemaValue : await lib$2.pipeline([
1642
+ schema$5.entries,
1643
+ lib$2.map(([keyword, keywordSchema]) => [`${schema.schemaVersion}#${keyword}`, keywordSchema]),
1644
+ lib$2.filter(([keywordId]) => core$2.hasKeyword(keywordId) && keywordId !== `${schema.schemaVersion}#validate`),
1645
+ lib$2.map(async ([keywordId, keywordSchema]) => {
1646
+ const keywordAst = await core$2.getKeyword(keywordId).compile(keywordSchema, ast, schema);
1647
+ return [keywordId, schema$5.uri(keywordSchema), keywordAst];
1648
+ }),
1649
+ lib$2.all
1650
+ ], schema)
1651
+ ];
1652
+ }
1653
+
1654
+ return url;
1655
+ };
1656
+
1657
+ const interpret$M = (uri, instance$1, ast, dynamicAnchors) => {
1658
+ const [keywordId, schemaUrl, nodes] = ast[uri];
1659
+
1660
+ pubsub.publishSync("result.start");
1661
+ const isValid = typeof nodes === "boolean" ? nodes : nodes
1662
+ .every(([keywordId, schemaUrl, keywordValue]) => {
1663
+ pubsub.publishSync("result.start");
1664
+ const isValid = core$2.getKeyword(keywordId).interpret(keywordValue, instance$1, ast, dynamicAnchors);
1665
+
1666
+ pubsub.publishSync("result", {
1667
+ keyword: keywordId,
1668
+ absoluteKeywordLocation: schemaUrl,
1669
+ instanceLocation: instance.uri(instance$1),
1670
+ valid: isValid,
1671
+ ast: keywordValue
1672
+ });
1673
+ pubsub.publishSync("result.end");
1674
+ return isValid;
1675
+ });
1676
+
1677
+ pubsub.publishSync("result", {
1678
+ keyword: keywordId,
1679
+ absoluteKeywordLocation: schemaUrl,
1680
+ instanceLocation: instance.uri(instance$1),
1681
+ valid: isValid,
1682
+ ast: uri
1683
+ });
1684
+ pubsub.publishSync("result.end");
1685
+ return isValid;
1686
+ };
1687
+
1688
+ const collectEvaluatedProperties$d = (uri, instance, ast, dynamicAnchors, isTop = false) => {
1689
+ const nodes = ast[uri][2];
1690
+
1691
+ if (typeof nodes === "boolean") {
1692
+ return nodes ? [] : false;
1693
+ }
1694
+
1695
+ return nodes
1696
+ .filter(([keywordId]) => !isTop || !keywordId.endsWith("#unevaluatedProperties"))
1697
+ .reduce((acc, [keywordId, , keywordValue]) => {
1698
+ const propertyNames = acc && core$2.getKeyword(keywordId).collectEvaluatedProperties(keywordValue, instance, ast, dynamicAnchors);
1699
+ return propertyNames !== false && [...acc, ...propertyNames];
1700
+ }, []);
1701
+ };
1702
+
1703
+ const collectEvaluatedItems$e = (uri, instance, ast, dynamicAnchors, isTop = false) => {
1704
+ const nodes = ast[uri][2];
1705
+
1706
+ if (typeof nodes === "boolean") {
1707
+ return nodes ? new Set() : false;
1708
+ }
1709
+
1710
+ return nodes
1711
+ .filter(([keywordId]) => !isTop || !keywordId.endsWith("#unevaluatedItems"))
1712
+ .reduce((acc, [keywordId, , keywordValue]) => {
1713
+ const itemIndexes = acc !== false && core$2.getKeyword(keywordId).collectEvaluatedItems(keywordValue, instance, ast, dynamicAnchors);
1714
+ return itemIndexes !== false && new Set([...acc, ...itemIndexes]);
1715
+ }, new Set());
1716
+ };
1717
+
1718
+ var validate = { compile: compile$M, interpret: interpret$M, collectEvaluatedProperties: collectEvaluatedProperties$d, collectEvaluatedItems: collectEvaluatedItems$e };
1719
+ validate.compile;
1720
+ validate.interpret;
1721
+ validate.collectEvaluatedProperties;
1722
+ validate.collectEvaluatedItems;
1723
+
1724
+ var keywords$1 = { metaData: metaData$2, validate };
1725
+ keywords$1.metaData;
1726
+ keywords$1.validate;
1727
+
1728
+ var lib$1 = { Core: core$2, Schema: schema$5, Instance: instance, Keywords: keywords$1 };
1729
+
1730
+ const { Core: Core$v, Schema: Schema$N, Instance: Instance$B } = lib$1;
1731
+
1732
+
1733
+ const compile$L = async (schema, ast, parentSchema) => {
1734
+ const items = await Schema$N.step("items", parentSchema);
1735
+ const numberOfItems = Schema$N.typeOf(items, "array") ? Schema$N.length(items) : Number.MAX_SAFE_INTEGER;
1736
+
1737
+ if (Schema$N.typeOf(schema, "boolean")) {
1738
+ return [numberOfItems, Schema$N.value(schema)];
1739
+ } else {
1740
+ return [numberOfItems, await Core$v.compileSchema(schema, ast)];
1741
+ }
1742
+ };
1743
+
1744
+ const interpret$L = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
1745
+ if (!Instance$B.typeOf(instance, "array")) {
1746
+ return true;
1747
+ }
1748
+
1749
+ if (typeof additionalItems === "string") {
1750
+ return Instance$B.every((item, ndx) => ndx < numberOfItems || Core$v.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
1751
+ } else {
1752
+ return Instance$B.every((item, ndx) => ndx < numberOfItems ? true : additionalItems, instance);
1753
+ }
1754
+ };
1755
+
1756
+ var additionalItems = { compile: compile$L, interpret: interpret$L };
1757
+ additionalItems.compile;
1758
+ additionalItems.interpret;
1759
+
1760
+ const { Core: Core$u, Schema: Schema$M, Instance: Instance$A } = lib$1;
1761
+
1762
+
1763
+ const compile$K = async (schema, ast, parentSchema) => {
1764
+ const items = await Schema$M.step("items", parentSchema);
1765
+ const numberOfItems = Schema$M.typeOf(items, "array") ? Schema$M.length(items) : Number.MAX_SAFE_INTEGER;
1766
+
1767
+ return [numberOfItems, await Core$u.compileSchema(schema, ast)];
1768
+ };
1769
+
1770
+ const interpret$K = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
1771
+ if (!Instance$A.typeOf(instance, "array")) {
1772
+ return true;
1773
+ }
1774
+
1775
+ return Instance$A.every((item, ndx) => ndx < numberOfItems || Core$u.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
1776
+ };
1777
+
1778
+ const collectEvaluatedItems$d = (keywordValue, instance, ast, dynamicAnchors) => {
1779
+ return interpret$K(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$A.map((item, ndx) => ndx, instance));
1780
+ };
1781
+
1782
+ var additionalItems6 = { compile: compile$K, interpret: interpret$K, collectEvaluatedItems: collectEvaluatedItems$d };
1783
+ additionalItems6.compile;
1784
+ additionalItems6.interpret;
1785
+ additionalItems6.collectEvaluatedItems;
1786
+
1787
+ const { Core: Core$t, Schema: Schema$L, Instance: Instance$z } = lib$1;
1788
+
1789
+
1790
+ const compile$J = async (schema, ast, parentSchema) => {
1791
+ const properties = await Schema$L.step("properties", parentSchema);
1792
+ const propertyNames = Schema$L.typeOf(properties, "object") ? Schema$L.keys(properties) : [];
1793
+
1794
+ const patternProperties = await Schema$L.step("patternProperties", parentSchema);
1795
+ const propertyNamePatterns = Schema$L.typeOf(patternProperties, "object") ? Schema$L.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
1796
+
1797
+ if (Schema$L.typeOf(schema, "boolean")) {
1798
+ return [propertyNames, propertyNamePatterns, Schema$L.value(schema)];
1799
+ } else {
1800
+ return [propertyNames, propertyNamePatterns, await Core$t.compileSchema(schema, ast)];
1801
+ }
1802
+ };
1803
+
1804
+ const interpret$J = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
1805
+ if (!Instance$z.typeOf(instance, "object")) {
1806
+ return true;
1807
+ }
1808
+
1809
+ const properties = Instance$z.entries(instance)
1810
+ .filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)));
1811
+
1812
+ if (typeof additionalProperties === "string") {
1813
+ return properties.every(([, property]) => Core$t.interpretSchema(additionalProperties, property, ast, dynamicAnchors));
1814
+ } else {
1815
+ return properties.length === 0 || additionalProperties;
1816
+ }
1817
+ };
1818
+
1819
+ var additionalProperties = { compile: compile$J, interpret: interpret$J };
1820
+ additionalProperties.compile;
1821
+ additionalProperties.interpret;
1822
+
1823
+ const { Core: Core$s, Schema: Schema$K, Instance: Instance$y } = lib$1;
1824
+
1825
+
1826
+ const compile$I = async (schema, ast, parentSchema) => {
1827
+ const propertiesSchema = await Schema$K.step("properties", parentSchema);
1828
+ const propertyNames = Schema$K.typeOf(propertiesSchema, "object") ? Schema$K.keys(propertiesSchema) : [];
1829
+
1830
+ const patternProperties = await Schema$K.step("patternProperties", parentSchema);
1831
+ const propertyNamePatterns = Schema$K.typeOf(patternProperties, "object") ? Schema$K.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
1832
+
1833
+ return [propertyNames, propertyNamePatterns, await Core$s.compileSchema(schema, ast)];
1834
+ };
1835
+
1836
+ const interpret$I = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
1837
+ if (!Instance$y.typeOf(instance, "object")) {
1838
+ return true;
1839
+ }
1840
+
1841
+ return Instance$y.entries(instance)
1842
+ .filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)))
1843
+ .every(([, property]) => Core$s.interpretSchema(additionalProperties, property, ast, dynamicAnchors));
1844
+ };
1845
+
1846
+ const collectEvaluatedProperties$c = (keywordValue, instance, ast, dynamicAnchors) => {
1847
+ return interpret$I(keywordValue, instance, ast, dynamicAnchors) && [new RegExp("")];
1848
+ };
1849
+
1850
+ var additionalProperties6 = { compile: compile$I, interpret: interpret$I, collectEvaluatedProperties: collectEvaluatedProperties$c };
1851
+ additionalProperties6.compile;
1852
+ additionalProperties6.interpret;
1853
+ additionalProperties6.collectEvaluatedProperties;
1854
+
1855
+ const { Core: Core$r, Schema: Schema$J } = lib$1;
1856
+
1857
+
1858
+
1859
+ const compile$H = (schema, ast) => lib$2.pipeline([
1860
+ Schema$J.map(async (itemSchema) => Core$r.compileSchema(await itemSchema, ast)),
1861
+ lib$2.all
1862
+ ], schema);
1863
+
1864
+ const interpret$H = (allOf, instance, ast, dynamicAnchors) => {
1865
+ return allOf.every((schemaUrl) => Core$r.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
1866
+ };
1867
+
1868
+ const collectEvaluatedProperties$b = (allOf, instance, ast, dynamicAnchors) => {
1869
+ return allOf.reduce((acc, schemaUrl) => {
1870
+ const propertyNames = acc && Core$r.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors);
1871
+ return propertyNames !== false && [...acc, ...propertyNames];
1872
+ }, []);
1873
+ };
1874
+
1875
+ const collectEvaluatedItems$c = (allOf, instance, ast, dynamicAnchors) => {
1876
+ return allOf.reduce((acc, schemaUrl) => {
1877
+ const itemIndexes = acc !== false && Core$r.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors);
1878
+ return itemIndexes !== false && new Set([...acc, ...itemIndexes]);
1879
+ }, new Set());
1880
+ };
1881
+
1882
+ var allOf = { compile: compile$H, interpret: interpret$H, collectEvaluatedProperties: collectEvaluatedProperties$b, collectEvaluatedItems: collectEvaluatedItems$c };
1883
+ allOf.compile;
1884
+ allOf.interpret;
1885
+ allOf.collectEvaluatedProperties;
1886
+ allOf.collectEvaluatedItems;
1887
+
1888
+ const { Core: Core$q, Schema: Schema$I } = lib$1;
1889
+
1890
+
1891
+
1892
+ const compile$G = (schema, ast) => lib$2.pipeline([
1893
+ Schema$I.map(async (itemSchema) => Core$q.compileSchema(await itemSchema, ast)),
1894
+ lib$2.all
1895
+ ], schema);
1896
+
1897
+ const interpret$G = (anyOf, instance, ast, dynamicAnchors) => {
1898
+ const matches = anyOf.filter((schemaUrl) => Core$q.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
1899
+ return matches.length > 0;
1900
+ };
1901
+
1902
+ const collectEvaluatedProperties$a = (anyOf, instance, ast, dynamicAnchors) => {
1903
+ return anyOf.reduce((acc, schemaUrl) => {
1904
+ const propertyNames = Core$q.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors);
1905
+ return propertyNames !== false ? [...acc || [], ...propertyNames] : acc;
1906
+ }, false);
1907
+ };
1908
+
1909
+ const collectEvaluatedItems$b = (anyOf, instance, ast, dynamicAnchors) => {
1910
+ return anyOf.reduce((acc, schemaUrl) => {
1911
+ const itemIndexes = Core$q.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors);
1912
+ return itemIndexes !== false ? new Set([...acc || [], ...itemIndexes]) : acc;
1913
+ }, false);
1914
+ };
1915
+
1916
+ var anyOf = { compile: compile$G, interpret: interpret$G, collectEvaluatedProperties: collectEvaluatedProperties$a, collectEvaluatedItems: collectEvaluatedItems$b };
1917
+ anyOf.compile;
1918
+ anyOf.interpret;
1919
+ anyOf.collectEvaluatedProperties;
1920
+ anyOf.collectEvaluatedItems;
1921
+
1922
+ var keyList = Object.keys;
1923
+ var native_stringify = JSON.stringify;
1924
+
1925
+ function stringify(val, allowUndefined) {
1926
+ var i, max, str, keys, key, propVal, tipeof;
1927
+
1928
+ tipeof = typeof val;
1929
+
1930
+ if (tipeof === 'string') return native_stringify(val);
1931
+ if (val === true) return 'true';
1932
+ if (val === false) return 'false';
1933
+ if (val === null) return 'null';
1934
+
1935
+ if (val instanceof Array) {
1936
+ str = '[';
1937
+ max = val.length - 1;
1938
+ for(i = 0; i < max; i++)
1939
+ str += stringify(val[i], false) + ',';
1940
+ if (max > -1) {
1941
+ str += stringify(val[i], false);
1942
+ }
1943
+
1944
+ return str + ']';
1945
+ }
1946
+
1947
+ if (val instanceof Object) {
1948
+ if (typeof val.toJSON === 'function')
1949
+ return stringify(val.toJSON(), allowUndefined);
1950
+
1951
+ // only object is left
1952
+ keys = keyList(val).sort();
1953
+ max = keys.length;
1954
+ str = '';
1955
+ i = 0;
1956
+ while (i < max) {
1957
+ key = keys[i];
1958
+ propVal = stringify(val[key], true);
1959
+ if (propVal !== undefined) {
1960
+ if (i && str !== '') { //if the string is empty, don't add comma to avoid the json to become invalid.
1961
+ str += ',';
1962
+ }
1963
+ str += native_stringify(key) + ':' + propVal;
1964
+ }
1965
+ i++;
1966
+ }
1967
+ return '{' + str + '}';
1968
+ }
1969
+
1970
+ switch (tipeof) {
1971
+ case 'function':
1972
+ case 'undefined':
1973
+ return allowUndefined ? undefined : null;
1974
+ default:
1975
+ return isFinite(val) ? val : null;
1976
+ }
1977
+ }
1978
+
1979
+ var fastestStableStringify = function(obj) { return '' + stringify(obj, false); };
1980
+
1981
+ const { Schema: Schema$H, Instance: Instance$x } = lib$1;
1982
+
1983
+
1984
+
1985
+ const compile$F = (schema) => fastestStableStringify(Schema$H.value(schema));
1986
+ const interpret$F = (const_, instance) => fastestStableStringify(Instance$x.value(instance)) === const_;
1987
+
1988
+ var _const = { compile: compile$F, interpret: interpret$F };
1989
+ _const.compile;
1990
+ _const.interpret;
1991
+
1992
+ const { Core: Core$p, Instance: Instance$w } = lib$1;
1993
+
1994
+
1995
+ const compile$E = (schema, ast) => Core$p.compileSchema(schema, ast);
1996
+
1997
+ const interpret$E = (contains, instance, ast, dynamicAnchors) => {
1998
+ return !Instance$w.typeOf(instance, "array") || Instance$w.some((item) => Core$p.interpretSchema(contains, item, ast, dynamicAnchors), instance);
1999
+ };
2000
+
2001
+ var contains = { compile: compile$E, interpret: interpret$E };
2002
+ contains.compile;
2003
+ contains.interpret;
2004
+
2005
+ const { Core: Core$o, Schema: Schema$G, Instance: Instance$v } = lib$1;
2006
+
2007
+
2008
+ const compile$D = async (schema, ast, parentSchema) => {
2009
+ const contains = await Core$o.compileSchema(schema, ast);
2010
+
2011
+ const minContainsSchema = await Schema$G.step("minContains", parentSchema);
2012
+ const minContains = Schema$G.typeOf(minContainsSchema, "number") ? Schema$G.value(minContainsSchema) : 1;
2013
+
2014
+ const maxContainsSchema = await Schema$G.step("maxContains", parentSchema);
2015
+ const maxContains = Schema$G.typeOf(maxContainsSchema, "number") ? Schema$G.value(maxContainsSchema) : Number.MAX_SAFE_INTEGER;
2016
+
2017
+ return { contains, minContains, maxContains };
2018
+ };
2019
+
2020
+ const interpret$D = ({ contains, minContains, maxContains }, instance, ast, dynamicAnchors) => {
2021
+ if (!Instance$v.typeOf(instance, "array")) {
2022
+ return true;
2023
+ }
2024
+
2025
+ const matches = Instance$v.reduce((matches, item) => {
2026
+ return Core$o.interpretSchema(contains, item, ast, dynamicAnchors) ? matches + 1 : matches;
2027
+ }, 0, instance);
2028
+ return matches >= minContains && matches <= maxContains;
2029
+ };
2030
+
2031
+ const collectEvaluatedItems$a = (keywordValue, instance, ast, dynamicAnchors) => {
2032
+ return interpret$D(keywordValue, instance, ast, dynamicAnchors) && Instance$v.reduce((matchedIndexes, item, itemIndex) => {
2033
+ return Core$o.interpretSchema(keywordValue.contains, item, ast, dynamicAnchors) ? matchedIndexes.add(itemIndex) : matchedIndexes;
2034
+ }, new Set(), instance);
2035
+ };
2036
+
2037
+ var containsMinContainsMaxContains = { compile: compile$D, interpret: interpret$D, collectEvaluatedItems: collectEvaluatedItems$a };
2038
+ containsMinContainsMaxContains.compile;
2039
+ containsMinContainsMaxContains.interpret;
2040
+ containsMinContainsMaxContains.collectEvaluatedItems;
2041
+
2042
+ const { Core: Core$n, Schema: Schema$F } = lib$1;
2043
+
2044
+
2045
+
2046
+ const compile$C = async (schema, ast) => {
2047
+ await lib$2.pipeline([
2048
+ Schema$F.entries,
2049
+ lib$2.map(([, definitionSchema]) => Core$n.compileSchema(definitionSchema, ast)),
2050
+ lib$2.all
2051
+ ], schema);
2052
+ };
2053
+
2054
+ const interpret$C = () => true;
2055
+
2056
+ var definitions = { compile: compile$C, interpret: interpret$C };
2057
+ definitions.compile;
2058
+ definitions.interpret;
2059
+
2060
+ const { Core: Core$m, Schema: Schema$E, Instance: Instance$u } = lib$1;
2061
+
2062
+
2063
+
2064
+ const compile$B = (schema, ast) => lib$2.pipeline([
2065
+ Schema$E.entries,
2066
+ lib$2.map(async ([key, dependency]) => {
2067
+ return [key, Schema$E.typeOf(dependency, "array") ? Schema$E.value(dependency) : await Core$m.compileSchema(dependency, ast)];
2068
+ }),
2069
+ lib$2.all
2070
+ ], schema);
2071
+
2072
+ const interpret$B = (dependencies, instance, ast, dynamicAnchors) => {
2073
+ const value = Instance$u.value(instance);
2074
+
2075
+ return !Instance$u.typeOf(instance, "object") || dependencies.every(([propertyName, dependency]) => {
2076
+ if (!(propertyName in value)) {
2077
+ return true;
2078
+ }
2079
+
2080
+ if (Array.isArray(dependency)) {
2081
+ return dependency.every((key) => key in value);
2082
+ } else {
2083
+ return Core$m.interpretSchema(dependency, instance, ast, dynamicAnchors);
2084
+ }
2085
+ });
2086
+ };
2087
+
2088
+ var dependencies = { compile: compile$B, interpret: interpret$B };
2089
+ dependencies.compile;
2090
+ dependencies.interpret;
2091
+
2092
+ const { Schema: Schema$D, Instance: Instance$t } = lib$1;
2093
+
2094
+
2095
+
2096
+ const compile$A = (schema) => lib$2.pipeline([
2097
+ Schema$D.entries,
2098
+ lib$2.map(([key, dependentRequired]) => [key, Schema$D.value(dependentRequired)]),
2099
+ lib$2.all
2100
+ ], schema);
2101
+
2102
+ const interpret$A = (dependentRequired, instance) => {
2103
+ const value = Instance$t.value(instance);
2104
+
2105
+ return !Instance$t.typeOf(instance, "object") || dependentRequired.every(([propertyName, required]) => {
2106
+ return !(propertyName in value) || required.every((key) => key in value);
2107
+ });
2108
+ };
2109
+
2110
+ var dependentRequired = { compile: compile$A, interpret: interpret$A };
2111
+ dependentRequired.compile;
2112
+ dependentRequired.interpret;
2113
+
2114
+ const { Core: Core$l, Schema: Schema$C, Instance: Instance$s } = lib$1;
2115
+
2116
+
2117
+
2118
+ const compile$z = (schema, ast) => lib$2.pipeline([
2119
+ Schema$C.entries,
2120
+ lib$2.map(async ([key, dependentSchema]) => [key, await Core$l.compileSchema(dependentSchema, ast)]),
2121
+ lib$2.all
2122
+ ], schema);
2123
+
2124
+ const interpret$z = (dependentSchemas, instance, ast, dynamicAnchors) => {
2125
+ const value = Instance$s.value(instance);
2126
+
2127
+ return !Instance$s.typeOf(instance, "object") || dependentSchemas.every(([propertyName, dependentSchema]) => {
2128
+ return !(propertyName in value) || Core$l.interpretSchema(dependentSchema, instance, ast, dynamicAnchors);
2129
+ });
2130
+ };
2131
+
2132
+ const collectEvaluatedProperties$9 = (dependentSchemas, instance, ast, dynamicAnchors) => {
2133
+ return dependentSchemas.reduce((acc, [propertyName, dependentSchema]) => {
2134
+ if (!acc || !Instance$s.has(propertyName, instance)) {
2135
+ return acc;
2136
+ }
2137
+
2138
+ const propertyNames = Core$l.collectEvaluatedProperties(dependentSchema, instance, ast, dynamicAnchors);
2139
+ return propertyNames !== false && acc.concat(propertyNames);
2140
+ }, []);
2141
+ };
2142
+
2143
+ var dependentSchemas = { compile: compile$z, interpret: interpret$z, collectEvaluatedProperties: collectEvaluatedProperties$9 };
2144
+ dependentSchemas.compile;
2145
+ dependentSchemas.interpret;
2146
+ dependentSchemas.collectEvaluatedProperties;
2147
+
2148
+ const { Schema: Schema$B, Instance: Instance$r } = lib$1;
2149
+
2150
+
2151
+
2152
+ const compile$y = (schema) => Schema$B.value(schema).map(fastestStableStringify);
2153
+ const interpret$y = (enum_, instance) => enum_.some((enumValue) => fastestStableStringify(Instance$r.value(instance)) === enumValue);
2154
+
2155
+ var _enum = { compile: compile$y, interpret: interpret$y };
2156
+ _enum.compile;
2157
+ _enum.interpret;
2158
+
2159
+ const { Schema: Schema$A, Instance: Instance$q } = lib$1;
2160
+
2161
+
2162
+ const compile$x = async (schema) => Schema$A.value(schema);
2163
+ const interpret$x = (exclusiveMaximum, instance) => !Instance$q.typeOf(instance, "number") || Instance$q.value(instance) < exclusiveMaximum;
2164
+
2165
+ var exclusiveMaximum = { compile: compile$x, interpret: interpret$x };
2166
+ exclusiveMaximum.compile;
2167
+ exclusiveMaximum.interpret;
2168
+
2169
+ const { Schema: Schema$z, Instance: Instance$p } = lib$1;
2170
+
2171
+
2172
+ const compile$w = async (schema) => Schema$z.value(schema);
2173
+ const interpret$w = (exclusiveMinimum, instance) => !Instance$p.typeOf(instance, "number") || Instance$p.value(instance) > exclusiveMinimum;
2174
+
2175
+ var exclusiveMinimum = { compile: compile$w, interpret: interpret$w };
2176
+ exclusiveMinimum.compile;
2177
+ exclusiveMinimum.interpret;
2178
+
2179
+ const { Core: Core$k } = lib$1;
2180
+
2181
+
2182
+ const compile$v = (schema, ast) => Core$k.compileSchema(schema, ast);
2183
+
2184
+ const interpret$v = (ifSchema, instance, ast, dynamicAnchors) => {
2185
+ Core$k.interpretSchema(ifSchema, instance, ast, dynamicAnchors);
2186
+ return true;
2187
+ };
2188
+
2189
+ const collectEvaluatedProperties$8 = (ifSchema, instance, ast, dynamicAnchors) => {
2190
+ return Core$k.collectEvaluatedProperties(ifSchema, instance, ast, dynamicAnchors) || [];
2191
+ };
2192
+
2193
+ const collectEvaluatedItems$9 = (ifSchema, instance, ast, dynamicAnchors) => {
2194
+ return Core$k.collectEvaluatedItems(ifSchema, instance, ast, dynamicAnchors) || new Set();
2195
+ };
2196
+
2197
+ var _if = { compile: compile$v, interpret: interpret$v, collectEvaluatedProperties: collectEvaluatedProperties$8, collectEvaluatedItems: collectEvaluatedItems$9 };
2198
+ _if.compile;
2199
+ _if.interpret;
2200
+ _if.collectEvaluatedProperties;
2201
+ _if.collectEvaluatedItems;
2202
+
2203
+ const { Core: Core$j, Schema: Schema$y } = lib$1;
2204
+
2205
+
2206
+ const compile$u = async (schema, ast, parentSchema) => {
2207
+ if (Schema$y.has("if", parentSchema)) {
2208
+ const ifSchema = await Schema$y.step("if", parentSchema);
2209
+ return [await Core$j.compileSchema(ifSchema, ast), await Core$j.compileSchema(schema, ast)];
2210
+ } else {
2211
+ return [];
2212
+ }
2213
+ };
2214
+
2215
+ const interpret$u = ([guard, block], instance, ast, dynamicAnchors) => {
2216
+ return guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors) || Core$j.interpretSchema(block, instance, ast, dynamicAnchors);
2217
+ };
2218
+
2219
+ // Interpret a schema without events being emitted
2220
+ const quietInterpretSchema$1 = (uri, instance, ast, dynamicAnchors) => {
2221
+ const nodes = ast[uri][2];
2222
+
2223
+ return typeof nodes === "boolean" ? nodes : nodes
2224
+ .every(([keywordId, , keywordValue]) => {
2225
+ return Core$j.getKeyword(keywordId).interpret(keywordValue, instance, ast, dynamicAnchors);
2226
+ });
2227
+ };
2228
+
2229
+ const collectEvaluatedProperties$7 = ([guard, block], instance, ast, dynamicAnchors) => {
2230
+ if (guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors)) {
2231
+ return [];
2232
+ }
2233
+
2234
+ return Core$j.collectEvaluatedProperties(block, instance, ast, dynamicAnchors);
2235
+ };
2236
+
2237
+ const collectEvaluatedItems$8 = ([guard, block], instance, ast, dynamicAnchors) => {
2238
+ if (guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors)) {
2239
+ return new Set();
2240
+ }
2241
+
2242
+ return Core$j.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
2243
+ };
2244
+
2245
+ var then = { compile: compile$u, interpret: interpret$u, collectEvaluatedProperties: collectEvaluatedProperties$7, collectEvaluatedItems: collectEvaluatedItems$8 };
2246
+ then.compile;
2247
+ then.interpret;
2248
+ then.collectEvaluatedProperties;
2249
+ then.collectEvaluatedItems;
2250
+
2251
+ const { Core: Core$i, Schema: Schema$x } = lib$1;
2252
+
2253
+
2254
+ const compile$t = async (schema, ast, parentSchema) => {
2255
+ if (Schema$x.has("if", parentSchema)) {
2256
+ const ifSchema = await Schema$x.step("if", parentSchema);
2257
+ return [await Core$i.compileSchema(ifSchema, ast), await Core$i.compileSchema(schema, ast)];
2258
+ } else {
2259
+ return [];
2260
+ }
2261
+ };
2262
+
2263
+ const interpret$t = ([guard, block], instance, ast, dynamicAnchors) => {
2264
+ return guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors) || Core$i.interpretSchema(block, instance, ast, dynamicAnchors);
2265
+ };
2266
+
2267
+ // Interpret a schema without events being emitted
2268
+ const quietInterpretSchema = (uri, instance, ast, dynamicAnchors) => {
2269
+ const nodes = ast[uri][2];
2270
+
2271
+ return typeof nodes === "boolean" ? nodes : nodes
2272
+ .every(([keywordId, , keywordValue]) => {
2273
+ return Core$i.getKeyword(keywordId).interpret(keywordValue, instance, ast, dynamicAnchors);
2274
+ });
2275
+ };
2276
+
2277
+ const collectEvaluatedProperties$6 = ([guard, block], instance, ast, dynamicAnchors) => {
2278
+ if (guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors)) {
2279
+ return [];
2280
+ }
2281
+
2282
+ return Core$i.collectEvaluatedProperties(block, instance, ast, dynamicAnchors);
2283
+ };
2284
+
2285
+ const collectEvaluatedItems$7 = ([guard, block], instance, ast, dynamicAnchors) => {
2286
+ if (guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors)) {
2287
+ return new Set();
2288
+ }
2289
+
2290
+ return Core$i.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
2291
+ };
2292
+
2293
+ var _else = { compile: compile$t, interpret: interpret$t, collectEvaluatedProperties: collectEvaluatedProperties$6, collectEvaluatedItems: collectEvaluatedItems$7 };
2294
+ _else.compile;
2295
+ _else.interpret;
2296
+ _else.collectEvaluatedProperties;
2297
+ _else.collectEvaluatedItems;
2298
+
2299
+ const { Core: Core$h, Schema: Schema$w, Instance: Instance$o } = lib$1;
2300
+
2301
+
2302
+ const compile$s = async (schema, ast) => {
2303
+ if (Schema$w.typeOf(schema, "array")) {
2304
+ const tupleItems = await Schema$w.map((itemSchema) => Core$h.compileSchema(itemSchema, ast), schema);
2305
+ return Promise.all(tupleItems);
2306
+ } else {
2307
+ return Core$h.compileSchema(schema, ast);
2308
+ }
2309
+ };
2310
+
2311
+ const interpret$s = (items, instance, ast, dynamicAnchors) => {
2312
+ if (!Instance$o.typeOf(instance, "array")) {
2313
+ return true;
2314
+ }
2315
+
2316
+ if (typeof items === "string") {
2317
+ return Instance$o.every((itemValue) => Core$h.interpretSchema(items, itemValue, ast, dynamicAnchors), instance);
2318
+ } else {
2319
+ return Instance$o.every((item, ndx) => !(ndx in items) || Core$h.interpretSchema(items[ndx], item, ast, dynamicAnchors), instance);
2320
+ }
2321
+ };
2322
+
2323
+ const collectEvaluatedItems$6 = (items, instance, ast, dynamicAnchors) => {
2324
+ return interpret$s(items, instance, ast, dynamicAnchors) && (typeof items === "string"
2325
+ ? new Set(Instance$o.map((item, itemIndex) => itemIndex, instance))
2326
+ : new Set(items.map((item, itemIndex) => itemIndex)));
2327
+ };
2328
+
2329
+ var items = { compile: compile$s, interpret: interpret$s, collectEvaluatedItems: collectEvaluatedItems$6 };
2330
+ items.compile;
2331
+ items.interpret;
2332
+ items.collectEvaluatedItems;
2333
+
2334
+ const { Core: Core$g, Schema: Schema$v, Instance: Instance$n } = lib$1;
2335
+
2336
+
2337
+ const compile$r = async (schema, ast, parentSchema) => {
2338
+ const items = await Schema$v.step("prefixItems", parentSchema);
2339
+ const numberOfPrefixItems = Schema$v.typeOf(items, "array") ? Schema$v.length(items) : 0;
2340
+
2341
+ return [numberOfPrefixItems, await Core$g.compileSchema(schema, ast)];
2342
+ };
2343
+
2344
+ const interpret$r = ([numberOfPrefixItems, items], instance, ast, dynamicAnchors) => {
2345
+ if (!Instance$n.typeOf(instance, "array")) {
2346
+ return true;
2347
+ }
2348
+
2349
+ return Instance$n.every((item, ndx) => ndx < numberOfPrefixItems || Core$g.interpretSchema(items, item, ast, dynamicAnchors), instance);
2350
+ };
2351
+
2352
+ const collectEvaluatedItems$5 = (keywordValue, instance, ast, dynamicAnchors) => {
2353
+ return interpret$r(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$n.map((item, ndx) => ndx, instance));
2354
+ };
2355
+
2356
+ var items202012 = { compile: compile$r, interpret: interpret$r, collectEvaluatedItems: collectEvaluatedItems$5 };
2357
+ items202012.compile;
2358
+ items202012.interpret;
2359
+ items202012.collectEvaluatedItems;
2360
+
2361
+ const { Schema: Schema$u, Instance: Instance$m } = lib$1;
2362
+
2363
+
2364
+ const compile$q = (schema) => Schema$u.value(schema);
2365
+ const interpret$q = (maxItems, instance) => !Instance$m.typeOf(instance, "array") || Instance$m.length(instance) <= maxItems;
2366
+
2367
+ var maxItems = { compile: compile$q, interpret: interpret$q };
2368
+ maxItems.compile;
2369
+ maxItems.interpret;
2370
+
2371
+ const { Schema: Schema$t, Instance: Instance$l } = lib$1;
2372
+
2373
+
2374
+ const compile$p = (schema) => Schema$t.value(schema);
2375
+ const interpret$p = (maxLength, instance) => !Instance$l.typeOf(instance, "string") || Instance$l.length(instance) <= maxLength;
2376
+
2377
+ var maxLength = { compile: compile$p, interpret: interpret$p };
2378
+ maxLength.compile;
2379
+ maxLength.interpret;
2380
+
2381
+ const { Schema: Schema$s, Instance: Instance$k } = lib$1;
2382
+
2383
+
2384
+ const compile$o = (schema) => Schema$s.value(schema);
2385
+ const interpret$o = (maxLength, instance) => !Instance$k.typeOf(instance, "string") || [...Instance$k.value(instance)].length <= maxLength;
2386
+
2387
+ var maxLength6 = { compile: compile$o, interpret: interpret$o };
2388
+ maxLength6.compile;
2389
+ maxLength6.interpret;
2390
+
2391
+ const { Schema: Schema$r, Instance: Instance$j } = lib$1;
2392
+
2393
+
2394
+ const compile$n = (schema) => Schema$r.value(schema);
2395
+ const interpret$n = (maxProperties, instance) => !Instance$j.typeOf(instance, "object") || Instance$j.keys(instance).length <= maxProperties;
2396
+
2397
+ var maxProperties = { compile: compile$n, interpret: interpret$n };
2398
+ maxProperties.compile;
2399
+ maxProperties.interpret;
2400
+
2401
+ const { Schema: Schema$q, Instance: Instance$i } = lib$1;
2402
+
2403
+
2404
+ const compile$m = async (schema, ast, parentSchema) => {
2405
+ const exclusiveMaximum = await Schema$q.step("exclusiveMaximum", parentSchema);
2406
+ const isExclusive = Schema$q.value(exclusiveMaximum);
2407
+
2408
+ return [Schema$q.value(schema), isExclusive];
2409
+ };
2410
+
2411
+ const interpret$m = ([maximum, isExclusive], instance) => {
2412
+ if (!Instance$i.typeOf(instance, "number")) {
2413
+ return true;
2414
+ }
2415
+
2416
+ const value = Instance$i.value(instance);
2417
+ return isExclusive ? value < maximum : value <= maximum;
2418
+ };
2419
+
2420
+ var maximumExclusiveMaximum = { compile: compile$m, interpret: interpret$m };
2421
+ maximumExclusiveMaximum.compile;
2422
+ maximumExclusiveMaximum.interpret;
2423
+
2424
+ const { Schema: Schema$p, Instance: Instance$h } = lib$1;
2425
+
2426
+
2427
+ const compile$l = async (schema) => Schema$p.value(schema);
2428
+ const interpret$l = (maximum, instance) => !Instance$h.typeOf(instance, "number") || Instance$h.value(instance) <= maximum;
2429
+
2430
+ var maximum = { compile: compile$l, interpret: interpret$l };
2431
+ maximum.compile;
2432
+ maximum.interpret;
2433
+
2434
+ const { Schema: Schema$o, Instance: Instance$g } = lib$1;
2435
+
2436
+
2437
+ const compile$k = (schema) => Schema$o.value(schema);
2438
+ const interpret$k = (minItems, instance) => !Instance$g.typeOf(instance, "array") || Instance$g.length(instance) >= minItems;
2439
+
2440
+ var minItems = { compile: compile$k, interpret: interpret$k };
2441
+ minItems.compile;
2442
+ minItems.interpret;
2443
+
2444
+ const { Schema: Schema$n, Instance: Instance$f } = lib$1;
2445
+
2446
+
2447
+ const compile$j = (schema) => Schema$n.value(schema);
2448
+ const interpret$j = (minLength, instance) => !Instance$f.typeOf(instance, "string") || Instance$f.length(instance) >= minLength;
2449
+
2450
+ var minLength = { compile: compile$j, interpret: interpret$j };
2451
+ minLength.compile;
2452
+ minLength.interpret;
2453
+
2454
+ const { Schema: Schema$m, Instance: Instance$e } = lib$1;
2455
+
2456
+
2457
+ const compile$i = (schema) => Schema$m.value(schema);
2458
+ const interpret$i = (minLength, instance) => !Instance$e.typeOf(instance, "string") || [...Instance$e.value(instance)].length >= minLength;
2459
+
2460
+ var minLength6 = { compile: compile$i, interpret: interpret$i };
2461
+ minLength6.compile;
2462
+ minLength6.interpret;
2463
+
2464
+ const { Schema: Schema$l, Instance: Instance$d } = lib$1;
2465
+
2466
+
2467
+ const compile$h = (schema) => Schema$l.value(schema);
2468
+ const interpret$h = (minProperties, instance) => !Instance$d.typeOf(instance, "object") || Instance$d.keys(instance).length >= minProperties;
2469
+
2470
+ var minProperties = { compile: compile$h, interpret: interpret$h };
2471
+ minProperties.compile;
2472
+ minProperties.interpret;
2473
+
2474
+ const { Schema: Schema$k, Instance: Instance$c } = lib$1;
2475
+
2476
+
2477
+ const compile$g = async (schema, ast, parentSchema) => {
2478
+ const exclusiveMinimum = await Schema$k.step("exclusiveMinimum", parentSchema);
2479
+ const isExclusive = Schema$k.value(exclusiveMinimum);
2480
+
2481
+ return [Schema$k.value(schema), isExclusive];
2482
+ };
2483
+
2484
+ const interpret$g = ([minimum, isExclusive], instance) => {
2485
+ if (!Instance$c.typeOf(instance, "number")) {
2486
+ return true;
2487
+ }
2488
+
2489
+ const value = Instance$c.value(instance);
2490
+ return isExclusive ? value > minimum : value >= minimum;
2491
+ };
2492
+
2493
+ var minimumExclusiveMinimum = { compile: compile$g, interpret: interpret$g };
2494
+ minimumExclusiveMinimum.compile;
2495
+ minimumExclusiveMinimum.interpret;
2496
+
2497
+ const { Schema: Schema$j, Instance: Instance$b } = lib$1;
2498
+
2499
+
2500
+ const compile$f = async (schema) => Schema$j.value(schema);
2501
+ const interpret$f = (minimum, instance) => !Instance$b.typeOf(instance, "number") || Instance$b.value(instance) >= minimum;
2502
+
2503
+ var minimum = { compile: compile$f, interpret: interpret$f };
2504
+ minimum.compile;
2505
+ minimum.interpret;
2506
+
2507
+ const { Schema: Schema$i, Instance: Instance$a } = lib$1;
2508
+
2509
+
2510
+ const compile$e = (schema) => Schema$i.value(schema);
2511
+
2512
+ const interpret$e = (multipleOf, instance) => {
2513
+ if (!Instance$a.typeOf(instance, "number")) {
2514
+ return true;
2515
+ }
2516
+
2517
+ const remainder = Instance$a.value(instance) % multipleOf;
2518
+ return numberEqual(0, remainder) || numberEqual(multipleOf, remainder);
2519
+ };
2520
+
2521
+ const numberEqual = (a, b) => Math.abs(a - b) < 1.19209290e-7;
2522
+
2523
+ var multipleOf = { compile: compile$e, interpret: interpret$e };
2524
+ multipleOf.compile;
2525
+ multipleOf.interpret;
2526
+
2527
+ const { Core: Core$f } = lib$1;
2528
+
2529
+
2530
+ const compile$d = Core$f.compileSchema;
2531
+ const interpret$d = (not, instance, ast, dynamicAnchors) => !Core$f.interpretSchema(not, instance, ast, dynamicAnchors);
2532
+
2533
+ var not = { compile: compile$d, interpret: interpret$d };
2534
+ not.compile;
2535
+ not.interpret;
2536
+
2537
+ const { Core: Core$e, Schema: Schema$h } = lib$1;
2538
+
2539
+
2540
+ const compile$c = async (schema, ast) => {
2541
+ const oneOf = await Schema$h.map((itemSchema) => Core$e.compileSchema(itemSchema, ast), schema);
2542
+ return Promise.all(oneOf);
2543
+ };
2544
+
2545
+ const interpret$c = (oneOf, instance, ast, dynamicAnchors) => {
2546
+ let validCount = 0;
2547
+ for (const schemaUrl of oneOf) {
2548
+ if (Core$e.interpretSchema(schemaUrl, instance, ast, dynamicAnchors)) {
2549
+ validCount++;
2550
+ }
2551
+
2552
+ if (validCount > 1) {
2553
+ break;
2554
+ }
2555
+ }
2556
+
2557
+ return validCount === 1;
2558
+ };
2559
+
2560
+ const collectEvaluatedProperties$5 = (oneOf, instance, ast, dynamicAnchors) => {
2561
+ let validCount = 0;
2562
+ return oneOf.reduce((acc, schemaUrl) => {
2563
+ if (validCount > 1) {
2564
+ return false;
2565
+ }
2566
+
2567
+ const propertyNames = Core$e.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors);
2568
+ return propertyNames ? validCount++ === 0 && propertyNames : acc;
2569
+ }, false);
2570
+ };
2571
+
2572
+ const collectEvaluatedItems$4 = (oneOf, instance, ast, dynamicAnchors) => {
2573
+ let validCount = 0;
2574
+ return oneOf.reduce((acc, schemaUrl) => {
2575
+ if (validCount > 1) {
2576
+ return false;
2577
+ }
2578
+
2579
+ const itemIndexes = Core$e.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors);
2580
+ return itemIndexes ? validCount++ === 0 && itemIndexes : acc;
2581
+ }, false);
2582
+ };
2583
+
2584
+ var oneOf = { compile: compile$c, interpret: interpret$c, collectEvaluatedProperties: collectEvaluatedProperties$5, collectEvaluatedItems: collectEvaluatedItems$4 };
2585
+ oneOf.compile;
2586
+ oneOf.interpret;
2587
+ oneOf.collectEvaluatedProperties;
2588
+ oneOf.collectEvaluatedItems;
2589
+
2590
+ const { Schema: Schema$g, Instance: Instance$9 } = lib$1;
2591
+
2592
+
2593
+ const compile$b = (schema) => new RegExp(Schema$g.value(schema), "u");
2594
+ const interpret$b = (pattern, instance) => !Instance$9.typeOf(instance, "string") || pattern.test(Instance$9.value(instance));
2595
+
2596
+ var pattern = { compile: compile$b, interpret: interpret$b };
2597
+ pattern.compile;
2598
+ pattern.interpret;
2599
+
2600
+ const { Core: Core$d, Schema: Schema$f, Instance: Instance$8 } = lib$1;
2601
+
2602
+
2603
+
2604
+ const compile$a = (schema, ast) => lib$2.pipeline([
2605
+ Schema$f.entries,
2606
+ lib$2.map(async ([pattern, propertySchema]) => [new RegExp(pattern, "u"), await Core$d.compileSchema(propertySchema, ast)]),
2607
+ lib$2.all
2608
+ ], schema);
2609
+
2610
+ const interpret$a = (patternProperties, instance, ast, dynamicAnchors) => {
2611
+ return !Instance$8.typeOf(instance, "object") || patternProperties.every(([pattern, schemaUrl]) => {
2612
+ return Instance$8.entries(instance)
2613
+ .filter(([propertyName]) => pattern.test(propertyName))
2614
+ .every(([, propertyValue]) => Core$d.interpretSchema(schemaUrl, propertyValue, ast, dynamicAnchors));
2615
+ });
2616
+ };
2617
+
2618
+ const collectEvaluatedProperties$4 = (patternProperties, instance, ast, dynamicAnchors) => {
2619
+ return interpret$a(patternProperties, instance, ast, dynamicAnchors) && patternProperties.map(([pattern]) => pattern);
2620
+ };
2621
+
2622
+ var patternProperties = { compile: compile$a, interpret: interpret$a, collectEvaluatedProperties: collectEvaluatedProperties$4 };
2623
+ patternProperties.compile;
2624
+ patternProperties.interpret;
2625
+ patternProperties.collectEvaluatedProperties;
2626
+
2627
+ const isObject = (value) => typeof value === "object" && !Array.isArray(value) && value !== null;
2628
+ const escapeRegExp$1 = (string) => string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
2629
+
2630
+ const splitUrl$1 = (url) => {
2631
+ const indexOfHash = url.indexOf("#");
2632
+ const ndx = indexOfHash === -1 ? url.length : indexOfHash;
2633
+ const urlReference = url.slice(0, ndx);
2634
+ const urlFragment = url.slice(ndx + 1);
2635
+
2636
+ return [decodeURI(urlReference), decodeURI(urlFragment)];
2637
+ };
2638
+
2639
+ var common = { isObject, escapeRegExp: escapeRegExp$1, splitUrl: splitUrl$1 };
2640
+
2641
+ const { Core: Core$c, Schema: Schema$e, Instance: Instance$7 } = lib$1;
2642
+
2643
+ const { escapeRegExp } = common;
2644
+
2645
+
2646
+ const compile$9 = (schema, ast) => lib$2.pipeline([
2647
+ Schema$e.entries,
2648
+ lib$2.reduce(async (acc, [propertyName, propertySchema]) => {
2649
+ acc[propertyName] = await Core$c.compileSchema(propertySchema, ast);
2650
+ return acc;
2651
+ }, Object.create(null))
2652
+ ], schema);
2653
+
2654
+ const interpret$9 = (properties, instance, ast, dynamicAnchors) => {
2655
+ return !Instance$7.typeOf(instance, "object") || Instance$7.entries(instance)
2656
+ .filter(([propertyName]) => propertyName in properties)
2657
+ .every(([propertyName, schemaUrl]) => Core$c.interpretSchema(properties[propertyName], schemaUrl, ast, dynamicAnchors));
2658
+ };
2659
+
2660
+ const collectEvaluatedProperties$3 = (properties, instance, ast, dynamicAnchors) => {
2661
+ return interpret$9(properties, instance, ast, dynamicAnchors) && Object.keys(properties)
2662
+ .map((propertyName) => new RegExp(`^${escapeRegExp(propertyName)}$`));
2663
+ };
2664
+
2665
+ var properties = { compile: compile$9, interpret: interpret$9, collectEvaluatedProperties: collectEvaluatedProperties$3 };
2666
+ properties.compile;
2667
+ properties.interpret;
2668
+ properties.collectEvaluatedProperties;
2669
+
2670
+ const { Core: Core$b, Instance: Instance$6 } = lib$1;
2671
+
2672
+
2673
+ const compile$8 = (schema, ast) => Core$b.compileSchema(schema, ast);
2674
+
2675
+ const interpret$8 = (propertyNames, instance, ast, dynamicAnchors) => {
2676
+ return !Instance$6.typeOf(instance, "object") || Instance$6.keys(instance)
2677
+ .every((key) => Core$b.interpretSchema(propertyNames, Instance$6.cons(key), ast, dynamicAnchors));
2678
+ };
2679
+
2680
+ var propertyNames = { compile: compile$8, interpret: interpret$8 };
2681
+ propertyNames.compile;
2682
+ propertyNames.interpret;
2683
+
2684
+ const { Core: Core$a, Schema: Schema$d } = lib$1;
2685
+ const { splitUrl } = common;
2686
+
2687
+
2688
+ const compile$7 = async (dynamicRef, ast) => {
2689
+ const [, fragment] = splitUrl(Schema$d.value(dynamicRef));
2690
+ const referencedSchema = await Schema$d.get(Schema$d.value(dynamicRef), dynamicRef);
2691
+ await Core$a.compileSchema(referencedSchema, ast);
2692
+ return [referencedSchema.id, fragment];
2693
+ };
2694
+
2695
+ const interpret$7 = ([id, fragment], instance, ast, dynamicAnchors) => {
2696
+ if (fragment in ast.metaData[id].dynamicAnchors) {
2697
+ return Core$a.interpretSchema(dynamicAnchors[fragment], instance, ast, dynamicAnchors);
2698
+ } else {
2699
+ const pointer = Schema$d.getAnchorPointer(ast.metaData[id], fragment);
2700
+ return Core$a.interpretSchema(`${id}#${encodeURI(pointer)}`, instance, ast, dynamicAnchors);
2701
+ }
2702
+ };
2703
+
2704
+ const collectEvaluatedProperties$2 = Core$a.collectEvaluatedProperties;
2705
+ const collectEvaluatedItems$3 = Core$a.collectEvaluatedItems;
2706
+
2707
+ var dynamicRef = { compile: compile$7, interpret: interpret$7, collectEvaluatedProperties: collectEvaluatedProperties$2, collectEvaluatedItems: collectEvaluatedItems$3 };
2708
+ dynamicRef.compile;
2709
+ dynamicRef.interpret;
2710
+ dynamicRef.collectEvaluatedProperties;
2711
+ dynamicRef.collectEvaluatedItems;
2712
+
2713
+ const { Core: Core$9, Schema: Schema$c } = lib$1;
2714
+
2715
+
2716
+ const compile$6 = async (ref, ast) => {
2717
+ const referencedSchema = await Schema$c.get(Schema$c.value(ref), ref);
2718
+ return Core$9.compileSchema(referencedSchema, ast);
2719
+ };
2720
+
2721
+ const interpret$6 = Core$9.interpretSchema;
2722
+ const collectEvaluatedProperties$1 = Core$9.collectEvaluatedProperties;
2723
+ const collectEvaluatedItems$2 = Core$9.collectEvaluatedItems;
2724
+
2725
+ var ref = { compile: compile$6, interpret: interpret$6, collectEvaluatedProperties: collectEvaluatedProperties$1, collectEvaluatedItems: collectEvaluatedItems$2 };
2726
+ ref.compile;
2727
+ ref.interpret;
2728
+ ref.collectEvaluatedProperties;
2729
+ ref.collectEvaluatedItems;
2730
+
2731
+ const { Schema: Schema$b, Instance: Instance$5 } = lib$1;
2732
+
2733
+
2734
+ const compile$5 = (schema) => Schema$b.value(schema);
2735
+
2736
+ const interpret$5 = (required, instance) => {
2737
+ return !Instance$5.typeOf(instance, "object") || required.every((propertyName) => Object.prototype.hasOwnProperty.call(Instance$5.value(instance), propertyName));
2738
+ };
2739
+
2740
+ var required = { compile: compile$5, interpret: interpret$5 };
2741
+ required.compile;
2742
+ required.interpret;
2743
+
2744
+ const { Core: Core$8, Schema: Schema$a, Instance: Instance$4 } = lib$1;
2745
+
2746
+
2747
+
2748
+ const compile$4 = (schema, ast) => {
2749
+ return lib$2.pipeline([
2750
+ Schema$a.map((itemSchema) => Core$8.compileSchema(itemSchema, ast)),
2751
+ lib$2.all
2752
+ ], schema);
2753
+ };
2754
+
2755
+ const interpret$4 = (items, instance, ast, dynamicAnchors) => {
2756
+ if (!Instance$4.typeOf(instance, "array")) {
2757
+ return true;
2758
+ }
2759
+
2760
+ return Instance$4.every((item, ndx) => !(ndx in items) || Core$8.interpretSchema(items[ndx], item, ast, dynamicAnchors), instance);
2761
+ };
2762
+
2763
+ const collectEvaluatedItems$1 = (items, instance, ast, dynamicAnchors) => {
2764
+ return interpret$4(items, instance, ast, dynamicAnchors) && new Set(items.map((item, ndx) => ndx));
2765
+ };
2766
+
2767
+ var tupleItems = { compile: compile$4, interpret: interpret$4, collectEvaluatedItems: collectEvaluatedItems$1 };
2768
+ tupleItems.compile;
2769
+ tupleItems.interpret;
2770
+ tupleItems.collectEvaluatedItems;
2771
+
2772
+ const { Schema: Schema$9, Instance: Instance$3 } = lib$1;
2773
+
2774
+
2775
+ const compile$3 = (schema) => Schema$9.value(schema);
2776
+ const interpret$3 = (type, instance) => typeof type === "string" ? Instance$3.typeOf(instance, type) : type.some(Instance$3.typeOf(instance));
2777
+
2778
+ var type = { compile: compile$3, interpret: interpret$3 };
2779
+ type.compile;
2780
+ type.interpret;
2781
+
2782
+ const { Core: Core$7, Schema: Schema$8, Instance: Instance$2 } = lib$1;
2783
+
2784
+
2785
+ const compile$2 = async (schema, ast, parentSchema) => {
2786
+ return [Schema$8.uri(parentSchema), await Core$7.compileSchema(schema, ast)];
2787
+ };
2788
+
2789
+ const interpret$2 = ([schemaUrl, unevaluatedItems], instance, ast, dynamicAnchors) => {
2790
+ if (!Instance$2.typeOf(instance, "array")) {
2791
+ return true;
2792
+ }
2793
+
2794
+ const itemIndexes = Core$7.collectEvaluatedItems(schemaUrl, instance, ast, dynamicAnchors, true);
2795
+ return itemIndexes === false || Instance$2.every((item, itemIndex) => {
2796
+ return itemIndexes.has(itemIndex) || Core$7.interpretSchema(unevaluatedItems, Instance$2.step(itemIndex, instance), ast, dynamicAnchors);
2797
+ }, instance);
2798
+ };
2799
+
2800
+ const collectEvaluatedItems = (keywordValue, instance, ast, dynamicAnchors) => {
2801
+ return interpret$2(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$2.map((item, ndx) => ndx, instance));
2802
+ };
2803
+
2804
+ var unevaluatedItems = { compile: compile$2, interpret: interpret$2, collectEvaluatedItems };
2805
+ unevaluatedItems.compile;
2806
+ unevaluatedItems.interpret;
2807
+ unevaluatedItems.collectEvaluatedItems;
2808
+
2809
+ const { Core: Core$6, Schema: Schema$7, Instance: Instance$1 } = lib$1;
2810
+
2811
+
2812
+ const compile$1 = async (schema, ast, parentSchema) => {
2813
+ return [Schema$7.uri(parentSchema), await Core$6.compileSchema(schema, ast)];
2814
+ };
2815
+
2816
+ const interpret$1 = ([schemaUrl, unevaluatedProperties], instance, ast, dynamicAnchors) => {
2817
+ if (!Instance$1.typeOf(instance, "object")) {
2818
+ return true;
2819
+ }
2820
+
2821
+ const evaluatedPropertyNames = Core$6.collectEvaluatedProperties(schemaUrl, instance, ast, dynamicAnchors, true);
2822
+
2823
+ return !evaluatedPropertyNames || Instance$1.entries(instance)
2824
+ .filter(([propertyName]) => !evaluatedPropertyNames.some((pattern) => propertyName.match(pattern)))
2825
+ .every(([, property]) => Core$6.interpretSchema(unevaluatedProperties, property, ast, dynamicAnchors));
2826
+ };
2827
+
2828
+ const collectEvaluatedProperties = (keywordValue, instance, ast, dynamicAnchors) =>{
2829
+ return interpret$1(keywordValue, instance, ast, dynamicAnchors) && [new RegExp("")];
2830
+ };
2831
+
2832
+ var unevaluatedProperties = { compile: compile$1, interpret: interpret$1, collectEvaluatedProperties };
2833
+ unevaluatedProperties.compile;
2834
+ unevaluatedProperties.interpret;
2835
+ unevaluatedProperties.collectEvaluatedProperties;
2836
+
2837
+ const { Schema: Schema$6, Instance } = lib$1;
2838
+
2839
+
2840
+
2841
+ const compile = (schema) => Schema$6.value(schema);
2842
+
2843
+ const interpret = (uniqueItems, instance) => {
2844
+ if (!Instance.typeOf(instance, "array") || uniqueItems === false) {
2845
+ return true;
2846
+ }
2847
+
2848
+ const normalizedItems = Instance.map((item) => fastestStableStringify(Instance.value(item)), instance);
2849
+ return new Set(normalizedItems).size === normalizedItems.length;
2850
+ };
2851
+
2852
+ var uniqueItems = { compile, interpret };
2853
+ uniqueItems.compile;
2854
+ uniqueItems.interpret;
2855
+
2856
+ const { Keywords } = lib$1;
2857
+
2858
+
2859
+ var keywords = {
2860
+ additionalItems: additionalItems,
2861
+ additionalItems6: additionalItems6,
2862
+ additionalProperties: additionalProperties,
2863
+ additionalProperties6: additionalProperties6,
2864
+ allOf: allOf,
2865
+ anyOf: anyOf,
2866
+ const: _const,
2867
+ contains: contains,
2868
+ containsMinContainsMaxContains: containsMinContainsMaxContains,
2869
+ definitions: definitions,
2870
+ dependencies: dependencies,
2871
+ dependentRequired: dependentRequired,
2872
+ dependentSchemas: dependentSchemas,
2873
+ enum: _enum,
2874
+ exclusiveMaximum: exclusiveMaximum,
2875
+ exclusiveMinimum: exclusiveMinimum,
2876
+ if: _if,
2877
+ then: then,
2878
+ else: _else,
2879
+ items: items,
2880
+ items202012: items202012,
2881
+ maxItems: maxItems,
2882
+ maxLength: maxLength,
2883
+ maxLength6: maxLength6,
2884
+ maxProperties: maxProperties,
2885
+ maximumExclusiveMaximum: maximumExclusiveMaximum,
2886
+ maximum: maximum,
2887
+ metaData: Keywords.metaData,
2888
+ minItems: minItems,
2889
+ minLength: minLength,
2890
+ minLength6: minLength6,
2891
+ minProperties: minProperties,
2892
+ minimumExclusiveMinimum: minimumExclusiveMinimum,
2893
+ minimum: minimum,
2894
+ multipleOf: multipleOf,
2895
+ not: not,
2896
+ oneOf: oneOf,
2897
+ pattern: pattern,
2898
+ patternProperties: patternProperties,
2899
+ properties: properties,
2900
+ propertyNames: propertyNames,
2901
+ dynamicRef: dynamicRef,
2902
+ ref: ref,
2903
+ required: required,
2904
+ tupleItems: tupleItems,
2905
+ type: type,
2906
+ unevaluatedItems: unevaluatedItems,
2907
+ unevaluatedProperties: unevaluatedProperties,
2908
+ uniqueItems: uniqueItems,
2909
+ validate: Keywords.validate
2910
+ };
2911
+ keywords.additionalItems;
2912
+ keywords.additionalItems6;
2913
+ keywords.additionalProperties;
2914
+ keywords.additionalProperties6;
2915
+ keywords.allOf;
2916
+ keywords.anyOf;
2917
+ keywords.contains;
2918
+ keywords.containsMinContainsMaxContains;
2919
+ keywords.definitions;
2920
+ keywords.dependencies;
2921
+ keywords.dependentRequired;
2922
+ keywords.dependentSchemas;
2923
+ keywords.exclusiveMaximum;
2924
+ keywords.exclusiveMinimum;
2925
+ keywords.then;
2926
+ keywords.items;
2927
+ keywords.items202012;
2928
+ keywords.maxItems;
2929
+ keywords.maxLength;
2930
+ keywords.maxLength6;
2931
+ keywords.maxProperties;
2932
+ keywords.maximumExclusiveMaximum;
2933
+ keywords.maximum;
2934
+ keywords.metaData;
2935
+ keywords.minItems;
2936
+ keywords.minLength;
2937
+ keywords.minLength6;
2938
+ keywords.minProperties;
2939
+ keywords.minimumExclusiveMinimum;
2940
+ keywords.minimum;
2941
+ keywords.multipleOf;
2942
+ keywords.not;
2943
+ keywords.oneOf;
2944
+ keywords.pattern;
2945
+ keywords.patternProperties;
2946
+ keywords.properties;
2947
+ keywords.propertyNames;
2948
+ keywords.dynamicRef;
2949
+ keywords.ref;
2950
+ keywords.required;
2951
+ keywords.tupleItems;
2952
+ keywords.type;
2953
+ keywords.unevaluatedItems;
2954
+ keywords.unevaluatedProperties;
2955
+ keywords.uniqueItems;
2956
+ keywords.validate;
2957
+
2958
+ var schema$4 = `{
2959
+ "id": "http://json-schema.org/draft-04/schema#",
2960
+ "$schema": "http://json-schema.org/draft-04/schema#",
2961
+ "description": "Core schema meta-schema",
2962
+ "definitions": {
2963
+ "schemaArray": {
2964
+ "type": "array",
2965
+ "minItems": 1,
2966
+ "items": { "$ref": "#" }
2967
+ },
2968
+ "positiveInteger": {
2969
+ "type": "integer",
2970
+ "minimum": 0
2971
+ },
2972
+ "positiveIntegerDefault0": {
2973
+ "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
2974
+ },
2975
+ "simpleTypes": {
2976
+ "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
2977
+ },
2978
+ "stringArray": {
2979
+ "type": "array",
2980
+ "items": { "type": "string" },
2981
+ "minItems": 1,
2982
+ "uniqueItems": true
2983
+ }
2984
+ },
2985
+ "type": "object",
2986
+ "properties": {
2987
+ "id": {
2988
+ "type": "string"
2989
+ },
2990
+ "$schema": {
2991
+ "type": "string"
2992
+ },
2993
+ "title": {
2994
+ "type": "string"
2995
+ },
2996
+ "description": {
2997
+ "type": "string"
2998
+ },
2999
+ "default": {},
3000
+ "multipleOf": {
3001
+ "type": "number",
3002
+ "minimum": 0,
3003
+ "exclusiveMinimum": true
3004
+ },
3005
+ "maximum": {
3006
+ "type": "number"
3007
+ },
3008
+ "exclusiveMaximum": {
3009
+ "type": "boolean",
3010
+ "default": false
3011
+ },
3012
+ "minimum": {
3013
+ "type": "number"
3014
+ },
3015
+ "exclusiveMinimum": {
3016
+ "type": "boolean",
3017
+ "default": false
3018
+ },
3019
+ "maxLength": { "$ref": "#/definitions/positiveInteger" },
3020
+ "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
3021
+ "pattern": {
3022
+ "type": "string",
3023
+ "format": "regex"
3024
+ },
3025
+ "additionalItems": {
3026
+ "anyOf": [
3027
+ { "type": "boolean" },
3028
+ { "$ref": "#" }
3029
+ ],
3030
+ "default": {}
3031
+ },
3032
+ "items": {
3033
+ "anyOf": [
3034
+ { "$ref": "#" },
3035
+ { "$ref": "#/definitions/schemaArray" }
3036
+ ],
3037
+ "default": {}
3038
+ },
3039
+ "maxItems": { "$ref": "#/definitions/positiveInteger" },
3040
+ "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
3041
+ "uniqueItems": {
3042
+ "type": "boolean",
3043
+ "default": false
3044
+ },
3045
+ "maxProperties": { "$ref": "#/definitions/positiveInteger" },
3046
+ "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
3047
+ "required": { "$ref": "#/definitions/stringArray" },
3048
+ "additionalProperties": {
3049
+ "anyOf": [
3050
+ { "type": "boolean" },
3051
+ { "$ref": "#" }
3052
+ ],
3053
+ "default": {}
3054
+ },
3055
+ "definitions": {
3056
+ "type": "object",
3057
+ "additionalProperties": { "$ref": "#" },
3058
+ "default": {}
3059
+ },
3060
+ "properties": {
3061
+ "type": "object",
3062
+ "additionalProperties": { "$ref": "#" },
3063
+ "default": {}
3064
+ },
3065
+ "patternProperties": {
3066
+ "type": "object",
3067
+ "additionalProperties": { "$ref": "#" },
3068
+ "default": {}
3069
+ },
3070
+ "dependencies": {
3071
+ "type": "object",
3072
+ "additionalProperties": {
3073
+ "anyOf": [
3074
+ { "$ref": "#" },
3075
+ { "$ref": "#/definitions/stringArray" }
3076
+ ]
3077
+ }
3078
+ },
3079
+ "enum": {
3080
+ "type": "array",
3081
+ "minItems": 1,
3082
+ "uniqueItems": true
3083
+ },
3084
+ "type": {
3085
+ "anyOf": [
3086
+ { "$ref": "#/definitions/simpleTypes" },
3087
+ {
3088
+ "type": "array",
3089
+ "items": { "$ref": "#/definitions/simpleTypes" },
3090
+ "minItems": 1,
3091
+ "uniqueItems": true
3092
+ }
3093
+ ]
3094
+ },
3095
+ "format": { "type": "string" },
3096
+ "allOf": { "$ref": "#/definitions/schemaArray" },
3097
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
3098
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
3099
+ "not": { "$ref": "#" }
3100
+ },
3101
+ "dependencies": {
3102
+ "exclusiveMaximum": [ "maximum" ],
3103
+ "exclusiveMinimum": [ "minimum" ]
3104
+ },
3105
+ "default": {}
3106
+ }`;
3107
+
3108
+ var hyperSchema = `{
3109
+ "$schema": "http://json-schema.org/draft-04/hyper-schema#",
3110
+ "id": "http://json-schema.org/draft-04/hyper-schema#",
3111
+ "title": "JSON Hyper-Schema",
3112
+ "allOf": [
3113
+ {"$ref": "http://json-schema.org/draft-04/schema#"}
3114
+ ],
3115
+ "properties": {
3116
+ "additionalItems": {
3117
+ "anyOf": [
3118
+ {"type": "boolean"},
3119
+ {"$ref": "#"}
3120
+ ]
3121
+ },
3122
+ "additionalProperties": {
3123
+ "anyOf": [
3124
+ {"type": "boolean"},
3125
+ {"$ref": "#"}
3126
+ ]
3127
+ },
3128
+ "dependencies": {
3129
+ "additionalProperties": {
3130
+ "anyOf": [
3131
+ {"$ref": "#"},
3132
+ {"type": "array"}
3133
+ ]
3134
+ }
3135
+ },
3136
+ "items": {
3137
+ "anyOf": [
3138
+ {"$ref": "#"},
3139
+ {"$ref": "#/definitions/schemaArray"}
3140
+ ]
3141
+ },
3142
+ "definitions": {
3143
+ "additionalProperties": {"$ref": "#"}
3144
+ },
3145
+ "patternProperties": {
3146
+ "additionalProperties": {"$ref": "#"}
3147
+ },
3148
+ "properties": {
3149
+ "additionalProperties": {"$ref": "#"}
3150
+ },
3151
+ "allOf": {"$ref": "#/definitions/schemaArray"},
3152
+ "anyOf": {"$ref": "#/definitions/schemaArray"},
3153
+ "oneOf": {"$ref": "#/definitions/schemaArray"},
3154
+ "not": { "$ref": "#" },
3155
+
3156
+ "links": {
3157
+ "type": "array",
3158
+ "items": {"$ref": "#/definitions/linkDescription"}
3159
+ },
3160
+ "fragmentResolution": {
3161
+ "type": "string"
3162
+ },
3163
+ "media": {
3164
+ "type": "object",
3165
+ "properties": {
3166
+ "type": {
3167
+ "description": "A media type, as described in RFC 2046",
3168
+ "type": "string"
3169
+ },
3170
+ "binaryEncoding": {
3171
+ "description": "A content encoding scheme, as described in RFC 2045",
3172
+ "type": "string"
3173
+ }
3174
+ }
3175
+ },
3176
+ "pathStart": {
3177
+ "description": "Instances' URIs must start with this value for this schema to apply to them",
3178
+ "type": "string",
3179
+ "format": "uri"
3180
+ }
3181
+ },
3182
+ "definitions": {
3183
+ "schemaArray": {
3184
+ "type": "array",
3185
+ "items": {"$ref": "#"}
3186
+ },
3187
+ "linkDescription": {
3188
+ "title": "Link Description Object",
3189
+ "type": "object",
3190
+ "required": ["href", "rel"],
3191
+ "properties": {
3192
+ "href": {
3193
+ "description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
3194
+ "type": "string"
3195
+ },
3196
+ "rel": {
3197
+ "description": "relation to the target resource of the link",
3198
+ "type": "string"
3199
+ },
3200
+ "title": {
3201
+ "description": "a title for the link",
3202
+ "type": "string"
3203
+ },
3204
+ "targetSchema": {
3205
+ "description": "JSON Schema describing the link target",
3206
+ "$ref": "#"
3207
+ },
3208
+ "mediaType": {
3209
+ "description": "media type (as defined by RFC 2046) describing the link target",
3210
+ "type": "string"
3211
+ },
3212
+ "method": {
3213
+ "description": "method for requesting the target of the link (e.g. for HTTP this might be \\"GET\\" or \\"DELETE\\")",
3214
+ "type": "string"
3215
+ },
3216
+ "encType": {
3217
+ "description": "The media type in which to submit data along with the request",
3218
+ "type": "string",
3219
+ "default": "application/json"
3220
+ },
3221
+ "schema": {
3222
+ "description": "Schema describing the data to submit along with the request",
3223
+ "$ref": "#"
3224
+ }
3225
+ }
3226
+ },
3227
+ "readOnly": {
3228
+ "description": "If true, indicates that the value of this property is controlled by the server.",
3229
+ "type": "boolean",
3230
+ "default": false
3231
+ }
3232
+ },
3233
+ "links": [
3234
+ {
3235
+ "rel": "self",
3236
+ "href": "{+id}"
3237
+ },
3238
+ {
3239
+ "rel": "full",
3240
+ "href": "{+($ref)}"
3241
+ }
3242
+ ]
3243
+ }`;
3244
+
3245
+ const { Core: Core$5, Schema: Schema$5 } = lib$1;
3246
+
3247
+
3248
+
3249
+
3250
+
3251
+ // JSON Schema Draft-04
3252
+ const schemaVersion$4 = "http://json-schema.org/draft-04/schema";
3253
+
3254
+ Schema$5.setConfig(schemaVersion$4, "baseToken", "id");
3255
+ Schema$5.setConfig(schemaVersion$4, "embeddedToken", "id");
3256
+ Schema$5.setConfig(schemaVersion$4, "anchorToken", "id");
3257
+ Schema$5.setConfig(schemaVersion$4, "jrefToken", "$ref");
3258
+
3259
+ Schema$5.add(JSON.parse(schema$4));
3260
+ Core$5.defineVocabulary(schemaVersion$4, {
3261
+ "validate": keywords.validate,
3262
+ "additionalItems": keywords.additionalItems,
3263
+ "additionalProperties": keywords.additionalProperties,
3264
+ "allOf": keywords.allOf,
3265
+ "anyOf": keywords.anyOf,
3266
+ "default": keywords.metaData,
3267
+ "definitions": keywords.definitions,
3268
+ "dependencies": keywords.dependencies,
3269
+ "description": keywords.metaData,
3270
+ "enum": keywords.enum,
3271
+ "format": keywords.metaData,
3272
+ "items": keywords.items,
3273
+ "maxItems": keywords.maxItems,
3274
+ "maxLength": keywords.maxLength,
3275
+ "maxProperties": keywords.maxProperties,
3276
+ "maximum": keywords.maximumExclusiveMaximum,
3277
+ "minItems": keywords.minItems,
3278
+ "minLength": keywords.minLength,
3279
+ "minProperties": keywords.minProperties,
3280
+ "minimum": keywords.minimumExclusiveMinimum,
3281
+ "multipleOf": keywords.multipleOf,
3282
+ "not": keywords.not,
3283
+ "oneOf": keywords.oneOf,
3284
+ "pattern": keywords.pattern,
3285
+ "patternProperties": keywords.patternProperties,
3286
+ "properties": keywords.properties,
3287
+ "required": keywords.required,
3288
+ "title": keywords.metaData,
3289
+ "type": keywords.type,
3290
+ "uniqueItems": keywords.uniqueItems
3291
+ });
3292
+
3293
+ // JSON Hyper-Schema Draft-04
3294
+ const hyperSchemaVersion = "http://json-schema.org/draft-04/hyper-schema";
3295
+
3296
+ Schema$5.setConfig(hyperSchemaVersion, "baseToken", "id");
3297
+ Schema$5.setConfig(hyperSchemaVersion, "embeddedToken", "id");
3298
+ Schema$5.setConfig(hyperSchemaVersion, "anchorToken", "id");
3299
+ Schema$5.setConfig(hyperSchemaVersion, "jrefToken", "$ref");
3300
+
3301
+ Schema$5.add(JSON.parse(hyperSchema));
3302
+ Core$5.defineVocabulary(hyperSchemaVersion, {
3303
+ "validate": keywords.validate,
3304
+ "additionalItems": keywords.additionalItems,
3305
+ "additionalProperties": keywords.additionalProperties,
3306
+ "allOf": keywords.allOf,
3307
+ "anyOf": keywords.anyOf,
3308
+ "default": keywords.metaData,
3309
+ "definitions": keywords.definitions,
3310
+ "dependencies": keywords.dependencies,
3311
+ "description": keywords.metaData,
3312
+ "enum": keywords.enum,
3313
+ "format": keywords.metaData,
3314
+ "fragmentResolution": keywords.metaData,
3315
+ "items": keywords.items,
3316
+ "maxItems": keywords.maxItems,
3317
+ "minProperties": keywords.minProperties,
3318
+ "maxProperties": keywords.maxProperties,
3319
+ "maximum": keywords.maximumExclusiveMaximum,
3320
+ "media": keywords.metaData,
3321
+ "minItems": keywords.minItems,
3322
+ "minLength": keywords.minLength,
3323
+ "maxLength": keywords.maxLength,
3324
+ "minimum": keywords.minimumExclusiveMinimum,
3325
+ "multipleOf": keywords.multipleOf,
3326
+ "links": keywords.metaData,
3327
+ "not": keywords.not,
3328
+ "oneOf": keywords.oneOf,
3329
+ "pathStart": keywords.metaData,
3330
+ "pattern": keywords.pattern,
3331
+ "patternProperties": keywords.patternProperties,
3332
+ "properties": keywords.properties,
3333
+ "readOnly": keywords.metaData,
3334
+ "required": keywords.required,
3335
+ "title": keywords.metaData,
3336
+ "type": keywords.type,
3337
+ "uniqueItems": keywords.uniqueItems
3338
+ });
3339
+
3340
+ var schema$3 = `{
3341
+ "$schema": "http://json-schema.org/draft-06/schema#",
3342
+ "$id": "http://json-schema.org/draft-06/schema#",
3343
+ "title": "Core schema meta-schema",
3344
+ "definitions": {
3345
+ "schemaArray": {
3346
+ "type": "array",
3347
+ "minItems": 1,
3348
+ "items": { "$ref": "#" }
3349
+ },
3350
+ "nonNegativeInteger": {
3351
+ "type": "integer",
3352
+ "minimum": 0
3353
+ },
3354
+ "nonNegativeIntegerDefault0": {
3355
+ "allOf": [
3356
+ { "$ref": "#/definitions/nonNegativeInteger" },
3357
+ { "default": 0 }
3358
+ ]
3359
+ },
3360
+ "simpleTypes": {
3361
+ "enum": [
3362
+ "array",
3363
+ "boolean",
3364
+ "integer",
3365
+ "null",
3366
+ "number",
3367
+ "object",
3368
+ "string"
3369
+ ]
3370
+ },
3371
+ "stringArray": {
3372
+ "type": "array",
3373
+ "items": { "type": "string" },
3374
+ "uniqueItems": true,
3375
+ "default": []
3376
+ }
3377
+ },
3378
+ "type": ["object", "boolean"],
3379
+ "properties": {
3380
+ "$id": {
3381
+ "type": "string",
3382
+ "format": "uri-reference"
3383
+ },
3384
+ "$schema": {
3385
+ "type": "string",
3386
+ "format": "uri"
3387
+ },
3388
+ "$ref": {
3389
+ "type": "string",
3390
+ "format": "uri-reference"
3391
+ },
3392
+ "title": {
3393
+ "type": "string"
3394
+ },
3395
+ "description": {
3396
+ "type": "string"
3397
+ },
3398
+ "default": {},
3399
+ "examples": {
3400
+ "type": "array",
3401
+ "items": {}
3402
+ },
3403
+ "multipleOf": {
3404
+ "type": "number",
3405
+ "exclusiveMinimum": 0
3406
+ },
3407
+ "maximum": {
3408
+ "type": "number"
3409
+ },
3410
+ "exclusiveMaximum": {
3411
+ "type": "number"
3412
+ },
3413
+ "minimum": {
3414
+ "type": "number"
3415
+ },
3416
+ "exclusiveMinimum": {
3417
+ "type": "number"
3418
+ },
3419
+ "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
3420
+ "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3421
+ "pattern": {
3422
+ "type": "string",
3423
+ "format": "regex"
3424
+ },
3425
+ "additionalItems": { "$ref": "#" },
3426
+ "items": {
3427
+ "anyOf": [
3428
+ { "$ref": "#" },
3429
+ { "$ref": "#/definitions/schemaArray" }
3430
+ ],
3431
+ "default": {}
3432
+ },
3433
+ "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
3434
+ "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3435
+ "uniqueItems": {
3436
+ "type": "boolean",
3437
+ "default": false
3438
+ },
3439
+ "contains": { "$ref": "#" },
3440
+ "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
3441
+ "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3442
+ "required": { "$ref": "#/definitions/stringArray" },
3443
+ "additionalProperties": { "$ref": "#" },
3444
+ "definitions": {
3445
+ "type": "object",
3446
+ "additionalProperties": { "$ref": "#" },
3447
+ "default": {}
3448
+ },
3449
+ "properties": {
3450
+ "type": "object",
3451
+ "additionalProperties": { "$ref": "#" },
3452
+ "default": {}
3453
+ },
3454
+ "patternProperties": {
3455
+ "type": "object",
3456
+ "additionalProperties": { "$ref": "#" },
3457
+ "default": {}
3458
+ },
3459
+ "dependencies": {
3460
+ "type": "object",
3461
+ "additionalProperties": {
3462
+ "anyOf": [
3463
+ { "$ref": "#" },
3464
+ { "$ref": "#/definitions/stringArray" }
3465
+ ]
3466
+ }
3467
+ },
3468
+ "propertyNames": { "$ref": "#" },
3469
+ "const": {},
3470
+ "enum": {
3471
+ "type": "array",
3472
+ "minItems": 1,
3473
+ "uniqueItems": true
3474
+ },
3475
+ "type": {
3476
+ "anyOf": [
3477
+ { "$ref": "#/definitions/simpleTypes" },
3478
+ {
3479
+ "type": "array",
3480
+ "items": { "$ref": "#/definitions/simpleTypes" },
3481
+ "minItems": 1,
3482
+ "uniqueItems": true
3483
+ }
3484
+ ]
3485
+ },
3486
+ "format": { "type": "string" },
3487
+ "allOf": { "$ref": "#/definitions/schemaArray" },
3488
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
3489
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
3490
+ "not": { "$ref": "#" }
3491
+ },
3492
+ "default": {}
3493
+ }`;
3494
+
3495
+ const { Core: Core$4, Schema: Schema$4 } = lib$1;
3496
+
3497
+
3498
+
3499
+
3500
+ const schemaVersion$3 = "http://json-schema.org/draft-06/schema";
3501
+
3502
+ Schema$4.setConfig(schemaVersion$3, "baseToken", "$id");
3503
+ Schema$4.setConfig(schemaVersion$3, "embeddedToken", "$id");
3504
+ Schema$4.setConfig(schemaVersion$3, "anchorToken", "$id");
3505
+ Schema$4.setConfig(schemaVersion$3, "jrefToken", "$ref");
3506
+
3507
+ Schema$4.add(JSON.parse(schema$3));
3508
+ Core$4.defineVocabulary(schemaVersion$3, {
3509
+ "validate": keywords.validate,
3510
+ "additionalItems": keywords.additionalItems6,
3511
+ "additionalProperties": keywords.additionalProperties6,
3512
+ "allOf": keywords.allOf,
3513
+ "anyOf": keywords.anyOf,
3514
+ "const": keywords.const,
3515
+ "contains": keywords.contains,
3516
+ "default": keywords.metaData,
3517
+ "definitions": keywords.definitions,
3518
+ "dependencies": keywords.dependencies,
3519
+ "description": keywords.metaData,
3520
+ "enum": keywords.enum,
3521
+ "examples": keywords.metaData,
3522
+ "exclusiveMaximum": keywords.exclusiveMaximum,
3523
+ "exclusiveMinimum": keywords.exclusiveMinimum,
3524
+ "format": keywords.metaData,
3525
+ "items": keywords.items,
3526
+ "maxItems": keywords.maxItems,
3527
+ "maxLength": keywords.maxLength6,
3528
+ "maxProperties": keywords.maxProperties,
3529
+ "maximum": keywords.maximum,
3530
+ "minItems": keywords.minItems,
3531
+ "minLength": keywords.minLength6,
3532
+ "minProperties": keywords.minProperties,
3533
+ "minimum": keywords.minimum,
3534
+ "multipleOf": keywords.multipleOf,
3535
+ "not": keywords.not,
3536
+ "oneOf": keywords.oneOf,
3537
+ "pattern": keywords.pattern,
3538
+ "patternProperties": keywords.patternProperties,
3539
+ "properties": keywords.properties,
3540
+ "propertyNames": keywords.propertyNames,
3541
+ "required": keywords.required,
3542
+ "title": keywords.metaData,
3543
+ "type": keywords.type,
3544
+ "uniqueItems": keywords.uniqueItems
3545
+ });
3546
+
3547
+ var schema$2 = `{
3548
+ "$schema": "http://json-schema.org/draft-07/schema#",
3549
+ "$id": "http://json-schema.org/draft-07/schema#",
3550
+ "title": "Core schema meta-schema",
3551
+ "definitions": {
3552
+ "schemaArray": {
3553
+ "type": "array",
3554
+ "minItems": 1,
3555
+ "items": { "$ref": "#" }
3556
+ },
3557
+ "nonNegativeInteger": {
3558
+ "type": "integer",
3559
+ "minimum": 0
3560
+ },
3561
+ "nonNegativeIntegerDefault0": {
3562
+ "allOf": [
3563
+ { "$ref": "#/definitions/nonNegativeInteger" },
3564
+ { "default": 0 }
3565
+ ]
3566
+ },
3567
+ "simpleTypes": {
3568
+ "enum": [
3569
+ "array",
3570
+ "boolean",
3571
+ "integer",
3572
+ "null",
3573
+ "number",
3574
+ "object",
3575
+ "string"
3576
+ ]
3577
+ },
3578
+ "stringArray": {
3579
+ "type": "array",
3580
+ "items": { "type": "string" },
3581
+ "uniqueItems": true,
3582
+ "default": []
3583
+ }
3584
+ },
3585
+ "type": ["object", "boolean"],
3586
+ "properties": {
3587
+ "$id": {
3588
+ "type": "string",
3589
+ "format": "uri-reference"
3590
+ },
3591
+ "$schema": {
3592
+ "type": "string",
3593
+ "format": "uri"
3594
+ },
3595
+ "$ref": {
3596
+ "type": "string",
3597
+ "format": "uri-reference"
3598
+ },
3599
+ "$comment": {
3600
+ "type": "string"
3601
+ },
3602
+ "title": {
3603
+ "type": "string"
3604
+ },
3605
+ "description": {
3606
+ "type": "string"
3607
+ },
3608
+ "default": true,
3609
+ "readOnly": {
3610
+ "type": "boolean",
3611
+ "default": false
3612
+ },
3613
+ "writeOnly": {
3614
+ "type": "boolean",
3615
+ "default": false
3616
+ },
3617
+ "examples": {
3618
+ "type": "array",
3619
+ "items": true
3620
+ },
3621
+ "multipleOf": {
3622
+ "type": "number",
3623
+ "exclusiveMinimum": 0
3624
+ },
3625
+ "maximum": {
3626
+ "type": "number"
3627
+ },
3628
+ "exclusiveMaximum": {
3629
+ "type": "number"
3630
+ },
3631
+ "minimum": {
3632
+ "type": "number"
3633
+ },
3634
+ "exclusiveMinimum": {
3635
+ "type": "number"
3636
+ },
3637
+ "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
3638
+ "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3639
+ "pattern": {
3640
+ "type": "string",
3641
+ "format": "regex"
3642
+ },
3643
+ "additionalItems": { "$ref": "#" },
3644
+ "items": {
3645
+ "anyOf": [
3646
+ { "$ref": "#" },
3647
+ { "$ref": "#/definitions/schemaArray" }
3648
+ ],
3649
+ "default": true
3650
+ },
3651
+ "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
3652
+ "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3653
+ "uniqueItems": {
3654
+ "type": "boolean",
3655
+ "default": false
3656
+ },
3657
+ "contains": { "$ref": "#" },
3658
+ "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
3659
+ "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
3660
+ "required": { "$ref": "#/definitions/stringArray" },
3661
+ "additionalProperties": { "$ref": "#" },
3662
+ "definitions": {
3663
+ "type": "object",
3664
+ "additionalProperties": { "$ref": "#" },
3665
+ "default": {}
3666
+ },
3667
+ "properties": {
3668
+ "type": "object",
3669
+ "additionalProperties": { "$ref": "#" },
3670
+ "default": {}
3671
+ },
3672
+ "patternProperties": {
3673
+ "type": "object",
3674
+ "additionalProperties": { "$ref": "#" },
3675
+ "propertyNames": { "format": "regex" },
3676
+ "default": {}
3677
+ },
3678
+ "dependencies": {
3679
+ "type": "object",
3680
+ "additionalProperties": {
3681
+ "anyOf": [
3682
+ { "$ref": "#" },
3683
+ { "$ref": "#/definitions/stringArray" }
3684
+ ]
3685
+ }
3686
+ },
3687
+ "propertyNames": { "$ref": "#" },
3688
+ "const": true,
3689
+ "enum": {
3690
+ "type": "array",
3691
+ "items": true,
3692
+ "minItems": 1,
3693
+ "uniqueItems": true
3694
+ },
3695
+ "type": {
3696
+ "anyOf": [
3697
+ { "$ref": "#/definitions/simpleTypes" },
3698
+ {
3699
+ "type": "array",
3700
+ "items": { "$ref": "#/definitions/simpleTypes" },
3701
+ "minItems": 1,
3702
+ "uniqueItems": true
3703
+ }
3704
+ ]
3705
+ },
3706
+ "format": { "type": "string" },
3707
+ "contentMediaType": { "type": "string" },
3708
+ "contentEncoding": { "type": "string" },
3709
+ "if": { "$ref": "#" },
3710
+ "then": { "$ref": "#" },
3711
+ "else": { "$ref": "#" },
3712
+ "allOf": { "$ref": "#/definitions/schemaArray" },
3713
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
3714
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
3715
+ "not": { "$ref": "#" }
3716
+ },
3717
+ "default": true
3718
+ }`;
3719
+
3720
+ const { Core: Core$3, Schema: Schema$3 } = lib$1;
3721
+
3722
+
3723
+
3724
+
3725
+ const schemaVersion$2 = "http://json-schema.org/draft-07/schema";
3726
+
3727
+ Schema$3.setConfig(schemaVersion$2, "baseToken", "$id");
3728
+ Schema$3.setConfig(schemaVersion$2, "embeddedToken", "$id");
3729
+ Schema$3.setConfig(schemaVersion$2, "anchorToken", "$id");
3730
+ Schema$3.setConfig(schemaVersion$2, "jrefToken", "$ref");
3731
+
3732
+ Schema$3.add(JSON.parse(schema$2));
3733
+ Core$3.defineVocabulary(schemaVersion$2, {
3734
+ "validate": keywords.validate,
3735
+ "additionalItems": keywords.additionalItems6,
3736
+ "additionalProperties": keywords.additionalProperties6,
3737
+ "allOf": keywords.allOf,
3738
+ "anyOf": keywords.anyOf,
3739
+ "const": keywords.const,
3740
+ "contains": keywords.contains,
3741
+ "default": keywords.metaData,
3742
+ "definitions": keywords.definitions,
3743
+ "dependencies": keywords.dependencies,
3744
+ "description": keywords.metaData,
3745
+ "enum": keywords.enum,
3746
+ "exclusiveMaximum": keywords.exclusiveMaximum,
3747
+ "exclusiveMinimum": keywords.exclusiveMinimum,
3748
+ "format": keywords.metaData,
3749
+ "if": keywords.if,
3750
+ "then": keywords.then,
3751
+ "else": keywords.else,
3752
+ "items": keywords.items,
3753
+ "maxItems": keywords.maxItems,
3754
+ "maxLength": keywords.maxLength6,
3755
+ "maxProperties": keywords.maxProperties,
3756
+ "maximum": keywords.maximum,
3757
+ "minItems": keywords.minItems,
3758
+ "minLength": keywords.minLength6,
3759
+ "minProperties": keywords.minProperties,
3760
+ "minimum": keywords.minimum,
3761
+ "multipleOf": keywords.multipleOf,
3762
+ "not": keywords.not,
3763
+ "oneOf": keywords.oneOf,
3764
+ "pattern": keywords.pattern,
3765
+ "patternProperties": keywords.patternProperties,
3766
+ "properties": keywords.properties,
3767
+ "propertyNames": keywords.propertyNames,
3768
+ "readOnly": keywords.metaData,
3769
+ "required": keywords.required,
3770
+ "title": keywords.metaData,
3771
+ "type": keywords.type,
3772
+ "uniqueItems": keywords.uniqueItems,
3773
+ "writeOnly": keywords.metaData
3774
+ });
3775
+
3776
+ var schema$1 = `{
3777
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3778
+ "$id": "https://json-schema.org/draft/2019-09/schema",
3779
+ "$vocabulary": {
3780
+ "https://json-schema.org/draft/2019-09/vocab/core": true,
3781
+ "https://json-schema.org/draft/2019-09/vocab/applicator": true,
3782
+ "https://json-schema.org/draft/2019-09/vocab/validation": true,
3783
+ "https://json-schema.org/draft/2019-09/vocab/meta-data": true,
3784
+ "https://json-schema.org/draft/2019-09/vocab/format": false,
3785
+ "https://json-schema.org/draft/2019-09/vocab/content": true
3786
+ },
3787
+ "$recursiveAnchor": true,
3788
+
3789
+ "title": "Core and Validation specifications meta-schema",
3790
+ "allOf": [
3791
+ {"$ref": "meta/core"},
3792
+ {"$ref": "meta/applicator"},
3793
+ {"$ref": "meta/validation"},
3794
+ {"$ref": "meta/meta-data"},
3795
+ {"$ref": "meta/format"},
3796
+ {"$ref": "meta/content"}
3797
+ ],
3798
+ "type": ["object", "boolean"],
3799
+ "properties": {
3800
+ "definitions": {
3801
+ "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",
3802
+ "type": "object",
3803
+ "additionalProperties": { "$recursiveRef": "#" },
3804
+ "default": {}
3805
+ },
3806
+ "dependencies": {
3807
+ "$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",
3808
+ "type": "object",
3809
+ "additionalProperties": {
3810
+ "anyOf": [
3811
+ { "$recursiveRef": "#" },
3812
+ { "$ref": "meta/validation#/$defs/stringArray" }
3813
+ ]
3814
+ }
3815
+ }
3816
+ }
3817
+ }`;
3818
+
3819
+ var core$1 = `{
3820
+ "$id": "https://json-schema.org/draft/2019-09/meta/core",
3821
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3822
+ "$vocabulary": {
3823
+ "https://json-schema.org/draft/2019-09/vocab/core": true
3824
+ },
3825
+ "$recursiveAnchor": true,
3826
+
3827
+ "title": "Core vocabulary meta-schema",
3828
+ "type": ["object", "boolean"],
3829
+ "properties": {
3830
+ "$id": {
3831
+ "type": "string",
3832
+ "format": "uri-reference",
3833
+ "$comment": "Non-empty fragments not allowed.",
3834
+ "pattern": "^[^#]*#?$"
3835
+ },
3836
+ "$schema": {
3837
+ "type": "string",
3838
+ "format": "uri"
3839
+ },
3840
+ "$anchor": {
3841
+ "type": "string",
3842
+ "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$"
3843
+ },
3844
+ "$ref": {
3845
+ "type": "string",
3846
+ "format": "uri-reference"
3847
+ },
3848
+ "$recursiveRef": {
3849
+ "type": "string",
3850
+ "format": "uri-reference"
3851
+ },
3852
+ "$recursiveAnchor": {
3853
+ "type": "boolean",
3854
+ "default": false
3855
+ },
3856
+ "$vocabulary": {
3857
+ "type": "object",
3858
+ "propertyNames": {
3859
+ "type": "string",
3860
+ "format": "uri"
3861
+ },
3862
+ "additionalProperties": {
3863
+ "type": "boolean"
3864
+ }
3865
+ },
3866
+ "$comment": {
3867
+ "type": "string"
3868
+ },
3869
+ "$defs": {
3870
+ "type": "object",
3871
+ "additionalProperties": { "$recursiveRef": "#" },
3872
+ "default": {}
3873
+ }
3874
+ }
3875
+ }`;
3876
+
3877
+ var applicator$1 = `{
3878
+ "$id": "https://json-schema.org/draft/2019-09/meta/applicator",
3879
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3880
+ "$vocabulary": {
3881
+ "https://json-schema.org/draft/2019-09/vocab/applicator": true
3882
+ },
3883
+ "$recursiveAnchor": true,
3884
+
3885
+ "title": "Applicator vocabulary meta-schema",
3886
+ "properties": {
3887
+ "additionalItems": { "$recursiveRef": "#" },
3888
+ "unevaluatedItems": { "$recursiveRef": "#" },
3889
+ "items": {
3890
+ "anyOf": [
3891
+ { "$recursiveRef": "#" },
3892
+ { "$ref": "#/$defs/schemaArray" }
3893
+ ]
3894
+ },
3895
+ "contains": { "$recursiveRef": "#" },
3896
+ "additionalProperties": { "$recursiveRef": "#" },
3897
+ "unevaluatedProperties": { "$recursiveRef": "#" },
3898
+ "properties": {
3899
+ "type": "object",
3900
+ "additionalProperties": { "$recursiveRef": "#" },
3901
+ "default": {}
3902
+ },
3903
+ "patternProperties": {
3904
+ "type": "object",
3905
+ "additionalProperties": { "$recursiveRef": "#" },
3906
+ "propertyNames": { "format": "regex" },
3907
+ "default": {}
3908
+ },
3909
+ "dependentSchemas": {
3910
+ "type": "object",
3911
+ "additionalProperties": {
3912
+ "$recursiveRef": "#"
3913
+ }
3914
+ },
3915
+ "propertyNames": { "$recursiveRef": "#" },
3916
+ "if": { "$recursiveRef": "#" },
3917
+ "then": { "$recursiveRef": "#" },
3918
+ "else": { "$recursiveRef": "#" },
3919
+ "allOf": { "$ref": "#/$defs/schemaArray" },
3920
+ "anyOf": { "$ref": "#/$defs/schemaArray" },
3921
+ "oneOf": { "$ref": "#/$defs/schemaArray" },
3922
+ "not": { "$recursiveRef": "#" }
3923
+ },
3924
+ "$defs": {
3925
+ "schemaArray": {
3926
+ "type": "array",
3927
+ "minItems": 1,
3928
+ "items": { "$recursiveRef": "#" }
3929
+ }
3930
+ }
3931
+ }`;
3932
+
3933
+ var validation$1 = `{
3934
+ "$id": "https://json-schema.org/draft/2019-09/meta/validation",
3935
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3936
+ "$vocabulary": {
3937
+ "https://json-schema.org/draft/2019-09/vocab/validation": true
3938
+ },
3939
+ "$recursiveAnchor": true,
3940
+
3941
+ "title": "Validation vocabulary meta-schema",
3942
+ "type": ["object", "boolean"],
3943
+ "properties": {
3944
+ "multipleOf": {
3945
+ "type": "number",
3946
+ "exclusiveMinimum": 0
3947
+ },
3948
+ "maximum": {
3949
+ "type": "number"
3950
+ },
3951
+ "exclusiveMaximum": {
3952
+ "type": "number"
3953
+ },
3954
+ "minimum": {
3955
+ "type": "number"
3956
+ },
3957
+ "exclusiveMinimum": {
3958
+ "type": "number"
3959
+ },
3960
+ "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
3961
+ "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
3962
+ "pattern": {
3963
+ "type": "string",
3964
+ "format": "regex"
3965
+ },
3966
+ "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
3967
+ "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
3968
+ "uniqueItems": {
3969
+ "type": "boolean",
3970
+ "default": false
3971
+ },
3972
+ "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
3973
+ "minContains": {
3974
+ "$ref": "#/$defs/nonNegativeInteger",
3975
+ "default": 1
3976
+ },
3977
+ "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
3978
+ "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
3979
+ "required": { "$ref": "#/$defs/stringArray" },
3980
+ "dependentRequired": {
3981
+ "type": "object",
3982
+ "additionalProperties": {
3983
+ "$ref": "#/$defs/stringArray"
3984
+ }
3985
+ },
3986
+ "const": true,
3987
+ "enum": {
3988
+ "type": "array",
3989
+ "items": true
3990
+ },
3991
+ "type": {
3992
+ "anyOf": [
3993
+ { "$ref": "#/$defs/simpleTypes" },
3994
+ {
3995
+ "type": "array",
3996
+ "items": { "$ref": "#/$defs/simpleTypes" },
3997
+ "minItems": 1,
3998
+ "uniqueItems": true
3999
+ }
4000
+ ]
4001
+ }
4002
+ },
4003
+ "$defs": {
4004
+ "nonNegativeInteger": {
4005
+ "type": "integer",
4006
+ "minimum": 0
4007
+ },
4008
+ "nonNegativeIntegerDefault0": {
4009
+ "$ref": "#/$defs/nonNegativeInteger",
4010
+ "default": 0
4011
+ },
4012
+ "simpleTypes": {
4013
+ "enum": [
4014
+ "array",
4015
+ "boolean",
4016
+ "integer",
4017
+ "null",
4018
+ "number",
4019
+ "object",
4020
+ "string"
4021
+ ]
4022
+ },
4023
+ "stringArray": {
4024
+ "type": "array",
4025
+ "items": { "type": "string" },
4026
+ "uniqueItems": true,
4027
+ "default": []
4028
+ }
4029
+ }
4030
+ }`;
4031
+
4032
+ var metaData$1 = `{
4033
+ "$id": "https://json-schema.org/draft/2019-09/meta/meta-data",
4034
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
4035
+ "$vocabulary": {
4036
+ "https://json-schema.org/draft/2019-09/vocab/meta-data": true
4037
+ },
4038
+ "$recursiveAnchor": true,
4039
+
4040
+ "title": "Meta-data vocabulary meta-schema",
4041
+
4042
+ "type": ["object", "boolean"],
4043
+ "properties": {
4044
+ "title": {
4045
+ "type": "string"
4046
+ },
4047
+ "description": {
4048
+ "type": "string"
4049
+ },
4050
+ "default": true,
4051
+ "deprecated": {
4052
+ "type": "boolean",
4053
+ "default": false
4054
+ },
4055
+ "readOnly": {
4056
+ "type": "boolean",
4057
+ "default": false
4058
+ },
4059
+ "writeOnly": {
4060
+ "type": "boolean",
4061
+ "default": false
4062
+ },
4063
+ "examples": {
4064
+ "type": "array",
4065
+ "items": true
4066
+ }
4067
+ }
4068
+ }`;
4069
+
4070
+ var format = `{
4071
+ "$id": "https://json-schema.org/draft/2019-09/meta/format",
4072
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
4073
+ "$vocabulary": {
4074
+ "https://json-schema.org/draft/2019-09/vocab/format": true
4075
+ },
4076
+ "$recursiveAnchor": true,
4077
+
4078
+ "title": "Format vocabulary meta-schema",
4079
+ "type": ["object", "boolean"],
4080
+ "properties": {
4081
+ "format": { "type": "string" }
4082
+ }
4083
+ }`;
4084
+
4085
+ var content$1 = `{
4086
+ "$id": "https://json-schema.org/draft/2019-09/meta/content",
4087
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
4088
+ "$vocabulary": {
4089
+ "https://json-schema.org/draft/2019-09/vocab/content": true
4090
+ },
4091
+ "$recursiveAnchor": true,
4092
+
4093
+ "title": "Content vocabulary meta-schema",
4094
+
4095
+ "type": ["object", "boolean"],
4096
+ "properties": {
4097
+ "contentMediaType": { "type": "string" },
4098
+ "contentEncoding": { "type": "string" },
4099
+ "contentSchema": { "$recursiveRef": "#" }
4100
+ }
4101
+ }`;
4102
+
4103
+ const { Core: Core$2, Schema: Schema$2 } = lib$1;
4104
+
4105
+
4106
+
4107
+
4108
+
4109
+
4110
+
4111
+
4112
+
4113
+
4114
+ const schemaVersion$1 = "https://json-schema.org/draft/2019-09/schema";
4115
+
4116
+ Schema$2.setConfig(schemaVersion$1, "baseToken", "$id");
4117
+ Schema$2.setConfig(schemaVersion$1, "embeddedToken", "$id");
4118
+ Schema$2.setConfig(schemaVersion$1, "anchorToken", "$anchor");
4119
+ Schema$2.setConfig(schemaVersion$1, "recursiveAnchorToken", "$recursiveAnchor");
4120
+ Schema$2.setConfig(schemaVersion$1, "vocabularyToken", "$vocabulary");
4121
+ Schema$2.setConfig(schemaVersion$1, "mandatoryVocabularies", ["https://json-schema.org/draft/2019-09/vocab/core"]);
4122
+
4123
+ Schema$2.add(JSON.parse(schema$1));
4124
+
4125
+ Schema$2.add(JSON.parse(core$1));
4126
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/core", {
4127
+ "validate": keywords.validate,
4128
+ "$defs": keywords.definitions,
4129
+ "$recursiveRef": keywords.dynamicRef,
4130
+ "$ref": keywords.ref
4131
+ });
4132
+
4133
+ Schema$2.add(JSON.parse(applicator$1));
4134
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/applicator", {
4135
+ "additionalItems": keywords.additionalItems6,
4136
+ "additionalProperties": keywords.additionalProperties6,
4137
+ "allOf": keywords.allOf,
4138
+ "anyOf": keywords.anyOf,
4139
+ "contains": keywords.containsMinContainsMaxContains,
4140
+ "dependentSchemas": keywords.dependentSchemas,
4141
+ "if": keywords.if,
4142
+ "then": keywords.then,
4143
+ "else": keywords.else,
4144
+ "items": keywords.items,
4145
+ "not": keywords.not,
4146
+ "oneOf": keywords.oneOf,
4147
+ "patternProperties": keywords.patternProperties,
4148
+ "properties": keywords.properties,
4149
+ "propertyNames": keywords.propertyNames,
4150
+ "unevaluatedItems": keywords.unevaluatedItems,
4151
+ "unevaluatedProperties": keywords.unevaluatedProperties
4152
+ });
4153
+
4154
+ Schema$2.add(JSON.parse(validation$1));
4155
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/validation", {
4156
+ "const": keywords.const,
4157
+ "dependentRequired": keywords.dependentRequired,
4158
+ "enum": keywords.enum,
4159
+ "exclusiveMaximum": keywords.exclusiveMaximum,
4160
+ "exclusiveMinimum": keywords.exclusiveMinimum,
4161
+ "maxItems": keywords.maxItems,
4162
+ "maxLength": keywords.maxLength6,
4163
+ "maxProperties": keywords.maxProperties,
4164
+ "maximum": keywords.maximum,
4165
+ "minItems": keywords.minItems,
4166
+ "minLength": keywords.minLength6,
4167
+ "minProperties": keywords.minProperties,
4168
+ "minimum": keywords.minimum,
4169
+ "multipleOf": keywords.multipleOf,
4170
+ "pattern": keywords.pattern,
4171
+ "required": keywords.required,
4172
+ "type": keywords.type,
4173
+ "uniqueItems": keywords.uniqueItems
4174
+ });
4175
+
4176
+ Schema$2.add(JSON.parse(metaData$1));
4177
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/meta-data", {
4178
+ "default": keywords.metaData,
4179
+ "deprecated": keywords.metaData,
4180
+ "description": keywords.metaData,
4181
+ "examples": keywords.metaData,
4182
+ "readOnly": keywords.metaData,
4183
+ "title": keywords.metaData,
4184
+ "writeOnly": keywords.metaData
4185
+ });
4186
+
4187
+ Schema$2.add(JSON.parse(format));
4188
+
4189
+ Schema$2.add(JSON.parse(content$1));
4190
+ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/content", {
4191
+ "contentEncoding": keywords.metaData,
4192
+ "contentMediaType": keywords.metaData,
4193
+ "contentSchema": keywords.metaData
4194
+ });
4195
+
4196
+ var schema = `{
4197
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4198
+ "$id": "https://json-schema.org/draft/2020-12/schema",
4199
+ "$vocabulary": {
4200
+ "https://json-schema.org/draft/2020-12/vocab/core": true,
4201
+ "https://json-schema.org/draft/2020-12/vocab/applicator": true,
4202
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
4203
+ "https://json-schema.org/draft/2020-12/vocab/validation": true,
4204
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": true,
4205
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
4206
+ "https://json-schema.org/draft/2020-12/vocab/content": true
4207
+ },
4208
+ "$dynamicAnchor": "meta",
4209
+
4210
+ "title": "Core and Validation specifications meta-schema",
4211
+ "allOf": [
4212
+ {"$ref": "meta/core"},
4213
+ {"$ref": "meta/applicator"},
4214
+ {"$ref": "meta/unevaluated"},
4215
+ {"$ref": "meta/validation"},
4216
+ {"$ref": "meta/meta-data"},
4217
+ {"$ref": "meta/format-annotation"},
4218
+ {"$ref": "meta/content"}
4219
+ ],
4220
+ "type": ["object", "boolean"],
4221
+ "properties": {
4222
+ "definitions": {
4223
+ "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",
4224
+ "type": "object",
4225
+ "additionalProperties": { "$dynamicRef": "#meta" },
4226
+ "default": {}
4227
+ },
4228
+ "dependencies": {
4229
+ "$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",
4230
+ "type": "object",
4231
+ "additionalProperties": {
4232
+ "anyOf": [
4233
+ { "$dynamicRef": "#meta" },
4234
+ { "$ref": "meta/validation#/$defs/stringArray" }
4235
+ ]
4236
+ }
4237
+ }
4238
+ }
4239
+ }`;
4240
+
4241
+ var core = `{
4242
+ "$id": "https://json-schema.org/draft/2020-12/meta/core",
4243
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4244
+ "$vocabulary": {
4245
+ "https://json-schema.org/draft/2020-12/vocab/core": true
4246
+ },
4247
+ "$dynamicAnchor": "meta",
4248
+
4249
+ "title": "Core vocabulary meta-schema",
4250
+ "type": ["object", "boolean"],
4251
+ "properties": {
4252
+ "$id": {
4253
+ "type": "string",
4254
+ "format": "uri-reference",
4255
+ "$comment": "Non-empty fragments not allowed.",
4256
+ "pattern": "^[^#]*#?$"
4257
+ },
4258
+ "$schema": {
4259
+ "type": "string",
4260
+ "format": "uri"
4261
+ },
4262
+ "$anchor": {
4263
+ "type": "string",
4264
+ "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
4265
+ },
4266
+ "$ref": {
4267
+ "type": "string",
4268
+ "format": "uri-reference"
4269
+ },
4270
+ "$dynamicRef": {
4271
+ "type": "string",
4272
+ "format": "uri-reference"
4273
+ },
4274
+ "$dynamicAnchor": {
4275
+ "type": "string",
4276
+ "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
4277
+ },
4278
+ "$vocabulary": {
4279
+ "type": "object",
4280
+ "propertyNames": {
4281
+ "type": "string",
4282
+ "format": "uri"
4283
+ },
4284
+ "additionalProperties": {
4285
+ "type": "boolean"
4286
+ }
4287
+ },
4288
+ "$comment": {
4289
+ "type": "string"
4290
+ },
4291
+ "$defs": {
4292
+ "type": "object",
4293
+ "additionalProperties": { "$dynamicRef": "#meta" },
4294
+ "default": {}
4295
+ }
4296
+ }
4297
+ }`;
4298
+
4299
+ var applicator = `{
4300
+ "$id": "https://json-schema.org/draft/2020-12/meta/applicator",
4301
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4302
+ "$vocabulary": {
4303
+ "https://json-schema.org/draft/2020-12/vocab/applicator": true
4304
+ },
4305
+ "$dynamicAnchor": "meta",
4306
+
4307
+ "title": "Applicator vocabulary meta-schema",
4308
+ "type": ["object", "boolean"],
4309
+ "properties": {
4310
+ "prefixItems": { "$ref": "#/$defs/schemaArray" },
4311
+ "items": { "$dynamicRef": "#meta" },
4312
+ "contains": { "$dynamicRef": "#meta" },
4313
+ "additionalProperties": { "$dynamicRef": "#meta" },
4314
+ "properties": {
4315
+ "type": "object",
4316
+ "additionalProperties": { "$dynamicRef": "#meta" },
4317
+ "default": {}
4318
+ },
4319
+ "patternProperties": {
4320
+ "type": "object",
4321
+ "additionalProperties": { "$dynamicRef": "#meta" },
4322
+ "propertyNames": { "format": "regex" },
4323
+ "default": {}
4324
+ },
4325
+ "dependentSchemas": {
4326
+ "type": "object",
4327
+ "additionalProperties": {
4328
+ "$dynamicRef": "#meta"
4329
+ }
4330
+ },
4331
+ "propertyNames": { "$dynamicRef": "#meta" },
4332
+ "if": { "$dynamicRef": "#meta" },
4333
+ "then": { "$dynamicRef": "#meta" },
4334
+ "else": { "$dynamicRef": "#meta" },
4335
+ "allOf": { "$ref": "#/$defs/schemaArray" },
4336
+ "anyOf": { "$ref": "#/$defs/schemaArray" },
4337
+ "oneOf": { "$ref": "#/$defs/schemaArray" },
4338
+ "not": { "$dynamicRef": "#meta" }
4339
+ },
4340
+ "$defs": {
4341
+ "schemaArray": {
4342
+ "type": "array",
4343
+ "minItems": 1,
4344
+ "items": { "$dynamicRef": "#meta" }
4345
+ }
4346
+ }
4347
+ }`;
4348
+
4349
+ var validation = `{
4350
+ "$id": "https://json-schema.org/draft/2020-12/meta/validation",
4351
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4352
+ "$vocabulary": {
4353
+ "https://json-schema.org/draft/2020-12/vocab/validation": true
4354
+ },
4355
+ "$dynamicAnchor": "meta",
4356
+
4357
+ "title": "Validation vocabulary meta-schema",
4358
+ "type": ["object", "boolean"],
4359
+ "properties": {
4360
+ "multipleOf": {
4361
+ "type": "number",
4362
+ "exclusiveMinimum": 0
4363
+ },
4364
+ "maximum": {
4365
+ "type": "number"
4366
+ },
4367
+ "exclusiveMaximum": {
4368
+ "type": "number"
4369
+ },
4370
+ "minimum": {
4371
+ "type": "number"
4372
+ },
4373
+ "exclusiveMinimum": {
4374
+ "type": "number"
4375
+ },
4376
+ "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
4377
+ "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
4378
+ "pattern": {
4379
+ "type": "string",
4380
+ "format": "regex"
4381
+ },
4382
+ "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
4383
+ "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
4384
+ "uniqueItems": {
4385
+ "type": "boolean",
4386
+ "default": false
4387
+ },
4388
+ "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
4389
+ "minContains": {
4390
+ "$ref": "#/$defs/nonNegativeInteger",
4391
+ "default": 1
4392
+ },
4393
+ "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
4394
+ "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
4395
+ "required": { "$ref": "#/$defs/stringArray" },
4396
+ "dependentRequired": {
4397
+ "type": "object",
4398
+ "additionalProperties": {
4399
+ "$ref": "#/$defs/stringArray"
4400
+ }
4401
+ },
4402
+ "const": true,
4403
+ "enum": {
4404
+ "type": "array",
4405
+ "items": true
4406
+ },
4407
+ "type": {
4408
+ "anyOf": [
4409
+ { "$ref": "#/$defs/simpleTypes" },
4410
+ {
4411
+ "type": "array",
4412
+ "items": { "$ref": "#/$defs/simpleTypes" },
4413
+ "minItems": 1,
4414
+ "uniqueItems": true
4415
+ }
4416
+ ]
4417
+ }
4418
+ },
4419
+ "$defs": {
4420
+ "nonNegativeInteger": {
4421
+ "type": "integer",
4422
+ "minimum": 0
4423
+ },
4424
+ "nonNegativeIntegerDefault0": {
4425
+ "$ref": "#/$defs/nonNegativeInteger",
4426
+ "default": 0
4427
+ },
4428
+ "simpleTypes": {
4429
+ "enum": [
4430
+ "array",
4431
+ "boolean",
4432
+ "integer",
4433
+ "null",
4434
+ "number",
4435
+ "object",
4436
+ "string"
4437
+ ]
4438
+ },
4439
+ "stringArray": {
4440
+ "type": "array",
4441
+ "items": { "type": "string" },
4442
+ "uniqueItems": true,
4443
+ "default": []
4444
+ }
4445
+ }
4446
+ }`;
4447
+
4448
+ var metaData = `{
4449
+ "$id": "https://json-schema.org/draft/2020-12/meta/meta-data",
4450
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4451
+ "$vocabulary": {
4452
+ "https://json-schema.org/draft/2020-12/vocab/meta-data": true
4453
+ },
4454
+ "$dynamicAnchor": "meta",
4455
+
4456
+ "title": "Meta-data vocabulary meta-schema",
4457
+
4458
+ "type": ["object", "boolean"],
4459
+ "properties": {
4460
+ "title": {
4461
+ "type": "string"
4462
+ },
4463
+ "description": {
4464
+ "type": "string"
4465
+ },
4466
+ "default": true,
4467
+ "deprecated": {
4468
+ "type": "boolean",
4469
+ "default": false
4470
+ },
4471
+ "readOnly": {
4472
+ "type": "boolean",
4473
+ "default": false
4474
+ },
4475
+ "writeOnly": {
4476
+ "type": "boolean",
4477
+ "default": false
4478
+ },
4479
+ "examples": {
4480
+ "type": "array",
4481
+ "items": true
4482
+ }
4483
+ }
4484
+ }`;
4485
+
4486
+ var formatAnnotation = `{
4487
+ "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",
4488
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4489
+ "$vocabulary": {
4490
+ "https://json-schema.org/draft/2020-12/vocab/format-annotation": true
4491
+ },
4492
+ "$dynamicAnchor": "meta",
4493
+
4494
+ "title": "Format vocabulary meta-schema for annotation results",
4495
+ "type": ["object", "boolean"],
4496
+ "properties": {
4497
+ "format": { "type": "string" }
4498
+ }
4499
+ }`;
4500
+
4501
+ var formatAssertion = `{
4502
+ "$id": "https://json-schema.org/draft/2020-12/meta/format-assertion",
4503
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4504
+ "$vocabulary": {
4505
+ "https://json-schema.org/draft/2020-12/vocab/format-assertion": true
4506
+ },
4507
+ "$dynamicAnchor": "meta",
4508
+
4509
+ "title": "Format vocabulary meta-schema for assertion results",
4510
+ "type": ["object", "boolean"],
4511
+ "properties": {
4512
+ "format": { "type": "string" }
4513
+ }
4514
+ }`;
4515
+
4516
+ var content = `{
4517
+ "$id": "https://json-schema.org/draft/2020-12/meta/content",
4518
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4519
+ "$vocabulary": {
4520
+ "https://json-schema.org/draft/2020-12/vocab/content": true
4521
+ },
4522
+ "$dynamicAnchor": "meta",
4523
+
4524
+ "title": "Content vocabulary meta-schema",
4525
+
4526
+ "type": ["object", "boolean"],
4527
+ "properties": {
4528
+ "contentMediaType": { "type": "string" },
4529
+ "contentEncoding": { "type": "string" },
4530
+ "contentSchema": { "$dynamicRef": "#meta" }
4531
+ }
4532
+ }`;
4533
+
4534
+ var unevaluated = `{
4535
+ "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",
4536
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4537
+ "$vocabulary": {
4538
+ "https://json-schema.org/draft/2020-12/vocab/unevaluated": true
4539
+ },
4540
+ "$dynamicAnchor": "meta",
4541
+
4542
+ "title": "Unevaluated applicator vocabulary meta-schema",
4543
+ "type": ["object", "boolean"],
4544
+ "properties": {
4545
+ "unevaluatedItems": { "$dynamicRef": "#meta" },
4546
+ "unevaluatedProperties": { "$dynamicRef": "#meta" }
4547
+ }
4548
+ }`;
4549
+
4550
+ const { Core: Core$1, Schema: Schema$1 } = lib$1;
4551
+
4552
+
4553
+
4554
+
4555
+
4556
+
4557
+
4558
+
4559
+
4560
+
4561
+
4562
+
4563
+ const schemaVersion = "https://json-schema.org/draft/2020-12/schema";
4564
+
4565
+ Schema$1.setConfig(schemaVersion, "baseToken", "$id");
4566
+ Schema$1.setConfig(schemaVersion, "embeddedToken", "$id");
4567
+ Schema$1.setConfig(schemaVersion, "anchorToken", "$anchor");
4568
+ Schema$1.setConfig(schemaVersion, "dynamicAnchorToken", "$dynamicAnchor");
4569
+ Schema$1.setConfig(schemaVersion, "vocabularyToken", "$vocabulary");
4570
+ Schema$1.setConfig(schemaVersion, "mandatoryVocabularies", ["https://json-schema.org/draft/2020-12/vocab/core"]);
4571
+
4572
+ Schema$1.add(JSON.parse(schema));
4573
+
4574
+ Schema$1.add(JSON.parse(core));
4575
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/core", {
4576
+ "validate": keywords.validate,
4577
+ "$defs": keywords.definitions,
4578
+ "$dynamicRef": keywords.dynamicRef,
4579
+ "$ref": keywords.ref
4580
+ });
4581
+
4582
+ Schema$1.add(JSON.parse(applicator));
4583
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/applicator", {
4584
+ "additionalProperties": keywords.additionalProperties6,
4585
+ "allOf": keywords.allOf,
4586
+ "anyOf": keywords.anyOf,
4587
+ "contains": keywords.containsMinContainsMaxContains,
4588
+ "dependentSchemas": keywords.dependentSchemas,
4589
+ "if": keywords.if,
4590
+ "then": keywords.then,
4591
+ "else": keywords.else,
4592
+ "items": keywords.items202012,
4593
+ "not": keywords.not,
4594
+ "oneOf": keywords.oneOf,
4595
+ "patternProperties": keywords.patternProperties,
4596
+ "prefixItems": keywords.tupleItems,
4597
+ "properties": keywords.properties,
4598
+ "propertyNames": keywords.propertyNames
4599
+ });
4600
+
4601
+ Schema$1.add(JSON.parse(validation));
4602
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/validation", {
4603
+ "const": keywords.const,
4604
+ "dependentRequired": keywords.dependentRequired,
4605
+ "enum": keywords.enum,
4606
+ "exclusiveMaximum": keywords.exclusiveMaximum,
4607
+ "exclusiveMinimum": keywords.exclusiveMinimum,
4608
+ "maxItems": keywords.maxItems,
4609
+ "maxLength": keywords.maxLength6,
4610
+ "maxProperties": keywords.maxProperties,
4611
+ "maximum": keywords.maximum,
4612
+ "minItems": keywords.minItems,
4613
+ "minLength": keywords.minLength6,
4614
+ "minProperties": keywords.minProperties,
4615
+ "minimum": keywords.minimum,
4616
+ "multipleOf": keywords.multipleOf,
4617
+ "pattern": keywords.pattern,
4618
+ "required": keywords.required,
4619
+ "type": keywords.type,
4620
+ "uniqueItems": keywords.uniqueItems
4621
+ });
4622
+
4623
+ Schema$1.add(JSON.parse(metaData));
4624
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/meta-data", {
4625
+ "default": keywords.metaData,
4626
+ "deprecated": keywords.metaData,
4627
+ "description": keywords.metaData,
4628
+ "examples": keywords.metaData,
4629
+ "readOnly": keywords.metaData,
4630
+ "title": keywords.metaData,
4631
+ "writeOnly": keywords.metaData
4632
+ });
4633
+
4634
+ Schema$1.add(JSON.parse(formatAnnotation));
4635
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/format-annotation", {
4636
+ "format": keywords.metaData
4637
+ });
4638
+
4639
+ Schema$1.add(JSON.parse(formatAssertion));
4640
+
4641
+ Schema$1.add(JSON.parse(content));
4642
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/content", {
4643
+ "contentEncoding": keywords.metaData,
4644
+ "contentMediaType": keywords.metaData,
4645
+ "contentSchema": keywords.metaData
4646
+ });
4647
+
4648
+ Schema$1.add(JSON.parse(unevaluated));
4649
+ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/unevaluated", {
4650
+ "unevaluatedItems": keywords.unevaluatedItems,
4651
+ "unevaluatedProperties": keywords.unevaluatedProperties
4652
+ });
4653
+
4654
+ const { Core, Schema, InvalidSchemaError } = lib$1;
4655
+
4656
+
4657
+
4658
+
4659
+
4660
+
4661
+
4662
+
4663
+
4664
+ var lib = {
4665
+ add: Core.add,
4666
+ get: Schema.get,
4667
+ validate: Core.validate,
4668
+ compile: Core.compile,
4669
+ interpret: Core.interpret,
4670
+ setMetaOutputFormat: Core.setMetaOutputFormat,
4671
+ setShouldMetaValidate: Core.setShouldMetaValidate,
4672
+ FLAG: Core.FLAG,
4673
+ BASIC: Core.BASIC,
4674
+ DETAILED: Core.DETAILED,
4675
+ VERBOSE: Core.VERBOSE,
4676
+ Keywords: keywords,
4677
+ InvalidSchemaError: InvalidSchemaError
4678
+ };
4679
+ var lib_1 = lib.add;
4680
+ var lib_2 = lib.get;
4681
+ var lib_3 = lib.validate;
4682
+ var lib_4 = lib.compile;
4683
+ var lib_5 = lib.interpret;
4684
+ var lib_6 = lib.setMetaOutputFormat;
4685
+ var lib_7 = lib.setShouldMetaValidate;
4686
+ var lib_8 = lib.FLAG;
4687
+ var lib_9 = lib.BASIC;
4688
+ var lib_10 = lib.DETAILED;
4689
+ var lib_11 = lib.VERBOSE;
4690
+ var lib_12 = lib.Keywords;
4691
+ var lib_13 = lib.InvalidSchemaError;
4692
+
4693
+ exports.BASIC = lib_9;
4694
+ exports.DETAILED = lib_10;
4695
+ exports.FLAG = lib_8;
4696
+ exports.InvalidSchemaError = lib_13;
4697
+ exports.Keywords = lib_12;
4698
+ exports.VERBOSE = lib_11;
4699
+ exports.add = lib_1;
4700
+ exports.compile = lib_4;
4701
+ exports['default'] = lib;
4702
+ exports.get = lib_2;
4703
+ exports.interpret = lib_5;
4704
+ exports.setMetaOutputFormat = lib_6;
4705
+ exports.setShouldMetaValidate = lib_7;
4706
+ exports.validate = lib_3;
4707
+
4708
+ Object.defineProperty(exports, '__esModule', { value: true });
4709
+
4710
+ return exports;
4711
+
4712
+ }({}));
4713
+ //# sourceMappingURL=json-schema-iife.js.map