@instantdb/platform 0.22.146 → 0.22.147

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.
@@ -1,17 +1,17 @@
1
1
 
2
- > @instantdb/platform@0.22.146 build /home/runner/work/instant/instant/client/packages/platform
2
+ > @instantdb/platform@0.22.147 build /home/runner/work/instant/instant/client/packages/platform
3
3
  > rm -rf dist; npm run build:tshy && npm run build:standalone && npm run check-exports
4
4
 
5
5
  npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
6
6
  npm warn Unknown user config "always-auth". This will stop working in the next major version of npm.
7
7
 
8
- > @instantdb/platform@0.22.146 build:tshy
8
+ > @instantdb/platform@0.22.147 build:tshy
9
9
  > tshy
10
10
 
11
11
  npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
12
12
  npm warn Unknown user config "always-auth". This will stop working in the next major version of npm.
13
13
 
14
- > @instantdb/platform@0.22.146 build:standalone
14
+ > @instantdb/platform@0.22.147 build:standalone
15
15
  > vite build
16
16
 
17
17
  vite v5.4.14 building for production...
@@ -21,15 +21,15 @@ rendering chunks...
21
21
  computing gzip size...
22
22
  dist/standalone/index.umd.cjs 354.53 kB │ gzip: 96.92 kB
23
23
  dist/standalone/index.js 462.88 kB │ gzip: 109.34 kB
24
- ✓ built in 2.97s
24
+ ✓ built in 3.10s
25
25
  npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
26
26
  npm warn Unknown user config "always-auth". This will stop working in the next major version of npm.
27
27
 
28
- > @instantdb/platform@0.22.146 check-exports
28
+ > @instantdb/platform@0.22.147 check-exports
29
29
  > attw --pack .
30
30
 
31
31
 
32
- @instantdb/platform v0.22.146
32
+ @instantdb/platform v0.22.147
33
33
 
34
34
  Build tools:
35
35
  - @arethetypeswrong/cli@^0.17.4
@@ -838,7 +838,7 @@ class Ve extends qt {
838
838
  }
839
839
  }
840
840
  typeof window < "u" && typeof window.localStorage < "u" && (window.localStorage.getItem("devBackend"), window.localStorage.getItem("__instantLogging"), window.localStorage.getItem("__devtoolLocalDash"));
