aontu 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aontu.min.js +1 -1
- package/dist/lib/lang.js +22 -3
- package/dist/lib/lang.js.map +1 -1
- package/dist/lib/op/op.d.ts +1 -1
- package/dist/lib/type.d.ts +4 -3
- package/dist/lib/type.js +1 -0
- package/dist/lib/type.js.map +1 -1
- package/dist/lib/unify.d.ts +1 -1
- package/dist/lib/val/ValBase.d.ts +1 -1
- package/dist/lib/val/ValBase.js +2 -0
- package/dist/lib/val/ValBase.js.map +1 -1
- package/dist/lib/val.d.ts +1 -1
- package/lib/lang.ts +26 -3
- package/lib/type.ts +4 -0
- package/lib/val/ValBase.ts +3 -1
- package/package.json +15 -16
package/dist/aontu.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).Aontu=e()}}((function(){var define,module,exports,createModuleFactory=function(e){var t;return function(n){return t||e(t={exports:{},parent:n},t.exports),t.exports}},_$lang_2=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.includeFileResolver=t.Site=t.Lang=void 0;const n=_$multisource_20({}),r=_$type_6({}),i=_$ConjunctVal_9({}),o=_$DisjunctVal_10({}),l=_$MapVal_12({}),s=_$ListVal_11({}),a=_$PrefVal_14({}),c=_$RefVal_15({}),u=_$Nil_13({}),p=_$val_8({});t.Site=class{constructor(e){this.row=-1,this.col=-1,this.url="",this.row=e.row,this.col=e.col,this.url=e.url}};let d=function(e){e.use(_$pathMin_25.Path);let t=(e,t)=>(e.path=[...t||[]],e);e.options({value:{map:{string:{val:e=>t(new p.ScalarTypeVal(String),e.keep.path)},number:{val:e=>t(new p.ScalarTypeVal(Number),e.keep.path)},integer:{val:e=>t(new p.ScalarTypeVal(p.Integer),e.keep.path)},boolean:{val:e=>t(new p.ScalarTypeVal(Boolean),e.keep.path)},nil:{val:e=>t(new u.Nil("literal"),e.keep.path)},top:{val:()=>r.TOP}}},map:{merge:(e,n)=>{let r=e,o=n;return t(new i.ConjunctVal([r,o]),e.path)}}});let n={"conjunct-infix":(e,n,r)=>t(new i.ConjunctVal(r),e.keep.path),"disjunct-infix":(e,n,r)=>t(new o.DisjunctVal(r),e.keep.path),"dot-prefix":(e,n,r)=>t(new c.RefVal(r,!0),e.keep.path),"dot-infix":(e,n,r)=>t(new c.RefVal(r),e.keep.path),"star-prefix":(e,n,r)=>t(new a.PrefVal(r[0]),e.keep.path)};e.use(_$exprMin_18.Expr,{op:{conjunct:{infix:!0,src:"&",left:14e3,right:15e3},disjunct:{infix:!0,src:"|",left:16e3,right:17e3},"dot-infix":{src:".",infix:!0,left:15e6,right:14e6},"dot-prefix":{src:".",prefix:!0,right:14e6},star:{src:"*",prefix:!0,right:14e6}},evaluate:(e,t,r)=>n[t.name](e,t,r)});let d=e.token["#E&"],f=e.token.CL;e.rule("val",e=>(e.open([{s:[d,f],p:"map",b:2,g:"spread"}]).bc((e,n)=>{let r=e.node,i=typeof r;"string"===i?r=t(new p.StringVal(e.node),e.keep.path):"number"===i?r=Number.isInteger(e.node)?t(new p.IntegerVal(e.node),e.keep.path):t(new p.NumberVal(e.node),e.keep.path):"boolean"===i&&(r=t(new p.BooleanVal(e.node),e.keep.path));let o=e.o0;r.row=o.rI,r.col=o.cI,r.url=n.meta.multisource&&n.meta.multisource.path,e.node=r}),e)),e.rule("map",e=>(e.open([{s:[d,f],p:"pair",b:2,g:"spread"}]).bc(e=>{e.node=t(new l.MapVal(e.node),e.keep.path)}),e)),e.rule("list",e=>(e.bc(e=>{e.node=t(new s.ListVal(e.node),e.keep.path)}),e)),e.rule("pair",e=>(e.open([{s:[d,f],p:"val",u:{spread:!0},g:"spread"}]).bc(e=>{e.use.spread&&(e.node[l.MapVal.SPREAD]=e.node[l.MapVal.SPREAD]||{o:e.o0.src,v:[]},e.node[l.MapVal.SPREAD].v.push(e.child.node))}),e)),e.rule("elem",e=>(e.open([{s:[d,f],p:"val",u:{spread:!0},g:"spread"}]).bc(e=>{e.use.spread&&(e.node[s.ListVal.SPREAD]=e.node[s.ListVal.SPREAD]||{o:e.o0.src,v:[]},e.node[s.ListVal.SPREAD].v.push(e.child.node))}),e))};const f=(0,_$file_23.makeFileResolver)(e=>"string"==typeof e?e:null==e?void 0:e.peg);t.includeFileResolver=f,t.Lang=class{constructor(e){this.options={src:"",print:-1},this.options=Object.assign({},this.options,e),this.jsonic=_$jsonicMin_19.Jsonic.make().use(d).use(n.MultiSource,{resolver:(null==e?void 0:e.resolver)||f})}parse(e,t){let n={multisource:{path:this.options.base,deps:t&&t.deps||void 0}};return t&&null!=t.log&&Number.isInteger(t.log)&&(n.log=t.log),this.jsonic(e,n)}}})),_$ListVal_11=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$Nil_13({}),o=_$ValBase_16({}),l=_$ConjunctVal_9({});class s extends o.ValBase{constructor(e,t){super(e,t),this.spread={cj:void 0};let n=this.peg[s.SPREAD];delete this.peg[s.SPREAD],n&&"&"===n.o&&(this.spread.cj=new l.ConjunctVal(Array.isArray(n.v)?n.v:[n.v],t))}unify(e,t){let o=!0,a=n.TOP===e?this:new s([],t);a.spread.cj=this.spread.cj,e instanceof s&&(a.spread.cj=null==a.spread.cj?e.spread.cj:null==e.spread.cj?a.spread.cj:a.spread.cj=new l.ConjunctVal([a.spread.cj,e.spread.cj],t)),a.done=this.done+1,this.spread.cj&&(a.spread.cj=n.DONE!==this.spread.cj.done?(0,r.unite)(t,this.spread.cj):this.spread.cj);let c=a.spread.cj||n.TOP;for(let i in this.peg)a.peg[i]=(0,r.unite)(t.descend(i),this.peg[i],c),o=o&&n.DONE===a.peg[i].done;if(e instanceof s){let l=(0,r.unite)(t,e);for(let e in l.peg){let s=l.peg[e],u=a.peg[e],p=a.peg[e]=void 0===u?s:u instanceof i.Nil?u:s instanceof i.Nil?s:(0,r.unite)(t.descend(e),u,s);this.spread.cj&&(a.peg[e]=(0,r.unite)(t,a.peg[e],c)),o=o&&n.DONE===p.done}}else if(n.TOP!==e)return i.Nil.make(t,"map",this,e);return a.done=o?n.DONE:a.done,a}get canon(){let e=Object.keys(this.peg);return"["+(this.spread.cj?"&:"+this.spread.cj.canon+(0<e.length?",":""):"")+e.map(e=>[this.peg[e].canon]).join(",")+"]"}gen(e){return this.peg.map(t=>t.gen(e))}}t.ListVal=s,s.SPREAD=Symbol("spread")})),_$ConjunctVal_9=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConjunctVal=t.norm=void 0;const n=_$type_6({}),r=_$ValBase_16({}),i=_$Nil_13({}),o=_$MapVal_12({}),l=_$op_4({});class s extends r.ValBase{constructor(e,t){super(e,t)}append(e){return this.peg.push(e),this}unify(e,t){let r=!0,c=[];for(let o=0;o<this.peg.length;o++)if(c[o]=(0,l.unite)(t,this.peg[o],e),r=r&&n.DONE===c[o].done,c[o]instanceof i.Nil)return i.Nil.make(t,"&peer["+c[o].canon+","+e.canon+"]",this.peg[o],e);c=a(c);let u,p,d=[];e:for(let a=0;a<c.length;a++){let e=c[a];if(n.DONE!==e.done){let r=(0,l.unite)(t,e,n.TOP);if(!(n.DONE===r.done||r instanceof o.MapVal)){d.push(r);continue e}e=r}let p=c[a+1];if(null==p)d.push(e);else{if(u=(0,l.unite)(t,e,p),r=r&&n.DONE===u.done,u instanceof s)e.id===u.peg[0].id&&(u=e);else if(u instanceof i.Nil)return u;d.push(u),a++}}return(p=0===d.length?n.TOP:1===d.length?d[0]:new s(d,t)).done=r?n.DONE:this.done+1,p}get canon(){return this.peg.map(e=>e.canon).join("&")}gen(e){if(0<this.peg.length){let t=this.peg[0],n=void 0;return void 0===t||t instanceof i.Nil||(n=t.gen(e)),n}}}function a(e){let t=[];for(let n=0,r=0;n<e.length;n++,r++)e[n]instanceof s?(t.push(...e[n].peg),r+=e[n].peg.length-1):t[r]=e[n];return t}t.ConjunctVal=s,t.norm=a})),_$MapVal_12=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$ValBase_16({}),o=_$Nil_13({}),l=_$ConjunctVal_9({});class s extends i.ValBase{constructor(e,t){super(e,t),this.spread={cj:void 0};let n=this.peg[s.SPREAD];delete this.peg[s.SPREAD],n&&"&"===n.o&&(this.spread.cj=new l.ConjunctVal(Array.isArray(n.v)?n.v:[n.v],t))}unify(e,t){null==t&&console.trace();let i=!0,a=n.TOP===e?this:new s({},t);a.spread.cj=this.spread.cj,e instanceof s&&(a.spread.cj=null==a.spread.cj?e.spread.cj:null==e.spread.cj?a.spread.cj:a.spread.cj=new l.ConjunctVal([a.spread.cj,e.spread.cj],t)),a.done=this.done+1,this.spread.cj&&(a.spread.cj=n.DONE!==this.spread.cj.done?(0,r.unite)(t,this.spread.cj):this.spread.cj);let c=a.spread.cj||n.TOP;for(let o in this.peg)a.peg[o]=(0,r.unite)(t.descend(o),this.peg[o],c),i=i&&n.DONE===a.peg[o].done;if(e instanceof s){let l=(0,r.unite)(t,e);for(let e in l.peg){let s=l.peg[e],u=a.peg[e],p=a.peg[e]=void 0===u?s:u instanceof o.Nil?u:s instanceof o.Nil?s:(0,r.unite)(t.descend(e),u,s);this.spread.cj&&(a.peg[e]=(0,r.unite)(t,a.peg[e],c)),i=i&&n.DONE===p.done,o.Nil}}else if(n.TOP!==e)return o.Nil.make(t,"map",this,e);return a.done=i?n.DONE:a.done,a}get canon(){let e=Object.keys(this.peg);return"{"+(this.spread.cj?"&:"+this.spread.cj.canon+(0<e.length?",":""):"")+e.map(e=>[JSON.stringify(e)+":"+this.peg[e].canon]).join(",")+"}"}gen(e){let t={};for(let n in this.peg)t[n]=this.peg[n].gen(e);return t}}t.MapVal=s,s.SPREAD=Symbol("spread")})),_$op_4=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unite=t.disjunct=void 0;const n=_$disjunct_3({});Object.defineProperty(t,"disjunct",{enumerable:!0,get:function(){return n.disjunct}});const r=_$unite_5({});Object.defineProperty(t,"unite",{enumerable:!0,get:function(){return r.unite}})})),_$unite_5=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unite=void 0;const n=_$type_6({}),r=_$ConjunctVal_9({}),i=_$DisjunctVal_10({}),o=_$PrefVal_14({}),l=_$RefVal_15({}),s=_$Nil_13({});function a(e,t){return e}t.unite=(e,t,c,u)=>{let p=t;if(!c||n.TOP!==t&&t)if(!t||n.TOP!==c&&c){if(t&&c&&n.TOP!==c)if(t instanceof s.Nil)p=a(t);else if(c instanceof s.Nil)p=a(c);else{if(c instanceof r.ConjunctVal||c instanceof i.DisjunctVal||c instanceof l.RefVal||c instanceof o.PrefVal)return c.unify(t,e);p=t.constructor===c.constructor&&t.peg===c.peg?a(t):t.unify(c,e)}}else p=t;else p=c;return p&&p.unify||(p=s.Nil.make(e,"unite",t,c)),n.DONE!==p.done&&(p=p.unify(n.TOP,e)),p}})),_$RefVal_15=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RefVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$Nil_13({}),o=_$ValBase_16({}),l=_$ConjunctVal_9({}),s=_$val_8({});class a extends o.ValBase{constructor(e,t){super(""),this.sep=".",this.absolute=!0===t,this.parts=[];for(let n of e)this.append(n)}append(e){"string"==typeof e?this.parts.push(e):e instanceof s.StringVal?this.parts.push(e.peg):e instanceof a&&(this.parts.push(...e.parts),e.absolute&&(this.absolute=!0)),this.peg=(this.absolute?this.sep:"")+this.parts.join(this.sep)}unify(e,t){let o,s=null==t?this:t.find(this);return(s=null==s&&999<this.done?i.Nil.make(t,"no-path",this,e):s||this)instanceof a?n.TOP===e?o=this:e instanceof i.Nil?o=i.Nil.make(t,"ref["+this.peg+"]",this,e):(this.done=n.DONE===this.done?n.DONE:this.done+1,o=new l.ConjunctVal([this,e],t)):o=(0,r.unite)(t,s,e),o.done=n.DONE===o.done?n.DONE:this.done+1,o}same(e){return null!=e&&this.peg===e.peg}get canon(){return this.peg}gen(e){}}t.RefVal=a})),_$val_8=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntegerVal=t.BooleanVal=t.StringVal=t.NumberVal=t.ScalarTypeVal=t.Integer=void 0;const n=_$type_6({}),r=_$unify_7({}),i=_$Nil_13({}),o=_$ValBase_16({});class l{}t.Integer=l;class s extends o.ValBase{constructor(e,t){super(e,t),this.done=n.DONE}unify(e,t){if(e instanceof a)return e.type===this.peg||Number===this.peg&&l===e.type?e:i.Nil.make(t,"no-scalar-unify",this,e);if(e instanceof s){if(Number===this.peg&&l===e.peg)return e;if(Number===e.peg&&l===this.peg)return this}return i.Nil.make(t,"scalar-type",this,e)}get canon(){return this.peg.name.toLowerCase()}same(e){return e instanceof s?this.peg===e.peg:super.same(e)}gen(e){}}t.ScalarTypeVal=s;class a extends o.ValBase{constructor(e,t,r){super(e,r),this.type=t,this.done=n.DONE}unify(e,t){return e instanceof s?e.unify(this,t):i.Nil.make(t,"scalar",this,e)}get canon(){return this.peg.toString()}same(e){return e instanceof a?e.peg===this.peg:super.same(e)}gen(e){return this.peg}}t.NumberVal=class extends a{constructor(e,t){super(e,Number,t)}unify(e,t){return e instanceof a&&e.type===l?e:super.unify(e,t)}},t.IntegerVal=class extends a{constructor(e,t){if(!Number.isInteger(e))throw new Error("not-integer");super(e,l,t)}unify(e,t){return e instanceof s&&e.peg===Number||e instanceof a&&e.type===Number&&this.peg===e.peg?this:super.unify(e,t)}},t.StringVal=class extends a{constructor(e,t){super(e,String,t)}unify(e,t){return super.unify(e,t)}get canon(){return JSON.stringify(this.peg)}};class c extends a{constructor(e,t){super(e,Boolean,t)}unify(e,t){return super.unify(e,t)}}t.BooleanVal=c,c.TRUE=new c(!0,new r.Context({vc:1,root:n.TOP})),c.FALSE=new c(!1,new r.Context({vc:2,root:n.TOP}))})),_$unify_7=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Unify=t.Context=void 0;const n=_$type_6({}),r=_$lang_2({}),i=_$op_4({}),o=_$MapVal_12({});class l{constructor(e){this.root=e.root,this.path=[],this.err=e.err||[],this.vc=null==e.vc?1e9:e.vc}clone(e){return new l({root:e.root||this.root,err:e.err||this.err,vc:this.vc})}descend(e){return this.clone({root:this.root,path:this.path.concat(e)})}find(e){if(this.root instanceof o.MapVal&&e.absolute){let t=this.root,n=0;for(;n<e.parts.length&&t instanceof o.MapVal;n++){let r=e.parts[n];t=t.peg[r]}if(n===e.parts.length)return t}}}t.Context=l,t.Unify=class{constructor(e,t){this.lang=t||new r.Lang,"string"==typeof e&&(e=this.lang.parse(e)),this.root=e,this.res=e,this.err=[];let o=e,s=new l({root:o,err:this.err});for(this.dc=0;this.dc<999&&n.DONE!==o.done;this.dc++)o=(0,i.unite)(s,o,n.TOP),s=s.clone({root:o});this.res=o}}})),_$disjunct_3=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disjunct=void 0;const n=_$DisjunctVal_10({});_$ValBase_16({}),t.disjunct=(e,t,r)=>new n.DisjunctVal([],e,[])})),_$DisjunctVal_10=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DisjunctVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$ValBase_16({}),o=_$Nil_13({}),l=_$PrefVal_14({});class s extends i.ValBase{constructor(e,t,n){super(e,t)}append(e){return this.peg.push(e),this}unify(e,t){let i,l=!0,a=[];for(let o=0;o<this.peg.length;o++)a[o]=(0,r.unite)(t,this.peg[o],e),l=l&&n.DONE===a[o].done;if(1<a.length){for(let t=0;t<a.length;t++)a[t]instanceof s&&a.splice(t,1,...a[t].peg);let e=new o.Nil;for(let t=0;t<a.length;t++)for(let n=t+1;n<a.length;n++)a[n].same(a[t])&&(a[n]=e);a=a.filter(e=>!(e instanceof o.Nil))}if(1==a.length)i=a[0];else{if(0==a.length)return o.Nil.make(t,"|:empty",this);i=new s(a,t)}return i.done=l?n.DONE:this.done+1,i}get canon(){return this.peg.map(e=>e.canon).join("|")}gen(e){if(0<this.peg.length){let t=this.peg.filter(e=>e instanceof l.PrefVal),n=(t=0===t.length?this.peg:t)[0];for(let r=1;r<this.peg.length;r++)n=n.unify(this.peg[r],e);return n.gen(e)}}}t.DisjunctVal=s})),_$PrefVal_14=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrefVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$Nil_13({}),o=_$ValBase_16({});class l extends o.ValBase{constructor(e,t,n){super(e,n),this.pref=t||e}unify(e,t){let o,s=!0;return o=e instanceof l?new l((0,r.unite)(t,this.peg,e.peg,"Pref000"),(0,r.unite)(t,this.pref,e.pref,"Pref010"),t):new l((0,r.unite)(null==t?void 0:t.clone({err:[]}),this.peg,e,"Pref020"),(0,r.unite)(null==t?void 0:t.clone({err:[]}),this.pref,e,"Pref030"),t),s=s&&n.DONE===o.peg.done&&(null==o.pref||n.DONE===o.pref.done),o.peg instanceof i.Nil?o=o.pref:o.pref instanceof i.Nil&&(o=o.peg),o.done=s?n.DONE:this.done+1,o}same(e){if(null==e)return!1;let t=this.peg===e.peg||this.peg instanceof o.ValBase&&this.peg.same(e.peg),n=e instanceof l&&(this.pref===e.pref||this.pref instanceof o.ValBase&&this.pref.same(e.pref));return t&&n}get canon(){return this.pref instanceof i.Nil?this.peg.canon:"*"+this.pref.canon}gen(e){let t=this.pref instanceof i.Nil?this.peg instanceof i.Nil?void 0:this.peg:this.pref;return void 0===t?void 0:t.gen(e)}}t.PrefVal=l})),_$Nil_13=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Nil=void 0;const n=_$type_6({}),r=_$ValBase_16({});class i extends r.ValBase{constructor(e,t){super(null,t),this.nil=!0,this.why=e,this.done=n.DONE}unify(e,t){return this}get canon(){return"nil"}gen(e){}}t.Nil=i,i.make=(e,t,n,r)=>{let o=new i(t,e);return null!=n&&(o.row=n.row,o.col=n.col,o.url=n.url,o.primary=n,null!=r)&&(o.secondary=r,o.url===r.url&&(o.row<r.row||o.row===r.row&&o.col<r.col)&&(o.row=r.row,o.col=r.col,o.url=r.url,o.primary=r,o.secondary=n)),e&&e.err.push(o),o}})),_$ValBase_16=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValBase=void 0;const n=_$lang_2({});t.ValBase=class{constructor(e,t){this.done=0,this.row=-1,this.col=-1,this.url="",this.peg=e,this.path=t&&t.path||[],this.id=t&&t.vc++||9e9+Math.floor(1e9*Math.random())}same(e){return null!=e&&this.id===e.id}get site(){return new n.Site(this)}}})),_$type_6=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TOP=t.DONE=void 0;const n=_$lang_2({});t.DONE=-1;const r={id:0,top:!0,peg:void 0,done:-1,path:[],row:-1,col:-1,url:"",unify:(e,t)=>e,get canon(){return"top"},get site(){return new n.Site(this)},same:e=>r===e,gen:e=>{}};t.TOP=r})),_$multisource_20=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TOP=t.NONE=t.resolvePathSpec=t.MultiSource=void 0;const n=_$jsonic_22({});t.NONE="";const r=Symbol("TOP");t.TOP=r;const i=(e,t)=>{const n=t.markchar,r=t.resolver,i=t.processor,o=t.implictExt||[];for(let s=0;s<o.length;s++){let e=o[s];o[s]=e.startsWith(".")?e:"."+e}e.options({error:{multisource_not_found:"source not found: $path"},hint:{multisource_not_found:"The source path $path was not found."}});let l={name:"multisource",open:n,action:function(n,o){var l;let s=n.child.node,a=r(s,t,n,o,e);if(!a.found)return null===(l=n.parent)||void 0===l?void 0:l.o0.bad("multisource_not_found",{...a});a.kind=null==a.kind?"":a.kind,(i[a.kind]||i[""])(a,t,n,o,e),n.node=a.val}};e.use(_$directiveMin_17.Directive,l)};function o(e){return t=>t.val=e(t.src,t)}t.MultiSource=i;const l=o(e=>e),s=o(e=>null==e?void 0:JSON.parse(e)),a=(0,n.makeJsonicProcessor)(),c=(0,_$js_21.makeJavaScriptProcessor)();i.defaults={markchar:"@",processor:{"":l,jsonic:a,jsc:a,json:s,js:c},implictExt:["jsonic","jsc","json","js"]},t.resolvePathSpec=function(e,t,n,r){var i;let o=null===(i=t.meta)||void 0===i?void 0:i.multisource,l=r(null==o||null==o.path?e.path:o.path),s="string"==typeof n?n:null!=n.path?""+n.path:void 0,a=!(!(null==s?void 0:s.startsWith("/"))&&!(null==s?void 0:s.startsWith("\\"))),c=a?s:null!=s&&""!=s?null!=l&&""!=l?l+"/"+s:s:void 0;return{kind:null==c?"":(c.match(/\.([^.]*)$/)||["",""])[1],path:s,full:c,base:l,abs:a,found:!1}}})),_$jsonic_22=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeJsonicProcessor=void 0;const n=_$multisource_20({});t.makeJsonicProcessor=function(){return function(e,t,r,i,o){var l;if(null!=e.src&&null!=e.full){let t=(null===(l=i.meta)||void 0===l?void 0:l.multisource)||{},r={...i.meta||{},multisource:{...t,path:e.full}};if(e.val=o(e.src,r),t.deps){let r=t.deps,i=t.path||n.TOP;if(null!=i){let t={tar:i,src:e.full,wen:Date.now()};r[i]=r[i]||{},r[i][e.full]=t}}}}}})),_$jsonicMin_19={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$jsonicMin_19.exports?_$jsonicMin_19.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).Jsonic=t()}((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.values=t.keys=t.omap=t.str=t.prop=t.normalt=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 i=n({}),o=e=>null==e?[]:Object.keys(e);t.keys=o,t.values=e=>null==e?[]:Object.values(e),t.entries=e=>null==e?[]:Object.entries(e);const l=(e,...t)=>Object.assign(null==e?{}:e,...t);t.assign=l,t.isarr=e=>Array.isArray(e);const s=Object.defineProperty;t.defprop=s;const a=(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 i=2;for(;void 0!==r[i];)e[r[i]]=r[i+1],i+=2;return e},{});t.omap=a;const c={indent:" ",space:" ",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"};t.S=c;class u extends SyntaxError{constructor(e,t,n,r,i){let o=x(e,t=h({},t),n,r,i);super(o.message),l(this,o),g(this)}toJSON(){return{...this,__error:!0,name:this.name,message:this.message,stack:this.stack}}}function p(e,t,n){let i=t.t,o=i[e];return null==o&&r.STRING===typeof e&&(i[o=t.tI++]=e,i[e]=o,i[e.substring(1)]=o,null!=n&&l(n.token,t.t)),o}function d(e,...t){return new RegExp(t.map(e=>e.esc?f(e.toString()):e).join(r.EMPTY),null==e?"":e)}function f(e){return null==e?"":e.replace(/[-\\|\]{}()[^$+*?.!=]/g,"\\$&").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n")}function h(e,...t){let n=c.function===typeof e,r=null!=e&&(c.object===typeof e||n);for(let i of t){let t,o=c.function===typeof i,l=null!=i&&(c.object===typeof i||o);if(r&&l&&!o&&Array.isArray(e)===Array.isArray(i))for(let n in i)e[n]=h(e[n],i[n]);else e=void 0===i?e:o?i:l?c.function===typeof(t=i.constructor)&&c.Object!==t.name&&c.Array!==t.name?i:h(Array.isArray(i)?[]:{},i):i,n=c.function===typeof e,r=null!=e&&(c.object===typeof e||n)}return e}function m(e,t,n,r,i,o){let l={code:t,details:n,token:r,rule:i,ctx:o};return null==e?"":e.replace(/\$([\w_]+)/g,(e,t)=>{let s=JSON.stringify(null!=l[t]?l[t]:null!=n[t]?n[t]:o.meta&&null!=o.meta[t]?o.meta[t]:null!=r[t]?r[t]:null!=i[t]?i[t]:null!=o.opts[t]?o.opts[t]:null!=o.cfg[t]?o.cfg[t]:null!=o[t]?o[t]:"$"+t);return null==s?"":s})}function g(e){e.stack&&(e.stack=e.stack.split("\n").filter(e=>!e.includes("jsonic/jsonic")).map(e=>e.replace(/ at /,"at ")).join("\n"))}function v(e,t,n){let i=0<n.sI?n.sI:0,o=0<n.rI?n.rI:1,l=0<n.cI?n.cI:1,s=null==n.src?r.EMPTY:n.src,a=e.substring(Math.max(0,i-333),i).split("\n"),c=e.substring(i,i+333).split("\n"),u=2+(r.EMPTY+(o+2)).length,p=o<3?1:o-2,d=e=>"\x1b[34m"+(r.EMPTY+p++).padStart(u," ")+" | \x1b[0m"+(null==e?r.EMPTY:e),f=a.length;return[2<f?d(a[f-3]):null,1<f?d(a[f-2]):null,d(a[f-1]+c[0])," ".repeat(u)+" "+" ".repeat(l-1)+"\x1b[31m"+"^".repeat(s.length||1)+" "+t+"\x1b[0m",d(c[1]),d(c[2])].filter(e=>null!=e).join("\n")}function x(e,t,n,r,i){try{let o=i.cfg,l=i.meta,s=m(o.error[e]||o.error.unknown,e,t,n,r,i);c.function===typeof o.hint&&(o.hint={...o.hint(),...o.hint});let a=["\x1b[31m[jsonic/"+e+"]:\x1b[0m "+s," \x1b[34m--\x3e\x1b[0m "+(l&&l.fileName||"<no-file>")+":"+n.rI+":"+n.cI,v(i.src(),s,n),"",m((o.hint[e]||o.hint.unknown||"").trim().split("\n").map(e=>" "+e).join("\n"),e,t,n,r,i),""," \x1b[2mhttps://jsonic.senecajs.org\x1b[0m"," \x1b[2m--internal: rule="+r.name+"~"+r.state+"; token="+p(n.tin,i.cfg)+(null==n.why?"":"~"+n.why)+"; plugins="+i.plgn().map(e=>e.name).join(",")+"--\x1b[0m\n"].join("\n"),u={internal:{token:n,ctx:i}};return u={...Object.create(u),message:a,code:e,details:t,meta:l,fileName:l?l.fileName:void 0,lineNumber:n.rI,columnNumber:n.cI}}catch(o){return console.log(o),{}}}function k(e){return"function"==typeof e.debug.print.src?e.debug.print.src:(t,n)=>null==t?r.EMPTY:(n=JSON.stringify(t)).substring(0,e.debug.maxlen)+(e.debug.maxlen<n.length?"...":r.EMPTY)}function _(e,t=44){let n;try{n="object"==typeof e?JSON.stringify(e):""+e}catch(r){n=""+e}return b(t<n.length?n.substring(0,t-3)+"...":n,t)}function b(e,t=5){return void 0===e?"":(""+e).substring(0,t).replace(/[\r\n\t]/g,".")}function y(...e){return null==e?{}:e.filter(e=>!1!==e).map(e=>"object"==typeof e?o(e).join(r.EMPTY):e).join(r.EMPTY).split(r.EMPTY).reduce((e,t)=>(e[t]=t.charCodeAt(0),e),{})}function j(e){for(let t in e)null==e[t]&&delete e[t];return e}t.JsonicError=u,t.configure=function(e,t,n){var r,i,s,c,u,h,m,g,v,x,k,_,b,O,E,S,M,N,T,P,I,w,C,$,A,R,V,L,F,D,Y,B,U,J,z,Z,q,K,W;const G=t||{};G.t=G.t||{},G.tI=G.tI||1;const H=e=>p(e,G);!1!==n.standard$&&(H("#BD"),H("#ZZ"),H("#UK"),H("#AA"),H("#SP"),H("#LN"),H("#CM"),H("#NR"),H("#ST"),H("#TX"),H("#VL")),G.fixed={lex:!!(null===(r=n.fixed)||void 0===r?void 0:r.lex),token:n.fixed?a(j(n.fixed.token),([e,t])=>[t,p(e,G)]):{},ref:void 0},G.fixed.ref=a(G.fixed.token,([e,t])=>[e,t]),G.fixed.ref=Object.assign(G.fixed.ref,a(G.fixed.ref,([e,t])=>[t,e])),G.tokenSet=n.tokenSet?Object.keys(n.tokenSet).reduce((e,t)=>(e[t]=n.tokenSet[t].filter(e=>null!=e).map(e=>H(e)),e),{...G.tokenSet}):{},G.tokenSetDerived={ignore:Object.fromEntries(((null===(i=n.tokenSet)||void 0===i?void 0:i.ignore)||[]).map(e=>[H(e),!0]))},G.space={lex:!!(null===(s=n.space)||void 0===s?void 0:s.lex),chars:y(null===(c=n.space)||void 0===c?void 0:c.chars)},G.line={lex:!!(null===(u=n.line)||void 0===u?void 0:u.lex),chars:y(null===(h=n.line)||void 0===h?void 0:h.chars),rowChars:y(null===(m=n.line)||void 0===m?void 0:m.rowChars)},G.text={lex:!!(null===(g=n.text)||void 0===g?void 0:g.lex),modify:((null===(v=G.text)||void 0===v?void 0:v.modify)||[]).concat(([null===(x=n.text)||void 0===x?void 0:x.modify]||[]).flat()).filter(e=>null!=e)},G.number={lex:!!(null===(k=n.number)||void 0===k?void 0:k.lex),hex:!!(null===(_=n.number)||void 0===_?void 0:_.hex),oct:!!(null===(b=n.number)||void 0===b?void 0:b.oct),bin:!!(null===(O=n.number)||void 0===O?void 0:O.bin),sep:null!=(null===(E=n.number)||void 0===E?void 0:E.sep)&&""!==n.number.sep,exclude:null===(S=n.number)||void 0===S?void 0:S.exclude,sepChar:null===(M=n.number)||void 0===M?void 0:M.sep},G.value={lex:!!(null===(N=n.value)||void 0===N?void 0:N.lex),map:(null===(T=n.value)||void 0===T?void 0:T.map)||{}},G.rule={start:null==(null===(P=n.rule)||void 0===P?void 0:P.start)?"val":n.rule.start,maxmul:null==(null===(I=n.rule)||void 0===I?void 0:I.maxmul)?3:n.rule.maxmul,finish:!!(null===(w=n.rule)||void 0===w?void 0:w.finish),include:(null===(C=n.rule)||void 0===C?void 0:C.include)?n.rule.include.split(/\s*,+\s*/).filter(e=>""!==e):[],exclude:(null===($=n.rule)||void 0===$?void 0:$.exclude)?n.rule.exclude.split(/\s*,+\s*/).filter(e=>""!==e):[]},G.map={extend:!!(null===(A=n.map)||void 0===A?void 0:A.extend),merge:null===(R=n.map)||void 0===R?void 0:R.merge},G.list={property:!!(null===(V=n.list)||void 0===V?void 0:V.property)};let Q=Object.keys(G.fixed.token).sort((e,t)=>t.length-e.length).map(e=>f(e)).join("|"),X=(null===(L=n.comment)||void 0===L?void 0:L.lex)?(n.comment.marker||[]).filter(e=>e.lex).map(e=>f(e.start)).join("|"):"",ee=["([",f(o(y(G.space.lex&&G.space.chars,G.line.lex&&G.line.chars)).join("")),"]",("string"==typeof n.ender?n.ender.split(""):Array.isArray(n.ender)?n.ender:[]).map(e=>"|"+f(e)).join(""),""===Q?"":"|",Q,""===X?"":"|",X,"|$)"];return G.rePart={fixed:Q,ender:ee,commentStart:X},G.re={ender:d(null,...ee),rowChars:d(null,f(null===(F=n.line)||void 0===F?void 0:F.rowChars)),columns:d(null,"["+f(null===(D=n.line)||void 0===D?void 0:D.chars)+"]","(.*)$")},G.lex={empty:!!(null===(Y=n.lex)||void 0===Y?void 0:Y.empty),match:(null===(B=n.lex)||void 0===B?void 0:B.match)?n.lex.match.map(e=>e(G,n)):[]},G.debug={get_console:(null===(U=n.debug)||void 0===U?void 0:U.get_console)||(()=>console),maxlen:null==(null===(J=n.debug)||void 0===J?void 0:J.maxlen)?99:n.debug.maxlen,print:{config:!!(null===(Z=null===(z=n.debug)||void 0===z?void 0:z.print)||void 0===Z?void 0:Z.config),src:null===(K=null===(q=n.debug)||void 0===q?void 0:q.print)||void 0===K?void 0:K.src}},G.error=n.error||{},G.hint=n.hint||{},(null===(W=n.config)||void 0===W?void 0:W.modify)&&o(n.config.modify).forEach(e=>n.config.modify[e](G,n)),G.debug.print.config&&G.debug.get_console().dir(G,{depth:null}),G.result={fail:[]},n.result&&(G.result.fail=[...n.result.fail]),l(e.options,n),l(e.token,G.t),l(e.fixed,G.fixed.ref),G},t.tokenize=p,t.mesc=function(e,t){return(t=new String(e)).esc=!0,t},t.regexp=d,t.escre=f,t.deep=h,t.errinject=m,t.trimstk=g,t.extract=v,t.errdesc=x,t.badlex=function(e,t,n){let r=r=>{let i=e.next(r);if(t===i.tin){let e={};throw null!=i.use&&(e.use=i.use),new u(i.why||c.unexpected,e,i,r,n)}return i};return r.src=e.src,r},t.makelog=function(e,t){if(t)if("number"==typeof t.log){let n=!1,r=t.log;-1===r&&(r=1,n=!0),e.log=(...t)=>{if(n){let n=t.filter(e=>c.object!=typeof e).map(e=>c.function==typeof e?e.name:e).join(c.indent);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=k,t.str=_,t.snip=b,t.clone=function(e){return h(Object.create(Object.getPrototypeOf(e)),e)},t.charset=y,t.clean=j,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.normalt=function(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*/)),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),i=t([e.s[0]]),o=t([e.s[1]]),l=e;l.S0=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,l.S1=0<o.length?new Array(Math.max(...o.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(o,e),e)):null}else e.s=null;return e},t.prop=function(e,t,n){try{let r,i=t.split(".");for(let t=0;t<i.length;t++)r=i[t],t<i.length-1&&(e=e[r]=e[r]||{});return void 0!==n&&(e[r]=n),e[r]}catch(i){throw new Error("Cannot "+(void 0===n?"get":"set")+" path "+t+" on object: "+_(r)+(void 0===n?"":" to value: "+_(n,22)))}},t.parserwrap=function(e){return{start:function(t,n,o,l){try{return e.start(t,n,o,l)}catch(s){if("SyntaxError"===s.name){let l=0,a=0,c=0,d=r.EMPTY,f=s.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);if(f){d=f[1],l=parseInt(f[2]),a=t.substring(0,l).replace(/[^\n]/g,r.EMPTY).length;let e=l-1;for(;-1<e&&"\n"!==t.charAt(e);)e--;c=Math.max(t.substring(e,l).length,0)}let h=s.token||(0,i.makeToken)("#UK",p("#UK",n.internal().config),void 0,d,(0,i.makePoint)(d.length,l,s.lineNumber||a,s.columnNumber||c));throw new u(s.code||"json",s.details||{msg:s.message},h,{},s.ctx||{uI:-1,opts:n.options,cfg:n.internal().config,token:h,meta:o,src:()=>t,root:()=>{},plgn:()=>n.internal().plugins,rule:{name:"no-rule"},xs:-1,v2:h,v1:h,t0:h,t1:h,tC:-1,rs:[],rsI:0,next:()=>h,rsm:{},n:{},log:o?o.log:void 0,F:k(n.internal().config),use:{},NORULE:{name:"no-rule"},NOTOKEN:{name:"no-token"}})}throw s}}}}})),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.makeToken=n.makePoint=n.makeLex=n.makeNoToken=void 0;const i=t({});class o{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 l=(...e)=>new o(...e);n.makePoint=l;class s{constructor(e,t,n,i,o,l,s){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=i,this.val=n,this.sI=o.sI,this.rI=o.rI,this.cI=o.cI,this.use=l,this.why=s,this.len=null==i?0:i.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,i.deep)(this.use||{},t)),this}toString(){return"Token["+this.name+"="+this.tin+" "+(0,i.snip)(this.src)+(void 0===this.val||"#ST"===this.name||"#TX"===this.name?"":"="+(0,i.snip)(this.val))+" "+[this.sI,this.rI,this.cI]+(null==this.use?"":" "+(0,i.snip)(""+JSON.stringify(this.use).replace(/"/g,""),22))+(null==this.err?"":" "+this.err)+(null==this.why?"":" "+(0,i.snip)(""+this.why,22))+"]"}[r.INSPECT](){return this.toString()}}const a=(...e)=>new s(...e);function c(e,t,n){let r=e.pnt,i=t;if(e.cfg.fixed.lex&&null!=n&&0<n.length){let o=void 0,l=e.cfg.fixed.token[n];null!=l&&(o=e.token(l,void 0,n,r)),null!=o&&(r.sI+=o.src.length,r.cI+=o.src.length,null==t?i=o:r.token.push(o))}return i}n.makeToken=a,n.makeNoToken=()=>a("",-1,void 0,r.EMPTY,l(-1)),n.makeFixedMatcher=(e,t)=>{let n=(0,i.regexp)(null,"^(",e.rePart.fixed,")");return function(t){let r=e.fixed;if(!r.lex)return;let i=t.pnt,o=t.src.substring(i.sI).match(n);if(o){let e=o[1],n=e.length;if(0<n){let o=void 0,l=r.token[e];return null!=l&&(o=t.token(l,void 0,e,i),i.sI+=n,i.cI+=n),o}}}},n.makeCommentMatcher=(e,t)=>{let n=t.comment;e.comment={lex:!!n&&!!n.lex,marker:((null==n?void 0:n.marker)||[]).map(e=>({start:e.start,end:e.end,line:!!e.line,lex:!!e.lex}))};let r=e.comment.lex?e.comment.marker.filter(e=>e.lex&&e.line):[],o=e.comment.lex?e.comment.marker.filter(e=>e.lex&&!e.line):[];return function(t){if(!e.comment.lex)return;let n=t.pnt,l=t.src.substring(n.sI),s=n.rI,a=n.cI;for(let i of r)if(l.startsWith(i.start)){let r=l.length,o=i.start.length;for(a+=i.start.length;o<r&&!e.line.chars[l[o]];)a++,o++;let s=l.substring(0,o),c=t.token("#CM",void 0,s,n);return n.sI+=s.length,n.cI=a,c}for(let r of o)if(l.startsWith(r.start)){let o=l.length,c=r.start.length,u=r.end;for(a+=r.start.length;c<o&&!l.substring(c).startsWith(u);)e.line.rowChars[l[c]]&&(s++,a=0),a++,c++;if(l.substring(c).startsWith(u)){a+=u.length;let e=l.substring(0,c+u.length),r=t.token("#CM",void 0,e,n);return n.sI+=e.length,n.rI=s,n.cI=a,r}return t.bad(i.S.unterminated_comment,n.sI,n.sI+9*r.start.length)}}},n.makeTextMatcher=(e,t)=>{let n=(0,i.regexp)(e.line.lex?null:"s","^(.*?)",...e.rePart.ender);return function(r){let i=e.text,o=r.pnt,l=r.src.substring(o.sI),s=e.value.map,a=l.match(n);if(a){let n=a[1],l=a[2],u=void 0;if(null!=n){let t=n.length;if(0<t){let l=void 0;e.value.lex&&void 0!==(l=s[n])?(u=r.token("#VL",l.val,n,o),o.sI+=t,o.cI+=t):i.lex&&(u=r.token("#TX",n,n,o),o.sI+=t,o.cI+=t)}}if(u&&(u=c(r,u,l)),u&&0<e.text.modify.length){const n=e.text.modify;for(let i=0;i<n.length;i++)u.val=n[i](u.val,r,e,t)}return u}}},n.makeNumberMatcher=(e,t)=>{let n=e.number,r=(0,i.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,i.escre)(n.sepChar):""),")",...e.rePart.ender),o=n.sep?(0,i.regexp)("g",(0,i.escre)(n.sepChar)):void 0;return function(t){if(!(n=e.number).lex)return;let i=t.pnt,l=t.src.substring(i.sI),s=e.value.map,a=l.match(r);if(a){let n=a[1],r=a[9],l=void 0,u=!0;if(null!=n&&(u=!e.number.exclude||!n.match(e.number.exclude))){let r=n.length;if(0<r){let a=void 0;if(e.value.lex&&void 0!==(a=s[n]))l=t.token("#VL",a.val,n,i);else{let e=o?n.replace(o,""):n,s=+e;if(isNaN(s)){let t=e[0];"-"!==t&&"+"!==t||(s=("-"===t?-1:1)*+e.substring(1))}isNaN(s)||(l=t.token("#NR",s,n,i),i.sI+=r,i.cI+=r)}}}return u&&(l=c(t,l,r)),l}}},n.makeStringMatcher=(e,t)=>{let n=t.string||{};return e.string=e.string||{},e.string=(0,i.deep)(e.string,{lex:!!(null==n?void 0:n.lex),quoteMap:(0,i.charset)(n.chars),multiChars:(0,i.charset)(n.multiChars),escMap:(0,i.clean)({...n.escape}),escChar:n.escapeChar,escCharCode:null==n.escapeChar?void 0:n.escapeChar.charCodeAt(0),allowUnknown:!!n.allowUnknown,replaceCodeMap:(0,i.omap)((0,i.clean)({...n.replace}),([e,t])=>[e.charCodeAt(0),t]),hasReplace:!1}),e.string.hasReplace=0<(0,i.keys)(e.string.replaceCodeMap).length,function(t){let n=e.string;if(!n.lex)return;let{quoteMap:o,escMap:l,escChar:s,escCharCode:a,multiChars:c,allowUnknown:u,replaceCodeMap:p,hasReplace:d}=n,{pnt:f,src:h}=t,{sI:m,rI:g,cI:v}=f,x=h.length;if(o[h[m]]){const n=h[m],o=m,k=g,_=c[n];++m,++v;let b,y=[];for(;m<x;m++){v++;let r=h[m];if(b=void 0,n===r){m++;break}if(s===r){v++;let e=l[h[++m]];if(null!=e)y.push(e);else if("x"===h[m]){m++;let e=parseInt(h.substring(m,m+2),16);if(isNaN(e))return m-=2,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_ascii,m,m+4);let n=String.fromCharCode(e);y.push(n),m+=1,v+=2}else if("u"===h[m]){let e="{"===h[++m]?(m++,1):0,n=e?6:4,r=parseInt(h.substring(m,m+n),16);if(isNaN(r))return m=m-2-e,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_unicode,m,m+n+2+2*e);let o=String.fromCodePoint(r);y.push(o),m+=n-1+e,v+=n+e}else{if(!u)return f.sI=m,f.cI=v-1,t.bad(i.S.unexpected,m,m+1);y.push(h[m])}}else if(d&&void 0!==(b=p[h.charCodeAt(m)]))y.push(b),v++;else{let r=m,o=n.charCodeAt(0),l=h.charCodeAt(m);for(;(!d||void 0===(b=p[l]))&&m<x&&32<=l&&o!==l&&a!==l;)l=h.charCodeAt(++m),v++;if(v--,void 0===b&&l<32){if(!_||!e.line.chars[h[m]])return f.sI=m,f.cI=v,t.bad(i.S.unprintable,m,m+1);e.line.rowChars[h[m]]&&(f.rI=++g),v=1,y.push(h.substring(r,m+1))}else y.push(h.substring(r,m)),m--}}if(h[m-1]!==n||f.sI===m-1)return f.rI=k,t.bad(i.S.unterminated_string,o,m);const j=t.token("#ST",y.join(r.EMPTY),h.substring(f.sI,m),f);return f.sI=m,f.rI=g,f.cI=v,j}}},n.makeLineMatcher=(e,t)=>function(t){if(!e.line.lex)return;let{chars:n,rowChars:r}=e.line,{pnt:i,src:o}=t,{sI:l,rI:s}=i;for(;n[o[l]];)s+=r[o[l]]?1:0,l++;if(i.sI<l){let e=o.substring(i.sI,l);const n=t.token("#LN",void 0,e,i);return i.sI+=e.length,i.rI=s,i.cI=1,n}},n.makeSpaceMatcher=(e,t)=>function(t){if(!e.space.lex)return;let{chars:n}=e.space,{pnt:r,src:i}=t,{sI:o,cI:l}=r;for(;n[i[o]];)o++,l++;if(r.sI<o){let e=i.substring(r.sI,o);const n=t.token("#SP",void 0,e,r);return r.sI+=e.length,r.cI=l,n}};class u{constructor(e){this.src=r.EMPTY,this.ctx={},this.cfg={},this.pnt=l(-1),this.ctx=e,this.src=e.src(),this.cfg=e.cfg,this.pnt=l(this.src.length)}token(e,t,n,r,o,l){let s,c;return"string"==typeof e?(c=e,s=(0,i.tokenize)(c,this.cfg)):(s=e,c=(0,i.tokenize)(e,this.cfg)),a(c,s,t,n,r||this.pnt,o,l)}next(e){let t,n,r=this.pnt,o=r.sI;if(r.end)t=r.end;else if(0<r.token.length)t=r.token.shift();else if(r.len<=r.sI)r.end=this.token("#ZZ",void 0,"",r),t=r.end;else{for(let r of this.cfg.lex.match)if(t=r(this,e)){n=r;break}t=t||this.token("#BD",void 0,this.src[r.sI],r,void 0,"unexpected")}return this.ctx.log&&this.ctx.log(i.S.indent.repeat(e.d)+i.S.lex,(0,i.tokenize)(t.tin,this.cfg),this.ctx.F(t.src),r.sI,r.rI+":"+r.cI,(null==n?void 0:n.name)||"none",this.ctx.F(this.src.substring(o,o+16))),t}tokenize(e){return(0,i.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 i={};Object.defineProperty(i,"__esModule",{value:!0}),i.defaults=void 0;const o=n({}),l={tag:"-",fixed:{lex:!0,token:{"#OB":"{","#CB":"}","#OS":"[","#CS":"]","#CL":":","#CA":","}},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"},text:{lex:!0},number:{lex:!0,hex:!0,oct:!0,bin:!0,sep:"_",exclude:void 0},comment:{lex:!0,marker:[{line:!0,start:"#",lex:!0},{line:!0,start:"//",lex:!0},{line:!1,start:"/*",end:"*/",lex:!0}]},string:{lex:!0,chars:"'\"`",multiChars:"`",escapeChar:"\\",escape:{b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",'"':'"',"'":"'","`":"`","\\":"\\","/":"/"},allowUnknown:!0},map:{extend:!0,merge:void 0},list:{property:!0},value:{lex:!0,map:{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,i)=>(n[r]=e(t[i]),n),{})},lex:{match:[o.makeFixedMatcher,o.makeSpaceMatcher,o.makeLineMatcher,o.makeStringMatcher,o.makeCommentMatcher,o.makeNumberMatcher,o.makeTextMatcher],empty:!0},rule:{start:"val",finish:!0,maxmul:3,include:"",exclude:""},result:{fail:[]},config:{modify:{}},parser:{start:void 0}};i.defaults=l;var s={};Object.defineProperty(s,"__esModule",{value:!0}),s.Parser=s.makeRuleSpec=s.makeRule=void 0;const a=t({}),c=n({});class u{constructor(e,t,n){this.id=-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.id=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){return this.spec.process(this,e,this.state)}}const p=(...e)=>new u(...e);s.makeRule=p;class d{constructor(){this.p=r.EMPTY,this.r=r.EMPTY,this.b=0}}const f=(...e)=>new d(...e),h=f(),m=f();class g{constructor(e,t){this.name=r.EMPTY,this.def={open:[],close:[],bo:[],bc:[],ao:[],ac:[]},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])(0,a.normalt)(n)}tin(e){return(0,a.tokenize)(e,this.cfg)}add(e,t,n){let r=(null==n?void 0:n.append)?"push":"unshift",i=((0,a.isarr)(t)?t:[t]).filter(e=>null!=e&&"object"==typeof e).map(e=>(0,a.normalt)(e)),o="o"===e?"open":"close",l=this.def[o];if(l[r](...i),n){if(n.delete)for(let e=0;e<n.delete.length;e++)l[(l.length+n.delete[e])%l.length]=null;if(n.move)for(let e=0;e<n.move.length;e+=2){let t=(l.length+n.move[e])%l.length,r=(l.length+n.move[e+1])%l.length,i=l[t];l.splice(t,1),l.splice(r,0,i)}this.def[o]=l.filter(e=>null!=e)}return(0,a.filterRules)(this,this.cfg),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 i=this.def[t+n];return e?i.push(r):i.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}process(e,t,n){let i=r.EMPTY,o=t.F,l="o"===n,s=l?e:t.NORULE,c=this.def,u=l?c.open:c.close,d=l?e.bo?c.bo:null:e.bc?c.bc:null;if(d){let n=void 0;for(let r=0;r<d.length;r++)if((null==(n=d[r].call(this,e,t,s,n))?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}let f=0<u.length?this.parse_alts(l,u,e,t):m;if(f.h&&(f=f.h(e,t,f,s)||f,i+="H"),f.e)return this.bad(f.e,e,t,{is_open:l});if(f.n)for(let r in f.n)e.n[r]=0===f.n[r]?0:(null==e.n[r]?0:e.n[r])+f.n[r];if(f.u&&(e.use=Object.assign(e.use,f.u)),f.k&&(e.keep=Object.assign(e.keep,f.k)),f.a){i+="A";let n=f.a.call(this,e,t,f);if(n&&n.isToken&&n.err)return this.bad(n,e,t,{is_open:l})}if(f.p){t.rs[t.rsI++]=e;let n=t.rsm[f.p];if(!n)return this.bad(this.unknownRule(t.t0,f.p),e,t,{is_open:l});(s=e.child=p(n,t,e.node)).parent=e,s.n={...e.n},0<Object.keys(e.keep).length&&(s.keep={...e.keep}),i+="@p:"+f.p}else if(f.r){let n=t.rsm[f.r];if(!n)return this.bad(this.unknownRule(t.t0,f.r),e,t,{is_open:l});(s=p(n,t,e.node)).parent=e.parent,s.prev=e,s.n={...e.n},0<Object.keys(e.keep).length&&(s.keep={...e.keep}),i+="@r:"+f.r}else l||(s=t.rs[--t.rsI]||t.NORULE),i+="Z";let h=l?e.ao?c.ao:null:e.ac?c.ac:null;if(h){let n=void 0;for(let r=0;r<h.length;r++)if((null==(n=h[r].call(this,e,t,s,n))?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}s.why=i,t.log&&t.log(a.S.indent.repeat(e.d)+a.S.node+a.S.space,e.state.toUpperCase(),(e.prev.id+"/"+e.parent.id+"/"+e.child.id).padEnd(12),e.name+"~"+e.id,"w="+i,"n:"+(0,a.entries)(e.n).filter(e=>e[1]).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(e.use).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(e.keep).map(e=>e[0]+"="+e[1]).join(";"),"<"+o(e.node)+">");let g=0,v=e[l?"os":"cs"]-(f.b||0);for(;g++<v;)t.next();return r.OPEN===e.state&&(e.state=r.CLOSE),s}parse_alts(e,t,n,i){let o=h;o.b=0,o.p=r.EMPTY,o.r=r.EMPTY,o.n=void 0,o.h=void 0,o.a=void 0,o.u=void 0,o.k=void 0,o.e=void 0;let l,s=null,c=0,u=i.cfg.t,p=1<<u.AA-1,d=t.length;for(c=0;c<d;c++){s=t[c];let r=i.t0.tin,a=!1,u=!1;if(l=!0,s.S0&&(a=!0,(l=s.S0[r/31|0]&(1<<r%31-1|p))&&(u=null!=s.S1,s.S1))){u=!0;let e=i.t1.tin;l=s.S1[e/31|0]&(1<<e%31-1|p)}if(e?(n.o0=a?i.t0:i.NOTOKEN,n.o1=u?i.t1:i.NOTOKEN,n.os=(a?1:0)+(u?1:0)):(n.c0=a?i.t0:i.NOTOKEN,n.c1=u?i.t1:i.NOTOKEN,n.cs=(a?1:0)+(u?1:0)),l&&s.c&&(l=l&&s.c(n,i,o)),l)break;s=null}l||u.ZZ===i.t0.tin||(o.e=i.t0),s&&(o.n=null!=s.n?s.n:o.n,o.h=null!=s.h?s.h:o.h,o.a=null!=s.a?s.a:o.a,o.u=null!=s.u?s.u:o.u,o.k=null!=s.k?s.k:o.k,o.g=null!=s.g?s.g:o.g,o.e=s.e&&s.e(n,i,o)||void 0,o.p=null!=s.p?"string"==typeof s.p?s.p:s.p(n,i,o):o.p,o.r=null!=s.r?"string"==typeof s.r?s.r:s.r(n,i,o):o.r,o.b=null!=s.b?"number"==typeof s.b?s.b:s.b(n,i,o):o.b);let f=c<t.length;return i.log&&i.log(a.S.indent.repeat(n.d)+a.S.parse,n.state.toUpperCase(),(n.prev.id+"/"+n.parent.id+"/"+n.child.id).padEnd(12),n.name+"~"+n.id,f?"alt="+c:"no-alt",f&&o.g?"g:"+o.g+" ":"",(f&&o.p?"p:"+o.p+" ":"")+(f&&o.r?"r:"+o.r+" ":"")+(f&&o.b?"b:"+o.b+" ":""),(r.OPEN===n.state?[n.o0,n.o1].slice(0,n.os):[n.c0,n.c1].slice(0,n.cs)).map(e=>e.name+"="+i.F(e.src)).join(" "),"c:"+(s&&s.c?l:r.EMPTY),"n:"+(0,a.entries)(o.n).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(o.u).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(o.k).map(e=>e[0]+"="+e[1]).join(";"),c<t.length&&s.s?"["+s.s.map(e=>Array.isArray(e)?e.map(e=>u[e]).join("|"):u[e]).join(" ")+"]":"[]",o),o}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 v=(...e)=>new g(...e);s.makeRuleSpec=v;class x{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){n=this.rsm[e]=this.rsm[e]||v(this.cfg,{}),(n=this.rsm[e]=t(this.rsm[e],this.rsm)||this.rsm[e]).name=e;for(let e of[...n.def.open,...n.def.close])(0,a.normalt)(e);return}return n}start(e,t,n,i){let o,l=(0,c.makeToken)("#ZZ",(0,a.tokenize)("#ZZ",this.cfg),void 0,r.EMPTY,(0,c.makePoint)(-1)),s=(0,c.makeNoToken)(),u={uI:0,opts:this.options,cfg:this.cfg,meta:n||{},src:()=>e,root:()=>o.node,plgn:()=>t.internal().plugins,rule:{},xs:-1,v2:l,v1:l,t0:l,t1:l,tC:-2,next:_,rs:[],rsI:0,rsm:this.rsm,log:void 0,F:(0,a.srcfmt)(this.cfg),use:{},NOTOKEN:s,NORULE:{}},d=(e=>p(v(e.cfg,{}),e))(u=(0,a.deep)(u,i));if(u.NORULE=d,u.rule=d,(0,a.makelog)(u,n),""===e){if(this.cfg.lex.empty)return;throw new a.JsonicError(a.S.unexpected,{src:e},u.t0,d,u)}let f=e=>(0,a.tokenize)(e,this.cfg),h=(0,a.badlex)((0,c.makeLex)(u),(0,a.tokenize)("#BD",this.cfg),u),m=this.rsm[this.cfg.rule.start];if(null==m)return;let g=p(m,u);o=g;let x=2*(0,a.keys)(this.rsm).length*h.src.length*2*u.cfg.rule.maxmul,k=u.cfg.tokenSetDerived.ignore;function _(){let e;u.v2=u.v1,u.v1=u.t0,u.t0=u.t1;do{e=h(g),u.tC++}while(k[e.tin]);return u.t1=e,u.t0}_(),_();let b=0;for(;d!==g&&b<x;)u.log&&u.log("\n"+a.S.indent.repeat(g.d)+a.S.stack,u.rs.slice(0,u.rsI).map(e=>e.name+"~"+e.id).join("/"),"<<"+u.F(o.node)+">>",u.rs.slice(0,u.rsI).map(e=>"<"+u.F(e.node)+">").join(" "),g,u),u.log&&u.log(a.S.indent.repeat(g.d)+a.S.rule+a.S.space,g.state.toUpperCase(),(g.prev.id+"/"+g.parent.id+"/"+g.child.id).padEnd(12),g.name+"~"+g.id,"["+u.F(u.t0.src)+" "+u.F(u.t1.src)+"]","n:"+(0,a.entries)(g.n).filter(e=>e[1]).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(g.use).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(g.keep).map(e=>e[0]+"="+e[1]).join(";"),"["+f(u.t0.tin)+" "+f(u.t1.tin)+"]",g,u),u.rule=g,g=g.process(u),b++;if((0,a.tokenize)("#ZZ",this.cfg)!==u.t0.tin)throw new a.JsonicError(a.S.unexpected,{},u.t0,d,u);const y=u.root();if(this.cfg.result.fail.includes(y))throw new a.JsonicError(a.S.unexpected,{},u.t0,d,u);return y}clone(e,t){let n=new x(e,t);return n.rsm=Object.keys(this.rsm).reduce((e,t)=>(e[t]=(0,a.filterRules)(this.rsm[t],this.cfg),e),{}),n}}s.Parser=x;var k={};function _(e){const t=e.token.OB,n=e.token.CB,r=e.token.OS,i=e.token.CS,o=e.token.CL,l=e.token.CA,s=e.token.TX,a=e.token.ST,c=e.token.ZZ,u=e.config(),p=u.tokenSet.val,d=u.tokenSet.key,f=e.util.deep,h=(e,t)=>{if(!t.cfg.rule.finish)return t.t0.src="END_OF_SOURCE",t.t0},m=e=>{const t=e.o0,n=a===t.tin||s===t.tin?t.val:t.src;e.use.key=n};e.rule("val",e=>{e.bo(e=>e.node=void 0).open([{s:[t],p:"map",b:1,g:"map,json"},{s:[r],p:"list",b:1,g:"list,json"},{s:[p],g:"val,json"}]).close([{s:[c],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={}}).open([{s:[t,n],g:"map,json"},{s:[t],p:"pair",n:{pk:0},g:"map,json,pair"}])}),e.rule("list",e=>{e.bo(e=>{e.node=[]}).open([{s:[r,i],g:"list,json"},{s:[r],p:"elem",g:"list,elem,json"}])}),e.rule("pair",e=>{e.open([{s:[d,o],p:"val",u:{pair:!0},a:m,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:[n],g:"map,pair,json"},{s:[l],r:"pair",g:"map,pair,json"},{s:[c],e:h,g:"map,pair,json"}])}),e.rule("elem",e=>{e.open([{p:"val",u:{elem:!0},g:"list,elem,val,json"}]).bc(e=>{e.use.elem&&e.node.push(e.child.node)}).close([{s:[l],r:"elem",g:"list,elem,json"},{s:[i],g:"list,elem,json"},{s:[c],e:h,g:"list,elem,json"}])});const g=(e,t)=>{let n=e.use.key,r=e.child.node;const i=e.use.prev;r=void 0===r?null:r,e.node[n]=null==i?r:t.cfg.map.merge?t.cfg.map.merge(i,r):t.cfg.map.extend?f(i,r):r};e.rule("val",e=>{e.open([{s:[d,o],p:"map",b:2,n:{pk:1},g:"pair,jsonic"},{s:[p],g:"val,json"},{s:[[n,i]],b:1,g:"val,imp,null,jsonic"},{s:[l],c:{n:{il:0}},p:"list",b:1,g:"list,imp,jsonic"},{s:[l],b:1,g:"list,val,imp,null,jsonic"}],{append:!0,delete:[2]}).close([{s:[[n,i]],b:1,g:"val,json,close"},{s:[l],c:{n:{il:0,pk:0}},n:{il:1},r:"elem",a:e=>e.node=[e.node],g:"list,val,imp,comma,jsonic"},{c:{n:{il:0,pk:0}},n:{il:1},r:"elem",a:e=>e.node=[e.node],g:"list,val,imp,space,jsonic",b:1}],{append:!0,move:[1,-1]})}),e.rule("map",e=>{e.bo(e=>{e.n.il=1+(e.n.il?e.n.il:0),e.n.im=1+(e.n.im?e.n.im:0)}).open([{s:[d,o],p:"pair",b:2,g:"pair,list,val,imp"}],{append:!0})}),e.rule("list",e=>{e.bo(e=>{e.n.il=1+(e.n.il?e.n.il:0),e.n.pk=1+(e.n.pk?e.n.pk:0),e.n.im=1+(e.n.im?e.n.im:0)}).open([{s:[l],p:"elem",b:1,g:"list,elem,val,imp"},{p:"elem",g:"list,elem"}],{append:!0})}),e.rule("pair",e=>{e.open([{s:[l],g:"map,pair,comma"}],{append:!0}).bc((e,t)=>{e.use.pair&&g(e,t)}).close([{s:[n],c:{n:{pk:0}},g:"map,pair,json"},{s:[l,n],c:{n:{pk:0}},g:"map,pair,comma,jsonic"},{s:[l],c:{n:{pk:0}},r:"pair",g:"map,pair,json"},{s:[l],c:{n:{im:1}},r:"pair",g:"map,pair,jsonic"},{s:[p],c:{n:{pk:0}},r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[p],c:{n:{im:1}},r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[[n,l,...p]],b:1,g:"map,pair,imp,path,jsonic"},{s:[i],b:1,g:"list,pair,imp,jsonic"},{s:[c],e:h,g:"map,pair,json"}],{append:!0,delete:[0,1,2]})}),e.rule("elem",e=>{e.open([{s:[l,l],b:2,a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[l],a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},u.list.property&&{s:[d,o],p:"val",n:{pk:1},u:{elem:!1},a:m,g:"elem,pair,jsonic"}]).bc((e,t)=>{!1===e.use.elem&&(e.use.prev=e.node[e.use.key],g(e,t))}).close([{s:[l,i],g:"list,elem,comma.jsonic"},{s:[l],r:"elem",g:"list,elem,json"},{s:[[...p,t,r]],r:"elem",b:1,g:"list,elem,imp,jsonic"},{s:[i],g:"list,elem,json"},{s:[c],e:h,g:"list,elem,json"}],{delete:[-1,-2,-3]})})}Object.defineProperty(k,"__esModule",{value:!0}),k.makeJSON=k.grammar=void 0,k.grammar=_,k.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 _(t),t};var b={exports:{}};Object.defineProperty(b.exports,"__esModule",{value:!0}),b.exports.AFTER=b.exports.BEFORE=b.exports.CLOSE=b.exports.OPEN=b.exports.makeTextMatcher=b.exports.makeNumberMatcher=b.exports.makeCommentMatcher=b.exports.makeStringMatcher=b.exports.makeLineMatcher=b.exports.makeSpaceMatcher=b.exports.makeFixedMatcher=b.exports.makeLex=b.exports.makeRuleSpec=b.exports.makeRule=b.exports.makePoint=b.exports.makeToken=b.exports.make=b.exports.util=b.exports.Parser=b.exports.JsonicError=b.exports.Jsonic=void 0,Object.defineProperty(b.exports,"OPEN",{enumerable:!0,get:function(){return r.OPEN}}),Object.defineProperty(b.exports,"CLOSE",{enumerable:!0,get:function(){return r.CLOSE}}),Object.defineProperty(b.exports,"BEFORE",{enumerable:!0,get:function(){return r.BEFORE}}),Object.defineProperty(b.exports,"AFTER",{enumerable:!0,get:function(){return r.AFTER}});const y=t({});Object.defineProperty(b.exports,"JsonicError",{enumerable:!0,get:function(){return y.JsonicError}});const j=n({});Object.defineProperty(b.exports,"makePoint",{enumerable:!0,get:function(){return j.makePoint}}),Object.defineProperty(b.exports,"makeToken",{enumerable:!0,get:function(){return j.makeToken}}),Object.defineProperty(b.exports,"makeLex",{enumerable:!0,get:function(){return j.makeLex}}),Object.defineProperty(b.exports,"makeFixedMatcher",{enumerable:!0,get:function(){return j.makeFixedMatcher}}),Object.defineProperty(b.exports,"makeSpaceMatcher",{enumerable:!0,get:function(){return j.makeSpaceMatcher}}),Object.defineProperty(b.exports,"makeLineMatcher",{enumerable:!0,get:function(){return j.makeLineMatcher}}),Object.defineProperty(b.exports,"makeStringMatcher",{enumerable:!0,get:function(){return j.makeStringMatcher}}),Object.defineProperty(b.exports,"makeCommentMatcher",{enumerable:!0,get:function(){return j.makeCommentMatcher}}),Object.defineProperty(b.exports,"makeNumberMatcher",{enumerable:!0,get:function(){return j.makeNumberMatcher}}),Object.defineProperty(b.exports,"makeTextMatcher",{enumerable:!0,get:function(){return j.makeTextMatcher}}),Object.defineProperty(b.exports,"makeRule",{enumerable:!0,get:function(){return s.makeRule}}),Object.defineProperty(b.exports,"makeRuleSpec",{enumerable:!0,get:function(){return s.makeRuleSpec}}),Object.defineProperty(b.exports,"Parser",{enumerable:!0,get:function(){return s.Parser}});const O={tokenize:y.tokenize,srcfmt:y.srcfmt,deep:y.deep,clone:y.clone,charset:y.charset,trimstk:y.trimstk,makelog:y.makelog,badlex:y.badlex,extract:y.extract,errinject:y.errinject,errdesc:y.errdesc,configure:y.configure,parserwrap:y.parserwrap,mesc:y.mesc,escre:y.escre,regexp:y.regexp,prop:y.prop,str:y.str,omap:y.omap,keys:y.keys,values:y.values,entries:y.entries};function E(e,t){if("json"===e)return(0,k.makeJSON)(S);let n={parser:{},config:{},plugins:[],mark:Math.random()},r=(0,y.deep)({},t?{...t.options}:!1===(null==e?void 0:e.defaults$)?{}:i.defaults,e||{}),o=function(e,t,n){var r;if(y.S.string===typeof e){let i=o.internal();return((null===(r=l.parser)||void 0===r?void 0:r.start)?(0,y.parserwrap)(l.parser):i.parser).start(e,o,t,n)}return e},l=e=>{if(null!=e&&y.S.object===typeof e){(0,y.deep)(r,e),(0,y.configure)(o,n.config,r);let t=o.internal().parser;n.parser=t.clone(r,n.config)}return{...o.options}},a={token:e=>(0,y.tokenize)(e,n.config,o),fixed:e=>n.config.fixed.ref[e],options:(0,y.deep)(l,r),config:()=>(0,y.deep)(n.config),parse:o,use:function(e,t){const n=e.name.toLowerCase(),r=(0,y.deep)({},e.defaults||{},t||{});o.options({plugin:{[n]:r}});let i=o.options.plugin[n];return o.internal().plugins.push(e),e(o,i)||o},rule:(e,t)=>o.internal().parser.rule(e,t)||o,lex:e=>{let t=r.lex.match;t.unshift(e),o.options({lex:{match:t}})},make:e=>E(e,o),empty:e=>E({defaults$:!1,standard$:!1,grammar$:!1,...e||{}}),id:"Jsonic/"+Date.now()+"/"+(""+Math.random()).substring(2,8).padEnd(6,"0")+(null==l.tag?"":"/"+l.tag),toString:()=>a.id,util:O};if((0,y.defprop)(a.make,y.S.name,{value:y.S.make}),(0,y.assign)(o,a),(0,y.defprop)(o,"internal",{value:()=>n}),t){for(let n in t)void 0===o[n]&&(o[n]=t[n]);o.parent=t;let e=t.internal();n.config=(0,y.deep)({},e.config),(0,y.configure)(o,n.config,r),(0,y.assign)(o.token,n.config.t),n.plugins=[...e.plugins],n.parser=e.parser.clone(r,n.config)}else n.config=(0,y.configure)(o,void 0,r),n.plugins=[],n.parser=new s.Parser(r,n.config),!1!==r.grammar$&&(0,k.grammar)(o);return o}b.exports.util=O,b.exports.make=E;let S=void 0,M=S=E();return b.exports.Jsonic=M,delete S.options,delete S.use,delete S.rule,delete S.lex,delete S.token,delete S.fixed,S.Jsonic=S,S.JsonicError=y.JsonicError,S.Parser=s.Parser,S.makeLex=j.makeLex,S.makeToken=j.makeToken,S.makePoint=j.makePoint,S.makeRule=s.makeRule,S.makeRuleSpec=s.makeRuleSpec,S.makeFixedMatcher=j.makeFixedMatcher,S.makeSpaceMatcher=j.makeSpaceMatcher,S.makeLineMatcher=j.makeLineMatcher,S.makeStringMatcher=j.makeStringMatcher,S.makeCommentMatcher=j.makeCommentMatcher,S.makeNumberMatcher=j.makeNumberMatcher,S.makeTextMatcher=j.makeTextMatcher,S.util=O,S.make=E,b.exports.default=M,b.exports=b.exports.Jsonic,b.exports}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$jsonicMin_19=_$jsonicMin_19.exports;var _$directiveMin_17={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$directiveMin_17.exports?_$directiveMin_17.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).JsonicDirective=t()}((function(){var e={};Object.defineProperty(e,"__esModule",{value:!0}),e.Directive=void 0;const t=(e,t)=>{let n,r=("string"==typeof t.rules?t.rules.split(/\s*,\s*/):t.rules||[]).filter(e=>""!==e),i=t.name,o=t.open,l=t.close;if("string"==typeof t.action){let r=t.action;n=t=>t.node=e.util.prop(e.options,r)}else n=t.action;let s={},a="#D_open_"+i,c="#D_close_"+i,u=e.fixed(o),p=null==l?null:e.fixed(l);if(null!=u)throw new Error("Directive open token already in use: "+o);s[a]=o,null==p&&null!=l&&(s[c]=l),e.options({fixed:{token:s},error:{[i+"_close"]:null==l?null:"directive "+i+' close "'+l+'" without open "'+o+'"'},hint:{[i+"_close"]:null==l?null:`\nThe ${i} directive must start with the characters "${o}" and end\nwith the characters "${l}". The end characters "${l}" may not\nappear without the start characters "${o}" appearing first:\n"${o}...${l}".\n`}});let d=e.token.CA;u=e.fixed(o),p=null==l?null:e.fixed(l),r.forEach(t=>{e.rule(t,e=>(e.open({s:[u],p:i,n:{dr:1}}),null!=l&&(e.open([{s:[p],c:{n:{dr:0}},e:(e,t)=>t.t0.bad(i+"_close")},{s:[p],b:1}]),e.close({s:[p],b:1})),e))}),e.rule(i,e=>e.clear().bo(e=>{e.node={}}).open([{p:"val",n:null==l?{}:{pk:-1,il:0}}]).bc((function(e,t,r,i){let o=n.call(this,e,t,r,i);if(null==o?void 0:o.isToken)return o})).close(null!=l?[{s:[p]},{s:[d,p]}]:[]))};return e.Directive=t,t.defaults={rules:"val,pair,elem"},e}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$directiveMin_17=_$directiveMin_17.exports;var _$js_21={};function makeJavaScriptProcessor(e){const t=t=>{t.val=evaluate(t,e)};return t.opts=e,t}function evaluate(res,opts){let out=void 0;if(!0!==(null==opts?void 0:opts.evalOnly))out=require(res.full);else{let exports=null,module={exports:exports};eval(res.src),out=module.exports}return out}Object.defineProperty(_$js_21,"__esModule",{value:!0}),_$js_21.makeJavaScriptProcessor=void 0,_$js_21.makeJavaScriptProcessor=makeJavaScriptProcessor;var _$_empty_26={},_$browser_28={},cachedSetTimeout,cachedClearTimeout,process=_$browser_28={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,function(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var _$pathBrowserify_27={};(function(e){(function(){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,l=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(47===n)break;n=47}if(47===n){if(o===s-1||1===l);else if(o!==s-1&&2===l){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var a=r.lastIndexOf("/");if(a!==r.length-1){-1===a?(r="",i=0):i=(r=r.slice(0,a)).length-1-r.lastIndexOf("/"),o=s,l=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=s,l=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,s):r=e.slice(o+1,s),i=s-o-1;o=s,l=0}else 46===n&&-1!==l?++l:l=-1}return r}var r={resolve:function(){for(var r,i="",o=!1,l=arguments.length-1;l>=-1&&!o;l--){var s;l>=0?s=arguments[l]:(void 0===r&&(r=e.cwd()),s=r),t(s),0!==s.length&&(i=s+"/"+i,o=47===s.charCodeAt(0))}return i=n(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,l=o-i,s=1;s<n.length&&47===n.charCodeAt(s);++s);for(var a=n.length-s,c=l<a?l:a,u=-1,p=0;p<=c;++p){if(p===c){if(a>c){if(47===n.charCodeAt(s+p))return n.slice(s+p+1);if(0===p)return n.slice(s+p)}else l>c&&(47===e.charCodeAt(i+p)?u=p:0===p&&(u=0));break}var d=e.charCodeAt(i+p);if(d!==n.charCodeAt(s+p))break;47===d&&(u=p)}var f="";for(p=i+u+1;p<=o;++p)p!==o&&47!==e.charCodeAt(p)||(0===f.length?f+="..":f+="/..");return f.length>0?f+n.slice(s+u):(s+=u,47===n.charCodeAt(s)&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,l=e.length-1;l>=1;--l)if(47===(n=e.charCodeAt(l))){if(!o){i=l;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,l=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var s=n.length-1,a=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!l){i=r+1;break}}else-1===a&&(l=!1,a=r+1),s>=0&&(c===n.charCodeAt(s)?-1==--s&&(o=r):(s=-1,o=a))}return i===o?o=a:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!l){i=r+1;break}}else-1===o&&(l=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,l=0,s=e.length-1;s>=0;--s){var a=e.charCodeAt(s);if(47!==a)-1===i&&(o=!1,i=s+1),46===a?-1===n?n=s:1!==l&&(l=1):-1!==n&&(l=-1);else if(!o){r=s+1;break}}return-1===n||-1===i||0===l||1===l&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),o=47===i;o?(n.root="/",r=1):r=0;for(var l=-1,s=0,a=-1,c=!0,u=e.length-1,p=0;u>=r;--u)if(47!==(i=e.charCodeAt(u)))-1===a&&(c=!1,a=u+1),46===i?-1===l?l=u:1!==p&&(p=1):-1!==l&&(p=-1);else if(!c){s=u+1;break}return-1===l||-1===a||0===p||1===p&&l===a-1&&l===s+1?-1!==a&&(n.base=n.name=0===s&&o?e.slice(1,a):e.slice(s,a)):(0===s&&o?(n.name=e.slice(1,l),n.base=e.slice(1,a)):(n.name=e.slice(s,l),n.base=e.slice(s,a)),n.ext=e.slice(l,a)),s>0?n.dir=e.slice(0,s-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,_$pathBrowserify_27=r}).call(this)}).call(this,_$browser_28);var _$mem_24={};Object.defineProperty(_$mem_24,"__esModule",{value:!0}),_$mem_24.makeMemResolver=_$mem_24.buildPotentials=void 0;const __multisource_1_24=_$multisource_20({});function buildPotentials(e,t,n){let r=e.full,i=[],o=t.implictExt||[];for(let l of o)i.push(r+l);for(let l of o)i.push(n(r,"index"+l));if(null!=e.path){let t=(e.path.replace(/[\\\/]+$/,"").match(/[^\\\/]+$/)||[])[0];if(null!=t)for(let e of o)i.push(n(r,"index."+t+e))}return i}_$mem_24.makeMemResolver=function(e){return function(t,n,r,i){let o=(0,__multisource_1_24.resolvePathSpec)(n,i,t,function(e){return function(t){let n=t;return e[t]&&(n=(t.replace(/[\\\/]+$/,"").match(/[\\\/]+([^\\\/]+)$/)||["",""])[1]),n}}(e)),l=void 0;if(null!=o.full&&null==(l=e[o.full])&&__multisource_1_24.NONE===o.kind){let t=buildPotentials(o,n,(...e)=>e.reduce((e,t)=>e+"/"+t));for(let n of t)if(null!=(l=e[n])){o.full=n,o.kind=(n.match(/\.([^.]*)$/)||[__multisource_1_24.NONE,__multisource_1_24.NONE])[1];break}}return{...o,src:l,found:null!=l}}},_$mem_24.buildPotentials=buildPotentials;var _$file_23={},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_$file_23,"__esModule",{value:!0}),_$file_23.makeFileResolver=void 0;const fs_1=__importDefault(_$_empty_26),path_1=__importDefault(_$pathBrowserify_27),__multisource_1_23=_$multisource_20({});function resolvefolder(e){if("string"!=typeof e)return e;let t=e;return fs_1.default.statSync(e).isFile()&&(t=path_1.default.parse(e).dir),t}function load(e){try{return fs_1.default.readFileSync(e).toString()}catch(t){}}_$file_23.makeFileResolver=function(e){return function(t,n,r,i){let o=e?e(t):t,l=(0,__multisource_1_23.resolvePathSpec)(n,i,o,resolvefolder),s=void 0;if(null!=l.full&&(l.full=path_1.default.resolve(l.full),null==(s=load(l.full))&&__multisource_1_23.NONE===l.kind)){let e=(0,_$mem_24.buildPotentials)(l,n,(...e)=>path_1.default.resolve(e.reduce((e,t)=>path_1.default.join(e,t))));for(let t of e)if(null!=(s=load(t))){l.full=t,l.kind=(t.match(/\.([^.]*)$/)||[__multisource_1_23.NONE,__multisource_1_23.NONE])[1];break}}return{...l,src:s,found:null!=s}}};var _$exprMin_18={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$exprMin_18.exports?_$exprMin_18.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).JsonicExpr=t()}((function(){var t={exports:{}};(function(e){(function(){!function(n){"object"==typeof t.exports?t.exports=n():("undefined"!=typeof window?window:void 0!==e?e:"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.values=t.keys=t.omap=t.str=t.prop=t.normalt=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 i=n({}),o=e=>null==e?[]:Object.keys(e);t.keys=o,t.values=e=>null==e?[]:Object.values(e),t.entries=e=>null==e?[]:Object.entries(e);const l=(e,...t)=>Object.assign(null==e?{}:e,...t);t.assign=l,t.isarr=e=>Array.isArray(e);const s=Object.defineProperty;t.defprop=s;const a=(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 i=2;for(;void 0!==r[i];)e[r[i]]=r[i+1],i+=2;return e},{});t.omap=a;const c={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"};t.S=c;class u extends SyntaxError{constructor(e,t,n,r,i){let o=x(e,t=h({},t),n,r,i);super(o.message),l(this,o),g(this)}toJSON(){return{...this,__error:!0,name:this.name,message:this.message,stack:this.stack}}}function p(e,t,n){let i=t.t,o=i[e];return null==o&&r.STRING===typeof e&&(i[o=t.tI++]=e,i[e]=o,i[e.substring(1)]=o,null!=n&&l(n.token,t.t)),o}function d(e,...t){return new RegExp(t.map(e=>e.esc?f(e.toString()):e).join(r.EMPTY),null==e?"":e)}function f(e){return null==e?"":e.replace(/[-\\|\]{}()[^$+*?.!=]/g,"\\$&").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n")}function h(e,...t){let n=c.function===typeof e,r=null!=e&&(c.object===typeof e||n);for(let i of t){let t=c.function===typeof i,o=null!=i&&(c.object===typeof i||t);if(r&&o&&!t&&Array.isArray(e)===Array.isArray(i))for(let n in i)e[n]=h(e[n],i[n]);else e=void 0===i?e:t?i:o?h(Array.isArray(i)?[]:{},i):i,n=c.function===typeof e,r=null!=e&&(c.object===typeof e||n)}return e}function m(e,t,n,r,i,o){let l={code:t,details:n,token:r,rule:i,ctx:o};return null==e?"":e.replace(/\$([\w_]+)/g,(e,t)=>{let s=JSON.stringify(null!=l[t]?l[t]:null!=n[t]?n[t]:o.meta&&null!=o.meta[t]?o.meta[t]:null!=r[t]?r[t]:null!=i[t]?i[t]:null!=o.opts[t]?o.opts[t]:null!=o.cfg[t]?o.cfg[t]:null!=o[t]?o[t]:"$"+t);return null==s?"":s})}function g(e){e.stack&&(e.stack=e.stack.split("\n").filter(e=>!e.includes("jsonic/jsonic")).map(e=>e.replace(/ at /,"at ")).join("\n"))}function v(e,t,n){let i=0<n.sI?n.sI:0,o=0<n.rI?n.rI:1,l=0<n.cI?n.cI:1,s=null==n.src?r.EMPTY:n.src,a=e.substring(Math.max(0,i-333),i).split("\n"),c=e.substring(i,i+333).split("\n"),u=2+(r.EMPTY+(o+2)).length,p=o<3?1:o-2,d=e=>"\x1b[34m"+(r.EMPTY+p++).padStart(u," ")+" | \x1b[0m"+(null==e?r.EMPTY:e),f=a.length;return[2<f?d(a[f-3]):null,1<f?d(a[f-2]):null,d(a[f-1]+c[0])," ".repeat(u)+" "+" ".repeat(l-1)+"\x1b[31m"+"^".repeat(s.length||1)+" "+t+"\x1b[0m",d(c[1]),d(c[2])].filter(e=>null!=e).join("\n")}function x(e,t,n,r,i){try{let o=i.cfg,l=i.meta,s=m(o.error[e]||o.error.unknown,e,t,n,r,i);c.function===typeof o.hint&&(o.hint={...o.hint(),...o.hint});let a=["\x1b[31m[jsonic/"+e+"]:\x1b[0m "+s," \x1b[34m--\x3e\x1b[0m "+(l&&l.fileName||"<no-file>")+":"+n.rI+":"+n.cI,v(i.src(),s,n),"",m((o.hint[e]||o.hint.unknown||"").trim().split("\n").map(e=>" "+e).join("\n"),e,t,n,r,i),""," \x1b[2mhttps://jsonic.senecajs.org\x1b[0m"," \x1b[2m--internal: rule="+r.name+"~"+r.state+"; token="+p(n.tin,i.cfg)+(null==n.why?"":"~"+n.why)+"; plugins="+i.plgn().map(e=>e.name).join(",")+"--\x1b[0m\n"].join("\n"),u={internal:{token:n,ctx:i}};return u={...Object.create(u),message:a,code:e,details:t,meta:l,fileName:l?l.fileName:void 0,lineNumber:n.rI,columnNumber:n.cI}}catch(o){return console.log(o),{}}}function k(e){return"function"==typeof e.debug.print.src?e.debug.print.src:(t,n)=>null==t?r.EMPTY:(n=JSON.stringify(t)).substring(0,e.debug.maxlen)+(e.debug.maxlen<n.length?"...":r.EMPTY)}function _(e,t=44){let n;try{n="object"==typeof e?JSON.stringify(e):""+e}catch(r){n=""+e}return b(t<n.length?n.substring(0,t-3)+"...":n,t)}function b(e,t=5){return void 0===e?"":(""+e).substring(0,t).replace(/[\r\n\t]/g,".")}function y(...e){return null==e?{}:e.filter(e=>!1!==e).map(e=>"object"==typeof e?o(e).join(r.EMPTY):e).join(r.EMPTY).split(r.EMPTY).reduce((e,t)=>(e[t]=t.charCodeAt(0),e),{})}function j(e){for(let t in e)null==e[t]&&delete e[t];return e}t.JsonicError=u,t.configure=function(e,t,n){var r,i,s,c,u,h,m,g,v,x,k,_,b,O,E,S,M,N,T,P,I,w,C,$,A,R,V,L,F,D,Y,B,U,J,z,Z,q;const K=t||{};K.t=K.t||{},K.tI=K.tI||1;const W=e=>p(e,K);!1!==n.grammar$&&(W("#BD"),W("#ZZ"),W("#UK"),W("#AA"),W("#SP"),W("#LN"),W("#CM"),W("#NR"),W("#ST"),W("#TX"),W("#VL")),K.fixed={lex:!!(null===(r=n.fixed)||void 0===r?void 0:r.lex),token:n.fixed?a(j(n.fixed.token),([e,t])=>[t,p(e,K)]):{},ref:void 0},K.fixed.ref=a(K.fixed.token,([e,t])=>[e,t]),K.fixed.ref=Object.assign(K.fixed.ref,a(K.fixed.ref,([e,t])=>[t,e])),K.tokenSet={ignore:Object.fromEntries(((null===(i=n.tokenSet)||void 0===i?void 0:i.ignore)||[]).map(e=>[W(e),!0]))},K.space={lex:!!(null===(s=n.space)||void 0===s?void 0:s.lex),chars:y(null===(c=n.space)||void 0===c?void 0:c.chars)},K.line={lex:!!(null===(u=n.line)||void 0===u?void 0:u.lex),chars:y(null===(h=n.line)||void 0===h?void 0:h.chars),rowChars:y(null===(m=n.line)||void 0===m?void 0:m.rowChars)},K.text={lex:!!(null===(g=n.text)||void 0===g?void 0:g.lex),modify:((null===(v=K.text)||void 0===v?void 0:v.modify)||[]).concat(([null===(x=n.text)||void 0===x?void 0:x.modify]||[]).flat()).filter(e=>null!=e)},K.number={lex:!!(null===(k=n.number)||void 0===k?void 0:k.lex),hex:!!(null===(_=n.number)||void 0===_?void 0:_.hex),oct:!!(null===(b=n.number)||void 0===b?void 0:b.oct),bin:!!(null===(O=n.number)||void 0===O?void 0:O.bin),sep:null!=(null===(E=n.number)||void 0===E?void 0:E.sep)&&""!==n.number.sep,sepChar:null===(S=n.number)||void 0===S?void 0:S.sep},K.value={lex:!!(null===(M=n.value)||void 0===M?void 0:M.lex),map:(null===(N=n.value)||void 0===N?void 0:N.map)||{}},K.rule={start:null==(null===(T=n.rule)||void 0===T?void 0:T.start)?"val":n.rule.start,maxmul:null==(null===(P=n.rule)||void 0===P?void 0:P.maxmul)?3:n.rule.maxmul,finish:!!(null===(I=n.rule)||void 0===I?void 0:I.finish),include:(null===(w=n.rule)||void 0===w?void 0:w.include)?n.rule.include.split(/\s*,+\s*/).filter(e=>""!==e):[],exclude:(null===(C=n.rule)||void 0===C?void 0:C.exclude)?n.rule.exclude.split(/\s*,+\s*/).filter(e=>""!==e):[]},K.map={extend:!!(null===($=n.map)||void 0===$?void 0:$.extend),merge:null===(A=n.map)||void 0===A?void 0:A.merge};let G=Object.keys(K.fixed.token).sort((e,t)=>t.length-e.length).map(e=>f(e)).join("|"),H=(null===(R=n.comment)||void 0===R?void 0:R.lex)?(n.comment.marker||[]).filter(e=>e.lex).map(e=>f(e.start)).join("|"):"",Q=["([",f(o(y(K.space.lex&&K.space.chars,K.line.lex&&K.line.chars)).join("")),"]",("string"==typeof n.ender?n.ender.split(""):Array.isArray(n.ender)?n.ender:[]).map(e=>"|"+f(e)).join(""),""===G?"":"|",G,""===H?"":"|",H,"|$)"];return K.rePart={fixed:G,ender:Q,commentStart:H},K.re={ender:d(null,...Q),rowChars:d(null,f(null===(V=n.line)||void 0===V?void 0:V.rowChars)),columns:d(null,"["+f(null===(L=n.line)||void 0===L?void 0:L.chars)+"]","(.*)$")},K.lex={empty:!!(null===(F=n.lex)||void 0===F?void 0:F.empty),match:(null===(D=n.lex)||void 0===D?void 0:D.match)?n.lex.match.map(e=>e(K,n)):[]},K.debug={get_console:(null===(Y=n.debug)||void 0===Y?void 0:Y.get_console)||(()=>console),maxlen:null==(null===(B=n.debug)||void 0===B?void 0:B.maxlen)?99:n.debug.maxlen,print:{config:!!(null===(J=null===(U=n.debug)||void 0===U?void 0:U.print)||void 0===J?void 0:J.config),src:null===(Z=null===(z=n.debug)||void 0===z?void 0:z.print)||void 0===Z?void 0:Z.src}},K.error=n.error||{},K.hint=n.hint||{},(null===(q=n.config)||void 0===q?void 0:q.modify)&&o(n.config.modify).forEach(e=>n.config.modify[e](K,n)),K.debug.print.config&&K.debug.get_console().dir(K,{depth:null}),l(e.options,n),l(e.token,K.t),l(e.fixed,K.fixed.ref),K},t.tokenize=p,t.mesc=function(e,t){return(t=new String(e)).esc=!0,t},t.regexp=d,t.escre=f,t.deep=h,t.errinject=m,t.trimstk=g,t.extract=v,t.errdesc=x,t.badlex=function(e,t,n){let r=r=>{let i=e.next(r);if(t===i.tin){let e={};throw null!=i.use&&(e.use=i.use),new u(i.why||c.unexpected,e,i,r,n)}return i};return r.src=e.src,r},t.makelog=function(e,t){if(t)if("number"==typeof t.log){let n=!1,r=t.log;-1===r&&(r=1,n=!0),e.log=(...t)=>{if(n){let n=t.filter(e=>c.object!=typeof e).map(e=>c.function==typeof e?e.name:e).join("\t");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=k,t.str=_,t.snip=b,t.clone=function(e){return h(Object.create(Object.getPrototypeOf(e)),e)},t.charset=y,t.clean=j,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.normalt=function(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*/)),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),i=t([e.s[0]]),o=t([e.s[1]]),l=e;l.S0=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,l.S1=0<o.length?new Array(Math.max(...o.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(o,e),e)):null}else e.s=null;return e},t.prop=function(e,t,n){try{let r,i=t.split(".");for(let t=0;t<i.length;t++)r=i[t],t<i.length-1&&(e=e[r]=e[r]||{});return void 0!==n&&(e[r]=n),e[r]}catch(i){throw new Error("Cannot "+(void 0===n?"get":"set")+" path "+t+" on object: "+_(r)+(void 0===n?"":" to value: "+_(n,22)))}},t.parserwrap=function(e){return{start:function(t,n,o,l){try{return e.start(t,n,o,l)}catch(s){if("SyntaxError"===s.name){let l=0,a=0,c=0,d=r.EMPTY,f=s.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);if(f){d=f[1],l=parseInt(f[2]),a=t.substring(0,l).replace(/[^\n]/g,r.EMPTY).length;let e=l-1;for(;-1<e&&"\n"!==t.charAt(e);)e--;c=Math.max(t.substring(e,l).length,0)}let h=s.token||(0,i.makeToken)("#UK",p("#UK",n.internal().config),void 0,d,(0,i.makePoint)(d.length,l,s.lineNumber||a,s.columnNumber||c));throw new u(s.code||"json",s.details||{msg:s.message},h,{},s.ctx||{uI:-1,opts:n.options,cfg:n.internal().config,token:h,meta:o,src:()=>t,root:()=>{},plgn:()=>n.internal().plugins,rule:{name:"no-rule"},xs:-1,v2:h,v1:h,t0:h,t1:h,tC:-1,rs:[],rsI:0,next:()=>h,rsm:{},n:{},log:o?o.log:void 0,F:k(n.internal().config),use:{},NORULE:{name:"no-rule"},NOTOKEN:{name:"no-token"}})}throw s}}}}})),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.makeToken=n.makePoint=n.makeLex=n.makeNoToken=void 0;const i=t({});class o{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 l=(...e)=>new o(...e);n.makePoint=l;class s{constructor(e,t,n,i,o,l,s){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=i,this.val=n,this.sI=o.sI,this.rI=o.rI,this.cI=o.cI,this.use=l,this.why=s,this.len=null==i?0:i.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,i.deep)(this.use||{},t)),this}toString(){return"Token["+this.name+"="+this.tin+" "+(0,i.snip)(this.src)+(void 0===this.val||"#ST"===this.name||"#TX"===this.name?"":"="+(0,i.snip)(this.val))+" "+[this.sI,this.rI,this.cI]+(null==this.use?"":" "+(0,i.snip)(""+JSON.stringify(this.use).replace(/"/g,""),22))+(null==this.err?"":" "+this.err)+(null==this.why?"":" "+(0,i.snip)(""+this.why,22))+"]"}[r.INSPECT](){return this.toString()}}const a=(...e)=>new s(...e);function c(e,t,n){let r=e.pnt,i=t;if(e.cfg.fixed.lex&&null!=n&&0<n.length){let o=void 0,l=e.cfg.fixed.token[n];null!=l&&(o=e.token(l,void 0,n,r)),null!=o&&(r.sI+=o.src.length,r.cI+=o.src.length,null==t?i=o:r.token.push(o))}return i}n.makeToken=a,n.makeNoToken=()=>a("",-1,void 0,r.EMPTY,l(-1)),n.makeFixedMatcher=(e,t)=>{let n=(0,i.regexp)(null,"^(",e.rePart.fixed,")");return function(t){let r=e.fixed;if(!r.lex)return;let i=t.pnt,o=t.src.substring(i.sI).match(n);if(o){let e=o[1],n=e.length;if(0<n){let o=void 0,l=r.token[e];return null!=l&&(o=t.token(l,void 0,e,i),i.sI+=n,i.cI+=n),o}}}},n.makeCommentMatcher=(e,t)=>{let n=t.comment;e.comment={lex:!!n&&!!n.lex,marker:((null==n?void 0:n.marker)||[]).map(e=>({start:e.start,end:e.end,line:!!e.line,lex:!!e.lex}))};let r=e.comment.lex?e.comment.marker.filter(e=>e.lex&&e.line):[],o=e.comment.lex?e.comment.marker.filter(e=>e.lex&&!e.line):[];return function(t){if(!e.comment.lex)return;let n=t.pnt,l=t.src.substring(n.sI),s=n.rI,a=n.cI;for(let i of r)if(l.startsWith(i.start)){let r=l.length,o=i.start.length;for(a+=i.start.length;o<r&&!e.line.chars[l[o]];)a++,o++;let s=l.substring(0,o),c=t.token("#CM",void 0,s,n);return n.sI+=s.length,n.cI=a,c}for(let r of o)if(l.startsWith(r.start)){let o=l.length,c=r.start.length,u=r.end;for(a+=r.start.length;c<o&&!l.substring(c).startsWith(u);)e.line.rowChars[l[c]]&&(s++,a=0),a++,c++;if(l.substring(c).startsWith(u)){a+=u.length;let e=l.substring(0,c+u.length),r=t.token("#CM",void 0,e,n);return n.sI+=e.length,n.rI=s,n.cI=a,r}return t.bad(i.S.unterminated_comment,n.sI,n.sI+9*r.start.length)}}},n.makeTextMatcher=(e,t)=>{let n=(0,i.regexp)(e.line.lex?null:"s","^(.*?)",...e.rePart.ender);return function(r){let i=e.text,o=r.pnt,l=r.src.substring(o.sI),s=e.value.map,a=l.match(n);if(a){let n=a[1],l=a[2],u=void 0;if(null!=n){let t=n.length;if(0<t){let l=void 0;e.value.lex&&void 0!==(l=s[n])?(u=r.token("#VL",l.val,n,o),o.sI+=t,o.cI+=t):i.lex&&(u=r.token("#TX",n,n,o),o.sI+=t,o.cI+=t)}}if(u&&(u=c(r,u,l)),u&&0<e.text.modify.length){const n=e.text.modify;for(let i=0;i<n.length;i++)u.val=n[i](u.val,r,e,t)}return u}}},n.makeNumberMatcher=(e,t)=>{let n=e.number,r=(0,i.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,i.escre)(n.sepChar):""),")",...e.rePart.ender),o=n.sep?(0,i.regexp)("g",(0,i.escre)(n.sepChar)):void 0;return function(t){if(!(n=e.number).lex)return;let i=t.pnt,l=t.src.substring(i.sI),s=e.value.map,a=l.match(r);if(a){let n=a[1],r=a[9],l=void 0;if(null!=n){let r=n.length;if(0<r){let a=void 0;if(e.value.lex&&void 0!==(a=s[n]))l=t.token("#VL",a.val,n,i);else{let e=o?n.replace(o,""):n,s=+e;if(isNaN(s)){let t=e[0];"-"!==t&&"+"!==t||(s=("-"===t?-1:1)*+e.substring(1))}isNaN(s)||(l=t.token("#NR",s,n,i),i.sI+=r,i.cI+=r)}}}return l=c(t,l,r)}}},n.makeStringMatcher=(e,t)=>{let n=t.string||{};return e.string=e.string||{},e.string=(0,i.deep)(e.string,{lex:!!(null==n?void 0:n.lex),quoteMap:(0,i.charset)(n.chars),multiChars:(0,i.charset)(n.multiChars),escMap:(0,i.clean)({...n.escape}),escChar:n.escapeChar,escCharCode:null==n.escapeChar?void 0:n.escapeChar.charCodeAt(0),allowUnknown:!!n.allowUnknown,replaceCodeMap:(0,i.omap)((0,i.clean)({...n.replace}),([e,t])=>[e.charCodeAt(0),t]),hasReplace:!1}),e.string.hasReplace=0<(0,i.keys)(e.string.replaceCodeMap).length,function(t){let n=e.string;if(!n.lex)return;let{quoteMap:o,escMap:l,escChar:s,escCharCode:a,multiChars:c,allowUnknown:u,replaceCodeMap:p,hasReplace:d}=n,{pnt:f,src:h}=t,{sI:m,rI:g,cI:v}=f,x=h.length;if(o[h[m]]){const n=h[m],o=m,k=g,_=c[n];++m,++v;let b,y=[];for(;m<x;m++){v++;let r=h[m];if(b=void 0,n===r){m++;break}if(s===r){v++;let e=l[h[++m]];if(null!=e)y.push(e);else if("x"===h[m]){m++;let e=parseInt(h.substring(m,m+2),16);if(isNaN(e))return m-=2,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_ascii,m,m+4);let n=String.fromCharCode(e);y.push(n),m+=1,v+=2}else if("u"===h[m]){let e="{"===h[++m]?(m++,1):0,n=e?6:4,r=parseInt(h.substring(m,m+n),16);if(isNaN(r))return m=m-2-e,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_unicode,m,m+n+2+2*e);let o=String.fromCodePoint(r);y.push(o),m+=n-1+e,v+=n+e}else{if(!u)return f.sI=m,f.cI=v-1,t.bad(i.S.unexpected,m,m+1);y.push(h[m])}}else if(d&&void 0!==(b=p[h.charCodeAt(m)]))y.push(b),v++;else{let r=m,o=n.charCodeAt(0),l=h.charCodeAt(m);for(;(!d||void 0===(b=p[l]))&&m<x&&32<=l&&o!==l&&a!==l;)l=h.charCodeAt(++m),v++;if(v--,void 0===b&&l<32){if(!_||!e.line.chars[h[m]])return f.sI=m,f.cI=v,t.bad(i.S.unprintable,m,m+1);e.line.rowChars[h[m]]&&(f.rI=++g),v=1,y.push(h.substring(r,m+1))}else y.push(h.substring(r,m)),m--}}if(h[m-1]!==n||f.sI===m-1)return f.rI=k,t.bad(i.S.unterminated_string,o,m);const j=t.token("#ST",y.join(r.EMPTY),h.substring(f.sI,m),f);return f.sI=m,f.rI=g,f.cI=v,j}}},n.makeLineMatcher=(e,t)=>function(t){if(!e.line.lex)return;let{chars:n,rowChars:r}=e.line,{pnt:i,src:o}=t,{sI:l,rI:s}=i;for(;n[o[l]];)s+=r[o[l]]?1:0,l++;if(i.sI<l){let e=o.substring(i.sI,l);const n=t.token("#LN",void 0,e,i);return i.sI+=e.length,i.rI=s,i.cI=1,n}},n.makeSpaceMatcher=(e,t)=>function(t){if(!e.space.lex)return;let{chars:n}=e.space,{pnt:r,src:i}=t,{sI:o,cI:l}=r;for(;n[i[o]];)o++,l++;if(r.sI<o){let e=i.substring(r.sI,o);const n=t.token("#SP",void 0,e,r);return r.sI+=e.length,r.cI=l,n}};class u{constructor(e){this.src=r.EMPTY,this.ctx={},this.cfg={},this.pnt=l(-1),this.ctx=e,this.src=e.src(),this.cfg=e.cfg,this.pnt=l(this.src.length)}token(e,t,n,r,o,l){let s,c;return"string"==typeof e?(c=e,s=(0,i.tokenize)(c,this.cfg)):(s=e,c=(0,i.tokenize)(e,this.cfg)),a(c,s,t,n,r||this.pnt,o,l)}next(e){let t,n=this.pnt;if(n.end)t=n.end;else if(0<n.token.length)t=n.token.shift();else if(n.len<=n.sI)n.end=this.token("#ZZ",void 0,"",n),t=n.end;else{for(let n of this.cfg.lex.match)if(t=n(this,e))break;t=t||this.token("#BD",void 0,this.src[n.sI],n,void 0,"unexpected")}return this.ctx.log&&this.ctx.log(i.S.lex,(0,i.tokenize)(t.tin,this.cfg),this.ctx.F(t.src),n.sI,n.rI+":"+n.cI),t}tokenize(e){return(0,i.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 i={};Object.defineProperty(i,"__esModule",{value:!0}),i.defaults=void 0;const o=n({}),l={tag:"-",fixed:{lex:!0,token:{"#OB":"{","#CB":"}","#OS":"[","#CS":"]","#CL":":","#CA":","}},tokenSet:{ignore:["#SP","#LN","#CM"]},space:{lex:!0,chars:" \t"},line:{lex:!0,chars:"\r\n",rowChars:"\n"},text:{lex:!0},number:{lex:!0,hex:!0,oct:!0,bin:!0,sep:"_"},comment:{lex:!0,marker:[{line:!0,start:"#",lex:!0},{line:!0,start:"//",lex:!0},{line:!1,start:"/*",end:"*/",lex:!0}]},string:{lex:!0,chars:"'\"`",multiChars:"`",escapeChar:"\\",escape:{b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",'"':'"',"'":"'","`":"`","\\":"\\","/":"/"},allowUnknown:!0},map:{extend:!0,merge:void 0},value:{lex:!0,map:{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,i)=>(n[r]=e(t[i]),n),{})},lex:{match:[o.makeFixedMatcher,o.makeSpaceMatcher,o.makeLineMatcher,o.makeStringMatcher,o.makeCommentMatcher,o.makeNumberMatcher,o.makeTextMatcher],empty:!0},rule:{start:"val",finish:!0,maxmul:3,include:"",exclude:""},config:{modify:{}},parser:{start:void 0}};i.defaults=l;var s={};Object.defineProperty(s,"__esModule",{value:!0}),s.Parser=s.makeRuleSpec=s.makeRule=void 0;const a=t({}),c=n({});class u{constructor(e,t,n){this.id=-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.id=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){return this.spec.process(this,e,this.state)}}const p=(...e)=>new u(...e);s.makeRule=p;class d{constructor(){this.p=r.EMPTY,this.r=r.EMPTY,this.b=0}}const f=(...e)=>new d(...e),h=f(),m=f();class g{constructor(e,t){this.name=r.EMPTY,this.def={open:[],close:[],bo:[],bc:[],ao:[],ac:[]},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])(0,a.normalt)(n)}tin(e){return(0,a.tokenize)(e,this.cfg)}add(e,t,n){let r=(null==n?void 0:n.append)?"push":"unshift",i=((0,a.isarr)(t)?t:[t]).filter(e=>null!=e).map(e=>(0,a.normalt)(e)),o="o"===e?"open":"close",l=this.def[o];if(l[r](...i),n){if(n.delete)for(let e=0;e<n.delete.length;e++)l[(l.length+n.delete[e])%l.length]=null;if(n.move)for(let e=0;e<n.move.length;e+=2){let t=(l.length+n.move[e])%l.length,r=(l.length+n.move[e+1])%l.length,i=l[t];l.splice(t,1),l.splice(r,0,i)}this.def[o]=l.filter(e=>null!=e)}return(0,a.filterRules)(this,this.cfg),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 i=this.def[t+n];return e?i.push(r):i.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}process(e,t,n){let i=r.EMPTY,o=t.F,l="o"===n,s=l?e:t.NORULE,c=this.def,u=l?c.open:c.close,d=l?e.bo?c.bo:null:e.bc?c.bc:null;if(d){let n=void 0;for(let r=0;r<d.length;r++)if((null==(n=d[r].call(this,e,t,s,n))?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}let f=0<u.length?this.parse_alts(l,u,e,t):m;if(f.h&&(f=f.h(e,t,f,s)||f,i+="H"),f.e)return this.bad(f.e,e,t,{is_open:l});if(f.n)for(let r in f.n)e.n[r]=0===f.n[r]?0:(null==e.n[r]?0:e.n[r])+f.n[r];if(f.u&&(e.use=Object.assign(e.use,f.u)),f.k&&(e.keep=Object.assign(e.keep,f.k)),f.a){i+="A";let n=f.a.call(this,e,t,f);if(n&&n.isToken&&n.err)return this.bad(n,e,t,{is_open:l})}if(f.p){t.rs[t.rsI++]=e;let n=t.rsm[f.p];if(!n)return this.bad(this.unknownRule(t.t0,f.p),e,t,{is_open:l});(s=e.child=p(n,t,e.node)).parent=e,s.n={...e.n},0<Object.keys(e.keep).length&&(s.keep={...e.keep}),i+="@p:"+f.p}else if(f.r){let n=t.rsm[f.r];if(!n)return this.bad(this.unknownRule(t.t0,f.r),e,t,{is_open:l});(s=p(n,t,e.node)).parent=e.parent,s.prev=e,s.n={...e.n},0<Object.keys(e.keep).length&&(s.keep={...e.keep}),i+="@r:"+f.r}else l||(s=t.rs[--t.rsI]||t.NORULE),i+="Z";let h=l?e.ao?c.ao:null:e.ac?c.ac:null;if(h){let n=void 0;for(let r=0;r<h.length;r++)if((null==(n=h[r].call(this,e,t,s,n))?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}s.why=i,t.log&&t.log("node "+e.state.toUpperCase(),e.prev.id+"/"+e.parent.id+"/"+e.child.id,e.name+"~"+e.id,"w="+i,"n:"+(0,a.entries)(e.n).filter(e=>e[1]).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(e.use).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(e.keep).map(e=>e[0]+"="+e[1]).join(";"),"<"+o(e.node)+">");let g=0,v=e[l?"os":"cs"]-(f.b||0);for(;g++<v;)t.next();return r.OPEN===e.state&&(e.state=r.CLOSE),s}parse_alts(e,t,n,i){let o=h;o.b=0,o.p=r.EMPTY,o.r=r.EMPTY,o.n=void 0,o.h=void 0,o.a=void 0,o.u=void 0,o.k=void 0,o.e=void 0;let l,s=null,c=0,u=i.cfg.t,p=1<<u.AA-1,d=t.length;for(c=0;c<d;c++){s=t[c];let r=i.t0.tin,a=!1,u=!1;if(l=!0,s.S0&&(a=!0,(l=s.S0[r/31|0]&(1<<r%31-1|p))&&(u=null!=s.S1,s.S1))){u=!0;let e=i.t1.tin;l=s.S1[e/31|0]&(1<<e%31-1|p)}if(e?(n.o0=a?i.t0:i.NOTOKEN,n.o1=u?i.t1:i.NOTOKEN,n.os=(a?1:0)+(u?1:0)):(n.c0=a?i.t0:i.NOTOKEN,n.c1=u?i.t1:i.NOTOKEN,n.cs=(a?1:0)+(u?1:0)),l&&s.c&&(l=l&&s.c(n,i,o)),l)break;s=null}l||u.ZZ===i.t0.tin||(o.e=i.t0),s&&(o.n=null!=s.n?s.n:o.n,o.h=null!=s.h?s.h:o.h,o.a=null!=s.a?s.a:o.a,o.u=null!=s.u?s.u:o.u,o.k=null!=s.k?s.k:o.k,o.g=null!=s.g?s.g:o.g,o.e=s.e&&s.e(n,i,o)||void 0,o.p=null!=s.p?"string"==typeof s.p?s.p:s.p(n,i,o):o.p,o.r=null!=s.r?"string"==typeof s.r?s.r:s.r(n,i,o):o.r,o.b=null!=s.b?"number"==typeof s.b?s.b:s.b(n,i,o):o.b);let f=c<t.length;return i.log&&i.log("parse "+n.state.toUpperCase(),n.prev.id+"/"+n.parent.id+"/"+n.child.id,n.name+"~"+n.id,f?"alt="+c:"no-alt",f&&o.g?"g:"+o.g+" ":"",(f&&o.p?"p:"+o.p+" ":"")+(f&&o.r?"r:"+o.r+" ":"")+(f&&o.b?"b:"+o.b+" ":""),(r.OPEN===n.state?[n.o0,n.o1].slice(0,n.os):[n.c0,n.c1].slice(0,n.cs)).map(e=>e.name+"="+i.F(e.src)).join(" "),"c:"+(s&&s.c?l:r.EMPTY),"n:"+(0,a.entries)(o.n).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(o.u).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(o.k).map(e=>e[0]+"="+e[1]).join(";"),c<t.length&&s.s?"["+s.s.map(e=>Array.isArray(e)?e.map(e=>u[e]).join("|"):u[e]).join(" ")+"]":"[]",o),o}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 v=(...e)=>new g(...e);s.makeRuleSpec=v;class x{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){n=this.rsm[e]=this.rsm[e]||v(this.cfg,{}),(n=this.rsm[e]=t(this.rsm[e],this.rsm)||this.rsm[e]).name=e;for(let e of[...n.def.open,...n.def.close])(0,a.normalt)(e);return}return n}start(e,t,n,i){let o,l=(0,c.makeToken)("#ZZ",(0,a.tokenize)("#ZZ",this.cfg),void 0,r.EMPTY,(0,c.makePoint)(-1)),s=(0,c.makeNoToken)(),u={uI:0,opts:this.options,cfg:this.cfg,meta:n||{},src:()=>e,root:()=>o.node,plgn:()=>t.internal().plugins,rule:{},xs:-1,v2:l,v1:l,t0:l,t1:l,tC:-2,next:_,rs:[],rsI:0,rsm:this.rsm,log:void 0,F:(0,a.srcfmt)(this.cfg),use:{},NOTOKEN:s,NORULE:{}},d=(e=>p(v(e.cfg,{}),e))(u=(0,a.deep)(u,i));if(u.NORULE=d,u.rule=d,(0,a.makelog)(u,n),""===e){if(this.cfg.lex.empty)return;throw new a.JsonicError(a.S.unexpected,{src:e},u.t0,d,u)}let f=e=>(0,a.tokenize)(e,this.cfg),h=(0,a.badlex)((0,c.makeLex)(u),(0,a.tokenize)("#BD",this.cfg),u),m=this.rsm[this.cfg.rule.start];if(null==m)return;let g=p(m,u);o=g;let x=2*(0,a.keys)(this.rsm).length*h.src.length*2*u.cfg.rule.maxmul,k=u.cfg.tokenSet.ignore;function _(){let e;u.v2=u.v1,u.v1=u.t0,u.t0=u.t1;do{e=h(g),u.tC++}while(k[e.tin]);return u.t1=e,u.t0}_(),_();let b=0;for(;d!==g&&b<x;)u.log&&u.log("\nstack","<<"+u.F(o.node)+">>",u.rs.slice(0,u.rsI).map(e=>e.name+"~"+e.id).join("/"),u.rs.slice(0,u.rsI).map(e=>"<"+u.F(e.node)+">").join(" "),g,u,"\n"),u.log&&u.log("rule "+g.state.toUpperCase(),g.prev.id+"/"+g.parent.id+"/"+g.child.id,g.name+"~"+g.id,"["+u.F(u.t0.src)+" "+u.F(u.t1.src)+"]","n:"+(0,a.entries)(g.n).filter(e=>e[1]).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(g.use).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(g.keep).map(e=>e[0]+"="+e[1]).join(";"),"["+f(u.t0.tin)+" "+f(u.t1.tin)+"]",g,u),u.rule=g,g=g.process(u),b++;if((0,a.tokenize)("#ZZ",this.cfg)!==u.t0.tin)throw new a.JsonicError(a.S.unexpected,{},u.t0,d,u);return u.root()}clone(e,t){let n=new x(e,t);return n.rsm=Object.keys(this.rsm).reduce((e,t)=>(e[t]=(0,a.filterRules)(this.rsm[t],this.cfg),e),{}),n}}s.Parser=x;var k={};Object.defineProperty(k,"__esModule",{value:!0}),k.grammar=void 0,k.grammar=function(e){const t=e.token.OB,n=e.token.CB,r=e.token.OS,i=e.token.CS,o=e.token.CL,l=e.token.CA,s=e.token.TX,a=e.token.NR,c=e.token.ST,u=e.token.VL,p=e.token.ZZ,d=[s,a,c,u],f=e.util.deep,h=(e,t)=>{if(!t.cfg.rule.finish)return t.t0.src="END_OF_SOURCE",t.t0};e.rule("val",e=>{e.bo(e=>e.node=void 0).open([{s:[t],p:"map",b:1,g:"map,json"},{s:[r],p:"list",b:1,g:"list,json"},{s:[d,o],p:"map",b:2,n:{pk:1},g:"pair,json"},{s:[d],g:"val,json"}]).close([{s:[p],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={}}).open([{s:[t,n],g:"map,json"},{s:[t],p:"pair",n:{pk:0},g:"map,json,pair"}])}),e.rule("list",e=>{e.bo(e=>{e.node=[]}).open([{s:[r,i],g:"list,json"},{s:[r],p:"elem",g:"list,elem,json"}])}),e.rule("pair",e=>{e.open([{s:[d,o],p:"val",u:{pair:!0},g:"map,pair,key,json"}]).ao((e,t)=>{if(e.use.pair){const t=e.o0,n=c===t.tin||s===t.tin?t.val:t.src;e.use.key=n}}).bc((e,t)=>{e.use.pair&&(e.use.prev=e.node[e.use.key],e.node[e.use.key]=e.child.node)}).close([{s:[n],g:"map,pair,json"},{s:[l],r:"pair",g:"map,pair,json"},{s:[p],e:h,g:"map,pair,json"}])}),e.rule("elem",e=>{e.open([{p:"val",g:"list,elem,val,json"}]).bc(e=>{void 0!==e.child.node&&e.node.push(e.child.node)}).close([{s:[l],r:"elem",g:"list,elem,json"},{s:[i],g:"list,elem,json"},{s:[p],e:h,g:"list,elem,json"}])}),e.rule("val",e=>{e.open([{s:[[n,i]],b:1,g:"val,imp,null,jsonic"},{s:[l],c:{n:{il:0}},p:"list",b:1,g:"list,imp,jsonic"},{s:[l],b:1,g:"list,val,imp,null,jsonic"}],{append:!0}).close([{s:[[n,i]],b:1,g:"val,json,close"},{s:[l],c:{n:{il:0,pk:0}},n:{il:1},r:"elem",a:e=>e.node=[e.node],g:"list,val,imp,comma,jsonic"},{c:{n:{il:0,pk:0}},n:{il:1},r:"elem",a:e=>e.node=[e.node],g:"list,val,imp,space,jsonic",b:1}],{append:!0,move:[1,-1]})}),e.rule("map",e=>{e.bo(e=>{e.n.il=1+(e.n.il?e.n.il:0),e.n.im=1+(e.n.im?e.n.im:0)}).open([{s:[d,o],p:"pair",b:2,g:"pair,list,val,imp"}],{append:!0})}),e.rule("list",e=>{e.bo(e=>{e.n.il=1+(e.n.il?e.n.il:0),e.n.pk=1+(e.n.pk?e.n.pk:0),e.n.im=1+(e.n.im?e.n.im:0)}).open([{s:[l],p:"elem",b:1,g:"list,elem,val,imp"},{p:"elem",g:"list,elem"}],{append:!0})}),e.rule("pair",e=>{e.open([{s:[l],g:"map,pair,comma"}],{append:!0}).bc((e,t)=>{if(e.use.pair){let n=e.use.key,r=e.child.node;const i=e.use.prev;r=void 0===r?null:r,e.node[n]=null==i?r:t.cfg.map.merge?t.cfg.map.merge(i,r):t.cfg.map.extend?f(i,r):r}}).close([{s:[n],c:{n:{pk:0}},g:"map,pair,json"},{s:[l,n],c:{n:{pk:0}},g:"map,pair,comma,jsonic"},{s:[l],c:{n:{pk:0}},r:"pair",g:"map,pair,json"},{s:[l],c:{n:{im:1}},r:"pair",g:"map,pair,jsonic"},{s:[d],c:{n:{pk:0}},r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[d],c:{n:{im:1}},r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[[n,l,...d]],b:1,g:"map,pair,imp,path,jsonic"},{s:[i],b:1,g:"list,pair,imp,jsonic"},{s:[p],e:h,g:"map,pair,json"}],{append:!0,delete:[0,1,2]})}),e.rule("elem",e=>{e.open([{s:[l,l],b:2,a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[l],a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"}]).close([{s:[l,i],g:"list,elem,comma.jsonic"},{s:[l],r:"elem",g:"list,elem,json"},{s:[[...d,t,r]],r:"elem",b:1,g:"list,elem,imp,jsonic"},{s:[i],g:"list,elem,json"},{s:[p],e:h,g:"list,elem,json"}],{delete:[-1,-2,-3]})})};var _={exports:{}};Object.defineProperty(_.exports,"__esModule",{value:!0}),_.exports.AFTER=_.exports.BEFORE=_.exports.CLOSE=_.exports.OPEN=_.exports.makeTextMatcher=_.exports.makeNumberMatcher=_.exports.makeCommentMatcher=_.exports.makeStringMatcher=_.exports.makeLineMatcher=_.exports.makeSpaceMatcher=_.exports.makeFixedMatcher=_.exports.makeLex=_.exports.makeRuleSpec=_.exports.makeRule=_.exports.makePoint=_.exports.makeToken=_.exports.make=_.exports.util=_.exports.Parser=_.exports.JsonicError=_.exports.Jsonic=void 0,Object.defineProperty(_.exports,"OPEN",{enumerable:!0,get:function(){return r.OPEN}}),Object.defineProperty(_.exports,"CLOSE",{enumerable:!0,get:function(){return r.CLOSE}}),Object.defineProperty(_.exports,"BEFORE",{enumerable:!0,get:function(){return r.BEFORE}}),Object.defineProperty(_.exports,"AFTER",{enumerable:!0,get:function(){return r.AFTER}});const b=t({});Object.defineProperty(_.exports,"JsonicError",{enumerable:!0,get:function(){return b.JsonicError}});const y=n({});Object.defineProperty(_.exports,"makePoint",{enumerable:!0,get:function(){return y.makePoint}}),Object.defineProperty(_.exports,"makeToken",{enumerable:!0,get:function(){return y.makeToken}}),Object.defineProperty(_.exports,"makeLex",{enumerable:!0,get:function(){return y.makeLex}}),Object.defineProperty(_.exports,"makeFixedMatcher",{enumerable:!0,get:function(){return y.makeFixedMatcher}}),Object.defineProperty(_.exports,"makeSpaceMatcher",{enumerable:!0,get:function(){return y.makeSpaceMatcher}}),Object.defineProperty(_.exports,"makeLineMatcher",{enumerable:!0,get:function(){return y.makeLineMatcher}}),Object.defineProperty(_.exports,"makeStringMatcher",{enumerable:!0,get:function(){return y.makeStringMatcher}}),Object.defineProperty(_.exports,"makeCommentMatcher",{enumerable:!0,get:function(){return y.makeCommentMatcher}}),Object.defineProperty(_.exports,"makeNumberMatcher",{enumerable:!0,get:function(){return y.makeNumberMatcher}}),Object.defineProperty(_.exports,"makeTextMatcher",{enumerable:!0,get:function(){return y.makeTextMatcher}}),Object.defineProperty(_.exports,"makeRule",{enumerable:!0,get:function(){return s.makeRule}}),Object.defineProperty(_.exports,"makeRuleSpec",{enumerable:!0,get:function(){return s.makeRuleSpec}}),Object.defineProperty(_.exports,"Parser",{enumerable:!0,get:function(){return s.Parser}});const j={tokenize:b.tokenize,srcfmt:b.srcfmt,deep:b.deep,clone:b.clone,charset:b.charset,trimstk:b.trimstk,makelog:b.makelog,badlex:b.badlex,extract:b.extract,errinject:b.errinject,errdesc:b.errdesc,configure:b.configure,parserwrap:b.parserwrap,mesc:b.mesc,escre:b.escre,regexp:b.regexp,prop:b.prop,str:b.str,omap:b.omap,keys:b.keys,values:b.values,entries:b.entries};function O(e,t){let n={parser:{},config:{},plugins:[],mark:Math.random()},r=(0,b.deep)({},t?{...t.options}:!1===(null==e?void 0:e.defaults$)?{}:i.defaults,e||{}),o=function(e,t,n){var r;if(b.S.string===typeof e){let i=o.internal();return((null===(r=l.parser)||void 0===r?void 0:r.start)?(0,b.parserwrap)(l.parser):i.parser).start(e,o,t,n)}return e},l=e=>{if(null!=e&&b.S.object===typeof e){(0,b.deep)(r,e),(0,b.configure)(o,n.config,r);let t=o.internal().parser;n.parser=t.clone(r,n.config)}return{...o.options}},a={token:e=>(0,b.tokenize)(e,n.config,o),fixed:e=>n.config.fixed.ref[e],options:(0,b.deep)(l,r),parse:o,use:function(e,t){const n=e.name.toLowerCase(),r=(0,b.deep)({},e.defaults||{},t||{});o.options({plugin:{[n]:r}});let i=o.options.plugin[n];return o.internal().plugins.push(e),e(o,i)||o},rule:(e,t)=>o.internal().parser.rule(e,t)||o,lex:e=>{let t=r.lex.match;t.unshift(e),o.options({lex:{match:t}})},make:e=>O(e,o),empty:e=>O({defaults$:!1,grammar$:!1,...e||{}}),id:"Jsonic/"+Date.now()+"/"+(""+Math.random()).substring(2,8).padEnd(6,"0")+(null==l.tag?"":"/"+l.tag),toString:()=>a.id,util:j};if((0,b.defprop)(a.make,b.S.name,{value:b.S.make}),(0,b.assign)(o,a),(0,b.defprop)(o,"internal",{value:()=>n}),t){for(let n in t)void 0===o[n]&&(o[n]=t[n]);o.parent=t;let e=t.internal();n.config=(0,b.deep)({},e.config),(0,b.configure)(o,n.config,r),(0,b.assign)(o.token,n.config.t),n.plugins=[...e.plugins],n.parser=e.parser.clone(r,n.config)}else n.config=(0,b.configure)(o,void 0,r),n.plugins=[],n.parser=new s.Parser(r,n.config),!1!==r.grammar$&&(0,k.grammar)(o);return o}_.exports.util=j,_.exports.make=O;let E=void 0,S=E=O();return _.exports.Jsonic=S,delete E.options,delete E.use,delete E.rule,delete E.lex,delete E.token,delete E.fixed,E.Jsonic=E,E.JsonicError=b.JsonicError,E.Parser=s.Parser,E.makeLex=y.makeLex,E.makeToken=y.makeToken,E.makePoint=y.makePoint,E.makeRule=s.makeRule,E.makeRuleSpec=s.makeRuleSpec,E.makeFixedMatcher=y.makeFixedMatcher,E.makeSpaceMatcher=y.makeSpaceMatcher,E.makeLineMatcher=y.makeLineMatcher,E.makeStringMatcher=y.makeStringMatcher,E.makeCommentMatcher=y.makeCommentMatcher,E.makeNumberMatcher=y.makeNumberMatcher,E.makeTextMatcher=y.makeTextMatcher,E.util=j,E.make=O,_.exports.default=S,_.exports=_.exports.Jsonic,_.exports}))}).call(this)}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),t=t.exports;var n={};Object.defineProperty(n,"__esModule",{value:!0}),n.testing=n.evaluate=n.Expr=void 0;const{omap:r,entries:i,values:o}=t.util,l={};let s=function(e,t){var n;let s=(null===(n=e.options.lex)||void 0===n?void 0:n.match)||[],y=s.map(e=>e.name).indexOf("makeCommentMatcher");0<y&&e.options({lex:{match:[s[y],...s.slice(0,y),...s.slice(y+1)]}});let j=e.token.bind(e),O=e.fixed.bind(e),E=t.op||{};const S=k(j,O,E,"prefix"),M=k(j,O,E,"suffix"),N=k(j,O,E,"infix"),T=k(j,O,E,"ternary"),P=function(e,t,n){return i(E).reduce((n,[r,i])=>{if(i.paren){let o=t(i.osrc)||e("#E"+i.osrc),s=e(o),a=t(i.csrc)||e("#E"+i.csrc),c=e(a);n[o]={name:r+"-paren",osrc:i.osrc,csrc:i.csrc,otkn:s,otin:o,ctkn:c,ctin:a,preval:{active:null!=i.preval&&(null==i.preval.active||i.preval.active),required:null!=i.preval&&null!=i.preval.required&&i.preval.required},use:{},paren:!0,src:i.osrc,left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER,infix:!1,prefix:!1,suffix:!1,ternary:!1,tkn:"",tin:-1,terms:1,token:{},OP_MARK:l}}return n},{})}(j,O),I=r(P,([e,t])=>[void 0,void 0,t.ctin,t]);let w=Object.values({...P,...I}).reduce((e,t)=>(e[t.otkn]=t.osrc,e[t.ctkn]=t.csrc,e),{}),C=Object.values({...S,...M,...N,...T}).reduce((e,t)=>(e[t.tkn]=t.src,e),{});e.options({fixed:{token:{...C,...w}}});const $=o(S).map(e=>e.tin),A=o(N).map(e=>e.tin),R=o(M).map(e=>e.tin),V=o(T).filter(e=>0===e.use.ternary.opI).map(e=>e.tin),L=o(T).filter(e=>1===e.use.ternary.opI).map(e=>e.tin),F=o(P).map(e=>e.otin),D=o(I).map(e=>e.ctin),Y=0<$.length,B=0<A.length,U=0<R.length,J=0<V.length&&0<L.length,z=0<F.length&&0<D.length,Z=e.token.CA,q=e.token.TX,K=e.token.NR,W=e.token.ST,G=e.token.VL,H=e.token.ZZ,Q=[q,K,W,G];e.rule("val",t=>{J&&L.includes(e.token.CL)&&(t.def.open.find(e=>e.g.includes("pair")).c=e=>!e.n.expr_ternary),t.open([Y?{s:[$],b:1,n:{expr_prefix:1,expr_suffix:0},p:"expr",g:"expr,expr-prefix"}:null,z?{s:[F],b:1,p:"paren",c:(e,t)=>{let n=!0;return P[e.o0.tin].preval.required&&(n="val"===e.prev.name&&e.prev.use.paren_preval),n&&1===e.prev.id&&(t.root=()=>e.node),n},g:"expr,expr-paren"}:null]).close([J?{s:[V],c:e=>!e.n.expr,b:1,r:"ternary",g:"expr,expr-ternary"}:null,B?{s:[A],b:1,n:{expr_prefix:0,expr_suffix:0},r:e=>e.n.expr?"":"expr",g:"expr,expr-infix"}:null,U?{s:[R],b:1,n:{expr_prefix:0,expr_suffix:1},r:e=>e.n.expr?"":"expr",g:"expr,expr-suffix"}:null,z?{s:[D],c:e=>!!e.n.expr_paren,b:1,g:"expr,expr-paren"}:null,z?{s:[F],b:1,r:"val",c:e=>P[e.c0.tin].preval.active,u:{paren_preval:!0},g:"expr,expr-paren,expr-paren-preval"}:null,J?{s:[L],c:e=>!!e.n.expr_ternary,b:1,g:"expr,expr-ternary"}:null,{s:[Z],c:e=>1===e.d&&(1<=e.n.expr||1<=e.n.expr_ternary)||1<=e.n.expr_ternary&&1<=e.n.expr_paren,b:1,g:"expr,list,val,imp,comma,top"},{s:[Q],c:e=>1===e.d&&(1<=e.n.expr||1<=e.n.expr_ternary)||1<=e.n.expr_ternary&&1<=e.n.expr_paren,b:1,g:"expr,list,val,imp,space,top"}])}),e.rule("list",e=>{e.bo(!1,(...e)=>{e[0].n.expr=0,e[0].n.expr_prefix=0,e[0].n.expr_suffix=0,e[0].n.expr_paren=0,e[0].n.expr_ternary=0})}),e.rule("map",e=>{e.bo(!1,(...e)=>{e[0].n.expr=0,e[0].n.expr_prefix=0,e[0].n.expr_suffix=0,e[0].n.expr_paren=0,e[0].n.expr_ternary=0})}),e.rule("elem",e=>{e.close([z?{s:[D],b:1,c:e=>!!e.n.expr_paren,g:"expr,expr-paren,imp,close,list"}:null,z?{s:[F],b:1,r:"elem",g:"expr,expr-paren,imp,open,list"}:null])}),e.rule("pair",e=>{e.close([z?{s:[D],b:1,c:e=>!!e.n.expr_paren||0<e.n.pk,g:"expr,expr-paren,imp,map"}:null])}),e.rule("expr",e=>{e.open([Y?{s:[$],c:e=>!!e.n.expr_prefix,n:{expr:1,il:1,im:1},p:"val",g:"expr,expr-prefix",a:e=>{const t=c(e.o0,S);e.node=x(e.parent.node)?_(e.parent.node,t):a(e,e.parent,t)}}:null,B?{s:[A],p:"val",n:{expr:1,expr_prefix:0,il:1,im:1},a:e=>{const t=e.prev,n=e.parent,r=c(e.o0,N);x(n.node)&&!v("ternary",n.node)?e.node=_(n.node,r):x(t.node)?(e.node=_(t.node,r),e.parent=t):e.node=a(e,t,r)},g:"expr,expr-infix"}:null,U?{s:[R],n:{expr:1,expr_prefix:0,il:1,im:1},a:e=>{const t=e.prev,n=c(e.o0,M);e.node=x(t.node)?_(t.node,n):a(e,t,n)},g:"expr,expr-suffix"}:null]).bc(e=>{var t;x(e.node)&&(null===(t=e.node)||void 0===t?void 0:t.length)-1<e.node[0].terms&&e.node.push(e.child.node)}).close([B?{s:[A],c:e=>!e.n.expr_prefix,b:1,r:"expr",g:"expr,expr-infix"}:null,U?{s:[R],c:e=>!e.n.expr_prefix,b:1,r:"expr",g:"expr,expr-suffix"}:null,z?{s:[D],c:e=>!!e.n.expr_paren,b:1}:null,J?{s:[V],c:e=>!e.n.expr_prefix,b:1,r:"ternary",g:"expr,expr-ternary"}:null,{s:[Z],c:{d:0},n:{expr:0},r:"elem",a:e=>e.parent.node=e.node=[e.node],g:"expr,comma,list,top"},{s:[Q],c:{d:0},n:{expr:0},b:1,r:"elem",a:e=>e.parent.node=e.node=[e.node],g:"expr,space,list,top"},{s:[Z],c:{n:{pk:0}},n:{expr:0},b:1,h:h,g:"expr,list,val,imp,comma"},{c:{n:{pk:0,expr_suffix:0}},n:{expr:0},h:h,g:"expr,list,val,imp,space"},{n:{expr:0},g:"expr,expr-end"}]).ac(e=>{t.evaluate&&0===e.n.expr&&(e.parent.node=b(e.parent,e.parent.node,t.evaluate))})}),e.rule("paren",e=>{e.bo(e=>{e.n.im=0,e.n.il=0,e.n.pk=0}).open([z?{s:[F,D],b:1,g:"expr,expr-paren,empty",c:e=>P[e.o0.tin].name===I[e.o1.tin].name,a:d(P)}:null,z?{s:[F],p:"val",n:{expr_paren:1,expr:0,expr_prefix:0,expr_suffix:0},g:"expr,expr-paren,open",a:d(P)}:null]).close([z?{s:[D],c:e=>{let t="expr_paren_depth_"+I[e.c0.tin].name;return!!e.n[t]},a:f(I),g:"expr,expr-paren,close"}:null])}),J&&e.rule("ternary",e=>{e.open([{s:[V],p:"val",n:{expr_ternary:1,expr:0,expr_prefix:0,expr_suffix:0},u:{expr_ternary_step:1},g:"expr,expr-ternary,open",a:e=>{let t=c(e.o0,T);e.use.expr_ternary_name=t.name,x(e.prev.node)?e.node=u(e.prev.node,t,p(e.prev.node)):e.node=e.prev.node=u([],t,e.prev.node),e.use.expr_ternary_paren=e.n.expr_paren||e.prev.use.expr_ternary_paren||0,e.n.expr_paren=0}},{p:"val",c:e=>2===e.prev.use.expr_ternary_step,a:e=>{e.use.expr_ternary_step=e.prev.use.expr_ternary_step,e.n.expr_paren=e.use.expr_ternary_paren=e.prev.use.expr_ternary_paren},g:"expr,expr-ternary,step"}]).close([{s:[L],c:e=>1===e.use.expr_ternary_step&&e.use.expr_ternary_name===T[e.c0.tin].name,r:"ternary",a:e=>{e.use.expr_ternary_step++,e.node.push(e.child.node)},g:"expr,expr-ternary,step"},{s:[[Z,...D]],c:m,b:(e,t)=>D.includes(t.t0.tin)?1:0,r:(e,t)=>{var n;return D.includes(t.t0.tin)||0!==e.d&&(!e.prev.use.expr_ternary_paren||(null===(n=e.parent.node)||void 0===n?void 0:n.length))?"":"elem"},a:g,g:"expr,expr-ternary,list,val,imp,comma"},{c:m,r:(e,t)=>{var n;return 0!==e.d&&D.includes(t.t0.tin)&&!e.prev.use.expr_ternary_paren||(null===(n=e.parent.node)||void 0===n?void 0:n.length)||H===t.t0.tin?"":"elem"},a:g,g:"expr,expr-ternary,list,val,imp,space"},{c:e=>0<e.d&&2===e.use.expr_ternary_step,a:e=>{e.node.push(e.child.node)},g:"expr,expr-ternary,close"}])})};function a(e,t,n){let r=t.node;return x(t.node)?r=p(t.node):t.node=[],u(t.node,n),n.prefix||(t.node[1]=r),e.parent=t,t.node}function c(e,t){return{...t[e.tin],token:e,OP_MARK:l}}function u(e,t,...n){let r=e;r[0]=t;let i=0;for(;i<n.length;i++)r[i+1]=n[i];return r.length=i+1,r}function p(e){return[...e]}function d(e){return function(t){let n="expr_paren_depth_"+c(t.o0,e).name;t.use[n]=t.n[n]=1,t.node=void 0}}function f(e){return function(t){(x(t.child.node)||void 0===t.node)&&(t.node=t.child.node);const n=c(t.c0,e);let r="expr_paren_depth_"+n.name;if(t.use[r]===t.n[r]){const e=t.node;t.node=[n],void 0!==e&&(t.node[1]=e),t.parent.prev.use.paren_preval&&(v("paren",t.parent.prev.node)?t.node=u(t.parent.prev.node,t.node[0],p(t.parent.prev.node),t.node[1]):(t.node.splice(1,0,t.parent.prev.node),t.parent.prev.node=t.node))}}}function h(e,t,n){let r=null;for(let i=t.rsI-1;-1<i;i--)if("paren"===t.rs[i].name){r=t.rs[i];break}return r&&(null==r.child.node?(r.child.node=[e.node],n.r="elem",n.b=0):x(r.child.node)&&(r.child.node=[r.child.node],n.r="elem",n.b=0),e.node=r.child.node),n}function m(e){return(0===e.d||1<=e.n.expr_paren)&&!e.n.pk&&2===e.use.expr_ternary_step}function g(e,t,n){e.n.expr_paren=e.prev.use.expr_ternary_paren,e.node.push(e.child.node),"elem"===n.r&&(e.node[0]=p(e.node),e.node.length=1)}function v(e,t){return null!=t&&x(t)&&!0===t[0][e]}function x(e){return null!=e&&e[0]&&e[0].OP_MARK===l}function k(e,t,n,r){return Object.entries(n).filter(([e,t])=>t[r]).reduce((n,[i,o])=>{let s="",a=-1,c="";c="string"==typeof o.src?o.src:o.src[0],a=t(c)||e("#E"+c),s=e(a);let u=n[a]={src:c,left:o.left||Number.MIN_SAFE_INTEGER,right:o.right||Number.MAX_SAFE_INTEGER,name:i+(i.endsWith("-"+r)?"":"-"+r),infix:"infix"===r,prefix:"prefix"===r,suffix:"suffix"===r,ternary:"ternary"===r,tkn:s,tin:a,terms:"ternary"===r?3:"infix"===r?2:1,use:{},paren:!1,osrc:"",csrc:"",otkn:"",ctkn:"",otin:-1,ctin:-1,preval:{active:!1,required:!1},token:{},OP_MARK:l};if(u.ternary){let r=o.src;u.src=r[0],u.use.ternary={opI:0};let i={...u};c=o.src[1],a=t(c)||e("#E"+c),s=e(a),i.src=c,i.use={ternary:{opI:1}},i.tkn=s,i.tin=a,n[a]=i}return n},{})}function _(e,t){let n=e,r=e[0];if(t)if(t.infix)if(r.suffix||t.left<=r.right)u(e,t,p(e));else{const i=r.terms;n=x(e[i])&&e[i][0].right<t.left?_(e[i],t):e[i]=u([],t,e[i])}else if(t.prefix)n=e[r.terms]=u([],t);else if(t.suffix)if(!r.suffix&&r.right<=t.left){const n=r.terms;x(e[n])&&e[n][0].prefix&&e[n][0].right<t.left?_(e[n],t):e[n]=u([],t,e[n])}else u(e,t,p(e));return n}function b(e,t,n){return null==t?t:x(t)?n(e,t[0],t.slice(1).map(t=>b(e,t,n))):t}n.Expr=s,s.defaults={op:{positive:{prefix:!0,right:14e3,src:"+"},negative:{prefix:!0,right:14e3,src:"-"},addition:{infix:!0,left:140,right:150,src:"+"},subtraction:{infix:!0,left:140,right:150,src:"-"},multiplication:{infix:!0,left:160,right:170,src:"*"},division:{infix:!0,left:160,right:170,src:"/"},remainder:{infix:!0,left:160,right:170,src:"%"},plain:{paren:!0,osrc:"(",csrc:")"}}},n.evaluate=b;const y={prattify:_,opify:e=>(e.OP_MARK=l,e)};return n.testing=y,n}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$exprMin_18=_$exprMin_18.exports;var _$pathMin_25={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$pathMin_25.exports?_$pathMin_25.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).JsonicPath=t()}((function(){var e={};Object.defineProperty(e,"__esModule",{value:!0}),e.Path=void 0;const t=(e,t)=>{e.rule("val",e=>{e.bo(e=>{0===e.d&&(e.keep.path=[])})}),e.rule("map",e=>{e.bo(e=>{delete e.keep.index})}),e.rule("pair",e=>{e.ao(e=>{0<e.d&&e.use.pair&&(e.child.keep.path=[...e.keep.path,e.use.key],e.child.keep.key=e.use.key)})}),e.rule("list",e=>{e.bo(e=>{e.keep.index=-1})}),e.rule("elem",e=>{e.ao(e=>{0<e.d&&(e.keep.index=1+e.keep.index,e.child.keep.path=[...e.keep.path,e.keep.index],e.child.keep.key=e.keep.index,e.child.keep.index=e.keep.index)})})};return e.Path=t,t.defaults={},e}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$pathMin_25=_$pathMin_25.exports;var _$aontu_1={};Object.defineProperty(_$aontu_1,"__esModule",{value:!0}),_$aontu_1.util=_$aontu_1.Lang=_$aontu_1.Nil=_$aontu_1.Aontu=void 0;const __lang_1_1=_$lang_2({});Object.defineProperty(_$aontu_1,"Lang",{enumerable:!0,get:function(){return __lang_1_1.Lang}});const __unify_1_1=_$unify_7({}),__Nil_1_1=_$Nil_13({});function Aontu(e,t){let n=util.options(e,t),r={},i=new __lang_1_1.Lang(n).parse(n.src,{deps:r}),o=new __unify_1_1.Unify(i),l=o.res,s=o.err;return l.deps=r,l.err=s,l}Object.defineProperty(_$aontu_1,"Nil",{enumerable:!0,get:function(){return __Nil_1_1.Nil}}),_$aontu_1.Aontu=Aontu;const util={options:(e,t)=>{let n="string"==typeof e?{src:e}:e;return{src:"",print:0,resolver:__lang_1_1.includeFileResolver,...n,...t||{}}}};return _$aontu_1.util=util,_$aontu_1.default=Aontu,_$aontu_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).Aontu=e()}}((function(){var define,module,exports,createModuleFactory=function(e){var t;return function(n){return t||e(t={exports:{},parent:n},t.exports),t.exports}},_$lang_2=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.includeFileResolver=t.Site=t.Lang=void 0;const n=_$multisource_20({}),r=_$type_6({}),i=_$ConjunctVal_9({}),l=_$DisjunctVal_10({}),o=_$MapVal_12({}),s=_$ListVal_11({}),a=_$PrefVal_14({}),u=_$RefVal_15({}),c=_$Nil_13({}),p=_$val_8({});t.Site=class{constructor(e){this.row=-1,this.col=-1,this.url="",this.row=e.row,this.col=e.col,this.url=e.url}};let d=function(e){e.use(_$pathMin_25.Path);let t=(e,t)=>(e.path=[...t||[]],e);e.options({value:{map:{string:{val:e=>t(new p.ScalarTypeVal(String),e.keep.path)},number:{val:e=>t(new p.ScalarTypeVal(Number),e.keep.path)},integer:{val:e=>t(new p.ScalarTypeVal(p.Integer),e.keep.path)},boolean:{val:e=>t(new p.ScalarTypeVal(Boolean),e.keep.path)},nil:{val:e=>t(new c.Nil("literal"),e.keep.path)},top:{val:()=>r.TOP}}},map:{merge:(e,n)=>{let r=e,l=n;return(null==r?void 0:r.isVal)&&(null==l?void 0:l.isVal)?t(new i.ConjunctVal([r,l]),e.path):(e.___merge=e.___merge||[],e.___merge.push(n),e)}}});let n={"conjunct-infix":(e,n,r)=>t(new i.ConjunctVal(r),e.keep.path),"disjunct-infix":(e,n,r)=>t(new l.DisjunctVal(r),e.keep.path),"dot-prefix":(e,n,r)=>t(new u.RefVal(r,!0),e.keep.path),"dot-infix":(e,n,r)=>t(new u.RefVal(r),e.keep.path),"star-prefix":(e,n,r)=>t(new a.PrefVal(r[0]),e.keep.path)};e.use(_$exprMin_18.Expr,{op:{conjunct:{infix:!0,src:"&",left:14e3,right:15e3},disjunct:{infix:!0,src:"|",left:16e3,right:17e3},"dot-infix":{src:".",infix:!0,left:15e6,right:14e6},"dot-prefix":{src:".",prefix:!0,right:14e6},star:{src:"*",prefix:!0,right:14e6}},evaluate:(e,t,r)=>n[t.name](e,t,r)});let d=e.token["#E&"],f=e.token.CL;e.rule("val",e=>(e.open([{s:[d,f],p:"map",b:2,g:"spread"}]).bc((e,n)=>{let r=e.node,i=typeof r;"string"===i?r=t(new p.StringVal(e.node),e.keep.path):"number"===i?r=Number.isInteger(e.node)?t(new p.IntegerVal(e.node),e.keep.path):t(new p.NumberVal(e.node),e.keep.path):"boolean"===i&&(r=t(new p.BooleanVal(e.node),e.keep.path));let l=e.o0;r.row=l.rI,r.col=l.cI,r.url=n.meta.multisource&&n.meta.multisource.path,e.node=r}),e)),e.rule("map",e=>(e.open([{s:[d,f],p:"pair",b:2,g:"spread"}]).bc(e=>{let n=e.node;if(n.___merge){let r={...n};delete r.___merge;let l=new o.MapVal(r);e.node=t(new i.ConjunctVal([l,...n.___merge]),e.keep.path)}else e.node=t(new o.MapVal(n),e.keep.path)}),e)),e.rule("list",e=>(e.bc(e=>{e.node=t(new s.ListVal(e.node),e.keep.path)}),e)),e.rule("pair",e=>(e.open([{s:[d,f],p:"val",u:{spread:!0},g:"spread"}]).bc(e=>{e.use.spread&&(e.node[o.MapVal.SPREAD]=e.node[o.MapVal.SPREAD]||{o:e.o0.src,v:[]},e.node[o.MapVal.SPREAD].v.push(e.child.node))}),e)),e.rule("elem",e=>(e.open([{s:[d,f],p:"val",u:{spread:!0},g:"spread"}]).bc(e=>{e.use.spread&&(e.node[s.ListVal.SPREAD]=e.node[s.ListVal.SPREAD]||{o:e.o0.src,v:[]},e.node[s.ListVal.SPREAD].v.push(e.child.node))}),e))};const f=(0,_$file_23.makeFileResolver)(e=>"string"==typeof e?e:null==e?void 0:e.peg);t.includeFileResolver=f,t.Lang=class{constructor(e){this.options={src:"",print:-1},this.options=Object.assign({},this.options,e),this.jsonic=_$jsonicMin_19.Jsonic.make().use(d).use(n.MultiSource,{resolver:(null==e?void 0:e.resolver)||f})}parse(e,t){let n={multisource:{path:this.options.base,deps:t&&t.deps||void 0}};return t&&null!=t.log&&Number.isInteger(t.log)&&(n.log=t.log),this.jsonic(e,n)}}})),_$ListVal_11=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$Nil_13({}),l=_$ValBase_16({}),o=_$ConjunctVal_9({});class s extends l.ValBase{constructor(e,t){super(e,t),this.spread={cj:void 0};let n=this.peg[s.SPREAD];delete this.peg[s.SPREAD],n&&"&"===n.o&&(this.spread.cj=new o.ConjunctVal(Array.isArray(n.v)?n.v:[n.v],t))}unify(e,t){let l=!0,a=n.TOP===e?this:new s([],t);a.spread.cj=this.spread.cj,e instanceof s&&(a.spread.cj=null==a.spread.cj?e.spread.cj:null==e.spread.cj?a.spread.cj:a.spread.cj=new o.ConjunctVal([a.spread.cj,e.spread.cj],t)),a.done=this.done+1,this.spread.cj&&(a.spread.cj=n.DONE!==this.spread.cj.done?(0,r.unite)(t,this.spread.cj):this.spread.cj);let u=a.spread.cj||n.TOP;for(let i in this.peg)a.peg[i]=(0,r.unite)(t.descend(i),this.peg[i],u),l=l&&n.DONE===a.peg[i].done;if(e instanceof s){let o=(0,r.unite)(t,e);for(let e in o.peg){let s=o.peg[e],c=a.peg[e],p=a.peg[e]=void 0===c?s:c instanceof i.Nil?c:s instanceof i.Nil?s:(0,r.unite)(t.descend(e),c,s);this.spread.cj&&(a.peg[e]=(0,r.unite)(t,a.peg[e],u)),l=l&&n.DONE===p.done}}else if(n.TOP!==e)return i.Nil.make(t,"map",this,e);return a.done=l?n.DONE:a.done,a}get canon(){let e=Object.keys(this.peg);return"["+(this.spread.cj?"&:"+this.spread.cj.canon+(0<e.length?",":""):"")+e.map(e=>[this.peg[e].canon]).join(",")+"]"}gen(e){return this.peg.map(t=>t.gen(e))}}t.ListVal=s,s.SPREAD=Symbol("spread")})),_$ConjunctVal_9=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConjunctVal=t.norm=void 0;const n=_$type_6({}),r=_$ValBase_16({}),i=_$Nil_13({}),l=_$MapVal_12({}),o=_$op_4({});class s extends r.ValBase{constructor(e,t){super(e,t)}append(e){return this.peg.push(e),this}unify(e,t){let r=!0,u=[];for(let l=0;l<this.peg.length;l++)if(u[l]=(0,o.unite)(t,this.peg[l],e),r=r&&n.DONE===u[l].done,u[l]instanceof i.Nil)return i.Nil.make(t,"&peer["+u[l].canon+","+e.canon+"]",this.peg[l],e);u=a(u);let c,p,d=[];e:for(let a=0;a<u.length;a++){let e=u[a];if(n.DONE!==e.done){let r=(0,o.unite)(t,e,n.TOP);if(!(n.DONE===r.done||r instanceof l.MapVal)){d.push(r);continue e}e=r}let p=u[a+1];if(null==p)d.push(e);else{if(c=(0,o.unite)(t,e,p),r=r&&n.DONE===c.done,c instanceof s)e.id===c.peg[0].id&&(c=e);else if(c instanceof i.Nil)return c;d.push(c),a++}}return p=0===d.length?n.TOP:1===d.length?d[0]:new s(d,t),p.done=r?n.DONE:this.done+1,p}get canon(){return this.peg.map(e=>e.canon).join("&")}gen(e){if(0<this.peg.length){let t,n=this.peg[0];return void 0===n||n instanceof i.Nil||(t=n.gen(e)),t}}}function a(e){let t=[];for(let n=0,r=0;n<e.length;n++,r++)e[n]instanceof s?(t.push(...e[n].peg),r+=e[n].peg.length-1):t[r]=e[n];return t}t.ConjunctVal=s,t.norm=a})),_$MapVal_12=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$ValBase_16({}),l=_$Nil_13({}),o=_$ConjunctVal_9({});class s extends i.ValBase{constructor(e,t){super(e,t),this.spread={cj:void 0};let n=this.peg[s.SPREAD];delete this.peg[s.SPREAD],n&&"&"===n.o&&(this.spread.cj=new o.ConjunctVal(Array.isArray(n.v)?n.v:[n.v],t))}unify(e,t){null==t&&console.trace();let i=!0,a=n.TOP===e?this:new s({},t);a.spread.cj=this.spread.cj,e instanceof s&&(a.spread.cj=null==a.spread.cj?e.spread.cj:null==e.spread.cj?a.spread.cj:a.spread.cj=new o.ConjunctVal([a.spread.cj,e.spread.cj],t)),a.done=this.done+1,this.spread.cj&&(a.spread.cj=n.DONE!==this.spread.cj.done?(0,r.unite)(t,this.spread.cj):this.spread.cj);let u=a.spread.cj||n.TOP;for(let l in this.peg)a.peg[l]=(0,r.unite)(t.descend(l),this.peg[l],u),i=i&&n.DONE===a.peg[l].done;if(e instanceof s){let o=(0,r.unite)(t,e);for(let e in o.peg){let s=o.peg[e],c=a.peg[e],p=a.peg[e]=void 0===c?s:c instanceof l.Nil?c:s instanceof l.Nil?s:(0,r.unite)(t.descend(e),c,s);this.spread.cj&&(a.peg[e]=(0,r.unite)(t,a.peg[e],u)),i=i&&n.DONE===p.done,l.Nil}}else if(n.TOP!==e)return l.Nil.make(t,"map",this,e);return a.done=i?n.DONE:a.done,a}get canon(){let e=Object.keys(this.peg);return"{"+(this.spread.cj?"&:"+this.spread.cj.canon+(0<e.length?",":""):"")+e.map(e=>[JSON.stringify(e)+":"+this.peg[e].canon]).join(",")+"}"}gen(e){let t={};for(let n in this.peg)t[n]=this.peg[n].gen(e);return t}}t.MapVal=s,s.SPREAD=Symbol("spread")})),_$op_4=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unite=t.disjunct=void 0;const n=_$disjunct_3({});Object.defineProperty(t,"disjunct",{enumerable:!0,get:function(){return n.disjunct}});const r=_$unite_5({});Object.defineProperty(t,"unite",{enumerable:!0,get:function(){return r.unite}})})),_$unite_5=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unite=void 0;const n=_$type_6({}),r=_$ConjunctVal_9({}),i=_$DisjunctVal_10({}),l=_$PrefVal_14({}),o=_$RefVal_15({}),s=_$Nil_13({});function a(e,t){return e}t.unite=(e,t,u,c)=>{let p=t;if(!u||n.TOP!==t&&t)if(!t||n.TOP!==u&&u){if(t&&u&&n.TOP!==u)if(t instanceof s.Nil)p=a(t);else if(u instanceof s.Nil)p=a(u);else{if(u instanceof r.ConjunctVal||u instanceof i.DisjunctVal||u instanceof o.RefVal||u instanceof l.PrefVal)return u.unify(t,e);p=t.constructor===u.constructor&&t.peg===u.peg?a(t):t.unify(u,e)}}else p=t;else p=u;return p&&p.unify||(p=s.Nil.make(e,"unite",t,u)),n.DONE!==p.done&&(p=p.unify(n.TOP,e)),p}})),_$RefVal_15=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RefVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$Nil_13({}),l=_$ValBase_16({}),o=_$ConjunctVal_9({}),s=_$val_8({});class a extends l.ValBase{constructor(e,t){super(""),this.sep=".",this.absolute=!0===t,this.parts=[];for(let n of e)this.append(n)}append(e){"string"==typeof e?this.parts.push(e):e instanceof s.StringVal?this.parts.push(e.peg):e instanceof a&&(this.parts.push(...e.parts),e.absolute&&(this.absolute=!0)),this.peg=(this.absolute?this.sep:"")+this.parts.join(this.sep)}unify(e,t){let l,s=null==t?this:t.find(this);return s=null==s&&999<this.done?i.Nil.make(t,"no-path",this,e):s||this,s instanceof a?n.TOP===e?l=this:e instanceof i.Nil?l=i.Nil.make(t,"ref["+this.peg+"]",this,e):(this.done=n.DONE===this.done?n.DONE:this.done+1,l=new o.ConjunctVal([this,e],t)):l=(0,r.unite)(t,s,e),l.done=n.DONE===l.done?n.DONE:this.done+1,l}same(e){return null!=e&&this.peg===e.peg}get canon(){return this.peg}gen(e){}}t.RefVal=a})),_$val_8=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntegerVal=t.BooleanVal=t.StringVal=t.NumberVal=t.ScalarTypeVal=t.Integer=void 0;const n=_$type_6({}),r=_$unify_7({}),i=_$Nil_13({}),l=_$ValBase_16({});class o{}t.Integer=o;class s extends l.ValBase{constructor(e,t){super(e,t),this.done=n.DONE}unify(e,t){if(e instanceof a)return e.type===this.peg||Number===this.peg&&o===e.type?e:i.Nil.make(t,"no-scalar-unify",this,e);if(e instanceof s){if(Number===this.peg&&o===e.peg)return e;if(Number===e.peg&&o===this.peg)return this}return i.Nil.make(t,"scalar-type",this,e)}get canon(){return this.peg.name.toLowerCase()}same(e){return e instanceof s?this.peg===e.peg:super.same(e)}gen(e){}}t.ScalarTypeVal=s;class a extends l.ValBase{constructor(e,t,r){super(e,r),this.type=t,this.done=n.DONE}unify(e,t){return e instanceof s?e.unify(this,t):i.Nil.make(t,"scalar",this,e)}get canon(){return this.peg.toString()}same(e){return e instanceof a?e.peg===this.peg:super.same(e)}gen(e){return this.peg}}t.NumberVal=class extends a{constructor(e,t){super(e,Number,t)}unify(e,t){return e instanceof a&&e.type===o?e:super.unify(e,t)}},t.IntegerVal=class extends a{constructor(e,t){if(!Number.isInteger(e))throw new Error("not-integer");super(e,o,t)}unify(e,t){return e instanceof s&&e.peg===Number||e instanceof a&&e.type===Number&&this.peg===e.peg?this:super.unify(e,t)}},t.StringVal=class extends a{constructor(e,t){super(e,String,t)}unify(e,t){return super.unify(e,t)}get canon(){return JSON.stringify(this.peg)}};class u extends a{constructor(e,t){super(e,Boolean,t)}unify(e,t){return super.unify(e,t)}}t.BooleanVal=u,u.TRUE=new u(!0,new r.Context({vc:1,root:n.TOP})),u.FALSE=new u(!1,new r.Context({vc:2,root:n.TOP}))})),_$unify_7=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Unify=t.Context=void 0;const n=_$type_6({}),r=_$lang_2({}),i=_$op_4({}),l=_$MapVal_12({});class o{constructor(e){this.root=e.root,this.path=[],this.err=e.err||[],this.vc=null==e.vc?1e9:e.vc}clone(e){return new o({root:e.root||this.root,err:e.err||this.err,vc:this.vc})}descend(e){return this.clone({root:this.root,path:this.path.concat(e)})}find(e){if(this.root instanceof l.MapVal&&e.absolute){let t=this.root,n=0;for(;n<e.parts.length&&t instanceof l.MapVal;n++){let r=e.parts[n];t=t.peg[r]}if(n===e.parts.length)return t}}}t.Context=o,t.Unify=class{constructor(e,t){this.lang=t||new r.Lang,"string"==typeof e&&(e=this.lang.parse(e)),this.root=e,this.res=e,this.err=[];let l=e,s=new o({root:l,err:this.err});for(this.dc=0;this.dc<999&&n.DONE!==l.done;this.dc++)l=(0,i.unite)(s,l,n.TOP),s=s.clone({root:l});this.res=l}}})),_$disjunct_3=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disjunct=void 0;const n=_$DisjunctVal_10({});_$ValBase_16({}),t.disjunct=(e,t,r)=>new n.DisjunctVal([],e,[])})),_$DisjunctVal_10=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DisjunctVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$ValBase_16({}),l=_$Nil_13({}),o=_$PrefVal_14({});class s extends i.ValBase{constructor(e,t,n){super(e,t)}append(e){return this.peg.push(e),this}unify(e,t){let i,o=!0,a=[];for(let l=0;l<this.peg.length;l++)a[l]=(0,r.unite)(t,this.peg[l],e),o=o&&n.DONE===a[l].done;if(1<a.length){for(let t=0;t<a.length;t++)a[t]instanceof s&&a.splice(t,1,...a[t].peg);let e=new l.Nil;for(let t=0;t<a.length;t++)for(let n=t+1;n<a.length;n++)a[n].same(a[t])&&(a[n]=e);a=a.filter(e=>!(e instanceof l.Nil))}if(1==a.length)i=a[0];else{if(0==a.length)return l.Nil.make(t,"|:empty",this);i=new s(a,t)}return i.done=o?n.DONE:this.done+1,i}get canon(){return this.peg.map(e=>e.canon).join("|")}gen(e){if(0<this.peg.length){let t=this.peg.filter(e=>e instanceof o.PrefVal);t=0===t.length?this.peg:t;let n=t[0];for(let r=1;r<this.peg.length;r++)n=n.unify(this.peg[r],e);return n.gen(e)}}}t.DisjunctVal=s})),_$PrefVal_14=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrefVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$Nil_13({}),l=_$ValBase_16({});class o extends l.ValBase{constructor(e,t,n){super(e,n),this.pref=t||e}unify(e,t){let l,s=!0;return l=e instanceof o?new o((0,r.unite)(t,this.peg,e.peg,"Pref000"),(0,r.unite)(t,this.pref,e.pref,"Pref010"),t):new o((0,r.unite)(null==t?void 0:t.clone({err:[]}),this.peg,e,"Pref020"),(0,r.unite)(null==t?void 0:t.clone({err:[]}),this.pref,e,"Pref030"),t),s=s&&n.DONE===l.peg.done&&(null==l.pref||n.DONE===l.pref.done),l.peg instanceof i.Nil?l=l.pref:l.pref instanceof i.Nil&&(l=l.peg),l.done=s?n.DONE:this.done+1,l}same(e){if(null==e)return!1;let t=this.peg===e.peg||this.peg instanceof l.ValBase&&this.peg.same(e.peg),n=e instanceof o&&(this.pref===e.pref||this.pref instanceof l.ValBase&&this.pref.same(e.pref));return t&&n}get canon(){return this.pref instanceof i.Nil?this.peg.canon:"*"+this.pref.canon}gen(e){let t=this.pref instanceof i.Nil?this.peg instanceof i.Nil?void 0:this.peg:this.pref;return void 0===t?void 0:t.gen(e)}}t.PrefVal=o})),_$Nil_13=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Nil=void 0;const n=_$type_6({}),r=_$ValBase_16({});class i extends r.ValBase{constructor(e,t){super(null,t),this.nil=!0,this.why=e,this.done=n.DONE}unify(e,t){return this}get canon(){return"nil"}gen(e){}}t.Nil=i,i.make=(e,t,n,r)=>{let l=new i(t,e);return null!=n&&(l.row=n.row,l.col=n.col,l.url=n.url,l.primary=n,null!=r)&&(l.secondary=r,l.url===r.url&&(l.row<r.row||l.row===r.row&&l.col<r.col)&&(l.row=r.row,l.col=r.col,l.url=r.url,l.primary=r,l.secondary=n)),e&&e.err.push(l),l}})),_$ValBase_16=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValBase=void 0;const n=_$lang_2({});t.ValBase=class{constructor(e,t){this.isVal=!0,this.done=0,this.row=-1,this.col=-1,this.url="",this.peg=e,this.path=t&&t.path||[],this.id=t&&t.vc++||9e9+Math.floor(1e9*Math.random())}same(e){return null!=e&&this.id===e.id}get site(){return new n.Site(this)}}})),_$type_6=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TOP=t.DONE=void 0;const n=_$lang_2({});t.DONE=-1;const r={isVal:!0,id:0,top:!0,peg:void 0,done:-1,path:[],row:-1,col:-1,url:"",unify:(e,t)=>e,get canon(){return"top"},get site(){return new n.Site(this)},same:e=>r===e,gen:e=>{}};t.TOP=r})),_$multisource_20=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TOP=t.NONE=t.resolvePathSpec=t.MultiSource=void 0;const n=_$jsonic_22({});t.NONE="";const r=Symbol("TOP");t.TOP=r;const i=(e,t)=>{const n=t.markchar,r=t.resolver,i=t.processor,{deep:l}=e.util,o=t.implictExt||[];for(let a=0;a<o.length;a++){let e=o[a];o[a]=e.startsWith(".")?e:"."+e}e.options({error:{multisource_not_found:"source not found: $path"},hint:{multisource_not_found:"The source path $path was not found."}});let s={name:"multisource",open:n,rules:{open:"val,pair"},action:function(n,o){var s;let a=n.parent.name,u=n.child.node,c=r(u,t,n,o,e);if(!c.found)return null===(s=n.parent)||void 0===s?void 0:s.o0.bad("multisource_not_found",{...c});c.kind=null==c.kind?"":c.kind,(i[c.kind]||i[""])(c,t,n,o,e),"pair"===a?o.cfg.map.merge?n.parent.parent.node=o.cfg.map.merge(n.parent.parent.node,c.val,n,o):o.cfg.map.extend?n.parent.parent.node=l(n.parent.parent.node,c.val):Object.assign(n.parent.node,c.val):n.node=c.val},custom:(e,{OPEN:t,name:n})=>{e.rule("val",e=>{e.open({s:[t],c:e=>0===e.d,p:"map",b:1,n:{[n+"_top"]:1}})}),e.rule("map",e=>{e.open({s:[t],c:e=>1===e.d&&1===e.n[n+"_top"],p:"pair",b:1})})}};e.use(_$directiveMin_17.Directive,s)};function l(e){return t=>t.val=e(t.src,t)}t.MultiSource=i;const o=l(e=>e),s=l(e=>null==e?void 0:JSON.parse(e)),a=(0,n.makeJsonicProcessor)(),u=(0,_$js_21.makeJavaScriptProcessor)();i.defaults={markchar:"@",processor:{"":o,jsonic:a,jsc:a,json:s,js:u},implictExt:["jsonic","jsc","json","js"]},t.resolvePathSpec=function(e,t,n,r){var i;let l=null===(i=t.meta)||void 0===i?void 0:i.multisource,o=r(null==l||null==l.path?e.path:l.path),s="string"==typeof n?n:null!=n.path?""+n.path:void 0,a=!(!(null==s?void 0:s.startsWith("/"))&&!(null==s?void 0:s.startsWith("\\"))),u=a?s:null!=s&&""!=s?null!=o&&""!=o?o+"/"+s:s:void 0;return{kind:null==u?"":(u.match(/\.([^.]*)$/)||["",""])[1],path:s,full:u,base:o,abs:a,found:!1}}})),_$jsonic_22=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeJsonicProcessor=void 0;const n=_$multisource_20({});t.makeJsonicProcessor=function(){return function(e,t,r,i,l){var o;if(null!=e.src&&null!=e.full){let t=(null===(o=i.meta)||void 0===o?void 0:o.multisource)||{},r={...i.meta||{},multisource:{...t,path:e.full}};if(e.val=l(e.src,r),t.deps){let r=t.deps,i=t.path||n.TOP;if(null!=i){let t={tar:i,src:e.full,wen:Date.now()};r[i]=r[i]||{},r[i][e.full]=t}}}}}})),_$jsonicMin_19={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$jsonicMin_19.exports?_$jsonicMin_19.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).Jsonic=t()}((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.log_lex=t.log_stack=t.log_parse=t.log_node=t.log_rule=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 i=n({}),l=e=>null==e?[]:Object.keys(e);t.keys=l;const o=e=>null==e?[]:Object.values(e);t.values=o;const s=e=>null==e?[]:Object.entries(e);t.entries=s;const a=(e,...t)=>Object.assign(null==e?{}:e,...t);t.assign=a,t.isarr=e=>Array.isArray(e);const u=Object.defineProperty;t.defprop=u;const c=(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 i=2;for(;void 0!==r[i];)e[r[i]]=r[i+1],i+=2;return e},{});t.omap=c;const p={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=p;class d extends SyntaxError{constructor(e,t,n,r,i){let l=k(e,t=g({},t),n,r,i);super(l.message),a(this,l),x(this)}toJSON(){return{...this,__error:!0,name:this.name,message:this.message,stack:this.stack}}}function f(e,t,n){let i=t.t,l=i[e];return null==l&&r.STRING===typeof e&&(l=t.tI++,i[l]=e,i[e]=l,i[e.substring(1)]=l,null!=n&&a(n.token,t.t)),l}function h(e,...t){return new RegExp(t.map(e=>e.esc?m(e.toString()):e).join(r.EMPTY),null==e?"":e)}function m(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=p.function===typeof e,r=null!=e&&(p.object===typeof e||n);for(let i of t){let t,l=p.function===typeof i,o=null!=i&&(p.object===typeof i||l);if(r&&o&&!l&&Array.isArray(e)===Array.isArray(i))for(let n in i)e[n]=g(e[n],i[n]);else e=void 0===i?e:l?i:o?p.function===typeof(t=i.constructor)&&p.Object!==t.name&&p.Array!==t.name?i:g(Array.isArray(i)?[]:{},i):i,n=p.function===typeof e,r=null!=e&&(p.object===typeof e||n)}return e}function v(e,t,n,r,i,l){let o={code:t,details:n,token:r,rule:i,ctx:l};return null==e?"":e.replace(/\$([\w_]+)/g,(e,t)=>{let s=JSON.stringify(null!=o[t]?o[t]:null!=n[t]?n[t]:l.meta&&null!=l.meta[t]?l.meta[t]:null!=r[t]?r[t]:null!=i[t]?i[t]:null!=l.opts[t]?l.opts[t]:null!=l.cfg[t]?l.cfg[t]:null!=l[t]?l[t]:"$"+t);return null==s?"":s})}function x(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 i=0<n.sI?n.sI:0,l=0<n.rI?n.rI:1,o=0<n.cI?n.cI:1,s=null==n.src?r.EMPTY:n.src,a=e.substring(Math.max(0,i-333),i).split("\n"),u=e.substring(i,i+333).split("\n"),c=2+(r.EMPTY+(l+2)).length,p=l<3?1:l-2,d=e=>"\x1b[34m"+(r.EMPTY+p++).padStart(c," ")+" | \x1b[0m"+(null==e?r.EMPTY:e),f=a.length;return[2<f?d(a[f-3]):null,1<f?d(a[f-2]):null,d(a[f-1]+u[0])," ".repeat(c)+" "+" ".repeat(o-1)+"\x1b[31m"+"^".repeat(s.length||1)+" "+t+"\x1b[0m",d(u[1]),d(u[2])].filter(e=>null!=e).join("\n")}function k(e,t,n,r,i){try{let l=i.cfg,o=i.meta,s=v(l.error[e]||l.error.unknown,e,t,n,r,i);p.function===typeof l.hint&&(l.hint={...l.hint(),...l.hint});let a=["\x1b[31m[jsonic/"+e+"]:\x1b[0m "+s," \x1b[34m--\x3e\x1b[0m "+(o&&o.fileName||"<no-file>")+":"+n.rI+":"+n.cI,b(i.src(),s,n),"",v((l.hint[e]||l.hint.unknown||"").trim().split("\n").map(e=>" "+e).join("\n"),e,t,n,r,i),""," \x1b[2mhttps://jsonic.senecajs.org\x1b[0m"," \x1b[2m--internal: rule="+r.name+"~"+r.state+"; token="+f(n.tin,i.cfg)+(null==n.why?"":"~"+n.why)+"; plugins="+i.plgn().map(e=>e.name).join(",")+"--\x1b[0m\n"].join("\n"),u={internal:{token:n,ctx:i}};return u={...Object.create(u),message:a,code:e,details:t,meta:o,fileName:o?o.fileName:void 0,lineNumber:n.rI,columnNumber:n.cI},u}catch(l){return console.log(l),{}}}function _(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(/]$/,s(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 y(e,t=44){let n;try{n="object"==typeof e?JSON.stringify(e):""+e}catch(r){n=""+e}return j(t<n.length?n.substring(0,t-3)+"...":n,t)}function j(e,t=5){return void 0===e?"":(""+e).substring(0,t).replace(/[\r\n\t]/g,".")}function O(...e){return null==e?{}:e.filter(e=>!1!==e).map(e=>"object"==typeof e?l(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}function S(e,t){return"["+(e.s||[]).map(e=>"number"==typeof e?f(e,t):Array.isArray(e)?"["+e.map(e=>f(e,t))+"]":"").join(" ")+"] "}function N(e,t,n){return e.F(e.src().substring(n.pnt.sI,n.pnt.sI+16)).padEnd(18," ")+" "+function(e){return"["+(e.NOTOKEN===e.t0?"":e.F(e.t0.src))+(e.NOTOKEN===e.t1?"":" "+e.F(e.t1.src))+"]~["+(e.NOTOKEN===e.t0?"":f(e.t0.tin,e.cfg))+(e.NOTOKEN===e.t1?"":" "+f(e.t1.tin,e.cfg))+"]"}(e).padEnd(34," ")+" "+(""+t.d).padStart(4," ")}function M(e,t){let n=s(t.n),r=s(t.use),i=s(t.keep);return(0===n.length?"":" N<"+n.filter(e=>e[1]).map(e=>e[0]+"="+e[1]).join(";")+">")+(0===r.length?"":" U<"+r.map(t=>t[0]+"="+e.F(t[1])).join(";")+">")+(0===i.length?"":" K<"+i.map(t=>t[0]+"="+e.F(t[1])).join(";")+">")}t.JsonicError=d,t.configure=function(e,t,n){var r,i,u,p,d,g,v,x,b,k,_,y,j,S,N,M,T,P,I,w,C,$,R,A,V,L,F,D,Y,B,U,J,K,q,z,G,Z,W,X,H,Q;const ee=t||{};ee.t=ee.t||{},ee.tI=ee.tI||1;const te=e=>f(e,ee);!1!==n.standard$&&(te("#BD"),te("#ZZ"),te("#UK"),te("#AA"),te("#SP"),te("#LN"),te("#CM"),te("#NR"),te("#ST"),te("#TX"),te("#VL")),ee.fixed={lex:!!(null===(r=n.fixed)||void 0===r?void 0:r.lex),token:n.fixed?c(E(n.fixed.token),([e,t])=>[t,f(e,ee)]):{},ref:void 0},ee.fixed.ref=c(ee.fixed.token,([e,t])=>[e,t]),ee.fixed.ref=Object.assign(ee.fixed.ref,c(ee.fixed.ref,([e,t])=>[t,e])),ee.match={lex:!!(null===(i=n.match)||void 0===i?void 0:i.lex),token:n.match?c(E(n.match.token),([e,t])=>[f(e,ee),t]):{}},c(ee.match.token,([e,t])=>[e,(t.tin$=+e,t)]);const ne=n.tokenSet?Object.keys(n.tokenSet).reduce((e,t)=>(e[t]=n.tokenSet[t].filter(e=>null!=e).map(e=>te(e)),e),{}):{};ee.tokenSet=ee.tokenSet||{},s(ne).map(e=>{let t=e[0],n=e[1];ee.tokenSet[t]?(ee.tokenSet[t].length=0,ee.tokenSet[t].push(...n)):ee.tokenSet[t]=n}),ee.tokenSetTins=s(ee.tokenSet).reduce((e,t)=>(e[t[0]]=e[t[0]]||{},t[1].map(n=>e[t[0]][n]=!0),e),{}),ee.tokenSetTins.IGNORE=ee.tokenSetTins.IGNORE||{},ee.space={lex:!!(null===(u=n.space)||void 0===u?void 0:u.lex),chars:O(null===(p=n.space)||void 0===p?void 0:p.chars)},ee.line={lex:!!(null===(d=n.line)||void 0===d?void 0:d.lex),chars:O(null===(g=n.line)||void 0===g?void 0:g.chars),rowChars:O(null===(v=n.line)||void 0===v?void 0:v.rowChars),single:!!(null===(x=n.line)||void 0===x?void 0:x.single)},ee.text={lex:!!(null===(b=n.text)||void 0===b?void 0:b.lex),modify:((null===(k=ee.text)||void 0===k?void 0:k.modify)||[]).concat(([null===(_=n.text)||void 0===_?void 0:_.modify]||[]).flat()).filter(e=>null!=e)},ee.number={lex:!!(null===(y=n.number)||void 0===y?void 0:y.lex),hex:!!(null===(j=n.number)||void 0===j?void 0:j.hex),oct:!!(null===(S=n.number)||void 0===S?void 0:S.oct),bin:!!(null===(N=n.number)||void 0===N?void 0:N.bin),sep:null!=(null===(M=n.number)||void 0===M?void 0:M.sep)&&""!==n.number.sep,exclude:null===(T=n.number)||void 0===T?void 0:T.exclude,sepChar:null===(P=n.number)||void 0===P?void 0:P.sep},ee.value={lex:!!(null===(I=n.value)||void 0===I?void 0:I.lex),map:s((null===(w=n.value)||void 0===w?void 0:w.map)||{}).reduce((e,t)=>(null==t[1]||(e[t[0]]=t[1]),e),{})},ee.rule={start:null==(null===(C=n.rule)||void 0===C?void 0:C.start)?"val":n.rule.start,maxmul:null==(null===($=n.rule)||void 0===$?void 0:$.maxmul)?3:n.rule.maxmul,finish:!!(null===(R=n.rule)||void 0===R?void 0:R.finish),include:(null===(A=n.rule)||void 0===A?void 0:A.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):[]},ee.map={extend:!!(null===(L=n.map)||void 0===L?void 0:L.extend),merge:null===(F=n.map)||void 0===F?void 0:F.merge},ee.list={property:!!(null===(D=n.list)||void 0===D?void 0:D.property)};let re=Object.keys(ee.fixed.token).sort((e,t)=>t.length-e.length).map(e=>m(e)).join("|"),ie=(null===(Y=n.comment)||void 0===Y?void 0:Y.lex)?(n.comment.def?o(n.comment.def):[]).filter(e=>e&&e.lex).map(e=>m(e.start)).join("|"):"",le=["([",m(l(O(ee.space.lex&&ee.space.chars,ee.line.lex&&ee.line.chars)).join("")),"]",("string"==typeof n.ender?n.ender.split(""):Array.isArray(n.ender)?n.ender:[]).map(e=>"|"+m(e)).join(""),""===re?"":"|",re,""===ie?"":"|",ie,"|$)"];return ee.rePart={fixed:re,ender:le,commentStart:ie},ee.re={ender:h(null,...le),rowChars:h(null,m(null===(B=n.line)||void 0===B?void 0:B.rowChars)),columns:h(null,"["+m(null===(U=n.line)||void 0===U?void 0:U.chars)+"]","(.*)$")},ee.lex={empty:!!(null===(J=n.lex)||void 0===J?void 0:J.empty),emptyResult:null===(K=n.lex)||void 0===K?void 0:K.emptyResult,match:(null===(q=n.lex)||void 0===q?void 0:q.match)?n.lex.match.map(e=>{let t=e(ee,n);return t&&(t.maker=e),t}).filter(e=>null!=e&&!1!==e):[]},ee.debug={get_console:(null===(z=n.debug)||void 0===z?void 0:z.get_console)||(()=>console),maxlen:null==(null===(G=n.debug)||void 0===G?void 0:G.maxlen)?99:n.debug.maxlen,print:{config:!!(null===(W=null===(Z=n.debug)||void 0===Z?void 0:Z.print)||void 0===W?void 0:W.config),src:null===(H=null===(X=n.debug)||void 0===X?void 0:X.print)||void 0===H?void 0:H.src}},ee.error=n.error||{},ee.hint=n.hint||{},(null===(Q=n.config)||void 0===Q?void 0:Q.modify)&&l(n.config.modify).forEach(e=>n.config.modify[e](ee,n)),ee.debug.print.config&&ee.debug.get_console().dir(ee,{depth:null}),ee.result={fail:[]},n.result&&(ee.result.fail=[...n.result.fail]),a(e.options,n),a(e.token,ee.t),a(e.tokenSet,ee.tokenSet),a(e.fixed,ee.fixed.ref),ee},t.tokenize=f,t.findTokenSet=function(e,t){return t.tokenSet[e]},t.mesc=function(e,t){return(t=new String(e)).esc=!0,t},t.regexp=h,t.escre=m,t.deep=g,t.errinject=v,t.trimstk=x,t.extract=b,t.errdesc=k,t.badlex=function(e,t,n){let r=e.next.bind(e);return e.next=(e,i,l,o)=>{let s=r(e,i,l,o);if(t===s.tin){let t={};throw null!=s.use&&(t.use=s.use),new d(s.why||p.unexpected,t,s,e,n)}return s},e},t.makelog=function(e,t){var n,r,i;let l=null===(i=null===(r=null===(n=e.opts)||void 0===n?void 0:n.plugin)||void 0===r?void 0:r.debug)||void 0===i?void 0:i.trace;if(t||l)if("number"==typeof(null==t?void 0:t.log)||l){let n=!1,r=null==t?void 0:t.log;(-1===r||l)&&(r=1,n=!0),e.log=(...t)=>{if(n){let n=t.filter(e=>p.object!=typeof e).map(e=>p.function==typeof e?e.name:e).join(p.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=_,t.str=y,t.snip=j,t.clone=function(e){return g(Object.create(Object.getPrototypeOf(e)),e)},t.charset=O,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,i=t.split(".");for(let t=0;t<i.length;t++)r=i[t],t<i.length-1&&(e=e[r]=e[r]||{});return void 0!==n&&(e[r]=n),e[r]}catch(i){throw new Error("Cannot "+(void 0===n?"get":"set")+" path "+t+" on object: "+y(r)+(void 0===n?"":" to value: "+y(n,22)))}},t.modlist=function(e,t){if(t&&e&&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,i=(e.length+t.move[r+1])%e.length,l=e[n];e.splice(n,1),e.splice(i,0,l)}let n=e.filter(e=>null!=e);n.length!==e.length&&(e.length=0,e.push(...n))}return e},t.parserwrap=function(e){return{start:function(t,n,l,o){try{return e.start(t,n,l,o)}catch(s){if("SyntaxError"===s.name){let o=0,a=0,u=0,c=r.EMPTY,p=s.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);if(p){c=p[1],o=parseInt(p[2]),a=t.substring(0,o).replace(/[^\n]/g,r.EMPTY).length;let e=o-1;for(;-1<e&&"\n"!==t.charAt(e);)e--;u=Math.max(t.substring(e,o).length,0)}let h=s.token||(0,i.makeToken)("#UK",f("#UK",n.internal().config),void 0,c,(0,i.makePoint)(c.length,o,s.lineNumber||a,s.columnNumber||u));throw new d(s.code||"json",s.details||{msg:s.message},h,{},s.ctx||{uI:-1,opts:n.options,cfg:n.internal().config,token:h,meta:l,src:()=>t,root:()=>{},plgn:()=>n.internal().plugins,rule:{name:"no-rule"},sub:{},xs:-1,v2:h,v1:h,t0:h,t1:h,tC:-1,kI:-1,rs:[],rsI:0,rsm:{},n:{},log:l?l.log:void 0,F:_(n.internal().config),use:{},NORULE:{name:"no-rule"},NOTOKEN:{name:"no-token"}})}throw s}}}};const T={o:p.open.toUpperCase(),c:p.close.toUpperCase()};t.log_rule=function(e,t,n){e.log(t,e,n,p.logindent+p.rule+p.space,N(e,t,n),p.indent.repeat(t.d)+(t.name+"~"+t.i+p.colon+T[t.state]).padEnd(16),("prev="+t.prev.i+" parent="+t.parent.i+" child="+t.child.i).padEnd(28),M(e,t))},t.log_node=function(e,t,n,r){e.log(t,e,n,r,p.logindent+p.node+p.space,N(e,t,n),p.indent.repeat(t.d)+("why="+r.why+p.space+"<"+e.F(t.node)+">").padEnd(46),M(e,t))},t.log_parse=function(e,t,n,i,l,o,a,u){let c=i&&u.n?s(u.n):null,d=i&&u.u?s(u.u):null,f=i&&u.k?s(u.k):null;e.log&&e.log(e,t,n,p.logindent+p.parse,N(e,t,n),p.indent.repeat(t.d)+(i?"alt="+o:"no-alt"),i&&a?S(a,e.cfg):"",i&&u.g?"g:"+u.g+" ":"",(i&&u.p?"p:"+u.p+" ":"")+(i&&u.r?"r:"+u.r+" ":"")+(i&&u.b?"b:"+u.b+" ":""),a&&a.c?"c:"+l:r.EMPTY,null==c?"":"n:"+c.map(e=>e[0]+"="+e[1]).join(";"),null==d?"":"u:"+d.map(e=>e[0]+"="+e[1]).join(";"),null==f?"":"k:"+f.map(e=>e[0]+"="+e[1]).join(";"))},t.log_stack=function(e,t,n){e.log(p.logindent+p.stack,N(e,t,n),p.indent.repeat(t.d)+"/"+e.rs.slice(0,t.d).map(e=>e.name+"~"+e.i).join("/"),"~","/"+e.rs.slice(0,t.d).map(t=>e.F(t.node)).join("/"),e,t,n)},t.log_lex=function(e,t,n,r,i,l,o,s,a,u){e.log(p.logindent+p.lex+p.space+p.space,N(e,t,n),p.indent.repeat(t.d)+f(o.tin,e.cfg),e.F(o.src),r.sI,r.rI+":"+r.cI,(null==l?void 0:l.name)||"",s?"on:alt="+a+";"+s.g+";t="+u+";"+S(s,e.cfg):"",e.F(n.src.substring(i,i+16)),e,t,n)}})),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 i=t({});class l{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 o=(...e)=>new l(...e);n.makePoint=o;class s{constructor(e,t,n,i,l,o,s){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=i,this.val=n,this.sI=l.sI,this.rI=l.rI,this.cI=l.cI,this.use=o,this.why=s,this.len=null==i?0:i.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,i.deep)(this.use||{},t)),this}toString(){return"Token["+this.name+"="+this.tin+" "+(0,i.snip)(this.src)+(void 0===this.val||"#ST"===this.name||"#TX"===this.name?"":"="+(0,i.snip)(this.val))+" "+[this.sI,this.rI,this.cI]+(null==this.use?"":" "+(0,i.snip)(""+JSON.stringify(this.use).replace(/"/g,""),22))+(null==this.err?"":" "+this.err)+(null==this.why?"":" "+(0,i.snip)(""+this.why,22))+"]"}[r.INSPECT](){return this.toString()}}const a=(...e)=>new s(...e);function u(e,t,n){let r=e.pnt,i=t;if(e.cfg.fixed.lex&&null!=n&&0<n.length){let l,o=e.cfg.fixed.token[n];null!=o&&(l=e.token(o,void 0,n,r)),null!=l&&(r.sI+=l.src.length,r.cI+=l.src.length,null==t?i=l:r.token.push(l))}return i}n.makeToken=a,n.makeNoToken=()=>a("",-1,void 0,r.EMPTY,o(-1)),n.makeFixedMatcher=(e,t)=>{let n=(0,i.regexp)(null,"^(",e.rePart.fixed,")");return function(t){let r=e.fixed;if(!r.lex)return;let i=t.pnt,l=t.src.substring(i.sI).match(n);if(l){let e=l[1],n=e.length;if(0<n){let l,o=r.token[e];return null!=o&&(l=t.token(o,void 0,e,i),i.sI+=n,i.cI+=n),l}}}},n.makeMatchMatcher=(e,t)=>{let n=(0,i.values)(e.match.token);return 0===n.length?null:function(t,r,i=0){if(!e.match.lex)return;let l=t.pnt,o=t.src.substring(l.sI),s="o"===r.state?0:1;for(let e of n)if(!e.tin$||r.spec.def.tcol[s][i].includes(e.tin$))if(e instanceof RegExp){let n=o.match(e);if(n){let r=n[0],i=r.length;if(0<i){let n,o=e.tin$;return n=t.token(o,r,r,l),l.sI+=i,l.cI+=i,n}}}else{let n=e(t,r);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,i.entries)(n.def):[]).reduce((t,[n,r])=>{if(null==r||!1===r)return t;let l={name:n,start:r.start,end:r.end,line:!!r.line,lex:!!r.lex,suffixMatch:void 0,getSuffixMatch:void 0};return l.getSuffixMatch=r.suffix?()=>{if(r.suffix instanceof Function)return l.suffixMatch=r.suffix;let t=(Array.isArray(r.suffix)?r.suffix:[r.suffix]).map(t=>e.lex.match.find(e=>{var n;return(null===(n=e.maker)||void 0===n?void 0:n.name)==t})).filter(e=>null!=e),n=(...e)=>{t.map(t=>t(...e))};return(0,i.defprop)(n,"name",{value:""+r.suffix}),n}:void 0,t[n]=l,t},{})};let r=e.comment.lex?(0,i.values)(e.comment.def).filter(e=>e.lex&&e.line):[],l=e.comment.lex?(0,i.values)(e.comment.def).filter(e=>e.lex&&!e.line):[];return function(t,n){if(!e.comment.lex)return;let o=t.pnt,s=t.src.substring(o.sI),a=o.rI,u=o.cI;for(let i of r)if(s.startsWith(i.start)){let r=s.length,l=i.start.length;for(u+=i.start.length;l<r&&!e.line.chars[s[l]];)u++,l++;let a=s.substring(0,l),c=t.token("#CM",void 0,a,o);return o.sI+=a.length,o.cI=u,i.suffixMatch?i.suffixMatch(t,n):i.getSuffixMatch&&(i.suffixMatch=i.getSuffixMatch(),i.suffixMatch&&i.suffixMatch(t,n)),c}for(let r of l)if(s.startsWith(r.start)){let n=s.length,l=r.start.length,c=r.end;for(u+=r.start.length;l<n&&!s.substring(l).startsWith(c);)e.line.rowChars[s[l]]&&(a++,u=0),u++,l++;if(s.substring(l).startsWith(c)){u+=c.length;let e=s.substring(0,l+c.length),n=t.token("#CM",void 0,e,o);return o.sI+=e.length,o.rI=a,o.cI=u,n}return t.bad(i.S.unterminated_comment,o.sI,o.sI+9*r.start.length)}}},n.makeTextMatcher=(e,t)=>{let n=(0,i.regexp)(e.line.lex?null:"s","^(.*?)",...e.rePart.ender);return function(r){let i=e.text,l=r.pnt,o=r.src.substring(l.sI),s=e.value.map,a=o.match(n);if(a){let n,o=a[1],c=a[2];if(null!=o){let t=o.length;if(0<t){let a;e.value.lex&&void 0!==(a=s[o])?(n=r.token("#VL",a.val,o,l),l.sI+=t,l.cI+=t):i.lex&&(n=r.token("#TX",o,o,l),l.sI+=t,l.cI+=t)}}if(n&&(n=u(r,n,c)),n&&0<e.text.modify.length){const i=e.text.modify;for(let l=0;l<i.length;l++)n.val=i[l](n.val,r,e,t)}return n}}},n.makeNumberMatcher=(e,t)=>{let n=e.number,r=(0,i.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,i.escre)(n.sepChar):""),")",...e.rePart.ender),l=n.sep?(0,i.regexp)("g",(0,i.escre)(n.sepChar)):void 0;return function(t){if(n=e.number,!n.lex)return;let i=t.pnt,o=t.src.substring(i.sI),s=e.value.map,a=o.match(r);if(a){let n,r=a[1],o=a[9],c=!0;if(null!=r&&(c=!e.number.exclude||!r.match(e.number.exclude))){let o=r.length;if(0<o){let a;if(e.value.lex&&void 0!==(a=s[r]))n=t.token("#VL",a.val,r,i);else{let e=l?r.replace(l,""):r,s=+e;if(isNaN(s)){let t=e[0];"-"!==t&&"+"!==t||(s=("-"===t?-1:1)*+e.substring(1))}isNaN(s)||(n=t.token("#NR",s,r,i),i.sI+=o,i.cI+=o)}}}return c&&(n=u(t,n,o)),n}}},n.makeStringMatcher=(e,t)=>{let n=t.string||{};return e.string=e.string||{},e.string=(0,i.deep)(e.string,{lex:!!(null==n?void 0:n.lex),quoteMap:(0,i.charset)(n.chars),multiChars:(0,i.charset)(n.multiChars),escMap:(0,i.clean)({...n.escape}),escChar:n.escapeChar,escCharCode:null==n.escapeChar?void 0:n.escapeChar.charCodeAt(0),allowUnknown:!!n.allowUnknown,replaceCodeMap:(0,i.omap)((0,i.clean)({...n.replace}),([e,t])=>[e.charCodeAt(0),t]),hasReplace:!1}),e.string.hasReplace=0<(0,i.keys)(e.string.replaceCodeMap).length,function(t){let n=e.string;if(!n.lex)return;let{quoteMap:l,escMap:o,escChar:s,escCharCode:a,multiChars:u,allowUnknown:c,replaceCodeMap:p,hasReplace:d}=n,{pnt:f,src:h}=t,{sI:m,rI:g,cI:v}=f,x=h.length;if(l[h[m]]){const n=h[m],l=m,b=g,k=u[n];++m,++v;let _,y=[];for(;m<x;m++){v++;let r=h[m];if(_=void 0,n===r){m++;break}if(s===r){m++,v++;let e=o[h[m]];if(null!=e)y.push(e);else if("x"===h[m]){m++;let e=parseInt(h.substring(m,m+2),16);if(isNaN(e))return m-=2,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_ascii,m,m+4);let n=String.fromCharCode(e);y.push(n),m+=1,v+=2}else if("u"===h[m]){m++;let e="{"===h[m]?(m++,1):0,n=e?6:4,r=parseInt(h.substring(m,m+n),16);if(isNaN(r))return m=m-2-e,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_unicode,m,m+n+2+2*e);let l=String.fromCodePoint(r);y.push(l),m+=n-1+e,v+=n+e}else{if(!c)return f.sI=m,f.cI=v-1,t.bad(i.S.unexpected,m,m+1);y.push(h[m])}}else if(d&&void 0!==(_=p[h.charCodeAt(m)]))y.push(_),v++;else{let r=m,l=n.charCodeAt(0),o=h.charCodeAt(m);for(;(!d||void 0===(_=p[o]))&&m<x&&32<=o&&l!==o&&a!==o;)o=h.charCodeAt(++m),v++;if(v--,void 0===_&&o<32){if(!k||!e.line.chars[h[m]])return f.sI=m,f.cI=v,t.bad(i.S.unprintable,m,m+1);e.line.rowChars[h[m]]&&(f.rI=++g),v=1,y.push(h.substring(r,m+1))}else y.push(h.substring(r,m)),m--}}if(h[m-1]!==n||f.sI===m-1)return f.rI=b,t.bad(i.S.unterminated_string,l,m);const j=t.token("#ST",y.join(r.EMPTY),h.substring(f.sI,m),f);return f.sI=m,f.rI=g,f.cI=v,j}}},n.makeLineMatcher=(e,t)=>function(t){if(!e.line.lex)return;let n,{chars:r,rowChars:i}=e.line,{pnt:l,src:o}=t,{sI:s,rI:a}=l,u=e.line.single;for(u&&(n={});r[o[s]]&&!(n&&(n[o[s]]=(n[o[s]]||0)+1,u&&1<n[o[s]]));)a+=i[o[s]]?1:0,s++;if(l.sI<s){let e=o.substring(l.sI,s);const n=t.token("#LN",void 0,e,l);return l.sI+=e.length,l.rI=a,l.cI=1,n}},n.makeSpaceMatcher=(e,t)=>function(t){if(!e.space.lex)return;let{chars:n}=e.space,{pnt:r,src:i}=t,{sI:l,cI:o}=r;for(;n[i[l]];)l++,o++;if(r.sI<l){let e=i.substring(r.sI,l);const n=t.token("#SP",void 0,e,r);return r.sI+=e.length,r.cI=o,n}};class c{constructor(e){this.src=r.EMPTY,this.ctx={},this.cfg={},this.pnt=o(-1),this.ctx=e,this.src=e.src(),this.cfg=e.cfg,this.pnt=o(this.src.length)}token(e,t,n,r,l,o){let s,u;return"string"==typeof e?(u=e,s=(0,i.tokenize)(u,this.cfg)):(s=e,u=(0,i.tokenize)(e,this.cfg)),a(u,s,t,n,r||this.pnt,l,o)}next(e,t,n,r){let l,o,s=this.pnt,a=s.sI;if(s.end)l=s.end;else if(0<s.token.length)l=s.token.shift();else if(s.len<=s.sI)s.end=this.token("#ZZ",void 0,"",s),l=s.end;else{for(let t of this.cfg.lex.match)if(l=t(this,e,r)){o=t;break}l=l||this.token("#BD",void 0,this.src[s.sI],s,void 0,"unexpected")}return this.ctx.log&&(0,i.log_lex)(this.ctx,e,this,s,a,o,l,t,n,r),this.ctx.sub.lex&&this.ctx.sub.lex.map(t=>t(l,e,this.ctx)),l}tokenize(e){return(0,i.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 c(...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 i={};Object.defineProperty(i,"__esModule",{value:!0}),i.defaults=void 0;const l=n({}),o={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},slash:{line:!0,start:"//",lex:!0},multi:{line:!1,start:"/*",end:"*/",lex:!0}}},string:{lex:!0,chars:"'\"`",multiChars:"`",escapeChar:"\\",escape:{b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",'"':'"',"'":"'","`":"`","\\":"\\","/":"/"},allowUnknown:!0},map:{extend:!0,merge:void 0},list:{property:!0},value:{lex:!0,map:{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,i)=>(n[r]=e(t[i]),n),{})},lex:{match:[l.makeMatchMatcher,l.makeFixedMatcher,l.makeSpaceMatcher,l.makeLineMatcher,l.makeStringMatcher,l.makeCommentMatcher,l.makeNumberMatcher,l.makeTextMatcher],empty:!0,emptyResult:void 0},rule:{start:"val",finish:!0,maxmul:3,include:"",exclude:""},result:{fail:[]},config:{modify:{}},parser:{start:void 0}};i.defaults=o;var s={};Object.defineProperty(s,"__esModule",{value:!0}),s.makeRuleSpec=s.makeNoRule=s.makeRule=void 0;const a=t({});class u{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 c=(...e)=>new u(...e);s.makeRule=c,s.makeNoRule=e=>c(g(e.cfg,{}),e);class p{constructor(){this.p=r.EMPTY,this.r=r.EMPTY,this.b=0}}const d=(...e)=>new p(...e),f=d(),h=d();class m{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])v(n)}tin(e){return(0,a.tokenize)(e,this.cfg)}add(e,t,n){let r=(null==n?void 0:n.append)?"push":"unshift",i=((0,a.isarr)(t)?t:[t]).filter(e=>null!=e&&"object"==typeof e).map(e=>v(e)),l="o"===e?"open":"close",o=this.def[l];return o[r](...i),(0,a.modlist)(o,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 i=this.def[t+n];return e?i.push(r):i.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=>v(e)),this.def.close.map(e=>v(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,i){t.log&&(0,a.log_rule)(t,e,n);let l="o"===i,o=l?e:t.NORULE,s=l?"O":"C",u=this.def,p=l?u.open:u.close,d=l?e.bo?u.bo:null:e.bc?u.bc:null;if(d){let n;for(let r=0;r<d.length;r++)if(n=d[r].call(this,e,t,o,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}let m=0<p.length?function(e,t,n,i,l){let o=f;o.b=0,o.p=r.EMPTY,o.r=r.EMPTY,o.n=void 0,o.h=void 0,o.a=void 0,o.u=void 0,o.k=void 0,o.e=void 0;let s=null,u=0,c=!0,p=1<<l.cfg.t.AA-1,d=l.cfg.tokenSetTins.IGNORE;function h(e,t,r,i){let o;do{o=n.next(e,t,r,i),l.tC++}while(d[o.tin]);return o}let m=t.length;for(u=0;u<m;u++){s=t[u];let n=!1,r=!1;if(c=!0,s.S0){let e=(l.t0=l.NOTOKEN!==l.t0?l.t0:l.t0=h(i,s,u,0)).tin;if(n=!0,c=!!(s.S0[e/31|0]&(1<<e%31-1|p)),c&&(r=null!=s.S1,s.S1)){let e=(l.t1=l.NOTOKEN!==l.t1?l.t1:l.t1=h(i,s,u,1)).tin;r=!0,c=!!(s.S1[e/31|0]&(1<<e%31-1|p))}}if(e?(i.o0=n?l.t0:l.NOTOKEN,i.o1=r?l.t1:l.NOTOKEN,i.os=(n?1:0)+(r?1:0)):(i.c0=n?l.t0:l.NOTOKEN,i.c1=r?l.t1:l.NOTOKEN,i.cs=(n?1:0)+(r?1:0)),c&&s.c&&(c=c&&s.c(i,l,o)),c)break;s=null}c||(o.e=l.t0),s&&(o.n=null!=s.n?s.n:o.n,o.h=null!=s.h?s.h:o.h,o.a=null!=s.a?s.a:o.a,o.u=null!=s.u?s.u:o.u,o.k=null!=s.k?s.k:o.k,o.g=null!=s.g?s.g:o.g,o.e=s.e&&s.e(i,l,o)||void 0,o.p=null!=s.p&&!1!==s.p?"string"==typeof s.p?s.p:s.p(i,l,o):o.p,o.r=null!=s.r&&!1!==s.r?"string"==typeof s.r?s.r:s.r(i,l,o):o.r,o.b=null!=s.b&&!1!==s.b?"number"==typeof s.b?s.b:s.b(i,l,o):o.b);let g=u<t.length;return l.log&&(0,a.log_parse)(l,i,n,g,c,u,s,o),o}(l,p,n,e,t):h;if(m.h&&(m=m.h(e,t,m,o)||m,s+="H"),m.e)return this.bad(m.e,e,t,{is_open:l});if(m.n)for(let r in m.n)e.n[r]=0===m.n[r]?0:(null==e.n[r]?0:e.n[r])+m.n[r];if(m.u&&(e.use=Object.assign(e.use,m.u)),m.k&&(e.keep=Object.assign(e.keep,m.k)),m.a){s+="A";let n=m.a(e,t,m);if(n&&n.isToken&&n.err)return this.bad(n,e,t,{is_open:l})}if(m.p){t.rs[t.rsI++]=e;let n=t.rsm[m.p];if(!n)return this.bad(this.unknownRule(t.t0,m.p),e,t,{is_open:l});o=e.child=c(n,t,e.node),o.parent=e,o.n={...e.n},0<Object.keys(e.keep).length&&(o.keep={...e.keep}),s+="P`"+m.p+"`"}else if(m.r){let n=t.rsm[m.r];if(!n)return this.bad(this.unknownRule(t.t0,m.r),e,t,{is_open:l});o=c(n,t,e.node),o.parent=e.parent,o.prev=e,o.n={...e.n},0<Object.keys(e.keep).length&&(o.keep={...e.keep}),s+="R`"+m.r+"`"}else l||(o=t.rs[--t.rsI]||t.NORULE);let g=l?e.ao?u.ao:null:e.ac?u.ac:null;if(g){let n;for(let r=0;r<g.length;r++)if(n=g[r](e,t,o,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}o.why=s,t.log&&(0,a.log_node)(t,e,n,o),r.OPEN===e.state&&(e.state=r.CLOSE);let v=e[l?"os":"cs"]-(m.b||0);return 1===v?(t.v2=t.v1,t.v1=t.t0,t.t0=t.t1,t.t1=t.NOTOKEN):2==v&&(t.v2=t.t1,t.v1=t.t0,t.t0=t.NOTOKEN,t.t1=t.NOTOKEN),o}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 m(...e);function v(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*/)),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),i=t([e.s[0]]),l=t([e.s[1]]),o=e;o.S0=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,o.S1=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}else e.s=null;return e.p||(e.p=null),e.r||(e.r=null),e.b||(e.b=null),e}s.makeRuleSpec=g;var x={};Object.defineProperty(x,"__esModule",{value:!0}),x.makeParser=x.makeRuleSpec=x.makeRule=void 0;const b=t({}),k=n({});Object.defineProperty(x,"makeRule",{enumerable:!0,get:function(){return s.makeRule}}),Object.defineProperty(x,"makeRuleSpec",{enumerable:!0,get:function(){return s.makeRuleSpec}});class _{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,s.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,i){let l,o=(0,k.makeToken)("#ZZ",(0,b.tokenize)("#ZZ",this.cfg),void 0,r.EMPTY,(0,k.makePoint)(-1)),a=(0,k.makeNoToken)(),u={uI:0,opts:this.options,cfg:this.cfg,meta:n||{},src:()=>e,root:()=>l,plgn:()=>t.internal().plugins,rule:{},sub:t.internal().sub,xs:-1,v2:o,v1:o,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:{}};u=(0,b.deep)(u,i);let c=(0,s.makeNoRule)(u);if(u.NORULE=c,u.rule=c,(0,b.makelog)(u,n),""===e){if(this.cfg.lex.empty)return this.cfg.lex.emptyResult;throw new b.JsonicError(b.S.unexpected,{src:e},u.t0,c,u)}let p=(0,b.badlex)((0,k.makeLex)(u),(0,b.tokenize)("#BD",this.cfg),u),d=this.rsm[this.cfg.rule.start];if(null==d)return;let f=(0,s.makeRule)(d,u);l=f;let h=2*(0,b.keys)(this.rsm).length*p.src.length*2*u.cfg.rule.maxmul,m=0;for(;c!==f&&m<h;)u.kI=m,u.rule=f,u.log&&u.log(u.kI+":"),u.sub.rule&&u.sub.rule.map(e=>e(f,u)),f=f.process(u,p),u.log&&(0,b.log_stack)(u,f,p),m++;if(o.tin!==p.next(f).tin)throw new b.JsonicError(b.S.unexpected,{},u.t0,c,u);const g=u.root().node;if(this.cfg.result.fail.includes(g))throw new b.JsonicError(b.S.unexpected,{},u.t0,c,u);return g}clone(e,t){let n=new _(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())}}x.makeParser=(...e)=>new _(...e);var y={};function j(e){const{deep:t}=e.util,{OB:n,CB:r,OS:i,CS:l,CL:o,CA:s,TX:a,ST:u,ZZ:c}=e.token,{VAL:p,KEY:d}=e.tokenSet,f=(e,t)=>{if(!t.cfg.rule.finish)return t.t0.src="END_OF_SOURCE",t.t0},h=e=>{const t=e.o0,n=u===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:[i],p:"list",b:1,g:"list,json"},{s:[p],g:"val,json"}]).close([{s:[c],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={}}).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:[i,l],b:1,g:"list,json"},{s:[i],p:"elem",g:"list,elem,json"}]).close([{s:[l],g:"end,json"}])}),e.rule("pair",e=>{e.open([{s:[d,o],p:"val",u:{pair:!0},a:h,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:[s],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:[s],r:"elem",g:"list,elem,json"},{s:[l],b:1,g:"list,elem,json"}])});const m=(e,n)=>{let r=e.use.key,i=e.child.node;const l=e.use.prev;i=void 0===i?null:i,e.node[r]=null==l?i:n.cfg.map.merge?n.cfg.map.merge(l,i,e,n):n.cfg.map.extend?t(l,i):i};e.rule("val",e=>{e.open([{s:[d,o],p:"map",b:2,n:{pk:1},g:"pair,jsonic"},{s:[p],g:"val,json"},{s:[[r,l]],b:1,c:e=>0<e.d,g:"val,imp,null,jsonic"},{s:[s],c:e=>0===e.d,p:"list",b:1,g:"list,imp,jsonic"},{s:[s],b:1,g:"list,val,imp,null,jsonic"},{s:[c],g:"jsonic"}],{append:!0,delete:[2]}).close([{s:[[r,l]],b:1,g:"val,json,close",e:(e,t)=>0===e.d?t.t0:void 0},{s:[s],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:[c],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,c],b:1,e:f,g:"end,jsonic"}]).open([{s:[d,o],p:"pair",b:2,g:"pair,list,val,imp"}],{append:!0}).close([{s:[r],c:{n:{pk:0}},g:"end,json"},{s:[r],b:1,g:"path,jsonic"},{s:[[s,l,...p]],b:1,g:"end,path,jsonic"},{s:[c],e:f,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:[s],p:"elem",b:1,g:"list,elem,val,imp"},{p:"elem",g:"list,elem"}],{append:!0}).close([{s:[c],e:f,g:"end,jsonic"}],{append:!0})}),e.rule("pair",(e,t)=>{e.open([{s:[s],g:"map,pair,comma"}],{append:!0}).bc((e,t)=>{e.use.pair&&m(e,t)}).close([{s:[r],c:{n:{pk:0}},b:1,g:"map,pair,json"},{s:[s,r],c:{n:{pk:0}},b:1,g:"map,pair,comma,jsonic"},{s:[s,c],g:"end,jsonic"},{s:[s],c:{n:{pk:0}},r:"pair",g:"map,pair,json"},{s:[s],c:{n:{dmap:1}},r:"pair",g:"map,pair,jsonic"},{s:[d],c:{n:{dmap:1}},r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[[r,s,l,...d]],b:1,g:"map,pair,imp,path,jsonic",c:e=>0<e.n.pk},{s:[l],e:e=>e.c0,g:"end,jsonic"},{s:[c],e:f,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:[s,s],b:2,u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[s],u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[d,o],e:t.cfg.list.property?void 0:(e,t)=>t.t0,p:"val",n:{pk:1,dmap:1},u:{done:!0,pair:!0},a:h,g:"elem,pair,jsonic"}]).bc((e,t)=>{!0===e.use.pair&&(e.use.prev=e.node[e.use.key],m(e,t))}).close([{s:[s,[l,c]],b:1,g:"list,elem,comma,jsonic"},{s:[s],r:"elem",g:"list,elem,json"},{s:[l],b:1,g:"list,elem,json"},{s:[c],e:f,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(y,"__esModule",{value:!0}),y.makeJSON=y.grammar=void 0,y.grammar=j,y.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 j(t),t};var O={};Object.defineProperty(O,"__esModule",{value:!0}),O.Debug=void 0;const E=(e,t)=>{const{keys:n,values:r,entries:i}=e.util;e.debug={describe:function(){var t;let l=null===(t=e.options.lex)||void 0===t?void 0:t.match,o=e.rule();return["========= RULES =========",N(e,n(o),o),"\n","========= ALTS =========",r(o).map(t=>" "+t.name+":\n"+S(e,t,"open")+S(e,t,"close")).join("\n\n"),"\n","========= LEXER ========="," "+(l&&l.map(e=>e.name)||[]).join("\n "),"\n","\n","========= PLUGIN ========="," "+e.internal().plugins.map(e=>e.name+(e.options?i(e.options).reduce((e,t)=>e+"\n "+t[0]+": "+JSON.stringify(t[1]),""):"")).join("\n "),"\n"].join("\n")}};const l=e.use.bind(e);e.use=(...e)=>{let n=l(...e);return t.print&&n.internal().config.debug.get_console().log(n.debug.describe()),n},t.trace};function S(e,t,n){const{entries:r}=e.util;return 0===t.def[n].length?"":" "+n.toUpperCase()+":\n"+t.def[n].map((t,n)=>{var i,l;return" "+(""+n).padStart(5," ")+" "+("["+(t.s||[]).map(t=>"number"==typeof t?e.token[t]:"["+t.map(t=>e.token[t])+"]").join(" ")+"] ").padEnd(32," ")+(t.r?" r="+("string"==typeof t.r?t.r:"<F>"):"")+(t.p?" p="+("string"==typeof t.p?t.p:"<F>"):"")+(t.r||t.p?"":"\t")+"\t"+(null==t.b?"":"b="+t.b)+"\t"+(null==t.n?"":"n="+r(t.n).map(([e,t])=>e+":"+t))+"\t"+(null==t.a?"":"A")+(null==t.c?"":"C")+(null==t.h?"":"H")+"\t"+(null==(null===(i=t.c)||void 0===i?void 0:i.n)?"\t":" CN="+r(t.c.n).map(([e,t])=>e+":"+t))+(null==(null===(l=t.c)||void 0===l?void 0:l.d)?"":" CD="+t.c.d)+(t.g?"\tg="+t.g:"")}).join("\n")+"\n"}function N(e,t,n){const{values:r,omap:i}=e.util;return t.reduce((e,t)=>e+" "+t+":\n "+r(i({op:M(n,t,"open","p"),or:M(n,t,"open","r"),cp:M(n,t,"close","p"),cr:M(n,t,"close","r")},([e,t])=>[1<t.length?e:void 0,e+": "+t])).join("\n ")+"\n","")}function M(e,t,n,r){return[...new Set(e[t].def[n].filter(e=>e[r]).map(e=>e[r]).map(e=>"string"==typeof e?e:"<F>"))].join(" ")}O.Debug=E,E.defaults={print:!0,trace:!1};var T={exports:{}};Object.defineProperty(T.exports,"__esModule",{value:!0}),T.exports.EMPTY=T.exports.AFTER=T.exports.BEFORE=T.exports.CLOSE=T.exports.OPEN=T.exports.makeTextMatcher=T.exports.makeNumberMatcher=T.exports.makeCommentMatcher=T.exports.makeStringMatcher=T.exports.makeLineMatcher=T.exports.makeSpaceMatcher=T.exports.makeFixedMatcher=T.exports.makeParser=T.exports.makeLex=T.exports.makeRuleSpec=T.exports.makeRule=T.exports.makePoint=T.exports.makeToken=T.exports.make=T.exports.util=T.exports.Debug=T.exports.JsonicError=T.exports.Jsonic=void 0,Object.defineProperty(T.exports,"OPEN",{enumerable:!0,get:function(){return r.OPEN}}),Object.defineProperty(T.exports,"CLOSE",{enumerable:!0,get:function(){return r.CLOSE}}),Object.defineProperty(T.exports,"BEFORE",{enumerable:!0,get:function(){return r.BEFORE}}),Object.defineProperty(T.exports,"AFTER",{enumerable:!0,get:function(){return r.AFTER}}),Object.defineProperty(T.exports,"EMPTY",{enumerable:!0,get:function(){return r.EMPTY}});const P=t({});Object.defineProperty(T.exports,"JsonicError",{enumerable:!0,get:function(){return P.JsonicError}});const I=n({});Object.defineProperty(T.exports,"makePoint",{enumerable:!0,get:function(){return I.makePoint}}),Object.defineProperty(T.exports,"makeToken",{enumerable:!0,get:function(){return I.makeToken}}),Object.defineProperty(T.exports,"makeLex",{enumerable:!0,get:function(){return I.makeLex}}),Object.defineProperty(T.exports,"makeFixedMatcher",{enumerable:!0,get:function(){return I.makeFixedMatcher}}),Object.defineProperty(T.exports,"makeSpaceMatcher",{enumerable:!0,get:function(){return I.makeSpaceMatcher}}),Object.defineProperty(T.exports,"makeLineMatcher",{enumerable:!0,get:function(){return I.makeLineMatcher}}),Object.defineProperty(T.exports,"makeStringMatcher",{enumerable:!0,get:function(){return I.makeStringMatcher}}),Object.defineProperty(T.exports,"makeCommentMatcher",{enumerable:!0,get:function(){return I.makeCommentMatcher}}),Object.defineProperty(T.exports,"makeNumberMatcher",{enumerable:!0,get:function(){return I.makeNumberMatcher}}),Object.defineProperty(T.exports,"makeTextMatcher",{enumerable:!0,get:function(){return I.makeTextMatcher}}),Object.defineProperty(T.exports,"makeRule",{enumerable:!0,get:function(){return x.makeRule}}),Object.defineProperty(T.exports,"makeRuleSpec",{enumerable:!0,get:function(){return x.makeRuleSpec}}),Object.defineProperty(T.exports,"makeParser",{enumerable:!0,get:function(){return x.makeParser}}),Object.defineProperty(T.exports,"Debug",{enumerable:!0,get:function(){return O.Debug}});const w={tokenize:P.tokenize,srcfmt:P.srcfmt,clone:P.clone,charset:P.charset,trimstk:P.trimstk,makelog:P.makelog,badlex:P.badlex,extract:P.extract,errinject:P.errinject,errdesc:P.errdesc,configure:P.configure,parserwrap:P.parserwrap,mesc:P.mesc,escre:P.escre,regexp:P.regexp,prop:P.prop,str:P.str,clean:P.clean,deep:P.deep,omap:P.omap,keys:P.keys,values:P.values,entries:P.entries};function C(e,t){let n=!0;if("jsonic"===e)n=!1;else if("json"===e)return(0,y.makeJSON)($);e="string"==typeof e?{}:e;let r={parser:null,config:null,plugins:[],sub:{lex:void 0,rule:void 0},mark:Math.random()},l=(0,P.deep)({},t?{...t.options}:!1===(null==e?void 0:e.defaults$)?{}:i.defaults,e||{}),o=function(e,t,n){var r;if(P.S.string===typeof e){let i=o.internal();return((null===(r=s.parser)||void 0===r?void 0:r.start)?(0,P.parserwrap)(s.parser):i.parser).start(e,o,t,n)}return e},s=e=>{if(null!=e&&P.S.object===typeof e){(0,P.deep)(l,e),(0,P.configure)(o,r.config,l);let t=o.internal().parser;r.parser=t.clone(l,r.config)}return{...o.options}},a={token:e=>(0,P.tokenize)(e,r.config,o),tokenSet:e=>(0,P.findTokenSet)(e,r.config),fixed:e=>r.config.fixed.ref[e],options:(0,P.deep)(s,l),config:()=>(0,P.deep)(r.config),parse:o,use:function(e,t){const n=e.name.toLowerCase(),r=(0,P.deep)({},e.defaults||{},t||{});o.options({plugin:{[n]:r}});let i=o.options.plugin[n];return o.internal().plugins.push(e),e.options=i,e(o,i)||o},rule:(e,t)=>o.internal().parser.rule(e,t)||o,lex:e=>{let t=l.lex.match;t.unshift(e),o.options({lex:{match:t}})},make:e=>C(e,o),empty:e=>C({defaults$:!1,standard$:!1,grammar$:!1,...e||{}}),id:"Jsonic/"+Date.now()+"/"+(""+Math.random()).substring(2,8).padEnd(6,"0")+(null==s.tag?"":"/"+s.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)),o),util:w};if((0,P.defprop)(a.make,P.S.name,{value:P.S.make}),n?(0,P.assign)(o,a):(0,P.assign)(o,{empty:a.empty,parse:a.parse,sub:a.sub,id:a.id,toString:a.toString}),(0,P.defprop)(o,"internal",{value:()=>r}),t){for(let n in t)void 0===o[n]&&(o[n]=t[n]);o.parent=t;let e=t.internal();r.config=(0,P.deep)({},e.config),(0,P.configure)(o,r.config,l),(0,P.assign)(o.token,r.config.t),r.plugins=[...e.plugins],r.parser=e.parser.clone(l,r.config)}else{let e={...o,...a};r.config=(0,P.configure)(e,void 0,l),r.plugins=[],r.parser=(0,x.makeParser)(l,r.config),!1!==l.grammar$&&(0,y.grammar)(e)}return o}let $;T.exports.util=w,T.exports.make=C;let R=$=C("jsonic");return T.exports.Jsonic=R,$.Jsonic=$,$.JsonicError=P.JsonicError,$.Debug=O.Debug,$.makeLex=I.makeLex,$.makeParser=x.makeParser,$.makeToken=I.makeToken,$.makePoint=I.makePoint,$.makeRule=x.makeRule,$.makeRuleSpec=x.makeRuleSpec,$.makeFixedMatcher=I.makeFixedMatcher,$.makeSpaceMatcher=I.makeSpaceMatcher,$.makeLineMatcher=I.makeLineMatcher,$.makeStringMatcher=I.makeStringMatcher,$.makeCommentMatcher=I.makeCommentMatcher,$.makeNumberMatcher=I.makeNumberMatcher,$.makeTextMatcher=I.makeTextMatcher,$.OPEN=r.OPEN,$.CLOSE=r.CLOSE,$.BEFORE=r.BEFORE,$.AFTER=r.AFTER,$.EMPTY=r.EMPTY,$.util=w,$.make=C,T.exports.default=R,T.exports=T.exports.Jsonic,T.exports}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$jsonicMin_19=_$jsonicMin_19.exports;var _$directiveMin_17={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$directiveMin_17.exports?_$directiveMin_17.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).JsonicDirective=t()}((function(){var e={};Object.defineProperty(e,"__esModule",{value:!0}),e.Directive=void 0;const t=e=>("string"==typeof e?e.split(/\s*,\s*/):e||[]).filter(e=>null!=e&&""!==e),n=(e,n)=>{var r,i;let l,o={open:t(null===(r=null==n?void 0:n.rules)||void 0===r?void 0:r.open),close:t(null===(i=null==n?void 0:n.rules)||void 0===i?void 0:i.close)},s=n.name,a=n.open,u=n.close,c=n.custom;if("string"==typeof n.action){let t=n.action;l=n=>n.node=e.util.prop(e.options,t)}else l=n.action;let p={},d="#OD_"+s,f="#CD_"+s,h=e.fixed(a),m=null==u?null:e.fixed(u);if(null!=h)throw new Error("Directive open token already in use: "+a);p[d]=a,null==m&&null!=u&&(p[f]=u),e.options({fixed:{token:p},error:{[s+"_close"]:null==u?null:"directive "+s+' close "'+u+'" without open "'+a+'"'},hint:{[s+"_close"]:null==u?null:`\nThe ${s} directive must start with the characters "${a}" and end\nwith the characters "${u}". The end characters "${u}" may not\nappear without the start characters "${a}" appearing first:\n"${a}...${u}".\n`}});let g=e.token.CA;h=e.fixed(a),m=null==u?null:e.fixed(u),o.open.forEach(t=>{e.rule(t,e=>(e.open({s:[h],p:s,n:{["dr_"+s]:1},g:"start"}),null!=u&&(e.open({s:[h,m],b:1,p:s,n:{["dr_"+s]:1},g:"start,end"}),e.close({s:[m],b:1,g:"end"})),e))}),null!=u&&o.close.forEach(t=>{e.rule(t,e=>{e.close([{s:[m],c:e=>1===e.n["dr_"+s],b:1,g:"end"},{s:[g,m],c:e=>1===e.n["dr_"+s],b:1,g:"end,comma"}])})}),e.rule(s,e=>e.clear().bo(e=>{e.node={}}).open([null!=u?{s:[m],b:1}:null,{p:"val",n:null==u?{dlist:1,dmap:1}:{dlist:0,dmap:0}}]).bc((function(e,t,n,r){let i=l.call(this,e,t,n,r);if(null==i?void 0:i.isToken)return i})).close(null!=u?[{s:[m]},{s:[g,m]}]:[])),c&&c(e,{OPEN:h,CLOSE:m,name:s})};return e.Directive=n,n.defaults={rules:{open:"val",close:"list,elem,map,pair"}},e}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$directiveMin_17=_$directiveMin_17.exports;var _$js_21={};function makeJavaScriptProcessor(e){const t=t=>{t.val=evaluate(t,e)};return t.opts=e,t}function evaluate(res,opts){let out;if(!0!==(null==opts?void 0:opts.evalOnly))out=require(res.full);else{let exports=null,module={exports:exports};eval(res.src),out=module.exports}return out}Object.defineProperty(_$js_21,"__esModule",{value:!0}),_$js_21.makeJavaScriptProcessor=void 0,_$js_21.makeJavaScriptProcessor=makeJavaScriptProcessor;var _$_empty_26={},_$browser_28={},cachedSetTimeout,cachedClearTimeout,process=_$browser_28={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,function(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var _$pathBrowserify_27={};(function(e){(function(){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,l=-1,o=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(47===n)break;n=47}if(47===n){if(l===s-1||1===o);else if(l!==s-1&&2===o){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var a=r.lastIndexOf("/");if(a!==r.length-1){-1===a?(r="",i=0):i=(r=r.slice(0,a)).length-1-r.lastIndexOf("/"),l=s,o=0;continue}}else if(2===r.length||1===r.length){r="",i=0,l=s,o=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(l+1,s):r=e.slice(l+1,s),i=s-l-1;l=s,o=0}else 46===n&&-1!==o?++o:o=-1}return r}var r={resolve:function(){for(var r,i="",l=!1,o=arguments.length-1;o>=-1&&!l;o--){var s;o>=0?s=arguments[o]:(void 0===r&&(r=e.cwd()),s=r),t(s),0!==s.length&&(i=s+"/"+i,l=47===s.charCodeAt(0))}return i=n(i,!l),l?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var l=e.length,o=l-i,s=1;s<n.length&&47===n.charCodeAt(s);++s);for(var a=n.length-s,u=o<a?o:a,c=-1,p=0;p<=u;++p){if(p===u){if(a>u){if(47===n.charCodeAt(s+p))return n.slice(s+p+1);if(0===p)return n.slice(s+p)}else o>u&&(47===e.charCodeAt(i+p)?c=p:0===p&&(c=0));break}var d=e.charCodeAt(i+p);if(d!==n.charCodeAt(s+p))break;47===d&&(c=p)}var f="";for(p=i+c+1;p<=l;++p)p!==l&&47!==e.charCodeAt(p)||(0===f.length?f+="..":f+="/..");return f.length>0?f+n.slice(s+c):(s+=c,47===n.charCodeAt(s)&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,l=!0,o=e.length-1;o>=1;--o)if(47===(n=e.charCodeAt(o))){if(!l){i=o;break}}else l=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,l=-1,o=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var s=n.length-1,a=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!o){i=r+1;break}}else-1===a&&(o=!1,a=r+1),s>=0&&(u===n.charCodeAt(s)?-1==--s&&(l=r):(s=-1,l=a))}return i===l?l=a:-1===l&&(l=e.length),e.slice(i,l)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!o){i=r+1;break}}else-1===l&&(o=!1,l=r+1);return-1===l?"":e.slice(i,l)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,l=!0,o=0,s=e.length-1;s>=0;--s){var a=e.charCodeAt(s);if(47!==a)-1===i&&(l=!1,i=s+1),46===a?-1===n?n=s:1!==o&&(o=1):-1!==n&&(o=-1);else if(!l){r=s+1;break}}return-1===n||-1===i||0===o||1===o&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),l=47===i;l?(n.root="/",r=1):r=0;for(var o=-1,s=0,a=-1,u=!0,c=e.length-1,p=0;c>=r;--c)if(47!==(i=e.charCodeAt(c)))-1===a&&(u=!1,a=c+1),46===i?-1===o?o=c:1!==p&&(p=1):-1!==o&&(p=-1);else if(!u){s=c+1;break}return-1===o||-1===a||0===p||1===p&&o===a-1&&o===s+1?-1!==a&&(n.base=n.name=0===s&&l?e.slice(1,a):e.slice(s,a)):(0===s&&l?(n.name=e.slice(1,o),n.base=e.slice(1,a)):(n.name=e.slice(s,o),n.base=e.slice(s,a)),n.ext=e.slice(o,a)),s>0?n.dir=e.slice(0,s-1):l&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,_$pathBrowserify_27=r}).call(this)}).call(this,_$browser_28);var _$mem_24={};Object.defineProperty(_$mem_24,"__esModule",{value:!0}),_$mem_24.makeMemResolver=_$mem_24.buildPotentials=void 0;const __multisource_1_24=_$multisource_20({});function buildPotentials(e,t,n){let r=e.full,i=[],l=t.implictExt||[];for(let o of l)i.push(r+o);for(let o of l)i.push(n(r,"index"+o));if(null!=e.path){let t=(e.path.replace(/[\\\/]+$/,"").match(/[^\\\/]+$/)||[])[0];if(null!=t)for(let e of l)i.push(n(r,"index."+t+e))}return i}_$mem_24.makeMemResolver=function(e){return function(t,n,r,i){let l,o=(0,__multisource_1_24.resolvePathSpec)(n,i,t,function(e){return function(t){let n=t;return e[t]&&(n=(t.replace(/[\\\/]+$/,"").match(/[\\\/]+([^\\\/]+)$/)||["",""])[1]),n}}(e));if(null!=o.full&&(l=e[o.full],null==l&&__multisource_1_24.NONE===o.kind)){let t=buildPotentials(o,n,(...e)=>e.reduce((e,t)=>e+"/"+t));for(let n of t)if(null!=(l=e[n])){o.full=n,o.kind=(n.match(/\.([^.]*)$/)||[__multisource_1_24.NONE,__multisource_1_24.NONE])[1];break}}return{...o,src:l,found:null!=l}}},_$mem_24.buildPotentials=buildPotentials;var _$file_23={},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_$file_23,"__esModule",{value:!0}),_$file_23.makeFileResolver=void 0;const fs_1=__importDefault(_$_empty_26),path_1=__importDefault(_$pathBrowserify_27),__multisource_1_23=_$multisource_20({});function resolvefolder(e){if("string"!=typeof e)return e;let t=e;return fs_1.default.statSync(e).isFile()&&(t=path_1.default.parse(e).dir),t}function load(e){try{return fs_1.default.readFileSync(e).toString()}catch(t){}}_$file_23.makeFileResolver=function(e){return function(t,n,r,i){let l,o=e?e(t):t,s=(0,__multisource_1_23.resolvePathSpec)(n,i,o,resolvefolder);if(null!=s.full&&(s.full=path_1.default.resolve(s.full),l=load(s.full),null==l&&__multisource_1_23.NONE===s.kind)){let e=(0,_$mem_24.buildPotentials)(s,n,(...e)=>path_1.default.resolve(e.reduce((e,t)=>path_1.default.join(e,t))));for(let t of e)if(null!=(l=load(t))){s.full=t,s.kind=(t.match(/\.([^.]*)$/)||[__multisource_1_23.NONE,__multisource_1_23.NONE])[1];break}}return{...s,src:l,found:null!=l}}};var _$exprMin_18={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$exprMin_18.exports?_$exprMin_18.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).JsonicExpr=t()}((function(){var t={exports:{}};(function(e){(function(){!function(n){"object"==typeof t.exports?t.exports=n():("undefined"!=typeof window?window:void 0!==e?e:"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.log_lex=t.log_stack=t.log_parse=t.log_node=t.log_rule=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 i=n({}),l=e=>null==e?[]:Object.keys(e);t.keys=l;const o=e=>null==e?[]:Object.values(e);t.values=o;const s=e=>null==e?[]:Object.entries(e);t.entries=s;const a=(e,...t)=>Object.assign(null==e?{}:e,...t);t.assign=a,t.isarr=e=>Array.isArray(e);const u=Object.defineProperty;t.defprop=u;const c=(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 i=2;for(;void 0!==r[i];)e[r[i]]=r[i+1],i+=2;return e},{});t.omap=c;const p={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=p;class d extends SyntaxError{constructor(e,t,n,r,i){let l=k(e,t=g({},t),n,r,i);super(l.message),a(this,l),x(this)}toJSON(){return{...this,__error:!0,name:this.name,message:this.message,stack:this.stack}}}function f(e,t,n){let i=t.t,l=i[e];return null==l&&r.STRING===typeof e&&(l=t.tI++,i[l]=e,i[e]=l,i[e.substring(1)]=l,null!=n&&a(n.token,t.t)),l}function h(e,...t){return new RegExp(t.map(e=>e.esc?m(e.toString()):e).join(r.EMPTY),null==e?"":e)}function m(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=p.function===typeof e,r=null!=e&&(p.object===typeof e||n);for(let i of t){let t,l=p.function===typeof i,o=null!=i&&(p.object===typeof i||l);if(r&&o&&!l&&Array.isArray(e)===Array.isArray(i))for(let n in i)e[n]=g(e[n],i[n]);else e=void 0===i?e:l?i:o?p.function===typeof(t=i.constructor)&&p.Object!==t.name&&p.Array!==t.name?i:g(Array.isArray(i)?[]:{},i):i,n=p.function===typeof e,r=null!=e&&(p.object===typeof e||n)}return e}function v(e,t,n,r,i,l){let o={code:t,details:n,token:r,rule:i,ctx:l};return null==e?"":e.replace(/\$([\w_]+)/g,(e,t)=>{let s=JSON.stringify(null!=o[t]?o[t]:null!=n[t]?n[t]:l.meta&&null!=l.meta[t]?l.meta[t]:null!=r[t]?r[t]:null!=i[t]?i[t]:null!=l.opts[t]?l.opts[t]:null!=l.cfg[t]?l.cfg[t]:null!=l[t]?l[t]:"$"+t);return null==s?"":s})}function x(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 i=0<n.sI?n.sI:0,l=0<n.rI?n.rI:1,o=0<n.cI?n.cI:1,s=null==n.src?r.EMPTY:n.src,a=e.substring(Math.max(0,i-333),i).split("\n"),u=e.substring(i,i+333).split("\n"),c=2+(r.EMPTY+(l+2)).length,p=l<3?1:l-2,d=e=>"\x1b[34m"+(r.EMPTY+p++).padStart(c," ")+" | \x1b[0m"+(null==e?r.EMPTY:e),f=a.length;return[2<f?d(a[f-3]):null,1<f?d(a[f-2]):null,d(a[f-1]+u[0])," ".repeat(c)+" "+" ".repeat(o-1)+"\x1b[31m"+"^".repeat(s.length||1)+" "+t+"\x1b[0m",d(u[1]),d(u[2])].filter(e=>null!=e).join("\n")}function k(e,t,n,r,i){try{let l=i.cfg,o=i.meta,s=v(l.error[e]||l.error.unknown,e,t,n,r,i);p.function===typeof l.hint&&(l.hint={...l.hint(),...l.hint});let a=["\x1b[31m[jsonic/"+e+"]:\x1b[0m "+s," \x1b[34m--\x3e\x1b[0m "+(o&&o.fileName||"<no-file>")+":"+n.rI+":"+n.cI,b(i.src(),s,n),"",v((l.hint[e]||l.hint.unknown||"").trim().split("\n").map(e=>" "+e).join("\n"),e,t,n,r,i),""," \x1b[2mhttps://jsonic.senecajs.org\x1b[0m"," \x1b[2m--internal: rule="+r.name+"~"+r.state+"; token="+f(n.tin,i.cfg)+(null==n.why?"":"~"+n.why)+"; plugins="+i.plgn().map(e=>e.name).join(",")+"--\x1b[0m\n"].join("\n"),u={internal:{token:n,ctx:i}};return u={...Object.create(u),message:a,code:e,details:t,meta:o,fileName:o?o.fileName:void 0,lineNumber:n.rI,columnNumber:n.cI},u}catch(l){return console.log(l),{}}}function _(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(/]$/,s(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 y(e,t=44){let n;try{n="object"==typeof e?JSON.stringify(e):""+e}catch(r){n=""+e}return j(t<n.length?n.substring(0,t-3)+"...":n,t)}function j(e,t=5){return void 0===e?"":(""+e).substring(0,t).replace(/[\r\n\t]/g,".")}function O(...e){return null==e?{}:e.filter(e=>!1!==e).map(e=>"object"==typeof e?l(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}function S(e,t){return"["+(e.s||[]).map(e=>"number"==typeof e?f(e,t):Array.isArray(e)?"["+e.map(e=>f(e,t))+"]":"").join(" ")+"] "}function N(e,t,n){return e.F(e.src().substring(n.pnt.sI,n.pnt.sI+16)).padEnd(18," ")+" "+function(e){return"["+(e.NOTOKEN===e.t0?"":e.F(e.t0.src))+(e.NOTOKEN===e.t1?"":" "+e.F(e.t1.src))+"]~["+(e.NOTOKEN===e.t0?"":f(e.t0.tin,e.cfg))+(e.NOTOKEN===e.t1?"":" "+f(e.t1.tin,e.cfg))+"]"}(e).padEnd(34," ")+" "+(""+t.d).padStart(4," ")}function M(e,t){let n=s(t.n),r=s(t.use),i=s(t.keep);return(0===n.length?"":" N<"+n.filter(e=>e[1]).map(e=>e[0]+"="+e[1]).join(";")+">")+(0===r.length?"":" U<"+r.map(t=>t[0]+"="+e.F(t[1])).join(";")+">")+(0===i.length?"":" K<"+i.map(t=>t[0]+"="+e.F(t[1])).join(";")+">")}t.JsonicError=d,t.configure=function(e,t,n){var r,i,u,p,d,g,v,x,b,k,_,y,j,S,N,M,T,P,I,w,C,$,R,A,V,L,F,D,Y,B,U,J,K,q,z,G,Z,W,X,H,Q;const ee=t||{};ee.t=ee.t||{},ee.tI=ee.tI||1;const te=e=>f(e,ee);!1!==n.standard$&&(te("#BD"),te("#ZZ"),te("#UK"),te("#AA"),te("#SP"),te("#LN"),te("#CM"),te("#NR"),te("#ST"),te("#TX"),te("#VL")),ee.fixed={lex:!!(null===(r=n.fixed)||void 0===r?void 0:r.lex),token:n.fixed?c(E(n.fixed.token),([e,t])=>[t,f(e,ee)]):{},ref:void 0},ee.fixed.ref=c(ee.fixed.token,([e,t])=>[e,t]),ee.fixed.ref=Object.assign(ee.fixed.ref,c(ee.fixed.ref,([e,t])=>[t,e])),ee.match={lex:!!(null===(i=n.match)||void 0===i?void 0:i.lex),token:n.match?c(E(n.match.token),([e,t])=>[f(e,ee),t]):{}},c(ee.match.token,([e,t])=>[e,(t.tin$=+e,t)]);const ne=n.tokenSet?Object.keys(n.tokenSet).reduce((e,t)=>(e[t]=n.tokenSet[t].filter(e=>null!=e).map(e=>te(e)),e),{}):{};ee.tokenSet=ee.tokenSet||{},s(ne).map(e=>{let t=e[0],n=e[1];ee.tokenSet[t]?(ee.tokenSet[t].length=0,ee.tokenSet[t].push(...n)):ee.tokenSet[t]=n}),ee.tokenSetTins=s(ee.tokenSet).reduce((e,t)=>(e[t[0]]=e[t[0]]||{},t[1].map(n=>e[t[0]][n]=!0),e),{}),ee.tokenSetTins.IGNORE=ee.tokenSetTins.IGNORE||{},ee.space={lex:!!(null===(u=n.space)||void 0===u?void 0:u.lex),chars:O(null===(p=n.space)||void 0===p?void 0:p.chars)},ee.line={lex:!!(null===(d=n.line)||void 0===d?void 0:d.lex),chars:O(null===(g=n.line)||void 0===g?void 0:g.chars),rowChars:O(null===(v=n.line)||void 0===v?void 0:v.rowChars),single:!!(null===(x=n.line)||void 0===x?void 0:x.single)},ee.text={lex:!!(null===(b=n.text)||void 0===b?void 0:b.lex),modify:((null===(k=ee.text)||void 0===k?void 0:k.modify)||[]).concat(([null===(_=n.text)||void 0===_?void 0:_.modify]||[]).flat()).filter(e=>null!=e)},ee.number={lex:!!(null===(y=n.number)||void 0===y?void 0:y.lex),hex:!!(null===(j=n.number)||void 0===j?void 0:j.hex),oct:!!(null===(S=n.number)||void 0===S?void 0:S.oct),bin:!!(null===(N=n.number)||void 0===N?void 0:N.bin),sep:null!=(null===(M=n.number)||void 0===M?void 0:M.sep)&&""!==n.number.sep,exclude:null===(T=n.number)||void 0===T?void 0:T.exclude,sepChar:null===(P=n.number)||void 0===P?void 0:P.sep},ee.value={lex:!!(null===(I=n.value)||void 0===I?void 0:I.lex),map:s((null===(w=n.value)||void 0===w?void 0:w.map)||{}).reduce((e,t)=>(null==t[1]||(e[t[0]]=t[1]),e),{})},ee.rule={start:null==(null===(C=n.rule)||void 0===C?void 0:C.start)?"val":n.rule.start,maxmul:null==(null===($=n.rule)||void 0===$?void 0:$.maxmul)?3:n.rule.maxmul,finish:!!(null===(R=n.rule)||void 0===R?void 0:R.finish),include:(null===(A=n.rule)||void 0===A?void 0:A.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):[]},ee.map={extend:!!(null===(L=n.map)||void 0===L?void 0:L.extend),merge:null===(F=n.map)||void 0===F?void 0:F.merge},ee.list={property:!!(null===(D=n.list)||void 0===D?void 0:D.property)};let re=Object.keys(ee.fixed.token).sort((e,t)=>t.length-e.length).map(e=>m(e)).join("|"),ie=(null===(Y=n.comment)||void 0===Y?void 0:Y.lex)?(n.comment.def?o(n.comment.def):[]).filter(e=>e&&e.lex).map(e=>m(e.start)).join("|"):"",le=["([",m(l(O(ee.space.lex&&ee.space.chars,ee.line.lex&&ee.line.chars)).join("")),"]",("string"==typeof n.ender?n.ender.split(""):Array.isArray(n.ender)?n.ender:[]).map(e=>"|"+m(e)).join(""),""===re?"":"|",re,""===ie?"":"|",ie,"|$)"];return ee.rePart={fixed:re,ender:le,commentStart:ie},ee.re={ender:h(null,...le),rowChars:h(null,m(null===(B=n.line)||void 0===B?void 0:B.rowChars)),columns:h(null,"["+m(null===(U=n.line)||void 0===U?void 0:U.chars)+"]","(.*)$")},ee.lex={empty:!!(null===(J=n.lex)||void 0===J?void 0:J.empty),emptyResult:null===(K=n.lex)||void 0===K?void 0:K.emptyResult,match:(null===(q=n.lex)||void 0===q?void 0:q.match)?n.lex.match.map(e=>{let t=e(ee,n);return t&&(t.maker=e),t}).filter(e=>null!=e&&!1!==e):[]},ee.debug={get_console:(null===(z=n.debug)||void 0===z?void 0:z.get_console)||(()=>console),maxlen:null==(null===(G=n.debug)||void 0===G?void 0:G.maxlen)?99:n.debug.maxlen,print:{config:!!(null===(W=null===(Z=n.debug)||void 0===Z?void 0:Z.print)||void 0===W?void 0:W.config),src:null===(H=null===(X=n.debug)||void 0===X?void 0:X.print)||void 0===H?void 0:H.src}},ee.error=n.error||{},ee.hint=n.hint||{},(null===(Q=n.config)||void 0===Q?void 0:Q.modify)&&l(n.config.modify).forEach(e=>n.config.modify[e](ee,n)),ee.debug.print.config&&ee.debug.get_console().dir(ee,{depth:null}),ee.result={fail:[]},n.result&&(ee.result.fail=[...n.result.fail]),a(e.options,n),a(e.token,ee.t),a(e.tokenSet,ee.tokenSet),a(e.fixed,ee.fixed.ref),ee},t.tokenize=f,t.findTokenSet=function(e,t){return t.tokenSet[e]},t.mesc=function(e,t){return(t=new String(e)).esc=!0,t},t.regexp=h,t.escre=m,t.deep=g,t.errinject=v,t.trimstk=x,t.extract=b,t.errdesc=k,t.badlex=function(e,t,n){let r=e.next.bind(e);return e.next=(e,i,l,o)=>{let s=r(e,i,l,o);if(t===s.tin){let t={};throw null!=s.use&&(t.use=s.use),new d(s.why||p.unexpected,t,s,e,n)}return s},e},t.makelog=function(e,t){var n,r,i;let l=null===(i=null===(r=null===(n=e.opts)||void 0===n?void 0:n.plugin)||void 0===r?void 0:r.debug)||void 0===i?void 0:i.trace;if(t||l)if("number"==typeof(null==t?void 0:t.log)||l){let n=!1,r=null==t?void 0:t.log;(-1===r||l)&&(r=1,n=!0),e.log=(...t)=>{if(n){let n=t.filter(e=>p.object!=typeof e).map(e=>p.function==typeof e?e.name:e).join(p.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=_,t.str=y,t.snip=j,t.clone=function(e){return g(Object.create(Object.getPrototypeOf(e)),e)},t.charset=O,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,i=t.split(".");for(let t=0;t<i.length;t++)r=i[t],t<i.length-1&&(e=e[r]=e[r]||{});return void 0!==n&&(e[r]=n),e[r]}catch(i){throw new Error("Cannot "+(void 0===n?"get":"set")+" path "+t+" on object: "+y(r)+(void 0===n?"":" to value: "+y(n,22)))}},t.modlist=function(e,t){if(t&&e&&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,i=(e.length+t.move[r+1])%e.length,l=e[n];e.splice(n,1),e.splice(i,0,l)}let n=e.filter(e=>null!=e);n.length!==e.length&&(e.length=0,e.push(...n))}return e},t.parserwrap=function(e){return{start:function(t,n,l,o){try{return e.start(t,n,l,o)}catch(s){if("SyntaxError"===s.name){let o=0,a=0,u=0,c=r.EMPTY,p=s.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);if(p){c=p[1],o=parseInt(p[2]),a=t.substring(0,o).replace(/[^\n]/g,r.EMPTY).length;let e=o-1;for(;-1<e&&"\n"!==t.charAt(e);)e--;u=Math.max(t.substring(e,o).length,0)}let h=s.token||(0,i.makeToken)("#UK",f("#UK",n.internal().config),void 0,c,(0,i.makePoint)(c.length,o,s.lineNumber||a,s.columnNumber||u));throw new d(s.code||"json",s.details||{msg:s.message},h,{},s.ctx||{uI:-1,opts:n.options,cfg:n.internal().config,token:h,meta:l,src:()=>t,root:()=>{},plgn:()=>n.internal().plugins,rule:{name:"no-rule"},sub:{},xs:-1,v2:h,v1:h,t0:h,t1:h,tC:-1,kI:-1,rs:[],rsI:0,rsm:{},n:{},log:l?l.log:void 0,F:_(n.internal().config),use:{},NORULE:{name:"no-rule"},NOTOKEN:{name:"no-token"}})}throw s}}}};const T={o:p.open.toUpperCase(),c:p.close.toUpperCase()};t.log_rule=function(e,t,n){e.log(t,e,n,p.logindent+p.rule+p.space,N(e,t,n),p.indent.repeat(t.d)+(t.name+"~"+t.i+p.colon+T[t.state]).padEnd(16),("prev="+t.prev.i+" parent="+t.parent.i+" child="+t.child.i).padEnd(28),M(e,t))},t.log_node=function(e,t,n,r){e.log(t,e,n,r,p.logindent+p.node+p.space,N(e,t,n),p.indent.repeat(t.d)+("why="+r.why+p.space+"<"+e.F(t.node)+">").padEnd(46),M(e,t))},t.log_parse=function(e,t,n,i,l,o,a,u){let c=i&&u.n?s(u.n):null,d=i&&u.u?s(u.u):null,f=i&&u.k?s(u.k):null;e.log&&e.log(e,t,n,p.logindent+p.parse,N(e,t,n),p.indent.repeat(t.d)+(i?"alt="+o:"no-alt"),i&&a?S(a,e.cfg):"",i&&u.g?"g:"+u.g+" ":"",(i&&u.p?"p:"+u.p+" ":"")+(i&&u.r?"r:"+u.r+" ":"")+(i&&u.b?"b:"+u.b+" ":""),a&&a.c?"c:"+l:r.EMPTY,null==c?"":"n:"+c.map(e=>e[0]+"="+e[1]).join(";"),null==d?"":"u:"+d.map(e=>e[0]+"="+e[1]).join(";"),null==f?"":"k:"+f.map(e=>e[0]+"="+e[1]).join(";"))},t.log_stack=function(e,t,n){e.log(p.logindent+p.stack,N(e,t,n),p.indent.repeat(t.d)+"/"+e.rs.slice(0,t.d).map(e=>e.name+"~"+e.i).join("/"),"~","/"+e.rs.slice(0,t.d).map(t=>e.F(t.node)).join("/"),e,t,n)},t.log_lex=function(e,t,n,r,i,l,o,s,a,u){e.log(p.logindent+p.lex+p.space+p.space,N(e,t,n),p.indent.repeat(t.d)+f(o.tin,e.cfg),e.F(o.src),r.sI,r.rI+":"+r.cI,(null==l?void 0:l.name)||"",s?"on:alt="+a+";"+s.g+";t="+u+";"+S(s,e.cfg):"",e.F(n.src.substring(i,i+16)),e,t,n)}})),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 i=t({});class l{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 o=(...e)=>new l(...e);n.makePoint=o;class s{constructor(e,t,n,i,l,o,s){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=i,this.val=n,this.sI=l.sI,this.rI=l.rI,this.cI=l.cI,this.use=o,this.why=s,this.len=null==i?0:i.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,i.deep)(this.use||{},t)),this}toString(){return"Token["+this.name+"="+this.tin+" "+(0,i.snip)(this.src)+(void 0===this.val||"#ST"===this.name||"#TX"===this.name?"":"="+(0,i.snip)(this.val))+" "+[this.sI,this.rI,this.cI]+(null==this.use?"":" "+(0,i.snip)(""+JSON.stringify(this.use).replace(/"/g,""),22))+(null==this.err?"":" "+this.err)+(null==this.why?"":" "+(0,i.snip)(""+this.why,22))+"]"}[r.INSPECT](){return this.toString()}}const a=(...e)=>new s(...e);function u(e,t,n){let r=e.pnt,i=t;if(e.cfg.fixed.lex&&null!=n&&0<n.length){let l,o=e.cfg.fixed.token[n];null!=o&&(l=e.token(o,void 0,n,r)),null!=l&&(r.sI+=l.src.length,r.cI+=l.src.length,null==t?i=l:r.token.push(l))}return i}n.makeToken=a,n.makeNoToken=()=>a("",-1,void 0,r.EMPTY,o(-1)),n.makeFixedMatcher=(e,t)=>{let n=(0,i.regexp)(null,"^(",e.rePart.fixed,")");return function(t){let r=e.fixed;if(!r.lex)return;let i=t.pnt,l=t.src.substring(i.sI).match(n);if(l){let e=l[1],n=e.length;if(0<n){let l,o=r.token[e];return null!=o&&(l=t.token(o,void 0,e,i),i.sI+=n,i.cI+=n),l}}}},n.makeMatchMatcher=(e,t)=>{let n=(0,i.values)(e.match.token);return 0===n.length?null:function(t,r,i=0){if(!e.match.lex)return;let l=t.pnt,o=t.src.substring(l.sI),s="o"===r.state?0:1;for(let e of n)if(!e.tin$||r.spec.def.tcol[s][i].includes(e.tin$))if(e instanceof RegExp){let n=o.match(e);if(n){let r=n[0],i=r.length;if(0<i){let n,o=e.tin$;return n=t.token(o,r,r,l),l.sI+=i,l.cI+=i,n}}}else{let n=e(t,r);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,i.entries)(n.def):[]).reduce((t,[n,r])=>{if(null==r||!1===r)return t;let l={name:n,start:r.start,end:r.end,line:!!r.line,lex:!!r.lex,suffixMatch:void 0,getSuffixMatch:void 0};return l.getSuffixMatch=r.suffix?()=>{if(r.suffix instanceof Function)return l.suffixMatch=r.suffix;let t=(Array.isArray(r.suffix)?r.suffix:[r.suffix]).map(t=>e.lex.match.find(e=>{var n;return(null===(n=e.maker)||void 0===n?void 0:n.name)==t})).filter(e=>null!=e),n=(...e)=>{t.map(t=>t(...e))};return(0,i.defprop)(n,"name",{value:""+r.suffix}),n}:void 0,t[n]=l,t},{})};let r=e.comment.lex?(0,i.values)(e.comment.def).filter(e=>e.lex&&e.line):[],l=e.comment.lex?(0,i.values)(e.comment.def).filter(e=>e.lex&&!e.line):[];return function(t,n){if(!e.comment.lex)return;let o=t.pnt,s=t.src.substring(o.sI),a=o.rI,u=o.cI;for(let i of r)if(s.startsWith(i.start)){let r=s.length,l=i.start.length;for(u+=i.start.length;l<r&&!e.line.chars[s[l]];)u++,l++;let a=s.substring(0,l),c=t.token("#CM",void 0,a,o);return o.sI+=a.length,o.cI=u,i.suffixMatch?i.suffixMatch(t,n):i.getSuffixMatch&&(i.suffixMatch=i.getSuffixMatch(),i.suffixMatch&&i.suffixMatch(t,n)),c}for(let r of l)if(s.startsWith(r.start)){let n=s.length,l=r.start.length,c=r.end;for(u+=r.start.length;l<n&&!s.substring(l).startsWith(c);)e.line.rowChars[s[l]]&&(a++,u=0),u++,l++;if(s.substring(l).startsWith(c)){u+=c.length;let e=s.substring(0,l+c.length),n=t.token("#CM",void 0,e,o);return o.sI+=e.length,o.rI=a,o.cI=u,n}return t.bad(i.S.unterminated_comment,o.sI,o.sI+9*r.start.length)}}},n.makeTextMatcher=(e,t)=>{let n=(0,i.regexp)(e.line.lex?null:"s","^(.*?)",...e.rePart.ender);return function(r){let i=e.text,l=r.pnt,o=r.src.substring(l.sI),s=e.value.map,a=o.match(n);if(a){let n,o=a[1],c=a[2];if(null!=o){let t=o.length;if(0<t){let a;e.value.lex&&void 0!==(a=s[o])?(n=r.token("#VL",a.val,o,l),l.sI+=t,l.cI+=t):i.lex&&(n=r.token("#TX",o,o,l),l.sI+=t,l.cI+=t)}}if(n&&(n=u(r,n,c)),n&&0<e.text.modify.length){const i=e.text.modify;for(let l=0;l<i.length;l++)n.val=i[l](n.val,r,e,t)}return n}}},n.makeNumberMatcher=(e,t)=>{let n=e.number,r=(0,i.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,i.escre)(n.sepChar):""),")",...e.rePart.ender),l=n.sep?(0,i.regexp)("g",(0,i.escre)(n.sepChar)):void 0;return function(t){if(n=e.number,!n.lex)return;let i=t.pnt,o=t.src.substring(i.sI),s=e.value.map,a=o.match(r);if(a){let n,r=a[1],o=a[9],c=!0;if(null!=r&&(c=!e.number.exclude||!r.match(e.number.exclude))){let o=r.length;if(0<o){let a;if(e.value.lex&&void 0!==(a=s[r]))n=t.token("#VL",a.val,r,i);else{let e=l?r.replace(l,""):r,s=+e;if(isNaN(s)){let t=e[0];"-"!==t&&"+"!==t||(s=("-"===t?-1:1)*+e.substring(1))}isNaN(s)||(n=t.token("#NR",s,r,i),i.sI+=o,i.cI+=o)}}}return c&&(n=u(t,n,o)),n}}},n.makeStringMatcher=(e,t)=>{let n=t.string||{};return e.string=e.string||{},e.string=(0,i.deep)(e.string,{lex:!!(null==n?void 0:n.lex),quoteMap:(0,i.charset)(n.chars),multiChars:(0,i.charset)(n.multiChars),escMap:(0,i.clean)({...n.escape}),escChar:n.escapeChar,escCharCode:null==n.escapeChar?void 0:n.escapeChar.charCodeAt(0),allowUnknown:!!n.allowUnknown,replaceCodeMap:(0,i.omap)((0,i.clean)({...n.replace}),([e,t])=>[e.charCodeAt(0),t]),hasReplace:!1}),e.string.hasReplace=0<(0,i.keys)(e.string.replaceCodeMap).length,function(t){let n=e.string;if(!n.lex)return;let{quoteMap:l,escMap:o,escChar:s,escCharCode:a,multiChars:u,allowUnknown:c,replaceCodeMap:p,hasReplace:d}=n,{pnt:f,src:h}=t,{sI:m,rI:g,cI:v}=f,x=h.length;if(l[h[m]]){const n=h[m],l=m,b=g,k=u[n];++m,++v;let _,y=[];for(;m<x;m++){v++;let r=h[m];if(_=void 0,n===r){m++;break}if(s===r){m++,v++;let e=o[h[m]];if(null!=e)y.push(e);else if("x"===h[m]){m++;let e=parseInt(h.substring(m,m+2),16);if(isNaN(e))return m-=2,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_ascii,m,m+4);let n=String.fromCharCode(e);y.push(n),m+=1,v+=2}else if("u"===h[m]){m++;let e="{"===h[m]?(m++,1):0,n=e?6:4,r=parseInt(h.substring(m,m+n),16);if(isNaN(r))return m=m-2-e,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_unicode,m,m+n+2+2*e);let l=String.fromCodePoint(r);y.push(l),m+=n-1+e,v+=n+e}else{if(!c)return f.sI=m,f.cI=v-1,t.bad(i.S.unexpected,m,m+1);y.push(h[m])}}else if(d&&void 0!==(_=p[h.charCodeAt(m)]))y.push(_),v++;else{let r=m,l=n.charCodeAt(0),o=h.charCodeAt(m);for(;(!d||void 0===(_=p[o]))&&m<x&&32<=o&&l!==o&&a!==o;)o=h.charCodeAt(++m),v++;if(v--,void 0===_&&o<32){if(!k||!e.line.chars[h[m]])return f.sI=m,f.cI=v,t.bad(i.S.unprintable,m,m+1);e.line.rowChars[h[m]]&&(f.rI=++g),v=1,y.push(h.substring(r,m+1))}else y.push(h.substring(r,m)),m--}}if(h[m-1]!==n||f.sI===m-1)return f.rI=b,t.bad(i.S.unterminated_string,l,m);const j=t.token("#ST",y.join(r.EMPTY),h.substring(f.sI,m),f);return f.sI=m,f.rI=g,f.cI=v,j}}},n.makeLineMatcher=(e,t)=>function(t){if(!e.line.lex)return;let n,{chars:r,rowChars:i}=e.line,{pnt:l,src:o}=t,{sI:s,rI:a}=l,u=e.line.single;for(u&&(n={});r[o[s]]&&!(n&&(n[o[s]]=(n[o[s]]||0)+1,u&&1<n[o[s]]));)a+=i[o[s]]?1:0,s++;if(l.sI<s){let e=o.substring(l.sI,s);const n=t.token("#LN",void 0,e,l);return l.sI+=e.length,l.rI=a,l.cI=1,n}},n.makeSpaceMatcher=(e,t)=>function(t){if(!e.space.lex)return;let{chars:n}=e.space,{pnt:r,src:i}=t,{sI:l,cI:o}=r;for(;n[i[l]];)l++,o++;if(r.sI<l){let e=i.substring(r.sI,l);const n=t.token("#SP",void 0,e,r);return r.sI+=e.length,r.cI=o,n}};class c{constructor(e){this.src=r.EMPTY,this.ctx={},this.cfg={},this.pnt=o(-1),this.ctx=e,this.src=e.src(),this.cfg=e.cfg,this.pnt=o(this.src.length)}token(e,t,n,r,l,o){let s,u;return"string"==typeof e?(u=e,s=(0,i.tokenize)(u,this.cfg)):(s=e,u=(0,i.tokenize)(e,this.cfg)),a(u,s,t,n,r||this.pnt,l,o)}next(e,t,n,r){let l,o,s=this.pnt,a=s.sI;if(s.end)l=s.end;else if(0<s.token.length)l=s.token.shift();else if(s.len<=s.sI)s.end=this.token("#ZZ",void 0,"",s),l=s.end;else{for(let t of this.cfg.lex.match)if(l=t(this,e,r)){o=t;break}l=l||this.token("#BD",void 0,this.src[s.sI],s,void 0,"unexpected")}return this.ctx.log&&(0,i.log_lex)(this.ctx,e,this,s,a,o,l,t,n,r),this.ctx.sub.lex&&this.ctx.sub.lex.map(t=>t(l,e,this.ctx)),l}tokenize(e){return(0,i.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 c(...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 i={};Object.defineProperty(i,"__esModule",{value:!0}),i.defaults=void 0;const l=n({}),o={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},slash:{line:!0,start:"//",lex:!0},multi:{line:!1,start:"/*",end:"*/",lex:!0}}},string:{lex:!0,chars:"'\"`",multiChars:"`",escapeChar:"\\",escape:{b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",'"':'"',"'":"'","`":"`","\\":"\\","/":"/"},allowUnknown:!0},map:{extend:!0,merge:void 0},list:{property:!0},value:{lex:!0,map:{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,i)=>(n[r]=e(t[i]),n),{})},lex:{match:[l.makeMatchMatcher,l.makeFixedMatcher,l.makeSpaceMatcher,l.makeLineMatcher,l.makeStringMatcher,l.makeCommentMatcher,l.makeNumberMatcher,l.makeTextMatcher],empty:!0,emptyResult:void 0},rule:{start:"val",finish:!0,maxmul:3,include:"",exclude:""},result:{fail:[]},config:{modify:{}},parser:{start:void 0}};i.defaults=o;var s={};Object.defineProperty(s,"__esModule",{value:!0}),s.makeRuleSpec=s.makeNoRule=s.makeRule=void 0;const a=t({});class u{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 c=(...e)=>new u(...e);s.makeRule=c,s.makeNoRule=e=>c(g(e.cfg,{}),e);class p{constructor(){this.p=r.EMPTY,this.r=r.EMPTY,this.b=0}}const d=(...e)=>new p(...e),f=d(),h=d();class m{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])v(n)}tin(e){return(0,a.tokenize)(e,this.cfg)}add(e,t,n){let r=(null==n?void 0:n.append)?"push":"unshift",i=((0,a.isarr)(t)?t:[t]).filter(e=>null!=e&&"object"==typeof e).map(e=>v(e)),l="o"===e?"open":"close",o=this.def[l];return o[r](...i),(0,a.modlist)(o,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 i=this.def[t+n];return e?i.push(r):i.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=>v(e)),this.def.close.map(e=>v(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,i){t.log&&(0,a.log_rule)(t,e,n);let l="o"===i,o=l?e:t.NORULE,s=l?"O":"C",u=this.def,p=l?u.open:u.close,d=l?e.bo?u.bo:null:e.bc?u.bc:null;if(d){let n;for(let r=0;r<d.length;r++)if(n=d[r].call(this,e,t,o,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}let m=0<p.length?function(e,t,n,i,l){let o=f;o.b=0,o.p=r.EMPTY,o.r=r.EMPTY,o.n=void 0,o.h=void 0,o.a=void 0,o.u=void 0,o.k=void 0,o.e=void 0;let s=null,u=0,c=!0,p=1<<l.cfg.t.AA-1,d=l.cfg.tokenSetTins.IGNORE;function h(e,t,r,i){let o;do{o=n.next(e,t,r,i),l.tC++}while(d[o.tin]);return o}let m=t.length;for(u=0;u<m;u++){s=t[u];let n=!1,r=!1;if(c=!0,s.S0){let e=(l.t0=l.NOTOKEN!==l.t0?l.t0:l.t0=h(i,s,u,0)).tin;if(n=!0,c=!!(s.S0[e/31|0]&(1<<e%31-1|p)),c&&(r=null!=s.S1,s.S1)){let e=(l.t1=l.NOTOKEN!==l.t1?l.t1:l.t1=h(i,s,u,1)).tin;r=!0,c=!!(s.S1[e/31|0]&(1<<e%31-1|p))}}if(e?(i.o0=n?l.t0:l.NOTOKEN,i.o1=r?l.t1:l.NOTOKEN,i.os=(n?1:0)+(r?1:0)):(i.c0=n?l.t0:l.NOTOKEN,i.c1=r?l.t1:l.NOTOKEN,i.cs=(n?1:0)+(r?1:0)),c&&s.c&&(c=c&&s.c(i,l,o)),c)break;s=null}c||(o.e=l.t0),s&&(o.n=null!=s.n?s.n:o.n,o.h=null!=s.h?s.h:o.h,o.a=null!=s.a?s.a:o.a,o.u=null!=s.u?s.u:o.u,o.k=null!=s.k?s.k:o.k,o.g=null!=s.g?s.g:o.g,o.e=s.e&&s.e(i,l,o)||void 0,o.p=null!=s.p&&!1!==s.p?"string"==typeof s.p?s.p:s.p(i,l,o):o.p,o.r=null!=s.r&&!1!==s.r?"string"==typeof s.r?s.r:s.r(i,l,o):o.r,o.b=null!=s.b&&!1!==s.b?"number"==typeof s.b?s.b:s.b(i,l,o):o.b);let g=u<t.length;return l.log&&(0,a.log_parse)(l,i,n,g,c,u,s,o),o}(l,p,n,e,t):h;if(m.h&&(m=m.h(e,t,m,o)||m,s+="H"),m.e)return this.bad(m.e,e,t,{is_open:l});if(m.n)for(let r in m.n)e.n[r]=0===m.n[r]?0:(null==e.n[r]?0:e.n[r])+m.n[r];if(m.u&&(e.use=Object.assign(e.use,m.u)),m.k&&(e.keep=Object.assign(e.keep,m.k)),m.a){s+="A";let n=m.a(e,t,m);if(n&&n.isToken&&n.err)return this.bad(n,e,t,{is_open:l})}if(m.p){t.rs[t.rsI++]=e;let n=t.rsm[m.p];if(!n)return this.bad(this.unknownRule(t.t0,m.p),e,t,{is_open:l});o=e.child=c(n,t,e.node),o.parent=e,o.n={...e.n},0<Object.keys(e.keep).length&&(o.keep={...e.keep}),s+="P`"+m.p+"`"}else if(m.r){let n=t.rsm[m.r];if(!n)return this.bad(this.unknownRule(t.t0,m.r),e,t,{is_open:l});o=c(n,t,e.node),o.parent=e.parent,o.prev=e,o.n={...e.n},0<Object.keys(e.keep).length&&(o.keep={...e.keep}),s+="R`"+m.r+"`"}else l||(o=t.rs[--t.rsI]||t.NORULE);let g=l?e.ao?u.ao:null:e.ac?u.ac:null;if(g){let n;for(let r=0;r<g.length;r++)if(n=g[r](e,t,o,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}o.why=s,t.log&&(0,a.log_node)(t,e,n,o),r.OPEN===e.state&&(e.state=r.CLOSE);let v=e[l?"os":"cs"]-(m.b||0);return 1===v?(t.v2=t.v1,t.v1=t.t0,t.t0=t.t1,t.t1=t.NOTOKEN):2==v&&(t.v2=t.t1,t.v1=t.t0,t.t0=t.NOTOKEN,t.t1=t.NOTOKEN),o}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 m(...e);function v(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*/)),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),i=t([e.s[0]]),l=t([e.s[1]]),o=e;o.S0=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,o.S1=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}else e.s=null;return e.p||(e.p=null),e.r||(e.r=null),e.b||(e.b=null),e}s.makeRuleSpec=g;var x={};Object.defineProperty(x,"__esModule",{value:!0}),x.makeParser=x.makeRuleSpec=x.makeRule=void 0;const b=t({}),k=n({});Object.defineProperty(x,"makeRule",{enumerable:!0,get:function(){return s.makeRule}}),Object.defineProperty(x,"makeRuleSpec",{enumerable:!0,get:function(){return s.makeRuleSpec}});class _{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,s.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,i){let l,o=(0,k.makeToken)("#ZZ",(0,b.tokenize)("#ZZ",this.cfg),void 0,r.EMPTY,(0,k.makePoint)(-1)),a=(0,k.makeNoToken)(),u={uI:0,opts:this.options,cfg:this.cfg,meta:n||{},src:()=>e,root:()=>l,plgn:()=>t.internal().plugins,rule:{},sub:t.internal().sub,xs:-1,v2:o,v1:o,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:{}};u=(0,b.deep)(u,i);let c=(0,s.makeNoRule)(u);if(u.NORULE=c,u.rule=c,(0,b.makelog)(u,n),""===e){if(this.cfg.lex.empty)return this.cfg.lex.emptyResult;throw new b.JsonicError(b.S.unexpected,{src:e},u.t0,c,u)}let p=(0,b.badlex)((0,k.makeLex)(u),(0,b.tokenize)("#BD",this.cfg),u),d=this.rsm[this.cfg.rule.start];if(null==d)return;let f=(0,s.makeRule)(d,u);l=f;let h=2*(0,b.keys)(this.rsm).length*p.src.length*2*u.cfg.rule.maxmul,m=0;for(;c!==f&&m<h;)u.kI=m,u.rule=f,u.log&&u.log(u.kI+":"),u.sub.rule&&u.sub.rule.map(e=>e(f,u)),f=f.process(u,p),u.log&&(0,b.log_stack)(u,f,p),m++;if(o.tin!==p.next(f).tin)throw new b.JsonicError(b.S.unexpected,{},u.t0,c,u);const g=u.root().node;if(this.cfg.result.fail.includes(g))throw new b.JsonicError(b.S.unexpected,{},u.t0,c,u);return g}clone(e,t){let n=new _(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())}}x.makeParser=(...e)=>new _(...e);var y={};function j(e){const{deep:t}=e.util,{OB:n,CB:r,OS:i,CS:l,CL:o,CA:s,TX:a,ST:u,ZZ:c}=e.token,{VAL:p,KEY:d}=e.tokenSet,f=(e,t)=>{if(!t.cfg.rule.finish)return t.t0.src="END_OF_SOURCE",t.t0},h=e=>{const t=e.o0,n=u===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:[i],p:"list",b:1,g:"list,json"},{s:[p],g:"val,json"}]).close([{s:[c],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={}}).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:[i,l],b:1,g:"list,json"},{s:[i],p:"elem",g:"list,elem,json"}]).close([{s:[l],g:"end,json"}])}),e.rule("pair",e=>{e.open([{s:[d,o],p:"val",u:{pair:!0},a:h,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:[s],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:[s],r:"elem",g:"list,elem,json"},{s:[l],b:1,g:"list,elem,json"}])});const m=(e,n)=>{let r=e.use.key,i=e.child.node;const l=e.use.prev;i=void 0===i?null:i,e.node[r]=null==l?i:n.cfg.map.merge?n.cfg.map.merge(l,i,e,n):n.cfg.map.extend?t(l,i):i};e.rule("val",e=>{e.open([{s:[d,o],p:"map",b:2,n:{pk:1},g:"pair,jsonic"},{s:[p],g:"val,json"},{s:[[r,l]],b:1,c:e=>0<e.d,g:"val,imp,null,jsonic"},{s:[s],c:e=>0===e.d,p:"list",b:1,g:"list,imp,jsonic"},{s:[s],b:1,g:"list,val,imp,null,jsonic"},{s:[c],g:"jsonic"}],{append:!0,delete:[2]}).close([{s:[[r,l]],b:1,g:"val,json,close",e:(e,t)=>0===e.d?t.t0:void 0},{s:[s],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:[c],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,c],b:1,e:f,g:"end,jsonic"}]).open([{s:[d,o],p:"pair",b:2,g:"pair,list,val,imp"}],{append:!0}).close([{s:[r],c:{n:{pk:0}},g:"end,json"},{s:[r],b:1,g:"path,jsonic"},{s:[[s,l,...p]],b:1,g:"end,path,jsonic"},{s:[c],e:f,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:[s],p:"elem",b:1,g:"list,elem,val,imp"},{p:"elem",g:"list,elem"}],{append:!0}).close([{s:[c],e:f,g:"end,jsonic"}],{append:!0})}),e.rule("pair",(e,t)=>{e.open([{s:[s],g:"map,pair,comma"}],{append:!0}).bc((e,t)=>{e.use.pair&&m(e,t)}).close([{s:[r],c:{n:{pk:0}},b:1,g:"map,pair,json"},{s:[s,r],c:{n:{pk:0}},b:1,g:"map,pair,comma,jsonic"},{s:[s,c],g:"end,jsonic"},{s:[s],c:{n:{pk:0}},r:"pair",g:"map,pair,json"},{s:[s],c:{n:{dmap:1}},r:"pair",g:"map,pair,jsonic"},{s:[d],c:{n:{dmap:1}},r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[[r,s,l,...d]],b:1,g:"map,pair,imp,path,jsonic",c:e=>0<e.n.pk},{s:[l],e:e=>e.c0,g:"end,jsonic"},{s:[c],e:f,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:[s,s],b:2,u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[s],u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[d,o],e:t.cfg.list.property?void 0:(e,t)=>t.t0,p:"val",n:{pk:1,dmap:1},u:{done:!0,pair:!0},a:h,g:"elem,pair,jsonic"}]).bc((e,t)=>{!0===e.use.pair&&(e.use.prev=e.node[e.use.key],m(e,t))}).close([{s:[s,[l,c]],b:1,g:"list,elem,comma,jsonic"},{s:[s],r:"elem",g:"list,elem,json"},{s:[l],b:1,g:"list,elem,json"},{s:[c],e:f,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(y,"__esModule",{value:!0}),y.makeJSON=y.grammar=void 0,y.grammar=j,y.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 j(t),t};var O={};Object.defineProperty(O,"__esModule",{value:!0}),O.Debug=void 0;const E=(e,t)=>{const{keys:n,values:r,entries:i}=e.util;e.debug={describe:function(){var t;let l=null===(t=e.options.lex)||void 0===t?void 0:t.match,o=e.rule();return["========= RULES =========",N(e,n(o),o),"\n","========= ALTS =========",r(o).map(t=>" "+t.name+":\n"+S(e,t,"open")+S(e,t,"close")).join("\n\n"),"\n","========= LEXER ========="," "+(l&&l.map(e=>e.name)||[]).join("\n "),"\n","\n","========= PLUGIN ========="," "+e.internal().plugins.map(e=>e.name+(e.options?i(e.options).reduce((e,t)=>e+"\n "+t[0]+": "+JSON.stringify(t[1]),""):"")).join("\n "),"\n"].join("\n")}};const l=e.use.bind(e);e.use=(...e)=>{let n=l(...e);return t.print&&n.internal().config.debug.get_console().log(n.debug.describe()),n},t.trace};function S(e,t,n){const{entries:r}=e.util;return 0===t.def[n].length?"":" "+n.toUpperCase()+":\n"+t.def[n].map((t,n)=>{var i,l;return" "+(""+n).padStart(5," ")+" "+("["+(t.s||[]).map(t=>"number"==typeof t?e.token[t]:"["+t.map(t=>e.token[t])+"]").join(" ")+"] ").padEnd(32," ")+(t.r?" r="+("string"==typeof t.r?t.r:"<F>"):"")+(t.p?" p="+("string"==typeof t.p?t.p:"<F>"):"")+(t.r||t.p?"":"\t")+"\t"+(null==t.b?"":"b="+t.b)+"\t"+(null==t.n?"":"n="+r(t.n).map(([e,t])=>e+":"+t))+"\t"+(null==t.a?"":"A")+(null==t.c?"":"C")+(null==t.h?"":"H")+"\t"+(null==(null===(i=t.c)||void 0===i?void 0:i.n)?"\t":" CN="+r(t.c.n).map(([e,t])=>e+":"+t))+(null==(null===(l=t.c)||void 0===l?void 0:l.d)?"":" CD="+t.c.d)+(t.g?"\tg="+t.g:"")}).join("\n")+"\n"}function N(e,t,n){const{values:r,omap:i}=e.util;return t.reduce((e,t)=>e+" "+t+":\n "+r(i({op:M(n,t,"open","p"),or:M(n,t,"open","r"),cp:M(n,t,"close","p"),cr:M(n,t,"close","r")},([e,t])=>[1<t.length?e:void 0,e+": "+t])).join("\n ")+"\n","")}function M(e,t,n,r){return[...new Set(e[t].def[n].filter(e=>e[r]).map(e=>e[r]).map(e=>"string"==typeof e?e:"<F>"))].join(" ")}O.Debug=E,E.defaults={print:!0,trace:!1};var T={exports:{}};Object.defineProperty(T.exports,"__esModule",{value:!0}),T.exports.EMPTY=T.exports.AFTER=T.exports.BEFORE=T.exports.CLOSE=T.exports.OPEN=T.exports.makeTextMatcher=T.exports.makeNumberMatcher=T.exports.makeCommentMatcher=T.exports.makeStringMatcher=T.exports.makeLineMatcher=T.exports.makeSpaceMatcher=T.exports.makeFixedMatcher=T.exports.makeParser=T.exports.makeLex=T.exports.makeRuleSpec=T.exports.makeRule=T.exports.makePoint=T.exports.makeToken=T.exports.make=T.exports.util=T.exports.Debug=T.exports.JsonicError=T.exports.Jsonic=void 0,Object.defineProperty(T.exports,"OPEN",{enumerable:!0,get:function(){return r.OPEN}}),Object.defineProperty(T.exports,"CLOSE",{enumerable:!0,get:function(){return r.CLOSE}}),Object.defineProperty(T.exports,"BEFORE",{enumerable:!0,get:function(){return r.BEFORE}}),Object.defineProperty(T.exports,"AFTER",{enumerable:!0,get:function(){return r.AFTER}}),Object.defineProperty(T.exports,"EMPTY",{enumerable:!0,get:function(){return r.EMPTY}});const P=t({});Object.defineProperty(T.exports,"JsonicError",{enumerable:!0,get:function(){return P.JsonicError}});const I=n({});Object.defineProperty(T.exports,"makePoint",{enumerable:!0,get:function(){return I.makePoint}}),Object.defineProperty(T.exports,"makeToken",{enumerable:!0,get:function(){return I.makeToken}}),Object.defineProperty(T.exports,"makeLex",{enumerable:!0,get:function(){return I.makeLex}}),Object.defineProperty(T.exports,"makeFixedMatcher",{enumerable:!0,get:function(){return I.makeFixedMatcher}}),Object.defineProperty(T.exports,"makeSpaceMatcher",{enumerable:!0,get:function(){return I.makeSpaceMatcher}}),Object.defineProperty(T.exports,"makeLineMatcher",{enumerable:!0,get:function(){return I.makeLineMatcher}}),Object.defineProperty(T.exports,"makeStringMatcher",{enumerable:!0,get:function(){return I.makeStringMatcher}}),Object.defineProperty(T.exports,"makeCommentMatcher",{enumerable:!0,get:function(){return I.makeCommentMatcher}}),Object.defineProperty(T.exports,"makeNumberMatcher",{enumerable:!0,get:function(){return I.makeNumberMatcher}}),Object.defineProperty(T.exports,"makeTextMatcher",{enumerable:!0,get:function(){return I.makeTextMatcher}}),Object.defineProperty(T.exports,"makeRule",{enumerable:!0,get:function(){return x.makeRule}}),Object.defineProperty(T.exports,"makeRuleSpec",{enumerable:!0,get:function(){return x.makeRuleSpec}}),Object.defineProperty(T.exports,"makeParser",{enumerable:!0,get:function(){return x.makeParser}}),Object.defineProperty(T.exports,"Debug",{enumerable:!0,get:function(){return O.Debug}});const w={tokenize:P.tokenize,srcfmt:P.srcfmt,clone:P.clone,charset:P.charset,trimstk:P.trimstk,makelog:P.makelog,badlex:P.badlex,extract:P.extract,errinject:P.errinject,errdesc:P.errdesc,configure:P.configure,parserwrap:P.parserwrap,mesc:P.mesc,escre:P.escre,regexp:P.regexp,prop:P.prop,str:P.str,clean:P.clean,deep:P.deep,omap:P.omap,keys:P.keys,values:P.values,entries:P.entries};function C(e,t){let n=!0;if("jsonic"===e)n=!1;else if("json"===e)return(0,y.makeJSON)($);e="string"==typeof e?{}:e;let r={parser:null,config:null,plugins:[],sub:{lex:void 0,rule:void 0},mark:Math.random()},l=(0,P.deep)({},t?{...t.options}:!1===(null==e?void 0:e.defaults$)?{}:i.defaults,e||{}),o=function(e,t,n){var r;if(P.S.string===typeof e){let i=o.internal();return((null===(r=s.parser)||void 0===r?void 0:r.start)?(0,P.parserwrap)(s.parser):i.parser).start(e,o,t,n)}return e},s=e=>{if(null!=e&&P.S.object===typeof e){(0,P.deep)(l,e),(0,P.configure)(o,r.config,l);let t=o.internal().parser;r.parser=t.clone(l,r.config)}return{...o.options}},a={token:e=>(0,P.tokenize)(e,r.config,o),tokenSet:e=>(0,P.findTokenSet)(e,r.config),fixed:e=>r.config.fixed.ref[e],options:(0,P.deep)(s,l),config:()=>(0,P.deep)(r.config),parse:o,use:function(e,t){const n=e.name.toLowerCase(),r=(0,P.deep)({},e.defaults||{},t||{});o.options({plugin:{[n]:r}});let i=o.options.plugin[n];return o.internal().plugins.push(e),e.options=i,e(o,i)||o},rule:(e,t)=>o.internal().parser.rule(e,t)||o,lex:e=>{let t=l.lex.match;t.unshift(e),o.options({lex:{match:t}})},make:e=>C(e,o),empty:e=>C({defaults$:!1,standard$:!1,grammar$:!1,...e||{}}),id:"Jsonic/"+Date.now()+"/"+(""+Math.random()).substring(2,8).padEnd(6,"0")+(null==s.tag?"":"/"+s.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)),o),util:w};if((0,P.defprop)(a.make,P.S.name,{value:P.S.make}),n?(0,P.assign)(o,a):(0,P.assign)(o,{empty:a.empty,parse:a.parse,sub:a.sub,id:a.id,toString:a.toString}),(0,P.defprop)(o,"internal",{value:()=>r}),t){for(let n in t)void 0===o[n]&&(o[n]=t[n]);o.parent=t;let e=t.internal();r.config=(0,P.deep)({},e.config),(0,P.configure)(o,r.config,l),(0,P.assign)(o.token,r.config.t),r.plugins=[...e.plugins],r.parser=e.parser.clone(l,r.config)}else{let e={...o,...a};r.config=(0,P.configure)(e,void 0,l),r.plugins=[],r.parser=(0,x.makeParser)(l,r.config),!1!==l.grammar$&&(0,y.grammar)(e)}return o}let $;T.exports.util=w,T.exports.make=C;let R=$=C("jsonic");return T.exports.Jsonic=R,$.Jsonic=$,$.JsonicError=P.JsonicError,$.Debug=O.Debug,$.makeLex=I.makeLex,$.makeParser=x.makeParser,$.makeToken=I.makeToken,$.makePoint=I.makePoint,$.makeRule=x.makeRule,$.makeRuleSpec=x.makeRuleSpec,$.makeFixedMatcher=I.makeFixedMatcher,$.makeSpaceMatcher=I.makeSpaceMatcher,$.makeLineMatcher=I.makeLineMatcher,$.makeStringMatcher=I.makeStringMatcher,$.makeCommentMatcher=I.makeCommentMatcher,$.makeNumberMatcher=I.makeNumberMatcher,$.makeTextMatcher=I.makeTextMatcher,$.OPEN=r.OPEN,$.CLOSE=r.CLOSE,$.BEFORE=r.BEFORE,$.AFTER=r.AFTER,$.EMPTY=r.EMPTY,$.util=w,$.make=C,T.exports.default=R,T.exports=T.exports.Jsonic,T.exports}))}).call(this)}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),t=t.exports;var n={};Object.defineProperty(n,"__esModule",{value:!0}),n.testing=n.evaluate=n.Expr=void 0;const{omap:r,entries:i,values:l}=t.util,o={};let s=function(e,t){var n;let s=(null===(n=e.options.lex)||void 0===n?void 0:n.match)||[],y=s.map(e=>e.name).indexOf("makeCommentMatcher");0<y&&e.options({lex:{match:[s[y],...s.slice(0,y),...s.slice(y+1)]}});let j=e.token.bind(e),O=e.fixed.bind(e),E=t.op||{};const S=b(j,O,E,"prefix"),N=b(j,O,E,"suffix"),M=b(j,O,E,"infix"),T=b(j,O,E,"ternary"),P=function(e,t,n){return i(n).reduce((n,[r,i])=>{if(i.paren){let l=t(i.osrc)||e("#E"+i.osrc),s=e(l),a=t(i.csrc)||e("#E"+i.csrc),u=e(a);n[l]={name:r+"-paren",osrc:i.osrc,csrc:i.csrc,otkn:s,otin:l,ctkn:u,ctin:a,preval:{active:null!=i.preval&&(null==i.preval.active||i.preval.active),required:null!=i.preval&&null!=i.preval.required&&i.preval.required},use:{},paren:!0,src:i.osrc,left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER,infix:!1,prefix:!1,suffix:!1,ternary:!1,tkn:"",tin:-1,terms:1,token:{},OP_MARK:o}}return n},{})}(j,O,E),I=r(P,([e,t])=>[void 0,void 0,t.ctin,t]);let w=Object.values({...P,...I}).reduce((e,t)=>(e[t.otkn]=t.osrc,e[t.ctkn]=t.csrc,e),{}),C=Object.values({...S,...N,...M,...T}).reduce((e,t)=>(e[t.tkn]=t.src,e),{});e.options({fixed:{token:{...C,...w}}});const $=l(S).map(e=>e.tin),R=l(M).map(e=>e.tin),A=l(N).map(e=>e.tin),V=l(T).filter(e=>0===e.use.ternary.opI).map(e=>e.tin),L=l(T).filter(e=>1===e.use.ternary.opI).map(e=>e.tin),F=l(P).map(e=>e.otin),D=l(I).map(e=>e.ctin),Y=0<$.length,B=0<R.length,U=0<A.length,J=0<V.length&&0<L.length,K=0<F.length&&0<D.length,q=e.token.CA,z=e.token.CS,G=e.token.CB,Z=e.token.TX,W=e.token.NR,X=e.token.ST,H=e.token.VL,Q=e.token.ZZ,ee=[Z,W,X,H];e.rule("val",t=>{J&&L.includes(e.token.CL)&&(t.def.open.find(e=>e.g.includes("pair")).c=e=>!e.n.expr_ternary),t.open([Y?{s:[$],b:1,n:{expr_prefix:1,expr_suffix:0},p:"expr",g:"expr,expr-prefix"}:null,K?{s:[F],b:1,p:"paren",c:(e,t)=>{let n=!0;return P[e.o0.tin].preval.required&&(n="val"===e.prev.name&&e.prev.use.paren_preval),n&&1===e.prev.i&&(t.root=()=>e),n},g:"expr,expr-paren"}:null]).close([J?{s:[V],c:e=>!e.n.expr,b:1,r:"ternary",g:"expr,expr-ternary"}:null,B?{s:[R],b:1,n:{expr_prefix:0,expr_suffix:0},r:e=>e.n.expr?"":"expr",g:"expr,expr-infix"}:null,U?{s:[A],b:1,n:{expr_prefix:0,expr_suffix:1},r:e=>e.n.expr?"":"expr",g:"expr,expr-suffix"}:null,K?{s:[D],c:e=>!!e.n.expr_paren,b:1,g:"expr,expr-paren"}:null,K?{s:[F],b:1,r:"val",c:e=>P[e.c0.tin].preval.active,u:{paren_preval:!0},g:"expr,expr-paren,expr-paren-preval"}:null,J?{s:[L],c:e=>!!e.n.expr_ternary,b:1,g:"expr,expr-ternary"}:null,{s:[q],c:e=>1===e.d&&(1<=e.n.expr||1<=e.n.expr_ternary)||1<=e.n.expr_ternary&&1<=e.n.expr_paren,b:1,g:"expr,list,val,imp,comma,top"},{s:[ee],c:e=>1===e.d&&(1<=e.n.expr||1<=e.n.expr_ternary)||1<=e.n.expr_ternary&&1<=e.n.expr_paren,b:1,g:"expr,list,val,imp,space,top"}])}),e.rule("list",e=>{e.bo(!1,e=>{e.prev.use.implist||(e.n.expr=0,e.n.expr_prefix=0,e.n.expr_suffix=0,e.n.expr_paren=0,e.n.expr_ternary=0)}).close([K&&{s:[D],b:e=>z!==e.c0.tin||e.n.expr_paren?1:0}])}),e.rule("map",e=>{e.bo(!1,(...e)=>{e[0].n.expr=0,e[0].n.expr_prefix=0,e[0].n.expr_suffix=0,e[0].n.expr_paren=0,e[0].n.expr_ternary=0}).close([K&&{s:[D],b:e=>G!==e.c0.tin||e.n.expr_paren?1:0}])}),e.rule("elem",e=>{e.close([K?{s:[D],b:1,c:e=>!!e.n.expr_paren,g:"expr,expr-paren,imp,close,list"}:null,K?{s:[F],b:1,r:"elem",g:"expr,expr-paren,imp,open,list"}:null])}),e.rule("pair",e=>{e.close([K?{s:[D],b:1,c:e=>!!e.n.expr_paren||0<e.n.pk,g:"expr,expr-paren,imp,map"}:null])}),e.rule("expr",e=>{e.open([Y?{s:[$],c:e=>!!e.n.expr_prefix,n:{expr:1,dlist:1,dmap:1},p:"val",g:"expr,expr-prefix",a:e=>{const t=u(e.o0,S);e.node=x(e.parent.node)?k(e.parent.node,t):a(e,e.parent,t)}}:null,B?{s:[R],p:"val",n:{expr:1,expr_prefix:0,dlist:1,dmap:1},a:e=>{const t=e.prev,n=e.parent,r=u(e.o0,M);x(n.node)&&!v("ternary",n.node)?e.node=k(n.node,r):x(t.node)?(e.node=k(t.node,r),e.parent=t):e.node=a(e,t,r)},g:"expr,expr-infix"}:null,U?{s:[A],n:{expr:1,expr_prefix:0,dlist:1,dmap:1},a:e=>{const t=e.prev,n=u(e.o0,N);e.node=x(t.node)?k(t.node,n):a(e,t,n)},g:"expr,expr-suffix"}:null]).bc(e=>{var t;x(e.node)&&(null===(t=e.node)||void 0===t?void 0:t.length)-1<e.node[0].terms&&e.node.push(e.child.node)}).close([B?{s:[R],c:e=>!e.n.expr_prefix,b:1,r:"expr",g:"expr,expr-infix"}:null,U?{s:[A],c:e=>!e.n.expr_prefix,b:1,r:"expr",g:"expr,expr-suffix"}:null,K?{s:[D],c:e=>!!e.n.expr_paren,b:1}:null,J?{s:[V],c:e=>!e.n.expr_prefix,b:1,r:"ternary",g:"expr,expr-ternary"}:null,{s:[q],c:{d:0},n:{expr:0},r:"elem",a:e=>e.parent.node=e.node=[e.node],g:"expr,comma,list,top"},{s:[ee],c:{d:0},n:{expr:0},b:1,r:"elem",a:e=>e.parent.node=e.node=[e.node],g:"expr,space,list,top"},{s:[q],c:{n:{pk:0}},n:{expr:0},b:1,h:h,g:"expr,list,val,imp,comma"},{c:{n:{pk:0,expr_suffix:0}},n:{expr:0},h:h,g:"expr,list,val,imp,space"},{n:{expr:0},g:"expr,expr-end"}]).ac(e=>{t.evaluate&&0===e.n.expr&&(e.parent.node=_(e.parent,e.parent.node,t.evaluate))})}),e.rule("paren",e=>{e.bo(e=>{e.n.dmap=0,e.n.dlist=0,e.n.pk=0}).open([K?{s:[F,D],b:1,g:"expr,expr-paren,empty",c:e=>P[e.o0.tin].name===I[e.o1.tin].name,a:d(P)}:null,K?{s:[F],p:"val",n:{expr_paren:1,expr:0,expr_prefix:0,expr_suffix:0},g:"expr,expr-paren,open",a:d(P)}:null]).close([K?{s:[D],c:e=>{let t="expr_paren_depth_"+I[e.c0.tin].name;return!!e.n[t]},a:f(I),g:"expr,expr-paren,close"}:null])}),J&&e.rule("ternary",e=>{e.open([{s:[V],p:"val",n:{expr_ternary:1,expr:0,expr_prefix:0,expr_suffix:0},u:{expr_ternary_step:1},g:"expr,expr-ternary,open",a:e=>{let t=u(e.o0,T);e.use.expr_ternary_name=t.name,x(e.prev.node)?e.node=c(e.prev.node,t,p(e.prev.node)):e.node=e.prev.node=c([],t,e.prev.node),e.use.expr_ternary_paren=e.n.expr_paren||e.prev.use.expr_ternary_paren||0,e.n.expr_paren=0}},{p:"val",c:e=>2===e.prev.use.expr_ternary_step,a:e=>{e.use.expr_ternary_step=e.prev.use.expr_ternary_step,e.n.expr_paren=e.use.expr_ternary_paren=e.prev.use.expr_ternary_paren},g:"expr,expr-ternary,step"}]).close([{s:[L],c:e=>1===e.use.expr_ternary_step&&e.use.expr_ternary_name===T[e.c0.tin].name,r:"ternary",a:e=>{e.use.expr_ternary_step++,e.node.push(e.child.node)},g:"expr,expr-ternary,step"},{s:[[q,...D]],c:m,b:(e,t)=>D.includes(t.t0.tin)?1:0,r:(e,t)=>{var n;return D.includes(t.t0.tin)||0!==e.d&&(!e.prev.use.expr_ternary_paren||(null===(n=e.parent.node)||void 0===n?void 0:n.length))?"":"elem"},a:g,g:"expr,expr-ternary,list,val,imp,comma"},{c:m,r:(e,t)=>{var n;return 0!==e.d&&D.includes(t.t0.tin)&&!e.prev.use.expr_ternary_paren||(null===(n=e.parent.node)||void 0===n?void 0:n.length)||Q===t.t0.tin?"":"elem"},a:g,g:"expr,expr-ternary,list,val,imp,space"},{c:e=>0<e.d&&2===e.use.expr_ternary_step,a:e=>{e.node.push(e.child.node)},g:"expr,expr-ternary,close"}])})};function a(e,t,n){let r=t.node;return x(t.node)?r=p(t.node):t.node=[],c(t.node,n),n.prefix||(t.node[1]=r),e.parent=t,t.node}function u(e,t){return{...t[e.tin],token:e,OP_MARK:o}}function c(e,t,...n){let r=e;r[0]=t;let i=0;for(;i<n.length;i++)r[i+1]=n[i];return r.length=i+1,r}function p(e){return[...e]}function d(e){return function(t){let n="expr_paren_depth_"+u(t.o0,e).name;t.use[n]=t.n[n]=1,t.node=void 0}}function f(e){return function(t){(x(t.child.node)||void 0===t.node)&&(t.node=t.child.node);const n=u(t.c0,e);let r="expr_paren_depth_"+n.name;if(t.use[r]===t.n[r]){const e=t.node;t.node=[n],void 0!==e&&(t.node[1]=e),t.parent.prev.use.paren_preval&&(v("paren",t.parent.prev.node)?t.node=c(t.parent.prev.node,t.node[0],p(t.parent.prev.node),t.node[1]):(t.node.splice(1,0,t.parent.prev.node),t.parent.prev.node=t.node))}}}function h(e,t,n){let r=null;for(let i=t.rsI-1;-1<i;i--)if("paren"===t.rs[i].name){r=t.rs[i];break}return r&&(null==r.child.node?(r.child.node=[e.node],n.r="elem",n.b=0):x(r.child.node)&&(r.child.node=[r.child.node],n.r="elem",n.b=0),e.node=r.child.node),n}function m(e){return(0===e.d||1<=e.n.expr_paren)&&!e.n.pk&&2===e.use.expr_ternary_step}function g(e,t,n){e.n.expr_paren=e.prev.use.expr_ternary_paren,e.node.push(e.child.node),"elem"===n.r&&(e.node[0]=p(e.node),e.node.length=1)}function v(e,t){return null!=t&&x(t)&&!0===t[0][e]}function x(e){return null!=e&&e[0]&&e[0].OP_MARK===o}function b(e,t,n,r){return Object.entries(n).filter(([e,t])=>t[r]).reduce((n,[i,l])=>{let s="",a=-1,u="";u="string"==typeof l.src?l.src:l.src[0],a=t(u)||e("#E"+u),s=e(a);let c=n[a]={src:u,left:l.left||Number.MIN_SAFE_INTEGER,right:l.right||Number.MAX_SAFE_INTEGER,name:i+(i.endsWith("-"+r)?"":"-"+r),infix:"infix"===r,prefix:"prefix"===r,suffix:"suffix"===r,ternary:"ternary"===r,tkn:s,tin:a,terms:"ternary"===r?3:"infix"===r?2:1,use:{},paren:!1,osrc:"",csrc:"",otkn:"",ctkn:"",otin:-1,ctin:-1,preval:{active:!1,required:!1},token:{},OP_MARK:o};if(c.ternary){let r=l.src;c.src=r[0],c.use.ternary={opI:0};let i={...c};u=l.src[1],a=t(u)||e("#E"+u),s=e(a),i.src=u,i.use={ternary:{opI:1}},i.tkn=s,i.tin=a,n[a]=i}return n},{})}function k(e,t){let n=e,r=e[0];if(t)if(t.infix)if(r.suffix||t.left<=r.right)c(e,t,p(e));else{const i=r.terms;n=x(e[i])&&e[i][0].right<t.left?k(e[i],t):e[i]=c([],t,e[i])}else if(t.prefix)n=e[r.terms]=c([],t);else if(t.suffix)if(!r.suffix&&r.right<=t.left){const n=r.terms;x(e[n])&&e[n][0].prefix&&e[n][0].right<t.left?k(e[n],t):e[n]=c([],t,e[n])}else c(e,t,p(e));return n}function _(e,t,n){return null==t?t:x(t)?n(e,t[0],t.slice(1).map(t=>_(e,t,n))):t}n.Expr=s,s.defaults={op:{positive:{prefix:!0,right:14e3,src:"+"},negative:{prefix:!0,right:14e3,src:"-"},addition:{infix:!0,left:140,right:150,src:"+"},subtraction:{infix:!0,left:140,right:150,src:"-"},multiplication:{infix:!0,left:160,right:170,src:"*"},division:{infix:!0,left:160,right:170,src:"/"},remainder:{infix:!0,left:160,right:170,src:"%"},plain:{paren:!0,osrc:"(",csrc:")"}}},n.evaluate=_;const y={prattify:k,opify:e=>(e.OP_MARK=o,e)};return n.testing=y,n}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$exprMin_18=_$exprMin_18.exports;var _$pathMin_25={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$pathMin_25.exports?_$pathMin_25.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).JsonicPath=t()}((function(){var e={};Object.defineProperty(e,"__esModule",{value:!0}),e.Path=void 0;const t=(e,t)=>{e.rule("val",e=>{e.bo(e=>{0===e.d&&(e.keep.path=[])})}),e.rule("map",e=>{e.bo(e=>{delete e.keep.index})}),e.rule("pair",e=>{e.ao(e=>{0<e.d&&e.use.pair&&(e.child.keep.path=[...e.keep.path,e.use.key],e.child.keep.key=e.use.key)})}),e.rule("list",e=>{e.bo(e=>{e.keep.index=-1})}),e.rule("elem",e=>{e.ao(e=>{0<e.d&&(e.keep.index=1+e.keep.index,e.child.keep.path=[...e.keep.path,e.keep.index],e.child.keep.key=e.keep.index,e.child.keep.index=e.keep.index)})})};return e.Path=t,t.defaults={},e}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$pathMin_25=_$pathMin_25.exports;var _$aontu_1={};Object.defineProperty(_$aontu_1,"__esModule",{value:!0}),_$aontu_1.util=_$aontu_1.Lang=_$aontu_1.Nil=_$aontu_1.Aontu=void 0;const __lang_1_1=_$lang_2({});Object.defineProperty(_$aontu_1,"Lang",{enumerable:!0,get:function(){return __lang_1_1.Lang}});const __unify_1_1=_$unify_7({}),__Nil_1_1=_$Nil_13({});function Aontu(e,t){let n=util.options(e,t),r={},i=new __lang_1_1.Lang(n).parse(n.src,{deps:r}),l=new __unify_1_1.Unify(i),o=l.res,s=l.err;return o.deps=r,o.err=s,o}Object.defineProperty(_$aontu_1,"Nil",{enumerable:!0,get:function(){return __Nil_1_1.Nil}}),_$aontu_1.Aontu=Aontu;const util={options:(e,t)=>{let n="string"==typeof e?{src:e}:e;return{src:"",print:0,resolver:__lang_1_1.includeFileResolver,...n,...t||{}}}};return _$aontu_1.util=util,_$aontu_1.default=Aontu,_$aontu_1}));
|
package/dist/lib/lang.js
CHANGED
|
@@ -65,7 +65,16 @@ let AontuJsonic = function aontu(jsonic) {
|
|
|
65
65
|
merge: (prev, curr) => {
|
|
66
66
|
let pval = prev;
|
|
67
67
|
let cval = curr;
|
|
68
|
-
|
|
68
|
+
if ((pval === null || pval === void 0 ? void 0 : pval.isVal) && (cval === null || cval === void 0 ? void 0 : cval.isVal)) {
|
|
69
|
+
return addpath(new ConjunctVal_1.ConjunctVal([pval, cval]), prev.path);
|
|
70
|
+
}
|
|
71
|
+
// Handle defered conjuncts, where MapVal does not yet
|
|
72
|
+
// exist, by creating ConjunctVal later.
|
|
73
|
+
else {
|
|
74
|
+
prev.___merge = (prev.___merge || []);
|
|
75
|
+
prev.___merge.push(curr);
|
|
76
|
+
return prev;
|
|
77
|
+
}
|
|
69
78
|
}
|
|
70
79
|
}
|
|
71
80
|
});
|
|
@@ -152,8 +161,17 @@ let AontuJsonic = function aontu(jsonic) {
|
|
|
152
161
|
rs
|
|
153
162
|
.open([{ s: [CJ, CL], p: 'pair', b: 2, g: 'spread' }])
|
|
154
163
|
.bc((r) => {
|
|
155
|
-
|
|
156
|
-
|
|
164
|
+
let mo = r.node;
|
|
165
|
+
// Handle defered conjuncts, e.g. `{x:1 @"foo"}`
|
|
166
|
+
if (mo.___merge) {
|
|
167
|
+
let mop = { ...mo };
|
|
168
|
+
delete mop.___merge;
|
|
169
|
+
let mopv = new MapVal_1.MapVal(mop);
|
|
170
|
+
r.node = addpath(new ConjunctVal_1.ConjunctVal([mopv, ...mo.___merge]), r.keep.path);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
r.node = addpath(new MapVal_1.MapVal(mo), r.keep.path);
|
|
174
|
+
}
|
|
157
175
|
// return out
|
|
158
176
|
return undefined;
|
|
159
177
|
});
|
|
@@ -211,6 +229,7 @@ class Lang {
|
|
|
211
229
|
};
|
|
212
230
|
this.options = Object.assign({}, this.options, options);
|
|
213
231
|
this.jsonic = jsonic_next_1.Jsonic.make()
|
|
232
|
+
// .use(Debug, { trace: true })
|
|
214
233
|
.use(AontuJsonic)
|
|
215
234
|
.use(multisource_1.MultiSource, {
|
|
216
235
|
resolver: (options === null || options === void 0 ? void 0 : options.resolver) || includeFileResolver
|
package/dist/lib/lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lang.js","sourceRoot":"","sources":["../../lib/lang.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAEzD,
|
|
1
|
+
{"version":3,"file":"lang.js","sourceRoot":"","sources":["../../lib/lang.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAEzD,qDAO4B;AAE5B,qDAE4B;AAE5B,iEAE+C;AAE/C,uCAGqB;AAErB,uCAEqB;AAQrB,iCAEe;AAEf,mDAA+C;AAC/C,mDAA+C;AAC/C,yCAAqC;AACrC,2CAAuC;AACvC,2CAAuC;AACvC,yCAAqC;AACrC,mCAA+B;AAG/B,+BAOc;AAId,0BAA0B;AAE1B,MAAM,IAAI;IAKR,8BAA8B;IAE9B,YAAY,GAAQ;QANpB,QAAG,GAAW,CAAC,CAAC,CAAA;QAChB,QAAG,GAAW,CAAC,CAAC,CAAA;QAChB,QAAG,GAAW,EAAE,CAAA;QAKd,iEAAiE;QACjE,gCAAgC;QAChC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAA;QAClB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAA;QAClB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAA;IACpB,CAAC;CAGF;AAmTC,oBAAI;AAhTN,IAAI,WAAW,GAAW,SAAS,KAAK,CAAC,MAAc;IAErD,MAAM,CAAC,GAAG,CAAC,WAAI,CAAC,CAAA;IAEhB,iCAAiC;IACjC,IAAI,OAAO,GAAG,CAAC,CAAM,EAAE,CAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAGnE,MAAM,CAAC,OAAO,CAAC;QACb,KAAK,EAAE;YACL,GAAG,EAAE;gBACH,mDAAmD;gBACnD,sDAAsD;gBACtD,0BAA0B;gBAC1B,yDAAyD;gBACzD,QAAQ,EAAE;oBACR,GAAG,EAAE,CAAC,CAAO,EAAE,EAAE,CACf,OAAO,CAAC,IAAI,mBAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBAClD;gBACD,QAAQ,EAAE;oBACR,GAAG,EAAE,CAAC,CAAO,EAAE,EAAE,CACf,OAAO,CAAC,IAAI,mBAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBAClD;gBACD,SAAS,EAAE;oBACT,GAAG,EAAE,CAAC,CAAO,EAAE,EAAE,CACf,OAAO,CAAC,IAAI,mBAAa,CAAC,aAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBACnD;gBACD,SAAS,EAAE;oBACT,GAAG,EAAE,CAAC,CAAO,EAAE,EAAE,CACf,OAAO,CAAC,IAAI,mBAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBACnD;gBACD,KAAK,EAAE;oBACL,GAAG,EAAE,CAAC,CAAO,EAAE,EAAE,CACf,OAAO,CAAC,IAAI,SAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBAC3C;gBAED,8CAA8C;gBAC9C,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,UAAG,EAAE;aAC1B;SACF;QAED,GAAG,EAAE;YACH,KAAK,EAAE,CAAC,IAAS,EAAE,IAAS,EAAE,EAAE;gBAC9B,IAAI,IAAI,GAAI,IAAY,CAAA;gBACxB,IAAI,IAAI,GAAI,IAAY,CAAA;gBAExB,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,MAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAA,EAAE;oBAC9B,OAAO,OAAO,CAAC,IAAI,yBAAW,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;iBACzD;gBAED,sDAAsD;gBACtD,wCAAwC;qBACnC;oBACH,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAA;oBACrC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;oBACxB,OAAO,IAAI,CAAA;iBACZ;YACH,CAAC;SACF;KACF,CAAC,CAAA;IAGF,IAAI,KAAK,GAAQ;QACf,gBAAgB,EAAE,CAAC,CAAO,EAAE,GAAO,EAAE,KAAU,EAAE,EAAE,CACjD,OAAO,CAAC,IAAI,yBAAW,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9C,gBAAgB,EAAE,CAAC,CAAO,EAAE,GAAO,EAAE,KAAU,EAAE,EAAE,CACjD,OAAO,CAAC,IAAI,yBAAW,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAE9C,YAAY,EAAE,CAAC,CAAO,EAAE,GAAO,EAAE,KAAU,EAAE,EAAE,CAC7C,OAAO,CAAC,IAAI,eAAM,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC/C,WAAW,EAAE,CAAC,CAAO,EAAE,GAAO,EAAE,KAAU,EAAE,EAAE,CAC5C,OAAO,CAAC,IAAI,eAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAEzC,aAAa,EAAE,CAAC,CAAO,EAAE,GAAO,EAAE,KAAU,EAAE,EAAE,CAC9C,OAAO,CAAC,IAAI,iBAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;KAC9C,CAAA;IAGD,MAAM;SACH,GAAG,CAAC,WAAI,EAAE;QACT,EAAE,EAAE;YACF,4CAA4C;YAC5C,UAAU,EAAE;gBACV,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;aACjD;YACD,UAAU,EAAE;gBACV,mDAAmD;gBACnD,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;aACjD;YAED,WAAW,EAAE;gBACX,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,QAAU;gBAChB,KAAK,EAAE,QAAU;aAClB;YACD,YAAY,EAAE;gBACZ,GAAG,EAAE,GAAG;gBACR,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,QAAU;aAClB;YAED,MAAM,EAAE;gBACN,GAAG,EAAE,GAAG;gBACR,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,QAAU;aAClB;SACF;QACD,QAAQ,EAAE,CAAC,CAAO,EAAE,EAAM,EAAE,KAAU,EAAE,EAAE;YACxC,8CAA8C;YAC9C,IAAI,GAAG,GAAQ,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;YAC3C,oCAAoC;YAEpC,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAC,CAAA;IAGJ,IAAI,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAC5B,IAAI,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAA;IAGxB,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAY,EAAE,EAAE;QAElC,EAAE;aACC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;aAEpD,EAAE,CAAC,CAAC,CAAO,EAAE,GAAY,EAAE,EAAE;YAE5B,IAAI,OAAO,GAAQ,CAAC,CAAC,IAAI,CAAA;YACzB,IAAI,OAAO,GAAG,OAAO,OAAO,CAAA;YAE5B,kDAAkD;YAElD,IAAI,QAAQ,KAAK,OAAO,EAAE;gBACxB,OAAO,GAAG,OAAO,CAAC,IAAI,eAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aACtD;iBACI,IAAI,QAAQ,KAAK,OAAO,EAAE;gBAC7B,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;oBAC5B,OAAO,GAAG,OAAO,CAAC,IAAI,gBAAU,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;iBACvD;qBACI;oBACH,OAAO,GAAG,OAAO,CAAC,IAAI,eAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;iBACtD;aACF;iBACI,IAAI,SAAS,KAAK,OAAO,EAAE;gBAC9B,OAAO,GAAG,OAAO,CAAC,IAAI,gBAAU,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aACvD;YAED,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,CAAA;YACb,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAA;YACnB,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAA;YAEnB,gDAAgD;YAChD,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;YAE/D,CAAC,CAAC,IAAI,GAAG,OAAO,CAAA;YAEhB,aAAa;YACb,OAAO,SAAS,CAAA;QAClB,CAAC,CAAC,CAAA;QAEJ,OAAO,EAAE,CAAA;IACX,CAAC,CAAC,CAAA;IAIF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAY,EAAE,EAAE;QAClC,0BAA0B;QAC1B,mDAAmD;QACnD,kEAAkE;QAClE,EAAE;aACC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;aAErD,EAAE,CAAC,CAAC,CAAO,EAAE,EAAE;YAEd,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,CAAA;YAEf,iDAAiD;YACjD,IAAI,EAAE,CAAC,QAAQ,EAAE;gBACf,IAAI,GAAG,GAAG,EAAE,GAAG,EAAE,EAAE,CAAA;gBACnB,OAAO,GAAG,CAAC,QAAQ,CAAA;gBACnB,IAAI,IAAI,GAAG,IAAI,eAAM,CAAC,GAAG,CAAC,CAAA;gBAC1B,CAAC,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,yBAAW,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aACvE;iBACI;gBACH,CAAC,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,eAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aAC9C;YAED,aAAa;YACb,OAAO,SAAS,CAAA;QAClB,CAAC,CAAC,CAAA;QAEJ,OAAO,EAAE,CAAA;IACX,CAAC,CAAC,CAAA;IAGF,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAY,EAAE,EAAE;QACnC,0BAA0B;QAC1B,mDAAmD;QACnD,kEAAkE;QAElE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAO,EAAE,EAAE;YAChB,CAAC,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,iBAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAElD,aAAa;YACb,OAAO,SAAS,CAAA;QAClB,CAAC,CAAC,CAAA;QAEF,OAAO,EAAE,CAAA;IACX,CAAC,CAAC,CAAA;IAIF,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAY,EAAE,EAAE;QACnC,EAAE;aACC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;aAEnE,EAAE,CAAC,CAAC,IAAU,EAAE,EAAE;YACjB,+BAA+B;YAE/B,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;gBACnB,IAAI,CAAC,IAAI,CAAC,eAAM,CAAC,MAAM,CAAC;oBACtB,CAAC,IAAI,CAAC,IAAI,CAAC,eAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;gBACzD,IAAI,CAAC,IAAI,CAAC,eAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;aACjD;YAED,OAAO,SAAS,CAAA;QAClB,CAAC,CAAC,CAAA;QAEJ,OAAO,EAAE,CAAA;IACX,CAAC,CAAC,CAAA;IAGF,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAY,EAAE,EAAE;QACnC,EAAE;aACC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;aAEnE,EAAE,CAAC,CAAC,IAAU,EAAE,EAAE;YACjB,+BAA+B;YAE/B,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;gBACnB,IAAI,CAAC,IAAI,CAAC,iBAAO,CAAC,MAAM,CAAC;oBACvB,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;gBAC1D,IAAI,CAAC,IAAI,CAAC,iBAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;aAClD;YAED,OAAO,SAAS,CAAA;QAClB,CAAC,CAAC,CAAA;QAEJ,OAAO,EAAE,CAAA;IACX,CAAC,CAAC,CAAA;AAEJ,CAAC,CAAA;AAGD,MAAM,mBAAmB,GAAG,IAAA,uBAAgB,EAAC,CAAC,IAAS,EAAE,EAAE;IACzD,OAAO,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,CAAA;AACpD,CAAC,CAAC,CAAA;AA+CA,kDAAmB;AA5CrB,MAAM,IAAI;IAOR,YAAY,OAA0B;QALtC,YAAO,GAAY;YACjB,GAAG,EAAE,EAAE;YACP,KAAK,EAAE,CAAC,CAAC;SACV,CAAA;QAGC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvD,IAAI,CAAC,MAAM,GAAG,oBAAM,CAAC,IAAI,EAAE;YACzB,+BAA+B;aAC9B,GAAG,CAAC,WAAW,CAAC;aAChB,GAAG,CAAC,yBAAW,EAAE;YAChB,QAAQ,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,KAAI,mBAAmB;SACnD,CAAC,CAAA;IACN,CAAC;IAED,KAAK,CAAC,GAAW,EAAE,IAAU;QAE3B,6BAA6B;QAC7B,IAAI,EAAE,GAAQ;YACZ,WAAW,EAAE;gBACX,mDAAmD;gBACnD,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;gBACvB,IAAI,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS;aACvC;SACF,CAAA;QAED,sCAAsC;QACtC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAC1D,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;SAClB;QAED,cAAc;QAEd,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAE9B,OAAO,GAAG,CAAA;IACZ,CAAC;CACF;AAGC,oBAAI"}
|
package/dist/lib/op/op.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { Context } from '../unify';
|
|
|
2
2
|
import { Val } from '../type';
|
|
3
3
|
import { disjunct } from './disjunct';
|
|
4
4
|
import { unite } from './unite';
|
|
5
|
-
|
|
5
|
+
type Operation = (ctx: Context, a?: Val, b?: Val, whence?: string) => Val;
|
|
6
6
|
export { Operation, disjunct, unite, };
|
package/dist/lib/type.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Resolver } from '@jsonic/multisource';
|
|
2
2
|
import { Context } from './unify';
|
|
3
3
|
import { Site } from './lang';
|
|
4
|
-
|
|
4
|
+
type Options = {
|
|
5
5
|
src: string;
|
|
6
6
|
print: number;
|
|
7
7
|
resolver?: Resolver;
|
|
8
8
|
base?: string;
|
|
9
9
|
};
|
|
10
10
|
interface Val {
|
|
11
|
+
isVal: boolean;
|
|
11
12
|
id: number;
|
|
12
13
|
done: number;
|
|
13
14
|
path: string[];
|
|
@@ -24,10 +25,10 @@ interface Val {
|
|
|
24
25
|
get canon(): string;
|
|
25
26
|
gen(ctx?: Context): any;
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
+
type ValMap = {
|
|
28
29
|
[key: string]: Val;
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
+
type ValList = Val[];
|
|
31
32
|
declare const DONE = -1;
|
|
32
33
|
declare const TOP: Val;
|
|
33
34
|
export type { Val, ValMap, ValList, Options, };
|
package/dist/lib/type.js
CHANGED
package/dist/lib/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../lib/type.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AASpD,iCAEe;
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../lib/type.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AASpD,iCAEe;AAgDf,MAAM,IAAI,GAAG,CAAC,CAAC,CAAA;AA4Cb,oBAAI;AAzCN,yBAAyB;AACzB,MAAM,GAAG,GAAQ;IACf,KAAK,EAAE,IAAI;IAEX,EAAE,EAAE,CAAC;IACL,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,EAAE;IACR,GAAG,EAAE,CAAC,CAAC;IACP,GAAG,EAAE,CAAC,CAAC;IACP,GAAG,EAAE,EAAE;IAEP,KAAK,CAAC,IAAS,EAAE,IAAa;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,KAAK,KAAK,OAAO,KAAK,CAAA,CAAC,CAAC;IAE5B,IAAI,IAAI,KAAK,OAAO,IAAI,WAAI,CAAC,IAAI,CAAC,CAAA,CAAC,CAAC;IAEpC,IAAI,CAAC,IAAS;QACZ,OAAO,GAAG,KAAK,IAAI,CAAA;IACrB,CAAC;IAED,GAAG,EAAE,CAAC,IAAc,EAAE,EAAE;QACtB,OAAO,SAAS,CAAA;IAClB,CAAC;CAEF,CAAA;AAaC,kBAAG"}
|
package/dist/lib/unify.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Lang } from './lang';
|
|
|
3
3
|
import { MapVal } from '../lib/val/MapVal';
|
|
4
4
|
import { RefVal } from '../lib/val/RefVal';
|
|
5
5
|
import { Nil } from '../lib/val/Nil';
|
|
6
|
-
|
|
6
|
+
type Path = string[];
|
|
7
7
|
declare class Context {
|
|
8
8
|
root: Val;
|
|
9
9
|
path: Path;
|
|
@@ -2,6 +2,7 @@ import type { Val } from '../type';
|
|
|
2
2
|
import { Context } from '../unify';
|
|
3
3
|
import { Site } from '../lang';
|
|
4
4
|
declare abstract class ValBase implements Val {
|
|
5
|
+
isVal: boolean;
|
|
5
6
|
id: number;
|
|
6
7
|
done: number;
|
|
7
8
|
path: string[];
|
|
@@ -11,7 +12,6 @@ declare abstract class ValBase implements Val {
|
|
|
11
12
|
top?: boolean;
|
|
12
13
|
peg?: any;
|
|
13
14
|
err?: any[];
|
|
14
|
-
deps?: any;
|
|
15
15
|
constructor(peg?: any, ctx?: Context);
|
|
16
16
|
same(peer: Val): boolean;
|
|
17
17
|
get site(): Site;
|
package/dist/lib/val/ValBase.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValBase.js","sourceRoot":"","sources":["../../../lib/val/ValBase.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAkBzD,kCAEgB;AAWhB,MAAe,OAAO;IAiBpB,YAAY,GAAS,EAAE,GAAa;
|
|
1
|
+
{"version":3,"file":"ValBase.js","sourceRoot":"","sources":["../../../lib/val/ValBase.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAkBzD,kCAEgB;AAWhB,MAAe,OAAO;IAiBpB,aAAa;IAEb,YAAY,GAAS,EAAE,GAAa;QAlBpC,UAAK,GAAG,IAAI,CAAA;QAGZ,SAAI,GAAW,CAAC,CAAA;QAEhB,QAAG,GAAW,CAAC,CAAC,CAAA;QAChB,QAAG,GAAW,CAAC,CAAC,CAAA;QAChB,QAAG,GAAW,EAAE,CAAA;QAYd,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;QACnC,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC1E,CAAC;IAED,IAAI,CAAC,IAAS;QACZ,uBAAuB;QACvB,OAAO,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAA;IACnD,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,WAAI,CAAC,IAAI,CAAC,CAAA;IACvB,CAAC;CAOF;AAMC,0BAAO"}
|
package/dist/lib/val.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Context } from './unify';
|
|
|
3
3
|
import { ValBase } from './val/ValBase';
|
|
4
4
|
declare class Integer {
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
type ScalarConstructor = StringConstructor | NumberConstructor | BooleanConstructor | (typeof Integer.constructor);
|
|
7
7
|
declare class ScalarTypeVal extends ValBase {
|
|
8
8
|
constructor(peg: ScalarConstructor, ctx?: Context);
|
|
9
9
|
unify(peer: Val, ctx: Context): Val;
|
package/lib/lang.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Rule,
|
|
7
7
|
RuleSpec,
|
|
8
8
|
Context,
|
|
9
|
+
Debug,
|
|
9
10
|
} from '@jsonic/jsonic-next'
|
|
10
11
|
|
|
11
12
|
import {
|
|
@@ -121,7 +122,18 @@ let AontuJsonic: Plugin = function aontu(jsonic: Jsonic) {
|
|
|
121
122
|
merge: (prev: any, curr: any) => {
|
|
122
123
|
let pval = (prev as Val)
|
|
123
124
|
let cval = (curr as Val)
|
|
124
|
-
|
|
125
|
+
|
|
126
|
+
if (pval?.isVal && cval?.isVal) {
|
|
127
|
+
return addpath(new ConjunctVal([pval, cval]), prev.path)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Handle defered conjuncts, where MapVal does not yet
|
|
131
|
+
// exist, by creating ConjunctVal later.
|
|
132
|
+
else {
|
|
133
|
+
prev.___merge = (prev.___merge || [])
|
|
134
|
+
prev.___merge.push(curr)
|
|
135
|
+
return prev
|
|
136
|
+
}
|
|
125
137
|
}
|
|
126
138
|
}
|
|
127
139
|
})
|
|
@@ -241,8 +253,18 @@ let AontuJsonic: Plugin = function aontu(jsonic: Jsonic) {
|
|
|
241
253
|
|
|
242
254
|
.bc((r: Rule) => {
|
|
243
255
|
|
|
244
|
-
|
|
245
|
-
|
|
256
|
+
let mo = r.node
|
|
257
|
+
|
|
258
|
+
// Handle defered conjuncts, e.g. `{x:1 @"foo"}`
|
|
259
|
+
if (mo.___merge) {
|
|
260
|
+
let mop = { ...mo }
|
|
261
|
+
delete mop.___merge
|
|
262
|
+
let mopv = new MapVal(mop)
|
|
263
|
+
r.node = addpath(new ConjunctVal([mopv, ...mo.___merge]), r.keep.path)
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
r.node = addpath(new MapVal(mo), r.keep.path)
|
|
267
|
+
}
|
|
246
268
|
|
|
247
269
|
// return out
|
|
248
270
|
return undefined
|
|
@@ -326,6 +348,7 @@ class Lang {
|
|
|
326
348
|
constructor(options?: Partial<Options>) {
|
|
327
349
|
this.options = Object.assign({}, this.options, options)
|
|
328
350
|
this.jsonic = Jsonic.make()
|
|
351
|
+
// .use(Debug, { trace: true })
|
|
329
352
|
.use(AontuJsonic)
|
|
330
353
|
.use(MultiSource, {
|
|
331
354
|
resolver: options?.resolver || includeFileResolver
|
package/lib/type.ts
CHANGED
|
@@ -24,6 +24,8 @@ type Options = {
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
interface Val {
|
|
27
|
+
isVal: boolean
|
|
28
|
+
|
|
27
29
|
id: number
|
|
28
30
|
done: number
|
|
29
31
|
path: string[]
|
|
@@ -60,6 +62,8 @@ const DONE = -1
|
|
|
60
62
|
|
|
61
63
|
// There can be only one.
|
|
62
64
|
const TOP: Val = {
|
|
65
|
+
isVal: true,
|
|
66
|
+
|
|
63
67
|
id: 0,
|
|
64
68
|
top: true,
|
|
65
69
|
peg: undefined,
|
package/lib/val/ValBase.ts
CHANGED
|
@@ -30,6 +30,8 @@ import {
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
abstract class ValBase implements Val {
|
|
33
|
+
isVal = true
|
|
34
|
+
|
|
33
35
|
id: number
|
|
34
36
|
done: number = 0
|
|
35
37
|
path: string[]
|
|
@@ -44,7 +46,7 @@ abstract class ValBase implements Val {
|
|
|
44
46
|
|
|
45
47
|
// TODO: used for top level result - not great
|
|
46
48
|
err?: any[]
|
|
47
|
-
deps?: any
|
|
49
|
+
// deps?: any
|
|
48
50
|
|
|
49
51
|
constructor(peg?: any, ctx?: Context) {
|
|
50
52
|
this.peg = peg
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aontu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"main": "dist/aontu.js",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"browser": "dist/aontu.min.js",
|
|
@@ -43,23 +43,22 @@
|
|
|
43
43
|
"LICENSE"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@jsonic/directive": "^0.
|
|
47
|
-
"@jsonic/expr": "^0.
|
|
48
|
-
"@jsonic/jsonic-next": "^2.
|
|
49
|
-
"@jsonic/multisource": "^0.
|
|
50
|
-
"@jsonic/path": "^0.
|
|
46
|
+
"@jsonic/directive": "^0.9.0",
|
|
47
|
+
"@jsonic/expr": "^0.6.0",
|
|
48
|
+
"@jsonic/jsonic-next": "^2.5.4",
|
|
49
|
+
"@jsonic/multisource": "^0.8.0",
|
|
50
|
+
"@jsonic/path": "^0.4.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@types/jest": "^29.
|
|
53
|
+
"@types/jest": "^29.2.4",
|
|
54
54
|
"browserify": "^17.0.0",
|
|
55
|
-
"esbuild": "^0.
|
|
56
|
-
"
|
|
57
|
-
"jest": "^29.
|
|
58
|
-
"prettier": "^2.
|
|
59
|
-
"serve": "^14.
|
|
60
|
-
"tinyify": "^
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"@types/node": "^18.7.16"
|
|
55
|
+
"esbuild": "^0.16.12",
|
|
56
|
+
"es-jest": "^2.1.0",
|
|
57
|
+
"jest": "^29.3.1",
|
|
58
|
+
"prettier": "^2.8.1",
|
|
59
|
+
"serve": "^14.1.2",
|
|
60
|
+
"tinyify": "^4.0.0",
|
|
61
|
+
"typescript": "^4.9.4",
|
|
62
|
+
"@types/node": "^18.11.18"
|
|
64
63
|
}
|
|
65
64
|
}
|