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