@swagger-api/apidom-parser-adapter-openapi-yaml-3-1 1.0.0-beta.31 → 1.0.0-beta.33

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.
@@ -292,6 +292,36 @@ class MediaTypeExamples extends _swagger_api_apidom_core__WEBPACK_IMPORTED_MODUL
292
292
 
293
293
  /***/ }),
294
294
 
295
+ /***/ 675:
296
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
297
+
298
+ "use strict";
299
+ __webpack_require__.r(__webpack_exports__);
300
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
301
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
302
+ /* harmony export */ });
303
+ /* harmony import */ var _JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(924);
304
+
305
+ class JSONPointerTypeError extends _JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
306
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JSONPointerTypeError);
307
+
308
+ /***/ }),
309
+
310
+ /***/ 924:
311
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
312
+
313
+ "use strict";
314
+ __webpack_require__.r(__webpack_exports__);
315
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
316
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
317
+ /* harmony export */ });
318
+ /* harmony import */ var _JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12008);
319
+
320
+ class JSONPointerEvaluateError extends _JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
321
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JSONPointerEvaluateError);
322
+
323
+ /***/ }),
324
+
295
325
  /***/ 929:
296
326
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
297
327
 
@@ -827,6 +857,21 @@ var nodeUtil = (function() {
827
857
  module.exports = nodeUtil;
828
858
 
829
859
 
860
+ /***/ }),
861
+
862
+ /***/ 2325:
863
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
864
+
865
+ "use strict";
866
+ __webpack_require__.r(__webpack_exports__);
867
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
868
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
869
+ /* harmony export */ });
870
+ /* harmony import */ var _JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(924);
871
+
872
+ class JSONPointerIndexError extends _JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
873
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JSONPointerIndexError);
874
+
830
875
  /***/ }),
831
876
 
832
877
  /***/ 2459:
@@ -1954,6 +1999,32 @@ module.exports = function (argument, $default) {
1954
1999
  };
1955
2000
 
1956
2001
 
2002
+ /***/ }),
2003
+
2004
+ /***/ 4896:
2005
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2006
+
2007
+ "use strict";
2008
+ __webpack_require__.r(__webpack_exports__);
2009
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2010
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2011
+ /* harmony export */ });
2012
+ /* harmony import */ var apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51751);
2013
+ /* harmony import */ var _grammar_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36585);
2014
+
2015
+
2016
+ const grammar = new _grammar_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
2017
+ const parser = new apg_lite__WEBPACK_IMPORTED_MODULE_0__.Parser();
2018
+ const testArrayLocation = referenceToken => {
2019
+ if (typeof referenceToken !== 'string') return false;
2020
+ try {
2021
+ return parser.parse(grammar, 'array-location', referenceToken).success;
2022
+ } catch {
2023
+ return false;
2024
+ }
2025
+ };
2026
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (testArrayLocation);
2027
+
1957
2028
  /***/ }),
1958
2029
 
1959
2030
  /***/ 4930:
@@ -3046,6 +3117,56 @@ class OpenApi3_0Visitor extends (0,ts_mixer__WEBPACK_IMPORTED_MODULE_0__.Mixin)(
3046
3117
 
3047
3118
  /***/ }),
3048
3119
 
3120
+ /***/ 8750:
3121
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
3122
+
3123
+ "use strict";
3124
+ __webpack_require__.r(__webpack_exports__);
3125
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3126
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3127
+ /* harmony export */ });
3128
+ /* harmony import */ var apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51751);
3129
+ /* harmony import */ var _grammar_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(36585);
3130
+ /* harmony import */ var _errors_JSONPointerParseError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26490);
3131
+ /* harmony import */ var _translators_ASTTranslator_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23020);
3132
+ /* harmony import */ var _trace_Trace_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17431);
3133
+
3134
+
3135
+
3136
+
3137
+
3138
+ const grammar = new _grammar_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]();
3139
+ const parse = (jsonPointer, {
3140
+ translator = new _translators_ASTTranslator_mjs__WEBPACK_IMPORTED_MODULE_2__["default"](),
3141
+ stats = false,
3142
+ trace = false
3143
+ } = {}) => {
3144
+ if (typeof jsonPointer !== 'string') {
3145
+ throw new TypeError('JSON Pointer must be a string');
3146
+ }
3147
+ try {
3148
+ const parser = new apg_lite__WEBPACK_IMPORTED_MODULE_0__.Parser();
3149
+ if (translator) parser.ast = translator;
3150
+ if (stats) parser.stats = new apg_lite__WEBPACK_IMPORTED_MODULE_0__.Stats();
3151
+ if (trace) parser.trace = new _trace_Trace_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
3152
+ const result = parser.parse(grammar, 'json-pointer', jsonPointer);
3153
+ return {
3154
+ result,
3155
+ tree: result.success && translator ? parser.ast.getTree() : undefined,
3156
+ stats: parser.stats,
3157
+ trace: parser.trace
3158
+ };
3159
+ } catch (error) {
3160
+ throw new _errors_JSONPointerParseError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]('Unexpected error during JSON Pointer parsing', {
3161
+ cause: error,
3162
+ jsonPointer
3163
+ });
3164
+ }
3165
+ };
3166
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parse);
3167
+
3168
+ /***/ }),
3169
+
3049
3170
  /***/ 8867:
3050
3171
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
3051
3172
 
@@ -4306,6 +4427,57 @@ var isNull = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(null);
4306
4427
 
4307
4428
  /***/ }),
4308
4429
 
4430
+ /***/ 12008:
4431
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
4432
+
4433
+ "use strict";
4434
+ __webpack_require__.r(__webpack_exports__);
4435
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4436
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
4437
+ /* harmony export */ });
4438
+ class JSONPointerError extends Error {
4439
+ constructor(message, options = undefined) {
4440
+ super(message, options);
4441
+ this.name = this.constructor.name;
4442
+ if (typeof message === 'string') {
4443
+ this.message = message;
4444
+ }
4445
+ if (typeof Error.captureStackTrace === 'function') {
4446
+ Error.captureStackTrace(this, this.constructor);
4447
+ } else {
4448
+ this.stack = new Error(message).stack;
4449
+ }
4450
+
4451
+ /**
4452
+ * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
4453
+ * Node.js is >= 16.9.0 supports error causes natively.
4454
+ */
4455
+ if (options != null && typeof options === 'object' && Object.prototype.hasOwnProperty.call(options, 'cause') && !('cause' in this)) {
4456
+ const {
4457
+ cause
4458
+ } = options;
4459
+ this.cause = cause;
4460
+ if (cause instanceof Error && 'stack' in cause) {
4461
+ this.stack = `${this.stack}\nCAUSE: ${cause.stack}`;
4462
+ }
4463
+ }
4464
+
4465
+ /**
4466
+ * Allows to assign arbitrary properties to the error object.
4467
+ */
4468
+ if (options != null && typeof options === 'object') {
4469
+ const {
4470
+ cause,
4471
+ ...causelessOptions
4472
+ } = options;
4473
+ Object.assign(this, causelessOptions);
4474
+ }
4475
+ }
4476
+ }
4477
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JSONPointerError);
4478
+
4479
+ /***/ }),
4480
+
4309
4481
  /***/ 12066:
4310
4482
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
4311
4483
 
@@ -10170,6 +10342,50 @@ visitor, {
10170
10342
 
10171
10343
  /***/ }),
10172
10344
 
10345
+ /***/ 17431:
10346
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
10347
+
10348
+ "use strict";
10349
+ __webpack_require__.r(__webpack_exports__);
10350
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10351
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
10352
+ /* harmony export */ });
10353
+ /* harmony import */ var apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51751);
10354
+ /* harmony import */ var _Expectations_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83421);
10355
+
10356
+
10357
+ class Trace extends apg_lite__WEBPACK_IMPORTED_MODULE_0__.Trace {
10358
+ inferExpectations() {
10359
+ const lines = this.displayTrace().split('\n');
10360
+ const expectations = new Set();
10361
+ let collecting = false;
10362
+ let lastMatchedIndex = -1;
10363
+ for (let i = 0; i < lines.length; i++) {
10364
+ const line = lines[i];
10365
+
10366
+ // capture the max match line (first one that ends in a single character match)
10367
+ if (!collecting && line.includes('M|')) {
10368
+ const textMatch = line.match(/]'(.*)'$/);
10369
+ if (textMatch && textMatch[1]) {
10370
+ lastMatchedIndex = i;
10371
+ }
10372
+ }
10373
+
10374
+ // begin collecting after the deepest successful match
10375
+ if (i > lastMatchedIndex) {
10376
+ const terminalFailMatch = line.match(/N\|\[TLS\(([^)]+)\)]/);
10377
+ if (terminalFailMatch) {
10378
+ expectations.add(terminalFailMatch[1]);
10379
+ }
10380
+ }
10381
+ }
10382
+ return new _Expectations_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](...expectations);
10383
+ }
10384
+ }
10385
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Trace);
10386
+
10387
+ /***/ }),
10388
+
10173
10389
  /***/ 17534:
10174
10390
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
10175
10391
 
@@ -11097,6 +11313,30 @@ function _functionName(f) {
11097
11313
 
11098
11314
  /***/ }),
11099
11315
 
11316
+ /***/ 20439:
11317
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11318
+
11319
+ "use strict";
11320
+ __webpack_require__.r(__webpack_exports__);
11321
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11322
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
11323
+ /* harmony export */ });
11324
+ /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8750);
11325
+
11326
+ const testJSONPointer = jsonPointer => {
11327
+ try {
11328
+ const parseResult = (0,_parse_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(jsonPointer, {
11329
+ translator: null
11330
+ });
11331
+ return parseResult.result.success;
11332
+ } catch {
11333
+ return false;
11334
+ }
11335
+ };
11336
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (testJSONPointer);
11337
+
11338
+ /***/ }),
11339
+
11100
11340
  /***/ 20650:
11101
11341
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11102
11342
 
@@ -11697,6 +11937,32 @@ function isBoolean(value) {
11697
11937
  module.exports = isBoolean;
11698
11938
 
11699
11939
 
11940
+ /***/ }),
11941
+
11942
+ /***/ 22587:
11943
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11944
+
11945
+ "use strict";
11946
+ __webpack_require__.r(__webpack_exports__);
11947
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11948
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
11949
+ /* harmony export */ });
11950
+ /* harmony import */ var apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51751);
11951
+ /* harmony import */ var _grammar_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36585);
11952
+
11953
+
11954
+ const grammar = new _grammar_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
11955
+ const parser = new apg_lite__WEBPACK_IMPORTED_MODULE_0__.Parser();
11956
+ const testArrayIndex = referenceToken => {
11957
+ if (typeof referenceToken !== 'string') return false;
11958
+ try {
11959
+ return parser.parse(grammar, 'array-index', referenceToken).success;
11960
+ } catch {
11961
+ return false;
11962
+ }
11963
+ };
11964
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (testArrayIndex);
11965
+
11700
11966
  /***/ }),
11701
11967
 
11702
11968
  /***/ 22695:
@@ -12655,6 +12921,34 @@ Object.defineProperty(Header.prototype, 'description', {
12655
12921
 
12656
12922
  /***/ }),
12657
12923
 
12924
+ /***/ 23020:
12925
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12926
+
12927
+ "use strict";
12928
+ __webpack_require__.r(__webpack_exports__);
12929
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12930
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
12931
+ /* harmony export */ });
12932
+ /* harmony import */ var _CSTTranslator_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92802);
12933
+ /* harmony import */ var _unescape_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82182);
12934
+
12935
+
12936
+ class ASTTranslator extends _CSTTranslator_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
12937
+ getTree() {
12938
+ const {
12939
+ root
12940
+ } = super.getTree();
12941
+ return root.children.filter(({
12942
+ type
12943
+ }) => type === 'reference-token').map(({
12944
+ text
12945
+ }) => (0,_unescape_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(text));
12946
+ }
12947
+ }
12948
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ASTTranslator);
12949
+
12950
+ /***/ }),
12951
+
12658
12952
  /***/ 23031:
12659
12953
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12660
12954
 
@@ -14300,6 +14594,21 @@ class Schema extends _swagger_api_apidom_ns_json_schema_2020_12__WEBPACK_IMPORTE
14300
14594
 
14301
14595
  /***/ }),
14302
14596
 
14597
+ /***/ 26490:
14598
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14599
+
14600
+ "use strict";
14601
+ __webpack_require__.r(__webpack_exports__);
14602
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14603
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14604
+ /* harmony export */ });
14605
+ /* harmony import */ var _JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12008);
14606
+
14607
+ class JSONPointerParseError extends _JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
14608
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JSONPointerParseError);
14609
+
14610
+ /***/ }),
14611
+
14303
14612
  /***/ 26517:
14304
14613
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14305
14614
 
@@ -14407,6 +14716,24 @@ var path = __webpack_require__(68099);
14407
14716
  module.exports = path.AggregateError;
14408
14717
 
14409
14718
 
14719
+ /***/ }),
14720
+
14721
+ /***/ 27123:
14722
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
14723
+
14724
+ "use strict";
14725
+ __webpack_require__.r(__webpack_exports__);
14726
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14727
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14728
+ /* harmony export */ });
14729
+ const escape = referenceToken => {
14730
+ if (typeof referenceToken !== 'string' && typeof referenceToken !== 'number') {
14731
+ throw new TypeError('Reference token must be a string or number');
14732
+ }
14733
+ return String(referenceToken).replace(/~/g, '~0').replace(/\//g, '~1');
14734
+ };
14735
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (escape);
14736
+
14410
14737
  /***/ }),
14411
14738
 
14412
14739
  /***/ 27488:
@@ -18212,6 +18539,266 @@ const createRefractor = specPath => (value, options = {}) => refract(value, {
18212
18539
 
18213
18540
  /***/ }),
18214
18541
 