841
- const Ue = "v0.22.146";
841
+ const Ue = "v0.22.147";
842
842
  class Q {
843
843
  constructor(t, s, e, i = { indexed: !1, unique: !1 }) {
844
844
  m(this, "valueType");
@@ -1,4 +1,4 @@
1
- (function(A,v){typeof exports=="object"&&typeof module<"u"?v(exports):typeof define=="function"&&define.amd?define(["exports"],v):(A=typeof globalThis<"u"?globalThis:A||self,v(A.instant={}))})(this,function(A){"use strict";var Xn=Object.defineProperty;var ki=A=>{throw TypeError(A)};var Gn=(A,v,N)=>v in A?Xn(A,v,{enumerable:!0,configurable:!0,writable:!0,value:N}):A[v]=N;var m=(A,v,N)=>Gn(A,typeof v!="symbol"?v+"":v,N),vi=(A,v,N)=>v.has(A)||ki("Cannot "+N);var T=(A,v,N)=>(vi(A,v,"read from private field"),N?N.call(A):v.get(A)),xe=(A,v,N)=>v.has(A)?ki("Cannot add the same private member more than once"):v instanceof WeakSet?v.add(A):v.set(A,N),Pe=(A,v,N,Be)=>(vi(A,v,"write to private field"),Be?Be.call(A,N):v.set(A,N),N);var se,Y,Pt,gt,bt,F,j;class v extends Error{constructor(s){super(s.message);m(this,"error");m(this,"errorDescription");const e=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,v),this.name="InstantOAuthError",this.error=s.error,this.errorDescription=s.errorDescription}get[Symbol.toStringTag](){return"InstantAPIError"}}const N={Remove:"remove",Replace:"replace",Add:"add"},Be=Symbol.for("__MUTATIVE_PROXY_DRAFT__"),Ge=Symbol.iterator,Z={mutable:"mutable",immutable:"immutable"},Tt={};function Re(r,t){return r instanceof Map?r.has(t):Object.prototype.hasOwnProperty.call(r,t)}function cs(r,t){if(t in r){let s=Reflect.getPrototypeOf(r);for(;s;){const e=Reflect.getOwnPropertyDescriptor(s,t);if(e)return e;s=Reflect.getPrototypeOf(s)}}}function hs(r){return Object.getPrototypeOf(r)===Set.prototype}function ls(r){return Object.getPrototypeOf(r)===Map.prototype}function G(r){var t;return(t=r.copy)!==null&&t!==void 0?t:r.original}function At(r){return!!L(r)}function L(r){return typeof r!="object"?null:r==null?void 0:r[Be]}function St(r){var t;const s=L(r);return s?(t=s.copy)!==null&&t!==void 0?t:s.original:r}function ge(r,t){if(!r||typeof r!="object")return!1;let s;return Object.getPrototypeOf(r)===Object.prototype||Array.isArray(r)||r instanceof Map||r instanceof Set||!!(t!=null&&t.mark)&&((s=t.mark(r,Z))===Z.immutable||typeof s=="function")}function us(r,t=[]){if(Object.hasOwnProperty.call(r,"key")){const s=r.parent.copy,e=L(le(s,r.key));if(e!==null&&(e==null?void 0:e.original)!==r.original)return null;const i=r.parent.type===3,a=i?Array.from(r.parent.setMap.keys()).indexOf(r.key):r.key;if(!(i&&s.size>a||Re(s,a)))return null;t.push(a)}if(r.parent)return us(r.parent,t);t.reverse();try{Oi(r.copy,t)}catch{return null}return t}function je(r){return Array.isArray(r)?1:r instanceof Map?2:r instanceof Set?3:0}function le(r,t){return je(r)===2?r.get(t):r[t]}function Et(r,t,s){je(r)===2?r.set(t,s):r[t]=s}function It(r,t){const s=L(r);return(s?G(s):r)[t]}function be(r,t){return r===t?r!==0||1/r===1/t:r!==r&&t!==t}function we(r,t){return t?r:[""].concat(r).map(s=>{const e=`${s}`;return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")}function Oi(r,t){for(let s=0;s<t.length-1;s+=1){const e=t[s];if(r=le(je(r)===3?Array.from(r):r,e),typeof r!="object")throw new Error(`Cannot resolve patch at '${t.join("/")}'.`)}return r}function Di(r){const t=Object.create(Object.getPrototypeOf(r));return Reflect.ownKeys(r).forEach(s=>{let e=Reflect.getOwnPropertyDescriptor(r,s);if(e.enumerable&&e.configurable&&e.writable){t[s]=r[s];return}e.writable||(e.writable=!0,e.configurable=!0),(e.get||e.set)&&(e={configurable:!0,writable:!0,enumerable:e.enumerable,value:r[s]}),Reflect.defineProperty(t,s,e)}),t}const Li=Object.prototype.propertyIsEnumerable;function Mi(r,t){let s;if(Array.isArray(r))return Array.prototype.concat.call(r);if(r instanceof Set){if(!hs(r)){const e=Object.getPrototypeOf(r).constructor;return new e(r.values())}return Set.prototype.difference?Set.prototype.difference.call(r,new Set):new Set(r.values())}else if(r instanceof Map){if(!ls(r)){const e=Object.getPrototypeOf(r).constructor;return new e(r)}return new Map(r)}else if(t!=null&&t.mark&&(s=t.mark(r,Z),s!==void 0)&&s!==Z.mutable){if(s===Z.immutable)return Di(r);if(typeof s=="function"){if(t.enablePatches||t.enableAutoFreeze)throw new Error("You can't use mark and patches or auto freeze together.");return s()}throw new Error(`Unsupported mark result: ${s}`)}else if(typeof r=="object"&&Object.getPrototypeOf(r)===Object.prototype){const e={};return Object.keys(r).forEach(i=>{e[i]=r[i]}),Object.getOwnPropertySymbols(r).forEach(i=>{Li.call(r,i)&&(e[i]=r[i])}),e}else throw new Error("Please check mark() to ensure that it is a stable marker draftable function.")}function K(r){r.copy||(r.copy=Mi(r.original,r.options))}function _e(r){if(!ge(r))return St(r);if(Array.isArray(r))return r.map(_e);if(r instanceof Map){const s=Array.from(r.entries()).map(([e,i])=>[e,_e(i)]);if(!ls(r)){const e=Object.getPrototypeOf(r).constructor;return new e(s)}return new Map(s)}if(r instanceof Set){const s=Array.from(r).map(_e);if(!hs(r)){const e=Object.getPrototypeOf(r).constructor;return new e(s)}return new Set(s)}const t=Object.create(Object.getPrototypeOf(r));for(const s in r)t[s]=_e(r[s]);return t}function Ye(r){return At(r)?_e(r):r}function ie(r){var t;r.assignedMap=(t=r.assignedMap)!==null&&t!==void 0?t:new Map,r.operated||(r.operated=!0,r.parent&&ie(r.parent))}function Fi(r,t){const s=je(r);if(s===0)Reflect.ownKeys(r).forEach(e=>{t(e,r[e],r)});else if(s===1){let e=0;for(const i of r)t(e,i,r),e+=1}else r.forEach((e,i)=>t(i,e,r))}function ps(r,t,s){if(At(r)||!ge(r,s)||t.has(r)||Object.isFrozen(r))return;const e=r instanceof Set,i=e?new Map:void 0;if(t.add(r),Fi(r,(a,n)=>{var o;if(At(n)){const c=L(n);K(c);const h=!((o=c.assignedMap)===null||o===void 0)&&o.size||c.operated?c.copy:c.original;Et(e?i:r,a,h)}else ps(n,t,s)}),i){const a=r,n=Array.from(a);a.clear(),n.forEach(o=>{a.add(i.has(o)?i.get(o):o)})}}function Bi(r,t){const s=r.type===3?r.setMap:r.copy;r.finalities.revoke.length>1&&r.assignedMap.get(t)&&s&&ps(le(s,t),r.finalities.handledSet,r.options)}function Ct(r){r.type===3&&r.copy&&(r.copy.clear(),r.setMap.forEach(t=>{r.copy.add(St(t))}))}function Nt(r,t,s,e){if(r.operated&&r.assignedMap&&r.assignedMap.size>0&&!r.finalized){if(s&&e){const a=us(r);a&&t(r,a,s,e)}r.finalized=!0}}function kt(r,t,s,e){const i=L(s);i&&(i.callbacks||(i.callbacks=[]),i.callbacks.push((a,n)=>{var o;const c=r.type===3?r.setMap:r.copy;if(be(le(c,t),s)){let h=i.original;i.copy&&(h=i.copy),Ct(r),Nt(r,e,a,n),r.options.enableAutoFreeze&&(r.options.updatedValues=(o=r.options.updatedValues)!==null&&o!==void 0?o:new WeakMap,r.options.updatedValues.set(h,i.original)),Et(c,t,h)}}),r.options.enableAutoFreeze&&i.finalities!==r.finalities&&(r.options.enableAutoFreeze=!1)),ge(s,r.options)&&r.finalities.draft.push(()=>{const a=r.type===3?r.setMap:r.copy;be(le(a,t),s)&&Bi(r,t)})}function Ri(r,t,s,e,i){let{original:a,assignedMap:n,options:o}=r,c=r.copy;c.length<a.length&&([a,c]=[c,a],[s,e]=[e,s]);for(let h=0;h<a.length;h+=1)if(n.get(h.toString())&&c[h]!==a[h]){const l=t.concat([h]),u=we(l,i);s.push({op:N.Replace,path:u,value:Ye(c[h])}),e.push({op:N.Replace,path:u,value:Ye(a[h])})}for(let h=a.length;h<c.length;h+=1){const l=t.concat([h]),u=we(l,i);s.push({op:N.Add,path:u,value:Ye(c[h])})}if(a.length<c.length){const{arrayLengthAssignment:h=!0}=o.enablePatches;if(h){const l=t.concat(["length"]),u=we(l,i);e.push({op:N.Replace,path:u,value:a.length})}else for(let l=c.length;a.length<l;l-=1){const u=t.concat([l-1]),d=we(u,i);e.push({op:N.Remove,path:d})}}}function ji({original:r,copy:t,assignedMap:s},e,i,a,n){s.forEach((o,c)=>{const h=le(r,c),l=Ye(le(t,c)),u=o?Re(r,c)?N.Replace:N.Add:N.Remove;if(be(h,l)&&u===N.Replace)return;const d=e.concat(c),f=we(d,n);i.push(u===N.Remove?{op:u,path:f}:{op:u,path:f,value:l}),a.push(u===N.Add?{op:N.Remove,path:f}:u===N.Remove?{op:N.Add,path:f,value:h}:{op:N.Replace,path:f,value:h})})}function _i({original:r,copy:t},s,e,i,a){let n=0;r.forEach(o=>{if(!t.has(o)){const c=s.concat([n]),h=we(c,a);e.push({op:N.Remove,path:h,value:o}),i.unshift({op:N.Add,path:h,value:o})}n+=1}),n=0,t.forEach(o=>{if(!r.has(o)){const c=s.concat([n]),h=we(c,a);e.push({op:N.Add,path:h,value:o}),i.unshift({op:N.Remove,path:h,value:o})}n+=1})}function Ue(r,t,s,e){const{pathAsArray:i=!0}=r.options.enablePatches;switch(r.type){case 0:case 2:return ji(r,t,s,e,i);case 1:return Ri(r,t,s,e,i);case 3:return _i(r,t,s,e,i)}}const Qe=(r,t,s=!1)=>{if(typeof r=="object"&&r!==null&&(!ge(r,t)||s))throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.")},vt={get size(){return G(L(this)).size},has(r){return G(L(this)).has(r)},set(r,t){const s=L(this),e=G(s);return(!e.has(r)||!be(e.get(r),t))&&(K(s),ie(s),s.assignedMap.set(r,!0),s.copy.set(r,t),kt(s,r,t,Ue)),this},delete(r){if(!this.has(r))return!1;const t=L(this);return K(t),ie(t),t.original.has(r)?t.assignedMap.set(r,!1):t.assignedMap.delete(r),t.copy.delete(r),!0},clear(){const r=L(this);if(this.size){K(r),ie(r),r.assignedMap=new Map;for(const[t]of r.original)r.assignedMap.set(t,!1);r.copy.clear()}},forEach(r,t){const s=L(this);G(s).forEach((e,i)=>{r.call(t,this.get(i),i,this)})},get(r){var t,s;const e=L(this),i=G(e).get(r),a=((s=(t=e.options).mark)===null||s===void 0?void 0:s.call(t,i,Z))===Z.mutable;if(e.options.strict&&Qe(i,e.options,a),a||e.finalized||!ge(i,e.options)||i!==e.original.get(r))return i;const n=Tt.createDraft({original:i,parentDraft:e,key:r,finalities:e.finalities,options:e.options});return K(e),e.copy.set(r,n),n},keys(){return G(L(this)).keys()},values(){const r=this.keys();return{[Ge]:()=>this.values(),next:()=>{const t=r.next();return t.done?t:{done:!1,value:this.get(t.value)}}}},entries(){const r=this.keys();return{[Ge]:()=>this.entries(),next:()=>{const t=r.next();if(t.done)return t;const s=this.get(t.value);return{done:!1,value:[t.value,s]}}}},[Ge](){return this.entries()}},Ui=Reflect.ownKeys(vt),fs=(r,t,{isValuesIterator:s})=>()=>{var e,i;const a=t.next();if(a.done)return a;const n=a.value;let o=r.setMap.get(n);const c=L(o),h=((i=(e=r.options).mark)===null||i===void 0?void 0:i.call(e,o,Z))===Z.mutable;if(r.options.strict&&Qe(n,r.options,h),!h&&!c&&ge(n,r.options)&&!r.finalized&&r.original.has(n)){const l=Tt.createDraft({original:n,parentDraft:r,key:n,finalities:r.finalities,options:r.options});r.setMap.set(n,l),o=l}else c&&(o=c.proxy);return{done:!1,value:s?o:[o,o]}},Ze={get size(){return L(this).setMap.size},has(r){const t=L(this);if(t.setMap.has(r))return!0;K(t);const s=L(r);return!!(s&&t.setMap.has(s.original))},add(r){const t=L(this);return this.has(r)||(K(t),ie(t),t.assignedMap.set(r,!0),t.setMap.set(r,r),kt(t,r,r,Ue)),this},delete(r){if(!this.has(r))return!1;const t=L(this);K(t),ie(t);const s=L(r);return s&&t.setMap.has(s.original)?(t.assignedMap.set(s.original,!1),t.setMap.delete(s.original)):(!s&&t.setMap.has(r)?t.assignedMap.set(r,!1):t.assignedMap.delete(r),t.setMap.delete(r))},clear(){if(!this.size)return;const r=L(this);K(r),ie(r);for(const t of r.original)r.assignedMap.set(t,!1);r.setMap.clear()},values(){const r=L(this);K(r);const t=r.setMap.keys();return{[Symbol.iterator]:()=>this.values(),next:fs(r,t,{isValuesIterator:!0})}},entries(){const r=L(this);K(r);const t=r.setMap.keys();return{[Symbol.iterator]:()=>this.entries(),next:fs(r,t,{isValuesIterator:!1})}},keys(){return this.values()},[Ge](){return this.values()},forEach(r,t){const s=this.values();let e=s.next();for(;!e.done;)r.call(t,e.value,e.value,this),e=s.next()}};Set.prototype.difference&&Object.assign(Ze,{intersection(r){return Set.prototype.intersection.call(new Set(this.values()),r)},union(r){return Set.prototype.union.call(new Set(this.values()),r)},difference(r){return Set.prototype.difference.call(new Set(this.values()),r)},symmetricDifference(r){return Set.prototype.symmetricDifference.call(new Set(this.values()),r)},isSubsetOf(r){return Set.prototype.isSubsetOf.call(new Set(this.values()),r)},isSupersetOf(r){return Set.prototype.isSupersetOf.call(new Set(this.values()),r)},isDisjointFrom(r){return Set.prototype.isDisjointFrom.call(new Set(this.values()),r)}});const $i=Reflect.ownKeys(Ze),ds=new WeakSet,ms={get(r,t,s){var e,i;const a=(e=r.copy)===null||e===void 0?void 0:e[t];if(a&&ds.has(a))return a;if(t===Be)return r;let n;if(r.options.mark){const h=t==="size"&&(r.original instanceof Map||r.original instanceof Set)?Reflect.get(r.original,t):Reflect.get(r.original,t,s);if(n=r.options.mark(h,Z),n===Z.mutable)return r.options.strict&&Qe(h,r.options,!0),h}const o=G(r);if(o instanceof Map&&Ui.includes(t)){if(t==="size")return Object.getOwnPropertyDescriptor(vt,"size").get.call(r.proxy);const h=vt[t];if(h)return h.bind(r.proxy)}if(o instanceof Set&&$i.includes(t)){if(t==="size")return Object.getOwnPropertyDescriptor(Ze,"size").get.call(r.proxy);const h=Ze[t];if(h)return h.bind(r.proxy)}if(!Re(o,t)){const h=cs(o,t);return h?"value"in h?h.value:(i=h.get)===null||i===void 0?void 0:i.call(r.proxy):void 0}const c=o[t];if(r.options.strict&&Qe(c,r.options),r.finalized||!ge(c,r.options))return c;if(c===It(r.original,t)){if(K(r),r.copy[t]=ys({original:r.original[t],parentDraft:r,key:r.type===1?Number(t):t,finalities:r.finalities,options:r.options}),typeof n=="function"){const h=L(r.copy[t]);return K(h),ie(h),h.copy}return r.copy[t]}return c},set(r,t,s){var e;if(r.type===3||r.type===2)throw new Error("Map/Set draft does not support any property assignment.");let i;if(r.type===1&&t!=="length"&&!(Number.isInteger(i=Number(t))&&i>=0&&(t===0||i===0||String(i)===String(t))))throw new Error("Only supports setting array indices and the 'length' property.");const a=cs(G(r),t);if(a!=null&&a.set)return a.set.call(r.proxy,s),!0;const n=It(G(r),t),o=L(n);return o&&be(o.original,s)?(r.copy[t]=s,r.assignedMap=(e=r.assignedMap)!==null&&e!==void 0?e:new Map,r.assignedMap.set(t,!1),!0):(be(s,n)&&(s!==void 0||Re(r.original,t))||(K(r),ie(r),Re(r.original,t)&&be(s,r.original[t])?r.assignedMap.delete(t):r.assignedMap.set(t,!0),r.copy[t]=s,kt(r,t,s,Ue)),!0)},has(r,t){return t in G(r)},ownKeys(r){return Reflect.ownKeys(G(r))},getOwnPropertyDescriptor(r,t){const s=G(r),e=Reflect.getOwnPropertyDescriptor(s,t);return e&&{writable:!0,configurable:r.type!==1||t!=="length",enumerable:e.enumerable,value:s[t]}},getPrototypeOf(r){return Reflect.getPrototypeOf(r.original)},setPrototypeOf(){throw new Error("Cannot call 'setPrototypeOf()' on drafts")},defineProperty(){throw new Error("Cannot call 'defineProperty()' on drafts")},deleteProperty(r,t){var s;return r.type===1?ms.set.call(this,r,t,void 0,r.proxy):(It(r.original,t)!==void 0||t in r.original?(K(r),ie(r),r.assignedMap.set(t,!1)):(r.assignedMap=(s=r.assignedMap)!==null&&s!==void 0?s:new Map,r.assignedMap.delete(t)),r.copy&&delete r.copy[t],!0)}};function ys(r){const{original:t,parentDraft:s,key:e,finalities:i,options:a}=r,n=je(t),o={type:n,finalized:!1,parent:s,original:t,copy:null,proxy:null,finalities:i,options:a,setMap:n===3?new Map(t.entries()):void 0};(e||"key"in r)&&(o.key=e);const{proxy:c,revoke:h}=Proxy.revocable(n===1?Object.assign([],o):o,ms);if(i.revoke.push(h),ds.add(c),o.proxy=c,s){const l=s;l.finalities.draft.push((u,d)=>{var f,x;const S=L(c);let _=l.type===3?l.setMap:l.copy;const C=le(_,e),D=L(C);if(D){let U=D.original;D.operated&&(U=St(C)),Ct(D),Nt(D,Ue,u,d),l.options.enableAutoFreeze&&(l.options.updatedValues=(f=l.options.updatedValues)!==null&&f!==void 0?f:new WeakMap,l.options.updatedValues.set(U,D.original)),Et(_,e,U)}(x=S.callbacks)===null||x===void 0||x.forEach(U=>{U(u,d)})})}else{const l=L(c);l.finalities.draft.push((u,d)=>{Ct(l),Nt(l,Ue,u,d)})}return c}Tt.createDraft=ys,Object.prototype.constructor.toString();const z=[];for(let r=0;r<256;++r)z.push((r+256).toString(16).slice(1));function qi(r,t=0){return(z[r[t+0]]+z[r[t+1]]+z[r[t+2]]+z[r[t+3]]+"-"+z[r[t+4]]+z[r[t+5]]+"-"+z[r[t+6]]+z[r[t+7]]+"-"+z[r[t+8]]+z[r[t+9]]+"-"+z[r[t+10]]+z[r[t+11]]+z[r[t+12]]+z[r[t+13]]+z[r[t+14]]+z[r[t+15]]).toLowerCase()}let Ot;const zi=new Uint8Array(16);function Vi(){if(!Ot){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ot=crypto.getRandomValues.bind(crypto)}return Ot(zi)}const xs={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Hi(r,t,s){var i;if(xs.randomUUID&&!r)return xs.randomUUID();r=r||{};const e=r.random??((i=r.rng)==null?void 0:i.call(r))??Vi();if(e.length<16)throw new Error("Random bytes length must be >= 16");return e[6]=e[6]&15|64,e[8]=e[8]&63|128,qi(e)}function Ps(){return Hi()}function Ki(r,t){return r.localeCompare(t)}function Ji(){let r=Ki;if(typeof Intl=="object"&&Intl.hasOwnProperty("Collator"))try{r=Intl.Collator("en-US").compare}catch{}return r}Ji();function Wi(){const t={__etype:1,__ops:1,create:1,update:1,link:1,unlink:1,delete:1,merge:1,ruleParams:1};return new Set(Object.keys(t))}const Xi=Wi();function et(r,t,s){const e={__etype:r,__ops:s};return new Proxy(e,{get:(i,a)=>{if(a==="__ops")return s;if(a==="__etype")return r;if(Xi.has(a))return(n,o)=>et(r,t,[...s,o?[a,r,t,n,o]:[a,r,t,n]])}})}function Gi(r,t){return`lookup__${r}__${JSON.stringify(t)}`}function Yi(r){return r.startsWith("lookup__")}function gs(r){const[t,s,...e]=r.split("__");return[s,JSON.parse(e.join("__"))]}function Qi(r){return new Proxy({__etype:r},{get(t,s){if(s==="lookup")return(i,a)=>et(r,gs(Gi(i,a)),[]);if(s==="__etype")return r;const e=s;return Yi(e)?et(r,gs(e),[]):et(r,e,[])}})}function Zi(){return new Proxy({},{get(r,t){return Qi(t)}})}Zi();class Dt extends Error{constructor(s,e){super(s);m(this,"hint");this.hint=e;const i=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,i),Error.captureStackTrace&&Error.captureStackTrace(this,Dt),this.name="InstantError"}get[Symbol.toStringTag](){return"InstantError"}}class $e extends Dt{constructor(s){var a;const e=((a=s.body)==null?void 0:a.message)||`API Error (${s.status})`;super(e,s.body.hint);m(this,"body");m(this,"status");const i=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,i),Error.captureStackTrace&&Error.captureStackTrace(this,$e),this.name="InstantAPIError",this.status=s.status,this.body=s.body}get[Symbol.toStringTag](){return"InstantAPIError"}}typeof window<"u"&&typeof window.localStorage<"u"&&(window.localStorage.getItem("devBackend"),window.localStorage.getItem("__instantLogging"),window.localStorage.getItem("__devtoolLocalDash"));const Ce="v0.22.146";class ee{constructor(t,s,e,i={indexed:!1,unique:!1}){m(this,"valueType");m(this,"required");m(this,"isIndexed");m(this,"config");m(this,"metadata",{});this.valueType=t,this.required=s,this.isIndexed=e,this.config=i}clientRequired(){return new ee(this.valueType,!1,this.isIndexed,this.config)}optional(){return new ee(this.valueType,!1,this.isIndexed,this.config)}unique(){return new ee(this.valueType,this.required,this.isIndexed,{...this.config,unique:!0})}indexed(){return new ee(this.valueType,this.required,!0,{...this.config,indexed:!0})}}class tt{constructor(t,s){m(this,"attrs");m(this,"links");this.attrs=t,this.links=s}asType(){return new tt(this.attrs,this.links)}}class st{constructor(t,s,e){m(this,"entities");m(this,"links");m(this,"rooms");this.entities=t,this.links=s,this.rooms=e}withRoomSchema(){return new st(this.entities,this.links,{})}}var bs;(function(r){r.InitialSyncBatch="InitialSyncBatch",r.InitialSyncComplete="InitialSyncComplete",r.LoadFromStorage="LoadFromStorage",r.SyncTransaction="SyncTransaction",r.Error="Error"})(bs||(bs={}));function er(r,t){return new st(ws(r,t),t,void 0)}function tr(r){return new tt(r,{})}function sr(){return new ee("string",!0,!1)}function ir(){return new ee("number",!0,!1)}function rr(){return new ee("boolean",!0,!1)}function ar(){return new ee("date",!0,!1)}function nr(){return new ee("json",!0,!1)}function or(){return new ee("json",!0,!1)}function ws(r,t){var i,a,n,o;const s={fwd:{},rev:{}};for(const c of Object.values(t))(i=s.fwd)[a=c.forward.on]||(i[a]={}),(n=s.rev)[o=c.reverse.on]||(n[o]={}),s.fwd[c.forward.on][c.forward.label]={entityName:c.reverse.on,cardinality:c.forward.has},s.rev[c.reverse.on][c.reverse.label]={entityName:c.forward.on,cardinality:c.reverse.has};return Object.fromEntries(Object.entries(r).map(([c,h])=>[c,new tt(h.attrs,{...s.fwd[c],...s.rev[c]})]))}function cr({entities:r,links:t,rooms:s}){const e=t??{},i=s??{};return new st(ws(r,e),e,i)}const V={graph:er,schema:cr,entity:tr,string:sr,number:ir,boolean:rr,date:ar,json:nr,any:or};function hr(){return globalThis.__instantDbSchemaHashStore=globalThis.__instantDbSchemaHashStore??new WeakMap,globalThis.__instantDbSchemaHashStore}function lr(){return globalThis.__instantDbStore=globalThis.__instantDbStore??{},globalThis.__instantDbStore}lr(),hr();function ur(){const r="0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz-._~";let t="";for(const s of crypto.getRandomValues(new Uint8Array(64)))t=t+r[s%r.length];return t}function pr(r){return crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(r))}function fr(r){return r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function dr(r){return pr(r).then(t=>fr(btoa(String.fromCharCode(...Array.from(new Uint8Array(t))))))}function mr(){const r=Math.min(800,Math.floor(window.outerWidth*.8)),t=Math.min(630,Math.floor(window.outerHeight*.5)),s={width:r,height:t,left:Math.round(window.screenX+(window.outerWidth-r)/2),top:Math.round(window.screenY+(window.outerHeight-t)/8)},e={width:s.width,height:s.height,left:s.left,top:s.top,toolbar:0,scrollbars:1,status:1,resizable:1,menuBar:0,rel:"opener"};return Object.keys(e).map(i=>`${i}=${e[i]}`).join(",")}let Ts=null;function yr({clientId:r,state:t,codeChallenge:s,apiURI:e,redirectUri:i,scopes:a}){const n=new URL(`${e}/platform/oauth/start`);return n.searchParams.set("client_id",r),n.searchParams.set("redirect_uri",i),n.searchParams.set("scope",a.join(" ")),n.searchParams.set("state",t),n.searchParams.set("response_type","code"),n.searchParams.set("code_challenge",s),n.searchParams.set("code_challenge_method","S256"),n.toString()}async function xr({code:r,clientId:t,verifier:s,apiURI:e,redirectUri:i}){const a=await fetch(`${e}/platform/oauth/token`,{method:"POST",headers:{"Content-type":"application/json","Instant-Platform-Version":Ce,"Instant-Core-Version":Ce},body:JSON.stringify({grant_type:"authorization_code",code:r,redirect_uri:i,client_id:t,code_verifier:s})});if(!a.ok){const o=await a.text();let c;try{const h=JSON.parse(o);c={error:h.error,errorDescription:h.error_description,message:`OAuth error: ${h.error||"server_error"}`}}catch{c={error:"server_error",message:"OAuth error: server_error"}}throw new v(c)}const n=await a.json();return{token:n.access_token,expiresAt:new Date(Date.now()+(n.expires_in-30)*1e3)}}function Pr(){if(typeof window>"u")throw new Error("This function may only be used in a browser context.");const r=new URL(window.location.href).searchParams,t=r.get("state"),s=r.get("error"),e=r.get("error_description"),i=r.get("code");if(!t)throw new Error("Invalid redirect. The state param is missing.");const a=new BroadcastChannel(t);return a.addEventListener("message",n=>{n.data.type==="oauth-redirect-window-done"&&window.close()}),a.postMessage({type:"oauth-redirect",state:t,error:s,errorDescription:e,code:i}),()=>{a.close()}}function gr({clientId:r,apiURI:t,redirectUri:s,scopes:e}){if(typeof window>"u")throw new Error("OAuth flow can only be started on the client.");const i=Ts;i&&i.close();const a=crypto.randomUUID(),n=ur(),o=new BroadcastChannel(a),c=new Promise((l,u)=>{o.addEventListener("message",async d=>{if(d.data.type!=="oauth-redirect")return;const{state:f,error:x,code:S,errorDescription:_}=d.data;if(!(!f||f!==a)){if(S)try{const C=await xr({clientId:r,code:S,verifier:n,apiURI:t,redirectUri:s});l(C)}catch(C){C instanceof v&&u(C),u(new v({error:"server_error",message:"OAuth error exchanging code for token"}))}else u(typeof x=="string"?new v({error:x,errorDescription:_,message:`OAuth error: ${x}`}):new v({error:"server_error",message:"OAuth error: server_error"}));o.postMessage({type:"oauth-redirect-window-done"})}})}),h=window.open("",`instantdb_oauth_${Math.random()}`.replace(".",""),mr());return h?(Ts=h,dr(n).then(l=>{const u=yr({clientId:r,state:a,codeChallenge:l,apiURI:t,redirectUri:s,scopes:e});h.location.href=u}),c.finally(()=>o.close())):Promise.reject({error:"Could not open Auth window"})}class br{constructor(t){m(this,"redirectUri");m(this,"clientId");m(this,"apiURI");this.redirectUri=t.redirectUri,this.apiURI=t.apiURI??"https://api.instantdb.com",this.clientId=t.clientId}startClientOnlyFlow(t){return gr({clientId:this.clientId,apiURI:this.apiURI,redirectUri:this.redirectUri,scopes:t})}handleClientRedirect(){return Pr()}}function wr(r,t){if(r==null)return{};var s={};for(var e in r)if({}.hasOwnProperty.call(r,e)){if(t.indexOf(e)!==-1)continue;s[e]=r[e]}return s}class ue{constructor(t,s,e){m(this,"line");m(this,"column");m(this,"index");this.line=t,this.column=s,this.index=e}}class it{constructor(t,s){m(this,"start");m(this,"end");m(this,"filename");m(this,"identifierName");this.start=t,this.end=s}}function Q(r,t){const{line:s,column:e,index:i}=r;return new ue(s,e+t,i+t)}const As="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";var Tr={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:As},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:As}};const Ss={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},rt=r=>r.type==="UpdateExpression"?Ss.UpdateExpression[`${r.prefix}`]:Ss[r.type];var Ar={AccessorIsGenerator:({kind:r})=>`A ${r}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:r})=>`Missing initializer in ${r} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:r})=>`\`${r}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:r,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.
1
+ (function(A,v){typeof exports=="object"&&typeof module<"u"?v(exports):typeof define=="function"&&define.amd?define(["exports"],v):(A=typeof globalThis<"u"?globalThis:A||self,v(A.instant={}))})(this,function(A){"use strict";var Xn=Object.defineProperty;var ki=A=>{throw TypeError(A)};var Gn=(A,v,N)=>v in A?Xn(A,v,{enumerable:!0,configurable:!0,writable:!0,value:N}):A[v]=N;var m=(A,v,N)=>Gn(A,typeof v!="symbol"?v+"":v,N),vi=(A,v,N)=>v.has(A)||ki("Cannot "+N);var T=(A,v,N)=>(vi(A,v,"read from private field"),N?N.call(A):v.get(A)),xe=(A,v,N)=>v.has(A)?ki("Cannot add the same private member more than once"):v instanceof WeakSet?v.add(A):v.set(A,N),Pe=(A,v,N,Be)=>(vi(A,v,"write to private field"),Be?Be.call(A,N):v.set(A,N),N);var se,Y,Pt,gt,bt,F,j;class v extends Error{constructor(s){super(s.message);m(this,"error");m(this,"errorDescription");const e=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,v),this.name="InstantOAuthError",this.error=s.error,this.errorDescription=s.errorDescription}get[Symbol.toStringTag](){return"InstantAPIError"}}const N={Remove:"remove",Replace:"replace",Add:"add"},Be=Symbol.for("__MUTATIVE_PROXY_DRAFT__"),Ge=Symbol.iterator,Z={mutable:"mutable",immutable:"immutable"},Tt={};function Re(r,t){return r instanceof Map?r.has(t):Object.prototype.hasOwnProperty.call(r,t)}function cs(r,t){if(t in r){let s=Reflect.getPrototypeOf(r);for(;s;){const e=Reflect.getOwnPropertyDescriptor(s,t);if(e)return e;s=Reflect.getPrototypeOf(s)}}}function hs(r){return Object.getPrototypeOf(r)===Set.prototype}function ls(r){return Object.getPrototypeOf(r)===Map.prototype}function G(r){var t;return(t=r.copy)!==null&&t!==void 0?t:r.original}function At(r){return!!L(r)}function L(r){return typeof r!="object"?null:r==null?void 0:r[Be]}function St(r){var t;const s=L(r);return s?(t=s.copy)!==null&&t!==void 0?t:s.original:r}function ge(r,t){if(!r||typeof r!="object")return!1;let s;return Object.getPrototypeOf(r)===Object.prototype||Array.isArray(r)||r instanceof Map||r instanceof Set||!!(t!=null&&t.mark)&&((s=t.mark(r,Z))===Z.immutable||typeof s=="function")}function us(r,t=[]){if(Object.hasOwnProperty.call(r,"key")){const s=r.parent.copy,e=L(le(s,r.key));if(e!==null&&(e==null?void 0:e.original)!==r.original)return null;const i=r.parent.type===3,a=i?Array.from(r.parent.setMap.keys()).indexOf(r.key):r.key;if(!(i&&s.size>a||Re(s,a)))return null;t.push(a)}if(r.parent)return us(r.parent,t);t.reverse();try{Oi(r.copy,t)}catch{return null}return t}function je(r){return Array.isArray(r)?1:r instanceof Map?2:r instanceof Set?3:0}function le(r,t){return je(r)===2?r.get(t):r[t]}function Et(r,t,s){je(r)===2?r.set(t,s):r[t]=s}function It(r,t){const s=L(r);return(s?G(s):r)[t]}function be(r,t){return r===t?r!==0||1/r===1/t:r!==r&&t!==t}function we(r,t){return t?r:[""].concat(r).map(s=>{const e=`${s}`;return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")}function Oi(r,t){for(let s=0;s<t.length-1;s+=1){const e=t[s];if(r=le(je(r)===3?Array.from(r):r,e),typeof r!="object")throw new Error(`Cannot resolve patch at '${t.join("/")}'.`)}return r}function Di(r){const t=Object.create(Object.getPrototypeOf(r));return Reflect.ownKeys(r).forEach(s=>{let e=Reflect.getOwnPropertyDescriptor(r,s);if(e.enumerable&&e.configurable&&e.writable){t[s]=r[s];return}e.writable||(e.writable=!0,e.configurable=!0),(e.get||e.set)&&(e={configurable:!0,writable:!0,enumerable:e.enumerable,value:r[s]}),Reflect.defineProperty(t,s,e)}),t}const Li=Object.prototype.propertyIsEnumerable;function Mi(r,t){let s;if(Array.isArray(r))return Array.prototype.concat.call(r);if(r instanceof Set){if(!hs(r)){const e=Object.getPrototypeOf(r).constructor;return new e(r.values())}return Set.prototype.difference?Set.prototype.difference.call(r,new Set):new Set(r.values())}else if(r instanceof Map){if(!ls(r)){const e=Object.getPrototypeOf(r).constructor;return new e(r)}return new Map(r)}else if(t!=null&&t.mark&&(s=t.mark(r,Z),s!==void 0)&&s!==Z.mutable){if(s===Z.immutable)return Di(r);if(typeof s=="function"){if(t.enablePatches||t.enableAutoFreeze)throw new Error("You can't use mark and patches or auto freeze together.");return s()}throw new Error(`Unsupported mark result: ${s}`)}else if(typeof r=="object"&&Object.getPrototypeOf(r)===Object.prototype){const e={};return Object.keys(r).forEach(i=>{e[i]=r[i]}),Object.getOwnPropertySymbols(r).forEach(i=>{Li.call(r,i)&&(e[i]=r[i])}),e}else throw new Error("Please check mark() to ensure that it is a stable marker draftable function.")}function K(r){r.copy||(r.copy=Mi(r.original,r.options))}function _e(r){if(!ge(r))return St(r);if(Array.isArray(r))return r.map(_e);if(r instanceof Map){const s=Array.from(r.entries()).map(([e,i])=>[e,_e(i)]);if(!ls(r)){const e=Object.getPrototypeOf(r).constructor;return new e(s)}return new Map(s)}if(r instanceof Set){const s=Array.from(r).map(_e);if(!hs(r)){const e=Object.getPrototypeOf(r).constructor;return new e(s)}return new Set(s)}const t=Object.create(Object.getPrototypeOf(r));for(const s in r)t[s]=_e(r[s]);return t}function Ye(r){return At(r)?_e(r):r}function ie(r){var t;r.assignedMap=(t=r.assignedMap)!==null&&t!==void 0?t:new Map,r.operated||(r.operated=!0,r.parent&&ie(r.parent))}function Fi(r,t){const s=je(r);if(s===0)Reflect.ownKeys(r).forEach(e=>{t(e,r[e],r)});else if(s===1){let e=0;for(const i of r)t(e,i,r),e+=1}else r.forEach((e,i)=>t(i,e,r))}function ps(r,t,s){if(At(r)||!ge(r,s)||t.has(r)||Object.isFrozen(r))return;const e=r instanceof Set,i=e?new Map:void 0;if(t.add(r),Fi(r,(a,n)=>{var o;if(At(n)){const c=L(n);K(c);const h=!((o=c.assignedMap)===null||o===void 0)&&o.size||c.operated?c.copy:c.original;Et(e?i:r,a,h)}else ps(n,t,s)}),i){const a=r,n=Array.from(a);a.clear(),n.forEach(o=>{a.add(i.has(o)?i.get(o):o)})}}function Bi(r,t){const s=r.type===3?r.setMap:r.copy;r.finalities.revoke.length>1&&r.assignedMap.get(t)&&s&&ps(le(s,t),r.finalities.handledSet,r.options)}function Ct(r){r.type===3&&r.copy&&(r.copy.clear(),r.setMap.forEach(t=>{r.copy.add(St(t))}))}function Nt(r,t,s,e){if(r.operated&&r.assignedMap&&r.assignedMap.size>0&&!r.finalized){if(s&&e){const a=us(r);a&&t(r,a,s,e)}r.finalized=!0}}function kt(r,t,s,e){const i=L(s);i&&(i.callbacks||(i.callbacks=[]),i.callbacks.push((a,n)=>{var o;const c=r.type===3?r.setMap:r.copy;if(be(le(c,t),s)){let h=i.original;i.copy&&(h=i.copy),Ct(r),Nt(r,e,a,n),r.options.enableAutoFreeze&&(r.options.updatedValues=(o=r.options.updatedValues)!==null&&o!==void 0?o:new WeakMap,r.options.updatedValues.set(h,i.original)),Et(c,t,h)}}),r.options.enableAutoFreeze&&i.finalities!==r.finalities&&(r.options.enableAutoFreeze=!1)),ge(s,r.options)&&r.finalities.draft.push(()=>{const a=r.type===3?r.setMap:r.copy;be(le(a,t),s)&&Bi(r,t)})}function Ri(r,t,s,e,i){let{original:a,assignedMap:n,options:o}=r,c=r.copy;c.length<a.length&&([a,c]=[c,a],[s,e]=[e,s]);for(let h=0;h<a.length;h+=1)if(n.get(h.toString())&&c[h]!==a[h]){const l=t.concat([h]),u=we(l,i);s.push({op:N.Replace,path:u,value:Ye(c[h])}),e.push({op:N.Replace,path:u,value:Ye(a[h])})}for(let h=a.length;h<c.length;h+=1){const l=t.concat([h]),u=we(l,i);s.push({op:N.Add,path:u,value:Ye(c[h])})}if(a.length<c.length){const{arrayLengthAssignment:h=!0}=o.enablePatches;if(h){const l=t.concat(["length"]),u=we(l,i);e.push({op:N.Replace,path:u,value:a.length})}else for(let l=c.length;a.length<l;l-=1){const u=t.concat([l-1]),d=we(u,i);e.push({op:N.Remove,path:d})}}}function ji({original:r,copy:t,assignedMap:s},e,i,a,n){s.forEach((o,c)=>{const h=le(r,c),l=Ye(le(t,c)),u=o?Re(r,c)?N.Replace:N.Add:N.Remove;if(be(h,l)&&u===N.Replace)return;const d=e.concat(c),f=we(d,n);i.push(u===N.Remove?{op:u,path:f}:{op:u,path:f,value:l}),a.push(u===N.Add?{op:N.Remove,path:f}:u===N.Remove?{op:N.Add,path:f,value:h}:{op:N.Replace,path:f,value:h})})}function _i({original:r,copy:t},s,e,i,a){let n=0;r.forEach(o=>{if(!t.has(o)){const c=s.concat([n]),h=we(c,a);e.push({op:N.Remove,path:h,value:o}),i.unshift({op:N.Add,path:h,value:o})}n+=1}),n=0,t.forEach(o=>{if(!r.has(o)){const c=s.concat([n]),h=we(c,a);e.push({op:N.Add,path:h,value:o}),i.unshift({op:N.Remove,path:h,value:o})}n+=1})}function Ue(r,t,s,e){const{pathAsArray:i=!0}=r.options.enablePatches;switch(r.type){case 0:case 2:return ji(r,t,s,e,i);case 1:return Ri(r,t,s,e,i);case 3:return _i(r,t,s,e,i)}}const Qe=(r,t,s=!1)=>{if(typeof r=="object"&&r!==null&&(!ge(r,t)||s))throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.")},vt={get size(){return G(L(this)).size},has(r){return G(L(this)).has(r)},set(r,t){const s=L(this),e=G(s);return(!e.has(r)||!be(e.get(r),t))&&(K(s),ie(s),s.assignedMap.set(r,!0),s.copy.set(r,t),kt(s,r,t,Ue)),this},delete(r){if(!this.has(r))return!1;const t=L(this);return K(t),ie(t),t.original.has(r)?t.assignedMap.set(r,!1):t.assignedMap.delete(r),t.copy.delete(r),!0},clear(){const r=L(this);if(this.size){K(r),ie(r),r.assignedMap=new Map;for(const[t]of r.original)r.assignedMap.set(t,!1);r.copy.clear()}},forEach(r,t){const s=L(this);G(s).forEach((e,i)=>{r.call(t,this.get(i),i,this)})},get(r){var t,s;const e=L(this),i=G(e).get(r),a=((s=(t=e.options).mark)===null||s===void 0?void 0:s.call(t,i,Z))===Z.mutable;if(e.options.strict&&Qe(i,e.options,a),a||e.finalized||!ge(i,e.options)||i!==e.original.get(r))return i;const n=Tt.createDraft({original:i,parentDraft:e,key:r,finalities:e.finalities,options:e.options});return K(e),e.copy.set(r,n),n},keys(){return G(L(this)).keys()},values(){const r=this.keys();return{[Ge]:()=>this.values(),next:()=>{const t=r.next();return t.done?t:{done:!1,value:this.get(t.value)}}}},entries(){const r=this.keys();return{[Ge]:()=>this.entries(),next:()=>{const t=r.next();if(t.done)return t;const s=this.get(t.value);return{done:!1,value:[t.value,s]}}}},[Ge](){return this.entries()}},Ui=Reflect.ownKeys(vt),fs=(r,t,{isValuesIterator:s})=>()=>{var e,i;const a=t.next();if(a.done)return a;const n=a.value;let o=r.setMap.get(n);const c=L(o),h=((i=(e=r.options).mark)===null||i===void 0?void 0:i.call(e,o,Z))===Z.mutable;if(r.options.strict&&Qe(n,r.options,h),!h&&!c&&ge(n,r.options)&&!r.finalized&&r.original.has(n)){const l=Tt.createDraft({original:n,parentDraft:r,key:n,finalities:r.finalities,options:r.options});r.setMap.set(n,l),o=l}else c&&(o=c.proxy);return{done:!1,value:s?o:[o,o]}},Ze={get size(){return L(this).setMap.size},has(r){const t=L(this);if(t.setMap.has(r))return!0;K(t);const s=L(r);return!!(s&&t.setMap.has(s.original))},add(r){const t=L(this);return this.has(r)||(K(t),ie(t),t.assignedMap.set(r,!0),t.setMap.set(r,r),kt(t,r,r,Ue)),this},delete(r){if(!this.has(r))return!1;const t=L(this);K(t),ie(t);const s=L(r);return s&&t.setMap.has(s.original)?(t.assignedMap.set(s.original,!1),t.setMap.delete(s.original)):(!s&&t.setMap.has(r)?t.assignedMap.set(r,!1):t.assignedMap.delete(r),t.setMap.delete(r))},clear(){if(!this.size)return;const r=L(this);K(r),ie(r);for(const t of r.original)r.assignedMap.set(t,!1);r.setMap.clear()},values(){const r=L(this);K(r);const t=r.setMap.keys();return{[Symbol.iterator]:()=>this.values(),next:fs(r,t,{isValuesIterator:!0})}},entries(){const r=L(this);K(r);const t=r.setMap.keys();return{[Symbol.iterator]:()=>this.entries(),next:fs(r,t,{isValuesIterator:!1})}},keys(){return this.values()},[Ge](){return this.values()},forEach(r,t){const s=this.values();let e=s.next();for(;!e.done;)r.call(t,e.value,e.value,this),e=s.next()}};Set.prototype.difference&&Object.assign(Ze,{intersection(r){return Set.prototype.intersection.call(new Set(this.values()),r)},union(r){return Set.prototype.union.call(new Set(this.values()),r)},difference(r){return Set.prototype.difference.call(new Set(this.values()),r)},symmetricDifference(r){return Set.prototype.symmetricDifference.call(new Set(this.values()),r)},isSubsetOf(r){return Set.prototype.isSubsetOf.call(new Set(this.values()),r)},isSupersetOf(r){return Set.prototype.isSupersetOf.call(new Set(this.values()),r)},isDisjointFrom(r){return Set.prototype.isDisjointFrom.call(new Set(this.values()),r)}});const $i=Reflect.ownKeys(Ze),ds=new WeakSet,ms={get(r,t,s){var e,i;const a=(e=r.copy)===null||e===void 0?void 0:e[t];if(a&&ds.has(a))return a;if(t===Be)return r;let n;if(r.options.mark){const h=t==="size"&&(r.original instanceof Map||r.original instanceof Set)?Reflect.get(r.original,t):Reflect.get(r.original,t,s);if(n=r.options.mark(h,Z),n===Z.mutable)return r.options.strict&&Qe(h,r.options,!0),h}const o=G(r);if(o instanceof Map&&Ui.includes(t)){if(t==="size")return Object.getOwnPropertyDescriptor(vt,"size").get.call(r.proxy);const h=vt[t];if(h)return h.bind(r.proxy)}if(o instanceof Set&&$i.includes(t)){if(t==="size")return Object.getOwnPropertyDescriptor(Ze,"size").get.call(r.proxy);const h=Ze[t];if(h)return h.bind(r.proxy)}if(!Re(o,t)){const h=cs(o,t);return h?"value"in h?h.value:(i=h.get)===null||i===void 0?void 0:i.call(r.proxy):void 0}const c=o[t];if(r.options.strict&&Qe(c,r.options),r.finalized||!ge(c,r.options))return c;if(c===It(r.original,t)){if(K(r),r.copy[t]=ys({original:r.original[t],parentDraft:r,key:r.type===1?Number(t):t,finalities:r.finalities,options:r.options}),typeof n=="function"){const h=L(r.copy[t]);return K(h),ie(h),h.copy}return r.copy[t]}return c},set(r,t,s){var e;if(r.type===3||r.type===2)throw new Error("Map/Set draft does not support any property assignment.");let i;if(r.type===1&&t!=="length"&&!(Number.isInteger(i=Number(t))&&i>=0&&(t===0||i===0||String(i)===String(t))))throw new Error("Only supports setting array indices and the 'length' property.");const a=cs(G(r),t);if(a!=null&&a.set)return a.set.call(r.proxy,s),!0;const n=It(G(r),t),o=L(n);return o&&be(o.original,s)?(r.copy[t]=s,r.assignedMap=(e=r.assignedMap)!==null&&e!==void 0?e:new Map,r.assignedMap.set(t,!1),!0):(be(s,n)&&(s!==void 0||Re(r.original,t))||(K(r),ie(r),Re(r.original,t)&&be(s,r.original[t])?r.assignedMap.delete(t):r.assignedMap.set(t,!0),r.copy[t]=s,kt(r,t,s,Ue)),!0)},has(r,t){return t in G(r)},ownKeys(r){return Reflect.ownKeys(G(r))},getOwnPropertyDescriptor(r,t){const s=G(r),e=Reflect.getOwnPropertyDescriptor(s,t);return e&&{writable:!0,configurable:r.type!==1||t!=="length",enumerable:e.enumerable,value:s[t]}},getPrototypeOf(r){return Reflect.getPrototypeOf(r.original)},setPrototypeOf(){throw new Error("Cannot call 'setPrototypeOf()' on drafts")},defineProperty(){throw new Error("Cannot call 'defineProperty()' on drafts")},deleteProperty(r,t){var s;return r.type===1?ms.set.call(this,r,t,void 0,r.proxy):(It(r.original,t)!==void 0||t in r.original?(K(r),ie(r),r.assignedMap.set(t,!1)):(r.assignedMap=(s=r.assignedMap)!==null&&s!==void 0?s:new Map,r.assignedMap.delete(t)),r.copy&&delete r.copy[t],!0)}};function ys(r){const{original:t,parentDraft:s,key:e,finalities:i,options:a}=r,n=je(t),o={type:n,finalized:!1,parent:s,original:t,copy:null,proxy:null,finalities:i,options:a,setMap:n===3?new Map(t.entries()):void 0};(e||"key"in r)&&(o.key=e);const{proxy:c,revoke:h}=Proxy.revocable(n===1?Object.assign([],o):o,ms);if(i.revoke.push(h),ds.add(c),o.proxy=c,s){const l=s;l.finalities.draft.push((u,d)=>{var f,x;const S=L(c);let _=l.type===3?l.setMap:l.copy;const C=le(_,e),D=L(C);if(D){let U=D.original;D.operated&&(U=St(C)),Ct(D),Nt(D,Ue,u,d),l.options.enableAutoFreeze&&(l.options.updatedValues=(f=l.options.updatedValues)!==null&&f!==void 0?f:new WeakMap,l.options.updatedValues.set(U,D.original)),Et(_,e,U)}(x=S.callbacks)===null||x===void 0||x.forEach(U=>{U(u,d)})})}else{const l=L(c);l.finalities.draft.push((u,d)=>{Ct(l),Nt(l,Ue,u,d)})}return c}Tt.createDraft=ys,Object.prototype.constructor.toString();const z=[];for(let r=0;r<256;++r)z.push((r+256).toString(16).slice(1));function qi(r,t=0){return(z[r[t+0]]+z[r[t+1]]+z[r[t+2]]+z[r[t+3]]+"-"+z[r[t+4]]+z[r[t+5]]+"-"+z[r[t+6]]+z[r[t+7]]+"-"+z[r[t+8]]+z[r[t+9]]+"-"+z[r[t+10]]+z[r[t+11]]+z[r[t+12]]+z[r[t+13]]+z[r[t+14]]+z[r[t+15]]).toLowerCase()}let Ot;const zi=new Uint8Array(16);function Vi(){if(!Ot){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ot=crypto.getRandomValues.bind(crypto)}return Ot(zi)}const xs={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Hi(r,t,s){var i;if(xs.randomUUID&&!r)return xs.randomUUID();r=r||{};const e=r.random??((i=r.rng)==null?void 0:i.call(r))??Vi();if(e.length<16)throw new Error("Random bytes length must be >= 16");return e[6]=e[6]&15|64,e[8]=e[8]&63|128,qi(e)}function Ps(){return Hi()}function Ki(r,t){return r.localeCompare(t)}function Ji(){let r=Ki;if(typeof Intl=="object"&&Intl.hasOwnProperty("Collator"))try{r=Intl.Collator("en-US").compare}catch{}return r}Ji();function Wi(){const t={__etype:1,__ops:1,create:1,update:1,link:1,unlink:1,delete:1,merge:1,ruleParams:1};return new Set(Object.keys(t))}const Xi=Wi();function et(r,t,s){const e={__etype:r,__ops:s};return new Proxy(e,{get:(i,a)=>{if(a==="__ops")return s;if(a==="__etype")return r;if(Xi.has(a))return(n,o)=>et(r,t,[...s,o?[a,r,t,n,o]:[a,r,t,n]])}})}function Gi(r,t){return`lookup__${r}__${JSON.stringify(t)}`}function Yi(r){return r.startsWith("lookup__")}function gs(r){const[t,s,...e]=r.split("__");return[s,JSON.parse(e.join("__"))]}function Qi(r){return new Proxy({__etype:r},{get(t,s){if(s==="lookup")return(i,a)=>et(r,gs(Gi(i,a)),[]);if(s==="__etype")return r;const e=s;return Yi(e)?et(r,gs(e),[]):et(r,e,[])}})}function Zi(){return new Proxy({},{get(r,t){return Qi(t)}})}Zi();class Dt extends Error{constructor(s,e){super(s);m(this,"hint");this.hint=e;const i=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,i),Error.captureStackTrace&&Error.captureStackTrace(this,Dt),this.name="InstantError"}get[Symbol.toStringTag](){return"InstantError"}}class $e extends Dt{constructor(s){var a;const e=((a=s.body)==null?void 0:a.message)||`API Error (${s.status})`;super(e,s.body.hint);m(this,"body");m(this,"status");const i=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,i),Error.captureStackTrace&&Error.captureStackTrace(this,$e),this.name="InstantAPIError",this.status=s.status,this.body=s.body}get[Symbol.toStringTag](){return"InstantAPIError"}}typeof window<"u"&&typeof window.localStorage<"u"&&(window.localStorage.getItem("devBackend"),window.localStorage.getItem("__instantLogging"),window.localStorage.getItem("__devtoolLocalDash"));const Ce="v0.22.147";class ee{constructor(t,s,e,i={indexed:!1,unique:!1}){m(this,"valueType");m(this,"required");m(this,"isIndexed");m(this,"config");m(this,"metadata",{});this.valueType=t,this.required=s,this.isIndexed=e,this.config=i}clientRequired(){return new ee(this.valueType,!1,this.isIndexed,this.config)}optional(){return new ee(this.valueType,!1,this.isIndexed,this.config)}unique(){return new ee(this.valueType,this.required,this.isIndexed,{...this.config,unique:!0})}indexed(){return new ee(this.valueType,this.required,!0,{...this.config,indexed:!0})}}class tt{constructor(t,s){m(this,"attrs");m(this,"links");this.attrs=t,this.links=s}asType(){return new tt(this.attrs,this.links)}}class st{constructor(t,s,e){m(this,"entities");m(this,"links");m(this,"rooms");this.entities=t,this.links=s,this.rooms=e}withRoomSchema(){return new st(this.entities,this.links,{})}}var bs;(function(r){r.InitialSyncBatch="InitialSyncBatch",r.InitialSyncComplete="InitialSyncComplete",r.LoadFromStorage="LoadFromStorage",r.SyncTransaction="SyncTransaction",r.Error="Error"})(bs||(bs={}));function er(r,t){return new st(ws(r,t),t,void 0)}function tr(r){return new tt(r,{})}function sr(){return new ee("string",!0,!1)}function ir(){return new ee("number",!0,!1)}function rr(){return new ee("boolean",!0,!1)}function ar(){return new ee("date",!0,!1)}function nr(){return new ee("json",!0,!1)}function or(){return new ee("json",!0,!1)}function ws(r,t){var i,a,n,o;const s={fwd:{},rev:{}};for(const c of Object.values(t))(i=s.fwd)[a=c.forward.on]||(i[a]={}),(n=s.rev)[o=c.reverse.on]||(n[o]={}),s.fwd[c.forward.on][c.forward.label]={entityName:c.reverse.on,cardinality:c.forward.has},s.rev[c.reverse.on][c.reverse.label]={entityName:c.forward.on,cardinality:c.reverse.has};return Object.fromEntries(Object.entries(r).map(([c,h])=>[c,new tt(h.attrs,{...s.fwd[c],...s.rev[c]})]))}function cr({entities:r,links:t,rooms:s}){const e=t??{},i=s??{};return new st(ws(r,e),e,i)}const V={graph:er,schema:cr,entity:tr,string:sr,number:ir,boolean:rr,date:ar,json:nr,any:or};function hr(){return globalThis.__instantDbSchemaHashStore=globalThis.__instantDbSchemaHashStore??new WeakMap,globalThis.__instantDbSchemaHashStore}function lr(){return globalThis.__instantDbStore=globalThis.__instantDbStore??{},globalThis.__instantDbStore}lr(),hr();function ur(){const r="0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz-._~";let t="";for(const s of crypto.getRandomValues(new Uint8Array(64)))t=t+r[s%r.length];return t}function pr(r){return crypto.subtle.digest({name:"SHA-256"},new TextEncoder().encode(r))}function fr(r){return r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function dr(r){return pr(r).then(t=>fr(btoa(String.fromCharCode(...Array.from(new Uint8Array(t))))))}function mr(){const r=Math.min(800,Math.floor(window.outerWidth*.8)),t=Math.min(630,Math.floor(window.outerHeight*.5)),s={width:r,height:t,left:Math.round(window.screenX+(window.outerWidth-r)/2),top:Math.round(window.screenY+(window.outerHeight-t)/8)},e={width:s.width,height:s.height,left:s.left,top:s.top,toolbar:0,scrollbars:1,status:1,resizable:1,menuBar:0,rel:"opener"};return Object.keys(e).map(i=>`${i}=${e[i]}`).join(",")}let Ts=null;function yr({clientId:r,state:t,codeChallenge:s,apiURI:e,redirectUri:i,scopes:a}){const n=new URL(`${e}/platform/oauth/start`);return n.searchParams.set("client_id",r),n.searchParams.set("redirect_uri",i),n.searchParams.set("scope",a.join(" ")),n.searchParams.set("state",t),n.searchParams.set("response_type","code"),n.searchParams.set("code_challenge",s),n.searchParams.set("code_challenge_method","S256"),n.toString()}async function xr({code:r,clientId:t,verifier:s,apiURI:e,redirectUri:i}){const a=await fetch(`${e}/platform/oauth/token`,{method:"POST",headers:{"Content-type":"application/json","Instant-Platform-Version":Ce,"Instant-Core-Version":Ce},body:JSON.stringify({grant_type:"authorization_code",code:r,redirect_uri:i,client_id:t,code_verifier:s})});if(!a.ok){const o=await a.text();let c;try{const h=JSON.parse(o);c={error:h.error,errorDescription:h.error_description,message:`OAuth error: ${h.error||"server_error"}`}}catch{c={error:"server_error",message:"OAuth error: server_error"}}throw new v(c)}const n=await a.json();return{token:n.access_token,expiresAt:new Date(Date.now()+(n.expires_in-30)*1e3)}}function Pr(){if(typeof window>"u")throw new Error("This function may only be used in a browser context.");const r=new URL(window.location.href).searchParams,t=r.get("state"),s=r.get("error"),e=r.get("error_description"),i=r.get("code");if(!t)throw new Error("Invalid redirect. The state param is missing.");const a=new BroadcastChannel(t);return a.addEventListener("message",n=>{n.data.type==="oauth-redirect-window-done"&&window.close()}),a.postMessage({type:"oauth-redirect",state:t,error:s,errorDescription:e,code:i}),()=>{a.close()}}function gr({clientId:r,apiURI:t,redirectUri:s,scopes:e}){if(typeof window>"u")throw new Error("OAuth flow can only be started on the client.");const i=Ts;i&&i.close();const a=crypto.randomUUID(),n=ur(),o=new BroadcastChannel(a),c=new Promise((l,u)=>{o.addEventListener("message",async d=>{if(d.data.type!=="oauth-redirect")return;const{state:f,error:x,code:S,errorDescription:_}=d.data;if(!(!f||f!==a)){if(S)try{const C=await xr({clientId:r,code:S,verifier:n,apiURI:t,redirectUri:s});l(C)}catch(C){C instanceof v&&u(C),u(new v({error:"server_error",message:"OAuth error exchanging code for token"}))}else u(typeof x=="string"?new v({error:x,errorDescription:_,message:`OAuth error: ${x}`}):new v({error:"server_error",message:"OAuth error: server_error"}));o.postMessage({type:"oauth-redirect-window-done"})}})}),h=window.open("",`instantdb_oauth_${Math.random()}`.replace(".",""),mr());return h?(Ts=h,dr(n).then(l=>{const u=yr({clientId:r,state:a,codeChallenge:l,apiURI:t,redirectUri:s,scopes:e});h.location.href=u}),c.finally(()=>o.close())):Promise.reject({error:"Could not open Auth window"})}class br{constructor(t){m(this,"redirectUri");m(this,"clientId");m(this,"apiURI");this.redirectUri=t.redirectUri,this.apiURI=t.apiURI??"https://api.instantdb.com",this.clientId=t.clientId}startClientOnlyFlow(t){return gr({clientId:this.clientId,apiURI:this.apiURI,redirectUri:this.redirectUri,scopes:t})}handleClientRedirect(){return Pr()}}function wr(r,t){if(r==null)return{};var s={};for(var e in r)if({}.hasOwnProperty.call(r,e)){if(t.indexOf(e)!==-1)continue;s[e]=r[e]}return s}class ue{constructor(t,s,e){m(this,"line");m(this,"column");m(this,"index");this.line=t,this.column=s,this.index=e}}class it{constructor(t,s){m(this,"start");m(this,"end");m(this,"filename");m(this,"identifierName");this.start=t,this.end=s}}function Q(r,t){const{line:s,column:e,index:i}=r;return new ue(s,e+t,i+t)}const As="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";var Tr={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:As},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:As}};const Ss={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},rt=r=>r.type==="UpdateExpression"?Ss.UpdateExpression[`${r.prefix}`]:Ss[r.type];var Ar={AccessorIsGenerator:({kind:r})=>`A ${r}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:r})=>`Missing initializer in ${r} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:r})=>`\`${r}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:r,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.
2
2
  - Did you mean \`export { '${r}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:r})=>`'${r==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:r})=>`Unsyntactic ${r==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:r})=>`A string literal cannot be used as an imported binding.
3
3
  - Did you mean \`import { "${r}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:r})=>`Expected number in radix ${r}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:r})=>`Escape sequence in keyword ${r}.`,InvalidIdentifier:({identifierName:r})=>`Invalid identifier ${r}.`,InvalidLhs:({ancestor:r})=>`Invalid left-hand side in ${rt(r)}.`,InvalidLhsBinding:({ancestor:r})=>`Binding invalid left-hand side in ${rt(r)}.`,InvalidLhsOptionalChaining:({ancestor:r})=>`Invalid optional chaining in the left-hand side of ${rt(r)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:r})=>`Unexpected character '${r}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:r})=>`Private name #${r} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:r})=>`Label '${r}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:r})=>`This experimental syntax requires enabling the parser plugin: ${r.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:r})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${r.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:r})=>`Duplicate key "${r}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:r})=>`An export name cannot include a lone surrogate, found '\\u${r.toString(16)}'.`,ModuleExportUndefined:({localName:r})=>`Export '${r}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:r})=>`Private names are only allowed in property accesses (\`obj.#${r}\`) or in \`in\` expressions (\`#${r} in obj\`).`,PrivateNameRedeclaration:({identifierName:r})=>`Duplicate private name #${r}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:r})=>`Unexpected keyword '${r}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:r})=>`Unexpected reserved word '${r}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:r,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${r?`, expected "${r}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:r,onlyValidPropertyName:t})=>`The only valid meta property for ${r} is ${r}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:r})=>`Identifier '${r}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Sr={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:r})=>`Assigning to '${r}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:r})=>`Binding '${r}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Er={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:r})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(r)}\`.`};const Ir=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]);var Cr=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic references are only supported when using the `"proposal": "hack"` version of the pipeline proposal.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:r})=>`Invalid topic token ${r}. In order to use ${r} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${r}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:r})=>`Hack-style pipe body cannot be an unparenthesized ${rt({type:r})}; please wrap it in parentheses.`},{});const Nr=["message"];function Es(r,t,s){Object.defineProperty(r,t,{enumerable:!1,configurable:!0,value:s})}function kr({toMessage:r,code:t,reasonCode:s,syntaxPlugin:e}){const i=s==="MissingPlugin"||s==="MissingOneOfPlugins";return function a(n,o){const c=new SyntaxError;return c.code=t,c.reasonCode=s,c.loc=n,c.pos=n.index,c.syntaxPlugin=e,i&&(c.missingPlugin=o.missingPlugin),Es(c,"clone",function(l={}){const{line:u,column:d,index:f}=l.loc??n;return a(new ue(u,d,f),Object.assign({},o,l.details))}),Es(c,"details",o),Object.defineProperty(c,"message",{configurable:!0,get(){const h=`${r(o)} (${n.line}:${n.column})`;return this.message=h,h},set(h){Object.defineProperty(this,"message",{value:h,writable:!0})}}),c}}function re(r,t){if(Array.isArray(r))return e=>re(e,r[0]);const s={};for(const e of Object.keys(r)){const i=r[e],a=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:n}=a,o=wr(a,Nr),c=typeof n=="string"?()=>n:n;s[e]=kr(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:e,toMessage:c},t?{syntaxPlugin:t}:{},o))}return s}const p=Object.assign({},re(Tr),re(Ar),re(Sr),re(Er),re`pipelineOperator`(Cr));function vr(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!0,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Or(r){const t=vr();if(r==null)return t;if(r.annexB!=null&&r.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(const s of Object.keys(t))r[s]!=null&&(t[s]=r[s]);if(t.startLine===1)r.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:r.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if(r.startColumn==null||r.startIndex==null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");return t}const{defineProperty:Dr}=Object,Is=(r,t)=>{r&&Dr(r,t,{enumerable:!1,value:r[t]})};function qe(r){return Is(r.loc.start,"index"),Is(r.loc.end,"index"),r}var Lr=r=>class extends r{parse(){const s=qe(super.parse());return this.optionFlags&256&&(s.tokens=s.tokens.map(qe)),s}parseRegExpLiteral({pattern:s,flags:e}){let i=null;try{i=new RegExp(s,e)}catch{}const a=this.estreeParseLiteral(i);return a.regex={pattern:s,flags:e},a}parseBigIntLiteral(s){let e;try{e=BigInt(s)}catch{e=null}const i=this.estreeParseLiteral(e);return i.bigint=String(i.value||s),i}parseDecimalLiteral(s){const i=this.estreeParseLiteral(null);return i.decimal=String(i.value||s),i}estreeParseLiteral(s){return this.parseLiteral(s,"Literal")}parseStringLiteral(s){return this.estreeParseLiteral(s)}parseNumericLiteral(s){return this.estreeParseLiteral(s)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(s){return this.estreeParseLiteral(s)}estreeParseChainExpression(s,e){const i=this.startNodeAtNode(s);return i.expression=s,this.finishNodeAt(i,"ChainExpression",e)}directiveToStmt(s){const e=s.value;delete s.value,this.castNodeTo(e,"Literal"),e.raw=e.extra.raw,e.value=e.extra.expressionValue;const i=this.castNodeTo(s,"ExpressionStatement");return i.expression=e,i.directive=e.extra.rawValue,delete e.extra,i}fillOptionalPropertiesForTSESLint(s){}cloneEstreeStringLiteral(s){const{start:e,end:i,loc:a,range:n,raw:o,value:c}=s,h=Object.create(s.constructor.prototype);return h.type="Literal",h.start=e,h.end=i,h.loc=a,h.range=n,h.raw=o,h.value=c,h}initFunction(s,e){super.initFunction(s,e),s.expression=!1}checkDeclaration(s){s!=null&&this.isObjectProperty(s)?this.checkDeclaration(s.value):super.checkDeclaration(s)}getObjectOrClassMethodParams(s){return s.value.params}isValidDirective(s){var e;return s.type==="ExpressionStatement"&&s.expression.type==="Literal"&&typeof s.expression.value=="string"&&!((e=s.expression.extra)!=null&&e.parenthesized)}parseBlockBody(s,e,i,a,n){super.parseBlockBody(s,e,i,a,n);const o=s.directives.map(c=>this.directiveToStmt(c));s.body=o.concat(s.body),delete s.directives}parsePrivateName(){const s=super.parsePrivateName();return this.convertPrivateNameToPrivateIdentifier(s)}convertPrivateNameToPrivateIdentifier(s){const e=super.getPrivateNameSV(s);return s=s,delete s.id,s.name=e,this.castNodeTo(s,"PrivateIdentifier")}isPrivateName(s){return s.type==="PrivateIdentifier"}getPrivateNameSV(s){return s.name}parseLiteral(s,e){const i=super.parseLiteral(s,e);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(s,e,i=!1){super.parseFunctionBody(s,e,i),s.expression=s.body.type!=="BlockStatement"}parseMethod(s,e,i,a,n,o,c=!1){let h=this.startNode();h.kind=s.kind,h=super.parseMethod(h,e,i,a,n,o,c),delete h.kind;const{typeParameters:l}=s;l&&(delete s.typeParameters,h.typeParameters=l,this.resetStartLocationFromNode(h,l));const u=this.castNodeTo(h,this.hasPlugin("typescript")&&!h.body?"TSEmptyBodyFunctionExpression":"FunctionExpression");return s.value=u,o==="ClassPrivateMethod"&&(s.computed=!1),this.hasPlugin("typescript")&&s.abstract?(delete s.abstract,this.finishNode(s,"TSAbstractMethodDefinition")):o==="ObjectMethod"?(s.kind==="method"&&(s.kind="init"),s.shorthand=!1,this.finishNode(s,"Property")):this.finishNode(s,"MethodDefinition")}nameIsConstructor(s){return s.type==="Literal"?s.value==="constructor":super.nameIsConstructor(s)}parseClassProperty(...s){const e=super.parseClassProperty(...s);return e.abstract&&this.hasPlugin("typescript")?(delete e.abstract,this.castNodeTo(e,"TSAbstractPropertyDefinition")):this.castNodeTo(e,"PropertyDefinition"),e}parseClassPrivateProperty(...s){const e=super.parseClassPrivateProperty(...s);return e.abstract&&this.hasPlugin("typescript")?this.castNodeTo(e,"TSAbstractPropertyDefinition"):this.castNodeTo(e,"PropertyDefinition"),e.computed=!1,e}parseClassAccessorProperty(s){const e=super.parseClassAccessorProperty(s);return e.abstract&&this.hasPlugin("typescript")?(delete e.abstract,this.castNodeTo(e,"TSAbstractAccessorProperty")):this.castNodeTo(e,"AccessorProperty"),e}parseObjectProperty(s,e,i,a){const n=super.parseObjectProperty(s,e,i,a);return n&&(n.kind="init",this.castNodeTo(n,"Property")),n}finishObjectProperty(s){return s.kind="init",this.finishNode(s,"Property")}isValidLVal(s,e,i){return s==="Property"?"value":super.isValidLVal(s,e,i)}isAssignable(s,e){return s!=null&&this.isObjectProperty(s)?this.isAssignable(s.value,e):super.isAssignable(s,e)}toAssignable(s,e=!1){if(s!=null&&this.isObjectProperty(s)){const{key:i,value:a}=s;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(a,e)}else super.toAssignable(s,e)}toAssignableObjectExpressionProp(s,e,i){s.type==="Property"&&(s.kind==="get"||s.kind==="set")?this.raise(p.PatternHasAccessor,s.key):s.type==="Property"&&s.method?this.raise(p.PatternHasMethod,s.key):super.toAssignableObjectExpressionProp(s,e,i)}finishCallExpression(s,e){const i=super.finishCallExpression(s,e);return i.callee.type==="Import"?(this.castNodeTo(i,"ImportExpression"),i.source=i.arguments[0],i.options=i.arguments[1]??null,i.attributes=i.arguments[1]??null,delete i.arguments,delete i.callee):i.type==="OptionalCallExpression"?this.castNodeTo(i,"CallExpression"):i.optional=!1,i}toReferencedArguments(s){s.type!=="ImportExpression"&&super.toReferencedArguments(s)}parseExport(s,e){var n;const i=this.state.lastTokStartLoc,a=super.parseExport(s,e);switch(a.type){case"ExportAllDeclaration":a.exported=null;break;case"ExportNamedDeclaration":a.specifiers.length===1&&a.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(a,"ExportAllDeclaration"),a.exported=a.specifiers[0].exported,delete a.specifiers);case"ExportDefaultDeclaration":{const{declaration:o}=a;(o==null?void 0:o.type)==="ClassDeclaration"&&((n=o.decorators)==null?void 0:n.length)>0&&o.start===a.start&&this.resetStartLocation(a,i)}break}return a}stopParseSubscript(s,e){const i=super.stopParseSubscript(s,e);return e.optionalChainMember?this.estreeParseChainExpression(i,s.loc.end):i}parseMember(s,e,i,a,n){const o=super.parseMember(s,e,i,a,n);return o.type==="OptionalMemberExpression"?this.castNodeTo(o,"MemberExpression"):o.optional=!1,o}isOptionalMemberExpression(s){return s.type==="ChainExpression"?s.expression.type==="MemberExpression":super.isOptionalMemberExpression(s)}hasPropertyAsPrivateName(s){return s.type==="ChainExpression"&&(s=s.expression),super.hasPropertyAsPrivateName(s)}isObjectProperty(s){return s.type==="Property"&&s.kind==="init"&&!s.method}isObjectMethod(s){return s.type==="Property"&&(s.method||s.kind==="get"||s.kind==="set")}castNodeTo(s,e){const i=super.castNodeTo(s,e);return this.fillOptionalPropertiesForTSESLint(i),i}cloneIdentifier(s){const e=super.cloneIdentifier(s);return this.fillOptionalPropertiesForTSESLint(e),e}cloneStringLiteral(s){return s.type==="Literal"?this.cloneEstreeStringLiteral(s):super.cloneStringLiteral(s)}finishNodeAt(s,e,i){return qe(super.finishNodeAt(s,e,i))}finishNode(s,e){const i=super.finishNode(s,e);return this.fillOptionalPropertiesForTSESLint(i),i}resetStartLocation(s,e){super.resetStartLocation(s,e),qe(s)}resetEndLocation(s,e=this.state.lastTokEndLoc){super.resetEndLocation(s,e),qe(s)}};class at{constructor(t,s){m(this,"token");m(this,"preserveSpace");this.token=t,this.preserveSpace=!!s}}const M={brace:new at("{"),j_oTag:new at("<tag"),j_cTag:new at("</tag"),j_expr:new at("<tag>...</tag>",!0)},E=!0,y=!0,Lt=!0,ze=!0,pe=!0,Mr=!0;class Cs{constructor(t,s={}){m(this,"label");m(this,"keyword");m(this,"beforeExpr");m(this,"startsExpr");m(this,"rightAssociative");m(this,"isLoop");m(this,"isAssign");m(this,"prefix");m(this,"postfix");m(this,"binop");this.label=t,this.keyword=s.keyword,this.beforeExpr=!!s.beforeExpr,this.startsExpr=!!s.startsExpr,this.rightAssociative=!!s.rightAssociative,this.isLoop=!!s.isLoop,this.isAssign=!!s.isAssign,this.prefix=!!s.prefix,this.postfix=!!s.postfix,this.binop=s.binop!=null?s.binop:null}}const Mt=new Map;function k(r,t={}){t.keyword=r;const s=b(r,t);return Mt.set(r,s),s}function J(r,t){return b(r,{beforeExpr:E,binop:t})}let Ve=-1;const Ft=[],Bt=[],Rt=[],jt=[],_t=[],Ut=[];function b(r,t={}){return++Ve,Bt.push(r),Rt.push(t.binop??-1),jt.push(t.beforeExpr??!1),_t.push(t.startsExpr??!1),Ut.push(t.prefix??!1),Ft.push(new Cs(r,t)),Ve}function I(r,t={}){return++Ve,Mt.set(r,Ve),Bt.push(r),Rt.push(t.binop??-1),jt.push(t.beforeExpr??!1),_t.push(t.startsExpr??!1),Ut.push(t.prefix??!1),Ft.push(new Cs("name",t)),Ve}const Fr={bracketL:b("[",{beforeExpr:E,startsExpr:y}),bracketHashL:b("#[",{beforeExpr:E,startsExpr:y}),bracketBarL:b("[|",{beforeExpr:E,startsExpr:y}),bracketR:b("]"),bracketBarR:b("|]"),braceL:b("{",{beforeExpr:E,startsExpr:y}),braceBarL:b("{|",{beforeExpr:E,startsExpr:y}),braceHashL:b("#{",{beforeExpr:E,startsExpr:y}),braceR:b("}"),braceBarR:b("|}"),parenL:b("(",{beforeExpr:E,startsExpr:y}),parenR:b(")"),comma:b(",",{beforeExpr:E}),semi:b(";",{beforeExpr:E}),colon:b(":",{beforeExpr:E}),doubleColon:b("::",{beforeExpr:E}),dot:b("."),question:b("?",{beforeExpr:E}),questionDot:b("?."),arrow:b("=>",{beforeExpr:E}),template:b("template"),ellipsis:b("...",{beforeExpr:E}),backQuote:b("`",{startsExpr:y}),dollarBraceL:b("${",{beforeExpr:E,startsExpr:y}),templateTail:b("...`",{startsExpr:y}),templateNonTail:b("...${",{beforeExpr:E,startsExpr:y}),at:b("@"),hash:b("#",{startsExpr:y}),interpreterDirective:b("#!..."),eq:b("=",{beforeExpr:E,isAssign:ze}),assign:b("_=",{beforeExpr:E,isAssign:ze}),slashAssign:b("_=",{beforeExpr:E,isAssign:ze}),xorAssign:b("_=",{beforeExpr:E,isAssign:ze}),moduloAssign:b("_=",{beforeExpr:E,isAssign:ze}),incDec:b("++/--",{prefix:pe,postfix:Mr,startsExpr:y}),bang:b("!",{beforeExpr:E,prefix:pe,startsExpr:y}),tilde:b("~",{beforeExpr:E,prefix:pe,startsExpr:y}),doubleCaret:b("^^",{startsExpr:y}),doubleAt:b("@@",{startsExpr:y}),pipeline:J("|>",0),nullishCoalescing:J("??",1),logicalOR:J("||",1),logicalAND:J("&&",2),bitwiseOR:J("|",3),bitwiseXOR:J("^",4),bitwiseAND:J("&",5),equality:J("==/!=/===/!==",6),lt:J("</>/<=/>=",7),gt:J("</>/<=/>=",7),relational:J("</>/<=/>=",7),bitShift:J("<</>>/>>>",8),bitShiftL:J("<</>>/>>>",8),bitShiftR:J("<</>>/>>>",8),plusMin:b("+/-",{beforeExpr:E,binop:9,prefix:pe,startsExpr:y}),modulo:b("%",{binop:10,startsExpr:y}),star:b("*",{binop:10}),slash:J("/",10),exponent:b("**",{beforeExpr:E,binop:11,rightAssociative:!0}),_in:k("in",{beforeExpr:E,binop:7}),_instanceof:k("instanceof",{beforeExpr:E,binop:7}),_break:k("break"),_case:k("case",{beforeExpr:E}),_catch:k("catch"),_continue:k("continue"),_debugger:k("debugger"),_default:k("default",{beforeExpr:E}),_else:k("else",{beforeExpr:E}),_finally:k("finally"),_function:k("function",{startsExpr:y}),_if:k("if"),_return:k("return",{beforeExpr:E}),_switch:k("switch"),_throw:k("throw",{beforeExpr:E,prefix:pe,startsExpr:y}),_try:k("try"),_var:k("var"),_const:k("const"),_with:k("with"),_new:k("new",{beforeExpr:E,startsExpr:y}),_this:k("this",{startsExpr:y}),_super:k("super",{startsExpr:y}),_class:k("class",{startsExpr:y}),_extends:k("extends",{beforeExpr:E}),_export:k("export"),_import:k("import",{startsExpr:y}),_null:k("null",{startsExpr:y}),_true:k("true",{startsExpr:y}),_false:k("false",{startsExpr:y}),_typeof:k("typeof",{beforeExpr:E,prefix:pe,startsExpr:y}),_void:k("void",{beforeExpr:E,prefix:pe,startsExpr:y}),_delete:k("delete",{beforeExpr:E,prefix:pe,startsExpr:y}),_do:k("do",{isLoop:Lt,beforeExpr:E}),_for:k("for",{isLoop:Lt}),_while:k("while",{isLoop:Lt}),_as:I("as",{startsExpr:y}),_assert:I("assert",{startsExpr:y}),_async:I("async",{startsExpr:y}),_await:I("await",{startsExpr:y}),_defer:I("defer",{startsExpr:y}),_from:I("from",{startsExpr:y}),_get:I("get",{startsExpr:y}),_let:I("let",{startsExpr:y}),_meta:I("meta",{startsExpr:y}),_of:I("of",{startsExpr:y}),_sent:I("sent",{startsExpr:y}),_set:I("set",{startsExpr:y}),_source:I("source",{startsExpr:y}),_static:I("static",{startsExpr:y}),_using:I("using",{startsExpr:y}),_yield:I("yield",{startsExpr:y}),_asserts:I("asserts",{startsExpr:y}),_checks:I("checks",{startsExpr:y}),_exports:I("exports",{startsExpr:y}),_global:I("global",{startsExpr:y}),_implements:I("implements",{startsExpr:y}),_intrinsic:I("intrinsic",{startsExpr:y}),_infer:I("infer",{startsExpr:y}),_is:I("is",{startsExpr:y}),_mixins:I("mixins",{startsExpr:y}),_proto:I("proto",{startsExpr:y}),_require:I("require",{startsExpr:y}),_satisfies:I("satisfies",{startsExpr:y}),_keyof:I("keyof",{startsExpr:y}),_readonly:I("readonly",{startsExpr:y}),_unique:I("unique",{startsExpr:y}),_abstract:I("abstract",{startsExpr:y}),_declare:I("declare",{startsExpr:y}),_enum:I("enum",{startsExpr:y}),_module:I("module",{startsExpr:y}),_namespace:I("namespace",{startsExpr:y}),_interface:I("interface",{startsExpr:y}),_type:I("type",{startsExpr:y}),_opaque:I("opaque",{startsExpr:y}),name:b("name",{startsExpr:y}),placeholder:b("%%",{startsExpr:!0}),string:b("string",{startsExpr:y}),num:b("num",{startsExpr:y}),bigint:b("bigint",{startsExpr:y}),decimal:b("decimal",{startsExpr:y}),regexp:b("regexp",{startsExpr:y}),privateName:b("#name",{startsExpr:y}),eof:b("eof"),jsxName:b("jsxName"),jsxText:b("jsxText",{beforeExpr:!0}),jsxTagStart:b("jsxTagStart",{startsExpr:!0}),jsxTagEnd:b("jsxTagEnd")};function O(r){return r>=93&&r<=133}function Br(r){return r<=92}function te(r){return r>=58&&r<=133}function Ns(r){return r>=58&&r<=137}function Rr(r){return jt[r]}function He(r){return _t[r]}function jr(r){return r>=29&&r<=33}function ks(r){return r>=129&&r<=131}function _r(r){return r>=90&&r<=92}function $t(r){return r>=58&&r<=92}function Ur(r){return r>=39&&r<=59}function $r(r){return r===34}function qr(r){return Ut[r]}function zr(r){return r>=121&&r<=123}function Vr(r){return r>=124&&r<=130}function fe(r){return Bt[r]}function nt(r){return Rt[r]}function Hr(r){return r===57}function qt(r){return r>=24&&r<=25}function vs(r){return Ft[r]}let zt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Os="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";const Kr=new RegExp("["+zt+"]"),Jr=new RegExp("["+zt+Os+"]");zt=Os=null;const Ds=[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,4,51,13,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,39,27,10,22,251,41,7,1,17,2,60,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,20,1,64,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,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,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,200,32,32,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,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,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,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,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,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Wr=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,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,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,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,343,9,54,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,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,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,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function Vt(r,t){let s=65536;for(let e=0,i=t.length;e<i;e+=2){if(s+=t[e],s>r)return!1;if(s+=t[e+1],s>=r)return!0}return!1}function ae(r){return r<65?r===36:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&Kr.test(String.fromCharCode(r)):Vt(r,Ds)}function Ne(r){return r<48?r===36:r<58?!0:r<65?!1:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&Jr.test(String.fromCharCode(r)):Vt(r,Ds)||Vt(r,Wr)}const Ht={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},Xr=new Set(Ht.keyword),Gr=new Set(Ht.strict),Yr=new Set(Ht.strictBind);function Ls(r,t){return t&&r==="await"||r==="enum"}function Ms(r,t){return Ls(r,t)||Gr.has(r)}function Fs(r){return Yr.has(r)}function Bs(r,t){return Ms(r,t)||Fs(r)}function Qr(r){return Xr.has(r)}function Zr(r,t,s){return r===64&&t===64&&ae(s)}const ea=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function ta(r){return ea.has(r)}class Kt{constructor(t){m(this,"flags",0);m(this,"names",new Map);m(this,"firstLexicalName","");this.flags=t}}class Jt{constructor(t,s){m(this,"parser");m(this,"scopeStack",[]);m(this,"inModule");m(this,"undefinedExports",new Map);this.parser=t,this.inModule=s}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){const t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){const{flags:s}=this.scopeStack[t];if(s&128)return!0;if(s&707)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new Kt(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,s,e){let i=this.currentScope();if(s&8||s&16){this.checkRedeclarationInScope(i,t,s,e);let a=i.names.get(t)||0;s&16?a=a|4:(i.firstLexicalName||(i.firstLexicalName=t),a=a|2),i.names.set(t,a),s&8&&this.maybeExportDefined(i,t)}else if(s&4)for(let a=this.scopeStack.length-1;a>=0&&(i=this.scopeStack[a],this.checkRedeclarationInScope(i,t,s,e),i.names.set(t,(i.names.get(t)||0)|1),this.maybeExportDefined(i,t),!(i.flags&643));--a);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,s){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(s)}checkRedeclarationInScope(t,s,e,i){this.isRedeclaredInScope(t,s,e)&&this.parser.raise(p.VarRedeclaration,i,{identifierName:s})}isRedeclaredInScope(t,s,e){if(!(e&1))return!1;if(e&8)return t.names.has(s);const i=t.names.get(s);return e&16?(i&2)>0||!this.treatFunctionsAsVarInScope(t)&&(i&1)>0:(i&2)>0&&!(t.flags&8&&t.firstLexicalName===s)||!this.treatFunctionsAsVarInScope(t)&&(i&4)>0}checkLocalExport(t){const{name:s}=t;this.scopeStack[0].names.has(s)||this.undefinedExports.set(s,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){const{flags:s}=this.scopeStack[t];if(s&643)return s}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){const{flags:s}=this.scopeStack[t];if(s&707&&!(s&4))return s}}}class sa extends Kt{constructor(){super(...arguments);m(this,"declareFunctions",new Set)}}class ia extends Jt{createScope(t){return new sa(t)}declareName(t,s,e){const i=this.currentScope();if(s&2048){this.checkRedeclarationInScope(i,t,s,e),this.maybeExportDefined(i,t),i.declareFunctions.add(t);return}super.declareName(t,s,e)}isRedeclaredInScope(t,s,e){if(super.isRedeclaredInScope(t,s,e))return!0;if(e&2048&&!t.declareFunctions.has(s)){const i=t.names.get(s);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}}const ra=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),w=re`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:r})=>`Cannot overwrite reserved type ${r}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:r,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${r} = true,\` or \`${r} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:r,enumName:t})=>`Enum member names need to be unique, but the name \`${r}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:r})=>`Enum \`${r}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:r,enumName:t})=>`Enum type \`${r}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:r})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${r}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:r,memberName:t,explicitType:s})=>`Enum \`${r}\` has type \`${s}\`, so the initializer of \`${t}\` needs to be a ${s} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:r,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${r}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:r,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${r}\`.`,EnumInvalidMemberName:({enumName:r,memberName:t,suggestion:s})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${s}\`, in enum \`${r}\`.`,EnumNumberMemberNotInitialized:({enumName:r,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${r}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:r})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${r}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:r})=>`Unexpected reserved type ${r}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:r,suggestion:t})=>`\`declare export ${r}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function aa(r){return r.type==="DeclareExportAllDeclaration"||r.type==="DeclareExportDeclaration"&&(!r.declaration||r.declaration.type!=="TypeAlias"&&r.declaration.type!=="InterfaceDeclaration")}function Rs(r){return r.importKind==="type"||r.importKind==="typeof"}const na={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function oa(r,t){const s=[],e=[];for(let i=0;i<r.length;i++)(t(r[i],i,r)?s:e).push(r[i]);return[s,e]}const ca=/\*?\s*@((?:no)?flow)\b/;var ha=r=>class extends r{constructor(){super(...arguments);m(this,"flowPragma")}getScopeHandler(){return ia}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,i){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,i)}addComment(e){if(this.flowPragma===void 0){const i=ca.exec(e.value);if(i)if(i[1]==="flow")this.flowPragma="flow";else if(i[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){const i=this.state.inType;this.state.inType=!0,this.expect(e||14);const a=this.flowParseType();return this.state.inType=i,a}flowParsePredicate(){const e=this.startNode(),i=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>i.index+1&&this.raise(w.UnexpectedSpaceBetweenModuloChecks,i),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){const e=this.state.inType;this.state.inType=!0,this.expect(14);let i=null,a=null;return this.match(54)?(this.state.inType=e,a=this.flowParsePredicate()):(i=this.flowParseType(),this.state.inType=e,this.match(54)&&(a=this.flowParsePredicate())),[i,a]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();const i=e.id=this.parseIdentifier(),a=this.startNode(),n=this.startNode();this.match(47)?a.typeParameters=this.flowParseTypeParameterDeclaration():a.typeParameters=null,this.expect(10);const o=this.flowParseFunctionTypeParams();return a.params=o.params,a.rest=o.rest,a.this=o._this,this.expect(11),[a.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),n.typeAnnotation=this.finishNode(a,"FunctionTypeAnnotation"),i.typeAnnotation=this.finishNode(n,"TypeAnnotation"),this.resetEndLocation(i),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,i){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(i&&this.raise(w.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,i);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();const i=e.body=this.startNode(),a=i.body=[];for(this.expect(5);!this.match(8);){let c=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(w.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(c)):(this.expectContextual(125,w.UnsupportedStatementInDeclareModule),c=this.flowParseDeclare(c,!0)),a.push(c)}this.scope.exit(),this.expect(8),this.finishNode(i,"BlockStatement");let n=null,o=!1;return a.forEach(c=>{aa(c)?(n==="CommonJS"&&this.raise(w.AmbiguousDeclareModuleKind,c),n="ES"):c.type==="DeclareModuleExports"&&(o&&this.raise(w.DuplicateDeclareModuleExports,c),n==="ES"&&this.raise(w.AmbiguousDeclareModuleKind,c),n="CommonJS",o=!0)}),e.kind=n||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,i){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!i){const a=this.state.value;throw this.raise(w.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:a,suggestion:na[a]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"?(e.default=!1,delete e.exportKind,this.castNodeTo(e,"DeclareExportDeclaration")):this.castNodeTo(e,"DeclareExportAllDeclaration");this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();const i=this.flowParseTypeAlias(e);return this.castNodeTo(i,"DeclareTypeAlias"),i}flowParseDeclareOpaqueType(e){this.next();const i=this.flowParseOpaqueType(e,!0);return this.castNodeTo(i,"DeclareOpaqueType"),i}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,i){if(e.id=this.flowParseRestrictedIdentifier(!i,!0),this.scope.declareName(e.id.name,i?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!i&&this.eat(12));if(i){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:i,allowExact:!1,allowSpread:!1,allowProto:i,allowInexact:!1})}flowParseInterfaceExtends(){const e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(w.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,i,a){ra.has(e)&&this.raise(a?w.AssignReservedType:w.UnexpectedReservedType,i,{reservedType:e})}flowParseRestrictedIdentifier(e,i){return this.checkReservedType(this.state.value,this.state.startLoc,i),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,i){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,i||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){const i=this.state.startLoc,a=this.startNode(),n=this.flowParseVariance(),o=this.flowParseTypeAnnotatableIdentifier();return a.name=o.name,a.variance=n,a.bound=o.typeAnnotation,this.match(29)?(this.eat(29),a.default=this.flowParseType()):e&&this.raise(w.MissingTypeParamDefault,i),this.finishNode(a,"TypeParameter")}flowParseTypeParameterDeclaration(){const e=this.state.inType,i=this.startNode();i.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let a=!1;do{const n=this.flowParseTypeParameter(a);i.params.push(n),n.default&&(a=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(i,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==M.brace){const i=this.state.context;this.state.context=[i[0]];try{return e()}finally{this.state.context=i}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){const e=this.startNode(),i=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);const a=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=a}),this.state.inType=i,!this.state.inType&&this.curContext()===M.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return;const e=this.startNode(),i=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=i,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){const e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,i,a){return e.static=i,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=a,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,i){return e.static=i,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,i){const a=this.startNode();return e.static=i,e.value=this.flowParseObjectTypeMethodish(a),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:i,allowSpread:a,allowProto:n,allowInexact:o}){const c=this.state.inType;this.state.inType=!0;const h=this.startNode();h.callProperties=[],h.properties=[],h.indexers=[],h.internalSlots=[];let l,u,d=!1;for(i&&this.match(6)?(this.expect(6),l=9,u=!0):(this.expect(5),l=8,u=!1),h.exact=u;!this.match(l);){let x=!1,S=null,_=null;const C=this.startNode();if(n&&this.isContextual(118)){const U=this.lookahead();U.type!==14&&U.type!==17&&(this.next(),S=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){const U=this.lookahead();U.type!==14&&U.type!==17&&(this.next(),x=!0)}const D=this.flowParseVariance();if(this.eat(0))S!=null&&this.unexpected(S),this.eat(0)?(D&&this.unexpected(D.loc.start),h.internalSlots.push(this.flowParseObjectTypeInternalSlot(C,x))):h.indexers.push(this.flowParseObjectTypeIndexer(C,x,D));else if(this.match(10)||this.match(47))S!=null&&this.unexpected(S),D&&this.unexpected(D.loc.start),h.callProperties.push(this.flowParseObjectTypeCallProperty(C,x));else{let U="init";if(this.isContextual(99)||this.isContextual(104)){const g=this.lookahead();Ns(g.type)&&(U=this.state.value,this.next())}const he=this.flowParseObjectTypeProperty(C,x,S,D,U,a,o??!u);he===null?(d=!0,_=this.state.lastTokStartLoc):h.properties.push(he)}this.flowObjectTypeSemicolon(),_&&!this.match(8)&&!this.match(9)&&this.raise(w.UnexpectedExplicitInexactInObject,_)}this.expect(l),a&&(h.inexact=d);const f=this.finishNode(h,"ObjectTypeAnnotation");return this.state.inType=c,f}flowParseObjectTypeProperty(e,i,a,n,o,c,h){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(c?h||this.raise(w.InexactInsideExact,this.state.lastTokStartLoc):this.raise(w.InexactInsideNonObject,this.state.lastTokStartLoc),n&&this.raise(w.InexactVariance,n),null):(c||this.raise(w.UnexpectedSpreadType,this.state.lastTokStartLoc),a!=null&&this.unexpected(a),n&&this.raise(w.SpreadVariance,n),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=i,e.proto=a!=null,e.kind=o;let l=!1;return this.match(47)||this.match(10)?(e.method=!0,a!=null&&this.unexpected(a),n&&this.unexpected(n.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(o==="get"||o==="set")&&this.flowCheckGetterSetterParams(e),!c&&e.key.name==="constructor"&&e.value.this&&this.raise(w.ThisParamBannedInConstructor,e.value.this)):(o!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(l=!0),e.value=this.flowParseTypeInitialiser(),e.variance=n),e.optional=l,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){const i=e.kind==="get"?0:1,a=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?w.GetterMayNotHaveThisParam:w.SetterMayNotHaveThisParam,e.value.this),a!==i&&this.raise(e.kind==="get"?p.BadGetterArity:p.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(p.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,i){e??(e=this.state.startLoc);let a=i||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){const n=this.startNodeAt(e);n.qualification=a,n.id=this.flowParseRestrictedIdentifier(!0),a=this.finishNode(n,"QualifiedTypeIdentifier")}return a}flowParseGenericType(e,i){const a=this.startNodeAt(e);return a.typeParameters=null,a.id=this.flowParseQualifiedTypeIdentifier(e,i),this.match(47)&&(a.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(a,"GenericTypeAnnotation")}flowParseTypeofType(){const e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){const e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let i=null,a=!1,n=null;const o=this.startNode(),c=this.lookahead(),h=this.state.type===78;return c.type===14||c.type===17?(h&&!e&&this.raise(w.ThisParamMustBeFirst,o),i=this.parseIdentifier(h),this.eat(17)&&(a=!0,h&&this.raise(w.ThisParamMayNotBeOptional,o)),n=this.flowParseTypeInitialiser()):n=this.flowParseType(),o.name=i,o.optional=a,o.typeAnnotation=n,this.finishNode(o,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){const i=this.startNodeAt(e.loc.start);return i.name=null,i.optional=!1,i.typeAnnotation=e,this.finishNode(i,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let i=null,a=null;for(this.match(78)&&(a=this.flowParseFunctionTypeParam(!0),a.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(i=this.flowParseFunctionTypeParam(!1)),{params:e,rest:i,_this:a}}flowIdentToTypeAnnotation(e,i,a){switch(a.name){case"any":return this.finishNode(i,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(i,"BooleanTypeAnnotation");case"mixed":return this.finishNode(i,"MixedTypeAnnotation");case"empty":return this.finishNode(i,"EmptyTypeAnnotation");case"number":return this.finishNode(i,"NumberTypeAnnotation");case"string":return this.finishNode(i,"StringTypeAnnotation");case"symbol":return this.finishNode(i,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(a.name),this.flowParseGenericType(e,a)}}flowParsePrimaryType(){const e=this.state.startLoc,i=this.startNode();let a,n,o=!1;const c=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,n=this.flowParseTupleType(),this.state.noAnonFunctionType=c,n;case 47:{const h=this.startNode();return h.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),a=this.flowParseFunctionTypeParams(),h.params=a.params,h.rest=a.rest,h.this=a._this,this.expect(11),this.expect(19),h.returnType=this.flowParseType(),this.finishNode(h,"FunctionTypeAnnotation")}case 10:{const h=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(O(this.state.type)||this.match(78)){const l=this.lookahead().type;o=l!==17&&l!==14}else o=!0;if(o){if(this.state.noAnonFunctionType=!1,n=this.flowParseType(),this.state.noAnonFunctionType=c,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),n;this.eat(12)}return n?a=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(n)]):a=this.flowParseFunctionTypeParams(),h.params=a.params,h.rest=a.rest,h.this=a._this,this.expect(11),this.expect(19),h.returnType=this.flowParseType(),h.typeParameters=null,this.finishNode(h,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return i.value=this.match(85),this.next(),this.finishNode(i,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",i);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",i);throw this.raise(w.UnexpectedSubtractionOperand,this.state.startLoc)}this.unexpected();return;case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(i,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(i,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(i,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(i,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if($t(this.state.type)){const h=fe(this.state.type);return this.next(),super.createIdentifier(i,h)}else if(O(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,i,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){const e=this.state.startLoc;let i=this.flowParsePrimaryType(),a=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){const n=this.startNodeAt(e),o=this.eat(18);a=a||o,this.expect(0),!o&&this.match(3)?(n.elementType=i,this.next(),i=this.finishNode(n,"ArrayTypeAnnotation")):(n.objectType=i,n.indexType=this.flowParseType(),this.expect(3),a?(n.optional=o,i=this.finishNode(n,"OptionalIndexedAccessType")):i=this.finishNode(n,"IndexedAccessType"))}return i}flowParsePrefixType(){const e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){const e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){const i=this.startNodeAt(e.loc.start);return i.params=[this.reinterpretTypeAsFunctionTypeParam(e)],i.rest=null,i.this=null,i.returnType=this.flowParseType(),i.typeParameters=null,this.finishNode(i,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){const e=this.startNode();this.eat(45);const i=this.flowParseAnonFunctionWithoutParens();for(e.types=[i];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?i:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){const e=this.startNode();this.eat(43);const i=this.flowParseIntersectionType();for(e.types=[i];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?i:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){const e=this.state.inType;this.state.inType=!0;const i=this.flowParseUnionType();return this.state.inType=e,i}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){const e=this.state.startLoc,i=this.parseIdentifier();return this.flowParseGenericType(e,i)}else return this.flowParseType()}flowParseTypeAnnotation(){const e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){const i=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(i.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(i)),i}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,i,a=!1){if(i){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,a));return}super.parseFunctionBody(e,!1,a)}parseFunctionBodyAndFinish(e,i,a=!1){if(this.match(14)){const n=this.startNode();[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,i,a)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){const a=this.lookahead();if(te(a.type)){const n=this.startNode();return this.next(),this.flowParseInterface(n)}}else if(this.isContextual(126)){const a=this.startNode();return this.next(),this.flowParseEnumDeclaration(a)}const i=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(i)&&(this.flowPragma=null),i}parseExpressionStatement(e,i,a){if(i.type==="Identifier"){if(i.name==="declare"){if(this.match(80)||O(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(O(this.state.type)){if(i.name==="interface")return this.flowParseInterface(e);if(i.name==="type")return this.flowParseTypeAlias(e);if(i.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,i,a)}shouldParseExportDeclaration(){const{type:e}=this.state;return e===126||ks(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){const{type:e}=this.state;return e===126||ks(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){const e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,i,a){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){const f=this.lookaheadCharCode();if(f===44||f===61||f===58||f===41)return this.setOptionalParametersError(a),e}this.expect(17);const n=this.state.clone(),o=this.state.noArrowAt,c=this.startNodeAt(i);let{consequent:h,failed:l}=this.tryParseConditionalConsequent(),[u,d]=this.getArrowLikeExpressions(h);if(l||d.length>0){const f=[...o];if(d.length>0){this.state=n,this.state.noArrowAt=f;for(let x=0;x<d.length;x++)f.push(d[x].start);({consequent:h,failed:l}=this.tryParseConditionalConsequent()),[u,d]=this.getArrowLikeExpressions(h)}l&&u.length>1&&this.raise(w.AmbiguousConditionalArrow,n.startLoc),l&&u.length===1&&(this.state=n,f.push(u[0].start),this.state.noArrowAt=f,{consequent:h,failed:l}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(h,!0),this.state.noArrowAt=o,this.expect(14),c.test=e,c.consequent=h,c.alternate=this.forwardNoArrowParamsConversionAt(c,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(c,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);const e=this.parseMaybeAssignAllowIn(),i=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:i}}getArrowLikeExpressions(e,i){const a=[e],n=[];for(;a.length!==0;){const o=a.pop();o.type==="ArrowFunctionExpression"&&o.body.type!=="BlockStatement"?(o.typeParameters||!o.returnType?this.finishArrowValidation(o):n.push(o),a.push(o.body)):o.type==="ConditionalExpression"&&(a.push(o.consequent),a.push(o.alternate))}return i?(n.forEach(o=>this.finishArrowValidation(o)),[n,[]]):oa(n,o=>o.params.every(c=>this.isAssignable(c,!0)))}finishArrowValidation(e){var i;this.toAssignableList(e.params,(i=e.extra)==null?void 0:i.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,i){let a;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),a=i(),this.state.noArrowParamsConversionAt.pop()):a=i(),a}parseParenItem(e,i){const a=super.parseParenItem(e,i);if(this.eat(17)&&(a.optional=!0,this.resetEndLocation(e)),this.match(14)){const n=this.startNodeAt(i);return n.expression=a,n.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(n,"TypeCastExpression")}return a}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";const i=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(i)}else if(this.isContextual(131)){e.exportKind="type";const i=this.startNode();return this.next(),this.flowParseOpaqueType(i,!1)}else if(this.isContextual(129)){e.exportKind="type";const i=this.startNode();return this.next(),this.flowParseInterface(i)}else if(this.isContextual(126)){e.exportKind="value";const i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){const{startLoc:i}=this.state,a=super.maybeParseExportNamespaceSpecifier(e);return a&&e.exportKind==="type"&&this.unexpected(i),a}parseClassId(e,i,a){super.parseClassId(e,i,a),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,i,a){const{startLoc:n}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,i))return;i.declare=!0}super.parseClassMember(e,i,a),i.declare&&(i.type!=="ClassProperty"&&i.type!=="ClassPrivateProperty"&&i.type!=="PropertyDefinition"?this.raise(w.DeclareClassElement,n):i.value&&this.raise(w.DeclareClassFieldInitializer,i.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){const e=super.readWord1(),i="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(p.InvalidIdentifier,this.state.curPosition(),{identifierName:i}),this.finishToken(132,i)}getTokenFromCode(e){const i=this.input.charCodeAt(this.state.pos+1);e===123&&i===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?i===46?this.finishOp(18,2):this.finishOp(17,1):Zr(e,i,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,i){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,i):super.isAssignable(e,i)}toAssignable(e,i=!1){!i&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,i)}toAssignableList(e,i,a){for(let n=0;n<e.length;n++){const o=e[n];(o==null?void 0:o.type)==="TypeCastExpression"&&(e[n]=this.typeCastToParameter(o))}super.toAssignableList(e,i,a)}toReferencedList(e,i){var a;for(let n=0;n<e.length;n++){const o=e[n];o&&o.type==="TypeCastExpression"&&!((a=o.extra)!=null&&a.parenthesized)&&(e.length>1||!i)&&this.raise(w.TypeCastInPattern,o.typeAnnotation)}return e}parseArrayLike(e,i,a,n){const o=super.parseArrayLike(e,i,a,n);return i&&!this.state.maybeInArrowParameters&&this.toReferencedList(o.elements),o}isValidLVal(e,i,a){return e==="TypeCastExpression"||super.isValidLVal(e,i,a)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,i,a,n,o,c){if(i.variance&&this.unexpected(i.variance.loc.start),delete i.variance,this.match(47)&&(i.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,i,a,n,o,c),i.params&&o){const h=i.params;h.length>0&&this.isThisParam(h[0])&&this.raise(w.ThisParamBannedInConstructor,i)}else if(i.type==="MethodDefinition"&&o&&i.value.params){const h=i.value.params;h.length>0&&this.isThisParam(h[0])&&this.raise(w.ThisParamBannedInConstructor,i)}}pushClassPrivateMethod(e,i,a,n){i.variance&&this.unexpected(i.variance.loc.start),delete i.variance,this.match(47)&&(i.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,i,a,n)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeArguments=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();const i=e.implements=[];do{const a=this.startNode();a.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?a.typeParameters=this.flowParseTypeParameterInstantiation():a.typeParameters=null,i.push(this.finishNode(a,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);const i=this.getObjectOrClassMethodParams(e);if(i.length>0){const a=i[0];this.isThisParam(a)&&e.kind==="get"?this.raise(w.GetterMayNotHaveThisParam,a):this.isThisParam(a)&&this.raise(w.SetterMayNotHaveThisParam,a)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,i,a,n,o,c,h){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let l;this.match(47)&&!c&&(l=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());const u=super.parseObjPropValue(e,i,a,n,o,c,h);return l&&((u.value||u).typeParameters=l),u}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(w.PatternIsOptional,e),this.isThisParam(e)&&this.raise(w.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(w.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(w.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,i){const a=super.parseMaybeDefault(e,i);return a.type==="AssignmentPattern"&&a.typeAnnotation&&a.right.start<a.typeAnnotation.start&&this.raise(w.TypeBeforeInitializer,a.typeAnnotation),a}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(w.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,i,a){i.local=Rs(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(i,a))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;const i=this.lookaheadCharCode();return i===123||i===42}return!e&&this.isContextual(87)}applyImportPhase(e,i,a,n){if(super.applyImportPhase(e,i,a,n),i){if(!a&&this.match(65))return;e.exportKind=a==="type"?a:"value"}else a==="type"&&this.match(55)&&this.unexpected(),e.importKind=a==="type"||a==="typeof"?a:"value"}parseImportSpecifier(e,i,a,n,o){const c=e.imported;let h=null;c.type==="Identifier"&&(c.name==="type"?h="type":c.name==="typeof"&&(h="typeof"));let l=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){const d=this.parseIdentifier(!0);h!==null&&!te(this.state.type)?(e.imported=d,e.importKind=h,e.local=this.cloneIdentifier(d)):(e.imported=c,e.importKind=null,e.local=this.parseIdentifier())}else{if(h!==null&&te(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=h;else{if(i)throw this.raise(p.ImportBindingIsString,e,{importName:c.value});e.imported=c,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(l=!0,e.local=this.cloneIdentifier(e.imported))}const u=Rs(e);return a&&u&&this.raise(w.ImportTypeShorthandOnlyInPureImport,e),(a||u)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),l&&!a&&!u&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,i){const a=e.kind;a!=="get"&&a!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,i)}parseVarId(e,i){super.parseVarId(e,i),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,i){if(this.match(14)){const a=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=a}return super.parseAsyncArrowFromCallExpression(e,i)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,i){let a=null,n;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(a=this.state.clone(),n=this.tryParse(()=>super.parseMaybeAssign(e,i),a),!n.error)return n.node;const{context:o}=this.state,c=o[o.length-1];(c===M.j_oTag||c===M.j_expr)&&o.pop()}if(n!=null&&n.error||this.match(47)){a=a||this.state.clone();let o;const c=this.tryParse(l=>{var f;o=this.flowParseTypeParameterDeclaration();const u=this.forwardNoArrowParamsConversionAt(o,()=>{const x=super.parseMaybeAssign(e,i);return this.resetStartLocationFromNode(x,o),x});(f=u.extra)!=null&&f.parenthesized&&l();const d=this.maybeUnwrapTypeCastExpression(u);return d.type!=="ArrowFunctionExpression"&&l(),d.typeParameters=o,this.resetStartLocationFromNode(d,o),u},a);let h=null;if(c.node&&this.maybeUnwrapTypeCastExpression(c.node).type==="ArrowFunctionExpression"){if(!c.error&&!c.aborted)return c.node.async&&this.raise(w.UnexpectedTypeParameterBeforeAsyncArrowFunction,o),c.node;h=c.node}if(n!=null&&n.node)return this.state=n.failState,n.node;if(h)return this.state=c.failState,h;throw n!=null&&n.thrown?n.error:c.thrown?c.error:this.raise(w.UnexpectedTokenAfterTypeParameter,o)}return super.parseMaybeAssign(e,i)}parseArrow(e){if(this.match(14)){const i=this.tryParse(()=>{const a=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;const n=this.startNode();return[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=a,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),n});if(i.thrown)return null;i.error&&(this.state=i.failState),e.returnType=i.node.typeAnnotation?this.finishNode(i.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,i){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=i:super.setArrowFunctionParameters(e,i)}checkParams(e,i,a,n=!0){if(!(a&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let o=0;o<e.params.length;o++)this.isThisParam(e.params[o])&&o>0&&this.raise(w.ThisParamMustBeFirst,e.params[o]);super.checkParams(e,i,a,n)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,i,a){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(i.index)){this.next();const n=this.startNodeAt(i);n.callee=e,n.arguments=super.parseCallExpressionArguments(11),e=this.finishNode(n,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){const n=this.state.clone(),o=this.tryParse(h=>this.parseAsyncArrowWithTypeParameters(i)||h(),n);if(!o.error&&!o.aborted)return o.node;const c=this.tryParse(()=>super.parseSubscripts(e,i,a),n);if(c.node&&!c.error)return c.node;if(o.node)return this.state=o.failState,o.node;if(c.node)return this.state=c.failState,c.node;throw o.error||c.error}return super.parseSubscripts(e,i,a)}parseSubscript(e,i,a,n){if(this.match(18)&&this.isLookaheadToken_lt()){if(n.optionalChainMember=!0,a)return n.stop=!0,e;this.next();const o=this.startNodeAt(i);return o.callee=e,o.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),o.arguments=this.parseCallExpressionArguments(11),o.optional=!0,this.finishCallExpression(o,!0)}else if(!a&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){const o=this.startNodeAt(i);o.callee=e;const c=this.tryParse(()=>(o.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),o.arguments=super.parseCallExpressionArguments(11),n.optionalChainMember&&(o.optional=!1),this.finishCallExpression(o,n.optionalChainMember)));if(c.node)return c.error&&(this.state=c.failState),c.node}return super.parseSubscript(e,i,a,n)}parseNewCallee(e){super.parseNewCallee(e);let i=null;this.shouldParseTypes()&&this.match(47)&&(i=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=i}parseAsyncArrowWithTypeParameters(e){const i=this.startNodeAt(e);if(this.parseFunctionParams(i,!1),!!this.parseArrow(i))return super.parseArrowExpression(i,void 0,!0)}readToken_mult_modulo(e){const i=this.input.charCodeAt(this.state.pos+1);if(e===42&&i===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){const i=this.input.charCodeAt(this.state.pos+1);if(e===124&&i===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,i){const a=super.parseTopLevel(e,i);return this.state.hasFlowComment&&this.raise(w.UnterminatedFlowComment,this.state.curPosition()),a}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(w.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();const e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){const{pos:e}=this.state;let i=2;for(;[32,9].includes(this.input.charCodeAt(e+i));)i++;const a=this.input.charCodeAt(i+e),n=this.input.charCodeAt(i+e+1);return a===58&&n===58?i+2:this.input.slice(i+e,i+e+12)==="flow-include"?i+12:a===58&&n!==58?i:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(p.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:i,memberName:a}){this.raise(w.EnumBooleanMemberNotInitialized,e,{memberName:a,enumName:i})}flowEnumErrorInvalidMemberInitializer(e,i){return this.raise(i.explicitType?i.explicitType==="symbol"?w.EnumInvalidMemberInitializerSymbolType:w.EnumInvalidMemberInitializerPrimaryType:w.EnumInvalidMemberInitializerUnknownType,e,i)}flowEnumErrorNumberMemberNotInitialized(e,i){this.raise(w.EnumNumberMemberNotInitialized,e,i)}flowEnumErrorStringMemberInconsistentlyInitialized(e,i){this.raise(w.EnumStringMemberInconsistentlyInitialized,e,i)}flowEnumMemberInit(){const e=this.state.startLoc,i=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{const a=this.parseNumericLiteral(this.state.value);return i()?{type:"number",loc:a.loc.start,value:a}:{type:"invalid",loc:e}}case 134:{const a=this.parseStringLiteral(this.state.value);return i()?{type:"string",loc:a.loc.start,value:a}:{type:"invalid",loc:e}}case 85:case 86:{const a=this.parseBooleanLiteral(this.match(85));return i()?{type:"boolean",loc:a.loc.start,value:a}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){const e=this.state.startLoc,i=this.parseIdentifier(!0),a=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:i,init:a}}flowEnumCheckExplicitTypeMismatch(e,i,a){const{explicitType:n}=i;n!==null&&n!==a&&this.flowEnumErrorInvalidMemberInitializer(e,i)}flowEnumMembers({enumName:e,explicitType:i}){const a=new Set,n={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]};let o=!1;for(;!this.match(8);){if(this.eat(21)){o=!0;break}const c=this.startNode(),{id:h,init:l}=this.flowEnumMemberRaw(),u=h.name;if(u==="")continue;/^[a-z]/.test(u)&&this.raise(w.EnumInvalidMemberName,h,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:e}),a.has(u)&&this.raise(w.EnumDuplicateMemberName,h,{memberName:u,enumName:e}),a.add(u);const d={enumName:e,explicitType:i,memberName:u};switch(c.id=h,l.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(l.loc,d,"boolean"),c.init=l.value,n.booleanMembers.push(this.finishNode(c,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(l.loc,d,"number"),c.init=l.value,n.numberMembers.push(this.finishNode(c,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(l.loc,d,"string"),c.init=l.value,n.stringMembers.push(this.finishNode(c,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(l.loc,d);case"none":switch(i){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(l.loc,d);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(l.loc,d);break;default:n.defaultedMembers.push(this.finishNode(c,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:n,hasUnknownMembers:o}}flowEnumStringMembers(e,i,{enumName:a}){if(e.length===0)return i;if(i.length===0)return e;if(i.length>e.length){for(const n of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:a});return i}else{for(const n of i)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:a});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!O(this.state.type))throw this.raise(w.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});const{value:i}=this.state;return this.next(),i!=="boolean"&&i!=="number"&&i!=="string"&&i!=="symbol"&&this.raise(w.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:i}),i}flowEnumBody(e,i){const a=i.name,n=i.loc.start,o=this.flowEnumParseExplicitType({enumName:a});this.expect(5);const{members:c,hasUnknownMembers:h}=this.flowEnumMembers({enumName:a,explicitType:o});switch(e.hasUnknownMembers=h,o){case"boolean":return e.explicitType=!0,e.members=c.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=c.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(c.stringMembers,c.defaultedMembers,{enumName:a}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=c.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{const l=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;const u=c.booleanMembers.length,d=c.numberMembers.length,f=c.stringMembers.length,x=c.defaultedMembers.length;if(!u&&!d&&!f&&!x)return l();if(!u&&!d)return e.members=this.flowEnumStringMembers(c.stringMembers,c.defaultedMembers,{enumName:a}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!d&&!f&&u>=x){for(const S of c.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(S.loc.start,{enumName:a,memberName:S.id.name});return e.members=c.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!u&&!f&&d>=x){for(const S of c.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(S.loc.start,{enumName:a,memberName:S.id.name});return e.members=c.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(w.EnumInconsistentMemberValues,n,{enumName:a}),l()}}}flowParseEnumDeclaration(e){const i=this.parseIdentifier();return e.id=i,e.body=this.flowEnumBody(this.startNode(),i),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){const e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){const i=this.input.charCodeAt(e+1);return i!==60&&i!==61}return!1}reScan_lt_gt(){const{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){const{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}};const la={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},ua=/\r\n|[\r\n\u2028\u2029]/,ot=new RegExp(ua.source,"g");function ke(r){switch(r){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function js(r,t,s){for(let e=t;e<s;e++)if(ke(r.charCodeAt(e)))return!0;return!1}const Wt=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Xt=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function pa(r){switch(r){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}const ne=re`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:r})=>`Expected corresponding JSX closing tag for <${r}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:r,HTMLEntity:t})=>`Unexpected token \`${r}\`. Did you mean \`${t}\` or \`{'${r}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function de(r){return r?r.type==="JSXOpeningFragment"||r.type==="JSXClosingFragment":!1}function ve(r){if(r.type==="JSXIdentifier")return r.name;if(r.type==="JSXNamespacedName")return r.namespace.name+":"+r.name.name;if(r.type==="JSXMemberExpression")return ve(r.object)+"."+ve(r.property);throw new Error("Node had unexpected type: "+r.type)}var fa=r=>class extends r{jsxReadToken(){let s="",e=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(ne.UnterminatedJsxContent,this.state.startLoc);const i=this.input.charCodeAt(this.state.pos);switch(i){case 60:case 123:if(this.state.pos===this.state.start){i===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(i);return}s+=this.input.slice(e,this.state.pos),this.finishToken(142,s);return;case 38:s+=this.input.slice(e,this.state.pos),s+=this.jsxReadEntity(),e=this.state.pos;break;case 62:case 125:this.raise(ne.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:i===125?"&rbrace;":"&gt;"});default:ke(i)?(s+=this.input.slice(e,this.state.pos),s+=this.jsxReadNewLine(!0),e=this.state.pos):++this.state.pos}}}jsxReadNewLine(s){const e=this.input.charCodeAt(this.state.pos);let i;return++this.state.pos,e===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,i=s?`
4
4
  `:`\r
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instantdb/platform",
3
- "version": "0.22.146",
3
+ "version": "0.22.147",
4
4
  "description": "Instant's platform package for managing Instant apps.",
5
5
  "homepage": "https://github.com/instantdb/instant/tree/main/client/packages/platform",
6
6
  "repository": {
@@ -54,8 +54,8 @@
54
54
  "dependencies": {
55
55
  "@babel/parser": "^8.0.0-beta.0",
56
56
  "@babel/types": "^8.0.0-beta.0",
57
- "@instantdb/core": "0.22.146",
58
- "@instantdb/version": "0.22.146"
57
+ "@instantdb/version": "0.22.147",
58
+ "@instantdb/core": "0.22.147"
59
59
  },
60
60
  "scripts": {
61
61
  "test": "vitest",