@jsonic/ini 0.2.1 → 0.2.4

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/README.md CHANGED
@@ -4,6 +4,27 @@ This plugin allows the [Jsonic](https://jsonic.senecajs.org) JSON parser
4
4
  to parse [INI](https://github.com/microsoft/node-ini-parser) format files.
5
5
 
6
6
 
7
+ [![npm version](https://img.shields.io/npm/v/@jsonic/ini.svg)](https://npmjs.com/package/@jsonic/ini)
8
+ [![build](https://github.com/jsonicjs/ini/actions/workflows/build.yml/badge.svg)](https://github.com/jsonicjs/ini/actions/workflows/build.yml)
9
+ [![Coverage Status](https://coveralls.io/repos/github/jsonicjs/ini/badge.svg?branch=main)](https://coveralls.io/github/jsonicjs/ini?branch=main)
10
+ [![Known Vulnerabilities](https://snyk.io/test/github/jsonicjs/ini/badge.svg)](https://snyk.io/test/github/jsonicjs/ini)
11
+ [![DeepScan grade](https://deepscan.io/api/teams/5016/projects/25267/branches/788638/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=5016&pid=25267&bid=788638)
12
+ [![Maintainability](https://api.codeclimate.com/v1/badges/6da148ebd83e336cdcbe/maintainability)](https://codeclimate.com/github/jsonicjs/ini/maintainability)
13
+
14
+
15
+ | ![Voxgig](https://www.voxgig.com/res/img/vgt01r.png) | This open source module is sponsored and supported by [Voxgig](https://www.voxgig.com). |
16
+ | ---------------------------------------------------- | --------------------------------------------------------------------------------------- |
17
+
18
+
19
+
20
+ <!--START:options-->
21
+ ## Options
22
+ _None_
23
+ <!--END:options-->
24
+
25
+
26
+
27
+
7
28
 
8
29
 
9
30
 
package/ini.d.ts CHANGED
@@ -1,8 +1,5 @@
1
1
  import { Jsonic } from '@jsonic/jsonic-next';
2
- type IniOptions = {
3
- allowTrailingComma?: boolean;
4
- disallowComments?: boolean;
5
- };
6
- declare function Ini(jsonic: Jsonic, options: IniOptions): void;
2
+ type IniOptions = {};
3
+ declare function Ini(jsonic: Jsonic, _options: IniOptions): void;
7
4
  export { Ini };
8
5
  export type { IniOptions };
package/ini.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Ini = void 0;
5
5
  const hoover_1 = require("@jsonic/hoover");
6
- function Ini(jsonic, options) {
6
+ function Ini(jsonic, _options) {
7
7
  jsonic.use(hoover_1.Hoover, {
8
8
  lex: {
9
9
  order: 8.5e6,
@@ -134,8 +134,8 @@ function Ini(jsonic, options) {
134
134
  jsonic.rule('table', (rs) => {
135
135
  rs.bo((r) => {
136
136
  r.node = r.parent.node;
137
- if (r.prev.use.dive) {
138
- let dive = r.prev.use.dive;
137
+ if (r.prev.u.dive) {
138
+ let dive = r.prev.u.dive;
139
139
  for (let dI = 0; dI < dive.length; dI++) {
140
140
  r.node = r.node[dive[dI]] = r.node[dive[dI]] || {};
141
141
  }
@@ -153,7 +153,7 @@ function Ini(jsonic, options) {
153
153
  })
154
154
  .close([
155
155
  { s: [OS], r: 'table', b: 1 },
156
- { s: [CS], r: 'table', a: (r) => (r.use.dive = r.child.use.dive) },
156
+ { s: [CS], r: 'table', a: (r) => (r.u.dive = r.child.u.dive) },
157
157
  { s: [ZZ] },
158
158
  ]);
159
159
  });
@@ -162,12 +162,12 @@ function Ini(jsonic, options) {
162
162
  rs.open([
163
163
  {
164
164
  s: [DK, DOT],
165
- a: (r) => (r.use.dive = r.parent.use.dive || []).push(r.o0.val),
165
+ a: (r) => (r.u.dive = r.parent.u.dive || []).push(r.o0.val),
166
166
  p: 'dive',
167
167
  },
168
168
  {
169
169
  s: [DK],
170
- a: (r) => (r.use.dive = r.parent.use.dive || []).push(r.o0.val),
170
+ a: (r) => (r.u.dive = r.parent.u.dive || []).push(r.o0.val),
171
171
  },
172
172
  ]).close([{ s: [CS], b: 1 }]);
173
173
  });
@@ -197,20 +197,20 @@ function Ini(jsonic, options) {
197
197
  a: (r) => {
198
198
  let key = '' + r.o0.val;
199
199
  if (Array.isArray(r.node[key])) {
200
- r.use.ini_array = r.node[key];
200
+ r.u.ini_array = r.node[key];
201
201
  }
202
202
  else {
203
- r.use.key = key;
203
+ r.u.key = key;
204
204
  if (2 < key.length && key.endsWith('[]')) {
205
- key = r.use.key = key.slice(0, -2);
206
- r.node[key] = r.use.ini_array = Array.isArray(r.node[key])
205
+ key = r.u.key = key.slice(0, -2);
206
+ r.node[key] = r.u.ini_array = Array.isArray(r.node[key])
207
207
  ? r.node[key]
208
208
  : undefined === r.node[key]
209
209
  ? []
210
210
  : [r.node[key]];
211
211
  }
212
212
  else {
213
- r.use.pair = true;
213
+ r.u.pair = true;
214
214
  }
215
215
  }
216
216
  },
@@ -259,11 +259,11 @@ function Ini(jsonic, options) {
259
259
  // Invalid JSON, just accept val as given
260
260
  }
261
261
  }
262
- if (null != r.prev.use.ini_prev) {
262
+ if (null != r.prev.u.ini_prev) {
263
263
  r.prev.node = r.node = r.prev.o0.src + r.node;
264
264
  }
265
- else if (r.parent.use.ini_array) {
266
- r.parent.use.ini_array.push(r.node);
265
+ else if (r.parent.u.ini_array) {
266
+ r.parent.u.ini_array.push(r.node);
267
267
  }
268
268
  });
269
269
  });
package/ini.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ini.js","sourceRoot":"","sources":["ini.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAIzD,2CAAuC;AAOvC,SAAS,GAAG,CAAC,MAAc,EAAE,OAAmB;IAC9C,MAAM,CAAC,GAAG,CAAC,eAAM,EAAE;QACjB,GAAG,EAAE;YACH,KAAK,EAAE,KAAK;SACb;QACD,KAAK,EAAE;YACL,SAAS,EAAE;gBACT,KAAK,EAAE;oBACL,IAAI,EAAE;wBACJ,MAAM,EAAE;4BACN,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;yBAC1B;qBACF;iBACF;gBACD,GAAG,EAAE;oBACH,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;oB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G,GAAG,CAAC,CAAC,IAAI,CAAA;aAC9C;iBAAM,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE;gBAC/B,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;aAClC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC;AAEQ,kBAAG"}
package/ini.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JsonicIni=e()}}((function(){var e={exports:{}};(function(t){(function(){!function(n){"object"==typeof e.exports?e.exports=n():("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).JsonicHoover=n()}((function(){var e={exports:{}};(function(t){(function(){!function(n){"object"==typeof e.exports?e.exports=n():("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).Jsonic=n()}((function(){var e=function(e){var t;return function(n){return t||e(t={exports:{},parent:n},t.exports),t.exports}},t=e((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modlist=t.findTokenSet=t.values=t.keys=t.omap=t.str=t.prop=t.parserwrap=t.trimstk=t.tokenize=t.srcfmt=t.snip=t.regexp=t.mesc=t.makelog=t.isarr=t.filterRules=t.extract=t.escre=t.errinject=t.errdesc=t.entries=t.defprop=t.deep=t.configure=t.clone=t.clean=t.charset=t.badlex=t.assign=t.S=t.JsonicError=void 0;const l=n({}),i=e=>null==e?[]:Object.keys(e);t.keys=i;const s=e=>null==e?[]:Object.values(e);t.values=s;const o=e=>null==e?[]:Object.entries(e);t.entries=o;const a=(e,...t)=>Object.assign(null==e?{}:e,...t);t.assign=a,t.isarr=e=>Array.isArray(e);const c=Object.defineProperty;t.defprop=c;const u=(e,t)=>Object.entries(e||{}).reduce((e,n)=>{let r=t?t(n):n;void 0===r[0]?delete e[n[0]]:e[r[0]]=r[1];let l=2;for(;void 0!==r[l];)e[r[l]]=r[l+1],l+=2;return e},{});t.omap=u;const d={indent:". ",logindent:" ",space:" ",gap:" ",Object:"Object",Array:"Array",object:"object",string:"string",function:"function",unexpected:"unexpected",map:"map",list:"list",elem:"elem",pair:"pair",val:"val",node:"node",no_re_flags:r.EMPTY,unprintable:"unprintable",invalid_ascii:"invalid_ascii",invalid_unicode:"invalid_unicode",invalid_lex_state:"invalid_lex_state",unterminated_string:"unterminated_string",unterminated_comment:"unterminated_comment",lex:"lex",parse:"parse",error:"error",none:"none",imp_map:"imp,map",imp_list:"imp,list",imp_null:"imp,null",end:"end",open:"open",close:"close",rule:"rule",stack:"stack",nUll:"null",name:"name",make:"make",colon:":"};t.S=d;class p extends SyntaxError{constructor(e,t,n,r,l){let i=x(e,t=g({},t),n,r,l);super(i.message),a(this,i),v(this)}toJSON(){return{...this,__error:!0,name:this.name,message:this.message,stack:this.stack}}}function m(e,t,n){let l=t.t,i=l[e];return null==i&&r.STRING===typeof e&&(i=t.tI++,l[i]=e,l[e]=i,l[e.substring(1)]=i,null!=n&&a(n.token,t.t)),i}function f(e,...t){return new RegExp(t.map(e=>e.esc?h(e.toString()):e).join(r.EMPTY),null==e?"":e)}function h(e){return null==e?"":e.replace(/[-\\|\]{}()[^$+*?.!=]/g,"\\$&").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n")}function g(e,...t){let n=d.function===typeof e,r=null!=e&&(d.object===typeof e||n);for(let l of t){let t,i=d.function===typeof l,s=null!=l&&(d.object===typeof l||i);if(r&&s&&!i&&Array.isArray(e)===Array.isArray(l))for(let n in l)e[n]=g(e[n],l[n]);else e=void 0===l?e:i?l:s?d.function===typeof(t=l.constructor)&&d.Object!==t.name&&d.Array!==t.name?l:g(Array.isArray(l)?[]:{},l):l,n=d.function===typeof e,r=null!=e&&(d.object===typeof e||n)}return e}function k(e,t,n,r,l,i){let s={code:t,details:n,token:r,rule:l,ctx:i};return null==e?"":e.replace(/\$(\{?)([\w_0-9]+)(\}?)/g,(e,t,o,a)=>{let c=null!=s[o]?s[o]:null!=n[o]?n[o]:i.meta&&null!=i.meta[o]?i.meta[o]:null!=r[o]?r[o]:null!=l[o]?l[o]:null!=i.opts[o]?i.opts[o]:null!=i.cfg[o]?i.cfg[o]:null!=i[o]?i[o]:"$"+o,u=t&&a?c:JSON.stringify(c);return u=null==u?"":u,u.replace(/\n/g,"\n ")})}function v(e){e.stack&&(e.stack=e.stack.split("\n").filter(e=>!e.includes("jsonic/jsonic")).map(e=>e.replace(/ at /,"at ")).join("\n"))}function b(e,t,n){let l=0<n.sI?n.sI:0,i=0<n.rI?n.rI:1,s=0<n.cI?n.cI:1,o=null==n.src?r.EMPTY:n.src,a=e.substring(Math.max(0,l-333),l).split("\n"),c=e.substring(l,l+333).split("\n"),u=2+(r.EMPTY+(i+2)).length,d=i<3?1:i-2,p=e=>"\x1b[34m"+(r.EMPTY+d++).padStart(u," ")+" | \x1b[0m"+(null==e?r.EMPTY:e),m=a.length;return[2<m?p(a[m-3]):null,1<m?p(a[m-2]):null,p(a[m-1]+c[0])," ".repeat(u)+" "+" ".repeat(s-1)+"\x1b[31m"+"^".repeat(o.length||1)+" "+t+"\x1b[0m",p(c[1]),p(c[2])].filter(e=>null!=e).join("\n")}function x(e,t,n,r,l){var i,s,o;try{let a=l.cfg,c=l.meta,u=k(a.error[e]||(null===(i=null==t?void 0:t.use)||void 0===i?void 0:i.err)&&(t.use.err.code||t.use.err.message)||a.error.unknown,e,t,n,r,l);d.function===typeof a.hint&&(a.hint={...a.hint(),...a.hint});let p=["\x1b[31m[jsonic/"+e+"]:\x1b[0m "+u," \x1b[34m--\x3e\x1b[0m "+(c&&c.fileName||"<no-file>")+":"+n.rI+":"+n.cI,b(l.src(),u,n),"",k((a.hint[e]||(null===(o=null===(s=t.use)||void 0===s?void 0:s.err)||void 0===o?void 0:o.message)||a.hint.unknown||"").trim().split("\n").map(e=>" "+e).join("\n"),e,t,n,r,l),""," \x1b[2mhttps://jsonic.senecajs.org\x1b[0m"," \x1b[2m--internal: rule="+r.name+"~"+r.state+"; token="+m(n.tin,l.cfg)+(null==n.why?"":"~"+n.why)+"; plugins="+l.plgn().map(e=>e.name).join(",")+"--\x1b[0m\n"].join("\n"),f={internal:{token:n,ctx:l}};return f={...Object.create(f),message:p,code:e,details:t,meta:c,fileName:c?c.fileName:void 0,lineNumber:n.rI,columnNumber:n.cI},f}catch(a){return console.log(a),{}}}function y(e){return"function"==typeof e.debug.print.src?e.debug.print.src:t=>{let n=null==t?r.EMPTY:Array.isArray(t)?JSON.stringify(t).replace(/]$/,o(t).filter(e=>isNaN(e[0])).map((e,t)=>(0===t?", ":"")+e[0]+": "+JSON.stringify(e[1]))+"]"):JSON.stringify(t);return n=n.substring(0,e.debug.maxlen)+(e.debug.maxlen<n.length?"...":r.EMPTY),n}}function I(e,t=44){let n;try{n="object"==typeof e?JSON.stringify(e):""+e}catch(r){n=""+e}return S(t<n.length?n.substring(0,t-3)+"...":n,t)}function S(e,t=5){return void 0===e?"":(""+e).substring(0,t).replace(/[\r\n\t]/g,".")}function j(...e){return null==e?{}:e.filter(e=>!1!==e).map(e=>"object"==typeof e?i(e).join(r.EMPTY):e).join(r.EMPTY).split(r.EMPTY).reduce((e,t)=>(e[t]=t.charCodeAt(0),e),{})}function E(e){for(let t in e)null==e[t]&&delete e[t];return e}t.JsonicError=p,t.configure=function(e,t,n){var r,l,c,d,p,g,k,v,b,x,y,I,S,O,T,N,M,P,C,w,_,R,A,L,Y,U,$,F,J,K,B,D,V,H,z,Z,G,W,q,X,Q,ee,te,ne,re,le,ie,se,oe,ae;const ce=t||{};ce.t=ce.t||{},ce.tI=ce.tI||1;const ue=e=>m(e,ce);!1!==n.standard$&&(ue("#BD"),ue("#ZZ"),ue("#UK"),ue("#AA"),ue("#SP"),ue("#LN"),ue("#CM"),ue("#NR"),ue("#ST"),ue("#TX"),ue("#VL")),ce.safe={key:!1!==(null===(r=n.safe)||void 0===r?void 0:r.key)},ce.fixed={lex:!!(null===(l=n.fixed)||void 0===l?void 0:l.lex),token:n.fixed?u(E(n.fixed.token),([e,t])=>[t,m(e,ce)]):{},ref:void 0,check:null===(c=n.fixed)||void 0===c?void 0:c.check},ce.fixed.ref=u(ce.fixed.token,([e,t])=>[e,t]),ce.fixed.ref=Object.assign(ce.fixed.ref,u(ce.fixed.ref,([e,t])=>[t,e])),ce.match={lex:!!(null===(d=n.match)||void 0===d?void 0:d.lex),value:n.match?u(E(n.match.value),([e,t])=>[e,t]):{},token:n.match?u(E(n.match.token),([e,t])=>[m(e,ce),t]):{},check:null===(p=n.match)||void 0===p?void 0:p.check},u(ce.match.token,([e,t])=>[e,(t.tin$=+e,t)]);const de=n.tokenSet?Object.keys(n.tokenSet).reduce((e,t)=>(e[t]=n.tokenSet[t].filter(e=>null!=e).map(e=>ue(e)),e),{}):{};ce.tokenSet=ce.tokenSet||{},o(de).map(e=>{let t=e[0],n=e[1];ce.tokenSet[t]?(ce.tokenSet[t].length=0,ce.tokenSet[t].push(...n)):ce.tokenSet[t]=n}),ce.tokenSetTins=o(ce.tokenSet).reduce((e,t)=>(e[t[0]]=e[t[0]]||{},t[1].map(n=>e[t[0]][n]=!0),e),{}),ce.tokenSetTins.IGNORE=ce.tokenSetTins.IGNORE||{},ce.space={lex:!!(null===(g=n.space)||void 0===g?void 0:g.lex),chars:j(null===(k=n.space)||void 0===k?void 0:k.chars),check:null===(v=n.space)||void 0===v?void 0:v.check},ce.line={lex:!!(null===(b=n.line)||void 0===b?void 0:b.lex),chars:j(null===(x=n.line)||void 0===x?void 0:x.chars),rowChars:j(null===(y=n.line)||void 0===y?void 0:y.rowChars),single:!!(null===(I=n.line)||void 0===I?void 0:I.single),check:null===(S=n.line)||void 0===S?void 0:S.check},ce.text={lex:!!(null===(O=n.text)||void 0===O?void 0:O.lex),modify:((null===(T=ce.text)||void 0===T?void 0:T.modify)||[]).concat(([null===(N=n.text)||void 0===N?void 0:N.modify]||[]).flat()).filter(e=>null!=e),check:null===(M=n.text)||void 0===M?void 0:M.check},ce.number={lex:!!(null===(P=n.number)||void 0===P?void 0:P.lex),hex:!!(null===(C=n.number)||void 0===C?void 0:C.hex),oct:!!(null===(w=n.number)||void 0===w?void 0:w.oct),bin:!!(null===(_=n.number)||void 0===_?void 0:_.bin),sep:null!=(null===(R=n.number)||void 0===R?void 0:R.sep)&&""!==n.number.sep,exclude:null===(A=n.number)||void 0===A?void 0:A.exclude,sepChar:null===(L=n.number)||void 0===L?void 0:L.sep,check:null===(Y=n.number)||void 0===Y?void 0:Y.check},ce.value={lex:!!(null===(U=n.value)||void 0===U?void 0:U.lex),def:o((null===($=n.value)||void 0===$?void 0:$.def)||{}).reduce((e,t)=>(null==t[1]||!1===t[1]||t[1].match||(e[t[0]]=t[1]),e),{}),defre:o((null===(F=n.value)||void 0===F?void 0:F.def)||{}).reduce((e,t)=>(t[1]&&t[1].match&&(e[t[0]]=t[1],e[t[0]].consume=!!e[t[0]].consume),e),{})},ce.rule={start:null==(null===(J=n.rule)||void 0===J?void 0:J.start)?"val":n.rule.start,maxmul:null==(null===(K=n.rule)||void 0===K?void 0:K.maxmul)?3:n.rule.maxmul,finish:!!(null===(B=n.rule)||void 0===B?void 0:B.finish),include:(null===(D=n.rule)||void 0===D?void 0:D.include)?n.rule.include.split(/\s*,+\s*/).filter(e=>""!==e):[],exclude:(null===(V=n.rule)||void 0===V?void 0:V.exclude)?n.rule.exclude.split(/\s*,+\s*/).filter(e=>""!==e):[]},ce.map={extend:!!(null===(H=n.map)||void 0===H?void 0:H.extend),merge:null===(z=n.map)||void 0===z?void 0:z.merge},ce.list={property:!!(null===(Z=n.list)||void 0===Z?void 0:Z.property)};let pe=Object.keys(ce.fixed.token).sort((e,t)=>t.length-e.length).map(e=>h(e)).join("|"),me=(null===(G=n.comment)||void 0===G?void 0:G.lex)?(n.comment.def?s(n.comment.def):[]).filter(e=>e&&e.lex).map(e=>h(e.start)).join("|"):"",fe=["([",h(i(j(ce.space.lex&&ce.space.chars,ce.line.lex&&ce.line.chars)).join("")),"]",("string"==typeof n.ender?n.ender.split(""):Array.isArray(n.ender)?n.ender:[]).map(e=>"|"+h(e)).join(""),""===pe?"":"|",pe,""===me?"":"|",me,"|$)"];return ce.rePart={fixed:pe,ender:fe,commentStart:me},ce.re={ender:f(null,...fe),rowChars:f(null,h(null===(W=n.line)||void 0===W?void 0:W.rowChars)),columns:f(null,"["+h(null===(q=n.line)||void 0===q?void 0:q.chars)+"]","(.*)$")},ce.lex={empty:!!(null===(X=n.lex)||void 0===X?void 0:X.empty),emptyResult:null===(Q=n.lex)||void 0===Q?void 0:Q.emptyResult,match:(null===(ee=n.lex)||void 0===ee?void 0:ee.match)?o(n.lex.match).reduce((e,t)=>{let r=t[0],l=t[1];if(l){let t=l.make(ce,n);t&&(t.matcher=r,t.make=l.make,t.order=l.order),e.push(t)}return e},[]).filter(e=>null!=e&&!1!==e&&-1<+e.order).sort((e,t)=>e.order-t.order):[]},ce.parse={prepare:s(null===(te=n.parse)||void 0===te?void 0:te.prepare)},ce.debug={get_console:(null===(ne=n.debug)||void 0===ne?void 0:ne.get_console)||(()=>console),maxlen:null==(null===(re=n.debug)||void 0===re?void 0:re.maxlen)?99:n.debug.maxlen,print:{config:!!(null===(ie=null===(le=n.debug)||void 0===le?void 0:le.print)||void 0===ie?void 0:ie.config),src:null===(oe=null===(se=n.debug)||void 0===se?void 0:se.print)||void 0===oe?void 0:oe.src}},ce.error=n.error||{},ce.hint=n.hint||{},(null===(ae=n.config)||void 0===ae?void 0:ae.modify)&&i(n.config.modify).forEach(e=>n.config.modify[e](ce,n)),ce.debug.print.config&&ce.debug.get_console().dir(ce,{depth:null}),ce.result={fail:[]},n.result&&(ce.result.fail=[...n.result.fail]),a(e.options,n),a(e.token,ce.t),a(e.tokenSet,ce.tokenSet),a(e.fixed,ce.fixed.ref),ce},t.tokenize=m,t.findTokenSet=function(e,t){return t.tokenSet[e]},t.mesc=function(e,t){return(t=new String(e)).esc=!0,t},t.regexp=f,t.escre=h,t.deep=g,t.errinject=k,t.trimstk=v,t.extract=b,t.errdesc=x,t.badlex=function(e,t,n){let r=e.next.bind(e);return e.next=(e,l,i,s)=>{let o=r(e,l,i,s);if(t===o.tin){let t={};throw null!=o.use&&(t.use=o.use),new p(o.why||d.unexpected,t,o,e,n)}return o},e},t.makelog=function(e,t){var n,r,l;let i=null===(l=null===(r=null===(n=e.opts)||void 0===n?void 0:n.plugin)||void 0===r?void 0:r.debug)||void 0===l?void 0:l.trace;if(t||i)if("number"==typeof(null==t?void 0:t.log)||i){let n=!1,r=null==t?void 0:t.log;(-1===r||i)&&(r=1,n=!0),e.log=(...t)=>{if(n){let n=t.filter(e=>d.object!=typeof e).map(e=>d.function==typeof e?e.name:e).join(d.gap);e.cfg.debug.get_console().log(n)}else e.cfg.debug.get_console().dir(t,{depth:r})}}else"function"==typeof t.log&&(e.log=t.log);return e.log},t.srcfmt=y,t.str=I,t.snip=S,t.clone=function(e){return g(Object.create(Object.getPrototypeOf(e)),e)},t.charset=j,t.clean=E,t.filterRules=function(e,t){let n=["open","close"];for(let r of n)e.def[r]=e.def[r].map(e=>(e.g="string"==typeof e.g?(e.g||"").split(/\s*,+\s*/):e.g||[],e)).filter(e=>t.rule.include.reduce((t,n)=>t||null!=e.g&&-1!==e.g.indexOf(n),0===t.rule.include.length)).filter(e=>t.rule.exclude.reduce((t,n)=>t&&(null==e.g||-1===e.g.indexOf(n)),!0));return e},t.prop=function(e,t,n){let r=e;try{let r,l=t.split(".");for(let t=0;t<l.length;t++)r=l[t],t<l.length-1&&(e=e[r]=e[r]||{});return void 0!==n&&(e[r]=n),e[r]}catch(l){throw new Error("Cannot "+(void 0===n?"get":"set")+" path "+t+" on object: "+I(r)+(void 0===n?"":" to value: "+I(n,22)))}},t.modlist=function(e,t){if(t&&e){if(0<e.length){if(t.delete&&0<t.delete.length)for(let r=0;r<t.delete.length;r++){let n=t.delete[r];(n<0?-1*n<=e.length:n<e.length)&&(e[(e.length+n)%e.length]=null)}if(t.move)for(let r=0;r<t.move.length;r+=2){let n=(e.length+t.move[r])%e.length,l=(e.length+t.move[r+1])%e.length,i=e[n];e.splice(n,1),e.splice(l,0,i)}let n=e.filter(e=>null!=e);n.length!==e.length&&(e.length=0,e.push(...n))}if(t.custom){let n=t.custom(e);null!=n&&(e=n)}}return e},t.parserwrap=function(e){return{start:function(t,n,i,s){try{return e.start(t,n,i,s)}catch(o){if("SyntaxError"===o.name){let s=0,a=0,c=0,u=r.EMPTY,d=o.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);if(d){u=d[1],s=parseInt(d[2]),a=t.substring(0,s).replace(/[^\n]/g,r.EMPTY).length;let e=s-1;for(;-1<e&&"\n"!==t.charAt(e);)e--;c=Math.max(t.substring(e,s).length,0)}let f=o.token||(0,l.makeToken)("#UK",m("#UK",n.internal().config),void 0,u,(0,l.makePoint)(u.length,s,o.lineNumber||a,o.columnNumber||c));throw new p(o.code||"json",o.details||{msg:o.message},f,{},o.ctx||{uI:-1,opts:n.options,cfg:n.internal().config,token:f,meta:i,src:()=>t,root:()=>{},plgn:()=>n.internal().plugins,inst:()=>n,rule:{name:"no-rule"},sub:{},xs:-1,v2:f,v1:f,t0:f,t1:f,tC:-1,kI:-1,rs:[],rsI:0,rsm:{},n:{},log:i?i.log:void 0,F:y(n.internal().config),use:{},NORULE:{name:"no-rule"},NOTOKEN:{name:"no-token"}})}throw o}}}}})),n=e((function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeTextMatcher=n.makeNumberMatcher=n.makeCommentMatcher=n.makeStringMatcher=n.makeLineMatcher=n.makeSpaceMatcher=n.makeFixedMatcher=n.makeMatchMatcher=n.makeToken=n.makePoint=n.makeLex=n.makeNoToken=void 0;const l=t({});class i{constructor(e,t,n,r){this.len=-1,this.sI=0,this.rI=1,this.cI=1,this.token=[],this.len=e,null!=t&&(this.sI=t),null!=n&&(this.rI=n),null!=r&&(this.cI=r)}toString(){return"Point["+[this.sI+"/"+this.len,this.rI,this.cI]+(0<this.token.length?" "+this.token:"")+"]"}[r.INSPECT](){return this.toString()}}const s=(...e)=>new i(...e);n.makePoint=s;class o{constructor(e,t,n,l,i,s,o){this.isToken=!0,this.name=r.EMPTY,this.tin=-1,this.val=void 0,this.src=r.EMPTY,this.sI=-1,this.rI=-1,this.cI=-1,this.len=-1,this.name=e,this.tin=t,this.src=l,this.val=n,this.sI=i.sI,this.rI=i.rI,this.cI=i.cI,this.use=s,this.why=o,this.len=null==l?0:l.length}resolveVal(e,t){return"function"==typeof this.val?this.val(e,t):this.val}bad(e,t){return this.err=e,null!=t&&(this.use=(0,l.deep)(this.use||{},t)),this}toString(){return"Token["+this.name+"="+this.tin+" "+(0,l.snip)(this.src)+(void 0===this.val||"#ST"===this.name||"#TX"===this.name?"":"="+(0,l.snip)(this.val))+" "+[this.sI,this.rI,this.cI]+(null==this.use?"":" "+(0,l.snip)(""+JSON.stringify(this.use).replace(/"/g,""),22))+(null==this.err?"":" "+this.err)+(null==this.why?"":" "+(0,l.snip)(""+this.why,22))+"]"}[r.INSPECT](){return this.toString()}}const a=(...e)=>new o(...e);function c(e,t,n){let r=e.pnt,l=t;if(e.cfg.fixed.lex&&null!=n&&0<n.length){let i,s=e.cfg.fixed.token[n];null!=s&&(i=e.token(s,void 0,n,r)),null!=i&&(r.sI+=i.src.length,r.cI+=i.src.length,null==t?l=i:r.token.push(i))}return l}n.makeToken=a,n.makeNoToken=()=>a("",-1,void 0,r.EMPTY,s(-1)),n.makeFixedMatcher=(e,t)=>{let n=(0,l.regexp)(null,"^(",e.rePart.fixed,")");return function(t){let r=e.fixed;if(!r.lex)return;if(e.fixed.check){let n=e.fixed.check(t);if(n&&n.done)return n.token}let l=t.pnt,i=t.src.substring(l.sI).match(n);if(i){let e=i[1],n=e.length;if(0<n){let i,s=r.token[e];return null!=s&&(i=t.token(s,void 0,e,l),l.sI+=n,l.cI+=n),i}}}},n.makeMatchMatcher=(e,t)=>{let n=(0,l.values)(e.match.value),r=(0,l.values)(e.match.token);return 0===n.length&&0===r.length?null:function(t,l,i=0){if(!e.match.lex)return;if(e.match.check){let n=e.match.check(t);if(n&&n.done)return n.token}let s=t.pnt,o=t.src.substring(s.sI),a="o"===l.state?0:1;for(let e of n)if(e.match instanceof RegExp){let n=o.match(e.match);if(n){let r=n[0],l=r.length;if(0<l){let i,o=e.val?e.val(n):r;return i=t.token("#VL",o,r,s),s.sI+=l,s.cI+=l,i}}}else{let n=e.match(t,l);if(null!=n)return n}for(let e of r)if(!e.tin$||l.spec.def.tcol[a][i].includes(e.tin$))if(e instanceof RegExp){let n=o.match(e);if(n){let r=n[0],l=r.length;if(0<l){let n,i=e.tin$;return n=t.token(i,r,r,s),s.sI+=l,s.cI+=l,n}}}else{let n=e(t,l);if(null!=n)return n}}},n.makeCommentMatcher=(e,t)=>{let n=t.comment;e.comment={lex:!!n&&!!n.lex,def:((null==n?void 0:n.def)?(0,l.entries)(n.def):[]).reduce((e,[t,n])=>{if(null==n||!1===n)return e;let r={name:t,start:n.start,end:n.end,line:!!n.line,lex:!!n.lex,eatline:!!n.eatline};return e[t]=r,e},{})};let r=e.comment.lex?(0,l.values)(e.comment.def).filter(e=>e.lex&&e.line):[],i=e.comment.lex?(0,l.values)(e.comment.def).filter(e=>e.lex&&!e.line):[];return function(t,n){if(!e.comment.lex)return;if(e.comment.check){let n=e.comment.check(t);if(n&&n.done)return n.token}let s=t.pnt,o=t.src.substring(s.sI),a=s.rI,c=s.cI;for(let l of r)if(o.startsWith(l.start)){let n=o.length,r=l.start.length;for(c+=l.start.length;r<n&&!e.line.chars[o[r]];)c++,r++;if(l.eatline)for(;r<n&&e.line.chars[o[r]];)e.line.rowChars[o[r]]&&a++,r++;let i=o.substring(0,r),u=t.token("#CM",void 0,i,s);return s.sI+=i.length,s.cI=c,s.rI=a,u}for(let r of i)if(o.startsWith(r.start)){let n=o.length,i=r.start.length,u=r.end;for(c+=r.start.length;i<n&&!o.substring(i).startsWith(u);)e.line.rowChars[o[i]]&&(a++,c=0),c++,i++;if(o.substring(i).startsWith(u)){if(c+=u.length,r.eatline)for(;i<n&&e.line.chars[o[i]];)e.line.rowChars[o[i]]&&a++,i++;let l=o.substring(0,i+u.length),d=t.token("#CM",void 0,l,s);return s.sI+=l.length,s.rI=a,s.cI=c,d}return t.bad(l.S.unterminated_comment,s.sI,s.sI+9*r.start.length)}}},n.makeTextMatcher=(e,t)=>{let n=(0,l.regexp)(e.line.lex?null:"s","^(.*?)",...e.rePart.ender);return function(r){if(e.text.check){let t=e.text.check(r);if(t&&t.done)return t.token}let l=e.text,i=r.pnt,s=r.src.substring(i.sI),o=e.value.def,a=e.value.defre,u=s.match(n);if(u){let n,d=u[1],p=u[2];if(null!=d){let t=d.length;if(0<t){let c;if(e.value.lex)if(void 0!==(c=o[d]))n=r.token("#VL",c.val,d,i),i.sI+=t,i.cI+=t;else for(let e in a){let t=a[e];if(t.match){let e=t.match.exec(t.consume?s:d);if(e&&(t.consume||e[0].length===d.length)){let l=e[0];if(null==t.val)n=r.token("#VL",l,l,i);else{let s=t.val(e);n=r.token("#VL",s,l,i)}i.sI+=l.length,i.cI+=l.length}}}null==n&&l.lex&&(n=r.token("#TX",d,d,i),i.sI+=t,i.cI+=t)}}if(n&&(n=c(r,n,p)),n&&0<e.text.modify.length){const l=e.text.modify;for(let i=0;i<l.length;i++)n.val=l[i](n.val,r,e,t)}return n}}},n.makeNumberMatcher=(e,t)=>{let n=e.number,r=(0,l.regexp)(null,["^([-+]?(0(",[n.hex?"x[0-9a-fA-F_]+":null,n.oct?"o[0-7_]+":null,n.bin?"b[01_]+":null].filter(e=>null!=e).join("|"),")|\\.?[0-9]+([0-9_]*[0-9])?)","(\\.[0-9]?([0-9_]*[0-9])?)?","([eE][-+]?[0-9]+([0-9_]*[0-9])?)?"].join("").replace(/_/g,n.sep?(0,l.escre)(n.sepChar):""),")",...e.rePart.ender),i=n.sep?(0,l.regexp)("g",(0,l.escre)(n.sepChar)):void 0;return function(t){if(n=e.number,!n.lex)return;if(e.number.check){let n=e.number.check(t);if(n&&n.done)return n.token}let l=t.pnt,s=t.src.substring(l.sI),o=e.value.def,a=s.match(r);if(a){let n,r=a[1],s=a[9],u=!0;if(null!=r&&(u=!e.number.exclude||!r.match(e.number.exclude))){let s=r.length;if(0<s){let a;if(e.value.lex&&void 0!==(a=o[r]))n=t.token("#VL",a.val,r,l);else{let e=i?r.replace(i,""):r,o=+e;if(isNaN(o)){let t=e[0];"-"!==t&&"+"!==t||(o=("-"===t?-1:1)*+e.substring(1))}isNaN(o)||(n=t.token("#NR",o,r,l),l.sI+=s,l.cI+=s)}}}return u&&(n=c(t,n,s)),n}}},n.makeStringMatcher=(e,t)=>{let n=t.string||{};return e.string=e.string||{},e.string=(0,l.deep)(e.string,{lex:!!(null==n?void 0:n.lex),quoteMap:(0,l.charset)(n.chars),multiChars:(0,l.charset)(n.multiChars),escMap:{...n.escape},escChar:n.escapeChar,escCharCode:null==n.escapeChar?void 0:n.escapeChar.charCodeAt(0),allowUnknown:!!n.allowUnknown,replaceCodeMap:(0,l.omap)((0,l.clean)({...n.replace}),([e,t])=>[e.charCodeAt(0),t]),hasReplace:!1,abandon:!!n.abandon}),e.string.escMap=(0,l.clean)(e.string.escMap),e.string.hasReplace=0<(0,l.keys)(e.string.replaceCodeMap).length,function(t){let n=e.string;if(!n.lex)return;if(e.string.check){let n=e.string.check(t);if(n&&n.done)return n.token}let{quoteMap:i,escMap:s,escChar:o,escCharCode:a,multiChars:c,allowUnknown:u,replaceCodeMap:d,hasReplace:p}=n,{pnt:m,src:f}=t,{sI:h,rI:g,cI:k}=m,v=f.length;if(i[f[h]]){const i=f[h],b=h,x=g,y=c[i];++h,++k;let I,S=[];for(;h<v;h++){k++;let r=f[h];if(I=void 0,i===r){h++;break}if(o===r){h++,k++;let e=s[f[h]];if(null!=e)S.push(e);else if("x"===f[h]){h++;let e=parseInt(f.substring(h,h+2),16);if(isNaN(e)){if(n.abandon)return;return h-=2,k-=2,m.sI=h,m.cI=k,t.bad(l.S.invalid_ascii,h,h+4)}let r=String.fromCharCode(e);S.push(r),h+=1,k+=2}else if("u"===f[h]){h++;let e="{"===f[h]?(h++,1):0,r=e?6:4,i=parseInt(f.substring(h,h+r),16);if(isNaN(i)){if(n.abandon)return;return h=h-2-e,k-=2,m.sI=h,m.cI=k,t.bad(l.S.invalid_unicode,h,h+r+2+2*e)}let s=String.fromCodePoint(i);S.push(s),h+=r-1+e,k+=r+e}else{if(!u){if(n.abandon)return;return m.sI=h,m.cI=k-1,t.bad(l.S.unexpected,h,h+1)}S.push(f[h])}}else if(p&&void 0!==(I=d[f.charCodeAt(h)]))S.push(I),k++;else{let r=h,s=i.charCodeAt(0),o=f.charCodeAt(h);for(;(!p||void 0===(I=d[o]))&&h<v&&32<=o&&s!==o&&a!==o;)o=f.charCodeAt(++h),k++;if(k--,void 0===I&&o<32){if(!y||!e.line.chars[f[h]]){if(n.abandon)return;return m.sI=h,m.cI=k,t.bad(l.S.unprintable,h,h+1)}e.line.rowChars[f[h]]&&(m.rI=++g),k=1,S.push(f.substring(r,h+1))}else S.push(f.substring(r,h)),h--}}if(f[h-1]!==i||m.sI===h-1){if(n.abandon)return;return m.rI=x,t.bad(l.S.unterminated_string,b,h)}const j=t.token("#ST",S.join(r.EMPTY),f.substring(m.sI,h),m);return m.sI=h,m.rI=g,m.cI=k,j}}},n.makeLineMatcher=(e,t)=>function(t){if(!e.line.lex)return;if(e.line.check){let n=e.line.check(t);if(n&&n.done)return n.token}let n,{chars:r,rowChars:l}=e.line,{pnt:i,src:s}=t,{sI:o,rI:a}=i,c=e.line.single;for(c&&(n={});r[s[o]]&&!(n&&(n[s[o]]=(n[s[o]]||0)+1,c&&1<n[s[o]]));)a+=l[s[o]]?1:0,o++;if(i.sI<o){let e=s.substring(i.sI,o);const n=t.token("#LN",void 0,e,i);return i.sI+=e.length,i.rI=a,i.cI=1,n}},n.makeSpaceMatcher=(e,t)=>function(t){if(!e.space.lex)return;if(e.space.check){let n=e.space.check(t);if(n&&n.done)return n.token}let{chars:n}=e.space,{pnt:r,src:l}=t,{sI:i,cI:s}=r;for(;n[l[i]];)i++,s++;if(r.sI<i){let e=l.substring(r.sI,i);const n=t.token("#SP",void 0,e,r);return r.sI+=e.length,r.cI=s,n}};class u{constructor(e){this.src=r.EMPTY,this.ctx={},this.cfg={},this.pnt=s(-1),this.ctx=e,this.src=e.src(),this.cfg=e.cfg,this.pnt=s(this.src.length)}token(e,t,n,r,i,s){let o,c;return"string"==typeof e?(c=e,o=(0,l.tokenize)(c,this.cfg)):(o=e,c=(0,l.tokenize)(e,this.cfg)),a(c,o,t,n,r||this.pnt,i,s)}next(e,t,n,r){let i,s,o=this.pnt,a=o.sI;if(o.end)i=o.end;else if(0<o.token.length)i=o.token.shift();else if(o.len<=o.sI)o.end=this.token("#ZZ",void 0,"",o),i=o.end;else{try{for(let t of this.cfg.lex.match)if(i=t(this,e,r)){s=t;break}}catch(c){i=i||this.token("#BD",void 0,this.src[o.sI],o,{err:c},c.code||l.S.unexpected)}i=i||this.token("#BD",void 0,this.src[o.sI],o,void 0,l.S.unexpected)}return this.ctx.log&&this.ctx.log(l.S.lex,this.ctx,e,this,o,a,s,i,t,n,r),this.ctx.sub.lex&&this.ctx.sub.lex.map(t=>t(i,e,this.ctx)),i}tokenize(e){return(0,l.tokenize)(e,this.cfg)}bad(e,t,n){return this.token("#BD",void 0,0<=t&&t<=n?this.src.substring(t,n):this.src[this.pnt.sI],void 0,void 0,e)}}n.makeLex=(...e)=>new u(...e)})),r={};Object.defineProperty(r,"__esModule",{value:!0}),r.STRING=r.INSPECT=r.EMPTY=r.AFTER=r.BEFORE=r.CLOSE=r.OPEN=void 0,r.OPEN="o",r.CLOSE="c",r.BEFORE="b",r.AFTER="a",r.EMPTY="",r.INSPECT=Symbol.for("nodejs.util.inspect.custom"),r.STRING="string";var l={};Object.defineProperty(l,"__esModule",{value:!0}),l.defaults=void 0;const i=n({}),s={safe:{key:!0},tag:"-",fixed:{lex:!0,token:{"#OB":"{","#CB":"}","#OS":"[","#CS":"]","#CL":":","#CA":","}},match:{lex:!0,token:{}},tokenSet:{IGNORE:["#SP","#LN","#CM"],VAL:["#TX","#NR","#ST","#VL"],KEY:["#TX","#NR","#ST","#VL"]},space:{lex:!0,chars:" \t"},line:{lex:!0,chars:"\r\n",rowChars:"\n",single:!1},text:{lex:!0},number:{lex:!0,hex:!0,oct:!0,bin:!0,sep:"_",exclude:void 0},comment:{lex:!0,def:{hash:{line:!0,start:"#",lex:!0,eatline:!1},slash:{line:!0,start:"//",lex:!0,eatline:!1},multi:{line:!1,start:"/*",end:"*/",lex:!0,eatline:!1}}},string:{lex:!0,chars:"'\"`",multiChars:"`",escapeChar:"\\",escape:{b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",'"':'"',"'":"'","`":"`","\\":"\\","/":"/"},allowUnknown:!0,abandon:!1},map:{extend:!0,merge:void 0},list:{property:!0},value:{lex:!0,def:{true:{val:!0},false:{val:!1},null:{val:null}}},ender:[],plugin:{},debug:{get_console:()=>console,maxlen:99,print:{config:!1,src:void 0}},error:{unknown:"unknown error: $code",unexpected:"unexpected character(s): $src",invalid_unicode:"invalid unicode escape: $src",invalid_ascii:"invalid ascii escape: $src",unprintable:"unprintable character: $src",unterminated_string:"unterminated string: $src",unterminated_comment:"unterminated comment: $src",unknown_rule:"unknown rule: $rulename"},hint:function(e=((e,t="replace")=>e[t](/[A-Z]/g,e=>" "+e.toLowerCase())[t](/[~%][a-z]/g,e=>("~"==e[0]?" ":"")+e[1].toUpperCase())),t="~sinceTheErrorIsUnknown,ThisIsProbablyABugInsideJsonic\nitself,OrAPlugin.~pleaseConsiderPostingAGithubIssue -Thanks!\n\n~code: $code,~details: \n$details|~theCharacter(s) $srcWereNotExpectedAtThisPointAsTheyDoNot\nmatchTheExpectedSyntax,EvenUnderTheRelaxedJsonicRules.~ifIt\nisNotObviouslyWrong,TheActualSyntaxErrorMayBeElsewhere.~try\ncommentingOutLargerAreasAroundThisPointUntilYouGetNoErrors,\nthenRemoveTheCommentsInSmallSectionsUntilYouFindThe\noffendingSyntax.~n%o%t%e:~alsoCheckIfAnyPluginsYouAreUsing\nexpectDifferentSyntaxInThisCase.|~theEscapeSequence $srcDoesNotEncodeAValidUnicodeCodePoint\nnumber.~youMayNeedToValidateYourStringDataManuallyUsingTest\ncodeToSeeHow~javaScriptWillInterpretIt.~alsoConsiderThatYour\ndataMayHaveBecomeCorrupted,OrTheEscapeSequenceHasNotBeen\ngeneratedCorrectly.|~theEscapeSequence $srcDoesNotEncodeAValid~a%s%c%i%iCharacter.~you\nmayNeedToValidateYourStringDataManuallyUsingTestCodeToSee\nhow~javaScriptWillInterpretIt.~alsoConsiderThatYourDataMay\nhaveBecomeCorrupted,OrTheEscapeSequenceHasNotBeenGenerated\ncorrectly.|~stringValuesCannotContainUnprintableCharacters (characterCodes\nbelow 32).~theCharacter $srcIsUnprintable.~youMayNeedToRemove\ntheseCharactersFromYourSourceData.~alsoCheckThatItHasNot\nbecomeCorrupted.|~thisStringHasNoEndQuote.|~thisCommentIsNeverClosed.|~noRuleNamed $rulenameIsDefined.~thisIsProbablyAnErrorInThe\ngrammarOfAPlugin.".split("|")){return"unknown|unexpected|invalid_unicode|invalid_ascii|unprintable|unterminated_string|unterminated_comment|unknown_rule".split("|").reduce((n,r,l)=>(n[r]=e(t[l]),n),{})},lex:{match:{match:{order:1e6,make:i.makeMatchMatcher},fixed:{order:2e6,make:i.makeFixedMatcher},space:{order:3e6,make:i.makeSpaceMatcher},line:{order:4e6,make:i.makeLineMatcher},string:{order:5e6,make:i.makeStringMatcher},comment:{order:6e6,make:i.makeCommentMatcher},number:{order:7e6,make:i.makeNumberMatcher},text:{order:8e6,make:i.makeTextMatcher}},empty:!0,emptyResult:void 0},parse:{prepare:{}},rule:{start:"val",finish:!0,maxmul:3,include:"",exclude:""},result:{fail:[]},config:{modify:{}},parser:{start:void 0}};l.defaults=s;var o={};Object.defineProperty(o,"__esModule",{value:!0}),o.makeRuleSpec=o.makeNoRule=o.makeRule=void 0;const a=t({});class c{constructor(e,t,n){this.i=-1,this.name=r.EMPTY,this.node=null,this.state=r.OPEN,this.n=Object.create(null),this.d=-1,this.use=Object.create(null),this.keep=Object.create(null),this.bo=!1,this.ao=!1,this.bc=!1,this.ac=!1,this.os=0,this.cs=0,this.need=0,this.i=t.uI++,this.name=e.name,this.spec=e,this.child=t.NORULE,this.parent=t.NORULE,this.prev=t.NORULE,this.o0=t.NOTOKEN,this.o1=t.NOTOKEN,this.c0=t.NOTOKEN,this.c1=t.NOTOKEN,this.node=n,this.d=t.rsI,this.bo=null!=e.def.bo,this.ao=null!=e.def.ao,this.bc=null!=e.def.bc,this.ac=null!=e.def.ac}process(e,t){return this.spec.process(this,e,t,this.state)}toString(){return"[Rule "+this.name+"~"+this.i+"]"}}const u=(...e)=>new c(...e);o.makeRule=u,o.makeNoRule=e=>u(g(e.cfg,{}),e);class d{constructor(){this.p=r.EMPTY,this.r=r.EMPTY,this.b=0}}const p=(...e)=>new d(...e),m=p(),f=p();class h{constructor(e,t){this.name=r.EMPTY,this.def={open:[],close:[],bo:[],bc:[],ao:[],ac:[],tcol:[]},this.cfg=e,this.def=Object.assign(this.def,t),this.def.open=(this.def.open||[]).filter(e=>null!=e),this.def.close=(this.def.close||[]).filter(e=>null!=e);for(let n of[...this.def.open,...this.def.close])k(n)}tin(e){return(0,a.tokenize)(e,this.cfg)}add(e,t,n){let r=(null==n?void 0:n.append)?"push":"unshift",l=((0,a.isarr)(t)?t:[t]).filter(e=>null!=e&&"object"==typeof e).map(e=>k(e)),i="o"===e?"open":"close",s=this.def[i];return s[r](...l),s=this.def[i]=(0,a.modlist)(s,n),(0,a.filterRules)(this,this.cfg),this.norm(),this}open(e,t){return this.add("o",e,t)}close(e,t){return this.add("c",e,t)}action(e,t,n,r){let l=this.def[t+n];return e?l.push(r):l.unshift(r),this}bo(e,t){return this.action(!t||!!e,r.BEFORE,r.OPEN,t||e)}ao(e,t){return this.action(!t||!!e,r.AFTER,r.OPEN,t||e)}bc(e,t){return this.action(!t||!!e,r.BEFORE,r.CLOSE,t||e)}ac(e,t){return this.action(!t||!!e,r.AFTER,r.CLOSE,t||e)}clear(){return this.def.open.length=0,this.def.close.length=0,this.def.bo.length=0,this.def.ao.length=0,this.def.bc.length=0,this.def.ac.length=0,this}norm(){this.def.open.map(e=>k(e)),this.def.close.map(e=>k(e));const e=[];function t(e,t,n){return n[e]=n[e]||[],[function(e,n){if(n.s&&n.s[t]){let r=[...new Set(e.concat(n.s[t]))];e.length=0,e.push(...r)}return e},n[e][t]=n[e][t]||[]]}return this.def.open.reduce(...t(0,0,e)),this.def.open.reduce(...t(0,1,e)),this.def.close.reduce(...t(1,0,e)),this.def.close.reduce(...t(1,1,e)),this.def.tcol=e,this}process(e,t,n,l){t.log&&t.log(a.S.rule,t,e,n);let i="o"===l,s=i?e:t.NORULE,o=i?"O":"C",c=this.def,d=i?c.open:c.close,p=i?e.bo?c.bo:null:e.bc?c.bc:null;if(p){let n;for(let r=0;r<p.length;r++)if(n=p[r].call(this,e,t,s,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:i})}let h=0<d.length?function(e,t,n,l,i){let s=m;s.b=0,s.p=r.EMPTY,s.r=r.EMPTY,s.n=void 0,s.h=void 0,s.a=void 0,s.u=void 0,s.k=void 0,s.e=void 0;let o=null,c=0,u=!0,d=1<<i.cfg.t.AA-1,p=i.cfg.tokenSetTins.IGNORE;function f(e,t,r,l){let s;do{s=n.next(e,t,r,l),i.tC++}while(p[s.tin]);return s}let h=t.length;for(c=0;c<h;c++){o=t[c];let n=!1,r=!1;if(u=!0,o.S0){let e=(i.t0=i.NOTOKEN!==i.t0?i.t0:i.t0=f(l,o,c,0)).tin;if(n=!0,u=!!(o.S0[e/31|0]&(1<<e%31-1|d)),u&&(r=null!=o.S1,o.S1)){let e=(i.t1=i.NOTOKEN!==i.t1?i.t1:i.t1=f(l,o,c,1)).tin;r=!0,u=!!(o.S1[e/31|0]&(1<<e%31-1|d))}}if(e?(l.o0=n?i.t0:i.NOTOKEN,l.o1=r?i.t1:i.NOTOKEN,l.os=(n?1:0)+(r?1:0)):(l.c0=n?i.t0:i.NOTOKEN,l.c1=r?i.t1:i.NOTOKEN,l.cs=(n?1:0)+(r?1:0)),u&&o.c&&(u=u&&o.c(l,i,s)),u)break;o=null}u||(s.e=i.t0),o&&(s.n=null!=o.n?o.n:s.n,s.h=null!=o.h?o.h:s.h,s.a=null!=o.a?o.a:s.a,s.u=null!=o.u?o.u:s.u,s.k=null!=o.k?o.k:s.k,s.g=null!=o.g?o.g:s.g,s.e=o.e&&o.e(l,i,s)||void 0,s.p=null!=o.p&&!1!==o.p?"string"==typeof o.p?o.p:o.p(l,i,s):s.p,s.r=null!=o.r&&!1!==o.r?"string"==typeof o.r?o.r:o.r(l,i,s):s.r,s.b=null!=o.b&&!1!==o.b?"number"==typeof o.b?o.b:o.b(l,i,s):s.b);let g=c<t.length;return i.log&&i.log(a.S.parse,i,l,n,g,u,c,o,s),s}(i,d,n,e,t):f;if(h.h&&(h=h.h(e,t,h,s)||h,o+="H"),h.e)return this.bad(h.e,e,t,{is_open:i});if(h.n)for(let r in h.n)e.n[r]=0===h.n[r]?0:(null==e.n[r]?0:e.n[r])+h.n[r];if(h.u&&(e.use=Object.assign(e.use,h.u)),h.k&&(e.keep=Object.assign(e.keep,h.k)),h.a){o+="A";let n=h.a(e,t,h);if(n&&n.isToken&&n.err)return this.bad(n,e,t,{is_open:i})}if(h.p){t.rs[t.rsI++]=e;let n=t.rsm[h.p];if(!n)return this.bad(this.unknownRule(t.t0,h.p),e,t,{is_open:i});s=e.child=u(n,t,e.node),s.parent=e,s.n={...e.n},0<Object.keys(e.keep).length&&(s.keep={...e.keep}),o+="P`"+h.p+"`"}else if(h.r){let n=t.rsm[h.r];if(!n)return this.bad(this.unknownRule(t.t0,h.r),e,t,{is_open:i});s=u(n,t,e.node),s.parent=e.parent,s.prev=e,s.n={...e.n},0<Object.keys(e.keep).length&&(s.keep={...e.keep}),o+="R`"+h.r+"`"}else i||(s=t.rs[--t.rsI]||t.NORULE);let g=i?e.ao?c.ao:null:e.ac?c.ac:null;if(g){let n;for(let r=0;r<g.length;r++)if(n=g[r](e,t,s,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:i})}s.why=o,t.log&&t.log(a.S.node,t,e,n,s),r.OPEN===e.state&&(e.state=r.CLOSE);let k=e[i?"os":"cs"]-(h.b||0);return 1===k?(t.v2=t.v1,t.v1=t.t0,t.t0=t.t1,t.t1=t.NOTOKEN):2==k&&(t.v2=t.t1,t.v1=t.t0,t.t0=t.NOTOKEN,t.t1=t.NOTOKEN),s}bad(e,t,n,r){throw new a.JsonicError(e.err||a.S.unexpected,{...e.use,state:r.is_open?a.S.open:a.S.close},e,t,n)}unknownRule(e,t){return e.err="unknown_rule",e.use=e.use||{},e.use.rulename=t,e}}const g=(...e)=>new h(...e);function k(e){if(null!=e.c){let t=e.c.n,n=e.c.d;null==t&&null==n||(e.c=function(e){let r=!0;if(null!=t)for(let n in t)r=r&&(null==e.n[n]||e.n[n]<=(null==t[n]?0:t[n]));return null!=n&&(r=r&&e.d<=n),r},null!=t&&(e.c.n=t),null!=n&&(e.c.d=n))}if(r.STRING===typeof e.g?e.g=e.g.split(/\s*,\s*/):null==e.g&&(e.g=[]),e.g=e.g.sort(),e.s&&0!==e.s.length){const t=e=>e.flat().filter(e=>"number"==typeof e),n=(e,t)=>e.filter(e=>31*t<=e&&e<31*(t+1)),r=(e,t)=>e.reduce((e,n)=>1<<n-(31*t+1)|e,0),l=t([e.s[0]]),i=t([e.s[1]]),s=e;s.S0=0<l.length?new Array(Math.max(...l.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(l,e),e)):null,s.S1=0<i.length?new Array(Math.max(...i.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(i,e),e)):null}else e.s=null;return e.p||(e.p=null),e.r||(e.r=null),e.b||(e.b=null),e}o.makeRuleSpec=g;var v={};Object.defineProperty(v,"__esModule",{value:!0}),v.makeParser=v.makeRuleSpec=v.makeRule=void 0;const b=t({}),x=n({});Object.defineProperty(v,"makeRule",{enumerable:!0,get:function(){return o.makeRule}}),Object.defineProperty(v,"makeRuleSpec",{enumerable:!0,get:function(){return o.makeRuleSpec}});class y{constructor(e,t){this.rsm={},this.options=e,this.cfg=t}rule(e,t){if(null==e)return this.rsm;let n=this.rsm[e];if(null===t)delete this.rsm[e];else if(void 0!==t)return n=this.rsm[e]=this.rsm[e]||(0,o.makeRuleSpec)(this.cfg,{}),n=this.rsm[e]=t(this.rsm[e],this)||this.rsm[e],void(n.name=e);return n}start(e,t,n,l){let i,s=(0,x.makeToken)("#ZZ",(0,b.tokenize)("#ZZ",this.cfg),void 0,r.EMPTY,(0,x.makePoint)(-1)),a=(0,x.makeNoToken)(),c={uI:0,opts:this.options,cfg:this.cfg,meta:n||{},src:()=>e,root:()=>i,plgn:()=>t.internal().plugins,inst:()=>t,rule:{},sub:t.internal().sub,xs:-1,v2:s,v1:s,t0:a,t1:a,tC:-2,kI:-1,rs:[],rsI:0,rsm:this.rsm,log:void 0,F:(0,b.srcfmt)(this.cfg),use:{},NOTOKEN:a,NORULE:{}};c=(0,b.deep)(c,l);let u=(0,o.makeNoRule)(c);if(c.NORULE=u,c.rule=u,n&&b.S.function===typeof n.log&&(c.log=n.log),this.cfg.parse.prepare.forEach(e=>e(t,c,n)),""===e){if(this.cfg.lex.empty)return this.cfg.lex.emptyResult;throw new b.JsonicError(b.S.unexpected,{src:e},c.t0,u,c)}let d=(0,b.badlex)((0,x.makeLex)(c),(0,b.tokenize)("#BD",this.cfg),c),p=this.rsm[this.cfg.rule.start];if(null==p)return;let m=(0,o.makeRule)(p,c);i=m;let f=2*(0,b.keys)(this.rsm).length*d.src.length*2*c.cfg.rule.maxmul,h=0;for(;u!==m&&h<f;)c.kI=h,c.rule=m,c.log&&c.log("",c.kI+":"),c.sub.rule&&c.sub.rule.map(e=>e(m,c)),m=m.process(c,d),c.log&&c.log(b.S.stack,c,m,d),h++;if(s.tin!==d.next(m).tin)throw new b.JsonicError(b.S.unexpected,{},c.t0,u,c);const g=c.root().node;if(this.cfg.result.fail.includes(g))throw new b.JsonicError(b.S.unexpected,{},c.t0,u,c);return g}clone(e,t){let n=new y(e,t);return n.rsm=Object.keys(this.rsm).reduce((e,t)=>(e[t]=(0,b.filterRules)(this.rsm[t],this.cfg),e),{}),n.norm(),n}norm(){(0,b.values)(this.rsm).map(e=>e.norm())}}v.makeParser=(...e)=>new y(...e);var I={};function S(e){const{deep:t}=e.util,{OB:n,CB:r,OS:l,CS:i,CL:s,CA:o,TX:a,ST:c,ZZ:u}=e.token,{VAL:d,KEY:p}=e.tokenSet,m=(e,t)=>{if(!t.cfg.rule.finish)return t.t0.src="END_OF_SOURCE",t.t0},f=e=>{const t=e.o0,n=c===t.tin||a===t.tin?t.val:t.src;e.use.key=n};e.rule("val",e=>{e.bo(e=>e.node=void 0).open([{s:[n],p:"map",b:1,g:"map,json"},{s:[l],p:"list",b:1,g:"list,json"},{s:[d],g:"val,json"}]).close([{s:[u],g:"end,json"},{b:1,g:"more,json"}]).bc((e,t)=>{e.node=void 0===e.node?void 0===e.child.node?0===e.os?void 0:e.o0.resolveVal(e,t):e.child.node:e.node})}),e.rule("map",e=>{e.bo(e=>{e.node=Object.create(null)}).open([{s:[n,r],b:1,n:{pk:0},g:"map,json"},{s:[n],p:"pair",n:{pk:0},g:"map,json,pair"}]).close([{s:[r],g:"end,json"}])}),e.rule("list",e=>{e.bo(e=>{e.node=[]}).open([{s:[l,i],b:1,g:"list,json"},{s:[l],p:"elem",g:"list,elem,json"}]).close([{s:[i],g:"end,json"}])}),e.rule("pair",e=>{e.open([{s:[p,s],p:"val",u:{pair:!0},a:f,g:"map,pair,key,json"}]).bc((e,t)=>{e.use.pair&&(e.use.prev=e.node[e.use.key],e.node[e.use.key]=e.child.node)}).close([{s:[o],r:"pair",g:"map,pair,json"},{s:[r],b:1,g:"map,pair,json"}])}),e.rule("elem",e=>{e.open([{p:"val",g:"list,elem,val,json"}]).bc(e=>{!0!==e.use.done&&e.node.push(e.child.node)}).close([{s:[o],r:"elem",g:"list,elem,json"},{s:[i],b:1,g:"list,elem,json"}])});const h=(e,n)=>{let r=e.use.key,l=e.child.node;const i=e.use.prev;l=void 0===l?null:l,e.use.list&&n.cfg.safe.key&&("__proto__"===r||"constructor"===r)||(e.node[r]=null==i?l:n.cfg.map.merge?n.cfg.map.merge(i,l,e,n):n.cfg.map.extend?t(i,l):l)};e.rule("val",e=>{e.open([{s:[p,s],p:"map",b:2,n:{pk:1},g:"pair,jsonic"},{s:[d],g:"val,json"},{s:[[r,i]],b:1,c:e=>0<e.d,g:"val,imp,null,jsonic"},{s:[o],c:e=>0===e.d,p:"list",b:1,g:"list,imp,jsonic"},{s:[o],b:1,g:"list,val,imp,null,jsonic"},{s:[u],g:"jsonic"}],{append:!0,delete:[2]}).close([{s:[[r,i]],b:1,g:"val,json,close",e:(e,t)=>0===e.d?t.t0:void 0},{s:[o],c:{n:{dlist:0,dmap:0}},r:"list",u:{implist:!0},g:"list,val,imp,comma,jsonic"},{c:{n:{dlist:0,dmap:0}},r:"list",u:{implist:!0},g:"list,val,imp,space,jsonic",b:1},{s:[u],g:"jsonic"}],{append:!0,move:[1,-1]})}),e.rule("map",e=>{e.bo(e=>{e.n.dmap=1+(e.n.dmap?e.n.dmap:0)}).open([{s:[n,u],b:1,e:m,g:"end,jsonic"}]).open([{s:[p,s],p:"pair",b:2,g:"pair,list,val,imp,jsonic"}],{append:!0}).close([{s:[r],c:{n:{pk:0}},g:"end,json"},{s:[r],b:1,g:"path,jsonic"},{s:[[o,i,...d]],b:1,g:"end,path,jsonic"},{s:[u],e:m,g:"end,jsonic"}],{append:!0,delete:[0]})}),e.rule("list",e=>{e.bo(e=>{e.n.dlist=1+(e.n.dlist?e.n.dlist:0),e.prev.use.implist&&(e.node.push(e.prev.node),e.prev.node=e.node)}).open({c:e=>e.prev.use.implist,p:"elem"}).open([{s:[o],p:"elem",b:1,g:"list,elem,val,imp,jsonic"},{p:"elem",g:"list,elem.jsonic"}],{append:!0}).close([{s:[u],e:m,g:"end,jsonic"}],{append:!0})}),e.rule("pair",(e,t)=>{e.open([{s:[o],g:"map,pair,comma,jsonic"}],{append:!0}).bc((e,t)=>{e.use.pair&&h(e,t)}).close([{s:[r],c:{n:{pk:0}},b:1,g:"map,pair,json"},{s:[o,r],c:{n:{pk:0}},b:1,g:"map,pair,comma,jsonic"},{s:[o,u],g:"end,jsonic"},{s:[o],c:{n:{pk:0}},r:"pair",g:"map,pair,json"},{s:[o],c:{n:{dmap:1}},r:"pair",g:"map,pair,jsonic"},{s:[p],c:{n:{dmap:1}},r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[[r,o,i,...p]],b:1,g:"map,pair,imp,path,jsonic",c:e=>0<e.n.pk},{s:[i],e:e=>e.c0,g:"end,jsonic"},{s:[u],e:m,g:"map,pair,json"},{r:"pair",b:1,g:"map,pair,imp,jsonic"}],{append:!0,delete:[0,1]})}),e.rule("elem",(e,t)=>{e.open([{s:[o,o],b:2,u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[o],u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[p,s],e:t.cfg.list.property?void 0:(e,t)=>t.t0,p:"val",n:{pk:1,dmap:1},u:{done:!0,pair:!0,list:!0},a:f,g:"elem,pair,jsonic"}]).bc((e,t)=>{!0===e.use.pair&&(e.use.prev=e.node[e.use.key],h(e,t))}).close([{s:[o,[i,u]],b:1,g:"list,elem,comma,jsonic"},{s:[o],r:"elem",g:"list,elem,json"},{s:[i],b:1,g:"list,elem,json"},{s:[u],e:m,g:"list,elem,json"},{s:[r],e:e=>e.c0,g:"end,jsonic"},{r:"elem",b:1,g:"list,elem,imp,jsonic"}],{delete:[-1,-2]})})}Object.defineProperty(I,"__esModule",{value:!0}),I.makeJSON=I.grammar=void 0,I.grammar=S,I.makeJSON=function(e){let t=e.make({grammar$:!1,text:{lex:!1},number:{hex:!1,oct:!1,bin:!1,sep:null,exclude:/^00+/},string:{chars:'"',multiChars:"",allowUnknown:!1,escape:{v:null}},comment:{lex:!1},map:{extend:!1},lex:{empty:!1},rule:{finish:!1,include:"json"},result:{fail:[void 0,NaN]},tokenSet:{KEY:["#ST",null,null,null]}});return S(t),t};var j={exports:{}};Object.defineProperty(j.exports,"__esModule",{value:!0}),j.exports.root=j.exports.S=j.exports.EMPTY=j.exports.AFTER=j.exports.BEFORE=j.exports.CLOSE=j.exports.OPEN=j.exports.makeTextMatcher=j.exports.makeNumberMatcher=j.exports.makeCommentMatcher=j.exports.makeStringMatcher=j.exports.makeLineMatcher=j.exports.makeSpaceMatcher=j.exports.makeFixedMatcher=j.exports.makeParser=j.exports.makeLex=j.exports.makeRuleSpec=j.exports.makeRule=j.exports.makePoint=j.exports.makeToken=j.exports.make=j.exports.util=j.exports.JsonicError=j.exports.Jsonic=void 0,Object.defineProperty(j.exports,"OPEN",{enumerable:!0,get:function(){return r.OPEN}}),Object.defineProperty(j.exports,"CLOSE",{enumerable:!0,get:function(){return r.CLOSE}}),Object.defineProperty(j.exports,"BEFORE",{enumerable:!0,get:function(){return r.BEFORE}}),Object.defineProperty(j.exports,"AFTER",{enumerable:!0,get:function(){return r.AFTER}}),Object.defineProperty(j.exports,"EMPTY",{enumerable:!0,get:function(){return r.EMPTY}});const E=t({});Object.defineProperty(j.exports,"JsonicError",{enumerable:!0,get:function(){return E.JsonicError}}),Object.defineProperty(j.exports,"S",{enumerable:!0,get:function(){return E.S}});const O=n({});Object.defineProperty(j.exports,"makePoint",{enumerable:!0,get:function(){return O.makePoint}}),Object.defineProperty(j.exports,"makeToken",{enumerable:!0,get:function(){return O.makeToken}}),Object.defineProperty(j.exports,"makeLex",{enumerable:!0,get:function(){return O.makeLex}}),Object.defineProperty(j.exports,"makeFixedMatcher",{enumerable:!0,get:function(){return O.makeFixedMatcher}}),Object.defineProperty(j.exports,"makeSpaceMatcher",{enumerable:!0,get:function(){return O.makeSpaceMatcher}}),Object.defineProperty(j.exports,"makeLineMatcher",{enumerable:!0,get:function(){return O.makeLineMatcher}}),Object.defineProperty(j.exports,"makeStringMatcher",{enumerable:!0,get:function(){return O.makeStringMatcher}}),Object.defineProperty(j.exports,"makeCommentMatcher",{enumerable:!0,get:function(){return O.makeCommentMatcher}}),Object.defineProperty(j.exports,"makeNumberMatcher",{enumerable:!0,get:function(){return O.makeNumberMatcher}}),Object.defineProperty(j.exports,"makeTextMatcher",{enumerable:!0,get:function(){return O.makeTextMatcher}}),Object.defineProperty(j.exports,"makeRule",{enumerable:!0,get:function(){return v.makeRule}}),Object.defineProperty(j.exports,"makeRuleSpec",{enumerable:!0,get:function(){return v.makeRuleSpec}}),Object.defineProperty(j.exports,"makeParser",{enumerable:!0,get:function(){return v.makeParser}});const T={tokenize:E.tokenize,srcfmt:E.srcfmt,clone:E.clone,charset:E.charset,trimstk:E.trimstk,makelog:E.makelog,badlex:E.badlex,extract:E.extract,errinject:E.errinject,errdesc:E.errdesc,configure:E.configure,parserwrap:E.parserwrap,mesc:E.mesc,escre:E.escre,regexp:E.regexp,prop:E.prop,str:E.str,clean:E.clean,deep:E.deep,omap:E.omap,keys:E.keys,values:E.values,entries:E.entries};function N(e,t){let n=!0;if("jsonic"===e)n=!1;else if("json"===e)return(0,I.makeJSON)(M);e="string"==typeof e?{}:e;let r={parser:null,config:null,plugins:[],sub:{lex:void 0,rule:void 0},mark:Math.random()},i=(0,E.deep)({},t?{...t.options}:!1===(null==e?void 0:e.defaults$)?{}:l.defaults,e||{}),s=function(e,t,n){var r;if(E.S.string===typeof e){let l=s.internal();return((null===(r=o.parser)||void 0===r?void 0:r.start)?(0,E.parserwrap)(o.parser):l.parser).start(e,s,t,n)}return e},o=e=>{if(null!=e&&E.S.object===typeof e){(0,E.deep)(i,e),(0,E.configure)(s,r.config,i);let t=s.internal().parser;r.parser=t.clone(i,r.config)}return{...s.options}},a={token:e=>(0,E.tokenize)(e,r.config,s),tokenSet:e=>(0,E.findTokenSet)(e,r.config),fixed:e=>r.config.fixed.ref[e],options:(0,E.deep)(o,i),config:()=>(0,E.deep)(r.config),parse:s,use:function(e,t){if(E.S.function!==typeof e)throw new Error("Jsonic.use: the first argument must be a function defining a plugin. See https://jsonic.senecajs.org/plugin");const n=e.name.toLowerCase(),r=(0,E.deep)({},e.defaults||{},t||{});s.options({plugin:{[n]:r}});let l=s.options.plugin[n];return s.internal().plugins.push(e),e.options=l,e(s,l)||s},rule:(e,t)=>s.internal().parser.rule(e,t)||s,make:e=>N(e,s),empty:e=>N({defaults$:!1,standard$:!1,grammar$:!1,...e||{}}),id:"Jsonic/"+Date.now()+"/"+(""+Math.random()).substring(2,8).padEnd(6,"0")+(null==o.tag?"":"/"+o.tag),toString:()=>a.id,sub:e=>(e.lex&&(r.sub.lex=r.sub.lex||[],r.sub.lex.push(e.lex)),e.rule&&(r.sub.rule=r.sub.rule||[],r.sub.rule.push(e.rule)),s),util:T};if((0,E.defprop)(a.make,E.S.name,{value:E.S.make}),n?(0,E.assign)(s,a):(0,E.assign)(s,{empty:a.empty,parse:a.parse,sub:a.sub,id:a.id,toString:a.toString}),(0,E.defprop)(s,"internal",{value:()=>r}),t){for(let n in t)void 0===s[n]&&(s[n]=t[n]);s.parent=t;let e=t.internal();r.config=(0,E.deep)({},e.config),(0,E.configure)(s,r.config,i),(0,E.assign)(s.token,r.config.t),r.plugins=[...e.plugins],r.parser=e.parser.clone(i,r.config)}else{let e={...s,...a};r.config=(0,E.configure)(e,void 0,i),r.plugins=[],r.parser=(0,v.makeParser)(i,r.config),!1!==i.grammar$&&(0,I.grammar)(e)}return s}let M;j.exports.util=T,j.exports.make=N,j.exports.root=M;let P=j.exports.root=M=N("jsonic");return j.exports.Jsonic=P,M.Jsonic=M,M.JsonicError=E.JsonicError,M.makeLex=O.makeLex,M.makeParser=v.makeParser,M.makeToken=O.makeToken,M.makePoint=O.makePoint,M.makeRule=v.makeRule,M.makeRuleSpec=v.makeRuleSpec,M.makeFixedMatcher=O.makeFixedMatcher,M.makeSpaceMatcher=O.makeSpaceMatcher,M.makeLineMatcher=O.makeLineMatcher,M.makeStringMatcher=O.makeStringMatcher,M.makeCommentMatcher=O.makeCommentMatcher,M.makeNumberMatcher=O.makeNumberMatcher,M.makeTextMatcher=O.makeTextMatcher,M.OPEN=r.OPEN,M.CLOSE=r.CLOSE,M.BEFORE=r.BEFORE,M.AFTER=r.AFTER,M.EMPTY=r.EMPTY,M.util=T,M.make=N,M.S=E.S,j.exports.default=P,j.exports=P,j.exports}))}).call(this)}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),e=e.exports;var n={};Object.defineProperty(n,"__esModule",{value:!0}),n.Hoover=n.parseToEnd=void 0;const r=(t,n)=>{var r;const{entries:s}=t.util;let o=s(n.block).map(e=>({allowUnknownEscape:!0,preserveEscapeChar:!1,token:"#HV",...e[1],name:e[0]})),a={};for(let e of o)e.TOKEN=t.token(e.token),a[e.token]||t.rule("val",t=>{t.open({s:[e.TOKEN],a:n.action})}),a[e.token]=e.TOKEN;t.options({lex:{match:{hoover:{order:null===(r=n.lex)||void 0===r?void 0:r.order,make:(t,n)=>function(n){for(let r of o){const s=(0,e.makePoint)(n.pnt.len,n.pnt.sI,n.pnt.rI,n.pnt.cI);if(l(n,s,r).match){let e=i(n,s,r,t);if(e.done){let t=n.token(r.TOKEN,e.val,n.src.substring(n.pnt.sI,s.sI),s);return t.use={block:r.name},n.pnt.sI=s.sI,n.pnt.rI=s.rI,n.pnt.cI=s.cI,t}return e.bad||n.bad("invalid_text",n.pnt.sI,s.sI)}}}}}}})};function l(e,t,n){let r=e.src,l=t.sI,i=t.rI,s=t.cI,o=n.start||{},a=o.rule||{},c=null;a.parent&&(a.parent.include&&(c=a.parent.include.includes(e.ctx.rule.parent.name)&&(null===c||c)),a.parent.exclude&&(c=!a.parent.exclude.includes(e.ctx.rule.parent.name)&&(null===c||c))),a.current&&(a.current.include&&(c=a.current.include.includes(e.ctx.rule.name)&&(null===c||c)),a.current.exclude&&(c=!a.current.exclude.includes(e.ctx.rule.name)&&(null===c||c)));let u=""===a.state?"":a.state||"o";u&&(c=u.includes(e.ctx.rule.state)&&(null===c||c));let d=!0,p=o.fixed;if(c&&null!=p){d=!1,p=Array.isArray(p)?p:[p];for(let e=0;!d&&e<p.length;e++)if(r.substring(t.sI).startsWith(p[e])){if(d=!0,!1!==o.consume&&(!Array.isArray(o.consume)||o.consume.includes(p[e]))){let n=t.sI+p[e].length;for(let e=t.sI;e<n;e++)l++,s++,"\n"===r[e]&&(i++,s=0)}break}}if(c&&d){let e=r.substring(t.sI,l);return!1!==n.trim&&(e=e.trim()),t.sI=l,t.rI=i,t.cI=s,{match:!0,start:e}}return{match:!1}}function i(e,t,n,r){let l=[],i=e.src,s=n.end,o=s.fixed;o="string"==typeof o?[o]:o;let a=o.map(e=>e[0]),c=o.map(e=>e.substring(1)),u=n.escapeChar,d=t.sI,p=t.rI,m=t.cI,f=!1,h="",g=d,k=0;e:do{if(h=i[d],-1<(k=a.indexOf(h))){let e=c[k];if(void 0===e||""===e){g=d+1,f=!0;break e}if("string"==typeof e&&e===i.substring(d+1,d+1+e.length)){g=d+1+e.length,f=!0;break e}}if(u===h){let t=n.escape[i[d+1]];if(null!=t)h=t,d++,m++;else{if(!n.allowUnknownEscape)return{done:!1,val:"",bad:e.bad("invalid_escape",d,d+1)};h=n.preserveEscapeChar?i.substring(d,d+2):i[d+1],d++}}l.push(h),d++,m++,"\n"===h&&(p++,m=0)}while(d<=i.length);if(f){if(!1!==s.consume){let e=i.substring(d,g);if(!Array.isArray(s.consume)||s.consume.includes(e)){let e=d;for(;e<g;e++)d++,m++,"\n"===i[e]&&(p++,m=0)}}t.sI=d,t.rI=p,t.cI=m}let v=l.join("");return n.trim&&(v=v.trim()),r.value.lex&&void 0!==r.value.def[v]&&(v=r.value.def[v].val),{done:f,val:v}}return n.Hoover=r,n.parseToEnd=i,r.defaults={block:{},lex:{order:45e5}},n}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),e=e.exports;var t={};return Object.defineProperty(t,"__esModule",{value:!0}),t.Ini=void 0,t.Ini=function(t,n){t.use(e.Hoover,{lex:{order:85e5},block:{endofline:{start:{rule:{parent:{include:["pair","elem"]}}},end:{fixed:["\n","\r\n","#",";",""],consume:["\n","\r\n"]},escapeChar:"\\",escape:{"#":"#",";":";","\\":"\\"},preserveEscapeChar:!0,trim:!0},key:{token:"#HK",start:{rule:{current:{exclude:["dive"]},state:"oc"}},end:{fixed:["=","\n","\r\n","#",";",""],consume:!1},escape:{"#":"#",";":";","\\":"\\"},trim:!0},divekey:{token:"#DK",start:{rule:{current:{include:["dive"]}}},end:{fixed:["]","."],consume:!1},escapeChar:"\\",escape:{"]":"]",".":".","\\":"\\"},allowUnknownEscape:!0,trim:!0}}}),t.options({rule:{start:"ini",exclude:"jsonic"},lex:{emptyResult:{}},fixed:{token:{"#EQ":"=","#DOT":".","#OB":null,"#CB":null,"#CL":null}},line:{check:e=>{if("val"===e.ctx.rule.name)return{done:!0,token:void 0}}},number:{lex:!1},string:{lex:!0,chars:"'\"",abandon:!0},text:{lex:!1},comment:{def:{hash:{eatline:!0},slash:null,multi:null,semi:{line:!0,start:";",lex:!0,eatline:!0}}}});const{ZZ:r,ST:l,VL:i,OS:s,CS:o,CL:a,EQ:c,DOT:u,HV:d,HK:p,DK:m}=t.token,f=[p,l,i];t.rule("ini",e=>{e.bo(e=>{e.node={}}).open([{s:[s],p:"table",b:1},{s:[f,c],p:"table",b:2},{s:[d,s],p:"table",b:2},{s:[r]}])}),t.rule("table",e=>{e.bo(e=>{if(e.node=e.parent.node,e.prev.use.dive){let t=e.prev.use.dive;for(let n=0;n<t.length;n++)e.node=e.node[t[n]]=e.node[t[n]]||{}}}).open([{s:[s],p:"dive"},{s:[f,c],p:"map",b:2},{s:[d,s],p:"map",b:2},{s:[o],p:"map"},{s:[r]}]).bc(e=>{Object.assign(e.node,e.child.node)}).close([{s:[s],r:"table",b:1},{s:[o],r:"table",a:e=>e.use.dive=e.child.use.dive},{s:[r]}])}),t.rule("dive",e=>{e.open([{s:[m,u],a:e=>(e.use.dive=e.parent.use.dive||[]).push(e.o0.val),p:"dive"},{s:[m],a:e=>(e.use.dive=e.parent.use.dive||[]).push(e.o0.val)}]).close([{s:[o],b:1}])}),t.rule("map",e=>{e.open([{s:[f,c],c:e=>"table"===e.parent.name,p:"pair",b:2},{s:[f],c:e=>"table"===e.parent.name,p:"pair",b:1}],{append:!0}).close([{s:[s],b:1},{s:[r]}])}),t.rule("pair",e=>{e.open([{s:[f,c],c:e=>"table"===e.parent.parent.name,p:"val",a:e=>{let t=""+e.o0.val;Array.isArray(e.node[t])?e.use.ini_array=e.node[t]:(e.use.key=t,2<t.length&&t.endsWith("[]")?(t=e.use.key=t.slice(0,-2),e.node[t]=e.use.ini_array=Array.isArray(e.node[t])?e.node[t]:void 0===e.node[t]?[]:[e.node[t]]):e.use.pair=!0)}},{s:[p],c:e=>"table"===e.parent.parent.name,a:e=>{let t=e.o0.val;"string"==typeof t&&0<t.length&&(e.parent.node[t]=!0)}}]).close([{s:[f,a],c:e=>"table"===e.parent.parent.name,e:e=>e.c1},{s:[f],b:1,r:"pair"},{s:[s],b:1}])}),t.rule("val",e=>{e.open([{s:[[s,o]],r:"val",u:{ini_prev:!0}},{s:[r],a:e=>e.node=""}],{custom:e=>e.filter(e=>"json,list"!==e.g.join())}).ac(e=>{if(l===e.o0.tin&&"'"===e.o0.src[0])try{e.node=JSON.parse(e.node)}catch(t){}null!=e.prev.use.ini_prev?e.prev.node=e.node=e.prev.o0.src+e.node:e.parent.use.ini_array&&e.parent.use.ini_array.push(e.node)})})},t}));
1
+ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JsonicIni=e()}}((function(){var e={exports:{}};(function(t){(function(){!function(n){"object"==typeof e.exports?e.exports=n():("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).JsonicHoover=n()}((function(){var e={exports:{}};(function(t){(function(){!function(n){"object"==typeof e.exports?e.exports=n():("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).Jsonic=n()}((function(){var e=function(e){var t;return function(n){return t||e(t={exports:{},parent:n},t.exports),t.exports}},t=e((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modlist=t.findTokenSet=t.values=t.keys=t.omap=t.str=t.prop=t.parserwrap=t.trimstk=t.tokenize=t.srcfmt=t.snip=t.regexp=t.mesc=t.makelog=t.isarr=t.filterRules=t.extract=t.escre=t.errinject=t.errdesc=t.entries=t.defprop=t.deep=t.configure=t.clone=t.clean=t.charset=t.badlex=t.assign=t.S=t.JsonicError=void 0;const l=n({}),i=e=>null==e?[]:Object.keys(e);t.keys=i;const s=e=>null==e?[]:Object.values(e);t.values=s;const o=e=>null==e?[]:Object.entries(e);t.entries=o;const a=(e,...t)=>Object.assign(null==e?{}:e,...t);t.assign=a,t.isarr=e=>Array.isArray(e);const c=Object.defineProperty;t.defprop=c;const u=(e,t)=>Object.entries(e||{}).reduce((e,n)=>{let r=t?t(n):n;void 0===r[0]?delete e[n[0]]:e[r[0]]=r[1];let l=2;for(;void 0!==r[l];)e[r[l]]=r[l+1],l+=2;return e},{});t.omap=u;const d={indent:". ",logindent:" ",space:" ",gap:" ",Object:"Object",Array:"Array",object:"object",string:"string",function:"function",unexpected:"unexpected",map:"map",list:"list",elem:"elem",pair:"pair",val:"val",node:"node",no_re_flags:r.EMPTY,unprintable:"unprintable",invalid_ascii:"invalid_ascii",invalid_unicode:"invalid_unicode",invalid_lex_state:"invalid_lex_state",unterminated_string:"unterminated_string",unterminated_comment:"unterminated_comment",lex:"lex",parse:"parse",error:"error",none:"none",imp_map:"imp,map",imp_list:"imp,list",imp_null:"imp,null",end:"end",open:"open",close:"close",rule:"rule",stack:"stack",nUll:"null",name:"name",make:"make",colon:":"};t.S=d;class p extends SyntaxError{constructor(e,t,n,r,l){let i=x(e,t=g({},t),n,r,l);super(i.message),a(this,i),v(this)}toJSON(){return{...this,__error:!0,name:this.name,message:this.message,stack:this.stack}}}function m(e,t,n){let l=t.t,i=l[e];return null==i&&r.STRING===typeof e&&(i=t.tI++,l[i]=e,l[e]=i,l[e.substring(1)]=i,null!=n&&a(n.token,t.t)),i}function f(e,...t){return new RegExp(t.map(e=>e.esc?h(e.toString()):e).join(r.EMPTY),null==e?"":e)}function h(e){return null==e?"":e.replace(/[-\\|\]{}()[^$+*?.!=]/g,"\\$&").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n")}function g(e,...t){let n=d.function===typeof e,r=null!=e&&(d.object===typeof e||n);for(let l of t){let t,i=d.function===typeof l,s=null!=l&&(d.object===typeof l||i);if(r&&s&&!i&&Array.isArray(e)===Array.isArray(l))for(let n in l)e[n]=g(e[n],l[n]);else e=void 0===l?e:i?l:s?d.function===typeof(t=l.constructor)&&d.Object!==t.name&&d.Array!==t.name?l:g(Array.isArray(l)?[]:{},l):l,n=d.function===typeof e,r=null!=e&&(d.object===typeof e||n)}return e}function k(e,t,n,r,l,i){let s={code:t,details:n,token:r,rule:l,ctx:i};return null==e?"":e.replace(/\$(\{?)([\w_0-9]+)(\}?)/g,(e,t,o,a)=>{let c=null!=s[o]?s[o]:null!=n[o]?n[o]:i.meta&&null!=i.meta[o]?i.meta[o]:null!=r[o]?r[o]:null!=l[o]?l[o]:null!=i.opts[o]?i.opts[o]:null!=i.cfg[o]?i.cfg[o]:null!=i[o]?i[o]:"$"+o,u=t&&a?c:JSON.stringify(c);return u=null==u?"":u,u.replace(/\n/g,"\n ")})}function v(e){e.stack&&(e.stack=e.stack.split("\n").filter(e=>!e.includes("jsonic/jsonic")).map(e=>e.replace(/ at /,"at ")).join("\n"))}function b(e,t,n){let l=0<n.sI?n.sI:0,i=0<n.rI?n.rI:1,s=0<n.cI?n.cI:1,o=null==n.src?r.EMPTY:n.src,a=e.substring(Math.max(0,l-333),l).split("\n"),c=e.substring(l,l+333).split("\n"),u=2+(r.EMPTY+(i+2)).length,d=i<3?1:i-2,p=e=>"\x1b[34m"+(r.EMPTY+d++).padStart(u," ")+" | \x1b[0m"+(null==e?r.EMPTY:e),m=a.length;return[2<m?p(a[m-3]):null,1<m?p(a[m-2]):null,p(a[m-1]+c[0])," ".repeat(u)+" "+" ".repeat(s-1)+"\x1b[31m"+"^".repeat(o.length||1)+" "+t+"\x1b[0m",p(c[1]),p(c[2])].filter(e=>null!=e).join("\n")}function x(e,t,n,r,l){var i,s,o;try{let a=l.cfg,c=l.meta,u=k(a.error[e]||(null===(i=null==t?void 0:t.use)||void 0===i?void 0:i.err)&&(t.use.err.code||t.use.err.message)||a.error.unknown,e,t,n,r,l);d.function===typeof a.hint&&(a.hint={...a.hint(),...a.hint});let p=["\x1b[31m[jsonic/"+e+"]:\x1b[0m "+u," \x1b[34m--\x3e\x1b[0m "+(c&&c.fileName||"<no-file>")+":"+n.rI+":"+n.cI,b(l.src(),u,n),"",k((a.hint[e]||(null===(o=null===(s=t.use)||void 0===s?void 0:s.err)||void 0===o?void 0:o.message)||a.hint.unknown||"").trim().split("\n").map(e=>" "+e).join("\n"),e,t,n,r,l),""," \x1b[2mhttps://jsonic.senecajs.org\x1b[0m"," \x1b[2m--internal: rule="+r.name+"~"+r.state+"; token="+m(n.tin,l.cfg)+(null==n.why?"":"~"+n.why)+"; plugins="+l.plgn().map(e=>e.name).join(",")+"--\x1b[0m\n"].join("\n"),f={internal:{token:n,ctx:l}};return f={...Object.create(f),message:p,code:e,details:t,meta:c,fileName:c?c.fileName:void 0,lineNumber:n.rI,columnNumber:n.cI},f}catch(a){return console.log(a),{}}}function y(e){return"function"==typeof e.debug.print.src?e.debug.print.src:t=>{let n=null==t?r.EMPTY:Array.isArray(t)?JSON.stringify(t).replace(/]$/,o(t).filter(e=>isNaN(e[0])).map((e,t)=>(0===t?", ":"")+e[0]+": "+JSON.stringify(e[1]))+"]"):JSON.stringify(t);return n=n.substring(0,e.debug.maxlen)+(e.debug.maxlen<n.length?"...":r.EMPTY),n}}function I(e,t=44){let n;try{n="object"==typeof e?JSON.stringify(e):""+e}catch(r){n=""+e}return S(t<n.length?n.substring(0,t-3)+"...":n,t)}function S(e,t=5){return void 0===e?"":(""+e).substring(0,t).replace(/[\r\n\t]/g,".")}function j(...e){return null==e?{}:e.filter(e=>!1!==e).map(e=>"object"==typeof e?i(e).join(r.EMPTY):e).join(r.EMPTY).split(r.EMPTY).reduce((e,t)=>(e[t]=t.charCodeAt(0),e),{})}function E(e){for(let t in e)null==e[t]&&delete e[t];return e}t.JsonicError=p,t.configure=function(e,t,n){var r,l,c,d,p,g,k,v,b,x,y,I,S,O,T,N,M,P,C,w,_,R,A,L,Y,U,$,F,J,K,B,D,V,H,z,Z,G,W,q,X,Q,ee,te,ne,re,le,ie,se,oe,ae;const ce=t||{};ce.t=ce.t||{},ce.tI=ce.tI||1;const ue=e=>m(e,ce);!1!==n.standard$&&(ue("#BD"),ue("#ZZ"),ue("#UK"),ue("#AA"),ue("#SP"),ue("#LN"),ue("#CM"),ue("#NR"),ue("#ST"),ue("#TX"),ue("#VL")),ce.safe={key:!1!==(null===(r=n.safe)||void 0===r?void 0:r.key)},ce.fixed={lex:!!(null===(l=n.fixed)||void 0===l?void 0:l.lex),token:n.fixed?u(E(n.fixed.token),([e,t])=>[t,m(e,ce)]):{},ref:void 0,check:null===(c=n.fixed)||void 0===c?void 0:c.check},ce.fixed.ref=u(ce.fixed.token,([e,t])=>[e,t]),ce.fixed.ref=Object.assign(ce.fixed.ref,u(ce.fixed.ref,([e,t])=>[t,e])),ce.match={lex:!!(null===(d=n.match)||void 0===d?void 0:d.lex),value:n.match?u(E(n.match.value),([e,t])=>[e,t]):{},token:n.match?u(E(n.match.token),([e,t])=>[m(e,ce),t]):{},check:null===(p=n.match)||void 0===p?void 0:p.check},u(ce.match.token,([e,t])=>[e,(t.tin$=+e,t)]);const de=n.tokenSet?Object.keys(n.tokenSet).reduce((e,t)=>(e[t]=n.tokenSet[t].filter(e=>null!=e).map(e=>ue(e)),e),{}):{};ce.tokenSet=ce.tokenSet||{},o(de).map(e=>{let t=e[0],n=e[1];ce.tokenSet[t]?(ce.tokenSet[t].length=0,ce.tokenSet[t].push(...n)):ce.tokenSet[t]=n}),ce.tokenSetTins=o(ce.tokenSet).reduce((e,t)=>(e[t[0]]=e[t[0]]||{},t[1].map(n=>e[t[0]][n]=!0),e),{}),ce.tokenSetTins.IGNORE=ce.tokenSetTins.IGNORE||{},ce.space={lex:!!(null===(g=n.space)||void 0===g?void 0:g.lex),chars:j(null===(k=n.space)||void 0===k?void 0:k.chars),check:null===(v=n.space)||void 0===v?void 0:v.check},ce.line={lex:!!(null===(b=n.line)||void 0===b?void 0:b.lex),chars:j(null===(x=n.line)||void 0===x?void 0:x.chars),rowChars:j(null===(y=n.line)||void 0===y?void 0:y.rowChars),single:!!(null===(I=n.line)||void 0===I?void 0:I.single),check:null===(S=n.line)||void 0===S?void 0:S.check},ce.text={lex:!!(null===(O=n.text)||void 0===O?void 0:O.lex),modify:((null===(T=ce.text)||void 0===T?void 0:T.modify)||[]).concat(([null===(N=n.text)||void 0===N?void 0:N.modify]||[]).flat()).filter(e=>null!=e),check:null===(M=n.text)||void 0===M?void 0:M.check},ce.number={lex:!!(null===(P=n.number)||void 0===P?void 0:P.lex),hex:!!(null===(C=n.number)||void 0===C?void 0:C.hex),oct:!!(null===(w=n.number)||void 0===w?void 0:w.oct),bin:!!(null===(_=n.number)||void 0===_?void 0:_.bin),sep:null!=(null===(R=n.number)||void 0===R?void 0:R.sep)&&""!==n.number.sep,exclude:null===(A=n.number)||void 0===A?void 0:A.exclude,sepChar:null===(L=n.number)||void 0===L?void 0:L.sep,check:null===(Y=n.number)||void 0===Y?void 0:Y.check},ce.value={lex:!!(null===(U=n.value)||void 0===U?void 0:U.lex),def:o((null===($=n.value)||void 0===$?void 0:$.def)||{}).reduce((e,t)=>(null==t[1]||!1===t[1]||t[1].match||(e[t[0]]=t[1]),e),{}),defre:o((null===(F=n.value)||void 0===F?void 0:F.def)||{}).reduce((e,t)=>(t[1]&&t[1].match&&(e[t[0]]=t[1],e[t[0]].consume=!!e[t[0]].consume),e),{})},ce.rule={start:null==(null===(J=n.rule)||void 0===J?void 0:J.start)?"val":n.rule.start,maxmul:null==(null===(K=n.rule)||void 0===K?void 0:K.maxmul)?3:n.rule.maxmul,finish:!!(null===(B=n.rule)||void 0===B?void 0:B.finish),include:(null===(D=n.rule)||void 0===D?void 0:D.include)?n.rule.include.split(/\s*,+\s*/).filter(e=>""!==e):[],exclude:(null===(V=n.rule)||void 0===V?void 0:V.exclude)?n.rule.exclude.split(/\s*,+\s*/).filter(e=>""!==e):[]},ce.map={extend:!!(null===(H=n.map)||void 0===H?void 0:H.extend),merge:null===(z=n.map)||void 0===z?void 0:z.merge},ce.list={property:!!(null===(Z=n.list)||void 0===Z?void 0:Z.property)};let pe=Object.keys(ce.fixed.token).sort((e,t)=>t.length-e.length).map(e=>h(e)).join("|"),me=(null===(G=n.comment)||void 0===G?void 0:G.lex)?(n.comment.def?s(n.comment.def):[]).filter(e=>e&&e.lex).map(e=>h(e.start)).join("|"):"",fe=["([",h(i(j(ce.space.lex&&ce.space.chars,ce.line.lex&&ce.line.chars)).join("")),"]",("string"==typeof n.ender?n.ender.split(""):Array.isArray(n.ender)?n.ender:[]).map(e=>"|"+h(e)).join(""),""===pe?"":"|",pe,""===me?"":"|",me,"|$)"];return ce.rePart={fixed:pe,ender:fe,commentStart:me},ce.re={ender:f(null,...fe),rowChars:f(null,h(null===(W=n.line)||void 0===W?void 0:W.rowChars)),columns:f(null,"["+h(null===(q=n.line)||void 0===q?void 0:q.chars)+"]","(.*)$")},ce.lex={empty:!!(null===(X=n.lex)||void 0===X?void 0:X.empty),emptyResult:null===(Q=n.lex)||void 0===Q?void 0:Q.emptyResult,match:(null===(ee=n.lex)||void 0===ee?void 0:ee.match)?o(n.lex.match).reduce((e,t)=>{let r=t[0],l=t[1];if(l){let t=l.make(ce,n);t&&(t.matcher=r,t.make=l.make,t.order=l.order),e.push(t)}return e},[]).filter(e=>null!=e&&!1!==e&&-1<+e.order).sort((e,t)=>e.order-t.order):[]},ce.parse={prepare:s(null===(te=n.parse)||void 0===te?void 0:te.prepare)},ce.debug={get_console:(null===(ne=n.debug)||void 0===ne?void 0:ne.get_console)||(()=>console),maxlen:null==(null===(re=n.debug)||void 0===re?void 0:re.maxlen)?99:n.debug.maxlen,print:{config:!!(null===(ie=null===(le=n.debug)||void 0===le?void 0:le.print)||void 0===ie?void 0:ie.config),src:null===(oe=null===(se=n.debug)||void 0===se?void 0:se.print)||void 0===oe?void 0:oe.src}},ce.error=n.error||{},ce.hint=n.hint||{},(null===(ae=n.config)||void 0===ae?void 0:ae.modify)&&i(n.config.modify).forEach(e=>n.config.modify[e](ce,n)),ce.debug.print.config&&ce.debug.get_console().dir(ce,{depth:null}),ce.result={fail:[]},n.result&&(ce.result.fail=[...n.result.fail]),a(e.options,n),a(e.token,ce.t),a(e.tokenSet,ce.tokenSet),a(e.fixed,ce.fixed.ref),ce},t.tokenize=m,t.findTokenSet=function(e,t){return t.tokenSet[e]},t.mesc=function(e,t){return(t=new String(e)).esc=!0,t},t.regexp=f,t.escre=h,t.deep=g,t.errinject=k,t.trimstk=v,t.extract=b,t.errdesc=x,t.badlex=function(e,t,n){let r=e.next.bind(e);return e.next=(e,l,i,s)=>{let o=r(e,l,i,s);if(t===o.tin){let t={};throw null!=o.use&&(t.use=o.use),new p(o.why||d.unexpected,t,o,e,n)}return o},e},t.makelog=function(e,t){var n,r,l;let i=null===(l=null===(r=null===(n=e.opts)||void 0===n?void 0:n.plugin)||void 0===r?void 0:r.debug)||void 0===l?void 0:l.trace;if(t||i)if("number"==typeof(null==t?void 0:t.log)||i){let n=!1,r=null==t?void 0:t.log;(-1===r||i)&&(r=1,n=!0),e.log=(...t)=>{if(n){let n=t.filter(e=>d.object!=typeof e).map(e=>d.function==typeof e?e.name:e).join(d.gap);e.cfg.debug.get_console().log(n)}else e.cfg.debug.get_console().dir(t,{depth:r})}}else"function"==typeof t.log&&(e.log=t.log);return e.log},t.srcfmt=y,t.str=I,t.snip=S,t.clone=function(e){return g(Object.create(Object.getPrototypeOf(e)),e)},t.charset=j,t.clean=E,t.filterRules=function(e,t){let n=["open","close"];for(let r of n)e.def[r]=e.def[r].map(e=>(e.g="string"==typeof e.g?(e.g||"").split(/\s*,+\s*/):e.g||[],e)).filter(e=>t.rule.include.reduce((t,n)=>t||null!=e.g&&-1!==e.g.indexOf(n),0===t.rule.include.length)).filter(e=>t.rule.exclude.reduce((t,n)=>t&&(null==e.g||-1===e.g.indexOf(n)),!0));return e},t.prop=function(e,t,n){let r=e;try{let r,l=t.split(".");for(let t=0;t<l.length;t++)r=l[t],t<l.length-1&&(e=e[r]=e[r]||{});return void 0!==n&&(e[r]=n),e[r]}catch(l){throw new Error("Cannot "+(void 0===n?"get":"set")+" path "+t+" on object: "+I(r)+(void 0===n?"":" to value: "+I(n,22)))}},t.modlist=function(e,t){if(t&&e){if(0<e.length){if(t.delete&&0<t.delete.length)for(let r=0;r<t.delete.length;r++){let n=t.delete[r];(n<0?-1*n<=e.length:n<e.length)&&(e[(e.length+n)%e.length]=null)}if(t.move)for(let r=0;r<t.move.length;r+=2){let n=(e.length+t.move[r])%e.length,l=(e.length+t.move[r+1])%e.length,i=e[n];e.splice(n,1),e.splice(l,0,i)}let n=e.filter(e=>null!=e);n.length!==e.length&&(e.length=0,e.push(...n))}if(t.custom){let n=t.custom(e);null!=n&&(e=n)}}return e},t.parserwrap=function(e){return{start:function(t,n,i,s){try{return e.start(t,n,i,s)}catch(o){if("SyntaxError"===o.name){let s=0,a=0,c=0,u=r.EMPTY,d=o.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);if(d){u=d[1],s=parseInt(d[2]),a=t.substring(0,s).replace(/[^\n]/g,r.EMPTY).length;let e=s-1;for(;-1<e&&"\n"!==t.charAt(e);)e--;c=Math.max(t.substring(e,s).length,0)}let f=o.token||(0,l.makeToken)("#UK",m("#UK",n.internal().config),void 0,u,(0,l.makePoint)(u.length,s,o.lineNumber||a,o.columnNumber||c));throw new p(o.code||"json",o.details||{msg:o.message},f,{},o.ctx||{uI:-1,opts:n.options,cfg:n.internal().config,token:f,meta:i,src:()=>t,root:()=>{},plgn:()=>n.internal().plugins,inst:()=>n,rule:{name:"no-rule"},sub:{},xs:-1,v2:f,v1:f,t0:f,t1:f,tC:-1,kI:-1,rs:[],rsI:0,rsm:{},n:{},log:i?i.log:void 0,F:y(n.internal().config),u:{},NORULE:{name:"no-rule"},NOTOKEN:{name:"no-token"}})}throw o}}}}})),n=e((function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeTextMatcher=n.makeNumberMatcher=n.makeCommentMatcher=n.makeStringMatcher=n.makeLineMatcher=n.makeSpaceMatcher=n.makeFixedMatcher=n.makeMatchMatcher=n.makeToken=n.makePoint=n.makeLex=n.makeNoToken=void 0;const l=t({});class i{constructor(e,t,n,r){this.len=-1,this.sI=0,this.rI=1,this.cI=1,this.token=[],this.len=e,null!=t&&(this.sI=t),null!=n&&(this.rI=n),null!=r&&(this.cI=r)}toString(){return"Point["+[this.sI+"/"+this.len,this.rI,this.cI]+(0<this.token.length?" "+this.token:"")+"]"}[r.INSPECT](){return this.toString()}}const s=(...e)=>new i(...e);n.makePoint=s;class o{constructor(e,t,n,l,i,s,o){this.isToken=!0,this.name=r.EMPTY,this.tin=-1,this.val=void 0,this.src=r.EMPTY,this.sI=-1,this.rI=-1,this.cI=-1,this.len=-1,this.name=e,this.tin=t,this.src=l,this.val=n,this.sI=i.sI,this.rI=i.rI,this.cI=i.cI,this.use=s,this.why=o,this.len=null==l?0:l.length}resolveVal(e,t){return"function"==typeof this.val?this.val(e,t):this.val}bad(e,t){return this.err=e,null!=t&&(this.use=(0,l.deep)(this.use||{},t)),this}toString(){return"Token["+this.name+"="+this.tin+" "+(0,l.snip)(this.src)+(void 0===this.val||"#ST"===this.name||"#TX"===this.name?"":"="+(0,l.snip)(this.val))+" "+[this.sI,this.rI,this.cI]+(null==this.use?"":" "+(0,l.snip)(""+JSON.stringify(this.use).replace(/"/g,""),22))+(null==this.err?"":" "+this.err)+(null==this.why?"":" "+(0,l.snip)(""+this.why,22))+"]"}[r.INSPECT](){return this.toString()}}const a=(...e)=>new o(...e);function c(e,t,n){let r=e.pnt,l=t;if(e.cfg.fixed.lex&&null!=n&&0<n.length){let i,s=e.cfg.fixed.token[n];null!=s&&(i=e.token(s,void 0,n,r)),null!=i&&(r.sI+=i.src.length,r.cI+=i.src.length,null==t?l=i:r.token.push(i))}return l}n.makeToken=a,n.makeNoToken=()=>a("",-1,void 0,r.EMPTY,s(-1)),n.makeFixedMatcher=(e,t)=>{let n=(0,l.regexp)(null,"^(",e.rePart.fixed,")");return function(t){let r=e.fixed;if(!r.lex)return;if(e.fixed.check){let n=e.fixed.check(t);if(n&&n.done)return n.token}let l=t.pnt,i=t.src.substring(l.sI).match(n);if(i){let e=i[1],n=e.length;if(0<n){let i,s=r.token[e];return null!=s&&(i=t.token(s,void 0,e,l),l.sI+=n,l.cI+=n),i}}}},n.makeMatchMatcher=(e,t)=>{let n=(0,l.values)(e.match.value),r=(0,l.values)(e.match.token);return 0===n.length&&0===r.length?null:function(t,l,i=0){if(!e.match.lex)return;if(e.match.check){let n=e.match.check(t);if(n&&n.done)return n.token}let s=t.pnt,o=t.src.substring(s.sI),a="o"===l.state?0:1;for(let e of n)if(e.match instanceof RegExp){let n=o.match(e.match);if(n){let r=n[0],l=r.length;if(0<l){let i,o=e.val?e.val(n):r;return i=t.token("#VL",o,r,s),s.sI+=l,s.cI+=l,i}}}else{let n=e.match(t,l);if(null!=n)return n}for(let e of r)if(!e.tin$||l.spec.def.tcol[a][i].includes(e.tin$))if(e instanceof RegExp){let n=o.match(e);if(n){let r=n[0],l=r.length;if(0<l){let n,i=e.tin$;return n=t.token(i,r,r,s),s.sI+=l,s.cI+=l,n}}}else{let n=e(t,l);if(null!=n)return n}}},n.makeCommentMatcher=(e,t)=>{let n=t.comment;e.comment={lex:!!n&&!!n.lex,def:((null==n?void 0:n.def)?(0,l.entries)(n.def):[]).reduce((e,[t,n])=>{if(null==n||!1===n)return e;let r={name:t,start:n.start,end:n.end,line:!!n.line,lex:!!n.lex,eatline:!!n.eatline};return e[t]=r,e},{})};let r=e.comment.lex?(0,l.values)(e.comment.def).filter(e=>e.lex&&e.line):[],i=e.comment.lex?(0,l.values)(e.comment.def).filter(e=>e.lex&&!e.line):[];return function(t,n){if(!e.comment.lex)return;if(e.comment.check){let n=e.comment.check(t);if(n&&n.done)return n.token}let s=t.pnt,o=t.src.substring(s.sI),a=s.rI,c=s.cI;for(let l of r)if(o.startsWith(l.start)){let n=o.length,r=l.start.length;for(c+=l.start.length;r<n&&!e.line.chars[o[r]];)c++,r++;if(l.eatline)for(;r<n&&e.line.chars[o[r]];)e.line.rowChars[o[r]]&&a++,r++;let i=o.substring(0,r),u=t.token("#CM",void 0,i,s);return s.sI+=i.length,s.cI=c,s.rI=a,u}for(let r of i)if(o.startsWith(r.start)){let n=o.length,i=r.start.length,u=r.end;for(c+=r.start.length;i<n&&!o.substring(i).startsWith(u);)e.line.rowChars[o[i]]&&(a++,c=0),c++,i++;if(o.substring(i).startsWith(u)){if(c+=u.length,r.eatline)for(;i<n&&e.line.chars[o[i]];)e.line.rowChars[o[i]]&&a++,i++;let l=o.substring(0,i+u.length),d=t.token("#CM",void 0,l,s);return s.sI+=l.length,s.rI=a,s.cI=c,d}return t.bad(l.S.unterminated_comment,s.sI,s.sI+9*r.start.length)}}},n.makeTextMatcher=(e,t)=>{let n=(0,l.regexp)(e.line.lex?null:"s","^(.*?)",...e.rePart.ender);return function(r){if(e.text.check){let t=e.text.check(r);if(t&&t.done)return t.token}let l=e.text,i=r.pnt,s=r.src.substring(i.sI),o=e.value.def,a=e.value.defre,u=s.match(n);if(u){let n,d=u[1],p=u[2];if(null!=d){let t=d.length;if(0<t){let c;if(e.value.lex)if(void 0!==(c=o[d]))n=r.token("#VL",c.val,d,i),i.sI+=t,i.cI+=t;else for(let e in a){let t=a[e];if(t.match){let e=t.match.exec(t.consume?s:d);if(e&&(t.consume||e[0].length===d.length)){let l=e[0];if(null==t.val)n=r.token("#VL",l,l,i);else{let s=t.val(e);n=r.token("#VL",s,l,i)}i.sI+=l.length,i.cI+=l.length}}}null==n&&l.lex&&(n=r.token("#TX",d,d,i),i.sI+=t,i.cI+=t)}}if(n&&(n=c(r,n,p)),n&&0<e.text.modify.length){const l=e.text.modify;for(let i=0;i<l.length;i++)n.val=l[i](n.val,r,e,t)}return n}}},n.makeNumberMatcher=(e,t)=>{let n=e.number,r=(0,l.regexp)(null,["^([-+]?(0(",[n.hex?"x[0-9a-fA-F_]+":null,n.oct?"o[0-7_]+":null,n.bin?"b[01_]+":null].filter(e=>null!=e).join("|"),")|\\.?[0-9]+([0-9_]*[0-9])?)","(\\.[0-9]?([0-9_]*[0-9])?)?","([eE][-+]?[0-9]+([0-9_]*[0-9])?)?"].join("").replace(/_/g,n.sep?(0,l.escre)(n.sepChar):""),")",...e.rePart.ender),i=n.sep?(0,l.regexp)("g",(0,l.escre)(n.sepChar)):void 0;return function(t){if(n=e.number,!n.lex)return;if(e.number.check){let n=e.number.check(t);if(n&&n.done)return n.token}let l=t.pnt,s=t.src.substring(l.sI),o=e.value.def,a=s.match(r);if(a){let n,r=a[1],s=a[9],u=!0;if(null!=r&&(u=!e.number.exclude||!r.match(e.number.exclude))){let s=r.length;if(0<s){let a;if(e.value.lex&&void 0!==(a=o[r]))n=t.token("#VL",a.val,r,l);else{let e=i?r.replace(i,""):r,o=+e;if(isNaN(o)){let t=e[0];"-"!==t&&"+"!==t||(o=("-"===t?-1:1)*+e.substring(1))}isNaN(o)||(n=t.token("#NR",o,r,l),l.sI+=s,l.cI+=s)}}}return u&&(n=c(t,n,s)),n}}},n.makeStringMatcher=(e,t)=>{let n=t.string||{};return e.string=e.string||{},e.string=(0,l.deep)(e.string,{lex:!!(null==n?void 0:n.lex),quoteMap:(0,l.charset)(n.chars),multiChars:(0,l.charset)(n.multiChars),escMap:{...n.escape},escChar:n.escapeChar,escCharCode:null==n.escapeChar?void 0:n.escapeChar.charCodeAt(0),allowUnknown:!!n.allowUnknown,replaceCodeMap:(0,l.omap)((0,l.clean)({...n.replace}),([e,t])=>[e.charCodeAt(0),t]),hasReplace:!1,abandon:!!n.abandon}),e.string.escMap=(0,l.clean)(e.string.escMap),e.string.hasReplace=0<(0,l.keys)(e.string.replaceCodeMap).length,function(t){let n=e.string;if(!n.lex)return;if(e.string.check){let n=e.string.check(t);if(n&&n.done)return n.token}let{quoteMap:i,escMap:s,escChar:o,escCharCode:a,multiChars:c,allowUnknown:u,replaceCodeMap:d,hasReplace:p}=n,{pnt:m,src:f}=t,{sI:h,rI:g,cI:k}=m,v=f.length;if(i[f[h]]){const i=f[h],b=h,x=g,y=c[i];++h,++k;let I,S=[];for(;h<v;h++){k++;let r=f[h];if(I=void 0,i===r){h++;break}if(o===r){h++,k++;let e=s[f[h]];if(null!=e)S.push(e);else if("x"===f[h]){h++;let e=parseInt(f.substring(h,h+2),16);if(isNaN(e)){if(n.abandon)return;return h-=2,k-=2,m.sI=h,m.cI=k,t.bad(l.S.invalid_ascii,h,h+4)}let r=String.fromCharCode(e);S.push(r),h+=1,k+=2}else if("u"===f[h]){h++;let e="{"===f[h]?(h++,1):0,r=e?6:4,i=parseInt(f.substring(h,h+r),16);if(isNaN(i)){if(n.abandon)return;return h=h-2-e,k-=2,m.sI=h,m.cI=k,t.bad(l.S.invalid_unicode,h,h+r+2+2*e)}let s=String.fromCodePoint(i);S.push(s),h+=r-1+e,k+=r+e}else{if(!u){if(n.abandon)return;return m.sI=h,m.cI=k-1,t.bad(l.S.unexpected,h,h+1)}S.push(f[h])}}else if(p&&void 0!==(I=d[f.charCodeAt(h)]))S.push(I),k++;else{let r=h,s=i.charCodeAt(0),o=f.charCodeAt(h);for(;(!p||void 0===(I=d[o]))&&h<v&&32<=o&&s!==o&&a!==o;)o=f.charCodeAt(++h),k++;if(k--,void 0===I&&o<32){if(!y||!e.line.chars[f[h]]){if(n.abandon)return;return m.sI=h,m.cI=k,t.bad(l.S.unprintable,h,h+1)}e.line.rowChars[f[h]]&&(m.rI=++g),k=1,S.push(f.substring(r,h+1))}else S.push(f.substring(r,h)),h--}}if(f[h-1]!==i||m.sI===h-1){if(n.abandon)return;return m.rI=x,t.bad(l.S.unterminated_string,b,h)}const j=t.token("#ST",S.join(r.EMPTY),f.substring(m.sI,h),m);return m.sI=h,m.rI=g,m.cI=k,j}}},n.makeLineMatcher=(e,t)=>function(t){if(!e.line.lex)return;if(e.line.check){let n=e.line.check(t);if(n&&n.done)return n.token}let n,{chars:r,rowChars:l}=e.line,{pnt:i,src:s}=t,{sI:o,rI:a}=i,c=e.line.single;for(c&&(n={});r[s[o]]&&!(n&&(n[s[o]]=(n[s[o]]||0)+1,c&&1<n[s[o]]));)a+=l[s[o]]?1:0,o++;if(i.sI<o){let e=s.substring(i.sI,o);const n=t.token("#LN",void 0,e,i);return i.sI+=e.length,i.rI=a,i.cI=1,n}},n.makeSpaceMatcher=(e,t)=>function(t){if(!e.space.lex)return;if(e.space.check){let n=e.space.check(t);if(n&&n.done)return n.token}let{chars:n}=e.space,{pnt:r,src:l}=t,{sI:i,cI:s}=r;for(;n[l[i]];)i++,s++;if(r.sI<i){let e=l.substring(r.sI,i);const n=t.token("#SP",void 0,e,r);return r.sI+=e.length,r.cI=s,n}};class u{constructor(e){this.src=r.EMPTY,this.ctx={},this.cfg={},this.pnt=s(-1),this.ctx=e,this.src=e.src(),this.cfg=e.cfg,this.pnt=s(this.src.length)}token(e,t,n,r,i,s){let o,c;return"string"==typeof e?(c=e,o=(0,l.tokenize)(c,this.cfg)):(o=e,c=(0,l.tokenize)(e,this.cfg)),a(c,o,t,n,r||this.pnt,i,s)}next(e,t,n,r){let i,s,o=this.pnt,a=o.sI;if(o.end)i=o.end;else if(0<o.token.length)i=o.token.shift();else if(o.len<=o.sI)o.end=this.token("#ZZ",void 0,"",o),i=o.end;else{try{for(let t of this.cfg.lex.match)if(i=t(this,e,r)){s=t;break}}catch(c){i=i||this.token("#BD",void 0,this.src[o.sI],o,{err:c},c.code||l.S.unexpected)}i=i||this.token("#BD",void 0,this.src[o.sI],o,void 0,l.S.unexpected)}return this.ctx.log&&this.ctx.log(l.S.lex,this.ctx,e,this,o,a,s,i,t,n,r),this.ctx.sub.lex&&this.ctx.sub.lex.map(t=>t(i,e,this.ctx)),i}tokenize(e){return(0,l.tokenize)(e,this.cfg)}bad(e,t,n){return this.token("#BD",void 0,0<=t&&t<=n?this.src.substring(t,n):this.src[this.pnt.sI],void 0,void 0,e)}}n.makeLex=(...e)=>new u(...e)})),r={};Object.defineProperty(r,"__esModule",{value:!0}),r.STRING=r.INSPECT=r.EMPTY=r.AFTER=r.BEFORE=r.CLOSE=r.OPEN=void 0,r.OPEN="o",r.CLOSE="c",r.BEFORE="b",r.AFTER="a",r.EMPTY="",r.INSPECT=Symbol.for("nodejs.util.inspect.custom"),r.STRING="string";var l={};Object.defineProperty(l,"__esModule",{value:!0}),l.defaults=void 0;const i=n({}),s={safe:{key:!0},tag:"-",fixed:{lex:!0,token:{"#OB":"{","#CB":"}","#OS":"[","#CS":"]","#CL":":","#CA":","}},match:{lex:!0,token:{}},tokenSet:{IGNORE:["#SP","#LN","#CM"],VAL:["#TX","#NR","#ST","#VL"],KEY:["#TX","#NR","#ST","#VL"]},space:{lex:!0,chars:" \t"},line:{lex:!0,chars:"\r\n",rowChars:"\n",single:!1},text:{lex:!0},number:{lex:!0,hex:!0,oct:!0,bin:!0,sep:"_",exclude:void 0},comment:{lex:!0,def:{hash:{line:!0,start:"#",lex:!0,eatline:!1},slash:{line:!0,start:"//",lex:!0,eatline:!1},multi:{line:!1,start:"/*",end:"*/",lex:!0,eatline:!1}}},string:{lex:!0,chars:"'\"`",multiChars:"`",escapeChar:"\\",escape:{b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",'"':'"',"'":"'","`":"`","\\":"\\","/":"/"},allowUnknown:!0,abandon:!1},map:{extend:!0,merge:void 0},list:{property:!0},value:{lex:!0,def:{true:{val:!0},false:{val:!1},null:{val:null}}},ender:[],plugin:{},debug:{get_console:()=>console,maxlen:99,print:{config:!1,src:void 0}},error:{unknown:"unknown error: $code",unexpected:"unexpected character(s): $src",invalid_unicode:"invalid unicode escape: $src",invalid_ascii:"invalid ascii escape: $src",unprintable:"unprintable character: $src",unterminated_string:"unterminated string: $src",unterminated_comment:"unterminated comment: $src",unknown_rule:"unknown rule: $rulename"},hint:function(e=((e,t="replace")=>e[t](/[A-Z]/g,e=>" "+e.toLowerCase())[t](/[~%][a-z]/g,e=>("~"==e[0]?" ":"")+e[1].toUpperCase())),t="~sinceTheErrorIsUnknown,ThisIsProbablyABugInsideJsonic\nitself,OrAPlugin.~pleaseConsiderPostingAGithubIssue -Thanks!\n\n~code: $code,~details: \n$details|~theCharacter(s) $srcWereNotExpectedAtThisPointAsTheyDoNot\nmatchTheExpectedSyntax,EvenUnderTheRelaxedJsonicRules.~ifIt\nisNotObviouslyWrong,TheActualSyntaxErrorMayBeElsewhere.~try\ncommentingOutLargerAreasAroundThisPointUntilYouGetNoErrors,\nthenRemoveTheCommentsInSmallSectionsUntilYouFindThe\noffendingSyntax.~n%o%t%e:~alsoCheckIfAnyPluginsYouAreUsing\nexpectDifferentSyntaxInThisCase.|~theEscapeSequence $srcDoesNotEncodeAValidUnicodeCodePoint\nnumber.~youMayNeedToValidateYourStringDataManuallyUsingTest\ncodeToSeeHow~javaScriptWillInterpretIt.~alsoConsiderThatYour\ndataMayHaveBecomeCorrupted,OrTheEscapeSequenceHasNotBeen\ngeneratedCorrectly.|~theEscapeSequence $srcDoesNotEncodeAValid~a%s%c%i%iCharacter.~you\nmayNeedToValidateYourStringDataManuallyUsingTestCodeToSee\nhow~javaScriptWillInterpretIt.~alsoConsiderThatYourDataMay\nhaveBecomeCorrupted,OrTheEscapeSequenceHasNotBeenGenerated\ncorrectly.|~stringValuesCannotContainUnprintableCharacters (characterCodes\nbelow 32).~theCharacter $srcIsUnprintable.~youMayNeedToRemove\ntheseCharactersFromYourSourceData.~alsoCheckThatItHasNot\nbecomeCorrupted.|~thisStringHasNoEndQuote.|~thisCommentIsNeverClosed.|~noRuleNamed $rulenameIsDefined.~thisIsProbablyAnErrorInThe\ngrammarOfAPlugin.".split("|")){return"unknown|unexpected|invalid_unicode|invalid_ascii|unprintable|unterminated_string|unterminated_comment|unknown_rule".split("|").reduce((n,r,l)=>(n[r]=e(t[l]),n),{})},lex:{match:{match:{order:1e6,make:i.makeMatchMatcher},fixed:{order:2e6,make:i.makeFixedMatcher},space:{order:3e6,make:i.makeSpaceMatcher},line:{order:4e6,make:i.makeLineMatcher},string:{order:5e6,make:i.makeStringMatcher},comment:{order:6e6,make:i.makeCommentMatcher},number:{order:7e6,make:i.makeNumberMatcher},text:{order:8e6,make:i.makeTextMatcher}},empty:!0,emptyResult:void 0},parse:{prepare:{}},rule:{start:"val",finish:!0,maxmul:3,include:"",exclude:""},result:{fail:[]},config:{modify:{}},parser:{start:void 0}};l.defaults=s;var o={};Object.defineProperty(o,"__esModule",{value:!0}),o.makeRuleSpec=o.makeNoRule=o.makeRule=void 0;const a=t({});class c{constructor(e,t,n){this.i=-1,this.name=r.EMPTY,this.node=null,this.state=r.OPEN,this.n=Object.create(null),this.d=-1,this.u=Object.create(null),this.k=Object.create(null),this.bo=!1,this.ao=!1,this.bc=!1,this.ac=!1,this.os=0,this.cs=0,this.need=0,this.i=t.uI++,this.name=e.name,this.spec=e,this.child=t.NORULE,this.parent=t.NORULE,this.prev=t.NORULE,this.o0=t.NOTOKEN,this.o1=t.NOTOKEN,this.c0=t.NOTOKEN,this.c1=t.NOTOKEN,this.node=n,this.d=t.rsI,this.bo=null!=e.def.bo,this.ao=null!=e.def.ao,this.bc=null!=e.def.bc,this.ac=null!=e.def.ac}process(e,t){return this.spec.process(this,e,t,this.state)}eq(e,t=0){let n=this.n[e];return null==n||n===t}lt(e,t=0){let n=this.n[e];return null==n||n<t}gt(e,t=0){let n=this.n[e];return null==n||n>t}lte(e,t=0){let n=this.n[e];return null==n||n<=t}gte(e,t=0){let n=this.n[e];return null==n||n>=t}toString(){return"[Rule "+this.name+"~"+this.i+"]"}}const u=(...e)=>new c(...e);o.makeRule=u,o.makeNoRule=e=>u(g(e.cfg,{}),e);class d{constructor(){this.p=r.EMPTY,this.r=r.EMPTY,this.b=0}}const p=(...e)=>new d(...e),m=p(),f=p();class h{constructor(e,t){this.name=r.EMPTY,this.def={open:[],close:[],bo:[],bc:[],ao:[],ac:[],tcol:[]},this.cfg=e,this.def=Object.assign(this.def,t),this.def.open=(this.def.open||[]).filter(e=>null!=e),this.def.close=(this.def.close||[]).filter(e=>null!=e);for(let n of[...this.def.open,...this.def.close])k(n)}tin(e){return(0,a.tokenize)(e,this.cfg)}add(e,t,n){let r=(null==n?void 0:n.append)?"push":"unshift",l=((0,a.isarr)(t)?t:[t]).filter(e=>null!=e&&"object"==typeof e).map(e=>k(e)),i="o"===e?"open":"close",s=this.def[i];return s[r](...l),s=this.def[i]=(0,a.modlist)(s,n),(0,a.filterRules)(this,this.cfg),this.norm(),this}open(e,t){return this.add("o",e,t)}close(e,t){return this.add("c",e,t)}action(e,t,n,r){let l=this.def[t+n];return e?l.push(r):l.unshift(r),this}bo(e,t){return this.action(!t||!!e,r.BEFORE,r.OPEN,t||e)}ao(e,t){return this.action(!t||!!e,r.AFTER,r.OPEN,t||e)}bc(e,t){return this.action(!t||!!e,r.BEFORE,r.CLOSE,t||e)}ac(e,t){return this.action(!t||!!e,r.AFTER,r.CLOSE,t||e)}clear(){return this.def.open.length=0,this.def.close.length=0,this.def.bo.length=0,this.def.ao.length=0,this.def.bc.length=0,this.def.ac.length=0,this}norm(){this.def.open.map(e=>k(e)),this.def.close.map(e=>k(e));const e=[];function t(e,t,n){return n[e]=n[e]||[],[function(e,n){if(n.s&&n.s[t]){let r=[...new Set(e.concat(n.s[t]))];e.length=0,e.push(...r)}return e},n[e][t]=n[e][t]||[]]}return this.def.open.reduce(...t(0,0,e)),this.def.open.reduce(...t(0,1,e)),this.def.close.reduce(...t(1,0,e)),this.def.close.reduce(...t(1,1,e)),this.def.tcol=e,this}process(e,t,n,l){t.log&&t.log(a.S.rule,t,e,n);let i="o"===l,s=i?e:t.NORULE,o=i?"O":"C",c=this.def,d=i?c.open:c.close,p=i?e.bo?c.bo:null:e.bc?c.bc:null;if(p){let n;for(let r=0;r<p.length;r++)if(n=p[r].call(this,e,t,s,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:i})}let h=0<d.length?function(e,t,n,l,i){let s=m;s.b=0,s.p=r.EMPTY,s.r=r.EMPTY,s.n=void 0,s.h=void 0,s.a=void 0,s.u=void 0,s.k=void 0,s.e=void 0;let o=null,c=0,u=!0,d=1<<i.cfg.t.AA-1,p=i.cfg.tokenSetTins.IGNORE;function f(e,t,r,l){let s;do{s=n.next(e,t,r,l),i.tC++}while(p[s.tin]);return s}let h=t.length;for(c=0;c<h;c++){o=t[c];let n=!1,r=!1;if(u=!0,o.S0){let e=(i.t0=i.NOTOKEN!==i.t0?i.t0:i.t0=f(l,o,c,0)).tin;if(n=!0,u=!!(o.S0[e/31|0]&(1<<e%31-1|d)),u&&(r=null!=o.S1,o.S1)){let e=(i.t1=i.NOTOKEN!==i.t1?i.t1:i.t1=f(l,o,c,1)).tin;r=!0,u=!!(o.S1[e/31|0]&(1<<e%31-1|d))}}if(e?(l.o0=n?i.t0:i.NOTOKEN,l.o1=r?i.t1:i.NOTOKEN,l.os=(n?1:0)+(r?1:0)):(l.c0=n?i.t0:i.NOTOKEN,l.c1=r?i.t1:i.NOTOKEN,l.cs=(n?1:0)+(r?1:0)),u&&o.c&&(u=u&&o.c(l,i,s)),u)break;o=null}u||(s.e=i.t0),o&&(s.n=null!=o.n?o.n:s.n,s.h=null!=o.h?o.h:s.h,s.a=null!=o.a?o.a:s.a,s.u=null!=o.u?o.u:s.u,s.k=null!=o.k?o.k:s.k,s.g=null!=o.g?o.g:s.g,s.e=o.e&&o.e(l,i,s)||void 0,s.p=null!=o.p&&!1!==o.p?"string"==typeof o.p?o.p:o.p(l,i,s):s.p,s.r=null!=o.r&&!1!==o.r?"string"==typeof o.r?o.r:o.r(l,i,s):s.r,s.b=null!=o.b&&!1!==o.b?"number"==typeof o.b?o.b:o.b(l,i,s):s.b);let g=c<t.length;return i.log&&i.log(a.S.parse,i,l,n,g,u,c,o,s),s}(i,d,n,e,t):f;if(h.h&&(h=h.h(e,t,h,s)||h,o+="H"),h.e)return this.bad(h.e,e,t,{is_open:i});if(h.n)for(let r in h.n)e.n[r]=0===h.n[r]?0:(null==e.n[r]?0:e.n[r])+h.n[r];if(h.u&&(e.u=Object.assign(e.u,h.u)),h.k&&(e.k=Object.assign(e.k,h.k)),h.a){o+="A";let n=h.a(e,t,h);if(n&&n.isToken&&n.err)return this.bad(n,e,t,{is_open:i})}if(h.p){t.rs[t.rsI++]=e;let n=t.rsm[h.p];if(!n)return this.bad(this.unknownRule(t.t0,h.p),e,t,{is_open:i});s=e.child=u(n,t,e.node),s.parent=e,s.n={...e.n},0<Object.keys(e.k).length&&(s.k={...e.k}),o+="P`"+h.p+"`"}else if(h.r){let n=t.rsm[h.r];if(!n)return this.bad(this.unknownRule(t.t0,h.r),e,t,{is_open:i});s=u(n,t,e.node),s.parent=e.parent,s.prev=e,s.n={...e.n},0<Object.keys(e.k).length&&(s.k={...e.k}),o+="R`"+h.r+"`"}else i||(s=t.rs[--t.rsI]||t.NORULE);let g=i?e.ao?c.ao:null:e.ac?c.ac:null;if(g){let n;for(let r=0;r<g.length;r++)if(n=g[r](e,t,s,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:i})}s.why=o,t.log&&t.log(a.S.node,t,e,n,s),r.OPEN===e.state&&(e.state=r.CLOSE);let k=e[i?"os":"cs"]-(h.b||0);return 1===k?(t.v2=t.v1,t.v1=t.t0,t.t0=t.t1,t.t1=t.NOTOKEN):2==k&&(t.v2=t.t1,t.v1=t.t0,t.t0=t.NOTOKEN,t.t1=t.NOTOKEN),s}bad(e,t,n,r){throw new a.JsonicError(e.err||a.S.unexpected,{...e.use,state:r.is_open?a.S.open:a.S.close},e,t,n)}unknownRule(e,t){return e.err="unknown_rule",e.use=e.use||{},e.use.rulename=t,e}}const g=(...e)=>new h(...e);function k(e){if(r.STRING===typeof e.g?e.g=e.g.split(/\s*,\s*/):null==e.g&&(e.g=[]),e.g=e.g.sort(),e.s&&0!==e.s.length){const t=e=>e.flat().filter(e=>"number"==typeof e),n=(e,t)=>e.filter(e=>31*t<=e&&e<31*(t+1)),r=(e,t)=>e.reduce((e,n)=>1<<n-(31*t+1)|e,0),l=t([e.s[0]]),i=t([e.s[1]]),s=e;s.S0=0<l.length?new Array(Math.max(...l.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(l,e),e)):null,s.S1=0<i.length?new Array(Math.max(...i.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(i,e),e)):null}else e.s=null;return e.p||(e.p=null),e.r||(e.r=null),e.b||(e.b=null),e}o.makeRuleSpec=g;var v={};Object.defineProperty(v,"__esModule",{value:!0}),v.makeParser=v.makeRuleSpec=v.makeRule=void 0;const b=t({}),x=n({});Object.defineProperty(v,"makeRule",{enumerable:!0,get:function(){return o.makeRule}}),Object.defineProperty(v,"makeRuleSpec",{enumerable:!0,get:function(){return o.makeRuleSpec}});class y{constructor(e,t){this.rsm={},this.options=e,this.cfg=t}rule(e,t){if(null==e)return this.rsm;let n=this.rsm[e];if(null===t)delete this.rsm[e];else if(void 0!==t)return n=this.rsm[e]=this.rsm[e]||(0,o.makeRuleSpec)(this.cfg,{}),n=this.rsm[e]=t(this.rsm[e],this)||this.rsm[e],void(n.name=e);return n}start(e,t,n,l){let i,s=(0,x.makeToken)("#ZZ",(0,b.tokenize)("#ZZ",this.cfg),void 0,r.EMPTY,(0,x.makePoint)(-1)),a=(0,x.makeNoToken)(),c={uI:0,opts:this.options,cfg:this.cfg,meta:n||{},src:()=>e,root:()=>i,plgn:()=>t.internal().plugins,inst:()=>t,rule:{},sub:t.internal().sub,xs:-1,v2:s,v1:s,t0:a,t1:a,tC:-2,kI:-1,rs:[],rsI:0,rsm:this.rsm,log:void 0,F:(0,b.srcfmt)(this.cfg),u:{},NOTOKEN:a,NORULE:{}};c=(0,b.deep)(c,l);let u=(0,o.makeNoRule)(c);if(c.NORULE=u,c.rule=u,n&&b.S.function===typeof n.log&&(c.log=n.log),this.cfg.parse.prepare.forEach(e=>e(t,c,n)),""===e){if(this.cfg.lex.empty)return this.cfg.lex.emptyResult;throw new b.JsonicError(b.S.unexpected,{src:e},c.t0,u,c)}let d=(0,b.badlex)((0,x.makeLex)(c),(0,b.tokenize)("#BD",this.cfg),c),p=this.rsm[this.cfg.rule.start];if(null==p)return;let m=(0,o.makeRule)(p,c);i=m;let f=2*(0,b.keys)(this.rsm).length*d.src.length*2*c.cfg.rule.maxmul,h=0;for(;u!==m&&h<f;)c.kI=h,c.rule=m,c.log&&c.log("",c.kI+":"),c.sub.rule&&c.sub.rule.map(e=>e(m,c)),m=m.process(c,d),c.log&&c.log(b.S.stack,c,m,d),h++;if(s.tin!==d.next(m).tin)throw new b.JsonicError(b.S.unexpected,{},c.t0,u,c);const g=c.root().node;if(this.cfg.result.fail.includes(g))throw new b.JsonicError(b.S.unexpected,{},c.t0,u,c);return g}clone(e,t){let n=new y(e,t);return n.rsm=Object.keys(this.rsm).reduce((e,t)=>(e[t]=(0,b.filterRules)(this.rsm[t],this.cfg),e),{}),n.norm(),n}norm(){(0,b.values)(this.rsm).map(e=>e.norm())}}v.makeParser=(...e)=>new y(...e);var I={};function S(e){const{deep:t}=e.util,{OB:n,CB:r,OS:l,CS:i,CL:s,CA:o,TX:a,ST:c,ZZ:u}=e.token,{VAL:d,KEY:p}=e.tokenSet,m=(e,t)=>{if(!t.cfg.rule.finish)return t.t0.src="END_OF_SOURCE",t.t0},f=e=>{const t=e.o0,n=c===t.tin||a===t.tin?t.val:t.src;e.u.key=n};e.rule("val",e=>{e.bo(e=>e.node=void 0).open([{s:[n],p:"map",b:1,g:"map,json"},{s:[l],p:"list",b:1,g:"list,json"},{s:[d],g:"val,json"}]).close([{s:[u],g:"end,json"},{b:1,g:"more,json"}]).bc((e,t)=>{e.node=void 0===e.node?void 0===e.child.node?0===e.os?void 0:e.o0.resolveVal(e,t):e.child.node:e.node})}),e.rule("map",e=>{e.bo(e=>{e.node=Object.create(null)}).open([{s:[n,r],b:1,n:{pk:0},g:"map,json"},{s:[n],p:"pair",n:{pk:0},g:"map,json,pair"}]).close([{s:[r],g:"end,json"}])}),e.rule("list",e=>{e.bo(e=>{e.node=[]}).open([{s:[l,i],b:1,g:"list,json"},{s:[l],p:"elem",g:"list,elem,json"}]).close([{s:[i],g:"end,json"}])}),e.rule("pair",e=>{e.open([{s:[p,s],p:"val",u:{pair:!0},a:f,g:"map,pair,key,json"}]).bc((e,t)=>{e.u.pair&&(e.u.prev=e.node[e.u.key],e.node[e.u.key]=e.child.node)}).close([{s:[o],r:"pair",g:"map,pair,json"},{s:[r],b:1,g:"map,pair,json"}])}),e.rule("elem",e=>{e.open([{p:"val",g:"list,elem,val,json"}]).bc(e=>{!0!==e.u.done&&e.node.push(e.child.node)}).close([{s:[o],r:"elem",g:"list,elem,json"},{s:[i],b:1,g:"list,elem,json"}])});const h=(e,n)=>{let r=e.u.key,l=e.child.node;const i=e.u.prev;l=void 0===l?null:l,e.u.list&&n.cfg.safe.key&&("__proto__"===r||"constructor"===r)||(e.node[r]=null==i?l:n.cfg.map.merge?n.cfg.map.merge(i,l,e,n):n.cfg.map.extend?t(i,l):l)};e.rule("val",e=>{e.open([{s:[p,s],p:"map",b:2,n:{pk:1},g:"pair,jsonic"},{s:[d],g:"val,json"},{s:[[r,i]],b:1,c:e=>0<e.d,g:"val,imp,null,jsonic"},{s:[o],c:e=>0===e.d,p:"list",b:1,g:"list,imp,jsonic"},{s:[o],b:1,g:"list,val,imp,null,jsonic"},{s:[u],g:"jsonic"}],{append:!0,delete:[2]}).close([{s:[[r,i]],b:1,g:"val,json,close",e:(e,t)=>0===e.d?t.t0:void 0},{s:[o],c:e=>e.lte("dlist")&&e.lte("dmap"),r:"list",u:{implist:!0},g:"list,val,imp,comma,jsonic"},{c:e=>e.lte("dlist")&&e.lte("dmap"),r:"list",u:{implist:!0},g:"list,val,imp,space,jsonic",b:1},{s:[u],g:"jsonic"}],{append:!0,move:[1,-1]})}),e.rule("map",e=>{e.bo(e=>{e.n.dmap=1+(e.n.dmap?e.n.dmap:0)}).open([{s:[n,u],b:1,e:m,g:"end,jsonic"}]).open([{s:[p,s],p:"pair",b:2,g:"pair,list,val,imp,jsonic"}],{append:!0}).close([{s:[r],c:e=>e.lte("pk"),g:"end,json"},{s:[r],b:1,g:"path,jsonic"},{s:[[o,i,...d]],b:1,g:"end,path,jsonic"},{s:[u],e:m,g:"end,jsonic"}],{append:!0,delete:[0]})}),e.rule("list",e=>{e.bo(e=>{e.n.dlist=1+(e.n.dlist?e.n.dlist:0),e.prev.u.implist&&(e.node.push(e.prev.node),e.prev.node=e.node)}).open({c:e=>e.prev.u.implist,p:"elem"}).open([{s:[o],p:"elem",b:1,g:"list,elem,val,imp,jsonic"},{p:"elem",g:"list,elem.jsonic"}],{append:!0}).close([{s:[u],e:m,g:"end,jsonic"}],{append:!0})}),e.rule("pair",(e,t)=>{e.open([{s:[o],g:"map,pair,comma,jsonic"}],{append:!0}).bc((e,t)=>{e.u.pair&&h(e,t)}).close([{s:[r],c:e=>e.lte("pk"),b:1,g:"map,pair,json"},{s:[o,r],c:e=>e.lte("pk"),b:1,g:"map,pair,comma,jsonic"},{s:[o,u],g:"end,jsonic"},{s:[o],c:e=>e.lte("pk"),r:"pair",g:"map,pair,json"},{s:[o],c:e=>e.lte("dmap",1),r:"pair",g:"map,pair,jsonic"},{s:[p],c:e=>e.lte("dmap",1),r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[[r,o,i,...p]],c:e=>0<e.n.pk,b:1,g:"map,pair,imp,path,jsonic"},{s:[i],e:e=>e.c0,g:"end,jsonic"},{s:[u],e:m,g:"map,pair,json"},{r:"pair",b:1,g:"map,pair,imp,jsonic"}],{append:!0,delete:[0,1]})}),e.rule("elem",(e,t)=>{e.open([{s:[o,o],b:2,u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[o],u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[p,s],e:t.cfg.list.property?void 0:(e,t)=>t.t0,p:"val",n:{pk:1,dmap:1},u:{done:!0,pair:!0,list:!0},a:f,g:"elem,pair,jsonic"}]).bc((e,t)=>{!0===e.u.pair&&(e.u.prev=e.node[e.u.key],h(e,t))}).close([{s:[o,[i,u]],b:1,g:"list,elem,comma,jsonic"},{s:[o],r:"elem",g:"list,elem,json"},{s:[i],b:1,g:"list,elem,json"},{s:[u],e:m,g:"list,elem,json"},{s:[r],e:e=>e.c0,g:"end,jsonic"},{r:"elem",b:1,g:"list,elem,imp,jsonic"}],{delete:[-1,-2]})})}Object.defineProperty(I,"__esModule",{value:!0}),I.makeJSON=I.grammar=void 0,I.grammar=S,I.makeJSON=function(e){let t=e.make({grammar$:!1,text:{lex:!1},number:{hex:!1,oct:!1,bin:!1,sep:null,exclude:/^00+/},string:{chars:'"',multiChars:"",allowUnknown:!1,escape:{v:null}},comment:{lex:!1},map:{extend:!1},lex:{empty:!1},rule:{finish:!1,include:"json"},result:{fail:[void 0,NaN]},tokenSet:{KEY:["#ST",null,null,null]}});return S(t),t};var j={exports:{}};Object.defineProperty(j.exports,"__esModule",{value:!0}),j.exports.root=j.exports.S=j.exports.EMPTY=j.exports.AFTER=j.exports.BEFORE=j.exports.CLOSE=j.exports.OPEN=j.exports.makeTextMatcher=j.exports.makeNumberMatcher=j.exports.makeCommentMatcher=j.exports.makeStringMatcher=j.exports.makeLineMatcher=j.exports.makeSpaceMatcher=j.exports.makeFixedMatcher=j.exports.makeParser=j.exports.makeLex=j.exports.makeRuleSpec=j.exports.makeRule=j.exports.makePoint=j.exports.makeToken=j.exports.make=j.exports.util=j.exports.JsonicError=j.exports.Jsonic=void 0,Object.defineProperty(j.exports,"OPEN",{enumerable:!0,get:function(){return r.OPEN}}),Object.defineProperty(j.exports,"CLOSE",{enumerable:!0,get:function(){return r.CLOSE}}),Object.defineProperty(j.exports,"BEFORE",{enumerable:!0,get:function(){return r.BEFORE}}),Object.defineProperty(j.exports,"AFTER",{enumerable:!0,get:function(){return r.AFTER}}),Object.defineProperty(j.exports,"EMPTY",{enumerable:!0,get:function(){return r.EMPTY}});const E=t({});Object.defineProperty(j.exports,"JsonicError",{enumerable:!0,get:function(){return E.JsonicError}}),Object.defineProperty(j.exports,"S",{enumerable:!0,get:function(){return E.S}});const O=n({});Object.defineProperty(j.exports,"makePoint",{enumerable:!0,get:function(){return O.makePoint}}),Object.defineProperty(j.exports,"makeToken",{enumerable:!0,get:function(){return O.makeToken}}),Object.defineProperty(j.exports,"makeLex",{enumerable:!0,get:function(){return O.makeLex}}),Object.defineProperty(j.exports,"makeFixedMatcher",{enumerable:!0,get:function(){return O.makeFixedMatcher}}),Object.defineProperty(j.exports,"makeSpaceMatcher",{enumerable:!0,get:function(){return O.makeSpaceMatcher}}),Object.defineProperty(j.exports,"makeLineMatcher",{enumerable:!0,get:function(){return O.makeLineMatcher}}),Object.defineProperty(j.exports,"makeStringMatcher",{enumerable:!0,get:function(){return O.makeStringMatcher}}),Object.defineProperty(j.exports,"makeCommentMatcher",{enumerable:!0,get:function(){return O.makeCommentMatcher}}),Object.defineProperty(j.exports,"makeNumberMatcher",{enumerable:!0,get:function(){return O.makeNumberMatcher}}),Object.defineProperty(j.exports,"makeTextMatcher",{enumerable:!0,get:function(){return O.makeTextMatcher}}),Object.defineProperty(j.exports,"makeRule",{enumerable:!0,get:function(){return v.makeRule}}),Object.defineProperty(j.exports,"makeRuleSpec",{enumerable:!0,get:function(){return v.makeRuleSpec}}),Object.defineProperty(j.exports,"makeParser",{enumerable:!0,get:function(){return v.makeParser}});const T={tokenize:E.tokenize,srcfmt:E.srcfmt,clone:E.clone,charset:E.charset,trimstk:E.trimstk,makelog:E.makelog,badlex:E.badlex,extract:E.extract,errinject:E.errinject,errdesc:E.errdesc,configure:E.configure,parserwrap:E.parserwrap,mesc:E.mesc,escre:E.escre,regexp:E.regexp,prop:E.prop,str:E.str,clean:E.clean,deep:E.deep,omap:E.omap,keys:E.keys,values:E.values,entries:E.entries};function N(e,t){let n=!0;if("jsonic"===e)n=!1;else if("json"===e)return(0,I.makeJSON)(M);e="string"==typeof e?{}:e;let r={parser:null,config:null,plugins:[],sub:{lex:void 0,rule:void 0},mark:Math.random()},i=(0,E.deep)({},t?{...t.options}:!1===(null==e?void 0:e.defaults$)?{}:l.defaults,e||{}),s=function(e,t,n){var r;if(E.S.string===typeof e){let l=s.internal();return((null===(r=o.parser)||void 0===r?void 0:r.start)?(0,E.parserwrap)(o.parser):l.parser).start(e,s,t,n)}return e},o=e=>{if(null!=e&&E.S.object===typeof e){(0,E.deep)(i,e),(0,E.configure)(s,r.config,i);let t=s.internal().parser;r.parser=t.clone(i,r.config)}return{...s.options}},a={token:e=>(0,E.tokenize)(e,r.config,s),tokenSet:e=>(0,E.findTokenSet)(e,r.config),fixed:e=>r.config.fixed.ref[e],options:(0,E.deep)(o,i),config:()=>(0,E.deep)(r.config),parse:s,use:function(e,t){if(E.S.function!==typeof e)throw new Error("Jsonic.use: the first argument must be a function defining a plugin. See https://jsonic.senecajs.org/plugin");const n=e.name.toLowerCase(),r=(0,E.deep)({},e.defaults||{},t||{});s.options({plugin:{[n]:r}});let l=s.options.plugin[n];return s.internal().plugins.push(e),e.options=l,e(s,l)||s},rule:(e,t)=>s.internal().parser.rule(e,t)||s,make:e=>N(e,s),empty:e=>N({defaults$:!1,standard$:!1,grammar$:!1,...e||{}}),id:"Jsonic/"+Date.now()+"/"+(""+Math.random()).substring(2,8).padEnd(6,"0")+(null==o.tag?"":"/"+o.tag),toString:()=>a.id,sub:e=>(e.lex&&(r.sub.lex=r.sub.lex||[],r.sub.lex.push(e.lex)),e.rule&&(r.sub.rule=r.sub.rule||[],r.sub.rule.push(e.rule)),s),util:T};if((0,E.defprop)(a.make,E.S.name,{value:E.S.make}),n?(0,E.assign)(s,a):(0,E.assign)(s,{empty:a.empty,parse:a.parse,sub:a.sub,id:a.id,toString:a.toString}),(0,E.defprop)(s,"internal",{value:()=>r}),t){for(let n in t)void 0===s[n]&&(s[n]=t[n]);s.parent=t;let e=t.internal();r.config=(0,E.deep)({},e.config),(0,E.configure)(s,r.config,i),(0,E.assign)(s.token,r.config.t),r.plugins=[...e.plugins],r.parser=e.parser.clone(i,r.config)}else{let e={...s,...a};r.config=(0,E.configure)(e,void 0,i),r.plugins=[],r.parser=(0,v.makeParser)(i,r.config),!1!==i.grammar$&&(0,I.grammar)(e)}return s}let M;j.exports.util=T,j.exports.make=N,j.exports.root=M;let P=j.exports.root=M=N("jsonic");return j.exports.Jsonic=P,M.Jsonic=M,M.JsonicError=E.JsonicError,M.makeLex=O.makeLex,M.makeParser=v.makeParser,M.makeToken=O.makeToken,M.makePoint=O.makePoint,M.makeRule=v.makeRule,M.makeRuleSpec=v.makeRuleSpec,M.makeFixedMatcher=O.makeFixedMatcher,M.makeSpaceMatcher=O.makeSpaceMatcher,M.makeLineMatcher=O.makeLineMatcher,M.makeStringMatcher=O.makeStringMatcher,M.makeCommentMatcher=O.makeCommentMatcher,M.makeNumberMatcher=O.makeNumberMatcher,M.makeTextMatcher=O.makeTextMatcher,M.OPEN=r.OPEN,M.CLOSE=r.CLOSE,M.BEFORE=r.BEFORE,M.AFTER=r.AFTER,M.EMPTY=r.EMPTY,M.util=T,M.make=N,M.S=E.S,j.exports.default=P,j.exports=P,j.exports}))}).call(this)}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),e=e.exports;var n={};Object.defineProperty(n,"__esModule",{value:!0}),n.Hoover=n.parseToEnd=void 0;const r=(t,n)=>{var r;const{entries:s}=t.util;let o=s(n.block).map(e=>({allowUnknownEscape:!0,preserveEscapeChar:!1,token:"#HV",...e[1],name:e[0]})),a={};for(let e of o)e.TOKEN=t.token(e.token),a[e.token]||t.rule("val",t=>{t.open({s:[e.TOKEN],a:n.action})}),a[e.token]=e.TOKEN;t.options({lex:{match:{hoover:{order:null===(r=n.lex)||void 0===r?void 0:r.order,make:(t,n)=>function(n){for(let r of o){const s=(0,e.makePoint)(n.pnt.len,n.pnt.sI,n.pnt.rI,n.pnt.cI);if(l(n,s,r).match){let e=i(n,s,r,t);if(e.done){let t=n.token(r.TOKEN,e.val,n.src.substring(n.pnt.sI,s.sI),s);return t.use={block:r.name},n.pnt.sI=s.sI,n.pnt.rI=s.rI,n.pnt.cI=s.cI,t}return e.bad||n.bad("invalid_text",n.pnt.sI,s.sI)}}}}}}})};function l(e,t,n){let r=e.src,l=t.sI,i=t.rI,s=t.cI,o=n.start||{},a=o.rule||{},c=null;a.parent&&(a.parent.include&&(c=a.parent.include.includes(e.ctx.rule.parent.name)&&(null===c||c)),a.parent.exclude&&(c=!a.parent.exclude.includes(e.ctx.rule.parent.name)&&(null===c||c))),a.current&&(a.current.include&&(c=a.current.include.includes(e.ctx.rule.name)&&(null===c||c)),a.current.exclude&&(c=!a.current.exclude.includes(e.ctx.rule.name)&&(null===c||c)));let u=""===a.state?"":a.state||"o";u&&(c=u.includes(e.ctx.rule.state)&&(null===c||c));let d=!0,p=o.fixed;if(c&&null!=p){d=!1,p=Array.isArray(p)?p:[p];for(let e=0;!d&&e<p.length;e++)if(r.substring(t.sI).startsWith(p[e])){if(d=!0,!1!==o.consume&&(!Array.isArray(o.consume)||o.consume.includes(p[e]))){let n=t.sI+p[e].length;for(let e=t.sI;e<n;e++)l++,s++,"\n"===r[e]&&(i++,s=0)}break}}if(c&&d){let e=r.substring(t.sI,l);return!1!==n.trim&&(e=e.trim()),t.sI=l,t.rI=i,t.cI=s,{match:!0,start:e}}return{match:!1}}function i(e,t,n,r){let l=[],i=e.src,s=n.end,o=s.fixed;o="string"==typeof o?[o]:o;let a=o.map(e=>e[0]),c=o.map(e=>e.substring(1)),u=n.escapeChar,d=t.sI,p=t.rI,m=t.cI,f=!1,h="",g=d,k=0;e:do{if(h=i[d],-1<(k=a.indexOf(h))){let e=c[k];if(void 0===e||""===e){g=d+1,f=!0;break e}if("string"==typeof e&&e===i.substring(d+1,d+1+e.length)){g=d+1+e.length,f=!0;break e}}if(u===h){let t=n.escape[i[d+1]];if(null!=t)h=t,d++,m++;else{if(!n.allowUnknownEscape)return{done:!1,val:"",bad:e.bad("invalid_escape",d,d+1)};h=n.preserveEscapeChar?i.substring(d,d+2):i[d+1],d++}}l.push(h),d++,m++,"\n"===h&&(p++,m=0)}while(d<=i.length);if(f){if(!1!==s.consume){let e=i.substring(d,g);if(!Array.isArray(s.consume)||s.consume.includes(e)){let e=d;for(;e<g;e++)d++,m++,"\n"===i[e]&&(p++,m=0)}}t.sI=d,t.rI=p,t.cI=m}let v=l.join("");return n.trim&&(v=v.trim()),r.value.lex&&void 0!==r.value.def[v]&&(v=r.value.def[v].val),{done:f,val:v}}return n.Hoover=r,n.parseToEnd=i,r.defaults={block:{},lex:{order:45e5}},n}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),e=e.exports;var t={};return Object.defineProperty(t,"__esModule",{value:!0}),t.Ini=void 0,t.Ini=function(t,n){t.use(e.Hoover,{lex:{order:85e5},block:{endofline:{start:{rule:{parent:{include:["pair","elem"]}}},end:{fixed:["\n","\r\n","#",";",""],consume:["\n","\r\n"]},escapeChar:"\\",escape:{"#":"#",";":";","\\":"\\"},preserveEscapeChar:!0,trim:!0},key:{token:"#HK",start:{rule:{current:{exclude:["dive"]},state:"oc"}},end:{fixed:["=","\n","\r\n","#",";",""],consume:!1},escape:{"#":"#",";":";","\\":"\\"},trim:!0},divekey:{token:"#DK",start:{rule:{current:{include:["dive"]}}},end:{fixed:["]","."],consume:!1},escapeChar:"\\",escape:{"]":"]",".":".","\\":"\\"},allowUnknownEscape:!0,trim:!0}}}),t.options({rule:{start:"ini",exclude:"jsonic"},lex:{emptyResult:{}},fixed:{token:{"#EQ":"=","#DOT":".","#OB":null,"#CB":null,"#CL":null}},line:{check:e=>{if("val"===e.ctx.rule.name)return{done:!0,token:void 0}}},number:{lex:!1},string:{lex:!0,chars:"'\"",abandon:!0},text:{lex:!1},comment:{def:{hash:{eatline:!0},slash:null,multi:null,semi:{line:!0,start:";",lex:!0,eatline:!0}}}});const{ZZ:r,ST:l,VL:i,OS:s,CS:o,CL:a,EQ:c,DOT:u,HV:d,HK:p,DK:m}=t.token,f=[p,l,i];t.rule("ini",e=>{e.bo(e=>{e.node={}}).open([{s:[s],p:"table",b:1},{s:[f,c],p:"table",b:2},{s:[d,s],p:"table",b:2},{s:[r]}])}),t.rule("table",e=>{e.bo(e=>{if(e.node=e.parent.node,e.prev.u.dive){let t=e.prev.u.dive;for(let n=0;n<t.length;n++)e.node=e.node[t[n]]=e.node[t[n]]||{}}}).open([{s:[s],p:"dive"},{s:[f,c],p:"map",b:2},{s:[d,s],p:"map",b:2},{s:[o],p:"map"},{s:[r]}]).bc(e=>{Object.assign(e.node,e.child.node)}).close([{s:[s],r:"table",b:1},{s:[o],r:"table",a:e=>e.u.dive=e.child.u.dive},{s:[r]}])}),t.rule("dive",e=>{e.open([{s:[m,u],a:e=>(e.u.dive=e.parent.u.dive||[]).push(e.o0.val),p:"dive"},{s:[m],a:e=>(e.u.dive=e.parent.u.dive||[]).push(e.o0.val)}]).close([{s:[o],b:1}])}),t.rule("map",e=>{e.open([{s:[f,c],c:e=>"table"===e.parent.name,p:"pair",b:2},{s:[f],c:e=>"table"===e.parent.name,p:"pair",b:1}],{append:!0}).close([{s:[s],b:1},{s:[r]}])}),t.rule("pair",e=>{e.open([{s:[f,c],c:e=>"table"===e.parent.parent.name,p:"val",a:e=>{let t=""+e.o0.val;Array.isArray(e.node[t])?e.u.ini_array=e.node[t]:(e.u.key=t,2<t.length&&t.endsWith("[]")?(t=e.u.key=t.slice(0,-2),e.node[t]=e.u.ini_array=Array.isArray(e.node[t])?e.node[t]:void 0===e.node[t]?[]:[e.node[t]]):e.u.pair=!0)}},{s:[p],c:e=>"table"===e.parent.parent.name,a:e=>{let t=e.o0.val;"string"==typeof t&&0<t.length&&(e.parent.node[t]=!0)}}]).close([{s:[f,a],c:e=>"table"===e.parent.parent.name,e:e=>e.c1},{s:[f],b:1,r:"pair"},{s:[s],b:1}])}),t.rule("val",e=>{e.open([{s:[[s,o]],r:"val",u:{ini_prev:!0}},{s:[r],a:e=>e.node=""}],{custom:e=>e.filter(e=>"json,list"!==e.g.join())}).ac(e=>{if(l===e.o0.tin&&"'"===e.o0.src[0])try{e.node=JSON.parse(e.node)}catch(t){}null!=e.prev.u.ini_prev?e.prev.node=e.node=e.prev.o0.src+e.node:e.parent.u.ini_array&&e.parent.u.ini_array.push(e.node)})})},t}));
package/ini.ts CHANGED
@@ -1,15 +1,12 @@
1
1
  /* Copyright (c) 2021-2023 Richard Rodger, MIT License */
2
2
 
3
3
  // Import Jsonic types used by plugin.
4
- import { Jsonic, Rule, RuleSpec, NormAltSpec, Lex } from '@jsonic/jsonic-next'
4
+ import { Jsonic, RuleSpec, NormAltSpec, Lex } from '@jsonic/jsonic-next'
5
5
  import { Hoover } from '@jsonic/hoover'
6
6
 
7
- type IniOptions = {
8
- allowTrailingComma?: boolean
9
- disallowComments?: boolean
10
- }
7
+ type IniOptions = {}
11
8
 
12
- function Ini(jsonic: Jsonic, options: IniOptions) {
9
+ function Ini(jsonic: Jsonic, _options: IniOptions) {
13
10
  jsonic.use(Hoover, {
14
11
  lex: {
15
12
  order: 8.5e6,
@@ -148,8 +145,8 @@ function Ini(jsonic: Jsonic, options: IniOptions) {
148
145
  rs.bo((r) => {
149
146
  r.node = r.parent.node
150
147
 
151
- if (r.prev.use.dive) {
152
- let dive = r.prev.use.dive
148
+ if (r.prev.u.dive) {
149
+ let dive = r.prev.u.dive
153
150
  for (let dI = 0; dI < dive.length; dI++) {
154
151
  r.node = r.node[dive[dI]] = r.node[dive[dI]] || {}
155
152
  }
@@ -167,7 +164,7 @@ function Ini(jsonic: Jsonic, options: IniOptions) {
167
164
  })
168
165
  .close([
169
166
  { s: [OS], r: 'table', b: 1 },
170
- { s: [CS], r: 'table', a: (r) => (r.use.dive = r.child.use.dive) },
167
+ { s: [CS], r: 'table', a: (r) => (r.u.dive = r.child.u.dive) },
171
168
  { s: [ZZ] },
172
169
  ])
173
170
  })
@@ -177,12 +174,12 @@ function Ini(jsonic: Jsonic, options: IniOptions) {
177
174
  rs.open([
178
175
  {
179
176
  s: [DK, DOT],
180
- a: (r) => (r.use.dive = r.parent.use.dive || []).push(r.o0.val),
177
+ a: (r) => (r.u.dive = r.parent.u.dive || []).push(r.o0.val),
181
178
  p: 'dive',
182
179
  },
183
180
  {
184
181
  s: [DK],
185
- a: (r) => (r.use.dive = r.parent.use.dive || []).push(r.o0.val),
182
+ a: (r) => (r.u.dive = r.parent.u.dive || []).push(r.o0.val),
186
183
  },
187
184
  ]).close([{ s: [CS], b: 1 }])
188
185
  })
@@ -218,18 +215,18 @@ function Ini(jsonic: Jsonic, options: IniOptions) {
218
215
  a: (r) => {
219
216
  let key = '' + r.o0.val
220
217
  if (Array.isArray(r.node[key])) {
221
- r.use.ini_array = r.node[key]
218
+ r.u.ini_array = r.node[key]
222
219
  } else {
223
- r.use.key = key
220
+ r.u.key = key
224
221
  if (2 < key.length && key.endsWith('[]')) {
225
- key = r.use.key = key.slice(0, -2)
226
- r.node[key] = r.use.ini_array = Array.isArray(r.node[key])
222
+ key = r.u.key = key.slice(0, -2)
223
+ r.node[key] = r.u.ini_array = Array.isArray(r.node[key])
227
224
  ? r.node[key]
228
225
  : undefined === r.node[key]
229
226
  ? []
230
227
  : [r.node[key]]
231
228
  } else {
232
- r.use.pair = true
229
+ r.u.pair = true
233
230
  }
234
231
  }
235
232
  },
@@ -285,10 +282,10 @@ function Ini(jsonic: Jsonic, options: IniOptions) {
285
282
  }
286
283
  }
287
284
 
288
- if (null != r.prev.use.ini_prev) {
285
+ if (null != r.prev.u.ini_prev) {
289
286
  r.prev.node = r.node = r.prev.o0.src + r.node
290
- } else if (r.parent.use.ini_array) {
291
- r.parent.use.ini_array.push(r.node)
287
+ } else if (r.parent.u.ini_array) {
288
+ r.parent.u.ini_array.push(r.node)
292
289
  }
293
290
  })
294
291
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonic/ini",
3
- "version": "0.2.1",
3
+ "version": "0.2.4",
4
4
  "description": "This plugin allows the [Jsonic](https://jsonic.senecajs.org) JSON parser to support INI syntax.",
5
5
  "main": "ini.js",
6
6
  "type": "commonjs",
@@ -24,6 +24,7 @@
24
24
  "test-some": "jest -t",
25
25
  "test-watch": "jest --coverage --watchAll",
26
26
  "watch": "tsc -w -d",
27
+ "doc": "jsonic-doc",
27
28
  "build": "tsc -d && cp ini.js ini.min.js && browserify -o ini.min.js -e ini.js -s @JsonicIni -im -i assert -p tinyify",
28
29
  "prettier": "prettier --write --no-semi --single-quote *.ts test/*.js",
29
30
  "clean": "rm -rf node_modules yarn.lock package-lock.json",
@@ -40,18 +41,21 @@
40
41
  "LICENSE"
41
42
  ],
42
43
  "devDependencies": {
44
+ "@jsonic/doc": "^0.0.7",
43
45
  "@types/jest": "^29.5.3",
44
46
  "browserify": "^17.0.0",
45
47
  "es-jest": "^2.1.0",
46
48
  "esbuild": "^0.19.1",
49
+ "ini": "^4.1.1",
47
50
  "jest": "^29.6.2",
48
51
  "prettier": "^3.0.1",
49
52
  "tinyify": "^4.0.0",
50
53
  "typescript": "^5.1.6",
51
- "ini": "^4.1.1"
54
+ "@jsonic/hoover": ">=0.3.5",
55
+ "@jsonic/jsonic-next": ">=2.12.1"
52
56
  },
53
57
  "peerDependencies": {
54
- "@jsonic/jsonic-next": ">=2.10.0",
55
- "@jsonic/hoover": ">=0.3.1"
58
+ "@jsonic/hoover": ">=0.3.5",
59
+ "@jsonic/jsonic-next": ">=2.12.1"
56
60
  }
57
61
  }