18542
+ /***/ 36585:
18543
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
18544
+
18545
+ "use strict";
18546
+ __webpack_require__.r(__webpack_exports__);
18547
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18548
+ /* harmony export */ "default": () => (/* binding */ grammar)
18549
+ /* harmony export */ });
18550
+ // copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved<br>
18551
+ // license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
18552
+ //
18553
+ // Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)
18554
+ function grammar() {
18555
+ // ```
18556
+ // SUMMARY
18557
+ // rules = 8
18558
+ // udts = 0
18559
+ // opcodes = 28
18560
+ // --- ABNF original opcodes
18561
+ // ALT = 5
18562
+ // CAT = 3
18563
+ // REP = 3
18564
+ // RNM = 6
18565
+ // TLS = 5
18566
+ // TBS = 1
18567
+ // TRG = 5
18568
+ // --- SABNF superset opcodes
18569
+ // UDT = 0
18570
+ // AND = 0
18571
+ // NOT = 0
18572
+ // characters = [0 - 1114111]
18573
+ // ```
18574
+ /* OBJECT IDENTIFIER (for internal parser use) */
18575
+ this.grammarObject = 'grammarObject';
18576
+
18577
+ /* RULES */
18578
+ this.rules = [];
18579
+ this.rules[0] = {
18580
+ name: 'json-pointer',
18581
+ lower: 'json-pointer',
18582
+ index: 0,
18583
+ isBkr: false
18584
+ };
18585
+ this.rules[1] = {
18586
+ name: 'reference-token',
18587
+ lower: 'reference-token',
18588
+ index: 1,
18589
+ isBkr: false
18590
+ };
18591
+ this.rules[2] = {
18592
+ name: 'unescaped',
18593
+ lower: 'unescaped',
18594
+ index: 2,
18595
+ isBkr: false
18596
+ };
18597
+ this.rules[3] = {
18598
+ name: 'escaped',
18599
+ lower: 'escaped',
18600
+ index: 3,
18601
+ isBkr: false
18602
+ };
18603
+ this.rules[4] = {
18604
+ name: 'array-location',
18605
+ lower: 'array-location',
18606
+ index: 4,
18607
+ isBkr: false
18608
+ };
18609
+ this.rules[5] = {
18610
+ name: 'array-index',
18611
+ lower: 'array-index',
18612
+ index: 5,
18613
+ isBkr: false
18614
+ };
18615
+ this.rules[6] = {
18616
+ name: 'array-dash',
18617
+ lower: 'array-dash',
18618
+ index: 6,
18619
+ isBkr: false
18620
+ };
18621
+ this.rules[7] = {
18622
+ name: 'slash',
18623
+ lower: 'slash',
18624
+ index: 7,
18625
+ isBkr: false
18626
+ };
18627
+
18628
+ /* UDTS */
18629
+ this.udts = [];
18630
+
18631
+ /* OPCODES */
18632
+ /* json-pointer */
18633
+ this.rules[0].opcodes = [];
18634
+ this.rules[0].opcodes[0] = {
18635
+ type: 3,
18636
+ min: 0,
18637
+ max: Infinity
18638
+ }; // REP
18639
+ this.rules[0].opcodes[1] = {
18640
+ type: 2,
18641
+ children: [2, 3]
18642
+ }; // CAT
18643
+ this.rules[0].opcodes[2] = {
18644
+ type: 4,
18645
+ index: 7
18646
+ }; // RNM(slash)
18647
+ this.rules[0].opcodes[3] = {
18648
+ type: 4,
18649
+ index: 1
18650
+ }; // RNM(reference-token)
18651
+
18652
+ /* reference-token */
18653
+ this.rules[1].opcodes = [];
18654
+ this.rules[1].opcodes[0] = {
18655
+ type: 3,
18656
+ min: 0,
18657
+ max: Infinity
18658
+ }; // REP
18659
+ this.rules[1].opcodes[1] = {
18660
+ type: 1,
18661
+ children: [2, 3]
18662
+ }; // ALT
18663
+ this.rules[1].opcodes[2] = {
18664
+ type: 4,
18665
+ index: 2
18666
+ }; // RNM(unescaped)
18667
+ this.rules[1].opcodes[3] = {
18668
+ type: 4,
18669
+ index: 3
18670
+ }; // RNM(escaped)
18671
+
18672
+ /* unescaped */
18673
+ this.rules[2].opcodes = [];
18674
+ this.rules[2].opcodes[0] = {
18675
+ type: 1,
18676
+ children: [1, 2, 3]
18677
+ }; // ALT
18678
+ this.rules[2].opcodes[1] = {
18679
+ type: 5,
18680
+ min: 0,
18681
+ max: 46
18682
+ }; // TRG
18683
+ this.rules[2].opcodes[2] = {
18684
+ type: 5,
18685
+ min: 48,
18686
+ max: 125
18687
+ }; // TRG
18688
+ this.rules[2].opcodes[3] = {
18689
+ type: 5,
18690
+ min: 127,
18691
+ max: 1114111
18692
+ }; // TRG
18693
+
18694
+ /* escaped */
18695
+ this.rules[3].opcodes = [];
18696
+ this.rules[3].opcodes[0] = {
18697
+ type: 2,
18698
+ children: [1, 2]
18699
+ }; // CAT
18700
+ this.rules[3].opcodes[1] = {
18701
+ type: 7,
18702
+ string: [126]
18703
+ }; // TLS
18704
+ this.rules[3].opcodes[2] = {
18705
+ type: 1,
18706
+ children: [3, 4]
18707
+ }; // ALT
18708
+ this.rules[3].opcodes[3] = {
18709
+ type: 7,
18710
+ string: [48]
18711
+ }; // TLS
18712
+ this.rules[3].opcodes[4] = {
18713
+ type: 7,
18714
+ string: [49]
18715
+ }; // TLS
18716
+
18717
+ /* array-location */
18718
+ this.rules[4].opcodes = [];
18719
+ this.rules[4].opcodes[0] = {
18720
+ type: 1,
18721
+ children: [1, 2]
18722
+ }; // ALT
18723
+ this.rules[4].opcodes[1] = {
18724
+ type: 4,
18725
+ index: 5
18726
+ }; // RNM(array-index)
18727
+ this.rules[4].opcodes[2] = {
18728
+ type: 4,
18729
+ index: 6
18730
+ }; // RNM(array-dash)
18731
+
18732
+ /* array-index */
18733
+ this.rules[5].opcodes = [];
18734
+ this.rules[5].opcodes[0] = {
18735
+ type: 1,
18736
+ children: [1, 2]
18737
+ }; // ALT
18738
+ this.rules[5].opcodes[1] = {
18739
+ type: 6,
18740
+ string: [48]
18741
+ }; // TBS
18742
+ this.rules[5].opcodes[2] = {
18743
+ type: 2,
18744
+ children: [3, 4]
18745
+ }; // CAT
18746
+ this.rules[5].opcodes[3] = {
18747
+ type: 5,
18748
+ min: 49,
18749
+ max: 57
18750
+ }; // TRG
18751
+ this.rules[5].opcodes[4] = {
18752
+ type: 3,
18753
+ min: 0,
18754
+ max: Infinity
18755
+ }; // REP
18756
+ this.rules[5].opcodes[5] = {
18757
+ type: 5,
18758
+ min: 48,
18759
+ max: 57
18760
+ }; // TRG
18761
+
18762
+ /* array-dash */
18763
+ this.rules[6].opcodes = [];
18764
+ this.rules[6].opcodes[0] = {
18765
+ type: 7,
18766
+ string: [45]
18767
+ }; // TLS
18768
+
18769
+ /* slash */
18770
+ this.rules[7].opcodes = [];
18771
+ this.rules[7].opcodes[0] = {
18772
+ type: 7,
18773
+ string: [47]
18774
+ }; // TLS
18775
+
18776
+ // The `toString()` function will display the original grammar file(s) that produced these opcodes.
18777
+ this.toString = function toString() {
18778
+ let str = "";
18779
+ str += "; JavaScript Object Notation (JSON) Pointer ABNF syntax\n";
18780
+ str += "; https://datatracker.ietf.org/doc/html/rfc6901\n";
18781
+ str += "json-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\n";
18782
+ str += "reference-token = *( unescaped / escaped )\n";
18783
+ str += "unescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n";
18784
+ str += " ; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'\n";
18785
+ str += "escaped = \"~\" ( \"0\" / \"1\" )\n";
18786
+ str += " ; representing '~' and '/', respectively\n";
18787
+ str += "\n";
18788
+ str += "; https://datatracker.ietf.org/doc/html/rfc6901#section-4\n";
18789
+ str += "array-location = array-index / array-dash\n";
18790
+ str += "array-index = %x30 / ( %x31-39 *(%x30-39) )\n";
18791
+ str += " ; \"0\", or digits without a leading \"0\"\n";
18792
+ str += "array-dash = \"-\"\n";
18793
+ str += "\n";
18794
+ str += "; Surrogate named rules\n";
18795
+ str += "slash = \"/\"\n";
18796
+ return str;
18797
+ };
18798
+ }
18799
+
18800
+ /***/ }),
18801
+
18215
18802
  /***/ 36882:
18216
18803
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
18217
18804
 
@@ -18946,6 +19533,64 @@ class InfoVisitor extends (0,ts_mixer__WEBPACK_IMPORTED_MODULE_0__.Mixin)(_gener
18946
19533
 
18947
19534
  /***/ }),
18948
19535
 
19536
+ /***/ 39150:
19537
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
19538
+
19539
+ "use strict";
19540
+ __webpack_require__.r(__webpack_exports__);
19541
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19542
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
19543
+ /* harmony export */ });
19544
+ /* harmony import */ var _EvaluationRealm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59408);
19545
+ /* harmony import */ var _errors_JSONPointerIndexError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2325);
19546
+
19547
+
19548
+ class JSONEvaluationRealm extends _EvaluationRealm_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
19549
+ name = 'json';
19550
+ isArray(node) {
19551
+ return Array.isArray(node);
19552
+ }
19553
+ isObject(node) {
19554
+ return typeof node === 'object' && node !== null && !this.isArray(node);
19555
+ }
19556
+ sizeOf(node) {
19557
+ if (this.isArray(node)) {
19558
+ return node.length;
19559
+ }
19560
+ if (this.isObject(node)) {
19561
+ return Object.keys(node).length;
19562
+ }
19563
+ return 0;
19564
+ }
19565
+ has(node, referenceToken) {
19566
+ if (this.isArray(node)) {
19567
+ const index = Number(referenceToken);
19568
+ const indexUint32 = index >>> 0;
19569
+ if (index !== indexUint32) {
19570
+ throw new _errors_JSONPointerIndexError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](`Invalid array index "${referenceToken}": index must be an unsinged 32-bit integer`, {
19571
+ referenceToken,
19572
+ currentValue: node,
19573
+ realm: this.name
19574
+ });
19575
+ }
19576
+ return indexUint32 < this.sizeOf(node);
19577
+ }
19578
+ if (this.isObject(node)) {
19579
+ return Object.prototype.hasOwnProperty.call(node, referenceToken);
19580
+ }
19581
+ return false;
19582
+ }
19583
+ evaluate(node, referenceToken) {
19584
+ if (this.isArray(node)) {
19585
+ return node[Number(referenceToken)];
19586
+ }
19587
+ return node[referenceToken];
19588
+ }
19589
+ }
19590
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JSONEvaluationRealm);
19591
+
19592
+ /***/ }),
19593
+
18949
19594
  /***/ 39361:
18950
19595
  /***/ ((module) => {
18951
19596
 
@@ -19760,6 +20405,21 @@ class Server extends _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.Objec
19760
20405
 
19761
20406
  /***/ }),
19762
20407
 
20408
+ /***/ 42144:
20409
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
20410
+
20411
+ "use strict";
20412
+ __webpack_require__.r(__webpack_exports__);
20413
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20414
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
20415
+ /* harmony export */ });
20416
+ /* harmony import */ var _JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12008);
20417
+
20418
+ class JSONPointerCompileError extends _JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
20419
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JSONPointerCompileError);
20420
+
20421
+ /***/ }),
20422
+
19763
20423
  /***/ 42937:
19764
20424
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19765
20425
 
@@ -22683,6 +23343,1256 @@ class GenericMapping extends _Tag_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
22683
23343
 
22684
23344
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GenericMapping);
22685
23345
 
