@webqit/oohtml 4.5.3 → 4.5.5

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/main.lite.js CHANGED
@@ -1,4 +1,4 @@
1
- (()=>{var dr=Object.defineProperty;var Kr=(i,t,e)=>t in i?dr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var _e=(i,t)=>{for(var e in t)dr(i,e,{get:t[e],enumerable:!0})};var W=(i,t,e)=>(Kr(i,typeof t!="symbol"?t+"":t,e),e),pr=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var F=(i,t,e)=>(pr(i,t,"read from private field"),e?e.call(i):t.get(i)),Vt=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},Ct=(i,t,e,r)=>(pr(i,t,"write to private field"),r?r.call(i,e):t.set(i,e),e);var ze={};_e(ze,{AsyncQuantumFunction:()=>Sr,AsyncQuantumScript:()=>jt,Observer:()=>P,QuantumAsyncFunction:()=>Pi,QuantumAsyncScript:()=>Ti,QuantumFunction:()=>Ei,QuantumModule:()=>re,QuantumScript:()=>Ci,State:()=>Ot});var Fe={};_e(Fe,{any:()=>gi,apply:()=>Re,batch:()=>He,construct:()=>ke,defineProperties:()=>xi,defineProperty:()=>Jt,deleteProperties:()=>_i,deleteProperty:()=>Yt,get:()=>ct,getOwnPropertyDescriptor:()=>ue,getOwnPropertyDescriptors:()=>wi,getPrototypeOf:()=>Ie,has:()=>fe,intercept:()=>yi,isExtensible:()=>Me,map:()=>bi,observe:()=>Le,ownKeys:()=>qe,path:()=>hi,preventExtensions:()=>Ne,reduce:()=>De,set:()=>wt,setPrototypeOf:()=>je,subtree:()=>mi});function T(i){return!Array.isArray(i)&&typeof i=="object"&&i}function Tt(i){return typeof i}function E(i){return Array.isArray(i)}function It(i){return typeof i=="function"}function Bt(i){return i===null||i===""}function ot(i){return arguments.length&&(i===void 0||typeof i>"u")}function M(i){return Array.isArray(i)||typeof i=="object"&&i||It(i)}function ve(i){return Bt(i)||ot(i)||i===!1||i===0||M(i)&&!Object.keys(i).length}function I(i){return It(i)||i&&{}.toString.call(i)==="[object function]"}function zt(i){return i instanceof Number||typeof i=="number"}function X(i){return zt(i)||i!==!0&&i!==!1&&i!==null&&i!==""&&!isNaN(i*1)}function Mt(i){return i instanceof String||typeof i=="string"&&i!==null}function Oe(i){return!Mt(i)&&!ot(i.length)}function ae(i,...t){return t.forEach(e=>{i.indexOf(e)<0&&i.push(e)}),i}function Se(r,t){t=t||Object.prototype,t=t&&!E(t)?[t]:t;for(var e=[],r=r;r&&(!t||t.indexOf(r)<0)&&r.name!=="default";)e.push(r),r=r?Object.getPrototypeOf(r):null;return e}function Ae(i,t){var e=[];return Se(i,t).forEach(r=>{ae(e,...Object.getOwnPropertyNames(r))}),e}function K(i,t,e=!1,r=!1,n=!1){var o=0,a=i.shift();if((X(a)||a===!0||a===!1)&&(o=a,a=i.shift()),!i.length)throw new Error("_merge() requires two or more array/objects.");return i.forEach((s,u)=>{!M(s)&&!I(s)||(e?Ae(s):Object.keys(s)).forEach(c=>{if(!!t(c,a,s,u)){var l=a[c],f=s[c];if((E(l)&&E(f)||T(l)&&T(f))&&(o===!0||o>0))a[c]=E(l)&&E(f)?[]:{},K([X(o)?o-1:o,a[c],l,f],t,e,r,n);else if(E(a)&&E(s))r?a[c]=f:a.push(f);else try{n?Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(s,c)):a[c]=s[c]}catch{}}})}),a}function Ut(...i){return K(i,(t,e,r)=>!0,!1,!1,!1)}function B(i,...t){if(!i||!["object","function"].includes(typeof i))throw new Error("Argument #1 must be of type object");let e=i[Symbol.for("wq")];if(e||(e=new ce,Object.defineProperty(i,Symbol.for("wq"),{value:e,enumerable:!1,configurable:!1,writable:!1})),!t.length)return e;let r,n;for(;r=t.shift();)(n=e)&&!(e=e.get(r))&&(e=new ce,n.set(r,e));return e}var ce=class extends Map{};function j(i,t=!0){return E(i)?i:!t&&T(i)?[i]:i!==!1&&i!==0&&ve(i)?[]:Oe(i)?Array.prototype.slice.call(i):T(i)?Object.values(i):[i]}var R=(i,...t)=>B(i,"observerAPI",...t),qt=(i,t)=>i instanceof Promise?i.then(t):t(i),le={};var gt=class{constructor(t,e){this.registry=t,Object.assign(this,{...e,target:t.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var Gt=class extends gt{constructor(){super(...arguments),this.emit.currentRegistration=this,Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal}),le.setMaxListeners?.(0,this.signal)}remove(){this.abortController.abort(),super.remove()}fire(t){if(this.emit.recursionTarget&&!["inject","force-async","force-sync"].includes(this.params.recursions))return;let e=t,r=this.filter;if(r!==1/0&&(r=j(r,!1))&&(e=t.filter(o=>r.includes(o.key))),this.params.diff&&(e=e.filter(o=>o.type!=="set"||o.value!==o.oldValue)),!e.length)return;if(["inject","defer"].includes(this.params.recursions)){if(this.emit.recursionTarget){this.emit.recursionTarget.push(...e);return}this.emit.recursionTarget=this.params.recursions==="inject"?e:[]}let n=this.filter===1/0||Array.isArray(this.filter)?this.emit(e,this):this.emit(e[0],this);return qt(n,o=>{let a=this.emit.recursionTarget;return delete this.emit.recursionTarget,this.params.recursions==="defer"&&a?.length?this.emit.currentRegistration.fire(a):o})}};var yt=class{constructor(t){this.target=t,this.entries=[]}addRegistration(t){return this.entries.push(t),t}removeRegistration(t){this.entries=this.entries.filter(e=>e!==t)}static _getInstance(t,e,r=!0,n=this.__namespace){if(!M(e))throw new Error(`Subject must be of type object; "${Tt(e)}" given!`);let o=this;return n&&R(globalThis,"observerAPI","namespaces").has(t+"-"+n)&&(o=R(globalThis,"observerAPI","namespaces").get(t+"-"+n),t+="-"+n),!R(e,"registry").has(t)&&r&&R(e,"registry").set(t,new o(e)),R(e,"registry").get(t)}static _namespace(t,e,r=null){if(t+="-"+e,arguments.length===2)return R(globalThis,"observerAPI","namespaces").get(t);if(!(r.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${e} must be a subclass of ${this.name}.`);R(globalThis,"observerAPI","namespaces").set(t,r),r.__namespace=e}};var D=class{constructor(t,e){if(this.target=t,!e.operation)throw new Error("Descriptor operation must be given in definition!");Object.assign(this,e)}};var st=class extends yt{static getInstance(t,e=!0,r=null){return super._getInstance("listeners",...arguments)}static namespace(t,e=null){return super._namespace("listeners",...arguments)}constructor(t){super(t),this.batches=[]}addRegistration(t,e,r){return super.addRegistration(new Gt(this,{filter:t,emit:e,params:r}))}emit(t,{eventsArePropertyDescriptors:e=!1,eventIsArrayMethodDescriptor:r=!1}={}){if(this.batches.length){let n=this.batches[0].params.arrayMethodName;this.batches[0].snapshots.push({events:[...t],arrayMethodName:n,eventsArePropertyDescriptors:e,eventIsArrayMethodDescriptor:r});return}this.$emit(this.entries,[{events:t,eventsArePropertyDescriptors:e,eventIsArrayMethodDescriptor:r}])}$emit(t,e){let r=0,n=0,o=0;for(let l of t)r+=1,l.params.withPropertyDescriptors&&(n+=1),l.params.withArrayMethodDescriptors&&(o+=1);let a=[],s=[],u=[],c=[];for(let l of e){let f=l.arrayMethodName,d=l.eventsArePropertyDescriptors,h=l.eventIsArrayMethodDescriptor;for(let p of l.events)if(f&&(p.operation=f),n&&(o&&a.push(p),h||o!==r&&s.push(p)),n!==r){let v=p;if(d){let{target:O,type:g,...w}=p;v=new D(O,{type:"set",...w}),Object.defineProperty(v,"value","get"in w.value?{get:()=>w.value.get()}:{value:w.value.value}),w.oldValue&&Object.defineProperty(v,"oldValue","get"in w.oldValue?{get:()=>w.oldValue.get()}:{value:w.oldValue.value})}o&&u.push(v),h||o!==r&&c.push(v)}}for(let l of t)l.params.withPropertyDescriptors?l.params.withArrayMethodDescriptors?a.length&&l.fire(a):s.length&&l.fire(s):l.params.withArrayMethodDescriptors?u.length&&l.fire(u):c.length&&l.fire(c)}batch(t,e={}){this.batches.unshift({entries:[...this.entries],snapshots:[],params:e});let r=t();return qt(r,n=>{let o=this.batches.shift();return o.snapshots.length&&this.$emit(o.entries,o.snapshots),n})}};var Qt=class extends gt{exec(t,e,r){return this.running||!this.traps[t.operation]?e(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[t.operation](t,r,(...n)=>(this.running=!1,e(...n))))}};var at=class extends yt{static getInstance(t,e=!0,r=null){return super._getInstance("traps",...arguments)}static namespace(t,e=null){return super._namespace("traps",...arguments)}addRegistration(t){return super.addRegistration(new Qt(this,t))}emit(t,e=null){let r=this;return function n(o,...a){let s=r.entries[o];return s?s.exec(t,(...u)=>n(o+1,...u),...a):e?e(t,...a):a[0]}(0)}};var Te={};_e(Te,{accessorize:()=>di,proxy:()=>Pe,unaccessorize:()=>pi,unproxy:()=>Xt});var xr=Symbol("wqOriginal");function di(i,t,e={}){i=Ce(i);let r=R(i,"accessorizedProps");function n(u){let c,l=i;do c=Object.getOwnPropertyDescriptor(l,u);while(!c&&(l=Object.getPrototypeOf(l)));return c?{proto:l,descriptor:c}:{descriptor:{value:void 0,configurable:!0,enumerable:!0,writable:!0}}}function o(u){if(r.has(u+""))return!0;let c=n(u);c.getValue=function(d=!1){return d?this.descriptor:this.descriptor.get?this.descriptor.get():this.descriptor.value},c.setValue=function(d,h=!1){if(this.dirty=!0,h){this.descriptor=d;return}return this.descriptor.set?this.descriptor.set(d)!==!1:(this.descriptor.value=d,!0)},c.intact=function(){let d=Object.getOwnPropertyDescriptor(i,u);return d?.get===f.get&&d?.set===f.set&&r.get(u+"")===this},c.restore=function(){return this.intact()?(this.proto&&this.proto!==i||!this.proto&&!this.dirty?delete i[u]:Object.defineProperty(i,u,this.descriptor),r.delete(u+""),!0):!1},r.set(isNaN(u)?u:parseInt(u),c);let{enumerable:l=!0}=c.descriptor,f={enumerable:l,configurable:!0};("value"in c.descriptor||c.descriptor.set)&&(f.set=function(d){return wt(this,u,d,e)}),("value"in c.descriptor||c.descriptor.get)&&(f.get=function(){return ct(this,u,e)});try{return Object.defineProperty(i,u,f),!0}catch{return r.delete(u+""),!1}}let s=(Array.isArray(t)?t:t===void 0?Object.keys(i):[t]).map(o);return t===void 0||Array.isArray(t)?s:s[0]}function pi(i,t,e={}){i=Ce(i);let r=R(i,"accessorizedProps");function n(s){return r.has(s+"")?r.get(s+"").restore():!0}let a=(Array.isArray(t)?t:t===void 0?Object.keys(i):[t]).map(n);return t===void 0||Array.isArray(t)?a:a[0]}function Pe(i,t={},e=void 0){let r=Ce(i);if(typeof t.membrane=="boolean")throw new Error("The params.membrane parameter cannot be of type boolean.");if(t.membrane&&R(r,"membraneRef").has(t.membrane))return R(r,"membraneRef").get(t.membrane);let n={apply:(s,u,c)=>Re(s,u,c,void 0,t),construct:(s,u,c=null)=>ke(s,u,c,t),defineProperty:(s,u,c)=>Jt(s,u,c,t),deleteProperty:(s,u)=>Yt(s,u,t),get:(s,u,c=null)=>{if(u===xr)return r;let l={...t,receiver:c},f=ct(s,u,l);return Array.isArray(s)&&typeof f=="function"&&!/^class\s?|\{\s\[native\scode\]\s\}$/.test(Function.prototype.toString.call(f))?Pe(f,{...t,arrayMethodName:u,membrane:c},e):t.chainable&&M(f)&&u!=="prototype"&&!(typeof f=="function"&&/^class\s?|\{\s\[native\scode\]\s\}$/.test(Function.prototype.toString.call(s)))?Pe(f,t,e):f},getOwnPropertyDescriptor:(s,u)=>ue(s,u,t),getPrototypeOf:s=>Ie(s,t),has:(s,u)=>fe(s,u,t),isExtensible:s=>Me(s,t),ownKeys:s=>qe(s,t),preventExtensions:s=>Ne(s,t),set:(s,u,c,l=null)=>wt(s,u,c,{...t,receiver:l}),setPrototypeOf:(s,u)=>je(s,u,t)},o=e?.(n)||n,a=new Proxy(r,o);return t.membrane&&R(r,"membraneRef").set(t.membrane,a),a}function Xt(i){return i&&i[xr]||i}function Ce(i){if(!i||!M(i))throw new Error("Target must be of type object!");return Xt(i)}var Zt=class extends Array{};function hi(...i){return new Zt(...i)}var bt=class extends Array{};function mi(){return new bt}function gi(){return 1/0}function De(i,t,e,r=o=>o,n={}){let o=t instanceof bt;if(!(!o&&!t?.length))return function a(s,u,c,l){let f=l||u[c.level]instanceof bt,d=f?1/0:u[c.level],h=f?!1:c.level===u.length-1;return s instanceof D&&s.operation!=="get"?c={...c,probe:"always"}:c.probe!=="always"&&(c={...c,probe:!h}),e(s,d,(p,...v)=>{let O=b=>{b instanceof D&&(b.path="key"in b?[b.key]:[],s instanceof D&&(b.path="key"in b?s.path.concat(b.key):s.path.slice(0),Object.defineProperty(b,"context",{get:()=>s,configurable:!0})))},g=v[0]||{},w=b=>{if(b instanceof D&&"argumentsList"in b)return;let y=tt(b,!1);return qt(y,m=>(b instanceof D?b.value=m:b=m,a(b,u,{...c,...g,keyInParent:b.key,level:c.level+1},f)))};if(Kt(d)&&Array.isArray(p)){if(p.forEach(O),h)return r(p,...v);f&&p[0]instanceof D&&(p[0].operation!=="get"||n.asGet)&&r(p,...v);for(let b of p)w(b);return}return O(p),h?r(p,...v):w(p)},c)}(i,t.slice(0),{...n,level:0},o)}function Le(i,t,e,r={}){let n=tt(i,!r.level);if(I(arguments[1])&&([,e,r={}]=arguments,t=1/0),!I(e))throw new Error(`Handler must be a function; "${Tt(e)}" given!`);if(t instanceof Zt||t instanceof bt)return De(n,t,Le,e,r);if(r={...r,descripted:!0},delete r.live,!M(n))return r.probe&&ct(n,t,e,r)||void 0;let o=_r(n,t,e,r);return r.probe?ct(n,t,o,r):o()}function yi(i,t,e={}){let r=tt(i);return T(t)||([,,,e={}]=arguments,t={[arguments[1]]:arguments[2]}),at.getInstance(r,!0,e.namespace).addRegistration({traps:t,params:e})}function ue(i,t,e=n=>n,r={}){return Z(i,"getOwnPropertyDescriptor",{key:t},e,r)}function wi(i,t,e=n=>n,r={}){return Z(i,"getOwnPropertyDescriptors",{key:t},e,r)}function Ie(i,t=r=>r,e={}){return Z(i,"getPrototypeOf",{},t,e)}function Me(i,t=r=>r,e={}){return Z(i,"isExtensible",{},t,e)}function qe(i,t=r=>r,e={}){return Z(i,"ownKeys",{},t,e)}function fe(i,t,e=n=>n,r={}){return Z(i,"has",{key:t},e,r)}function ct(i,t,e=n=>n,r={}){let n,o=tt(i,!r.level);return T(e)?[r,e]=[e,a=>a]:r.live&&(n=!0),t instanceof Zt||t instanceof bt?De(o,t,ct,e,{...r,asGet:!0}):vi(o,t,a=>{let s=[...a];return function u(c,l,f){if(!l.length)return f(c);let d=l.shift();if(!["string","number","symbol"].includes(typeof d))throw new Error(`Property name/key ${d} invalid.`);function h(O,g=void 0){let w=m=>(O.value=m,u([...c,r.live||r.descripted?O:m],l,f));if(arguments.length>1)return w(g);if(!M(o))return w(o?.[O.key]);let b=R(o,"accessorizedProps",!1),y=b&&b.get(O.key);if(y&&y.intact())return w(y.getValue(r.withPropertyDescriptors));if(r.withPropertyDescriptors){let m=Object.getOwnPropertyDescriptor(o,O.key);return w(m)}return w(Reflect.get(o,O.key))}let p=new D(o,{type:"get",key:d,value:void 0,operation:"get",related:s});if(!M(o))return h(p);let v=at.getInstance(o,!1,r.namespace);return v?v.emit(p,h):h(p)}([],a.slice(0),u=>{let c=Kt(t)?u:u[0];return n&&M(o)?_r(o,t,e,r,i.key)(c):e(c)})},r)}function He(i,t,e={}){let r=tt(i);return st.getInstance(r,!0,e.namespace).batch(t,e)}function bi(i,t,e={}){t=tt(t),i=tt(i);let r=(e.only||[]).slice(0),n=(e.except||[]).slice(0),o=Object.keys(e.spread?[...i]:i).map(c=>isNaN(c)?c:parseInt(c)),a=r.length?r.filter(c=>o.includes(c)):o.filter(c=>!n.includes(c)),s=c=>!Array.isArray(t)||isNaN(c)?c:c-n.filter(l=>l<c).length,u=c=>{let l=ue(i,c,e);"value"in l&&l.writable&&l.enumerable&&l.configurable?wt(t,s(c),l.value,e):(l.enumerable||e.onlyEnumerable===!1)&&Jt(t,c,{...l,configurable:!0},e)};return He(t,()=>{a.forEach(u)}),Le(i,c=>{c.filter(l=>r.length?r.includes(l.key):!n.includes(l.key)).forEach(l=>{if(l.type==="delete")return Yt(t,s(l.key),e);if(l.type==="def"){(l.value.enumerable||e.onlyEnumerable===!1)&&Jt(t,s(l.key),{...l.value,configurable:!0},e);return}u(l.key)})},{...e,withPropertyDescriptors:!0})}function wt(i,t,e,r=a=>a,n={},o=!1){let a=tt(i),s=[[t,e]];T(t)&&([,,r=c=>c,n={},o=!1]=arguments,s=Object.entries(t)),T(r)&&([o,n,r]=[typeof n=="boolean"?n:o,r,c=>c]);let u=s.map(([c])=>c);return function c(l,f,d){if(!f.length)return d(l);let[h,p]=f.shift();function v(g,w=void 0){let b=_=>(g.status=_,c(l.concat(g),f,d));if(arguments.length>1)return b(g,w);let y=R(a,"accessorizedProps",!1),m=y&&y.get(g.key);return g.type==="def"?(m&&!m.restore()&&b(!1),Object.defineProperty(a,g.key,g.value),b(!0)):m&&m.intact()?b(m.setValue(g.value)):b(Reflect.set(a,g.key,g.value))}function O(g,w){if(n.diff&&p===w)return c(l,f,d);let b=new D(a,{type:o?"def":"set",key:h,value:p,isUpdate:g,oldValue:w,related:[...u],operation:o?"defineProperty":"set",detail:n.detail}),y=at.getInstance(a,!1,n.namespace);return y?y.emit(b,v):v(b)}return fe(a,h,g=>{if(!g)return O(g);if(h==="length"&&Array.isArray(a)&&R(a).has("$length"))return O(!0,R(a).get("$length"));let w={...n,withPropertyDescriptors:o};return ct(a,h,b=>O(g,b),w)},n)}([],s.slice(0),c=>{let l=st.getInstance(a,!1,n.namespace);return l&&l.emit(c,{eventsArePropertyDescriptors:!!o}),r(Kt(t)?c.map(f=>f.status):c[0]?.status)})}function Jt(i,t,e,r=o=>o,n={}){return wt(i,t,e,r,n,!0)}function xi(i,t,e=n=>n,r={}){return wt(i,t,e,r,!0)}function Yt(i,t,e=n=>n,r={}){let n=tt(i);T(e)&&([r,e]=[e,s=>s]);let o=j(t,!1),a=[...o];return function s(u,c,l){if(!c.length)return l(u);let f=c.shift();function d(p,v=void 0){let O=b=>(p.status=b,s(u.concat(p),c,l));if(arguments.length>1)return O(p,v);let g=R(n,"accessorizedProps",!1),w=g&&g.get(p.key);return w&&!w.restore()&&O(!1),O(Reflect.deleteProperty(n,p.key))}function h(p){let v=new D(n,{type:"delete",key:f,oldValue:p,related:[...a],operation:"deleteProperty",detail:r.detail}),O=at.getInstance(n,!1,r.namespace);return O?O.emit(v,d):d(v)}return ct(n,f,h,r)}([],o.slice(0),s=>{let u=st.getInstance(n,!1,r.namespace);return u&&u.emit(s),e(Kt(t)?s.map(c=>c.status):s[0].status)})}function _i(i,t,e=n=>n,r={}){return Yt(...arguments)}function ke(i,t,e=null,r=o=>o,n={}){return Z(i,"construct",arguments.length>2?{argumentsList:t,newTarget:e}:{argumentsList:t},r,n)}function Re(i,t,e,r=o=>o,n={}){let o=Xt(t),a;if(Array.isArray(t)){if(n.arrayMethodName){let s=new D(o,{operation:n.arrayMethodName,argumentsList:e});st.getInstance(o,!1,n.namespace)?.emit([s],{eventIsArrayMethodDescriptor:!0})}R(o).set("$length",o.length),a=He(o,()=>Z(i,"apply",{thisArgument:t,argumentsList:e},r,n),n),R(o).delete("$length")}else a=Z(i,"apply",{thisArgument:o,argumentsList:e},r,n);return a}function je(i,t,e=n=>n,r={}){return Z(i,"setPrototypeOf",{proto:t},e,r)}function Ne(i,t=r=>r,e={}){return Z(i,"preventExtensions",{},t,e)}function _r(i,t,e,r={}){let n=new AbortController;le.setMaxListeners?.(0,n.signal),r.signal&&r.signal.addEventListener("abort",()=>n.abort());let o={...r,signal:n.signal},a=st.getInstance(i,!0,o.namespace),s=new Map;return function u(c=[],l=null){let f,d,h;if(Kt(t)){if(l){h=!0,d=l;for(let p of c)s.get(p.key)?.remove(),s.delete(p.key)}else d=a.addRegistration(t,u,o);f={signal:d.signal,childRegistrations:s}}else l?.remove(),d=a.addRegistration(t,u,o),f={signal:d.signal};if(o.childRegistrations&&o.keyInParent&&o.childRegistrations.set(o.keyInParent,d),arguments.length){let p=e(c,f);if(arguments.length>1)return p}return n}}function Z(i,t,e={},r=o=>o,n={}){i=tt(i),T(r)&&([n,r]=[r,u=>u]);function o(u,c){return arguments.length>1?r(c):r((Reflect[t]||Object[t])(i,...Object.values(e)))}let a=new D(i,{operation:t,...e}),s=at.getInstance(i,!1,n.namespace);return s?s.emit(a,o):o(a)}function Kt(i){return i===1/0||Array.isArray(i)}function tt(i,t=!0,e=!0){if((!i||!M(i))&&t)throw new Error(`Object must be of type object or array! "${Tt(i)}" given.`);return i instanceof D&&(i.type==="def"&&e?i=typeof i.value.get=="function"?i.value.get():i.value.value:i=i.value),i&&Xt(i)}function vi(i,t,e,r={}){return t===1/0?r.level&&!M(i)?e([]):e(Object.entries(Object.getOwnPropertyDescriptors(i)).filter(([,n])=>n.writable!==!1&&!n.get&&!n.set).map(([n])=>n)):e(j(t,!1))}var Oi={...Fe,...Te},P=Oi;var We=(i,...t)=>{let e=t.pop();if(i.constructor.name==="AsyncFunction")return G(i.call(...t),e);try{return e(i.call(...t))}catch(r){return e(void 0,r)}},G=(i,t)=>i instanceof Promise?i.then(t).catch(e=>t(void 0,e)):t(i),Ve=i=>typeof i=="object"&&i||typeof i=="function";function vr(i){let t=typeof i[i.length-1]=="object"?i.pop():{},e=i.pop()||"";return t.functionParams=i,{source:e,params:t}}var Or={};function kt(...i){let t,e={runtimeParams:$i,compilerParams:Ai,parserParams:Si};for(;t=i.shift();){let{runtimeParams:r={},compilerParams:{globalsNoObserve:n=[],globalsOnlyPathsExcept:o=[],...a}={},parserParams:s={}}=t;e={runtimeParams:{...e.runtimeParams,...r},compilerParams:{...e.compilerParams,globalsNoObserve:[...e.compilerParams.globalsNoObserve,...n],globalsOnlyPathsExcept:[...e.compilerParams.globalsOnlyPathsExcept,...o],...a},parserParams:{...e.parserParams,...s}},i.devMode}return e}var Si={ecmaVersion:"latest",allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!1,allowSuperOutsideMethod:!1,preserveParens:!1,locations:!0},Ai={globalsNoObserve:["arguments","debugger"],globalsOnlyPathsExcept:[],originalSource:!0,locations:!0,compact:2},$i={apiVersion:3};var te=Object.create(null);var xt=class extends EventTarget{managedAlways=new Set;managedOnce=new Set;constructor(){super(),Or.setMaxListeners?.(0,this)}fire(t){return this.dispatchEvent(new Event(t,{cancelable:!0}))}on(...t){return this.addEventListener(...t),()=>this.removeEventListener(...t)}abort(t=!1){this.managedAlways.forEach(e=>e.abort?e.abort(t):e(t)),this.managedOnce.forEach(e=>e.abort?e.abort(t):e(t)),this.managedOnce.clear(),this.fire("abort")}manage(t){this.managedAlways.add(t)}once(t){this.managedOnce.add(t)}};var _t=class extends xt{subscribers=new Set;signals=new Map;constructor(t,e,r){super(),this.context=t,this.context?.once(()=>this.abort()),this.once(()=>this.watchMode(!1)),this.type=e,this.state=r}get name(){return[...this.context?.signals.keys()||[]].find(t=>this.context.signals.get(t)===this)}signal(t,e="prop"){let r=this.signals.get(t);return r||(r=new _t(this,e,e==="object"?t:Ve(this.state)?P.get(this.state,t):void 0),this.signals.set(t,r),this.signals.size===1&&this.watchMode(),r.once(()=>{this.signals.delete(t),this.signals.size||this.watchMode(!1)})),r}subscribe(t){this.subscribers.add(t),t.once(()=>{this.subscribers.delete(t),this.subscribers.size||this.abort()})}watchMode(t=!0){this.mutationsWatch?.abort(),!(!t||!this.signals.size||!Ve(this.state))&&(this.mutationsWatch=P.observe(this.state,e=>{let r={map:new Map,add(o,a){for(let s of o)s.spec.beforeSchedule?.(a)!==!1&&(this.map.has(s.runtime)||this.map.set(s.runtime,new Set),this.map.get(s.runtime).add(s))}};for(let o of e){let a=this.signals.get(o.key);!a||(r.add(a.subscribers,o),a.refresh(o.value))}let n=r.map.size?[...r.map].sort((o,a)=>o.$serial>a.$serial?-1:1):r.map;for(let[o,a]of n)o.state!=="aborted"&&o.schedule(...a)},{recursions:"force-sync"}))}refresh(t){this.state=t;for(let[e,r]of this.signals)r.refresh(P.get(this.state??{},e));this.watchMode()}};var V=class extends _t{symbols=new Map;constructor(t,e,r=void 0){super(t,e,r||Object.create(null))}};var et=class extends xt{state;constructor(t,e,r,n,o,a){super(),t?.once(this),this.context=t,this.type=e,this.spec=r||{},this.scope=o,t?.scope!==o&&this.manage(o),this.serial=n,a&&(this.closure=a),t?.type==="iteration"?this.path=t.path.concat(this.spec.index):t?.type==="round"?this.path=t.path.concat(this.serial):this.path=(t?.path||[]).slice(0,-1).concat(this.serial),this.flowControl=new Map}get runtime(){return this.context.runtime}contains(t){return this===t.context||t.context&&this.contains(t.context)}order(t){if(!t)return this;let[e,r]=t.path.length<this.path.length?[t,this]:[this,t];return e.path.reduce((n,o,a)=>n&&o<=r.path[a],!0)&&e||r}beforeExecute(){this.state="running";let t=this.flowControl;return this.flowControl=new Map,t}execute(t=null){return this.runtime.thread.unshift(this),G(this.beforeExecute(),e=>We(this.closure,this,this,(r,n)=>n?this.throw(n,[this.serial,this.context?.serial],n.code):(this.spec.complete&&(r=this.spec.complete(r,this)),this.afterExecute(e),this.runtime.thread.shift(),t?t(r,this):r)))}throw(t,e,r){if(this.type==="function"&&["HandlerFunction","FinalizerFunction"].includes(this.$params.executionMode))return this.$params.lexicalContext.throw(t,e,r);if(this.spec.handler)return this.spec.handler(t);if(this.type!=="function"&&this.context)return this.context.throw(t,e,r);if(t.cause)throw t;let n=`${t.message||t}`,o=r!==null?`[${r}]: ${n}`:n,a=e.map(l=>l!==-1&&this.extractSource(l,!0)).filter(l=>l);a.push({source:this.runtime.$params.originalSource});let s=globalThis[t.name],u=new(s||Error)(o,{cause:a}),c=this.runtime.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace||this.$params.fileName;throw c&&(u.fileName=c),r&&(u.code=r),u}afterExecute(t){this.state="complete";let e=this.flowControl;this.spec.finalizer&&this.spec.finalizer(),this.handleDownstream(e.size,t.size),this.handleRightstream(e.size,t.size);for(let r of["break","continue","return"])e.has(r)&&!e.get(r).endpoint?this.hoistFlowControl(r,e.get(r).arg):t.has(r)&&!t.get(r).endpoint&&this.hoistFlowControl(r,t.get(r).arg,!0)}typed(t,e,r=void 0){let n=Array.isArray(e)?"array":e===null?"null":typeof e;if(n===t||t==="iterable"&&e?.[Symbol.iterator]||t==="desctructurable"&&!["undefined","null"].includes(n))return e;throw t==="iterable"?new Error("value is not iterable."):t==="desctructurable"?new Error((r?`Cannot access ${r}; `:"")+"object not desctructurable."):new Error(`value must be of type ${t}.`)}let(t,e,r,n={}){return this.var(t,e,r,{...n,kind:"let"})}const(t,e,r,n={}){return this.var(t,e,r,{...n,kind:"const"})}var(t,e,r,n={}){n={kind:"var",...n},r||(r=()=>{});let o=n.restOf?(...s)=>{try{return r(...s)}catch(u){throw new Error(`Cannot declare ${t}; ${u.message}`)}}:r,a=(s,u)=>{let c=u.scope;if(n.kind==="var")for(;!["module","function"].includes(c.type)&&!P.has(c.state,t)&&c.context;)c=c.context;else c.type==="this"&&c.context&&(c=c.context);let l=c.symbols.get(t);if(l&&(l.kind!==n.kind||n.kind==="let"&&l.serial!==e))throw new Error(`Identifier "${t}" has already been declared.`);l?.reader?.abort(),l={serial:e,kind:n.kind};let f=s;return n.restOf&&(n.type==="array"?f=[]:f={},l.reader=P.map(s,f,{except:n.restOf,spread:n.type==="array"}),u.once(l.reader)),c.symbols.set(t,l),P.set(c.state,t,f),f};return this.autorun(n.kind,{complete:a,...n},e,o)}update(t,e,r={}){let n=this.scope;for(;n&&!P.has(n.state,t);)n=n.context;if(!n)throw new ReferenceError(`${t} is not defined.`);let o=n.symbols.get(t);if(o?.kind==="const")throw new ReferenceError(`Assignment to constant variable "${t}".`);let a=P.get(n.state,t),s=r.restOf?(...u)=>{try{return e(...u)}catch(c){throw new Error(`Cannot update ${t}; ${c.message}`)}}:e;return We(s,void 0,a,(u,c)=>{if(c)return this.throw(c,[this.serial]);o?.reader?.abort();let l=u;return r.restOf&&(o=o||{},r.type==="array"?l=[]:l={},o.reader=P.map(u,l,{except:r.restOf,spread:r.type==="array"}),this.once(o.reader)),P.set(n.state,t,l),["postinc","postdec"].includes(r.kind)?a:l})}ref(t,...e){let r=0,n={};typeof e[0]=="number"?(r=e.shift(),n=e.shift()||{}):typeof e[0]=="object"&&(n=e.shift());let o=this.scope;for(;o&&!P.has(o.state,t);)o=o.context;if(!o){if(n.isTypeCheck)return;throw new Error(`${t} is not defined.`)}let a=o.symbols.get(t)?.kind,s=o.signal(t,a);return n.typed&&this.typed(n.typed,s.state,t),this.autobind(s,r,n)}obj(t,...e){let r=0,n={};return typeof e[0]=="number"?(r=e.shift(),n=e.shift()||{}):typeof e[0]=="object"&&(n=e.shift()),this.autobind(this.runtime.$objects.signal(t,"object"),r,n)}autobind(t,e,r){let n=["QuantumProgram","QuantumFunction"].includes(this.runtime.$params.executionMode),o=t.type==="const",a=this===this.runtime,s=this.state==="aborted",u=this.spec.static,c=this;return function l(f,d){if(n&&!u&&!o&&!a&&!s&&f.subscribe(c),!d||!f.state||typeof f.state!="object"){let p=f.state;return typeof f.state=="function"&&!/^class\s?/.test(Function.prototype.toString.call(f.state))&&(p=P.proxy(f.state,{membrane:f})),p}let h;return P.proxy(f.state,{},p=>({...p,get(v,O,g=null){return h?p.get(v,O,g):(h=!0,l(f.signal(O),d-1))}}))}(t,e)}autorun(t,...e){let r=e.pop(),n=e.pop(),o=e.pop()||{},a=et,s=this.scope;if(t==="iteration"){let c=this.runtime.constructor;a=r.constructor.name==="AsyncFunction"?c.AutoAsyncIterator:c.AutoIterator}["block","switch","iteration"].includes(t)&&(s=new V(s,t));let u=new a(this,t,o,n,s,r);if(t==="downstream"){if(this.downstream=u,this.flowControlApplied())return}else if(this.type==="switch"&&this.breakpoint)return;return u.execute()}function(t,e,r,n){e==="Declaration"&&P.set(this.scope.state,n.name,n);let o=this;return Object.defineProperty(n,"toString",{value:function(a=!1){if(a&&t==="QuantumFunction")return Function.prototype.toString.call(n);let s=o.runtime.extractSource(r);return s.startsWith("static ")?s.replace("static ",""):s}}),n}class(t,e,r){return t==="Declaration"&&P.set(this.scope.state,e.name,e),r.forEach(({name:n,isQuantumFunction:o,static:a,serial:s})=>{this.function(o&&"QuantumFunction"||"RegularFunction","Expression",s,a?e[n]:e.prototype[n])}),e}async import(...t){return this.runtime.import(...t)}async export(...t){return this.runtime.export(...t)}continue(t){return this.applyFlowControl("continue",t)}break(t){return this.applyFlowControl("break",t)}return(t){return this.applyFlowControl("return",t)}applyFlowControl(t,e,r=!1){let n=this.flowControl.size;if(r?this.flowControl.delete(t):this.flowControl.set(t,{arg:e}),this.type==="round"&&(this.context.breakpoint=this),this.type==="round"&&["break","continue"].includes(t)&&e===this.context?.spec.label){r||(this.flowControl.get(t).endpoint=!0),this.state!=="running"&&this.handleRightstream(this.flowControl.size,n);return}if(this.context?.type==="switch"&&t==="break"&&!e){r||(this.flowControl.get(t).endpoint=!0),this.context.breakpoint=this;return}this.state!=="running"&&(this.handleDownstream(this.flowControl.size,n),this.hoistFlowControl(...arguments))}hoistFlowControl(...t){return this.context?.applyFlowControl(...t)}flowControlApplied(t,e){return arguments.length?arguments.length===1?this.flowControl.has(t):this.flowControl.get(t)?.arg===e:this.flowControl.size||!1}handleDownstream(t,e){let r;!["block"].includes(this.type)||!(r=this.context?.downstream)||(t?r.abort():e&&(r.state="resuming",this.runtime.schedule(r)))}handleRightstream(t,e){if(this.type!=="round")return;let r=this,n=new Set;for(;r=r.nextRound;)t?r.abort():e&&r.state!=="inert"&&(r.state="resuming",n.add(r));n.size&&this.runtime.schedule(...n),!t&&e&&this.runtime.on("reflection",()=>{this.context.iterating||this.context.iterate()},{once:!0})}abort(t=!1){return t&&(this.context?.breakpoint===this&&delete this.context.breakpoint,this.flowControl.clear()),this.state=t?"inert":"aborted",super.abort(t)}};var vt=class extends et{rounds=new Map;constructor(t,e,r,n,o,a){r.$closure=a,super(t,e,r,n,o),this.manage(()=>{delete this.breakpoint,this.rounds.clear()})}pseudorun(t){return this.runtime.iThread.unshift(this),G(t(),e=>(this.runtime.iThread.pop(),e))}createIterator(){return this.spec.kind==="for-in"?function*(){for(let t in this.iteratee)yield t}.call(this):this.spec.kind==="for-of"?function*(){for(let t of this.iteratee)yield t}.call(this):{next:()=>({done:!this.pseudorun(()=>this.spec.test(this))})}}closure(){["for-of","for-in"].includes(this.spec.kind)?([this.production,this.iteratee]=this.spec.parameters(this),this.iterator=this.createIterator(),this.iterator.original=!0,this.watchMode()):(this.spec.kind==="for"&&this.spec.init(this),this.iterator=this.createIterator()),this.iterate()}terminated(){return this.breakpoint&&!this.breakpoint.flowControlApplied("continue",this.spec.label)&&this.breakpoint.flowControlApplied()}advance(){this.spec.kind==="for"&&this.pseudorun(()=>this.spec.advance(this))}iterate(){this.iterating=!0;let t=()=>!this.terminated()&&!(this.cursor=this.iterator.next()).done,e=()=>{this.createRound(this.cursor.value).execute(),this.advance()};if(this.spec.kind==="do-while")do e();while(t());else for(;t();)e();this.iterating=!1}createRound(t){let e=this.rounds.size,r={index:e},n=["for-in","for-of"].includes(this.spec.kind)?{[this.production]:t}:{...this.scope.state},o=new V(this.scope,"round",n);this.scope.symbols.forEach((u,c)=>{o.symbols.set(c,u)});let a=new et(this,"round",r,this.serial,o,this.spec.$closure),s=this.spec.kind==="for-in"?t:e;return this.rounds.set(s,a),this.lastRound&&(this.lastRound.nextRound=a,a.prevRound=this.lastRound),this.lastRound=a,a}watchMode(){if(this.spec.static)return;let t=(e,r)=>{let n=new Set,o=new Set;for(let a of e){if(Array.isArray(this.iteratee)&&a.key==="length")continue;let s=this.spec.kind==="for-in"?a.key:a.value,u=this.spec.kind==="for-in"?a.key:parseInt(a.key),c=this.rounds.get(u);if(c)P.set(c.scope.state,this.production,s),a.type==="delete"&&(this.rounds.set(u,void 0),c.prevRound&&(c.prevRound.nextRound=c.nextRound),c.nextRound&&(c.nextRound.prevRound=c.prevRound),n.add(c));else if(a.type!=="delete"&&!a.isUpdate){if(this.spec.kind==="for-of"&&this.iterator.original&&!r.done)continue;o.add(s)}}this.runtime.on("reflection",()=>{n.forEach(a=>a.abort(!0))},{once:!0}),o.size&&(this.iterator=function*(a){yield*a,yield*o}(this.iterator),r.done&&this.iterate())};this.once(P.observe(this.iteratee,e=>{G(this.cursor,r=>t(e,r))}))}};var ee=class extends vt{async createIterator(){return this.spec.kind==="for-in"?function*(){for(let t in this.iteratee)yield t}.call(this):this.spec.kind==="for-of"?function*(){for(let t of this.iteratee)yield t}.call(this):{next:async()=>({done:!await this.pseudorun(()=>this.spec.test(this))})}}async closure(){["for-of","for-in"].includes(this.spec.kind)?([this.production,this.iteratee]=await this.spec.parameters(this),this.iterator=await this.createIterator(),this.iterator.original=!0,this.watchMode()):(this.spec.kind==="for"&&await this.spec.init(this),this.iterator=await this.createIterator()),await this.iterate()}async iterate(){let t;this.iterating=!0;let e=async()=>!this.terminated()&&(this.cursor=this.iterator.next())&&(t=await this.cursor)&&!t.done,r=async()=>{await this.createRound(t.value).execute(),await this.advance()};if(this.spec.kind==="do-while")do await r();while(await e());else for(;await e();)await r();this.iterating=!1}};var Ot=class{constructor(t){Object.defineProperty(this,"runtime",{value:t});let e={statechange:()=>{P.defineProperty(this,"value",{value:t.flowControl.get("return")?.arg,enumerable:!0,configurable:!0})}};for(let r in e)t.on(r,e[r]),e[r]();t.$params.sourceType==="module"&&Object.defineProperty(this,"exports",{value:t.exports})}dispose(){return this.runtime.abort(!0)}};var St=class extends et{locations=[];queue=new Set;thread=[];iThread=[];constructor(t,e,r,n,o){let{$serial:a=0,spec:s,...u}=r;super(t,e,s,-1,n,o),this.$serial=a,this.$params=u,this.$objects=new V(void 0,"objects"),this.manage(this.$objects),this.exports=Object.create(null),this.$promises={imports:[],exports:[]},this.manage(()=>{P.deleteProperties(this.exports,Object.keys(this.exports)),this.$promises.imports.splice(0),this.$promises.exports.splice(0)})}extractSource(t,e=!1){let[[r,n,o],[a]]=this.locations[t],s=this.$params.originalSource.slice(r,a);return e?{expr:s,line:n,column:o}:s}get runtime(){return this}get nowRunning(){return this.thread[0]}schedule(...t){let e=this.queue.size;for(let r of t)this.queue.add(r);if(!e)return this.flowControlDirty=!1,function r(n,o){let a;for(let s of this.queue){if(o&&o.order(s)!==o||["aborted","running"].includes(s.state)||this.iThread[0]?.contains(s)){this.queue.delete(s);continue}a=a?a.order(s):s,o||(o=a)}return a?(a.abort(),a.execute(s=>(this.queue.delete(a),r.call(this,s,a)))):(this.fire("reflection"),this.flowControlApplied()&&this.fire("statechange"),n)}.call(this,void 0,this.nowRunning)}execute(t=null){return super.execute(e=>{let n=["QuantumProgram","QuantumFunction"].includes(this.$params.executionMode)?new Ot(this):this.flowControl.get("return")?.arg;return t?t(n,this):n})}spawn(t,e,r,n=null){let o=this.nowRunning||n||this,a={...this.$params,$serial:this.$serial+1,executionMode:t,lexicalContext:n},s=new V(o.scope,"function",{this:e});return new this.constructor(o,"function",a,s,r).execute()}async import(...t){let e=t.pop(),r=typeof e=="string"?{source:e}:e,n=a=>{if(r.forExport||r.isDynamic)return a;this.assignModules(t,this.scope.state,a,e.serial)};if(this.$params.experimentalFeatures!==!1&&te[r.source])return n(te[r.source]);let o=(async()=>{let a=this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace||this.$params.fileName;try{return n({...await import(r.source)})}catch(s){s.code==="ERR_MODULE_NOT_FOUND"?this.throw(new Error(`Cannot find module "${r.source}"${a?` imported at "${a}"`:""}.`),[r.serial],s.code):this.throw(s,[r.serial],s.code)}})();return r.isDynamic||this.$promises[r.forExport?"exports":"imports"].push(o),o}async export(...t){let e=Array.isArray(t[t.length-1])?null:t.pop(),r=e?await this.import({...e,forExport:!0}):this.scope.state;this.assignModules(t,this.exports,r,e?.serial)}assignModules(t,e,r,n=null){let o=[],a=["QuantumProgram","QuantumFunction"].includes(this.$params.executionMode);for(let[s,u,c]of t){if(s==="*"&&c){(a?P:Reflect).set(e,c,r);continue}P.has(r,s)||this.throw(new Error(`The requested module does not provide an export named "${s}".`),[u,n]),(a?P:Reflect).set(e,c||s,P.get(r,s)),o.push([s,u,c])}!o.length||!a||this.once(P.observe(r,s=>{for(let[u,,c]of o)for(let l of s)u==="*"?P.set(e,l.key,l.value):l.key===u&&P.set(e,c||u,l.value)}))}afterExecute(...t){return this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace&&(te[this.$params.exportNamespace]=this.exports,this.once(()=>{delete te[this.$params.exportNamespace]})),super.afterExecute(...t)}};W(St,"AutoAsyncIterator",ee),W(St,"AutoIterator",vt);function de(i,t,e,r){let{env:n,functionParams:o=[],exportNamespace:a,fileName:s}=r,{parserParams:u,compilerParams:c,runtimeParams:l}=kt(r),f=Object.getOwnPropertyDescriptor(globalThis,"window")?.get?.toString().includes("[native code]")??!1,d=["async-script","module"].includes(i);if(i==="module")u.sourceType=i,u.allowAwaitOutsideFunction=!0;else if(["function","async-function"].includes(i)){let p=" "+e.split(`
1
+ (()=>{var dr=Object.defineProperty;var Kr=(i,t,e)=>t in i?dr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var _e=(i,t)=>{for(var e in t)dr(i,e,{get:t[e],enumerable:!0})};var W=(i,t,e)=>(Kr(i,typeof t!="symbol"?t+"":t,e),e),pr=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var F=(i,t,e)=>(pr(i,t,"read from private field"),e?e.call(i):t.get(i)),Vt=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},Ct=(i,t,e,r)=>(pr(i,t,"write to private field"),r?r.call(i,e):t.set(i,e),e);var ze={};_e(ze,{AsyncQuantumFunction:()=>Sr,AsyncQuantumScript:()=>jt,Observer:()=>P,QuantumAsyncFunction:()=>Pi,QuantumAsyncScript:()=>Ti,QuantumFunction:()=>Ei,QuantumModule:()=>re,QuantumScript:()=>Ci,State:()=>Ot});var Fe={};_e(Fe,{any:()=>gi,apply:()=>Re,batch:()=>He,construct:()=>ke,defineProperties:()=>xi,defineProperty:()=>Jt,deleteProperties:()=>_i,deleteProperty:()=>Yt,get:()=>ct,getOwnPropertyDescriptor:()=>ue,getOwnPropertyDescriptors:()=>wi,getPrototypeOf:()=>Ie,has:()=>fe,intercept:()=>yi,isExtensible:()=>Me,map:()=>bi,observe:()=>Le,ownKeys:()=>qe,path:()=>hi,preventExtensions:()=>Ne,reduce:()=>De,set:()=>wt,setPrototypeOf:()=>je,subtree:()=>mi});function T(i){return!Array.isArray(i)&&typeof i=="object"&&i}function Tt(i){return typeof i}function E(i){return Array.isArray(i)}function It(i){return typeof i=="function"}function Bt(i){return i===null||i===""}function ot(i){return arguments.length&&(i===void 0||typeof i>"u")}function M(i){return Array.isArray(i)||typeof i=="object"&&i||It(i)}function ve(i){return Bt(i)||ot(i)||i===!1||i===0||M(i)&&!Object.keys(i).length}function I(i){return It(i)||i&&{}.toString.call(i)==="[object function]"}function zt(i){return i instanceof Number||typeof i=="number"}function X(i){return zt(i)||i!==!0&&i!==!1&&i!==null&&i!==""&&!isNaN(i*1)}function Mt(i){return i instanceof String||typeof i=="string"&&i!==null}function Oe(i){return!Mt(i)&&!ot(i.length)}function ae(i,...t){return t.forEach(e=>{i.indexOf(e)<0&&i.push(e)}),i}function Se(r,t){t=t||Object.prototype,t=t&&!E(t)?[t]:t;for(var e=[],r=r;r&&(!t||t.indexOf(r)<0)&&r.name!=="default";)e.push(r),r=r?Object.getPrototypeOf(r):null;return e}function Ae(i,t){var e=[];return Se(i,t).forEach(r=>{ae(e,...Object.getOwnPropertyNames(r))}),e}function K(i,t,e=!1,r=!1,n=!1){var o=0,a=i.shift();if((X(a)||a===!0||a===!1)&&(o=a,a=i.shift()),!i.length)throw new Error("_merge() requires two or more array/objects.");return i.forEach((s,u)=>{!M(s)&&!I(s)||(e?Ae(s):Object.keys(s)).forEach(c=>{if(!!t(c,a,s,u)){var l=a[c],f=s[c];if((E(l)&&E(f)||T(l)&&T(f))&&(o===!0||o>0))a[c]=E(l)&&E(f)?[]:{},K([X(o)?o-1:o,a[c],l,f],t,e,r,n);else if(E(a)&&E(s))r?a[c]=f:a.push(f);else try{n?Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(s,c)):a[c]=s[c]}catch{}}})}),a}function Ut(...i){return K(i,(t,e,r)=>!0,!1,!1,!1)}function B(i,...t){if(!i||!["object","function"].includes(typeof i))throw new Error("Argument #1 must be of type object");let e=i[Symbol.for("wq")];if(e||(e=new ce,Object.defineProperty(i,Symbol.for("wq"),{value:e,enumerable:!1,configurable:!1,writable:!1})),!t.length)return e;let r,n;for(;r=t.shift();)(n=e)&&!(e=e.get(r))&&(e=new ce,n.set(r,e));return e}var ce=class extends Map{};function j(i,t=!0){return E(i)?i:!t&&T(i)?[i]:i!==!1&&i!==0&&ve(i)?[]:Oe(i)?Array.prototype.slice.call(i):T(i)?Object.values(i):[i]}var R=(i,...t)=>B(i,"observerAPI",...t),qt=(i,t)=>i instanceof Promise?i.then(t):t(i),le={};var gt=class{constructor(t,e){this.registry=t,Object.assign(this,{...e,target:t.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var Gt=class extends gt{constructor(){super(...arguments),this.emit.currentRegistration=this,Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal}),le.setMaxListeners?.(0,this.signal)}remove(){this.abortController.abort(),super.remove()}fire(t){if(this.emit.recursionTarget&&!["inject","force-async","force-sync"].includes(this.params.recursions))return;let e=t,r=this.filter;if(r!==1/0&&(r=j(r,!1))&&(e=t.filter(o=>r.includes(o.key))),this.params.diff&&(e=e.filter(o=>o.type!=="set"||o.value!==o.oldValue)),!e.length)return;if(["inject","defer"].includes(this.params.recursions)){if(this.emit.recursionTarget){this.emit.recursionTarget.push(...e);return}this.emit.recursionTarget=this.params.recursions==="inject"?e:[]}let n=this.filter===1/0||Array.isArray(this.filter)?this.emit(e,this):this.emit(e[0],this);return qt(n,o=>{let a=this.emit.recursionTarget;return delete this.emit.recursionTarget,this.params.recursions==="defer"&&a?.length?this.emit.currentRegistration.fire(a):o})}};var yt=class{constructor(t){this.target=t,this.entries=[]}addRegistration(t){return this.entries.push(t),t}removeRegistration(t){this.entries=this.entries.filter(e=>e!==t)}static _getInstance(t,e,r=!0,n=this.__namespace){if(!M(e))throw new Error(`Subject must be of type object; "${Tt(e)}" given!`);let o=this;return n&&R(globalThis,"observerAPI","namespaces").has(t+"-"+n)&&(o=R(globalThis,"observerAPI","namespaces").get(t+"-"+n),t+="-"+n),!R(e,"registry").has(t)&&r&&R(e,"registry").set(t,new o(e)),R(e,"registry").get(t)}static _namespace(t,e,r=null){if(t+="-"+e,arguments.length===2)return R(globalThis,"observerAPI","namespaces").get(t);if(!(r.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${e} must be a subclass of ${this.name}.`);R(globalThis,"observerAPI","namespaces").set(t,r),r.__namespace=e}};var D=class{constructor(t,e){if(this.target=t,!e.operation)throw new Error("Descriptor operation must be given in definition!");Object.assign(this,e)}};var st=class extends yt{static getInstance(t,e=!0,r=null){return super._getInstance("listeners",...arguments)}static namespace(t,e=null){return super._namespace("listeners",...arguments)}constructor(t){super(t),this.batches=[]}addRegistration(t,e,r){return super.addRegistration(new Gt(this,{filter:t,emit:e,params:r}))}emit(t,{eventsArePropertyDescriptors:e=!1,eventIsArrayMethodDescriptor:r=!1}={}){if(this.batches.length){let n=this.batches[0].params.arrayMethodName;this.batches[0].snapshots.push({events:[...t],arrayMethodName:n,eventsArePropertyDescriptors:e,eventIsArrayMethodDescriptor:r});return}this.$emit(this.entries,[{events:t,eventsArePropertyDescriptors:e,eventIsArrayMethodDescriptor:r}])}$emit(t,e){let r=0,n=0,o=0;for(let l of t)r+=1,l.params.withPropertyDescriptors&&(n+=1),l.params.withArrayMethodDescriptors&&(o+=1);let a=[],s=[],u=[],c=[];for(let l of e){let f=l.arrayMethodName,d=l.eventsArePropertyDescriptors,h=l.eventIsArrayMethodDescriptor;for(let p of l.events)if(f&&(p.operation=f),n&&(o&&a.push(p),h||o!==r&&s.push(p)),n!==r){let v=p;if(d){let{target:O,type:g,...w}=p;v=new D(O,{type:"set",...w}),Object.defineProperty(v,"value","get"in w.value?{get:()=>w.value.get()}:{value:w.value.value}),w.oldValue&&Object.defineProperty(v,"oldValue","get"in w.oldValue?{get:()=>w.oldValue.get()}:{value:w.oldValue.value})}o&&u.push(v),h||o!==r&&c.push(v)}}for(let l of t)l.params.withPropertyDescriptors?l.params.withArrayMethodDescriptors?a.length&&l.fire(a):s.length&&l.fire(s):l.params.withArrayMethodDescriptors?u.length&&l.fire(u):c.length&&l.fire(c)}batch(t,e={}){this.batches.unshift({entries:[...this.entries],snapshots:[],params:e});let r=t();return qt(r,n=>{let o=this.batches.shift();return o.snapshots.length&&this.$emit(o.entries,o.snapshots),n})}};var Qt=class extends gt{exec(t,e,r){return this.running||!this.traps[t.operation]?e(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[t.operation](t,r,(...n)=>(this.running=!1,e(...n))))}};var at=class extends yt{static getInstance(t,e=!0,r=null){return super._getInstance("traps",...arguments)}static namespace(t,e=null){return super._namespace("traps",...arguments)}addRegistration(t){return super.addRegistration(new Qt(this,t))}emit(t,e=null){let r=this;return function n(o,...a){let s=r.entries[o];return s?s.exec(t,(...u)=>n(o+1,...u),...a):e?e(t,...a):a[0]}(0)}};var Te={};_e(Te,{accessorize:()=>di,proxy:()=>Pe,unaccessorize:()=>pi,unproxy:()=>Xt});var xr=Symbol("wqOriginal");function di(i,t,e={}){i=Ce(i);let r=R(i,"accessorizedProps");function n(u){let c,l=i;do c=Object.getOwnPropertyDescriptor(l,u);while(!c&&(l=Object.getPrototypeOf(l)));return c?{proto:l,descriptor:c}:{descriptor:{value:void 0,configurable:!0,enumerable:!0,writable:!0}}}function o(u){if(r.has(u+""))return!0;let c=n(u);c.getValue=function(d=!1){return d?this.descriptor:this.descriptor.get?this.descriptor.get():this.descriptor.value},c.setValue=function(d,h=!1){if(this.dirty=!0,h){this.descriptor=d;return}return this.descriptor.set?this.descriptor.set(d)!==!1:(this.descriptor.value=d,!0)},c.intact=function(){let d=Object.getOwnPropertyDescriptor(i,u);return d?.get===f.get&&d?.set===f.set&&r.get(u+"")===this},c.restore=function(){return this.intact()?(this.proto&&this.proto!==i||!this.proto&&!this.dirty?delete i[u]:Object.defineProperty(i,u,this.descriptor),r.delete(u+""),!0):!1},r.set(isNaN(u)?u:parseInt(u),c);let{enumerable:l=!0}=c.descriptor,f={enumerable:l,configurable:!0};("value"in c.descriptor||c.descriptor.set)&&(f.set=function(d){return wt(this,u,d,e)}),("value"in c.descriptor||c.descriptor.get)&&(f.get=function(){return ct(this,u,e)});try{return Object.defineProperty(i,u,f),!0}catch{return r.delete(u+""),!1}}let s=(Array.isArray(t)?t:t===void 0?Object.keys(i):[t]).map(o);return t===void 0||Array.isArray(t)?s:s[0]}function pi(i,t,e={}){i=Ce(i);let r=R(i,"accessorizedProps");function n(s){return r.has(s+"")?r.get(s+"").restore():!0}let a=(Array.isArray(t)?t:t===void 0?Object.keys(i):[t]).map(n);return t===void 0||Array.isArray(t)?a:a[0]}function Pe(i,t={},e=void 0){let r=Ce(i);if(typeof t.membrane=="boolean")throw new Error("The params.membrane parameter cannot be of type boolean.");if(t.membrane&&R(r,"membraneRef").has(t.membrane))return R(r,"membraneRef").get(t.membrane);let n={apply:(s,u,c)=>Re(s,u,c,void 0,t),construct:(s,u,c=null)=>ke(s,u,c,t),defineProperty:(s,u,c)=>Jt(s,u,c,t),deleteProperty:(s,u)=>Yt(s,u,t),get:(s,u,c=null)=>{if(u===xr)return r;let l={...t,receiver:c},f=ct(s,u,l);return Array.isArray(s)&&typeof f=="function"&&!/^class\s?|\{\s\[native\scode\]\s\}$/.test(Function.prototype.toString.call(f))?Pe(f,{...t,arrayMethodName:u,membrane:c},e):t.chainable&&M(f)&&u!=="prototype"&&!(typeof f=="function"&&/^class\s?|\{\s\[native\scode\]\s\}$/.test(Function.prototype.toString.call(f)))?Pe(f,t,e):f},getOwnPropertyDescriptor:(s,u)=>ue(s,u,t),getPrototypeOf:s=>Ie(s,t),has:(s,u)=>fe(s,u,t),isExtensible:s=>Me(s,t),ownKeys:s=>qe(s,t),preventExtensions:s=>Ne(s,t),set:(s,u,c,l=null)=>wt(s,u,c,{...t,receiver:l}),setPrototypeOf:(s,u)=>je(s,u,t)},o=e?.(n)||n,a=new Proxy(r,o);return t.membrane&&R(r,"membraneRef").set(t.membrane,a),a}function Xt(i){return i&&i[xr]||i}function Ce(i){if(!i||!M(i))throw new Error("Target must be of type object!");return Xt(i)}var Zt=class extends Array{};function hi(...i){return new Zt(...i)}var bt=class extends Array{};function mi(){return new bt}function gi(){return 1/0}function De(i,t,e,r=o=>o,n={}){let o=t instanceof bt;if(!(!o&&!t?.length))return function a(s,u,c,l){let f=l||u[c.level]instanceof bt,d=f?1/0:u[c.level],h=f?!1:c.level===u.length-1;return s instanceof D&&s.operation!=="get"?c={...c,probe:"always"}:c.probe!=="always"&&(c={...c,probe:!h}),e(s,d,(p,...v)=>{let O=b=>{b instanceof D&&(b.path="key"in b?[b.key]:[],s instanceof D&&(b.path="key"in b?s.path.concat(b.key):s.path.slice(0),Object.defineProperty(b,"context",{get:()=>s,configurable:!0})))},g=v[0]||{},w=b=>{if(b instanceof D&&"argumentsList"in b)return;let y=tt(b,!1);return qt(y,m=>(b instanceof D?b.value=m:b=m,a(b,u,{...c,...g,keyInParent:b.key,level:c.level+1},f)))};if(Kt(d)&&Array.isArray(p)){if(p.forEach(O),h)return r(p,...v);f&&p[0]instanceof D&&(p[0].operation!=="get"||n.asGet)&&r(p,...v);for(let b of p)w(b);return}return O(p),h?r(p,...v):w(p)},c)}(i,t.slice(0),{...n,level:0},o)}function Le(i,t,e,r={}){let n=tt(i,!r.level);if(I(arguments[1])&&([,e,r={}]=arguments,t=1/0),!I(e))throw new Error(`Handler must be a function; "${Tt(e)}" given!`);if(t instanceof Zt||t instanceof bt)return De(n,t,Le,e,r);if(r={...r,descripted:!0},delete r.live,!M(n))return r.probe&&ct(n,t,e,r)||void 0;let o=_r(n,t,e,r);return r.probe?ct(n,t,o,r):o()}function yi(i,t,e={}){let r=tt(i);return T(t)||([,,,e={}]=arguments,t={[arguments[1]]:arguments[2]}),at.getInstance(r,!0,e.namespace).addRegistration({traps:t,params:e})}function ue(i,t,e=n=>n,r={}){return Z(i,"getOwnPropertyDescriptor",{key:t},e,r)}function wi(i,t,e=n=>n,r={}){return Z(i,"getOwnPropertyDescriptors",{key:t},e,r)}function Ie(i,t=r=>r,e={}){return Z(i,"getPrototypeOf",{},t,e)}function Me(i,t=r=>r,e={}){return Z(i,"isExtensible",{},t,e)}function qe(i,t=r=>r,e={}){return Z(i,"ownKeys",{},t,e)}function fe(i,t,e=n=>n,r={}){return Z(i,"has",{key:t},e,r)}function ct(i,t,e=n=>n,r={}){let n,o=tt(i,!r.level);return T(e)?[r,e]=[e,a=>a]:r.live&&(n=!0),t instanceof Zt||t instanceof bt?De(o,t,ct,e,{...r,asGet:!0}):vi(o,t,a=>{let s=[...a];return function u(c,l,f){if(!l.length)return f(c);let d=l.shift();if(!["string","number","symbol"].includes(typeof d))throw new Error(`Property name/key ${d} invalid.`);function h(O,g=void 0){let w=m=>(O.value=m,u([...c,r.live||r.descripted?O:m],l,f));if(arguments.length>1)return w(g);if(!M(o))return w(o?.[O.key]);let b=R(o,"accessorizedProps",!1),y=b&&b.get(O.key);if(y&&y.intact())return w(y.getValue(r.withPropertyDescriptors));if(r.withPropertyDescriptors){let m=Object.getOwnPropertyDescriptor(o,O.key);return w(m)}return w(Reflect.get(o,O.key))}let p=new D(o,{type:"get",key:d,value:void 0,operation:"get",related:s});if(!M(o))return h(p);let v=at.getInstance(o,!1,r.namespace);return v?v.emit(p,h):h(p)}([],a.slice(0),u=>{let c=Kt(t)?u:u[0];return n&&M(o)?_r(o,t,e,r,i.key)(c):e(c)})},r)}function He(i,t,e={}){let r=tt(i);return st.getInstance(r,!0,e.namespace).batch(t,e)}function bi(i,t,e={}){t=tt(t),i=tt(i);let r=(e.only||[]).slice(0),n=(e.except||[]).slice(0),o=Object.keys(e.spread?[...i]:i).map(c=>isNaN(c)?c:parseInt(c)),a=r.length?r.filter(c=>o.includes(c)):o.filter(c=>!n.includes(c)),s=c=>!Array.isArray(t)||isNaN(c)?c:c-n.filter(l=>l<c).length,u=c=>{let l=ue(i,c,e);"value"in l&&l.writable&&l.enumerable&&l.configurable?wt(t,s(c),l.value,e):(l.enumerable||e.onlyEnumerable===!1)&&Jt(t,c,{...l,configurable:!0},e)};return He(t,()=>{a.forEach(u)}),Le(i,c=>{c.filter(l=>r.length?r.includes(l.key):!n.includes(l.key)).forEach(l=>{if(l.type==="delete")return Yt(t,s(l.key),e);if(l.type==="def"){(l.value.enumerable||e.onlyEnumerable===!1)&&Jt(t,s(l.key),{...l.value,configurable:!0},e);return}u(l.key)})},{...e,withPropertyDescriptors:!0})}function wt(i,t,e,r=a=>a,n={},o=!1){let a=tt(i),s=[[t,e]];T(t)&&([,,r=c=>c,n={},o=!1]=arguments,s=Object.entries(t)),T(r)&&([o,n,r]=[typeof n=="boolean"?n:o,r,c=>c]);let u=s.map(([c])=>c);return function c(l,f,d){if(!f.length)return d(l);let[h,p]=f.shift();function v(g,w=void 0){let b=_=>(g.status=_,c(l.concat(g),f,d));if(arguments.length>1)return b(g,w);let y=R(a,"accessorizedProps",!1),m=y&&y.get(g.key);return g.type==="def"?(m&&!m.restore()&&b(!1),Object.defineProperty(a,g.key,g.value),b(!0)):m&&m.intact()?b(m.setValue(g.value)):b(Reflect.set(a,g.key,g.value))}function O(g,w){if(n.diff&&p===w)return c(l,f,d);let b=new D(a,{type:o?"def":"set",key:h,value:p,isUpdate:g,oldValue:w,related:[...u],operation:o?"defineProperty":"set",detail:n.detail}),y=at.getInstance(a,!1,n.namespace);return y?y.emit(b,v):v(b)}return fe(a,h,g=>{if(!g)return O(g);if(h==="length"&&Array.isArray(a)&&R(a).has("$length"))return O(!0,R(a).get("$length"));let w={...n,withPropertyDescriptors:o};return ct(a,h,b=>O(g,b),w)},n)}([],s.slice(0),c=>{let l=st.getInstance(a,!1,n.namespace);return l&&l.emit(c,{eventsArePropertyDescriptors:!!o}),r(Kt(t)?c.map(f=>f.status):c[0]?.status)})}function Jt(i,t,e,r=o=>o,n={}){return wt(i,t,e,r,n,!0)}function xi(i,t,e=n=>n,r={}){return wt(i,t,e,r,!0)}function Yt(i,t,e=n=>n,r={}){let n=tt(i);T(e)&&([r,e]=[e,s=>s]);let o=j(t,!1),a=[...o];return function s(u,c,l){if(!c.length)return l(u);let f=c.shift();function d(p,v=void 0){let O=b=>(p.status=b,s(u.concat(p),c,l));if(arguments.length>1)return O(p,v);let g=R(n,"accessorizedProps",!1),w=g&&g.get(p.key);return w&&!w.restore()&&O(!1),O(Reflect.deleteProperty(n,p.key))}function h(p){let v=new D(n,{type:"delete",key:f,oldValue:p,related:[...a],operation:"deleteProperty",detail:r.detail}),O=at.getInstance(n,!1,r.namespace);return O?O.emit(v,d):d(v)}return ct(n,f,h,r)}([],o.slice(0),s=>{let u=st.getInstance(n,!1,r.namespace);return u&&u.emit(s),e(Kt(t)?s.map(c=>c.status):s[0].status)})}function _i(i,t,e=n=>n,r={}){return Yt(...arguments)}function ke(i,t,e=null,r=o=>o,n={}){return Z(i,"construct",arguments.length>2?{argumentsList:t,newTarget:e}:{argumentsList:t},r,n)}function Re(i,t,e,r=o=>o,n={}){let o=Xt(t),a;if(Array.isArray(t)){if(n.arrayMethodName){let s=new D(o,{operation:n.arrayMethodName,argumentsList:e});st.getInstance(o,!1,n.namespace)?.emit([s],{eventIsArrayMethodDescriptor:!0})}R(o).set("$length",o.length),a=He(o,()=>Z(i,"apply",{thisArgument:t,argumentsList:e},r,n),n),R(o).delete("$length")}else a=Z(i,"apply",{thisArgument:o,argumentsList:e},r,n);return a}function je(i,t,e=n=>n,r={}){return Z(i,"setPrototypeOf",{proto:t},e,r)}function Ne(i,t=r=>r,e={}){return Z(i,"preventExtensions",{},t,e)}function _r(i,t,e,r={}){let n=new AbortController;le.setMaxListeners?.(0,n.signal),r.signal&&r.signal.addEventListener("abort",()=>n.abort());let o={...r,signal:n.signal},a=st.getInstance(i,!0,o.namespace),s=new Map;return function u(c=[],l=null){let f,d,h;if(Kt(t)){if(l){h=!0,d=l;for(let p of c)s.get(p.key)?.remove(),s.delete(p.key)}else d=a.addRegistration(t,u,o);f={signal:d.signal,childRegistrations:s}}else l?.remove(),d=a.addRegistration(t,u,o),f={signal:d.signal};if(o.childRegistrations&&o.keyInParent&&o.childRegistrations.set(o.keyInParent,d),arguments.length){let p=e(c,f);if(arguments.length>1)return p}return n}}function Z(i,t,e={},r=o=>o,n={}){i=tt(i),T(r)&&([n,r]=[r,u=>u]);function o(u,c){return arguments.length>1?r(c):r((Reflect[t]||Object[t])(i,...Object.values(e)))}let a=new D(i,{operation:t,...e}),s=at.getInstance(i,!1,n.namespace);return s?s.emit(a,o):o(a)}function Kt(i){return i===1/0||Array.isArray(i)}function tt(i,t=!0,e=!0){if((!i||!M(i))&&t)throw new Error(`Object must be of type object or array! "${Tt(i)}" given.`);return i instanceof D&&(i.type==="def"&&e?i=typeof i.value.get=="function"?i.value.get():i.value.value:i=i.value),i&&Xt(i)}function vi(i,t,e,r={}){return t===1/0?r.level&&!M(i)?e([]):e(Object.entries(Object.getOwnPropertyDescriptors(i)).filter(([,n])=>n.writable!==!1&&!n.get&&!n.set).map(([n])=>n)):e(j(t,!1))}var Oi={...Fe,...Te},P=Oi;var We=(i,...t)=>{let e=t.pop();if(i.constructor.name==="AsyncFunction")return G(i.call(...t),e);try{return e(i.call(...t))}catch(r){return e(void 0,r)}},G=(i,t)=>i instanceof Promise?i.then(t).catch(e=>t(void 0,e)):t(i),Ve=i=>typeof i=="object"&&i||typeof i=="function";function vr(i){let t=typeof i[i.length-1]=="object"?i.pop():{},e=i.pop()||"";return t.functionParams=i,{source:e,params:t}}var Or={};function kt(...i){let t,e={runtimeParams:$i,compilerParams:Ai,parserParams:Si};for(;t=i.shift();){let{runtimeParams:r={},compilerParams:{globalsNoObserve:n=[],globalsOnlyPathsExcept:o=[],...a}={},parserParams:s={}}=t;e={runtimeParams:{...e.runtimeParams,...r},compilerParams:{...e.compilerParams,globalsNoObserve:[...e.compilerParams.globalsNoObserve,...n],globalsOnlyPathsExcept:[...e.compilerParams.globalsOnlyPathsExcept,...o],...a},parserParams:{...e.parserParams,...s}},i.devMode}return e}var Si={ecmaVersion:"latest",allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!1,allowSuperOutsideMethod:!1,preserveParens:!1,locations:!0},Ai={globalsNoObserve:["arguments","debugger"],globalsOnlyPathsExcept:[],originalSource:!0,locations:!0,compact:2},$i={apiVersion:3};var te=Object.create(null);var xt=class extends EventTarget{managedAlways=new Set;managedOnce=new Set;constructor(){super(),Or.setMaxListeners?.(0,this)}fire(t){return this.dispatchEvent(new Event(t,{cancelable:!0}))}on(...t){return this.addEventListener(...t),()=>this.removeEventListener(...t)}abort(t=!1){this.managedAlways.forEach(e=>e.abort?e.abort(t):e(t)),this.managedOnce.forEach(e=>e.abort?e.abort(t):e(t)),this.managedOnce.clear(),this.fire("abort")}manage(t){this.managedAlways.add(t)}once(t){this.managedOnce.add(t)}};var _t=class extends xt{subscribers=new Set;signals=new Map;constructor(t,e,r){super(),this.context=t,this.context?.once(()=>this.abort()),this.once(()=>this.watchMode(!1)),this.type=e,this.state=r}get name(){return[...this.context?.signals.keys()||[]].find(t=>this.context.signals.get(t)===this)}signal(t,e="prop"){let r=this.signals.get(t);return r||(r=new _t(this,e,e==="object"?t:Ve(this.state)?P.get(this.state,t):void 0),this.signals.set(t,r),this.signals.size===1&&this.watchMode(),r.once(()=>{this.signals.delete(t),this.signals.size||this.watchMode(!1)})),r}subscribe(t){this.subscribers.add(t),t.once(()=>{this.subscribers.delete(t),this.subscribers.size||this.abort()})}watchMode(t=!0){this.mutationsWatch?.abort(),!(!t||!this.signals.size||!Ve(this.state))&&(this.mutationsWatch=P.observe(this.state,e=>{let r={map:new Map,add(o,a){for(let s of o)s.spec.beforeSchedule?.(a)!==!1&&(this.map.has(s.runtime)||this.map.set(s.runtime,new Set),this.map.get(s.runtime).add(s))}};for(let o of e){let a=this.signals.get(o.key);!a||(r.add(a.subscribers,o),a.refresh(o.value))}let n=r.map.size?[...r.map].sort((o,a)=>o.$serial>a.$serial?-1:1):r.map;for(let[o,a]of n)o.state!=="aborted"&&o.schedule(...a)},{recursions:"force-sync"}))}refresh(t){this.state=t;for(let[e,r]of this.signals)r.refresh(P.get(this.state??{},e));this.watchMode()}};var V=class extends _t{symbols=new Map;constructor(t,e,r=void 0){super(t,e,r||Object.create(null))}};var et=class extends xt{state;constructor(t,e,r,n,o,a){super(),t?.once(this),this.context=t,this.type=e,this.spec=r||{},this.scope=o,t?.scope!==o&&this.manage(o),this.serial=n,a&&(this.closure=a),t?.type==="iteration"?this.path=t.path.concat(this.spec.index):t?.type==="round"?this.path=t.path.concat(this.serial):this.path=(t?.path||[]).slice(0,-1).concat(this.serial),this.flowControl=new Map}get runtime(){return this.context.runtime}contains(t){return this===t.context||t.context&&this.contains(t.context)}order(t){if(!t)return this;let[e,r]=t.path.length<this.path.length?[t,this]:[this,t];return e.path.reduce((n,o,a)=>n&&o<=r.path[a],!0)&&e||r}beforeExecute(){this.state="running";let t=this.flowControl;return this.flowControl=new Map,t}execute(t=null){return this.runtime.thread.unshift(this),G(this.beforeExecute(),e=>We(this.closure,this,this,(r,n)=>n?this.throw(n,[this.serial,this.context?.serial],n.code):(this.spec.complete&&(r=this.spec.complete(r,this)),this.afterExecute(e),this.runtime.thread.shift(),t?t(r,this):r)))}throw(t,e,r){if(this.type==="function"&&["HandlerFunction","FinalizerFunction"].includes(this.$params.executionMode))return this.$params.lexicalContext.throw(t,e,r);if(this.spec.handler)return this.spec.handler(t);if(this.type!=="function"&&this.context)return this.context.throw(t,e,r);if(t.cause)throw t;let n=`${t.message||t}`,o=r!==null?`[${r}]: ${n}`:n,a=e.map(l=>l!==-1&&this.extractSource(l,!0)).filter(l=>l);a.push({source:this.runtime.$params.originalSource});let s=globalThis[t.name],u=new(s||Error)(o,{cause:a}),c=this.runtime.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace||this.$params.fileName;throw c&&(u.fileName=c),r&&(u.code=r),u}afterExecute(t){this.state="complete";let e=this.flowControl;this.spec.finalizer&&this.spec.finalizer(),this.handleDownstream(e.size,t.size),this.handleRightstream(e.size,t.size);for(let r of["break","continue","return"])e.has(r)&&!e.get(r).endpoint?this.hoistFlowControl(r,e.get(r).arg):t.has(r)&&!t.get(r).endpoint&&this.hoistFlowControl(r,t.get(r).arg,!0)}typed(t,e,r=void 0){let n=Array.isArray(e)?"array":e===null?"null":typeof e;if(n===t||t==="iterable"&&e?.[Symbol.iterator]||t==="desctructurable"&&!["undefined","null"].includes(n))return e;throw t==="iterable"?new Error("value is not iterable."):t==="desctructurable"?new Error((r?`Cannot access ${r}; `:"")+"object not desctructurable."):new Error(`value must be of type ${t}.`)}let(t,e,r,n={}){return this.var(t,e,r,{...n,kind:"let"})}const(t,e,r,n={}){return this.var(t,e,r,{...n,kind:"const"})}var(t,e,r,n={}){n={kind:"var",...n},r||(r=()=>{});let o=n.restOf?(...s)=>{try{return r(...s)}catch(u){throw new Error(`Cannot declare ${t}; ${u.message}`)}}:r,a=(s,u)=>{let c=u.scope;if(n.kind==="var")for(;!["module","function"].includes(c.type)&&!P.has(c.state,t)&&c.context;)c=c.context;else c.type==="this"&&c.context&&(c=c.context);let l=c.symbols.get(t);if(l&&(l.kind!==n.kind||n.kind==="let"&&l.serial!==e))throw new Error(`Identifier "${t}" has already been declared.`);l?.reader?.abort(),l={serial:e,kind:n.kind};let f=s;return n.restOf&&(n.type==="array"?f=[]:f={},l.reader=P.map(s,f,{except:n.restOf,spread:n.type==="array"}),u.once(l.reader)),c.symbols.set(t,l),P.set(c.state,t,f),f};return this.autorun(n.kind,{complete:a,...n},e,o)}update(t,e,r={}){let n=this.scope;for(;n&&!P.has(n.state,t);)n=n.context;if(!n)throw new ReferenceError(`${t} is not defined.`);let o=n.symbols.get(t);if(o?.kind==="const")throw new ReferenceError(`Assignment to constant variable "${t}".`);let a=P.get(n.state,t),s=r.restOf?(...u)=>{try{return e(...u)}catch(c){throw new Error(`Cannot update ${t}; ${c.message}`)}}:e;return We(s,void 0,a,(u,c)=>{if(c)return this.throw(c,[this.serial]);o?.reader?.abort();let l=u;return r.restOf&&(o=o||{},r.type==="array"?l=[]:l={},o.reader=P.map(u,l,{except:r.restOf,spread:r.type==="array"}),this.once(o.reader)),P.set(n.state,t,l),["postinc","postdec"].includes(r.kind)?a:l})}ref(t,...e){let r=0,n={};typeof e[0]=="number"?(r=e.shift(),n=e.shift()||{}):typeof e[0]=="object"&&(n=e.shift());let o=this.scope;for(;o&&!P.has(o.state,t);)o=o.context;if(!o){if(n.isTypeCheck)return;throw new Error(`${t} is not defined.`)}let a=o.symbols.get(t)?.kind,s=o.signal(t,a);return n.typed&&this.typed(n.typed,s.state,t),this.autobind(s,r,n)}obj(t,...e){let r=0,n={};return typeof e[0]=="number"?(r=e.shift(),n=e.shift()||{}):typeof e[0]=="object"&&(n=e.shift()),this.autobind(this.runtime.$objects.signal(t,"object"),r,n)}autobind(t,e,r){let n=["QuantumProgram","QuantumFunction"].includes(this.runtime.$params.executionMode),o=t.type==="const",a=this===this.runtime,s=this.state==="aborted",u=this.spec.static,c=this;return function l(f,d){if(n&&!u&&!o&&!a&&!s&&f.subscribe(c),!d||!f.state||typeof f.state!="object"){let p=f.state;return typeof f.state=="function"&&!/^class\s?/.test(Function.prototype.toString.call(f.state))&&(p=P.proxy(f.state,{membrane:f})),p}let h;return P.proxy(f.state,{},p=>({...p,get(v,O,g=null){return h?p.get(v,O,g):(h=!0,l(f.signal(O),d-1))}}))}(t,e)}autorun(t,...e){let r=e.pop(),n=e.pop(),o=e.pop()||{},a=et,s=this.scope;if(t==="iteration"){let c=this.runtime.constructor;a=r.constructor.name==="AsyncFunction"?c.AutoAsyncIterator:c.AutoIterator}["block","switch","iteration"].includes(t)&&(s=new V(s,t));let u=new a(this,t,o,n,s,r);if(t==="downstream"){if(this.downstream=u,this.flowControlApplied())return}else if(this.type==="switch"&&this.breakpoint)return;return u.execute()}function(t,e,r,n){e==="Declaration"&&P.set(this.scope.state,n.name,n);let o=this;return Object.defineProperty(n,"toString",{value:function(a=!1){if(a&&t==="QuantumFunction")return Function.prototype.toString.call(n);let s=o.runtime.extractSource(r);return s.startsWith("static ")?s.replace("static ",""):s}}),n}class(t,e,r){return t==="Declaration"&&P.set(this.scope.state,e.name,e),r.forEach(({name:n,isQuantumFunction:o,static:a,serial:s})=>{this.function(o&&"QuantumFunction"||"RegularFunction","Expression",s,a?e[n]:e.prototype[n])}),e}async import(...t){return this.runtime.import(...t)}async export(...t){return this.runtime.export(...t)}continue(t){return this.applyFlowControl("continue",t)}break(t){return this.applyFlowControl("break",t)}return(t){return this.applyFlowControl("return",t)}applyFlowControl(t,e,r=!1){let n=this.flowControl.size;if(r?this.flowControl.delete(t):this.flowControl.set(t,{arg:e}),this.type==="round"&&(this.context.breakpoint=this),this.type==="round"&&["break","continue"].includes(t)&&e===this.context?.spec.label){r||(this.flowControl.get(t).endpoint=!0),this.state!=="running"&&this.handleRightstream(this.flowControl.size,n);return}if(this.context?.type==="switch"&&t==="break"&&!e){r||(this.flowControl.get(t).endpoint=!0),this.context.breakpoint=this;return}this.state!=="running"&&(this.handleDownstream(this.flowControl.size,n),this.hoistFlowControl(...arguments))}hoistFlowControl(...t){return this.context?.applyFlowControl(...t)}flowControlApplied(t,e){return arguments.length?arguments.length===1?this.flowControl.has(t):this.flowControl.get(t)?.arg===e:this.flowControl.size||!1}handleDownstream(t,e){let r;!["block"].includes(this.type)||!(r=this.context?.downstream)||(t?r.abort():e&&(r.state="resuming",this.runtime.schedule(r)))}handleRightstream(t,e){if(this.type!=="round")return;let r=this,n=new Set;for(;r=r.nextRound;)t?r.abort():e&&r.state!=="inert"&&(r.state="resuming",n.add(r));n.size&&this.runtime.schedule(...n),!t&&e&&this.runtime.on("reflection",()=>{this.context.iterating||this.context.iterate()},{once:!0})}abort(t=!1){return t&&(this.context?.breakpoint===this&&delete this.context.breakpoint,this.flowControl.clear()),this.state=t?"inert":"aborted",super.abort(t)}};var vt=class extends et{rounds=new Map;constructor(t,e,r,n,o,a){r.$closure=a,super(t,e,r,n,o),this.manage(()=>{delete this.breakpoint,this.rounds.clear()})}pseudorun(t){return this.runtime.iThread.unshift(this),G(t(),e=>(this.runtime.iThread.pop(),e))}createIterator(){return this.spec.kind==="for-in"?function*(){for(let t in this.iteratee)yield t}.call(this):this.spec.kind==="for-of"?function*(){for(let t of this.iteratee)yield t}.call(this):{next:()=>({done:!this.pseudorun(()=>this.spec.test(this))})}}closure(){["for-of","for-in"].includes(this.spec.kind)?([this.production,this.iteratee]=this.spec.parameters(this),this.iterator=this.createIterator(),this.iterator.original=!0,this.watchMode()):(this.spec.kind==="for"&&this.spec.init(this),this.iterator=this.createIterator()),this.iterate()}terminated(){return this.breakpoint&&!this.breakpoint.flowControlApplied("continue",this.spec.label)&&this.breakpoint.flowControlApplied()}advance(){this.spec.kind==="for"&&this.pseudorun(()=>this.spec.advance(this))}iterate(){this.iterating=!0;let t=()=>!this.terminated()&&!(this.cursor=this.iterator.next()).done,e=()=>{this.createRound(this.cursor.value).execute(),this.advance()};if(this.spec.kind==="do-while")do e();while(t());else for(;t();)e();this.iterating=!1}createRound(t){let e=this.rounds.size,r={index:e},n=["for-in","for-of"].includes(this.spec.kind)?{[this.production]:t}:{...this.scope.state},o=new V(this.scope,"round",n);this.scope.symbols.forEach((u,c)=>{o.symbols.set(c,u)});let a=new et(this,"round",r,this.serial,o,this.spec.$closure),s=this.spec.kind==="for-in"?t:e;return this.rounds.set(s,a),this.lastRound&&(this.lastRound.nextRound=a,a.prevRound=this.lastRound),this.lastRound=a,a}watchMode(){if(this.spec.static)return;let t=(e,r)=>{let n=new Set,o=new Set;for(let a of e){if(Array.isArray(this.iteratee)&&a.key==="length")continue;let s=this.spec.kind==="for-in"?a.key:a.value,u=this.spec.kind==="for-in"?a.key:parseInt(a.key),c=this.rounds.get(u);if(c)P.set(c.scope.state,this.production,s),a.type==="delete"&&(this.rounds.set(u,void 0),c.prevRound&&(c.prevRound.nextRound=c.nextRound),c.nextRound&&(c.nextRound.prevRound=c.prevRound),n.add(c));else if(a.type!=="delete"&&!a.isUpdate){if(this.spec.kind==="for-of"&&this.iterator.original&&!r.done)continue;o.add(s)}}this.runtime.on("reflection",()=>{n.forEach(a=>a.abort(!0))},{once:!0}),o.size&&(this.iterator=function*(a){yield*a,yield*o}(this.iterator),r.done&&this.iterate())};this.once(P.observe(this.iteratee,e=>{G(this.cursor,r=>t(e,r))}))}};var ee=class extends vt{async createIterator(){return this.spec.kind==="for-in"?function*(){for(let t in this.iteratee)yield t}.call(this):this.spec.kind==="for-of"?function*(){for(let t of this.iteratee)yield t}.call(this):{next:async()=>({done:!await this.pseudorun(()=>this.spec.test(this))})}}async closure(){["for-of","for-in"].includes(this.spec.kind)?([this.production,this.iteratee]=await this.spec.parameters(this),this.iterator=await this.createIterator(),this.iterator.original=!0,this.watchMode()):(this.spec.kind==="for"&&await this.spec.init(this),this.iterator=await this.createIterator()),await this.iterate()}async iterate(){let t;this.iterating=!0;let e=async()=>!this.terminated()&&(this.cursor=this.iterator.next())&&(t=await this.cursor)&&!t.done,r=async()=>{await this.createRound(t.value).execute(),await this.advance()};if(this.spec.kind==="do-while")do await r();while(await e());else for(;await e();)await r();this.iterating=!1}};var Ot=class{constructor(t){Object.defineProperty(this,"runtime",{value:t});let e={statechange:()=>{P.defineProperty(this,"value",{value:t.flowControl.get("return")?.arg,enumerable:!0,configurable:!0})}};for(let r in e)t.on(r,e[r]),e[r]();t.$params.sourceType==="module"&&Object.defineProperty(this,"exports",{value:t.exports})}dispose(){return this.runtime.abort(!0)}};var St=class extends et{locations=[];queue=new Set;thread=[];iThread=[];constructor(t,e,r,n,o){let{$serial:a=0,spec:s,...u}=r;super(t,e,s,-1,n,o),this.$serial=a,this.$params=u,this.$objects=new V(void 0,"objects"),this.manage(this.$objects),this.exports=Object.create(null),this.$promises={imports:[],exports:[]},this.manage(()=>{P.deleteProperties(this.exports,Object.keys(this.exports)),this.$promises.imports.splice(0),this.$promises.exports.splice(0)})}extractSource(t,e=!1){let[[r,n,o],[a]]=this.locations[t],s=this.$params.originalSource.slice(r,a);return e?{expr:s,line:n,column:o}:s}get runtime(){return this}get nowRunning(){return this.thread[0]}schedule(...t){let e=this.queue.size;for(let r of t)this.queue.add(r);if(!e)return this.flowControlDirty=!1,function r(n,o){let a;for(let s of this.queue){if(o&&o.order(s)!==o||["aborted","running"].includes(s.state)||this.iThread[0]?.contains(s)){this.queue.delete(s);continue}a=a?a.order(s):s,o||(o=a)}return a?(a.abort(),a.execute(s=>(this.queue.delete(a),r.call(this,s,a)))):(this.fire("reflection"),this.flowControlApplied()&&this.fire("statechange"),n)}.call(this,void 0,this.nowRunning)}execute(t=null){return super.execute(e=>{let n=["QuantumProgram","QuantumFunction"].includes(this.$params.executionMode)?new Ot(this):this.flowControl.get("return")?.arg;return t?t(n,this):n})}spawn(t,e,r,n=null){let o=this.nowRunning||n||this,a={...this.$params,$serial:this.$serial+1,executionMode:t,lexicalContext:n},s=new V(o.scope,"function",{this:e});return new this.constructor(o,"function",a,s,r).execute()}async import(...t){let e=t.pop(),r=typeof e=="string"?{source:e}:e,n=a=>{if(r.forExport||r.isDynamic)return a;this.assignModules(t,this.scope.state,a,e.serial)};if(this.$params.experimentalFeatures!==!1&&te[r.source])return n(te[r.source]);let o=(async()=>{let a=this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace||this.$params.fileName;try{return n({...await import(r.source)})}catch(s){s.code==="ERR_MODULE_NOT_FOUND"?this.throw(new Error(`Cannot find module "${r.source}"${a?` imported at "${a}"`:""}.`),[r.serial],s.code):this.throw(s,[r.serial],s.code)}})();return r.isDynamic||this.$promises[r.forExport?"exports":"imports"].push(o),o}async export(...t){let e=Array.isArray(t[t.length-1])?null:t.pop(),r=e?await this.import({...e,forExport:!0}):this.scope.state;this.assignModules(t,this.exports,r,e?.serial)}assignModules(t,e,r,n=null){let o=[],a=["QuantumProgram","QuantumFunction"].includes(this.$params.executionMode);for(let[s,u,c]of t){if(s==="*"&&c){(a?P:Reflect).set(e,c,r);continue}P.has(r,s)||this.throw(new Error(`The requested module does not provide an export named "${s}".`),[u,n]),(a?P:Reflect).set(e,c||s,P.get(r,s)),o.push([s,u,c])}!o.length||!a||this.once(P.observe(r,s=>{for(let[u,,c]of o)for(let l of s)u==="*"?P.set(e,l.key,l.value):l.key===u&&P.set(e,c||u,l.value)}))}afterExecute(...t){return this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace&&(te[this.$params.exportNamespace]=this.exports,this.once(()=>{delete te[this.$params.exportNamespace]})),super.afterExecute(...t)}};W(St,"AutoAsyncIterator",ee),W(St,"AutoIterator",vt);function de(i,t,e,r){let{env:n,functionParams:o=[],exportNamespace:a,fileName:s}=r,{parserParams:u,compilerParams:c,runtimeParams:l}=kt(r),f=Object.getOwnPropertyDescriptor(globalThis,"window")?.get?.toString().includes("[native code]")??!1,d=["async-script","module"].includes(i);if(i==="module")u.sourceType=i,u.allowAwaitOutsideFunction=!0;else if(["function","async-function"].includes(i)){let p=" "+e.split(`
2
2
  `).join(`
3
3
  `);e=`return ${i==="async-function"?"async ":""}function**(${o.join(", ")}) {
4
4
  ${p}
@@ -29,7 +29,7 @@ ${p}
29
29
  ${m==="in"&&y[1]?`let /*value*/${y[1]} = $iteratee__[ ${y[0]} ];`:""}
30
30
  let $itemBinding__ = { ${y.join(", ")} };
31
31
 
32
- let $key___ = ( ${m==="in"?y[0]:x} ) + '';
32
+ const $key___ = ( ${m==="in"?y[0]:x} ) + '';
33
33
  let $itemNode__ = $existing__.get( $key___ );
34
34
  if ( $itemNode__ ) {
35
35
  $existing__.delete( $key___ );