UNPKG

@webqit/quantum-js

Version:

Runtime extension to JavaScript that let's us do Imperative Reactive Programming (IRP) in the very language.

3 lines 195 kB
(()=>{var ni=Object.defineProperty;var hr=(t,e,i)=>e in t?ni(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var be=(t,e)=>{for(var i in e)ni(t,i,{get:e[i],enumerable:!0})};var X=(t,e,i)=>(hr(t,typeof e!="symbol"?e+"":e,i),i);var si={};be(si,{AsyncQuantumFunction:()=>lr,AsyncQuantumScript:()=>Vt,Observer:()=>P,QuantumAsyncFunction:()=>ks,QuantumAsyncScript:()=>Cs,QuantumFunction:()=>_s,QuantumModule:()=>ee,QuantumScript:()=>te,State:()=>Et});var De={};be(De,{any:()=>Tr,apply:()=>Oe,batch:()=>$e,construct:()=>Te,defineProperties:()=>Vr,defineProperty:()=>Mt,deleteProperties:()=>Rr,deleteProperty:()=>Bt,get:()=>st,getOwnPropertyDescriptor:()=>oe,getOwnPropertyDescriptors:()=>Lr,getPrototypeOf:()=>Ae,has:()=>ue,intercept:()=>Or,isExtensible:()=>Ie,map:()=>Fr,observe:()=>Re,ownKeys:()=>Ne,path:()=>Ir,preventExtensions:()=>Fe,reduce:()=>Ve,set:()=>yt,setPrototypeOf:()=>Le,subtree:()=>Nr});function R(t){return!Array.isArray(t)&&typeof t=="object"&&t}function Ct(t){return typeof t}function W(t){return Array.isArray(t)}function Pt(t){return typeof t=="function"}function we(t){return t===null||t===""}function mt(t){return arguments.length&&(t===void 0||typeof t>"u")}function V(t){return Array.isArray(t)||typeof t=="object"&&t||Pt(t)}function ve(t){return we(t)||mt(t)||t===!1||t===0||V(t)&&!Object.keys(t).length}function et(t){return Pt(t)||t&&{}.toString.call(t)==="[object function]"}function re(t){return t instanceof String||typeof t=="string"&&t!==null}function Se(t){return!re(t)&&!mt(t.length)}function ne(t,...e){if(!t||!["object","function"].includes(typeof t))throw new Error("Argument #1 must be of type object");let i=t[Symbol.for("wq")];if(i||(i=new se,Object.defineProperty(t,Symbol.for("wq"),{value:i,enumerable:!1,configurable:!1,writable:!1})),!e.length)return i;let r,s;for(;r=e.shift();)(s=i)&&!(i=i.get(r))&&(i=new se,s.set(r,i));return i}var se=class extends Map{};function lt(t,e=!0){return W(t)?t:!e&&R(t)?[t]:t!==!1&&t!==0&&ve(t)?[]:Se(t)?Array.prototype.slice.call(t):R(t)?Object.values(t):[t]}var N=(t,...e)=>ne(t,"observerAPI",...e),At=(t,e)=>t instanceof Promise?t.then(e):e(t),ae={};var dt=class{constructor(e,i){this.registry=e,Object.assign(this,{...i,target:e.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var Rt=class extends dt{constructor(){super(...arguments),this.emit.currentRegistration=this,Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal}),ae.setMaxListeners?.(0,this.signal)}remove(){this.abortController.abort(),super.remove()}fire(e){if(this.emit.recursionTarget&&!["inject","force-async","force-sync"].includes(this.params.recursions))return;let i=e,r=this.filter;if(r!==1/0&&(r=lt(r,!1))&&(i=e.filter(n=>r.includes(n.key))),this.params.diff&&(i=i.filter(n=>n.type!=="set"||n.value!==n.oldValue)),!i.length)return;if(["inject","defer"].includes(this.params.recursions)){if(this.emit.recursionTarget){this.emit.recursionTarget.push(...i);return}this.emit.recursionTarget=this.params.recursions==="inject"?i:[]}let s=this.filter===1/0||Array.isArray(this.filter)?this.emit(i,this):this.emit(i[0],this);return At(s,n=>{let a=this.emit.recursionTarget;return delete this.emit.recursionTarget,this.params.recursions==="defer"&&a?.length?this.emit.currentRegistration.fire(a):n})}};var xt=class{constructor(e){this.target=e,this.entries=[]}addRegistration(e){return this.entries.push(e),e}removeRegistration(e){this.entries=this.entries.filter(i=>i!==e)}static _getInstance(e,i,r=!0,s=this.__namespace){if(!V(i))throw new Error(`Subject must be of type object; "${Ct(i)}" given!`);let n=this;return s&&N(globalThis,"observerAPI","namespaces").has(e+"-"+s)&&(n=N(globalThis,"observerAPI","namespaces").get(e+"-"+s),e+="-"+s),!N(i,"registry").has(e)&&r&&N(i,"registry").set(e,new n(i)),N(i,"registry").get(e)}static _namespace(e,i,r=null){if(e+="-"+i,arguments.length===2)return N(globalThis,"observerAPI","namespaces").get(e);if(!(r.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${i} must be a subclass of ${this.name}.`);N(globalThis,"observerAPI","namespaces").set(e,r),r.__namespace=i}};var L=class{constructor(e,i){if(this.target=e,!i.operation)throw new Error("Descriptor operation must be given in definition!");Object.assign(this,i)}};var it=class extends xt{static getInstance(e,i=!0,r=null){return super._getInstance("listeners",...arguments)}static namespace(e,i=null){return super._namespace("listeners",...arguments)}constructor(e){super(e),this.batches=[]}addRegistration(e,i,r){return super.addRegistration(new Rt(this,{filter:e,emit:i,params:r}))}emit(e,{eventsArePropertyDescriptors:i=!1,eventIsArrayMethodDescriptor:r=!1}={}){if(this.batches.length){let s=this.batches[0].params.arrayMethodName;this.batches[0].snapshots.push({events:[...e],arrayMethodName:s,eventsArePropertyDescriptors:i,eventIsArrayMethodDescriptor:r});return}this.$emit(this.entries,[{events:e,eventsArePropertyDescriptors:i,eventIsArrayMethodDescriptor:r}])}$emit(e,i){let r=0,s=0,n=0;for(let f of e)r+=1,f.params.withPropertyDescriptors&&(s+=1),f.params.withArrayMethodDescriptors&&(n+=1);let a=[],u=[],c=[],l=[];for(let f of i){let p=f.arrayMethodName,d=f.eventsArePropertyDescriptors,x=f.eventIsArrayMethodDescriptor;for(let m of f.events)if(p&&(m.operation=p),s&&(n&&a.push(m),x||n!==r&&u.push(m)),s!==r){let S=m;if(d){let{target:E,type:b,...v}=m;S=new L(E,{type:"set",...v}),Object.defineProperty(S,"value","get"in v.value?{get:()=>v.value.get()}:{value:v.value.value}),v.oldValue&&Object.defineProperty(S,"oldValue","get"in v.oldValue?{get:()=>v.oldValue.get()}:{value:v.oldValue.value})}n&&c.push(S),x||n!==r&&l.push(S)}}for(let f of e)f.params.withPropertyDescriptors?f.params.withArrayMethodDescriptors?a.length&&f.fire(a):u.length&&f.fire(u):f.params.withArrayMethodDescriptors?c.length&&f.fire(c):l.length&&f.fire(l)}batch(e,i={}){this.batches.unshift({entries:[...this.entries],snapshots:[],params:i});let r=e();return At(r,s=>{let n=this.batches.shift();return n.snapshots.length&&this.$emit(n.entries,n.snapshots),s})}};var $t=class extends dt{exec(e,i,r){return this.running||!this.traps[e.operation]?i(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[e.operation](e,r,(...s)=>(this.running=!1,i(...s))))}};var rt=class extends xt{static getInstance(e,i=!0,r=null){return super._getInstance("traps",...arguments)}static namespace(e,i=null){return super._namespace("traps",...arguments)}addRegistration(e){return super.addRegistration(new $t(this,e))}emit(e,i=null){let r=this;return function s(n,...a){let u=r.entries[n];return u?u.exec(e,(...c)=>s(n+1,...c),...a):i?i(e,...a):a[0]}(0)}};var Pe={};be(Pe,{accessorize:()=>Pr,proxy:()=>ke,unaccessorize:()=>Ar,unproxy:()=>Dt});var hi=Symbol("wqOriginal");function Pr(t,e,i={}){t=Ce(t);let r=N(t,"accessorizedProps");function s(c){let l,f=t;do l=Object.getOwnPropertyDescriptor(f,c);while(!l&&(f=Object.getPrototypeOf(f)));return l?{proto:f,descriptor:l}:{descriptor:{value:void 0,configurable:!0,enumerable:!0,writable:!0}}}function n(c){if(r.has(c+""))return!0;let l=s(c);l.getValue=function(d=!1){return d?this.descriptor:this.descriptor.get?this.descriptor.get():this.descriptor.value},l.setValue=function(d,x=!1){if(this.dirty=!0,x){this.descriptor=d;return}return this.descriptor.set?this.descriptor.set(d)!==!1:(this.descriptor.value=d,!0)},l.intact=function(){let d=Object.getOwnPropertyDescriptor(t,c);return d?.get===p.get&&d?.set===p.set&&r.get(c+"")===this},l.restore=function(){return this.intact()?(this.proto&&this.proto!==t||!this.proto&&!this.dirty?delete t[c]:Object.defineProperty(t,c,this.descriptor),r.delete(c+""),!0):!1},r.set(isNaN(c)?c:parseInt(c),l);let{enumerable:f=!0}=l.descriptor,p={enumerable:f,configurable:!0};("value"in l.descriptor||l.descriptor.set)&&(p.set=function(d){return yt(this,c,d,i)}),("value"in l.descriptor||l.descriptor.get)&&(p.get=function(){return st(this,c,i)});try{return Object.defineProperty(t,c,p),!0}catch{return r.delete(c+""),!1}}let u=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(n);return e===void 0||Array.isArray(e)?u:u[0]}function Ar(t,e,i={}){t=Ce(t);let r=N(t,"accessorizedProps");function s(u){return r.has(u+"")?r.get(u+"").restore():!0}let a=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(s);return e===void 0||Array.isArray(e)?a:a[0]}function ke(t,e={},i=void 0){let r=Ce(t);if(typeof e.membrane=="boolean")throw new Error("The params.membrane parameter cannot be of type boolean.");if(e.membrane&&N(r,"membraneRef").has(e.membrane))return N(r,"membraneRef").get(e.membrane);let s={apply:(u,c,l)=>Oe(u,c,l,void 0,e),construct:(u,c,l=null)=>Te(u,c,l,e),defineProperty:(u,c,l)=>Mt(u,c,l,e),deleteProperty:(u,c)=>Bt(u,c,e),get:(u,c,l=null)=>{if(c===hi)return r;let f={...e,receiver:l},p=st(u,c,f);return Array.isArray(u)&&typeof p=="function"&&!/^class\s?/.test(Function.prototype.toString.call(p))?ke(p,{...e,arrayMethodName:c,membrane:l},i):e.chainable&&V(p)&&c!=="prototype"&&!(typeof p=="function"&&/^class\s?|\{\s\[native\scode\]\s\}$/.test(Function.prototype.toString.call(p)))?ke(p,e,i):p},getOwnPropertyDescriptor:(u,c)=>oe(u,c,e),getPrototypeOf:u=>Ae(u,e),has:(u,c)=>ue(u,c,e),isExtensible:u=>Ie(u,e),ownKeys:u=>Ne(u,e),preventExtensions:u=>Fe(u,e),set:(u,c,l,f=null)=>yt(u,c,l,{...e,receiver:f}),setPrototypeOf:(u,c)=>Le(u,c,e)},n=i?.(s)||s,a=new Proxy(r,n);return e.membrane&&N(r,"membraneRef").set(e.membrane,a),a}function Dt(t){return t&&t[hi]||t}function Ce(t){if(!t||!V(t))throw new Error("Target must be of type object!");return Dt(t)}var jt=class extends Array{};function Ir(...t){return new jt(...t)}var gt=class extends Array{};function Nr(){return new gt}function Tr(){return 1/0}function Ve(t,e,i,r=n=>n,s={}){let n=e instanceof gt;if(!(!n&&!e?.length))return function a(u,c,l,f){let p=f||c[l.level]instanceof gt,d=p?1/0:c[l.level],x=p?!1:l.level===c.length-1;return u instanceof L&&u.operation!=="get"?l={...l,probe:"always"}:l.probe!=="always"&&(l={...l,probe:!x}),i(u,d,(m,...S)=>{let E=y=>{y instanceof L&&(y.path="key"in y?[y.key]:[],u instanceof L&&(y.path="key"in y?u.path.concat(y.key):u.path.slice(0),Object.defineProperty(y,"context",{get:()=>u,configurable:!0})))},b=S[0]||{},v=y=>{if(y instanceof L&&"argumentsList"in y)return;let F=Z(y,!1);return At(F,T=>(y instanceof L?y.value=T:y=T,a(y,c,{...l,...b,keyInParent:y.key,level:l.level+1},p)))};if(qt(d)&&Array.isArray(m)){if(m.forEach(E),x)return r(m,...S);p&&m[0]instanceof L&&(m[0].operation!=="get"||s.asGet)&&r(m,...S);for(let y of m)v(y);return}return E(m),x?r(m,...S):v(m)},l)}(t,e.slice(0),{...s,level:0},n)}function Re(t,e,i,r={}){let s=Z(t,!r.level);if(et(arguments[1])&&([,i,r={}]=arguments,e=1/0),!et(i))throw new Error(`Handler must be a function; "${Ct(i)}" given!`);if(e instanceof jt||e instanceof gt)return Ve(s,e,Re,i,r);if(r={...r,descripted:!0},delete r.live,!V(s))return r.probe&&st(s,e,i,r)||void 0;let n=fi(s,e,i,r);return r.probe?st(s,e,n,r):n()}function Or(t,e,i={}){let r=Z(t);return R(e)||([,,,i={}]=arguments,e={[arguments[1]]:arguments[2]}),rt.getInstance(r,!0,i.namespace).addRegistration({traps:e,params:i})}function oe(t,e,i=s=>s,r={}){return H(t,"getOwnPropertyDescriptor",{key:e},i,r)}function Lr(t,e,i=s=>s,r={}){return H(t,"getOwnPropertyDescriptors",{key:e},i,r)}function Ae(t,e=r=>r,i={}){return H(t,"getPrototypeOf",{},e,i)}function Ie(t,e=r=>r,i={}){return H(t,"isExtensible",{},e,i)}function Ne(t,e=r=>r,i={}){return H(t,"ownKeys",{},e,i)}function ue(t,e,i=s=>s,r={}){return H(t,"has",{key:e},i,r)}function st(t,e,i=s=>s,r={}){let s,n=Z(t,!r.level);return R(i)?[r,i]=[i,a=>a]:r.live&&(s=!0),e instanceof jt||e instanceof gt?Ve(n,e,st,i,{...r,asGet:!0}):$r(n,e,a=>{let u=[...a];return function c(l,f,p){if(!f.length)return p(l);let d=f.shift();if(!["string","number","symbol"].includes(typeof d))throw new Error(`Property name/key ${d} invalid.`);function x(E,b=void 0){let v=T=>(E.value=T,c([...l,r.live||r.descripted?E:T],f,p));if(arguments.length>1)return v(b);if(!V(n))return v(n?.[E.key]);let y=N(n,"accessorizedProps",!1),F=y&&y.get(E.key);if(F&&F.intact())return v(F.getValue(r.withPropertyDescriptors));if(r.withPropertyDescriptors){let T=Object.getOwnPropertyDescriptor(n,E.key);return v(T)}return v(Reflect.get(n,E.key))}let m=new L(n,{type:"get",key:d,value:void 0,operation:"get",related:u});if(!V(n))return x(m);let S=rt.getInstance(n,!1,r.namespace);return S?S.emit(m,x):x(m)}([],a.slice(0),c=>{let l=qt(e)?c:c[0];return s&&V(n)?fi(n,e,i,r,t.key)(l):i(l)})},r)}function $e(t,e,i={}){let r=Z(t);return it.getInstance(r,!0,i.namespace).batch(e,i)}function Fr(t,e,i={}){e=Z(e),t=Z(t);let r=(i.only||[]).slice(0),s=(i.except||[]).slice(0),n=Object.keys(i.spread?[...t]:t).map(l=>isNaN(l)?l:parseInt(l)),a=r.length?r.filter(l=>n.includes(l)):n.filter(l=>!s.includes(l)),u=l=>!Array.isArray(e)||isNaN(l)?l:l-s.filter(f=>f<l).length,c=l=>{let f=oe(t,l,i);"value"in f&&f.writable&&f.enumerable&&f.configurable?yt(e,u(l),f.value,i):(f.enumerable||i.onlyEnumerable===!1)&&Mt(e,l,{...f,configurable:!0},i)};return $e(e,()=>{a.forEach(c)}),Re(t,l=>{l.filter(f=>r.length?r.includes(f.key):!s.includes(f.key)).forEach(f=>{if(f.type==="delete")return Bt(e,u(f.key),i);if(f.type==="def"){(f.value.enumerable||i.onlyEnumerable===!1)&&Mt(e,u(f.key),{...f.value,configurable:!0},i);return}c(f.key)})},{...i,withPropertyDescriptors:!0})}function yt(t,e,i,r=a=>a,s={},n=!1){let a=Z(t),u=[[e,i]];R(e)&&([,,r=l=>l,s={},n=!1]=arguments,u=Object.entries(e)),R(r)&&([n,s,r]=[typeof s=="boolean"?s:n,r,l=>l]);let c=u.map(([l])=>l);return function l(f,p,d){if(!p.length)return d(f);let[x,m]=p.shift();function S(b,v=void 0){let y=ct=>(b.status=ct,l(f.concat(b),p,d));if(arguments.length>1)return y(b,v);let F=N(a,"accessorizedProps",!1),T=F&&F.get(b.key);return b.type==="def"?(T&&!T.restore()&&y(!1),Object.defineProperty(a,b.key,b.value),y(!0)):T&&T.intact()?y(T.setValue(b.value)):y(Reflect.set(a,b.key,b.value))}function E(b,v){if(s.diff&&m===v)return l(f,p,d);let y=new L(a,{type:n?"def":"set",key:x,value:m,isUpdate:b,oldValue:v,related:[...c],operation:n?"defineProperty":"set",detail:s.detail}),F=rt.getInstance(a,!1,s.namespace);return F?F.emit(y,S):S(y)}return ue(a,x,b=>{if(!b)return E(b);if(x==="length"&&Array.isArray(a)&&N(a).has("$length"))return E(!0,N(a).get("$length"));let v={...s,withPropertyDescriptors:n};return st(a,x,y=>E(b,y),v)},s)}([],u.slice(0),l=>{let f=it.getInstance(a,!1,s.namespace);return f&&f.emit(l,{eventsArePropertyDescriptors:!!n}),r(qt(e)?l.map(p=>p.status):l[0]?.status)})}function Mt(t,e,i,r=n=>n,s={}){return yt(t,e,i,r,s,!0)}function Vr(t,e,i=s=>s,r={}){return yt(t,e,i,r,!0)}function Bt(t,e,i=s=>s,r={}){let s=Z(t);R(i)&&([r,i]=[i,u=>u]);let n=lt(e,!1),a=[...n];return function u(c,l,f){if(!l.length)return f(c);let p=l.shift();function d(m,S=void 0){let E=y=>(m.status=y,u(c.concat(m),l,f));if(arguments.length>1)return E(m,S);let b=N(s,"accessorizedProps",!1),v=b&&b.get(m.key);return v&&!v.restore()&&E(!1),E(Reflect.deleteProperty(s,m.key))}function x(m){let S=new L(s,{type:"delete",key:p,oldValue:m,related:[...a],operation:"deleteProperty",detail:r.detail}),E=rt.getInstance(s,!1,r.namespace);return E?E.emit(S,d):d(S)}return st(s,p,x,r)}([],n.slice(0),u=>{let c=it.getInstance(s,!1,r.namespace);return c&&c.emit(u),i(qt(e)?u.map(l=>l.status):u[0].status)})}function Rr(t,e,i=s=>s,r={}){return Bt(...arguments)}function Te(t,e,i=null,r=n=>n,s={}){return H(t,"construct",arguments.length>2?{argumentsList:e,newTarget:i}:{argumentsList:e},r,s)}function Oe(t,e,i,r=n=>n,s={}){let n=Dt(e),a;if(Array.isArray(e)){if(s.arrayMethodName){let u=new L(n,{operation:s.arrayMethodName,argumentsList:i});it.getInstance(n,!1,s.namespace)?.emit([u],{eventIsArrayMethodDescriptor:!0})}N(n).set("$length",n.length),a=$e(n,()=>H(t,"apply",{thisArgument:e,argumentsList:i},r,s),s),N(n).delete("$length")}else a=H(t,"apply",{thisArgument:n,argumentsList:i},r,s);return a}function Le(t,e,i=s=>s,r={}){return H(t,"setPrototypeOf",{proto:e},i,r)}function Fe(t,e=r=>r,i={}){return H(t,"preventExtensions",{},e,i)}function fi(t,e,i,r={}){let s=new AbortController;ae.setMaxListeners?.(0,s.signal),r.signal&&r.signal.addEventListener("abort",()=>s.abort());let n={...r,signal:s.signal},a=it.getInstance(t,!0,n.namespace),u=new Map;return function c(l=[],f=null){let p,d,x;if(qt(e)){if(f){x=!0,d=f;for(let m of l)u.get(m.key)?.remove(),u.delete(m.key)}else d=a.addRegistration(e,c,n);p={signal:d.signal,childRegistrations:u}}else f?.remove(),d=a.addRegistration(e,c,n),p={signal:d.signal};if(n.childRegistrations&&n.keyInParent&&n.childRegistrations.set(n.keyInParent,d),arguments.length){let m=i(l,p);if(arguments.length>1)return m}return s}}function H(t,e,i={},r=n=>n,s={}){t=Z(t),R(r)&&([s,r]=[r,c=>c]);function n(c,l){return arguments.length>1?r(l):r((Reflect[e]||Object[e])(t,...Object.values(i)))}let a=new L(t,{operation:e,...i}),u=rt.getInstance(t,!1,s.namespace);return u?u.emit(a,n):n(a)}function qt(t){return t===1/0||Array.isArray(t)}function Z(t,e=!0,i=!0){if((!t||!V(t))&&e)throw new Error(`Object must be of type object or array! "${Ct(t)}" given.`);return t instanceof L&&(t.type==="def"&&i?t=typeof t.value.get=="function"?t.value.get():t.value.value:t=t.value),t&&Dt(t)}function $r(t,e,i,r={}){return e===1/0?r.level&&!V(t)?i([]):i(Object.entries(Object.getOwnPropertyDescriptors(t)).filter(([,s])=>s.writable!==!1&&!s.get&&!s.set).map(([s])=>s)):i(lt(e,!1))}var Dr={...De,...Pe},P=Dr;var Me=(t,...e)=>{let i=e.pop();if(t.constructor.name==="AsyncFunction")return j(t.call(...e),i);try{return i(t.call(...e))}catch(r){return i(void 0,r)}},j=(t,e)=>t instanceof Promise?t.then(e).catch(i=>e(void 0,i)):e(t),Be=t=>typeof t=="object"&&t||typeof t=="function";function je(t){let e=typeof t[t.length-1]=="object"?t.pop():{},i=t.pop()||"";return e.functionParams=t,{source:i,params:e}}var pi={};var Mr=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,357,0,62,13,1495,6,110,6,6,9,4759,9,787719,239],gi=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2637,96,16,1070,4050,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,46,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,482,44,11,6,17,0,322,29,19,43,1269,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4152,8,221,3,5761,15,7472,3104,541,1507,4938],Br="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F",bi="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",qe={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Ue="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",jr={5:Ue,"5module":Ue+" export import",6:Ue+" const class extends export import super"},qr=/^in(stanceof)?$/,Ur=new RegExp("["+bi+"]"),zr=new RegExp("["+bi+Br+"]");function Qe(t,e){for(var i=65536,r=0;r<e.length;r+=2){if(i+=e[r],i>t)return!1;if(i+=e[r+1],i>=t)return!0}}function at(t,e){return t<65?t===36:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&Ur.test(String.fromCharCode(t)):e===!1?!1:Qe(t,gi)}function It(t,e){return t<48?t===36:t<58?!0:t<65?!1:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&zr.test(String.fromCharCode(t)):e===!1?!1:Qe(t,gi)||Qe(t,Mr)}var A=function(e,i){i===void 0&&(i={}),this.label=e,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function q(t,e){return new A(t,{beforeExpr:!0,binop:e})}var U={beforeExpr:!0},B={startsExpr:!0},Ge={};function C(t,e){return e===void 0&&(e={}),e.keyword=t,Ge[t]=new A(t,e)}var o={num:new A("num",B),regexp:new A("regexp",B),string:new A("string",B),name:new A("name",B),privateId:new A("privateId",B),eof:new A("eof"),bracketL:new A("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new A("]"),braceL:new A("{",{beforeExpr:!0,startsExpr:!0}),braceR:new A("}"),parenL:new A("(",{beforeExpr:!0,startsExpr:!0}),parenR:new A(")"),comma:new A(",",U),semi:new A(";",U),colon:new A(":",U),dot:new A("."),question:new A("?",U),questionDot:new A("?."),arrow:new A("=>",U),template:new A("template"),invalidTemplate:new A("invalidTemplate"),ellipsis:new A("...",U),backQuote:new A("`",B),dollarBraceL:new A("${",{beforeExpr:!0,startsExpr:!0}),eq:new A("=",{beforeExpr:!0,isAssign:!0}),assign:new A("_=",{beforeExpr:!0,isAssign:!0}),incDec:new A("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new A("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:q("||",1),logicalAND:q("&&",2),bitwiseOR:q("|",3),bitwiseXOR:q("^",4),bitwiseAND:q("&",5),equality:q("==/!=/===/!==",6),relational:q("</>/<=/>=",7),bitShift:q("<</>>/>>>",8),plusMin:new A("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:q("%",10),star:q("*",10),slash:q("/",10),starstar:new A("**",{beforeExpr:!0}),coalesce:q("??",1),_break:C("break"),_case:C("case",U),_catch:C("catch"),_continue:C("continue"),_debugger:C("debugger"),_default:C("default",U),_do:C("do",{isLoop:!0,beforeExpr:!0}),_else:C("else",U),_finally:C("finally"),_for:C("for",{isLoop:!0}),_function:C("function",B),_if:C("if"),_return:C("return",U),_switch:C("switch"),_throw:C("throw",U),_try:C("try"),_var:C("var"),_const:C("const"),_while:C("while",{isLoop:!0}),_with:C("with"),_new:C("new",{beforeExpr:!0,startsExpr:!0}),_this:C("this",B),_super:C("super",B),_class:C("class",B),_extends:C("extends",U),_export:C("export"),_import:C("import",B),_null:C("null",B),_true:C("true",B),_false:C("false",B),_in:C("in",{beforeExpr:!0,binop:7}),_instanceof:C("instanceof",{beforeExpr:!0,binop:7}),_typeof:C("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:C("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:C("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Q=/\r\n?|\n|\u2028|\u2029/,Qr=new RegExp(Q.source,"g");function Nt(t){return t===10||t===13||t===8232||t===8233}function wi(t,e,i){i===void 0&&(i=t.length);for(var r=e;r<i;r++){var s=t.charCodeAt(r);if(Nt(s))return r<i-1&&s===13&&t.charCodeAt(r+1)===10?r+2:r+1}return-1}var vi=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,z=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Si=Object.prototype,Wr=Si.hasOwnProperty,Hr=Si.toString,Wt=Object.hasOwn||function(t,e){return Wr.call(t,e)},mi=Array.isArray||function(t){return Hr.call(t)==="[object Array]"};function bt(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}function ht(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}var Gr=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,zt=function(e,i){this.line=e,this.column=i};zt.prototype.offset=function(e){return new zt(this.line,this.column+e)};var pe=function(e,i,r){this.start=i,this.end=r,e.sourceFile!==null&&(this.source=e.sourceFile)};function Ei(t,e){for(var i=1,r=0;;){var s=wi(t,r,e);if(s<0)return new zt(i,e-r);++i,r=s}}var We={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},di=!1;function Kr(t){var e={};for(var i in We)e[i]=t&&Wt(t,i)?t[i]:We[i];if(e.ecmaVersion==="latest"?e.ecmaVersion=1e8:e.ecmaVersion==null?(!di&&typeof console=="object"&&console.warn&&(di=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. Defaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=11):e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),t.allowHashBang==null&&(e.allowHashBang=e.ecmaVersion>=14),mi(e.onToken)){var r=e.onToken;e.onToken=function(s){return r.push(s)}}return mi(e.onComment)&&(e.onComment=Yr(e,e.onComment)),e}function Yr(t,e){return function(i,r,s,n,a,u){var c={type:i?"Block":"Line",value:r,start:s,end:n};t.locations&&(c.loc=new pe(this,a,u)),t.ranges&&(c.range=[s,n]),e.push(c)}}var Qt=1,Tt=2,Ke=4,_i=8,ki=16,Ci=32,Ye=64,Pi=128,Ht=256,Xe=Qt|Tt|Ht;function Ze(t,e){return Tt|(t?Ke:0)|(e?_i:0)}var le=0,Je=1,nt=2,Ai=3,Ii=4,Ni=5,O=function(e,i,r){this.options=e=Kr(e),this.sourceFile=e.sourceFile,this.keywords=bt(jr[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var s="";e.allowReserved!==!0&&(s=qe[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType==="module"&&(s+=" await")),this.reservedWords=bt(s);var n=(s?s+" ":"")+qe.strict;this.reservedWordsStrict=bt(n),this.reservedWordsStrictBind=bt(n+" "+qe.strictBind),this.input=String(i),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(` `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Q).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=o.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Qt),this.regexpState=null,this.privateNameStack=[]},J={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};O.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)};J.inFunction.get=function(){return(this.currentVarScope().flags&Tt)>0};J.inGenerator.get=function(){return(this.currentVarScope().flags&_i)>0&&!this.currentVarScope().inClassFieldInit};J.inAsync.get=function(){return(this.currentVarScope().flags&Ke)>0&&!this.currentVarScope().inClassFieldInit};J.canAwait.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t];if(e.inClassFieldInit||e.flags&Ht)return!1;if(e.flags&Tt)return(e.flags&Ke)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};J.allowSuper.get=function(){var t=this.currentThisScope(),e=t.flags,i=t.inClassFieldInit;return(e&Ye)>0||i||this.options.allowSuperOutsideMethod};J.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Pi)>0};J.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};J.allowNewDotTarget.get=function(){var t=this.currentThisScope(),e=t.flags,i=t.inClassFieldInit;return(e&(Tt|Ht))>0||i};J.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ht)>0};O.extend=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];for(var r=this,s=0;s<e.length;s++)r=e[s](r);return r};O.parse=function(e,i){return new this(i,e).parse()};O.parseExpressionAt=function(e,i,r){var s=new this(r,e,i);return s.nextToken(),s.parseExpression()};O.tokenizer=function(e,i){return new this(i,e)};Object.defineProperties(O.prototype,J);var $=O.prototype,Xr=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;$.strictDirective=function(t){if(this.options.ecmaVersion<5)return!1;for(;;){z.lastIndex=t,t+=z.exec(this.input)[0].length;var e=Xr.exec(this.input.slice(t));if(!e)return!1;if((e[1]||e[2])==="use strict"){z.lastIndex=t+e[0].length;var i=z.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||Q.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}t+=e[0].length,z.lastIndex=t,t+=z.exec(this.input)[0].length,this.input[t]===";"&&t++}};$.eat=function(t){return this.type===t?(this.next(),!0):!1};$.isContextual=function(t){return this.type===o.name&&this.value===t&&!this.containsEsc};$.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};$.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};$.canInsertSemicolon=function(){return this.type===o.eof||this.type===o.braceR||Q.test(this.input.slice(this.lastTokEnd,this.start))};$.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};$.semicolon=function(){!this.eat(o.semi)&&!this.insertSemicolon()&&this.unexpected()};$.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};$.expect=function(t){this.eat(t)||this.unexpected()};$.unexpected=function(t){this.raise(t??this.start,"Unexpected token")};var me=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};$.checkPatternErrors=function(t,e){if(!!t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")}};$.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,r=t.doubleProto;if(!e)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};$.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};$.isSimpleAssignTarget=function(t){return t.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(t.expression):t.type==="Identifier"||t.type==="MemberExpression"};var w=O.prototype;w.parseTopLevel=function(t){var e=Object.create(null);for(t.body||(t.body=[]);this.type!==o.eof;){var i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var n=s[r];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType,this.finishNode(t,"Program")};var ti={kind:"loop"},Zr={kind:"switch"};w.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;z.lastIndex=this.pos;var e=z.exec(this.input),i=this.pos+e[0].length,r=this.input.charCodeAt(i);if(r===91||r===92||r>55295&&r<56320)return!0;if(t)return!1;if(r===123)return!0;if(at(r,!0)){for(var s=i+1;It(r=this.input.charCodeAt(s),!0);)++s;if(r===92||r>55295&&r<56320)return!0;var n=this.input.slice(i,s);if(!qr.test(n))return!0}return!1};w.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;z.lastIndex=this.pos;var t=z.exec(this.input),e=this.pos+t[0].length,i;return!Q.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(It(i=this.input.charCodeAt(e+8))||i>55295&&i<56320))};w.parseStatement=function(t,e,i){var r=this.type,s=this.startNode(),n;switch(this.isLet(t)&&(r=o._var,n="let"),r){case o._break:case o._continue:return this.parseBreakContinueStatement(s,r.keyword);case o._debugger:return this.parseDebuggerStatement(s);case o._do:return this.parseDoStatement(s);case o._for:return this.parseForStatement(s);case o._function:return t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!t);case o._class:return t&&this.unexpected(),this.parseClass(s,!0);case o._if:return this.parseIfStatement(s);case o._return:return this.parseReturnStatement(s);case o._switch:return this.parseSwitchStatement(s);case o._throw:return this.parseThrowStatement(s);case o._try:return this.parseTryStatement(s);case o._const:case o._var:return n=n||this.value,t&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case o._while:return this.parseWhileStatement(s);case o._with:return this.parseWithStatement(s);case o.braceL:return this.parseBlock(!0,s);case o.semi:return this.parseEmptyStatement(s);case o._export:case o._import:if(this.options.ecmaVersion>10&&r===o._import){z.lastIndex=this.pos;var a=z.exec(this.input),u=this.pos+a[0].length,c=this.input.charCodeAt(u);if(c===40||c===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===o._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!t);var l=this.value,f=this.parseExpression();return r===o.name&&f.type==="Identifier"&&this.eat(o.colon)?this.parseLabeledStatement(s,l,f,t):this.parseExpressionStatement(s,f)}};w.parseBreakContinueStatement=function(t,e){var i=e==="break";this.next(),this.eat(o.semi)||this.insertSemicolon()?t.label=null:this.type!==o.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var s=this.labels[r];if((t.label==null||s.name===t.label.name)&&(s.kind!=null&&(i||s.kind==="loop")||t.label&&i))break}return r===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")};w.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")};w.parseDoStatement=function(t){return this.next(),this.labels.push(ti),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(o._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(o.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")};w.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ti),this.enterScope(0),this.expect(o.parenL),this.type===o.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===o._var||this.type===o._const||i){var r=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(r,!0,s),this.finishNode(r,"VariableDeclaration"),(this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===o._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,r)):(e>-1&&this.unexpected(e),this.parseFor(t,r))}var n=this.isContextual("let"),a=!1,u=new me,c=this.parseExpression(e>-1?"await":!0,u);return this.type===o._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===o._in?e>-1&&this.unexpected(e):t.await=e>-1),n&&a&&this.raise(c.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(c,!1,u),this.checkLValPattern(c),this.parseForIn(t,c)):(this.checkExpressionErrors(u,!0),e>-1&&this.unexpected(e),this.parseFor(t,c))};w.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,Ut|(i?0:He),!1,e)};w.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(o._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};w.parseReturnStatement=function(t){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(o.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")};w.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(o.braceL),this.labels.push(Zr),this.enterScope(0);for(var e,i=!1;this.type!==o.braceR;)if(this.type===o._case||this.type===o._default){var r=this.type===o._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),r?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(o.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};w.parseThrowStatement=function(t){return this.next(),Q.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var Jr=[];w.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===o._catch){var e=this.startNode();if(this.next(),this.eat(o.parenL)){e.param=this.parseBindingAtom();var i=e.param.type==="Identifier";this.enterScope(i?Ci:0),this.checkLValPattern(e.param,i?Ii:nt),this.expect(o.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0);e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(o._finally)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")};w.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")};w.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(ti),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};w.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};w.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};w.parseLabeledStatement=function(t,e,i,r){for(var s=0,n=this.labels;s<n.length;s+=1){var a=n[s];a.name===e&&this.raise(i.start,"Label '"+e+"' is already declared")}for(var u=this.type.isLoop?"loop":this.type===o._switch?"switch":null,c=this.labels.length-1;c>=0;c--){var l=this.labels[c];if(l.statementStart===t.start)l.statementStart=this.start,l.kind=u;else break}return this.labels.push({name:e,kind:u,statementStart:this.start}),t.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")};w.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};w.parseBlock=function(t,e,i){for(t===void 0&&(t=!0),e===void 0&&(e=this.startNode()),e.body=[],this.expect(o.braceL),t&&this.enterScope(0);this.type!==o.braceR;){var r=this.parseStatement(null);e.body.push(r)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")};w.parseFor=function(t,e){return t.init=e,this.expect(o.semi),t.test=this.type===o.semi?null:this.parseExpression(),this.expect(o.semi),t.update=this.type===o.parenR?null:this.parseExpression(),this.expect(o.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};w.parseForIn=function(t,e){var i=this.type===o._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(o.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")};w.parseVar=function(t,e,i){for(t.declarations=[],t.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(o.eq)?r.init=this.parseMaybeAssign(e):i==="const"&&!(this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():r.id.type!=="Identifier"&&!(e&&(this.type===o._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,t.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(o.comma))break}return t};w.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLValPattern(t.id,e==="var"?Je:nt,!1)};var Ut=1,He=2,Ti=4;w.parseFunction=function(t,e,i,r,s){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===o.star&&e&He&&this.unexpected(),t.generator=this.eat(o.star)),this.options.ecmaVersion>=8&&(t.async=