23346
+ /***/ }),
23347
+
23348
+ /***/ 51751:
23349
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
23350
+
23351
+ "use strict";
23352
+ __webpack_require__.r(__webpack_exports__);
23353
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23354
+ /* harmony export */ Ast: () => (/* binding */ Ast),
23355
+ /* harmony export */ Parser: () => (/* binding */ Parser),
23356
+ /* harmony export */ Stats: () => (/* binding */ Stats),
23357
+ /* harmony export */ Trace: () => (/* binding */ Trace),
23358
+ /* harmony export */ identifiers: () => (/* binding */ identifiers),
23359
+ /* harmony export */ utilities: () => (/* binding */ utilities)
23360
+ /* harmony export */ });
23361
+ /* *************************************************************************************
23362
+ * copyright: Copyright (c) 2023 Lowell D. Thomas, all rights reserved
23363
+ * license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)
23364
+ *
23365
+ * Redistribution and use in source and binary forms, with or without
23366
+ * modification, are permitted provided that the following conditions are met:
23367
+ *
23368
+ * 1. Redistributions of source code must retain the above copyright notice, this
23369
+ * list of conditions and the following disclaimer.
23370
+ *
23371
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
23372
+ * this list of conditions and the following disclaimer in the documentation
23373
+ * and/or other materials provided with the distribution.
23374
+ *
23375
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23376
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23377
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23378
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23379
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23380
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23381
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23382
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23383
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23384
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23385
+ *
23386
+ * ********************************************************************************* */
23387
+
23388
+
23389
+ const Parser = function fnparser() {
23390
+ const id = identifiers;
23391
+ const utils = utilities;
23392
+ const p = this;
23393
+ const thisFileName = 'parser.js: Parser(): ';
23394
+ const systemData = function systemData() {
23395
+ this.state = id.ACTIVE;
23396
+ this.phraseLength = 0;
23397
+ this.refresh = () => {
23398
+ this.state = id.ACTIVE;
23399
+ this.phraseLength = 0;
23400
+ };
23401
+ };
23402
+ p.ast = undefined;
23403
+ p.stats = undefined;
23404
+ p.trace = undefined;
23405
+ p.callbacks = [];
23406
+ let lookAhead = 0;
23407
+ let treeDepth = 0;
23408
+ let maxTreeDepth = 0;
23409
+ let nodeHits = 0;
23410
+ let maxMatched = 0;
23411
+ let rules = undefined;
23412
+ let udts = undefined;
23413
+ let opcodes = undefined;
23414
+ let chars = undefined;
23415
+ let sysData = new systemData();
23416
+ let ruleCallbacks = undefined;
23417
+ let udtCallbacks = undefined;
23418
+ let userData = undefined;
23419
+ const clear = () => {
23420
+ lookAhead = 0;
23421
+ treeDepth = 0;
23422
+ maxTreeDepth = 0;
23423
+ nodeHits = 0;
23424
+ maxMatched = 0;
23425
+ rules = undefined;
23426
+ udts = undefined;
23427
+ opcodes = undefined;
23428
+ chars = undefined;
23429
+ sysData.refresh();
23430
+ ruleCallbacks = undefined;
23431
+ udtCallbacks = undefined;
23432
+ userData = undefined;
23433
+ };
23434
+
23435
+ const initializeCallbacks = () => {
23436
+ const functionName = `${thisFileName}initializeCallbacks(): `;
23437
+ let i;
23438
+ ruleCallbacks = [];
23439
+ udtCallbacks = [];
23440
+ for (i = 0; i < rules.length; i += 1) {
23441
+ ruleCallbacks[i] = undefined;
23442
+ }
23443
+ for (i = 0; i < udts.length; i += 1) {
23444
+ udtCallbacks[i] = undefined;
23445
+ }
23446
+ let func;
23447
+ const list = [];
23448
+ for (i = 0; i < rules.length; i += 1) {
23449
+ list.push(rules[i].lower);
23450
+ }
23451
+ for (i = 0; i < udts.length; i += 1) {
23452
+ list.push(udts[i].lower);
23453
+ }
23454
+ for (const index in p.callbacks) {
23455
+ if (p.callbacks.hasOwnProperty(index)) {
23456
+ i = list.indexOf(index.toLowerCase());
23457
+ if (i < 0) {
23458
+ throw new Error(`${functionName}syntax callback '${index}' not a rule or udt name`);
23459
+ }
23460
+ func = p.callbacks[index] ? p.callbacks[index] : undefined;
23461
+ if (typeof func === 'function' || func === undefined) {
23462
+ if (i < rules.length) {
23463
+ ruleCallbacks[i] = func;
23464
+ } else {
23465
+ udtCallbacks[i - rules.length] = func;
23466
+ }
23467
+ } else {
23468
+ throw new Error(`${functionName}syntax callback[${index}] must be function reference or falsy)`);
23469
+ }
23470
+ }
23471
+ }
23472
+ };
23473
+
23474
+ p.parse = (grammar, startName, inputString, callbackData) => {
23475
+ const functionName = `${thisFileName}parse(): `;
23476
+ clear();
23477
+ chars = utils.stringToChars(inputString);
23478
+ rules = grammar.rules;
23479
+ udts = grammar.udts;
23480
+ const lower = startName.toLowerCase();
23481
+ let startIndex = undefined;
23482
+ for (const i in rules) {
23483
+ if (rules.hasOwnProperty(i)) {
23484
+ if (lower === rules[i].lower) {
23485
+ startIndex = rules[i].index;
23486
+ break;
23487
+ }
23488
+ }
23489
+ }
23490
+ if (startIndex === undefined) {
23491
+ throw new Error(`${functionName}start rule name '${startRule}' not recognized`);
23492
+ }
23493
+ initializeCallbacks();
23494
+ if (p.trace) {
23495
+ p.trace.init(rules, udts, chars);
23496
+ }
23497
+ if (p.stats) {
23498
+ p.stats.init(rules, udts);
23499
+ }
23500
+ if (p.ast) {
23501
+ p.ast.init(rules, udts, chars);
23502
+ }
23503
+ userData = callbackData;
23504
+ /* create a dummy opcode for the start rule */
23505
+ opcodes = [
23506
+ {
23507
+ type: id.RNM,
23508
+ index: startIndex,
23509
+ },
23510
+ ];
23511
+ /* execute the start rule */
23512
+ opExecute(0, 0);
23513
+ opcodes = undefined;
23514
+ /* test and return the sysData */
23515
+ let success = false;
23516
+ switch (sysData.state) {
23517
+ case id.ACTIVE:
23518
+ throw new Error(`${functionName}final state should never be 'ACTIVE'`);
23519
+ case id.NOMATCH:
23520
+ success = false;
23521
+ break;
23522
+ case id.EMPTY:
23523
+ case id.MATCH:
23524
+ if (sysData.phraseLength === chars.length) {
23525
+ success = true;
23526
+ } else {
23527
+ success = false;
23528
+ }
23529
+ break;
23530
+ default:
23531
+ throw new Error('unrecognized state');
23532
+ }
23533
+ return {
23534
+ success,
23535
+ state: sysData.state,
23536
+ stateName: id.idName(sysData.state),
23537
+ length: chars.length,
23538
+ matched: sysData.phraseLength,
23539
+ maxMatched,
23540
+ maxTreeDepth,
23541
+ nodeHits,
23542
+ };
23543
+ };
23544
+ // The `ALT` operator.<br>
23545
+ // Executes its child nodes, from left to right, until it finds a match.
23546
+ // Fails if *all* of its child nodes fail.
23547
+ const opALT = (opIndex, phraseIndex) => {
23548
+ const op = opcodes[opIndex];
23549
+ for (let i = 0; i < op.children.length; i += 1) {
23550
+ opExecute(op.children[i], phraseIndex);
23551
+ if (sysData.state !== id.NOMATCH) {
23552
+ break;
23553
+ }
23554
+ }
23555
+ };
23556
+ // The `CAT` operator.<br>
23557
+ // Executes all of its child nodes, from left to right,
23558
+ // concatenating the matched phrases.
23559
+ // Fails if *any* child nodes fail.
23560
+ const opCAT = (opIndex, phraseIndex) => {
23561
+ let success;
23562
+ let astLength;
23563
+ let catCharIndex;
23564
+ let catPhrase;
23565
+ const op = opcodes[opIndex];
23566
+ if (p.ast) {
23567
+ astLength = p.ast.getLength();
23568
+ }
23569
+ success = true;
23570
+ catCharIndex = phraseIndex;
23571
+ catPhrase = 0;
23572
+ for (let i = 0; i < op.children.length; i += 1) {
23573
+ opExecute(op.children[i], catCharIndex);
23574
+ if (sysData.state === id.NOMATCH) {
23575
+ success = false;
23576
+ break;
23577
+ } else {
23578
+ catCharIndex += sysData.phraseLength;
23579
+ catPhrase += sysData.phraseLength;
23580
+ }
23581
+ }
23582
+ if (success) {
23583
+ sysData.state = catPhrase === 0 ? id.EMPTY : id.MATCH;
23584
+ sysData.phraseLength = catPhrase;
23585
+ } else {
23586
+ sysData.state = id.NOMATCH;
23587
+ sysData.phraseLength = 0;
23588
+ if (p.ast) {
23589
+ p.ast.setLength(astLength);
23590
+ }
23591
+ }
23592
+ };
23593
+ // The `REP` operator.<br>
23594
+ // Repeatedly executes its single child node,
23595
+ // concatenating each of the matched phrases found.
23596
+ // The number of repetitions executed and its final sysData depends
23597
+ // on its `min` & `max` repetition values.
23598
+ const opREP = (opIndex, phraseIndex) => {
23599
+ let astLength;
23600
+ let repCharIndex;
23601
+ let repPhrase;
23602
+ let repCount;
23603
+ const op = opcodes[opIndex];
23604
+ if (op.max === 0) {
23605
+ // this is an empty-string acceptor
23606
+ // deprecated: use the TLS empty string operator, "", instead
23607
+ sysData.state = id.EMPTY;
23608
+ sysData.phraseLength = 0;
23609
+ return;
23610
+ }
23611
+ repCharIndex = phraseIndex;
23612
+ repPhrase = 0;
23613
+ repCount = 0;
23614
+ if (p.ast) {
23615
+ astLength = p.ast.getLength();
23616
+ }
23617
+ while (1) {
23618
+ if (repCharIndex >= chars.length) {
23619
+ /* exit on end of input string */
23620
+ break;
23621
+ }
23622
+ opExecute(opIndex + 1, repCharIndex);
23623
+ if (sysData.state === id.NOMATCH) {
23624
+ /* always end if the child node fails */
23625
+ break;
23626
+ }
23627
+ if (sysData.state === id.EMPTY) {
23628
+ /* REP always succeeds when the child node returns an empty phrase */
23629
+ /* this may not seem obvious, but that's the way it works out */
23630
+ break;
23631
+ }
23632
+ repCount += 1;
23633
+ repPhrase += sysData.phraseLength;
23634
+ repCharIndex += sysData.phraseLength;
23635
+ if (repCount === op.max) {
23636
+ /* end on maxed out reps */
23637
+ break;
23638
+ }
23639
+ }
23640
+ /* evaluate the match count according to the min, max values */
23641
+ if (sysData.state === id.EMPTY) {
23642
+ sysData.state = repPhrase === 0 ? id.EMPTY : id.MATCH;
23643
+ sysData.phraseLength = repPhrase;
23644
+ } else if (repCount >= op.min) {
23645
+ sysData.state = repPhrase === 0 ? id.EMPTY : id.MATCH;
23646
+ sysData.phraseLength = repPhrase;
23647
+ } else {
23648
+ sysData.state = id.NOMATCH;
23649
+ sysData.phraseLength = 0;
23650
+ if (p.ast) {
23651
+ p.ast.setLength(astLength);
23652
+ }
23653
+ }
23654
+ };
23655
+ // Validate the callback function's returned sysData values.
23656
+ // It's the user's responsibility to get them right
23657
+ // but `RNM` fails if not.
23658
+ const validateRnmCallbackResult = (rule, sysData, charsLeft, down) => {
23659
+ if (sysData.phraseLength > charsLeft) {
23660
+ let str = `${thisFileName}opRNM(${rule.name}): callback function error: `;
23661
+ str += `sysData.phraseLength: ${sysData.phraseLength}`;
23662
+ str += ` must be <= remaining chars: ${charsLeft}`;
23663
+ throw new Error(str);
23664
+ }
23665
+ switch (sysData.state) {
23666
+ case id.ACTIVE:
23667
+ if (!down) {
23668
+ throw new Error(
23669
+ `${thisFileName}opRNM(${rule.name}): callback function return error. ACTIVE state not allowed.`
23670
+ );
23671
+ }
23672
+ break;
23673
+ case id.EMPTY:
23674
+ sysData.phraseLength = 0;
23675
+ break;
23676
+ case id.MATCH:
23677
+ if (sysData.phraseLength === 0) {
23678
+ sysData.state = id.EMPTY;
23679
+ }
23680
+ break;
23681
+ case id.NOMATCH:
23682
+ sysData.phraseLength = 0;
23683
+ break;
23684
+ default:
23685
+ throw new Error(
23686
+ `${thisFileName}opRNM(${rule.name}): callback function return error. Unrecognized return state: ${sysData.state}`
23687
+ );
23688
+ }
23689
+ };
23690
+ // The `RNM` operator.<br>
23691
+ // This operator will acts as a root node for a parse tree branch below and
23692
+ // returns the matched phrase to its parent.
23693
+ // However, its larger responsibility is handling user-defined callback functions and `AST` nodes.
23694
+ // Note that the `AST` is a separate object, but `RNM` calls its functions to create its nodes.
23695
+ const opRNM = (opIndex, phraseIndex) => {
23696
+ let astLength;
23697
+ let astDefined;
23698
+ let savedOpcodes;
23699
+ const op = opcodes[opIndex];
23700
+ const rule = rules[op.index];
23701
+ const callback = ruleCallbacks[rule.index];
23702
+ /* ignore AST in look ahead (AND or NOT operator above) */
23703
+ if (!lookAhead) {
23704
+ astDefined = p.ast && p.ast.ruleDefined(op.index);
23705
+ if (astDefined) {
23706
+ astLength = p.ast.getLength();
23707
+ p.ast.down(op.index, rules[op.index].name);
23708
+ }
23709
+ }
23710
+ if (callback) {
23711
+ /* call user's callback going down the parse tree*/
23712
+ const charsLeft = chars.length - phraseIndex;
23713
+ callback(sysData, chars, phraseIndex, userData);
23714
+ validateRnmCallbackResult(rule, sysData, charsLeft, true);
23715
+ if (sysData.state === id.ACTIVE) {
23716
+ savedOpcodes = opcodes;
23717
+ opcodes = rule.opcodes;
23718
+ opExecute(0, phraseIndex);
23719
+ opcodes = savedOpcodes;
23720
+ /* call user's callback going up the parse tree*/
23721
+ callback(sysData, chars, phraseIndex, userData);
23722
+ validateRnmCallbackResult(rule, sysData, charsLeft, false);
23723
+ } /* implied else clause: just accept the callback sysData - RNM acting as UDT */
23724
+ } else {
23725
+ /* no callback - just execute the rule */
23726
+ savedOpcodes = opcodes;
23727
+ opcodes = rule.opcodes;
23728
+ opExecute(0, phraseIndex, sysData);
23729
+ opcodes = savedOpcodes;
23730
+ }
23731
+ if (!lookAhead) {
23732
+ /* end AST */
23733
+ if (astDefined) {
23734
+ if (sysData.state === id.NOMATCH) {
23735
+ p.ast.setLength(astLength);
23736
+ } else {
23737
+ p.ast.up(op.index, rule.name, phraseIndex, sysData.phraseLength);
23738
+ }
23739
+ }
23740
+ }
23741
+ };
23742
+ // The `TRG` operator.<br>
23743
+ // Succeeds if the single first character of the phrase is
23744
+ // within the `min - max` range.
23745
+ const opTRG = (opIndex, phraseIndex) => {
23746
+ const op = opcodes[opIndex];
23747
+ sysData.state = id.NOMATCH;
23748
+ if (phraseIndex < chars.length) {
23749
+ if (op.min <= chars[phraseIndex] && chars[phraseIndex] <= op.max) {
23750
+ sysData.state = id.MATCH;
23751
+ sysData.phraseLength = 1;
23752
+ }
23753
+ }
23754
+ };
23755
+ // The `TBS` operator.<br>
23756
+ // Matches its pre-defined phrase against the input string.
23757
+ // All characters must match exactly.
23758
+ // Case-sensitive literal strings (`'string'` & `%s"string"`) are translated to `TBS`
23759
+ // operators by `apg`.
23760
+ // Phrase length of zero is not allowed.
23761
+ // Empty phrases can only be defined with `TLS` operators.
23762
+ const opTBS = (opIndex, phraseIndex) => {
23763
+ const op = opcodes[opIndex];
23764
+ const len = op.string.length;
23765
+ sysData.state = id.NOMATCH;
23766
+ if (phraseIndex + len <= chars.length) {
23767
+ for (let i = 0; i < len; i += 1) {
23768
+ if (chars[phraseIndex + i] !== op.string[i]) {
23769
+ return;
23770
+ }
23771
+ }
23772
+ sysData.state = id.MATCH;
23773
+ sysData.phraseLength = len;
23774
+ } /* implied else NOMATCH */
23775
+ };
23776
+ // The `TLS` operator.<br>
23777
+ // Matches its pre-defined phrase against the input string.
23778
+ // A case-insensitive match is attempted for ASCII alphbetical characters.
23779
+ // `TLS` is the only operator that explicitly allows empty phrases.
23780
+ // `apg` will fail for empty `TBS`, case-sensitive strings (`''`) or
23781
+ // zero repetitions (`0*0RuleName` or `0RuleName`).
23782
+ const opTLS = (opIndex, phraseIndex) => {
23783
+ let code;
23784
+ const op = opcodes[opIndex];
23785
+ sysData.state = id.NOMATCH;
23786
+ const len = op.string.length;
23787
+ if (len === 0) {
23788
+ /* EMPTY match allowed for TLS */
23789
+ sysData.state = id.EMPTY;
23790
+ return;
23791
+ }
23792
+ if (phraseIndex + len <= chars.length) {
23793
+ for (let i = 0; i < len; i += 1) {
23794
+ code = chars[phraseIndex + i];
23795
+ if (code >= 65 && code <= 90) {
23796
+ code += 32;
23797
+ }
23798
+ if (code !== op.string[i]) {
23799
+ return;
23800
+ }
23801
+ }
23802
+ sysData.state = id.MATCH;
23803
+ sysData.phraseLength = len;
23804
+ } /* implied else NOMATCH */
23805
+ };
23806
+ // Validate the callback function's returned sysData values.
23807
+ // It's the user's responsibility to get it right but `UDT` fails if not.
23808
+ const validateUdtCallbackResult = (udt, sysData, charsLeft) => {
23809
+ if (sysData.phraseLength > charsLeft) {
23810
+ let str = `${thisFileName}opUDT(${udt.name}): callback function error: `;
23811
+ str += `sysData.phraseLength: ${sysData.phraseLength}`;
23812
+ str += ` must be <= remaining chars: ${charsLeft}`;
23813
+ throw new Error(str);
23814
+ }
23815
+ switch (sysData.state) {
23816
+ case id.ACTIVE:
23817
+ throw new Error(`${thisFileName}opUDT(${udt.name}) ACTIVE state return not allowed.`);
23818
+ case id.EMPTY:
23819
+ if (udt.empty) {
23820
+ sysData.phraseLength = 0;
23821
+ } else {
23822
+ throw new Error(`${thisFileName}opUDT(${udt.name}) may not return EMPTY.`);
23823
+ }
23824
+ break;
23825
+ case id.MATCH:
23826
+ if (sysData.phraseLength === 0) {
23827
+ if (udt.empty) {
23828
+ sysData.state = id.EMPTY;
23829
+ } else {
23830
+ throw new Error(`${thisFileName}opUDT(${udt.name}) may not return EMPTY.`);
23831
+ }
23832
+ }
23833
+ break;
23834
+ case id.NOMATCH:
23835
+ sysData.phraseLength = 0;
23836
+ break;
23837
+ default:
23838
+ throw new Error(
23839
+ `${thisFileName}opUDT(${udt.name}): callback function return error. Unrecognized return state: ${sysData.state}`
23840
+ );
23841
+ }
23842
+ };
23843
+ // The `UDT` operator.<br>
23844
+ // Simply calls the user's callback function, but operates like `RNM` with regard to the `AST`
23845
+ // and back referencing.
23846
+ // There is some ambiguity here. `UDT`s act as terminals for phrase recognition but as named rules
23847
+ // for `AST` nodes and back referencing.
23848
+ // See [`ast.js`](./ast.html) for usage.
23849
+ const opUDT = (opIndex, phraseIndex) => {
23850
+ let astLength;
23851
+ let astIndex;
23852
+ let astDefined;
23853
+ const op = opcodes[opIndex];
23854
+ const udt = udts[op.index];
23855
+ sysData.UdtIndex = udt.index;
23856
+ /* ignore AST in look ahead */
23857
+ if (!lookAhead) {
23858
+ astDefined = p.ast && p.ast.udtDefined(op.index);
23859
+ if (astDefined) {
23860
+ astIndex = rules.length + op.index;
23861
+ astLength = p.ast.getLength();
23862
+ p.ast.down(astIndex, udt.name);
23863
+ }
23864
+ }
23865
+ /* call the UDT */
23866
+ const charsLeft = chars.length - phraseIndex;
23867
+ udtCallbacks[op.index](sysData, chars, phraseIndex, userData);
23868
+ validateUdtCallbackResult(udt, sysData, charsLeft);
23869
+ if (!lookAhead) {
23870
+ /* end AST */
23871
+ if (astDefined) {
23872
+ if (sysData.state === id.NOMATCH) {
23873
+ p.ast.setLength(astLength);
23874
+ } else {
23875
+ p.ast.up(astIndex, udt.name, phraseIndex, sysData.phraseLength);
23876
+ }
23877
+ }
23878
+ }
23879
+ };
23880
+ // The `AND` operator.<br>
23881
+ // This is the positive `look ahead` operator.
23882
+ // Executes its single child node, returning the EMPTY state
23883
+ // if it succeedsand NOMATCH if it fails.
23884
+ // *Always* backtracks on any matched phrase and returns EMPTY on success.
23885
+ const opAND = (opIndex, phraseIndex) => {
23886
+ lookAhead += 1;
23887
+ opExecute(opIndex + 1, phraseIndex);
23888
+ lookAhead -= 1;
23889
+ sysData.phraseLength = 0;
23890
+ switch (sysData.state) {
23891
+ case id.EMPTY:
23892
+ sysData.state = id.EMPTY;
23893
+ break;
23894
+ case id.MATCH:
23895
+ sysData.state = id.EMPTY;
23896
+ break;
23897
+ case id.NOMATCH:
23898
+ sysData.state = id.NOMATCH;
23899
+ break;
23900
+ default:
23901
+ throw new Error(`opAND: invalid state ${sysData.state}`);
23902
+ }
23903
+ };
23904
+ // The `NOT` operator.<br>
23905
+ // This is the negative `look ahead` operator.
23906
+ // Executes its single child node, returning the EMPTY state
23907
+ // if it *fails* and NOMATCH if it succeeds.
23908
+ // *Always* backtracks on any matched phrase and returns EMPTY
23909
+ // on success (failure of its child node).
23910
+ const opNOT = (opIndex, phraseIndex) => {
23911
+ lookAhead += 1;
23912
+ opExecute(opIndex + 1, phraseIndex);
23913
+ lookAhead -= 1;
23914
+ sysData.phraseLength = 0;
23915
+ switch (sysData.state) {
23916
+ case id.EMPTY:
23917
+ case id.MATCH:
23918
+ sysData.state = id.NOMATCH;
23919
+ break;
23920
+ case id.NOMATCH:
23921
+ sysData.state = id.EMPTY;
23922
+ break;
23923
+ default:
23924
+ throw new Error(`opNOT: invalid state ${sysData.state}`);
23925
+ }
23926
+ };
23927
+
23928
+ const opExecute = (opIndex, phraseIndex) => {
23929
+ const functionName = `${thisFileName}opExecute(): `;
23930
+ const op = opcodes[opIndex];
23931
+ nodeHits += 1;
23932
+ if (treeDepth > maxTreeDepth) {
23933
+ maxTreeDepth = treeDepth;
23934
+ }
23935
+ treeDepth += 1;
23936
+ sysData.refresh();
23937
+ if (p.trace) {
23938
+ p.trace.down(op, phraseIndex);
23939
+ }
23940
+ switch (op.type) {
23941
+ case id.ALT:
23942
+ opALT(opIndex, phraseIndex);
23943
+ break;
23944
+ case id.CAT:
23945
+ opCAT(opIndex, phraseIndex);
23946
+ break;
23947
+ case id.REP:
23948
+ opREP(opIndex, phraseIndex);
23949
+ break;
23950
+ case id.RNM:
23951
+ opRNM(opIndex, phraseIndex);
23952
+ break;
23953
+ case id.TRG:
23954
+ opTRG(opIndex, phraseIndex);
23955
+ break;
23956
+ case id.TBS:
23957
+ opTBS(opIndex, phraseIndex);
23958
+ break;
23959
+ case id.TLS:
23960
+ opTLS(opIndex, phraseIndex);
23961
+ break;
23962
+ case id.UDT:
23963
+ opUDT(opIndex, phraseIndex);
23964
+ break;
23965
+ case id.AND:
23966
+ opAND(opIndex, phraseIndex);
23967
+ break;
23968
+ case id.NOT:
23969
+ opNOT(opIndex, phraseIndex);
23970
+ break;
23971
+ default:
23972
+ throw new Error(`${functionName}unrecognized operator`);
23973
+ }
23974
+ if (!lookAhead) {
23975
+ if (phraseIndex + sysData.phraseLength > maxMatched) {
23976
+ maxMatched = phraseIndex + sysData.phraseLength;
23977
+ }
23978
+ }
23979
+ if (p.stats) {
23980
+ p.stats.collect(op, sysData);
23981
+ }
23982
+ if (p.trace) {
23983
+ p.trace.up(op, sysData.state, phraseIndex, sysData.phraseLength);
23984
+ }
23985
+ treeDepth -= 1;
23986
+ };
23987
+ };
23988
+
23989
+ const Ast = function fnast() {
23990
+ const thisFileName = 'parser.js: Ast()): ';
23991
+ const id = identifiers;
23992
+ const utils = utilities;
23993
+ const a = this;
23994
+ let rules = undefined;
23995
+ let udts = undefined;
23996
+ let chars = undefined;
23997
+ let nodeCount = 0;
23998
+ const nodeCallbacks = [];
23999
+ const stack = [];
24000
+ const records = [];
24001
+ a.callbacks = [];
24002
+ /* called by the parser to initialize the AST with the rules, UDTs and the input characters */
24003
+ a.init = (rulesIn, udtsIn, charsIn) => {
24004
+ stack.length = 0;
24005
+ records.length = 0;
24006
+ nodeCount = 0;
24007
+ rules = rulesIn;
24008
+ udts = udtsIn;
24009
+ chars = charsIn;
24010
+ let i;
24011
+ const list = [];
24012
+ for (i = 0; i < rules.length; i += 1) {
24013
+ list.push(rules[i].lower);
24014
+ }
24015
+ for (i = 0; i < udts.length; i += 1) {
24016
+ list.push(udts[i].lower);
24017
+ }
24018
+ nodeCount = rules.length + udts.length;
24019
+ for (i = 0; i < nodeCount; i += 1) {
24020
+ nodeCallbacks[i] = undefined;
24021
+ }
24022
+ for (const index in a.callbacks) {
24023
+ if (a.callbacks.hasOwnProperty(index)) {
24024
+ const lower = index.toLowerCase();
24025
+ i = list.indexOf(lower);
24026
+ if (i < 0) {
24027
+ throw new Error(`${thisFileName}init: node '${index}' not a rule or udt name`);
24028
+ }
24029
+ nodeCallbacks[i] = a.callbacks[index];
24030
+ }
24031
+ }
24032
+ };
24033
+ /* AST node rule callbacks - called by the parser's `RNM` operator */
24034
+ a.ruleDefined = (index) => !!nodeCallbacks[index];
24035
+ /* AST node UDT callbacks - called by the parser's `UDT` operator */
24036
+ a.udtDefined = (index) => !!nodeCallbacks[rules.length + index];
24037
+ /* called by the parser's `RNM` & `UDT` operators
24038
+ builds a record for the downward traversal of the node */
24039
+ a.down = (callbackIndex, name) => {
24040
+ const thisIndex = records.length;
24041
+ stack.push(thisIndex);
24042
+ records.push({
24043
+ name,
24044
+ thisIndex,
24045
+ thatIndex: undefined,
24046
+ state: id.SEM_PRE,
24047
+ callbackIndex,
24048
+ phraseIndex: undefined,
24049
+ phraseLength: undefined,
24050
+ stack: stack.length,
24051
+ });
24052
+ return thisIndex;
24053
+ };
24054
+ /* called by the parser's `RNM` & `UDT` operators */
24055
+ /* builds a record for the upward traversal of the node */
24056
+ a.up = (callbackIndex, name, phraseIndex, phraseLength) => {
24057
+ const thisIndex = records.length;
24058
+ const thatIndex = stack.pop();
24059
+ records.push({
24060
+ name,
24061
+ thisIndex,
24062
+ thatIndex,
24063
+ state: id.SEM_POST,
24064
+ callbackIndex,
24065
+ phraseIndex,
24066
+ phraseLength,
24067
+ stack: stack.length,
24068
+ });
24069
+ records[thatIndex].thatIndex = thisIndex;
24070
+ records[thatIndex].phraseIndex = phraseIndex;
24071
+ records[thatIndex].phraseLength = phraseLength;
24072
+ return thisIndex;
24073
+ };
24074
+ // Called by the user to translate the AST.
24075
+ // Translate means to associate or apply some semantic action to the
24076
+ // phrases that were syntactically matched to the AST nodes according
24077
+ // to the defining grammar.
24078
+ // ```
24079
+ // data - optional user-defined data
24080
+ // passed to the callback functions by the translator
24081
+ // ```
24082
+ a.translate = (data) => {
24083
+ let ret;
24084
+ let callback;
24085
+ let record;
24086
+ for (let i = 0; i < records.length; i += 1) {
24087
+ record = records[i];
24088
+ callback = nodeCallbacks[record.callbackIndex];
24089
+ if (callback) {
24090
+ if (record.state === id.SEM_PRE) {
24091
+ callback(id.SEM_PRE, chars, record.phraseIndex, record.phraseLength, data);
24092
+ } else if (callback) {
24093
+ callback(id.SEM_POST, chars, record.phraseIndex, record.phraseLength, data);
24094
+ }
24095
+ }
24096
+ }
24097
+ };
24098
+ /* called by the parser to reset the length of the records array */
24099
+ /* necessary on backtracking */
24100
+ a.setLength = (length) => {
24101
+ records.length = length;
24102
+ if (length > 0) {
24103
+ stack.length = records[length - 1].stack;
24104
+ } else {
24105
+ stack.length = 0;
24106
+ }
24107
+ };
24108
+ /* called by the parser to get the length of the records array */
24109
+ a.getLength = () => records.length;
24110
+ /* helper for XML display */
24111
+ function indent(n) {
24112
+ let ret = '';
24113
+ while (n-- > 0) {
24114
+ ret += ' ';
24115
+ }
24116
+ return ret;
24117
+ }
24118
+ // Generate an `XML` version of the AST.
24119
+ // Useful if you want to use a special or favorite XML parser to translate the
24120
+ // AST. Node data are JavaScript strings.
24121
+ a.toXml = () => {
24122
+ let xml = '';
24123
+ let depth = 0;
24124
+ xml += '<?xml version="1.0" encoding="utf-8"?>\n';
24125
+ xml += `<root nodes="${records.length / 2}" characters="${chars.length}">\n`;
24126
+ xml += `<!-- input string -->\n`;
24127
+ xml += indent(depth + 2);
24128
+ xml += utils.charsToString(chars);
24129
+ xml += '\n';
24130
+ records.forEach((rec) => {
24131
+ if (rec.state === id.SEM_PRE) {
24132
+ depth += 1;
24133
+ xml += indent(depth);
24134
+ xml += `<node name="${rec.name}" index="${rec.phraseIndex}" length="${rec.phraseLength}">\n`;
24135
+ xml += indent(depth + 2);
24136
+ xml += utils.charsToString(chars, rec.phraseIndex, rec.phraseLength);
24137
+ xml += '\n';
24138
+ } else {
24139
+ xml += indent(depth);
24140
+ xml += `</node><!-- name="${rec.name}" -->\n`;
24141
+ depth -= 1;
24142
+ }
24143
+ });
24144
+
24145
+ xml += '</root>\n';
24146
+ return xml;
24147
+ };
24148
+ };
24149
+
24150
+ const Trace = function fntrace() {
24151
+ const id = identifiers;
24152
+ const utils = utilities;
24153
+ const thisFile = 'parser.js: Trace(): ';
24154
+ let chars = undefined;
24155
+ let rules = undefined;
24156
+ let udts = undefined;
24157
+ let out = '';
24158
+ let treeDepth = 0;
24159
+ const MAX_PHRASE = 100;
24160
+ const t = this;
24161
+ const indent = (n) => {
24162
+ let ret = '';
24163
+ let count = 0;
24164
+ if (n >= 0) {
24165
+ while (n--) {
24166
+ count += 1;
24167
+ if (count === 5) {
24168
+ ret += '|';
24169
+ count = 0;
24170
+ } else {
24171
+ ret += '.';
24172
+ }
24173
+ }
24174
+ }
24175
+ return ret;
24176
+ };
24177
+ t.init = (r, u, c) => {
24178
+ rules = r;
24179
+ udts = u;
24180
+ chars = c;
24181
+ };
24182
+ const opName = (op) => {
24183
+ let name;
24184
+ switch (op.type) {
24185
+ case id.ALT:
24186
+ name = 'ALT';
24187
+ break;
24188
+ case id.CAT:
24189
+ name = 'CAT';
24190
+ break;
24191
+ case id.REP:
24192
+ if (op.max === Infinity) {
24193
+ name = `REP(${op.min},inf)`;
24194
+ } else {
24195
+ name = `REP(${op.min},${op.max})`;
24196
+ }
24197
+ break;
24198
+ case id.RNM:
24199
+ name = `RNM(${rules[op.index].name})`;
24200
+ break;
24201
+ case id.TRG:
24202
+ name = `TRG(${op.min},${op.max})`;
24203
+ break;
24204
+ case id.TBS:
24205
+ if (op.string.length > 6) {
24206
+ name = `TBS(${utils.charsToString(op.string, 0, 3)}...)`;
24207
+ } else {
24208
+ name = `TBS(${utils.charsToString(op.string, 0, 6)})`;
24209
+ }
24210
+ break;
24211
+ case id.TLS:
24212
+ if (op.string.length > 6) {
24213
+ name = `TLS(${utils.charsToString(op.string, 0, 3)}...)`;
24214
+ } else {
24215
+ name = `TLS(${utils.charsToString(op.string, 0, 6)})`;
24216
+ }
24217
+ break;
24218
+ case id.UDT:
24219
+ name = `UDT(${udts[op.index].name})`;
24220
+ break;
24221
+ case id.AND:
24222
+ name = 'AND';
24223
+ break;
24224
+ case id.NOT:
24225
+ name = 'NOT';
24226
+ break;
24227
+ default:
24228
+ throw new Error(`${thisFile}Trace: opName: unrecognized opcode`);
24229
+ }
24230
+ return name;
24231
+ };
24232
+ t.down = (op, offset) => {
24233
+ const lead = indent(treeDepth);
24234
+ const len = Math.min(MAX_PHRASE, chars.length - offset);
24235
+ let phrase = utils.charsToString(chars, offset, len);
24236
+ if (len < chars.length - offset) {
24237
+ phrase += '...';
24238
+ }
24239
+ phrase = `${lead}|-|[${opName(op)}]${phrase}\n`;
24240
+ out += phrase;
24241
+ treeDepth += 1;
24242
+ };
24243
+ t.up = (op, state, offset, phraseLength) => {
24244
+ const thisFunc = `${thisFile}trace.up: `;
24245
+ treeDepth -= 1;
24246
+ const lead = indent(treeDepth);
24247
+ let len;
24248
+ let phrase;
24249
+ let st;
24250
+ switch (state) {
24251
+ case id.EMPTY:
24252
+ st = '|E|';
24253
+ phrase = `''`;
24254
+ break;
24255
+ case id.MATCH:
24256
+ st = '|M|';
24257
+ len = Math.min(MAX_PHRASE, phraseLength);
24258
+ if (len < phraseLength) {
24259
+ phrase = `'${utils.charsToString(chars, offset, len)}...'`;
24260
+ } else {
24261
+ phrase = `'${utils.charsToString(chars, offset, len)}'`;
24262
+ }
24263
+ break;
24264
+ case id.NOMATCH:
24265
+ st = '|N|';
24266
+ phrase = '';
24267
+ break;
24268
+ default:
24269
+ throw new Error(`${thisFunc} unrecognized state`);
24270
+ }
24271
+ phrase = `${lead}${st}[${opName(op)}]${phrase}\n`;
24272
+ out += phrase;
24273
+ };
24274
+ t.displayTrace = () => out;
24275
+ };
24276
+
24277
+ const Stats = function fnstats() {
24278
+ const id = identifiers;
24279
+ const thisFileName = 'parser.js: Stats(): ';
24280
+ let rules;
24281
+ let udts;
24282
+ let totals;
24283
+ const stats = [];
24284
+ const ruleStats = [];
24285
+ const udtStats = [];
24286
+ /* called by parser to initialize the stats */
24287
+ this.init = (r, u) => {
24288
+ rules = r;
24289
+ udts = u;
24290
+ clear();
24291
+ };
24292
+ /* This function is the main interaction with the parser. */
24293
+ /* The parser calls it after each node has been traversed. */
24294
+ this.collect = (op, sys) => {
24295
+ incStat(totals, sys.state, sys.phraseLength);
24296
+ incStat(stats[op.type], sys.state, sys.phraseLength);
24297
+ if (op.type === id.RNM) {
24298
+ incStat(ruleStats[op.index], sys.state, sys.phraseLength);
24299
+ }
24300
+ if (op.type === id.UDT) {
24301
+ incStat(udtStats[op.index], sys.state, sys.phraseLength);
24302
+ }
24303
+ };
24304
+ this.displayStats = () => {
24305
+ let out = '';
24306
+ const totals = {
24307
+ match: 0,
24308
+ empty: 0,
24309
+ nomatch: 0,
24310
+ total: 0,
24311
+ };
24312
+ const displayRow = (op, m, e, n, t) => {
24313
+ totals.match += m;
24314
+ totals.empty += e;
24315
+ totals.nomatch += n;
24316
+ totals.total += t;
24317
+ const mm = normalize(m);
24318
+ const ee = normalize(e);
24319
+ const nn = normalize(n);
24320
+ const tt = normalize(t);
24321
+ return `${op} | ${mm} | ${ee} | ${nn} | ${tt} |\n`;
24322
+ };
24323
+ out += ' OPERATOR STATS\n';
24324
+ out += ' | MATCH | EMPTY | NOMATCH | TOTAL |\n';
24325
+ out += displayRow(' ALT', stats[id.ALT].match, stats[id.ALT].empty, stats[id.ALT].nomatch, stats[id.ALT].total);
24326
+ out += displayRow(' CAT', stats[id.CAT].match, stats[id.CAT].empty, stats[id.CAT].nomatch, stats[id.CAT].total);
24327
+ out += displayRow(' REP', stats[id.REP].match, stats[id.REP].empty, stats[id.REP].nomatch, stats[id.REP].total);
24328
+ out += displayRow(' RNM', stats[id.RNM].match, stats[id.RNM].empty, stats[id.RNM].nomatch, stats[id.RNM].total);
24329
+ out += displayRow(' TRG', stats[id.TRG].match, stats[id.TRG].empty, stats[id.TRG].nomatch, stats[id.TRG].total);
24330
+ out += displayRow(' TBS', stats[id.TBS].match, stats[id.TBS].empty, stats[id.TBS].nomatch, stats[id.TBS].total);
24331
+ out += displayRow(' TLS', stats[id.TLS].match, stats[id.TLS].empty, stats[id.TLS].nomatch, stats[id.TLS].total);
24332
+ out += displayRow(' UDT', stats[id.UDT].match, stats[id.UDT].empty, stats[id.UDT].nomatch, stats[id.UDT].total);
24333
+ out += displayRow(' AND', stats[id.AND].match, stats[id.AND].empty, stats[id.AND].nomatch, stats[id.AND].total);
24334
+ out += displayRow(' NOT', stats[id.NOT].match, stats[id.NOT].empty, stats[id.NOT].nomatch, stats[id.NOT].total);
24335
+ out += displayRow('TOTAL', totals.match, totals.empty, totals.nomatch, totals.total);
24336
+ return out;
24337
+ };
24338
+ /*
24339
+ Display rule/udt
24340
+ */
24341
+ this.displayHits = (type) => {
24342
+ let out = '';
24343
+ const displayRow = (m, e, n, t, name) => {
24344
+ totals.match += m;
24345
+ totals.empty += e;
24346
+ totals.nomatch += n;
24347
+ totals.total += t;
24348
+ const mm = normalize(m);
24349
+ const ee = normalize(e);
24350
+ const nn = normalize(n);
24351
+ const tt = normalize(t);
24352
+ return `| ${mm} | ${ee} | ${nn} | ${tt} | ${name}\n`;
24353
+ };
24354
+ if (typeof type === 'string' && type.toLowerCase()[0] === 'a') {
24355
+ ruleStats.sort(sortAlpha);
24356
+ udtStats.sort(sortAlpha);
24357
+ out += ' RULES/UDTS ALPHABETICALLY\n';
24358
+ } else if (typeof type === 'string' && type.toLowerCase()[0] === 'i') {
24359
+ ruleStats.sort(sortIndex);
24360
+ udtStats.sort(sortIndex);
24361
+ out += ' RULES/UDTS BY INDEX\n';
24362
+ } else {
24363
+ ruleStats.sort(sortHits);
24364
+ udtStats.sort(sortHits);
24365
+ out += ' RULES/UDTS BY HIT COUNT\n';
24366
+ }
24367
+ out += '| MATCH | EMPTY | NOMATCH | TOTAL | NAME\n';
24368
+ for (let i = 0; i < ruleStats.length; i += 1) {
24369
+ let r = ruleStats[i];
24370
+ if (r.total) {
24371
+ out += displayRow(r.match, r.empty, r.nomatch, r.total, r.name);
24372
+ }
24373
+ }
24374
+ for (let i = 0; i < udtStats.length; i += 1) {
24375
+ let r = udtStats[i];
24376
+ if (r.total) {
24377
+ out += displayRow(r.match, r.empty, r.nomatch, r.total, r.name);
24378
+ }
24379
+ }
24380
+ return out;
24381
+ };
24382
+ const normalize = (n) => {
24383
+ if (n < 10) {
24384
+ return ` ${n}`;
24385
+ }
24386
+ if (n < 100) {
24387
+ return ` ${n}`;
24388
+ }
24389
+ if (n < 1000) {
24390
+ return ` ${n}`;
24391
+ }
24392
+ if (n < 10000) {
24393
+ return ` ${n}`;
24394
+ }
24395
+ if (n < 100000) {
24396
+ return ` ${n}`;
24397
+ }
24398
+ if (n < 1000000) {
24399
+ return ` ${n}`;
24400
+ }
24401
+ return `${n}`;
24402
+ };
24403
+ const sortAlpha = (lhs, rhs) => {
24404
+ if (lhs.lower < rhs.lower) {
24405
+ return -1;
24406
+ }
24407
+ if (lhs.lower > rhs.lower) {
24408
+ return 1;
24409
+ }
24410
+ return 0;
24411
+ };
24412
+ const sortHits = (lhs, rhs) => {
24413
+ if (lhs.total < rhs.total) {
24414
+ return 1;
24415
+ }
24416
+ if (lhs.total > rhs.total) {
24417
+ return -1;
24418
+ }
24419
+ return sortAlpha(lhs, rhs);
24420
+ };
24421
+ const sortIndex = (lhs, rhs) => {
24422
+ if (lhs.index < rhs.index) {
24423
+ return -1;
24424
+ }
24425
+ if (lhs.index > rhs.index) {
24426
+ return 1;
24427
+ }
24428
+ return 0;
24429
+ };
24430
+ const EmptyStat = function fnempty() {
24431
+ this.empty = 0;
24432
+ this.match = 0;
24433
+ this.nomatch = 0;
24434
+ this.total = 0;
24435
+ };
24436
+ /* Zero out all stats */
24437
+ const clear = () => {
24438
+ stats.length = 0;
24439
+ totals = new EmptyStat();
24440
+ stats[id.ALT] = new EmptyStat();
24441
+ stats[id.CAT] = new EmptyStat();
24442
+ stats[id.REP] = new EmptyStat();
24443
+ stats[id.RNM] = new EmptyStat();
24444
+ stats[id.TRG] = new EmptyStat();
24445
+ stats[id.TBS] = new EmptyStat();
24446
+ stats[id.TLS] = new EmptyStat();
24447
+ stats[id.UDT] = new EmptyStat();
24448
+ stats[id.AND] = new EmptyStat();
24449
+ stats[id.NOT] = new EmptyStat();
24450
+ ruleStats.length = 0;
24451
+ for (let i = 0; i < rules.length; i += 1) {
24452
+ ruleStats.push({
24453
+ empty: 0,
24454
+ match: 0,
24455
+ nomatch: 0,
24456
+ total: 0,
24457
+ name: rules[i].name,
24458
+ lower: rules[i].lower,
24459
+ index: rules[i].index,
24460
+ });
24461
+ }
24462
+ if (udts.length > 0) {
24463
+ udtStats.length = 0;
24464
+ for (let i = 0; i < udts.length; i += 1) {
24465
+ udtStats.push({
24466
+ empty: 0,
24467
+ match: 0,
24468
+ nomatch: 0,
24469
+ total: 0,
24470
+ name: udts[i].name,
24471
+ lower: udts[i].lower,
24472
+ index: udts[i].index,
24473
+ });
24474
+ }
24475
+ }
24476
+ };
24477
+ /* increment the designated operator hit count by one */
24478
+ const incStat = (stat, state) => {
24479
+ stat.total += 1;
24480
+ switch (state) {
24481
+ case id.EMPTY:
24482
+ stat.empty += 1;
24483
+ break;
24484
+ case id.MATCH:
24485
+ stat.match += 1;
24486
+ break;
24487
+ case id.NOMATCH:
24488
+ stat.nomatch += 1;
24489
+ break;
24490
+ default:
24491
+ throw new Error(`${thisFileName}collect(): incStat(): unrecognized state: ${state}`);
24492
+ }
24493
+ };
24494
+ };
24495
+
24496
+ const utilities = {
24497
+ // utility functions
24498
+ stringToChars: (string) => [...string].map((cp) => cp.codePointAt(0)),
24499
+ charsToString: (chars, beg, len) => {
24500
+ let subChars = chars;
24501
+ while (1) {
24502
+ if (beg === undefined || beg < 0) {
24503
+ break;
24504
+ }
24505
+ if (len === undefined) {
24506
+ subChars = chars.slice(beg);
24507
+ break;
24508
+ }
24509
+ if (len <= 0) {
24510
+ // always an empty string
24511
+ return '';
24512
+ }
24513
+ subChars = chars.slice(beg, beg + len);
24514
+ break;
24515
+ }
24516
+ return String.fromCodePoint(...subChars);
24517
+ },
24518
+ };
24519
+
24520
+ const identifiers = {
24521
+ // Identifies the operator type.
24522
+ // NB: These must match the values in apg-js 4.3.0, apg-lib/identifiers.
24523
+ /* the original ABNF operators */
24524
+ ALT: 1 /* alternation */,
24525
+ CAT: 2 /* concatenation */,
24526
+ REP: 3 /* repetition */,
24527
+ RNM: 4 /* rule name */,
24528
+ TRG: 5 /* terminal range */,
24529
+ TBS: 6 /* terminal binary string, case sensitive */,
24530
+ TLS: 7 /* terminal literal string, case insensitive */,
24531
+ /* the super set, SABNF operators */
24532
+ UDT: 11 /* user-defined terminal */,
24533
+ AND: 12 /* positive look ahead */,
24534
+ NOT: 13 /* negative look ahead */,
24535
+ // Used by the parser and the user's `RNM` and `UDT` callback functions.
24536
+ // Identifies the parser state as it traverses the parse tree nodes.
24537
+ // - *ACTIVE* - indicates the downward direction through the parse tree node.
24538
+ // - *MATCH* - indicates the upward direction and a phrase, of length \> 0, has been successfully matched
24539
+ // - *EMPTY* - indicates the upward direction and a phrase, of length = 0, has been successfully matched
24540
+ // - *NOMATCH* - indicates the upward direction and the parser failed to match any phrase at all
24541
+ ACTIVE: 100,
24542
+ MATCH: 101,
24543
+ EMPTY: 102,
24544
+ NOMATCH: 103,
24545
+ // Used by [`AST` translator](./ast.html) (semantic analysis) and the user's callback functions
24546
+ // to indicate the direction of flow through the `AST` nodes.
24547
+ // - *SEM_PRE* - indicates the downward (pre-branch) direction through the `AST` node.
24548
+ // - *SEM_POST* - indicates the upward (post-branch) direction through the `AST` node.
24549
+ SEM_PRE: 200,
24550
+ SEM_POST: 201,
24551
+ // Ignored. Retained for backwords compatibility.
24552
+ SEM_OK: 300,
24553
+ idName: (s) => {
24554
+ switch (s) {
24555
+ case identifiers.ALT:
24556
+ return 'ALT';
24557
+ case identifiers.CAT:
24558
+ return 'CAT';
24559
+ case identifiers.REP:
24560
+ return 'REP';
24561
+ case identifiers.RNM:
24562
+ return 'RNM';
24563
+ case identifiers.TRG:
24564
+ return 'TRG';
24565
+ case identifiers.TBS:
24566
+ return 'TBS';
24567
+ case identifiers.TLS:
24568
+ return 'TLS';
24569
+ case identifiers.UDT:
24570
+ return 'UDT';
24571
+ case identifiers.AND:
24572
+ return 'AND';
24573
+ case identifiers.NOT:
24574
+ return 'NOT';
24575
+ case identifiers.ACTIVE:
24576
+ return 'ACTIVE';
24577
+ case identifiers.EMPTY:
24578
+ return 'EMPTY';
24579
+ case identifiers.MATCH:
24580
+ return 'MATCH';
24581
+ case identifiers.NOMATCH:
24582
+ return 'NOMATCH';
24583
+ case identifiers.SEM_PRE:
24584
+ return 'SEM_PRE';
24585
+ case identifiers.SEM_POST:
24586
+ return 'SEM_POST';
24587
+ case identifiers.SEM_OK:
24588
+ return 'SEM_OK';
24589
+ default:
24590
+ return 'UNRECOGNIZED STATE';
24591
+ }
24592
+ },
24593
+ };
24594
+
24595
+
22686
24596
  /***/ }),
