!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).svelte={})}(this,(function(e){"use strict";function t(e,t,s){const r=s._;let a=!1;function i(e,{next:t,state:n}){t(n)}return function e(t,o,l){if(a)return;if(!t.type)return;let c;const p={},u={path:o,state:l,next:(s=l)=>{o.push(t);for(const n in t){if("type"===n)continue;const r=t[n];if(r&&"object"==typeof r)if(Array.isArray(r)){const t={};r.forEach(((n,r)=>{if(n&&"object"==typeof n){const a=e(n,o,s);a&&(t[r]=a)}})),Object.keys(t).length>0&&(p[n]=r.map(((e,n)=>t[n]??e)))}else{const t=e(r,o,s);t&&(p[n]=t)}}if(o.pop(),Object.keys(p).length>0)return n(t,p)},stop:()=>{a=!0},visit:(n,s=l)=>{o.push(t);const r=e(n,o,s)??n;return o.pop(),r}};let d=s[t.type]??i;if(r){let e;c=r(t,{...u,next:(n=l)=>(l=n,e=d(t,{...u,state:n}),e)}),!c&&e&&(c=e)}else c=d(t,u);return c||Object.keys(p).length>0&&(c=n(t,p)),c||void 0}(e,[],t)??e}function n(e,t){const n={},s=Object.getOwnPropertyDescriptors(e);for(const e in s)Object.defineProperty(n,e,s[e]);for(const e in t)n[e]=t[e];return n}const s=/\s/,r=/\s+/,a=/^\r?\n/,i=/^\s/,o=/^[ \t\r\n]+/,l=/\s$/,c=/[ \t\r\n]+$/,p=/[^ \t\r\n]/,u=/[ \t\n\r\f]+/g,d=/^[ \t\n\r\f]+$/,h=/[^\n]/g,m=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/,f=/(^[^a-zA-Z_$]|[^a-zA-Z0-9_$])/g,y=/^[aeiou]/,v=/^h[1-6]$/,g=/(^[0-9-.])|[\^$@%&#?!|()[\]{}^*+~;]/,b=1,_=2,x=4,C=8,w=16,k=1,S=2,P="http://www.w3.org/2000/svg",E="http://www.w3.org/1998/Math/MathML";function T(e,t){if(0===t.length)return null;const n=new q(t).get(e);return n&&n[0][0]>.7?n[0][1]:null}function A(e,t){if(null===e&&null===t)throw"Trying to compare two null values";if(null===e||null===t)return 0;const n=function(e,t){const n=[];let s=0,r=0;for(let a=0;a<=t.length;a++)for(let i=0;i<=e.length;i++)r=a&&i?e.charAt(i-1)===t.charAt(a-1)?s:Math.min(n[i],n[i-1],s)+1:a+i,s=n[i],n[i]=r;return n.pop()}(e=String(e),t=String(t));return 1-n/Math.max(e.length,t.length)}const $=/[^\w, ]+/;function I(e,t=2){const n={},s=function(e,t=2){const n="-"+e.toLowerCase().replace($,"")+"-",s=t-n.length,r=[];if(s>0)for(let t=0;t=2;--t){const n=this.__get(e,t);if(n.length>0)return n}return null}__get(e,t){const n=e.toLowerCase(),s={},r=I(n,t),a=this.items[t];let i,o,l,c,p,u=0;for(i in r)if(o=r[i],u+=Math.pow(o,2),i in this.match_dict)for(l=0;l{const n=r+e.length+1,s={start:r,end:n,line:t};return r=n,s}));let i=0;return function(t,r){if("string"==typeof t&&(t=e.indexOf(t,r??0)),-1===t)return;let o=a[i];const l=t>=o.end?1:-1;for(;o;){if(L(o,t))return{line:n+o.line,column:s+t-o.start,character:t};i+=l,o=a[i]}}}const O=/\r/g;function N(e){let t=5381,n=(e=e.replace(O,"")).length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return(t>>>0).toString(36)}const D=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function j(e){return D.includes(e)||"!doctype"===e.toLowerCase()}const B=["arguments","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","eval","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","var","void","while","with","yield"];function F(e){return B.includes(e)}function V(e){return e.endsWith("capture")&&"gotpointercapture"!==e&&"lostpointercapture"!==e}const H=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function U(e){return H.includes(e)}const z=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];function W(e){return z.includes(e)}const G={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};const K=[...z,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];const X=["autofocus","muted","defaultValue","defaultChecked"];function Q(e){return X.includes(e)}const Y=["touchstart","touchmove"];const J=["textContent","innerHTML","innerText"];function Z(e){return J.includes(e)}const ee=["body","embed","iframe","img","link","object","script","style","track"];function te(e){return ee.includes(e)}const ne=["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","discard","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hatch","hatchpath","hkern","image","line","linearGradient","marker","mask","mesh","meshgradient","meshpatch","meshrow","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","solidcolor","stop","svg","switch","symbol","text","textPath","tref","tspan","unknown","use","view","vkern"];function se(e){return ne.includes(e)}const re=["annotation","annotation-xml","maction","math","merror","mfrac","mi","mmultiscripts","mn","mo","mover","mpadded","mphantom","mprescripts","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msubsup","msup","mtable","mtd","mtext","mtr","munder","munderover","semantics"];const ae=["$state","$state.raw","$state.snapshot","$props","$props.id","$bindable","$derived","$derived.by","$effect","$effect.pre","$effect.tracking","$effect.root","$inspect","$inspect().with","$inspect.trace","$host"];function ie(e){return ae.includes(e)}let oe,le,ce,pe,ue=[],de=M("",{offsetLine:1});function he(e){const t=de(e.start);return`${n=oe,n?.replace(/\//g,"/​")}:${t?.line}:${t.column}`;var n}let me=[],fe=new Map;function ye(e=(()=>!0)){pe=e}function ve(e,t){return ce&&!!fe.get(e)?.some((e=>e.has(t)))}function ge(e,t){le=e;const n=t.rootDir?.replace(/\\/g,"/");oe=t.filename.replace(/\\/g,"/"),ce=!!t.dev,"string"==typeof n&&oe.startsWith(n)&&(oe=oe.replace(n,"").replace(/^[/\\]/,"")),de=M(le,{offsetLine:1}),ue=[],me=[],fe.clear()}const be=/^\t+/;function _e(e){return e.replace(be,(e=>e.split("\t").join(" ")))}class xe{name="CompileDiagnostic";constructor(e,t,n){this.code=e,this.message=t,oe&&(this.filename=oe),n&&(this.position=n,this.start=de(n[0]),this.end=de(n[1]),this.start&&this.end&&(this.frame=function(e,t,n){const s=e.split("\n"),r=Math.max(0,t-2),a=Math.min(t+3,s.length),i=String(a+1).length;return s.slice(r,a).map(((e,s)=>{const a=r+s===t,o=String(s+r+1).padStart(i," ");if(a){const t=" ".repeat(i+2+_e(e.slice(0,n)).length)+"^";return`${o}: ${_e(e)}\n${t}`}return`${o}: ${_e(e)}`})).join("\n")}(le,this.start.line-1,this.end.column)))}toString(){let e=`${this.code}: ${this.message}`;return this.filename&&(e+=`\n${this.filename}`,this.start&&(e+=`:${this.start.line}:${this.start.column}`)),this.frame&&(e+=`\n${this.frame}`),e}toJSON(){return{code:this.code,message:this.message,filename:this.filename,start:this.start,end:this.end,position:this.position,frame:this.frame}}}class Ce extends xe{name="CompileWarning";constructor(e,t,n){super(e,t,n)}}function we(e,t,n){let s=me;if(e&&(s=fe.get(e)??me),s&&s.at(-1)?.has(t))return;const r=new Ce(t,n,e&&void 0!==e.start?[e.start,e.end??e.start]:void 0);pe(r)&&ue.push(r)}function ke(e){we(e,"a11y_accesskey","Avoid using accesskey\nhttps://svelte.dev/e/a11y_accesskey")}function Se(e){we(e,"a11y_aria_activedescendant_has_tabindex","An element with an aria-activedescendant attribute should have a tabindex value\nhttps://svelte.dev/e/a11y_aria_activedescendant_has_tabindex")}function Pe(e,t){we(e,"a11y_aria_attributes",`\`<${t}>\` should not have aria-* attributes\nhttps://svelte.dev/e/a11y_aria_attributes`)}function Ee(e){we(e,"a11y_autofocus","Avoid using autofocus\nhttps://svelte.dev/e/a11y_autofocus")}function Te(e,t){we(e,"a11y_hidden",`\`<${t}>\` element should not be hidden\nhttps://svelte.dev/e/a11y_hidden`)}function Ae(e,t,n){we(e,"a11y_incorrect_aria_attribute_type",`The value of '${t}' must be a ${n}\nhttps://svelte.dev/e/a11y_incorrect_aria_attribute_type`)}function $e(e,t){we(e,"a11y_interactive_supports_focus",`Elements with the '${t}' interactive role must have a tabindex value\nhttps://svelte.dev/e/a11y_interactive_supports_focus`)}function Ie(e,t){we(e,"a11y_misplaced_role",`\`<${t}>\` should not have role attribute\nhttps://svelte.dev/e/a11y_misplaced_role`)}function Re(e){we(e,"a11y_misplaced_scope","The scope attribute should only be used with `` elements\nhttps://svelte.dev/e/a11y_misplaced_scope")}function qe(e,t,n){we(e,"a11y_mouse_events_have_key_events",`'${t}' event must be accompanied by '${n}' event\nhttps://svelte.dev/e/a11y_mouse_events_have_key_events`)}function Le(e,t){we(e,"a11y_no_abstract_role",`Abstract role '${t}' is forbidden\nhttps://svelte.dev/e/a11y_no_abstract_role`)}function Me(e,t,n){we(e,"a11y_no_interactive_element_to_noninteractive_role",`\`<${t}>\` cannot have role '${n}'\nhttps://svelte.dev/e/a11y_no_interactive_element_to_noninteractive_role`)}function Oe(e,t,n){we(e,"a11y_no_noninteractive_element_to_interactive_role",`Non-interactive element \`<${t}>\` cannot have interactive role '${n}'\nhttps://svelte.dev/e/a11y_no_noninteractive_element_to_interactive_role`)}function Ne(e,t){we(e,"a11y_no_redundant_roles",`Redundant role '${t}'\nhttps://svelte.dev/e/a11y_no_redundant_roles`)}function De(e){we(e,"a11y_positive_tabindex","Avoid tabindex values above zero\nhttps://svelte.dev/e/a11y_positive_tabindex")}function je(e,t,n){we(e,"a11y_role_has_required_aria_props",`Elements with the ARIA role "${t}" must have the following attributes defined: ${n}\nhttps://svelte.dev/e/a11y_role_has_required_aria_props`)}function Be(e,t,n){we(e,"a11y_role_supports_aria_props",`The attribute '${t}' is not supported by the role '${n}'\nhttps://svelte.dev/e/a11y_role_supports_aria_props`)}function Fe(e,t,n,s){we(e,"a11y_role_supports_aria_props_implicit",`The attribute '${t}' is not supported by the role '${n}'. This role is implicit on the element \`<${s}>\`\nhttps://svelte.dev/e/a11y_role_supports_aria_props_implicit`)}function Ve(e,t,n){we(e,"a11y_unknown_aria_attribute",(n?`Unknown aria attribute 'aria-${t}'. Did you mean '${n}'?`:`Unknown aria attribute 'aria-${t}'`)+"\nhttps://svelte.dev/e/a11y_unknown_aria_attribute")}function He(e,t,n){we(e,"a11y_unknown_role",(n?`Unknown role '${t}'. Did you mean '${n}'?`:`Unknown role '${t}'`)+"\nhttps://svelte.dev/e/a11y_unknown_role")}function Ue(e,t,n){we(e,"legacy_code",`\`${t}\` is no longer valid — please use \`${n}\` instead\nhttps://svelte.dev/e/legacy_code`)}function ze(e,t,n){we(e,"unknown_code",(n?`\`${t}\` is not a recognised code (did you mean \`${n}\`?)`:`\`${t}\` is not a recognised code`)+"\nhttps://svelte.dev/e/unknown_code")}function We(e){we(e,"options_deprecated_accessors","The `accessors` option has been deprecated. It will have no effect in runes mode\nhttps://svelte.dev/e/options_deprecated_accessors")}function Ge(e){we(e,"options_deprecated_immutable","The `immutable` option has been deprecated. It will have no effect in runes mode\nhttps://svelte.dev/e/options_deprecated_immutable")}function Ke(e){we(e,"options_missing_custom_element","The `customElement` option is used when generating a custom element. Did you forget the `customElement: true` compile option?\nhttps://svelte.dev/e/options_missing_custom_element")}function Xe(e){we(e,"options_renamed_ssr_dom",'`generate: "dom"` and `generate: "ssr"` options have been renamed to "client" and "server" respectively\nhttps://svelte.dev/e/options_renamed_ssr_dom')}function Qe(e,t){we(e,"export_let_unused",`Component has unused export property '${t}'. If it is for external reference only, please consider using \`export const ${t}\`\nhttps://svelte.dev/e/export_let_unused`)}function Ye(e,t){we(e,"non_reactive_update",`\`${t}\` is updated, but is not declared with \`$state(...)\`. Changing its value will not correctly trigger updates\nhttps://svelte.dev/e/non_reactive_update`)}function Je(e,t){we(e,"store_rune_conflict",`It looks like you're using the \`$${t}\` rune, but there is a local binding called \`${t}\`. Referencing a local variable with a \`$\` prefix will create a store subscription. Please rename \`${t}\` to avoid the ambiguity\nhttps://svelte.dev/e/store_rune_conflict`)}function Ze(e){we(e,"attribute_avoid_is",'The "is" attribute is not supported cross-browser and should be avoided\nhttps://svelte.dev/e/attribute_avoid_is')}function et(e,t){we(e,"attribute_global_event_reference",`You are referencing \`globalThis.${t}\`. Did you forget to declare a variable with that name?\nhttps://svelte.dev/e/attribute_global_event_reference`)}function tt(e,t,n){we(e,"attribute_invalid_property_name",`'${t}' is not a valid HTML attribute. Did you mean '${n}'?\nhttps://svelte.dev/e/attribute_invalid_property_name`)}function nt(e,t){we(e,"node_invalid_placement_ssr",`${t}. When rendering this component on the server, the resulting HTML will be modified by the browser (by moving, removing, or inserting elements), likely resulting in a \`hydration_mismatch\` warning\nhttps://svelte.dev/e/node_invalid_placement_ssr`)}function st(e){we(e,"script_unknown_attribute","Unrecognized attribute — should be one of `generics`, `lang` or `module`. If this exists for a preprocessor, ensure that the preprocessor removes it\nhttps://svelte.dev/e/script_unknown_attribute")}const rt=/^\s*svelte-ignore\s/,at={"non-top-level-reactive-declaration":"reactive_declaration_invalid_placement","module-script-reactive-declaration":"reactive_declaration_module_script","empty-block":"block_empty","avoid-is":"attribute_avoid_is","invalid-html-attribute":"attribute_invalid_property_name","a11y-structure":"a11y_figcaption_parent","illegal-attribute-character":"attribute_illegal_colon","invalid-rest-eachblock-binding":"bind_invalid_each_rest","unused-export-let":"export_let_unused"},it=["a11y_accesskey","a11y_aria_activedescendant_has_tabindex","a11y_aria_attributes","a11y_autocomplete_valid","a11y_autofocus","a11y_click_events_have_key_events","a11y_consider_explicit_label","a11y_distracting_elements","a11y_figcaption_index","a11y_figcaption_parent","a11y_hidden","a11y_img_redundant_alt","a11y_incorrect_aria_attribute_type","a11y_incorrect_aria_attribute_type_boolean","a11y_incorrect_aria_attribute_type_id","a11y_incorrect_aria_attribute_type_idlist","a11y_incorrect_aria_attribute_type_integer","a11y_incorrect_aria_attribute_type_token","a11y_incorrect_aria_attribute_type_tokenlist","a11y_incorrect_aria_attribute_type_tristate","a11y_interactive_supports_focus","a11y_invalid_attribute","a11y_label_has_associated_control","a11y_media_has_caption","a11y_misplaced_role","a11y_misplaced_scope","a11y_missing_attribute","a11y_missing_content","a11y_mouse_events_have_key_events","a11y_no_abstract_role","a11y_no_interactive_element_to_noninteractive_role","a11y_no_noninteractive_element_interactions","a11y_no_noninteractive_element_to_interactive_role","a11y_no_noninteractive_tabindex","a11y_no_redundant_roles","a11y_no_static_element_interactions","a11y_positive_tabindex","a11y_role_has_required_aria_props","a11y_role_supports_aria_props","a11y_role_supports_aria_props_implicit","a11y_unknown_aria_attribute","a11y_unknown_role","legacy_code","unknown_code","options_deprecated_accessors","options_deprecated_immutable","options_missing_custom_element","options_removed_enable_sourcemap","options_removed_hydratable","options_removed_loop_guard_timeout","options_renamed_ssr_dom","export_let_unused","legacy_component_creation","non_reactive_update","perf_avoid_inline_class","perf_avoid_nested_class","reactive_declaration_invalid_placement","reactive_declaration_module_script_dependency","state_referenced_locally","store_rune_conflict","css_unused_selector","attribute_avoid_is","attribute_global_event_reference","attribute_illegal_colon","attribute_invalid_property_name","attribute_quoted","bind_invalid_each_rest","block_empty","component_name_lowercase","element_invalid_self_closing_tag","event_directive_deprecated","node_invalid_placement_ssr","script_context_deprecated","script_unknown_attribute","slot_element_deprecated","svelte_component_deprecated","svelte_element_invalid_this","svelte_self_deprecated"].concat(["state_snapshot_uncloneable","binding_property_non_reactive","hydration_attribute_changed","hydration_html_changed","ownership_invalid_binding","ownership_invalid_mutation"]);function ot(e,t,n){const s=rt.exec(t);if(!s)return[];let r=s[0].length;e+=r;const a=[];if(n)for(const n of t.slice(r).matchAll(/([\w$-]+)(,)?/gm)){const t=n[1];if(it.includes(t))a.push(t);else{const s=at[t]??t.replace(/-/g,"_"),r=e+n.index,a=r+t.length;if(it.includes(s))Ue({start:r,end:a},t,s);else{ze({start:r,end:a},t,T(t,it))}}if(!n[2])break}else for(const e of t.slice(r).matchAll(/[\w$-]+/gm)){const t=e[0];if(a.push(t),!it.includes(t)){const e=at[t]??t.replace(/-/g,"_");it.includes(e)&&a.push(e)}}return a}function lt(e){const t=rt.exec(e);if(!t)return e;const n=t[0].length;return e.substring(0,n)+e.substring(n).replace(/\w+-\w+(-\w+)*/g,((t,s,r)=>{let a=at[t]??t.replace(/-/g,"_");return/\w+-\w+/.test(e.substring(n+r+t.length))&&(a+=","),a}))}function ct(e){const t=e.at(0),n=e.at(-1);"Text"===t?.type&&(p.test(t.data)?t.data=t.data.replace(o,""):e.shift()),"Text"===n?.type&&(p.test(n.data)?n.data=n.data.replace(c,""):e.pop())}var pt=[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],ut=[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],dt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",ht={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},mt="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",ft={5:mt,"5module":mt+" export import",6:mt+" const class extends export import super"},yt=/^in(stanceof)?$/,vt=new RegExp("["+dt+"]"),gt=new RegExp("["+dt+"‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");function bt(e,t){for(var n=65536,s=0;se)return!1;if((n+=t[s+1])>=e)return!0}return!1}function _t(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&vt.test(String.fromCharCode(e)):!1!==t&&bt(e,ut)))}function xt(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&>.test(String.fromCharCode(e)):!1!==t&&(bt(e,ut)||bt(e,pt)))))}var Ct=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function wt(e,t){return new Ct(e,{beforeExpr:!0,binop:t})}var kt={beforeExpr:!0},St={startsExpr:!0},Pt={};function Et(e,t){return void 0===t&&(t={}),t.keyword=e,Pt[e]=new Ct(e,t)}var Tt={num:new Ct("num",St),regexp:new Ct("regexp",St),string:new Ct("string",St),name:new Ct("name",St),privateId:new Ct("privateId",St),eof:new Ct("eof"),bracketL:new Ct("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new Ct("]"),braceL:new Ct("{",{beforeExpr:!0,startsExpr:!0}),braceR:new Ct("}"),parenL:new Ct("(",{beforeExpr:!0,startsExpr:!0}),parenR:new Ct(")"),comma:new Ct(",",kt),semi:new Ct(";",kt),colon:new Ct(":",kt),dot:new Ct("."),question:new Ct("?",kt),questionDot:new Ct("?."),arrow:new Ct("=>",kt),template:new Ct("template"),invalidTemplate:new Ct("invalidTemplate"),ellipsis:new Ct("...",kt),backQuote:new Ct("`",St),dollarBraceL:new Ct("${",{beforeExpr:!0,startsExpr:!0}),eq:new Ct("=",{beforeExpr:!0,isAssign:!0}),assign:new Ct("_=",{beforeExpr:!0,isAssign:!0}),incDec:new Ct("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Ct("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:wt("||",1),logicalAND:wt("&&",2),bitwiseOR:wt("|",3),bitwiseXOR:wt("^",4),bitwiseAND:wt("&",5),equality:wt("==/!=/===/!==",6),relational:wt("/<=/>=",7),bitShift:wt("<>/>>>",8),plusMin:new Ct("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:wt("%",10),star:wt("*",10),slash:wt("/",10),starstar:new Ct("**",{beforeExpr:!0}),coalesce:wt("??",1),_break:Et("break"),_case:Et("case",kt),_catch:Et("catch"),_continue:Et("continue"),_debugger:Et("debugger"),_default:Et("default",kt),_do:Et("do",{isLoop:!0,beforeExpr:!0}),_else:Et("else",kt),_finally:Et("finally"),_for:Et("for",{isLoop:!0}),_function:Et("function",St),_if:Et("if"),_return:Et("return",kt),_switch:Et("switch"),_throw:Et("throw",kt),_try:Et("try"),_var:Et("var"),_const:Et("const"),_while:Et("while",{isLoop:!0}),_with:Et("with"),_new:Et("new",{beforeExpr:!0,startsExpr:!0}),_this:Et("this",St),_super:Et("super",St),_class:Et("class",St),_extends:Et("extends",kt),_export:Et("export"),_import:Et("import",St),_null:Et("null",St),_true:Et("true",St),_false:Et("false",St),_in:Et("in",{beforeExpr:!0,binop:7}),_instanceof:Et("instanceof",{beforeExpr:!0,binop:7}),_typeof:Et("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Et("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Et("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},At=/\r\n?|\n|\u2028|\u2029/,$t=new RegExp(At.source,"g");function It(e){return 10===e||13===e||8232===e||8233===e}function Rt(e,t,n){void 0===n&&(n=e.length);for(var s=t;s>10),56320+(1023&e)))}var Ht=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Ut=function(e,t){this.line=e,this.column=t};Ut.prototype.offset=function(e){return new Ut(this.line,this.column+e)};var zt=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)};function Wt(e,t){for(var n=1,s=0;;){var r=Rt(e,s,t);if(r<0)return new Ut(n,t-s);++n,s=r}}var Gt={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Kt=!1;function Xt(e){var t={};for(var n in Gt)t[n]=e&&Dt(e,n)?e[n]:Gt[n];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!Kt&&"object"==typeof console&&console.warn&&(Kt=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),jt(t.onToken)){var s=t.onToken;t.onToken=function(e){return s.push(e)}}return jt(t.onComment)&&(t.onComment=function(e,t){return function(n,s,r,a,i,o){var l={type:n?"Block":"Line",value:s,start:r,end:a};e.locations&&(l.loc=new zt(this,i,o)),e.ranges&&(l.range=[r,a]),t.push(l)}}(t,t.onComment)),t}var Qt=256;function Yt(e,t){return 2|(e?4:0)|(t?8:0)}var Jt=function(e,t,n){this.options=e=Xt(e),this.sourceFile=e.sourceFile,this.keywords=Ft(ft[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var s="";!0!==e.allowReserved&&(s=ht[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(s+=" await")),this.reservedWords=Ft(s);var r=(s?s+" ":"")+ht.strict;this.reservedWordsStrict=Ft(r),this.reservedWordsStrictBind=Ft(r+" "+ht.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(At).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=Tt.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null,this.privateNameStack=[]},Zt={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Jt.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Zt.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},Zt.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0&&!this.currentVarScope().inClassFieldInit},Zt.inAsync.get=function(){return(4&this.currentVarScope().flags)>0&&!this.currentVarScope().inClassFieldInit},Zt.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&Qt)return!1;if(2&t.flags)return(4&t.flags)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Zt.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(64&t)>0||n||this.options.allowSuperOutsideMethod},Zt.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},Zt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Zt.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,n=e.inClassFieldInit;return(258&t)>0||n},Zt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Qt)>0},Jt.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,s=0;s=,?^&]/.test(r)||"!"===r&&"="===this.input.charAt(s+1))}e+=t[0].length,Lt.lastIndex=e,e+=Lt.exec(this.input)[0].length,";"===this.input[e]&&e++}},en.eat=function(e){return this.type===e&&(this.next(),!0)},en.isContextual=function(e){return this.type===Tt.name&&this.value===e&&!this.containsEsc},en.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},en.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},en.canInsertSemicolon=function(){return this.type===Tt.eof||this.type===Tt.braceR||At.test(this.input.slice(this.lastTokEnd,this.start))},en.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},en.semicolon=function(){this.eat(Tt.semi)||this.insertSemicolon()||this.unexpected()},en.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},en.expect=function(e){this.eat(e)||this.unexpected()},en.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var nn=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};en.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")}},en.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,s=e.doubleProto;if(!t)return n>=0||s>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")},en.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&s<56320)return!0;if(_t(s,!0)){for(var r=n+1;xt(s=this.input.charCodeAt(r),!0);)++r;if(92===s||s>55295&&s<56320)return!0;var a=this.input.slice(n,r);if(!yt.test(a))return!0}return!1},sn.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Lt.lastIndex=this.pos;var e,t=Lt.exec(this.input),n=this.pos+t[0].length;return!(At.test(this.input.slice(this.pos,n))||"function"!==this.input.slice(n,n+8)||n+8!==this.input.length&&(xt(e=this.input.charCodeAt(n+8))||e>55295&&e<56320))},sn.parseStatement=function(e,t,n){var s,r=this.type,a=this.startNode();switch(this.isLet(e)&&(r=Tt._var,s="let"),r){case Tt._break:case Tt._continue:return this.parseBreakContinueStatement(a,r.keyword);case Tt._debugger:return this.parseDebuggerStatement(a);case Tt._do:return this.parseDoStatement(a);case Tt._for:return this.parseForStatement(a);case Tt._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(a,!1,!e);case Tt._class:return e&&this.unexpected(),this.parseClass(a,!0);case Tt._if:return this.parseIfStatement(a);case Tt._return:return this.parseReturnStatement(a);case Tt._switch:return this.parseSwitchStatement(a);case Tt._throw:return this.parseThrowStatement(a);case Tt._try:return this.parseTryStatement(a);case Tt._const:case Tt._var:return s=s||this.value,e&&"var"!==s&&this.unexpected(),this.parseVarStatement(a,s);case Tt._while:return this.parseWhileStatement(a);case Tt._with:return this.parseWithStatement(a);case Tt.braceL:return this.parseBlock(!0,a);case Tt.semi:return this.parseEmptyStatement(a);case Tt._export:case Tt._import:if(this.options.ecmaVersion>10&&r===Tt._import){Lt.lastIndex=this.pos;var i=Lt.exec(this.input),o=this.pos+i[0].length,l=this.input.charCodeAt(o);if(40===l||46===l)return this.parseExpressionStatement(a,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===Tt._import?this.parseImport(a):this.parseExport(a,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(a,!0,!e);var c=this.value,p=this.parseExpression();return r===Tt.name&&"Identifier"===p.type&&this.eat(Tt.colon)?this.parseLabeledStatement(a,c,p,e):this.parseExpressionStatement(a,p)}},sn.parseBreakContinueStatement=function(e,t){var n="break"===t;this.next(),this.eat(Tt.semi)||this.insertSemicolon()?e.label=null:this.type!==Tt.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var s=0;s=6?this.eat(Tt.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},sn.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(rn),this.enterScope(0),this.expect(Tt.parenL),this.type===Tt.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===Tt._var||this.type===Tt._const||n){var s=this.startNode(),r=n?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),(this.type===Tt._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===s.declarations.length?(this.options.ecmaVersion>=9&&(this.type===Tt._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,s)):(t>-1&&this.unexpected(t),this.parseFor(e,s))}var a=this.isContextual("let"),i=!1,o=this.containsEsc,l=new nn,c=this.start,p=t>-1?this.parseExprSubscripts(l,"await"):this.parseExpression(!0,l);return this.type===Tt._in||(i=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===Tt._in&&this.unexpected(t),e.await=!0):i&&this.options.ecmaVersion>=8&&(p.start!==c||o||"Identifier"!==p.type||"async"!==p.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),a&&i&&this.raise(p.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(p,!1,l),this.checkLValPattern(p),this.parseForIn(e,p)):(this.checkExpressionErrors(l,!0),t>-1&&this.unexpected(t),this.parseFor(e,p))},sn.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,ln|(n?0:cn),!1,t)},sn.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(Tt._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},sn.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Tt.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},sn.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(Tt.braceL),this.labels.push(an),this.enterScope(0);for(var n=!1;this.type!==Tt.braceR;)if(this.type===Tt._case||this.type===Tt._default){var s=this.type===Tt._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(Tt.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},sn.parseThrowStatement=function(e){return this.next(),At.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var on=[];sn.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?32:0),this.checkLValPattern(e,t?4:2),this.expect(Tt.parenR),e},sn.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===Tt._catch){var t=this.startNode();this.next(),this.eat(Tt.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(Tt._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},sn.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")},sn.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(rn),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},sn.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},sn.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},sn.parseLabeledStatement=function(e,t,n,s){for(var r=0,a=this.labels;r=0;o--){var l=this.labels[o];if(l.statementStart!==e.start)break;l.statementStart=this.start,l.kind=i}return this.labels.push({name:t,kind:i,statementStart:this.start}),e.body=this.parseStatement(s?-1===s.indexOf("label")?s+"label":s:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},sn.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},sn.parseBlock=function(e,t,n){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(Tt.braceL),e&&this.enterScope(0);this.type!==Tt.braceR;){var s=this.parseStatement(null);t.body.push(s)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},sn.parseFor=function(e,t){return e.init=t,this.expect(Tt.semi),e.test=this.type===Tt.semi?null:this.parseExpression(),this.expect(Tt.semi),e.update=this.type===Tt.parenR?null:this.parseExpression(),this.expect(Tt.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},sn.parseForIn=function(e,t){var n=this.type===Tt._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!n||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(Tt.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")},sn.parseVar=function(e,t,n,s){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(Tt.eq)?r.init=this.parseMaybeAssign(t):s||"const"!==n||this.type===Tt._in||this.options.ecmaVersion>=6&&this.isContextual("of")?s||"Identifier"===r.id.type||t&&(this.type===Tt._in||this.isContextual("of"))?r.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(Tt.comma))break}return e},sn.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var ln=1,cn=2;function pn(e,t){var n=t.key.name,s=e[n],r="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(r=(t.static?"s":"i")+t.kind),"iget"===s&&"iset"===r||"iset"===s&&"iget"===r||"sget"===s&&"sset"===r||"sset"===s&&"sget"===r?(e[n]="true",!1):!!s||(e[n]=r,!1)}function un(e,t){var n=e.computed,s=e.key;return!n&&("Identifier"===s.type&&s.name===t||"Literal"===s.type&&s.value===t)}sn.parseFunction=function(e,t,n,s,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===Tt.star&&t&cn&&this.unexpected(),e.generator=this.eat(Tt.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&ln&&(e.id=4&t&&this.type!==Tt.name?null:this.parseIdent(),!e.id||t&cn||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var a=this.yieldPos,i=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Yt(e.async,e.generator)),t&ln||(e.id=this.type===Tt.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,r),this.yieldPos=a,this.awaitPos=i,this.awaitIdentPos=o,this.finishNode(e,t&ln?"FunctionDeclaration":"FunctionExpression")},sn.parseFunctionParams=function(e){this.expect(Tt.parenL),e.params=this.parseBindingList(Tt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},sn.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var s=this.enterClassBody(),r=this.startNode(),a=!1;for(r.body=[],this.expect(Tt.braceL);this.type!==Tt.braceR;){var i=this.parseClassElement(null!==e.superClass);i&&(r.body.push(i),"MethodDefinition"===i.type&&"constructor"===i.kind?(a&&this.raiseRecoverable(i.start,"Duplicate constructor in the same class"),a=!0):i.key&&"PrivateIdentifier"===i.key.type&&pn(s,i)&&this.raiseRecoverable(i.key.start,"Identifier '#"+i.key.name+"' has already been declared"))}return this.strict=n,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},sn.parseClassElement=function(e){if(this.eat(Tt.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),s="",r=!1,a=!1,i="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(Tt.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===Tt.star?o=!0:s="static"}if(n.static=o,!s&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==Tt.star||this.canInsertSemicolon()?s="async":a=!0),!s&&(t>=9||!a)&&this.eat(Tt.star)&&(r=!0),!s&&!a&&!r){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?i=l:s=l)}if(s?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=s,this.finishNode(n.key,"Identifier")):this.parseClassElementName(n),t<13||this.type===Tt.parenL||"method"!==i||r||a){var c=!n.static&&un(n,"constructor"),p=c&&e;c&&"method"!==i&&this.raise(n.key.start,"Constructor can't have get/set modifier"),n.kind=c?"constructor":i,this.parseClassMethod(n,r,a,p)}else this.parseClassField(n);return n},sn.isClassElementNameStart=function(){return this.type===Tt.name||this.type===Tt.privateId||this.type===Tt.num||this.type===Tt.string||this.type===Tt.bracketL||this.type.keyword},sn.parseClassElementName=function(e){this.type===Tt.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},sn.parseClassMethod=function(e,t,n,s){var r=e.key;"constructor"===e.kind?(t&&this.raise(r.start,"Constructor can't be a generator"),n&&this.raise(r.start,"Constructor can't be an async method")):e.static&&un(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(t,n,s);return"get"===e.kind&&0!==a.params.length&&this.raiseRecoverable(a.start,"getter should have no params"),"set"===e.kind&&1!==a.params.length&&this.raiseRecoverable(a.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===a.params[0].type&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},sn.parseClassField=function(e){if(un(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&un(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(Tt.eq)){var t=this.currentThisScope(),n=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=n}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")},sn.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==Tt.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},sn.parseClassId=function(e,t){this.type===Tt.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},sn.parseClassSuper=function(e){e.superClass=this.eat(Tt._extends)?this.parseExprSubscripts(null,!1):null},sn.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},sn.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var s=this.privateNameStack.length,r=0===s?null:this.privateNameStack[s-1],a=0;a=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==Tt.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},sn.parseExport=function(e,t){if(this.next(),this.eat(Tt.star))return this.parseExportAllDeclaration(e,t);if(this.eat(Tt._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==Tt.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,s=e.specifiers;n=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},sn.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportSpecifier")},sn.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportDefaultSpecifier")},sn.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportNamespaceSpecifier")},sn.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===Tt.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(Tt.comma)))return e;if(this.type===Tt.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(Tt.braceL);!this.eat(Tt.braceR);){if(t)t=!1;else if(this.expect(Tt.comma),this.afterTrailingComma(Tt.braceR))break;e.push(this.parseImportSpecifier())}return e},sn.parseWithClause=function(){var e=[];if(!this.eat(Tt._with))return e;this.expect(Tt.braceL);for(var t={},n=!0;!this.eat(Tt.braceR);){if(n)n=!1;else if(this.expect(Tt.comma),this.afterTrailingComma(Tt.braceR))break;var s=this.parseImportAttribute(),r="Identifier"===s.key.type?s.key.name:s.key.value;Dt(t,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(s)}return e},sn.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===Tt.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(Tt.colon),this.type!==Tt.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},sn.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Tt.string){var e=this.parseLiteral(this.value);return Ht.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},sn.adaptDirectivePrologue=function(e){for(var t=0;t=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var dn=Jt.prototype;dn.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var s=0,r=e.properties;s=8&&!o&&"async"===l.name&&!this.canInsertSemicolon()&&this.eat(Tt._function))return this.overrideContext(mn.f_expr),this.parseFunction(this.startNodeAt(a,i),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(Tt.arrow))return this.parseArrowExpression(this.startNodeAt(a,i),[l],!1,t);if(this.options.ecmaVersion>=8&&"async"===l.name&&this.type===Tt.name&&!o&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return l=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(Tt.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,i),[l],!0,t)}return l;case Tt.regexp:var c=this.value;return(s=this.parseLiteral(c.value)).regex={pattern:c.pattern,flags:c.flags},s;case Tt.num:case Tt.string:return this.parseLiteral(this.value);case Tt._null:case Tt._true:case Tt._false:return(s=this.startNode()).value=this.type===Tt._null?null:this.type===Tt._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case Tt.parenL:var p=this.start,u=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),u;case Tt.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(Tt.bracketR,!0,!0,e),this.finishNode(s,"ArrayExpression");case Tt.braceL:return this.overrideContext(mn.b_expr),this.parseObj(!1,e);case Tt._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case Tt._class:return this.parseClass(this.startNode(),!1);case Tt._new:return this.parseNew();case Tt.backQuote:return this.parseTemplate();case Tt._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},yn.parseExprAtomDefault=function(){this.unexpected()},yn.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===Tt.parenL&&!e)return this.parseDynamicImport(t);if(this.type===Tt.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name="import",t.meta=this.finishNode(n,"Identifier"),this.parseImportMeta(t)}this.unexpected()},yn.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(Tt.parenR)?e.options=null:(this.expect(Tt.comma),this.afterTrailingComma(Tt.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(Tt.parenR)||(this.expect(Tt.comma),this.afterTrailingComma(Tt.parenR)||this.unexpected())));else if(!this.eat(Tt.parenR)){var t=this.start;this.eat(Tt.comma)&&this.eat(Tt.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},yn.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},yn.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},yn.parseParenExpression=function(){this.expect(Tt.parenL);var e=this.parseExpression();return this.expect(Tt.parenR),e},yn.shouldParseArrow=function(e){return!this.canInsertSemicolon()},yn.parseParenAndDistinguishExpression=function(e,t){var n,s=this.start,r=this.startLoc,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var i,o=this.start,l=this.startLoc,c=[],p=!0,u=!1,d=new nn,h=this.yieldPos,m=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==Tt.parenR;){if(p?p=!1:this.expect(Tt.comma),a&&this.afterTrailingComma(Tt.parenR,!0)){u=!0;break}if(this.type===Tt.ellipsis){i=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===Tt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var f=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(Tt.parenR),e&&this.shouldParseArrow(c)&&this.eat(Tt.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=h,this.awaitPos=m,this.parseParenArrowList(s,r,c,t);c.length&&!u||this.unexpected(this.lastTokStart),i&&this.unexpected(i),this.checkExpressionErrors(d,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=m||this.awaitPos,c.length>1?((n=this.startNodeAt(o,l)).expressions=c,this.finishNodeAt(n,"SequenceExpression",f,y)):n=c[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var v=this.startNodeAt(s,r);return v.expression=n,this.finishNode(v,"ParenthesizedExpression")}return n},yn.parseParenItem=function(e){return e},yn.parseParenArrowList=function(e,t,n,s){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,s)};var bn=[];yn.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Tt.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var s=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,r,!0,!1),this.eat(Tt.parenL)?e.arguments=this.parseExprList(Tt.parenR,this.options.ecmaVersion>=8,!1):e.arguments=bn,this.finishNode(e,"NewExpression")},yn.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===Tt.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===Tt.backQuote,this.finishNode(n,"TemplateElement")},yn.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var s=this.parseTemplateElement({isTagged:t});for(n.quasis=[s];!s.tail;)this.type===Tt.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Tt.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(Tt.braceR),n.quasis.push(s=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},yn.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===Tt.name||this.type===Tt.num||this.type===Tt.string||this.type===Tt.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Tt.star)&&!At.test(this.input.slice(this.lastTokEnd,this.start))},yn.parseObj=function(e,t){var n=this.startNode(),s=!0,r={};for(n.properties=[],this.next();!this.eat(Tt.braceR);){if(s)s=!1;else if(this.expect(Tt.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Tt.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,r,t),n.properties.push(a)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},yn.parseProperty=function(e,t){var n,s,r,a,i=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(Tt.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===Tt.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===Tt.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(r=this.start,a=this.startLoc),e||(n=this.eat(Tt.star)));var o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(i)?(s=!0,n=this.options.ecmaVersion>=9&&this.eat(Tt.star),this.parsePropertyName(i)):s=!1,this.parsePropertyValue(i,e,n,s,r,a,t,o),this.finishNode(i,"Property")},yn.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t="get"===e.kind?0:1;if(e.value.params.length!==t){var n=e.value.start;"get"===e.kind?this.raiseRecoverable(n,"getter should have no params"):this.raiseRecoverable(n,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},yn.parsePropertyValue=function(e,t,n,s,r,a,i,o){(n||s)&&this.type===Tt.colon&&this.unexpected(),this.eat(Tt.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,i),e.kind="init"):this.options.ecmaVersion>=6&&this.type===Tt.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,s)):t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===Tt.comma||this.type===Tt.braceR||this.type===Tt.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((n||s)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),e.kind="init",t?e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key)):this.type===Tt.eq&&i?(i.shorthandAssign<0&&(i.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected():((n||s)&&this.unexpected(),this.parseGetterSetter(e))},yn.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(Tt.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(Tt.bracketR),e.key;e.computed=!1}return e.key=this.type===Tt.num||this.type===Tt.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},yn.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},yn.parseMethod=function(e,t,n){var s=this.startNode(),r=this.yieldPos,a=this.awaitPos,i=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|Yt(t,s.generator)|(n?128:0)),this.expect(Tt.parenL),s.params=this.parseBindingList(Tt.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=i,this.finishNode(s,"FunctionExpression")},yn.parseArrowExpression=function(e,t,n,s){var r=this.yieldPos,a=this.awaitPos,i=this.awaitIdentPos;return this.enterScope(16|Yt(n,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=i,this.finishNode(e,"ArrowFunctionExpression")},yn.parseFunctionBody=function(e,t,n,s){var r=t&&this.type!==Tt.braceL,a=this.strict,i=!1;if(r)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);a&&!o||(i=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var l=this.labels;this.labels=[],i&&(this.strict=!0),this.checkParams(e,!a&&!i&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,i&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()},yn.isSimpleParamList=function(e){for(var t=0,n=e;t-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&1&r.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var a=this.currentScope();s=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var i=this.scopeStack.length-1;i>=0;--i){var o=this.scopeStack[i];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){s=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],259&o.flags)break}s&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},xn.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},xn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},xn.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(259&t.flags)return t}},xn.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(259&t.flags&&!(16&t.flags))return t}};var wn=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new zt(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},kn=Jt.prototype;function Sn(e,t,n,s){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=n),e}kn.startNode=function(){return new wn(this,this.start,this.startLoc)},kn.startNodeAt=function(e,t){return new wn(this,e,t)},kn.finishNode=function(e,t){return Sn.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},kn.finishNodeAt=function(e,t,n,s){return Sn.call(this,e,t,n,s)},kn.copyNode=function(e){var t=new wn(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Pn="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",En=Pn+" Extended_Pictographic",Tn=En+" EBase EComp EMod EPres ExtPict",An={9:Pn,10:En,11:En,12:Tn,13:Tn,14:Tn},$n={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},In="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Rn="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",qn=Rn+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ln=qn+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Mn=Ln+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",On=Mn+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Nn={9:Rn,10:qn,11:Ln,12:Mn,13:On,14:On+" Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz"},Dn={};function jn(e){var t=Dn[e]={binary:Ft(An[e]+" "+In),binaryOfStrings:Ft($n[e]),nonBinary:{General_Category:Ft(In),Script:Ft(Nn[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Bn=0,Fn=[9,10,11,12,13,14];Bn=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Dn[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function zn(e){return 105===e||109===e||115===e}function Wn(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Gn(e){return e>=65&&e<=90||e>=97&&e<=122}Un.prototype.reset=function(e,t,n){var s=-1!==n.indexOf("v"),r=-1!==n.indexOf("u");this.start=0|e,this.source=t+"",this.flags=n,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=r&&this.parser.options.ecmaVersion>=9)},Un.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},Un.prototype.at=function(e,t){void 0===t&&(t=!1);var n=this.source,s=n.length;if(e>=s)return-1;var r=n.charCodeAt(e);if(!t&&!this.switchU||r<=55295||r>=57344||e+1>=s)return r;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(r<<10)+a-56613888:r},Un.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var n=this.source,s=n.length;if(e>=s)return s;var r,a=n.charCodeAt(e);return!t&&!this.switchU||a<=55295||a>=57344||e+1>=s||(r=n.charCodeAt(e+1))<56320||r>57343?e+1:e+2},Un.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},Un.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},Un.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},Un.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},Un.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var n=this.pos,s=0,r=e;s-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===i&&(s=!0),"v"===i&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(e.start,"Invalid regular expression flag")},Vn.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&function(e){for(var t in e)return!0;return!1}(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Vn.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t=16;for(t&&(e.branchID=new Hn(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},Vn.regexp_alternative=function(e){for(;e.pos=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Vn.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Vn.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Vn.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var s=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return-1!==r&&r=16){var n=this.regexp_eatModifiers(e),s=e.eat(45);if(n||s){for(var r=0;r-1&&e.raise("Duplicate regular expression modifiers")}if(s){var i=this.regexp_eatModifiers(e);n||i||58!==e.current()||e.raise("Invalid regular expression modifiers");for(var o=0;o-1||n.indexOf(l)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},Vn.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Vn.regexp_eatModifiers=function(e){for(var t="",n=0;-1!==(n=e.current())&&zn(n);)t+=Vt(n),e.advance();return t},Vn.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Vn.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Vn.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!Wn(t)&&(e.lastIntValue=t,e.advance(),!0)},Vn.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;-1!==(n=e.current())&&!Wn(n);)e.advance();return e.pos!==t},Vn.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},Vn.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var s=0,r=n;s=11,s=e.current(n);return e.advance(n),92===s&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(s=e.lastIntValue),function(e){return _t(e,!0)||36===e||95===e}(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)},Vn.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,s=e.current(n);return e.advance(n),92===s&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(s=e.lastIntValue),function(e){return xt(e,!0)||36===e||95===e||8204===e||8205===e}(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)},Vn.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Vn.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Vn.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Vn.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Vn.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Vn.regexp_eatZero=function(e){return 48===e.current()&&!Qn(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Vn.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Vn.regexp_eatControlLetter=function(e){var t=e.current();return!!Gn(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Vn.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var n,s=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(r&&a>=55296&&a<=56319){var i=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(a-55296)+(o-56320)+65536,!0}e.pos=i,e.lastIntValue=a}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((n=e.lastIntValue)>=0&&n<=1114111))return!0;r&&e.raise("Invalid unicode escape"),e.pos=s}return!1},Vn.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},Vn.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};function Kn(e){return Gn(e)||95===e}function Xn(e){return Kn(e)||Qn(e)}function Qn(e){return e>=48&&e<=57}function Yn(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Jn(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Zn(e){return e>=48&&e<=55}Vn.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),1;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=80===t)||112===t)){var s;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&2===s&&e.raise("Invalid property name"),s;e.raise("Invalid property name")}return 0},Vn.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,s),1}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return 0},Vn.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){Dt(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},Vn.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},Vn.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Kn(t=e.current());)e.lastStringValue+=Vt(t),e.advance();return""!==e.lastStringValue},Vn.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Xn(t=e.current());)e.lastStringValue+=Vt(t),e.advance();return""!==e.lastStringValue},Vn.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Vn.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&2===n&&e.raise("Negated character class may contain strings"),!0}return!1},Vn.regexp_classContents=function(e){return 93===e.current()?1:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),1)},Vn.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||-1!==t&&-1!==n||e.raise("Invalid character class"),-1!==t&&-1!==n&&t>n&&e.raise("Range out of order in character class")}}},Vn.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(99===n||Zn(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var s=e.current();return 93!==s&&(e.lastIntValue=s,e.advance(),!0)},Vn.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Vn.regexp_classSetExpression=function(e){var t,n=1;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){2===t&&(n=2);for(var s=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?2!==t&&(n=1):e.raise("Invalid character in character class");if(s!==e.pos)return n;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(s!==e.pos)return n}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return n;2===t&&(n=2)}},Vn.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var s=e.lastIntValue;return-1!==n&&-1!==s&&n>s&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},Vn.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?1:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Vn.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),s=this.regexp_classContents(e);if(e.eat(93))return n&&2===s&&e.raise("Negated character class may contain strings"),s;e.pos=t}if(e.eat(92)){var r=this.regexp_eatCharacterClassEscape(e);if(r)return r;e.pos=t}return null},Vn.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise("Invalid escape");e.pos=t}return null},Vn.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)2===this.regexp_classString(e)&&(t=2);return t},Vn.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?1:2},Vn.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e))||(e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1));var n=e.current();return!(n<0||n===e.lookahead()&&function(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}(n))&&(!function(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}(n)&&(e.advance(),e.lastIntValue=n,!0))},Vn.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!function(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}(t)&&(e.lastIntValue=t,e.advance(),!0)},Vn.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Qn(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},Vn.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Vn.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Qn(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},Vn.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Yn(n=e.current());)e.lastIntValue=16*e.lastIntValue+Jn(n),e.advance();return e.pos!==t},Vn.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*n+e.lastIntValue:e.lastIntValue=8*t+n}else e.lastIntValue=t;return!0}return!1},Vn.regexp_eatOctalDigit=function(e){var t=e.current();return Zn(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Vn.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var s=0;s=this.input.length?this.finishToken(Tt.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},ts.readToken=function(e){return _t(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},ts.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},ts.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(var s=void 0,r=t;(s=Rt(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},ts.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&qt.test(String.fromCharCode(e))))break e;++this.pos}}},ts.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},ts.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(Tt.ellipsis)):(++this.pos,this.finishToken(Tt.dot))},ts.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(Tt.assign,2):this.finishOp(Tt.slash,1)},ts.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,s=42===e?Tt.star:Tt.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++n,s=Tt.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(Tt.assign,n+1):this.finishOp(s,n)},ts.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(Tt.assign,3);return this.finishOp(124===e?Tt.logicalOR:Tt.logicalAND,2)}return 61===t?this.finishOp(Tt.assign,2):this.finishOp(124===e?Tt.bitwiseOR:Tt.bitwiseAND,1)},ts.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(Tt.assign,2):this.finishOp(Tt.bitwiseXOR,1)},ts.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!At.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(Tt.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(Tt.assign,2):this.finishOp(Tt.plusMin,1)},ts.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(Tt.assign,n+1):this.finishOp(Tt.bitShift,n)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp(Tt.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},ts.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(Tt.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Tt.arrow)):this.finishOp(61===e?Tt.eq:Tt.prefix,1)},ts.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(Tt.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(Tt.assign,3);return this.finishOp(Tt.coalesce,2)}}return this.finishOp(Tt.question,1)},ts.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,_t(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(Tt.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Vt(e)+"'")},ts.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Tt.parenL);case 41:return++this.pos,this.finishToken(Tt.parenR);case 59:return++this.pos,this.finishToken(Tt.semi);case 44:return++this.pos,this.finishToken(Tt.comma);case 91:return++this.pos,this.finishToken(Tt.bracketL);case 93:return++this.pos,this.finishToken(Tt.bracketR);case 123:return++this.pos,this.finishToken(Tt.braceL);case 125:return++this.pos,this.finishToken(Tt.braceR);case 58:return++this.pos,this.finishToken(Tt.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Tt.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(Tt.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Vt(e)+"'")},ts.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},ts.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(At.test(s)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===s)t=!0;else if("]"===s&&t)t=!1;else if("/"===s&&!t)break;e="\\"===s}++this.pos}var r=this.input.slice(n,this.pos);++this.pos;var a=this.pos,i=this.readWord1();this.containsEsc&&this.unexpected(a);var o=this.regexpState||(this.regexpState=new Un(this));o.reset(n,r,i),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var l=null;try{l=new RegExp(r,i)}catch(e){}return this.finishToken(Tt.regexp,{pattern:r,flags:i,value:l})},ts.readInt=function(e,t,n){for(var s=this.options.ecmaVersion>=12&&void 0===t,r=n&&48===this.input.charCodeAt(this.pos),a=this.pos,i=0,o=0,l=0,c=null==t?1/0:t;l=97?p-97+10:p>=65?p-65+10:p>=48&&p<=57?p-48:1/0)>=e)break;o=p,i=i*e+u}}return s&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||null!=t&&this.pos-a!==t?null:i},ts.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return null==n&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(n=ns(this.input.slice(t,this.pos)),++this.pos):_t(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Tt.num,n)},ts.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var n=this.pos-t>=2&&48===this.input.charCodeAt(t);n&&this.strict&&this.raise(t,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&110===s){var r=ns(this.input.slice(t,this.pos));return++this.pos,_t(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Tt.num,r)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),46!==s||n||(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),69!==s&&101!==s||n||(43!==(s=this.input.charCodeAt(++this.pos))&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),_t(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a,i=(a=this.input.slice(t,this.pos),n?parseInt(a,8):parseFloat(a.replace(/_/g,"")));return this.finishToken(Tt.num,i)},ts.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},ts.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===e)break;92===s?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):8232===s||8233===s?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(It(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(Tt.string,t)};var ss={};ts.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==ss)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},ts.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ss;this.raise(e,t)},ts.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==Tt.template&&this.type!==Tt.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(Tt.template,e)):36===n?(this.pos+=2,this.finishToken(Tt.dollarBraceL)):(++this.pos,this.finishToken(Tt.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(It(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},ts.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(s,8);return r>255&&(s=s.slice(0,-1),r=parseInt(s,8)),this.pos+=s.length-1,t=this.input.charCodeAt(this.pos),"0"===s&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return It(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},ts.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},ts.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,s=this.options.ecmaVersion>=6;this.pos...",!0,!0)},p=new RegExp(`^(?:${Object.keys(o).join("|")})$`);l.jsxTagStart.updateContext=function(){this.context.push(c.tc_expr),this.context.push(c.tc_oTag),this.exprAllowed=!1},l.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===c.tc_oTag&&e===Tt.slash||t===c.tc_cTag?(this.context.pop(),this.exprAllowed=this.curContext()===c.tc_expr):this.exprAllowed=!0},n={tokTypes:{...o,...l},tokContexts:{...c},keywordsRegExp:p,tokenIsLiteralPropertyName:e,tokenIsKeywordOrIdentifier:t,tokenIsIdentifier:s,tokenIsTSDeclarationStart:r,tokenIsTSTypeOperator:a,tokenIsTemplate:i}}return n}var ps=1024,us=new RegExp("(?=("+/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y"),ds=class{constructor(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}};function hs(e,t){const n=t.key.name,s=e[n];let r="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(r=(t.static?"s":"i")+t.kind),"iget"===s&&"iset"===r||"iset"===s&&"iget"===r||"sget"===s&&"sset"===r||"sset"===s&&"sget"===r?(e[n]="true",!1):!!s||(e[n]=r,!1)}function ms(e,t){const{computed:n,key:s}=e;return!n&&("Identifier"===s.type&&s.name===t||"Literal"===s.type&&s.value===t)}var fs={AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",CannotFindName:({name:e})=>`Cannot find name '${e}'.`,ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:()=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",IncompatibleModifiers:({modifiers:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",MixedLabeledAndUnlabeledElements:"Tuple members must all have names or all not have names.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,PrivateMethodsHasAccessibility:({modifier:e})=>`Private methods cannot have an accessibility modifier ('${e}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",GenericsEndWithComma:"Trailing comma is not allowed at the end of generics.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations."},ys={UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",TrailingDecorator:"Decorators must be attached to a class element.",SpreadElementDecorator:"Decorators can't be used with SpreadElement"};var vs=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;function gs(e){if(!e)throw new Error("Assert fail")}function bs(e){return"accessor"===e}function _s(e){return"in"===e||"out"===e}var xs={SCOPE_TOP:1,SCOPE_FUNCTION:2,SCOPE_ASYNC:4,SCOPE_GENERATOR:8,SCOPE_ARROW:16,SCOPE_SIMPLE_CATCH:32,SCOPE_SUPER:64,SCOPE_DIRECT_SUPER:128,SCOPE_CLASS_STATIC_BLOCK:256,SCOPE_VAR:256,BIND_NONE:0,BIND_VAR:1,BIND_LEXICAL:2,BIND_FUNCTION:3,BIND_SIMPLE_CATCH:4,BIND_OUTSIDE:5,BIND_TS_TYPE:6,BIND_TS_INTERFACE:7,BIND_TS_NAMESPACE:8,BIND_FLAGS_TS_EXPORT_ONLY:1024,BIND_FLAGS_TS_IMPORT:4096,BIND_FLAGS_TS_ENUM:256,BIND_FLAGS_TS_CONST_ENUM:512,BIND_FLAGS_CLASS:128};function Cs(e,t){return xs.SCOPE_FUNCTION|(e?xs.SCOPE_ASYNC:0)|(t?xs.SCOPE_GENERATOR:0)}function ws(e){if("MemberExpression"!==e.type)return!1;const{computed:t,property:n}=e;return(!t||!("TemplateLiteral"!==n.type||n.expressions.length>0))&&ks(e.object)}function ks(e){return"Identifier"===e.type||"MemberExpression"===e.type&&(!e.computed&&ks(e.object))}function Ss(e){return"private"===e||"public"===e||"protected"===e}const Ps=Jt.extend(function(e){const{dts:t=!1}={},n=!!e?.jsx;return function(e){const s=e.acorn||as,r=cs(s),a=s.tokTypes,i=s.keywordTypes,o=s.isIdentifierStart,l=s.lineBreak,c=s.isNewLine,p=s.tokContexts,u=s.isIdentifierChar,{tokTypes:d,tokContexts:h,keywordsRegExp:m,tokenIsLiteralPropertyName:f,tokenIsTemplate:y,tokenIsTSDeclarationStart:v,tokenIsIdentifier:g,tokenIsKeywordOrIdentifier:b,tokenIsTSTypeOperator:_}=r;function x(e,t,n=e.length){for(let s=t;s{this.tsParseModifiers({modified:e,allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:fs.InvalidModifierOnTypeParameterPositions})},this.ecmaVersion=this.options.ecmaVersion}static get acornTypeScript(){return r}get acornTypeScript(){return r}getTokenFromCodeInType(e){return 62===e||60===e?this.finishOp(a.relational,1):super.getTokenFromCode(e)}readToken(e){if(!this.inType){let t=this.curContext();if(t===h.tc_expr)return this.jsx_readToken();if(t===h.tc_oTag||t===h.tc_cTag){if(o(e))return this.jsx_readWord();if(62==e)return++this.pos,this.finishToken(d.jsxTagEnd);if((34===e||39===e)&&t==h.tc_oTag)return this.jsx_readString(e)}if(60===e&&this.exprAllowed&&33!==this.input.charCodeAt(this.pos+1))return++this.pos,this.finishToken(a.relational,"<")}return super.readToken(e)}getTokenFromCode(e){return this.inType?this.getTokenFromCodeInType(e):64===e?(++this.pos,this.finishToken(d.at)):super.getTokenFromCode(e)}isAbstractClass(){return this.ts_isContextual(d.abstract)&&this.lookahead().type===a._class}finishNode(e,t){return""!==e.type&&0!==e.end?e:super.finishNode(e,t)}tryParse(e,t=this.cloneCurLookaheadState()){const n={node:null};try{return{node:e(((e=null)=>{throw n.node=e,n})),error:null,thrown:!1,aborted:!1,failState:null}}catch(e){const s=this.getCurLookaheadState();if(this.setLookaheadState(t),e instanceof SyntaxError)return{node:null,error:e,thrown:!0,aborted:!1,failState:s};if(e===n)return{node:n.node,error:null,thrown:!1,aborted:!0,failState:s};throw e}}setOptionalParametersError(e,t){e.optionalParametersLoc=t?.loc??this.startLoc}reScan_lt_gt(){this.type===a.relational&&(this.pos-=1,this.readToken_lt_gt(this.fullCharCodeAtPos()))}reScan_lt(){const{type:e}=this;return e===a.bitShift?(this.pos-=2,this.finishOp(a.relational,1),a.relational):e}resetEndLocation(e,t=this.lastTokEnd,n=this.lastTokEndLoc){e.end=t,e.loc.end=n,this.options.ranges&&(e.range[1]=t)}startNodeAtNode(e){return super.startNodeAt(e.start,e.loc.start)}nextTokenStart(){return this.nextTokenStartSince(this.pos)}tsHasSomeModifiers(e,t){return t.some((t=>Ss(t)?e.accessibility===t:!!e[t]))}tsIsStartOfStaticBlocks(){return this.isContextual("static")&&123===this.lookaheadCharCode()}tsCheckForInvalidTypeCasts(e){e.forEach((e=>{"TSTypeCastExpression"===e?.type&&this.raise(e.typeAnnotation.start,fs.UnexpectedTypeAnnotation)}))}atPossibleAsyncArrow(e){return"Identifier"===e.type&&"async"===e.name&&this.lastTokEndLoc.column===e.end&&!this.canInsertSemicolon()&&e.end-e.start==5&&e.start===this.potentialArrowAt}tsIsIdentifier(){return g(this.type)}tsTryParseTypeOrTypePredicateAnnotation(){return this.match(a.colon)?this.tsParseTypeOrTypePredicateAnnotation(a.colon):void 0}tsTryParseGenericAsyncArrowFunction(e,t,n){if(!this.tsMatchLeftRelational())return;const s=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;const r=this.tsTryParseAndCatch((()=>{const n=this.startNodeAt(e,t);return n.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(n),n.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(a.arrow),n}));return this.maybeInArrowParameters=s,r?super.parseArrowExpression(r,null,!0,n):void 0}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===a.relational)return this.tsParseTypeArguments()}tsInNoContext(e){const t=this.context;this.context=[t[0]];try{return e()}finally{this.context=t}}tsTryParseTypeAnnotation(){return this.match(a.colon)?this.tsParseTypeAnnotation():void 0}isUnparsedContextual(e,t){const n=e+t.length;if(this.input.slice(e,n)===t){const e=this.input.charCodeAt(n);return!(u(e)||55296==(64512&e))}return!1}isAbstractConstructorSignature(){return this.ts_isContextual(d.abstract)&&this.lookahead().type===a._new}nextTokenStartSince(e){return vs.lastIndex=e,vs.test(this.input)?vs.lastIndex:e}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}compareLookaheadState(e,t){for(const n of Object.keys(e))if(e[n]!==t[n])return!1;return!0}createLookaheadState(){this.value=null,this.context=[this.curContext()]}getCurLookaheadState(){return{endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,pos:this.pos,value:this.value,type:this.type,start:this.start,end:this.end,context:this.context,startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,curLine:this.curLine,lineStart:this.lineStart,curPosition:this.curPosition,containsEsc:this.containsEsc}}cloneCurLookaheadState(){return{pos:this.pos,value:this.value,type:this.type,start:this.start,end:this.end,context:this.context&&this.context.slice(),startLoc:this.startLoc,lastTokEndLoc:this.lastTokEndLoc,endLoc:this.endLoc,lastTokEnd:this.lastTokEnd,lastTokStart:this.lastTokStart,lastTokStartLoc:this.lastTokStartLoc,curLine:this.curLine,lineStart:this.lineStart,curPosition:this.curPosition,containsEsc:this.containsEsc}}setLookaheadState(e){this.pos=e.pos,this.value=e.value,this.endLoc=e.endLoc,this.lastTokEnd=e.lastTokEnd,this.lastTokStart=e.lastTokStart,this.lastTokStartLoc=e.lastTokStartLoc,this.type=e.type,this.start=e.start,this.end=e.end,this.context=e.context,this.startLoc=e.startLoc,this.lastTokEndLoc=e.lastTokEndLoc,this.curLine=e.curLine,this.lineStart=e.lineStart,this.curPosition=e.curPosition,this.containsEsc=e.containsEsc}tsLookAhead(e){const t=this.getCurLookaheadState(),n=e();return this.setLookaheadState(t),n}lookahead(e){const t=this.getCurLookaheadState();if(this.createLookaheadState(),this.isLookahead=!0,void 0!==e)for(let t=0;t-1;)++this.curLine,n=this.lineStart=e;this.isLookahead||this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())}skipLineComment(e){let t,n=this.pos;this.isLookahead||(t=this.options.onComment&&this.curPosition());let s=this.input.charCodeAt(this.pos+=e);for(;this.pos{if(n===a._function)return e.declare=!0,this.parseFunctionStatement(e,!1,!0);if(n===a._class)return e.declare=!0,this.parseClass(e,!0);if(n===d.enum)return this.tsParseEnumDeclaration(e,{declare:!0});if(n===d.global)return this.tsParseAmbientExternalModuleDeclaration(e);if(n===a._const||n===a._var)return this.match(a._const)&&this.isLookaheadContextual("enum")?(this.expect(a._const),this.tsParseEnumDeclaration(e,{const:!0,declare:!0})):(e.declare=!0,this.parseVarStatement(e,t||this.value,!0));if(n===d.interface){const t=this.tsParseInterfaceDeclaration(e,{declare:!0});if(t)return t}return g(n)?this.tsParseDeclaration(e,this.value,!0):void 0}))}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(a.braceR);case"HeritageClauseElement":return this.match(a.braceL);case"TupleElementTypes":return this.match(a.bracketR);case"TypeParametersOrArguments":return this.tsMatchRightRelational()}}tsParseDelimitedListWorker(e,t,n,s){const r=[];let i=-1;for(;!this.tsIsListTerminator(e);){i=-1;const s=t();if(null==s)return;if(r.push(s),!this.eat(a.comma)){if(this.tsIsListTerminator(e))break;return void(n&&this.expect(a.comma))}i=this.lastTokStart}return s&&(s.value=i),r}tsParseDelimitedList(e,t,n){return function(e){if(null==e)throw new Error(`Unexpected ${e} value.`);return e}(this.tsParseDelimitedListWorker(e,t,!0,n))}tsParseBracketedList(e,t,n,s,r){s||(n?this.expect(a.bracketL):this.expect(a.relational));const i=this.tsParseDelimitedList(e,t,r);return n?this.expect(a.bracketR):this.expect(a.relational),i}tsParseTypeParameterName(){return this.parseIdent().name}tsEatThenParseType(e){return this.match(e)?this.tsNextThenParseType():void 0}tsExpectThenParseType(e){return this.tsDoThenParseType((()=>this.expect(e)))}tsNextThenParseType(){return this.tsDoThenParseType((()=>this.next()))}tsDoThenParseType(e){return this.tsInType((()=>(e(),this.tsParseType())))}tsSkipParameterStart(){if(g(this.type)||this.match(a._this))return this.next(),!0;if(this.match(a.braceL))try{return this.parseObj(!0),!0}catch{return!1}if(this.match(a.bracketL)){this.next();try{return this.parseBindingList(a.bracketR,!0,!0),!0}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){if(this.next(),this.match(a.parenR)||this.match(a.ellipsis))return!0;if(this.tsSkipParameterStart()){if(this.match(a.colon)||this.match(a.comma)||this.match(a.question)||this.match(a.eq))return!0;if(this.match(a.parenR)&&(this.next(),this.match(a.arrow)))return!0}return!1}tsIsStartOfFunctionType(){return!!this.tsMatchLeftRelational()||this.match(a.parenL)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsInAllowConditionalTypesContext(e){const t=this.inDisallowConditionalTypesContext;this.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.inDisallowConditionalTypesContext=t}}tsParseBindingListForSignature(){return super.parseBindingList(a.parenR,!0,!0).map((e=>("Identifier"!==e.type&&"RestElement"!==e.type&&"ObjectPattern"!==e.type&&"ArrayPattern"!==e.type&&this.raise(e.start,fs.UnsupportedSignatureParameterKind(e.type)),e)))}tsParseTypePredicateAsserts(){if(this.type!==d.asserts)return!1;const e=this.containsEsc;return this.next(),!(!g(this.type)&&!this.match(a._this))&&(e&&this.raise(this.lastTokStart,"Escape sequence in keyword asserts"),!0)}tsParseThisTypeNode(){const e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType((()=>{e&&this.expect(a.colon),t.typeAnnotation=this.tsParseType()})),this.finishNode(t,"TSTypeAnnotation")}tsParseThisTypePredicate(e){this.next();const t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,"TSTypePredicate")}tsParseThisTypeOrThisTypePredicate(){const e=this.tsParseThisTypeNode();return this.isContextual("is")&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseTypePredicatePrefix(){const e=this.parseIdent();if(this.isContextual("is")&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType((()=>{const t=this.startNode();this.expect(e);const n=this.startNode(),s=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(s&&this.match(a._this)){let e=this.tsParseThisTypeOrThisTypePredicate();return"TSThisType"===e.type?(n.parameterName=e,n.asserts=!0,n.typeAnnotation=null,e=this.finishNode(n,"TSTypePredicate")):(this.resetStartLocationFromNode(e,n),e.asserts=!0),t.typeAnnotation=e,this.finishNode(t,"TSTypeAnnotation")}const r=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!r)return s?(n.parameterName=this.parseIdent(),n.asserts=s,n.typeAnnotation=null,t.typeAnnotation=this.finishNode(n,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,t);const i=this.tsParseTypeAnnotation(!1);return n.parameterName=r,n.typeAnnotation=i,n.asserts=s,t.typeAnnotation=this.finishNode(n,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")}))}tsFillSignature(e,t){const n=e===a.arrow,s="typeAnnotation";t.typeParameters=this.tsTryParseTypeParameters(),this.expect(a.parenL),t.parameters=this.tsParseBindingListForSignature(),(n||this.match(e))&&(t[s]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsTryNextParseConstantContext(){if(this.lookahead().type!==a._const)return null;this.next();const e=this.tsParseTypeReference();return(e.typeParameters||e.typeArguments)&&this.raise(e.typeName.start,fs.CannotFindName({name:"const"})),e}tsParseFunctionOrConstructorType(e,t){const n=this.startNode();return"TSConstructorType"===e&&(n.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext((()=>this.tsFillSignature(a.arrow,n))),this.finishNode(n,e)}tsParseUnionOrIntersectionType(e,t,n){const s=this.startNode(),r=this.eat(n),a=[];do{a.push(t())}while(this.eat(n));return 1!==a.length||r?(s.types=a,this.finishNode(s,e)):a[0]}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(e.start,fs.UnexpectedReadonly)}}tsParseTypeOperator(){const e=this.startNode(),t=this.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),"readonly"===t&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsParseConstraintForInferType(){if(this.eat(a._extends)){const e=this.tsInDisallowConditionalTypesContext((()=>this.tsParseType()));if(this.inDisallowConditionalTypesContext||!this.match(a.question))return e}}tsParseInferType(){const e=this.startNode();this.expectContextual("infer");const t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse((()=>this.tsParseConstraintForInferType())),e.typeParameter=this.finishNode(t,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseLiteralTypeNode(){const e=this.startNode();return e.literal=(()=>{switch(this.type){case a.num:case a.string:case a._true:case a._false:return this.parseExprAtom();default:this.unexpected()}})(),this.finishNode(e,"TSLiteralType")}tsParseImportType(){const e=this.startNode();return this.expect(a._import),this.expect(a.parenL),this.match(a.string)||this.raise(this.start,fs.UnsupportedImportTypeArgument),e.argument=this.parseExprAtom(),this.expect(a.parenR),this.eat(a.dot)&&(e.qualifier=this.tsParseEntityName()),this.tsMatchLeftRelational()&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseTypeQuery(){const e=this.startNode();return this.expect(a._typeof),this.match(a._import)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseMappedTypeParameter(){const e=this.startNode();return e.name=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(a._in),this.finishNode(e,"TSTypeParameter")}tsParseMappedType(){const e=this.startNode();return this.expect(a.braceL),this.match(a.plusMin)?(e.readonly=this.value,this.next(),this.expectContextual("readonly")):this.eatContextual("readonly")&&(e.readonly=!0),this.expect(a.bracketL),e.typeParameter=this.tsParseMappedTypeParameter(),e.nameType=this.eatContextual("as")?this.tsParseType():null,this.expect(a.bracketR),this.match(a.plusMin)?(e.optional=this.value,this.next(),this.expect(a.question)):this.eat(a.question)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(a.braceR),this.finishNode(e,"TSMappedType")}tsParseTypeLiteral(){const e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseTupleElementType(){const e=this.startLoc,t=this.start,n=this.eat(a.ellipsis);let s=this.tsParseType();const r=this.eat(a.question);if(this.eat(a.colon)){const e=this.startNodeAtNode(s);e.optional=r,"TSTypeReference"!==s.type||s.typeArguments||"Identifier"!==s.typeName.type?(this.raise(s.start,fs.InvalidTupleMemberLabel),e.label=s):e.label=s.typeName,e.elementType=this.tsParseType(),s=this.finishNode(e,"TSNamedTupleMember")}else if(r){const e=this.startNodeAtNode(s);e.typeAnnotation=s,s=this.finishNode(e,"TSOptionalType")}if(n){const n=this.startNodeAt(t,e);n.typeAnnotation=s,s=this.finishNode(n,"TSRestType")}return s}tsParseTupleType(){const e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let t=!1,n=null;return e.elementTypes.forEach((e=>{const{type:s}=e;!t||"TSRestType"===s||"TSOptionalType"===s||"TSNamedTupleMember"===s&&e.optional||this.raise(e.start,fs.OptionalTypeBeforeRequired),t||="TSNamedTupleMember"===s&&e.optional||"TSOptionalType"===s;let r=s;"TSRestType"===s&&(r=(e=e.typeAnnotation).type);const a="TSNamedTupleMember"===r;n??=a,n!==a&&this.raise(e.start,fs.MixedLabeledAndUnlabeledElements)})),this.finishNode(e,"TSTupleType")}tsParseTemplateLiteralType(){const e=this.startNode();return e.literal=this.parseTemplate({isTagged:!1}),this.finishNode(e,"TSLiteralType")}tsParseTypeReference(){const e=this.startNode();return e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.tsMatchLeftRelational()&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsMatchLeftRelational(){return this.match(a.relational)&&"<"===this.value}tsMatchRightRelational(){return this.match(a.relational)&&">"===this.value}tsParseParenthesizedType(){const e=this.startNode();return this.expect(a.parenL),e.typeAnnotation=this.tsParseType(),this.expect(a.parenR),this.finishNode(e,"TSParenthesizedType")}tsParseNonArrayType(){switch(this.type){case a.string:case a.num:case a._true:case a._false:return this.tsParseLiteralTypeNode();case a.plusMin:if("-"===this.value){const e=this.startNode();return this.lookahead().type!==a.num&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case a._this:return this.tsParseThisTypeOrThisTypePredicate();case a._typeof:return this.tsParseTypeQuery();case a._import:return this.tsParseImportType();case a.braceL:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case a.bracketL:return this.tsParseTupleType();case a.parenL:return this.tsParseParenthesizedType();case a.backQuote:case a.dollarBraceL:return this.tsParseTemplateLiteralType();default:{const{type:e}=this;if(g(e)||e===a._void||e===a._null){const t=e===a._void?"TSVoidKeyword":e===a._null?"TSNullKeyword":function(e){switch(e){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}(this.value);if(void 0!==t&&46!==this.lookaheadCharCode()){const e=this.startNode();return this.next(),this.finishNode(e,t)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(a.bracketL);)if(this.match(a.bracketR)){const t=this.startNodeAtNode(e);t.elementType=e,this.expect(a.bracketR),e=this.finishNode(t,"TSArrayType")}else{const t=this.startNodeAtNode(e);t.objectType=e,t.indexType=this.tsParseType(),this.expect(a.bracketR),e=this.finishNode(t,"TSIndexedAccessType")}return e}tsParseTypeOperatorOrHigher(){return _(this.type)&&!this.containsEsc?this.tsParseTypeOperator():this.isContextual("infer")?this.tsParseInferType():this.tsInAllowConditionalTypesContext((()=>this.tsParseArrayTypeOrHigher()))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),a.bitwiseAND)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),a.bitwiseOR)}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(a._new)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseType(){gs(this.inType);const e=this.tsParseNonConditionalType();if(this.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(a._extends))return e;const t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext((()=>this.tsParseNonConditionalType())),this.expect(a.question),t.trueType=this.tsInAllowConditionalTypesContext((()=>this.tsParseType())),this.expect(a.colon),t.falseType=this.tsInAllowConditionalTypesContext((()=>this.tsParseType())),this.finishNode(t,"TSConditionalType")}tsIsUnambiguouslyIndexSignature(){return this.next(),!!g(this.type)&&(this.next(),this.match(a.colon))}tsInType(e){const t=this.inType;this.inType=!0;try{return e()}finally{this.inType=t}}tsTryParseIndexSignature(e){if(!this.match(a.bracketL)||!this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))return;this.expect(a.bracketL);const t=this.parseIdent();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(a.bracketR),e.parameters=[t];const n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParseNoneModifiers(e){this.tsParseModifiers({modified:e,allowedModifiers:[],disallowedModifiers:["in","out"],errorTemplate:fs.InvalidModifierOnTypeParameterPositions})}tsParseTypeParameter(e=this.tsParseNoneModifiers.bind(this)){const t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(a._extends),t.default=this.tsEatThenParseType(a.eq),this.finishNode(t,"TSTypeParameter")}tsParseTypeParameters(e){const t=this.startNode();this.tsMatchLeftRelational()||this.matchJsx("jsxTagStart")?this.next():this.unexpected();const n={value:-1};return t.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,n),0===t.params.length&&this.raise(this.start,fs.EmptyTypeParameters),-1!==n.value&&this.addExtra(t,"trailingComma",n.value),this.finishNode(t,"TSTypeParameterDeclaration")}tsTryParseTypeParameters(e){if(this.tsMatchLeftRelational())return this.tsParseTypeParameters(e)}tsTryParse(e){const t=this.getCurLookaheadState(),n=e();return void 0!==n&&!1!==n?n:void this.setLookaheadState(t)}tsTokenCanFollowModifier(){return(this.match(a.bracketL)||this.match(a.braceL)||this.match(a.star)||this.match(a.ellipsis)||this.match(a.privateId)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(!0),this.tsTokenCanFollowModifier()}tsParseModifier(e,t){const n=this.value;if(-1!==e.indexOf(n)&&!this.containsEsc){if(t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return n}}tsParseModifiersByMap({modified:e,map:t}){for(const n of Object.keys(t))e[n]=t[n]}tsParseModifiers({modified:e,allowedModifiers:t,disallowedModifiers:n,stopOnStartOfClassStaticBlock:s,errorTemplate:r=fs.InvalidModifierOnTypeMember}){const a={},i=(t,n,s,r)=>{n===s&&e[r]&&this.raise(t.column,fs.InvalidModifiersOrder({orderedModifiers:[s,r]}))},o=(t,n,s,r)=>{(e[s]&&n===r||e[r]&&n===s)&&this.raise(t.column,fs.IncompatibleModifiers({modifiers:[s,r]}))};for(;;){const l=this.startLoc,c=this.tsParseModifier(t.concat(n??[]),s);if(!c)break;Ss(c)?e.accessibility?this.raise(this.start,fs.DuplicateAccessibilityModifier()):(i(l,c,c,"override"),i(l,c,c,"static"),i(l,c,c,"readonly"),i(l,c,c,"accessor"),a.accessibility=c,e.accessibility=c):_s(c)?e[c]?this.raise(this.start,fs.DuplicateModifier({modifier:c})):(i(l,c,"in","out"),a[c]=c,e[c]=!0):bs(c)?e[c]?this.raise(this.start,fs.DuplicateModifier({modifier:c})):(o(l,c,"accessor","readonly"),o(l,c,"accessor","static"),o(l,c,"accessor","override"),a[c]=c,e[c]=!0):"const"===c?e[c]?this.raise(this.start,fs.DuplicateModifier({modifier:c})):(a[c]=c,e[c]=!0):Object.hasOwnProperty.call(e,c)?this.raise(this.start,fs.DuplicateModifier({modifier:c})):(i(l,c,"static","readonly"),i(l,c,"static","override"),i(l,c,"override","readonly"),i(l,c,"abstract","override"),o(l,c,"declare","override"),o(l,c,"static","abstract"),a[c]=c,e[c]=!0),n?.includes(c)&&this.raise(this.start,r)}return a}tsParseInOutModifiers(e){this.tsParseModifiers({modified:e,allowedModifiers:["in","out"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:fs.InvalidModifierOnTypeParameter})}parseMaybeUnary(e,t,n,s){return this.tsMatchLeftRelational()?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t,n,s)}tsParseTypeAssertion(){const e=this.tryParse((()=>{const e=this.startNode(),t=this.tsTryNextParseConstantContext();return e.typeAnnotation=t||this.tsNextThenParseType(),this.expect(a.relational),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}));return e.error?this.tsParseTypeParameters(this.tsParseConstModifier):e.node}tsParseTypeArguments(){const e=this.startNode();return e.params=this.tsInType((()=>this.tsInNoContext((()=>(this.expect(a.relational),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))))),0===e.params.length&&this.raise(this.start,fs.EmptyTypeArguments),this.exprAllowed=!1,this.expect(a.relational),this.finishNode(e,"TSTypeParameterInstantiation")}tsParseHeritageClause(e){const t=this.start,n=this.tsParseDelimitedList("HeritageClauseElement",(()=>{const e=this.startNode();return e.expression=this.tsParseEntityName(),this.tsMatchLeftRelational()&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSExpressionWithTypeArguments")}));return n.length||this.raise(t,fs.EmptyHeritageClauseType({token:e})),n}tsParseTypeMemberSemicolon(){this.eat(a.comma)||this.isLineTerminator()||this.expect(a.semi)}tsTryParseAndCatch(e){const t=this.tryParse((t=>e()||t()));if(!t.aborted&&t.node)return t.error&&this.setLookaheadState(t.failState),t.node}tsParseSignatureMember(e,t){return this.tsFillSignature(a.colon,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsParsePropertyOrMethodSignature(e,t){this.eat(a.question)&&(e.optional=!0);const n=e;if(this.match(a.parenL)||this.tsMatchLeftRelational()){t&&this.raise(e.start,fs.ReadonlyForMethodSignature);const s=n;s.kind&&this.tsMatchLeftRelational()&&this.raise(this.start,fs.AccesorCannotHaveTypeParameters),this.tsFillSignature(a.colon,s),this.tsParseTypeMemberSemicolon();const r="parameters",i="typeAnnotation";if("get"===s.kind)s[r].length>0&&(this.raise(this.start,"A 'get' accesor must not have any formal parameters."),this.isThisParam(s[r][0])&&this.raise(this.start,fs.AccesorCannotDeclareThisParameter));else if("set"===s.kind){if(1!==s[r].length)this.raise(this.start,"A 'get' accesor must not have any formal parameters.");else{const e=s[r][0];this.isThisParam(e)&&this.raise(this.start,fs.AccesorCannotDeclareThisParameter),"Identifier"===e.type&&e.optional&&this.raise(this.start,fs.SetAccesorCannotHaveOptionalParameter),"RestElement"===e.type&&this.raise(this.start,fs.SetAccesorCannotHaveRestParameter)}s[i]&&this.raise(s[i].start,fs.SetAccesorCannotHaveReturnType)}else s.kind="method";return this.finishNode(s,"TSMethodSignature")}{const e=n;t&&(e.readonly=!0);const s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSPropertySignature")}}tsParseTypeMember(){const e=this.startNode();if(this.match(a.parenL)||this.tsMatchLeftRelational())return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(a._new)){const t=this.startNode();return this.next(),this.match(a.parenL)||this.tsMatchLeftRelational()?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(t,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({modified:e,allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]});const t=this.tsTryParseIndexSignature(e);return t||(this.parsePropertyName(e),e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||!this.tsTokenCanFollowModifier()||(e.kind=e.key.name,this.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseList(e,t){const n=[];for(;!this.tsIsListTerminator(e);)n.push(t());return n}tsParseObjectTypeMembers(){this.expect(a.braceL);const e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(a.braceR),e}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual("interface"),t.declare&&(e.declare=!0),g(this.type)?(e.id=this.parseIdent(),this.checkLValSimple(e.id,xs.BIND_TS_INTERFACE)):(e.id=null,this.raise(this.start,fs.MissingInterfaceName)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.eat(a._extends)&&(e.extends=this.tsParseHeritageClause("extends"));const n=this.startNode();return n.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(n,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseAbstractDeclaration(e){if(this.match(a._class))return e.abstract=!0,this.parseClass(e,!0);if(this.ts_isContextual(d.interface)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.tsParseInterfaceDeclaration(e)}else this.unexpected(e.start)}tsIsDeclarationStart(){return v(this.type)}tsParseExpressionStatement(e,t){switch(t.name){case"declare":{const t=this.tsTryParseDeclare(e);if(t)return t.declare=!0,t;break}case"global":if(this.match(a.braceL)){this.enterScope(ps);const n=e;return n.global=!0,n.id=t,n.body=this.tsParseModuleBlock(),super.exitScope(),this.finishNode(n,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,t.name,!1)}}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsIsExportDefaultSpecifier(){const{type:e}=this,t=this.isAsyncFunction(),n=this.isLet();if(g(e)){if(t&&!this.containsEsc||n)return!1;if((e===d.type||e===d.interface)&&!this.containsEsc){const e=this.lookahead();if(g(e.type)&&!this.isContextualWithState("from",e)||e.type===a.braceL)return!1}}else if(!this.match(a._default))return!1;const s=this.nextTokenStart(),r=this.isUnparsedContextual(s,"from");if(44===this.input.charCodeAt(s)||g(this.type)&&r)return!0;if(this.match(a._default)&&r){const e=this.input.charCodeAt(this.nextTokenStartSince(s+4));return 34===e||39===e}return!1}tsInAmbientContext(e){const t=this.isAmbientContext;this.isAmbientContext=!0;try{return e()}finally{this.isAmbientContext=t}}tsCheckLineTerminator(e){return e?!this.hasFollowingLineBreak()&&(this.next(),!0):!this.isLineTerminator()}tsParseModuleOrNamespaceDeclaration(e,t=!1){if(e.id=this.parseIdent(),t||this.checkLValSimple(e.id,xs.BIND_TS_NAMESPACE),this.eat(a.dot)){const t=this.startNode();this.tsParseModuleOrNamespaceDeclaration(t,!0),e.body=t}else this.enterScope(ps),e.body=this.tsParseModuleBlock(),super.exitScope();return this.finishNode(e,"TSModuleDeclaration")}checkLValSimple(e,t=xs.BIND_NONE,n){return"TSNonNullExpression"!==e.type&&"TSAsExpression"!==e.type||(e=e.expression),super.checkLValSimple(e,t,n)}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdent(),this.checkLValSimple(e.id,xs.BIND_TS_TYPE),e.typeAnnotation=this.tsInType((()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)),this.expect(a.eq),this.ts_isContextual(d.interface)&&this.lookahead().type!==a.dot){const e=this.startNode();return this.next(),this.finishNode(e,"TSIntrinsicKeyword")}return this.tsParseType()})),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsParseDeclaration(e,t,n){switch(t){case"abstract":if(this.tsCheckLineTerminator(n)&&(this.match(a._class)||g(this.type)))return this.tsParseAbstractDeclaration(e);break;case"module":if(this.tsCheckLineTerminator(n)){if(this.match(a.string))return this.tsParseAmbientExternalModuleDeclaration(e);if(g(this.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(n)&&g(this.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(n)&&g(this.type))return this.tsParseTypeAliasDeclaration(e)}}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.value,!0)}tsParseImportEqualsDeclaration(e,t){e.isExport=t||!1,e.id=this.parseIdent(),this.checkLValSimple(e.id,xs.BIND_LEXICAL),super.expect(a.eq);const n=this.tsParseModuleReference();return"type"===e.importKind&&"TSExternalModuleReference"!==n.type&&this.raise(n.start,fs.ImportAliasHasImportType),e.moduleReference=n,super.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}isExportDefaultSpecifier(){if(this.tsIsDeclarationStart())return!1;const{type:e}=this;if(g(e)){if(this.isContextual("async")||this.isContextual("let"))return!1;if((e===d.type||e===d.interface)&&!this.containsEsc){const e=this.lookahead();if(g(e.type)&&!this.isContextualWithState("from",e)||e.type===a.braceL)return!1}}else if(!this.match(a._default))return!1;const t=this.nextTokenStart(),n=this.isUnparsedContextual(t,"from");if(44===this.input.charCodeAt(t)||g(this.type)&&n)return!0;if(this.match(a._default)&&n){const e=this.input.charCodeAt(this.nextTokenStartSince(t+4));return 34===e||39===e}return!1}parseTemplate({isTagged:e=!1}={}){let t=this.startNode();this.next(),t.expressions=[];let n=this.parseTemplateElement({isTagged:e});for(t.quasis=[n];!n.tail;)this.type===a.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(a.dollarBraceL),t.expressions.push(this.inType?this.tsParseType():this.parseExpression()),this.expect(a.braceR),t.quasis.push(n=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(t,"TemplateLiteral")}parseFunction(e,t,n,s,r){this.initFunction(e),(this.ecmaVersion>=9||this.ecmaVersion>=6&&!s)&&(this.type===a.star&&2&t&&this.unexpected(),e.generator=this.eat(a.star)),this.ecmaVersion>=8&&(e.async=!!s),1&t&&(e.id=4&t&&this.type!==a.name?null:this.parseIdent());let i=this.yieldPos,o=this.awaitPos,l=this.awaitIdentPos;const c=this.maybeInArrowParameters;this.maybeInArrowParameters=!1,this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Cs(e.async,e.generator)),1&t||(e.id=this.type===a.name?this.parseIdent():null),this.parseFunctionParams(e);const p=1&t;return this.parseFunctionBody(e,n,!1,r,{isFunctionDeclaration:p}),this.yieldPos=i,this.awaitPos=o,this.awaitIdentPos=l,1&t&&e.id&&!(2&t)&&(e.body?this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?xs.BIND_VAR:xs.BIND_LEXICAL:xs.BIND_FUNCTION):this.checkLValSimple(e.id,xs.BIND_NONE)),this.maybeInArrowParameters=c,this.finishNode(e,p?"FunctionDeclaration":"FunctionExpression")}parseFunctionBody(e,t=!1,n=!1,s=!1,r){this.match(a.colon)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(a.colon));const i=r?.isFunctionDeclaration?"TSDeclareFunction":r?.isClassMethod?"TSDeclareMethod":void 0;return i&&!this.match(a.braceL)&&this.isLineTerminator()?this.finishNode(e,i):"TSDeclareFunction"===i&&this.isAmbientContext&&(this.raise(e.start,fs.DeclareFunctionHasImplementation),e.declare)?(super.parseFunctionBody(e,t,n,!1),this.finishNode(e,i)):(super.parseFunctionBody(e,t,n,s),e)}parseNew(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");let e=this.startNode(),t=this.parseIdent(!0);if(this.ecmaVersion>=6&&this.eat(a.dot)){e.meta=t;let n=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}let n=this.start,s=this.startLoc,r=this.type===a._import;e.callee=this.parseSubscripts(this.parseExprAtom(),n,s,!0,!1),r&&"ImportExpression"===e.callee.type&&this.raise(n,"Cannot use new with import()");const{callee:i}=e;return"TSInstantiationExpression"!==i.type||i.extra?.parenthesized||(e.typeArguments=i.typeArguments,e.callee=i.expression),this.eat(a.parenL)?e.arguments=this.parseExprList(a.parenR,this.ecmaVersion>=8,!1):e.arguments=[],this.finishNode(e,"NewExpression")}parseExprOp(e,t,n,s,r){if(a._in.binop>s&&!this.hasPrecedingLineBreak()){let a;if(this.isContextual("as")&&(a="TSAsExpression"),this.isContextual("satisfies")&&(a="TSSatisfiesExpression"),a){const i=this.startNodeAt(t,n);i.expression=e;const o=this.tsTryNextParseConstantContext();return i.typeAnnotation=o||this.tsNextThenParseType(),this.finishNode(i,a),this.reScan_lt_gt(),this.parseExprOp(i,t,n,s,r)}}return super.parseExprOp(e,t,n,s,r)}parseImportSpecifiers(){let e=[],t=!0;if(r.tokenIsIdentifier(this.type)&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(a.comma)))return e;if(this.type===a.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(a.braceL);!this.eat(a.braceR);){if(t)t=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;e.push(this.parseImportSpecifier())}return e}parseImport(e){let t=this.lookahead();if(e.importKind="value",this.importOrExportOuterKind="value",g(t.type)||this.match(a.star)||this.match(a.braceL)){let n=this.lookahead(2);if(n.type!==a.comma&&!this.isContextualWithState("from",n)&&n.type!==a.eq&&this.ts_eatContextualWithState("type",1,t)&&(this.importOrExportOuterKind="type",e.importKind="type",t=this.lookahead(),n=this.lookahead(2)),g(t.type)&&n.type===a.eq){this.next();const t=this.tsParseImportEqualsDeclaration(e);return this.importOrExportOuterKind="value",t}}return this.next(),this.type===a.string?(e.specifiers=[],e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===a.string?this.parseExprAtom():this.unexpected()),this.parseMaybeImportAttributes(e),this.semicolon(),this.finishNode(e,"ImportDeclaration"),this.importOrExportOuterKind="value","type"===e.importKind&&e.specifiers.length>1&&"ImportDefaultSpecifier"===e.specifiers[0].type&&this.raise(e.start,fs.TypeImportCannotSpecifyDefaultAndNamed),e}parseExportDefaultDeclaration(){if(this.isAbstractClass()){const e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0)}if(this.match(d.interface)){const e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultDeclaration()}parseExportAllDeclaration(e,t){return this.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.parseMaybeImportAttributes(e),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")}parseDynamicImport(e){if(this.next(),e.source=this.parseMaybeAssign(),this.eat(a.comma)){const t=this.parseExpression();e.arguments=[t]}if(!this.eat(a.parenR)){const e=this.start;this.eat(a.comma)&&this.eat(a.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(e,"ImportExpression")}parseExport(e,t){let n=this.lookahead();if(this.ts_eatWithState(a._import,2,n)){this.ts_isContextual(d.type)&&61!==this.lookaheadCharCode()?(e.importKind="type",this.importOrExportOuterKind="type",this.next()):(e.importKind="value",this.importOrExportOuterKind="value");const t=this.tsParseImportEqualsDeclaration(e,!0);return this.importOrExportOuterKind=void 0,t}if(this.ts_eatWithState(a.eq,2,n)){const t=e;return t.expression=this.parseExpression(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(t,"TSExportAssignment")}if(this.ts_eatContextualWithState("as",2,n)){const t=e;return this.expectContextual("namespace"),t.id=this.parseIdent(),this.semicolon(),this.importOrExportOuterKind=void 0,this.finishNode(t,"TSNamespaceExportDeclaration")}if(this.ts_isContextualWithState(n,d.type)&&this.lookahead(2).type===a.braceL?(this.next(),this.importOrExportOuterKind="type",e.exportKind="type"):(this.importOrExportOuterKind="value",e.exportKind="value"),this.next(),this.eat(a.star))return this.parseExportAllDeclaration(e,t);if(this.eat(a._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.parseMaybeImportAttributes(e);else{for(let t of e.specifiers)this.checkUnreserved(t.local),this.checkLocalExport(t.local),"Literal"===t.local.type&&this.raise(t.local.start,"A string literal cannot be used as an exported binding without `from`.");e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")}checkExport(e,t,n){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),e[t]=!0)}parseMaybeDefault(e,t,n){const s=super.parseMaybeDefault(e,t,n);return"AssignmentPattern"===s.type&&s.typeAnnotation&&s.right.start=8&&!r&&"async"===i.name&&!this.canInsertSemicolon()&&this.eat(a._function))return this.overrideContext(p.f_expr),this.parseFunction(this.startNodeAt(n,s),0,!1,!0,t);if(e&&!this.canInsertSemicolon()){if(this.eat(a.arrow))return this.parseArrowExpression(this.startNodeAt(n,s),[i],!1,t);if(this.ecmaVersion>=8&&"async"===i.name&&this.type===a.name&&!r&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return i=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(a.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,s),[i],!0,t)}return i}return super.parseExprAtom(e,t,n)}parseExprAtomDefault(){if(g(this.type)){const e=this.potentialArrowAt===this.start,t=this.containsEsc,n=this.parseIdent();if(!t&&"async"===n.name&&!this.canInsertSemicolon()){const{type:e}=this;if(e===a._function)return this.next(),this.parseFunction(this.startNodeAtNode(n),void 0,!0,!0);if(g(e)){if(61===this.lookaheadCharCode()){const e=this.parseIdent(!1);return!this.canInsertSemicolon()&&this.eat(a.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAtNode(n),[e],!0)}return n}}return e&&this.match(a.arrow)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}this.unexpected()}parseIdentNode(){let e=this.startNode();return b(this.type)&&("class"!==this.type.keyword&&"function"!==this.type.keyword||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart))?(e.name=this.value,e):super.parseIdentNode()}parseVarStatement(e,t,n=!1){const{isAmbientContext:s}=this;this.next(),super.parseVar(e,!1,t,n||s),this.semicolon();const r=this.finishNode(e,"VariableDeclaration");if(!s)return r;for(const{id:e,init:n}of r.declarations)n&&("const"!==t||e.typeAnnotation?this.raise(n.start,fs.InitializerNotAllowedInAmbientContext):"StringLiteral"!==n.type&&"BooleanLiteral"!==n.type&&"NumericLiteral"!==n.type&&"BigIntLiteral"!==n.type&&("TemplateLiteral"!==n.type||n.expressions.length>0)&&!ws(n)&&this.raise(n.start,fs.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference));return r}parseStatement(e,t,n){if(this.match(d.at)&&this.parseDecorators(!0),this.match(a._const)&&this.isLookaheadContextual("enum")){const e=this.startNode();return this.expect(a._const),this.tsParseEnumDeclaration(e,{const:!0})}if(this.ts_isContextual(d.enum))return this.tsParseEnumDeclaration(this.startNode());if(this.ts_isContextual(d.interface)){const e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseStatement(e,t,n)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}parsePostMemberNameModifiers(e){this.eat(a.question)&&(e.optional=!0),e.readonly&&this.match(a.parenL)&&this.raise(e.start,fs.ClassMethodHasReadonly),e.declare&&this.match(a.parenL)&&this.raise(e.start,fs.ClassMethodHasDeclare)}parseExpressionStatement(e,t){return("Identifier"===t.type?this.tsParseExpressionStatement(e,t):void 0)||super.parseExpressionStatement(e,t)}shouldParseExportStatement(){return!!this.tsIsDeclarationStart()||(!!this.match(d.at)||super.shouldParseExportStatement())}parseConditional(e,t,n,s,r){if(this.eat(a.question)){let r=this.startNodeAt(t,n);return r.test=e,r.consequent=this.parseMaybeAssign(),this.expect(a.colon),r.alternate=this.parseMaybeAssign(s),this.finishNode(r,"ConditionalExpression")}return e}parseMaybeConditional(e,t){let n=this.start,s=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(!this.maybeInArrowParameters||!this.match(a.question))return this.parseConditional(r,n,s,e,t);const i=this.tryParse((()=>this.parseConditional(r,n,s,e,t)));return i.node?(i.error&&this.setLookaheadState(i.failState),i.node):(i.error&&this.setOptionalParametersError(t,i.error),r)}parseParenItem(e){const t=this.start,n=this.startLoc;if(e=super.parseParenItem(e),this.eat(a.question)&&(e.optional=!0,this.resetEndLocation(e)),this.match(a.colon)){const s=this.startNodeAt(t,n);return s.expression=e,s.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(s,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.isAmbientContext&&this.ts_isContextual(d.declare))return this.tsInAmbientContext((()=>this.parseExportDeclaration(e)));const t=this.start,n=this.startLoc,s=this.eatContextual("declare");!s||!this.ts_isContextual(d.declare)&&this.shouldParseExportStatement()||this.raise(this.start,fs.ExpectedAmbientAfterExportDeclare);const r=g(this.type)&&this.tsTryParseExportDeclaration()||this.parseStatement(null);return r?(("TSInterfaceDeclaration"===r.type||"TSTypeAliasDeclaration"===r.type||s)&&(e.exportKind="type"),s&&(this.resetStartLocation(r,t,n),r.declare=!0),r):null}parseClassId(e,t){if(!t&&this.isContextual("implements"))return;super.parseClassId(e,t);const n=this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));n&&(e.typeParameters=n)}parseClassPropertyAnnotation(e){e.optional||("!"===this.value&&this.eat(a.prefix)?e.definite=!0:this.eat(a.question)&&(e.optional=!0));const t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassField(e){if("PrivateIdentifier"===e.key.type)e.abstract&&this.raise(e.start,fs.PrivateElementHasAbstract),e.accessibility&&this.raise(e.start,fs.PrivateElementHasAccessibility({modifier:e.accessibility})),this.parseClassPropertyAnnotation(e);else if(this.parseClassPropertyAnnotation(e),this.isAmbientContext&&(!e.readonly||e.typeAnnotation)&&this.match(a.eq)&&this.raise(this.start,fs.DeclareClassFieldHasInitializer),e.abstract&&this.match(a.eq)){const{key:t}=e;this.raise(this.start,fs.AbstractPropertyHasInitializer({propertyName:"Identifier"!==t.type||e.computed?`[${this.input.slice(t.start,t.end)}]`:t.name}))}return super.parseClassField(e)}parseClassMethod(e,t,n,s){const r="constructor"===e.kind,a="PrivateIdentifier"===e.key.type,i=this.tsTryParseTypeParameters(this.tsParseConstModifier);a?(i&&(e.typeParameters=i),e.accessibility&&this.raise(e.start,fs.PrivateMethodsHasAccessibility({modifier:e.accessibility}))):i&&r&&this.raise(i.start,fs.ConstructorHasTypeParameters);const{declare:o=!1,kind:l}=e;!o||"get"!==l&&"set"!==l||this.raise(e.start,fs.DeclareAccessor({kind:l})),i&&(e.typeParameters=i);const c=e.key;"constructor"===e.kind?(t&&this.raise(c.start,"Constructor can't be a generator"),n&&this.raise(c.start,"Constructor can't be an async method")):e.static&&ms(e,"prototype")&&this.raise(c.start,"Classes may not have a static property named prototype");const p=e.value=this.parseMethod(t,n,s,!0,e);return"get"===e.kind&&0!==p.params.length&&this.raiseRecoverable(p.start,"getter should have no params"),"set"===e.kind&&1!==p.params.length&&this.raiseRecoverable(p.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===p.params[0].type&&this.raiseRecoverable(p.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")}isClassMethod(){return this.match(a.relational)}parseClassElement(e){if(this.eat(a.semi))return null;let t=this.startNode(),n="",s=!1,r=!1,i="method",o=!1;const l=["declare","private","public","protected","accessor","override","abstract","readonly","static"],c=this.tsParseModifiers({modified:t,allowedModifiers:l,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:fs.InvalidModifierOnTypeParameterPositions});o=Boolean(c.static);const p=()=>{if(!this.tsIsStartOfStaticBlocks()){const l=this.tsTryParseIndexSignature(t);if(l)return t.abstract&&this.raise(t.start,fs.IndexSignatureHasAbstract),t.accessibility&&this.raise(t.start,fs.IndexSignatureHasAccessibility({modifier:t.accessibility})),t.declare&&this.raise(t.start,fs.IndexSignatureHasDeclare),t.override&&this.raise(t.start,fs.IndexSignatureHasOverride),l;if(!this.inAbstractClass&&t.abstract&&this.raise(t.start,fs.NonAbstractClassHasAbstractMethod),t.override&&(e||this.raise(t.start,fs.OverrideNotInSubClass)),t.static=o,o&&(this.isClassElementNameStart()||this.type===a.star||(n="static")),!n&&this.ecmaVersion>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==a.star||this.canInsertSemicolon()?n="async":r=!0),!n&&(this.ecmaVersion>=9||!r)&&this.eat(a.star)&&(s=!0),!n&&!r&&!s){const e=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?i=e:n=e)}if(n?(t.computed=!1,t.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),t.key.name=n,this.finishNode(t.key,"Identifier")):this.parseClassElementName(t),this.parsePostMemberNameModifiers(t),this.isClassMethod()||this.ecmaVersion<13||this.type===a.parenL||"method"!==i||s||r){const n=!t.static&&ms(t,"constructor"),a=n&&e;n&&"method"!==i&&this.raise(t.key.start,"Constructor can't have get/set modifier"),t.kind=n?"constructor":i,this.parseClassMethod(t,s,r,a)}else this.parseClassField(t);return t}if(this.next(),this.next(),this.tsHasSomeModifiers(t,l)&&this.raise(this.start,fs.StaticBlockCannotHaveModifier),this.ecmaVersion>=13)return super.parseClassStaticBlock(t),t};return t.declare?this.tsInAmbientContext(p):p(),t}isClassElementNameStart(){return!!this.tsIsIdentifier()||super.isClassElementNameStart()}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.tsMatchLeftRelational()||this.match(a.bitShift))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual("implements")&&(e.implements=this.tsParseHeritageClause("implements"))}parseFunctionParams(e){const t=this.tsTryParseTypeParameters(this.tsParseConstModifier);t&&(e.typeParameters=t),super.parseFunctionParams(e)}parseVarId(e,t){super.parseVarId(e,t),"Identifier"===e.id.type&&!this.hasPrecedingLineBreak()&&"!"===this.value&&this.eat(a.prefix)&&(e.definite=!0);const n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseArrowExpression(e,t,n,s){this.match(a.colon)&&(e.returnType=this.tsParseTypeAnnotation());let r=this.yieldPos,i=this.awaitPos,o=this.awaitIdentPos;this.enterScope(Cs(n,!1)|xs.SCOPE_ARROW),this.initFunction(e);const l=this.maybeInArrowParameters;return this.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.maybeInArrowParameters=!0,e.params=this.toAssignableList(t,!0),this.maybeInArrowParameters=!1,this.parseFunctionBody(e,!0,!1,s),this.yieldPos=r,this.awaitPos=i,this.awaitIdentPos=o,this.maybeInArrowParameters=l,this.finishNode(e,"ArrowFunctionExpression")}parseMaybeAssignOrigin(e,t,n){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}let s=!1,r=-1,i=-1,o=-1;t?(r=t.parenthesizedAssign,i=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new ds,s=!0);let l=this.start,c=this.startLoc;(this.type===a.parenL||g(this.type))&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);let p=this.parseMaybeConditional(e,t);if(n&&(p=n.call(this,p,l,c)),this.type.isAssign){let n=this.startNodeAt(l,c);return n.operator=this.value,this.type===a.eq&&(p=this.toAssignable(p,!0,t)),s||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=p.start&&(t.shorthandAssign=-1),this.maybeInArrowParameters||(this.type===a.eq?this.checkLValPattern(p):this.checkLValSimple(p)),n.left=p,this.next(),n.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(n,"AssignmentExpression")}return s&&this.checkExpressionErrors(t,!0),r>-1&&(t.parenthesizedAssign=r),i>-1&&(t.trailingComma=i),p}parseMaybeAssign(e,t,n){let s,r,a;if(!this.tsMatchLeftRelational())return this.parseMaybeAssignOrigin(e,t,n);s&&!this.compareLookaheadState(s,this.getCurLookaheadState())||(s=this.cloneCurLookaheadState());const i=this.tryParse((s=>{a=this.tsParseTypeParameters(this.tsParseConstModifier);const r=this.parseMaybeAssignOrigin(e,t,n);return("ArrowFunctionExpression"!==r.type||r.extra?.parenthesized)&&s(),0!==a?.params.length&&this.resetStartLocationFromNode(r,a),r.typeParameters=a,r}),s);if(!i.error&&!i.aborted)return a&&this.reportReservedArrowTypeParam(a),i.node;if(gs(!0),r=this.tryParse((()=>this.parseMaybeAssignOrigin(e,t,n)),s),!r.error)return r.node;if(i.node)return this.setLookaheadState(i.failState),a&&this.reportReservedArrowTypeParam(a),i.node;if(r?.node)return this.setLookaheadState(r.failState),r.node;if(i.thrown)throw i.error;if(r?.thrown)throw r.error;throw i.error||r?.error}parseAssignableListItem(e){const t=[];for(;this.match(d.at);)t.push(this.parseDecorator());const n=this.start,s=this.startLoc;let r,a=!1,i=!1;if(void 0!==e){const t={};this.tsParseModifiers({modified:t,allowedModifiers:["public","private","protected","override","readonly"]}),r=t.accessibility,i=t.override,a=t.readonly,!1===e&&(r||a||i)&&this.raise(s.start,fs.UnexpectedParameterModifier)}const o=this.parseMaybeDefault(n,s);this.parseBindingListItem(o);const l=this.parseMaybeDefault(o.start,o.loc,o);if(t.length&&(l.decorators=t),r||a||i){const e=this.startNodeAt(n,s);return r&&(e.accessibility=r),a&&(e.readonly=a),i&&(e.override=i),"Identifier"!==l.type&&"AssignmentPattern"!==l.type&&this.raise(e.start,fs.UnsupportedParameterPropertyKind),e.parameter=l,this.finishNode(e,"TSParameterProperty")}return l}checkLValInnerPattern(e,t=xs.BIND_NONE,n){if("TSParameterProperty"===e.type)this.checkLValInnerPattern(e.parameter,t,n);else super.checkLValInnerPattern(e,t,n)}parseBindingListItem(e){this.eat(a.question)&&("Identifier"===e.type||this.isAmbientContext||this.inType||this.raise(e.start,fs.PatternIsOptional),e.optional=!0);const t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,t);case"TSParameterProperty":case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{const t=e.properties.length-1;return e.properties.every(((e,n)=>"ObjectMethod"!==e.type&&(n===t||"SpreadElement"!==e.type)&&this.isAssignable(e)))}case"Property":case"ObjectProperty":return this.isAssignable(e.value);case"SpreadElement":return this.isAssignable(e.argument);case"ArrayExpression":return e.elements.every((e=>null===e||this.isAssignable(e)));case"AssignmentExpression":return"="===e.operator;case"ParenthesizedExpression":return this.isAssignable(e.expression);case"MemberExpression":case"OptionalMemberExpression":return!t;default:return!1}}toAssignable(e,t=!1,n=new ds){switch(e.type){case"ParenthesizedExpression":return this.toAssignableParenthesizedExpression(e,t,n);case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":return t||this.raise(e.start,fs.UnexpectedTypeCastInParameter),this.toAssignable(e.expression,t,n);case"MemberExpression":break;case"AssignmentExpression":return t||"TSTypeCastExpression"!==e.left.type||(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t,n);case"TSTypeCastExpression":return this.typeCastToParameter(e);default:return super.toAssignable(e,t,n)}return e}toAssignableParenthesizedExpression(e,t,n){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":return this.toAssignable(e.expression,t,n);default:return super.toAssignable(e,t,n)}}parseBindingAtom(){return this.type===a._this?this.parseIdent(!0):super.parseBindingAtom()}shouldParseArrow(e){let t;if(t=this.match(a.colon)?e.every((e=>this.isAssignable(e,!0))):!this.canInsertSemicolon(),t){if(this.match(a.colon)){const e=this.tryParse((e=>{const t=this.tsParseTypeOrTypePredicateAnnotation(a.colon);return!this.canInsertSemicolon()&&this.match(a.arrow)||e(),t}));if(e.aborted)return this.shouldParseArrowReturnType=void 0,!1;e.thrown||(e.error&&this.setLookaheadState(e.failState),this.shouldParseArrowReturnType=e.node)}return!!this.match(a.arrow)||(this.shouldParseArrowReturnType=void 0,!1)}return this.shouldParseArrowReturnType=void 0,t}parseParenArrowList(e,t,n,s){const r=this.startNodeAt(e,t);return r.returnType=this.shouldParseArrowReturnType,this.shouldParseArrowReturnType=void 0,this.parseArrowExpression(r,n,!1,s)}parseParenAndDistinguishExpression(e,t){let n,s=this.start,r=this.startLoc,i=this.ecmaVersion>=8;if(this.ecmaVersion>=6){const o=this.maybeInArrowParameters;this.maybeInArrowParameters=!0,this.next();let l,c=this.start,p=this.startLoc,u=[],d=!0,h=!1,m=new ds,f=this.yieldPos,y=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==a.parenR;){if(d?d=!1:this.expect(a.comma),i&&this.afterTrailingComma(a.parenR,!0)){h=!0;break}if(this.type===a.ellipsis){l=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===a.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}u.push(this.parseMaybeAssign(t,m,this.parseParenItem))}let v=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(a.parenR),this.maybeInArrowParameters=o,e&&this.shouldParseArrow(u)&&this.eat(a.arrow))return this.checkPatternErrors(m,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=y,this.parseParenArrowList(s,r,u,t);u.length&&!h||this.unexpected(this.lastTokStart),l&&this.unexpected(l),this.checkExpressionErrors(m,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=y||this.awaitPos,u.length>1?(n=this.startNodeAt(c,p),n.expressions=u,this.finishNodeAt(n,"SequenceExpression",v,g)):n=u[0]}else n=this.parseParenExpression();if(this.options.preserveParens){let e=this.startNodeAt(s,r);return e.expression=n,this.finishNode(e,"ParenthesizedExpression")}return n}parseTaggedTemplateExpression(e,t,n,s){const r=this.startNodeAt(t,n);return r.tag=e,r.quasi=this.parseTemplate({isTagged:!0}),s&&this.raise(t,"Tagged Template Literals are not allowed in optionalChain."),this.finishNode(r,"TaggedTemplateExpression")}shouldParseAsyncArrow(){if(!this.match(a.colon))return!this.canInsertSemicolon()&&this.eat(a.arrow);{const e=this.tryParse((e=>{const t=this.tsParseTypeOrTypePredicateAnnotation(a.colon);return!this.canInsertSemicolon()&&this.match(a.arrow)||e(),t}));if(e.aborted)return this.shouldParseAsyncArrowReturnType=void 0,!1;if(!e.thrown)return e.error&&this.setLookaheadState(e.failState),this.shouldParseAsyncArrowReturnType=e.node,!this.canInsertSemicolon()&&this.eat(a.arrow)}}parseSubscriptAsyncArrow(e,t,n,s){const r=this.startNodeAt(e,t);return r.returnType=this.shouldParseAsyncArrowReturnType,this.shouldParseAsyncArrowReturnType=void 0,this.parseArrowExpression(r,n,!0,s)}parseExprList(e,t,n,s){let r=[],i=!0;for(;!this.eat(e);){if(i)i=!1;else if(this.expect(a.comma),t&&this.afterTrailingComma(e))break;let o;n&&this.type===a.comma?o=null:this.type===a.ellipsis?(o=this.parseSpread(s),this.maybeInArrowParameters&&this.match(a.colon)&&(o.typeAnnotation=this.tsParseTypeAnnotation()),s&&this.type===a.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):o=this.parseMaybeAssign(!1,s,this.parseParenItem),r.push(o)}return r}parseSubscript(e,t,n,s,r,i,o){let l=i;if(!this.hasPrecedingLineBreak()&&"!"===this.value&&this.match(a.prefix)){this.exprAllowed=!1,this.next();const s=this.startNodeAt(t,n);return s.expression=e,e=this.finishNode(s,"TSNonNullExpression")}let c=!1;if(this.match(a.questionDot)&&60===this.lookaheadCharCode()){if(s)return e;e.optional=!0,l=c=!0,this.next()}if(this.tsMatchLeftRelational()||this.match(a.bitShift)){let r;const i=this.tsTryParseAndCatch((()=>{if(!s&&this.atPossibleAsyncArrow(e)){const s=this.tsTryParseGenericAsyncArrowFunction(t,n,o);if(s)return e=s}const i=this.tsParseTypeArgumentsInExpression();if(!i)return e;if(c&&!this.match(a.parenL))return r=this.curPosition(),e;if(y(this.type)||this.type===a.backQuote){const s=this.parseTaggedTemplateExpression(e,t,n,l);return s.typeArguments=i,s}if(!s&&this.eat(a.parenL)){let s=new ds;const r=this.startNodeAt(t,n);return r.callee=e,r.arguments=this.parseExprList(a.parenR,this.ecmaVersion>=8,!1,s),this.tsCheckForInvalidTypeCasts(r.arguments),r.typeArguments=i,l&&(r.optional=c),this.checkExpressionErrors(s,!0),e=this.finishNode(r,"CallExpression")}const p=this.type;if(this.tsMatchRightRelational()||p===a.bitShift||p!==a.parenL&&Boolean(p.startsExpr)&&!this.hasPrecedingLineBreak())return;const u=this.startNodeAt(t,n);return u.expression=e,u.typeArguments=i,this.finishNode(u,"TSInstantiationExpression")}));if(r&&this.unexpected(r),i)return"TSInstantiationExpression"===i.type&&(this.match(a.dot)||this.match(a.questionDot)&&40!==this.lookaheadCharCode())&&this.raise(this.start,fs.InvalidPropertyAccessAfterInstantiationExpression),e=i}let p=this.ecmaVersion>=11,u=p&&this.eat(a.questionDot);s&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");let d=this.eat(a.bracketL);if(d||u&&this.type!==a.parenL&&this.type!==a.backQuote||this.eat(a.dot)){let s=this.startNodeAt(t,n);s.object=e,d?(s.property=this.parseExpression(),this.expect(a.bracketR)):this.type===a.privateId&&"Super"!==e.type?s.property=this.parsePrivateIdent():s.property=this.parseIdent("never"!==this.options.allowReserved),s.computed=!!d,p&&(s.optional=u),e=this.finishNode(s,"MemberExpression")}else if(!s&&this.eat(a.parenL)){const s=this.maybeInArrowParameters;this.maybeInArrowParameters=!0;let i=new ds,l=this.yieldPos,c=this.awaitPos,d=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;let h=this.parseExprList(a.parenR,this.ecmaVersion>=8,!1,i);if(r&&!u&&this.shouldParseAsyncArrow())this.checkPatternErrors(i,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=l,this.awaitPos=c,this.awaitIdentPos=d,e=this.parseSubscriptAsyncArrow(t,n,h,o);else{this.checkExpressionErrors(i,!0),this.yieldPos=l||this.yieldPos,this.awaitPos=c||this.awaitPos,this.awaitIdentPos=d||this.awaitIdentPos;let s=this.startNodeAt(t,n);s.callee=e,s.arguments=h,p&&(s.optional=u),e=this.finishNode(s,"CallExpression")}this.maybeInArrowParameters=s}else if(this.type===a.backQuote){(u||l)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");let s=this.startNodeAt(t,n);s.tag=e,s.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(s,"TaggedTemplateExpression")}return e}parseGetterSetter(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);let t="get"===e.kind?0:1;const n=e.value.params[0];if(t=n&&this.isThisParam(n)?t+1:t,e.value.params.length!==t){let t=e.value.start;"get"===e.kind?this.raiseRecoverable(t,"getter should have no params"):this.raiseRecoverable(t,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}parseProperty(e,t){if(!e){let n=[];if(this.match(d.at))for(;this.match(d.at);)n.push(this.parseDecorator());const s=super.parseProperty(e,t);return"SpreadElement"===s.type&&n.length&&this.raise(s.start,ys.SpreadElementDecorator),n.length&&(s.decorators=n,n=[]),s}return super.parseProperty(e,t)}parseCatchClauseParam(){const e=this.parseBindingAtom();let t="Identifier"===e.type;this.enterScope(t?xs.SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(e,t?xs.BIND_SIMPLE_CATCH:xs.BIND_LEXICAL);const n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n,this.resetEndLocation(e)),this.expect(a.parenR),e}parseClass(e,t){const n=this.inAbstractClass;this.inAbstractClass=!!e.abstract;try{this.next(),this.takeDecorators(e);const n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);const s=this.enterClassBody(),r=this.startNode();let i=!1;r.body=[];let o=[];for(this.expect(a.braceL);this.type!==a.braceR;){if(this.match(d.at)){o.push(this.parseDecorator());continue}const t=this.parseClassElement(null!==e.superClass);o.length&&(t.decorators=o,this.resetStartLocationFromNode(t,o[0]),o=[]),t&&(r.body.push(t),"MethodDefinition"===t.type&&"constructor"===t.kind&&"FunctionExpression"===t.value.type?(i&&this.raiseRecoverable(t.start,"Duplicate constructor in the same class"),i=!0,t.decorators&&t.decorators.length>0&&this.raise(t.start,ys.DecoratorConstructor)):t.key&&"PrivateIdentifier"===t.key.type&&hs(s,t)&&this.raiseRecoverable(t.key.start,`Identifier '#${t.key.name}' has already been declared`))}return this.strict=n,this.next(),o.length&&this.raise(this.start,ys.TrailingDecorator),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")}finally{this.inAbstractClass=n}}parseClassFunctionParams(){const e=this.tsTryParseTypeParameters();let t=this.parseBindingList(a.parenR,!1,this.ecmaVersion>=8,!0);return e&&(t.typeParameters=e),t}parseMethod(e,t,n,s,r){let i=this.startNode(),o=this.yieldPos,l=this.awaitPos,c=this.awaitIdentPos;if(this.initFunction(i),this.ecmaVersion>=6&&(i.generator=e),this.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Cs(t,i.generator)|xs.SCOPE_SUPER|(n?xs.SCOPE_DIRECT_SUPER:0)),this.expect(a.parenL),i.params=this.parseClassFunctionParams(),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0,!1,{isClassMethod:s}),this.yieldPos=o,this.awaitPos=l,this.awaitIdentPos=c,r&&r.abstract){if(!!i.body){const{key:e}=r;this.raise(r.start,fs.AbstractMethodHasImplementation({methodName:"Identifier"!==e.type||r.computed?`[${this.input.slice(e.start,e.end)}]`:e.name}))}}return this.finishNode(i,"FunctionExpression")}static parse(e,n){if(!1===n.locations)throw new Error("You have to enable options.locations while using acorn-typescript");n.locations=!0;const s=new this(n,e);return t&&(s.isAmbientContext=!0),s.parse()}static parseExpressionAt(e,n,s){if(!1===s.locations)throw new Error("You have to enable options.locations while using acorn-typescript");s.locations=!0;const r=new this(s,e,n);return t&&(r.isAmbientContext=!0),r.nextToken(),r.parseExpression()}parseImportSpecifier(){if(this.ts_isContextual(d.type)){let e=this.startNode();return e.imported=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(e,!0,"type"===this.importOrExportOuterKind),this.finishNode(e,"ImportSpecifier")}{const e=super.parseImportSpecifier();return e.importKind="value",e}}parseExportSpecifier(e){const t=this.ts_isContextual(d.type);if(!this.match(a.string)&&t){let t=this.startNode();return t.local=this.parseModuleExportName(),this.parseTypeOnlyImportExportSpecifier(t,!1,"type"===this.importOrExportOuterKind),this.finishNode(t,"ExportSpecifier"),this.checkExport(e,t.exported,t.exported.start),t}{const t=super.parseExportSpecifier(e);return t.exportKind="value",t}}parseTypeOnlyImportExportSpecifier(e,t,n){const s=t?"imported":"local",r=t?"local":"exported";let a,i=e[s],o=!1,l=!0;const c=i.start;if(this.isContextual("as")){const e=this.parseIdent();if(this.isContextual("as")){const n=this.parseIdent();b(this.type)?(o=!0,i=e,a=t?this.parseIdent():this.parseModuleExportName(),l=!1):(a=n,l=!1)}else b(this.type)?(l=!1,a=t?this.parseIdent():this.parseModuleExportName()):(o=!0,i=e)}else b(this.type)&&(o=!0,t?(i=super.parseIdent(!0),this.isContextual("as")||this.checkUnreserved(i)):i=this.parseModuleExportName());o&&n&&this.raise(c,t?fs.TypeModifierIsUsedInTypeImports:fs.TypeModifierIsUsedInTypeExports),e[s]=i,e[r]=a;e[t?"importKind":"exportKind"]=o?"type":"value",l&&this.eatContextual("as")&&(e[r]=t?this.parseIdent():this.parseModuleExportName()),e[r]||(e[r]=this.copyNode(e[s])),t&&this.checkLValSimple(e[r],xs.BIND_LEXICAL)}raiseCommonCheck(e,t,n){return"Comma is not permitted after the rest element"===t?this.isAmbientContext&&this.match(a.comma)&&41===this.lookaheadCharCode()?void this.next():super.raise(e,t):n?super.raiseRecoverable(e,t):super.raise(e,t)}raiseRecoverable(e,t){return this.raiseCommonCheck(e,t,!0)}raise(e,t){return this.raiseCommonCheck(e,t,!0)}updateContext(e){const{type:t}=this;if(t==a.braceL){var n=this.curContext();n==h.tc_oTag?this.context.push(p.b_expr):n==h.tc_expr?this.context.push(p.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else{if(t!==a.slash||e!==d.jsxTagStart)return super.updateContext(e);this.context.length-=2,this.context.push(h.tc_cTag),this.exprAllowed=!1}}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t),s=this.jsx_parseElementName();if(s&&(n.name=s),this.match(a.relational)||this.match(a.bitShift)){const e=this.tsTryParseAndCatch((()=>this.tsParseTypeArgumentsInExpression()));e&&(n.typeArguments=e)}for(n.attributes=[];this.type!==a.slash&&this.type!==d.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(a.slash),this.expect(d.jsxTagEnd),this.finishNode(n,s?"JSXOpeningElement":"JSXOpeningFragment")}enterScope(e){e===ps&&this.importsStack.push([]),super.enterScope(e);const t=super.currentScope();t.types=[],t.enums=[],t.constEnums=[],t.classes=[],t.exportOnlyBindings=[]}exitScope(){super.currentScope().flags===ps&&this.importsStack.pop(),super.exitScope()}hasImport(e,t){const n=this.importsStack.length;if(this.importsStack[n-1].indexOf(e)>-1)return!0;if(!t&&n>1)for(let t=0;t-1)return!0;return!1}maybeExportDefined(e,t){this.inModule&&e.flags&xs.SCOPE_TOP&&this.undefinedExports.delete(t)}declareName(e,t,n){if(t&xs.BIND_FLAGS_TS_IMPORT)return this.hasImport(e,!0)&&this.raise(n,`Identifier '${e}' has already been declared.`),void this.importsStack[this.importsStack.length-1].push(e);const s=this.currentScope();if(t&xs.BIND_FLAGS_TS_EXPORT_ONLY)return this.maybeExportDefined(s,e),void s.exportOnlyBindings.push(e);t===xs.BIND_TS_TYPE||t===xs.BIND_TS_INTERFACE?(t===xs.BIND_TS_TYPE&&s.types.includes(e)&&this.raise(n,`type '${e}' has already been declared.`),s.types.push(e)):super.declareName(e,t,n),t&xs.BIND_FLAGS_TS_ENUM&&s.enums.push(e),t&xs.BIND_FLAGS_TS_CONST_ENUM&&s.constEnums.push(e),t&xs.BIND_FLAGS_CLASS&&s.classes.push(e)}checkLocalExport(e){const{name:t}=e;if(this.hasImport(t))return;for(let e=this.scopeStack.length-1;e>=0;e--){const n=this.scopeStack[e];if(n.types.indexOf(t)>-1||n.exportOnlyBindings.indexOf(t)>-1)return}super.checkLocalExport(e)}}}}());function Es(e,t,n){const s=t?Ps:Jt,{onComment:r,add_comments:a}=As(e),i=s.prototype.parseStatement;let o;n&&(s.prototype.parseStatement=function(...e){const t=i.call(this,...e);return this.undefinedExports={},t});try{o=s.parse(e,{onComment:r,sourceType:"module",ecmaVersion:13,locations:!0})}finally{n&&(s.prototype.parseStatement=i)}return a(o),o}function Ts(e,t,n){const s=t?Ps:Jt,{onComment:r,add_comments:a}=As(e),i=s.parseExpressionAt(e,n,{onComment:r,sourceType:"module",ecmaVersion:13,locations:!0});return a(i),i}function As(e){const n=[];return{onComment:(t,s,r,a)=>{if(t&&/\n/.test(s)){let t=r;for(;t>0&&"\n"!==e[t-1];)t-=1;let n=t;for(;/[ \t]/.test(e[n]);)n+=1;const a=e.slice(t,n);s=s.replace(new RegExp(`^${a}`,"gm"),"")}n.push({type:t?"Block":"Line",value:s,start:r,end:a})},add_comments(s){0!==n.length&&(t(s,null,{_(t,{next:s,path:r}){let a;for(;n[0]&&n[0].start=s.end)break;(t.trailingComments||=[]).push(e),n.shift(),e.end}else t.end<=n[0].start&&/^[,) \t]*$/.test(r)&&(t.trailingComments=[n.shift()])}}}}),n.length>0&&(n[0].start>=s.end||"Program"===s.type)&&(s.trailingComments||=[]).push(...n.splice(0)))}}}class $s extends Error{message="";#e;constructor(e,t,n){super(t),this.stack="",this.#e=new xe(e,t,n),Object.assign(this,this.#e),this.name="CompileError"}toString(){return this.#e.toString()}toJSON(){return this.#e.toJSON()}}function Is(e,t,n){const s="number"==typeof e?e:e?.start;throw new $s(t,n,void 0!==s?[s,("number"==typeof e?e:e?.end)??s]:void 0)}function Rs(e,t){Is(e,"options_unrecognised",`Unrecognised compiler option ${t}\nhttps://svelte.dev/e/options_unrecognised`)}function qs(e,t){Is(e,"constant_assignment",`Cannot assign to ${t}\nhttps://svelte.dev/e/constant_assignment`)}function Ls(e){Is(e,"declaration_duplicate_module_import","Cannot declare a variable with the same name as an import inside `