@speclynx/apidom-core 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.2.1](https://github.com/speclynx/apidom/compare/v2.2.0...v2.2.1) (2026-01-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @speclynx/apidom-core
|
|
9
|
+
|
|
6
10
|
# [2.2.0](https://github.com/speclynx/apidom/compare/v2.1.0...v2.2.0) (2026-01-19)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @speclynx/apidom-core
|
|
@@ -1422,8 +1422,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1422
1422
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1423
1423
|
/* harmony export */ Path: () => (/* binding */ Path)
|
|
1424
1424
|
/* harmony export */ });
|
|
1425
|
-
/* harmony import */ var
|
|
1426
|
-
/* harmony import */ var
|
|
1425
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5162);
|
|
1426
|
+
/* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1198);
|
|
1427
|
+
/* harmony import */ var _speclynx_apidom_json_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3204);
|
|
1428
|
+
|
|
1427
1429
|
|
|
1428
1430
|
|
|
1429
1431
|
|
|
@@ -1565,14 +1567,34 @@ class Path {
|
|
|
1565
1567
|
}
|
|
1566
1568
|
|
|
1567
1569
|
/**
|
|
1568
|
-
* Get the path from root as an array of keys.
|
|
1570
|
+
* Get the semantic path from root as an array of keys.
|
|
1571
|
+
* Returns logical document keys (property names, array indices) rather than
|
|
1572
|
+
* internal ApiDOM structure keys.
|
|
1573
|
+
*
|
|
1574
|
+
* @example
|
|
1575
|
+
* // For a path to $.paths['/pets'].get in an OpenAPI document:
|
|
1576
|
+
* path.getPathKeys(); // => ['paths', '/pets', 'get']
|
|
1569
1577
|
*/
|
|
1570
1578
|
getPathKeys() {
|
|
1571
1579
|
const keys = [];
|
|
1572
1580
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
1573
1581
|
let current = this;
|
|
1574
1582
|
while (current !== null && current.key !== undefined) {
|
|
1575
|
-
|
|
1583
|
+
const {
|
|
1584
|
+
key,
|
|
1585
|
+
parent,
|
|
1586
|
+
parentPath
|
|
1587
|
+
} = current;
|
|
1588
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isMemberElement)(parent) && key === 'value') {
|
|
1589
|
+
// Inside MemberElement.value → push the member's key
|
|
1590
|
+
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(parent.key)) {
|
|
1591
|
+
throw new TypeError('MemberElement.key must be a StringElement');
|
|
1592
|
+
}
|
|
1593
|
+
keys.unshift(parent.key.toValue());
|
|
1594
|
+
} else if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isArrayElement)(parentPath?.node) && typeof key === 'number') {
|
|
1595
|
+
// Inside ArrayElement → push the numeric index
|
|
1596
|
+
keys.unshift(key);
|
|
1597
|
+
}
|
|
1576
1598
|
current = current.parentPath;
|
|
1577
1599
|
}
|
|
1578
1600
|
return keys;
|
|
@@ -1608,11 +1630,11 @@ class Path {
|
|
|
1608
1630
|
}
|
|
1609
1631
|
if (pathFormat === 'jsonpath') {
|
|
1610
1632
|
// RFC 9535 Normalized JSONPath
|
|
1611
|
-
return
|
|
1633
|
+
return _speclynx_apidom_json_path__WEBPACK_IMPORTED_MODULE_2__.NormalizedPath.from(parts);
|
|
1612
1634
|
}
|
|
1613
1635
|
|
|
1614
1636
|
// RFC 6901 JSON Pointer
|
|
1615
|
-
return (0,
|
|
1637
|
+
return (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_1__.compile)(parts);
|
|
1616
1638
|
}
|
|
1617
1639
|
|
|
1618
1640
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.apidomCore=t():e.apidomCore=t()}(self,()=>(()=>{"use strict";var e={279:e=>{var t=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(t,r,s)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s,a=(e,t)=>{for(var r in t||(t={}))n.call(t,r)&&o(e,r,t[r]);if(s)for(var r of s(t))i.call(t,r)&&o(e,r,t[r]);return e},c=(e,t,r)=>o(e,"symbol"!=typeof t?t+"":t,r),l={};((t,r)=>{for(var s in r)e(t,s,{get:r[s],enumerable:!0})})(l,{DEFAULT_OPTIONS:()=>p,DEFAULT_UUID_LENGTH:()=>u,default:()=>f});var u=6,p={dictionary:"alphanum",shuffle:!0,debug:!1,length:u,counter:0},h=class{constructor(e={}){c(this,"counter"),c(this,"debug"),c(this,"dict"),c(this,"version"),c(this,"dictIndex",0),c(this,"dictRange",[]),c(this,"lowerBound",0),c(this,"upperBound",0),c(this,"dictLength",0),c(this,"uuidLength"),c(this,"_digit_first_ascii",48),c(this,"_digit_last_ascii",58),c(this,"_alpha_lower_first_ascii",97),c(this,"_alpha_lower_last_ascii",123),c(this,"_hex_last_ascii",103),c(this,"_alpha_upper_first_ascii",65),c(this,"_alpha_upper_last_ascii",91),c(this,"_number_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii]}),c(this,"_alpha_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alpha_lower_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),c(this,"_alpha_upper_dict_ranges",{upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alphanum_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alphanum_lower_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),c(this,"_alphanum_upper_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_hex_dict_ranges",{decDigits:[this._digit_first_ascii,this._digit_last_ascii],alphaDigits:[this._alpha_lower_first_ascii,this._hex_last_ascii]}),c(this,"_dict_ranges",{_number_dict_ranges:this._number_dict_ranges,_alpha_dict_ranges:this._alpha_dict_ranges,_alpha_lower_dict_ranges:this._alpha_lower_dict_ranges,_alpha_upper_dict_ranges:this._alpha_upper_dict_ranges,_alphanum_dict_ranges:this._alphanum_dict_ranges,_alphanum_lower_dict_ranges:this._alphanum_lower_dict_ranges,_alphanum_upper_dict_ranges:this._alphanum_upper_dict_ranges,_hex_dict_ranges:this._hex_dict_ranges}),c(this,"log",(...e)=>{const t=[...e];t[0]="[short-unique-id] ".concat(e[0]),!0!==this.debug||"undefined"==typeof console||null===console||console.log(...t)}),c(this,"_normalizeDictionary",(e,t)=>{let r;if(e&&Array.isArray(e)&&e.length>1)r=e;else{r=[],this.dictIndex=0;const t="_".concat(e,"_dict_ranges"),s=this._dict_ranges[t];let n=0;for(const[,e]of Object.entries(s)){const[t,r]=e;n+=Math.abs(r-t)}r=new Array(n);let i=0;for(const[,e]of Object.entries(s)){this.dictRange=e,this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1];const t=this.lowerBound<=this.upperBound,s=this.lowerBound,n=this.upperBound;if(t)for(let e=s;e<n;e++)r[i++]=String.fromCharCode(e),this.dictIndex=e;else for(let e=s;e>n;e--)r[i++]=String.fromCharCode(e),this.dictIndex=e}r.length=i}if(t){for(let e=r.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[r[e],r[t]]=[r[t],r[e]]}}return r}),c(this,"setDictionary",(e,t)=>{this.dict=this._normalizeDictionary(e,t),this.dictLength=this.dict.length,this.setCounter(0)}),c(this,"seq",()=>this.sequentialUUID()),c(this,"sequentialUUID",()=>{const e=this.dictLength,t=this.dict;let r=this.counter;const s=[];do{const n=r%e;r=Math.trunc(r/e),s.push(t[n])}while(0!==r);const n=s.join("");return this.counter+=1,n}),c(this,"rnd",(e=this.uuidLength||u)=>this.randomUUID(e)),c(this,"randomUUID",(e=this.uuidLength||u)=>{if(null==e||e<1)throw new Error("Invalid UUID Length Provided");const t=new Array(e),r=this.dictLength,s=this.dict;for(let n=0;n<e;n++){const e=Math.floor(Math.random()*r);t[n]=s[e]}return t.join("")}),c(this,"fmt",(e,t)=>this.formattedUUID(e,t)),c(this,"formattedUUID",(e,t)=>{const r={$r:this.randomUUID,$s:this.sequentialUUID,$t:this.stamp};return e.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,e=>{const s=e.slice(0,2),n=Number.parseInt(e.slice(2),10);return"$s"===s?r[s]().padStart(n,"0"):"$t"===s&&t?r[s](n,t):r[s](n)})}),c(this,"availableUUIDs",(e=this.uuidLength)=>Number.parseFloat(([...new Set(this.dict)].length**e).toFixed(0))),c(this,"_collisionCache",new Map),c(this,"approxMaxBeforeCollision",(e=this.availableUUIDs(this.uuidLength))=>{const t=e,r=this._collisionCache.get(t);if(void 0!==r)return r;const s=Number.parseFloat(Math.sqrt(Math.PI/2*e).toFixed(20));return this._collisionCache.set(t,s),s}),c(this,"collisionProbability",(e=this.availableUUIDs(this.uuidLength),t=this.uuidLength)=>Number.parseFloat((this.approxMaxBeforeCollision(e)/this.availableUUIDs(t)).toFixed(20))),c(this,"uniqueness",(e=this.availableUUIDs(this.uuidLength))=>{const t=Number.parseFloat((1-this.approxMaxBeforeCollision(e)/e).toFixed(20));return t>1?1:t<0?0:t}),c(this,"getVersion",()=>this.version),c(this,"stamp",(e,t)=>{const r=Math.floor(+(t||new Date)/1e3).toString(16);if("number"==typeof e&&0===e)return r;if("number"!=typeof e||e<10)throw new Error(["Param finalLength must be a number greater than or equal to 10,","or 0 if you want the raw hexadecimal timestamp"].join("\n"));const s=e-9,n=Math.round(Math.random()*(s>15?15:s)),i=this.randomUUID(s);return"".concat(i.substring(0,n)).concat(r).concat(i.substring(n)).concat(n.toString(16))}),c(this,"parseStamp",(e,t)=>{if(t&&!/t0|t[1-9]\d{1,}/.test(t))throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");const r=t?t.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,e=>{const t={$r:e=>[...Array(e)].map(()=>"r").join(""),$s:e=>[...Array(e)].map(()=>"s").join(""),$t:e=>[...Array(e)].map(()=>"t").join("")},r=e.slice(0,2),s=Number.parseInt(e.slice(2),10);return t[r](s)}).replace(/^(.*?)(t{8,})(.*)$/g,(t,r,s)=>e.substring(r.length,r.length+s.length)):e;if(8===r.length)return new Date(1e3*Number.parseInt(r,16));if(r.length<10)throw new Error("Stamp length invalid");const s=Number.parseInt(r.substring(r.length-1),16);return new Date(1e3*Number.parseInt(r.substring(s,s+8),16))}),c(this,"setCounter",e=>{this.counter=e}),c(this,"validate",(e,t)=>{const r=t?this._normalizeDictionary(t):this.dict;return e.split("").every(e=>r.includes(e))});const t=a(a({},p),e);this.counter=0,this.debug=!1,this.dict=[],this.version="5.3.2";const{dictionary:r,shuffle:s,length:n,counter:i}=t;this.uuidLength=n,this.setDictionary(r,s),this.setCounter(i),this.debug=t.debug,this.log(this.dict),this.log("Generator instantiated with Dictionary Size ".concat(this.dictLength," and counter set to ").concat(this.counter)),this.log=this.log.bind(this),this.setDictionary=this.setDictionary.bind(this),this.setCounter=this.setCounter.bind(this),this.seq=this.seq.bind(this),this.sequentialUUID=this.sequentialUUID.bind(this),this.rnd=this.rnd.bind(this),this.randomUUID=this.randomUUID.bind(this),this.fmt=this.fmt.bind(this),this.formattedUUID=this.formattedUUID.bind(this),this.availableUUIDs=this.availableUUIDs.bind(this),this.approxMaxBeforeCollision=this.approxMaxBeforeCollision.bind(this),this.collisionProbability=this.collisionProbability.bind(this),this.uniqueness=this.uniqueness.bind(this),this.getVersion=this.getVersion.bind(this),this.stamp=this.stamp.bind(this),this.parseStamp=this.parseStamp.bind(this)}};c(h,"default",h);var d,f=h;return d=l,((s,i,o,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of r(i))n.call(s,c)||c===o||e(s,c,{get:()=>i[c],enumerable:!(a=t(i,c))||a.enumerable});return s})(e({},"__esModule",{value:!0}),d)})();e.exports=t.default,"undefined"!=typeof window&&(t=t.default)}},t={};function r(s){var n=t[s];if(void 0!==n)return n.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};r.r(s),r.d(s,{ElementIdentityError:()=>ds,IdentityManager:()=>fs,MediaTypes:()=>ws,Transcluder:()=>Is,createToolbox:()=>cs,deepmerge:()=>dn,defaultIdentityManager:()=>ms,dehydrate:()=>on,dispatchRefractorPlugins:()=>us,from:()=>en,mergeLeft:()=>gn,mergeRight:()=>mn,refractorPluginElementIdentity:()=>ys,refractorPluginSemanticElementIdentity:()=>gs,resolveSpecification:()=>Zs,sexprs:()=>cn,toJSON:()=>rn,toString:()=>an,toValue:()=>tn,toYAML:()=>nn,transclude:()=>As});const n=function(){const e=o,t=i,r=this,s="parser.js: Parser(): ";r.ast=void 0,r.stats=void 0,r.trace=void 0,r.callbacks=[];let n,a,c,l,u,p,h,d=0,f=0,m=0,y=0,g=0,x=new function(){this.state=e.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=e.ACTIVE,this.phraseLength=0}};r.parse=(i,o,b,w)=>{const k=`${s}parse(): `;d=0,f=0,m=0,y=0,g=0,n=void 0,a=void 0,c=void 0,l=void 0,x.refresh(),u=void 0,p=void 0,h=void 0,l=t.stringToChars(b),n=i.rules,a=i.udts;const _=o.toLowerCase();let E;for(const e in n)if(n.hasOwnProperty(e)&&_===n[e].lower){E=n[e].index;break}if(void 0===E)throw new Error(`${k}start rule name '${startRule}' not recognized`);(()=>{const e=`${s}initializeCallbacks(): `;let t,i;for(u=[],p=[],t=0;t<n.length;t+=1)u[t]=void 0;for(t=0;t<a.length;t+=1)p[t]=void 0;const o=[];for(t=0;t<n.length;t+=1)o.push(n[t].lower);for(t=0;t<a.length;t+=1)o.push(a[t].lower);for(const s in r.callbacks)if(r.callbacks.hasOwnProperty(s)){if(t=o.indexOf(s.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${s}' not a rule or udt name`);if(i=r.callbacks[s]?r.callbacks[s]:void 0,"function"!=typeof i&&void 0!==i)throw new Error(`${e}syntax callback[${s}] must be function reference or falsy)`);t<n.length?u[t]=i:p[t-n.length]=i}})(),r.trace&&r.trace.init(n,a,l),r.stats&&r.stats.init(n,a),r.ast&&r.ast.init(n,a,l),h=w,c=[{type:e.RNM,index:E}],v(0,0),c=void 0;let A=!1;switch(x.state){case e.ACTIVE:throw new Error(`${k}final state should never be 'ACTIVE'`);case e.NOMATCH:A=!1;break;case e.EMPTY:case e.MATCH:A=x.phraseLength===l.length;break;default:throw new Error("unrecognized state")}return{success:A,state:x.state,stateName:e.idName(x.state),length:l.length,matched:x.phraseLength,maxMatched:g,maxTreeDepth:m,nodeHits:y}};const b=(t,r,n,i)=>{if(r.phraseLength>n){let e=`${s}opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${n}`,new Error(e)}switch(r.state){case e.ACTIVE:if(!i)throw new Error(`${s}opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:r.phraseLength=0;break;case e.MATCH:0===r.phraseLength&&(r.state=e.EMPTY);break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${s}opRNM(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}},w=(t,i)=>{let o,u,f;const m=c[t],y=a[m.index];x.UdtIndex=y.index,d||(f=r.ast&&r.ast.udtDefined(m.index),f&&(u=n.length+m.index,o=r.ast.getLength(),r.ast.down(u,y.name)));const g=l.length-i;p[m.index](x,l,i,h),((t,r,n)=>{if(r.phraseLength>n){let e=`${s}opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${n}`,new Error(e)}switch(r.state){case e.ACTIVE:throw new Error(`${s}opUDT(${t.name}) ACTIVE state return not allowed.`);case e.EMPTY:if(!t.empty)throw new Error(`${s}opUDT(${t.name}) may not return EMPTY.`);r.phraseLength=0;break;case e.MATCH:if(0===r.phraseLength){if(!t.empty)throw new Error(`${s}opUDT(${t.name}) may not return EMPTY.`);r.state=e.EMPTY}break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${s}opUDT(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}})(y,x,g),d||f&&(x.state===e.NOMATCH?r.ast.setLength(o):r.ast.up(u,y.name,i,x.phraseLength))},v=(t,i)=>{const o=`${s}opExecute(): `,a=c[t];switch(y+=1,f>m&&(m=f),f+=1,x.refresh(),r.trace&&r.trace.down(a,i),a.type){case e.ALT:((t,r)=>{const s=c[t];for(let t=0;t<s.children.length&&(v(s.children[t],r),x.state===e.NOMATCH);t+=1);})(t,i);break;case e.CAT:((t,s)=>{let n,i,o,a;const l=c[t];r.ast&&(i=r.ast.getLength()),n=!0,o=s,a=0;for(let t=0;t<l.children.length;t+=1){if(v(l.children[t],o),x.state===e.NOMATCH){n=!1;break}o+=x.phraseLength,a+=x.phraseLength}n?(x.state=0===a?e.EMPTY:e.MATCH,x.phraseLength=a):(x.state=e.NOMATCH,x.phraseLength=0,r.ast&&r.ast.setLength(i))})(t,i);break;case e.REP:((t,s)=>{let n,i,o,a;const u=c[t];if(0===u.max)return x.state=e.EMPTY,void(x.phraseLength=0);for(i=s,o=0,a=0,r.ast&&(n=r.ast.getLength());!(i>=l.length)&&(v(t+1,i),x.state!==e.NOMATCH)&&x.state!==e.EMPTY&&(a+=1,o+=x.phraseLength,i+=x.phraseLength,a!==u.max););x.state===e.EMPTY||a>=u.min?(x.state=0===o?e.EMPTY:e.MATCH,x.phraseLength=o):(x.state=e.NOMATCH,x.phraseLength=0,r.ast&&r.ast.setLength(n))})(t,i);break;case e.RNM:((t,s)=>{let i,o,a;const p=c[t],f=n[p.index],m=u[f.index];if(d||(o=r.ast&&r.ast.ruleDefined(p.index),o&&(i=r.ast.getLength(),r.ast.down(p.index,n[p.index].name))),m){const t=l.length-s;m(x,l,s,h),b(f,x,t,!0),x.state===e.ACTIVE&&(a=c,c=f.opcodes,v(0,s),c=a,m(x,l,s,h),b(f,x,t,!1))}else a=c,c=f.opcodes,v(0,s,x),c=a;d||o&&(x.state===e.NOMATCH?r.ast.setLength(i):r.ast.up(p.index,f.name,s,x.phraseLength))})(t,i);break;case e.TRG:((t,r)=>{const s=c[t];x.state=e.NOMATCH,r<l.length&&s.min<=l[r]&&l[r]<=s.max&&(x.state=e.MATCH,x.phraseLength=1)})(t,i);break;case e.TBS:((t,r)=>{const s=c[t],n=s.string.length;if(x.state=e.NOMATCH,r+n<=l.length){for(let e=0;e<n;e+=1)if(l[r+e]!==s.string[e])return;x.state=e.MATCH,x.phraseLength=n}})(t,i);break;case e.TLS:((t,r)=>{let s;const n=c[t];x.state=e.NOMATCH;const i=n.string.length;if(0!==i){if(r+i<=l.length){for(let e=0;e<i;e+=1)if(s=l[r+e],s>=65&&s<=90&&(s+=32),s!==n.string[e])return;x.state=e.MATCH,x.phraseLength=i}}else x.state=e.EMPTY})(t,i);break;case e.UDT:w(t,i);break;case e.AND:((t,r)=>{switch(d+=1,v(t+1,r),d-=1,x.phraseLength=0,x.state){case e.EMPTY:case e.MATCH:x.state=e.EMPTY;break;case e.NOMATCH:x.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${x.state}`)}})(t,i);break;case e.NOT:((t,r)=>{switch(d+=1,v(t+1,r),d-=1,x.phraseLength=0,x.state){case e.EMPTY:case e.MATCH:x.state=e.NOMATCH;break;case e.NOMATCH:x.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${x.state}`)}})(t,i);break;default:throw new Error(`${o}unrecognized operator`)}d||i+x.phraseLength>g&&(g=i+x.phraseLength),r.stats&&r.stats.collect(a,x),r.trace&&r.trace.up(a,x.state,i,x.phraseLength),f-=1}},i={stringToChars:e=>[...e].map(e=>e.codePointAt(0)),charsToString:(e,t,r)=>{let s=e;for(;!(void 0===t||t<0);){if(void 0===r){s=e.slice(t);break}if(r<=0)return"";s=e.slice(t,t+r);break}return String.fromCodePoint(...s)}},o={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,idName:e=>{switch(e){case o.ALT:return"ALT";case o.CAT:return"CAT";case o.REP:return"REP";case o.RNM:return"RNM";case o.TRG:return"TRG";case o.TBS:return"TBS";case o.TLS:return"TLS";case o.UDT:return"UDT";case o.AND:return"AND";case o.NOT:return"NOT";case o.ACTIVE:return"ACTIVE";case o.EMPTY:return"EMPTY";case o.MATCH:return"MATCH";case o.NOMATCH:return"NOMATCH";case o.SEM_PRE:return"SEM_PRE";case o.SEM_POST:return"SEM_POST";case o.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};function a(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"json-pointer",lower:"json-pointer",index:0,isBkr:!1},this.rules[1]={name:"reference-token",lower:"reference-token",index:1,isBkr:!1},this.rules[2]={name:"unescaped",lower:"unescaped",index:2,isBkr:!1},this.rules[3]={name:"escaped",lower:"escaped",index:3,isBkr:!1},this.rules[4]={name:"array-location",lower:"array-location",index:4,isBkr:!1},this.rules[5]={name:"array-index",lower:"array-index",index:5,isBkr:!1},this.rules[6]={name:"array-dash",lower:"array-dash",index:6,isBkr:!1},this.rules[7]={name:"slash",lower:"slash",index:7,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:2,children:[2,3]},this.rules[0].opcodes[2]={type:4,index:7},this.rules[0].opcodes[3]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:1,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:2},this.rules[1].opcodes[3]={type:4,index:3},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3]},this.rules[2].opcodes[1]={type:5,min:0,max:46},this.rules[2].opcodes[2]={type:5,min:48,max:125},this.rules[2].opcodes[3]={type:5,min:127,max:1114111},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2]},this.rules[3].opcodes[1]={type:7,string:[126]},this.rules[3].opcodes[2]={type:1,children:[3,4]},this.rules[3].opcodes[3]={type:7,string:[48]},this.rules[3].opcodes[4]={type:7,string:[49]},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2]},this.rules[5].opcodes[1]={type:6,string:[48]},this.rules[5].opcodes[2]={type:2,children:[3,4]},this.rules[5].opcodes[3]={type:5,min:49,max:57},this.rules[5].opcodes[4]={type:3,min:0,max:1/0},this.rules[5].opcodes[5]={type:5,min:48,max:57},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:7,string:[45]},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:7,string:[47]},this.toString=function(){let e="";return e+="; JavaScript Object Notation (JSON) Pointer ABNF syntax\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901\n",e+="json-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\n",e+="reference-token = *( unescaped / escaped )\n",e+="unescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n",e+=" ; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'\n",e+='escaped = "~" ( "0" / "1" )\n',e+=" ; representing '~' and '/', respectively\n",e+="\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901#section-4\n",e+="array-location = array-index / array-dash\n",e+="array-index = %x30 / ( %x31-39 *(%x30-39) )\n",e+=' ; "0", or digits without a leading "0"\n',e+='array-dash = "-"\n',e+="\n",e+="; Surrogate named rules\n",e+='slash = "/"\n','; JavaScript Object Notation (JSON) Pointer ABNF syntax\n; https://datatracker.ietf.org/doc/html/rfc6901\njson-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\nreference-token = *( unescaped / escaped )\nunescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n ; %x2F (\'/\') and %x7E (\'~\') are excluded from \'unescaped\'\nescaped = "~" ( "0" / "1" )\n ; representing \'~\' and \'/\', respectively\n\n; https://datatracker.ietf.org/doc/html/rfc6901#section-4\narray-location = array-index / array-dash\narray-index = %x30 / ( %x31-39 *(%x30-39) )\n ; "0", or digits without a leading "0"\narray-dash = "-"\n\n; Surrogate named rules\nslash = "/"\n'}}class c extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}}const l=c;new a;new a,new n,new a,new n,new a,new n,new a,new n;const u=e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return String(e).replace(/~/g,"~0").replace(/\//g,"~1")};const p=class extends l{},h=e=>{if(!Array.isArray(e))throw new TypeError("Reference tokens must be a list of strings or numbers");try{return 0===e.length?"":`/${e.map(e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return u(String(e))}).join("/")}`}catch(t){throw new p("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}};class d extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.hasOwn(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}}const f=d;new function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"jsonpath-query",lower:"jsonpath-query",index:0,isBkr:!1},this.rules[1]={name:"segments",lower:"segments",index:1,isBkr:!1},this.rules[2]={name:"B",lower:"b",index:2,isBkr:!1},this.rules[3]={name:"S",lower:"s",index:3,isBkr:!1},this.rules[4]={name:"root-identifier",lower:"root-identifier",index:4,isBkr:!1},this.rules[5]={name:"selector",lower:"selector",index:5,isBkr:!1},this.rules[6]={name:"name-selector",lower:"name-selector",index:6,isBkr:!1},this.rules[7]={name:"string-literal",lower:"string-literal",index:7,isBkr:!1},this.rules[8]={name:"double-quoted",lower:"double-quoted",index:8,isBkr:!1},this.rules[9]={name:"single-quoted",lower:"single-quoted",index:9,isBkr:!1},this.rules[10]={name:"ESC",lower:"esc",index:10,isBkr:!1},this.rules[11]={name:"unescaped",lower:"unescaped",index:11,isBkr:!1},this.rules[12]={name:"escapable",lower:"escapable",index:12,isBkr:!1},this.rules[13]={name:"hexchar",lower:"hexchar",index:13,isBkr:!1},this.rules[14]={name:"non-surrogate",lower:"non-surrogate",index:14,isBkr:!1},this.rules[15]={name:"high-surrogate",lower:"high-surrogate",index:15,isBkr:!1},this.rules[16]={name:"low-surrogate",lower:"low-surrogate",index:16,isBkr:!1},this.rules[17]={name:"HEXDIG",lower:"hexdig",index:17,isBkr:!1},this.rules[18]={name:"wildcard-selector",lower:"wildcard-selector",index:18,isBkr:!1},this.rules[19]={name:"index-selector",lower:"index-selector",index:19,isBkr:!1},this.rules[20]={name:"int",lower:"int",index:20,isBkr:!1},this.rules[21]={name:"DIGIT1",lower:"digit1",index:21,isBkr:!1},this.rules[22]={name:"slice-selector",lower:"slice-selector",index:22,isBkr:!1},this.rules[23]={name:"start",lower:"start",index:23,isBkr:!1},this.rules[24]={name:"end",lower:"end",index:24,isBkr:!1},this.rules[25]={name:"step",lower:"step",index:25,isBkr:!1},this.rules[26]={name:"filter-selector",lower:"filter-selector",index:26,isBkr:!1},this.rules[27]={name:"logical-expr",lower:"logical-expr",index:27,isBkr:!1},this.rules[28]={name:"logical-or-expr",lower:"logical-or-expr",index:28,isBkr:!1},this.rules[29]={name:"logical-and-expr",lower:"logical-and-expr",index:29,isBkr:!1},this.rules[30]={name:"basic-expr",lower:"basic-expr",index:30,isBkr:!1},this.rules[31]={name:"paren-expr",lower:"paren-expr",index:31,isBkr:!1},this.rules[32]={name:"logical-not-op",lower:"logical-not-op",index:32,isBkr:!1},this.rules[33]={name:"test-expr",lower:"test-expr",index:33,isBkr:!1},this.rules[34]={name:"filter-query",lower:"filter-query",index:34,isBkr:!1},this.rules[35]={name:"rel-query",lower:"rel-query",index:35,isBkr:!1},this.rules[36]={name:"current-node-identifier",lower:"current-node-identifier",index:36,isBkr:!1},this.rules[37]={name:"comparison-expr",lower:"comparison-expr",index:37,isBkr:!1},this.rules[38]={name:"literal",lower:"literal",index:38,isBkr:!1},this.rules[39]={name:"comparable",lower:"comparable",index:39,isBkr:!1},this.rules[40]={name:"comparison-op",lower:"comparison-op",index:40,isBkr:!1},this.rules[41]={name:"singular-query",lower:"singular-query",index:41,isBkr:!1},this.rules[42]={name:"rel-singular-query",lower:"rel-singular-query",index:42,isBkr:!1},this.rules[43]={name:"abs-singular-query",lower:"abs-singular-query",index:43,isBkr:!1},this.rules[44]={name:"singular-query-segments",lower:"singular-query-segments",index:44,isBkr:!1},this.rules[45]={name:"name-segment",lower:"name-segment",index:45,isBkr:!1},this.rules[46]={name:"index-segment",lower:"index-segment",index:46,isBkr:!1},this.rules[47]={name:"number",lower:"number",index:47,isBkr:!1},this.rules[48]={name:"frac",lower:"frac",index:48,isBkr:!1},this.rules[49]={name:"exp",lower:"exp",index:49,isBkr:!1},this.rules[50]={name:"true",lower:"true",index:50,isBkr:!1},this.rules[51]={name:"false",lower:"false",index:51,isBkr:!1},this.rules[52]={name:"null",lower:"null",index:52,isBkr:!1},this.rules[53]={name:"function-name",lower:"function-name",index:53,isBkr:!1},this.rules[54]={name:"function-name-first",lower:"function-name-first",index:54,isBkr:!1},this.rules[55]={name:"function-name-char",lower:"function-name-char",index:55,isBkr:!1},this.rules[56]={name:"LCALPHA",lower:"lcalpha",index:56,isBkr:!1},this.rules[57]={name:"function-expr",lower:"function-expr",index:57,isBkr:!1},this.rules[58]={name:"function-argument",lower:"function-argument",index:58,isBkr:!1},this.rules[59]={name:"segment",lower:"segment",index:59,isBkr:!1},this.rules[60]={name:"child-segment",lower:"child-segment",index:60,isBkr:!1},this.rules[61]={name:"bracketed-selection",lower:"bracketed-selection",index:61,isBkr:!1},this.rules[62]={name:"member-name-shorthand",lower:"member-name-shorthand",index:62,isBkr:!1},this.rules[63]={name:"name-first",lower:"name-first",index:63,isBkr:!1},this.rules[64]={name:"name-char",lower:"name-char",index:64,isBkr:!1},this.rules[65]={name:"DIGIT",lower:"digit",index:65,isBkr:!1},this.rules[66]={name:"ALPHA",lower:"alpha",index:66,isBkr:!1},this.rules[67]={name:"descendant-segment",lower:"descendant-segment",index:67,isBkr:!1},this.rules[68]={name:"normalized-path",lower:"normalized-path",index:68,isBkr:!1},this.rules[69]={name:"normal-index-segment",lower:"normal-index-segment",index:69,isBkr:!1},this.rules[70]={name:"normal-selector",lower:"normal-selector",index:70,isBkr:!1},this.rules[71]={name:"normal-name-selector",lower:"normal-name-selector",index:71,isBkr:!1},this.rules[72]={name:"normal-single-quoted",lower:"normal-single-quoted",index:72,isBkr:!1},this.rules[73]={name:"normal-unescaped",lower:"normal-unescaped",index:73,isBkr:!1},this.rules[74]={name:"normal-escapable",lower:"normal-escapable",index:74,isBkr:!1},this.rules[75]={name:"normal-hexchar",lower:"normal-hexchar",index:75,isBkr:!1},this.rules[76]={name:"normal-HEXDIG",lower:"normal-hexdig",index:76,isBkr:!1},this.rules[77]={name:"normal-index-selector",lower:"normal-index-selector",index:77,isBkr:!1},this.rules[78]={name:"dot-prefix",lower:"dot-prefix",index:78,isBkr:!1},this.rules[79]={name:"double-dot-prefix",lower:"double-dot-prefix",index:79,isBkr:!1},this.rules[80]={name:"left-bracket",lower:"left-bracket",index:80,isBkr:!1},this.rules[81]={name:"right-bracket",lower:"right-bracket",index:81,isBkr:!1},this.rules[82]={name:"left-paren",lower:"left-paren",index:82,isBkr:!1},this.rules[83]={name:"right-paren",lower:"right-paren",index:83,isBkr:!1},this.rules[84]={name:"comma",lower:"comma",index:84,isBkr:!1},this.rules[85]={name:"colon",lower:"colon",index:85,isBkr:!1},this.rules[86]={name:"dquote",lower:"dquote",index:86,isBkr:!1},this.rules[87]={name:"squote",lower:"squote",index:87,isBkr:!1},this.rules[88]={name:"questionmark",lower:"questionmark",index:88,isBkr:!1},this.rules[89]={name:"disjunction",lower:"disjunction",index:89,isBkr:!1},this.rules[90]={name:"conjunction",lower:"conjunction",index:90,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,2]},this.rules[0].opcodes[1]={type:4,index:4},this.rules[0].opcodes[2]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:2,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:3},this.rules[1].opcodes[3]={type:4,index:59},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:6,string:[32]},this.rules[2].opcodes[2]={type:6,string:[9]},this.rules[2].opcodes[3]={type:6,string:[10]},this.rules[2].opcodes[4]={type:6,string:[13]},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:0,max:1/0},this.rules[3].opcodes[1]={type:4,index:2},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:7,string:[36]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[5].opcodes[1]={type:4,index:6},this.rules[5].opcodes[2]={type:4,index:18},this.rules[5].opcodes[3]={type:4,index:22},this.rules[5].opcodes[4]={type:4,index:19},this.rules[5].opcodes[5]={type:4,index:26},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:4,index:7},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,6]},this.rules[7].opcodes[1]={type:2,children:[2,3,5]},this.rules[7].opcodes[2]={type:4,index:86},this.rules[7].opcodes[3]={type:3,min:0,max:1/0},this.rules[7].opcodes[4]={type:4,index:8},this.rules[7].opcodes[5]={type:4,index:86},this.rules[7].opcodes[6]={type:2,children:[7,8,10]},this.rules[7].opcodes[7]={type:4,index:87},this.rules[7].opcodes[8]={type:3,min:0,max:1/0},this.rules[7].opcodes[9]={type:4,index:9},this.rules[7].opcodes[10]={type:4,index:87},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[8].opcodes[1]={type:4,index:11},this.rules[8].opcodes[2]={type:6,string:[39]},this.rules[8].opcodes[3]={type:2,children:[4,5]},this.rules[8].opcodes[4]={type:4,index:10},this.rules[8].opcodes[5]={type:6,string:[34]},this.rules[8].opcodes[6]={type:2,children:[7,8]},this.rules[8].opcodes[7]={type:4,index:10},this.rules[8].opcodes[8]={type:4,index:12},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:6,string:[34]},this.rules[9].opcodes[3]={type:2,children:[4,5]},this.rules[9].opcodes[4]={type:4,index:10},this.rules[9].opcodes[5]={type:6,string:[39]},this.rules[9].opcodes[6]={type:2,children:[7,8]},this.rules[9].opcodes[7]={type:4,index:10},this.rules[9].opcodes[8]={type:4,index:12},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[92]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[11].opcodes[1]={type:5,min:32,max:33},this.rules[11].opcodes[2]={type:5,min:35,max:38},this.rules[11].opcodes[3]={type:5,min:40,max:91},this.rules[11].opcodes[4]={type:5,min:93,max:55295},this.rules[11].opcodes[5]={type:5,min:57344,max:1114111},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[12].opcodes[1]={type:6,string:[98]},this.rules[12].opcodes[2]={type:6,string:[102]},this.rules[12].opcodes[3]={type:6,string:[110]},this.rules[12].opcodes[4]={type:6,string:[114]},this.rules[12].opcodes[5]={type:6,string:[116]},this.rules[12].opcodes[6]={type:7,string:[47]},this.rules[12].opcodes[7]={type:7,string:[92]},this.rules[12].opcodes[8]={type:2,children:[9,10]},this.rules[12].opcodes[9]={type:6,string:[117]},this.rules[12].opcodes[10]={type:4,index:13},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:1,children:[1,2]},this.rules[13].opcodes[1]={type:4,index:14},this.rules[13].opcodes[2]={type:2,children:[3,4,5,6]},this.rules[13].opcodes[3]={type:4,index:15},this.rules[13].opcodes[4]={type:7,string:[92]},this.rules[13].opcodes[5]={type:6,string:[117]},this.rules[13].opcodes[6]={type:4,index:16},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:1,children:[1,11]},this.rules[14].opcodes[1]={type:2,children:[2,9]},this.rules[14].opcodes[2]={type:1,children:[3,4,5,6,7,8]},this.rules[14].opcodes[3]={type:4,index:65},this.rules[14].opcodes[4]={type:7,string:[97]},this.rules[14].opcodes[5]={type:7,string:[98]},this.rules[14].opcodes[6]={type:7,string:[99]},this.rules[14].opcodes[7]={type:7,string:[101]},this.rules[14].opcodes[8]={type:7,string:[102]},this.rules[14].opcodes[9]={type:3,min:3,max:3},this.rules[14].opcodes[10]={type:4,index:17},this.rules[14].opcodes[11]={type:2,children:[12,13,14]},this.rules[14].opcodes[12]={type:7,string:[100]},this.rules[14].opcodes[13]={type:5,min:48,max:55},this.rules[14].opcodes[14]={type:3,min:2,max:2},this.rules[14].opcodes[15]={type:4,index:17},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2,7]},this.rules[15].opcodes[1]={type:7,string:[100]},this.rules[15].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[15].opcodes[3]={type:7,string:[56]},this.rules[15].opcodes[4]={type:7,string:[57]},this.rules[15].opcodes[5]={type:7,string:[97]},this.rules[15].opcodes[6]={type:7,string:[98]},this.rules[15].opcodes[7]={type:3,min:2,max:2},this.rules[15].opcodes[8]={type:4,index:17},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,2,7]},this.rules[16].opcodes[1]={type:7,string:[100]},this.rules[16].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[16].opcodes[3]={type:7,string:[99]},this.rules[16].opcodes[4]={type:7,string:[100]},this.rules[16].opcodes[5]={type:7,string:[101]},this.rules[16].opcodes[6]={type:7,string:[102]},this.rules[16].opcodes[7]={type:3,min:2,max:2},this.rules[16].opcodes[8]={type:4,index:17},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,2,3,4,5,6,7]},this.rules[17].opcodes[1]={type:4,index:65},this.rules[17].opcodes[2]={type:7,string:[97]},this.rules[17].opcodes[3]={type:7,string:[98]},this.rules[17].opcodes[4]={type:7,string:[99]},this.rules[17].opcodes[5]={type:7,string:[100]},this.rules[17].opcodes[6]={type:7,string:[101]},this.rules[17].opcodes[7]={type:7,string:[102]},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:7,string:[42]},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:4,index:20},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:1,children:[1,2]},this.rules[20].opcodes[1]={type:7,string:[48]},this.rules[20].opcodes[2]={type:2,children:[3,5,6]},this.rules[20].opcodes[3]={type:3,min:0,max:1},this.rules[20].opcodes[4]={type:7,string:[45]},this.rules[20].opcodes[5]={type:4,index:21},this.rules[20].opcodes[6]={type:3,min:0,max:1/0},this.rules[20].opcodes[7]={type:4,index:65},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:5,min:49,max:57},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:2,children:[1,5,6,7,11]},this.rules[22].opcodes[1]={type:3,min:0,max:1},this.rules[22].opcodes[2]={type:2,children:[3,4]},this.rules[22].opcodes[3]={type:4,index:23},this.rules[22].opcodes[4]={type:4,index:3},this.rules[22].opcodes[5]={type:4,index:85},this.rules[22].opcodes[6]={type:4,index:3},this.rules[22].opcodes[7]={type:3,min:0,max:1},this.rules[22].opcodes[8]={type:2,children:[9,10]},this.rules[22].opcodes[9]={type:4,index:24},this.rules[22].opcodes[10]={type:4,index:3},this.rules[22].opcodes[11]={type:3,min:0,max:1},this.rules[22].opcodes[12]={type:2,children:[13,14]},this.rules[22].opcodes[13]={type:4,index:85},this.rules[22].opcodes[14]={type:3,min:0,max:1},this.rules[22].opcodes[15]={type:2,children:[16,17]},this.rules[22].opcodes[16]={type:4,index:3},this.rules[22].opcodes[17]={type:4,index:25},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:4,index:20},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:4,index:20},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:4,index:20},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:2,children:[1,2,3]},this.rules[26].opcodes[1]={type:4,index:88},this.rules[26].opcodes[2]={type:4,index:3},this.rules[26].opcodes[3]={type:4,index:27},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:4,index:28},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:29},this.rules[28].opcodes[2]={type:3,min:0,max:1/0},this.rules[28].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[28].opcodes[4]={type:4,index:3},this.rules[28].opcodes[5]={type:4,index:89},this.rules[28].opcodes[6]={type:4,index:3},this.rules[28].opcodes[7]={type:4,index:29},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:2,children:[1,2]},this.rules[29].opcodes[1]={type:4,index:30},this.rules[29].opcodes[2]={type:3,min:0,max:1/0},this.rules[29].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[29].opcodes[4]={type:4,index:3},this.rules[29].opcodes[5]={type:4,index:90},this.rules[29].opcodes[6]={type:4,index:3},this.rules[29].opcodes[7]={type:4,index:30},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:1,children:[1,2,3]},this.rules[30].opcodes[1]={type:4,index:31},this.rules[30].opcodes[2]={type:4,index:37},this.rules[30].opcodes[3]={type:4,index:33},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:2,children:[1,5,6,7,8,9]},this.rules[31].opcodes[1]={type:3,min:0,max:1},this.rules[31].opcodes[2]={type:2,children:[3,4]},this.rules[31].opcodes[3]={type:4,index:32},this.rules[31].opcodes[4]={type:4,index:3},this.rules[31].opcodes[5]={type:4,index:82},this.rules[31].opcodes[6]={type:4,index:3},this.rules[31].opcodes[7]={type:4,index:27},this.rules[31].opcodes[8]={type:4,index:3},this.rules[31].opcodes[9]={type:4,index:83},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:7,string:[33]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:2,children:[1,5]},this.rules[33].opcodes[1]={type:3,min:0,max:1},this.rules[33].opcodes[2]={type:2,children:[3,4]},this.rules[33].opcodes[3]={type:4,index:32},this.rules[33].opcodes[4]={type:4,index:3},this.rules[33].opcodes[5]={type:1,children:[6,7]},this.rules[33].opcodes[6]={type:4,index:34},this.rules[33].opcodes[7]={type:4,index:57},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:1,children:[1,2]},this.rules[34].opcodes[1]={type:4,index:35},this.rules[34].opcodes[2]={type:4,index:0},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:2,children:[1,2]},this.rules[35].opcodes[1]={type:4,index:36},this.rules[35].opcodes[2]={type:4,index:1},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:7,string:[64]},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:2,children:[1,2,3,4,5]},this.rules[37].opcodes[1]={type:4,index:39},this.rules[37].opcodes[2]={type:4,index:3},this.rules[37].opcodes[3]={type:4,index:40},this.rules[37].opcodes[4]={type:4,index:3},this.rules[37].opcodes[5]={type:4,index:39},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[38].opcodes[1]={type:4,index:47},this.rules[38].opcodes[2]={type:4,index:7},this.rules[38].opcodes[3]={type:4,index:50},this.rules[38].opcodes[4]={type:4,index:51},this.rules[38].opcodes[5]={type:4,index:52},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:1,children:[1,2,3]},this.rules[39].opcodes[1]={type:4,index:41},this.rules[39].opcodes[2]={type:4,index:57},this.rules[39].opcodes[3]={type:4,index:38},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2,3,4,5,6]},this.rules[40].opcodes[1]={type:7,string:[61,61]},this.rules[40].opcodes[2]={type:7,string:[33,61]},this.rules[40].opcodes[3]={type:7,string:[60,61]},this.rules[40].opcodes[4]={type:7,string:[62,61]},this.rules[40].opcodes[5]={type:7,string:[60]},this.rules[40].opcodes[6]={type:7,string:[62]},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:1,children:[1,2]},this.rules[41].opcodes[1]={type:4,index:42},this.rules[41].opcodes[2]={type:4,index:43},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:4,index:36},this.rules[42].opcodes[2]={type:4,index:44},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:2,children:[1,2]},this.rules[43].opcodes[1]={type:4,index:4},this.rules[43].opcodes[2]={type:4,index:44},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:3,min:0,max:1/0},this.rules[44].opcodes[1]={type:2,children:[2,3]},this.rules[44].opcodes[2]={type:4,index:3},this.rules[44].opcodes[3]={type:1,children:[4,5]},this.rules[44].opcodes[4]={type:4,index:45},this.rules[44].opcodes[5]={type:4,index:46},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:1,children:[1,5]},this.rules[45].opcodes[1]={type:2,children:[2,3,4]},this.rules[45].opcodes[2]={type:4,index:80},this.rules[45].opcodes[3]={type:4,index:6},this.rules[45].opcodes[4]={type:4,index:81},this.rules[45].opcodes[5]={type:2,children:[6,7]},this.rules[45].opcodes[6]={type:4,index:78},this.rules[45].opcodes[7]={type:4,index:62},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:2,children:[1,2,3]},this.rules[46].opcodes[1]={type:4,index:80},this.rules[46].opcodes[2]={type:4,index:19},this.rules[46].opcodes[3]={type:4,index:81},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:2,children:[1,4,6]},this.rules[47].opcodes[1]={type:1,children:[2,3]},this.rules[47].opcodes[2]={type:4,index:20},this.rules[47].opcodes[3]={type:7,string:[45,48]},this.rules[47].opcodes[4]={type:3,min:0,max:1},this.rules[47].opcodes[5]={type:4,index:48},this.rules[47].opcodes[6]={type:3,min:0,max:1},this.rules[47].opcodes[7]={type:4,index:49},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:2,children:[1,2]},this.rules[48].opcodes[1]={type:7,string:[46]},this.rules[48].opcodes[2]={type:3,min:1,max:1/0},this.rules[48].opcodes[3]={type:4,index:65},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:2,children:[1,2,6]},this.rules[49].opcodes[1]={type:7,string:[101]},this.rules[49].opcodes[2]={type:3,min:0,max:1},this.rules[49].opcodes[3]={type:1,children:[4,5]},this.rules[49].opcodes[4]={type:7,string:[45]},this.rules[49].opcodes[5]={type:7,string:[43]},this.rules[49].opcodes[6]={type:3,min:1,max:1/0},this.rules[49].opcodes[7]={type:4,index:65},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[116,114,117,101]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[102,97,108,115,101]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[110,117,108,108]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:4,index:54},this.rules[53].opcodes[2]={type:3,min:0,max:1/0},this.rules[53].opcodes[3]={type:4,index:55},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:4,index:56},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:1,children:[1,2,3]},this.rules[55].opcodes[1]={type:4,index:54},this.rules[55].opcodes[2]={type:7,string:[95]},this.rules[55].opcodes[3]={type:4,index:65},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:5,min:97,max:122},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:2,children:[1,2,3,4,13,14]},this.rules[57].opcodes[1]={type:4,index:53},this.rules[57].opcodes[2]={type:4,index:82},this.rules[57].opcodes[3]={type:4,index:3},this.rules[57].opcodes[4]={type:3,min:0,max:1},this.rules[57].opcodes[5]={type:2,children:[6,7]},this.rules[57].opcodes[6]={type:4,index:58},this.rules[57].opcodes[7]={type:3,min:0,max:1/0},this.rules[57].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[57].opcodes[9]={type:4,index:3},this.rules[57].opcodes[10]={type:4,index:84},this.rules[57].opcodes[11]={type:4,index:3},this.rules[57].opcodes[12]={type:4,index:58},this.rules[57].opcodes[13]={type:4,index:3},this.rules[57].opcodes[14]={type:4,index:83},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[58].opcodes[1]={type:4,index:27},this.rules[58].opcodes[2]={type:4,index:34},this.rules[58].opcodes[3]={type:4,index:57},this.rules[58].opcodes[4]={type:4,index:38},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:1,children:[1,2]},this.rules[59].opcodes[1]={type:4,index:60},this.rules[59].opcodes[2]={type:4,index:67},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:1,children:[1,2]},this.rules[60].opcodes[1]={type:4,index:61},this.rules[60].opcodes[2]={type:2,children:[3,4]},this.rules[60].opcodes[3]={type:4,index:78},this.rules[60].opcodes[4]={type:1,children:[5,6]},this.rules[60].opcodes[5]={type:4,index:18},this.rules[60].opcodes[6]={type:4,index:62},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3,4,10,11]},this.rules[61].opcodes[1]={type:4,index:80},this.rules[61].opcodes[2]={type:4,index:3},this.rules[61].opcodes[3]={type:4,index:5},this.rules[61].opcodes[4]={type:3,min:0,max:1/0},this.rules[61].opcodes[5]={type:2,children:[6,7,8,9]},this.rules[61].opcodes[6]={type:4,index:3},this.rules[61].opcodes[7]={type:4,index:84},this.rules[61].opcodes[8]={type:4,index:3},this.rules[61].opcodes[9]={type:4,index:5},this.rules[61].opcodes[10]={type:4,index:3},this.rules[61].opcodes[11]={type:4,index:81},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:2,children:[1,2]},this.rules[62].opcodes[1]={type:4,index:63},this.rules[62].opcodes[2]={type:3,min:0,max:1/0},this.rules[62].opcodes[3]={type:4,index:64},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[63].opcodes[1]={type:4,index:66},this.rules[63].opcodes[2]={type:7,string:[95]},this.rules[63].opcodes[3]={type:5,min:128,max:55295},this.rules[63].opcodes[4]={type:5,min:57344,max:1114111},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:1,children:[1,2]},this.rules[64].opcodes[1]={type:4,index:63},this.rules[64].opcodes[2]={type:4,index:65},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:5,min:48,max:57},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:1,children:[1,2]},this.rules[66].opcodes[1]={type:5,min:65,max:90},this.rules[66].opcodes[2]={type:5,min:97,max:122},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:2,children:[1,2]},this.rules[67].opcodes[1]={type:4,index:79},this.rules[67].opcodes[2]={type:1,children:[3,4,5]},this.rules[67].opcodes[3]={type:4,index:61},this.rules[67].opcodes[4]={type:4,index:18},this.rules[67].opcodes[5]={type:4,index:62},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:2,children:[1,2]},this.rules[68].opcodes[1]={type:4,index:4},this.rules[68].opcodes[2]={type:3,min:0,max:1/0},this.rules[68].opcodes[3]={type:4,index:69},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:2,children:[1,2,3]},this.rules[69].opcodes[1]={type:4,index:80},this.rules[69].opcodes[2]={type:4,index:70},this.rules[69].opcodes[3]={type:4,index:81},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:1,children:[1,2]},this.rules[70].opcodes[1]={type:4,index:71},this.rules[70].opcodes[2]={type:4,index:77},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:2,children:[1,2,4]},this.rules[71].opcodes[1]={type:4,index:87},this.rules[71].opcodes[2]={type:3,min:0,max:1/0},this.rules[71].opcodes[3]={type:4,index:72},this.rules[71].opcodes[4]={type:4,index:87},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:1,children:[1,2]},this.rules[72].opcodes[1]={type:4,index:73},this.rules[72].opcodes[2]={type:2,children:[3,4]},this.rules[72].opcodes[3]={type:4,index:10},this.rules[72].opcodes[4]={type:4,index:74},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[73].opcodes[1]={type:5,min:32,max:38},this.rules[73].opcodes[2]={type:5,min:40,max:91},this.rules[73].opcodes[3]={type:5,min:93,max:55295},this.rules[73].opcodes[4]={type:5,min:57344,max:1114111},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[74].opcodes[1]={type:6,string:[98]},this.rules[74].opcodes[2]={type:6,string:[102]},this.rules[74].opcodes[3]={type:6,string:[110]},this.rules[74].opcodes[4]={type:6,string:[114]},this.rules[74].opcodes[5]={type:6,string:[116]},this.rules[74].opcodes[6]={type:7,string:[39]},this.rules[74].opcodes[7]={type:7,string:[92]},this.rules[74].opcodes[8]={type:2,children:[9,10]},this.rules[74].opcodes[9]={type:6,string:[117]},this.rules[74].opcodes[10]={type:4,index:75},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:2,children:[1,2,3]},this.rules[75].opcodes[1]={type:7,string:[48]},this.rules[75].opcodes[2]={type:7,string:[48]},this.rules[75].opcodes[3]={type:1,children:[4,7,10,13]},this.rules[75].opcodes[4]={type:2,children:[5,6]},this.rules[75].opcodes[5]={type:7,string:[48]},this.rules[75].opcodes[6]={type:5,min:48,max:55},this.rules[75].opcodes[7]={type:2,children:[8,9]},this.rules[75].opcodes[8]={type:7,string:[48]},this.rules[75].opcodes[9]={type:6,string:[98]},this.rules[75].opcodes[10]={type:2,children:[11,12]},this.rules[75].opcodes[11]={type:7,string:[48]},this.rules[75].opcodes[12]={type:5,min:101,max:102},this.rules[75].opcodes[13]={type:2,children:[14,15]},this.rules[75].opcodes[14]={type:7,string:[49]},this.rules[75].opcodes[15]={type:4,index:76},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:4,index:65},this.rules[76].opcodes[2]={type:5,min:97,max:102},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:7,string:[48]},this.rules[77].opcodes[2]={type:2,children:[3,4]},this.rules[77].opcodes[3]={type:4,index:21},this.rules[77].opcodes[4]={type:3,min:0,max:1/0},this.rules[77].opcodes[5]={type:4,index:65},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:7,string:[46]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:7,string:[46,46]},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:7,string:[91]},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:7,string:[93]},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:7,string:[40]},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:7,string:[41]},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:7,string:[44]},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:7,string:[58]},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:6,string:[34]},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:6,string:[39]},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:7,string:[63]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:7,string:[124,124]},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:7,string:[38,38]},this.toString=function(){let e="";return e+="; JSONPath: Query Expressions for JSON\n",e+="; https://www.rfc-editor.org/rfc/rfc9535\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\n",e+="jsonpath-query = root-identifier segments\n",e+="segments = *(S segment)\n",e+="\n",e+="B = %x20 / ; Space\n",e+=" %x09 / ; Horizontal tab\n",e+=" %x0A / ; Line feed or New line\n",e+=" %x0D ; Carriage return\n",e+="S = *B ; optional blank space\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\n",e+='root-identifier = "$"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\n",e+="selector = name-selector /\n",e+=" wildcard-selector /\n",e+=" slice-selector /\n",e+=" index-selector /\n",e+=" filter-selector\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\n",e+="name-selector = string-literal\n",e+="\n",e+='string-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n',e+=" squote *single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="\n",e+="double-quoted = unescaped /\n",e+=" %x27 / ; '\n",e+=' ESC %x22 / ; \\"\n',e+=" ESC escapable\n",e+="\n",e+="single-quoted = unescaped /\n",e+=' %x22 / ; "\n',e+=" ESC %x27 / ; \\'\n",e+=" ESC escapable\n",e+="\n",e+="ESC = %x5C ; \\ backslash\n",e+="\n",e+="unescaped = %x20-21 / ; see RFC 8259\n",e+=' ; omit 0x22 "\n',e+=" %x23-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=' "/" / ; / slash (solidus) U+002F\n',e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 hexchar) ; uXXXX U+XXXX\n",e+="\n",e+="hexchar = non-surrogate /\n",e+=' (high-surrogate "\\" %x75 low-surrogate)\n',e+='non-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n',e+=' ("D" %x30-37 2HEXDIG )\n',e+='high-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\n',e+='low-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n',e+="\n",e+='HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\n",e+='wildcard-selector = "*"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\n",e+="index-selector = int ; decimal integer\n",e+="\n",e+='int = "0" /\n',e+=' (["-"] DIGIT1 *DIGIT) ; - optional\n',e+="DIGIT1 = %x31-39 ; 1-9 non-zero digit\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\n",e+="slice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="start = int ; included in selection\n",e+="end = int ; not included in selection\n",e+="step = int ; default: 1\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\n",e+="filter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="logical-expr = logical-or-expr\n",e+="logical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; disjunction\n",e+=" ; binds less tightly than conjunction\n",e+="logical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; conjunction\n",e+=" ; binds more tightly than disjunction\n",e+="\n",e+="basic-expr = paren-expr /\n",e+=" comparison-expr /\n",e+=" test-expr\n",e+="\n",e+="paren-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n",e+=" ; parenthesized expression\n",e+='logical-not-op = "!" ; logical NOT operator\n',e+="\n",e+="test-expr = [logical-not-op S]\n",e+=" (filter-query / ; existence/non-existence\n",e+=" function-expr) ; LogicalType or NodesType\n",e+="filter-query = rel-query / jsonpath-query\n",e+="rel-query = current-node-identifier segments\n",e+='current-node-identifier = "@"\n',e+="\n",e+="comparison-expr = comparable S comparison-op S comparable\n",e+="literal = number / string-literal /\n",e+=" true / false / null\n",e+="comparable = singular-query / ; singular query value\n",e+=" function-expr / ; ValueType\n",e+=" literal\n",e+=" ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\n",e+='comparison-op = "==" / "!=" /\n',e+=' "<=" / ">=" /\n',e+=' "<" / ">"\n',e+="\n",e+="singular-query = rel-singular-query / abs-singular-query\n",e+="rel-singular-query = current-node-identifier singular-query-segments\n",e+="abs-singular-query = root-identifier singular-query-segments\n",e+="singular-query-segments = *(S (name-segment / index-segment))\n",e+="name-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n",e+=" (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\n",e+="index-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="\n",e+='number = (int / "-0") [ frac ] [ exp ] ; decimal number\n',e+='frac = "." 1*DIGIT ; decimal fraction\n',e+='exp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\n',e+="true = %x74.72.75.65 ; true\n",e+="false = %x66.61.6c.73.65 ; false\n",e+="null = %x6e.75.6c.6c ; null\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\n",e+="function-name = function-name-first *function-name-char\n",e+="function-name-first = LCALPHA\n",e+='function-name-char = function-name-first / "_" / DIGIT\n',e+='LCALPHA = %x61-7A ; "a".."z"\n',e+="\n",e+="function-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n",e+=" *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\n",e+="function-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n",e+=" filter-query / ; (includes singular-query)\n",e+=" function-expr /\n",e+=" literal\n",e+="\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\n",e+="segment = child-segment / descendant-segment\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\n",e+="child-segment = bracketed-selection /\n",e+=" (dot-prefix ; MODIFICATION: surrogate text rule used\n",e+=" (wildcard-selector /\n",e+=" member-name-shorthand))\n",e+="\n",e+="bracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n",e+=" ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="member-name-shorthand = name-first *name-char\n",e+="name-first = ALPHA /\n",e+=' "_" /\n',e+=" %x80-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="name-char = name-first / DIGIT\n",e+="\n",e+="DIGIT = %x30-39 ; 0-9\n",e+="ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\n",e+="descendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n",e+=" wildcard-selector /\n",e+=" member-name-shorthand)\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\n",e+="normalized-path = root-identifier *(normal-index-segment)\n",e+="normal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="normal-selector = normal-name-selector / normal-index-selector\n",e+="normal-name-selector = squote *normal-single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="normal-single-quoted = normal-unescaped /\n",e+=" ESC normal-escapable\n",e+="normal-unescaped = ; omit %x0-1F control codes\n",e+=" %x20-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="normal-escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=" \"'\" / ; ' apostrophe U+0027\n",e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 normal-hexchar)\n",e+=" ; certain values u00xx U+00XX\n",e+='normal-hexchar = "0" "0"\n',e+=" (\n",e+=' ("0" %x30-37) / ; "00"-"07"\n',e+=" ; omit U+0008-U+000A BS HT LF\n",e+=' ("0" %x62) / ; "0b"\n',e+=" ; omit U+000C-U+000D FF CR\n",e+=' ("0" %x65-66) / ; "0e"-"0f"\n',e+=' ("1" normal-HEXDIG)\n',e+=" )\n",e+='normal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\n',e+='normal-index-selector = "0" / (DIGIT1 *DIGIT)\n',e+=" ; non-negative decimal integer\n",e+="\n",e+="; Surrogate named rules\n",e+='dot-prefix = "."\n',e+='double-dot-prefix = ".."\n',e+='left-bracket = "["\n',e+='right-bracket = "]"\n',e+='left-paren = "("\n',e+='right-paren = ")"\n',e+='comma = ","\n',e+='colon = ":"\n',e+='dquote = %x22 ; "\n',e+="squote = %x27 ; '\n",e+='questionmark = "?"\n',e+='disjunction = "||"\n',e+='conjunction = "&&"\n','; JSONPath: Query Expressions for JSON\n; https://www.rfc-editor.org/rfc/rfc9535\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\njsonpath-query = root-identifier segments\nsegments = *(S segment)\n\nB = %x20 / ; Space\n %x09 / ; Horizontal tab\n %x0A / ; Line feed or New line\n %x0D ; Carriage return\nS = *B ; optional blank space\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\nroot-identifier = "$"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\nselector = name-selector /\n wildcard-selector /\n slice-selector /\n index-selector /\n filter-selector\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\nname-selector = string-literal\n\nstring-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n squote *single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\n\ndouble-quoted = unescaped /\n %x27 / ; \'\n ESC %x22 / ; \\"\n ESC escapable\n\nsingle-quoted = unescaped /\n %x22 / ; "\n ESC %x27 / ; \\\'\n ESC escapable\n\nESC = %x5C ; \\ backslash\n\nunescaped = %x20-21 / ; see RFC 8259\n ; omit 0x22 "\n %x23-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nescapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "/" / ; / slash (solidus) U+002F\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 hexchar) ; uXXXX U+XXXX\n\nhexchar = non-surrogate /\n (high-surrogate "\\" %x75 low-surrogate)\nnon-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n ("D" %x30-37 2HEXDIG )\nhigh-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\nlow-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n\nHEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\nwildcard-selector = "*"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\nindex-selector = int ; decimal integer\n\nint = "0" /\n (["-"] DIGIT1 *DIGIT) ; - optional\nDIGIT1 = %x31-39 ; 1-9 non-zero digit\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\nslice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n\nstart = int ; included in selection\nend = int ; not included in selection\nstep = int ; default: 1\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\nfilter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n\nlogical-expr = logical-or-expr\nlogical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n ; disjunction\n ; binds less tightly than conjunction\nlogical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n ; conjunction\n ; binds more tightly than disjunction\n\nbasic-expr = paren-expr /\n comparison-expr /\n test-expr\n\nparen-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n ; parenthesized expression\nlogical-not-op = "!" ; logical NOT operator\n\ntest-expr = [logical-not-op S]\n (filter-query / ; existence/non-existence\n function-expr) ; LogicalType or NodesType\nfilter-query = rel-query / jsonpath-query\nrel-query = current-node-identifier segments\ncurrent-node-identifier = "@"\n\ncomparison-expr = comparable S comparison-op S comparable\nliteral = number / string-literal /\n true / false / null\ncomparable = singular-query / ; singular query value\n function-expr / ; ValueType\n literal\n ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\ncomparison-op = "==" / "!=" /\n "<=" / ">=" /\n "<" / ">"\n\nsingular-query = rel-singular-query / abs-singular-query\nrel-singular-query = current-node-identifier singular-query-segments\nabs-singular-query = root-identifier singular-query-segments\nsingular-query-segments = *(S (name-segment / index-segment))\nname-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\nindex-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n\nnumber = (int / "-0") [ frac ] [ exp ] ; decimal number\nfrac = "." 1*DIGIT ; decimal fraction\nexp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\ntrue = %x74.72.75.65 ; true\nfalse = %x66.61.6c.73.65 ; false\nnull = %x6e.75.6c.6c ; null\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\nfunction-name = function-name-first *function-name-char\nfunction-name-first = LCALPHA\nfunction-name-char = function-name-first / "_" / DIGIT\nLCALPHA = %x61-7A ; "a".."z"\n\nfunction-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\nfunction-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n filter-query / ; (includes singular-query)\n function-expr /\n literal\n\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\nsegment = child-segment / descendant-segment\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\nchild-segment = bracketed-selection /\n (dot-prefix ; MODIFICATION: surrogate text rule used\n (wildcard-selector /\n member-name-shorthand))\n\nbracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n ; MODIFICATION: surrogate text rule used\n\nmember-name-shorthand = name-first *name-char\nname-first = ALPHA /\n "_" /\n %x80-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\nname-char = name-first / DIGIT\n\nDIGIT = %x30-39 ; 0-9\nALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\ndescendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n wildcard-selector /\n member-name-shorthand)\n\n; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\nnormalized-path = root-identifier *(normal-index-segment)\nnormal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\nnormal-selector = normal-name-selector / normal-index-selector\nnormal-name-selector = squote *normal-single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\nnormal-single-quoted = normal-unescaped /\n ESC normal-escapable\nnormal-unescaped = ; omit %x0-1F control codes\n %x20-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nnormal-escapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "\'" / ; \' apostrophe U+0027\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 normal-hexchar)\n ; certain values u00xx U+00XX\nnormal-hexchar = "0" "0"\n (\n ("0" %x30-37) / ; "00"-"07"\n ; omit U+0008-U+000A BS HT LF\n ("0" %x62) / ; "0b"\n ; omit U+000C-U+000D FF CR\n ("0" %x65-66) / ; "0e"-"0f"\n ("1" normal-HEXDIG)\n )\nnormal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\nnormal-index-selector = "0" / (DIGIT1 *DIGIT)\n ; non-negative decimal integer\n\n; Surrogate named rules\ndot-prefix = "."\ndouble-dot-prefix = ".."\nleft-bracket = "["\nright-bracket = "]"\nleft-paren = "("\nright-paren = ")"\ncomma = ","\ncolon = ":"\ndquote = %x22 ; "\nsquote = %x27 ; \'\nquestionmark = "?"\ndisjunction = "||"\nconjunction = "&&"\n'}};const m=class extends f{},y=e=>{if(!Array.isArray(e))throw new m("Selectors must be an array, got: "+typeof e,{selectors:e});try{return`$${e.map(e=>{if("string"==typeof e)return`['${(e=>{if("string"!=typeof e)throw new TypeError("Selector must be a string");let t="";for(const r of e){const e=r.codePointAt(0);switch(e){case 8:t+="\\b";break;case 9:t+="\\t";break;case 10:t+="\\n";break;case 12:t+="\\f";break;case 13:t+="\\r";break;case 39:t+="\\'";break;case 92:t+="\\\\";break;default:t+=e<=31?`\\u${e.toString(16).padStart(4,"0")}`:r}}return t})(e)}']`;if("number"==typeof e){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Index selector must be a non-negative safe integer, got: ${e}`);return`[${e}]`}throw new TypeError("Selector must be a string or non-negative integer, got: "+typeof e)}).join("")}`}catch(t){throw new m("Failed to compile normalized JSONPath",{cause:t,selectors:e})}},g=(e,t,r,s)=>{const{realm:n}=e,{value:i}=r;if(n.isObject(t)&&n.hasProperty(t,i)){s(n.getProperty(t,i),i)}},x=(e,t,r,s)=>{const{realm:n}=e,{value:i}=r;if(!n.isArray(t))return;const o=n.getLength(t),a=((e,t)=>e>=0?e:t+e)(i,o);if(a>=0&&a<o){s(n.getElement(t,a),a)}},b=(e,t,r,s)=>{const{realm:n}=e;for(const[e,r]of n.entries(t))s(r,e)},w=(e,t)=>e>=0?Math.min(e,t):Math.max(t+e,0),v=(e,t,r,s)=>{const{realm:n}=e,{start:i,end:o,step:a}=r;if(!n.isArray(t))return;const c=((e,t,r,s)=>{const n=r??1;if(0===n)return null;let i,o;if(n>0){const r=0,n=s,a=null!==e?w(e,s):r,c=null!==t?w(t,s):n;i=Math.max(a,0),o=Math.min(c,s)}else{const r=s-1,n=-s-1,a=null!==e?e>=0?Math.min(e,s-1):Math.max(s+e,-1):r,c=null!==t?t>=0?Math.min(t,s-1):Math.max(s+t,-1):n;o=Math.min(a,s-1),i=Math.max(c,-1)}return{lower:i,upper:o,step:n}})(i,o,a,n.getLength(t));if(null===c)return;const{lower:l,upper:u,step:p}=c;if(p>0)for(let e=l;e<u;e+=p){s(n.getElement(t,e),e)}else for(let e=u;e>l;e+=p){s(n.getElement(t,e),e)}},k=(e,t,r,s)=>s.value,_=(e,t,r)=>{const{realm:s}=e,{selector:n}=r;switch(n.type){case"NameSelector":{const{value:e}=n;return s.isObject(t)&&s.hasProperty(t,e)?s.getProperty(t,e):void 0}case"IndexSelector":{const{value:e}=n;if(!s.isArray(t))return;const r=s.getLength(t),i=e>=0?e:r+e;return i>=0&&i<r?s.getElement(t,i):void 0}default:return}},E=(e,t,r,s)=>{const{selectors:n}=r;for(const r of n)N(e,t,r,s)},A=(e,t,r)=>{const s=[],n=e=>{s.push(e)},{selector:i}=r;switch(i.type){case"BracketedSelection":E(e,t,i,n);break;case"NameSelector":case"WildcardSelector":case"IndexSelector":case"SliceSelector":case"FilterSelector":N(e,t,i,n)}return s},I=(e,t,r,s)=>{let n=r;for(const t of s){const r=[];if("DescendantSegment"===t.type){const s=n=>{const{realm:i}=e,o=A(e,n,t);r.push(...o);for(const[,e]of i.entries(n))s(e)};for(const e of n)s(e)}else for(const s of n){const n=A(e,s,t);r.push(...n)}n=r}return n},S=(e,t,r,s)=>{const{query:n}=s;let i;switch(n.type){case"RelQuery":i=((e,t,r,s)=>{const{segments:n}=s;return 0===n.length?[r]:I(e,0,[r],n)})(e,0,r,n);break;case"JsonPathQuery":i=((e,t,r,s)=>{const{segments:n}=s;return 0===n.length?[t]:I(e,0,[t],n)})(e,t,0,n);break;default:i=[]}return o=i,Object.defineProperty(o,"_isNodelist",{value:!0,enumerable:!1,writable:!1}),o;var o};let O;const M=(e,t,r,s)=>{const{name:n,arguments:i}=s,o=e.functions[n];if("function"!=typeof o)return;const a=i.map(s=>((e,t,r,s)=>{switch(s.type){case"Literal":case"RelSingularQuery":case"AbsSingularQuery":case"FunctionExpr":return T(e,t,r,s);case"FilterQuery":return S(e,t,r,s);case"TestExpr":return"FilterQuery"===s.expression.type?S(e,t,r,s.expression):"FunctionExpr"===s.expression.type?T(e,t,r,s.expression):O(e,t,r,s);case"LogicalOrExpr":case"LogicalAndExpr":case"LogicalNotExpr":case"ComparisonExpr":return O(e,t,r,s);default:return}})(e,t,r,s));return o(e.realm,...a)},T=(e,t,r,s)=>{switch(s.type){case"Literal":return k(e,t,r,s);case"RelSingularQuery":return((e,t,r,s)=>{let n=r;for(const t of s.segments)if(n=_(e,n,t),void 0===n)return;return n})(e,0,r,s);case"AbsSingularQuery":return((e,t,r,s)=>{let n=t;for(const t of s.segments)if(n=_(e,n,t),void 0===n)return;return n})(e,t,0,s);case"FunctionExpr":return M(e,t,r,s);default:return}},C=(e,t,r,s)=>{const{left:n,op:i,right:o}=s,a=T(e,t,r,n),c=T(e,t,r,o);return e.realm.compare(a,i,c)},D=e=>Array.isArray(e),j=(e,t,r,s)=>{switch(s.type){case"LogicalOrExpr":return!!j(e,t,r,s.left)||j(e,t,r,s.right);case"LogicalAndExpr":return!!j(e,t,r,s.left)&&j(e,t,r,s.right);case"LogicalNotExpr":return!j(e,t,r,s.expression);case"TestExpr":{const{expression:n}=s;if("FilterQuery"===n.type){return S(e,t,r,n).length>0}if("FunctionExpr"===n.type){const s=M(e,t,r,n);return"boolean"==typeof s?s:void 0!==s&&(D(s)?s.length>0:Boolean(s))}return!1}case"ComparisonExpr":return C(e,t,r,s);default:return!1}};O=j;const F=j,B=(e,t,r,s)=>{const{realm:n,root:i}=e,{expression:o}=r;for(const[r,a]of n.entries(t)){F(e,i,a,o)&&s(a,r)}},N=(e,t,r,s)=>{switch(r.type){case"NameSelector":g(e,t,r,s);break;case"IndexSelector":x(e,t,r,s);break;case"WildcardSelector":b(e,t,r,s);break;case"SliceSelector":v(e,t,r,s);break;case"FilterSelector":B(e,t,r,s)}};new Map;class P{node;key;index;parent;parentPath;inList;#e=!1;#t=!1;#r=!1;#s=!1;#n;#i=!1;constructor(e,t,r,s,n){this.node=e,this.parent=t,this.parentPath=r,this.key=s,this.index=n&&"number"==typeof s?s:void 0,this.inList=n}get shouldSkip(){return this.#e}get shouldStop(){return this.#t}get removed(){return this.#r}isRoot(){return null===this.parentPath}get depth(){let e=0,t=this.parentPath;for(;null!==t;)e+=1,t=t.parentPath;return e}getAncestry(){const e=[];let t=this.parentPath;for(;null!==t;)e.push(t),t=t.parentPath;return e}getAncestorNodes(){return this.getAncestry().map(e=>e.node)}getPathKeys(){const e=[];let t=this;for(;null!==t&&void 0!==t.key;)e.unshift(t.key),t=t.parentPath;return e}formatPath(e="jsonpointer"){const t=this.getPathKeys();return 0===t.length?"jsonpath"===e?"$":"":"jsonpath"===e?y(t):h(t)}findParent(e){let t=this.parentPath;for(;null!==t;){if(e(t))return t;t=t.parentPath}return null}find(e){return e(this)?this:this.findParent(e)}skip(){this.#e=!0}stop(){this.#t=!0}replaceWith(e){this.#i&&console.warn("Warning: replaceWith() called on a stale Path. This path belongs to a node whose visit has already completed. The replacement will have no effect. To replace a parent node, do so from the parent's own visitor."),this.#s=!0,this.#n=e,this.node=e}remove(){this.#i&&console.warn("Warning: remove() called on a stale Path. This path belongs to a node whose visit has already completed. The removal will have no effect. To remove a parent node, do so from the parent's own visitor."),this.#r=!0}_getReplacementNode(){return this.#n}_wasReplaced(){return this.#s}_reset(){this.#e=!1,this.#t=!1,this.#r=!1,this.#s=!1,this.#n=void 0}_markStale(){this.#i=!0}}class L extends AggregateError{constructor(e,t,r){super(e,t,r),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const U=L;class q extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(U,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const $=q;const H=class extends ${constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}};function R(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,s){return t.apply(this,arguments)};case 4:return function(e,r,s,n){return t.apply(this,arguments)};case 5:return function(e,r,s,n,i){return t.apply(this,arguments)};case 6:return function(e,r,s,n,i,o){return t.apply(this,arguments)};case 7:return function(e,r,s,n,i,o,a){return t.apply(this,arguments)};case 8:return function(e,r,s,n,i,o,a,c){return t.apply(this,arguments)};case 9:return function(e,r,s,n,i,o,a,c,l){return t.apply(this,arguments)};case 10:return function(e,r,s,n,i,o,a,c,l,u){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function G(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function V(e){return function t(r){return 0===arguments.length||G(r)?t:e.apply(this,arguments)}}function z(e){return function t(r,s){switch(arguments.length){case 0:return t;case 1:return G(r)?t:V(function(t){return e(r,t)});default:return G(r)&&G(s)?t:G(r)?V(function(t){return e(t,s)}):G(s)?V(function(t){return e(r,t)}):e(r,s)}}}function X(e,t,r){return function(){for(var s=[],n=0,i=e,o=0,a=!1;o<t.length||n<arguments.length;){var c;o<t.length&&(!G(t[o])||n>=arguments.length)?c=t[o]:(c=arguments[n],n+=1),s[o]=c,G(c)?a=!0:i-=1,o+=1}return!a&&i<=0?r.apply(this,s):R(Math.max(0,i),X(e,s,r))}}var W=z(function(e,t){return 1===e?V(t):R(e,X(e,[],t))});const Y=W;function K(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}const J=z(function(e,t){return e&&t});function Q(e,t,r){for(var s=0,n=r.length;s<n;)t=e(t,r[s]),s+=1;return t}const Z=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function ee(e){return"[object String]"===Object.prototype.toString.call(e)}const te=V(function(e){return!!Z(e)||!!e&&("object"==typeof e&&(!ee(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))});var re="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function se(e,t,r){return function(s,n,i){if(te(i))return e(s,n,i);if(null==i)return n;if("function"==typeof i["fantasy-land/reduce"])return t(s,n,i,"fantasy-land/reduce");if(null!=i[re])return r(s,n,i[re]());if("function"==typeof i.next)return r(s,n,i);if("function"==typeof i.reduce)return t(s,n,i,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function ne(e,t,r){for(var s=r.next();!s.done;)t=e(t,s.value),s=r.next();return t}function ie(e,t,r,s){return r[s](e,t)}const oe=se(Q,ie,ne);function ae(e,t,r){return function(){if(0===arguments.length)return r();var s=arguments[arguments.length-1];if(!Z(s)){for(var n=0;n<e.length;){if("function"==typeof s[e[n]])return s[e[n]].apply(s,Array.prototype.slice.call(arguments,0,-1));n+=1}if(function(e){return null!=e&&"function"==typeof e["@@transducer/step"]}(s))return t.apply(null,Array.prototype.slice.call(arguments,0,-1))(s)}return r.apply(this,arguments)}}function ce(e,t){for(var r=0,s=t.length,n=Array(s);r<s;)n[r]=e(t[r]),r+=1;return n}const le=function(){return this.xf["@@transducer/init"]()},ue=function(e){return this.xf["@@transducer/result"](e)};var pe=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=le,e.prototype["@@transducer/result"]=ue,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}();const he=function(e){return function(t){return new pe(e,t)}};function de(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var fe=Object.prototype.toString;const me=function(){return"[object Arguments]"===fe.call(arguments)?function(e){return"[object Arguments]"===fe.call(e)}:function(e){return de("callee",e)}}();var ye=!{toString:null}.propertyIsEnumerable("toString"),ge=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],xe=function(){return arguments.propertyIsEnumerable("length")}(),be=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1},we="function"!=typeof Object.keys||xe?V(function(e){if(Object(e)!==e)return[];var t,r,s=[],n=xe&&me(e);for(t in e)!de(t,e)||n&&"length"===t||(s[s.length]=t);if(ye)for(r=ge.length-1;r>=0;)de(t=ge[r],e)&&!be(s,t)&&(s[s.length]=t),r-=1;return s}):V(function(e){return Object(e)!==e?[]:Object.keys(e)});const ve=we;var ke=z(ae(["fantasy-land/map","map"],he,function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return Y(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return Q(function(r,s){return r[s]=e(t[s]),r},{},ve(t));default:return ce(e,t)}}));const _e=ke;const Ee=z(function(e,t){return"function"==typeof t["fantasy-land/ap"]?t["fantasy-land/ap"](e):"function"==typeof e.ap?e.ap(t):"function"==typeof e?function(r){return e(r)(t(r))}:oe(function(e,r){return function(e,t){var r;t=t||[];var s=(e=e||[]).length,n=t.length,i=[];for(r=0;r<s;)i[i.length]=e[r],r+=1;for(r=0;r<n;)i[i.length]=t[r],r+=1;return i}(e,_e(r,t))},[],e)});var Ae=z(function(e,t){var r=Y(e,t);return Y(e,function(){return Q(Ee,_e(r,arguments[0]),Array.prototype.slice.call(arguments,1))})});const Ie=Ae;var Se=V(function(e){return Ie(e.length,e)});const Oe=Se;const Me=z(function(e,t){return K(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:Oe(J)(e,t)});function Te(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function Ce(e){return function t(r,s,n){switch(arguments.length){case 0:return t;case 1:return G(r)?t:z(function(t,s){return e(r,t,s)});case 2:return G(r)&&G(s)?t:G(r)?z(function(t,r){return e(t,s,r)}):G(s)?z(function(t,s){return e(r,t,s)}):V(function(t){return e(r,s,t)});default:return G(r)&&G(s)&&G(n)?t:G(r)&&G(s)?z(function(t,r){return e(t,r,n)}):G(r)&&G(n)?z(function(t,r){return e(t,s,r)}):G(s)&&G(n)?z(function(t,s){return e(r,t,s)}):G(r)?V(function(t){return e(t,s,n)}):G(s)?V(function(t){return e(r,t,n)}):G(n)?V(function(t){return e(r,s,t)}):e(r,s,n)}}}function De(e,t,r){for(var s=0,n=r.length;s<n;){if((t=e["@@transducer/step"](t,r[s]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}s+=1}return e["@@transducer/result"](t)}var je=z(function(e,t){return R(e.length,function(){return e.apply(t,arguments)})});const Fe=je;function Be(e,t,r){for(var s=r.next();!s.done;){if((t=e["@@transducer/step"](t,s.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}s=r.next()}return e["@@transducer/result"](t)}function Ne(e,t,r,s){return e["@@transducer/result"](r[s](Fe(e["@@transducer/step"],e),t))}const Pe=se(De,Ne,Be);var Le=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var Ue=Ce(function(e,t,r){return Pe("function"==typeof e?function(e){return new Le(e)}(e):e,t,r)});const qe=Ue;function $e(e,t){return function(){var r=arguments.length;if(0===r)return t();var s=arguments[r-1];return Z(s)||"function"!=typeof s[e]?t.apply(this,arguments):s[e].apply(s,Array.prototype.slice.call(arguments,0,r-1))}}const He=Ce($e("slice",function(e,t,r){return Array.prototype.slice.call(r,e,t)}));const Re=V($e("tail",He(1,1/0)));function Ge(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return R(arguments[0].length,qe(Te,arguments[0],Re(arguments)))}function Ve(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function ze(e,t,r){for(var s=0,n=r.length;s<n;){if(e(t,r[s]))return!0;s+=1}return!1}const Xe="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};const We=V(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function Ye(e,t,r,s){var n=Ve(e);function i(e,t){return Ke(e,t,r.slice(),s.slice())}return!ze(function(e,t){return!ze(i,t,e)},Ve(t),n)}function Ke(e,t,r,s){if(Xe(e,t))return!0;var n=We(e);if(n!==We(t))return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(n){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!Xe(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!Xe(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=r.length-1;i>=0;){if(r[i]===e)return s[i]===t;i-=1}switch(n){case"Map":return e.size===t.size&&Ye(e.entries(),t.entries(),r.concat([e]),s.concat([t]));case"Set":return e.size===t.size&&Ye(e.values(),t.values(),r.concat([e]),s.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var o=ve(e);if(o.length!==ve(t).length)return!1;var a=r.concat([e]),c=s.concat([t]);for(i=o.length-1;i>=0;){var l=o[i];if(!de(l,t)||!Ke(t[l],e[l],a,c))return!1;i-=1}return!0}const Je=z(function(e,t){return Ke(e,t,[],[])});function Qe(e,t){return function(e,t,r){var s,n;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(s=1/t;r<e.length;){if(0===(n=e[r])&&1/n===s)return r;r+=1}return-1}if(t!=t){for(;r<e.length;){if("number"==typeof(n=e[r])&&n!=n)return r;r+=1}return-1}return e.indexOf(t,r);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,r);case"object":if(null===t)return e.indexOf(t,r)}for(;r<e.length;){if(Je(e[r],t))return r;r+=1}return-1}(t,e,0)>=0}function Ze(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var et=function(e){return(e<10?"0":"")+e};const tt="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+et(e.getUTCMonth()+1)+"-"+et(e.getUTCDate())+"T"+et(e.getUTCHours())+":"+et(e.getUTCMinutes())+":"+et(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function rt(e){return"[object Object]"===Object.prototype.toString.call(e)}var st=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=le,e.prototype["@@transducer/result"]=ue,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}();function nt(e){return function(t){return new st(e,t)}}var it=z(ae(["fantasy-land/filter","filter"],nt,function(e,t){return rt(t)?Q(function(r,s){return e(t[s])&&(r[s]=t[s]),r},{},ve(t)):(r=t,"[object Map]"===Object.prototype.toString.call(r)?function(e,t){for(var r=new Map,s=t.entries(),n=s.next();!n.done;)e(n.value[1])&&r.set(n.value[0],n.value[1]),n=s.next();return r}(e,t):function(e,t){for(var r=0,s=t.length,n=[];r<s;)e(t[r])&&(n[n.length]=t[r]),r+=1;return n}(e,t));var r}));const ot=it;const at=z(function(e,t){return ot((r=e,function(){return!r.apply(this,arguments)}),t);var r});function ct(e,t){var r=function(r){var s=t.concat([e]);return Qe(r,s)?"<Circular>":ct(r,s)},s=function(e,t){return ce(function(t){return Ze(t)+": "+r(e[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+ce(r,e).join(", ")+"))";case"[object Array]":return"["+ce(r,e).concat(s(e,at(function(e){return/^\d+$/.test(e)},ve(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+r(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?r(NaN):Ze(tt(e)))+")";case"[object Map]":return"new Map("+r(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+r(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+r(Array.from(e).sort())+")";case"[object String]":return"object"==typeof e?"new String("+r(e.valueOf())+")":Ze(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var n=e.toString();if("[object Object]"!==n)return n}return"{"+s(e,ve(e)).join(", ")+"}"}}const lt=V(function(e){return ct(e,[])});const ut=z(function(e,t){return e||t});const pt=z(function(e,t){return K(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:Oe(ut)(e,t)});const ht=Oe(V(function(e){return!e}));const dt=Je(null);const ft=ht(dt);const mt=z(function(e,t){if(e===t)return t;function r(e,t){if(e>t!=t>e)return t>e?t:e}var s=r(e,t);if(void 0!==s)return s;var n=r(typeof e,typeof t);if(void 0!==n)return n===typeof e?e:t;var i=lt(e),o=r(i,lt(t));return void 0!==o&&o===i?e:t}),yt=Number.isInteger||function(e){return(e|0)===e};function gt(e,t){return t[e<0?t.length+e:e]}const xt=z(function(e,t){if(null!=t)return yt(e)?gt(e,t):t[e]});const bt=z(function(e,t){return _e(xt(e),t)});const wt=V(function(e){return Y(qe(mt,0,bt("length",e)),function(){for(var t=0,r=e.length;t<r;){if(e[t].apply(this,arguments))return!0;t+=1}return!1})});var vt=function(e,t){switch(arguments.length){case 0:return vt;case 1:return function t(r){return 0===arguments.length?t:Xe(e,r)};default:return Xe(e,t)}};const kt=vt;const _t=Y(1,Ge(We,kt("GeneratorFunction")));const Et=Y(1,Ge(We,kt("AsyncFunction")));const At=wt([Ge(We,kt("Function")),_t,Et]);function It(e){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(e)}const St=function(e){return"object"===It(e)};var Ot=Y(1,Me(ft,pt(St,At)));const Mt=Y(1,Me(Ot,Ge(lt,Je("[object Promise]"))));const Tt=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class Ct{elements;constructor(e){this.elements=e??[]}toValue(){return this.elements.map(e=>({key:e.key?.toValue(),value:e.value?.toValue()}))}map(e,t){return this.elements.map(r=>{const s=r.value,n=r.key;if(void 0===s||void 0===n)throw new Error("MemberElement must have both key and value");return void 0!==t?e.call(t,s,n,r):e(s,n,r)})}filter(e,t){const r=this.elements.filter(r=>{const s=r.value,n=r.key;return void 0!==s&&void 0!==n&&(void 0!==t?e.call(t,s,n,r):e(s,n,r))});return new Ct(r)}reject(e,t){const r=[];for(const s of this.elements){const n=s.value,i=s.key;void 0!==n&&void 0!==i&&(e.call(t,n,i,s)||r.push(s))}return new Ct(r)}forEach(e,t){this.elements.forEach((r,s)=>{const n=r.value,i=r.key;void 0!==n&&void 0!==i&&(void 0!==t?e.call(t,n,i,r,s):e(n,i,r,s))})}find(e,t){return this.elements.find(r=>{const s=r.value,n=r.key;return void 0!==s&&void 0!==n&&(void 0!==t?e.call(t,s,n,r):e(s,n,r))})}keys(){return this.elements.map(e=>e.key?.toValue()).filter(e=>void 0!==e)}values(){return this.elements.map(e=>e.value?.toValue()).filter(e=>void 0!==e)}get length(){return this.elements.length}get isEmpty(){return 0===this.length}get first(){return this.elements[0]}get(e){return this.elements[e]}push(e){return this.elements.push(e),this}includesKey(e){return this.elements.some(t=>t.key?.equals(e))}[Symbol.iterator](){return this.elements[Symbol.iterator]()}}const Dt=Ct;class jt{parent;startLine;startCharacter;startOffset;endLine;endCharacter;endOffset;_storedElement="element";_content;_meta;_attributes;constructor(e,t,r){void 0!==t&&(this.meta=t),void 0!==r&&(this.attributes=r),void 0!==e&&(this.content=e)}get element(){return this._storedElement}set element(e){this._storedElement=e}get content(){return this._content}set content(e){if(e instanceof jt)this._content=e;else if(null!=e&&"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e&&"bigint"!=typeof e&&"symbol"!=typeof e)if(e instanceof Tt)this._content=e;else if(e instanceof Dt)this._content=e.elements;else if(Array.isArray(e))this._content=e.map(e=>this.refract(e));else{if("object"!=typeof e)throw new Error("Cannot set content to value of type "+typeof e);this._content=Object.entries(e).map(([e,t])=>new this.MemberElement(e,t))}else this._content=e}get meta(){if(!this._meta){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._meta=new this.ObjectElement}return this._meta}set meta(e){e instanceof jt?this._meta=e:this.meta.set(e??{})}get attributes(){if(!this._attributes){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._attributes=new this.ObjectElement}return this._attributes}set attributes(e){e instanceof jt?this._attributes=e:this.attributes.set(e??{})}get id(){return this.getMetaProperty("id","")}set id(e){this.setMetaProperty("id",e)}get classes(){return this.getMetaProperty("classes",[])}set classes(e){this.setMetaProperty("classes",e)}get links(){return this.getMetaProperty("links",[])}set links(e){this.setMetaProperty("links",e)}get children(){const{_content:e}=this;if(Array.isArray(e))return e;if(e instanceof Tt){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof jt?[e]:[]}get isFrozen(){return Object.isFrozen(this)}freeze(){if(!this.isFrozen){this._meta&&(this._meta.parent=this,this._meta.freeze()),this._attributes&&(this._attributes.parent=this,this._attributes.freeze());for(const e of this.children)e.parent=this,e.freeze();Array.isArray(this._content)&&Object.freeze(this._content),Object.freeze(this)}}toValue(){const{_content:e}=this;return e instanceof jt||e instanceof Tt?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof jt?e.toValue():e;return Je(this.toValue(),t)}primitive(){}set(e){return this.content=e,this}toRef(e){const t=this.id.toValue();if(""===t)throw new Error("Cannot create reference to an element without an ID");const r=new this.RefElement(t);return"string"==typeof e&&(r.path=this.refract(e)),r}getMetaProperty(e,t){if(!this.meta.hasKey(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.meta.set(e,t)}return this.meta.get(e)}setMetaProperty(e,t){this.meta.set(e,t)}hasMetaProperty(e){return!this.isMetaEmpty&&this.meta.hasKey(e)}get isMetaEmpty(){return void 0===this._meta||this.meta.isEmpty}getAttributesProperty(e,t){if(!this.hasAttributesProperty(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.attributes.set(e,t)}return this.attributes.get(e)}setAttributesProperty(e,t){this.attributes.set(e,t)}hasAttributesProperty(e){return!this.isAttributesEmpty&&this.attributes.hasKey(e)}get isAttributesEmpty(){return void 0===this._attributes||this.attributes.isEmpty}}const Ft=jt;const Bt=class extends Ft{constructor(e,t,r){super(e,t,r),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};const Nt=class extends Ft{constructor(e,t,r){super(e,t,r),this.element="number"}primitive(){return"number"}};const Pt=class extends Ft{constructor(e,t,r){super(e??null,t,r),this.element="null"}primitive(){return"null"}set(e){throw new Error("Cannot set the value of null")}};const Lt=class extends Ft{constructor(e,t,r){super(e,t,r),this.element="boolean"}primitive(){return"boolean"}};class Ut extends Ft{constructor(e,t,r){super(e||[],t,r)}get length(){return this._content.length}get isEmpty(){return 0===this.length}get first(){return this._content[0]}get second(){return this._content[1]}get last(){return this._content.at(-1)}push(...e){for(const t of e)this._content.push(this.refract(t));return this}shift(){return this._content.shift()}unshift(e){this._content.unshift(this.refract(e))}includes(e){return this._content.some(t=>t.equals(e))}findElements(e,t){const r=t||{},s=!!r.recursive,n=void 0===r.results?[]:r.results;for(let t=0;t<this._content.length;t+=1){const r=this._content[t],i=r;s&&"function"==typeof i.findElements&&i.findElements(e,{results:n,recursive:s}),e(r,t,void 0)&&n.push(r)}return n}find(e){const t=this.findElements(e,{recursive:!0});return new this.ArrayElement(t)}findByElement(e){return this.find(t=>t.element===e)}findByClass(e){return this.find(t=>{const r=t.classes;return"function"==typeof r.includes&&r.includes(e)})}getById(e){return this.find(t=>t.id.toValue()===e).first}concat(e){return new(0,this.constructor)(this._content.concat(e._content))}[Symbol.iterator](){return this._content[Symbol.iterator]()}}const qt=Ut;const $t=class extends qt{constructor(e,t,r){super(e||[],t,r),this.element="array"}primitive(){return"array"}get(e){return this._content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}set(e,t){return"number"==typeof e&&void 0!==t?this._content[e]=this.refract(t):this.content=e,this}remove(e){return this._content.splice(e,1)[0]??null}map(e,t){return this._content.map(e,t)}flatMap(e,t){return this._content.flatMap(e,t)}compactMap(e,t){const r=[];for(const s of this._content){const n=e.call(t,s);n&&r.push(n)}return r}filter(e,t){const r=this._content.filter(e,t);return new this.constructor(r)}reject(e,t){const r=[];for(const s of this._content)e.call(t,s)||r.push(s);return new this.constructor(r)}reduce(e,t){let r,s;void 0!==t?(r=0,s=this.refract(t)):(r=1,s=this.first);for(let t=r;t<this.length;t+=1){const r=e(s,this._content[t],t,this);s=void 0===r?r:this.refract(r)}return s}forEach(e,t){this._content.forEach((r,s)=>{e.call(t,r,s)})}empty(){return new this.constructor([])}};const Ht=class extends Ft{constructor(e,t,r,s){super(new Tt,r,s),this.element="member",void 0!==e&&(this.key=e),arguments.length>=2&&(this.value=t)}primitive(){return"member"}get key(){return this._content.key}set key(e){this._content.key=this.refract(e)}get value(){return this._content.value}set value(e){this._content.value=void 0===e?void 0:this.refract(e)}};const Rt=class extends qt{constructor(e,t,r){super(e||[],t,r),this.element="object"}primitive(){return"object"}toValue(){return this._content.reduce((e,t)=>(e[t.key.toValue()]=t.value?t.value.toValue():void 0,e),{})}get(e){const t=this.getMember(e);if(t)return t.value}getValue(e){const t=this.get(e);if(t)return t.toValue()}getMember(e){if(void 0!==e)return this._content.find(t=>t.key.toValue()===e)}remove(e){let t=null;return this.content=this._content.filter(r=>r.key.toValue()!==e||(t=r,!1)),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if("string"==typeof e){const r=this.getMember(e);r?r.value=t:this._content.push(new Ht(e,t))}else if("object"==typeof e&&!Array.isArray(e))for(const t of Object.keys(e))this.set(t,e[t]);return this}keys(){return this._content.map(e=>e.key.toValue())}values(){return this._content.map(e=>e.value.toValue())}hasKey(e){return this._content.some(t=>t.key.equals(e))}items(){return this._content.map(e=>[e.key.toValue(),e.value.toValue()])}map(e,t){return this._content.map(r=>e.call(t,r.value,r.key,r))}compactMap(e,t){const r=[];return this.forEach((s,n,i)=>{const o=e.call(t,s,n,i);o&&r.push(o)}),r}filter(e,t){return new Dt(this._content).filter(e,t)}reject(e,t){const r=[];for(const s of this._content)e.call(t,s.value,s.key,s)||r.push(s);return new Dt(r)}forEach(e,t){this._content.forEach(r=>e.call(t,r.value,r.key,r))}reduce(e,t){let r,s;void 0!==t?(r=0,s=this.refract(t)):(r=1,s=this._content[0]?.value);for(let t=r;t<this._content.length;t+=1){const r=this._content[t],n=e(s,r.value,r.key,r,this);s=void 0===n?n:this.refract(n)}return s}empty(){return new this.constructor([])}},Gt=e=>e instanceof Ft,Vt=e=>e instanceof Bt,zt=e=>e instanceof Nt,Xt=e=>e instanceof Pt,Wt=e=>e instanceof Lt,Yt=e=>e instanceof $t,Kt=e=>e instanceof Rt,Jt=e=>e instanceof Ht,Qt=e=>Kt(e)&&"object"===e.element||Yt(e)&&"array"===e.element||Wt(e)&&"boolean"===e.element||zt(e)&&"number"===e.element||Vt(e)&&"string"===e.element||Xt(e)&&"null"===e.element||Jt(e)&&"member"===e.element,Zt=e=>"number"==typeof e.startLine&&"number"==typeof e.startCharacter&&"number"==typeof e.startOffset&&"number"==typeof e.endLine&&"number"==typeof e.endCharacter&&"number"==typeof e.endOffset,er=(e,t)=>0===t.length||!!Gt(e)&&(!e.isMetaEmpty&&(!!e.hasMetaProperty("classes")&&t.every(t=>e.classes.includes(t))));class tr extends Bt{constructor(e,t,r){super(e,t,r),this.element="sourceMap"}static transfer(e,t){t.startLine=e.startLine,t.startCharacter=e.startCharacter,t.startOffset=e.startOffset,t.endLine=e.endLine,t.endCharacter=e.endCharacter,t.endOffset=e.endOffset}static from(e){const{startLine:t,startCharacter:r,startOffset:s,endLine:n,endCharacter:i,endOffset:o}=e;if("number"!=typeof t||"number"!=typeof r||"number"!=typeof s||"number"!=typeof n||"number"!=typeof i||"number"!=typeof o)return;const a="sm1:"+[t,r,s,n,i,o].map(sr).join("");const c=new tr(a);return c.startLine=t,c.startCharacter=r,c.startOffset=s,c.endLine=n,c.endCharacter=i,c.endOffset=o,c}applyTo(e){this.content&&([e.startLine,e.startCharacter,e.startOffset,e.endLine,e.endCharacter,e.endOffset]=function(e){const t=e.startsWith("sm1:")?e.slice(4):e,r=[];let s=0;for(let e=0;e<6;e++){const e=nr(t,s);r.push(e.value),s=e.next}return r}(this.content))}}const rr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function sr(e){let t=e>>>0,r="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),r+=rr[e]}while(0!==t);return r}function nr(e,t=0){let r=0,s=0,n=t;for(;;){const t=e[n++],i=rr.indexOf(t);if(-1===i)throw new Error(`Invalid Base64 VLQ char: ${t}`);if(r|=(31&i)<<s,s+=5,!!!(32&i))break}return{value:r>>>0,next:n}}const ir=tr;const or=class extends H{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const ar=class extends or{};const cr=class extends or{},lr=(e,t)=>{const{visited:r=new WeakMap}=t,s={...t,visited:r};if(r.has(e))return r.get(e);const n=dr(e);r.set(e,n);const{content:i}=e;return Array.isArray(i)?n.content=i.map(e=>lr(e,s)):Gt(i)?n.content=lr(i,s):n.content=i instanceof Tt?ur(i,s):i,n},ur=(e,t)=>{const{visited:r=new WeakMap}=t,s={...t,visited:r};if(r.has(e))return r.get(e);const{key:n,value:i}=e,o=void 0!==n?lr(n,s):void 0,a=void 0!==i?lr(i,s):void 0,c=new Tt(o,a);return r.set(e,c),c},pr=(e,t={})=>{if(e instanceof Tt)return ur(e,t);if(e instanceof Dt)return((e,t)=>{const{visited:r=new WeakMap}=t,s={...t,visited:r};if(r.has(e))return r.get(e);const n=[...e].map(e=>lr(e,s)),i=new Dt(n);return r.set(e,i),i})(e,t);if(Gt(e))return lr(e,t);throw new ar("Value provided to cloneDeep function couldn't be cloned",{value:e})};pr.safe=e=>{try{return pr(e)}catch{return e}};const hr=e=>{const{key:t,value:r}=e;return new Tt(t,r)},dr=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=pr(e.meta)),e.isAttributesEmpty||(t.attributes=pr(e.attributes)),Zt(e)&&ir.transfer(e,t);const{content:r}=e;return Gt(r)?t.content=dr(r):Array.isArray(r)?t.content=[...r]:t.content=r instanceof Tt?hr(r):r,t},fr=e=>{if(e instanceof Tt)return hr(e);if(e instanceof Dt)return(e=>{const t=[...e];return new Dt(t)})(e);if(Gt(e))return dr(e);throw new cr("Value provided to cloneShallow function couldn't be cloned",{value:e})};fr.safe=e=>{try{return fr(e)}catch{return e}};const mr=e=>{const t=e?.element;return void 0===t||"element"===t?"Element":`${t.charAt(0).toUpperCase()}${t.slice(1)}Element`},yr=e=>Gt(e),gr=e=>fr(e),xr=(e,t,r)=>{Jt(e)?e.value=r:Array.isArray(e)?e[t]=null===r?void 0:r:null===r?delete e[t]:e[t]=r},br=e=>Jt(e)?["key","value"]:Yt(e)||Kt(e)?["content"]:[],wr=(e,t)=>{if(void 0!==e[t])return e[t];const r=t.length;for(const s in e){if(!s.includes("|"))continue;const n=s.indexOf(t);if(-1===n)continue;const i=0===n||"|"===s[n-1],o=n+r===s.length||"|"===s[n+r];if(i&&o)return e[s]}},vr=(e,t,r)=>{if(void 0===t)return null;const s=e,n=r?"leave":"enter",i=wr(s,t);if(!r&&"function"==typeof i)return i;if(null!=i){const e=i[n];if("function"==typeof e)return e}const o=s[n];if("function"==typeof o)return o;if(null!=o){const e=wr(o,t);if("function"==typeof e)return e}return null},kr=(e,t={})=>{const{visitFnGetter:r=vr,nodeTypeGetter:s=mr,exposeEdits:n=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),a=new Array(e.length).fill(i);return{enter(t){let c=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(a[u]===i){const i=r(e[u],s(c),!1);if("function"==typeof i){const r=Er(t,c),s=i.call(e[u],r);if(Mt(s))throw new H("Async visitor not supported in sync mode",{visitor:e[u],visitFn:i});if(r.shouldStop){a[u]=o;break}if(r.shouldSkip&&(a[u]=c),r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();if(!n)return t.replaceWith(e),e;c=e,l=!0}else if(void 0!==s){if(!n)return t.replaceWith(s),s;c=s,l=!0}}}if(l)return t.replaceWith(c),c},leave(t){const n=t.node;for(let c=0;c<e.length;c+=1)if(a[c]===i){const i=r(e[c],s(n),!0);if("function"==typeof i){const r=Er(t,n),s=i.call(e[c],r);if(Mt(s))throw new H("Async visitor not supported in sync mode",{visitor:e[c],visitFn:i});if(r.shouldStop){a[c]=o;break}if(r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();return t.replaceWith(e),e}if(void 0!==s)return t.replaceWith(s),s}}else a[c]===n&&(a[c]=i)}}},_r=(e,t={})=>{const{visitFnGetter:r=vr,nodeTypeGetter:s=mr,exposeEdits:n=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),a=new Array(e.length).fill(i);return{async enter(t){let c=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(a[u]===i){const i=r(e[u],s(c),!1);if("function"==typeof i){const r=Er(t,c),s=await i.call(e[u],r);if(r.shouldStop){a[u]=o;break}if(r.shouldSkip&&(a[u]=c),r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();if(!n)return t.replaceWith(e),e;c=e,l=!0}else if(void 0!==s){if(!n)return t.replaceWith(s),s;c=s,l=!0}}}if(l)return t.replaceWith(c),c},async leave(t){const n=t.node;for(let c=0;c<e.length;c+=1)if(a[c]===i){const i=r(e[c],s(n),!0);if("function"==typeof i){const r=Er(t,n),s=await i.call(e[c],r);if(r.shouldStop){a[c]=o;break}if(r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();return t.replaceWith(e),e}if(void 0!==s)return t.replaceWith(s),s}}else a[c]===n&&(a[c]=i)}}};function Er(e,t){return new P(t,e.parent,e.parentPath,e.key,e.inList)}function*Ar(e,t,r){const{keyMap:s,state:n,nodeTypeGetter:i,nodePredicate:o,nodeCloneFn:a,detectCycles:c,mutable:l,mutationFn:u}=r,p="function"==typeof s;let h,d,f=Array.isArray(e),m=[e],y=-1,g=[],x=e,b=null,w=null;const v=[];do{y+=1;const e=y===m.length;let r;const k=e&&0!==g.length;if(e){if(r=0===v.length?void 0:b?.key,x=d,d=v.pop(),w=b?.parentPath?.parentPath??null,k)if(l)for(const[e,t]of g)u(x,e,t);else if(f){x=x.slice();let e=0;for(const[t,r]of g){const s=t-e;null===r?(x.splice(s,1),e+=1):x[s]=r}}else{x=a(x);for(const[e,t]of g)x[e]=t}if(void 0!==h){y=h.index,m=h.keys,g=h.edits;const e=h.inArray;if(w=h.parentPath,h=h.prev,k&&!l){const t=e?y:m[y];g.push([t,x])}f=e}}else if(void 0!==d&&(r=f?y:m[y],x=d[r],void 0===x))continue;if(!Array.isArray(x)){if(!o(x))throw new H(`Invalid AST Node: ${String(x)}`,{node:x});if(c&&v.includes(x))continue;b=new P(x,d,w,r,f);const s=vr(t,i(x),e);if(s){for(const[e,r]of Object.entries(n))t[e]=r;const i=yield{visitFn:s,path:b,isLeaving:e};if(b.shouldStop)break;if(b.shouldSkip&&!e)continue;if(b.removed){if(g.push([r,null]),!e)continue}else if(b._wasReplaced()){const t=b._getReplacementNode();if(g.push([r,t]),!e){if(!o(t))continue;x=t}}else if(void 0!==i&&(g.push([r,i]),!e)){if(!o(i))continue;x=i}b._markStale()}}if(!e){if(h={inArray:f,index:y,keys:m,edits:g,parentPath:w,prev:h},f=Array.isArray(x),f)m=x;else if(p)m=s(x);else{const e=i(x);m=void 0!==e?s[e]??[]:[]}y=-1,g=[],void 0!==d&&v.push(d),d=x,w=b}}while(void 0!==h);return 0!==g.length?g.at(-1)[1]:e}kr[Symbol.for("nodejs.util.promisify.custom")]=_r;const Ir=(e,t,r={})=>{const s=Ar(e,t,{keyMap:r.keyMap??br,state:r.state??{},nodeTypeGetter:r.nodeTypeGetter??mr,nodePredicate:r.nodePredicate??yr,nodeCloneFn:r.nodeCloneFn??gr,detectCycles:r.detectCycles??!0,mutable:r.mutable??!1,mutationFn:r.mutationFn??xr});let n=s.next();for(;!n.done;){const e=n.value,r=e.visitFn.call(t,e.path);if(Mt(r))throw new H("Async visitor not supported in sync mode",{visitor:t,visitFn:e.visitFn});n=s.next(r)}return n.value},Sr=async(e,t,r={})=>{const s=Ar(e,t,{keyMap:r.keyMap??br,state:r.state??{},nodeTypeGetter:r.nodeTypeGetter??mr,nodePredicate:r.nodePredicate??yr,nodeCloneFn:r.nodeCloneFn??gr,detectCycles:r.detectCycles??!0,mutable:r.mutable??!1,mutationFn:r.mutationFn??xr});let n=s.next();for(;!n.done;){const e=n.value,r=await e.visitFn.call(t,e.path);n=s.next(r)}return n.value};Ir[Symbol.for("nodejs.util.promisify.custom")]=Sr,P.prototype.traverse=function(e,t){return Ir(this.node,e,t)},P.prototype.traverseAsync=function(e,t){return Sr(this.node,e,t)};var Or=Ce(function(e,t,r){var s,n={};for(s in r=r||{},t=t||{})de(s,t)&&(n[s]=de(s,r)?e(s,t[s],r[s]):t[s]);for(s in r)de(s,r)&&!de(s,n)&&(n[s]=r[s]);return n});const Mr=Or;var Tr=Ce(function e(t,r,s){return Mr(function(r,s,n){return rt(s)&&rt(n)?e(t,s,n):t(r,s,n)},r,s)});const Cr=Tr;const Dr=z(function(e,t){return Cr(function(e,t,r){return r},e,t)});const jr=z(function(e,t){return null==t||t!=t?e:t});const Fr=Ce(function(e,t,r){return jr(e,xt(t,r))});function Br(e,t){for(var r=t,s=0;s<e.length;s+=1){if(null==r)return;var n=e[s];r=yt(n)?gt(n,r):r[n]}return r}const Nr=z(Br);const Pr=He(0,-1);var Lr=z(function(e,t){return e.apply(this,t)});const Ur=Lr;const qr=ht(At);var $r=V(function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():e==Set||e instanceof Set?new Set:e==Map||e instanceof Map?new Map:Z(e)?[]:ee(e)?"":rt(e)?{}:me(e)?function(){return arguments}():function(e){var t=Object.prototype.toString.call(e);return"[object Uint8ClampedArray]"===t||"[object Int8Array]"===t||"[object Uint8Array]"===t||"[object Int16Array]"===t||"[object Uint16Array]"===t||"[object Int32Array]"===t||"[object Uint32Array]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object BigInt64Array]"===t||"[object BigUint64Array]"===t}(e)?e.constructor.from(""):void 0});const Hr=$r;const Rr=V(function(e){return null!=e&&Je(e,Hr(e))});const Gr=Me(Y(1,At(Array.isArray)?Array.isArray:Ge(We,kt("Array"))),Rr);const Vr=Y(3,function(e,t,r){var s=Nr(e,r),n=Nr(Pr(e),r);if(!qr(s)&&!Gr(e)){var i=Fe(s,n);return Ur(i,t)}});const zr=class extends Ft{constructor(e,t,r){super(e||[],t,r),this.element="link"}get relation(){if(this.hasAttributesProperty("relation"))return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){if(this.hasAttributesProperty("href"))return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}};const Xr=class extends Ft{constructor(e,t,r){super(e||[],t,r),this.element="ref",this.path||(this.path="element")}get path(){if(this.hasAttributesProperty("path"))return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}};const Wr=class extends Bt{constructor(e,t,r){super(e,t,r),this.element="annotation"}get code(){if(this.hasAttributesProperty("code"))return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}};const Yr=class extends Bt{constructor(e,t,r){super(e,t,r),this.element="comment"}};const Kr=class extends $t{constructor(e,t,r){super(e,t,r),this.element="parseResult"}get api(){return this.filter(e=>er(e,["api"])).first}get results(){return this.filter(e=>er(e,["result"]))}get result(){return this.results.first}get annotations(){return this.filter(e=>"annotation"===e.element)}get warnings(){return this.filter(e=>"annotation"===e.element&&er(e,["warning"]))}get errors(){return this.filter(e=>"annotation"===e.element&&er(e,["error"]))}get isEmpty(){return 0===this.reject(e=>"annotation"===e.element).length}replaceResult(e){const{result:t}=this;if(void 0===t)return!1;const r=this._content,s=r.findIndex(e=>e===t);return-1!==s&&(r[s]=e,!0)}},Jr=e=>e instanceof zr,Qr=e=>e instanceof Xr;const Zr=class{namespace;constructor(e){this.namespace=e||new this.Namespace}serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);const t={element:e.element};if(e.isMetaEmpty||(t.meta=this.serialiseObject(e.meta)),e.isAttributesEmpty||(t.attributes=this.serialiseObject(e.attributes)),!(e instanceof ir)){const r=ir.from(e);r&&(t.meta||(t.meta={}),t.meta.__mappings__=this.serialise(r))}const r=this.serialiseContent(e.content);return void 0!==r&&(t.content=r),t}deserialise(e){if(!e.element)throw new Error("Given value is not an object containing an element name");const t=new(this.namespace.getElementClass(e.element));let r;t.element!==e.element&&(t.element=e.element);let s=e.meta;if(e.meta?.__mappings__){const{__mappings__:t,...n}=e.meta;r=t,s=Object.keys(n).length>0?n:void 0}if(s&&this.deserialiseObject(s,t.meta),r){this.deserialise(r).applyTo(t)}e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const n=this.deserialiseContent(e.content);return void 0===n&&null!==t.content||(t.content=n),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t=e,r={key:this.serialise(t.key)};return t.value&&(r.value=this.serialise(t.value)),r}if(e&&Array.isArray(e)){if(0===e.length)return;return e.map(e=>this.serialise(e))}return e}deserialiseContent(e){if(e){if(e.element)return this.deserialise(e);if(e.key){const t=new this.namespace.KeyValuePair(this.deserialise(e.key));return e.value&&(t.value=this.deserialise(e.value)),t}if(Array.isArray(e))return e.map(e=>this.deserialise(e))}return e}serialiseObject(e){const t={};if(e.forEach((e,r)=>{e&&(t[r.toValue()]=this.serialise(e))}),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach(r=>{t.set(r,this.deserialise(e[r]))})}},es=e=>null===e,ts=e=>"string"==typeof e,rs=e=>"number"==typeof e,ss=e=>"boolean"==typeof e,ns=e=>null!==e&&"object"==typeof e;class is{elementMap={};elementDetection=[];Element;KeyValuePair;_elements;_attributeElementKeys=[];_attributeElementArrayKeys=[];constructor(e){this.Element=Ft,this.KeyValuePair=Tt,e&&e.noDefault||this.useDefault()}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",Pt).register("string",Bt).register("number",Nt).register("boolean",Lt).register("array",$t).register("object",Rt).register("member",Ht).register("ref",Xr).register("link",zr).register("sourceMap",ir),this.detect(es,Pt,!1).detect(ts,Bt,!1).detect(rs,Nt,!1).detect(ss,Lt,!1).detect(Array.isArray,$t,!1).detect(ns,Rt,!1),this}register(e,t){return this._elements=void 0,this.elementMap[e]=t,this}unregister(e){return this._elements=void 0,delete this.elementMap[e],this}detect(e,t,r){return void 0===r||r?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(const[r,s]of this.elementDetection)if(r(e)){t=new s(e);break}return t}getElementClass(e){const t=this.elementMap[e];return void 0===t?this.Element:t}fromRefract(e){return this.serialiser.deserialise(e)}toRefract(e){return this.serialiser.serialise(e)}get elements(){return void 0===this._elements&&(this._elements={Element:this.Element},Object.keys(this.elementMap).forEach(e=>{const t=e[0].toUpperCase()+e.substring(1);this._elements[t]=this.elementMap[e]})),this._elements}get serialiser(){return new Zr(this)}}Zr.prototype.Namespace=is;const os=new is,as={isElement:Gt,isStringElement:Vt,isNumberElement:zt,isNullElement:Xt,isBooleanElement:Wt,isArrayElement:Yt,isObjectElement:Kt,isMemberElement:Jt,isPrimitiveElement:Qt,isLinkElement:Jr,isRefElement:Qr,isAnnotationElement:e=>e instanceof Wr,isCommentElement:e=>e instanceof Yr,isParseResultElement:e=>e instanceof Kr,isSourceMapElement:e=>e instanceof ir,hasElementSourceMap:Zt,includesSymbols:(e,t)=>{if(0===t.length)return!0;if(!e.hasAttributesProperty("symbols"))return!1;const r=e.attributes.get("symbols");return!!Yt(r)&&t.every(e=>r.includes(e))},includesClasses:er},cs=()=>({predicates:as,namespace:os}),ls={toolboxCreator:cs,visitorOptions:{exposeEdits:!0}},us=(e,t,r={})=>{if(0===t.length)return e;const s=Dr(ls,r),{toolboxCreator:n,visitorOptions:i}=s,o=n(),a=t.map(e=>e(o)),c=kr(a.map(Fr({},"visitor")),i);a.forEach(Vr(["pre"],[]));const l=Ir(e,c);return a.forEach(Vr(["post"],[])),l};us[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,r={})=>{if(0===t.length)return e;const s=Dr(ls,r),{toolboxCreator:n,visitorOptions:i}=s,o=n(),a=t.map(e=>e(o)),c=_r(a.map(Fr({},"visitor")),i);await Promise.allSettled(a.map(Vr(["pre"],[])));const l=await Sr(e,c);return await Promise.allSettled(a.map(Vr(["post"],[]))),l};var ps=r(279),hs=r.n(ps);const ds=class extends H{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};class fs{uuid;identityMap;constructor({length:e=6}={}){this.uuid=new(hs())({length:e}),this.identityMap=new WeakMap}identify(e){if(!Gt(e))throw new ds("Cannot not identify the element. `element` is neither structurally compatible nor a subclass of an Element class.",{value:e});if(e.hasMetaProperty("id")){const t=e.meta.get("id");if(Vt(t)&&!t.equals(""))return e.id}if(this.identityMap.has(e))return this.identityMap.get(e);const t=new Bt(this.generateId());return this.identityMap.set(e,t),t}forget(e){return!!this.identityMap.has(e)&&(this.identityMap.delete(e),!0)}generateId(){return this.uuid.randomUUID()}}const ms=new fs,ys=({length:e=6}={})=>()=>{let t;return{pre(){t=new fs({length:e})},visitor:{enter(e){e.node.id=t.identify(e.node)}},post(){t=null}}},gs=({length:e=6}={})=>()=>{let t;return{pre(){t=new fs({length:e})},visitor:{enter(e){Qt(e.node)||(e.node.id=t.identify(e.node))}},post(){t=null}}};const xs=class extends ${};const bs=class extends xs{};const ws=class extends Array{unknownMediaType="application/octet-stream";filterByFormat(){throw new bs("filterByFormat method in MediaTypes class is not yet implemented.")}findBy(){throw new bs("findBy method in MediaTypes class is not yet implemented.")}latest(){throw new bs("latest method in MediaTypes class is not yet implemented.")}};var vs=V(function(e){return function(){return e}})(void 0);const ks=Je(vs()),_s=(e,t=new WeakMap)=>(Jt(e)?(t.set(e.key,e),_s(e.key,t),t.set(e.value,e),_s(e.value,t)):e.children.forEach(r=>{t.set(r,e),_s(r,t)}),t);const Es=class{element;edges;constructor({element:e}){this.element=e}transclude(e,t){if(e===this.element)return t;if(e===t)return this.element;this.edges=this.edges??_s(this.element);const r=this.edges.get(e);return ks(r)?void 0:(Kt(r)?((e,t,r)=>{const s=r.get(e);Kt(s)&&(s.content=s.map((n,i,o)=>o===e?(r.delete(e),r.set(t,s),t):o))})(e,t,this.edges):Yt(r)?((e,t,r)=>{const s=r.get(e);Yt(s)&&(s.content=s.map(n=>n===e?(r.delete(e),r.set(t,s),t):n))})(e,t,this.edges):Jt(r)&&((e,t,r)=>{const s=r.get(e);Jt(s)&&(s.key===e&&(s.key=t,r.delete(e),r.set(t,s)),s.value===e&&(s.value=t,r.delete(e),r.set(t,s)))})(e,t,this.edges),this.element)}},As=(e,t,r)=>new Es({element:r}).transclude(e,t),Is=Es;var Ss=z(function(e,t){return Q(function(r,s){return r[s]=e(t[s],s,t),r},{},ve(t))});const Os=Ss;const Ms=V(function(e){return null==e});var Ts=z(function(e,t){if(0===e.length||Ms(t))return!1;for(var r=t,s=0;s<e.length;){if(Ms(r)||!de(e[s],r))return!1;r=r[e[s]],s+=1}return!0});const Cs=Ts;var Ds=z(function(e,t){return Cs([e],t)});const js=Ds;const Fs=Ce(function(e,t,r){return e(xt(t,r))});const Bs=Ce(function(e,t,r){return e(Br(t,r))});const Ns=Y(1,Me(ft,St));var Ps=Ge(We,kt("Object")),Ls=Bs(Me(At,Ge(lt,Je(lt(Object)))),["constructor"]);const Us=Y(1,function(e){if(!Ns(e)||!Ps(e))return!1;var t=Object.getPrototypeOf(e);return!!dt(t)||Ls(t)});const qs=Y(1,Ge(We,kt("String")));var $s=V(function(e){return Y(e.length,e)});const Hs=$s;const Rs=z(function(e,t){return Y(e+1,function(){var r=arguments[e];if(null!=r&&K(r[t]))return r[t].apply(r,Array.prototype.slice.call(arguments,0,e));throw new TypeError(lt(r)+' does not have a method named "'+t+'"')})});const Gs=Rs(1,"split");var Vs=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=le,e.prototype["@@transducer/result"]=ue,e.prototype["@@transducer/step"]=function(e,t){if(this.f){if(this.f(t))return e;this.f=null}return this.xf["@@transducer/step"](e,t)},e}();function zs(e){return function(t){return new Vs(e,t)}}const Xs=z(ae(["dropWhile"],zs,function(e,t){for(var r=0,s=t.length;r<s&&e(t[r]);)r+=1;return He(r,1/0,t)}));const Ws=Rs(1,"join");var Ys=V(function(e){return Y(e.length,function(t,r){var s=Array.prototype.slice.call(arguments,0);return s[0]=r,s[1]=t,e.apply(this,s)})});const Ks=Ys(z(Qe));const Js=Hs(function(e,t){return Ge(Gs(""),Xs(Ks(e)),Ws(""))(t)}),Qs=new WeakMap,Zs=e=>{if(Qs.has(e))return Qs.get(e);const t={},r=(e,s,n)=>("string"==typeof e.element&&(t[e.element]=e.$visitor?[...n,"$visitor"]:n),Os((e,t)=>{const i=[...n,t];if(Us(e)&&js("$ref",e)&&Fs(qs,"$ref",e)){const t=Nr(["$ref"],e),r=Js("#/",t);return Nr(r.split("/"),s)}return Us(e)?r(e,s,i):e},e)),s=r(e,e,[]);return s.elementMap=t,Qs.set(e,s),s},en=(e,t=os)=>{if(qs(e))try{return t.fromRefract(JSON.parse(e))}catch{}return Us(e)&&js("element",e)?t.fromRefract(e):t.toElement(e)},tn=e=>{if(!Gt(e))return e;if(Vt(e)||zt(e)||Wt(e)||Xt(e))return e.toValue();const t=new WeakMap,r=e=>{if(!Gt(e))return e;if(Kt(e)){if(t.has(e))return t.get(e);const s={};return t.set(e,s),e.forEach((e,t)=>{const n=r(t),i=r(e);"string"==typeof n&&(s[n]=i)}),s}if(Yt(e)){if(t.has(e))return t.get(e);const s=[];return t.set(e,s),e.forEach(e=>s.push(r(e))),s}return Qr(e)?String(e.toValue()):Jr(e)?Vt(e.href)?e.href.toValue():"":e.toValue()};return r(e)},rn=(e,t,r)=>JSON.stringify(tn(e),t,r);class sn{static indentChar=" ";result;indent;constructor({directive:e=!1,indent:t=0}={}){this.result=e?"%YAML 1.2\n---\n":"",this.indent=t}NumberElement(e){this.result+=tn(e.node)}BooleanElement(e){const t=tn(e.node);this.result+=t?"true":"false"}StringElement(e){this.result+=JSON.stringify(tn(e.node))}NullElement(){this.result+="null"}ArrayElement(e){const t=e.node;if(0===t.length)return this.result+="[]",void e.skip();t.forEach(e=>{const t=new sn({indent:this.indent+1}),r=sn.indentChar.repeat(this.indent);Ir(e,t);const{result:s}=t;this.result+=s.startsWith("\n")?`\n${r}-${s}`:`\n${r}- ${s}`}),e.skip()}ObjectElement(e){const t=e.node;if(0===t.length)return this.result+="{}",void e.skip();t.forEach((e,t)=>{const r=new sn({indent:this.indent+1}),s=new sn({indent:this.indent+1}),n=sn.indentChar.repeat(this.indent);Ir(t,r),Ir(e,s);const{result:i}=r,{result:o}=s;this.result+=o.startsWith("\n")?`\n${n}${i}:${o}`:`\n${n}${i}: ${o}`}),e.skip()}}const nn=(e,{directive:t=!1}={})=>{const r=new sn({directive:t});return Ir(e,r),r.result},on=(e,t=os)=>t.toRefract(e),an=(e,t=os)=>{const r=on(e,t);return JSON.stringify(r)},cn=e=>{let t="",r=0;return Ir(e,{enter(e){const{element:s}=e.node,n=s.charAt(0).toUpperCase()+s.slice(1),i=" ".repeat(r);t+=r>0?"\n":"",t+=`${i}(${n}Element`,r+=1},leave(){r-=1,t+=")"}}),t},ln=e=>{const t=e.isMetaEmpty?void 0:pr(e.meta),r=e.isAttributesEmpty?void 0:pr(e.attributes);return new e.constructor(void 0,t,r)},un=(e,t)=>t.clone&&t.isMergeableElement(e)?hn(ln(e),e,t):e,pn={clone:!0,isMergeableElement:e=>Kt(e)||Yt(e),arrayElementMerge:(e,t,r)=>new(0,e.constructor)(e.concat(t).map(e=>un(e,r))),objectElementMerge:(e,t,r)=>{const s=Kt(e)?ln(e):ln(t);return Kt(e)&&e.forEach((e,t,n)=>{const i=fr(n);i.value=un(e,r),s.content.push(i)}),t.forEach((t,n,i)=>{const o=tn(n);let a;if(Kt(e)&&e.hasKey(o)&&r.isMergeableElement(t)){const s=e.get(o);a=fr(i),a.value=((e,t)=>{if("function"!=typeof t.customMerge)return hn;const r=t.customMerge(e,t);return"function"==typeof r?r:hn})(n,r)(s,t,r)}else a=fr(i),a.value=un(t,r);s.remove(o),s.content.push(a)}),s},customMerge:void 0,customMetaMerge:void 0,customAttributesMerge:void 0},hn=(e,t,r)=>{const s={...pn,...r};s.isMergeableElement=s.isMergeableElement??pn.isMergeableElement,s.arrayElementMerge=s.arrayElementMerge??pn.arrayElementMerge,s.objectElementMerge=s.objectElementMerge??pn.objectElementMerge;const n=Yt(t);if(!(n===Yt(e)))return un(t,s);const i=n&&"function"==typeof s.arrayElementMerge?s.arrayElementMerge(e,t,s):s.objectElementMerge(e,t,s);return i.meta=(e=>"function"!=typeof e.customMetaMerge?e=>pr(e):e.customMetaMerge)(s)(e.meta,t.meta),i.attributes=(e=>"function"!=typeof e.customAttributesMerge?e=>pr(e):e.customAttributesMerge)(s)(e.attributes,t.attributes),i};hn.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of deepmerge should be an array.");return 0===e.length?new Rt:e.reduce((e,r)=>hn(e,r,t),ln(e[0]))};const dn=hn,fn=(e,t,r)=>{const s={...pn,...r,customMerge:()=>(e,t)=>t,clone:!1};return dn(e,t,s)};fn.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of mergeRight should be an array.");return 0===e.length?new Rt:e.reduce((e,r)=>fn(e,r,t),ln(e[0]))};const mn=fn,yn=(...[e,t,r])=>mn(t,e,r);yn.all=(...[e,t])=>mn.all([...e].reverse(),t);const gn=yn;return s})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.apidomCore=t():e.apidomCore=t()}(self,()=>(()=>{"use strict";var e={279:e=>{var t=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(t,r,s)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s,a=(e,t)=>{for(var r in t||(t={}))n.call(t,r)&&o(e,r,t[r]);if(s)for(var r of s(t))i.call(t,r)&&o(e,r,t[r]);return e},c=(e,t,r)=>o(e,"symbol"!=typeof t?t+"":t,r),l={};((t,r)=>{for(var s in r)e(t,s,{get:r[s],enumerable:!0})})(l,{DEFAULT_OPTIONS:()=>p,DEFAULT_UUID_LENGTH:()=>u,default:()=>f});var u=6,p={dictionary:"alphanum",shuffle:!0,debug:!1,length:u,counter:0},h=class{constructor(e={}){c(this,"counter"),c(this,"debug"),c(this,"dict"),c(this,"version"),c(this,"dictIndex",0),c(this,"dictRange",[]),c(this,"lowerBound",0),c(this,"upperBound",0),c(this,"dictLength",0),c(this,"uuidLength"),c(this,"_digit_first_ascii",48),c(this,"_digit_last_ascii",58),c(this,"_alpha_lower_first_ascii",97),c(this,"_alpha_lower_last_ascii",123),c(this,"_hex_last_ascii",103),c(this,"_alpha_upper_first_ascii",65),c(this,"_alpha_upper_last_ascii",91),c(this,"_number_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii]}),c(this,"_alpha_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alpha_lower_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),c(this,"_alpha_upper_dict_ranges",{upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alphanum_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_alphanum_lower_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),c(this,"_alphanum_upper_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),c(this,"_hex_dict_ranges",{decDigits:[this._digit_first_ascii,this._digit_last_ascii],alphaDigits:[this._alpha_lower_first_ascii,this._hex_last_ascii]}),c(this,"_dict_ranges",{_number_dict_ranges:this._number_dict_ranges,_alpha_dict_ranges:this._alpha_dict_ranges,_alpha_lower_dict_ranges:this._alpha_lower_dict_ranges,_alpha_upper_dict_ranges:this._alpha_upper_dict_ranges,_alphanum_dict_ranges:this._alphanum_dict_ranges,_alphanum_lower_dict_ranges:this._alphanum_lower_dict_ranges,_alphanum_upper_dict_ranges:this._alphanum_upper_dict_ranges,_hex_dict_ranges:this._hex_dict_ranges}),c(this,"log",(...e)=>{const t=[...e];t[0]="[short-unique-id] ".concat(e[0]),!0!==this.debug||"undefined"==typeof console||null===console||console.log(...t)}),c(this,"_normalizeDictionary",(e,t)=>{let r;if(e&&Array.isArray(e)&&e.length>1)r=e;else{r=[],this.dictIndex=0;const t="_".concat(e,"_dict_ranges"),s=this._dict_ranges[t];let n=0;for(const[,e]of Object.entries(s)){const[t,r]=e;n+=Math.abs(r-t)}r=new Array(n);let i=0;for(const[,e]of Object.entries(s)){this.dictRange=e,this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1];const t=this.lowerBound<=this.upperBound,s=this.lowerBound,n=this.upperBound;if(t)for(let e=s;e<n;e++)r[i++]=String.fromCharCode(e),this.dictIndex=e;else for(let e=s;e>n;e--)r[i++]=String.fromCharCode(e),this.dictIndex=e}r.length=i}if(t){for(let e=r.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[r[e],r[t]]=[r[t],r[e]]}}return r}),c(this,"setDictionary",(e,t)=>{this.dict=this._normalizeDictionary(e,t),this.dictLength=this.dict.length,this.setCounter(0)}),c(this,"seq",()=>this.sequentialUUID()),c(this,"sequentialUUID",()=>{const e=this.dictLength,t=this.dict;let r=this.counter;const s=[];do{const n=r%e;r=Math.trunc(r/e),s.push(t[n])}while(0!==r);const n=s.join("");return this.counter+=1,n}),c(this,"rnd",(e=this.uuidLength||u)=>this.randomUUID(e)),c(this,"randomUUID",(e=this.uuidLength||u)=>{if(null==e||e<1)throw new Error("Invalid UUID Length Provided");const t=new Array(e),r=this.dictLength,s=this.dict;for(let n=0;n<e;n++){const e=Math.floor(Math.random()*r);t[n]=s[e]}return t.join("")}),c(this,"fmt",(e,t)=>this.formattedUUID(e,t)),c(this,"formattedUUID",(e,t)=>{const r={$r:this.randomUUID,$s:this.sequentialUUID,$t:this.stamp};return e.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,e=>{const s=e.slice(0,2),n=Number.parseInt(e.slice(2),10);return"$s"===s?r[s]().padStart(n,"0"):"$t"===s&&t?r[s](n,t):r[s](n)})}),c(this,"availableUUIDs",(e=this.uuidLength)=>Number.parseFloat(([...new Set(this.dict)].length**e).toFixed(0))),c(this,"_collisionCache",new Map),c(this,"approxMaxBeforeCollision",(e=this.availableUUIDs(this.uuidLength))=>{const t=e,r=this._collisionCache.get(t);if(void 0!==r)return r;const s=Number.parseFloat(Math.sqrt(Math.PI/2*e).toFixed(20));return this._collisionCache.set(t,s),s}),c(this,"collisionProbability",(e=this.availableUUIDs(this.uuidLength),t=this.uuidLength)=>Number.parseFloat((this.approxMaxBeforeCollision(e)/this.availableUUIDs(t)).toFixed(20))),c(this,"uniqueness",(e=this.availableUUIDs(this.uuidLength))=>{const t=Number.parseFloat((1-this.approxMaxBeforeCollision(e)/e).toFixed(20));return t>1?1:t<0?0:t}),c(this,"getVersion",()=>this.version),c(this,"stamp",(e,t)=>{const r=Math.floor(+(t||new Date)/1e3).toString(16);if("number"==typeof e&&0===e)return r;if("number"!=typeof e||e<10)throw new Error(["Param finalLength must be a number greater than or equal to 10,","or 0 if you want the raw hexadecimal timestamp"].join("\n"));const s=e-9,n=Math.round(Math.random()*(s>15?15:s)),i=this.randomUUID(s);return"".concat(i.substring(0,n)).concat(r).concat(i.substring(n)).concat(n.toString(16))}),c(this,"parseStamp",(e,t)=>{if(t&&!/t0|t[1-9]\d{1,}/.test(t))throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");const r=t?t.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,e=>{const t={$r:e=>[...Array(e)].map(()=>"r").join(""),$s:e=>[...Array(e)].map(()=>"s").join(""),$t:e=>[...Array(e)].map(()=>"t").join("")},r=e.slice(0,2),s=Number.parseInt(e.slice(2),10);return t[r](s)}).replace(/^(.*?)(t{8,})(.*)$/g,(t,r,s)=>e.substring(r.length,r.length+s.length)):e;if(8===r.length)return new Date(1e3*Number.parseInt(r,16));if(r.length<10)throw new Error("Stamp length invalid");const s=Number.parseInt(r.substring(r.length-1),16);return new Date(1e3*Number.parseInt(r.substring(s,s+8),16))}),c(this,"setCounter",e=>{this.counter=e}),c(this,"validate",(e,t)=>{const r=t?this._normalizeDictionary(t):this.dict;return e.split("").every(e=>r.includes(e))});const t=a(a({},p),e);this.counter=0,this.debug=!1,this.dict=[],this.version="5.3.2";const{dictionary:r,shuffle:s,length:n,counter:i}=t;this.uuidLength=n,this.setDictionary(r,s),this.setCounter(i),this.debug=t.debug,this.log(this.dict),this.log("Generator instantiated with Dictionary Size ".concat(this.dictLength," and counter set to ").concat(this.counter)),this.log=this.log.bind(this),this.setDictionary=this.setDictionary.bind(this),this.setCounter=this.setCounter.bind(this),this.seq=this.seq.bind(this),this.sequentialUUID=this.sequentialUUID.bind(this),this.rnd=this.rnd.bind(this),this.randomUUID=this.randomUUID.bind(this),this.fmt=this.fmt.bind(this),this.formattedUUID=this.formattedUUID.bind(this),this.availableUUIDs=this.availableUUIDs.bind(this),this.approxMaxBeforeCollision=this.approxMaxBeforeCollision.bind(this),this.collisionProbability=this.collisionProbability.bind(this),this.uniqueness=this.uniqueness.bind(this),this.getVersion=this.getVersion.bind(this),this.stamp=this.stamp.bind(this),this.parseStamp=this.parseStamp.bind(this)}};c(h,"default",h);var d,f=h;return d=l,((s,i,o,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of r(i))n.call(s,c)||c===o||e(s,c,{get:()=>i[c],enumerable:!(a=t(i,c))||a.enumerable});return s})(e({},"__esModule",{value:!0}),d)})();e.exports=t.default,"undefined"!=typeof window&&(t=t.default)}},t={};function r(s){var n=t[s];if(void 0!==n)return n.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};function n(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function i(e){return function t(r){return 0===arguments.length||n(r)?t:e.apply(this,arguments)}}function o(e){return function t(r,s){switch(arguments.length){case 0:return t;case 1:return n(r)?t:i(function(t){return e(r,t)});default:return n(r)&&n(s)?t:n(r)?i(function(t){return e(t,s)}):n(s)?i(function(t){return e(r,t)}):e(r,s)}}}function a(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function c(e,t,r){for(var s=0,n=r.length;s<n;){if(e(t,r[s]))return!0;s+=1}return!1}function l(e,t){return Object.prototype.hasOwnProperty.call(t,e)}r.r(s),r.d(s,{ElementIdentityError:()=>hs,IdentityManager:()=>ds,MediaTypes:()=>bs,Transcluder:()=>As,createToolbox:()=>as,deepmerge:()=>hn,defaultIdentityManager:()=>fs,dehydrate:()=>nn,dispatchRefractorPlugins:()=>ls,from:()=>Zs,mergeLeft:()=>yn,mergeRight:()=>fn,refractorPluginElementIdentity:()=>ms,refractorPluginSemanticElementIdentity:()=>ys,resolveSpecification:()=>Qs,sexprs:()=>an,toJSON:()=>tn,toString:()=>on,toValue:()=>en,toYAML:()=>sn,transclude:()=>Es});const u="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var p=Object.prototype.toString;const h=function(){return"[object Arguments]"===p.call(arguments)?function(e){return"[object Arguments]"===p.call(e)}:function(e){return l("callee",e)}}();var d=!{toString:null}.propertyIsEnumerable("toString"),f=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=function(){return arguments.propertyIsEnumerable("length")}(),y=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1},g="function"!=typeof Object.keys||m?i(function(e){if(Object(e)!==e)return[];var t,r,s=[],n=m&&h(e);for(t in e)!l(t,e)||n&&"length"===t||(s[s.length]=t);if(d)for(r=f.length-1;r>=0;)l(t=f[r],e)&&!y(s,t)&&(s[s.length]=t),r-=1;return s}):i(function(e){return Object(e)!==e?[]:Object.keys(e)});const x=g;const b=i(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function w(e,t,r,s){var n=a(e);function i(e,t){return v(e,t,r.slice(),s.slice())}return!c(function(e,t){return!c(i,t,e)},a(t),n)}function v(e,t,r,s){if(u(e,t))return!0;var n=b(e);if(n!==b(t))return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(n){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!u(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!u(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=r.length-1;i>=0;){if(r[i]===e)return s[i]===t;i-=1}switch(n){case"Map":return e.size===t.size&&w(e.entries(),t.entries(),r.concat([e]),s.concat([t]));case"Set":return e.size===t.size&&w(e.values(),t.values(),r.concat([e]),s.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var o=x(e);if(o.length!==x(t).length)return!1;var a=r.concat([e]),c=s.concat([t]);for(i=o.length-1;i>=0;){var p=o[i];if(!l(p,t)||!v(t[p],e[p],a,c))return!1;i-=1}return!0}const k=o(function(e,t){return v(e,t,[],[])});const _=class{key;value;constructor(e,t){this.key=e,this.value=t}toValue(){return{key:this.key?.toValue(),value:this.value?.toValue()}}};class E{elements;constructor(e){this.elements=e??[]}toValue(){return this.elements.map(e=>({key:e.key?.toValue(),value:e.value?.toValue()}))}map(e,t){return this.elements.map(r=>{const s=r.value,n=r.key;if(void 0===s||void 0===n)throw new Error("MemberElement must have both key and value");return void 0!==t?e.call(t,s,n,r):e(s,n,r)})}filter(e,t){const r=this.elements.filter(r=>{const s=r.value,n=r.key;return void 0!==s&&void 0!==n&&(void 0!==t?e.call(t,s,n,r):e(s,n,r))});return new E(r)}reject(e,t){const r=[];for(const s of this.elements){const n=s.value,i=s.key;void 0!==n&&void 0!==i&&(e.call(t,n,i,s)||r.push(s))}return new E(r)}forEach(e,t){this.elements.forEach((r,s)=>{const n=r.value,i=r.key;void 0!==n&&void 0!==i&&(void 0!==t?e.call(t,n,i,r,s):e(n,i,r,s))})}find(e,t){return this.elements.find(r=>{const s=r.value,n=r.key;return void 0!==s&&void 0!==n&&(void 0!==t?e.call(t,s,n,r):e(s,n,r))})}keys(){return this.elements.map(e=>e.key?.toValue()).filter(e=>void 0!==e)}values(){return this.elements.map(e=>e.value?.toValue()).filter(e=>void 0!==e)}get length(){return this.elements.length}get isEmpty(){return 0===this.length}get first(){return this.elements[0]}get(e){return this.elements[e]}push(e){return this.elements.push(e),this}includesKey(e){return this.elements.some(t=>t.key?.equals(e))}[Symbol.iterator](){return this.elements[Symbol.iterator]()}}const A=E;class I{parent;startLine;startCharacter;startOffset;endLine;endCharacter;endOffset;_storedElement="element";_content;_meta;_attributes;constructor(e,t,r){void 0!==t&&(this.meta=t),void 0!==r&&(this.attributes=r),void 0!==e&&(this.content=e)}get element(){return this._storedElement}set element(e){this._storedElement=e}get content(){return this._content}set content(e){if(e instanceof I)this._content=e;else if(null!=e&&"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e&&"bigint"!=typeof e&&"symbol"!=typeof e)if(e instanceof _)this._content=e;else if(e instanceof A)this._content=e.elements;else if(Array.isArray(e))this._content=e.map(e=>this.refract(e));else{if("object"!=typeof e)throw new Error("Cannot set content to value of type "+typeof e);this._content=Object.entries(e).map(([e,t])=>new this.MemberElement(e,t))}else this._content=e}get meta(){if(!this._meta){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._meta=new this.ObjectElement}return this._meta}set meta(e){e instanceof I?this._meta=e:this.meta.set(e??{})}get attributes(){if(!this._attributes){if(this.isFrozen){const e=new this.ObjectElement;return e.freeze(),e}this._attributes=new this.ObjectElement}return this._attributes}set attributes(e){e instanceof I?this._attributes=e:this.attributes.set(e??{})}get id(){return this.getMetaProperty("id","")}set id(e){this.setMetaProperty("id",e)}get classes(){return this.getMetaProperty("classes",[])}set classes(e){this.setMetaProperty("classes",e)}get links(){return this.getMetaProperty("links",[])}set links(e){this.setMetaProperty("links",e)}get children(){const{_content:e}=this;if(Array.isArray(e))return e;if(e instanceof _){const t=[];return e.key&&t.push(e.key),e.value&&t.push(e.value),t}return e instanceof I?[e]:[]}get isFrozen(){return Object.isFrozen(this)}freeze(){if(!this.isFrozen){this._meta&&(this._meta.parent=this,this._meta.freeze()),this._attributes&&(this._attributes.parent=this,this._attributes.freeze());for(const e of this.children)e.parent=this,e.freeze();Array.isArray(this._content)&&Object.freeze(this._content),Object.freeze(this)}}toValue(){const{_content:e}=this;return e instanceof I||e instanceof _?e.toValue():Array.isArray(e)?e.map(e=>e.toValue()):e}equals(e){const t=e instanceof I?e.toValue():e;return k(this.toValue(),t)}primitive(){}set(e){return this.content=e,this}toRef(e){const t=this.id.toValue();if(""===t)throw new Error("Cannot create reference to an element without an ID");const r=new this.RefElement(t);return"string"==typeof e&&(r.path=this.refract(e)),r}getMetaProperty(e,t){if(!this.meta.hasKey(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.meta.set(e,t)}return this.meta.get(e)}setMetaProperty(e,t){this.meta.set(e,t)}hasMetaProperty(e){return!this.isMetaEmpty&&this.meta.hasKey(e)}get isMetaEmpty(){return void 0===this._meta||this.meta.isEmpty}getAttributesProperty(e,t){if(!this.hasAttributesProperty(e)){if(this.isFrozen){const e=this.refract(t);return e.freeze(),e}this.attributes.set(e,t)}return this.attributes.get(e)}setAttributesProperty(e,t){this.attributes.set(e,t)}hasAttributesProperty(e){return!this.isAttributesEmpty&&this.attributes.hasKey(e)}get isAttributesEmpty(){return void 0===this._attributes||this.attributes.isEmpty}}const S=I;const O=class extends S{constructor(e,t,r){super(e,t,r),this.element="string"}primitive(){return"string"}get length(){return this.content?.length??0}};const M=class extends S{constructor(e,t,r){super(e,t,r),this.element="number"}primitive(){return"number"}};const T=class extends S{constructor(e,t,r){super(e??null,t,r),this.element="null"}primitive(){return"null"}set(e){throw new Error("Cannot set the value of null")}};const C=class extends S{constructor(e,t,r){super(e,t,r),this.element="boolean"}primitive(){return"boolean"}};class D extends S{constructor(e,t,r){super(e||[],t,r)}get length(){return this._content.length}get isEmpty(){return 0===this.length}get first(){return this._content[0]}get second(){return this._content[1]}get last(){return this._content.at(-1)}push(...e){for(const t of e)this._content.push(this.refract(t));return this}shift(){return this._content.shift()}unshift(e){this._content.unshift(this.refract(e))}includes(e){return this._content.some(t=>t.equals(e))}findElements(e,t){const r=t||{},s=!!r.recursive,n=void 0===r.results?[]:r.results;for(let t=0;t<this._content.length;t+=1){const r=this._content[t],i=r;s&&"function"==typeof i.findElements&&i.findElements(e,{results:n,recursive:s}),e(r,t,void 0)&&n.push(r)}return n}find(e){const t=this.findElements(e,{recursive:!0});return new this.ArrayElement(t)}findByElement(e){return this.find(t=>t.element===e)}findByClass(e){return this.find(t=>{const r=t.classes;return"function"==typeof r.includes&&r.includes(e)})}getById(e){return this.find(t=>t.id.toValue()===e).first}concat(e){return new(0,this.constructor)(this._content.concat(e._content))}[Symbol.iterator](){return this._content[Symbol.iterator]()}}const j=D;const F=class extends j{constructor(e,t,r){super(e||[],t,r),this.element="array"}primitive(){return"array"}get(e){return this._content[e]}getValue(e){const t=this.get(e);if(t)return t.toValue()}set(e,t){return"number"==typeof e&&void 0!==t?this._content[e]=this.refract(t):this.content=e,this}remove(e){return this._content.splice(e,1)[0]??null}map(e,t){return this._content.map(e,t)}flatMap(e,t){return this._content.flatMap(e,t)}compactMap(e,t){const r=[];for(const s of this._content){const n=e.call(t,s);n&&r.push(n)}return r}filter(e,t){const r=this._content.filter(e,t);return new this.constructor(r)}reject(e,t){const r=[];for(const s of this._content)e.call(t,s)||r.push(s);return new this.constructor(r)}reduce(e,t){let r,s;void 0!==t?(r=0,s=this.refract(t)):(r=1,s=this.first);for(let t=r;t<this.length;t+=1){const r=e(s,this._content[t],t,this);s=void 0===r?r:this.refract(r)}return s}forEach(e,t){this._content.forEach((r,s)=>{e.call(t,r,s)})}empty(){return new this.constructor([])}};const B=class extends S{constructor(e,t,r,s){super(new _,r,s),this.element="member",void 0!==e&&(this.key=e),arguments.length>=2&&(this.value=t)}primitive(){return"member"}get key(){return this._content.key}set key(e){this._content.key=this.refract(e)}get value(){return this._content.value}set value(e){this._content.value=void 0===e?void 0:this.refract(e)}};const N=class extends j{constructor(e,t,r){super(e||[],t,r),this.element="object"}primitive(){return"object"}toValue(){return this._content.reduce((e,t)=>(e[t.key.toValue()]=t.value?t.value.toValue():void 0,e),{})}get(e){const t=this.getMember(e);if(t)return t.value}getValue(e){const t=this.get(e);if(t)return t.toValue()}getMember(e){if(void 0!==e)return this._content.find(t=>t.key.toValue()===e)}remove(e){let t=null;return this.content=this._content.filter(r=>r.key.toValue()!==e||(t=r,!1)),t}getKey(e){const t=this.getMember(e);if(t)return t.key}set(e,t){if("string"==typeof e){const r=this.getMember(e);r?r.value=t:this._content.push(new B(e,t))}else if("object"==typeof e&&!Array.isArray(e))for(const t of Object.keys(e))this.set(t,e[t]);return this}keys(){return this._content.map(e=>e.key.toValue())}values(){return this._content.map(e=>e.value.toValue())}hasKey(e){return this._content.some(t=>t.key.equals(e))}items(){return this._content.map(e=>[e.key.toValue(),e.value.toValue()])}map(e,t){return this._content.map(r=>e.call(t,r.value,r.key,r))}compactMap(e,t){const r=[];return this.forEach((s,n,i)=>{const o=e.call(t,s,n,i);o&&r.push(o)}),r}filter(e,t){return new A(this._content).filter(e,t)}reject(e,t){const r=[];for(const s of this._content)e.call(t,s.value,s.key,s)||r.push(s);return new A(r)}forEach(e,t){this._content.forEach(r=>e.call(t,r.value,r.key,r))}reduce(e,t){let r,s;void 0!==t?(r=0,s=this.refract(t)):(r=1,s=this._content[0]?.value);for(let t=r;t<this._content.length;t+=1){const r=this._content[t],n=e(s,r.value,r.key,r,this);s=void 0===n?n:this.refract(n)}return s}empty(){return new this.constructor([])}},P=e=>e instanceof S,L=e=>e instanceof O,U=e=>e instanceof M,q=e=>e instanceof T,$=e=>e instanceof C,H=e=>e instanceof F,R=e=>e instanceof N,G=e=>e instanceof B,V=e=>R(e)&&"object"===e.element||H(e)&&"array"===e.element||$(e)&&"boolean"===e.element||U(e)&&"number"===e.element||L(e)&&"string"===e.element||q(e)&&"null"===e.element||G(e)&&"member"===e.element,z=function(){const e=W,t=X,r=this,s="parser.js: Parser(): ";r.ast=void 0,r.stats=void 0,r.trace=void 0,r.callbacks=[];let n,i,o,a,c,l,u,p=0,h=0,d=0,f=0,m=0,y=new function(){this.state=e.ACTIVE,this.phraseLength=0,this.refresh=()=>{this.state=e.ACTIVE,this.phraseLength=0}};r.parse=(g,x,w,v)=>{const k=`${s}parse(): `;p=0,h=0,d=0,f=0,m=0,n=void 0,i=void 0,o=void 0,a=void 0,y.refresh(),c=void 0,l=void 0,u=void 0,a=t.stringToChars(w),n=g.rules,i=g.udts;const _=x.toLowerCase();let E;for(const e in n)if(n.hasOwnProperty(e)&&_===n[e].lower){E=n[e].index;break}if(void 0===E)throw new Error(`${k}start rule name '${startRule}' not recognized`);(()=>{const e=`${s}initializeCallbacks(): `;let t,o;for(c=[],l=[],t=0;t<n.length;t+=1)c[t]=void 0;for(t=0;t<i.length;t+=1)l[t]=void 0;const a=[];for(t=0;t<n.length;t+=1)a.push(n[t].lower);for(t=0;t<i.length;t+=1)a.push(i[t].lower);for(const s in r.callbacks)if(r.callbacks.hasOwnProperty(s)){if(t=a.indexOf(s.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${s}' not a rule or udt name`);if(o=r.callbacks[s]?r.callbacks[s]:void 0,"function"!=typeof o&&void 0!==o)throw new Error(`${e}syntax callback[${s}] must be function reference or falsy)`);t<n.length?c[t]=o:l[t-n.length]=o}})(),r.trace&&r.trace.init(n,i,a),r.stats&&r.stats.init(n,i),r.ast&&r.ast.init(n,i,a),u=v,o=[{type:e.RNM,index:E}],b(0,0),o=void 0;let A=!1;switch(y.state){case e.ACTIVE:throw new Error(`${k}final state should never be 'ACTIVE'`);case e.NOMATCH:A=!1;break;case e.EMPTY:case e.MATCH:A=y.phraseLength===a.length;break;default:throw new Error("unrecognized state")}return{success:A,state:y.state,stateName:e.idName(y.state),length:a.length,matched:y.phraseLength,maxMatched:m,maxTreeDepth:d,nodeHits:f}};const g=(t,r,n,i)=>{if(r.phraseLength>n){let e=`${s}opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${n}`,new Error(e)}switch(r.state){case e.ACTIVE:if(!i)throw new Error(`${s}opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:r.phraseLength=0;break;case e.MATCH:0===r.phraseLength&&(r.state=e.EMPTY);break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${s}opRNM(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}},x=(t,c)=>{let h,d,f;const m=o[t],g=i[m.index];y.UdtIndex=g.index,p||(f=r.ast&&r.ast.udtDefined(m.index),f&&(d=n.length+m.index,h=r.ast.getLength(),r.ast.down(d,g.name)));const x=a.length-c;l[m.index](y,a,c,u),((t,r,n)=>{if(r.phraseLength>n){let e=`${s}opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${n}`,new Error(e)}switch(r.state){case e.ACTIVE:throw new Error(`${s}opUDT(${t.name}) ACTIVE state return not allowed.`);case e.EMPTY:if(!t.empty)throw new Error(`${s}opUDT(${t.name}) may not return EMPTY.`);r.phraseLength=0;break;case e.MATCH:if(0===r.phraseLength){if(!t.empty)throw new Error(`${s}opUDT(${t.name}) may not return EMPTY.`);r.state=e.EMPTY}break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`${s}opUDT(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}})(g,y,x),p||f&&(y.state===e.NOMATCH?r.ast.setLength(h):r.ast.up(d,g.name,c,y.phraseLength))},b=(t,i)=>{const l=`${s}opExecute(): `,w=o[t];switch(f+=1,h>d&&(d=h),h+=1,y.refresh(),r.trace&&r.trace.down(w,i),w.type){case e.ALT:((t,r)=>{const s=o[t];for(let t=0;t<s.children.length&&(b(s.children[t],r),y.state===e.NOMATCH);t+=1);})(t,i);break;case e.CAT:((t,s)=>{let n,i,a,c;const l=o[t];r.ast&&(i=r.ast.getLength()),n=!0,a=s,c=0;for(let t=0;t<l.children.length;t+=1){if(b(l.children[t],a),y.state===e.NOMATCH){n=!1;break}a+=y.phraseLength,c+=y.phraseLength}n?(y.state=0===c?e.EMPTY:e.MATCH,y.phraseLength=c):(y.state=e.NOMATCH,y.phraseLength=0,r.ast&&r.ast.setLength(i))})(t,i);break;case e.REP:((t,s)=>{let n,i,c,l;const u=o[t];if(0===u.max)return y.state=e.EMPTY,void(y.phraseLength=0);for(i=s,c=0,l=0,r.ast&&(n=r.ast.getLength());!(i>=a.length)&&(b(t+1,i),y.state!==e.NOMATCH)&&y.state!==e.EMPTY&&(l+=1,c+=y.phraseLength,i+=y.phraseLength,l!==u.max););y.state===e.EMPTY||l>=u.min?(y.state=0===c?e.EMPTY:e.MATCH,y.phraseLength=c):(y.state=e.NOMATCH,y.phraseLength=0,r.ast&&r.ast.setLength(n))})(t,i);break;case e.RNM:((t,s)=>{let i,l,h;const d=o[t],f=n[d.index],m=c[f.index];if(p||(l=r.ast&&r.ast.ruleDefined(d.index),l&&(i=r.ast.getLength(),r.ast.down(d.index,n[d.index].name))),m){const t=a.length-s;m(y,a,s,u),g(f,y,t,!0),y.state===e.ACTIVE&&(h=o,o=f.opcodes,b(0,s),o=h,m(y,a,s,u),g(f,y,t,!1))}else h=o,o=f.opcodes,b(0,s,y),o=h;p||l&&(y.state===e.NOMATCH?r.ast.setLength(i):r.ast.up(d.index,f.name,s,y.phraseLength))})(t,i);break;case e.TRG:((t,r)=>{const s=o[t];y.state=e.NOMATCH,r<a.length&&s.min<=a[r]&&a[r]<=s.max&&(y.state=e.MATCH,y.phraseLength=1)})(t,i);break;case e.TBS:((t,r)=>{const s=o[t],n=s.string.length;if(y.state=e.NOMATCH,r+n<=a.length){for(let e=0;e<n;e+=1)if(a[r+e]!==s.string[e])return;y.state=e.MATCH,y.phraseLength=n}})(t,i);break;case e.TLS:((t,r)=>{let s;const n=o[t];y.state=e.NOMATCH;const i=n.string.length;if(0!==i){if(r+i<=a.length){for(let e=0;e<i;e+=1)if(s=a[r+e],s>=65&&s<=90&&(s+=32),s!==n.string[e])return;y.state=e.MATCH,y.phraseLength=i}}else y.state=e.EMPTY})(t,i);break;case e.UDT:x(t,i);break;case e.AND:((t,r)=>{switch(p+=1,b(t+1,r),p-=1,y.phraseLength=0,y.state){case e.EMPTY:case e.MATCH:y.state=e.EMPTY;break;case e.NOMATCH:y.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${y.state}`)}})(t,i);break;case e.NOT:((t,r)=>{switch(p+=1,b(t+1,r),p-=1,y.phraseLength=0,y.state){case e.EMPTY:case e.MATCH:y.state=e.NOMATCH;break;case e.NOMATCH:y.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${y.state}`)}})(t,i);break;default:throw new Error(`${l}unrecognized operator`)}p||i+y.phraseLength>m&&(m=i+y.phraseLength),r.stats&&r.stats.collect(w,y),r.trace&&r.trace.up(w,y.state,i,y.phraseLength),h-=1}},X={stringToChars:e=>[...e].map(e=>e.codePointAt(0)),charsToString:(e,t,r)=>{let s=e;for(;!(void 0===t||t<0);){if(void 0===r){s=e.slice(t);break}if(r<=0)return"";s=e.slice(t,t+r);break}return String.fromCodePoint(...s)}},W={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,idName:e=>{switch(e){case W.ALT:return"ALT";case W.CAT:return"CAT";case W.REP:return"REP";case W.RNM:return"RNM";case W.TRG:return"TRG";case W.TBS:return"TBS";case W.TLS:return"TLS";case W.UDT:return"UDT";case W.AND:return"AND";case W.NOT:return"NOT";case W.ACTIVE:return"ACTIVE";case W.EMPTY:return"EMPTY";case W.MATCH:return"MATCH";case W.NOMATCH:return"NOMATCH";case W.SEM_PRE:return"SEM_PRE";case W.SEM_POST:return"SEM_POST";case W.SEM_OK:return"SEM_OK";default:return"UNRECOGNIZED STATE"}}};function Y(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"json-pointer",lower:"json-pointer",index:0,isBkr:!1},this.rules[1]={name:"reference-token",lower:"reference-token",index:1,isBkr:!1},this.rules[2]={name:"unescaped",lower:"unescaped",index:2,isBkr:!1},this.rules[3]={name:"escaped",lower:"escaped",index:3,isBkr:!1},this.rules[4]={name:"array-location",lower:"array-location",index:4,isBkr:!1},this.rules[5]={name:"array-index",lower:"array-index",index:5,isBkr:!1},this.rules[6]={name:"array-dash",lower:"array-dash",index:6,isBkr:!1},this.rules[7]={name:"slash",lower:"slash",index:7,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:2,children:[2,3]},this.rules[0].opcodes[2]={type:4,index:7},this.rules[0].opcodes[3]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:1,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:2},this.rules[1].opcodes[3]={type:4,index:3},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3]},this.rules[2].opcodes[1]={type:5,min:0,max:46},this.rules[2].opcodes[2]={type:5,min:48,max:125},this.rules[2].opcodes[3]={type:5,min:127,max:1114111},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2]},this.rules[3].opcodes[1]={type:7,string:[126]},this.rules[3].opcodes[2]={type:1,children:[3,4]},this.rules[3].opcodes[3]={type:7,string:[48]},this.rules[3].opcodes[4]={type:7,string:[49]},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2]},this.rules[5].opcodes[1]={type:6,string:[48]},this.rules[5].opcodes[2]={type:2,children:[3,4]},this.rules[5].opcodes[3]={type:5,min:49,max:57},this.rules[5].opcodes[4]={type:3,min:0,max:1/0},this.rules[5].opcodes[5]={type:5,min:48,max:57},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:7,string:[45]},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:7,string:[47]},this.toString=function(){let e="";return e+="; JavaScript Object Notation (JSON) Pointer ABNF syntax\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901\n",e+="json-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\n",e+="reference-token = *( unescaped / escaped )\n",e+="unescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n",e+=" ; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'\n",e+='escaped = "~" ( "0" / "1" )\n',e+=" ; representing '~' and '/', respectively\n",e+="\n",e+="; https://datatracker.ietf.org/doc/html/rfc6901#section-4\n",e+="array-location = array-index / array-dash\n",e+="array-index = %x30 / ( %x31-39 *(%x30-39) )\n",e+=' ; "0", or digits without a leading "0"\n',e+='array-dash = "-"\n',e+="\n",e+="; Surrogate named rules\n",e+='slash = "/"\n','; JavaScript Object Notation (JSON) Pointer ABNF syntax\n; https://datatracker.ietf.org/doc/html/rfc6901\njson-pointer = *( slash reference-token ) ; MODIFICATION: surrogate text rule used\nreference-token = *( unescaped / escaped )\nunescaped = %x00-2E / %x30-7D / %x7F-10FFFF\n ; %x2F (\'/\') and %x7E (\'~\') are excluded from \'unescaped\'\nescaped = "~" ( "0" / "1" )\n ; representing \'~\' and \'/\', respectively\n\n; https://datatracker.ietf.org/doc/html/rfc6901#section-4\narray-location = array-index / array-dash\narray-index = %x30 / ( %x31-39 *(%x30-39) )\n ; "0", or digits without a leading "0"\narray-dash = "-"\n\n; Surrogate named rules\nslash = "/"\n'}}class K extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}}const J=K;new Y;new Y,new z,new Y,new z,new Y,new z,new Y,new z;const Q=e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return String(e).replace(/~/g,"~0").replace(/\//g,"~1")};const Z=class extends J{},ee=e=>{if(!Array.isArray(e))throw new TypeError("Reference tokens must be a list of strings or numbers");try{return 0===e.length?"":`/${e.map(e=>{if("string"!=typeof e&&"number"!=typeof e)throw new TypeError("Reference token must be a string or number");return Q(String(e))}).join("/")}`}catch(t){throw new Z("Unexpected error during JSON Pointer compilation",{cause:t,referenceTokens:e})}};class te extends Error{constructor(e,t=void 0){if(super(e,t),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=t&&"object"==typeof t&&Object.hasOwn(t,"cause")&&!("cause"in this)){const{cause:e}=t;this.cause=e,e instanceof Error&&"stack"in e&&(this.stack=`${this.stack}\nCAUSE: ${e.stack}`)}if(null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}}const re=te;new function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"jsonpath-query",lower:"jsonpath-query",index:0,isBkr:!1},this.rules[1]={name:"segments",lower:"segments",index:1,isBkr:!1},this.rules[2]={name:"B",lower:"b",index:2,isBkr:!1},this.rules[3]={name:"S",lower:"s",index:3,isBkr:!1},this.rules[4]={name:"root-identifier",lower:"root-identifier",index:4,isBkr:!1},this.rules[5]={name:"selector",lower:"selector",index:5,isBkr:!1},this.rules[6]={name:"name-selector",lower:"name-selector",index:6,isBkr:!1},this.rules[7]={name:"string-literal",lower:"string-literal",index:7,isBkr:!1},this.rules[8]={name:"double-quoted",lower:"double-quoted",index:8,isBkr:!1},this.rules[9]={name:"single-quoted",lower:"single-quoted",index:9,isBkr:!1},this.rules[10]={name:"ESC",lower:"esc",index:10,isBkr:!1},this.rules[11]={name:"unescaped",lower:"unescaped",index:11,isBkr:!1},this.rules[12]={name:"escapable",lower:"escapable",index:12,isBkr:!1},this.rules[13]={name:"hexchar",lower:"hexchar",index:13,isBkr:!1},this.rules[14]={name:"non-surrogate",lower:"non-surrogate",index:14,isBkr:!1},this.rules[15]={name:"high-surrogate",lower:"high-surrogate",index:15,isBkr:!1},this.rules[16]={name:"low-surrogate",lower:"low-surrogate",index:16,isBkr:!1},this.rules[17]={name:"HEXDIG",lower:"hexdig",index:17,isBkr:!1},this.rules[18]={name:"wildcard-selector",lower:"wildcard-selector",index:18,isBkr:!1},this.rules[19]={name:"index-selector",lower:"index-selector",index:19,isBkr:!1},this.rules[20]={name:"int",lower:"int",index:20,isBkr:!1},this.rules[21]={name:"DIGIT1",lower:"digit1",index:21,isBkr:!1},this.rules[22]={name:"slice-selector",lower:"slice-selector",index:22,isBkr:!1},this.rules[23]={name:"start",lower:"start",index:23,isBkr:!1},this.rules[24]={name:"end",lower:"end",index:24,isBkr:!1},this.rules[25]={name:"step",lower:"step",index:25,isBkr:!1},this.rules[26]={name:"filter-selector",lower:"filter-selector",index:26,isBkr:!1},this.rules[27]={name:"logical-expr",lower:"logical-expr",index:27,isBkr:!1},this.rules[28]={name:"logical-or-expr",lower:"logical-or-expr",index:28,isBkr:!1},this.rules[29]={name:"logical-and-expr",lower:"logical-and-expr",index:29,isBkr:!1},this.rules[30]={name:"basic-expr",lower:"basic-expr",index:30,isBkr:!1},this.rules[31]={name:"paren-expr",lower:"paren-expr",index:31,isBkr:!1},this.rules[32]={name:"logical-not-op",lower:"logical-not-op",index:32,isBkr:!1},this.rules[33]={name:"test-expr",lower:"test-expr",index:33,isBkr:!1},this.rules[34]={name:"filter-query",lower:"filter-query",index:34,isBkr:!1},this.rules[35]={name:"rel-query",lower:"rel-query",index:35,isBkr:!1},this.rules[36]={name:"current-node-identifier",lower:"current-node-identifier",index:36,isBkr:!1},this.rules[37]={name:"comparison-expr",lower:"comparison-expr",index:37,isBkr:!1},this.rules[38]={name:"literal",lower:"literal",index:38,isBkr:!1},this.rules[39]={name:"comparable",lower:"comparable",index:39,isBkr:!1},this.rules[40]={name:"comparison-op",lower:"comparison-op",index:40,isBkr:!1},this.rules[41]={name:"singular-query",lower:"singular-query",index:41,isBkr:!1},this.rules[42]={name:"rel-singular-query",lower:"rel-singular-query",index:42,isBkr:!1},this.rules[43]={name:"abs-singular-query",lower:"abs-singular-query",index:43,isBkr:!1},this.rules[44]={name:"singular-query-segments",lower:"singular-query-segments",index:44,isBkr:!1},this.rules[45]={name:"name-segment",lower:"name-segment",index:45,isBkr:!1},this.rules[46]={name:"index-segment",lower:"index-segment",index:46,isBkr:!1},this.rules[47]={name:"number",lower:"number",index:47,isBkr:!1},this.rules[48]={name:"frac",lower:"frac",index:48,isBkr:!1},this.rules[49]={name:"exp",lower:"exp",index:49,isBkr:!1},this.rules[50]={name:"true",lower:"true",index:50,isBkr:!1},this.rules[51]={name:"false",lower:"false",index:51,isBkr:!1},this.rules[52]={name:"null",lower:"null",index:52,isBkr:!1},this.rules[53]={name:"function-name",lower:"function-name",index:53,isBkr:!1},this.rules[54]={name:"function-name-first",lower:"function-name-first",index:54,isBkr:!1},this.rules[55]={name:"function-name-char",lower:"function-name-char",index:55,isBkr:!1},this.rules[56]={name:"LCALPHA",lower:"lcalpha",index:56,isBkr:!1},this.rules[57]={name:"function-expr",lower:"function-expr",index:57,isBkr:!1},this.rules[58]={name:"function-argument",lower:"function-argument",index:58,isBkr:!1},this.rules[59]={name:"segment",lower:"segment",index:59,isBkr:!1},this.rules[60]={name:"child-segment",lower:"child-segment",index:60,isBkr:!1},this.rules[61]={name:"bracketed-selection",lower:"bracketed-selection",index:61,isBkr:!1},this.rules[62]={name:"member-name-shorthand",lower:"member-name-shorthand",index:62,isBkr:!1},this.rules[63]={name:"name-first",lower:"name-first",index:63,isBkr:!1},this.rules[64]={name:"name-char",lower:"name-char",index:64,isBkr:!1},this.rules[65]={name:"DIGIT",lower:"digit",index:65,isBkr:!1},this.rules[66]={name:"ALPHA",lower:"alpha",index:66,isBkr:!1},this.rules[67]={name:"descendant-segment",lower:"descendant-segment",index:67,isBkr:!1},this.rules[68]={name:"normalized-path",lower:"normalized-path",index:68,isBkr:!1},this.rules[69]={name:"normal-index-segment",lower:"normal-index-segment",index:69,isBkr:!1},this.rules[70]={name:"normal-selector",lower:"normal-selector",index:70,isBkr:!1},this.rules[71]={name:"normal-name-selector",lower:"normal-name-selector",index:71,isBkr:!1},this.rules[72]={name:"normal-single-quoted",lower:"normal-single-quoted",index:72,isBkr:!1},this.rules[73]={name:"normal-unescaped",lower:"normal-unescaped",index:73,isBkr:!1},this.rules[74]={name:"normal-escapable",lower:"normal-escapable",index:74,isBkr:!1},this.rules[75]={name:"normal-hexchar",lower:"normal-hexchar",index:75,isBkr:!1},this.rules[76]={name:"normal-HEXDIG",lower:"normal-hexdig",index:76,isBkr:!1},this.rules[77]={name:"normal-index-selector",lower:"normal-index-selector",index:77,isBkr:!1},this.rules[78]={name:"dot-prefix",lower:"dot-prefix",index:78,isBkr:!1},this.rules[79]={name:"double-dot-prefix",lower:"double-dot-prefix",index:79,isBkr:!1},this.rules[80]={name:"left-bracket",lower:"left-bracket",index:80,isBkr:!1},this.rules[81]={name:"right-bracket",lower:"right-bracket",index:81,isBkr:!1},this.rules[82]={name:"left-paren",lower:"left-paren",index:82,isBkr:!1},this.rules[83]={name:"right-paren",lower:"right-paren",index:83,isBkr:!1},this.rules[84]={name:"comma",lower:"comma",index:84,isBkr:!1},this.rules[85]={name:"colon",lower:"colon",index:85,isBkr:!1},this.rules[86]={name:"dquote",lower:"dquote",index:86,isBkr:!1},this.rules[87]={name:"squote",lower:"squote",index:87,isBkr:!1},this.rules[88]={name:"questionmark",lower:"questionmark",index:88,isBkr:!1},this.rules[89]={name:"disjunction",lower:"disjunction",index:89,isBkr:!1},this.rules[90]={name:"conjunction",lower:"conjunction",index:90,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,2]},this.rules[0].opcodes[1]={type:4,index:4},this.rules[0].opcodes[2]={type:4,index:1},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:3,min:0,max:1/0},this.rules[1].opcodes[1]={type:2,children:[2,3]},this.rules[1].opcodes[2]={type:4,index:3},this.rules[1].opcodes[3]={type:4,index:59},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:6,string:[32]},this.rules[2].opcodes[2]={type:6,string:[9]},this.rules[2].opcodes[3]={type:6,string:[10]},this.rules[2].opcodes[4]={type:6,string:[13]},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:0,max:1/0},this.rules[3].opcodes[1]={type:4,index:2},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:7,string:[36]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[5].opcodes[1]={type:4,index:6},this.rules[5].opcodes[2]={type:4,index:18},this.rules[5].opcodes[3]={type:4,index:22},this.rules[5].opcodes[4]={type:4,index:19},this.rules[5].opcodes[5]={type:4,index:26},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:4,index:7},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,6]},this.rules[7].opcodes[1]={type:2,children:[2,3,5]},this.rules[7].opcodes[2]={type:4,index:86},this.rules[7].opcodes[3]={type:3,min:0,max:1/0},this.rules[7].opcodes[4]={type:4,index:8},this.rules[7].opcodes[5]={type:4,index:86},this.rules[7].opcodes[6]={type:2,children:[7,8,10]},this.rules[7].opcodes[7]={type:4,index:87},this.rules[7].opcodes[8]={type:3,min:0,max:1/0},this.rules[7].opcodes[9]={type:4,index:9},this.rules[7].opcodes[10]={type:4,index:87},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[8].opcodes[1]={type:4,index:11},this.rules[8].opcodes[2]={type:6,string:[39]},this.rules[8].opcodes[3]={type:2,children:[4,5]},this.rules[8].opcodes[4]={type:4,index:10},this.rules[8].opcodes[5]={type:6,string:[34]},this.rules[8].opcodes[6]={type:2,children:[7,8]},this.rules[8].opcodes[7]={type:4,index:10},this.rules[8].opcodes[8]={type:4,index:12},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2,3,6]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:6,string:[34]},this.rules[9].opcodes[3]={type:2,children:[4,5]},this.rules[9].opcodes[4]={type:4,index:10},this.rules[9].opcodes[5]={type:6,string:[39]},this.rules[9].opcodes[6]={type:2,children:[7,8]},this.rules[9].opcodes[7]={type:4,index:10},this.rules[9].opcodes[8]={type:4,index:12},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[92]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[11].opcodes[1]={type:5,min:32,max:33},this.rules[11].opcodes[2]={type:5,min:35,max:38},this.rules[11].opcodes[3]={type:5,min:40,max:91},this.rules[11].opcodes[4]={type:5,min:93,max:55295},this.rules[11].opcodes[5]={type:5,min:57344,max:1114111},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[12].opcodes[1]={type:6,string:[98]},this.rules[12].opcodes[2]={type:6,string:[102]},this.rules[12].opcodes[3]={type:6,string:[110]},this.rules[12].opcodes[4]={type:6,string:[114]},this.rules[12].opcodes[5]={type:6,string:[116]},this.rules[12].opcodes[6]={type:7,string:[47]},this.rules[12].opcodes[7]={type:7,string:[92]},this.rules[12].opcodes[8]={type:2,children:[9,10]},this.rules[12].opcodes[9]={type:6,string:[117]},this.rules[12].opcodes[10]={type:4,index:13},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:1,children:[1,2]},this.rules[13].opcodes[1]={type:4,index:14},this.rules[13].opcodes[2]={type:2,children:[3,4,5,6]},this.rules[13].opcodes[3]={type:4,index:15},this.rules[13].opcodes[4]={type:7,string:[92]},this.rules[13].opcodes[5]={type:6,string:[117]},this.rules[13].opcodes[6]={type:4,index:16},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:1,children:[1,11]},this.rules[14].opcodes[1]={type:2,children:[2,9]},this.rules[14].opcodes[2]={type:1,children:[3,4,5,6,7,8]},this.rules[14].opcodes[3]={type:4,index:65},this.rules[14].opcodes[4]={type:7,string:[97]},this.rules[14].opcodes[5]={type:7,string:[98]},this.rules[14].opcodes[6]={type:7,string:[99]},this.rules[14].opcodes[7]={type:7,string:[101]},this.rules[14].opcodes[8]={type:7,string:[102]},this.rules[14].opcodes[9]={type:3,min:3,max:3},this.rules[14].opcodes[10]={type:4,index:17},this.rules[14].opcodes[11]={type:2,children:[12,13,14]},this.rules[14].opcodes[12]={type:7,string:[100]},this.rules[14].opcodes[13]={type:5,min:48,max:55},this.rules[14].opcodes[14]={type:3,min:2,max:2},this.rules[14].opcodes[15]={type:4,index:17},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2,7]},this.rules[15].opcodes[1]={type:7,string:[100]},this.rules[15].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[15].opcodes[3]={type:7,string:[56]},this.rules[15].opcodes[4]={type:7,string:[57]},this.rules[15].opcodes[5]={type:7,string:[97]},this.rules[15].opcodes[6]={type:7,string:[98]},this.rules[15].opcodes[7]={type:3,min:2,max:2},this.rules[15].opcodes[8]={type:4,index:17},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,2,7]},this.rules[16].opcodes[1]={type:7,string:[100]},this.rules[16].opcodes[2]={type:1,children:[3,4,5,6]},this.rules[16].opcodes[3]={type:7,string:[99]},this.rules[16].opcodes[4]={type:7,string:[100]},this.rules[16].opcodes[5]={type:7,string:[101]},this.rules[16].opcodes[6]={type:7,string:[102]},this.rules[16].opcodes[7]={type:3,min:2,max:2},this.rules[16].opcodes[8]={type:4,index:17},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,2,3,4,5,6,7]},this.rules[17].opcodes[1]={type:4,index:65},this.rules[17].opcodes[2]={type:7,string:[97]},this.rules[17].opcodes[3]={type:7,string:[98]},this.rules[17].opcodes[4]={type:7,string:[99]},this.rules[17].opcodes[5]={type:7,string:[100]},this.rules[17].opcodes[6]={type:7,string:[101]},this.rules[17].opcodes[7]={type:7,string:[102]},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:7,string:[42]},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:4,index:20},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:1,children:[1,2]},this.rules[20].opcodes[1]={type:7,string:[48]},this.rules[20].opcodes[2]={type:2,children:[3,5,6]},this.rules[20].opcodes[3]={type:3,min:0,max:1},this.rules[20].opcodes[4]={type:7,string:[45]},this.rules[20].opcodes[5]={type:4,index:21},this.rules[20].opcodes[6]={type:3,min:0,max:1/0},this.rules[20].opcodes[7]={type:4,index:65},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:5,min:49,max:57},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:2,children:[1,5,6,7,11]},this.rules[22].opcodes[1]={type:3,min:0,max:1},this.rules[22].opcodes[2]={type:2,children:[3,4]},this.rules[22].opcodes[3]={type:4,index:23},this.rules[22].opcodes[4]={type:4,index:3},this.rules[22].opcodes[5]={type:4,index:85},this.rules[22].opcodes[6]={type:4,index:3},this.rules[22].opcodes[7]={type:3,min:0,max:1},this.rules[22].opcodes[8]={type:2,children:[9,10]},this.rules[22].opcodes[9]={type:4,index:24},this.rules[22].opcodes[10]={type:4,index:3},this.rules[22].opcodes[11]={type:3,min:0,max:1},this.rules[22].opcodes[12]={type:2,children:[13,14]},this.rules[22].opcodes[13]={type:4,index:85},this.rules[22].opcodes[14]={type:3,min:0,max:1},this.rules[22].opcodes[15]={type:2,children:[16,17]},this.rules[22].opcodes[16]={type:4,index:3},this.rules[22].opcodes[17]={type:4,index:25},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:4,index:20},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:4,index:20},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:4,index:20},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:2,children:[1,2,3]},this.rules[26].opcodes[1]={type:4,index:88},this.rules[26].opcodes[2]={type:4,index:3},this.rules[26].opcodes[3]={type:4,index:27},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:4,index:28},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:29},this.rules[28].opcodes[2]={type:3,min:0,max:1/0},this.rules[28].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[28].opcodes[4]={type:4,index:3},this.rules[28].opcodes[5]={type:4,index:89},this.rules[28].opcodes[6]={type:4,index:3},this.rules[28].opcodes[7]={type:4,index:29},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:2,children:[1,2]},this.rules[29].opcodes[1]={type:4,index:30},this.rules[29].opcodes[2]={type:3,min:0,max:1/0},this.rules[29].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[29].opcodes[4]={type:4,index:3},this.rules[29].opcodes[5]={type:4,index:90},this.rules[29].opcodes[6]={type:4,index:3},this.rules[29].opcodes[7]={type:4,index:30},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:1,children:[1,2,3]},this.rules[30].opcodes[1]={type:4,index:31},this.rules[30].opcodes[2]={type:4,index:37},this.rules[30].opcodes[3]={type:4,index:33},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:2,children:[1,5,6,7,8,9]},this.rules[31].opcodes[1]={type:3,min:0,max:1},this.rules[31].opcodes[2]={type:2,children:[3,4]},this.rules[31].opcodes[3]={type:4,index:32},this.rules[31].opcodes[4]={type:4,index:3},this.rules[31].opcodes[5]={type:4,index:82},this.rules[31].opcodes[6]={type:4,index:3},this.rules[31].opcodes[7]={type:4,index:27},this.rules[31].opcodes[8]={type:4,index:3},this.rules[31].opcodes[9]={type:4,index:83},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:7,string:[33]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:2,children:[1,5]},this.rules[33].opcodes[1]={type:3,min:0,max:1},this.rules[33].opcodes[2]={type:2,children:[3,4]},this.rules[33].opcodes[3]={type:4,index:32},this.rules[33].opcodes[4]={type:4,index:3},this.rules[33].opcodes[5]={type:1,children:[6,7]},this.rules[33].opcodes[6]={type:4,index:34},this.rules[33].opcodes[7]={type:4,index:57},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:1,children:[1,2]},this.rules[34].opcodes[1]={type:4,index:35},this.rules[34].opcodes[2]={type:4,index:0},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:2,children:[1,2]},this.rules[35].opcodes[1]={type:4,index:36},this.rules[35].opcodes[2]={type:4,index:1},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:7,string:[64]},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:2,children:[1,2,3,4,5]},this.rules[37].opcodes[1]={type:4,index:39},this.rules[37].opcodes[2]={type:4,index:3},this.rules[37].opcodes[3]={type:4,index:40},this.rules[37].opcodes[4]={type:4,index:3},this.rules[37].opcodes[5]={type:4,index:39},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:1,children:[1,2,3,4,5]},this.rules[38].opcodes[1]={type:4,index:47},this.rules[38].opcodes[2]={type:4,index:7},this.rules[38].opcodes[3]={type:4,index:50},this.rules[38].opcodes[4]={type:4,index:51},this.rules[38].opcodes[5]={type:4,index:52},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:1,children:[1,2,3]},this.rules[39].opcodes[1]={type:4,index:41},this.rules[39].opcodes[2]={type:4,index:57},this.rules[39].opcodes[3]={type:4,index:38},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2,3,4,5,6]},this.rules[40].opcodes[1]={type:7,string:[61,61]},this.rules[40].opcodes[2]={type:7,string:[33,61]},this.rules[40].opcodes[3]={type:7,string:[60,61]},this.rules[40].opcodes[4]={type:7,string:[62,61]},this.rules[40].opcodes[5]={type:7,string:[60]},this.rules[40].opcodes[6]={type:7,string:[62]},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:1,children:[1,2]},this.rules[41].opcodes[1]={type:4,index:42},this.rules[41].opcodes[2]={type:4,index:43},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:4,index:36},this.rules[42].opcodes[2]={type:4,index:44},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:2,children:[1,2]},this.rules[43].opcodes[1]={type:4,index:4},this.rules[43].opcodes[2]={type:4,index:44},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:3,min:0,max:1/0},this.rules[44].opcodes[1]={type:2,children:[2,3]},this.rules[44].opcodes[2]={type:4,index:3},this.rules[44].opcodes[3]={type:1,children:[4,5]},this.rules[44].opcodes[4]={type:4,index:45},this.rules[44].opcodes[5]={type:4,index:46},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:1,children:[1,5]},this.rules[45].opcodes[1]={type:2,children:[2,3,4]},this.rules[45].opcodes[2]={type:4,index:80},this.rules[45].opcodes[3]={type:4,index:6},this.rules[45].opcodes[4]={type:4,index:81},this.rules[45].opcodes[5]={type:2,children:[6,7]},this.rules[45].opcodes[6]={type:4,index:78},this.rules[45].opcodes[7]={type:4,index:62},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:2,children:[1,2,3]},this.rules[46].opcodes[1]={type:4,index:80},this.rules[46].opcodes[2]={type:4,index:19},this.rules[46].opcodes[3]={type:4,index:81},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:2,children:[1,4,6]},this.rules[47].opcodes[1]={type:1,children:[2,3]},this.rules[47].opcodes[2]={type:4,index:20},this.rules[47].opcodes[3]={type:7,string:[45,48]},this.rules[47].opcodes[4]={type:3,min:0,max:1},this.rules[47].opcodes[5]={type:4,index:48},this.rules[47].opcodes[6]={type:3,min:0,max:1},this.rules[47].opcodes[7]={type:4,index:49},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:2,children:[1,2]},this.rules[48].opcodes[1]={type:7,string:[46]},this.rules[48].opcodes[2]={type:3,min:1,max:1/0},this.rules[48].opcodes[3]={type:4,index:65},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:2,children:[1,2,6]},this.rules[49].opcodes[1]={type:7,string:[101]},this.rules[49].opcodes[2]={type:3,min:0,max:1},this.rules[49].opcodes[3]={type:1,children:[4,5]},this.rules[49].opcodes[4]={type:7,string:[45]},this.rules[49].opcodes[5]={type:7,string:[43]},this.rules[49].opcodes[6]={type:3,min:1,max:1/0},this.rules[49].opcodes[7]={type:4,index:65},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[116,114,117,101]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[102,97,108,115,101]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[110,117,108,108]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:4,index:54},this.rules[53].opcodes[2]={type:3,min:0,max:1/0},this.rules[53].opcodes[3]={type:4,index:55},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:4,index:56},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:1,children:[1,2,3]},this.rules[55].opcodes[1]={type:4,index:54},this.rules[55].opcodes[2]={type:7,string:[95]},this.rules[55].opcodes[3]={type:4,index:65},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:5,min:97,max:122},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:2,children:[1,2,3,4,13,14]},this.rules[57].opcodes[1]={type:4,index:53},this.rules[57].opcodes[2]={type:4,index:82},this.rules[57].opcodes[3]={type:4,index:3},this.rules[57].opcodes[4]={type:3,min:0,max:1},this.rules[57].opcodes[5]={type:2,children:[6,7]},this.rules[57].opcodes[6]={type:4,index:58},this.rules[57].opcodes[7]={type:3,min:0,max:1/0},this.rules[57].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[57].opcodes[9]={type:4,index:3},this.rules[57].opcodes[10]={type:4,index:84},this.rules[57].opcodes[11]={type:4,index:3},this.rules[57].opcodes[12]={type:4,index:58},this.rules[57].opcodes[13]={type:4,index:3},this.rules[57].opcodes[14]={type:4,index:83},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[58].opcodes[1]={type:4,index:27},this.rules[58].opcodes[2]={type:4,index:34},this.rules[58].opcodes[3]={type:4,index:57},this.rules[58].opcodes[4]={type:4,index:38},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:1,children:[1,2]},this.rules[59].opcodes[1]={type:4,index:60},this.rules[59].opcodes[2]={type:4,index:67},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:1,children:[1,2]},this.rules[60].opcodes[1]={type:4,index:61},this.rules[60].opcodes[2]={type:2,children:[3,4]},this.rules[60].opcodes[3]={type:4,index:78},this.rules[60].opcodes[4]={type:1,children:[5,6]},this.rules[60].opcodes[5]={type:4,index:18},this.rules[60].opcodes[6]={type:4,index:62},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3,4,10,11]},this.rules[61].opcodes[1]={type:4,index:80},this.rules[61].opcodes[2]={type:4,index:3},this.rules[61].opcodes[3]={type:4,index:5},this.rules[61].opcodes[4]={type:3,min:0,max:1/0},this.rules[61].opcodes[5]={type:2,children:[6,7,8,9]},this.rules[61].opcodes[6]={type:4,index:3},this.rules[61].opcodes[7]={type:4,index:84},this.rules[61].opcodes[8]={type:4,index:3},this.rules[61].opcodes[9]={type:4,index:5},this.rules[61].opcodes[10]={type:4,index:3},this.rules[61].opcodes[11]={type:4,index:81},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:2,children:[1,2]},this.rules[62].opcodes[1]={type:4,index:63},this.rules[62].opcodes[2]={type:3,min:0,max:1/0},this.rules[62].opcodes[3]={type:4,index:64},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[63].opcodes[1]={type:4,index:66},this.rules[63].opcodes[2]={type:7,string:[95]},this.rules[63].opcodes[3]={type:5,min:128,max:55295},this.rules[63].opcodes[4]={type:5,min:57344,max:1114111},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:1,children:[1,2]},this.rules[64].opcodes[1]={type:4,index:63},this.rules[64].opcodes[2]={type:4,index:65},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:5,min:48,max:57},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:1,children:[1,2]},this.rules[66].opcodes[1]={type:5,min:65,max:90},this.rules[66].opcodes[2]={type:5,min:97,max:122},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:2,children:[1,2]},this.rules[67].opcodes[1]={type:4,index:79},this.rules[67].opcodes[2]={type:1,children:[3,4,5]},this.rules[67].opcodes[3]={type:4,index:61},this.rules[67].opcodes[4]={type:4,index:18},this.rules[67].opcodes[5]={type:4,index:62},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:2,children:[1,2]},this.rules[68].opcodes[1]={type:4,index:4},this.rules[68].opcodes[2]={type:3,min:0,max:1/0},this.rules[68].opcodes[3]={type:4,index:69},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:2,children:[1,2,3]},this.rules[69].opcodes[1]={type:4,index:80},this.rules[69].opcodes[2]={type:4,index:70},this.rules[69].opcodes[3]={type:4,index:81},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:1,children:[1,2]},this.rules[70].opcodes[1]={type:4,index:71},this.rules[70].opcodes[2]={type:4,index:77},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:2,children:[1,2,4]},this.rules[71].opcodes[1]={type:4,index:87},this.rules[71].opcodes[2]={type:3,min:0,max:1/0},this.rules[71].opcodes[3]={type:4,index:72},this.rules[71].opcodes[4]={type:4,index:87},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:1,children:[1,2]},this.rules[72].opcodes[1]={type:4,index:73},this.rules[72].opcodes[2]={type:2,children:[3,4]},this.rules[72].opcodes[3]={type:4,index:10},this.rules[72].opcodes[4]={type:4,index:74},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[73].opcodes[1]={type:5,min:32,max:38},this.rules[73].opcodes[2]={type:5,min:40,max:91},this.rules[73].opcodes[3]={type:5,min:93,max:55295},this.rules[73].opcodes[4]={type:5,min:57344,max:1114111},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8]},this.rules[74].opcodes[1]={type:6,string:[98]},this.rules[74].opcodes[2]={type:6,string:[102]},this.rules[74].opcodes[3]={type:6,string:[110]},this.rules[74].opcodes[4]={type:6,string:[114]},this.rules[74].opcodes[5]={type:6,string:[116]},this.rules[74].opcodes[6]={type:7,string:[39]},this.rules[74].opcodes[7]={type:7,string:[92]},this.rules[74].opcodes[8]={type:2,children:[9,10]},this.rules[74].opcodes[9]={type:6,string:[117]},this.rules[74].opcodes[10]={type:4,index:75},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:2,children:[1,2,3]},this.rules[75].opcodes[1]={type:7,string:[48]},this.rules[75].opcodes[2]={type:7,string:[48]},this.rules[75].opcodes[3]={type:1,children:[4,7,10,13]},this.rules[75].opcodes[4]={type:2,children:[5,6]},this.rules[75].opcodes[5]={type:7,string:[48]},this.rules[75].opcodes[6]={type:5,min:48,max:55},this.rules[75].opcodes[7]={type:2,children:[8,9]},this.rules[75].opcodes[8]={type:7,string:[48]},this.rules[75].opcodes[9]={type:6,string:[98]},this.rules[75].opcodes[10]={type:2,children:[11,12]},this.rules[75].opcodes[11]={type:7,string:[48]},this.rules[75].opcodes[12]={type:5,min:101,max:102},this.rules[75].opcodes[13]={type:2,children:[14,15]},this.rules[75].opcodes[14]={type:7,string:[49]},this.rules[75].opcodes[15]={type:4,index:76},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:4,index:65},this.rules[76].opcodes[2]={type:5,min:97,max:102},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:7,string:[48]},this.rules[77].opcodes[2]={type:2,children:[3,4]},this.rules[77].opcodes[3]={type:4,index:21},this.rules[77].opcodes[4]={type:3,min:0,max:1/0},this.rules[77].opcodes[5]={type:4,index:65},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:7,string:[46]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:7,string:[46,46]},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:7,string:[91]},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:7,string:[93]},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:7,string:[40]},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:7,string:[41]},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:7,string:[44]},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:7,string:[58]},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:6,string:[34]},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:6,string:[39]},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:7,string:[63]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:7,string:[124,124]},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:7,string:[38,38]},this.toString=function(){let e="";return e+="; JSONPath: Query Expressions for JSON\n",e+="; https://www.rfc-editor.org/rfc/rfc9535\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\n",e+="jsonpath-query = root-identifier segments\n",e+="segments = *(S segment)\n",e+="\n",e+="B = %x20 / ; Space\n",e+=" %x09 / ; Horizontal tab\n",e+=" %x0A / ; Line feed or New line\n",e+=" %x0D ; Carriage return\n",e+="S = *B ; optional blank space\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\n",e+='root-identifier = "$"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\n",e+="selector = name-selector /\n",e+=" wildcard-selector /\n",e+=" slice-selector /\n",e+=" index-selector /\n",e+=" filter-selector\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\n",e+="name-selector = string-literal\n",e+="\n",e+='string-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n',e+=" squote *single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="\n",e+="double-quoted = unescaped /\n",e+=" %x27 / ; '\n",e+=' ESC %x22 / ; \\"\n',e+=" ESC escapable\n",e+="\n",e+="single-quoted = unescaped /\n",e+=' %x22 / ; "\n',e+=" ESC %x27 / ; \\'\n",e+=" ESC escapable\n",e+="\n",e+="ESC = %x5C ; \\ backslash\n",e+="\n",e+="unescaped = %x20-21 / ; see RFC 8259\n",e+=' ; omit 0x22 "\n',e+=" %x23-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=' "/" / ; / slash (solidus) U+002F\n',e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 hexchar) ; uXXXX U+XXXX\n",e+="\n",e+="hexchar = non-surrogate /\n",e+=' (high-surrogate "\\" %x75 low-surrogate)\n',e+='non-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n',e+=' ("D" %x30-37 2HEXDIG )\n',e+='high-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\n',e+='low-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n',e+="\n",e+='HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\n",e+='wildcard-selector = "*"\n',e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\n",e+="index-selector = int ; decimal integer\n",e+="\n",e+='int = "0" /\n',e+=' (["-"] DIGIT1 *DIGIT) ; - optional\n',e+="DIGIT1 = %x31-39 ; 1-9 non-zero digit\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\n",e+="slice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="start = int ; included in selection\n",e+="end = int ; not included in selection\n",e+="step = int ; default: 1\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\n",e+="filter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="logical-expr = logical-or-expr\n",e+="logical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; disjunction\n",e+=" ; binds less tightly than conjunction\n",e+="logical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n",e+=" ; conjunction\n",e+=" ; binds more tightly than disjunction\n",e+="\n",e+="basic-expr = paren-expr /\n",e+=" comparison-expr /\n",e+=" test-expr\n",e+="\n",e+="paren-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n",e+=" ; parenthesized expression\n",e+='logical-not-op = "!" ; logical NOT operator\n',e+="\n",e+="test-expr = [logical-not-op S]\n",e+=" (filter-query / ; existence/non-existence\n",e+=" function-expr) ; LogicalType or NodesType\n",e+="filter-query = rel-query / jsonpath-query\n",e+="rel-query = current-node-identifier segments\n",e+='current-node-identifier = "@"\n',e+="\n",e+="comparison-expr = comparable S comparison-op S comparable\n",e+="literal = number / string-literal /\n",e+=" true / false / null\n",e+="comparable = singular-query / ; singular query value\n",e+=" function-expr / ; ValueType\n",e+=" literal\n",e+=" ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\n",e+='comparison-op = "==" / "!=" /\n',e+=' "<=" / ">=" /\n',e+=' "<" / ">"\n',e+="\n",e+="singular-query = rel-singular-query / abs-singular-query\n",e+="rel-singular-query = current-node-identifier singular-query-segments\n",e+="abs-singular-query = root-identifier singular-query-segments\n",e+="singular-query-segments = *(S (name-segment / index-segment))\n",e+="name-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n",e+=" (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\n",e+="index-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="\n",e+='number = (int / "-0") [ frac ] [ exp ] ; decimal number\n',e+='frac = "." 1*DIGIT ; decimal fraction\n',e+='exp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\n',e+="true = %x74.72.75.65 ; true\n",e+="false = %x66.61.6c.73.65 ; false\n",e+="null = %x6e.75.6c.6c ; null\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\n",e+="function-name = function-name-first *function-name-char\n",e+="function-name-first = LCALPHA\n",e+='function-name-char = function-name-first / "_" / DIGIT\n',e+='LCALPHA = %x61-7A ; "a".."z"\n',e+="\n",e+="function-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n",e+=" *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\n",e+="function-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n",e+=" filter-query / ; (includes singular-query)\n",e+=" function-expr /\n",e+=" literal\n",e+="\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\n",e+="segment = child-segment / descendant-segment\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\n",e+="child-segment = bracketed-selection /\n",e+=" (dot-prefix ; MODIFICATION: surrogate text rule used\n",e+=" (wildcard-selector /\n",e+=" member-name-shorthand))\n",e+="\n",e+="bracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n",e+=" ; MODIFICATION: surrogate text rule used\n",e+="\n",e+="member-name-shorthand = name-first *name-char\n",e+="name-first = ALPHA /\n",e+=' "_" /\n',e+=" %x80-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="name-char = name-first / DIGIT\n",e+="\n",e+="DIGIT = %x30-39 ; 0-9\n",e+="ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\n",e+="descendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n",e+=" wildcard-selector /\n",e+=" member-name-shorthand)\n",e+="\n",e+="; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\n",e+="normalized-path = root-identifier *(normal-index-segment)\n",e+="normal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\n",e+="normal-selector = normal-name-selector / normal-index-selector\n",e+="normal-name-selector = squote *normal-single-quoted squote ; 'string', MODIFICATION: surrogate text rule used\n",e+="normal-single-quoted = normal-unescaped /\n",e+=" ESC normal-escapable\n",e+="normal-unescaped = ; omit %x0-1F control codes\n",e+=" %x20-26 /\n",e+=" ; omit 0x27 '\n",e+=" %x28-5B /\n",e+=" ; omit 0x5C \\\n",e+=" %x5D-D7FF /\n",e+=" ; skip surrogate code points\n",e+=" %xE000-10FFFF\n",e+="\n",e+="normal-escapable = %x62 / ; b BS backspace U+0008\n",e+=" %x66 / ; f FF form feed U+000C\n",e+=" %x6E / ; n LF line feed U+000A\n",e+=" %x72 / ; r CR carriage return U+000D\n",e+=" %x74 / ; t HT horizontal tab U+0009\n",e+=" \"'\" / ; ' apostrophe U+0027\n",e+=' "\\" / ; \\ backslash (reverse solidus) U+005C\n',e+=" (%x75 normal-hexchar)\n",e+=" ; certain values u00xx U+00XX\n",e+='normal-hexchar = "0" "0"\n',e+=" (\n",e+=' ("0" %x30-37) / ; "00"-"07"\n',e+=" ; omit U+0008-U+000A BS HT LF\n",e+=' ("0" %x62) / ; "0b"\n',e+=" ; omit U+000C-U+000D FF CR\n",e+=' ("0" %x65-66) / ; "0e"-"0f"\n',e+=' ("1" normal-HEXDIG)\n',e+=" )\n",e+='normal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\n',e+='normal-index-selector = "0" / (DIGIT1 *DIGIT)\n',e+=" ; non-negative decimal integer\n",e+="\n",e+="; Surrogate named rules\n",e+='dot-prefix = "."\n',e+='double-dot-prefix = ".."\n',e+='left-bracket = "["\n',e+='right-bracket = "]"\n',e+='left-paren = "("\n',e+='right-paren = ")"\n',e+='comma = ","\n',e+='colon = ":"\n',e+='dquote = %x22 ; "\n',e+="squote = %x27 ; '\n",e+='questionmark = "?"\n',e+='disjunction = "||"\n',e+='conjunction = "&&"\n','; JSONPath: Query Expressions for JSON\n; https://www.rfc-editor.org/rfc/rfc9535\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.1.1\njsonpath-query = root-identifier segments\nsegments = *(S segment)\n\nB = %x20 / ; Space\n %x09 / ; Horizontal tab\n %x0A / ; Line feed or New line\n %x0D ; Carriage return\nS = *B ; optional blank space\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.2.1\nroot-identifier = "$"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3\nselector = name-selector /\n wildcard-selector /\n slice-selector /\n index-selector /\n filter-selector\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.1.1\nname-selector = string-literal\n\nstring-literal = dquote *double-quoted dquote / ; "string", MODIFICATION: surrogate text rule used\n squote *single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\n\ndouble-quoted = unescaped /\n %x27 / ; \'\n ESC %x22 / ; \\"\n ESC escapable\n\nsingle-quoted = unescaped /\n %x22 / ; "\n ESC %x27 / ; \\\'\n ESC escapable\n\nESC = %x5C ; \\ backslash\n\nunescaped = %x20-21 / ; see RFC 8259\n ; omit 0x22 "\n %x23-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nescapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "/" / ; / slash (solidus) U+002F\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 hexchar) ; uXXXX U+XXXX\n\nhexchar = non-surrogate /\n (high-surrogate "\\" %x75 low-surrogate)\nnon-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /\n ("D" %x30-37 2HEXDIG )\nhigh-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG\nlow-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG\n\nHEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.2.1\nwildcard-selector = "*"\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.3.1\nindex-selector = int ; decimal integer\n\nint = "0" /\n (["-"] DIGIT1 *DIGIT) ; - optional\nDIGIT1 = %x31-39 ; 1-9 non-zero digit\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.4.1\nslice-selector = [start S] colon S [end S] [colon [S step ]] ; MODIFICATION: surrogate text rule used\n\nstart = int ; included in selection\nend = int ; not included in selection\nstep = int ; default: 1\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.3.5.1\nfilter-selector = questionmark S logical-expr ; MODIFICATION: surrogate text rule used\n\nlogical-expr = logical-or-expr\nlogical-or-expr = logical-and-expr *(S disjunction S logical-and-expr) ; MODIFICATION: surrogate text rule used\n ; disjunction\n ; binds less tightly than conjunction\nlogical-and-expr = basic-expr *(S conjunction S basic-expr) ; MODIFICATION: surrogate text rule used\n ; conjunction\n ; binds more tightly than disjunction\n\nbasic-expr = paren-expr /\n comparison-expr /\n test-expr\n\nparen-expr = [logical-not-op S] left-paren S logical-expr S right-paren ; MODIFICATION: surrogate text rule used\n ; parenthesized expression\nlogical-not-op = "!" ; logical NOT operator\n\ntest-expr = [logical-not-op S]\n (filter-query / ; existence/non-existence\n function-expr) ; LogicalType or NodesType\nfilter-query = rel-query / jsonpath-query\nrel-query = current-node-identifier segments\ncurrent-node-identifier = "@"\n\ncomparison-expr = comparable S comparison-op S comparable\nliteral = number / string-literal /\n true / false / null\ncomparable = singular-query / ; singular query value\n function-expr / ; ValueType\n literal\n ; MODIFICATION: https://www.rfc-editor.org/errata/eid8352\ncomparison-op = "==" / "!=" /\n "<=" / ">=" /\n "<" / ">"\n\nsingular-query = rel-singular-query / abs-singular-query\nrel-singular-query = current-node-identifier singular-query-segments\nabs-singular-query = root-identifier singular-query-segments\nsingular-query-segments = *(S (name-segment / index-segment))\nname-segment = (left-bracket name-selector right-bracket) / ; MODIFICATION: surrogate text rule used\n (dot-prefix member-name-shorthand) ; MODIFICATION: surrogate text rule used\nindex-segment = left-bracket index-selector right-bracket ; MODIFICATION: surrogate text rule used\n\nnumber = (int / "-0") [ frac ] [ exp ] ; decimal number\nfrac = "." 1*DIGIT ; decimal fraction\nexp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent\ntrue = %x74.72.75.65 ; true\nfalse = %x66.61.6c.73.65 ; false\nnull = %x6e.75.6c.6c ; null\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.4\nfunction-name = function-name-first *function-name-char\nfunction-name-first = LCALPHA\nfunction-name-char = function-name-first / "_" / DIGIT\nLCALPHA = %x61-7A ; "a".."z"\n\nfunction-expr = function-name left-paren S [function-argument ; MODIFICATION: surrogate text rule used\n *(S comma S function-argument)] S right-paren ; MODIFICATION: surrogate text rule used\nfunction-argument = logical-expr / ; MODIFICATION: https://www.rfc-editor.org/errata/eid8343\n filter-query / ; (includes singular-query)\n function-expr /\n literal\n\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5\nsegment = child-segment / descendant-segment\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.1.1\nchild-segment = bracketed-selection /\n (dot-prefix ; MODIFICATION: surrogate text rule used\n (wildcard-selector /\n member-name-shorthand))\n\nbracketed-selection = left-bracket S selector *(S comma S selector) S right-bracket\n ; MODIFICATION: surrogate text rule used\n\nmember-name-shorthand = name-first *name-char\nname-first = ALPHA /\n "_" /\n %x80-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\nname-char = name-first / DIGIT\n\nDIGIT = %x30-39 ; 0-9\nALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n\n; https://www.rfc-editor.org/rfc/rfc9535#section-2.5.2.1\ndescendant-segment = double-dot-prefix (bracketed-selection / ; MODIFICATION: surrogate text rule used\n wildcard-selector /\n member-name-shorthand)\n\n; https://www.rfc-editor.org/rfc/rfc9535#name-normalized-paths\nnormalized-path = root-identifier *(normal-index-segment)\nnormal-index-segment = left-bracket normal-selector right-bracket ; MODIFICATION: surrogate text rule used\nnormal-selector = normal-name-selector / normal-index-selector\nnormal-name-selector = squote *normal-single-quoted squote ; \'string\', MODIFICATION: surrogate text rule used\nnormal-single-quoted = normal-unescaped /\n ESC normal-escapable\nnormal-unescaped = ; omit %x0-1F control codes\n %x20-26 /\n ; omit 0x27 \'\n %x28-5B /\n ; omit 0x5C \\\n %x5D-D7FF /\n ; skip surrogate code points\n %xE000-10FFFF\n\nnormal-escapable = %x62 / ; b BS backspace U+0008\n %x66 / ; f FF form feed U+000C\n %x6E / ; n LF line feed U+000A\n %x72 / ; r CR carriage return U+000D\n %x74 / ; t HT horizontal tab U+0009\n "\'" / ; \' apostrophe U+0027\n "\\" / ; \\ backslash (reverse solidus) U+005C\n (%x75 normal-hexchar)\n ; certain values u00xx U+00XX\nnormal-hexchar = "0" "0"\n (\n ("0" %x30-37) / ; "00"-"07"\n ; omit U+0008-U+000A BS HT LF\n ("0" %x62) / ; "0b"\n ; omit U+000C-U+000D FF CR\n ("0" %x65-66) / ; "0e"-"0f"\n ("1" normal-HEXDIG)\n )\nnormal-HEXDIG = DIGIT / %x61-66 ; "0"-"9", "a"-"f"\nnormal-index-selector = "0" / (DIGIT1 *DIGIT)\n ; non-negative decimal integer\n\n; Surrogate named rules\ndot-prefix = "."\ndouble-dot-prefix = ".."\nleft-bracket = "["\nright-bracket = "]"\nleft-paren = "("\nright-paren = ")"\ncomma = ","\ncolon = ":"\ndquote = %x22 ; "\nsquote = %x27 ; \'\nquestionmark = "?"\ndisjunction = "||"\nconjunction = "&&"\n'}};const se=class extends re{},ne=e=>{if(!Array.isArray(e))throw new se("Selectors must be an array, got: "+typeof e,{selectors:e});try{return`$${e.map(e=>{if("string"==typeof e)return`['${(e=>{if("string"!=typeof e)throw new TypeError("Selector must be a string");let t="";for(const r of e){const e=r.codePointAt(0);switch(e){case 8:t+="\\b";break;case 9:t+="\\t";break;case 10:t+="\\n";break;case 12:t+="\\f";break;case 13:t+="\\r";break;case 39:t+="\\'";break;case 92:t+="\\\\";break;default:t+=e<=31?`\\u${e.toString(16).padStart(4,"0")}`:r}}return t})(e)}']`;if("number"==typeof e){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Index selector must be a non-negative safe integer, got: ${e}`);return`[${e}]`}throw new TypeError("Selector must be a string or non-negative integer, got: "+typeof e)}).join("")}`}catch(t){throw new se("Failed to compile normalized JSONPath",{cause:t,selectors:e})}},ie=(e,t,r,s)=>{const{realm:n}=e,{value:i}=r;if(n.isObject(t)&&n.hasProperty(t,i)){s(n.getProperty(t,i),i)}},oe=(e,t,r,s)=>{const{realm:n}=e,{value:i}=r;if(!n.isArray(t))return;const o=n.getLength(t),a=((e,t)=>e>=0?e:t+e)(i,o);if(a>=0&&a<o){s(n.getElement(t,a),a)}},ae=(e,t,r,s)=>{const{realm:n}=e;for(const[e,r]of n.entries(t))s(r,e)},ce=(e,t)=>e>=0?Math.min(e,t):Math.max(t+e,0),le=(e,t,r,s)=>{const{realm:n}=e,{start:i,end:o,step:a}=r;if(!n.isArray(t))return;const c=((e,t,r,s)=>{const n=r??1;if(0===n)return null;let i,o;if(n>0){const r=0,n=s,a=null!==e?ce(e,s):r,c=null!==t?ce(t,s):n;i=Math.max(a,0),o=Math.min(c,s)}else{const r=s-1,n=-s-1,a=null!==e?e>=0?Math.min(e,s-1):Math.max(s+e,-1):r,c=null!==t?t>=0?Math.min(t,s-1):Math.max(s+t,-1):n;o=Math.min(a,s-1),i=Math.max(c,-1)}return{lower:i,upper:o,step:n}})(i,o,a,n.getLength(t));if(null===c)return;const{lower:l,upper:u,step:p}=c;if(p>0)for(let e=l;e<u;e+=p){s(n.getElement(t,e),e)}else for(let e=u;e>l;e+=p){s(n.getElement(t,e),e)}},ue=(e,t,r,s)=>s.value,pe=(e,t,r)=>{const{realm:s}=e,{selector:n}=r;switch(n.type){case"NameSelector":{const{value:e}=n;return s.isObject(t)&&s.hasProperty(t,e)?s.getProperty(t,e):void 0}case"IndexSelector":{const{value:e}=n;if(!s.isArray(t))return;const r=s.getLength(t),i=e>=0?e:r+e;return i>=0&&i<r?s.getElement(t,i):void 0}default:return}},he=(e,t,r,s)=>{const{selectors:n}=r;for(const r of n)Ee(e,t,r,s)},de=(e,t,r)=>{const s=[],n=e=>{s.push(e)},{selector:i}=r;switch(i.type){case"BracketedSelection":he(e,t,i,n);break;case"NameSelector":case"WildcardSelector":case"IndexSelector":case"SliceSelector":case"FilterSelector":Ee(e,t,i,n)}return s},fe=(e,t,r,s)=>{let n=r;for(const t of s){const r=[];if("DescendantSegment"===t.type){const s=n=>{const{realm:i}=e,o=de(e,n,t);r.push(...o);for(const[,e]of i.entries(n))s(e)};for(const e of n)s(e)}else for(const s of n){const n=de(e,s,t);r.push(...n)}n=r}return n},me=(e,t,r,s)=>{const{query:n}=s;let i;switch(n.type){case"RelQuery":i=((e,t,r,s)=>{const{segments:n}=s;return 0===n.length?[r]:fe(e,0,[r],n)})(e,0,r,n);break;case"JsonPathQuery":i=((e,t,r,s)=>{const{segments:n}=s;return 0===n.length?[t]:fe(e,0,[t],n)})(e,t,0,n);break;default:i=[]}return o=i,Object.defineProperty(o,"_isNodelist",{value:!0,enumerable:!1,writable:!1}),o;var o};let ye;const ge=(e,t,r,s)=>{const{name:n,arguments:i}=s,o=e.functions[n];if("function"!=typeof o)return;const a=i.map(s=>((e,t,r,s)=>{switch(s.type){case"Literal":case"RelSingularQuery":case"AbsSingularQuery":case"FunctionExpr":return xe(e,t,r,s);case"FilterQuery":return me(e,t,r,s);case"TestExpr":return"FilterQuery"===s.expression.type?me(e,t,r,s.expression):"FunctionExpr"===s.expression.type?xe(e,t,r,s.expression):ye(e,t,r,s);case"LogicalOrExpr":case"LogicalAndExpr":case"LogicalNotExpr":case"ComparisonExpr":return ye(e,t,r,s);default:return}})(e,t,r,s));return o(e.realm,...a)},xe=(e,t,r,s)=>{switch(s.type){case"Literal":return ue(e,t,r,s);case"RelSingularQuery":return((e,t,r,s)=>{let n=r;for(const t of s.segments)if(n=pe(e,n,t),void 0===n)return;return n})(e,0,r,s);case"AbsSingularQuery":return((e,t,r,s)=>{let n=t;for(const t of s.segments)if(n=pe(e,n,t),void 0===n)return;return n})(e,t,0,s);case"FunctionExpr":return ge(e,t,r,s);default:return}},be=(e,t,r,s)=>{const{left:n,op:i,right:o}=s,a=xe(e,t,r,n),c=xe(e,t,r,o);return e.realm.compare(a,i,c)},we=e=>Array.isArray(e),ve=(e,t,r,s)=>{switch(s.type){case"LogicalOrExpr":return!!ve(e,t,r,s.left)||ve(e,t,r,s.right);case"LogicalAndExpr":return!!ve(e,t,r,s.left)&&ve(e,t,r,s.right);case"LogicalNotExpr":return!ve(e,t,r,s.expression);case"TestExpr":{const{expression:n}=s;if("FilterQuery"===n.type){return me(e,t,r,n).length>0}if("FunctionExpr"===n.type){const s=ge(e,t,r,n);return"boolean"==typeof s?s:void 0!==s&&(we(s)?s.length>0:Boolean(s))}return!1}case"ComparisonExpr":return be(e,t,r,s);default:return!1}};ye=ve;const ke=ve,_e=(e,t,r,s)=>{const{realm:n,root:i}=e,{expression:o}=r;for(const[r,a]of n.entries(t)){ke(e,i,a,o)&&s(a,r)}},Ee=(e,t,r,s)=>{switch(r.type){case"NameSelector":ie(e,t,r,s);break;case"IndexSelector":oe(e,t,r,s);break;case"WildcardSelector":ae(e,t,r,s);break;case"SliceSelector":le(e,t,r,s);break;case"FilterSelector":_e(e,t,r,s)}};new Map;class Ae{node;key;index;parent;parentPath;inList;#e=!1;#t=!1;#r=!1;#s=!1;#n;#i=!1;constructor(e,t,r,s,n){this.node=e,this.parent=t,this.parentPath=r,this.key=s,this.index=n&&"number"==typeof s?s:void 0,this.inList=n}get shouldSkip(){return this.#e}get shouldStop(){return this.#t}get removed(){return this.#r}isRoot(){return null===this.parentPath}get depth(){let e=0,t=this.parentPath;for(;null!==t;)e+=1,t=t.parentPath;return e}getAncestry(){const e=[];let t=this.parentPath;for(;null!==t;)e.push(t),t=t.parentPath;return e}getAncestorNodes(){return this.getAncestry().map(e=>e.node)}getPathKeys(){const e=[];let t=this;for(;null!==t&&void 0!==t.key;){const{key:r,parent:s,parentPath:n}=t;if(G(s)&&"value"===r){if(!L(s.key))throw new TypeError("MemberElement.key must be a StringElement");e.unshift(s.key.toValue())}else H(n?.node)&&"number"==typeof r&&e.unshift(r);t=t.parentPath}return e}formatPath(e="jsonpointer"){const t=this.getPathKeys();return 0===t.length?"jsonpath"===e?"$":"":"jsonpath"===e?ne(t):ee(t)}findParent(e){let t=this.parentPath;for(;null!==t;){if(e(t))return t;t=t.parentPath}return null}find(e){return e(this)?this:this.findParent(e)}skip(){this.#e=!0}stop(){this.#t=!0}replaceWith(e){this.#i&&console.warn("Warning: replaceWith() called on a stale Path. This path belongs to a node whose visit has already completed. The replacement will have no effect. To replace a parent node, do so from the parent's own visitor."),this.#s=!0,this.#n=e,this.node=e}remove(){this.#i&&console.warn("Warning: remove() called on a stale Path. This path belongs to a node whose visit has already completed. The removal will have no effect. To remove a parent node, do so from the parent's own visitor."),this.#r=!0}_getReplacementNode(){return this.#n}_wasReplaced(){return this.#s}_reset(){this.#e=!1,this.#t=!1,this.#r=!1,this.#s=!1,this.#n=void 0}_markStale(){this.#i=!0}}class Ie extends AggregateError{constructor(e,t,r){super(e,t,r),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const Se=Ie;class Oe extends Error{static[Symbol.hasInstance](e){return super[Symbol.hasInstance](e)||Function.prototype[Symbol.hasInstance].call(Se,e)}constructor(e,t){super(e,t),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}const Me=Oe;const Te=class extends Me{constructor(e,t){if(super(e,t),null!=t&&"object"==typeof t){const{cause:e,...r}=t;Object.assign(this,r)}}};function Ce(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,s){return t.apply(this,arguments)};case 4:return function(e,r,s,n){return t.apply(this,arguments)};case 5:return function(e,r,s,n,i){return t.apply(this,arguments)};case 6:return function(e,r,s,n,i,o){return t.apply(this,arguments)};case 7:return function(e,r,s,n,i,o,a){return t.apply(this,arguments)};case 8:return function(e,r,s,n,i,o,a,c){return t.apply(this,arguments)};case 9:return function(e,r,s,n,i,o,a,c,l){return t.apply(this,arguments)};case 10:return function(e,r,s,n,i,o,a,c,l,u){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function De(e,t,r){return function(){for(var s=[],i=0,o=e,a=0,c=!1;a<t.length||i<arguments.length;){var l;a<t.length&&(!n(t[a])||i>=arguments.length)?l=t[a]:(l=arguments[i],i+=1),s[a]=l,n(l)?c=!0:o-=1,a+=1}return!c&&o<=0?r.apply(this,s):Ce(Math.max(0,o),De(e,s,r))}}var je=o(function(e,t){return 1===e?i(t):Ce(e,De(e,[],t))});const Fe=je;function Be(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}const Ne=o(function(e,t){return e&&t});function Pe(e,t,r){for(var s=0,n=r.length;s<n;)t=e(t,r[s]),s+=1;return t}const Le=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function Ue(e){return"[object String]"===Object.prototype.toString.call(e)}const qe=i(function(e){return!!Le(e)||!!e&&("object"==typeof e&&(!Ue(e)&&(0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))});var $e="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function He(e,t,r){return function(s,n,i){if(qe(i))return e(s,n,i);if(null==i)return n;if("function"==typeof i["fantasy-land/reduce"])return t(s,n,i,"fantasy-land/reduce");if(null!=i[$e])return r(s,n,i[$e]());if("function"==typeof i.next)return r(s,n,i);if("function"==typeof i.reduce)return t(s,n,i,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function Re(e,t,r){for(var s=r.next();!s.done;)t=e(t,s.value),s=r.next();return t}function Ge(e,t,r,s){return r[s](e,t)}const Ve=He(Pe,Ge,Re);function ze(e,t,r){return function(){if(0===arguments.length)return r();var s=arguments[arguments.length-1];if(!Le(s)){for(var n=0;n<e.length;){if("function"==typeof s[e[n]])return s[e[n]].apply(s,Array.prototype.slice.call(arguments,0,-1));n+=1}if(function(e){return null!=e&&"function"==typeof e["@@transducer/step"]}(s))return t.apply(null,Array.prototype.slice.call(arguments,0,-1))(s)}return r.apply(this,arguments)}}function Xe(e,t){for(var r=0,s=t.length,n=Array(s);r<s;)n[r]=e(t[r]),r+=1;return n}const We=function(){return this.xf["@@transducer/init"]()},Ye=function(e){return this.xf["@@transducer/result"](e)};var Ke=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=We,e.prototype["@@transducer/result"]=Ye,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}();var Je=o(ze(["fantasy-land/map","map"],function(e){return function(t){return new Ke(e,t)}},function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return Fe(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return Pe(function(r,s){return r[s]=e(t[s]),r},{},x(t));default:return Xe(e,t)}}));const Qe=Je;const Ze=o(function(e,t){return"function"==typeof t["fantasy-land/ap"]?t["fantasy-land/ap"](e):"function"==typeof e.ap?e.ap(t):"function"==typeof e?function(r){return e(r)(t(r))}:Ve(function(e,r){return function(e,t){var r;t=t||[];var s=(e=e||[]).length,n=t.length,i=[];for(r=0;r<s;)i[i.length]=e[r],r+=1;for(r=0;r<n;)i[i.length]=t[r],r+=1;return i}(e,Qe(r,t))},[],e)});var et=o(function(e,t){var r=Fe(e,t);return Fe(e,function(){return Pe(Ze,Qe(r,arguments[0]),Array.prototype.slice.call(arguments,1))})});const tt=et;var rt=i(function(e){return tt(e.length,e)});const st=rt;const nt=o(function(e,t){return Be(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:st(Ne)(e,t)});function it(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function ot(e){return function t(r,s,a){switch(arguments.length){case 0:return t;case 1:return n(r)?t:o(function(t,s){return e(r,t,s)});case 2:return n(r)&&n(s)?t:n(r)?o(function(t,r){return e(t,s,r)}):n(s)?o(function(t,s){return e(r,t,s)}):i(function(t){return e(r,s,t)});default:return n(r)&&n(s)&&n(a)?t:n(r)&&n(s)?o(function(t,r){return e(t,r,a)}):n(r)&&n(a)?o(function(t,r){return e(t,s,r)}):n(s)&&n(a)?o(function(t,s){return e(r,t,s)}):n(r)?i(function(t){return e(t,s,a)}):n(s)?i(function(t){return e(r,t,a)}):n(a)?i(function(t){return e(r,s,t)}):e(r,s,a)}}}function at(e,t,r){for(var s=0,n=r.length;s<n;){if((t=e["@@transducer/step"](t,r[s]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}s+=1}return e["@@transducer/result"](t)}var ct=o(function(e,t){return Ce(e.length,function(){return e.apply(t,arguments)})});const lt=ct;function ut(e,t,r){for(var s=r.next();!s.done;){if((t=e["@@transducer/step"](t,s.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}s=r.next()}return e["@@transducer/result"](t)}function pt(e,t,r,s){return e["@@transducer/result"](r[s](lt(e["@@transducer/step"],e),t))}const ht=He(at,pt,ut);var dt=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var ft=ot(function(e,t,r){return ht("function"==typeof e?function(e){return new dt(e)}(e):e,t,r)});const mt=ft;function yt(e,t){return function(){var r=arguments.length;if(0===r)return t();var s=arguments[r-1];return Le(s)||"function"!=typeof s[e]?t.apply(this,arguments):s[e].apply(s,Array.prototype.slice.call(arguments,0,r-1))}}const gt=ot(yt("slice",function(e,t,r){return Array.prototype.slice.call(r,e,t)}));const xt=i(yt("tail",gt(1,1/0)));function bt(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return Ce(arguments[0].length,mt(it,arguments[0],xt(arguments)))}function wt(e,t){return function(e,t,r){var s,n;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(s=1/t;r<e.length;){if(0===(n=e[r])&&1/n===s)return r;r+=1}return-1}if(t!=t){for(;r<e.length;){if("number"==typeof(n=e[r])&&n!=n)return r;r+=1}return-1}return e.indexOf(t,r);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,r);case"object":if(null===t)return e.indexOf(t,r)}for(;r<e.length;){if(k(e[r],t))return r;r+=1}return-1}(t,e,0)>=0}function vt(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var kt=function(e){return(e<10?"0":"")+e};const _t="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+kt(e.getUTCMonth()+1)+"-"+kt(e.getUTCDate())+"T"+kt(e.getUTCHours())+":"+kt(e.getUTCMinutes())+":"+kt(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function Et(e){return"[object Object]"===Object.prototype.toString.call(e)}var At=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=We,e.prototype["@@transducer/result"]=Ye,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}();function It(e){return function(t){return new At(e,t)}}var St=o(ze(["fantasy-land/filter","filter"],It,function(e,t){return Et(t)?Pe(function(r,s){return e(t[s])&&(r[s]=t[s]),r},{},x(t)):(r=t,"[object Map]"===Object.prototype.toString.call(r)?function(e,t){for(var r=new Map,s=t.entries(),n=s.next();!n.done;)e(n.value[1])&&r.set(n.value[0],n.value[1]),n=s.next();return r}(e,t):function(e,t){for(var r=0,s=t.length,n=[];r<s;)e(t[r])&&(n[n.length]=t[r]),r+=1;return n}(e,t));var r}));const Ot=St;const Mt=o(function(e,t){return Ot((r=e,function(){return!r.apply(this,arguments)}),t);var r});function Tt(e,t){var r=function(r){var s=t.concat([e]);return wt(r,s)?"<Circular>":Tt(r,s)},s=function(e,t){return Xe(function(t){return vt(t)+": "+r(e[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+Xe(r,e).join(", ")+"))";case"[object Array]":return"["+Xe(r,e).concat(s(e,Mt(function(e){return/^\d+$/.test(e)},x(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+r(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?r(NaN):vt(_t(e)))+")";case"[object Map]":return"new Map("+r(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+r(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+r(Array.from(e).sort())+")";case"[object String]":return"object"==typeof e?"new String("+r(e.valueOf())+")":vt(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var n=e.toString();if("[object Object]"!==n)return n}return"{"+s(e,x(e)).join(", ")+"}"}}const Ct=i(function(e){return Tt(e,[])});const Dt=o(function(e,t){return e||t});const jt=o(function(e,t){return Be(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:st(Dt)(e,t)});const Ft=st(i(function(e){return!e}));const Bt=k(null);const Nt=Ft(Bt);const Pt=o(function(e,t){if(e===t)return t;function r(e,t){if(e>t!=t>e)return t>e?t:e}var s=r(e,t);if(void 0!==s)return s;var n=r(typeof e,typeof t);if(void 0!==n)return n===typeof e?e:t;var i=Ct(e),o=r(i,Ct(t));return void 0!==o&&o===i?e:t}),Lt=Number.isInteger||function(e){return(e|0)===e};function Ut(e,t){return t[e<0?t.length+e:e]}const qt=o(function(e,t){if(null!=t)return Lt(e)?Ut(e,t):t[e]});const $t=o(function(e,t){return Qe(qt(e),t)});const Ht=i(function(e){return Fe(mt(Pt,0,$t("length",e)),function(){for(var t=0,r=e.length;t<r;){if(e[t].apply(this,arguments))return!0;t+=1}return!1})});var Rt=function(e,t){switch(arguments.length){case 0:return Rt;case 1:return function t(r){return 0===arguments.length?t:u(e,r)};default:return u(e,t)}};const Gt=Rt;const Vt=Fe(1,bt(b,Gt("GeneratorFunction")));const zt=Fe(1,bt(b,Gt("AsyncFunction")));const Xt=Ht([bt(b,Gt("Function")),Vt,zt]);function Wt(e){return Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wt(e)}const Yt=function(e){return"object"===Wt(e)};var Kt=Fe(1,nt(Nt,jt(Yt,Xt)));const Jt=Fe(1,nt(Kt,bt(Ct,k("[object Promise]")))),Qt=e=>"number"==typeof e.startLine&&"number"==typeof e.startCharacter&&"number"==typeof e.startOffset&&"number"==typeof e.endLine&&"number"==typeof e.endCharacter&&"number"==typeof e.endOffset,Zt=(e,t)=>0===t.length||!!P(e)&&(!e.isMetaEmpty&&(!!e.hasMetaProperty("classes")&&t.every(t=>e.classes.includes(t))));class er extends O{constructor(e,t,r){super(e,t,r),this.element="sourceMap"}static transfer(e,t){t.startLine=e.startLine,t.startCharacter=e.startCharacter,t.startOffset=e.startOffset,t.endLine=e.endLine,t.endCharacter=e.endCharacter,t.endOffset=e.endOffset}static from(e){const{startLine:t,startCharacter:r,startOffset:s,endLine:n,endCharacter:i,endOffset:o}=e;if("number"!=typeof t||"number"!=typeof r||"number"!=typeof s||"number"!=typeof n||"number"!=typeof i||"number"!=typeof o)return;const a="sm1:"+[t,r,s,n,i,o].map(rr).join("");const c=new er(a);return c.startLine=t,c.startCharacter=r,c.startOffset=s,c.endLine=n,c.endCharacter=i,c.endOffset=o,c}applyTo(e){this.content&&([e.startLine,e.startCharacter,e.startOffset,e.endLine,e.endCharacter,e.endOffset]=function(e){const t=e.startsWith("sm1:")?e.slice(4):e,r=[];let s=0;for(let e=0;e<6;e++){const e=sr(t,s);r.push(e.value),s=e.next}return r}(this.content))}}const tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rr(e){let t=e>>>0,r="";do{let e=31&t;t>>>=5,0!==t&&(e|=32),r+=tr[e]}while(0!==t);return r}function sr(e,t=0){let r=0,s=0,n=t;for(;;){const t=e[n++],i=tr.indexOf(t);if(-1===i)throw new Error(`Invalid Base64 VLQ char: ${t}`);if(r|=(31&i)<<s,s+=5,!!!(32&i))break}return{value:r>>>0,next:n}}const nr=er;const ir=class extends Te{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};const or=class extends ir{};const ar=class extends ir{},cr=(e,t)=>{const{visited:r=new WeakMap}=t,s={...t,visited:r};if(r.has(e))return r.get(e);const n=hr(e);r.set(e,n);const{content:i}=e;return Array.isArray(i)?n.content=i.map(e=>cr(e,s)):P(i)?n.content=cr(i,s):n.content=i instanceof _?lr(i,s):i,n},lr=(e,t)=>{const{visited:r=new WeakMap}=t,s={...t,visited:r};if(r.has(e))return r.get(e);const{key:n,value:i}=e,o=void 0!==n?cr(n,s):void 0,a=void 0!==i?cr(i,s):void 0,c=new _(o,a);return r.set(e,c),c},ur=(e,t={})=>{if(e instanceof _)return lr(e,t);if(e instanceof A)return((e,t)=>{const{visited:r=new WeakMap}=t,s={...t,visited:r};if(r.has(e))return r.get(e);const n=[...e].map(e=>cr(e,s)),i=new A(n);return r.set(e,i),i})(e,t);if(P(e))return cr(e,t);throw new or("Value provided to cloneDeep function couldn't be cloned",{value:e})};ur.safe=e=>{try{return ur(e)}catch{return e}};const pr=e=>{const{key:t,value:r}=e;return new _(t,r)},hr=e=>{const t=new(0,e.constructor);t.element=e.element,e.isMetaEmpty||(t.meta=ur(e.meta)),e.isAttributesEmpty||(t.attributes=ur(e.attributes)),Qt(e)&&nr.transfer(e,t);const{content:r}=e;return P(r)?t.content=hr(r):Array.isArray(r)?t.content=[...r]:t.content=r instanceof _?pr(r):r,t},dr=e=>{if(e instanceof _)return pr(e);if(e instanceof A)return(e=>{const t=[...e];return new A(t)})(e);if(P(e))return hr(e);throw new ar("Value provided to cloneShallow function couldn't be cloned",{value:e})};dr.safe=e=>{try{return dr(e)}catch{return e}};const fr=e=>{const t=e?.element;return void 0===t||"element"===t?"Element":`${t.charAt(0).toUpperCase()}${t.slice(1)}Element`},mr=e=>P(e),yr=e=>dr(e),gr=(e,t,r)=>{G(e)?e.value=r:Array.isArray(e)?e[t]=null===r?void 0:r:null===r?delete e[t]:e[t]=r},xr=e=>G(e)?["key","value"]:H(e)||R(e)?["content"]:[],br=(e,t)=>{if(void 0!==e[t])return e[t];const r=t.length;for(const s in e){if(!s.includes("|"))continue;const n=s.indexOf(t);if(-1===n)continue;const i=0===n||"|"===s[n-1],o=n+r===s.length||"|"===s[n+r];if(i&&o)return e[s]}},wr=(e,t,r)=>{if(void 0===t)return null;const s=e,n=r?"leave":"enter",i=br(s,t);if(!r&&"function"==typeof i)return i;if(null!=i){const e=i[n];if("function"==typeof e)return e}const o=s[n];if("function"==typeof o)return o;if(null!=o){const e=br(o,t);if("function"==typeof e)return e}return null},vr=(e,t={})=>{const{visitFnGetter:r=wr,nodeTypeGetter:s=fr,exposeEdits:n=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),a=new Array(e.length).fill(i);return{enter(t){let c=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(a[u]===i){const i=r(e[u],s(c),!1);if("function"==typeof i){const r=_r(t,c),s=i.call(e[u],r);if(Jt(s))throw new Te("Async visitor not supported in sync mode",{visitor:e[u],visitFn:i});if(r.shouldStop){a[u]=o;break}if(r.shouldSkip&&(a[u]=c),r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();if(!n)return t.replaceWith(e),e;c=e,l=!0}else if(void 0!==s){if(!n)return t.replaceWith(s),s;c=s,l=!0}}}if(l)return t.replaceWith(c),c},leave(t){const n=t.node;for(let c=0;c<e.length;c+=1)if(a[c]===i){const i=r(e[c],s(n),!0);if("function"==typeof i){const r=_r(t,n),s=i.call(e[c],r);if(Jt(s))throw new Te("Async visitor not supported in sync mode",{visitor:e[c],visitFn:i});if(r.shouldStop){a[c]=o;break}if(r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();return t.replaceWith(e),e}if(void 0!==s)return t.replaceWith(s),s}}else a[c]===n&&(a[c]=i)}}},kr=(e,t={})=>{const{visitFnGetter:r=wr,nodeTypeGetter:s=fr,exposeEdits:n=!1}=t,i=Symbol("internal-skip"),o=Symbol("break"),a=new Array(e.length).fill(i);return{async enter(t){let c=t.node,l=!1;for(let u=0;u<e.length;u+=1)if(a[u]===i){const i=r(e[u],s(c),!1);if("function"==typeof i){const r=_r(t,c),s=await i.call(e[u],r);if(r.shouldStop){a[u]=o;break}if(r.shouldSkip&&(a[u]=c),r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();if(!n)return t.replaceWith(e),e;c=e,l=!0}else if(void 0!==s){if(!n)return t.replaceWith(s),s;c=s,l=!0}}}if(l)return t.replaceWith(c),c},async leave(t){const n=t.node;for(let c=0;c<e.length;c+=1)if(a[c]===i){const i=r(e[c],s(n),!0);if("function"==typeof i){const r=_r(t,n),s=await i.call(e[c],r);if(r.shouldStop){a[c]=o;break}if(r.removed)return void t.remove();if(r._wasReplaced()){const e=r._getReplacementNode();return t.replaceWith(e),e}if(void 0!==s)return t.replaceWith(s),s}}else a[c]===n&&(a[c]=i)}}};function _r(e,t){return new Ae(t,e.parent,e.parentPath,e.key,e.inList)}function*Er(e,t,r){const{keyMap:s,state:n,nodeTypeGetter:i,nodePredicate:o,nodeCloneFn:a,detectCycles:c,mutable:l,mutationFn:u}=r,p="function"==typeof s;let h,d,f=Array.isArray(e),m=[e],y=-1,g=[],x=e,b=null,w=null;const v=[];do{y+=1;const e=y===m.length;let r;const k=e&&0!==g.length;if(e){if(r=0===v.length?void 0:b?.key,x=d,d=v.pop(),w=b?.parentPath?.parentPath??null,k)if(l)for(const[e,t]of g)u(x,e,t);else if(f){x=x.slice();let e=0;for(const[t,r]of g){const s=t-e;null===r?(x.splice(s,1),e+=1):x[s]=r}}else{x=a(x);for(const[e,t]of g)x[e]=t}if(void 0!==h){y=h.index,m=h.keys,g=h.edits;const e=h.inArray;if(w=h.parentPath,h=h.prev,k&&!l){const t=e?y:m[y];g.push([t,x])}f=e}}else if(void 0!==d&&(r=f?y:m[y],x=d[r],void 0===x))continue;if(!Array.isArray(x)){if(!o(x))throw new Te(`Invalid AST Node: ${String(x)}`,{node:x});if(c&&v.includes(x))continue;b=new Ae(x,d,w,r,f);const s=wr(t,i(x),e);if(s){for(const[e,r]of Object.entries(n))t[e]=r;const i=yield{visitFn:s,path:b,isLeaving:e};if(b.shouldStop)break;if(b.shouldSkip&&!e)continue;if(b.removed){if(g.push([r,null]),!e)continue}else if(b._wasReplaced()){const t=b._getReplacementNode();if(g.push([r,t]),!e){if(!o(t))continue;x=t}}else if(void 0!==i&&(g.push([r,i]),!e)){if(!o(i))continue;x=i}b._markStale()}}if(!e){if(h={inArray:f,index:y,keys:m,edits:g,parentPath:w,prev:h},f=Array.isArray(x),f)m=x;else if(p)m=s(x);else{const e=i(x);m=void 0!==e?s[e]??[]:[]}y=-1,g=[],void 0!==d&&v.push(d),d=x,w=b}}while(void 0!==h);return 0!==g.length?g.at(-1)[1]:e}vr[Symbol.for("nodejs.util.promisify.custom")]=kr;const Ar=(e,t,r={})=>{const s=Er(e,t,{keyMap:r.keyMap??xr,state:r.state??{},nodeTypeGetter:r.nodeTypeGetter??fr,nodePredicate:r.nodePredicate??mr,nodeCloneFn:r.nodeCloneFn??yr,detectCycles:r.detectCycles??!0,mutable:r.mutable??!1,mutationFn:r.mutationFn??gr});let n=s.next();for(;!n.done;){const e=n.value,r=e.visitFn.call(t,e.path);if(Jt(r))throw new Te("Async visitor not supported in sync mode",{visitor:t,visitFn:e.visitFn});n=s.next(r)}return n.value},Ir=async(e,t,r={})=>{const s=Er(e,t,{keyMap:r.keyMap??xr,state:r.state??{},nodeTypeGetter:r.nodeTypeGetter??fr,nodePredicate:r.nodePredicate??mr,nodeCloneFn:r.nodeCloneFn??yr,detectCycles:r.detectCycles??!0,mutable:r.mutable??!1,mutationFn:r.mutationFn??gr});let n=s.next();for(;!n.done;){const e=n.value,r=await e.visitFn.call(t,e.path);n=s.next(r)}return n.value};Ar[Symbol.for("nodejs.util.promisify.custom")]=Ir,Ae.prototype.traverse=function(e,t){return Ar(this.node,e,t)},Ae.prototype.traverseAsync=function(e,t){return Ir(this.node,e,t)};var Sr=ot(function(e,t,r){var s,n={};for(s in r=r||{},t=t||{})l(s,t)&&(n[s]=l(s,r)?e(s,t[s],r[s]):t[s]);for(s in r)l(s,r)&&!l(s,n)&&(n[s]=r[s]);return n});const Or=Sr;var Mr=ot(function e(t,r,s){return Or(function(r,s,n){return Et(s)&&Et(n)?e(t,s,n):t(r,s,n)},r,s)});const Tr=Mr;const Cr=o(function(e,t){return Tr(function(e,t,r){return r},e,t)});const Dr=o(function(e,t){return null==t||t!=t?e:t});const jr=ot(function(e,t,r){return Dr(e,qt(t,r))});function Fr(e,t){for(var r=t,s=0;s<e.length;s+=1){if(null==r)return;var n=e[s];r=Lt(n)?Ut(n,r):r[n]}return r}const Br=o(Fr);const Nr=gt(0,-1);var Pr=o(function(e,t){return e.apply(this,t)});const Lr=Pr;const Ur=Ft(Xt);var qr=i(function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():e==Set||e instanceof Set?new Set:e==Map||e instanceof Map?new Map:Le(e)?[]:Ue(e)?"":Et(e)?{}:h(e)?function(){return arguments}():function(e){var t=Object.prototype.toString.call(e);return"[object Uint8ClampedArray]"===t||"[object Int8Array]"===t||"[object Uint8Array]"===t||"[object Int16Array]"===t||"[object Uint16Array]"===t||"[object Int32Array]"===t||"[object Uint32Array]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object BigInt64Array]"===t||"[object BigUint64Array]"===t}(e)?e.constructor.from(""):void 0});const $r=qr;const Hr=i(function(e){return null!=e&&k(e,$r(e))});const Rr=nt(Fe(1,Xt(Array.isArray)?Array.isArray:bt(b,Gt("Array"))),Hr);const Gr=Fe(3,function(e,t,r){var s=Br(e,r),n=Br(Nr(e),r);if(!Ur(s)&&!Rr(e)){var i=lt(s,n);return Lr(i,t)}});const Vr=class extends S{constructor(e,t,r){super(e||[],t,r),this.element="link"}get relation(){if(this.hasAttributesProperty("relation"))return this.attributes.get("relation")}set relation(e){this.attributes.set("relation",e)}get href(){if(this.hasAttributesProperty("href"))return this.attributes.get("href")}set href(e){this.attributes.set("href",e)}};const zr=class extends S{constructor(e,t,r){super(e||[],t,r),this.element="ref",this.path||(this.path="element")}get path(){if(this.hasAttributesProperty("path"))return this.attributes.get("path")}set path(e){this.attributes.set("path",e)}};const Xr=class extends O{constructor(e,t,r){super(e,t,r),this.element="annotation"}get code(){if(this.hasAttributesProperty("code"))return this.attributes.get("code")}set code(e){this.attributes.set("code",e)}};const Wr=class extends O{constructor(e,t,r){super(e,t,r),this.element="comment"}};const Yr=class extends F{constructor(e,t,r){super(e,t,r),this.element="parseResult"}get api(){return this.filter(e=>Zt(e,["api"])).first}get results(){return this.filter(e=>Zt(e,["result"]))}get result(){return this.results.first}get annotations(){return this.filter(e=>"annotation"===e.element)}get warnings(){return this.filter(e=>"annotation"===e.element&&Zt(e,["warning"]))}get errors(){return this.filter(e=>"annotation"===e.element&&Zt(e,["error"]))}get isEmpty(){return 0===this.reject(e=>"annotation"===e.element).length}replaceResult(e){const{result:t}=this;if(void 0===t)return!1;const r=this._content,s=r.findIndex(e=>e===t);return-1!==s&&(r[s]=e,!0)}},Kr=e=>e instanceof Vr,Jr=e=>e instanceof zr;const Qr=class{namespace;constructor(e){this.namespace=e||new this.Namespace}serialise(e){if(!(e instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${e}\` is not an Element instance`);const t={element:e.element};if(e.isMetaEmpty||(t.meta=this.serialiseObject(e.meta)),e.isAttributesEmpty||(t.attributes=this.serialiseObject(e.attributes)),!(e instanceof nr)){const r=nr.from(e);r&&(t.meta||(t.meta={}),t.meta.__mappings__=this.serialise(r))}const r=this.serialiseContent(e.content);return void 0!==r&&(t.content=r),t}deserialise(e){if(!e.element)throw new Error("Given value is not an object containing an element name");const t=new(this.namespace.getElementClass(e.element));let r;t.element!==e.element&&(t.element=e.element);let s=e.meta;if(e.meta?.__mappings__){const{__mappings__:t,...n}=e.meta;r=t,s=Object.keys(n).length>0?n:void 0}if(s&&this.deserialiseObject(s,t.meta),r){this.deserialise(r).applyTo(t)}e.attributes&&this.deserialiseObject(e.attributes,t.attributes);const n=this.deserialiseContent(e.content);return void 0===n&&null!==t.content||(t.content=n),t}serialiseContent(e){if(e instanceof this.namespace.elements.Element)return this.serialise(e);if(e instanceof this.namespace.KeyValuePair){const t=e,r={key:this.serialise(t.key)};return t.value&&(r.value=this.serialise(t.value)),r}if(e&&Array.isArray(e)){if(0===e.length)return;return e.map(e=>this.serialise(e))}return e}deserialiseContent(e){if(e){if(e.element)return this.deserialise(e);if(e.key){const t=new this.namespace.KeyValuePair(this.deserialise(e.key));return e.value&&(t.value=this.deserialise(e.value)),t}if(Array.isArray(e))return e.map(e=>this.deserialise(e))}return e}serialiseObject(e){const t={};if(e.forEach((e,r)=>{e&&(t[r.toValue()]=this.serialise(e))}),0!==Object.keys(t).length)return t}deserialiseObject(e,t){Object.keys(e).forEach(r=>{t.set(r,this.deserialise(e[r]))})}},Zr=e=>null===e,es=e=>"string"==typeof e,ts=e=>"number"==typeof e,rs=e=>"boolean"==typeof e,ss=e=>null!==e&&"object"==typeof e;class ns{elementMap={};elementDetection=[];Element;KeyValuePair;_elements;_attributeElementKeys=[];_attributeElementArrayKeys=[];constructor(e){this.Element=S,this.KeyValuePair=_,e&&e.noDefault||this.useDefault()}use(e){return e.namespace&&e.namespace({base:this}),e.load&&e.load({base:this}),this}useDefault(){return this.register("null",T).register("string",O).register("number",M).register("boolean",C).register("array",F).register("object",N).register("member",B).register("ref",zr).register("link",Vr).register("sourceMap",nr),this.detect(Zr,T,!1).detect(es,O,!1).detect(ts,M,!1).detect(rs,C,!1).detect(Array.isArray,F,!1).detect(ss,N,!1),this}register(e,t){return this._elements=void 0,this.elementMap[e]=t,this}unregister(e){return this._elements=void 0,delete this.elementMap[e],this}detect(e,t,r){return void 0===r||r?this.elementDetection.unshift([e,t]):this.elementDetection.push([e,t]),this}toElement(e){if(e instanceof this.Element)return e;let t;for(const[r,s]of this.elementDetection)if(r(e)){t=new s(e);break}return t}getElementClass(e){const t=this.elementMap[e];return void 0===t?this.Element:t}fromRefract(e){return this.serialiser.deserialise(e)}toRefract(e){return this.serialiser.serialise(e)}get elements(){return void 0===this._elements&&(this._elements={Element:this.Element},Object.keys(this.elementMap).forEach(e=>{const t=e[0].toUpperCase()+e.substring(1);this._elements[t]=this.elementMap[e]})),this._elements}get serialiser(){return new Qr(this)}}Qr.prototype.Namespace=ns;const is=new ns,os={isElement:P,isStringElement:L,isNumberElement:U,isNullElement:q,isBooleanElement:$,isArrayElement:H,isObjectElement:R,isMemberElement:G,isPrimitiveElement:V,isLinkElement:Kr,isRefElement:Jr,isAnnotationElement:e=>e instanceof Xr,isCommentElement:e=>e instanceof Wr,isParseResultElement:e=>e instanceof Yr,isSourceMapElement:e=>e instanceof nr,hasElementSourceMap:Qt,includesSymbols:(e,t)=>{if(0===t.length)return!0;if(!e.hasAttributesProperty("symbols"))return!1;const r=e.attributes.get("symbols");return!!H(r)&&t.every(e=>r.includes(e))},includesClasses:Zt},as=()=>({predicates:os,namespace:is}),cs={toolboxCreator:as,visitorOptions:{exposeEdits:!0}},ls=(e,t,r={})=>{if(0===t.length)return e;const s=Cr(cs,r),{toolboxCreator:n,visitorOptions:i}=s,o=n(),a=t.map(e=>e(o)),c=vr(a.map(jr({},"visitor")),i);a.forEach(Gr(["pre"],[]));const l=Ar(e,c);return a.forEach(Gr(["post"],[])),l};ls[Symbol.for("nodejs.util.promisify.custom")]=async(e,t,r={})=>{if(0===t.length)return e;const s=Cr(cs,r),{toolboxCreator:n,visitorOptions:i}=s,o=n(),a=t.map(e=>e(o)),c=kr(a.map(jr({},"visitor")),i);await Promise.allSettled(a.map(Gr(["pre"],[])));const l=await Ir(e,c);return await Promise.allSettled(a.map(Gr(["post"],[]))),l};var us=r(279),ps=r.n(us);const hs=class extends Te{value;constructor(e,t){super(e,t),void 0!==t&&(this.value=t.value)}};class ds{uuid;identityMap;constructor({length:e=6}={}){this.uuid=new(ps())({length:e}),this.identityMap=new WeakMap}identify(e){if(!P(e))throw new hs("Cannot not identify the element. `element` is neither structurally compatible nor a subclass of an Element class.",{value:e});if(e.hasMetaProperty("id")){const t=e.meta.get("id");if(L(t)&&!t.equals(""))return e.id}if(this.identityMap.has(e))return this.identityMap.get(e);const t=new O(this.generateId());return this.identityMap.set(e,t),t}forget(e){return!!this.identityMap.has(e)&&(this.identityMap.delete(e),!0)}generateId(){return this.uuid.randomUUID()}}const fs=new ds,ms=({length:e=6}={})=>()=>{let t;return{pre(){t=new ds({length:e})},visitor:{enter(e){e.node.id=t.identify(e.node)}},post(){t=null}}},ys=({length:e=6}={})=>()=>{let t;return{pre(){t=new ds({length:e})},visitor:{enter(e){V(e.node)||(e.node.id=t.identify(e.node))}},post(){t=null}}};const gs=class extends Me{};const xs=class extends gs{};const bs=class extends Array{unknownMediaType="application/octet-stream";filterByFormat(){throw new xs("filterByFormat method in MediaTypes class is not yet implemented.")}findBy(){throw new xs("findBy method in MediaTypes class is not yet implemented.")}latest(){throw new xs("latest method in MediaTypes class is not yet implemented.")}};var ws=i(function(e){return function(){return e}})(void 0);const vs=k(ws()),ks=(e,t=new WeakMap)=>(G(e)?(t.set(e.key,e),ks(e.key,t),t.set(e.value,e),ks(e.value,t)):e.children.forEach(r=>{t.set(r,e),ks(r,t)}),t);const _s=class{element;edges;constructor({element:e}){this.element=e}transclude(e,t){if(e===this.element)return t;if(e===t)return this.element;this.edges=this.edges??ks(this.element);const r=this.edges.get(e);return vs(r)?void 0:(R(r)?((e,t,r)=>{const s=r.get(e);R(s)&&(s.content=s.map((n,i,o)=>o===e?(r.delete(e),r.set(t,s),t):o))})(e,t,this.edges):H(r)?((e,t,r)=>{const s=r.get(e);H(s)&&(s.content=s.map(n=>n===e?(r.delete(e),r.set(t,s),t):n))})(e,t,this.edges):G(r)&&((e,t,r)=>{const s=r.get(e);G(s)&&(s.key===e&&(s.key=t,r.delete(e),r.set(t,s)),s.value===e&&(s.value=t,r.delete(e),r.set(t,s)))})(e,t,this.edges),this.element)}},Es=(e,t,r)=>new _s({element:r}).transclude(e,t),As=_s;var Is=o(function(e,t){return Pe(function(r,s){return r[s]=e(t[s],s,t),r},{},x(t))});const Ss=Is;const Os=i(function(e){return null==e});var Ms=o(function(e,t){if(0===e.length||Os(t))return!1;for(var r=t,s=0;s<e.length;){if(Os(r)||!l(e[s],r))return!1;r=r[e[s]],s+=1}return!0});const Ts=Ms;var Cs=o(function(e,t){return Ts([e],t)});const Ds=Cs;const js=ot(function(e,t,r){return e(qt(t,r))});const Fs=ot(function(e,t,r){return e(Fr(t,r))});const Bs=Fe(1,nt(Nt,Yt));var Ns=bt(b,Gt("Object")),Ps=Fs(nt(Xt,bt(Ct,k(Ct(Object)))),["constructor"]);const Ls=Fe(1,function(e){if(!Bs(e)||!Ns(e))return!1;var t=Object.getPrototypeOf(e);return!!Bt(t)||Ps(t)});const Us=Fe(1,bt(b,Gt("String")));var qs=i(function(e){return Fe(e.length,e)});const $s=qs;const Hs=o(function(e,t){return Fe(e+1,function(){var r=arguments[e];if(null!=r&&Be(r[t]))return r[t].apply(r,Array.prototype.slice.call(arguments,0,e));throw new TypeError(Ct(r)+' does not have a method named "'+t+'"')})});const Rs=Hs(1,"split");var Gs=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=We,e.prototype["@@transducer/result"]=Ye,e.prototype["@@transducer/step"]=function(e,t){if(this.f){if(this.f(t))return e;this.f=null}return this.xf["@@transducer/step"](e,t)},e}();function Vs(e){return function(t){return new Gs(e,t)}}const zs=o(ze(["dropWhile"],Vs,function(e,t){for(var r=0,s=t.length;r<s&&e(t[r]);)r+=1;return gt(r,1/0,t)}));const Xs=Hs(1,"join");var Ws=i(function(e){return Fe(e.length,function(t,r){var s=Array.prototype.slice.call(arguments,0);return s[0]=r,s[1]=t,e.apply(this,s)})});const Ys=Ws(o(wt));const Ks=$s(function(e,t){return bt(Rs(""),zs(Ys(e)),Xs(""))(t)}),Js=new WeakMap,Qs=e=>{if(Js.has(e))return Js.get(e);const t={},r=(e,s,n)=>("string"==typeof e.element&&(t[e.element]=e.$visitor?[...n,"$visitor"]:n),Ss((e,t)=>{const i=[...n,t];if(Ls(e)&&Ds("$ref",e)&&js(Us,"$ref",e)){const t=Br(["$ref"],e),r=Ks("#/",t);return Br(r.split("/"),s)}return Ls(e)?r(e,s,i):e},e)),s=r(e,e,[]);return s.elementMap=t,Js.set(e,s),s},Zs=(e,t=is)=>{if(Us(e))try{return t.fromRefract(JSON.parse(e))}catch{}return Ls(e)&&Ds("element",e)?t.fromRefract(e):t.toElement(e)},en=e=>{if(!P(e))return e;if(L(e)||U(e)||$(e)||q(e))return e.toValue();const t=new WeakMap,r=e=>{if(!P(e))return e;if(R(e)){if(t.has(e))return t.get(e);const s={};return t.set(e,s),e.forEach((e,t)=>{const n=r(t),i=r(e);"string"==typeof n&&(s[n]=i)}),s}if(H(e)){if(t.has(e))return t.get(e);const s=[];return t.set(e,s),e.forEach(e=>s.push(r(e))),s}return Jr(e)?String(e.toValue()):Kr(e)?L(e.href)?e.href.toValue():"":e.toValue()};return r(e)},tn=(e,t,r)=>JSON.stringify(en(e),t,r);class rn{static indentChar=" ";result;indent;constructor({directive:e=!1,indent:t=0}={}){this.result=e?"%YAML 1.2\n---\n":"",this.indent=t}NumberElement(e){this.result+=en(e.node)}BooleanElement(e){const t=en(e.node);this.result+=t?"true":"false"}StringElement(e){this.result+=JSON.stringify(en(e.node))}NullElement(){this.result+="null"}ArrayElement(e){const t=e.node;if(0===t.length)return this.result+="[]",void e.skip();t.forEach(e=>{const t=new rn({indent:this.indent+1}),r=rn.indentChar.repeat(this.indent);Ar(e,t);const{result:s}=t;this.result+=s.startsWith("\n")?`\n${r}-${s}`:`\n${r}- ${s}`}),e.skip()}ObjectElement(e){const t=e.node;if(0===t.length)return this.result+="{}",void e.skip();t.forEach((e,t)=>{const r=new rn({indent:this.indent+1}),s=new rn({indent:this.indent+1}),n=rn.indentChar.repeat(this.indent);Ar(t,r),Ar(e,s);const{result:i}=r,{result:o}=s;this.result+=o.startsWith("\n")?`\n${n}${i}:${o}`:`\n${n}${i}: ${o}`}),e.skip()}}const sn=(e,{directive:t=!1}={})=>{const r=new rn({directive:t});return Ar(e,r),r.result},nn=(e,t=is)=>t.toRefract(e),on=(e,t=is)=>{const r=nn(e,t);return JSON.stringify(r)},an=e=>{let t="",r=0;return Ar(e,{enter(e){const{element:s}=e.node,n=s.charAt(0).toUpperCase()+s.slice(1),i=" ".repeat(r);t+=r>0?"\n":"",t+=`${i}(${n}Element`,r+=1},leave(){r-=1,t+=")"}}),t},cn=e=>{const t=e.isMetaEmpty?void 0:ur(e.meta),r=e.isAttributesEmpty?void 0:ur(e.attributes);return new e.constructor(void 0,t,r)},ln=(e,t)=>t.clone&&t.isMergeableElement(e)?pn(cn(e),e,t):e,un={clone:!0,isMergeableElement:e=>R(e)||H(e),arrayElementMerge:(e,t,r)=>new(0,e.constructor)(e.concat(t).map(e=>ln(e,r))),objectElementMerge:(e,t,r)=>{const s=R(e)?cn(e):cn(t);return R(e)&&e.forEach((e,t,n)=>{const i=dr(n);i.value=ln(e,r),s.content.push(i)}),t.forEach((t,n,i)=>{const o=en(n);let a;if(R(e)&&e.hasKey(o)&&r.isMergeableElement(t)){const s=e.get(o);a=dr(i),a.value=((e,t)=>{if("function"!=typeof t.customMerge)return pn;const r=t.customMerge(e,t);return"function"==typeof r?r:pn})(n,r)(s,t,r)}else a=dr(i),a.value=ln(t,r);s.remove(o),s.content.push(a)}),s},customMerge:void 0,customMetaMerge:void 0,customAttributesMerge:void 0},pn=(e,t,r)=>{const s={...un,...r};s.isMergeableElement=s.isMergeableElement??un.isMergeableElement,s.arrayElementMerge=s.arrayElementMerge??un.arrayElementMerge,s.objectElementMerge=s.objectElementMerge??un.objectElementMerge;const n=H(t);if(!(n===H(e)))return ln(t,s);const i=n&&"function"==typeof s.arrayElementMerge?s.arrayElementMerge(e,t,s):s.objectElementMerge(e,t,s);return i.meta=(e=>"function"!=typeof e.customMetaMerge?e=>ur(e):e.customMetaMerge)(s)(e.meta,t.meta),i.attributes=(e=>"function"!=typeof e.customAttributesMerge?e=>ur(e):e.customAttributesMerge)(s)(e.attributes,t.attributes),i};pn.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of deepmerge should be an array.");return 0===e.length?new N:e.reduce((e,r)=>pn(e,r,t),cn(e[0]))};const hn=pn,dn=(e,t,r)=>{const s={...un,...r,customMerge:()=>(e,t)=>t,clone:!1};return hn(e,t,s)};dn.all=(e,t)=>{if(!Array.isArray(e))throw new TypeError("First argument of mergeRight should be an array.");return 0===e.length?new N:e.reduce((e,r)=>dn(e,r,t),cn(e[0]))};const fn=dn,mn=(...[e,t,r])=>fn(t,e,r);mn.all=(...[e,t])=>fn.all([...e].reverse(),t);const yn=mn;return s})());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speclynx/apidom-core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Tools for manipulating ApiDOM structures.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"license": "Apache-2.0",
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@babel/runtime-corejs3": "^7.28.4",
|
|
43
|
-
"@speclynx/apidom-datamodel": "^2.2.
|
|
44
|
-
"@speclynx/apidom-error": "^2.2.
|
|
45
|
-
"@speclynx/apidom-traverse": "^2.2.
|
|
43
|
+
"@speclynx/apidom-datamodel": "^2.2.1",
|
|
44
|
+
"@speclynx/apidom-error": "^2.2.1",
|
|
45
|
+
"@speclynx/apidom-traverse": "^2.2.1",
|
|
46
46
|
"ramda": "~0.32.0",
|
|
47
47
|
"ramda-adjunct": "^6.0.0",
|
|
48
48
|
"short-unique-id": "^5.3.2",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"README.md",
|
|
59
59
|
"CHANGELOG.md"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "3d4d6dd6b579ad443dc578ce1e3f05abf27228be"
|
|
62
62
|
}
|