22687
24597
 
22688
24598
  /***/ 51865:
@@ -23081,6 +24991,48 @@ class ExternalValueVisitor extends _FallbackVisitor_mjs__WEBPACK_IMPORTED_MODULE
23081
24991
 
23082
24992
  /***/ }),
23083
24993
 
24994
+ /***/ 52725:
24995
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
24996
+
24997
+ "use strict";
24998
+ __webpack_require__.r(__webpack_exports__);
24999
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25000
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
25001
+ /* harmony export */ });
25002
+ /* harmony import */ var apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51751);
25003
+ /* harmony import */ var _errors_JSONPointerParseError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26490);
25004
+
25005
+
25006
+ const cst = ruleName => {
25007
+ return (state, chars, phraseIndex, phraseLength, data) => {
25008
+ if (!(typeof data === 'object' && data !== null && !Array.isArray(data))) {
25009
+ throw new _errors_JSONPointerParseError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]("parser's user data must be an object");
25010
+ }
25011
+ if (state === apg_lite__WEBPACK_IMPORTED_MODULE_0__.identifiers.SEM_PRE) {
25012
+ const node = {
25013
+ type: ruleName,
25014
+ text: apg_lite__WEBPACK_IMPORTED_MODULE_0__.utilities.charsToString(chars, phraseIndex, phraseLength),
25015
+ start: phraseIndex,
25016
+ length: phraseLength,
25017
+ children: []
25018
+ };
25019
+ if (data.stack.length > 0) {
25020
+ const parent = data.stack[data.stack.length - 1];
25021
+ parent.children.push(node);
25022
+ } else {
25023
+ data.root = node;
25024
+ }
25025
+ data.stack.push(node);
25026
+ }
25027
+ if (state === apg_lite__WEBPACK_IMPORTED_MODULE_0__.identifiers.SEM_POST) {
25028
+ data.stack.pop();
25029
+ }
25030
+ };
25031
+ };
25032
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cst);
25033
+
25034
+ /***/ }),
25035
+
23084
25036
  /***/ 52769:
23085
25037
  /***/ ((module) => {
23086
25038
 
@@ -25287,6 +27239,63 @@ class OperationVisitor extends BaseOperationVisitor {
25287
27239
 
25288
27240
  /***/ }),
25289
27241
 
27242
+ /***/ 56660:
27243
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
27244
+
27245
+ "use strict";
27246
+ __webpack_require__.r(__webpack_exports__);
27247
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27248
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
27249
+ /* harmony export */ });
27250
+ class TraceBuilder {
27251
+ #trace;
27252
+ #path;
27253
+ #realm;
27254
+ constructor(trace, context = {}) {
27255
+ this.#trace = trace;
27256
+ this.#trace.steps = [];
27257
+ this.#trace.failed = false;
27258
+ this.#trace.failedAt = -1;
27259
+ this.#trace.message = `JSON Pointer "${context.jsonPointer}" was successfully evaluated against the provided value`;
27260
+ this.#trace.context = {
27261
+ ...context,
27262
+ realm: context.realm.name
27263
+ };
27264
+ this.#path = [];
27265
+ this.#realm = context.realm;
27266
+ }
27267
+ step({
27268
+ referenceToken,
27269
+ input,
27270
+ output,
27271
+ success = true,
27272
+ reason
27273
+ }) {
27274
+ const position = this.#path.length;
27275
+ this.#path.push(referenceToken);
27276
+ const step = {
27277
+ referenceToken,
27278
+ referenceTokenPosition: position,
27279
+ input,
27280
+ inputType: this.#realm.isObject(input) ? 'object' : this.#realm.isArray(input) ? 'array' : 'unrecognized',
27281
+ output,
27282
+ success
27283
+ };
27284
+ if (reason) {
27285
+ step.reason = reason;
27286
+ }
27287
+ this.#trace.steps.push(step);
27288
+ if (!success) {
27289
+ this.#trace.failed = true;
27290
+ this.#trace.failedAt = position;
27291
+ this.#trace.message = reason;
27292
+ }
27293
+ }
27294
+ }
27295
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TraceBuilder);
27296
+
27297
+ /***/ }),
27298
+
25290
27299
  /***/ 56935:
25291
27300
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25292
27301
 
@@ -26511,6 +28520,38 @@ class DependenciesVisitor extends (0,ts_mixer__WEBPACK_IMPORTED_MODULE_0__.Mixin
26511
28520
 
26512
28521
  /***/ }),
26513
28522
 
28523
+ /***/ 59408:
28524
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
28525
+
28526
+ "use strict";
28527
+ __webpack_require__.r(__webpack_exports__);
28528
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
28529
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
28530
+ /* harmony export */ });
28531
+ /* harmony import */ var _errors_JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12008);
28532
+
28533
+ class EvaluationRealm {
28534
+ name = '';
28535
+ isArray(node) {
28536
+ throw new _errors_JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]('Realm.isArray(node) must be implemented in a subclass');
28537
+ }
28538
+ isObject(node) {
28539
+ throw new _errors_JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]('Realm.isObject(node) must be implemented in a subclass');
28540
+ }
28541
+ sizeOf(node) {
28542
+ throw new _errors_JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]('Realm.sizeOf(node) must be implemented in a subclass');
28543
+ }
28544
+ has(node, referenceToken) {
28545
+ throw new _errors_JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]('Realm.has(node) must be implemented in a subclass');
28546
+ }
28547
+ evaluate(node, referenceToken) {
28548
+ throw new _errors_JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]('Realm.evaluate(node) must be implemented in a subclass');
28549
+ }
28550
+ }
28551
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EvaluationRealm);
28552
+
28553
+ /***/ }),
28554
+
26514
28555
  /***/ 59425:
26515
28556
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
26516
28557
 
@@ -27550,6 +29591,32 @@ visitor, {
27550
29591
 
27551
29592
  /***/ }),
27552
29593
 
29594
+ /***/ 60357:
29595
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
29596
+
29597
+ "use strict";
29598
+ __webpack_require__.r(__webpack_exports__);
29599
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
29600
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
29601
+ /* harmony export */ });
29602
+ /* harmony import */ var apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51751);
29603
+ /* harmony import */ var _grammar_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36585);
29604
+
29605
+
29606
+ const grammar = new _grammar_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
29607
+ const parser = new apg_lite__WEBPACK_IMPORTED_MODULE_0__.Parser();
29608
+ const testArrayDash = referenceToken => {
29609
+ if (typeof referenceToken !== 'string') return false;
29610
+ try {
29611
+ return parser.parse(grammar, 'array-dash', referenceToken).success;
29612
+ } catch {
29613
+ return false;
29614
+ }
29615
+ };
29616
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (testArrayDash);
29617
+
29618
+ /***/ }),
29619
+
27553
29620
  /***/ 60493:
27554
29621
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
27555
29622
 
@@ -27761,6 +29828,92 @@ module.exports = {
27761
29828
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
27762
29829
  indexOf: createMethod(false)
27763
29830
  };
29831
+
29832
+
29833
+ /***/ }),
29834
+
29835
+ /***/ 61198:
29836
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
29837
+
29838
+ "use strict";
29839
+ __webpack_require__.r(__webpack_exports__);
29840
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
29841
+ /* harmony export */ ASTTranslator: () => (/* reexport safe */ _parse_translators_ASTTranslator_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]),
29842
+ /* harmony export */ CSTTranslator: () => (/* reexport safe */ _parse_translators_CSTTranslator_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]),
29843
+ /* harmony export */ EvaluationRealm: () => (/* reexport safe */ _evaluate_realms_EvaluationRealm_mjs__WEBPACK_IMPORTED_MODULE_16__["default"]),
29844
+ /* harmony export */ Grammar: () => (/* reexport safe */ _grammar_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]),
29845
+ /* harmony export */ JSONPointerCompileError: () => (/* reexport safe */ _errors_JSONPointerCompileError_mjs__WEBPACK_IMPORTED_MODULE_20__["default"]),
29846
+ /* harmony export */ JSONPointerError: () => (/* reexport safe */ _errors_JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_18__["default"]),
29847
+ /* harmony export */ JSONPointerEvaluateError: () => (/* reexport safe */ _errors_JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_21__["default"]),
29848
+ /* harmony export */ JSONPointerIndexError: () => (/* reexport safe */ _errors_JSONPointerIndexError_mjs__WEBPACK_IMPORTED_MODULE_24__["default"]),
29849
+ /* harmony export */ JSONPointerKeyError: () => (/* reexport safe */ _errors_JSONPointerKeyError_mjs__WEBPACK_IMPORTED_MODULE_23__["default"]),
29850
+ /* harmony export */ JSONPointerParseError: () => (/* reexport safe */ _errors_JSONPointerParseError_mjs__WEBPACK_IMPORTED_MODULE_19__["default"]),
29851
+ /* harmony export */ JSONPointerTypeError: () => (/* reexport safe */ _errors_JSONPointerTypeError_mjs__WEBPACK_IMPORTED_MODULE_22__["default"]),
29852
+ /* harmony export */ JSONString: () => (/* reexport module object */ _representation_json_string_mjs__WEBPACK_IMPORTED_MODULE_0__),
29853
+ /* harmony export */ URIFragmentIdentifier: () => (/* reexport module object */ _representation_uri_fragment_identifier_mjs__WEBPACK_IMPORTED_MODULE_1__),
29854
+ /* harmony export */ XMLTranslator: () => (/* reexport safe */ _parse_translators_XMLTranslator_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]),
29855
+ /* harmony export */ compile: () => (/* reexport safe */ _compile_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]),
29856
+ /* harmony export */ composeRealms: () => (/* reexport safe */ _evaluate_realms_compose_mjs__WEBPACK_IMPORTED_MODULE_17__["default"]),
29857
+ /* harmony export */ escape: () => (/* reexport safe */ _escape_mjs__WEBPACK_IMPORTED_MODULE_13__["default"]),
29858
+ /* harmony export */ evaluate: () => (/* reexport safe */ _evaluate_index_mjs__WEBPACK_IMPORTED_MODULE_15__["default"]),
29859
+ /* harmony export */ parse: () => (/* reexport safe */ _parse_index_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]),
29860
+ /* harmony export */ testArrayDash: () => (/* reexport safe */ _test_array_dash_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]),
29861
+ /* harmony export */ testArrayIndex: () => (/* reexport safe */ _test_array_index_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]),
29862
+ /* harmony export */ testArrayLocation: () => (/* reexport safe */ _test_array_location_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]),
29863
+ /* harmony export */ testJSONPointer: () => (/* reexport safe */ _test_json_pointer_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
29864
+ /* harmony export */ testReferenceToken: () => (/* reexport safe */ _test_reference_token_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]),
29865
+ /* harmony export */ unescape: () => (/* reexport safe */ _unescape_mjs__WEBPACK_IMPORTED_MODULE_14__["default"])
29866
+ /* harmony export */ });
29867
+ /* harmony import */ var _representation_json_string_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(70204);
29868
+ /* harmony import */ var _representation_uri_fragment_identifier_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86181);
29869
+ /* harmony import */ var _grammar_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36585);
29870
+ /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8750);
29871
+ /* harmony import */ var _parse_translators_CSTTranslator_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(92802);
29872
+ /* harmony import */ var _parse_translators_ASTTranslator_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23020);
29873
+ /* harmony import */ var _parse_translators_XMLTranslator_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(70979);
29874
+ /* harmony import */ var _test_json_pointer_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(20439);
29875
+ /* harmony import */ var _test_reference_token_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(91560);
29876
+ /* harmony import */ var _test_array_location_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4896);
29877
+ /* harmony import */ var _test_array_index_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(22587);
29878
+ /* harmony import */ var _test_array_dash_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(60357);
29879
+ /* harmony import */ var _compile_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(96901);
29880
+ /* harmony import */ var _escape_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(27123);
29881
+ /* harmony import */ var _unescape_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(82182);
29882
+ /* harmony import */ var _evaluate_index_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(89274);
29883
+ /* harmony import */ var _evaluate_realms_EvaluationRealm_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(59408);
29884
+ /* harmony import */ var _evaluate_realms_compose_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(99799);
29885
+ /* harmony import */ var _errors_JSONPointerError_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(12008);
29886
+ /* harmony import */ var _errors_JSONPointerParseError_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(26490);
29887
+ /* harmony import */ var _errors_JSONPointerCompileError_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(42144);
29888
+ /* harmony import */ var _errors_JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(924);
29889
+ /* harmony import */ var _errors_JSONPointerTypeError_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(675);
29890
+ /* harmony import */ var _errors_JSONPointerKeyError_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(82414);
29891
+ /* harmony import */ var _errors_JSONPointerIndexError_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(2325);
29892
+
29893
+
29894
+
29895
+
29896
+
29897
+
29898
+
29899
+
29900
+
29901
+
29902
+
29903
+
29904
+
29905
+
29906
+
29907
+
29908
+
29909
+
29910
+
29911
+
29912
+
29913
+
29914
+
29915
+
29916
+
27764
29917
 
27765
29918
 
27766
29919
  /***/ }),
@@ -30675,6 +32828,28 @@ const createPredicate = predicateCreator => {
30675
32828
 
30676
32829
  /***/ }),
30677
32830
 
32831
+ /***/ 70204:
32832
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
32833
+
32834
+ "use strict";
32835
+ __webpack_require__.r(__webpack_exports__);
32836
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32837
+ /* harmony export */ from: () => (/* binding */ from),
32838
+ /* harmony export */ to: () => (/* binding */ to)
32839
+ /* harmony export */ });
32840
+ const to = jsonPointer => {
32841
+ return JSON.stringify(jsonPointer);
32842
+ };
32843
+ const from = jsonString => {
32844
+ try {
32845
+ return String(JSON.parse(jsonString));
32846
+ } catch {
32847
+ return jsonString;
32848
+ }
32849
+ };
32850
+
32851
+ /***/ }),
32852
+
30678
32853
  /***/ 70369:
30679
32854
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
30680
32855
 
@@ -31129,6 +33304,25 @@ class YamlScalar extends _YamlNode_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
31129
33304
 
31130
33305
  /***/ }),
31131
33306
 
33307
+ /***/ 70979:
33308
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
33309
+
33310
+ "use strict";
33311
+ __webpack_require__.r(__webpack_exports__);
33312
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33313
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
33314
+ /* harmony export */ });
33315
+ /* harmony import */ var _CSTTranslator_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92802);
33316
+
33317
+ class XMLTranslator extends _CSTTranslator_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
33318
+ getTree() {
33319
+ return this.toXml();
33320
+ }
33321
+ }
33322
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (XMLTranslator);
33323
+
33324
+ /***/ }),
33325
+
31132
33326
  /***/ 71020:
31133
33327
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
31134
33328
 
@@ -35008,6 +37202,24 @@ var isNotUndefined = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(_isUndefi
35008
37202
 
35009
37203
  /***/ }),
35010
37204
 
37205
+ /***/ 82182:
37206
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
37207
+
37208
+ "use strict";
37209
+ __webpack_require__.r(__webpack_exports__);
37210
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
37211
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
37212
+ /* harmony export */ });
37213
+ const unescape = referenceToken => {
37214
+ if (typeof referenceToken !== 'string') {
37215
+ throw new TypeError('Reference token must be a string');
37216
+ }
37217
+ return referenceToken.replace(/~1/g, '/').replace(/~0/g, '~');
37218
+ };
37219
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (unescape);
37220
+
37221
+ /***/ }),
37222
+
35011
37223
  /***/ 82258:
35012
37224
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35013
37225
 
@@ -35091,6 +37303,21 @@ class KeyValuePair {
35091
37303
  module.exports = KeyValuePair;
35092
37304
 
35093
37305
 
37306
+ /***/ }),
37307
+
37308
+ /***/ 82414:
37309
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
37310
+
37311
+ "use strict";
37312
+ __webpack_require__.r(__webpack_exports__);
37313
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
37314
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
37315
+ /* harmony export */ });
37316
+ /* harmony import */ var _JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(924);
37317
+
37318
+ class JSONPointerKeyError extends _JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {}
37319
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JSONPointerKeyError);
37320
+
35094
37321
  /***/ }),
35095
37322
 
35096
37323
  /***/ 82719:
@@ -35777,6 +38004,23 @@ module.exports = function (it) {
35777
38004
  };
35778
38005
 
35779
38006
 
38007
+ /***/ }),
38008
+
38009
+ /***/ 83421:
38010
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
38011
+
38012
+ "use strict";
38013
+ __webpack_require__.r(__webpack_exports__);
38014
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
38015
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
38016
+ /* harmony export */ });
38017
+ class Expectations extends Array {
38018
+ toString() {
38019
+ return this.map(c => `"${String(c)}"`).join(', ');
38020
+ }
38021
+ }
38022
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Expectations);
38023
+
35780
38024
  /***/ }),
35781
38025
 
35782
38026
  /***/ 83479:
@@ -36730,6 +38974,30 @@ var hasPath = /*#__PURE__*/(0,_internal_curry2_js__WEBPACK_IMPORTED_MODULE_0__["
36730
38974
 
36731
38975
  /***/ }),
36732
38976
 
38977
+ /***/ 86181:
38978
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
38979
+
38980
+ "use strict";
38981
+ __webpack_require__.r(__webpack_exports__);
38982
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
38983
+ /* harmony export */ from: () => (/* binding */ from),
38984
+ /* harmony export */ to: () => (/* binding */ to)
38985
+ /* harmony export */ });
38986
+ const to = jsonPointer => {
38987
+ const encodedFragment = [...jsonPointer].map(char => /^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/.test(char) ? char : encodeURIComponent(char)).join('');
38988
+ return `#${encodedFragment}`;
38989
+ };
38990
+ const from = fragment => {
38991
+ try {
38992
+ const rfc3986Fragment = fragment.startsWith('#') ? fragment.slice(1) : fragment;
38993
+ return decodeURIComponent(rfc3986Fragment);
38994
+ } catch {
38995
+ return fragment;
38996
+ }
38997
+ };
38998
+
38999
+ /***/ }),
39000
+
36733
39001
  /***/ 86339:
36734
39002
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
36735
39003
 
@@ -36839,26 +39107,6 @@ class SecurityRequirement extends _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IM
36839
39107
 
36840
39108
  /***/ }),
36841
39109
 
36842
- /***/ 87129:
36843
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
36844
-
36845
- "use strict";
36846
- __webpack_require__.r(__webpack_exports__);
36847
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
36848
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
36849
- /* harmony export */ });
36850
- /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27567);
36851
- /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(98675);
36852
-
36853
-
36854
- /**
36855
- * @public
36856
- */
36857
- const escape = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])((0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(/~/g, '~0'), (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(/\//g, '~1'), encodeURIComponent);
36858
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (escape);
36859
-
36860
- /***/ }),
36861
-
36862
39110
  /***/ 87161:
36863
39111
  /***/ ((__unused_webpack_module, exports) => {
36864
39112
 
@@ -37418,6 +39666,174 @@ module.exports = function (input, pref) {
37418
39666
  };
37419
39667
 
37420
39668
 
39669
+ /***/ }),
39670
+
39671
+ /***/ 89274:
39672
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
39673
+
39674
+ "use strict";
39675
+ __webpack_require__.r(__webpack_exports__);
39676
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39677
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
39678
+ /* harmony export */ });
39679
+ /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8750);
39680
+ /* harmony import */ var _test_array_dash_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60357);
39681
+ /* harmony import */ var _test_array_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22587);
39682
+ /* harmony import */ var _trace_TraceBuilder_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56660);
39683
+ /* harmony import */ var _realms_json_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39150);
39684
+ /* harmony import */ var _errors_JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(924);
39685
+ /* harmony import */ var _errors_JSONPointerTypeError_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(675);
39686
+ /* harmony import */ var _errors_JSONPointerIndexError_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2325);
39687
+ /* harmony import */ var _errors_JSONPointerKeyError_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(82414);
39688
+
39689
+
39690
+
39691
+
39692
+
39693
+
39694
+
39695
+
39696
+
39697
+ const evaluate = (value, jsonPointer, {
39698
+ strictArrays = true,
39699
+ strictObjects = true,
39700
+ realm = new _realms_json_index_mjs__WEBPACK_IMPORTED_MODULE_3__["default"](),
39701
+ trace = true
39702
+ } = {}) => {
39703
+ const {
39704
+ result: parseResult,
39705
+ tree: referenceTokens,
39706
+ trace: parseTrace
39707
+ } = (0,_parse_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(jsonPointer, {
39708
+ trace: !!trace
39709
+ });
39710
+ const tracer = typeof trace === 'object' && trace !== null ? new _trace_TraceBuilder_mjs__WEBPACK_IMPORTED_MODULE_8__["default"](trace, {
39711
+ jsonPointer,
39712
+ referenceTokens,
39713
+ strictArrays,
39714
+ strictObjects,
39715
+ realm,
39716
+ value
39717
+ }) : null;
39718
+ try {
39719
+ let output;
39720
+ if (!parseResult.success) {
39721
+ let message = `Invalid JSON Pointer: "${jsonPointer}". Syntax error at position ${parseResult.maxMatched}`;
39722
+ message += parseTrace ? `, expected ${parseTrace.inferExpectations()}` : '';
39723
+ throw new _errors_JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_4__["default"](message, {
39724
+ jsonPointer,
39725
+ currentValue: value,
39726
+ realm: realm.name
39727
+ });
39728
+ }
39729
+ return referenceTokens.reduce((current, referenceToken, referenceTokenPosition) => {
39730
+ if (realm.isArray(current)) {
39731
+ if ((0,_test_array_dash_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(referenceToken)) {
39732
+ if (strictArrays) {
39733
+ throw new _errors_JSONPointerIndexError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"](`Invalid array index "-" at position ${referenceTokenPosition} in "${jsonPointer}". The "-" token always refers to a nonexistent element during evaluation`, {
39734
+ jsonPointer,
39735
+ referenceTokens,
39736
+ referenceToken,
39737
+ referenceTokenPosition,
39738
+ currentValue: current,
39739
+ realm: realm.name
39740
+ });
39741
+ } else {
39742
+ output = realm.evaluate(current, String(realm.sizeOf(current)));
39743
+ tracer === null || tracer === void 0 || tracer.step({
39744
+ referenceToken,
39745
+ input: current,
39746
+ output
39747
+ });
39748
+ return output;
39749
+ }
39750
+ }
39751
+ if (strictArrays && !(0,_test_array_index_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])(referenceToken)) {
39752
+ throw new _errors_JSONPointerIndexError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"](`Invalid array index "${referenceToken}" at position ${referenceTokenPosition} in "${jsonPointer}": index MUST be "0", or digits without a leading "0"`, {
39753
+ jsonPointer,
39754
+ referenceTokens,
39755
+ referenceToken,
39756
+ referenceTokenPosition,
39757
+ currentValue: current,
39758
+ realm: realm.name
39759
+ });
39760
+ }
39761
+ const index = Number(referenceToken);
39762
+ if (!Number.isSafeInteger(index)) {
39763
+ throw new _errors_JSONPointerIndexError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"](`Invalid array index "${referenceToken}" at position ${referenceTokenPosition} in "${jsonPointer}": index must be a safe integer`, {
39764
+ jsonPointer,
39765
+ referenceTokens,
39766
+ referenceToken,
39767
+ referenceTokenPosition,
39768
+ currentValue: current,
39769
+ realm: realm.name
39770
+ });
39771
+ }
39772
+ if (!realm.has(current, referenceToken) && strictArrays) {
39773
+ throw new _errors_JSONPointerIndexError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"](`Invalid array index "${referenceToken}" at position ${referenceTokenPosition} in "${jsonPointer}": out of bounds`, {
39774
+ jsonPointer,
39775
+ referenceTokens,
39776
+ referenceToken,
39777
+ referenceTokenPosition,
39778
+ currentValue: current,
39779
+ realm: realm.name
39780
+ });
39781
+ }
39782
+ output = realm.evaluate(current, referenceToken);
39783
+ tracer === null || tracer === void 0 || tracer.step({
39784
+ referenceToken,
39785
+ input: current,
39786
+ output
39787
+ });
39788
+ return output;
39789
+ }
39790
+ if (realm.isObject(current)) {
39791
+ if (!realm.has(current, referenceToken) && strictObjects) {
39792
+ throw new _errors_JSONPointerKeyError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"](`Invalid object key "${referenceToken}" at position ${referenceTokenPosition} in "${jsonPointer}": key not found in object`, {
39793
+ jsonPointer,
39794
+ referenceTokens,
39795
+ referenceToken,
39796
+ referenceTokenPosition,
39797
+ currentValue: current,
39798
+ realm: realm.name
39799
+ });
39800
+ }
39801
+ output = realm.evaluate(current, referenceToken);
39802
+ tracer === null || tracer === void 0 || tracer.step({
39803
+ referenceToken,
39804
+ input: current,
39805
+ output
39806
+ });
39807
+ return output;
39808
+ }
39809
+ throw new _errors_JSONPointerTypeError_mjs__WEBPACK_IMPORTED_MODULE_5__["default"](`Invalid reference token "${referenceToken}" at position ${referenceTokenPosition} in "${jsonPointer}": cannot be applied to a non-object/non-array value`, {
39810
+ jsonPointer,
39811
+ referenceTokens,
39812
+ referenceToken,
39813
+ referenceTokenPosition,
39814
+ currentValue: current,
39815
+ realm: realm.name
39816
+ });
39817
+ }, value);
39818
+ } catch (error) {
39819
+ tracer === null || tracer === void 0 || tracer.step({
39820
+ referenceToken: error.referenceToken,
39821
+ input: error.currentValue,
39822
+ success: false,
39823
+ reason: error.message
39824
+ });
39825
+ if (error instanceof _errors_JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]) {
39826
+ throw error;
39827
+ }
39828
+ throw new _errors_JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]('Unexpected error during JSON Pointer evaluation', {
39829
+ cause: error,
39830
+ jsonPointer,
39831
+ referenceTokens
39832
+ });
39833
+ }
39834
+ };
39835
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (evaluate);
39836
+
37421
39837
  /***/ }),
37422
39838
 
37423
39839
  /***/ 89319:
@@ -38966,6 +41382,32 @@ class SourceMap extends minim__WEBPACK_IMPORTED_MODULE_0__.ArrayElement {
38966
41382
 
38967
41383
  /***/ }),
38968
41384
 
41385
+ /***/ 91560:
41386
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
41387
+
41388
+ "use strict";
41389
+ __webpack_require__.r(__webpack_exports__);
41390
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
41391
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
41392
+ /* harmony export */ });
41393
+ /* harmony import */ var apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51751);
41394
+ /* harmony import */ var _grammar_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36585);
41395
+
41396
+
41397
+ const grammar = new _grammar_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
41398
+ const parser = new apg_lite__WEBPACK_IMPORTED_MODULE_0__.Parser();
41399
+ const testReferenceToken = referenceToken => {
41400
+ if (typeof referenceToken !== 'string') return false;
41401
+ try {
41402
+ return parser.parse(grammar, 'reference-token', referenceToken).success;
41403
+ } catch {
41404
+ return false;
41405
+ }
41406
+ };
41407
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (testReferenceToken);
41408
+
41409
+ /***/ }),
41410
+
38969
41411
  /***/ 91613:
38970
41412
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
38971
41413
 
@@ -39312,6 +41754,39 @@ var trimEnd = (0,_isFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(String.
39312
41754
 
39313
41755
  /***/ }),
39314
41756
 
41757
+ /***/ 92802:
41758
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
41759
+
41760
+ "use strict";
41761
+ __webpack_require__.r(__webpack_exports__);
41762
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
41763
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
41764
+ /* harmony export */ });
41765
+ /* harmony import */ var apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51751);
41766
+ /* harmony import */ var _callbacks_cst_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(52725);
41767
+
41768
+
41769
+ class CSTTranslator extends apg_lite__WEBPACK_IMPORTED_MODULE_0__.Ast {
41770
+ constructor() {
41771
+ super();
41772
+ this.callbacks['json-pointer'] = (0,_callbacks_cst_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])('json-pointer');
41773
+ this.callbacks['reference-token'] = (0,_callbacks_cst_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])('reference-token');
41774
+ this.callbacks['slash'] = (0,_callbacks_cst_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])('text');
41775
+ }
41776
+ getTree() {
41777
+ const data = {
41778
+ stack: [],
41779
+ root: null
41780
+ };
41781
+ this.translate(data);
41782
+ delete data.stack;
41783
+ return data;
41784
+ }
41785
+ }
41786
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CSTTranslator);
41787
+
41788
+ /***/ }),
41789
+
39315
41790
  /***/ 92935:
39316
41791
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
39317
41792
 
@@ -39320,7 +41795,7 @@ __webpack_require__.r(__webpack_exports__);
39320
41795
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39321
41796
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
39322
41797
  /* harmony export */ });
39323
- /* harmony import */ var _escape_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87129);
41798
+ /* harmony import */ var _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61198);
39324
41799
  /* harmony import */ var _errors_CompilationJsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41428);
39325
41800
 
39326
41801
 
@@ -39329,15 +41804,15 @@ __webpack_require__.r(__webpack_exports__);
39329
41804
  */
39330
41805
  const compile = tokens => {
39331
41806
  try {
39332
- if (tokens.length === 0) {
39333
- return '';
39334
- }
39335
- return `/${tokens.map(_escape_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]).join('/')}`;
41807
+ return _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__.URIFragmentIdentifier.to((0,_swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__.compile)(tokens)).slice(1);
39336
41808
  } catch (error) {
39337
- throw new _errors_CompilationJsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]('JSON Pointer compilation of tokens encountered an error.', {
39338
- tokens,
39339
- cause: error
39340
- });
41809
+ if (error instanceof _swaggerexpert_json_pointer__WEBPACK_IMPORTED_MODULE_0__.JSONPointerCompileError) {
41810
+ throw new _errors_CompilationJsonPointerError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](error.message, {
41811
+ tokens,
41812
+ cause: error
41813
+ });
41814
+ }
41815
+ throw error;
39341
41816
  }
39342
41817
  };
39343
41818
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (compile);
@@ -41226,6 +43701,43 @@ const specification = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(
41226
43701
 
41227
43702
  /***/ }),
41228
43703
 
43704
+ /***/ 96901:
43705
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
43706
+
43707
+ "use strict";
43708
+ __webpack_require__.r(__webpack_exports__);
43709
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
43710
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
43711
+ /* harmony export */ });
43712
+ /* harmony import */ var _escape_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27123);
43713
+ /* harmony import */ var _errors_JSONPointerCompileError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42144);
43714
+
43715
+
43716
+ const compile = referenceTokens => {
43717
+ if (!Array.isArray(referenceTokens)) {
43718
+ throw new TypeError('Reference tokens must be a list of strings or numbers');
43719
+ }
43720
+ try {
43721
+ if (referenceTokens.length === 0) {
43722
+ return '';
43723
+ }
43724
+ return `/${referenceTokens.map(referenceToken => {
43725
+ if (typeof referenceToken !== 'string' && typeof referenceToken !== 'number') {
43726
+ throw new TypeError('Reference token must be a string or number');
43727
+ }
43728
+ return (0,_escape_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(String(referenceToken));
43729
+ }).join('/')}`;
43730
+ } catch (error) {
43731
+ throw new _errors_JSONPointerCompileError_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]('Unexpected error during JSON Pointer compilation', {
43732
+ cause: error,
43733
+ referenceTokens
43734
+ });
43735
+ }
43736
+ };
43737
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (compile);
43738
+
43739
+ /***/ }),
43740
+
41229
43741
  /***/ 96903:
41230
43742
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
41231
43743
 
@@ -42172,6 +44684,64 @@ class HeaderContent extends _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0_
42172
44684
 
42173
44685
  /***/ }),
42174
44686
 
44687
+ /***/ 99799:
44688
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
44689
+
44690
+ "use strict";
44691
+ __webpack_require__.r(__webpack_exports__);
44692
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
44693
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
44694
+ /* harmony export */ });
44695
+ /* harmony import */ var _EvaluationRealm_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59408);
44696
+ /* harmony import */ var _errors_JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(924);
44697
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
44698
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
44699
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
44700
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
44701
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
44702
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
44703
+
44704
+
44705
+ var _CompositeEvaluationRealm_brand = /*#__PURE__*/new WeakSet();
44706
+ class CompositeEvaluationRealm extends _EvaluationRealm_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
44707
+ constructor(realms) {
44708
+ super();
44709
+ _classPrivateMethodInitSpec(this, _CompositeEvaluationRealm_brand);
44710
+ _defineProperty(this, "name", 'composite');
44711
+ _defineProperty(this, "realms", []);
44712
+ this.realms = realms;
44713
+ }
44714
+ isArray(node) {
44715
+ return _assertClassBrand(_CompositeEvaluationRealm_brand, this, _findRealm).call(this, node).isArray(node);
44716
+ }
44717
+ isObject(node) {
44718
+ return _assertClassBrand(_CompositeEvaluationRealm_brand, this, _findRealm).call(this, node).isObject(node);
44719
+ }
44720
+ sizeOf(node) {
44721
+ return _assertClassBrand(_CompositeEvaluationRealm_brand, this, _findRealm).call(this, node).sizeOf(node);
44722
+ }
44723
+ has(node, referenceToken) {
44724
+ return _assertClassBrand(_CompositeEvaluationRealm_brand, this, _findRealm).call(this, node).has(node, referenceToken);
44725
+ }
44726
+ evaluate(node, referenceToken) {
44727
+ return _assertClassBrand(_CompositeEvaluationRealm_brand, this, _findRealm).call(this, node).evaluate(node, referenceToken);
44728
+ }
44729
+ }
44730
+ function _findRealm(node) {
44731
+ for (const realm of this.realms) {
44732
+ if (realm.isArray(node) || realm.isObject(node)) {
44733
+ return realm;
44734
+ }
44735
+ }
44736
+ throw new _errors_JSONPointerEvaluateError_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]('No suitable evaluation realm found for value', {
44737
+ currentValue: node
44738
+ });
44739
+ }
44740
+ const compose = (...realms) => new CompositeEvaluationRealm(realms);
44741
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (compose);
44742
+
44743
+ /***/ }),
44744
+
42175
44745
  /***/ 99852:
42176
44746
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
42177
44747